@volter/world-console 2.0.11 → 2.0.13

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.
@@ -1,4 +1,4 @@
1
- var Nf=Object.create;var{getPrototypeOf:Cf,defineProperty:WL,getOwnPropertyNames:Sf}=Object;var jf=Object.prototype.hasOwnProperty;function Vf(Q){return this[Q]}var kf,Df,u0=(Q,U,Z)=>{var K=Q!=null&&typeof Q==="object";if(K){var X=U?kf??=new WeakMap:Df??=new WeakMap,W=X.get(Q);if(W)return W}Z=Q!=null?Nf(Cf(Q)):{};let z=U||!Q||!Q.__esModule?WL(Z,"default",{value:Q,enumerable:!0}):Z;for(let B of Sf(Q))if(!jf.call(z,B))WL(z,B,{get:Vf.bind(Q,B),enumerable:!0});if(K)X.set(Q,z);return z};var j4=(Q,U)=>()=>(U||Q((U={exports:{}}).exports,U),U.exports);var i5=j4((yf,eQ)=>{(function(){function Q(S,e){Object.defineProperty(K.prototype,S,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",e[0],e[1])}})}function U(S){if(S===null||typeof S!=="object")return null;return S=l1&&S[l1]||S["@@iterator"],typeof S==="function"?S:null}function Z(S,e){S=(S=S.constructor)&&(S.displayName||S.name)||"ReactClass";var A1=S+"."+e;W1[A1]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",e,S),W1[A1]=!0)}function K(S,e,A1){this.props=S,this.context=e,this.refs=c1,this.updater=A1||S1}function X(){}function W(S,e,A1){this.props=S,this.context=e,this.refs=c1,this.updater=A1||S1}function z(){}function B(S){return""+S}function O(S){try{B(S);var e=!1}catch(P1){e=!0}if(e){e=console;var A1=e.error,R1=typeof Symbol==="function"&&Symbol.toStringTag&&S[Symbol.toStringTag]||S.constructor.name||"Object";return A1.call(e,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",R1),B(S)}}function T(S){if(S==null)return null;if(typeof S==="function")return S.$$typeof===V0?null:S.displayName||S.name||null;if(typeof S==="string")return S;switch(S){case n:return"Fragment";case i:return"Profiler";case j:return"StrictMode";case L1:return"Suspense";case M1:return"SuspenseList";case f1:return"Activity"}if(typeof S==="object")switch(typeof S.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),S.$$typeof){case g:return"Portal";case Q1:return S.displayName||"Context";case q1:return(S._context.displayName||"Context")+".Consumer";case Y1:var e=S.render;return S=S.displayName,S||(S=e.displayName||e.name||"",S=S!==""?"ForwardRef("+S+")":"ForwardRef"),S;case I1:return e=S.displayName||null,e!==null?e:T(S.type)||"Memo";case X1:e=S._payload,S=S._init;try{return T(S(e))}catch(A1){}}return null}function R(S){if(S===n)return"<>";if(typeof S==="object"&&S!==null&&S.$$typeof===X1)return"<...>";try{var e=T(S);return e?"<"+e+">":"<...>"}catch(A1){return"<...>"}}function L(){var S=b1.A;return S===null?null:S.getOwner()}function M(){return Error("react-stack-top-frame")}function I(S){if(Z2.call(S,"key")){var e=Object.getOwnPropertyDescriptor(S,"key").get;if(e&&e.isReactWarning)return!1}return S.key!==void 0}function f(S,e){function A1(){h2||(h2=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",e))}A1.isReactWarning=!0,Object.defineProperty(S,"key",{get:A1,configurable:!0})}function D(){var S=T(this.type);return I2[S]||(I2[S]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),S=this.props.ref,S!==void 0?S:null}function V(S,e,A1,R1,P1,h1){var m1=A1.ref;return S={$$typeof:d,type:S,key:e,props:A1,_owner:R1},(m1!==void 0?m1:null)!==null?Object.defineProperty(S,"ref",{enumerable:!1,get:D}):Object.defineProperty(S,"ref",{enumerable:!1,value:null}),S._store={},Object.defineProperty(S._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(S,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(S,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:P1}),Object.defineProperty(S,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:h1}),Object.freeze&&(Object.freeze(S.props),Object.freeze(S)),S}function k(S,e){return e=V(S.type,e,S.props,S._owner,S._debugStack,S._debugTask),S._store&&(e._store.validated=S._store.validated),e}function h(S){P(S)?S._store&&(S._store.validated=1):typeof S==="object"&&S!==null&&S.$$typeof===X1&&(S._payload.status==="fulfilled"?P(S._payload.value)&&S._payload.value._store&&(S._payload.value._store.validated=1):S._store&&(S._store.validated=1))}function P(S){return typeof S==="object"&&S!==null&&S.$$typeof===d}function C(S){var e={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function(A1){return e[A1]})}function v(S,e){return typeof S==="object"&&S!==null&&S.key!=null?(O(S.key),C(""+S.key)):e.toString(36)}function b(S){switch(S.status){case"fulfilled":return S.value;case"rejected":throw S.reason;default:switch(typeof S.status==="string"?S.then(z,z):(S.status="pending",S.then(function(e){S.status==="pending"&&(S.status="fulfilled",S.value=e)},function(e){S.status==="pending"&&(S.status="rejected",S.reason=e)})),S.status){case"fulfilled":return S.value;case"rejected":throw S.reason}}throw S}function E(S,e,A1,R1,P1){var h1=typeof S;if(h1==="undefined"||h1==="boolean")S=null;var m1=!1;if(S===null)m1=!0;else switch(h1){case"bigint":case"string":case"number":m1=!0;break;case"object":switch(S.$$typeof){case d:case g:m1=!0;break;case X1:return m1=S._init,E(m1(S._payload),e,A1,R1,P1)}}if(m1){m1=S,P1=P1(m1);var U0=R1===""?"."+v(m1,0):R1;return j1(P1)?(A1="",U0!=null&&(A1=U0.replace(A2,"$&/")+"/"),E(P1,e,A1,"",function(J2){return J2})):P1!=null&&(P(P1)&&(P1.key!=null&&(m1&&m1.key===P1.key||O(P1.key)),A1=k(P1,A1+(P1.key==null||m1&&m1.key===P1.key?"":(""+P1.key).replace(A2,"$&/")+"/")+U0),R1!==""&&m1!=null&&P(m1)&&m1.key==null&&m1._store&&!m1._store.validated&&(A1._store.validated=2),P1=A1),e.push(P1)),1}if(m1=0,U0=R1===""?".":R1+":",j1(S))for(var V1=0;V1<S.length;V1++)R1=S[V1],h1=U0+v(R1,V1),m1+=E(R1,e,A1,h1,P1);else if(V1=U(S),typeof V1==="function")for(V1===S.entries&&(B2||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),B2=!0),S=V1.call(S),V1=0;!(R1=S.next()).done;)R1=R1.value,h1=U0+v(R1,V1++),m1+=E(R1,e,A1,h1,P1);else if(h1==="object"){if(typeof S.then==="function")return E(b(S),e,A1,R1,P1);throw e=String(S),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(S).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.")}return m1}function p(S,e,A1){if(S==null)return S;var R1=[],P1=0;return E(S,R1,"","",function(h1){return e.call(A1,h1,P1++)}),R1}function a(S){if(S._status===-1){var e=S._ioInfo;e!=null&&(e.start=e.end=performance.now()),e=S._result;var A1=e();if(A1.then(function(P1){if(S._status===0||S._status===-1){S._status=1,S._result=P1;var h1=S._ioInfo;h1!=null&&(h1.end=performance.now()),A1.status===void 0&&(A1.status="fulfilled",A1.value=P1)}},function(P1){if(S._status===0||S._status===-1){S._status=2,S._result=P1;var h1=S._ioInfo;h1!=null&&(h1.end=performance.now()),A1.status===void 0&&(A1.status="rejected",A1.reason=P1)}}),e=S._ioInfo,e!=null){e.value=A1;var R1=A1.displayName;typeof R1==="string"&&(e.name=R1)}S._status===-1&&(S._status=0,S._result=A1)}if(S._status===1)return e=S._result,e===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
1
+ var Nf=Object.create;var{getPrototypeOf:Cf,defineProperty:WL,getOwnPropertyNames:Sf}=Object;var jf=Object.prototype.hasOwnProperty;function Vf(Q){return this[Q]}var kf,Df,u0=(Q,U,Z)=>{var K=Q!=null&&typeof Q==="object";if(K){var X=U?kf??=new WeakMap:Df??=new WeakMap,W=X.get(Q);if(W)return W}Z=Q!=null?Nf(Cf(Q)):{};let z=U||!Q||!Q.__esModule?WL(Z,"default",{value:Q,enumerable:!0}):Z;for(let B of Sf(Q))if(!jf.call(z,B))WL(z,B,{get:Vf.bind(Q,B),enumerable:!0});if(K)X.set(Q,z);return z};var j4=(Q,U)=>()=>(U||Q((U={exports:{}}).exports,U),U.exports);var i5=j4((yf,eQ)=>{(function(){function Q(S,e){Object.defineProperty(K.prototype,S,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",e[0],e[1])}})}function U(S){if(S===null||typeof S!=="object")return null;return S=l1&&S[l1]||S["@@iterator"],typeof S==="function"?S:null}function Z(S,e){S=(S=S.constructor)&&(S.displayName||S.name)||"ReactClass";var A1=S+"."+e;W1[A1]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",e,S),W1[A1]=!0)}function K(S,e,A1){this.props=S,this.context=e,this.refs=c1,this.updater=A1||S1}function X(){}function W(S,e,A1){this.props=S,this.context=e,this.refs=c1,this.updater=A1||S1}function z(){}function B(S){return""+S}function O(S){try{B(S);var e=!1}catch(P1){e=!0}if(e){e=console;var A1=e.error,R1=typeof Symbol==="function"&&Symbol.toStringTag&&S[Symbol.toStringTag]||S.constructor.name||"Object";return A1.call(e,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",R1),B(S)}}function T(S){if(S==null)return null;if(typeof S==="function")return S.$$typeof===V0?null:S.displayName||S.name||null;if(typeof S==="string")return S;switch(S){case n:return"Fragment";case i:return"Profiler";case j:return"StrictMode";case L1:return"Suspense";case M1:return"SuspenseList";case f1:return"Activity"}if(typeof S==="object")switch(typeof S.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),S.$$typeof){case g:return"Portal";case Q1:return S.displayName||"Context";case q1:return(S._context.displayName||"Context")+".Consumer";case Y1:var e=S.render;return S=S.displayName,S||(S=e.displayName||e.name||"",S=S!==""?"ForwardRef("+S+")":"ForwardRef"),S;case I1:return e=S.displayName||null,e!==null?e:T(S.type)||"Memo";case X1:e=S._payload,S=S._init;try{return T(S(e))}catch(A1){}}return null}function R(S){if(S===n)return"<>";if(typeof S==="object"&&S!==null&&S.$$typeof===X1)return"<...>";try{var e=T(S);return e?"<"+e+">":"<...>"}catch(A1){return"<...>"}}function L(){var S=b1.A;return S===null?null:S.getOwner()}function M(){return Error("react-stack-top-frame")}function f(S){if(Z2.call(S,"key")){var e=Object.getOwnPropertyDescriptor(S,"key").get;if(e&&e.isReactWarning)return!1}return S.key!==void 0}function I(S,e){function A1(){h2||(h2=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",e))}A1.isReactWarning=!0,Object.defineProperty(S,"key",{get:A1,configurable:!0})}function D(){var S=T(this.type);return I2[S]||(I2[S]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),S=this.props.ref,S!==void 0?S:null}function V(S,e,A1,R1,P1,h1){var m1=A1.ref;return S={$$typeof:d,type:S,key:e,props:A1,_owner:R1},(m1!==void 0?m1:null)!==null?Object.defineProperty(S,"ref",{enumerable:!1,get:D}):Object.defineProperty(S,"ref",{enumerable:!1,value:null}),S._store={},Object.defineProperty(S._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(S,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(S,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:P1}),Object.defineProperty(S,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:h1}),Object.freeze&&(Object.freeze(S.props),Object.freeze(S)),S}function k(S,e){return e=V(S.type,e,S.props,S._owner,S._debugStack,S._debugTask),S._store&&(e._store.validated=S._store.validated),e}function h(S){P(S)?S._store&&(S._store.validated=1):typeof S==="object"&&S!==null&&S.$$typeof===X1&&(S._payload.status==="fulfilled"?P(S._payload.value)&&S._payload.value._store&&(S._payload.value._store.validated=1):S._store&&(S._store.validated=1))}function P(S){return typeof S==="object"&&S!==null&&S.$$typeof===d}function C(S){var e={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function(A1){return e[A1]})}function v(S,e){return typeof S==="object"&&S!==null&&S.key!=null?(O(S.key),C(""+S.key)):e.toString(36)}function b(S){switch(S.status){case"fulfilled":return S.value;case"rejected":throw S.reason;default:switch(typeof S.status==="string"?S.then(z,z):(S.status="pending",S.then(function(e){S.status==="pending"&&(S.status="fulfilled",S.value=e)},function(e){S.status==="pending"&&(S.status="rejected",S.reason=e)})),S.status){case"fulfilled":return S.value;case"rejected":throw S.reason}}throw S}function E(S,e,A1,R1,P1){var h1=typeof S;if(h1==="undefined"||h1==="boolean")S=null;var m1=!1;if(S===null)m1=!0;else switch(h1){case"bigint":case"string":case"number":m1=!0;break;case"object":switch(S.$$typeof){case d:case g:m1=!0;break;case X1:return m1=S._init,E(m1(S._payload),e,A1,R1,P1)}}if(m1){m1=S,P1=P1(m1);var U0=R1===""?"."+v(m1,0):R1;return j1(P1)?(A1="",U0!=null&&(A1=U0.replace(A2,"$&/")+"/"),E(P1,e,A1,"",function(J2){return J2})):P1!=null&&(P(P1)&&(P1.key!=null&&(m1&&m1.key===P1.key||O(P1.key)),A1=k(P1,A1+(P1.key==null||m1&&m1.key===P1.key?"":(""+P1.key).replace(A2,"$&/")+"/")+U0),R1!==""&&m1!=null&&P(m1)&&m1.key==null&&m1._store&&!m1._store.validated&&(A1._store.validated=2),P1=A1),e.push(P1)),1}if(m1=0,U0=R1===""?".":R1+":",j1(S))for(var V1=0;V1<S.length;V1++)R1=S[V1],h1=U0+v(R1,V1),m1+=E(R1,e,A1,h1,P1);else if(V1=U(S),typeof V1==="function")for(V1===S.entries&&(B2||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),B2=!0),S=V1.call(S),V1=0;!(R1=S.next()).done;)R1=R1.value,h1=U0+v(R1,V1++),m1+=E(R1,e,A1,h1,P1);else if(h1==="object"){if(typeof S.then==="function")return E(b(S),e,A1,R1,P1);throw e=String(S),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(S).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.")}return m1}function p(S,e,A1){if(S==null)return S;var R1=[],P1=0;return E(S,R1,"","",function(h1){return e.call(A1,h1,P1++)}),R1}function a(S){if(S._status===-1){var e=S._ioInfo;e!=null&&(e.start=e.end=performance.now()),e=S._result;var A1=e();if(A1.then(function(P1){if(S._status===0||S._status===-1){S._status=1,S._result=P1;var h1=S._ioInfo;h1!=null&&(h1.end=performance.now()),A1.status===void 0&&(A1.status="fulfilled",A1.value=P1)}},function(P1){if(S._status===0||S._status===-1){S._status=2,S._result=P1;var h1=S._ioInfo;h1!=null&&(h1.end=performance.now()),A1.status===void 0&&(A1.status="rejected",A1.reason=P1)}}),e=S._ioInfo,e!=null){e.value=A1;var R1=A1.displayName;typeof R1==="string"&&(e.name=R1)}S._status===-1&&(S._status=0,S._result=A1)}if(S._status===1)return e=S._result,e===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
2
2
 
3
3
  Your code should look like:
4
4
  const MyComponent = lazy(() => import('./MyComponent'))
@@ -10,21 +10,21 @@ Your code should look like:
10
10
  1. You might have mismatching versions of React and the renderer (such as React DOM)
11
11
  2. You might be breaking the Rules of Hooks
12
12
  3. You might have more than one copy of React in the same app
13
- See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),S}function _1(){b1.asyncTransitions--}function $1(S){if(v5===null)try{var e=("require"+Math.random()).slice(0,7);v5=(eQ&&eQ[e]).call(eQ,"timers").setImmediate}catch(A1){v5=function(R1){M3===!1&&(M3=!0,typeof MessageChannel>"u"&&console.error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var P1=new MessageChannel;P1.port1.onmessage=R1,P1.port2.postMessage(void 0)}}return v5(S)}function J1(S){return 1<S.length&&typeof AggregateError==="function"?AggregateError(S):S[0]}function y(S,e){e!==b4-1&&console.error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),b4=e}function u(S,e,A1){var R1=b1.actQueue;if(R1!==null)if(R1.length!==0)try{x(R1),$1(function(){return u(S,e,A1)});return}catch(P1){b1.thrownErrors.push(P1)}else b1.actQueue=null;0<b1.thrownErrors.length?(R1=J1(b1.thrownErrors),b1.thrownErrors.length=0,A1(R1)):e(S)}function x(S){if(!x4){x4=!0;var e=0;try{for(;e<S.length;e++){var A1=S[e];do{b1.didUsePromise=!1;var R1=A1(!1);if(R1!==null){if(b1.didUsePromise){S[e]=A1,S.splice(0,e);return}A1=R1}else break}while(1)}S.length=0}catch(P1){S.splice(0,e+1),b1.thrownErrors.push(P1)}finally{x4=!1}}}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var d=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),q1=Symbol.for("react.consumer"),Q1=Symbol.for("react.context"),Y1=Symbol.for("react.forward_ref"),L1=Symbol.for("react.suspense"),M1=Symbol.for("react.suspense_list"),I1=Symbol.for("react.memo"),X1=Symbol.for("react.lazy"),f1=Symbol.for("react.activity"),l1=Symbol.iterator,W1={},S1={isMounted:function(){return!1},enqueueForceUpdate:function(S){Z(S,"forceUpdate")},enqueueReplaceState:function(S){Z(S,"replaceState")},enqueueSetState:function(S){Z(S,"setState")}},v1=Object.assign,c1={};Object.freeze(c1),K.prototype.isReactComponent={},K.prototype.setState=function(S,e){if(typeof S!=="object"&&typeof S!=="function"&&S!=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,S,e,"setState")},K.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};var E1={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]};for(e5 in E1)E1.hasOwnProperty(e5)&&Q(e5,E1[e5]);X.prototype=K.prototype,E1=W.prototype=new X,E1.constructor=W,v1(E1,K.prototype),E1.isPureReactComponent=!0;var j1=Array.isArray,V0=Symbol.for("react.client.reference"),b1={H:null,A:null,T:null,S:null,actQueue:null,asyncTransitions:0,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1,didUsePromise:!1,thrownErrors:[],getCurrentStack:null,recentlyCreatedOwnerStacks:0},Z2=Object.prototype.hasOwnProperty,_0=console.createTask?console.createTask:function(){return null};E1={react_stack_bottom_frame:function(S){return S()}};var h2,z2,I2={},f2=E1.react_stack_bottom_frame.bind(E1,M)(),P2=_0(R(M)),B2=!1,A2=/\/+/g,L2=typeof reportError==="function"?reportError:function(S){if(typeof window==="object"&&typeof window.ErrorEvent==="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof S==="object"&&S!==null&&typeof S.message==="string"?String(S.message):String(S),error:S});if(!window.dispatchEvent(e))return}else if(typeof process==="object"&&typeof process.emit==="function"){process.emit("uncaughtException",S);return}console.error(S)},M3=!1,v5=null,b4=0,u4=!1,x4=!1,I6=typeof queueMicrotask==="function"?function(S){queueMicrotask(function(){return queueMicrotask(S)})}:$1;E1=Object.freeze({__proto__:null,c:function(S){return m().useMemoCache(S)}});var e5={map:p,forEach:function(S,e,A1){p(S,function(){e.apply(this,arguments)},A1)},count:function(S){var e=0;return p(S,function(){e++}),e},toArray:function(S){return p(S,function(e){return e})||[]},only:function(S){if(!P(S))throw Error("React.Children.only expected to receive a single React element child.");return S}};yf.Activity=f1,yf.Children=e5,yf.Component=K,yf.Fragment=n,yf.Profiler=i,yf.PureComponent=W,yf.StrictMode=j,yf.Suspense=L1,yf.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=b1,yf.__COMPILER_RUNTIME=E1,yf.act=function(S){var e=b1.actQueue,A1=b4;b4++;var R1=b1.actQueue=e!==null?e:[],P1=!1;try{var h1=S()}catch(V1){b1.thrownErrors.push(V1)}if(0<b1.thrownErrors.length)throw y(e,A1),S=J1(b1.thrownErrors),b1.thrownErrors.length=0,S;if(h1!==null&&typeof h1==="object"&&typeof h1.then==="function"){var m1=h1;return I6(function(){P1||u4||(u4=!0,console.error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),{then:function(V1,J2){P1=!0,m1.then(function(N2){if(y(e,A1),A1===0){try{x(R1),$1(function(){return u(N2,V1,J2)})}catch(f6){b1.thrownErrors.push(f6)}if(0<b1.thrownErrors.length){var _4=J1(b1.thrownErrors);b1.thrownErrors.length=0,J2(_4)}}else V1(N2)},function(N2){y(e,A1),0<b1.thrownErrors.length?(N2=J1(b1.thrownErrors),b1.thrownErrors.length=0,J2(N2)):J2(N2)})}}}var U0=h1;if(y(e,A1),A1===0&&(x(R1),R1.length!==0&&I6(function(){P1||u4||(u4=!0,console.error("A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"))}),b1.actQueue=null),0<b1.thrownErrors.length)throw S=J1(b1.thrownErrors),b1.thrownErrors.length=0,S;return{then:function(V1,J2){P1=!0,A1===0?(b1.actQueue=R1,$1(function(){return u(U0,V1,J2)})):V1(U0)}}},yf.cache=function(S){return function(){return S.apply(null,arguments)}},yf.cacheSignal=function(){return null},yf.captureOwnerStack=function(){var S=b1.getCurrentStack;return S===null?null:S()},yf.cloneElement=function(S,e,A1){if(S===null||S===void 0)throw Error("The argument must be a React element, but you passed "+S+".");var R1=v1({},S.props),P1=S.key,h1=S._owner;if(e!=null){var m1;_:{if(Z2.call(e,"ref")&&(m1=Object.getOwnPropertyDescriptor(e,"ref").get)&&m1.isReactWarning){m1=!1;break _}m1=e.ref!==void 0}m1&&(h1=L()),I(e)&&(O(e.key),P1=""+e.key);for(U0 in e)!Z2.call(e,U0)||U0==="key"||U0==="__self"||U0==="__source"||U0==="ref"&&e.ref===void 0||(R1[U0]=e[U0])}var U0=arguments.length-2;if(U0===1)R1.children=A1;else if(1<U0){m1=Array(U0);for(var V1=0;V1<U0;V1++)m1[V1]=arguments[V1+2];R1.children=m1}R1=V(S.type,P1,R1,h1,S._debugStack,S._debugTask);for(P1=2;P1<arguments.length;P1++)h(arguments[P1]);return R1},yf.createContext=function(S){return S={$$typeof:Q1,_currentValue:S,_currentValue2:S,_threadCount:0,Provider:null,Consumer:null},S.Provider=S,S.Consumer={$$typeof:q1,_context:S},S._currentRenderer=null,S._currentRenderer2=null,S},yf.createElement=function(S,e,A1){for(var R1=2;R1<arguments.length;R1++)h(arguments[R1]);R1={};var P1=null;if(e!=null)for(V1 in z2||!("__self"in e)||"key"in e||(z2=!0,console.warn("Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform")),I(e)&&(O(e.key),P1=""+e.key),e)Z2.call(e,V1)&&V1!=="key"&&V1!=="__self"&&V1!=="__source"&&(R1[V1]=e[V1]);var h1=arguments.length-2;if(h1===1)R1.children=A1;else if(1<h1){for(var m1=Array(h1),U0=0;U0<h1;U0++)m1[U0]=arguments[U0+2];Object.freeze&&Object.freeze(m1),R1.children=m1}if(S&&S.defaultProps)for(V1 in h1=S.defaultProps,h1)R1[V1]===void 0&&(R1[V1]=h1[V1]);P1&&f(R1,typeof S==="function"?S.displayName||S.name||"Unknown":S);var V1=1e4>b1.recentlyCreatedOwnerStacks++;return V(S,P1,R1,L(),V1?Error("react-stack-top-frame"):f2,V1?_0(R(S)):P2)},yf.createRef=function(){var S={current:null};return Object.seal(S),S},yf.forwardRef=function(S){S!=null&&S.$$typeof===I1?console.error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof S!=="function"?console.error("forwardRef requires a render function but was given %s.",S===null?"null":typeof S):S.length!==0&&S.length!==2&&console.error("forwardRef render functions accept exactly two parameters: props and ref. %s",S.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),S!=null&&S.defaultProps!=null&&console.error("forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?");var e={$$typeof:Y1,render:S},A1;return Object.defineProperty(e,"displayName",{enumerable:!1,configurable:!0,get:function(){return A1},set:function(R1){A1=R1,S.name||S.displayName||(Object.defineProperty(S,"name",{value:R1}),S.displayName=R1)}}),e},yf.isValidElement=P,yf.lazy=function(S){S={_status:-1,_result:S};var e={$$typeof:X1,_payload:S,_init:a},A1={name:"lazy",start:-1,end:-1,value:null,owner:null,debugStack:Error("react-stack-top-frame"),debugTask:console.createTask?console.createTask("lazy()"):null};return S._ioInfo=A1,e._debugInfo=[{awaited:A1}],e},yf.memo=function(S,e){S==null&&console.error("memo: The first argument must be a component. Instead received: %s",S===null?"null":typeof S),e={$$typeof:I1,type:S,compare:e===void 0?null:e};var A1;return Object.defineProperty(e,"displayName",{enumerable:!1,configurable:!0,get:function(){return A1},set:function(R1){A1=R1,S.name||S.displayName||(Object.defineProperty(S,"name",{value:R1}),S.displayName=R1)}}),e},yf.startTransition=function(S){var e=b1.T,A1={};A1._updatedFibers=new Set,b1.T=A1;try{var R1=S(),P1=b1.S;P1!==null&&P1(A1,R1),typeof R1==="object"&&R1!==null&&typeof R1.then==="function"&&(b1.asyncTransitions++,R1.then(_1,_1),R1.then(z,L2))}catch(h1){L2(h1)}finally{e===null&&A1._updatedFibers&&(S=A1._updatedFibers.size,A1._updatedFibers.clear(),10<S&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.")),e!==null&&A1.types!==null&&(e.types!==null&&e.types!==A1.types&&console.error("We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."),e.types=A1.types),b1.T=e}},yf.unstable_useCacheRefresh=function(){return m().useCacheRefresh()},yf.use=function(S){return m().use(S)},yf.useActionState=function(S,e,A1){return m().useActionState(S,e,A1)},yf.useCallback=function(S,e){return m().useCallback(S,e)},yf.useContext=function(S){var e=m();return S.$$typeof===q1&&console.error("Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"),e.useContext(S)},yf.useDebugValue=function(S,e){return m().useDebugValue(S,e)},yf.useDeferredValue=function(S,e){return m().useDeferredValue(S,e)},yf.useEffect=function(S,e){return S==null&&console.warn("React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"),m().useEffect(S,e)},yf.useEffectEvent=function(S){return m().useEffectEvent(S)},yf.useId=function(){return m().useId()},yf.useImperativeHandle=function(S,e,A1){return m().useImperativeHandle(S,e,A1)},yf.useInsertionEffect=function(S,e){return S==null&&console.warn("React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"),m().useInsertionEffect(S,e)},yf.useLayoutEffect=function(S,e){return S==null&&console.warn("React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"),m().useLayoutEffect(S,e)},yf.useMemo=function(S,e){return m().useMemo(S,e)},yf.useOptimistic=function(S,e){return m().useOptimistic(S,e)},yf.useReducer=function(S,e,A1){return m().useReducer(S,e,A1)},yf.useRef=function(S){return m().useRef(S)},yf.useState=function(S){return m().useState(S)},yf.useSyncExternalStore=function(S,e,A1){return m().useSyncExternalStore(S,e,A1)},yf.useTransition=function(){return m().useTransition()},yf.version="19.2.7",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var zL=j4((vf)=>{var X8=u0(i5());(function(){function Q(j){if(j==null)return null;if(typeof j==="function")return j.$$typeof===m?null:j.displayName||j.name||null;if(typeof j==="string")return j;switch(j){case D:return"Fragment";case k:return"Profiler";case V:return"StrictMode";case v:return"Suspense";case b:return"SuspenseList";case a:return"Activity"}if(typeof j==="object")switch(typeof j.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),j.$$typeof){case f:return"Portal";case P:return j.displayName||"Context";case h:return(j._context.displayName||"Context")+".Consumer";case C:var i=j.render;return j=j.displayName,j||(j=i.displayName||i.name||"",j=j!==""?"ForwardRef("+j+")":"ForwardRef"),j;case E:return i=j.displayName||null,i!==null?i:Q(j.type)||"Memo";case p:i=j._payload,j=j._init;try{return Q(j(i))}catch(q1){}}return null}function U(j){return""+j}function Z(j){try{U(j);var i=!1}catch(Y1){i=!0}if(i){i=console;var q1=i.error,Q1=typeof Symbol==="function"&&Symbol.toStringTag&&j[Symbol.toStringTag]||j.constructor.name||"Object";return q1.call(i,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",Q1),U(j)}}function K(j){if(j===D)return"<>";if(typeof j==="object"&&j!==null&&j.$$typeof===p)return"<...>";try{var i=Q(j);return i?"<"+i+">":"<...>"}catch(q1){return"<...>"}}function X(){var j=_1.A;return j===null?null:j.getOwner()}function W(){return Error("react-stack-top-frame")}function z(j){if($1.call(j,"key")){var i=Object.getOwnPropertyDescriptor(j,"key").get;if(i&&i.isReactWarning)return!1}return j.key!==void 0}function B(j,i){function q1(){u||(u=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",i))}q1.isReactWarning=!0,Object.defineProperty(j,"key",{get:q1,configurable:!0})}function O(){var j=Q(this.type);return x[j]||(x[j]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),j=this.props.ref,j!==void 0?j:null}function T(j,i,q1,Q1,Y1,L1){var M1=q1.ref;return j={$$typeof:I,type:j,key:i,props:q1,_owner:Q1},(M1!==void 0?M1:null)!==null?Object.defineProperty(j,"ref",{enumerable:!1,get:O}):Object.defineProperty(j,"ref",{enumerable:!1,value:null}),j._store={},Object.defineProperty(j._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(j,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(j,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Y1}),Object.defineProperty(j,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:L1}),Object.freeze&&(Object.freeze(j.props),Object.freeze(j)),j}function R(j,i,q1,Q1,Y1,L1){var M1=i.children;if(M1!==void 0)if(Q1)if(J1(M1)){for(Q1=0;Q1<M1.length;Q1++)L(M1[Q1]);Object.freeze&&Object.freeze(M1)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else L(M1);if($1.call(i,"key")){M1=Q(j);var I1=Object.keys(i).filter(function(f1){return f1!=="key"});Q1=0<I1.length?"{key: someKey, "+I1.join(": ..., ")+": ...}":"{key: someKey}",n[M1+Q1]||(I1=0<I1.length?"{"+I1.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
13
+ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),S}function _1(){b1.asyncTransitions--}function $1(S){if(v5===null)try{var e=("require"+Math.random()).slice(0,7);v5=(eQ&&eQ[e]).call(eQ,"timers").setImmediate}catch(A1){v5=function(R1){M3===!1&&(M3=!0,typeof MessageChannel>"u"&&console.error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var P1=new MessageChannel;P1.port1.onmessage=R1,P1.port2.postMessage(void 0)}}return v5(S)}function J1(S){return 1<S.length&&typeof AggregateError==="function"?AggregateError(S):S[0]}function y(S,e){e!==b4-1&&console.error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),b4=e}function u(S,e,A1){var R1=b1.actQueue;if(R1!==null)if(R1.length!==0)try{x(R1),$1(function(){return u(S,e,A1)});return}catch(P1){b1.thrownErrors.push(P1)}else b1.actQueue=null;0<b1.thrownErrors.length?(R1=J1(b1.thrownErrors),b1.thrownErrors.length=0,A1(R1)):e(S)}function x(S){if(!x4){x4=!0;var e=0;try{for(;e<S.length;e++){var A1=S[e];do{b1.didUsePromise=!1;var R1=A1(!1);if(R1!==null){if(b1.didUsePromise){S[e]=A1,S.splice(0,e);return}A1=R1}else break}while(1)}S.length=0}catch(P1){S.splice(0,e+1),b1.thrownErrors.push(P1)}finally{x4=!1}}}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var d=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),q1=Symbol.for("react.consumer"),Q1=Symbol.for("react.context"),Y1=Symbol.for("react.forward_ref"),L1=Symbol.for("react.suspense"),M1=Symbol.for("react.suspense_list"),I1=Symbol.for("react.memo"),X1=Symbol.for("react.lazy"),f1=Symbol.for("react.activity"),l1=Symbol.iterator,W1={},S1={isMounted:function(){return!1},enqueueForceUpdate:function(S){Z(S,"forceUpdate")},enqueueReplaceState:function(S){Z(S,"replaceState")},enqueueSetState:function(S){Z(S,"setState")}},v1=Object.assign,c1={};Object.freeze(c1),K.prototype.isReactComponent={},K.prototype.setState=function(S,e){if(typeof S!=="object"&&typeof S!=="function"&&S!=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,S,e,"setState")},K.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};var E1={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]};for(e5 in E1)E1.hasOwnProperty(e5)&&Q(e5,E1[e5]);X.prototype=K.prototype,E1=W.prototype=new X,E1.constructor=W,v1(E1,K.prototype),E1.isPureReactComponent=!0;var j1=Array.isArray,V0=Symbol.for("react.client.reference"),b1={H:null,A:null,T:null,S:null,actQueue:null,asyncTransitions:0,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1,didUsePromise:!1,thrownErrors:[],getCurrentStack:null,recentlyCreatedOwnerStacks:0},Z2=Object.prototype.hasOwnProperty,_0=console.createTask?console.createTask:function(){return null};E1={react_stack_bottom_frame:function(S){return S()}};var h2,z2,I2={},f2=E1.react_stack_bottom_frame.bind(E1,M)(),P2=_0(R(M)),B2=!1,A2=/\/+/g,L2=typeof reportError==="function"?reportError:function(S){if(typeof window==="object"&&typeof window.ErrorEvent==="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof S==="object"&&S!==null&&typeof S.message==="string"?String(S.message):String(S),error:S});if(!window.dispatchEvent(e))return}else if(typeof process==="object"&&typeof process.emit==="function"){process.emit("uncaughtException",S);return}console.error(S)},M3=!1,v5=null,b4=0,u4=!1,x4=!1,I6=typeof queueMicrotask==="function"?function(S){queueMicrotask(function(){return queueMicrotask(S)})}:$1;E1=Object.freeze({__proto__:null,c:function(S){return m().useMemoCache(S)}});var e5={map:p,forEach:function(S,e,A1){p(S,function(){e.apply(this,arguments)},A1)},count:function(S){var e=0;return p(S,function(){e++}),e},toArray:function(S){return p(S,function(e){return e})||[]},only:function(S){if(!P(S))throw Error("React.Children.only expected to receive a single React element child.");return S}};yf.Activity=f1,yf.Children=e5,yf.Component=K,yf.Fragment=n,yf.Profiler=i,yf.PureComponent=W,yf.StrictMode=j,yf.Suspense=L1,yf.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=b1,yf.__COMPILER_RUNTIME=E1,yf.act=function(S){var e=b1.actQueue,A1=b4;b4++;var R1=b1.actQueue=e!==null?e:[],P1=!1;try{var h1=S()}catch(V1){b1.thrownErrors.push(V1)}if(0<b1.thrownErrors.length)throw y(e,A1),S=J1(b1.thrownErrors),b1.thrownErrors.length=0,S;if(h1!==null&&typeof h1==="object"&&typeof h1.then==="function"){var m1=h1;return I6(function(){P1||u4||(u4=!0,console.error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),{then:function(V1,J2){P1=!0,m1.then(function(N2){if(y(e,A1),A1===0){try{x(R1),$1(function(){return u(N2,V1,J2)})}catch(f6){b1.thrownErrors.push(f6)}if(0<b1.thrownErrors.length){var _4=J1(b1.thrownErrors);b1.thrownErrors.length=0,J2(_4)}}else V1(N2)},function(N2){y(e,A1),0<b1.thrownErrors.length?(N2=J1(b1.thrownErrors),b1.thrownErrors.length=0,J2(N2)):J2(N2)})}}}var U0=h1;if(y(e,A1),A1===0&&(x(R1),R1.length!==0&&I6(function(){P1||u4||(u4=!0,console.error("A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"))}),b1.actQueue=null),0<b1.thrownErrors.length)throw S=J1(b1.thrownErrors),b1.thrownErrors.length=0,S;return{then:function(V1,J2){P1=!0,A1===0?(b1.actQueue=R1,$1(function(){return u(U0,V1,J2)})):V1(U0)}}},yf.cache=function(S){return function(){return S.apply(null,arguments)}},yf.cacheSignal=function(){return null},yf.captureOwnerStack=function(){var S=b1.getCurrentStack;return S===null?null:S()},yf.cloneElement=function(S,e,A1){if(S===null||S===void 0)throw Error("The argument must be a React element, but you passed "+S+".");var R1=v1({},S.props),P1=S.key,h1=S._owner;if(e!=null){var m1;_:{if(Z2.call(e,"ref")&&(m1=Object.getOwnPropertyDescriptor(e,"ref").get)&&m1.isReactWarning){m1=!1;break _}m1=e.ref!==void 0}m1&&(h1=L()),f(e)&&(O(e.key),P1=""+e.key);for(U0 in e)!Z2.call(e,U0)||U0==="key"||U0==="__self"||U0==="__source"||U0==="ref"&&e.ref===void 0||(R1[U0]=e[U0])}var U0=arguments.length-2;if(U0===1)R1.children=A1;else if(1<U0){m1=Array(U0);for(var V1=0;V1<U0;V1++)m1[V1]=arguments[V1+2];R1.children=m1}R1=V(S.type,P1,R1,h1,S._debugStack,S._debugTask);for(P1=2;P1<arguments.length;P1++)h(arguments[P1]);return R1},yf.createContext=function(S){return S={$$typeof:Q1,_currentValue:S,_currentValue2:S,_threadCount:0,Provider:null,Consumer:null},S.Provider=S,S.Consumer={$$typeof:q1,_context:S},S._currentRenderer=null,S._currentRenderer2=null,S},yf.createElement=function(S,e,A1){for(var R1=2;R1<arguments.length;R1++)h(arguments[R1]);R1={};var P1=null;if(e!=null)for(V1 in z2||!("__self"in e)||"key"in e||(z2=!0,console.warn("Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform")),f(e)&&(O(e.key),P1=""+e.key),e)Z2.call(e,V1)&&V1!=="key"&&V1!=="__self"&&V1!=="__source"&&(R1[V1]=e[V1]);var h1=arguments.length-2;if(h1===1)R1.children=A1;else if(1<h1){for(var m1=Array(h1),U0=0;U0<h1;U0++)m1[U0]=arguments[U0+2];Object.freeze&&Object.freeze(m1),R1.children=m1}if(S&&S.defaultProps)for(V1 in h1=S.defaultProps,h1)R1[V1]===void 0&&(R1[V1]=h1[V1]);P1&&I(R1,typeof S==="function"?S.displayName||S.name||"Unknown":S);var V1=1e4>b1.recentlyCreatedOwnerStacks++;return V(S,P1,R1,L(),V1?Error("react-stack-top-frame"):f2,V1?_0(R(S)):P2)},yf.createRef=function(){var S={current:null};return Object.seal(S),S},yf.forwardRef=function(S){S!=null&&S.$$typeof===I1?console.error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof S!=="function"?console.error("forwardRef requires a render function but was given %s.",S===null?"null":typeof S):S.length!==0&&S.length!==2&&console.error("forwardRef render functions accept exactly two parameters: props and ref. %s",S.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),S!=null&&S.defaultProps!=null&&console.error("forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?");var e={$$typeof:Y1,render:S},A1;return Object.defineProperty(e,"displayName",{enumerable:!1,configurable:!0,get:function(){return A1},set:function(R1){A1=R1,S.name||S.displayName||(Object.defineProperty(S,"name",{value:R1}),S.displayName=R1)}}),e},yf.isValidElement=P,yf.lazy=function(S){S={_status:-1,_result:S};var e={$$typeof:X1,_payload:S,_init:a},A1={name:"lazy",start:-1,end:-1,value:null,owner:null,debugStack:Error("react-stack-top-frame"),debugTask:console.createTask?console.createTask("lazy()"):null};return S._ioInfo=A1,e._debugInfo=[{awaited:A1}],e},yf.memo=function(S,e){S==null&&console.error("memo: The first argument must be a component. Instead received: %s",S===null?"null":typeof S),e={$$typeof:I1,type:S,compare:e===void 0?null:e};var A1;return Object.defineProperty(e,"displayName",{enumerable:!1,configurable:!0,get:function(){return A1},set:function(R1){A1=R1,S.name||S.displayName||(Object.defineProperty(S,"name",{value:R1}),S.displayName=R1)}}),e},yf.startTransition=function(S){var e=b1.T,A1={};A1._updatedFibers=new Set,b1.T=A1;try{var R1=S(),P1=b1.S;P1!==null&&P1(A1,R1),typeof R1==="object"&&R1!==null&&typeof R1.then==="function"&&(b1.asyncTransitions++,R1.then(_1,_1),R1.then(z,L2))}catch(h1){L2(h1)}finally{e===null&&A1._updatedFibers&&(S=A1._updatedFibers.size,A1._updatedFibers.clear(),10<S&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.")),e!==null&&A1.types!==null&&(e.types!==null&&e.types!==A1.types&&console.error("We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."),e.types=A1.types),b1.T=e}},yf.unstable_useCacheRefresh=function(){return m().useCacheRefresh()},yf.use=function(S){return m().use(S)},yf.useActionState=function(S,e,A1){return m().useActionState(S,e,A1)},yf.useCallback=function(S,e){return m().useCallback(S,e)},yf.useContext=function(S){var e=m();return S.$$typeof===q1&&console.error("Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"),e.useContext(S)},yf.useDebugValue=function(S,e){return m().useDebugValue(S,e)},yf.useDeferredValue=function(S,e){return m().useDeferredValue(S,e)},yf.useEffect=function(S,e){return S==null&&console.warn("React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"),m().useEffect(S,e)},yf.useEffectEvent=function(S){return m().useEffectEvent(S)},yf.useId=function(){return m().useId()},yf.useImperativeHandle=function(S,e,A1){return m().useImperativeHandle(S,e,A1)},yf.useInsertionEffect=function(S,e){return S==null&&console.warn("React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"),m().useInsertionEffect(S,e)},yf.useLayoutEffect=function(S,e){return S==null&&console.warn("React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"),m().useLayoutEffect(S,e)},yf.useMemo=function(S,e){return m().useMemo(S,e)},yf.useOptimistic=function(S,e){return m().useOptimistic(S,e)},yf.useReducer=function(S,e,A1){return m().useReducer(S,e,A1)},yf.useRef=function(S){return m().useRef(S)},yf.useState=function(S){return m().useState(S)},yf.useSyncExternalStore=function(S,e,A1){return m().useSyncExternalStore(S,e,A1)},yf.useTransition=function(){return m().useTransition()},yf.version="19.2.7",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var zL=j4((vf)=>{var X8=u0(i5());(function(){function Q(j){if(j==null)return null;if(typeof j==="function")return j.$$typeof===m?null:j.displayName||j.name||null;if(typeof j==="string")return j;switch(j){case D:return"Fragment";case k:return"Profiler";case V:return"StrictMode";case v:return"Suspense";case b:return"SuspenseList";case a:return"Activity"}if(typeof j==="object")switch(typeof j.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),j.$$typeof){case I:return"Portal";case P:return j.displayName||"Context";case h:return(j._context.displayName||"Context")+".Consumer";case C:var i=j.render;return j=j.displayName,j||(j=i.displayName||i.name||"",j=j!==""?"ForwardRef("+j+")":"ForwardRef"),j;case E:return i=j.displayName||null,i!==null?i:Q(j.type)||"Memo";case p:i=j._payload,j=j._init;try{return Q(j(i))}catch(q1){}}return null}function U(j){return""+j}function Z(j){try{U(j);var i=!1}catch(Y1){i=!0}if(i){i=console;var q1=i.error,Q1=typeof Symbol==="function"&&Symbol.toStringTag&&j[Symbol.toStringTag]||j.constructor.name||"Object";return q1.call(i,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",Q1),U(j)}}function K(j){if(j===D)return"<>";if(typeof j==="object"&&j!==null&&j.$$typeof===p)return"<...>";try{var i=Q(j);return i?"<"+i+">":"<...>"}catch(q1){return"<...>"}}function X(){var j=_1.A;return j===null?null:j.getOwner()}function W(){return Error("react-stack-top-frame")}function z(j){if($1.call(j,"key")){var i=Object.getOwnPropertyDescriptor(j,"key").get;if(i&&i.isReactWarning)return!1}return j.key!==void 0}function B(j,i){function q1(){u||(u=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",i))}q1.isReactWarning=!0,Object.defineProperty(j,"key",{get:q1,configurable:!0})}function O(){var j=Q(this.type);return x[j]||(x[j]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),j=this.props.ref,j!==void 0?j:null}function T(j,i,q1,Q1,Y1,L1){var M1=q1.ref;return j={$$typeof:f,type:j,key:i,props:q1,_owner:Q1},(M1!==void 0?M1:null)!==null?Object.defineProperty(j,"ref",{enumerable:!1,get:O}):Object.defineProperty(j,"ref",{enumerable:!1,value:null}),j._store={},Object.defineProperty(j._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(j,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(j,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Y1}),Object.defineProperty(j,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:L1}),Object.freeze&&(Object.freeze(j.props),Object.freeze(j)),j}function R(j,i,q1,Q1,Y1,L1){var M1=i.children;if(M1!==void 0)if(Q1)if(J1(M1)){for(Q1=0;Q1<M1.length;Q1++)L(M1[Q1]);Object.freeze&&Object.freeze(M1)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else L(M1);if($1.call(i,"key")){M1=Q(j);var I1=Object.keys(i).filter(function(f1){return f1!=="key"});Q1=0<I1.length?"{key: someKey, "+I1.join(": ..., ")+": ...}":"{key: someKey}",n[M1+Q1]||(I1=0<I1.length?"{"+I1.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
14
14
  let props = %s;
15
15
  <%s {...props} />
16
16
  React keys must be passed directly to JSX without using spread:
17
17
  let props = %s;
18
- <%s key={someKey} {...props} />`,Q1,M1,I1,M1),n[M1+Q1]=!0)}if(M1=null,q1!==void 0&&(Z(q1),M1=""+q1),z(i)&&(Z(i.key),M1=""+i.key),"key"in i){q1={};for(var X1 in i)X1!=="key"&&(q1[X1]=i[X1])}else q1=i;return M1&&B(q1,typeof j==="function"?j.displayName||j.name||"Unknown":j),T(j,M1,q1,X(),Y1,L1)}function L(j){M(j)?j._store&&(j._store.validated=1):typeof j==="object"&&j!==null&&j.$$typeof===p&&(j._payload.status==="fulfilled"?M(j._payload.value)&&j._payload.value._store&&(j._payload.value._store.validated=1):j._store&&(j._store.validated=1))}function M(j){return typeof j==="object"&&j!==null&&j.$$typeof===I}var I=Symbol.for("react.transitional.element"),f=Symbol.for("react.portal"),D=Symbol.for("react.fragment"),V=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),P=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),b=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),a=Symbol.for("react.activity"),m=Symbol.for("react.client.reference"),_1=X8.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$1=Object.prototype.hasOwnProperty,J1=Array.isArray,y=console.createTask?console.createTask:function(){return null};X8={react_stack_bottom_frame:function(j){return j()}};var u,x={},d=X8.react_stack_bottom_frame.bind(X8,W)(),g=y(K(W)),n={};vf.Fragment=D,vf.jsx=function(j,i,q1){var Q1=1e4>_1.recentlyCreatedOwnerStacks++;return R(j,i,q1,!1,Q1?Error("react-stack-top-frame"):d,Q1?y(K(j)):g)},vf.jsxs=function(j,i,q1){var Q1=1e4>_1.recentlyCreatedOwnerStacks++;return R(j,i,q1,!0,Q1?Error("react-stack-top-frame"):d,Q1?y(K(j)):g)}})()});var rM=j4((VC)=>{var W5=u0(i5());(function(){function Q(M,I){return M===I&&(M!==0||1/M===1/I)||M!==M&&I!==I}function U(M,I){T||W5.startTransition===void 0||(T=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var f=I();if(!R){var D=I();X(f,D)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),R=!0)}D=W({inst:{value:f,getSnapshot:I}});var V=D[0].inst,k=D[1];return B(function(){V.value=f,V.getSnapshot=I,Z(V)&&k({inst:V})},[M,f,I]),z(function(){return Z(V)&&k({inst:V}),M(function(){Z(V)&&k({inst:V})})},[M]),O(f),f}function Z(M){var I=M.getSnapshot;M=M.value;try{var f=I();return!X(M,f)}catch(D){return!0}}function K(M,I){return I()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var X=typeof Object.is==="function"?Object.is:Q,W=W5.useState,z=W5.useEffect,B=W5.useLayoutEffect,O=W5.useDebugValue,T=!1,R=!1,L=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?K:U;VC.useSyncExternalStore=W5.useSyncExternalStore!==void 0?W5.useSyncExternalStore:L,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var dM=j4((kC)=>{var A3=u0(i5());(function(){function Q(O,T){return O===T&&(O!==0||1/O===1/T)||O!==O&&T!==T}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var U=rM(),Z=typeof Object.is==="function"?Object.is:Q,K=U.useSyncExternalStore,X=A3.useRef,W=A3.useEffect,z=A3.useMemo,B=A3.useDebugValue;kC.useSyncExternalStoreWithSelector=function(O,T,R,L,M){var I=X(null);if(I.current===null){var f={hasValue:!1,value:null};I.current=f}else f=I.current;I=z(function(){function V(v){if(!k){if(k=!0,h=v,v=L(v),M!==void 0&&f.hasValue){var b=f.value;if(M(b,v))return P=b}return P=v}if(b=P,Z(h,v))return b;var E=L(v);if(M!==void 0&&M(b,E))return h=v,b;return h=v,P=E}var k=!1,h,P,C=R===void 0?null:R;return[function(){return V(T())},C===null?void 0:function(){return V(C())}]},[T,R,L,M]);var D=K(O,I[0],I[1]);return W(function(){f.hasValue=!0,f.value=D},[D]),B(D),D},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var eM=j4((EC)=>{var fX=u0(i5());(function(){function Q(){}function U(R){return""+R}function Z(R,L,M){var I=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;try{U(I);var f=!1}catch(D){f=!0}return f&&(console.error("The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",typeof Symbol==="function"&&Symbol.toStringTag&&I[Symbol.toStringTag]||I.constructor.name||"Object"),U(I)),{$$typeof:O,key:I==null?null:""+I,children:R,containerInfo:L,implementation:M}}function K(R,L){if(R==="font")return"";if(typeof L==="string")return L==="use-credentials"?L:""}function X(R){return R===null?"`null`":R===void 0?"`undefined`":R===""?"an empty string":'something with type "'+typeof R+'"'}function W(R){return R===null?"`null`":R===void 0?"`undefined`":R===""?"an empty string":typeof R==="string"?JSON.stringify(R):typeof R==="number"?"`"+R+"`":'something with type "'+typeof R+'"'}function z(){var R=T.H;return R===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
18
+ <%s key={someKey} {...props} />`,Q1,M1,I1,M1),n[M1+Q1]=!0)}if(M1=null,q1!==void 0&&(Z(q1),M1=""+q1),z(i)&&(Z(i.key),M1=""+i.key),"key"in i){q1={};for(var X1 in i)X1!=="key"&&(q1[X1]=i[X1])}else q1=i;return M1&&B(q1,typeof j==="function"?j.displayName||j.name||"Unknown":j),T(j,M1,q1,X(),Y1,L1)}function L(j){M(j)?j._store&&(j._store.validated=1):typeof j==="object"&&j!==null&&j.$$typeof===p&&(j._payload.status==="fulfilled"?M(j._payload.value)&&j._payload.value._store&&(j._payload.value._store.validated=1):j._store&&(j._store.validated=1))}function M(j){return typeof j==="object"&&j!==null&&j.$$typeof===f}var f=Symbol.for("react.transitional.element"),I=Symbol.for("react.portal"),D=Symbol.for("react.fragment"),V=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),P=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),b=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),a=Symbol.for("react.activity"),m=Symbol.for("react.client.reference"),_1=X8.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$1=Object.prototype.hasOwnProperty,J1=Array.isArray,y=console.createTask?console.createTask:function(){return null};X8={react_stack_bottom_frame:function(j){return j()}};var u,x={},d=X8.react_stack_bottom_frame.bind(X8,W)(),g=y(K(W)),n={};vf.Fragment=D,vf.jsx=function(j,i,q1){var Q1=1e4>_1.recentlyCreatedOwnerStacks++;return R(j,i,q1,!1,Q1?Error("react-stack-top-frame"):d,Q1?y(K(j)):g)},vf.jsxs=function(j,i,q1){var Q1=1e4>_1.recentlyCreatedOwnerStacks++;return R(j,i,q1,!0,Q1?Error("react-stack-top-frame"):d,Q1?y(K(j)):g)}})()});var rM=j4((VC)=>{var W5=u0(i5());(function(){function Q(M,f){return M===f&&(M!==0||1/M===1/f)||M!==M&&f!==f}function U(M,f){T||W5.startTransition===void 0||(T=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var I=f();if(!R){var D=f();X(I,D)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),R=!0)}D=W({inst:{value:I,getSnapshot:f}});var V=D[0].inst,k=D[1];return B(function(){V.value=I,V.getSnapshot=f,Z(V)&&k({inst:V})},[M,I,f]),z(function(){return Z(V)&&k({inst:V}),M(function(){Z(V)&&k({inst:V})})},[M]),O(I),I}function Z(M){var f=M.getSnapshot;M=M.value;try{var I=f();return!X(M,I)}catch(D){return!0}}function K(M,f){return f()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var X=typeof Object.is==="function"?Object.is:Q,W=W5.useState,z=W5.useEffect,B=W5.useLayoutEffect,O=W5.useDebugValue,T=!1,R=!1,L=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?K:U;VC.useSyncExternalStore=W5.useSyncExternalStore!==void 0?W5.useSyncExternalStore:L,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var dM=j4((kC)=>{var A3=u0(i5());(function(){function Q(O,T){return O===T&&(O!==0||1/O===1/T)||O!==O&&T!==T}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var U=rM(),Z=typeof Object.is==="function"?Object.is:Q,K=U.useSyncExternalStore,X=A3.useRef,W=A3.useEffect,z=A3.useMemo,B=A3.useDebugValue;kC.useSyncExternalStoreWithSelector=function(O,T,R,L,M){var f=X(null);if(f.current===null){var I={hasValue:!1,value:null};f.current=I}else I=f.current;f=z(function(){function V(v){if(!k){if(k=!0,h=v,v=L(v),M!==void 0&&I.hasValue){var b=I.value;if(M(b,v))return P=b}return P=v}if(b=P,Z(h,v))return b;var E=L(v);if(M!==void 0&&M(b,E))return h=v,b;return h=v,P=E}var k=!1,h,P,C=R===void 0?null:R;return[function(){return V(T())},C===null?void 0:function(){return V(C())}]},[T,R,L,M]);var D=K(O,f[0],f[1]);return W(function(){I.hasValue=!0,I.value=D},[D]),B(D),D},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var eM=j4((EC)=>{var fX=u0(i5());(function(){function Q(){}function U(R){return""+R}function Z(R,L,M){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;try{U(f);var I=!1}catch(D){I=!0}return I&&(console.error("The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",typeof Symbol==="function"&&Symbol.toStringTag&&f[Symbol.toStringTag]||f.constructor.name||"Object"),U(f)),{$$typeof:O,key:f==null?null:""+f,children:R,containerInfo:L,implementation:M}}function K(R,L){if(R==="font")return"";if(typeof L==="string")return L==="use-credentials"?L:""}function X(R){return R===null?"`null`":R===void 0?"`undefined`":R===""?"an empty string":'something with type "'+typeof R+'"'}function W(R){return R===null?"`null`":R===void 0?"`undefined`":R===""?"an empty string":typeof R==="string"?JSON.stringify(R):typeof R==="number"?"`"+R+"`":'something with type "'+typeof R+'"'}function z(){var R=T.H;return R===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
19
19
  1. You might have mismatching versions of React and the renderer (such as React DOM)
20
20
  2. You might be breaking the Rules of Hooks
21
21
  3. You might have more than one copy of React in the same app
22
- See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),R}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var B={d:{f:Q,r:function(){throw Error("Invalid form element. requestFormReset must be passed a form that was rendered by React.")},D:Q,C:Q,L:Q,m:Q,X:Q,S:Q,M:Q},p:0,findDOMNode:null},O=Symbol.for("react.portal"),T=fX.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;typeof Map==="function"&&Map.prototype!=null&&typeof Map.prototype.forEach==="function"&&typeof Set==="function"&&Set.prototype!=null&&typeof Set.prototype.clear==="function"&&typeof Set.prototype.forEach==="function"||console.error("React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),EC.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=B,EC.createPortal=function(R,L){var M=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!L||L.nodeType!==1&&L.nodeType!==9&&L.nodeType!==11)throw Error("Target container is not a DOM element.");return Z(R,L,null,M)},EC.flushSync=function(R){var L=T.T,M=B.p;try{if(T.T=null,B.p=2,R)return R()}finally{T.T=L,B.p=M,B.d.f()&&console.error("flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task.")}},EC.preconnect=function(R,L){typeof R==="string"&&R?L!=null&&typeof L!=="object"?console.error("ReactDOM.preconnect(): Expected the `options` argument (second) to be an object but encountered %s instead. The only supported option at this time is `crossOrigin` which accepts a string.",W(L)):L!=null&&typeof L.crossOrigin!=="string"&&console.error("ReactDOM.preconnect(): Expected the `crossOrigin` option (second argument) to be a string but encountered %s instead. Try removing this option or passing a string value instead.",X(L.crossOrigin)):console.error("ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",X(R)),typeof R==="string"&&(L?(L=L.crossOrigin,L=typeof L==="string"?L==="use-credentials"?L:"":void 0):L=null,B.d.C(R,L))},EC.prefetchDNS=function(R){if(typeof R!=="string"||!R)console.error("ReactDOM.prefetchDNS(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",X(R));else if(1<arguments.length){var L=arguments[1];typeof L==="object"&&L.hasOwnProperty("crossOrigin")?console.error("ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. It looks like the you are attempting to set a crossOrigin property for this DNS lookup hint. Browsers do not perform DNS queries using CORS and setting this attribute on the resource hint has no effect. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",W(L)):console.error("ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",W(L))}typeof R==="string"&&B.d.D(R)},EC.preinit=function(R,L){if(typeof R==="string"&&R?L==null||typeof L!=="object"?console.error("ReactDOM.preinit(): Expected the `options` argument (second) to be an object with an `as` property describing the type of resource to be preinitialized but encountered %s instead.",W(L)):L.as!=="style"&&L.as!=="script"&&console.error('ReactDOM.preinit(): Expected the `as` property in the `options` argument (second) to contain a valid value describing the type of resource to be preinitialized but encountered %s instead. Valid values for `as` are "style" and "script".',W(L.as)):console.error("ReactDOM.preinit(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",X(R)),typeof R==="string"&&L&&typeof L.as==="string"){var M=L.as,I=K(M,L.crossOrigin),f=typeof L.integrity==="string"?L.integrity:void 0,D=typeof L.fetchPriority==="string"?L.fetchPriority:void 0;M==="style"?B.d.S(R,typeof L.precedence==="string"?L.precedence:void 0,{crossOrigin:I,integrity:f,fetchPriority:D}):M==="script"&&B.d.X(R,{crossOrigin:I,integrity:f,fetchPriority:D,nonce:typeof L.nonce==="string"?L.nonce:void 0})}},EC.preinitModule=function(R,L){var M="";if(typeof R==="string"&&R||(M+=" The `href` argument encountered was "+X(R)+"."),L!==void 0&&typeof L!=="object"?M+=" The `options` argument encountered was "+X(L)+".":L&&("as"in L)&&L.as!=="script"&&(M+=" The `as` option encountered was "+W(L.as)+"."),M)console.error("ReactDOM.preinitModule(): Expected up to two arguments, a non-empty `href` string and, optionally, an `options` object with a valid `as` property.%s",M);else switch(M=L&&typeof L.as==="string"?L.as:"script",M){case"script":break;default:M=W(M),console.error('ReactDOM.preinitModule(): Currently the only supported "as" type for this function is "script" but received "%s" instead. This warning was generated for `href` "%s". In the future other module types will be supported, aligning with the import-attributes proposal. Learn more here: (https://github.com/tc39/proposal-import-attributes)',M,R)}if(typeof R==="string")if(typeof L==="object"&&L!==null){if(L.as==null||L.as==="script")M=K(L.as,L.crossOrigin),B.d.M(R,{crossOrigin:M,integrity:typeof L.integrity==="string"?L.integrity:void 0,nonce:typeof L.nonce==="string"?L.nonce:void 0})}else L==null&&B.d.M(R)},EC.preload=function(R,L){var M="";if(typeof R==="string"&&R||(M+=" The `href` argument encountered was "+X(R)+"."),L==null||typeof L!=="object"?M+=" The `options` argument encountered was "+X(L)+".":typeof L.as==="string"&&L.as||(M+=" The `as` option encountered was "+X(L.as)+"."),M&&console.error('ReactDOM.preload(): Expected two arguments, a non-empty `href` string and an `options` object with an `as` property valid for a `<link rel="preload" as="..." />` tag.%s',M),typeof R==="string"&&typeof L==="object"&&L!==null&&typeof L.as==="string"){M=L.as;var I=K(M,L.crossOrigin);B.d.L(R,M,{crossOrigin:I,integrity:typeof L.integrity==="string"?L.integrity:void 0,nonce:typeof L.nonce==="string"?L.nonce:void 0,type:typeof L.type==="string"?L.type:void 0,fetchPriority:typeof L.fetchPriority==="string"?L.fetchPriority:void 0,referrerPolicy:typeof L.referrerPolicy==="string"?L.referrerPolicy:void 0,imageSrcSet:typeof L.imageSrcSet==="string"?L.imageSrcSet:void 0,imageSizes:typeof L.imageSizes==="string"?L.imageSizes:void 0,media:typeof L.media==="string"?L.media:void 0})}},EC.preloadModule=function(R,L){var M="";typeof R==="string"&&R||(M+=" The `href` argument encountered was "+X(R)+"."),L!==void 0&&typeof L!=="object"?M+=" The `options` argument encountered was "+X(L)+".":L&&("as"in L)&&typeof L.as!=="string"&&(M+=" The `as` option encountered was "+X(L.as)+"."),M&&console.error('ReactDOM.preloadModule(): Expected two arguments, a non-empty `href` string and, optionally, an `options` object with an `as` property valid for a `<link rel="modulepreload" as="..." />` tag.%s',M),typeof R==="string"&&(L?(M=K(L.as,L.crossOrigin),B.d.m(R,{as:typeof L.as==="string"&&L.as!=="script"?L.as:void 0,crossOrigin:M,integrity:typeof L.integrity==="string"?L.integrity:void 0})):B.d.m(R))},EC.requestFormReset=function(R){B.d.r(R)},EC.unstable_batchedUpdates=function(R,L){return R(L)},EC.useFormState=function(R,L,M){return z().useFormState(R,L,M)},EC.useFormStatus=function(){return z().useHostTransitionStatus()},EC.version="19.2.7",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var PX=j4((ih,_T)=>{var bC=u0(eM());_T.exports=bC});var wJ=j4((QV)=>{var C8=u0(i5());(function(){function Q(j){if(j==null)return null;if(typeof j==="function")return j.$$typeof===m?null:j.displayName||j.name||null;if(typeof j==="string")return j;switch(j){case D:return"Fragment";case k:return"Profiler";case V:return"StrictMode";case v:return"Suspense";case b:return"SuspenseList";case a:return"Activity"}if(typeof j==="object")switch(typeof j.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),j.$$typeof){case f:return"Portal";case P:return j.displayName||"Context";case h:return(j._context.displayName||"Context")+".Consumer";case C:var i=j.render;return j=j.displayName,j||(j=i.displayName||i.name||"",j=j!==""?"ForwardRef("+j+")":"ForwardRef"),j;case E:return i=j.displayName||null,i!==null?i:Q(j.type)||"Memo";case p:i=j._payload,j=j._init;try{return Q(j(i))}catch(q1){}}return null}function U(j){return""+j}function Z(j){try{U(j);var i=!1}catch(Y1){i=!0}if(i){i=console;var q1=i.error,Q1=typeof Symbol==="function"&&Symbol.toStringTag&&j[Symbol.toStringTag]||j.constructor.name||"Object";return q1.call(i,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",Q1),U(j)}}function K(j){if(j===D)return"<>";if(typeof j==="object"&&j!==null&&j.$$typeof===p)return"<...>";try{var i=Q(j);return i?"<"+i+">":"<...>"}catch(q1){return"<...>"}}function X(){var j=_1.A;return j===null?null:j.getOwner()}function W(){return Error("react-stack-top-frame")}function z(j){if($1.call(j,"key")){var i=Object.getOwnPropertyDescriptor(j,"key").get;if(i&&i.isReactWarning)return!1}return j.key!==void 0}function B(j,i){function q1(){u||(u=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",i))}q1.isReactWarning=!0,Object.defineProperty(j,"key",{get:q1,configurable:!0})}function O(){var j=Q(this.type);return x[j]||(x[j]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),j=this.props.ref,j!==void 0?j:null}function T(j,i,q1,Q1,Y1,L1){var M1=q1.ref;return j={$$typeof:I,type:j,key:i,props:q1,_owner:Q1},(M1!==void 0?M1:null)!==null?Object.defineProperty(j,"ref",{enumerable:!1,get:O}):Object.defineProperty(j,"ref",{enumerable:!1,value:null}),j._store={},Object.defineProperty(j._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(j,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(j,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Y1}),Object.defineProperty(j,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:L1}),Object.freeze&&(Object.freeze(j.props),Object.freeze(j)),j}function R(j,i,q1,Q1,Y1,L1){var M1=i.children;if(M1!==void 0)if(Q1)if(J1(M1)){for(Q1=0;Q1<M1.length;Q1++)L(M1[Q1]);Object.freeze&&Object.freeze(M1)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else L(M1);if($1.call(i,"key")){M1=Q(j);var I1=Object.keys(i).filter(function(f1){return f1!=="key"});Q1=0<I1.length?"{key: someKey, "+I1.join(": ..., ")+": ...}":"{key: someKey}",n[M1+Q1]||(I1=0<I1.length?"{"+I1.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
22
+ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),R}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var B={d:{f:Q,r:function(){throw Error("Invalid form element. requestFormReset must be passed a form that was rendered by React.")},D:Q,C:Q,L:Q,m:Q,X:Q,S:Q,M:Q},p:0,findDOMNode:null},O=Symbol.for("react.portal"),T=fX.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;typeof Map==="function"&&Map.prototype!=null&&typeof Map.prototype.forEach==="function"&&typeof Set==="function"&&Set.prototype!=null&&typeof Set.prototype.clear==="function"&&typeof Set.prototype.forEach==="function"||console.error("React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),EC.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=B,EC.createPortal=function(R,L){var M=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!L||L.nodeType!==1&&L.nodeType!==9&&L.nodeType!==11)throw Error("Target container is not a DOM element.");return Z(R,L,null,M)},EC.flushSync=function(R){var L=T.T,M=B.p;try{if(T.T=null,B.p=2,R)return R()}finally{T.T=L,B.p=M,B.d.f()&&console.error("flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task.")}},EC.preconnect=function(R,L){typeof R==="string"&&R?L!=null&&typeof L!=="object"?console.error("ReactDOM.preconnect(): Expected the `options` argument (second) to be an object but encountered %s instead. The only supported option at this time is `crossOrigin` which accepts a string.",W(L)):L!=null&&typeof L.crossOrigin!=="string"&&console.error("ReactDOM.preconnect(): Expected the `crossOrigin` option (second argument) to be a string but encountered %s instead. Try removing this option or passing a string value instead.",X(L.crossOrigin)):console.error("ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",X(R)),typeof R==="string"&&(L?(L=L.crossOrigin,L=typeof L==="string"?L==="use-credentials"?L:"":void 0):L=null,B.d.C(R,L))},EC.prefetchDNS=function(R){if(typeof R!=="string"||!R)console.error("ReactDOM.prefetchDNS(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",X(R));else if(1<arguments.length){var L=arguments[1];typeof L==="object"&&L.hasOwnProperty("crossOrigin")?console.error("ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. It looks like the you are attempting to set a crossOrigin property for this DNS lookup hint. Browsers do not perform DNS queries using CORS and setting this attribute on the resource hint has no effect. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",W(L)):console.error("ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",W(L))}typeof R==="string"&&B.d.D(R)},EC.preinit=function(R,L){if(typeof R==="string"&&R?L==null||typeof L!=="object"?console.error("ReactDOM.preinit(): Expected the `options` argument (second) to be an object with an `as` property describing the type of resource to be preinitialized but encountered %s instead.",W(L)):L.as!=="style"&&L.as!=="script"&&console.error('ReactDOM.preinit(): Expected the `as` property in the `options` argument (second) to contain a valid value describing the type of resource to be preinitialized but encountered %s instead. Valid values for `as` are "style" and "script".',W(L.as)):console.error("ReactDOM.preinit(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",X(R)),typeof R==="string"&&L&&typeof L.as==="string"){var M=L.as,f=K(M,L.crossOrigin),I=typeof L.integrity==="string"?L.integrity:void 0,D=typeof L.fetchPriority==="string"?L.fetchPriority:void 0;M==="style"?B.d.S(R,typeof L.precedence==="string"?L.precedence:void 0,{crossOrigin:f,integrity:I,fetchPriority:D}):M==="script"&&B.d.X(R,{crossOrigin:f,integrity:I,fetchPriority:D,nonce:typeof L.nonce==="string"?L.nonce:void 0})}},EC.preinitModule=function(R,L){var M="";if(typeof R==="string"&&R||(M+=" The `href` argument encountered was "+X(R)+"."),L!==void 0&&typeof L!=="object"?M+=" The `options` argument encountered was "+X(L)+".":L&&("as"in L)&&L.as!=="script"&&(M+=" The `as` option encountered was "+W(L.as)+"."),M)console.error("ReactDOM.preinitModule(): Expected up to two arguments, a non-empty `href` string and, optionally, an `options` object with a valid `as` property.%s",M);else switch(M=L&&typeof L.as==="string"?L.as:"script",M){case"script":break;default:M=W(M),console.error('ReactDOM.preinitModule(): Currently the only supported "as" type for this function is "script" but received "%s" instead. This warning was generated for `href` "%s". In the future other module types will be supported, aligning with the import-attributes proposal. Learn more here: (https://github.com/tc39/proposal-import-attributes)',M,R)}if(typeof R==="string")if(typeof L==="object"&&L!==null){if(L.as==null||L.as==="script")M=K(L.as,L.crossOrigin),B.d.M(R,{crossOrigin:M,integrity:typeof L.integrity==="string"?L.integrity:void 0,nonce:typeof L.nonce==="string"?L.nonce:void 0})}else L==null&&B.d.M(R)},EC.preload=function(R,L){var M="";if(typeof R==="string"&&R||(M+=" The `href` argument encountered was "+X(R)+"."),L==null||typeof L!=="object"?M+=" The `options` argument encountered was "+X(L)+".":typeof L.as==="string"&&L.as||(M+=" The `as` option encountered was "+X(L.as)+"."),M&&console.error('ReactDOM.preload(): Expected two arguments, a non-empty `href` string and an `options` object with an `as` property valid for a `<link rel="preload" as="..." />` tag.%s',M),typeof R==="string"&&typeof L==="object"&&L!==null&&typeof L.as==="string"){M=L.as;var f=K(M,L.crossOrigin);B.d.L(R,M,{crossOrigin:f,integrity:typeof L.integrity==="string"?L.integrity:void 0,nonce:typeof L.nonce==="string"?L.nonce:void 0,type:typeof L.type==="string"?L.type:void 0,fetchPriority:typeof L.fetchPriority==="string"?L.fetchPriority:void 0,referrerPolicy:typeof L.referrerPolicy==="string"?L.referrerPolicy:void 0,imageSrcSet:typeof L.imageSrcSet==="string"?L.imageSrcSet:void 0,imageSizes:typeof L.imageSizes==="string"?L.imageSizes:void 0,media:typeof L.media==="string"?L.media:void 0})}},EC.preloadModule=function(R,L){var M="";typeof R==="string"&&R||(M+=" The `href` argument encountered was "+X(R)+"."),L!==void 0&&typeof L!=="object"?M+=" The `options` argument encountered was "+X(L)+".":L&&("as"in L)&&typeof L.as!=="string"&&(M+=" The `as` option encountered was "+X(L.as)+"."),M&&console.error('ReactDOM.preloadModule(): Expected two arguments, a non-empty `href` string and, optionally, an `options` object with an `as` property valid for a `<link rel="modulepreload" as="..." />` tag.%s',M),typeof R==="string"&&(L?(M=K(L.as,L.crossOrigin),B.d.m(R,{as:typeof L.as==="string"&&L.as!=="script"?L.as:void 0,crossOrigin:M,integrity:typeof L.integrity==="string"?L.integrity:void 0})):B.d.m(R))},EC.requestFormReset=function(R){B.d.r(R)},EC.unstable_batchedUpdates=function(R,L){return R(L)},EC.useFormState=function(R,L,M){return z().useFormState(R,L,M)},EC.useFormStatus=function(){return z().useHostTransitionStatus()},EC.version="19.2.7",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var PX=j4((ih,_T)=>{var bC=u0(eM());_T.exports=bC});var wJ=j4((QV)=>{var C8=u0(i5());(function(){function Q(j){if(j==null)return null;if(typeof j==="function")return j.$$typeof===m?null:j.displayName||j.name||null;if(typeof j==="string")return j;switch(j){case D:return"Fragment";case k:return"Profiler";case V:return"StrictMode";case v:return"Suspense";case b:return"SuspenseList";case a:return"Activity"}if(typeof j==="object")switch(typeof j.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),j.$$typeof){case I:return"Portal";case P:return j.displayName||"Context";case h:return(j._context.displayName||"Context")+".Consumer";case C:var i=j.render;return j=j.displayName,j||(j=i.displayName||i.name||"",j=j!==""?"ForwardRef("+j+")":"ForwardRef"),j;case E:return i=j.displayName||null,i!==null?i:Q(j.type)||"Memo";case p:i=j._payload,j=j._init;try{return Q(j(i))}catch(q1){}}return null}function U(j){return""+j}function Z(j){try{U(j);var i=!1}catch(Y1){i=!0}if(i){i=console;var q1=i.error,Q1=typeof Symbol==="function"&&Symbol.toStringTag&&j[Symbol.toStringTag]||j.constructor.name||"Object";return q1.call(i,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",Q1),U(j)}}function K(j){if(j===D)return"<>";if(typeof j==="object"&&j!==null&&j.$$typeof===p)return"<...>";try{var i=Q(j);return i?"<"+i+">":"<...>"}catch(q1){return"<...>"}}function X(){var j=_1.A;return j===null?null:j.getOwner()}function W(){return Error("react-stack-top-frame")}function z(j){if($1.call(j,"key")){var i=Object.getOwnPropertyDescriptor(j,"key").get;if(i&&i.isReactWarning)return!1}return j.key!==void 0}function B(j,i){function q1(){u||(u=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",i))}q1.isReactWarning=!0,Object.defineProperty(j,"key",{get:q1,configurable:!0})}function O(){var j=Q(this.type);return x[j]||(x[j]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),j=this.props.ref,j!==void 0?j:null}function T(j,i,q1,Q1,Y1,L1){var M1=q1.ref;return j={$$typeof:f,type:j,key:i,props:q1,_owner:Q1},(M1!==void 0?M1:null)!==null?Object.defineProperty(j,"ref",{enumerable:!1,get:O}):Object.defineProperty(j,"ref",{enumerable:!1,value:null}),j._store={},Object.defineProperty(j._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(j,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(j,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Y1}),Object.defineProperty(j,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:L1}),Object.freeze&&(Object.freeze(j.props),Object.freeze(j)),j}function R(j,i,q1,Q1,Y1,L1){var M1=i.children;if(M1!==void 0)if(Q1)if(J1(M1)){for(Q1=0;Q1<M1.length;Q1++)L(M1[Q1]);Object.freeze&&Object.freeze(M1)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else L(M1);if($1.call(i,"key")){M1=Q(j);var I1=Object.keys(i).filter(function(f1){return f1!=="key"});Q1=0<I1.length?"{key: someKey, "+I1.join(": ..., ")+": ...}":"{key: someKey}",n[M1+Q1]||(I1=0<I1.length?"{"+I1.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
23
23
  let props = %s;
24
24
  <%s {...props} />
25
25
  React keys must be passed directly to JSX without using spread:
26
26
  let props = %s;
27
- <%s key={someKey} {...props} />`,Q1,M1,I1,M1),n[M1+Q1]=!0)}if(M1=null,q1!==void 0&&(Z(q1),M1=""+q1),z(i)&&(Z(i.key),M1=""+i.key),"key"in i){q1={};for(var X1 in i)X1!=="key"&&(q1[X1]=i[X1])}else q1=i;return M1&&B(q1,typeof j==="function"?j.displayName||j.name||"Unknown":j),T(j,M1,q1,X(),Y1,L1)}function L(j){M(j)?j._store&&(j._store.validated=1):typeof j==="object"&&j!==null&&j.$$typeof===p&&(j._payload.status==="fulfilled"?M(j._payload.value)&&j._payload.value._store&&(j._payload.value._store.validated=1):j._store&&(j._store.validated=1))}function M(j){return typeof j==="object"&&j!==null&&j.$$typeof===I}var I=Symbol.for("react.transitional.element"),f=Symbol.for("react.portal"),D=Symbol.for("react.fragment"),V=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),P=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),b=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),a=Symbol.for("react.activity"),m=Symbol.for("react.client.reference"),_1=C8.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$1=Object.prototype.hasOwnProperty,J1=Array.isArray,y=console.createTask?console.createTask:function(){return null};C8={react_stack_bottom_frame:function(j){return j()}};var u,x={},d=C8.react_stack_bottom_frame.bind(C8,W)(),g=y(K(W)),n={};QV.Fragment=D,QV.jsxDEV=function(j,i,q1,Q1){var Y1=1e4>_1.recentlyCreatedOwnerStacks++;return R(j,i,q1,Q1,Y1?Error("react-stack-top-frame"):d,Y1?y(K(j)):g)}})()});var fR=j4((FV)=>{(function(){function Q(){if(C=!1,p){var u=FV.unstable_now();_1=u;var x=!0;try{_:{h=!1,P&&(P=!1,b(a),a=-1),k=!0;var d=V;try{J:{W(u);for(D=Z(M);D!==null&&!(D.expirationTime>u&&B());){var g=D.callback;if(typeof g==="function"){D.callback=null,V=D.priorityLevel;var n=g(D.expirationTime<=u);if(u=FV.unstable_now(),typeof n==="function"){D.callback=n,W(u),x=!0;break J}D===Z(M)&&K(M),W(u)}else K(M);D=Z(M)}if(D!==null)x=!0;else{var j=Z(I);j!==null&&O(z,j.startTime-u),x=!1}}break _}finally{D=null,V=d,k=!1}x=void 0}}finally{x?$1():p=!1}}}function U(u,x){var d=u.length;u.push(x);_:for(;0<d;){var g=d-1>>>1,n=u[g];if(0<X(n,x))u[g]=x,u[d]=n,d=g;else break _}}function Z(u){return u.length===0?null:u[0]}function K(u){if(u.length===0)return null;var x=u[0],d=u.pop();if(d!==x){u[0]=d;_:for(var g=0,n=u.length,j=n>>>1;g<j;){var i=2*(g+1)-1,q1=u[i],Q1=i+1,Y1=u[Q1];if(0>X(q1,d))Q1<n&&0>X(Y1,q1)?(u[g]=Y1,u[Q1]=d,g=Q1):(u[g]=q1,u[i]=d,g=i);else if(Q1<n&&0>X(Y1,d))u[g]=Y1,u[Q1]=d,g=Q1;else break _}}return x}function X(u,x){var d=u.sortIndex-x.sortIndex;return d!==0?d:u.id-x.id}function W(u){for(var x=Z(I);x!==null;){if(x.callback===null)K(I);else if(x.startTime<=u)K(I),x.sortIndex=x.expirationTime,U(M,x);else break;x=Z(I)}}function z(u){if(P=!1,W(u),!h)if(Z(M)!==null)h=!0,p||(p=!0,$1());else{var x=Z(I);x!==null&&O(z,x.startTime-u)}}function B(){return C?!0:FV.unstable_now()-_1<m?!1:!0}function O(u,x){a=v(function(){u(FV.unstable_now())},x)}if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()),FV.unstable_now=void 0,typeof performance==="object"&&typeof performance.now==="function"){var T=performance;FV.unstable_now=function(){return T.now()}}else{var R=Date,L=R.now();FV.unstable_now=function(){return R.now()-L}}var M=[],I=[],f=1,D=null,V=3,k=!1,h=!1,P=!1,C=!1,v=typeof setTimeout==="function"?setTimeout:null,b=typeof clearTimeout==="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null,p=!1,a=-1,m=5,_1=-1;if(typeof E==="function")var $1=function(){E(Q)};else if(typeof MessageChannel<"u"){var J1=new MessageChannel,y=J1.port2;J1.port1.onmessage=Q,$1=function(){y.postMessage(null)}}else $1=function(){v(Q,0)};FV.unstable_IdlePriority=5,FV.unstable_ImmediatePriority=1,FV.unstable_LowPriority=4,FV.unstable_NormalPriority=3,FV.unstable_Profiling=null,FV.unstable_UserBlockingPriority=2,FV.unstable_cancelCallback=function(u){u.callback=null},FV.unstable_forceFrameRate=function(u){0>u||125<u?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):m=0<u?Math.floor(1000/u):5},FV.unstable_getCurrentPriorityLevel=function(){return V},FV.unstable_next=function(u){switch(V){case 1:case 2:case 3:var x=3;break;default:x=V}var d=V;V=x;try{return u()}finally{V=d}},FV.unstable_requestPaint=function(){C=!0},FV.unstable_runWithPriority=function(u,x){switch(u){case 1:case 2:case 3:case 4:case 5:break;default:u=3}var d=V;V=u;try{return x()}finally{V=d}},FV.unstable_scheduleCallback=function(u,x,d){var g=FV.unstable_now();switch(typeof d==="object"&&d!==null?(d=d.delay,d=typeof d==="number"&&0<d?g+d:g):d=g,u){case 1:var n=-1;break;case 2:n=250;break;case 5:n=1073741823;break;case 4:n=1e4;break;default:n=5000}return n=d+n,u={id:f++,callback:x,priorityLevel:u,startTime:d,expirationTime:n,sortIndex:-1},d>g?(u.sortIndex=d,U(I,u),Z(M)===null&&u===Z(I)&&(P?(b(a),a=-1):P=!0,O(z,d-g))):(u.sortIndex=n,U(M,u),h||k||(h=!0,p||(p=!0,$1()))),u},FV.unstable_shouldYield=B,FV.unstable_wrapCallback=function(u){var x=V;return function(){var d=V;V=x;try{return u.apply(this,arguments)}finally{V=d}}},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var PR=j4((KV)=>{var K0=u0(fR()),$9=u0(i5()),hX=u0(PX());(function(){function Q(_,J){for(_=_.memoizedState;_!==null&&0<J;)_=_.next,J--;return _}function U(_,J,$,q){if($>=J.length)return q;var G=J[$],F=s0(_)?_.slice():o1({},_);return F[G]=U(_[G],J,$+1,q),F}function Z(_,J,$){if(J.length!==$.length)console.warn("copyWithRename() expects paths of the same length");else{for(var q=0;q<$.length-1;q++)if(J[q]!==$[q]){console.warn("copyWithRename() expects paths to be the same except for the deepest key");return}return K(_,J,$,0)}}function K(_,J,$,q){var G=J[q],F=s0(_)?_.slice():o1({},_);return q+1===J.length?(F[$[q]]=F[G],s0(F)?F.splice(G,1):delete F[G]):F[G]=K(_[G],J,$,q+1),F}function X(_,J,$){var q=J[$],G=s0(_)?_.slice():o1({},_);if($+1===J.length)return s0(G)?G.splice(q,1):delete G[q],G;return G[q]=X(_[q],J,$+1),G}function W(){return!1}function z(){return null}function B(){console.error("Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://react.dev/link/rules-of-hooks")}function O(){console.error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().")}function T(){}function R(){}function L(_){var J=[];return _.forEach(function($){J.push($)}),J.sort().join(", ")}function M(_,J,$,q){return new BO(_,J,$,q)}function I(_,J){_.context===c3&&(aG(_.current,2,J,_,null,null),s8())}function f(_,J){if(O5!==null){var $=J.staleFamilies;J=J.updatedFamilies,x9(),TH(_.current,J,$),s8()}}function D(_){O5=_}function V(_){return!(!_||_.nodeType!==1&&_.nodeType!==9&&_.nodeType!==11)}function k(_){var J=_,$=_;if(_.alternate)for(;J.return;)J=J.return;else{_=J;do J=_,(J.flags&4098)!==0&&($=J.return),_=J.return;while(_)}return J.tag===3?$:null}function h(_){if(_.tag===13){var J=_.memoizedState;if(J===null&&(_=_.alternate,_!==null&&(J=_.memoizedState)),J!==null)return J.dehydrated}return null}function P(_){if(_.tag===31){var J=_.memoizedState;if(J===null&&(_=_.alternate,_!==null&&(J=_.memoizedState)),J!==null)return J.dehydrated}return null}function C(_){if(k(_)!==_)throw Error("Unable to find node on an unmounted component.")}function v(_){var J=_.alternate;if(!J){if(J=k(_),J===null)throw Error("Unable to find node on an unmounted component.");return J!==_?null:_}for(var $=_,q=J;;){var G=$.return;if(G===null)break;var F=G.alternate;if(F===null){if(q=G.return,q!==null){$=q;continue}break}if(G.child===F.child){for(F=G.child;F;){if(F===$)return C(G),_;if(F===q)return C(G),J;F=F.sibling}throw Error("Unable to find node on an unmounted component.")}if($.return!==q.return)$=G,q=F;else{for(var Y=!1,A=G.child;A;){if(A===$){Y=!0,$=G,q=F;break}if(A===q){Y=!0,q=G,$=F;break}A=A.sibling}if(!Y){for(A=F.child;A;){if(A===$){Y=!0,$=F,q=G;break}if(A===q){Y=!0,q=F,$=G;break}A=A.sibling}if(!Y)throw Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.")}}if($.alternate!==q)throw Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.")}if($.tag!==3)throw Error("Unable to find node on an unmounted component.");return $.stateNode.current===$?_:J}function b(_){var J=_.tag;if(J===5||J===26||J===27||J===6)return _;for(_=_.child;_!==null;){if(J=b(_),J!==null)return J;_=_.sibling}return null}function E(_){if(_===null||typeof _!=="object")return null;return _=Nz&&_[Nz]||_["@@iterator"],typeof _==="function"?_:null}function p(_){if(_==null)return null;if(typeof _==="function")return _.$$typeof===bw?null:_.displayName||_.name||null;if(typeof _==="string")return _;switch(_){case $7:return"Fragment";case _Z:return"Profiler";case i$:return"StrictMode";case $Z:return"Suspense";case QZ:return"SuspenseList";case qZ:return"Activity"}if(typeof _==="object")switch(typeof _.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),_.$$typeof){case J7:return"Portal";case M4:return _.displayName||"Context";case JZ:return(_._context.displayName||"Context")+".Consumer";case a9:var J=_.render;return _=_.displayName,_||(_=J.displayName||J.name||"",_=_!==""?"ForwardRef("+_+")":"ForwardRef"),_;case a$:return J=_.displayName||null,J!==null?J:p(_.type)||"Memo";case U5:J=_._payload,_=_._init;try{return p(_(J))}catch($){}}return null}function a(_){return typeof _.tag==="number"?m(_):typeof _.name==="string"?_.name:null}function m(_){var J=_.type;switch(_.tag){case 31:return"Activity";case 24:return"Cache";case 9:return(J._context.displayName||"Context")+".Consumer";case 10:return J.displayName||"Context";case 18:return"DehydratedFragment";case 11:return _=J.render,_=_.displayName||_.name||"",J.displayName||(_!==""?"ForwardRef("+_+")":"ForwardRef");case 7:return"Fragment";case 26:case 27:case 5:return J;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return p(J);case 8:return J===i$?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 14:case 15:if(typeof J==="function")return J.displayName||J.name||null;if(typeof J==="string")return J;break;case 29:if(J=_._debugInfo,J!=null){for(var $=J.length-1;0<=$;$--)if(typeof J[$].name==="string")return J[$].name}if(_.return!==null)return m(_.return)}return null}function _1(_){return{current:_}}function $1(_,J){0>a4?console.error("Unexpected pop."):(J!==GZ[a4]&&console.error("Unexpected Fiber popped."),_.current=UZ[a4],UZ[a4]=null,GZ[a4]=null,a4--)}function J1(_,J,$){a4++,UZ[a4]=_.current,GZ[a4]=$,_.current=J}function y(_){return _===null&&console.error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue."),_}function u(_,J){J1(u3,J,_),J1(s9,_,_),J1(b3,null,_);var $=J.nodeType;switch($){case 9:case 11:$=$===9?"#document":"#fragment",J=(J=J.documentElement)?(J=J.namespaceURI)?tW(J):F3:F3;break;default:if($=J.tagName,J=J.namespaceURI)J=tW(J),J=oW(J,$);else switch($){case"svg":J=b7;break;case"math":J=dQ;break;default:J=F3}}$=$.toLowerCase(),$=W9(null,$),$={context:J,ancestorInfo:$},$1(b3,_),J1(b3,$,_)}function x(_){$1(b3,_),$1(s9,_),$1(u3,_)}function d(){return y(b3.current)}function g(_){_.memoizedState!==null&&J1(s$,_,_);var J=y(b3.current),$=_.type,q=oW(J.context,$);$=W9(J.ancestorInfo,$),q={context:q,ancestorInfo:$},J!==q&&(J1(s9,_,_),J1(b3,q,_))}function n(_){s9.current===_&&($1(b3,_),$1(s9,_)),s$.current===_&&($1(s$,_),m_._currentValue=K8)}function j(){}function i(){if(t9===0){Cz=console.log,Sz=console.info,jz=console.warn,Vz=console.error,kz=console.group,Dz=console.groupCollapsed,yz=console.groupEnd;var _={configurable:!0,enumerable:!0,value:j,writable:!0};Object.defineProperties(console,{info:_,log:_,warn:_,error:_,group:_,groupCollapsed:_,groupEnd:_})}t9++}function q1(){if(t9--,t9===0){var _={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:o1({},_,{value:Cz}),info:o1({},_,{value:Sz}),warn:o1({},_,{value:jz}),error:o1({},_,{value:Vz}),group:o1({},_,{value:kz}),groupCollapsed:o1({},_,{value:Dz}),groupEnd:o1({},_,{value:yz})})}0>t9&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function Q1(_){var J=Error.prepareStackTrace;if(Error.prepareStackTrace=void 0,_=_.stack,Error.prepareStackTrace=J,_.startsWith(`Error: react-stack-top-frame
27
+ <%s key={someKey} {...props} />`,Q1,M1,I1,M1),n[M1+Q1]=!0)}if(M1=null,q1!==void 0&&(Z(q1),M1=""+q1),z(i)&&(Z(i.key),M1=""+i.key),"key"in i){q1={};for(var X1 in i)X1!=="key"&&(q1[X1]=i[X1])}else q1=i;return M1&&B(q1,typeof j==="function"?j.displayName||j.name||"Unknown":j),T(j,M1,q1,X(),Y1,L1)}function L(j){M(j)?j._store&&(j._store.validated=1):typeof j==="object"&&j!==null&&j.$$typeof===p&&(j._payload.status==="fulfilled"?M(j._payload.value)&&j._payload.value._store&&(j._payload.value._store.validated=1):j._store&&(j._store.validated=1))}function M(j){return typeof j==="object"&&j!==null&&j.$$typeof===f}var f=Symbol.for("react.transitional.element"),I=Symbol.for("react.portal"),D=Symbol.for("react.fragment"),V=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),P=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),b=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),a=Symbol.for("react.activity"),m=Symbol.for("react.client.reference"),_1=C8.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$1=Object.prototype.hasOwnProperty,J1=Array.isArray,y=console.createTask?console.createTask:function(){return null};C8={react_stack_bottom_frame:function(j){return j()}};var u,x={},d=C8.react_stack_bottom_frame.bind(C8,W)(),g=y(K(W)),n={};QV.Fragment=D,QV.jsxDEV=function(j,i,q1,Q1){var Y1=1e4>_1.recentlyCreatedOwnerStacks++;return R(j,i,q1,Q1,Y1?Error("react-stack-top-frame"):d,Y1?y(K(j)):g)}})()});var fR=j4((FV)=>{(function(){function Q(){if(C=!1,p){var u=FV.unstable_now();_1=u;var x=!0;try{_:{h=!1,P&&(P=!1,b(a),a=-1),k=!0;var d=V;try{J:{W(u);for(D=Z(M);D!==null&&!(D.expirationTime>u&&B());){var g=D.callback;if(typeof g==="function"){D.callback=null,V=D.priorityLevel;var n=g(D.expirationTime<=u);if(u=FV.unstable_now(),typeof n==="function"){D.callback=n,W(u),x=!0;break J}D===Z(M)&&K(M),W(u)}else K(M);D=Z(M)}if(D!==null)x=!0;else{var j=Z(f);j!==null&&O(z,j.startTime-u),x=!1}}break _}finally{D=null,V=d,k=!1}x=void 0}}finally{x?$1():p=!1}}}function U(u,x){var d=u.length;u.push(x);_:for(;0<d;){var g=d-1>>>1,n=u[g];if(0<X(n,x))u[g]=x,u[d]=n,d=g;else break _}}function Z(u){return u.length===0?null:u[0]}function K(u){if(u.length===0)return null;var x=u[0],d=u.pop();if(d!==x){u[0]=d;_:for(var g=0,n=u.length,j=n>>>1;g<j;){var i=2*(g+1)-1,q1=u[i],Q1=i+1,Y1=u[Q1];if(0>X(q1,d))Q1<n&&0>X(Y1,q1)?(u[g]=Y1,u[Q1]=d,g=Q1):(u[g]=q1,u[i]=d,g=i);else if(Q1<n&&0>X(Y1,d))u[g]=Y1,u[Q1]=d,g=Q1;else break _}}return x}function X(u,x){var d=u.sortIndex-x.sortIndex;return d!==0?d:u.id-x.id}function W(u){for(var x=Z(f);x!==null;){if(x.callback===null)K(f);else if(x.startTime<=u)K(f),x.sortIndex=x.expirationTime,U(M,x);else break;x=Z(f)}}function z(u){if(P=!1,W(u),!h)if(Z(M)!==null)h=!0,p||(p=!0,$1());else{var x=Z(f);x!==null&&O(z,x.startTime-u)}}function B(){return C?!0:FV.unstable_now()-_1<m?!1:!0}function O(u,x){a=v(function(){u(FV.unstable_now())},x)}if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()),FV.unstable_now=void 0,typeof performance==="object"&&typeof performance.now==="function"){var T=performance;FV.unstable_now=function(){return T.now()}}else{var R=Date,L=R.now();FV.unstable_now=function(){return R.now()-L}}var M=[],f=[],I=1,D=null,V=3,k=!1,h=!1,P=!1,C=!1,v=typeof setTimeout==="function"?setTimeout:null,b=typeof clearTimeout==="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null,p=!1,a=-1,m=5,_1=-1;if(typeof E==="function")var $1=function(){E(Q)};else if(typeof MessageChannel<"u"){var J1=new MessageChannel,y=J1.port2;J1.port1.onmessage=Q,$1=function(){y.postMessage(null)}}else $1=function(){v(Q,0)};FV.unstable_IdlePriority=5,FV.unstable_ImmediatePriority=1,FV.unstable_LowPriority=4,FV.unstable_NormalPriority=3,FV.unstable_Profiling=null,FV.unstable_UserBlockingPriority=2,FV.unstable_cancelCallback=function(u){u.callback=null},FV.unstable_forceFrameRate=function(u){0>u||125<u?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):m=0<u?Math.floor(1000/u):5},FV.unstable_getCurrentPriorityLevel=function(){return V},FV.unstable_next=function(u){switch(V){case 1:case 2:case 3:var x=3;break;default:x=V}var d=V;V=x;try{return u()}finally{V=d}},FV.unstable_requestPaint=function(){C=!0},FV.unstable_runWithPriority=function(u,x){switch(u){case 1:case 2:case 3:case 4:case 5:break;default:u=3}var d=V;V=u;try{return x()}finally{V=d}},FV.unstable_scheduleCallback=function(u,x,d){var g=FV.unstable_now();switch(typeof d==="object"&&d!==null?(d=d.delay,d=typeof d==="number"&&0<d?g+d:g):d=g,u){case 1:var n=-1;break;case 2:n=250;break;case 5:n=1073741823;break;case 4:n=1e4;break;default:n=5000}return n=d+n,u={id:I++,callback:x,priorityLevel:u,startTime:d,expirationTime:n,sortIndex:-1},d>g?(u.sortIndex=d,U(f,u),Z(M)===null&&u===Z(f)&&(P?(b(a),a=-1):P=!0,O(z,d-g))):(u.sortIndex=n,U(M,u),h||k||(h=!0,p||(p=!0,$1()))),u},FV.unstable_shouldYield=B,FV.unstable_wrapCallback=function(u){var x=V;return function(){var d=V;V=x;try{return u.apply(this,arguments)}finally{V=d}}},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var PR=j4((KV)=>{var K0=u0(fR()),$9=u0(i5()),hX=u0(PX());(function(){function Q(_,J){for(_=_.memoizedState;_!==null&&0<J;)_=_.next,J--;return _}function U(_,J,$,q){if($>=J.length)return q;var G=J[$],F=s0(_)?_.slice():o1({},_);return F[G]=U(_[G],J,$+1,q),F}function Z(_,J,$){if(J.length!==$.length)console.warn("copyWithRename() expects paths of the same length");else{for(var q=0;q<$.length-1;q++)if(J[q]!==$[q]){console.warn("copyWithRename() expects paths to be the same except for the deepest key");return}return K(_,J,$,0)}}function K(_,J,$,q){var G=J[q],F=s0(_)?_.slice():o1({},_);return q+1===J.length?(F[$[q]]=F[G],s0(F)?F.splice(G,1):delete F[G]):F[G]=K(_[G],J,$,q+1),F}function X(_,J,$){var q=J[$],G=s0(_)?_.slice():o1({},_);if($+1===J.length)return s0(G)?G.splice(q,1):delete G[q],G;return G[q]=X(_[q],J,$+1),G}function W(){return!1}function z(){return null}function B(){console.error("Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://react.dev/link/rules-of-hooks")}function O(){console.error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().")}function T(){}function R(){}function L(_){var J=[];return _.forEach(function($){J.push($)}),J.sort().join(", ")}function M(_,J,$,q){return new BO(_,J,$,q)}function f(_,J){_.context===c3&&(aG(_.current,2,J,_,null,null),s8())}function I(_,J){if(O5!==null){var $=J.staleFamilies;J=J.updatedFamilies,x9(),TH(_.current,J,$),s8()}}function D(_){O5=_}function V(_){return!(!_||_.nodeType!==1&&_.nodeType!==9&&_.nodeType!==11)}function k(_){var J=_,$=_;if(_.alternate)for(;J.return;)J=J.return;else{_=J;do J=_,(J.flags&4098)!==0&&($=J.return),_=J.return;while(_)}return J.tag===3?$:null}function h(_){if(_.tag===13){var J=_.memoizedState;if(J===null&&(_=_.alternate,_!==null&&(J=_.memoizedState)),J!==null)return J.dehydrated}return null}function P(_){if(_.tag===31){var J=_.memoizedState;if(J===null&&(_=_.alternate,_!==null&&(J=_.memoizedState)),J!==null)return J.dehydrated}return null}function C(_){if(k(_)!==_)throw Error("Unable to find node on an unmounted component.")}function v(_){var J=_.alternate;if(!J){if(J=k(_),J===null)throw Error("Unable to find node on an unmounted component.");return J!==_?null:_}for(var $=_,q=J;;){var G=$.return;if(G===null)break;var F=G.alternate;if(F===null){if(q=G.return,q!==null){$=q;continue}break}if(G.child===F.child){for(F=G.child;F;){if(F===$)return C(G),_;if(F===q)return C(G),J;F=F.sibling}throw Error("Unable to find node on an unmounted component.")}if($.return!==q.return)$=G,q=F;else{for(var Y=!1,A=G.child;A;){if(A===$){Y=!0,$=G,q=F;break}if(A===q){Y=!0,q=G,$=F;break}A=A.sibling}if(!Y){for(A=F.child;A;){if(A===$){Y=!0,$=F,q=G;break}if(A===q){Y=!0,q=F,$=G;break}A=A.sibling}if(!Y)throw Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.")}}if($.alternate!==q)throw Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.")}if($.tag!==3)throw Error("Unable to find node on an unmounted component.");return $.stateNode.current===$?_:J}function b(_){var J=_.tag;if(J===5||J===26||J===27||J===6)return _;for(_=_.child;_!==null;){if(J=b(_),J!==null)return J;_=_.sibling}return null}function E(_){if(_===null||typeof _!=="object")return null;return _=Nz&&_[Nz]||_["@@iterator"],typeof _==="function"?_:null}function p(_){if(_==null)return null;if(typeof _==="function")return _.$$typeof===bw?null:_.displayName||_.name||null;if(typeof _==="string")return _;switch(_){case $7:return"Fragment";case _Z:return"Profiler";case i$:return"StrictMode";case $Z:return"Suspense";case QZ:return"SuspenseList";case qZ:return"Activity"}if(typeof _==="object")switch(typeof _.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),_.$$typeof){case J7:return"Portal";case M4:return _.displayName||"Context";case JZ:return(_._context.displayName||"Context")+".Consumer";case a9:var J=_.render;return _=_.displayName,_||(_=J.displayName||J.name||"",_=_!==""?"ForwardRef("+_+")":"ForwardRef"),_;case a$:return J=_.displayName||null,J!==null?J:p(_.type)||"Memo";case U5:J=_._payload,_=_._init;try{return p(_(J))}catch($){}}return null}function a(_){return typeof _.tag==="number"?m(_):typeof _.name==="string"?_.name:null}function m(_){var J=_.type;switch(_.tag){case 31:return"Activity";case 24:return"Cache";case 9:return(J._context.displayName||"Context")+".Consumer";case 10:return J.displayName||"Context";case 18:return"DehydratedFragment";case 11:return _=J.render,_=_.displayName||_.name||"",J.displayName||(_!==""?"ForwardRef("+_+")":"ForwardRef");case 7:return"Fragment";case 26:case 27:case 5:return J;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return p(J);case 8:return J===i$?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 14:case 15:if(typeof J==="function")return J.displayName||J.name||null;if(typeof J==="string")return J;break;case 29:if(J=_._debugInfo,J!=null){for(var $=J.length-1;0<=$;$--)if(typeof J[$].name==="string")return J[$].name}if(_.return!==null)return m(_.return)}return null}function _1(_){return{current:_}}function $1(_,J){0>a4?console.error("Unexpected pop."):(J!==GZ[a4]&&console.error("Unexpected Fiber popped."),_.current=UZ[a4],UZ[a4]=null,GZ[a4]=null,a4--)}function J1(_,J,$){a4++,UZ[a4]=_.current,GZ[a4]=$,_.current=J}function y(_){return _===null&&console.error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue."),_}function u(_,J){J1(u3,J,_),J1(s9,_,_),J1(b3,null,_);var $=J.nodeType;switch($){case 9:case 11:$=$===9?"#document":"#fragment",J=(J=J.documentElement)?(J=J.namespaceURI)?tW(J):F3:F3;break;default:if($=J.tagName,J=J.namespaceURI)J=tW(J),J=oW(J,$);else switch($){case"svg":J=b7;break;case"math":J=dQ;break;default:J=F3}}$=$.toLowerCase(),$=W9(null,$),$={context:J,ancestorInfo:$},$1(b3,_),J1(b3,$,_)}function x(_){$1(b3,_),$1(s9,_),$1(u3,_)}function d(){return y(b3.current)}function g(_){_.memoizedState!==null&&J1(s$,_,_);var J=y(b3.current),$=_.type,q=oW(J.context,$);$=W9(J.ancestorInfo,$),q={context:q,ancestorInfo:$},J!==q&&(J1(s9,_,_),J1(b3,q,_))}function n(_){s9.current===_&&($1(b3,_),$1(s9,_)),s$.current===_&&($1(s$,_),m_._currentValue=K8)}function j(){}function i(){if(t9===0){Cz=console.log,Sz=console.info,jz=console.warn,Vz=console.error,kz=console.group,Dz=console.groupCollapsed,yz=console.groupEnd;var _={configurable:!0,enumerable:!0,value:j,writable:!0};Object.defineProperties(console,{info:_,log:_,warn:_,error:_,group:_,groupCollapsed:_,groupEnd:_})}t9++}function q1(){if(t9--,t9===0){var _={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:o1({},_,{value:Cz}),info:o1({},_,{value:Sz}),warn:o1({},_,{value:jz}),error:o1({},_,{value:Vz}),group:o1({},_,{value:kz}),groupCollapsed:o1({},_,{value:Dz}),groupEnd:o1({},_,{value:yz})})}0>t9&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function Q1(_){var J=Error.prepareStackTrace;if(Error.prepareStackTrace=void 0,_=_.stack,Error.prepareStackTrace=J,_.startsWith(`Error: react-stack-top-frame
28
28
  `)&&(_=_.slice(29)),J=_.indexOf(`
29
29
  `),J!==-1&&(_=_.slice(J+1)),J=_.indexOf("react_stack_bottom_frame"),J!==-1&&(J=_.lastIndexOf(`
30
30
  `,J)),J!==-1)_=_.slice(0,J);else return"";return _}function Y1(_){if(ZZ===void 0)try{throw Error()}catch($){var J=$.stack.trim().match(/\n( *(at )?)/);ZZ=J&&J[1]||"",vz=-1<$.stack.indexOf(`
@@ -233,16 +233,16 @@ Check the render method of \``+G+"`."),F||q&&(F=`
233
233
  Check the top-level render call using <`+q+">.");var Y="";$!=null&&_!==$&&(q=null,typeof $.tag==="number"?q=m($):typeof $.name==="string"&&(q=$.name),q&&(Y=" It was passed a child from "+q+".")),W1(J,function(){console.error('Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',F,Y)})}}};var o6=gH(!0),tB=gH(!1),oB=0,nB=1,eB=2,dZ=3,t3=!1,_A=!1,iZ=null,aZ=!1,I7=_1(null),OQ=_1(0),K5=_1(null),N5=null,f7=1,w_=2,m0=_1(0),wQ=0,C5=1,v2=2,X5=4,E2=8,P7,JA=new Set,$A=new Set,sZ=new Set,QA=new Set,Q3=0,g1=null,L0=null,l0=null,IQ=!1,N7=!1,n6=!1,fQ=0,I_=0,q3=null,$f=0,Qf=25,G1=null,S5=null,U3=-1,f_=!1,P_={readContext:f0,use:D3,useCallback:E0,useContext:E0,useEffect:E0,useImperativeHandle:E0,useLayoutEffect:E0,useInsertionEffect:E0,useMemo:E0,useReducer:E0,useRef:E0,useState:E0,useDebugValue:E0,useDeferredValue:E0,useTransition:E0,useSyncExternalStore:E0,useId:E0,useHostTransitionStatus:E0,useFormState:E0,useActionState:E0,useOptimistic:E0,useMemoCache:E0,useCacheRefresh:E0};P_.useEffectEvent=E0;var tZ=null,qA=null,oZ=null,UA=null,C4=null,c5=null,PQ=null;tZ={readContext:function(_){return f0(_)},use:D3,useCallback:function(_,J){return G1="useCallback",t1(),p8(J),aU(_,J)},useContext:function(_){return G1="useContext",t1(),f0(_)},useEffect:function(_,J){return G1="useEffect",t1(),p8(J),M$(_,J)},useImperativeHandle:function(_,J,$){return G1="useImperativeHandle",t1(),p8($),iU(_,J,$)},useInsertionEffect:function(_,J){G1="useInsertionEffect",t1(),p8(J),b6(4,v2,_,J)},useLayoutEffect:function(_,J){return G1="useLayoutEffect",t1(),p8(J),dU(_,J)},useMemo:function(_,J){G1="useMemo",t1(),p8(J);var $=Z1.H;Z1.H=C4;try{return sU(_,J)}finally{Z1.H=$}},useReducer:function(_,J,$){G1="useReducer",t1();var q=Z1.H;Z1.H=C4;try{return uU(_,J,$)}finally{Z1.H=q}},useRef:function(_){return G1="useRef",t1(),lU(_)},useState:function(_){G1="useState",t1();var J=Z1.H;Z1.H=C4;try{return gU(_)}finally{Z1.H=J}},useDebugValue:function(){G1="useDebugValue",t1()},useDeferredValue:function(_,J){return G1="useDeferredValue",t1(),tU(_,J)},useTransition:function(){return G1="useTransition",t1(),eU()},useSyncExternalStore:function(_,J,$){return G1="useSyncExternalStore",t1(),hU(_,J,$)},useId:function(){return G1="useId",t1(),_G()},useFormState:function(_,J){return G1="useFormState",t1(),W$(),l8(_,J)},useActionState:function(_,J){return G1="useActionState",t1(),l8(_,J)},useOptimistic:function(_){return G1="useOptimistic",t1(),pU(_)},useHostTransitionStatus:u6,useMemoCache:E6,useCacheRefresh:function(){return G1="useCacheRefresh",t1(),JG()},useEffectEvent:function(_){return G1="useEffectEvent",t1(),rU(_)}},qA={readContext:function(_){return f0(_)},use:D3,useCallback:function(_,J){return G1="useCallback",z1(),aU(_,J)},useContext:function(_){return G1="useContext",z1(),f0(_)},useEffect:function(_,J){return G1="useEffect",z1(),M$(_,J)},useImperativeHandle:function(_,J,$){return G1="useImperativeHandle",z1(),iU(_,J,$)},useInsertionEffect:function(_,J){G1="useInsertionEffect",z1(),b6(4,v2,_,J)},useLayoutEffect:function(_,J){return G1="useLayoutEffect",z1(),dU(_,J)},useMemo:function(_,J){G1="useMemo",z1();var $=Z1.H;Z1.H=C4;try{return sU(_,J)}finally{Z1.H=$}},useReducer:function(_,J,$){G1="useReducer",z1();var q=Z1.H;Z1.H=C4;try{return uU(_,J,$)}finally{Z1.H=q}},useRef:function(_){return G1="useRef",z1(),lU(_)},useState:function(_){G1="useState",z1();var J=Z1.H;Z1.H=C4;try{return gU(_)}finally{Z1.H=J}},useDebugValue:function(){G1="useDebugValue",z1()},useDeferredValue:function(_,J){return G1="useDeferredValue",z1(),tU(_,J)},useTransition:function(){return G1="useTransition",z1(),eU()},useSyncExternalStore:function(_,J,$){return G1="useSyncExternalStore",z1(),hU(_,J,$)},useId:function(){return G1="useId",z1(),_G()},useActionState:function(_,J){return G1="useActionState",z1(),l8(_,J)},useFormState:function(_,J){return G1="useFormState",z1(),W$(),l8(_,J)},useOptimistic:function(_){return G1="useOptimistic",z1(),pU(_)},useHostTransitionStatus:u6,useMemoCache:E6,useCacheRefresh:function(){return G1="useCacheRefresh",z1(),JG()},useEffectEvent:function(_){return G1="useEffectEvent",z1(),rU(_)}},oZ={readContext:function(_){return f0(_)},use:D3,useCallback:function(_,J){return G1="useCallback",z1(),O$(_,J)},useContext:function(_){return G1="useContext",z1(),f0(_)},useEffect:function(_,J){G1="useEffect",z1(),c2(2048,E2,_,J)},useImperativeHandle:function(_,J,$){return G1="useImperativeHandle",z1(),R$(_,J,$)},useInsertionEffect:function(_,J){return G1="useInsertionEffect",z1(),c2(4,v2,_,J)},useLayoutEffect:function(_,J){return G1="useLayoutEffect",z1(),c2(4,X5,_,J)},useMemo:function(_,J){G1="useMemo",z1();var $=Z1.H;Z1.H=c5;try{return w$(_,J)}finally{Z1.H=$}},useReducer:function(_,J,$){G1="useReducer",z1();var q=Z1.H;Z1.H=c5;try{return c8(_,J,$)}finally{Z1.H=q}},useRef:function(){return G1="useRef",z1(),W0().memoizedState},useState:function(){G1="useState",z1();var _=Z1.H;Z1.H=c5;try{return c8(u5)}finally{Z1.H=_}},useDebugValue:function(){G1="useDebugValue",z1()},useDeferredValue:function(_,J){return G1="useDeferredValue",z1(),KY(_,J)},useTransition:function(){return G1="useTransition",z1(),BY()},useSyncExternalStore:function(_,J,$){return G1="useSyncExternalStore",z1(),B$(_,J,$)},useId:function(){return G1="useId",z1(),W0().memoizedState},useFormState:function(_){return G1="useFormState",z1(),W$(),A$(_)},useActionState:function(_){return G1="useActionState",z1(),A$(_)},useOptimistic:function(_,J){return G1="useOptimistic",z1(),eH(_,J)},useHostTransitionStatus:u6,useMemoCache:E6,useCacheRefresh:function(){return G1="useCacheRefresh",z1(),W0().memoizedState},useEffectEvent:function(_){return G1="useEffectEvent",z1(),T$(_)}},UA={readContext:function(_){return f0(_)},use:D3,useCallback:function(_,J){return G1="useCallback",z1(),O$(_,J)},useContext:function(_){return G1="useContext",z1(),f0(_)},useEffect:function(_,J){G1="useEffect",z1(),c2(2048,E2,_,J)},useImperativeHandle:function(_,J,$){return G1="useImperativeHandle",z1(),R$(_,J,$)},useInsertionEffect:function(_,J){return G1="useInsertionEffect",z1(),c2(4,v2,_,J)},useLayoutEffect:function(_,J){return G1="useLayoutEffect",z1(),c2(4,X5,_,J)},useMemo:function(_,J){G1="useMemo",z1();var $=Z1.H;Z1.H=PQ;try{return w$(_,J)}finally{Z1.H=$}},useReducer:function(_,J,$){G1="useReducer",z1();var q=Z1.H;Z1.H=PQ;try{return V9(_,J,$)}finally{Z1.H=q}},useRef:function(){return G1="useRef",z1(),W0().memoizedState},useState:function(){G1="useState",z1();var _=Z1.H;Z1.H=PQ;try{return V9(u5)}finally{Z1.H=_}},useDebugValue:function(){G1="useDebugValue",z1()},useDeferredValue:function(_,J){return G1="useDeferredValue",z1(),XY(_,J)},useTransition:function(){return G1="useTransition",z1(),AY()},useSyncExternalStore:function(_,J,$){return G1="useSyncExternalStore",z1(),B$(_,J,$)},useId:function(){return G1="useId",z1(),W0().memoizedState},useFormState:function(_){return G1="useFormState",z1(),W$(),L$(_)},useActionState:function(_){return G1="useActionState",z1(),L$(_)},useOptimistic:function(_,J){return G1="useOptimistic",z1(),JY(_,J)},useHostTransitionStatus:u6,useMemoCache:E6,useCacheRefresh:function(){return G1="useCacheRefresh",z1(),W0().memoizedState},useEffectEvent:function(_){return G1="useEffectEvent",z1(),T$(_)}},C4={readContext:function(_){return O(),f0(_)},use:function(_){return B(),D3(_)},useCallback:function(_,J){return G1="useCallback",B(),t1(),aU(_,J)},useContext:function(_){return G1="useContext",B(),t1(),f0(_)},useEffect:function(_,J){return G1="useEffect",B(),t1(),M$(_,J)},useImperativeHandle:function(_,J,$){return G1="useImperativeHandle",B(),t1(),iU(_,J,$)},useInsertionEffect:function(_,J){G1="useInsertionEffect",B(),t1(),b6(4,v2,_,J)},useLayoutEffect:function(_,J){return G1="useLayoutEffect",B(),t1(),dU(_,J)},useMemo:function(_,J){G1="useMemo",B(),t1();var $=Z1.H;Z1.H=C4;try{return sU(_,J)}finally{Z1.H=$}},useReducer:function(_,J,$){G1="useReducer",B(),t1();var q=Z1.H;Z1.H=C4;try{return uU(_,J,$)}finally{Z1.H=q}},useRef:function(_){return G1="useRef",B(),t1(),lU(_)},useState:function(_){G1="useState",B(),t1();var J=Z1.H;Z1.H=C4;try{return gU(_)}finally{Z1.H=J}},useDebugValue:function(){G1="useDebugValue",B(),t1()},useDeferredValue:function(_,J){return G1="useDeferredValue",B(),t1(),tU(_,J)},useTransition:function(){return G1="useTransition",B(),t1(),eU()},useSyncExternalStore:function(_,J,$){return G1="useSyncExternalStore",B(),t1(),hU(_,J,$)},useId:function(){return G1="useId",B(),t1(),_G()},useFormState:function(_,J){return G1="useFormState",B(),t1(),l8(_,J)},useActionState:function(_,J){return G1="useActionState",B(),t1(),l8(_,J)},useOptimistic:function(_){return G1="useOptimistic",B(),t1(),pU(_)},useMemoCache:function(_){return B(),E6(_)},useHostTransitionStatus:u6,useCacheRefresh:function(){return G1="useCacheRefresh",t1(),JG()},useEffectEvent:function(_){return G1="useEffectEvent",B(),t1(),rU(_)}},c5={readContext:function(_){return O(),f0(_)},use:function(_){return B(),D3(_)},useCallback:function(_,J){return G1="useCallback",B(),z1(),O$(_,J)},useContext:function(_){return G1="useContext",B(),z1(),f0(_)},useEffect:function(_,J){G1="useEffect",B(),z1(),c2(2048,E2,_,J)},useImperativeHandle:function(_,J,$){return G1="useImperativeHandle",B(),z1(),R$(_,J,$)},useInsertionEffect:function(_,J){return G1="useInsertionEffect",B(),z1(),c2(4,v2,_,J)},useLayoutEffect:function(_,J){return G1="useLayoutEffect",B(),z1(),c2(4,X5,_,J)},useMemo:function(_,J){G1="useMemo",B(),z1();var $=Z1.H;Z1.H=c5;try{return w$(_,J)}finally{Z1.H=$}},useReducer:function(_,J,$){G1="useReducer",B(),z1();var q=Z1.H;Z1.H=c5;try{return c8(_,J,$)}finally{Z1.H=q}},useRef:function(){return G1="useRef",B(),z1(),W0().memoizedState},useState:function(){G1="useState",B(),z1();var _=Z1.H;Z1.H=c5;try{return c8(u5)}finally{Z1.H=_}},useDebugValue:function(){G1="useDebugValue",B(),z1()},useDeferredValue:function(_,J){return G1="useDeferredValue",B(),z1(),KY(_,J)},useTransition:function(){return G1="useTransition",B(),z1(),BY()},useSyncExternalStore:function(_,J,$){return G1="useSyncExternalStore",B(),z1(),B$(_,J,$)},useId:function(){return G1="useId",B(),z1(),W0().memoizedState},useFormState:function(_){return G1="useFormState",B(),z1(),A$(_)},useActionState:function(_){return G1="useActionState",B(),z1(),A$(_)},useOptimistic:function(_,J){return G1="useOptimistic",B(),z1(),eH(_,J)},useMemoCache:function(_){return B(),E6(_)},useHostTransitionStatus:u6,useCacheRefresh:function(){return G1="useCacheRefresh",z1(),W0().memoizedState},useEffectEvent:function(_){return G1="useEffectEvent",B(),z1(),T$(_)}},PQ={readContext:function(_){return O(),f0(_)},use:function(_){return B(),D3(_)},useCallback:function(_,J){return G1="useCallback",B(),z1(),O$(_,J)},useContext:function(_){return G1="useContext",B(),z1(),f0(_)},useEffect:function(_,J){G1="useEffect",B(),z1(),c2(2048,E2,_,J)},useImperativeHandle:function(_,J,$){return G1="useImperativeHandle",B(),z1(),R$(_,J,$)},useInsertionEffect:function(_,J){return G1="useInsertionEffect",B(),z1(),c2(4,v2,_,J)},useLayoutEffect:function(_,J){return G1="useLayoutEffect",B(),z1(),c2(4,X5,_,J)},useMemo:function(_,J){G1="useMemo",B(),z1();var $=Z1.H;Z1.H=c5;try{return w$(_,J)}finally{Z1.H=$}},useReducer:function(_,J,$){G1="useReducer",B(),z1();var q=Z1.H;Z1.H=c5;try{return V9(_,J,$)}finally{Z1.H=q}},useRef:function(){return G1="useRef",B(),z1(),W0().memoizedState},useState:function(){G1="useState",B(),z1();var _=Z1.H;Z1.H=c5;try{return V9(u5)}finally{Z1.H=_}},useDebugValue:function(){G1="useDebugValue",B(),z1()},useDeferredValue:function(_,J){return G1="useDeferredValue",B(),z1(),XY(_,J)},useTransition:function(){return G1="useTransition",B(),z1(),AY()},useSyncExternalStore:function(_,J,$){return G1="useSyncExternalStore",B(),z1(),B$(_,J,$)},useId:function(){return G1="useId",B(),z1(),W0().memoizedState},useFormState:function(_){return G1="useFormState",B(),z1(),L$(_)},useActionState:function(_){return G1="useActionState",B(),z1(),L$(_)},useOptimistic:function(_,J){return G1="useOptimistic",B(),z1(),JY(_,J)},useMemoCache:function(_){return B(),E6(_)},useHostTransitionStatus:u6,useCacheRefresh:function(){return G1="useCacheRefresh",z1(),W0().memoizedState},useEffectEvent:function(_){return G1="useEffectEvent",B(),z1(),T$(_)}};var GA={},ZA=new Set,FA=new Set,KA=new Set,XA=new Set,HA=new Set,YA=new Set,WA=new Set,zA=new Set,BA=new Set,AA=new Set;Object.freeze(GA);var nZ={enqueueSetState:function(_,J,$){_=_._reactInternals;var q=Q5(_),G=S3(q);G.payload=J,$!==void 0&&$!==null&&(QG($),G.callback=$),J=j3(_,G,q),J!==null&&(q4(q,"this.setState()",_),k0(J,_,q),N9(J,_,q))},enqueueReplaceState:function(_,J,$){_=_._reactInternals;var q=Q5(_),G=S3(q);G.tag=nB,G.payload=J,$!==void 0&&$!==null&&(QG($),G.callback=$),J=j3(_,G,q),J!==null&&(q4(q,"this.replaceState()",_),k0(J,_,q),N9(J,_,q))},enqueueForceUpdate:function(_,J){_=_._reactInternals;var $=Q5(_),q=S3($);q.tag=eB,J!==void 0&&J!==null&&(QG(J),q.callback=J),J=j3(_,q,$),J!==null&&(q4($,"this.forceUpdate()",_),k0(J,_,$),N9(J,_,$))}},C7=null,eZ=null,_F=Error("This is not a real error. It's an implementation detail of React's selective hydration feature. If this leaks into userspace, it's a bug in React. Please file an issue."),r0=!1,LA={},MA={},TA={},RA={},S7=!1,OA={},NQ={},JF={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null},wA=!1,IA=null;IA=new Set;var G3=!1,d0=!1,$F=!1,fA=typeof WeakSet==="function"?WeakSet:Set,U2=null,j7=null,V7=null,i0=null,d2=!1,l5=null,t0=!1,N_=8192,qf={getCacheForType:function(_){var J=f0(p0),$=J.data.get(_);return $===void 0&&($=_(),J.data.set(_,$)),$},cacheSignal:function(){return f0(p0).controller.signal},getOwner:function(){return G5}};if(typeof Symbol==="function"&&Symbol.for){var C_=Symbol.for;C_("selector.component"),C_("selector.has_pseudo_class"),C_("selector.role"),C_("selector.test_id"),C_("selector.text")}var Uf=[],Gf=typeof WeakMap==="function"?WeakMap:Map,G2=0,o0=2,H5=4,Z3=0,S_=1,e6=2,CQ=3,o3=4,SQ=6,PA=5,Z0=G2,M0=null,s1=null,a1=0,i2=0,jQ=1,_8=2,j_=3,NA=4,QF=5,V_=6,VQ=7,qF=8,J8=9,z0=i2,Y5=null,n3=!1,k7=!1,UF=!1,S4=0,j0=Z3,e3=0,_6=0,GF=0,a2=0,$8=0,k_=null,b2=null,kQ=!1,DQ=0,CA=0,SA=300,yQ=1/0,jA=500,D_=null,b0=null,J6=null,vQ=0,ZF=1,FF=2,VA=3,$6=0,kA=1,DA=2,yA=3,vA=4,EQ=5,a0=0,Q6=null,D7=null,r5=0,KF=0,XF=-0,HF=null,EA=null,bA=null,d5=vQ,uA=null,Zf=50,y_=0,YF=null,WF=!1,bQ=!1,Ff=50,Q8=0,v_=null,y7=!1,uQ=null,xA=!1,hA=new Set,Kf={},xQ=null,v7=null,zF=!1,BF=!1,hQ=!1,AF=!1,q6=0,LF={};(function(){for(var _=0;_<SZ.length;_++){var J=SZ[_],$=J.toLowerCase();J=J[0].toUpperCase()+J.slice(1),b5($,"on"+J)}b5(BB,"onAnimationEnd"),b5(AB,"onAnimationIteration"),b5(LB,"onAnimationStart"),b5("dblclick","onDoubleClick"),b5("focusin","onFocus"),b5("focusout","onBlur"),b5(hI,"onTransitionRun"),b5(mI,"onTransitionStart"),b5(gI,"onTransitionCancel"),b5(MB,"onTransitionEnd")})(),N2("onMouseEnter",["mouseout","mouseover"]),N2("onMouseLeave",["mouseout","mouseover"]),N2("onPointerEnter",["pointerout","pointerover"]),N2("onPointerLeave",["pointerout","pointerover"]),J2("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),J2("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),J2("onBeforeInput",["compositionend","keypress","textInput","paste"]),J2("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),J2("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),J2("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var E_="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(" "),MF=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(E_)),mQ="_reactListening"+Math.random().toString(36).slice(2),mA=!1,gA=!1,gQ=!1,pA=!1,pQ=!1,cQ=!1,cA=!1,lQ={},Xf=/\r\n?/g,Hf=/\u0000|\uFFFD/g,q8="http://www.w3.org/1999/xlink",TF="http://www.w3.org/XML/1998/namespace",Yf="javascript:throw new Error('React form unexpectedly submitted.')",Wf="suppressHydrationWarning",U8="&",rQ="/&",b_="$",u_="/$",U6="$?",G8="$~",E7="$!",zf="html",Bf="body",Af="head",RF="F!",lA="F",rA="loading",Lf="style",F3=0,b7=1,dQ=2,OF=null,wF=null,dA={dialog:!0,webview:!0},IF=null,x_=void 0,iA=typeof setTimeout==="function"?setTimeout:void 0,Mf=typeof clearTimeout==="function"?clearTimeout:void 0,Z8=-1,aA=typeof Promise==="function"?Promise:void 0,Tf=typeof queueMicrotask==="function"?queueMicrotask:typeof aA<"u"?function(_){return aA.resolve(null).then(_).catch(Qw)}:iA,fF=null,F8=0,h_=1,sA=2,tA=3,j5=4,V5=new Map,oA=new Set,K3=Y0.d;Y0.d={f:function(){var _=K3.f(),J=s8();return _||J},r:function(_){var J=h1(_);J!==null&&J.tag===5&&J.type==="form"?zY(J):K3.r(_)},D:function(_){K3.D(_),Zz("dns-prefetch",_,null)},C:function(_,J){K3.C(_,J),Zz("preconnect",_,J)},L:function(_,J,$){K3.L(_,J,$);var q=u7;if(q&&_&&J){var G='link[rel="preload"][as="'+g2(J)+'"]';J==="image"?$&&$.imageSrcSet?(G+='[imagesrcset="'+g2($.imageSrcSet)+'"]',typeof $.imageSizes==="string"&&(G+='[imagesizes="'+g2($.imageSizes)+'"]')):G+='[href="'+g2(_)+'"]':G+='[href="'+g2(_)+'"]';var F=G;switch(J){case"style":F=n8(_);break;case"script":F=e8(_)}V5.has(F)||(_=o1({rel:"preload",href:J==="image"&&$&&$.imageSrcSet?void 0:_,as:J},$),V5.set(F,_),q.querySelector(G)!==null||J==="style"&&q.querySelector(r9(F))||J==="script"&&q.querySelector(d9(F))||(J=q.createElement("link"),X2(J,"link",_),V1(J),q.head.appendChild(J)))}},m:function(_,J){K3.m(_,J);var $=u7;if($&&_){var q=J&&typeof J.as==="string"?J.as:"script",G='link[rel="modulepreload"][as="'+g2(q)+'"][href="'+g2(_)+'"]',F=G;switch(q){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":F=e8(_)}if(!V5.has(F)&&(_=o1({rel:"modulepreload",href:_},J),V5.set(F,_),$.querySelector(G)===null)){switch(q){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if($.querySelector(d9(F)))return}q=$.createElement("link"),X2(q,"link",_),V1(q),$.head.appendChild(q)}}},X:function(_,J){K3.X(_,J);var $=u7;if($&&_){var q=U0($).hoistableScripts,G=e8(_),F=q.get(G);F||(F=$.querySelector(d9(G)),F||(_=o1({src:_,async:!0},J),(J=V5.get(G))&&iG(_,J),F=$.createElement("script"),V1(F),X2(F,"link",_),$.head.appendChild(F)),F={type:"script",instance:F,count:1,state:null},q.set(G,F))}},S:function(_,J,$){K3.S(_,J,$);var q=u7;if(q&&_){var G=U0(q).hoistableStyles,F=n8(_);J=J||"default";var Y=G.get(F);if(!Y){var A={loading:F8,preload:null};if(Y=q.querySelector(r9(F)))A.loading=h_|j5;else{_=o1({rel:"stylesheet",href:_,"data-precedence":J},$),($=V5.get(F))&&dG(_,$);var w=Y=q.createElement("link");V1(w),X2(w,"link",_),w._p=new Promise(function(N,t){w.onload=N,w.onerror=t}),w.addEventListener("load",function(){A.loading|=h_}),w.addEventListener("error",function(){A.loading|=sA}),A.loading|=j5,g$(Y,J,q)}Y={type:"stylesheet",instance:Y,count:1,state:A},G.set(F,Y)}}},M:function(_,J){K3.M(_,J);var $=u7;if($&&_){var q=U0($).hoistableScripts,G=e8(_),F=q.get(G);F||(F=$.querySelector(d9(G)),F||(_=o1({src:_,async:!0,type:"module"},J),(J=V5.get(G))&&iG(_,J),F=$.createElement("script"),V1(F),X2(F,"link",_),$.head.appendChild(F)),F={type:"script",instance:F,count:1,state:null},q.set(G,F))}}};var u7=typeof document>"u"?null:document,iQ=null,Rf=60000,Of=800,wf=500,PF=0,NF=null,aQ=null,K8=uw,m_={$$typeof:M4,Provider:null,Consumer:null,_currentValue:K8,_currentValue2:K8,_threadCount:0},nA="%c%s%c",eA="background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px",_L="",sQ=" ",If=Function.prototype.bind,JL=!1,$L=null,QL=null,qL=null,UL=null,GL=null,ZL=null,FL=null,KL=null,XL=null,HL=null;$L=function(_,J,$,q){J=Q(_,J),J!==null&&($=U(J.memoizedState,$,0,q),J.memoizedState=$,J.baseState=$,_.memoizedProps=o1({},_.memoizedProps),$=M2(_,2),$!==null&&k0($,_,2))},QL=function(_,J,$){J=Q(_,J),J!==null&&($=X(J.memoizedState,$,0),J.memoizedState=$,J.baseState=$,_.memoizedProps=o1({},_.memoizedProps),$=M2(_,2),$!==null&&k0($,_,2))},qL=function(_,J,$,q){J=Q(_,J),J!==null&&($=Z(J.memoizedState,$,q),J.memoizedState=$,J.baseState=$,_.memoizedProps=o1({},_.memoizedProps),$=M2(_,2),$!==null&&k0($,_,2))},UL=function(_,J,$){_.pendingProps=U(_.memoizedProps,J,0,$),_.alternate&&(_.alternate.pendingProps=_.pendingProps),J=M2(_,2),J!==null&&k0(J,_,2)},GL=function(_,J){_.pendingProps=X(_.memoizedProps,J,0),_.alternate&&(_.alternate.pendingProps=_.pendingProps),J=M2(_,2),J!==null&&k0(J,_,2)},ZL=function(_,J,$){_.pendingProps=Z(_.memoizedProps,J,$),_.alternate&&(_.alternate.pendingProps=_.pendingProps),J=M2(_,2),J!==null&&k0(J,_,2)},FL=function(_){var J=M2(_,2);J!==null&&k0(J,_,2)},KL=function(_){var J=B2(),$=M2(_,J);$!==null&&k0($,_,J)},XL=function(_){z=_},HL=function(_){W=_};var tQ=!0,oQ=null,CF=!1,G6=null,Z6=null,F6=null,g_=new Map,p_=new Map,K6=[],ff="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(" "),nQ=null;if(d$.prototype.render=eG.prototype.render=function(_){var J=this._internalRoot;if(J===null)throw Error("Cannot update an unmounted root.");var $=arguments;typeof $[1]==="function"?console.error("does not support the second callback argument. To execute a side effect after rendering, declare it in a component body with useEffect()."):V($[1])?console.error("You passed a container to the second argument of root.render(...). You don't need to pass it again since you already passed it to create the root."):typeof $[1]<"u"&&console.error("You passed a second argument to root.render(...) but it only accepts one argument."),$=_;var q=J.current,G=Q5(q);aG(q,G,$,J,null,null)},d$.prototype.unmount=eG.prototype.unmount=function(){var _=arguments;if(typeof _[0]==="function"&&console.error("does not support a callback argument. To execute a side effect after rendering, declare it in a component body with useEffect()."),_=this._internalRoot,_!==null){this._internalRoot=null;var J=_.containerInfo;(Z0&(o0|H5))!==G2&&console.error("Attempted to synchronously unmount a root while React was already rendering. React cannot finish unmounting the root until the current render has completed, which may lead to a race condition."),aG(_.current,2,null,_,null,null),s8(),J[h3]=null}},d$.prototype.unstable_scheduleHydration=function(_){if(_){var J=e();_={blockedOn:null,target:_,priority:J};for(var $=0;$<K6.length&&J!==0&&J<K6[$].priority;$++);K6.splice($,0,_),$===0&&Oz(_)}},function(){var _=$9.version;if(_!=="19.2.7")throw Error(`Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:
234
234
  - react: `+(_+`
235
235
  - react-dom: 19.2.7
236
- Learn more: https://react.dev/warnings/version-mismatch`))}(),typeof Map==="function"&&Map.prototype!=null&&typeof Map.prototype.forEach==="function"&&typeof Set==="function"&&Set.prototype!=null&&typeof Set.prototype.clear==="function"&&typeof Set.prototype.forEach==="function"||console.error("React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://react.dev/link/react-polyfills"),Y0.findDOMNode=function(_){var J=_._reactInternals;if(J===void 0){if(typeof _.render==="function")throw Error("Unable to find node on an unmounted component.");throw _=Object.keys(_).join(","),Error("Argument appears to not be a ReactComponent. Keys: "+_)}return _=v(J),_=_!==null?b(_):null,_=_===null?null:_.stateNode,_},!function(){var _={bundleType:1,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:Z1,reconcilerVersion:"19.2.7"};return _.overrideHookState=$L,_.overrideHookStateDeletePath=QL,_.overrideHookStateRenamePath=qL,_.overrideProps=UL,_.overridePropsDeletePath=GL,_.overridePropsRenamePath=ZL,_.scheduleUpdate=FL,_.scheduleRetry=KL,_.setErrorHandler=XL,_.setSuspenseHandler=HL,_.scheduleRefresh=f,_.scheduleRoot=I,_.setRefreshHandler=D,_.getCurrentFiber=jw,Z2(_)}()&&I4&&window.top===window.self&&(-1<navigator.userAgent.indexOf("Chrome")&&navigator.userAgent.indexOf("Edge")===-1||-1<navigator.userAgent.indexOf("Firefox"))){var YL=window.location.protocol;/^(https?|file):$/.test(YL)&&console.info("%cDownload the React DevTools for a better development experience: https://react.dev/link/react-devtools"+(YL==="file:"?`
236
+ Learn more: https://react.dev/warnings/version-mismatch`))}(),typeof Map==="function"&&Map.prototype!=null&&typeof Map.prototype.forEach==="function"&&typeof Set==="function"&&Set.prototype!=null&&typeof Set.prototype.clear==="function"&&typeof Set.prototype.forEach==="function"||console.error("React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://react.dev/link/react-polyfills"),Y0.findDOMNode=function(_){var J=_._reactInternals;if(J===void 0){if(typeof _.render==="function")throw Error("Unable to find node on an unmounted component.");throw _=Object.keys(_).join(","),Error("Argument appears to not be a ReactComponent. Keys: "+_)}return _=v(J),_=_!==null?b(_):null,_=_===null?null:_.stateNode,_},!function(){var _={bundleType:1,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:Z1,reconcilerVersion:"19.2.7"};return _.overrideHookState=$L,_.overrideHookStateDeletePath=QL,_.overrideHookStateRenamePath=qL,_.overrideProps=UL,_.overridePropsDeletePath=GL,_.overridePropsRenamePath=ZL,_.scheduleUpdate=FL,_.scheduleRetry=KL,_.setErrorHandler=XL,_.setSuspenseHandler=HL,_.scheduleRefresh=I,_.scheduleRoot=f,_.setRefreshHandler=D,_.getCurrentFiber=jw,Z2(_)}()&&I4&&window.top===window.self&&(-1<navigator.userAgent.indexOf("Chrome")&&navigator.userAgent.indexOf("Edge")===-1||-1<navigator.userAgent.indexOf("Firefox"))){var YL=window.location.protocol;/^(https?|file):$/.test(YL)&&console.info("%cDownload the React DevTools for a better development experience: https://react.dev/link/react-devtools"+(YL==="file:"?`
237
237
  You might need to use a local HTTP server (instead of file://): https://react.dev/link/react-devtools-faq`:""),"font-weight:bold")}KV.createRoot=function(_,J){if(!V(_))throw Error("Target container is not a DOM element.");Pz(_);var $=!1,q="",G=wY,F=IY,Y=fY;return J!==null&&J!==void 0&&(J.hydrate?console.warn("hydrate through createRoot is deprecated. Use ReactDOMClient.hydrateRoot(container, <App />) instead."):typeof J==="object"&&J!==null&&J.$$typeof===L4&&console.error(`You passed a JSX element to createRoot. You probably meant to call root.render instead. Example usage:
238
238
 
239
239
  let root = createRoot(domContainer);
240
- root.render(<App />);`),J.unstable_strictMode===!0&&($=!0),J.identifierPrefix!==void 0&&(q=J.identifierPrefix),J.onUncaughtError!==void 0&&(G=J.onUncaughtError),J.onCaughtError!==void 0&&(F=J.onCaughtError),J.onRecoverableError!==void 0&&(Y=J.onRecoverableError)),J=zz(_,1,!1,null,null,$,q,null,G,F,Y,fz),_[h3]=J.current,vG(_),new eG(J)},KV.hydrateRoot=function(_,J,$){if(!V(_))throw Error("Target container is not a DOM element.");Pz(_),J===void 0&&console.error("Must provide initial children as second argument to hydrateRoot. Example usage: hydrateRoot(domContainer, <App />)");var q=!1,G="",F=wY,Y=IY,A=fY,w=null;return $!==null&&$!==void 0&&($.unstable_strictMode===!0&&(q=!0),$.identifierPrefix!==void 0&&(G=$.identifierPrefix),$.onUncaughtError!==void 0&&(F=$.onUncaughtError),$.onCaughtError!==void 0&&(Y=$.onCaughtError),$.onRecoverableError!==void 0&&(A=$.onRecoverableError),$.formState!==void 0&&(w=$.formState)),J=zz(_,1,!0,J,$!=null?$:null,q,G,w,F,Y,A,fz),J.context=Bz(null),$=J.current,q=Q5($),q=x4(q),G=S3(q),G.callback=null,j3($,G,q),q4(q,"hydrateRoot()",null),$=q,J.current.lanes=$,L2(J,$),B4(J),_[h3]=J.current,vG(_),new d$(J)},KV.version="19.2.7",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var CR=j4((pm,NR)=>{var XV=u0(PR());NR.exports=XV});var B1=u0(i5(),1);var F1=u0(zL(),1),K1=u0(i5(),1);function y0(Q){if(typeof Q==="string"||typeof Q==="number")return""+Q;let U="";if(Array.isArray(Q)){for(let Z=0,K;Z<Q.length;Z++)if((K=y0(Q[Z]))!=="")U+=(U&&" ")+K}else for(let Z in Q)if(Q[Z])U+=(U&&" ")+Z;return U}var Ef={value:()=>{}};function AL(){for(var Q=0,U=arguments.length,Z={},K;Q<U;++Q){if(!(K=arguments[Q]+"")||K in Z||/[\s.]/.test(K))throw Error("illegal type: "+K);Z[K]=[]}return new _q(Z)}function _q(Q){this._=Q}function bf(Q,U){return Q.trim().split(/^|\s+/).map(function(Z){var K="",X=Z.indexOf(".");if(X>=0)K=Z.slice(X+1),Z=Z.slice(0,X);if(Z&&!U.hasOwnProperty(Z))throw Error("unknown type: "+Z);return{type:Z,name:K}})}_q.prototype=AL.prototype={constructor:_q,on:function(Q,U){var Z=this._,K=bf(Q+"",Z),X,W=-1,z=K.length;if(arguments.length<2){while(++W<z)if((X=(Q=K[W]).type)&&(X=uf(Z[X],Q.name)))return X;return}if(U!=null&&typeof U!=="function")throw Error("invalid callback: "+U);while(++W<z)if(X=(Q=K[W]).type)Z[X]=BL(Z[X],Q.name,U);else if(U==null)for(X in Z)Z[X]=BL(Z[X],Q.name,null);return this},copy:function(){var Q={},U=this._;for(var Z in U)Q[Z]=U[Z].slice();return new _q(Q)},call:function(Q,U){if((X=arguments.length-2)>0)for(var Z=Array(X),K=0,X,W;K<X;++K)Z[K]=arguments[K+2];if(!this._.hasOwnProperty(Q))throw Error("unknown type: "+Q);for(W=this._[Q],K=0,X=W.length;K<X;++K)W[K].value.apply(U,Z)},apply:function(Q,U,Z){if(!this._.hasOwnProperty(Q))throw Error("unknown type: "+Q);for(var K=this._[Q],X=0,W=K.length;X<W;++X)K[X].value.apply(U,Z)}};function uf(Q,U){for(var Z=0,K=Q.length,X;Z<K;++Z)if((X=Q[Z]).name===U)return X.value}function BL(Q,U,Z){for(var K=0,X=Q.length;K<X;++K)if(Q[K].name===U){Q[K]=Ef,Q=Q.slice(0,K).concat(Q.slice(K+1));break}if(Z!=null)Q.push({name:U,value:Z});return Q}var H8=AL;function x7(Q){return function(){return this.matches(Q)}}function Jq(Q){return function(U){return U.matches(Q)}}var $q="http://www.w3.org/1999/xhtml",SF={svg:"http://www.w3.org/2000/svg",xhtml:$q,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function V4(Q){var U=Q+="",Z=U.indexOf(":");if(Z>=0&&(U=Q.slice(0,Z))!=="xmlns")Q=Q.slice(Z+1);return SF.hasOwnProperty(U)?{space:SF[U],local:Q}:Q}function jF(Q){let U;while(U=Q.sourceEvent)Q=U;return Q}function O2(Q,U){if(Q=jF(Q),U===void 0)U=Q.currentTarget;if(U){var Z=U.ownerSVGElement||U;if(Z.createSVGPoint){var K=Z.createSVGPoint();return K.x=Q.clientX,K.y=Q.clientY,K=K.matrixTransform(U.getScreenCTM().inverse()),[K.x,K.y]}if(U.getBoundingClientRect){var X=U.getBoundingClientRect();return[Q.clientX-X.left-U.clientLeft,Q.clientY-X.top-U.clientTop]}}return[Q.pageX,Q.pageY]}function xf(){}function X6(Q){return Q==null?xf:function(){return this.querySelector(Q)}}function VF(Q){if(typeof Q!=="function")Q=X6(Q);for(var U=this._groups,Z=U.length,K=Array(Z),X=0;X<Z;++X)for(var W=U[X],z=W.length,B=K[X]=Array(z),O,T,R=0;R<z;++R)if((O=W[R])&&(T=Q.call(O,O.__data__,R,W))){if("__data__"in O)T.__data__=O.__data__;B[R]=T}return new x0(K,this._parents)}function kF(Q){return Q==null?[]:Array.isArray(Q)?Q:Array.from(Q)}function hf(){return[]}function h7(Q){return Q==null?hf:function(){return this.querySelectorAll(Q)}}function mf(Q){return function(){return kF(Q.apply(this,arguments))}}function DF(Q){if(typeof Q==="function")Q=mf(Q);else Q=h7(Q);for(var U=this._groups,Z=U.length,K=[],X=[],W=0;W<Z;++W)for(var z=U[W],B=z.length,O,T=0;T<B;++T)if(O=z[T])K.push(Q.call(O,O.__data__,T,z)),X.push(O);return new x0(K,X)}var gf=Array.prototype.find;function pf(Q){return function(){return gf.call(this.children,Q)}}function cf(){return this.firstElementChild}function yF(Q){return this.select(Q==null?cf:pf(typeof Q==="function"?Q:Jq(Q)))}var lf=Array.prototype.filter;function rf(){return Array.from(this.children)}function df(Q){return function(){return lf.call(this.children,Q)}}function vF(Q){return this.selectAll(Q==null?rf:df(typeof Q==="function"?Q:Jq(Q)))}function EF(Q){if(typeof Q!=="function")Q=x7(Q);for(var U=this._groups,Z=U.length,K=Array(Z),X=0;X<Z;++X)for(var W=U[X],z=W.length,B=K[X]=[],O,T=0;T<z;++T)if((O=W[T])&&Q.call(O,O.__data__,T,W))B.push(O);return new x0(K,this._parents)}function c_(Q){return Array(Q.length)}function bF(){return new x0(this._enter||this._groups.map(c_),this._parents)}function l_(Q,U){this.ownerDocument=Q.ownerDocument,this.namespaceURI=Q.namespaceURI,this._next=null,this._parent=Q,this.__data__=U}l_.prototype={constructor:l_,appendChild:function(Q){return this._parent.insertBefore(Q,this._next)},insertBefore:function(Q,U){return this._parent.insertBefore(Q,U)},querySelector:function(Q){return this._parent.querySelector(Q)},querySelectorAll:function(Q){return this._parent.querySelectorAll(Q)}};function uF(Q){return function(){return Q}}function af(Q,U,Z,K,X,W){var z=0,B,O=U.length,T=W.length;for(;z<T;++z)if(B=U[z])B.__data__=W[z],K[z]=B;else Z[z]=new l_(Q,W[z]);for(;z<O;++z)if(B=U[z])X[z]=B}function sf(Q,U,Z,K,X,W,z){var B,O,T=new Map,R=U.length,L=W.length,M=Array(R),I;for(B=0;B<R;++B)if(O=U[B])if(M[B]=I=z.call(O,O.__data__,B,U)+"",T.has(I))X[B]=O;else T.set(I,O);for(B=0;B<L;++B)if(I=z.call(Q,W[B],B,W)+"",O=T.get(I))K[B]=O,O.__data__=W[B],T.delete(I);else Z[B]=new l_(Q,W[B]);for(B=0;B<R;++B)if((O=U[B])&&T.get(M[B])===O)X[B]=O}function tf(Q){return Q.__data__}function xF(Q,U){if(!arguments.length)return Array.from(this,tf);var Z=U?sf:af,K=this._parents,X=this._groups;if(typeof Q!=="function")Q=uF(Q);for(var W=X.length,z=Array(W),B=Array(W),O=Array(W),T=0;T<W;++T){var R=K[T],L=X[T],M=L.length,I=of(Q.call(R,R&&R.__data__,T,K)),f=I.length,D=B[T]=Array(f),V=z[T]=Array(f),k=O[T]=Array(M);Z(R,L,D,V,k,I,U);for(var h=0,P=0,C,v;h<f;++h)if(C=D[h]){if(h>=P)P=h+1;while(!(v=V[P])&&++P<f);C._next=v||null}}return z=new x0(z,K),z._enter=B,z._exit=O,z}function of(Q){return typeof Q==="object"&&"length"in Q?Q:Array.from(Q)}function hF(){return new x0(this._exit||this._groups.map(c_),this._parents)}function mF(Q,U,Z){var K=this.enter(),X=this,W=this.exit();if(typeof Q==="function"){if(K=Q(K),K)K=K.selection()}else K=K.append(Q+"");if(U!=null){if(X=U(X),X)X=X.selection()}if(Z==null)W.remove();else Z(W);return K&&X?K.merge(X).order():X}function gF(Q){var U=Q.selection?Q.selection():Q;for(var Z=this._groups,K=U._groups,X=Z.length,W=K.length,z=Math.min(X,W),B=Array(X),O=0;O<z;++O)for(var T=Z[O],R=K[O],L=T.length,M=B[O]=Array(L),I,f=0;f<L;++f)if(I=T[f]||R[f])M[f]=I;for(;O<X;++O)B[O]=Z[O];return new x0(B,this._parents)}function pF(){for(var Q=this._groups,U=-1,Z=Q.length;++U<Z;)for(var K=Q[U],X=K.length-1,W=K[X],z;--X>=0;)if(z=K[X]){if(W&&z.compareDocumentPosition(W)^4)W.parentNode.insertBefore(z,W);W=z}return this}function cF(Q){if(!Q)Q=nf;function U(L,M){return L&&M?Q(L.__data__,M.__data__):!L-!M}for(var Z=this._groups,K=Z.length,X=Array(K),W=0;W<K;++W){for(var z=Z[W],B=z.length,O=X[W]=Array(B),T,R=0;R<B;++R)if(T=z[R])O[R]=T;O.sort(U)}return new x0(X,this._parents).order()}function nf(Q,U){return Q<U?-1:Q>U?1:Q>=U?0:NaN}function lF(){var Q=arguments[0];return arguments[0]=this,Q.apply(null,arguments),this}function rF(){return Array.from(this)}function dF(){for(var Q=this._groups,U=0,Z=Q.length;U<Z;++U)for(var K=Q[U],X=0,W=K.length;X<W;++X){var z=K[X];if(z)return z}return null}function iF(){let Q=0;for(let U of this)++Q;return Q}function aF(){return!this.node()}function sF(Q){for(var U=this._groups,Z=0,K=U.length;Z<K;++Z)for(var X=U[Z],W=0,z=X.length,B;W<z;++W)if(B=X[W])Q.call(B,B.__data__,W,X);return this}function ef(Q){return function(){this.removeAttribute(Q)}}function _P(Q){return function(){this.removeAttributeNS(Q.space,Q.local)}}function JP(Q,U){return function(){this.setAttribute(Q,U)}}function $P(Q,U){return function(){this.setAttributeNS(Q.space,Q.local,U)}}function QP(Q,U){return function(){var Z=U.apply(this,arguments);if(Z==null)this.removeAttribute(Q);else this.setAttribute(Q,Z)}}function qP(Q,U){return function(){var Z=U.apply(this,arguments);if(Z==null)this.removeAttributeNS(Q.space,Q.local);else this.setAttributeNS(Q.space,Q.local,Z)}}function tF(Q,U){var Z=V4(Q);if(arguments.length<2){var K=this.node();return Z.local?K.getAttributeNS(Z.space,Z.local):K.getAttribute(Z)}return this.each((U==null?Z.local?_P:ef:typeof U==="function"?Z.local?qP:QP:Z.local?$P:JP)(Z,U))}function r_(Q){return Q.ownerDocument&&Q.ownerDocument.defaultView||Q.document&&Q||Q.defaultView}function UP(Q){return function(){this.style.removeProperty(Q)}}function GP(Q,U,Z){return function(){this.style.setProperty(Q,U,Z)}}function ZP(Q,U,Z){return function(){var K=U.apply(this,arguments);if(K==null)this.style.removeProperty(Q);else this.style.setProperty(Q,K,Z)}}function oF(Q,U,Z){return arguments.length>1?this.each((U==null?UP:typeof U==="function"?ZP:GP)(Q,U,Z==null?"":Z)):H6(this.node(),Q)}function H6(Q,U){return Q.style.getPropertyValue(U)||r_(Q).getComputedStyle(Q,null).getPropertyValue(U)}function FP(Q){return function(){delete this[Q]}}function KP(Q,U){return function(){this[Q]=U}}function XP(Q,U){return function(){var Z=U.apply(this,arguments);if(Z==null)delete this[Q];else this[Q]=Z}}function nF(Q,U){return arguments.length>1?this.each((U==null?FP:typeof U==="function"?XP:KP)(Q,U)):this.node()[Q]}function LL(Q){return Q.trim().split(/^|\s+/)}function eF(Q){return Q.classList||new ML(Q)}function ML(Q){this._node=Q,this._names=LL(Q.getAttribute("class")||"")}ML.prototype={add:function(Q){var U=this._names.indexOf(Q);if(U<0)this._names.push(Q),this._node.setAttribute("class",this._names.join(" "))},remove:function(Q){var U=this._names.indexOf(Q);if(U>=0)this._names.splice(U,1),this._node.setAttribute("class",this._names.join(" "))},contains:function(Q){return this._names.indexOf(Q)>=0}};function TL(Q,U){var Z=eF(Q),K=-1,X=U.length;while(++K<X)Z.add(U[K])}function RL(Q,U){var Z=eF(Q),K=-1,X=U.length;while(++K<X)Z.remove(U[K])}function HP(Q){return function(){TL(this,Q)}}function YP(Q){return function(){RL(this,Q)}}function WP(Q,U){return function(){(U.apply(this,arguments)?TL:RL)(this,Q)}}function _K(Q,U){var Z=LL(Q+"");if(arguments.length<2){var K=eF(this.node()),X=-1,W=Z.length;while(++X<W)if(!K.contains(Z[X]))return!1;return!0}return this.each((typeof U==="function"?WP:U?HP:YP)(Z,U))}function zP(){this.textContent=""}function BP(Q){return function(){this.textContent=Q}}function AP(Q){return function(){var U=Q.apply(this,arguments);this.textContent=U==null?"":U}}function JK(Q){return arguments.length?this.each(Q==null?zP:(typeof Q==="function"?AP:BP)(Q)):this.node().textContent}function LP(){this.innerHTML=""}function MP(Q){return function(){this.innerHTML=Q}}function TP(Q){return function(){var U=Q.apply(this,arguments);this.innerHTML=U==null?"":U}}function $K(Q){return arguments.length?this.each(Q==null?LP:(typeof Q==="function"?TP:MP)(Q)):this.node().innerHTML}function RP(){if(this.nextSibling)this.parentNode.appendChild(this)}function QK(){return this.each(RP)}function OP(){if(this.previousSibling)this.parentNode.insertBefore(this,this.parentNode.firstChild)}function qK(){return this.each(OP)}function wP(Q){return function(){var U=this.ownerDocument,Z=this.namespaceURI;return Z===$q&&U.documentElement.namespaceURI===$q?U.createElement(Q):U.createElementNS(Z,Q)}}function IP(Q){return function(){return this.ownerDocument.createElementNS(Q.space,Q.local)}}function d_(Q){var U=V4(Q);return(U.local?IP:wP)(U)}function UK(Q){var U=typeof Q==="function"?Q:d_(Q);return this.select(function(){return this.appendChild(U.apply(this,arguments))})}function fP(){return null}function GK(Q,U){var Z=typeof Q==="function"?Q:d_(Q),K=U==null?fP:typeof U==="function"?U:X6(U);return this.select(function(){return this.insertBefore(Z.apply(this,arguments),K.apply(this,arguments)||null)})}function PP(){var Q=this.parentNode;if(Q)Q.removeChild(this)}function ZK(){return this.each(PP)}function NP(){var Q=this.cloneNode(!1),U=this.parentNode;return U?U.insertBefore(Q,this.nextSibling):Q}function CP(){var Q=this.cloneNode(!0),U=this.parentNode;return U?U.insertBefore(Q,this.nextSibling):Q}function FK(Q){return this.select(Q?CP:NP)}function KK(Q){return arguments.length?this.property("__data__",Q):this.node().__data__}function SP(Q){return function(U){Q.call(this,U,this.__data__)}}function jP(Q){return Q.trim().split(/^|\s+/).map(function(U){var Z="",K=U.indexOf(".");if(K>=0)Z=U.slice(K+1),U=U.slice(0,K);return{type:U,name:Z}})}function VP(Q){return function(){var U=this.__on;if(!U)return;for(var Z=0,K=-1,X=U.length,W;Z<X;++Z)if(W=U[Z],(!Q.type||W.type===Q.type)&&W.name===Q.name)this.removeEventListener(W.type,W.listener,W.options);else U[++K]=W;if(++K)U.length=K;else delete this.__on}}function kP(Q,U,Z){return function(){var K=this.__on,X,W=SP(U);if(K){for(var z=0,B=K.length;z<B;++z)if((X=K[z]).type===Q.type&&X.name===Q.name){this.removeEventListener(X.type,X.listener,X.options),this.addEventListener(X.type,X.listener=W,X.options=Z),X.value=U;return}}if(this.addEventListener(Q.type,W,Z),X={type:Q.type,name:Q.name,value:U,listener:W,options:Z},!K)this.__on=[X];else K.push(X)}}function XK(Q,U,Z){var K=jP(Q+""),X,W=K.length,z;if(arguments.length<2){var B=this.node().__on;if(B){for(var O=0,T=B.length,R;O<T;++O)for(X=0,R=B[O];X<W;++X)if((z=K[X]).type===R.type&&z.name===R.name)return R.value}return}B=U?kP:VP;for(X=0;X<W;++X)this.each(B(K[X],U,Z));return this}function OL(Q,U,Z){var K=r_(Q),X=K.CustomEvent;if(typeof X==="function")X=new X(U,Z);else if(X=K.document.createEvent("Event"),Z)X.initEvent(U,Z.bubbles,Z.cancelable),X.detail=Z.detail;else X.initEvent(U,!1,!1);Q.dispatchEvent(X)}function DP(Q,U){return function(){return OL(this,Q,U)}}function yP(Q,U){return function(){return OL(this,Q,U.apply(this,arguments))}}function HK(Q,U){return this.each((typeof U==="function"?yP:DP)(Q,U))}function*YK(){for(var Q=this._groups,U=0,Z=Q.length;U<Z;++U)for(var K=Q[U],X=0,W=K.length,z;X<W;++X)if(z=K[X])yield z}var WK=[null];function x0(Q,U){this._groups=Q,this._parents=U}function wL(){return new x0([[document.documentElement]],WK)}function vP(){return this}x0.prototype=wL.prototype={constructor:x0,select:VF,selectAll:DF,selectChild:yF,selectChildren:vF,filter:EF,data:xF,enter:bF,exit:hF,join:mF,merge:gF,selection:vP,order:pF,sort:cF,call:lF,nodes:rF,node:dF,size:iF,empty:aF,each:sF,attr:tF,style:oF,property:nF,classed:_K,text:JK,html:$K,raise:QK,lower:qK,append:UK,insert:GK,remove:ZK,clone:FK,datum:KK,on:XK,dispatch:HK,[Symbol.iterator]:YK};var H3=wL;function n0(Q){return typeof Q==="string"?new x0([[document.querySelector(Q)]],[document.documentElement]):new x0([[Q]],WK)}var IL={passive:!1},Y8={capture:!0,passive:!1};function Qq(Q){Q.stopImmediatePropagation()}function Y3(Q){Q.preventDefault(),Q.stopImmediatePropagation()}function m7(Q){var U=Q.document.documentElement,Z=n0(Q).on("dragstart.drag",Y3,Y8);if("onselectstart"in U)Z.on("selectstart.drag",Y3,Y8);else U.__noselect=U.style.MozUserSelect,U.style.MozUserSelect="none"}function i_(Q,U){var Z=Q.document.documentElement,K=n0(Q).on("dragstart.drag",null);if(U)K.on("click.drag",Y3,Y8),setTimeout(function(){K.on("click.drag",null)},0);if("onselectstart"in Z)K.on("selectstart.drag",null);else Z.style.MozUserSelect=Z.__noselect,delete Z.__noselect}var a_=(Q)=>()=>Q;function s_(Q,{sourceEvent:U,subject:Z,target:K,identifier:X,active:W,x:z,y:B,dx:O,dy:T,dispatch:R}){Object.defineProperties(this,{type:{value:Q,enumerable:!0,configurable:!0},sourceEvent:{value:U,enumerable:!0,configurable:!0},subject:{value:Z,enumerable:!0,configurable:!0},target:{value:K,enumerable:!0,configurable:!0},identifier:{value:X,enumerable:!0,configurable:!0},active:{value:W,enumerable:!0,configurable:!0},x:{value:z,enumerable:!0,configurable:!0},y:{value:B,enumerable:!0,configurable:!0},dx:{value:O,enumerable:!0,configurable:!0},dy:{value:T,enumerable:!0,configurable:!0},_:{value:R}})}s_.prototype.on=function(){var Q=this._.on.apply(this._,arguments);return Q===this._?this:Q};function EP(Q){return!Q.ctrlKey&&!Q.button}function bP(){return this.parentNode}function uP(Q,U){return U==null?{x:Q.x,y:Q.y}:U}function xP(){return navigator.maxTouchPoints||"ontouchstart"in this}function t_(){var Q=EP,U=bP,Z=uP,K=xP,X={},W=H8("start","drag","end"),z=0,B,O,T,R,L=0;function M(C){C.on("mousedown.drag",I).filter(K).on("touchstart.drag",V).on("touchmove.drag",k,IL).on("touchend.drag touchcancel.drag",h).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function I(C,v){if(R||!Q.call(this,C,v))return;var b=P(this,U.call(this,C,v),C,v,"mouse");if(!b)return;n0(C.view).on("mousemove.drag",f,Y8).on("mouseup.drag",D,Y8),m7(C.view),Qq(C),T=!1,B=C.clientX,O=C.clientY,b("start",C)}function f(C){if(Y3(C),!T){var v=C.clientX-B,b=C.clientY-O;T=v*v+b*b>L}X.mouse("drag",C)}function D(C){n0(C.view).on("mousemove.drag mouseup.drag",null),i_(C.view,T),Y3(C),X.mouse("end",C)}function V(C,v){if(!Q.call(this,C,v))return;var b=C.changedTouches,E=U.call(this,C,v),p=b.length,a,m;for(a=0;a<p;++a)if(m=P(this,E,C,v,b[a].identifier,b[a]))Qq(C),m("start",C,b[a])}function k(C){var v=C.changedTouches,b=v.length,E,p;for(E=0;E<b;++E)if(p=X[v[E].identifier])Y3(C),p("drag",C,v[E])}function h(C){var v=C.changedTouches,b=v.length,E,p;if(R)clearTimeout(R);R=setTimeout(function(){R=null},500);for(E=0;E<b;++E)if(p=X[v[E].identifier])Qq(C),p("end",C,v[E])}function P(C,v,b,E,p,a){var m=W.copy(),_1=O2(a||b,v),$1,J1,y;if((y=Z.call(C,new s_("beforestart",{sourceEvent:b,target:M,identifier:p,active:z,x:_1[0],y:_1[1],dx:0,dy:0,dispatch:m}),E))==null)return;return $1=y.x-_1[0]||0,J1=y.y-_1[1]||0,function u(x,d,g){var n=_1,j;switch(x){case"start":X[p]=u,j=z++;break;case"end":delete X[p],--z;case"drag":_1=O2(g||d,v),j=z;break}m.call(x,C,new s_(x,{sourceEvent:d,subject:y,target:M,identifier:p,active:j,x:_1[0]+$1,y:_1[1]+J1,dx:_1[0]-n[0],dy:_1[1]-n[1],dispatch:m}),E)}}return M.filter=function(C){return arguments.length?(Q=typeof C==="function"?C:a_(!!C),M):Q},M.container=function(C){return arguments.length?(U=typeof C==="function"?C:a_(C),M):U},M.subject=function(C){return arguments.length?(Z=typeof C==="function"?C:a_(C),M):Z},M.touchable=function(C){return arguments.length?(K=typeof C==="function"?C:a_(!!C),M):K},M.on=function(){var C=W.on.apply(W,arguments);return C===W?M:C},M.clickDistance=function(C){return arguments.length?(L=(C=+C)*C,M):Math.sqrt(L)},M}function o_(Q,U,Z){Q.prototype=U.prototype=Z,Z.constructor=Q}function zK(Q,U){var Z=Object.create(Q.prototype);for(var K in U)Z[K]=U[K];return Z}function _J(){}var n_=0.7,Gq=1/n_,g7="\\s*([+-]?\\d+)\\s*",e_="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",k4="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",hP=/^#([0-9a-f]{3,8})$/,mP=new RegExp(`^rgb\\(${g7},${g7},${g7}\\)$`),gP=new RegExp(`^rgb\\(${k4},${k4},${k4}\\)$`),pP=new RegExp(`^rgba\\(${g7},${g7},${g7},${e_}\\)$`),cP=new RegExp(`^rgba\\(${k4},${k4},${k4},${e_}\\)$`),lP=new RegExp(`^hsl\\(${e_},${k4},${k4}\\)$`),rP=new RegExp(`^hsla\\(${e_},${k4},${k4},${e_}\\)$`),fL={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};o_(_J,s5,{copy(Q){return Object.assign(new this.constructor,this,Q)},displayable(){return this.rgb().displayable()},hex:PL,formatHex:PL,formatHex8:dP,formatHsl:iP,formatRgb:NL,toString:NL});function PL(){return this.rgb().formatHex()}function dP(){return this.rgb().formatHex8()}function iP(){return DL(this).formatHsl()}function NL(){return this.rgb().formatRgb()}function s5(Q){var U,Z;return Q=(Q+"").trim().toLowerCase(),(U=hP.exec(Q))?(Z=U[1].length,U=parseInt(U[1],16),Z===6?CL(U):Z===3?new s2(U>>8&15|U>>4&240,U>>4&15|U&240,(U&15)<<4|U&15,1):Z===8?qq(U>>24&255,U>>16&255,U>>8&255,(U&255)/255):Z===4?qq(U>>12&15|U>>8&240,U>>8&15|U>>4&240,U>>4&15|U&240,((U&15)<<4|U&15)/255):null):(U=mP.exec(Q))?new s2(U[1],U[2],U[3],1):(U=gP.exec(Q))?new s2(U[1]*255/100,U[2]*255/100,U[3]*255/100,1):(U=pP.exec(Q))?qq(U[1],U[2],U[3],U[4]):(U=cP.exec(Q))?qq(U[1]*255/100,U[2]*255/100,U[3]*255/100,U[4]):(U=lP.exec(Q))?VL(U[1],U[2]/100,U[3]/100,1):(U=rP.exec(Q))?VL(U[1],U[2]/100,U[3]/100,U[4]):fL.hasOwnProperty(Q)?CL(fL[Q]):Q==="transparent"?new s2(NaN,NaN,NaN,0):null}function CL(Q){return new s2(Q>>16&255,Q>>8&255,Q&255,1)}function qq(Q,U,Z,K){if(K<=0)Q=U=Z=NaN;return new s2(Q,U,Z,K)}function aP(Q){if(!(Q instanceof _J))Q=s5(Q);if(!Q)return new s2;return Q=Q.rgb(),new s2(Q.r,Q.g,Q.b,Q.opacity)}function p7(Q,U,Z,K){return arguments.length===1?aP(Q):new s2(Q,U,Z,K==null?1:K)}function s2(Q,U,Z,K){this.r=+Q,this.g=+U,this.b=+Z,this.opacity=+K}o_(s2,p7,zK(_J,{brighter(Q){return Q=Q==null?Gq:Math.pow(Gq,Q),new s2(this.r*Q,this.g*Q,this.b*Q,this.opacity)},darker(Q){return Q=Q==null?n_:Math.pow(n_,Q),new s2(this.r*Q,this.g*Q,this.b*Q,this.opacity)},rgb(){return this},clamp(){return new s2(z8(this.r),z8(this.g),z8(this.b),Zq(this.opacity))},displayable(){return-0.5<=this.r&&this.r<255.5&&(-0.5<=this.g&&this.g<255.5)&&(-0.5<=this.b&&this.b<255.5)&&(0<=this.opacity&&this.opacity<=1)},hex:SL,formatHex:SL,formatHex8:sP,formatRgb:jL,toString:jL}));function SL(){return`#${W8(this.r)}${W8(this.g)}${W8(this.b)}`}function sP(){return`#${W8(this.r)}${W8(this.g)}${W8(this.b)}${W8((isNaN(this.opacity)?1:this.opacity)*255)}`}function jL(){let Q=Zq(this.opacity);return`${Q===1?"rgb(":"rgba("}${z8(this.r)}, ${z8(this.g)}, ${z8(this.b)}${Q===1?")":`, ${Q})`}`}function Zq(Q){return isNaN(Q)?1:Math.max(0,Math.min(1,Q))}function z8(Q){return Math.max(0,Math.min(255,Math.round(Q)||0))}function W8(Q){return Q=z8(Q),(Q<16?"0":"")+Q.toString(16)}function VL(Q,U,Z,K){if(K<=0)Q=U=Z=NaN;else if(Z<=0||Z>=1)Q=U=NaN;else if(U<=0)Q=NaN;return new a5(Q,U,Z,K)}function DL(Q){if(Q instanceof a5)return new a5(Q.h,Q.s,Q.l,Q.opacity);if(!(Q instanceof _J))Q=s5(Q);if(!Q)return new a5;if(Q instanceof a5)return Q;Q=Q.rgb();var U=Q.r/255,Z=Q.g/255,K=Q.b/255,X=Math.min(U,Z,K),W=Math.max(U,Z,K),z=NaN,B=W-X,O=(W+X)/2;if(B){if(U===W)z=(Z-K)/B+(Z<K)*6;else if(Z===W)z=(K-U)/B+2;else z=(U-Z)/B+4;B/=O<0.5?W+X:2-W-X,z*=60}else B=O>0&&O<1?0:z;return new a5(z,B,O,Q.opacity)}function yL(Q,U,Z,K){return arguments.length===1?DL(Q):new a5(Q,U,Z,K==null?1:K)}function a5(Q,U,Z,K){this.h=+Q,this.s=+U,this.l=+Z,this.opacity=+K}o_(a5,yL,zK(_J,{brighter(Q){return Q=Q==null?Gq:Math.pow(Gq,Q),new a5(this.h,this.s,this.l*Q,this.opacity)},darker(Q){return Q=Q==null?n_:Math.pow(n_,Q),new a5(this.h,this.s,this.l*Q,this.opacity)},rgb(){var Q=this.h%360+(this.h<0)*360,U=isNaN(Q)||isNaN(this.s)?0:this.s,Z=this.l,K=Z+(Z<0.5?Z:1-Z)*U,X=2*Z-K;return new s2(BK(Q>=240?Q-240:Q+120,X,K),BK(Q,X,K),BK(Q<120?Q+240:Q-120,X,K),this.opacity)},clamp(){return new a5(kL(this.h),Uq(this.s),Uq(this.l),Zq(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 Q=Zq(this.opacity);return`${Q===1?"hsl(":"hsla("}${kL(this.h)}, ${Uq(this.s)*100}%, ${Uq(this.l)*100}%${Q===1?")":`, ${Q})`}`}}));function kL(Q){return Q=(Q||0)%360,Q<0?Q+360:Q}function Uq(Q){return Math.max(0,Math.min(1,Q||0))}function BK(Q,U,Z){return(Q<60?U+(Z-U)*Q/60:Q<180?Z:Q<240?U+(Z-U)*(240-Q)/60:U)*255}function AK(Q,U,Z,K,X){var W=Q*Q,z=W*Q;return((1-3*Q+3*W-z)*U+(4-6*W+3*z)*Z+(1+3*Q+3*W-3*z)*K+z*X)/6}function LK(Q){var U=Q.length-1;return function(Z){var K=Z<=0?Z=0:Z>=1?(Z=1,U-1):Math.floor(Z*U),X=Q[K],W=Q[K+1],z=K>0?Q[K-1]:2*X-W,B=K<U-1?Q[K+2]:2*W-X;return AK((Z-K/U)*U,z,X,W,B)}}function MK(Q){var U=Q.length;return function(Z){var K=Math.floor(((Z%=1)<0?++Z:Z)*U),X=Q[(K+U-1)%U],W=Q[K%U],z=Q[(K+1)%U],B=Q[(K+2)%U];return AK((Z-K/U)*U,X,W,z,B)}}var JJ=(Q)=>()=>Q;function tP(Q,U){return function(Z){return Q+Z*U}}function oP(Q,U,Z){return Q=Math.pow(Q,Z),U=Math.pow(U,Z)-Q,Z=1/Z,function(K){return Math.pow(Q+K*U,Z)}}function vL(Q){return(Q=+Q)===1?Fq:function(U,Z){return Z-U?oP(U,Z,Q):JJ(isNaN(U)?Z:U)}}function Fq(Q,U){var Z=U-Q;return Z?tP(Q,Z):JJ(isNaN(Q)?U:Q)}var B8=function Q(U){var Z=vL(U);function K(X,W){var z=Z((X=p7(X)).r,(W=p7(W)).r),B=Z(X.g,W.g),O=Z(X.b,W.b),T=Fq(X.opacity,W.opacity);return function(R){return X.r=z(R),X.g=B(R),X.b=O(R),X.opacity=T(R),X+""}}return K.gamma=Q,K}(1);function EL(Q){return function(U){var Z=U.length,K=Array(Z),X=Array(Z),W=Array(Z),z,B;for(z=0;z<Z;++z)B=p7(U[z]),K[z]=B.r||0,X[z]=B.g||0,W[z]=B.b||0;return K=Q(K),X=Q(X),W=Q(W),B.opacity=1,function(O){return B.r=K(O),B.g=X(O),B.b=W(O),B+""}}}var nP=EL(LK),eP=EL(MK);function TK(Q,U){if(!U)U=[];var Z=Q?Math.min(U.length,Q.length):0,K=U.slice(),X;return function(W){for(X=0;X<Z;++X)K[X]=Q[X]*(1-W)+U[X]*W;return K}}function bL(Q){return ArrayBuffer.isView(Q)&&!(Q instanceof DataView)}function uL(Q,U){var Z=U?U.length:0,K=Q?Math.min(Z,Q.length):0,X=Array(K),W=Array(Z),z;for(z=0;z<K;++z)X[z]=D4(Q[z],U[z]);for(;z<Z;++z)W[z]=U[z];return function(B){for(z=0;z<K;++z)W[z]=X[z](B);return W}}function RK(Q,U){var Z=new Date;return Q=+Q,U=+U,function(K){return Z.setTime(Q*(1-K)+U*K),Z}}function w2(Q,U){return Q=+Q,U=+U,function(Z){return Q*(1-Z)+U*Z}}function OK(Q,U){var Z={},K={},X;if(Q===null||typeof Q!=="object")Q={};if(U===null||typeof U!=="object")U={};for(X in U)if(X in Q)Z[X]=D4(Q[X],U[X]);else K[X]=U[X];return function(W){for(X in Z)K[X]=Z[X](W);return K}}var IK=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,wK=new RegExp(IK.source,"g");function _N(Q){return function(){return Q}}function JN(Q){return function(U){return Q(U)+""}}function c7(Q,U){var Z=IK.lastIndex=wK.lastIndex=0,K,X,W,z=-1,B=[],O=[];Q=Q+"",U=U+"";while((K=IK.exec(Q))&&(X=wK.exec(U))){if((W=X.index)>Z)if(W=U.slice(Z,W),B[z])B[z]+=W;else B[++z]=W;if((K=K[0])===(X=X[0]))if(B[z])B[z]+=X;else B[++z]=X;else B[++z]=null,O.push({i:z,x:w2(K,X)});Z=wK.lastIndex}if(Z<U.length)if(W=U.slice(Z),B[z])B[z]+=W;else B[++z]=W;return B.length<2?O[0]?JN(O[0].x):_N(U):(U=O.length,function(T){for(var R=0,L;R<U;++R)B[(L=O[R]).i]=L.x(T);return B.join("")})}function D4(Q,U){var Z=typeof U,K;return U==null||Z==="boolean"?JJ(U):(Z==="number"?w2:Z==="string"?(K=s5(U))?(U=K,B8):c7:U instanceof s5?B8:U instanceof Date?RK:bL(U)?TK:Array.isArray(U)?uL:typeof U.valueOf!=="function"&&typeof U.toString!=="function"||isNaN(U)?OK:w2)(Q,U)}var xL=180/Math.PI,Kq={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Xq(Q,U,Z,K,X,W){var z,B,O;if(z=Math.sqrt(Q*Q+U*U))Q/=z,U/=z;if(O=Q*Z+U*K)Z-=Q*O,K-=U*O;if(B=Math.sqrt(Z*Z+K*K))Z/=B,K/=B,O/=B;if(Q*K<U*Z)Q=-Q,U=-U,O=-O,z=-z;return{translateX:X,translateY:W,rotate:Math.atan2(U,Q)*xL,skewX:Math.atan(O)*xL,scaleX:z,scaleY:B}}var Hq;function hL(Q){let U=new(typeof DOMMatrix==="function"?DOMMatrix:WebKitCSSMatrix)(Q+"");return U.isIdentity?Kq:Xq(U.a,U.b,U.c,U.d,U.e,U.f)}function mL(Q){if(Q==null)return Kq;if(!Hq)Hq=document.createElementNS("http://www.w3.org/2000/svg","g");if(Hq.setAttribute("transform",Q),!(Q=Hq.transform.baseVal.consolidate()))return Kq;return Q=Q.matrix,Xq(Q.a,Q.b,Q.c,Q.d,Q.e,Q.f)}function gL(Q,U,Z,K){function X(T){return T.length?T.pop()+" ":""}function W(T,R,L,M,I,f){if(T!==L||R!==M){var D=I.push("translate(",null,U,null,Z);f.push({i:D-4,x:w2(T,L)},{i:D-2,x:w2(R,M)})}else if(L||M)I.push("translate("+L+U+M+Z)}function z(T,R,L,M){if(T!==R){if(T-R>180)R+=360;else if(R-T>180)T+=360;M.push({i:L.push(X(L)+"rotate(",null,K)-2,x:w2(T,R)})}else if(R)L.push(X(L)+"rotate("+R+K)}function B(T,R,L,M){if(T!==R)M.push({i:L.push(X(L)+"skewX(",null,K)-2,x:w2(T,R)});else if(R)L.push(X(L)+"skewX("+R+K)}function O(T,R,L,M,I,f){if(T!==L||R!==M){var D=I.push(X(I)+"scale(",null,",",null,")");f.push({i:D-4,x:w2(T,L)},{i:D-2,x:w2(R,M)})}else if(L!==1||M!==1)I.push(X(I)+"scale("+L+","+M+")")}return function(T,R){var L=[],M=[];return T=Q(T),R=Q(R),W(T.translateX,T.translateY,R.translateX,R.translateY,L,M),z(T.rotate,R.rotate,L,M),B(T.skewX,R.skewX,L,M),O(T.scaleX,T.scaleY,R.scaleX,R.scaleY,L,M),T=R=null,function(I){var f=-1,D=M.length,V;while(++f<D)L[(V=M[f]).i]=V.x(I);return L.join("")}}}var fK=gL(hL,"px, ","px)","deg)"),PK=gL(mL,", ",")",")");var $N=0.000000000001;function pL(Q){return((Q=Math.exp(Q))+1/Q)/2}function QN(Q){return((Q=Math.exp(Q))-1/Q)/2}function qN(Q){return((Q=Math.exp(2*Q))-1)/(Q+1)}var A8=function Q(U,Z,K){function X(W,z){var B=W[0],O=W[1],T=W[2],R=z[0],L=z[1],M=z[2],I=R-B,f=L-O,D=I*I+f*f,V,k;if(D<$N)k=Math.log(M/T)/U,V=function(E){return[B+E*I,O+E*f,T*Math.exp(U*E*k)]};else{var h=Math.sqrt(D),P=(M*M-T*T+K*D)/(2*T*Z*h),C=(M*M-T*T-K*D)/(2*M*Z*h),v=Math.log(Math.sqrt(P*P+1)-P),b=Math.log(Math.sqrt(C*C+1)-C);k=(b-v)/U,V=function(E){var p=E*k,a=pL(v),m=T/(Z*h)*(a*qN(U*p+v)-QN(v));return[B+m*I,O+m*f,T*a/pL(U*p+v)]}}return V.duration=k*1000*U/Math.SQRT2,V}return X.rho=function(W){var z=Math.max(0.001,+W),B=z*z,O=B*B;return Q(z,B,O)},X}(Math.SQRT2,2,4);var l7=0,QJ=0,$J=0,lL=1000,Yq,qJ,Wq=0,L8=0,zq=0,UJ=typeof performance==="object"&&performance.now?performance:Date,rL=typeof window==="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(Q){setTimeout(Q,17)};function ZJ(){return L8||(rL(UN),L8=UJ.now()+zq)}function UN(){L8=0}function GJ(){this._call=this._time=this._next=null}GJ.prototype=Bq.prototype={constructor:GJ,restart:function(Q,U,Z){if(typeof Q!=="function")throw TypeError("callback is not a function");if(Z=(Z==null?ZJ():+Z)+(U==null?0:+U),!this._next&&qJ!==this){if(qJ)qJ._next=this;else Yq=this;qJ=this}this._call=Q,this._time=Z,NK()},stop:function(){if(this._call)this._call=null,this._time=1/0,NK()}};function Bq(Q,U,Z){var K=new GJ;return K.restart(Q,U,Z),K}function dL(){ZJ(),++l7;var Q=Yq,U;while(Q){if((U=L8-Q._time)>=0)Q._call.call(void 0,U);Q=Q._next}--l7}function cL(){L8=(Wq=UJ.now())+zq,l7=QJ=0;try{dL()}finally{l7=0,ZN(),L8=0}}function GN(){var Q=UJ.now(),U=Q-Wq;if(U>lL)zq-=U,Wq=Q}function ZN(){var Q,U=Yq,Z,K=1/0;while(U)if(U._call){if(K>U._time)K=U._time;Q=U,U=U._next}else Z=U._next,U._next=null,U=Q?Q._next=Z:Yq=Z;qJ=Q,NK(K)}function NK(Q){if(l7)return;if(QJ)QJ=clearTimeout(QJ);var U=Q-L8;if(U>24){if(Q<1/0)QJ=setTimeout(cL,Q-UJ.now()-zq);if($J)$J=clearInterval($J)}else{if(!$J)Wq=UJ.now(),$J=setInterval(GN,lL);l7=1,rL(cL)}}function FJ(Q,U,Z){var K=new GJ;return U=U==null?0:+U,K.restart((X)=>{K.stop(),Q(X+U)},U,Z),K}var FN=H8("start","end","cancel","interrupt"),KN=[],sL=0,iL=1,Lq=2,Aq=3,aL=4,Mq=5,KJ=6;function W3(Q,U,Z,K,X,W){var z=Q.__transition;if(!z)Q.__transition={};else if(Z in z)return;XN(Q,Z,{name:U,index:K,group:X,on:FN,tween:KN,time:W.time,delay:W.delay,duration:W.duration,ease:W.ease,timer:null,state:sL})}function XJ(Q,U){var Z=e0(Q,U);if(Z.state>sL)throw Error("too late; already scheduled");return Z}function W2(Q,U){var Z=e0(Q,U);if(Z.state>Aq)throw Error("too late; already running");return Z}function e0(Q,U){var Z=Q.__transition;if(!Z||!(Z=Z[U]))throw Error("transition not found");return Z}function XN(Q,U,Z){var K=Q.__transition,X;K[U]=Z,Z.timer=Bq(W,0,Z.time);function W(T){if(Z.state=iL,Z.timer.restart(z,Z.delay,Z.time),Z.delay<=T)z(T-Z.delay)}function z(T){var R,L,M,I;if(Z.state!==iL)return O();for(R in K){if(I=K[R],I.name!==Z.name)continue;if(I.state===Aq)return FJ(z);if(I.state===aL)I.state=KJ,I.timer.stop(),I.on.call("interrupt",Q,Q.__data__,I.index,I.group),delete K[R];else if(+R<U)I.state=KJ,I.timer.stop(),I.on.call("cancel",Q,Q.__data__,I.index,I.group),delete K[R]}if(FJ(function(){if(Z.state===Aq)Z.state=aL,Z.timer.restart(B,Z.delay,Z.time),B(T)}),Z.state=Lq,Z.on.call("start",Q,Q.__data__,Z.index,Z.group),Z.state!==Lq)return;Z.state=Aq,X=Array(M=Z.tween.length);for(R=0,L=-1;R<M;++R)if(I=Z.tween[R].value.call(Q,Q.__data__,Z.index,Z.group))X[++L]=I;X.length=L+1}function B(T){var R=T<Z.duration?Z.ease.call(null,T/Z.duration):(Z.timer.restart(O),Z.state=Mq,1),L=-1,M=X.length;while(++L<M)X[L].call(Q,R);if(Z.state===Mq)Z.on.call("end",Q,Q.__data__,Z.index,Z.group),O()}function O(){Z.state=KJ,Z.timer.stop(),delete K[U];for(var T in K)return;delete Q.__transition}}function Y6(Q,U){var Z=Q.__transition,K,X,W=!0,z;if(!Z)return;U=U==null?null:U+"";for(z in Z){if((K=Z[z]).name!==U){W=!1;continue}X=K.state>Lq&&K.state<Mq,K.state=KJ,K.timer.stop(),K.on.call(X?"interrupt":"cancel",Q,Q.__data__,K.index,K.group),delete Z[z]}if(W)delete Q.__transition}function CK(Q){return this.each(function(){Y6(this,Q)})}function HN(Q,U){var Z,K;return function(){var X=W2(this,Q),W=X.tween;if(W!==Z){K=Z=W;for(var z=0,B=K.length;z<B;++z)if(K[z].name===U){K=K.slice(),K.splice(z,1);break}}X.tween=K}}function YN(Q,U,Z){var K,X;if(typeof Z!=="function")throw Error();return function(){var W=W2(this,Q),z=W.tween;if(z!==K){X=(K=z).slice();for(var B={name:U,value:Z},O=0,T=X.length;O<T;++O)if(X[O].name===U){X[O]=B;break}if(O===T)X.push(B)}W.tween=X}}function SK(Q,U){var Z=this._id;if(Q+="",arguments.length<2){var K=e0(this.node(),Z).tween;for(var X=0,W=K.length,z;X<W;++X)if((z=K[X]).name===Q)return z.value;return null}return this.each((U==null?HN:YN)(Z,Q,U))}function r7(Q,U,Z){var K=Q._id;return Q.each(function(){var X=W2(this,K);(X.value||(X.value={}))[U]=Z.apply(this,arguments)}),function(X){return e0(X,K).value[U]}}function HJ(Q,U){var Z;return(typeof U==="number"?w2:U instanceof s5?B8:(Z=s5(U))?(U=Z,B8):c7)(Q,U)}function WN(Q){return function(){this.removeAttribute(Q)}}function zN(Q){return function(){this.removeAttributeNS(Q.space,Q.local)}}function BN(Q,U,Z){var K,X=Z+"",W;return function(){var z=this.getAttribute(Q);return z===X?null:z===K?W:W=U(K=z,Z)}}function AN(Q,U,Z){var K,X=Z+"",W;return function(){var z=this.getAttributeNS(Q.space,Q.local);return z===X?null:z===K?W:W=U(K=z,Z)}}function LN(Q,U,Z){var K,X,W;return function(){var z,B=Z(this),O;if(B==null)return void this.removeAttribute(Q);return z=this.getAttribute(Q),O=B+"",z===O?null:z===K&&O===X?W:(X=O,W=U(K=z,B))}}function MN(Q,U,Z){var K,X,W;return function(){var z,B=Z(this),O;if(B==null)return void this.removeAttributeNS(Q.space,Q.local);return z=this.getAttributeNS(Q.space,Q.local),O=B+"",z===O?null:z===K&&O===X?W:(X=O,W=U(K=z,B))}}function jK(Q,U){var Z=V4(Q),K=Z==="transform"?PK:HJ;return this.attrTween(Q,typeof U==="function"?(Z.local?MN:LN)(Z,K,r7(this,"attr."+Q,U)):U==null?(Z.local?zN:WN)(Z):(Z.local?AN:BN)(Z,K,U))}function TN(Q,U){return function(Z){this.setAttribute(Q,U.call(this,Z))}}function RN(Q,U){return function(Z){this.setAttributeNS(Q.space,Q.local,U.call(this,Z))}}function ON(Q,U){var Z,K;function X(){var W=U.apply(this,arguments);if(W!==K)Z=(K=W)&&RN(Q,W);return Z}return X._value=U,X}function wN(Q,U){var Z,K;function X(){var W=U.apply(this,arguments);if(W!==K)Z=(K=W)&&TN(Q,W);return Z}return X._value=U,X}function VK(Q,U){var Z="attr."+Q;if(arguments.length<2)return(Z=this.tween(Z))&&Z._value;if(U==null)return this.tween(Z,null);if(typeof U!=="function")throw Error();var K=V4(Q);return this.tween(Z,(K.local?ON:wN)(K,U))}function IN(Q,U){return function(){XJ(this,Q).delay=+U.apply(this,arguments)}}function fN(Q,U){return U=+U,function(){XJ(this,Q).delay=U}}function kK(Q){var U=this._id;return arguments.length?this.each((typeof Q==="function"?IN:fN)(U,Q)):e0(this.node(),U).delay}function PN(Q,U){return function(){W2(this,Q).duration=+U.apply(this,arguments)}}function NN(Q,U){return U=+U,function(){W2(this,Q).duration=U}}function DK(Q){var U=this._id;return arguments.length?this.each((typeof Q==="function"?PN:NN)(U,Q)):e0(this.node(),U).duration}function CN(Q,U){if(typeof U!=="function")throw Error();return function(){W2(this,Q).ease=U}}function yK(Q){var U=this._id;return arguments.length?this.each(CN(U,Q)):e0(this.node(),U).ease}function SN(Q,U){return function(){var Z=U.apply(this,arguments);if(typeof Z!=="function")throw Error();W2(this,Q).ease=Z}}function vK(Q){if(typeof Q!=="function")throw Error();return this.each(SN(this._id,Q))}function EK(Q){if(typeof Q!=="function")Q=x7(Q);for(var U=this._groups,Z=U.length,K=Array(Z),X=0;X<Z;++X)for(var W=U[X],z=W.length,B=K[X]=[],O,T=0;T<z;++T)if((O=W[T])&&Q.call(O,O.__data__,T,W))B.push(O);return new u2(K,this._parents,this._name,this._id)}function bK(Q){if(Q._id!==this._id)throw Error();for(var U=this._groups,Z=Q._groups,K=U.length,X=Z.length,W=Math.min(K,X),z=Array(K),B=0;B<W;++B)for(var O=U[B],T=Z[B],R=O.length,L=z[B]=Array(R),M,I=0;I<R;++I)if(M=O[I]||T[I])L[I]=M;for(;B<K;++B)z[B]=U[B];return new u2(z,this._parents,this._name,this._id)}function jN(Q){return(Q+"").trim().split(/^|\s+/).every(function(U){var Z=U.indexOf(".");if(Z>=0)U=U.slice(0,Z);return!U||U==="start"})}function VN(Q,U,Z){var K,X,W=jN(U)?XJ:W2;return function(){var z=W(this,Q),B=z.on;if(B!==K)(X=(K=B).copy()).on(U,Z);z.on=X}}function uK(Q,U){var Z=this._id;return arguments.length<2?e0(this.node(),Z).on.on(Q):this.each(VN(Z,Q,U))}function kN(Q){return function(){var U=this.parentNode;for(var Z in this.__transition)if(+Z!==Q)return;if(U)U.removeChild(this)}}function xK(){return this.on("end.remove",kN(this._id))}function hK(Q){var U=this._name,Z=this._id;if(typeof Q!=="function")Q=X6(Q);for(var K=this._groups,X=K.length,W=Array(X),z=0;z<X;++z)for(var B=K[z],O=B.length,T=W[z]=Array(O),R,L,M=0;M<O;++M)if((R=B[M])&&(L=Q.call(R,R.__data__,M,B))){if("__data__"in R)L.__data__=R.__data__;T[M]=L,W3(T[M],U,Z,M,T,e0(R,Z))}return new u2(W,this._parents,U,Z)}function mK(Q){var U=this._name,Z=this._id;if(typeof Q!=="function")Q=h7(Q);for(var K=this._groups,X=K.length,W=[],z=[],B=0;B<X;++B)for(var O=K[B],T=O.length,R,L=0;L<T;++L)if(R=O[L]){for(var M=Q.call(R,R.__data__,L,O),I,f=e0(R,Z),D=0,V=M.length;D<V;++D)if(I=M[D])W3(I,U,Z,D,M,f);W.push(M),z.push(R)}return new u2(W,z,U,Z)}var DN=H3.prototype.constructor;function gK(){return new DN(this._groups,this._parents)}function yN(Q,U){var Z,K,X;return function(){var W=H6(this,Q),z=(this.style.removeProperty(Q),H6(this,Q));return W===z?null:W===Z&&z===K?X:X=U(Z=W,K=z)}}function tL(Q){return function(){this.style.removeProperty(Q)}}function vN(Q,U,Z){var K,X=Z+"",W;return function(){var z=H6(this,Q);return z===X?null:z===K?W:W=U(K=z,Z)}}function EN(Q,U,Z){var K,X,W;return function(){var z=H6(this,Q),B=Z(this),O=B+"";if(B==null)O=B=(this.style.removeProperty(Q),H6(this,Q));return z===O?null:z===K&&O===X?W:(X=O,W=U(K=z,B))}}function bN(Q,U){var Z,K,X,W="style."+U,z="end."+W,B;return function(){var O=W2(this,Q),T=O.on,R=O.value[W]==null?B||(B=tL(U)):void 0;if(T!==Z||X!==R)(K=(Z=T).copy()).on(z,X=R);O.on=K}}function pK(Q,U,Z){var K=(Q+="")==="transform"?fK:HJ;return U==null?this.styleTween(Q,yN(Q,K)).on("end.style."+Q,tL(Q)):typeof U==="function"?this.styleTween(Q,EN(Q,K,r7(this,"style."+Q,U))).each(bN(this._id,Q)):this.styleTween(Q,vN(Q,K,U),Z).on("end.style."+Q,null)}function uN(Q,U,Z){return function(K){this.style.setProperty(Q,U.call(this,K),Z)}}function xN(Q,U,Z){var K,X;function W(){var z=U.apply(this,arguments);if(z!==X)K=(X=z)&&uN(Q,z,Z);return K}return W._value=U,W}function cK(Q,U,Z){var K="style."+(Q+="");if(arguments.length<2)return(K=this.tween(K))&&K._value;if(U==null)return this.tween(K,null);if(typeof U!=="function")throw Error();return this.tween(K,xN(Q,U,Z==null?"":Z))}function hN(Q){return function(){this.textContent=Q}}function mN(Q){return function(){var U=Q(this);this.textContent=U==null?"":U}}function lK(Q){return this.tween("text",typeof Q==="function"?mN(r7(this,"text",Q)):hN(Q==null?"":Q+""))}function gN(Q){return function(U){this.textContent=Q.call(this,U)}}function pN(Q){var U,Z;function K(){var X=Q.apply(this,arguments);if(X!==Z)U=(Z=X)&&gN(X);return U}return K._value=Q,K}function rK(Q){var U="text";if(arguments.length<1)return(U=this.tween(U))&&U._value;if(Q==null)return this.tween(U,null);if(typeof Q!=="function")throw Error();return this.tween(U,pN(Q))}function dK(){var Q=this._name,U=this._id,Z=Tq();for(var K=this._groups,X=K.length,W=0;W<X;++W)for(var z=K[W],B=z.length,O,T=0;T<B;++T)if(O=z[T]){var R=e0(O,U);W3(O,Q,Z,T,z,{time:R.time+R.delay+R.duration,delay:0,duration:R.duration,ease:R.ease})}return new u2(K,this._parents,Q,Z)}function iK(){var Q,U,Z=this,K=Z._id,X=Z.size();return new Promise(function(W,z){var B={value:z},O={value:function(){if(--X===0)W()}};if(Z.each(function(){var T=W2(this,K),R=T.on;if(R!==Q)U=(Q=R).copy(),U._.cancel.push(B),U._.interrupt.push(B),U._.end.push(O);T.on=U}),X===0)W()})}var cN=0;function u2(Q,U,Z,K){this._groups=Q,this._parents=U,this._name=Z,this._id=K}function oL(Q){return H3().transition(Q)}function Tq(){return++cN}var z3=H3.prototype;u2.prototype=oL.prototype={constructor:u2,select:hK,selectAll:mK,selectChild:z3.selectChild,selectChildren:z3.selectChildren,filter:EK,merge:bK,selection:gK,transition:dK,call:z3.call,nodes:z3.nodes,node:z3.node,size:z3.size,empty:z3.empty,each:z3.each,on:uK,attr:jK,attrTween:VK,style:pK,styleTween:cK,text:lK,textTween:rK,remove:xK,tween:SK,delay:kK,duration:DK,ease:yK,easeVarying:vK,end:iK,[Symbol.iterator]:z3[Symbol.iterator]};function Rq(Q){return((Q*=2)<=1?Q*Q*Q:(Q-=2)*Q*Q+2)/2}var lN={time:null,delay:0,duration:250,ease:Rq};function rN(Q,U){var Z;while(!(Z=Q.__transition)||!(Z=Z[U]))if(!(Q=Q.parentNode))throw Error(`transition ${U} not found`);return Z}function aK(Q){var U,Z;if(Q instanceof u2)U=Q._id,Q=Q._name;else U=Tq(),(Z=lN).time=ZJ(),Q=Q==null?null:Q+"";for(var K=this._groups,X=K.length,W=0;W<X;++W)for(var z=K[W],B=z.length,O,T=0;T<B;++T)if(O=z[T])W3(O,Q,U,T,z,Z||rN(O,U));return new u2(K,this._parents,Q,U)}H3.prototype.interrupt=CK;H3.prototype.transition=aK;var YJ=(Q)=>()=>Q;function sK(Q,{sourceEvent:U,target:Z,transform:K,dispatch:X}){Object.defineProperties(this,{type:{value:Q,enumerable:!0,configurable:!0},sourceEvent:{value:U,enumerable:!0,configurable:!0},target:{value:Z,enumerable:!0,configurable:!0},transform:{value:K,enumerable:!0,configurable:!0},_:{value:X}})}function t5(Q,U,Z){this.k=Q,this.x=U,this.y=Z}t5.prototype={constructor:t5,scale:function(Q){return Q===1?this:new t5(this.k*Q,this.x,this.y)},translate:function(Q,U){return Q===0&U===0?this:new t5(this.k,this.x+this.k*Q,this.y+this.k*U)},apply:function(Q){return[Q[0]*this.k+this.x,Q[1]*this.k+this.y]},applyX:function(Q){return Q*this.k+this.x},applyY:function(Q){return Q*this.k+this.y},invert:function(Q){return[(Q[0]-this.x)/this.k,(Q[1]-this.y)/this.k]},invertX:function(Q){return(Q-this.x)/this.k},invertY:function(Q){return(Q-this.y)/this.k},rescaleX:function(Q){return Q.copy().domain(Q.range().map(this.invertX,this).map(Q.invert,Q))},rescaleY:function(Q){return Q.copy().domain(Q.range().map(this.invertY,this).map(Q.invert,Q))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var M8=new t5(1,0,0);WJ.prototype=t5.prototype;function WJ(Q){while(!Q.__zoom)if(!(Q=Q.parentNode))return M8;return Q.__zoom}function Oq(Q){Q.stopImmediatePropagation()}function T8(Q){Q.preventDefault(),Q.stopImmediatePropagation()}function dN(Q){return(!Q.ctrlKey||Q.type==="wheel")&&!Q.button}function iN(){var Q=this;if(Q instanceof SVGElement){if(Q=Q.ownerSVGElement||Q,Q.hasAttribute("viewBox"))return Q=Q.viewBox.baseVal,[[Q.x,Q.y],[Q.x+Q.width,Q.y+Q.height]];return[[0,0],[Q.width.baseVal.value,Q.height.baseVal.value]]}return[[0,0],[Q.clientWidth,Q.clientHeight]]}function nL(){return this.__zoom||M8}function aN(Q){return-Q.deltaY*(Q.deltaMode===1?0.05:Q.deltaMode?1:0.002)*(Q.ctrlKey?10:1)}function sN(){return navigator.maxTouchPoints||"ontouchstart"in this}function tN(Q,U,Z){var K=Q.invertX(U[0][0])-Z[0][0],X=Q.invertX(U[1][0])-Z[1][0],W=Q.invertY(U[0][1])-Z[0][1],z=Q.invertY(U[1][1])-Z[1][1];return Q.translate(X>K?(K+X)/2:Math.min(0,K)||Math.max(0,X),z>W?(W+z)/2:Math.min(0,W)||Math.max(0,z))}function zJ(){var Q=dN,U=iN,Z=tN,K=aN,X=sN,W=[0,1/0],z=[[-1/0,-1/0],[1/0,1/0]],B=250,O=A8,T=H8("start","zoom","end"),R,L,M,I=500,f=150,D=0,V=10;function k(y){y.property("__zoom",nL).on("wheel.zoom",p,{passive:!1}).on("mousedown.zoom",a).on("dblclick.zoom",m).filter(X).on("touchstart.zoom",_1).on("touchmove.zoom",$1).on("touchend.zoom touchcancel.zoom",J1).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}k.transform=function(y,u,x,d){var g=y.selection?y.selection():y;if(g.property("__zoom",nL),y!==g)v(y,u,x,d);else g.interrupt().each(function(){b(this,arguments).event(d).start().zoom(null,typeof u==="function"?u.apply(this,arguments):u).end()})},k.scaleBy=function(y,u,x,d){k.scaleTo(y,function(){var g=this.__zoom.k,n=typeof u==="function"?u.apply(this,arguments):u;return g*n},x,d)},k.scaleTo=function(y,u,x,d){k.transform(y,function(){var g=U.apply(this,arguments),n=this.__zoom,j=x==null?C(g):typeof x==="function"?x.apply(this,arguments):x,i=n.invert(j),q1=typeof u==="function"?u.apply(this,arguments):u;return Z(P(h(n,q1),j,i),g,z)},x,d)},k.translateBy=function(y,u,x,d){k.transform(y,function(){return Z(this.__zoom.translate(typeof u==="function"?u.apply(this,arguments):u,typeof x==="function"?x.apply(this,arguments):x),U.apply(this,arguments),z)},null,d)},k.translateTo=function(y,u,x,d,g){k.transform(y,function(){var n=U.apply(this,arguments),j=this.__zoom,i=d==null?C(n):typeof d==="function"?d.apply(this,arguments):d;return Z(M8.translate(i[0],i[1]).scale(j.k).translate(typeof u==="function"?-u.apply(this,arguments):-u,typeof x==="function"?-x.apply(this,arguments):-x),n,z)},d,g)};function h(y,u){return u=Math.max(W[0],Math.min(W[1],u)),u===y.k?y:new t5(u,y.x,y.y)}function P(y,u,x){var d=u[0]-x[0]*y.k,g=u[1]-x[1]*y.k;return d===y.x&&g===y.y?y:new t5(y.k,d,g)}function C(y){return[(+y[0][0]+ +y[1][0])/2,(+y[0][1]+ +y[1][1])/2]}function v(y,u,x,d){y.on("start.zoom",function(){b(this,arguments).event(d).start()}).on("interrupt.zoom end.zoom",function(){b(this,arguments).event(d).end()}).tween("zoom",function(){var g=this,n=arguments,j=b(g,n).event(d),i=U.apply(g,n),q1=x==null?C(i):typeof x==="function"?x.apply(g,n):x,Q1=Math.max(i[1][0]-i[0][0],i[1][1]-i[0][1]),Y1=g.__zoom,L1=typeof u==="function"?u.apply(g,n):u,M1=O(Y1.invert(q1).concat(Q1/Y1.k),L1.invert(q1).concat(Q1/L1.k));return function(I1){if(I1===1)I1=L1;else{var X1=M1(I1),f1=Q1/X1[2];I1=new t5(f1,q1[0]-X1[0]*f1,q1[1]-X1[1]*f1)}j.zoom(null,I1)}})}function b(y,u,x){return!x&&y.__zooming||new E(y,u)}function E(y,u){this.that=y,this.args=u,this.active=0,this.sourceEvent=null,this.extent=U.apply(y,u),this.taps=0}E.prototype={event:function(y){if(y)this.sourceEvent=y;return this},start:function(){if(++this.active===1)this.that.__zooming=this,this.emit("start");return this},zoom:function(y,u){if(this.mouse&&y!=="mouse")this.mouse[1]=u.invert(this.mouse[0]);if(this.touch0&&y!=="touch")this.touch0[1]=u.invert(this.touch0[0]);if(this.touch1&&y!=="touch")this.touch1[1]=u.invert(this.touch1[0]);return this.that.__zoom=u,this.emit("zoom"),this},end:function(){if(--this.active===0)delete this.that.__zooming,this.emit("end");return this},emit:function(y){var u=n0(this.that).datum();T.call(y,this.that,new sK(y,{sourceEvent:this.sourceEvent,target:k,type:y,transform:this.that.__zoom,dispatch:T}),u)}};function p(y,...u){if(!Q.apply(this,arguments))return;var x=b(this,u).event(y),d=this.__zoom,g=Math.max(W[0],Math.min(W[1],d.k*Math.pow(2,K.apply(this,arguments)))),n=O2(y);if(x.wheel){if(x.mouse[0][0]!==n[0]||x.mouse[0][1]!==n[1])x.mouse[1]=d.invert(x.mouse[0]=n);clearTimeout(x.wheel)}else if(d.k===g)return;else x.mouse=[n,d.invert(n)],Y6(this),x.start();T8(y),x.wheel=setTimeout(j,f),x.zoom("mouse",Z(P(h(d,g),x.mouse[0],x.mouse[1]),x.extent,z));function j(){x.wheel=null,x.end()}}function a(y,...u){if(M||!Q.apply(this,arguments))return;var x=y.currentTarget,d=b(this,u,!0).event(y),g=n0(y.view).on("mousemove.zoom",q1,!0).on("mouseup.zoom",Q1,!0),n=O2(y,x),j=y.clientX,i=y.clientY;m7(y.view),Oq(y),d.mouse=[n,this.__zoom.invert(n)],Y6(this),d.start();function q1(Y1){if(T8(Y1),!d.moved){var L1=Y1.clientX-j,M1=Y1.clientY-i;d.moved=L1*L1+M1*M1>D}d.event(Y1).zoom("mouse",Z(P(d.that.__zoom,d.mouse[0]=O2(Y1,x),d.mouse[1]),d.extent,z))}function Q1(Y1){g.on("mousemove.zoom mouseup.zoom",null),i_(Y1.view,d.moved),T8(Y1),d.event(Y1).end()}}function m(y,...u){if(!Q.apply(this,arguments))return;var x=this.__zoom,d=O2(y.changedTouches?y.changedTouches[0]:y,this),g=x.invert(d),n=x.k*(y.shiftKey?0.5:2),j=Z(P(h(x,n),d,g),U.apply(this,u),z);if(T8(y),B>0)n0(this).transition().duration(B).call(v,j,d,y);else n0(this).call(k.transform,j,d,y)}function _1(y,...u){if(!Q.apply(this,arguments))return;var x=y.touches,d=x.length,g=b(this,u,y.changedTouches.length===d).event(y),n,j,i,q1;Oq(y);for(j=0;j<d;++j)if(i=x[j],q1=O2(i,this),q1=[q1,this.__zoom.invert(q1),i.identifier],!g.touch0)g.touch0=q1,n=!0,g.taps=1+!!R;else if(!g.touch1&&g.touch0[2]!==q1[2])g.touch1=q1,g.taps=0;if(R)R=clearTimeout(R);if(n){if(g.taps<2)L=q1[0],R=setTimeout(function(){R=null},I);Y6(this),g.start()}}function $1(y,...u){if(!this.__zooming)return;var x=b(this,u).event(y),d=y.changedTouches,g=d.length,n,j,i,q1;T8(y);for(n=0;n<g;++n)if(j=d[n],i=O2(j,this),x.touch0&&x.touch0[2]===j.identifier)x.touch0[0]=i;else if(x.touch1&&x.touch1[2]===j.identifier)x.touch1[0]=i;if(j=x.that.__zoom,x.touch1){var Q1=x.touch0[0],Y1=x.touch0[1],L1=x.touch1[0],M1=x.touch1[1],I1=(I1=L1[0]-Q1[0])*I1+(I1=L1[1]-Q1[1])*I1,X1=(X1=M1[0]-Y1[0])*X1+(X1=M1[1]-Y1[1])*X1;j=h(j,Math.sqrt(I1/X1)),i=[(Q1[0]+L1[0])/2,(Q1[1]+L1[1])/2],q1=[(Y1[0]+M1[0])/2,(Y1[1]+M1[1])/2]}else if(x.touch0)i=x.touch0[0],q1=x.touch0[1];else return;x.zoom("touch",Z(P(j,i,q1),x.extent,z))}function J1(y,...u){if(!this.__zooming)return;var x=b(this,u).event(y),d=y.changedTouches,g=d.length,n,j;if(Oq(y),M)clearTimeout(M);M=setTimeout(function(){M=null},I);for(n=0;n<g;++n)if(j=d[n],x.touch0&&x.touch0[2]===j.identifier)delete x.touch0;else if(x.touch1&&x.touch1[2]===j.identifier)delete x.touch1;if(x.touch1&&!x.touch0)x.touch0=x.touch1,delete x.touch1;if(x.touch0)x.touch0[1]=this.__zoom.invert(x.touch0[0]);else if(x.end(),x.taps===2){if(j=O2(j,this),Math.hypot(L[0]-j[0],L[1]-j[1])<V){var i=n0(this).on("dblclick.zoom");if(i)i.apply(this,arguments)}}}return k.wheelDelta=function(y){return arguments.length?(K=typeof y==="function"?y:YJ(+y),k):K},k.filter=function(y){return arguments.length?(Q=typeof y==="function"?y:YJ(!!y),k):Q},k.touchable=function(y){return arguments.length?(X=typeof y==="function"?y:YJ(!!y),k):X},k.extent=function(y){return arguments.length?(U=typeof y==="function"?y:YJ([[+y[0][0],+y[0][1]],[+y[1][0],+y[1][1]]]),k):U},k.scaleExtent=function(y){return arguments.length?(W[0]=+y[0],W[1]=+y[1],k):[W[0],W[1]]},k.translateExtent=function(y){return arguments.length?(z[0][0]=+y[0][0],z[1][0]=+y[1][0],z[0][1]=+y[0][1],z[1][1]=+y[1][1],k):[[z[0][0],z[0][1]],[z[1][0],z[1][1]]]},k.constrain=function(y){return arguments.length?(Z=y,k):Z},k.duration=function(y){return arguments.length?(B=+y,k):B},k.interpolate=function(y){return arguments.length?(O=y,k):O},k.on=function(){var y=T.on.apply(T,arguments);return y===T?k:y},k.clickDistance=function(y){return arguments.length?(D=(y=+y)*y,k):Math.sqrt(D)},k.tapDistance=function(y){return arguments.length?(V=+y,k):V},k}var x2={error001:(Q="react")=>`Seems like you have not used ${Q==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${Q}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:(Q)=>`Node type "${Q}" 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:(Q)=>`The old edge with id=${Q} does not exist.`,error009:(Q)=>`Marker type "${Q}" doesn't exist.`,error008:(Q,{id:U,sourceHandle:Z,targetHandle:K})=>`Couldn't create edge for ${Q} handle id: "${Q==="source"?Z:K}", edge id: ${U}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:(Q)=>`Edge type "${Q}" not found. Using fallback type "default".`,error012:(Q)=>`Node with id "${Q}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(Q="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${Q}/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:(Q)=>`Edge with id "${Q}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},s7=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],_X=["Enter"," ","Escape"],JX={"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:Q,x:U,y:Z})=>`Moved selected node ${Q}. New position, x: ${U}, y: ${Z}`,"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"},A6;(function(Q){Q.Strict="strict",Q.Loose="loose"})(A6||(A6={}));var B3;(function(Q){Q.Free="free",Q.Vertical="vertical",Q.Horizontal="horizontal"})(B3||(B3={}));var R8;(function(Q){Q.Partial="partial",Q.Full="full"})(R8||(R8={}));var $X={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},y4;(function(Q){Q.Bezier="default",Q.Straight="straight",Q.Step="step",Q.SmoothStep="smoothstep",Q.SimpleBezier="simplebezier"})(y4||(y4={}));var i7;(function(Q){Q.Arrow="arrow",Q.ArrowClosed="arrowclosed"})(i7||(i7={}));var C1;(function(Q){Q.Left="left",Q.Top="top",Q.Right="right",Q.Bottom="bottom"})(C1||(C1={}));var eL={[C1.Left]:C1.Right,[C1.Right]:C1.Left,[C1.Top]:C1.Bottom,[C1.Bottom]:C1.Top},QX=(Q)=>!!Q&&typeof Q==="object"&&("id"in Q)&&("source"in Q)&&("target"in Q),WM=(Q)=>!!Q&&typeof Q==="object"&&("id"in Q)&&("position"in Q)&&!("source"in Q)&&!("target"in Q),qX=(Q)=>!!Q&&typeof Q==="object"&&("id"in Q)&&("internals"in Q)&&!("source"in Q)&&!("target"in Q);var AJ=(Q,U=[0,0])=>{let{width:Z,height:K}=y5(Q),X=Q.origin??U,W=Z*X[0],z=K*X[1];return{x:Q.position.x-W,y:Q.position.y-z}},UX=(Q,U={nodeOrigin:[0,0]})=>{if(!U.nodeLookup)console.warn("Please use `getNodesBounds` from `useReactFlow`/`useSvelteFlow` hook to ensure correct values for sub flows. If not possible, you have to provide a nodeLookup to support sub flows.");if(Q.length===0)return{x:0,y:0,width:0,height:0};let Z=!1,K=Q.reduce((X,W)=>{let z=typeof W==="string",B=!U.nodeLookup&&!z?W:void 0;if(U.nodeLookup)B=z?U.nodeLookup.get(W):!qX(W)?U.nodeLookup.get(W.id):W;if(!B)return X;return Z=!0,Cq(X,fq(B,U.nodeOrigin))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Z?Sq(K):{x:0,y:0,width:0,height:0}},f8=(Q,U={})=>{let Z={x:1/0,y:1/0,x2:-1/0,y2:-1/0},K=!1;return Q.forEach((X)=>{if(U.filter===void 0||U.filter(X))Z=Cq(Z,fq(X)),K=!0}),K?Sq(Z):{x:0,y:0,width:0,height:0}},Pq=(Q,U,[Z,K,X]=[0,0,1],W=!1,z=!1)=>{let B=(U.x-Z)/X,O=(U.y-K)/X,T=U.width/X,R=U.height/X,L=[];for(let M of Q.values()){let{measured:I,selectable:f=!0,hidden:D=!1}=M;if(z&&!f||D)continue;let V=I.width??M.width??M.initialWidth??0,k=I.height??M.height??M.initialHeight??0,{x:h,y:P}=M.internals.positionAbsolute,C=MM(B,O,T,R,h,P,V,k),v=V*k,b=W&&C>0;if(!M.internals.handleBounds||b||C>=v||M.dragging)L.push(M)}return L},zM=(Q,U)=>{let Z=new Set;return Q.forEach((K)=>{Z.add(K.id)}),U.filter((K)=>Z.has(K.source)||Z.has(K.target))};function oN(Q,U){let Z=new Map,K=U?.nodes?new Set(U.nodes.map((X)=>X.id)):null;return Q.forEach((X)=>{let W;if(U?.includeHiddenNodes){let{width:z,height:B}=y5(X);W=z>0&&B>0}else W=Boolean(X.measured.width&&X.measured.height&&!X.hidden);if(W&&(!K||K.has(X.id)))Z.set(X.id,X)}),Z}async function BM({nodes:Q,width:U,height:Z,panZoom:K,minZoom:X,maxZoom:W},z){if(Q.size===0)return!0;let B=oN(Q,z),O=f8(B),T=MJ(O,U,Z,z?.minZoom??X,z?.maxZoom??W,z?.padding??0.1);return await K.setViewport(T,{duration:z?.duration,ease:z?.ease,interpolate:z?.interpolate}),!0}function GX({nodeId:Q,nextPosition:U,nodeLookup:Z,nodeOrigin:K=[0,0],nodeExtent:X,onError:W}){let z=Z.get(Q),B=z.parentId?Z.get(z.parentId):void 0,{x:O,y:T}=B?B.internals.positionAbsolute:{x:0,y:0},R=z.origin??K,L=z.extent||X;if(z.extent==="parent"&&!z.expandParent)if(!B)W?.("005",x2.error005());else{let{width:I,height:f}=y5(B);if(I&&f)L=[[O,T],[O+I,T+f]]}else if(B&&I8(z.extent))L=[[z.extent[0][0]+O,z.extent[0][1]+T],[z.extent[1][0]+O,z.extent[1][1]+T]];let M=I8(L)?O8(U,L,z.measured):U;if(z.measured.width===void 0||z.measured.height===void 0)W?.("015",x2.error015());return{position:{x:M.x-O+(z.measured.width??0)*R[0],y:M.y-T+(z.measured.height??0)*R[1]},positionAbsolute:M}}async function AM({nodesToRemove:Q=[],edgesToRemove:U=[],nodes:Z,edges:K,onBeforeDelete:X}){let W=new Set(Q.map((M)=>M.id)),z=[];for(let M of Z){if(M.deletable===!1)continue;let I=W.has(M.id),f=!I&&M.parentId&&z.find((D)=>D.id===M.parentId);if(I||f)z.push(M)}let B=new Set(U.map((M)=>M.id)),O=K.filter((M)=>M.deletable!==!1),R=zM(z,O);for(let M of O)if(B.has(M.id)&&!R.find((f)=>f.id===M.id))R.push(M);if(!X)return{edges:R,nodes:z};let L=await X({nodes:z,edges:R});if(typeof L==="boolean")return L?{edges:R,nodes:z}:{edges:[],nodes:[]};return L}var a7=(Q,U=0,Z=1)=>Math.min(Math.max(Q,U),Z),O8=(Q={x:0,y:0},U,Z)=>({x:a7(Q.x,U[0][0],U[1][0]-(Z?.width??0)),y:a7(Q.y,U[0][1],U[1][1]-(Z?.height??0))});function LM(Q,U,Z){let{width:K,height:X}=y5(Z),{x:W,y:z}=Z.internals.positionAbsolute;return O8(Q,[[W,z],[W+K,z+X]],U)}var _M=(Q,U,Z)=>{if(Q<U)return a7(Math.abs(Q-U),1,U)/U;else if(Q>Z)return-a7(Math.abs(Q-Z),1,U)/U;return 0},Nq=(Q,U,Z=15,K=40)=>{let X=_M(Q.x,K,U.width-K)*Z,W=_M(Q.y,K,U.height-K)*Z;return[X,W]},Cq=(Q,U)=>({x:Math.min(Q.x,U.x),y:Math.min(Q.y,U.y),x2:Math.max(Q.x2,U.x2),y2:Math.max(Q.y2,U.y2)}),eK=({x:Q,y:U,width:Z,height:K})=>({x:Q,y:U,x2:Q+Z,y2:U+K}),Sq=({x:Q,y:U,x2:Z,y2:K})=>({x:Q,y:U,width:Z-Q,height:K-U}),t7=(Q,U=[0,0])=>{let{x:Z,y:K}=qX(Q)?Q.internals.positionAbsolute:AJ(Q,U);return{x:Z,y:K,width:Q.measured?.width??Q.width??Q.initialWidth??0,height:Q.measured?.height??Q.height??Q.initialHeight??0}},fq=(Q,U=[0,0])=>{let{x:Z,y:K}=qX(Q)?Q.internals.positionAbsolute:AJ(Q,U);return{x:Z,y:K,x2:Z+(Q.measured?.width??Q.width??Q.initialWidth??0),y2:K+(Q.measured?.height??Q.height??Q.initialHeight??0)}},ZX=(Q,U)=>Sq(Cq(eK(Q),eK(U))),MM=(Q,U,Z,K,X,W,z,B)=>{let O=Math.max(0,Math.min(Q+Z,X+z)-Math.max(Q,X)),T=Math.max(0,Math.min(U+K,W+B)-Math.max(U,W));return Math.ceil(O*T)},LJ=(Q,U)=>MM(Q.x,Q.y,Q.width,Q.height,U.x,U.y,U.width,U.height),FX=(Q)=>k5(Q.width)&&k5(Q.height)&&k5(Q.x)&&k5(Q.y),k5=(Q)=>!isNaN(Q)&&isFinite(Q),KX=(Q,U)=>(Z,K)=>{console.warn(`[${Q}]: ${K} Help: ${U}error#${Z}`)},o7=(Q,U=[1,1])=>{return{x:U[0]*Math.round(Q.x/U[0]),y:U[1]*Math.round(Q.y/U[1])}},n7=({x:Q,y:U},[Z,K,X],W=!1,z=[1,1])=>{let B={x:(Q-Z)/X,y:(U-K)/X};return W?o7(B,z):B},w8=({x:Q,y:U},[Z,K,X])=>{return{x:Q*X+Z,y:U*X+K}};function d7(Q,U){if(typeof Q==="number")return Math.floor((U-U/(1+Q))*0.5);if(typeof Q==="string"&&Q.endsWith("px")){let Z=parseFloat(Q);if(!Number.isNaN(Z))return Math.floor(Z)}if(typeof Q==="string"&&Q.endsWith("%")){let Z=parseFloat(Q);if(!Number.isNaN(Z))return Math.floor(U*Z*0.01)}return console.error(`The padding value "${Q}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function nN(Q,U,Z){if(typeof Q==="string"||typeof Q==="number"){let K=d7(Q,Z),X=d7(Q,U);return{top:K,right:X,bottom:K,left:X,x:X*2,y:K*2}}if(typeof Q==="object"){let K=d7(Q.top??Q.y??0,Z),X=d7(Q.bottom??Q.y??0,Z),W=d7(Q.left??Q.x??0,U),z=d7(Q.right??Q.x??0,U);return{top:K,right:z,bottom:X,left:W,x:W+z,y:K+X}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function eN(Q,U,Z,K,X,W){let{x:z,y:B}=w8(Q,[U,Z,K]),{x:O,y:T}=w8({x:Q.x+Q.width,y:Q.y+Q.height},[U,Z,K]),R=X-O,L=W-T;return{left:Math.floor(z),top:Math.floor(B),right:Math.floor(R),bottom:Math.floor(L)}}var MJ=(Q,U,Z,K,X,W)=>{let z=nN(W,U,Z),B=(U-z.x)/Q.width,O=(Z-z.y)/Q.height,T=Math.min(B,O),R=a7(T,K,X),L=Q.x+Q.width/2,M=Q.y+Q.height/2,I=U/2-L*R,f=Z/2-M*R,D=eN(Q,I,f,R,U,Z),V={left:Math.min(D.left-z.left,0),top:Math.min(D.top-z.top,0),right:Math.min(D.right-z.right,0),bottom:Math.min(D.bottom-z.bottom,0)};return{x:I-V.left+V.right,y:f-V.top+V.bottom,zoom:R}},e7=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function I8(Q){return Q!==void 0&&Q!==null&&Q!=="parent"}function y5(Q){return{width:Q.measured?.width??Q.width??Q.initialWidth??0,height:Q.measured?.height??Q.height??Q.initialHeight??0}}function XX(Q){return(Q.measured?.width??Q.width??Q.initialWidth)!==void 0&&(Q.measured?.height??Q.height??Q.initialHeight)!==void 0}function HX(Q,U={width:0,height:0},Z,K,X){let W={...Q},z=K.get(Z);if(z){let B=z.origin||X;W.x+=z.internals.positionAbsolute.x-(U.width??0)*B[0],W.y+=z.internals.positionAbsolute.y-(U.height??0)*B[1]}return W}function YX(Q,U){if(Q.size!==U.size)return!1;for(let Z of Q)if(!U.has(Z))return!1;return!0}function TM(){let Q,U;return{promise:new Promise((K,X)=>{Q=K,U=X}),resolve:Q,reject:U}}function RM(Q){return{...JX,...Q||{}}}function _C(Q){if(typeof document>"u")return!0;let U=document.querySelector(`.${Q}-flow__pane`);if(!U||!U.isConnected)return!0;let Z=getComputedStyle(U);if(Z.display==="none")return!0;if(Z.visibility==="hidden"||Z.visibility==="collapse")return!0;if(Z.opacity==="0")return!0;if(Z.width==="0"&&Z.height==="0")return!0;let K=U.getBoundingClientRect();if(K.width===0&&K.height===0)return!0;let X=document.querySelector(`.${Q}-flow__attribution`);if(!X||!X.isConnected)return!1;let W=getComputedStyle(X);if(W.display==="none")return!1;if(W.visibility==="hidden"||W.visibility==="collapse")return!1;if(W.opacity==="0")return!1;let z=X.getBoundingClientRect();if(z.width===0&&z.height===0)return!1;return!0}var JM=!1;function OM(Q){if(JM)return;JM=!0;let U=`${Q.charAt(0).toUpperCase()+Q.slice(1)} Flow`;setTimeout(()=>{if(!_C(Q))console.warn(`${U}: It seems like you are hiding the attribution. Please only do this when you are subscribed to ${U} Pro: https://${Q}flow.dev/remove-attr
241
- %cYou can ignore this warning if you are subscribed.`,"font-style: italic;")},1000)}function WX(Q){return Q===null?null:Q?"valid":"invalid"}function BJ(Q,{snapGrid:U=[0,0],snapToGrid:Z=!1,transform:K,containerBounds:X}){let{x:W,y:z}=D5(Q),B=n7({x:W-(X?.left??0),y:z-(X?.top??0)},K),{x:O,y:T}=Z?o7(B,U):B;return{xSnapped:O,ySnapped:T,...B}}var jq=(Q)=>({width:Q.offsetWidth,height:Q.offsetHeight}),zX=(Q)=>Q?.getRootNode?.()||window?.document,JC=["INPUT","SELECT","TEXTAREA"];function BX(Q){let U=Q.composedPath?.()?.[0]||Q.target;if(U?.nodeType!==1)return!1;return JC.includes(U.nodeName)||U.hasAttribute("contenteditable")||!!U.closest(".nokey")}var AX=(Q)=>("clientX"in Q),D5=(Q,U)=>{let Z=AX(Q),K=Z?Q.clientX:Q.touches?.[0].clientX,X=Z?Q.clientY:Q.touches?.[0].clientY;return{x:K-(U?.left??0),y:X-(U?.top??0)}},$M=(Q,U,Z,K,X)=>{let W=U.querySelectorAll(`.${Q}`);if(!W||!W.length)return null;return Array.from(W).map((z)=>{let B=z.getBoundingClientRect();return{id:z.getAttribute("data-handleid"),type:Q,nodeId:X,position:z.getAttribute("data-handlepos"),x:(B.left-Z.left)/K,y:(B.top-Z.top)/K,...jq(z)}})};function Vq({sourceX:Q,sourceY:U,targetX:Z,targetY:K,sourceControlX:X,sourceControlY:W,targetControlX:z,targetControlY:B}){let O=Q*0.125+X*0.375+z*0.375+Z*0.125,T=U*0.125+W*0.375+B*0.375+K*0.125,R=Math.abs(O-Q),L=Math.abs(T-U);return[O,T,R,L]}function wq(Q,U){if(Q>=0)return 0.5*Q;return U*25*Math.sqrt(-Q)}function QM({pos:Q,x1:U,y1:Z,x2:K,y2:X,c:W}){switch(Q){case C1.Left:return[U-wq(U-K,W),Z];case C1.Right:return[U+wq(K-U,W),Z];case C1.Top:return[U,Z-wq(Z-X,W)];case C1.Bottom:return[U,Z+wq(X-Z,W)]}}function kq({sourceX:Q,sourceY:U,sourcePosition:Z=C1.Bottom,targetX:K,targetY:X,targetPosition:W=C1.Top,curvature:z=0.25}){let[B,O]=QM({pos:Z,x1:Q,y1:U,x2:K,y2:X,c:z}),[T,R]=QM({pos:W,x1:K,y1:X,x2:Q,y2:U,c:z}),[L,M,I,f]=Vq({sourceX:Q,sourceY:U,targetX:K,targetY:X,sourceControlX:B,sourceControlY:O,targetControlX:T,targetControlY:R});return[`M${Q},${U} C${B},${O} ${T},${R} ${K},${X}`,L,M,I,f]}function LX({sourceX:Q,sourceY:U,targetX:Z,targetY:K}){let X=Math.abs(Z-Q)/2,W=Z<Q?Z+X:Z-X,z=Math.abs(K-U)/2,B=K<U?K+z:K-z;return[W,B,X,z]}function wM({sourceNode:Q,targetNode:U,selected:Z=!1,zIndex:K=0,elevateOnSelect:X=!1,zIndexMode:W="basic"}){if(W==="manual")return K;let z=X&&Z?K+1000:K,B=Math.max(Q.parentId||X&&Q.selected?Q.internals.z:0,U.parentId||X&&U.selected?U.internals.z:0);return z+B}function IM({sourceNode:Q,targetNode:U,width:Z,height:K,transform:X}){let W=Cq(fq(Q),fq(U));if(W.x===W.x2)W.x2+=1;if(W.y===W.y2)W.y2+=1;let z={x:-X[0]/X[2],y:-X[1]/X[2],width:Z/X[2],height:K/X[2]};return LJ(z,Sq(W))>0}var $C=({source:Q,sourceHandle:U,target:Z,targetHandle:K})=>`xy-edge__${Q}${U||""}-${Z}${K||""}`,QC=(Q,U)=>{return U.some((Z)=>Z.source===Q.source&&Z.target===Q.target&&(Z.sourceHandle===Q.sourceHandle||!Z.sourceHandle&&!Q.sourceHandle)&&(Z.targetHandle===Q.targetHandle||!Z.targetHandle&&!Q.targetHandle))},fM=(Q,U,Z={})=>{if(!Q.source||!Q.target)return Z.onError?.("006",x2.error006()),U;let K=Z.getEdgeId||$C,X;if(QX(Q))X={...Q};else X={...Q,id:K(Q)};if(QC(X,U))return U;if(X.sourceHandle===null)delete X.sourceHandle;if(X.targetHandle===null)delete X.targetHandle;return U.concat(X)};function Dq({sourceX:Q,sourceY:U,targetX:Z,targetY:K}){let[X,W,z,B]=LX({sourceX:Q,sourceY:U,targetX:Z,targetY:K});return[`M ${Q},${U}L ${Z},${K}`,X,W,z,B]}var qM={[C1.Left]:{x:-1,y:0},[C1.Right]:{x:1,y:0},[C1.Top]:{x:0,y:-1},[C1.Bottom]:{x:0,y:1}},qC=({source:Q,sourcePosition:U=C1.Bottom,target:Z})=>{if(U===C1.Left||U===C1.Right)return Q.x<Z.x?{x:1,y:0}:{x:-1,y:0};return Q.y<Z.y?{x:0,y:1}:{x:0,y:-1}},UM=(Q,U)=>Math.sqrt(Math.pow(U.x-Q.x,2)+Math.pow(U.y-Q.y,2));function UC({source:Q,sourcePosition:U=C1.Bottom,target:Z,targetPosition:K=C1.Top,center:X,offset:W,stepPosition:z}){let B=qM[U],O=qM[K],T={x:Q.x+B.x*W,y:Q.y+B.y*W},R={x:Z.x+O.x*W,y:Z.y+O.y*W},L=qC({source:T,sourcePosition:U,target:R}),M=L.x!==0?"x":"y",I=L[M],f=[],D,V,k={x:0,y:0},h={x:0,y:0},[,,P,C]=LX({sourceX:Q.x,sourceY:Q.y,targetX:Z.x,targetY:Z.y});if(B[M]*O[M]===-1){if(M==="x")D=X.x??T.x+(R.x-T.x)*z,V=X.y??(T.y+R.y)/2;else D=X.x??(T.x+R.x)/2,V=X.y??T.y+(R.y-T.y)*z;let p=[{x:D,y:T.y},{x:D,y:R.y}],a=[{x:T.x,y:V},{x:R.x,y:V}];if(B[M]===I)f=M==="x"?p:a;else f=M==="x"?a:p}else{let p=[{x:T.x,y:R.y}],a=[{x:R.x,y:T.y}];if(M==="x")f=B.x===I?a:p;else f=B.y===I?p:a;if(U===K){let y=Math.abs(Q[M]-Z[M]);if(y<=W){let u=Math.min(W-1,W-y);if(B[M]===I)k[M]=(T[M]>Q[M]?-1:1)*u;else h[M]=(R[M]>Z[M]?-1:1)*u}}if(U!==K){let y=M==="x"?"y":"x",u=B[M]===O[y],x=T[y]>R[y],d=T[y]<R[y];if(B[M]===1&&(!u&&x||u&&d)||B[M]!==1&&(!u&&d||u&&x))f=M==="x"?p:a}let m={x:T.x+k.x,y:T.y+k.y},_1={x:R.x+h.x,y:R.y+h.y},$1=Math.max(Math.abs(m.x-f[0].x),Math.abs(_1.x-f[0].x)),J1=Math.max(Math.abs(m.y-f[0].y),Math.abs(_1.y-f[0].y));if($1>=J1)D=(m.x+_1.x)/2,V=f[0].y;else D=f[0].x,V=(m.y+_1.y)/2}let v={x:T.x+k.x,y:T.y+k.y},b={x:R.x+h.x,y:R.y+h.y};return[[Q,...v.x!==f[0].x||v.y!==f[0].y?[v]:[],...f,...b.x!==f[f.length-1].x||b.y!==f[f.length-1].y?[b]:[],Z],D,V,P,C]}function GC(Q,U,Z,K){let X=Math.min(UM(Q,U)/2,UM(U,Z)/2,K),{x:W,y:z}=U;if(Q.x===W&&W===Z.x||Q.y===z&&z===Z.y)return`L${W} ${z}`;if(Q.y===z){let T=Q.x<Z.x?-1:1,R=Q.y<Z.y?1:-1;return`L ${W+X*T},${z}Q ${W},${z} ${W},${z+X*R}`}let B=Q.x<Z.x?1:-1,O=Q.y<Z.y?-1:1;return`L ${W},${z+X*O}Q ${W},${z} ${W+X*B},${z}`}function TJ({sourceX:Q,sourceY:U,sourcePosition:Z=C1.Bottom,targetX:K,targetY:X,targetPosition:W=C1.Top,borderRadius:z=5,centerX:B,centerY:O,offset:T=20,stepPosition:R=0.5}){let[L,M,I,f,D]=UC({source:{x:Q,y:U},sourcePosition:Z,target:{x:K,y:X},targetPosition:W,center:{x:B,y:O},offset:T,stepPosition:R}),V=`M${L[0].x} ${L[0].y}`;for(let k=1;k<L.length-1;k++)V+=GC(L[k-1],L[k],L[k+1],z);return V+=`L${L[L.length-1].x} ${L[L.length-1].y}`,[V,M,I,f,D]}function GM(Q){return Q&&!!(Q.internals.handleBounds||Q.handles?.length)&&!!(Q.measured.width||Q.width||Q.initialWidth)}function PM(Q){let{sourceNode:U,targetNode:Z}=Q;if(!GM(U)||!GM(Z))return null;let K=U.internals.handleBounds||ZM(U.handles),X=Z.internals.handleBounds||ZM(Z.handles),W=FM(K?.source??[],Q.sourceHandle),z=FM(Q.connectionMode===A6.Strict?X?.target??[]:(X?.target??[]).concat(X?.source??[]),Q.targetHandle);if(!W||!z)return Q.onError?.("008",x2.error008(!W?"source":"target",{id:Q.id,sourceHandle:Q.sourceHandle,targetHandle:Q.targetHandle})),null;let B=W?.position||C1.Bottom,O=z?.position||C1.Top,T=L6(U,W,B),R=L6(Z,z,O);return{sourceX:T.x,sourceY:T.y,targetX:R.x,targetY:R.y,sourcePosition:B,targetPosition:O}}function ZM(Q){if(!Q)return null;let U=[],Z=[];for(let K of Q)if(K.width=K.width??1,K.height=K.height??1,K.type==="source")U.push(K);else if(K.type==="target")Z.push(K);return{source:U,target:Z}}function L6(Q,U,Z=C1.Left,K=!1){let X=(U?.x??0)+Q.internals.positionAbsolute.x,W=(U?.y??0)+Q.internals.positionAbsolute.y,{width:z,height:B}=U??y5(Q);if(K)return{x:X+z/2,y:W+B/2};switch(U?.position??Z){case C1.Top:return{x:X+z/2,y:W};case C1.Right:return{x:X+z,y:W+B/2};case C1.Bottom:return{x:X+z/2,y:W+B};case C1.Left:return{x:X,y:W+B/2}}}function FM(Q,U){if(!Q)return null;return(!U?Q[0]:Q.find((Z)=>Z.id===U))||null}function yq(Q,U){if(!Q)return"";if(typeof Q==="string")return Q;return`${U?`${U}__`:""}${Object.keys(Q).sort().map((K)=>`${K}=${Q[K]}`).join("&")}`}function NM(Q,{id:U,defaultColor:Z,defaultMarkerStart:K,defaultMarkerEnd:X}){let W=new Set;return Q.reduce((z,B)=>{return[B.markerStart||K,B.markerEnd||X].forEach((O)=>{if(O&&typeof O==="object"){let T=yq(O,U);if(!W.has(T))z.push({id:T,color:O.color||Z,...O}),W.add(T)}}),z},[]).sort((z,B)=>z.id.localeCompare(B.id))}function CM(Q,U,Z,K,X){let W=0.5;if(X==="start")W=0;else if(X==="end")W=1;let z=[(Q.x+Q.width*W)*U.zoom+U.x,Q.y*U.zoom+U.y-K],B=[-100*W,-100];switch(Z){case C1.Right:z=[(Q.x+Q.width)*U.zoom+U.x+K,(Q.y+Q.height*W)*U.zoom+U.y],B=[0,-100*W];break;case C1.Bottom:z[1]=(Q.y+Q.height)*U.zoom+U.y+K,B[1]=0;break;case C1.Left:z=[Q.x*U.zoom+U.x-K,(Q.y+Q.height*W)*U.zoom+U.y],B=[-100,-100*W];break}return`translate(${z[0]}px, ${z[1]}px) translate(${B[0]}%, ${B[1]}%)`}var SM=1000,ZC=10,MX={nodeOrigin:[0,0],nodeExtent:s7,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},FC={...MX,checkEquality:!0};function TX(Q,U){let Z={...Q};for(let K in U)if(U[K]!==void 0)Z[K]=U[K];return Z}function jM(Q,U,Z){let K=TX(MX,Z);for(let X of Q.values())if(X.parentId)OX(X,Q,U,K);else{let W=AJ(X,K.nodeOrigin),z=I8(X.extent)?X.extent:K.nodeExtent,B=O8(W,z,y5(X));X.internals.positionAbsolute=B}}function KC(Q,U){if(!Q.handles)return!Q.measured?void 0:U?.internals.handleBounds;let Z=[],K=[];for(let X of Q.handles){let W={id:X.id,width:X.width??1,height:X.height??1,nodeId:Q.id,x:X.x,y:X.y,position:X.position,type:X.type};if(X.type==="source")Z.push(W);else if(X.type==="target")K.push(W)}return{source:Z,target:K}}function RX(Q){return Q==="manual"}function vq(Q,U,Z,K={}){let X=TX(FC,K),W={i:0},z=new Map(U),B=X?.elevateNodesOnSelect&&!RX(X.zIndexMode)?SM:0,O=Q.length>0,T=!1;U.clear(),Z.clear();for(let R of Q){let L=z.get(R.id);if(X.checkEquality&&R===L?.internals.userNode)U.set(R.id,L);else{let M=AJ(R,X.nodeOrigin),I=I8(R.extent)?R.extent:X.nodeExtent,f=O8(M,I,y5(R));L={...X.defaults,...R,measured:{width:R.measured?.width,height:R.measured?.height},internals:{positionAbsolute:f,handleBounds:KC(R,L),z:VM(R,B,X.zIndexMode),userNode:R}},U.set(R.id,L)}if((L.measured===void 0||L.measured.width===void 0||L.measured.height===void 0)&&!L.hidden)O=!1;if(R.parentId)OX(L,U,Z,K,W);T||=R.selected??!1}return{nodesInitialized:O,hasSelectedNodes:T}}function XC(Q,U){if(!Q.parentId)return;let Z=U.get(Q.parentId);if(Z)Z.set(Q.id,Q);else U.set(Q.parentId,new Map([[Q.id,Q]]))}function OX(Q,U,Z,K,X){let{elevateNodesOnSelect:W,nodeOrigin:z,nodeExtent:B,zIndexMode:O}=TX(MX,K),T=Q.parentId,R=U.get(T);if(!R){console.warn(`Parent node ${T} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}if(XC(Q,Z),X&&!R.parentId&&R.internals.rootParentIndex===void 0&&O==="auto")R.internals.rootParentIndex=++X.i,R.internals.z=R.internals.z+X.i*ZC;if(X&&R.internals.rootParentIndex!==void 0)X.i=R.internals.rootParentIndex;let L=W&&!RX(O)?SM:0,{x:M,y:I,z:f}=HC(Q,R,z,B,L,O),{positionAbsolute:D}=Q.internals,V=M!==D.x||I!==D.y;if(V||f!==Q.internals.z)U.set(Q.id,{...Q,internals:{...Q.internals,positionAbsolute:V?{x:M,y:I}:D,z:f}})}function VM(Q,U,Z){let K=k5(Q.zIndex)?Q.zIndex:0;if(RX(Z))return K;return K+(Q.selected?U:0)}function HC(Q,U,Z,K,X,W){let{x:z,y:B}=U.internals.positionAbsolute,O=y5(Q),T=AJ(Q,Z),R=I8(Q.extent)?O8(T,Q.extent,O):T,L=O8({x:z+R.x,y:B+R.y},K,O);if(Q.extent==="parent")L=LM(L,O,U);let M=VM(Q,X,W),I=U.internals.z??0;return{x:L.x,y:L.y,z:I>=M?I+1:M}}function Eq(Q,U,Z,K=[0,0]){let X=[],W=new Map;for(let z of Q){let B=U.get(z.parentId);if(!B)continue;let O=W.get(z.parentId)?.expandedRect??t7(B),T=ZX(O,z.rect);W.set(z.parentId,{expandedRect:T,parent:B})}if(W.size>0)W.forEach(({expandedRect:z,parent:B},O)=>{let T=B.internals.positionAbsolute,R=y5(B),L=B.origin??K,M=z.x<T.x?Math.round(Math.abs(T.x-z.x)):0,I=z.y<T.y?Math.round(Math.abs(T.y-z.y)):0,f=Math.max(R.width,Math.round(z.width)),D=Math.max(R.height,Math.round(z.height)),V=(f-R.width)*L[0],k=(D-R.height)*L[1];if(M>0||I>0||V||k)X.push({id:O,type:"position",position:{x:B.position.x-M+V,y:B.position.y-I+k}}),Z.get(O)?.forEach((h)=>{if(!Q.some((P)=>P.id===h.id))X.push({id:h.id,type:"position",position:{x:h.position.x+M,y:h.position.y+I}})});if(R.width<z.width||R.height<z.height||M||I)X.push({id:O,type:"dimensions",setAttributes:!0,dimensions:{width:f+(M?L[0]*M-V:0),height:D+(I?L[1]*I-k:0)}})});return X}function kM(Q,U,Z,K,X,W,z){let B=K?.querySelector(".xyflow__viewport"),O=!1;if(!B)return{changes:[],updatedInternals:O};let T=[],R=window.getComputedStyle(B),{m22:L}=new window.DOMMatrixReadOnly(R.transform),M=[];for(let I of Q.values()){let f=U.get(I.id);if(!f)continue;if(f.hidden){U.set(f.id,{...f,internals:{...f.internals,handleBounds:void 0}}),O=!0;continue}let D=jq(I.nodeElement),V=f.measured.width!==D.width||f.measured.height!==D.height;if(!!(D.width&&D.height&&(V||!f.internals.handleBounds||I.force))){let h=I.nodeElement.getBoundingClientRect(),P=I8(f.extent)?f.extent:W,{positionAbsolute:C}=f.internals;if(f.parentId&&f.extent==="parent"){let b=U.get(f.parentId);if(b)C=LM(C,D,b)}else if(P)C=O8(C,P,D);let v={...f,measured:D,internals:{...f.internals,positionAbsolute:C,handleBounds:{source:$M("source",I.nodeElement,h,L,f.id),target:$M("target",I.nodeElement,h,L,f.id)}}};if(U.set(f.id,v),f.parentId)OX(v,U,Z,{nodeOrigin:X,zIndexMode:z});if(O=!0,V){if(T.push({id:f.id,type:"dimensions",dimensions:D}),f.expandParent&&f.parentId)M.push({id:f.id,parentId:f.parentId,rect:t7(v,X)})}}}if(M.length>0){let I=Eq(M,U,Z,X);T.push(...I)}return{changes:T,updatedInternals:O}}async function DM({delta:Q,panZoom:U,transform:Z,translateExtent:K,width:X,height:W}){if(!U||!Q.x&&!Q.y)return!1;let z=await U.setViewportConstrained({x:Z[0]+Q.x,y:Z[1]+Q.y,zoom:Z[2]},[[0,0],[X,W]],K);return!!z&&(z.x!==Z[0]||z.y!==Z[1]||z.k!==Z[2])}function KM(Q,U,Z,K,X,W){let z=X,B=K.get(z)||new Map;K.set(z,B.set(Z,U)),z=`${X}-${Q}`;let O=K.get(z)||new Map;if(K.set(z,O.set(Z,U)),W){z=`${X}-${Q}-${W}`;let T=K.get(z)||new Map;K.set(z,T.set(Z,U))}}function wX(Q,U,Z){Q.clear(),U.clear();for(let K of Z){let{source:X,target:W,sourceHandle:z=null,targetHandle:B=null}=K,O={edgeId:K.id,source:X,target:W,sourceHandle:z,targetHandle:B},T=`${X}-${z}--${W}-${B}`,R=`${W}-${B}--${X}-${z}`;KM("source",O,R,Q,X,z),KM("target",O,T,Q,W,B),U.set(K.id,K)}}function yM(Q,U){if(!Q.parentId)return!1;let Z=U.get(Q.parentId);if(!Z)return!1;if(Z.selected)return!0;return yM(Z,U)}function XM(Q,U,Z){let K=Q;do{if(K?.matches?.(U))return!0;if(K===Z)return!1;K=K?.parentElement}while(K);return!1}function YC(Q,U,Z,K){let X=new Map;for(let[W,z]of Q)if((z.selected||z.id===K)&&(!z.parentId||!yM(z,Q))&&(z.draggable||U&&typeof z.draggable>"u")){let B=Q.get(W);if(B)X.set(W,{id:W,position:B.position||{x:0,y:0},distance:{x:Z.x-B.internals.positionAbsolute.x,y:Z.y-B.internals.positionAbsolute.y},extent:B.extent,parentId:B.parentId,origin:B.origin,expandParent:B.expandParent,internals:{positionAbsolute:B.internals.positionAbsolute||{x:0,y:0}},measured:{width:B.measured.width??0,height:B.measured.height??0}})}return X}function tK({nodeId:Q,dragItems:U,nodeLookup:Z,dragging:K=!0}){let X=[];for(let[z,B]of U){let O=Z.get(z)?.internals.userNode;if(O)X.push({...O,position:B.position,dragging:K})}if(!Q)return[X[0],X];let W=Z.get(Q)?.internals.userNode;return[!W?X[0]:{...W,position:U.get(Q)?.position||W.position,dragging:K},X]}function WC({dragItems:Q,snapGrid:U,x:Z,y:K}){let X=Q.values().next().value;if(!X)return null;let W={x:Z-X.distance.x,y:K-X.distance.y},z=o7(W,U);return{x:z.x-W.x,y:z.y-W.y}}function vM({onNodeMouseDown:Q,getStoreItems:U,onDragStart:Z,onDrag:K,onDragStop:X}){let W={x:null,y:null},z=0,B=new Map,O=!1,T={x:0,y:0},R=null,L=!1,M=null,I=!1,f=!1,D=null;function V({noDragClassName:h,handleSelector:P,domNode:C,isSelectable:v,nodeId:b,nodeClickDistance:E=0}){M=n0(C);function p({x:$1,y:J1}){let{nodeLookup:y,nodeExtent:u,snapGrid:x,snapToGrid:d,nodeOrigin:g,onNodeDrag:n,onSelectionDrag:j,onError:i,updateNodePositions:q1}=U();W={x:$1,y:J1};let Q1=!1,Y1=B.size>1,L1=Y1&&u?eK(f8(B)):null,M1=Y1&&d?WC({dragItems:B,snapGrid:x,x:$1,y:J1}):null;for(let[I1,X1]of B){if(!y.has(I1))continue;let f1={x:$1-X1.distance.x,y:J1-X1.distance.y};if(d)f1=M1?{x:Math.round(f1.x+M1.x),y:Math.round(f1.y+M1.y)}:o7(f1,x);let l1=null;if(Y1&&u&&!X1.extent&&L1){let{positionAbsolute:v1}=X1.internals,c1=v1.x-L1.x+u[0][0],E1=v1.x+X1.measured.width-L1.x2+u[1][0],j1=v1.y-L1.y+u[0][1],V0=v1.y+X1.measured.height-L1.y2+u[1][1];l1=[[c1,j1],[E1,V0]]}let{position:W1,positionAbsolute:S1}=GX({nodeId:I1,nextPosition:f1,nodeLookup:y,nodeExtent:l1?l1:u,nodeOrigin:g,onError:i});Q1=Q1||X1.position.x!==W1.x||X1.position.y!==W1.y,X1.position=W1,X1.internals.positionAbsolute=S1}if(f=f||Q1,!Q1)return;if(q1(B,!0),D&&(K||n||!b&&j)){let[I1,X1]=tK({nodeId:b,dragItems:B,nodeLookup:y});if(K?.(D,B,I1,X1),n?.(D,I1,X1),!b)j?.(D,X1)}}async function a(){if(!R)return;let{transform:$1,panBy:J1,autoPanSpeed:y,autoPanOnNodeDrag:u}=U();if(!u){O=!1,cancelAnimationFrame(z);return}let[x,d]=Nq(T,R,y);if(x!==0||d!==0){if(W.x=(W.x??0)-x/$1[2],W.y=(W.y??0)-d/$1[2],await J1({x,y:d}))p(W)}z=requestAnimationFrame(a)}function m($1){let{nodeLookup:J1,multiSelectionActive:y,nodesDraggable:u,transform:x,snapGrid:d,snapToGrid:g,selectNodesOnDrag:n,onNodeDragStart:j,onSelectionDragStart:i,unselectNodesAndEdges:q1}=U();if(L=!0,(!n||!v)&&!y&&b){if(!J1.get(b)?.selected)q1()}if(v&&n&&b)Q?.(b);let Q1=BJ($1.sourceEvent,{transform:x,snapGrid:d,snapToGrid:g,containerBounds:R});if(W=Q1,B=YC(J1,u,Q1,b),B.size>0&&(Z||j||!b&&i)){let[Y1,L1]=tK({nodeId:b,dragItems:B,nodeLookup:J1});if(Z?.($1.sourceEvent,B,Y1,L1),j?.($1.sourceEvent,Y1,L1),!b)i?.($1.sourceEvent,L1)}}let _1=t_().clickDistance(E).on("start",($1)=>{let{domNode:J1,nodeDragThreshold:y,transform:u,snapGrid:x,snapToGrid:d}=U();if(R=J1?.getBoundingClientRect()||null,I=!1,f=!1,D=$1.sourceEvent,y===0)m($1);W=BJ($1.sourceEvent,{transform:u,snapGrid:x,snapToGrid:d,containerBounds:R}),T=D5($1.sourceEvent,R)}).on("drag",($1)=>{let{autoPanOnNodeDrag:J1,transform:y,snapGrid:u,snapToGrid:x,nodeDragThreshold:d,nodeLookup:g}=U(),n=BJ($1.sourceEvent,{transform:y,snapGrid:u,snapToGrid:x,containerBounds:R});if(D=$1.sourceEvent,$1.sourceEvent.type==="touchmove"&&$1.sourceEvent.touches.length>1||b&&!g.has(b))I=!0;if(I)return;if(!O&&J1&&L)O=!0,a();if(!L){let j=D5($1.sourceEvent,R),i=j.x-T.x,q1=j.y-T.y;if(Math.sqrt(i*i+q1*q1)>d)m($1)}if((W.x!==n.xSnapped||W.y!==n.ySnapped)&&B&&L)T=D5($1.sourceEvent,R),p(n)}).on("end",($1)=>{if(!L||I){if(I&&B.size>0)U().updateNodePositions(B,!1);return}if(O=!1,L=!1,cancelAnimationFrame(z),B.size>0){let{nodeLookup:J1,updateNodePositions:y,onNodeDragStop:u,onSelectionDragStop:x}=U();if(f)y(B,!1),f=!1;if(X||u||!b&&x){let[d,g]=tK({nodeId:b,dragItems:B,nodeLookup:J1,dragging:!1});if(X?.($1.sourceEvent,B,d,g),u?.($1.sourceEvent,d,g),!b)x?.($1.sourceEvent,g)}}}).filter(($1)=>{let J1=$1.target;return!$1.button&&(!h||!XM(J1,`.${h}`,C))&&(!P||XM(J1,P,C))});M.call(_1)}function k(){M?.on(".drag",null)}return{update:V,destroy:k}}function zC(Q,U,Z){let K=[],X={x:Q.x-Z,y:Q.y-Z,width:Z*2,height:Z*2};for(let W of U.values())if(LJ(X,t7(W))>0)K.push(W);return K}var BC=250;function AC(Q,U,Z,K){let X=[],W=1/0,z=zC(Q,Z,U+BC);for(let B of z){let O=[...B.internals.handleBounds?.source??[],...B.internals.handleBounds?.target??[]];for(let T of O){if(K.nodeId===T.nodeId&&K.type===T.type&&K.id===T.id)continue;let{x:R,y:L}=L6(B,T,T.position,!0),M=Math.sqrt(Math.pow(R-Q.x,2)+Math.pow(L-Q.y,2));if(M>U)continue;if(M<W)X=[{...T,x:R,y:L}],W=M;else if(M===W)X.push({...T,x:R,y:L})}}if(!X.length)return null;if(X.length>1){let B=K.type==="source"?"target":"source";return X.find((O)=>O.type===B)??X[0]}return X[0]}function EM(Q,U,Z,K,X,W=!1){let z=K.get(Q);if(!z)return null;let B=X==="strict"?z.internals.handleBounds?.[U]:[...z.internals.handleBounds?.source??[],...z.internals.handleBounds?.target??[]],O=(Z?B?.find((T)=>T.id===Z):B?.[0])??null;return O&&W?{...O,...L6(z,O,O.position,!0)}:O}function bM(Q,U){if(Q)return Q;else if(U?.classList.contains("target"))return"target";else if(U?.classList.contains("source"))return"source";return null}function LC(Q,U){let Z=null;if(U)Z=!0;else if(Q&&!U)Z=!1;return Z}var uM=()=>!0;function MC(Q,{connectionMode:U,connectionRadius:Z,handleId:K,nodeId:X,edgeUpdaterType:W,isTarget:z,domNode:B,nodeLookup:O,lib:T,autoPanOnConnect:R,flowId:L,panBy:M,cancelConnection:I,onConnectStart:f,onConnect:D,onConnectEnd:V,isValidConnection:k=uM,onReconnectEnd:h,updateConnection:P,getTransform:C,getFromHandle:v,autoPanSpeed:b,dragThreshold:E=1,handleDomNode:p}){let a=zX(Q.target),m=0,_1,{x:$1,y:J1}=D5(Q),y=bM(W,p),u=B?.getBoundingClientRect(),x=!1;if(!u||!y)return;let d=EM(X,y,K,O,U);if(!d)return;let g=D5(Q,u),n=!1,j=null,i=!1,q1=null;function Q1(){if(!R||!u)return;let[W1,S1]=Nq(g,u,b);M({x:W1,y:S1}),m=requestAnimationFrame(Q1)}let Y1={...d,nodeId:X,type:y,position:d.position},L1=O.get(X),I1={inProgress:!0,isValid:null,from:L6(L1,Y1,C1.Left,!0),fromHandle:Y1,fromPosition:Y1.position,fromNode:L1,to:g,toHandle:null,toPosition:eL[Y1.position],toNode:null,pointer:g};function X1(){x=!0,P(I1),f?.(Q,{nodeId:X,handleId:K,handleType:y})}if(E===0)X1();function f1(W1){if(!x){let{x:V0,y:b1}=D5(W1),Z2=V0-$1,_0=b1-J1;if(!(Z2*Z2+_0*_0>E*E))return;X1()}if(!v()||!Y1){l1(W1);return}let S1=C();if(g=D5(W1,u),_1=AC(n7(g,S1,!1,[1,1]),Z,O,Y1),!n)Q1(),n=!0;let v1=xM(W1,{handle:_1,connectionMode:U,fromNodeId:X,fromHandleId:K,fromType:z?"target":"source",isValidConnection:k,doc:a,lib:T,flowId:L,nodeLookup:O});q1=v1.handleDomNode,j=v1.connection,i=LC(!!_1,v1.isValid);let c1=O.get(X),E1=c1?L6(c1,Y1,C1.Left,!0):I1.from,j1={...I1,from:E1,isValid:i,to:v1.toHandle&&i?w8({x:v1.toHandle.x,y:v1.toHandle.y},S1):g,toHandle:v1.toHandle,toPosition:i&&v1.toHandle?v1.toHandle.position:eL[Y1.position],toNode:v1.toHandle?O.get(v1.toHandle.nodeId):null,pointer:g};P(j1),I1=j1}function l1(W1){if("touches"in W1&&W1.touches.length>0)return;if(x){if((_1||q1)&&j&&i)D?.(j);let{inProgress:S1,...v1}=I1,c1={...v1,toPosition:I1.toHandle?I1.toPosition:null};if(V?.(W1,c1),W)h?.(W1,c1)}I(),cancelAnimationFrame(m),n=!1,i=!1,j=null,q1=null,a.removeEventListener("mousemove",f1),a.removeEventListener("mouseup",l1),a.removeEventListener("touchmove",f1),a.removeEventListener("touchend",l1)}a.addEventListener("mousemove",f1),a.addEventListener("mouseup",l1),a.addEventListener("touchmove",f1),a.addEventListener("touchend",l1)}function xM(Q,{handle:U,connectionMode:Z,fromNodeId:K,fromHandleId:X,fromType:W,doc:z,lib:B,flowId:O,isValidConnection:T=uM,nodeLookup:R}){let L=W==="target",M=U?z.querySelector(`.${B}-flow__handle[data-id="${O}-${U?.nodeId}-${U?.id}-${U?.type}"]`):null,{x:I,y:f}=D5(Q),D=z.elementFromPoint(I,f),V=D?.classList.contains(`${B}-flow__handle`)?D:M,k={handleDomNode:V,isValid:!1,connection:null,toHandle:null};if(V){let h=bM(void 0,V),P=V.getAttribute("data-nodeid"),C=V.getAttribute("data-handleid"),v=V.classList.contains("connectable"),b=V.classList.contains("connectableend");if(!P||!h)return k;let E={source:L?P:K,sourceHandle:L?C:X,target:L?K:P,targetHandle:L?X:C};k.connection=E;let a=v&&b&&(Z===A6.Strict?L&&h==="source"||!L&&h==="target":P!==K||C!==X);k.isValid=a&&T(E),k.toHandle=EM(P,h,C,R,Z,!0)}return k}var bq={onPointerDown:MC,isValid:xM};function hM({domNode:Q,panZoom:U,getTransform:Z,getViewScale:K}){let X=n0(Q);function W({translateExtent:B,width:O,height:T,zoomStep:R=1,pannable:L=!0,zoomable:M=!0,inversePan:I=!1}){let f=(P)=>{if(P.sourceEvent.type!=="wheel"||!U)return;let C=Z(),v=P.sourceEvent.ctrlKey&&e7()?10:1,b=-P.sourceEvent.deltaY*(P.sourceEvent.deltaMode===1?0.05:P.sourceEvent.deltaMode?1:0.002)*R,E=C[2]*Math.pow(2,b*v);U.scaleTo(E)},D=[0,0],V=(P)=>{if(P.sourceEvent.type==="mousedown"||P.sourceEvent.type==="touchstart")D=[P.sourceEvent.clientX??P.sourceEvent.touches[0].clientX,P.sourceEvent.clientY??P.sourceEvent.touches[0].clientY]},k=(P)=>{let C=Z();if(P.sourceEvent.type!=="mousemove"&&P.sourceEvent.type!=="touchmove"||!U)return;let v=[P.sourceEvent.clientX??P.sourceEvent.touches[0].clientX,P.sourceEvent.clientY??P.sourceEvent.touches[0].clientY],b=[v[0]-D[0],v[1]-D[1]];D=v;let E=K()*Math.max(C[2],Math.log(C[2]))*(I?-1:1),p={x:C[0]-b[0]*E,y:C[1]-b[1]*E},a=[[0,0],[O,T]];U.setViewportConstrained({x:p.x,y:p.y,zoom:C[2]},a,B)},h=zJ().on("start",V).on("zoom",L?k:null).on("zoom.wheel",M?f:null);X.call(h,{})}function z(){X.on("zoom",null)}return{update:W,destroy:z,pointer:O2}}var uq=(Q)=>({x:Q.x,y:Q.y,zoom:Q.k}),oK=({x:Q,y:U,zoom:Z})=>M8.translate(Q,U).scale(Z),B6=(Q,U)=>Q.target.closest(`.${U}`),mM=(Q,U)=>U===2&&Array.isArray(Q)&&Q.includes(2),TC=(Q)=>((Q*=2)<=1?Q*Q*Q:(Q-=2)*Q*Q+2)/2,nK=(Q,U=0,Z=TC,K=()=>{})=>{let X=typeof U==="number"&&U>0;if(!X)K();return X?Q.transition().duration(U).ease(Z).on("end",K):Q},gM=(Q)=>{let U=Q.ctrlKey&&e7()?10:1;return-Q.deltaY*(Q.deltaMode===1?0.05:Q.deltaMode?1:0.002)*U};function RC({zoomPanValues:Q,noWheelClassName:U,d3Selection:Z,d3Zoom:K,panOnScrollMode:X,panOnScrollSpeed:W,zoomOnPinch:z,onPanZoomStart:B,onPanZoom:O,onPanZoomEnd:T}){return(R)=>{if(B6(R,U)){if(R.ctrlKey)R.preventDefault();return!1}R.preventDefault(),R.stopImmediatePropagation();let L=Z.property("__zoom").k||1;if(R.ctrlKey&&z){let V=O2(R),k=gM(R),h=L*Math.pow(2,k);K.scaleTo(Z,h,V,R);return}let M=R.deltaMode===1?20:1,I=X===B3.Vertical?0:R.deltaX*M,f=X===B3.Horizontal?0:R.deltaY*M;if(!e7()&&R.shiftKey&&X!==B3.Vertical)I=R.deltaY*M,f=0;K.translateBy(Z,-(I/L)*W,-(f/L)*W,{internal:!0});let D=uq(Z.property("__zoom"));if(clearTimeout(Q.panScrollTimeout),!Q.isPanScrolling)Q.isPanScrolling=!0,B?.(R,D);else O?.(R,D);Q.panScrollTimeout=setTimeout(()=>{T?.(R,D),Q.isPanScrolling=!1},150)}}function OC({noWheelClassName:Q,preventScrolling:U,d3ZoomHandler:Z}){return function(K,X){let W=K.type==="wheel",z=!U&&W&&!K.ctrlKey,B=B6(K,Q);if(K.ctrlKey&&W&&B)K.preventDefault();if(z||B)return null;K.preventDefault(),Z.call(this,K,X)}}function wC({zoomPanValues:Q,onDraggingChange:U,onPanZoomStart:Z}){return(K)=>{if(K.sourceEvent?.internal)return;let X=uq(K.transform);if(Q.mouseButton=K.sourceEvent?.button||0,Q.isZoomingOrPanning=!0,Q.prevViewport=X,K.sourceEvent?.type==="mousedown")U(!0);if(Z)Z?.(K.sourceEvent,X)}}function IC({zoomPanValues:Q,panOnDrag:U,onPaneContextMenu:Z,onTransformChange:K,onPanZoom:X}){return(W)=>{if(Q.usedRightMouseButton=!!(Z&&mM(U,Q.mouseButton??0)),!W.sourceEvent?.sync)K([W.transform.x,W.transform.y,W.transform.k]);if(X&&!W.sourceEvent?.internal)X?.(W.sourceEvent,uq(W.transform))}}function fC({zoomPanValues:Q,panOnDrag:U,panOnScroll:Z,onDraggingChange:K,onPanZoomEnd:X,onPaneContextMenu:W}){return(z)=>{if(z.sourceEvent?.internal)return;if(Q.isZoomingOrPanning=!1,W&&mM(U,Q.mouseButton??0)&&!Q.usedRightMouseButton&&z.sourceEvent)W(z.sourceEvent);if(Q.usedRightMouseButton=!1,K(!1),X){let B=uq(z.transform);Q.prevViewport=B,clearTimeout(Q.timerId),Q.timerId=setTimeout(()=>{X?.(z.sourceEvent,B)},Z?150:0)}}}function PC({panActivationKeyPressed:Q,zoomActivationKeyPressed:U,zoomOnScroll:Z,zoomOnPinch:K,panOnDrag:X,panOnScroll:W,zoomOnDoubleClick:z,userSelectionActive:B,noWheelClassName:O,noPanClassName:T,lib:R,connectionInProgress:L}){return(M)=>{let I=U||Z,f=K&&M.ctrlKey,D=M.type==="wheel";if(M.button===1&&M.type==="mousedown"&&(B6(M,`${R}-flow__node`)||B6(M,`${R}-flow__edge`)||B6(M,`${R}-flow__selection`)||B6(M,`${R}-flow__nodesselection`)))return!0;if(!X&&!I&&!W&&!z&&!K)return!1;if(B)return!1;if(L&&!D)return!1;if(B6(M,O)&&D)return!1;if(B6(M,T)&&(!D||W&&D&&!U))return!1;if(!K&&M.ctrlKey&&D)return!1;if(!K&&M.type==="touchstart"&&M.touches?.length>1)return M.preventDefault(),!1;if(!I&&!W&&!f&&D)return!1;if(!X&&(M.type==="mousedown"||M.type==="touchstart"))return!1;if(Array.isArray(X)&&!X.includes(M.button)&&M.type==="mousedown")return!1;let V=Array.isArray(X)&&X.includes(M.button)||!M.button||M.button<=1;return(!M.ctrlKey||D||Q)&&V}}function pM({domNode:Q,minZoom:U,maxZoom:Z,translateExtent:K,viewport:X,onPanZoom:W,onPanZoomStart:z,onPanZoomEnd:B,onDraggingChange:O}){let T={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},R=Q.getBoundingClientRect(),L=[[0,0],[R.width,R.height]];(typeof ResizeObserver<"u"?new ResizeObserver((J1)=>{let y=J1[0];if(y)L=[[0,0],[y.contentRect.width,y.contentRect.height]]}):null)?.observe(Q);let I=zJ().extent(()=>L).scaleExtent([U,Z]).translateExtent(K),f=n0(Q).call(I);C({x:X.x,y:X.y,zoom:a7(X.zoom,U,Z)},[[0,0],[R.width,R.height]],K);let D=f.on("wheel.zoom"),V=f.on("dblclick.zoom");I.wheelDelta(gM);async function k(J1,y){if(f)return new Promise((u)=>{I?.interpolate(y?.interpolate==="linear"?D4:A8).transform(nK(f,y?.duration,y?.ease,()=>u(!0)),J1)});return!1}function h({noWheelClassName:J1,noPanClassName:y,onPaneContextMenu:u,userSelectionActive:x,panOnScroll:d,panOnDrag:g,panOnScrollMode:n,panOnScrollSpeed:j,preventScrolling:i,zoomOnPinch:q1,zoomOnScroll:Q1,zoomOnDoubleClick:Y1,panActivationKeyPressed:L1=!1,zoomActivationKeyPressed:M1,lib:I1,onTransformChange:X1,connectionInProgress:f1,paneClickDistance:l1,selectionOnDrag:W1}){if(x&&!T.isZoomingOrPanning)P();let S1=d&&!M1&&!x;I.clickDistance(W1?1/0:!k5(l1)||l1<0?0:l1);let v1=S1?RC({zoomPanValues:T,noWheelClassName:J1,d3Selection:f,d3Zoom:I,panOnScrollMode:n,panOnScrollSpeed:j,zoomOnPinch:q1,onPanZoomStart:z,onPanZoom:W,onPanZoomEnd:B}):OC({noWheelClassName:J1,preventScrolling:i,d3ZoomHandler:D});f.on("wheel.zoom",v1,{passive:!1});let c1=wC({zoomPanValues:T,onDraggingChange:O,onPanZoomStart:z});I.on("start",c1);let E1=IC({zoomPanValues:T,panOnDrag:g,onPaneContextMenu:!!u,onPanZoom:W,onTransformChange:X1});I.on("zoom",E1);let j1=fC({zoomPanValues:T,panOnDrag:g,panOnScroll:d,onPaneContextMenu:u,onPanZoomEnd:B,onDraggingChange:O});I.on("end",j1);let V0=PC({panActivationKeyPressed:L1,zoomActivationKeyPressed:M1,panOnDrag:g,zoomOnScroll:Q1,panOnScroll:d,zoomOnDoubleClick:Y1,zoomOnPinch:q1,userSelectionActive:x,noPanClassName:y,noWheelClassName:J1,lib:I1,connectionInProgress:f1});if(I.filter(V0),Y1)f.on("dblclick.zoom",V);else f.on("dblclick.zoom",null)}function P(){I.on("zoom",null)}async function C(J1,y,u){let x=oK(J1),d=I?.constrain()(x,y,u);if(d)await k(d);return d}async function v(J1,y){let u=oK(J1);return await k(u,y),u}function b(J1){if(f){let y=oK(J1),u=f.property("__zoom");if(u.k!==J1.zoom||u.x!==J1.x||u.y!==J1.y)I?.transform(f,y,null,{sync:!0})}}function E(){let J1=f?WJ(f.node()):{x:0,y:0,k:1};return{x:J1.x,y:J1.y,zoom:J1.k}}async function p(J1,y){if(f)return new Promise((u)=>{I?.interpolate(y?.interpolate==="linear"?D4:A8).scaleTo(nK(f,y?.duration,y?.ease,()=>u(!0)),J1)});return!1}async function a(J1,y){if(f)return new Promise((u)=>{I?.interpolate(y?.interpolate==="linear"?D4:A8).scaleBy(nK(f,y?.duration,y?.ease,()=>u(!0)),J1)});return!1}function m(J1){I?.scaleExtent(J1)}function _1(J1){I?.translateExtent(J1)}function $1(J1){let y=!k5(J1)||J1<0?0:J1;I?.clickDistance(y)}return{update:h,destroy:P,setViewport:v,setViewportConstrained:C,getViewport:E,scaleTo:p,scaleBy:a,setScaleExtent:m,setTranslateExtent:_1,syncViewport:b,setClickDistance:$1}}var M6;(function(Q){Q.Line="line",Q.Handle="handle"})(M6||(M6={}));function NC({width:Q,prevWidth:U,height:Z,prevHeight:K,affectsX:X,affectsY:W}){let z=Q-U,B=Z-K,O=[z>0?1:z<0?-1:0,B>0?1:B<0?-1:0];if(z&&X)O[0]=O[0]*-1;if(B&&W)O[1]=O[1]*-1;return O}function HM(Q){let U=Q.includes("right")||Q.includes("left"),Z=Q.includes("bottom")||Q.includes("top"),K=Q.includes("left"),X=Q.includes("top");return{isHorizontal:U,isVertical:Z,affectsX:K,affectsY:X}}function W6(Q,U){return Math.max(0,U-Q)}function z6(Q,U){return Math.max(0,Q-U)}function Iq(Q,U,Z){return Math.max(0,U-Q,Q-Z)}function YM(Q,U){return Q?!U:U}function CC(Q,U,Z,K,X,W,z,B){let{affectsX:O,affectsY:T}=U,{isHorizontal:R,isVertical:L}=U,M=R&&L,{xSnapped:I,ySnapped:f}=Z,{minWidth:D,maxWidth:V,minHeight:k,maxHeight:h}=K,{x:P,y:C,width:v,height:b,aspectRatio:E}=Q,p=Math.floor(R?I-Q.pointerX:0),a=Math.floor(L?f-Q.pointerY:0),m=v+(O?-p:p),_1=b+(T?-a:a),$1=-W[0]*v,J1=-W[1]*b,y=Iq(m,D,V),u=Iq(_1,k,h);if(z){let g=0,n=0;if(O&&p<0)g=W6(P+p+$1,z[0][0]);else if(!O&&p>0)g=z6(P+m+$1,z[1][0]);if(T&&a<0)n=W6(C+a+J1,z[0][1]);else if(!T&&a>0)n=z6(C+_1+J1,z[1][1]);y=Math.max(y,g),u=Math.max(u,n)}if(B){let g=0,n=0;if(O&&p>0)g=z6(P+p,B[0][0]);else if(!O&&p<0)g=W6(P+m,B[1][0]);if(T&&a>0)n=z6(C+a,B[0][1]);else if(!T&&a<0)n=W6(C+_1,B[1][1]);y=Math.max(y,g),u=Math.max(u,n)}if(X){if(R){let g=Iq(m/E,k,h)*E;if(y=Math.max(y,g),z){let n=0;if(!O&&!T||O&&!T&&M)n=z6(C+J1+m/E,z[1][1])*E;else n=W6(C+J1+(O?p:-p)/E,z[0][1])*E;y=Math.max(y,n)}if(B){let n=0;if(!O&&!T||O&&!T&&M)n=W6(C+m/E,B[1][1])*E;else n=z6(C+(O?p:-p)/E,B[0][1])*E;y=Math.max(y,n)}}if(L){let g=Iq(_1*E,D,V)/E;if(u=Math.max(u,g),z){let n=0;if(!O&&!T||T&&!O&&M)n=z6(P+_1*E+$1,z[1][0])/E;else n=W6(P+(T?a:-a)*E+$1,z[0][0])/E;u=Math.max(u,n)}if(B){let n=0;if(!O&&!T||T&&!O&&M)n=W6(P+_1*E,B[1][0])/E;else n=z6(P+(T?a:-a)*E,B[0][0])/E;u=Math.max(u,n)}}}if(a=a+(a<0?u:-u),p=p+(p<0?y:-y),X)if(M)if(m>_1*E)a=(YM(O,T)?-p:p)/E;else p=(YM(O,T)?-a:a)*E;else if(R)a=p/E,T=O;else p=a*E,O=T;let x=O?P+p:P,d=T?C+a:C;return{width:v+(O?-p:p),height:b+(T?-a:a),x:W[0]*p*(!O?1:-1)+x,y:W[1]*a*(!T?1:-1)+d}}var cM={width:0,height:0,x:0,y:0},SC={...cM,pointerX:0,pointerY:0,aspectRatio:1};function jC(Q,U,Z){let K=U.position.x+Q.position.x,X=U.position.y+Q.position.y,W=Q.measured.width??0,z=Q.measured.height??0,B=Z[0]*W,O=Z[1]*z;return[[K-B,X-O],[K+W-B,X+z-O]]}function lM({domNode:Q,nodeId:U,getStoreItems:Z,onChange:K,onEnd:X}){let W=n0(Q),z={controlDirection:HM("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function B({controlPosition:T,boundaries:R,keepAspectRatio:L,resizeDirection:M,onResizeStart:I,onResize:f,onResizeEnd:D,shouldResize:V}){let k={...cM},h={...SC};z={boundaries:R,resizeDirection:M,keepAspectRatio:L,controlDirection:HM(T)};let P=void 0,C=null,v=[],b=void 0,E=void 0,p=void 0,a=t_().on("start",(m)=>{let{nodeLookup:_1,transform:$1,snapGrid:J1,snapToGrid:y,nodeOrigin:u,paneDomNode:x}=Z();if(P=_1.get(U),!P)return;C=x?.getBoundingClientRect()??null;let{xSnapped:d,ySnapped:g}=BJ(m.sourceEvent,{transform:$1,snapGrid:J1,snapToGrid:y,containerBounds:C});if(k={width:P.measured.width??0,height:P.measured.height??0,x:P.position.x??0,y:P.position.y??0},h={...k,pointerX:d,pointerY:g,aspectRatio:k.width/k.height},b=void 0,E=I8(P.extent)?P.extent:void 0,P.parentId&&(P.extent==="parent"||P.expandParent))b=_1.get(P.parentId);if(b&&P.extent==="parent")E=[[0,0],[b.measured.width,b.measured.height]];v=[],p=void 0;for(let[n,j]of _1)if(j.parentId===U){if(v.push({id:n,position:{...j.position},extent:j.extent}),j.extent==="parent"||j.expandParent){let i=jC(j,P,j.origin??u);if(p)p=[[Math.min(i[0][0],p[0][0]),Math.min(i[0][1],p[0][1])],[Math.max(i[1][0],p[1][0]),Math.max(i[1][1],p[1][1])]];else p=i}}I?.(m,{...k})}).on("drag",(m)=>{let{transform:_1,snapGrid:$1,snapToGrid:J1,nodeOrigin:y}=Z(),u=BJ(m.sourceEvent,{transform:_1,snapGrid:$1,snapToGrid:J1,containerBounds:C}),x=[];if(!P)return;let{x:d,y:g,width:n,height:j}=k,i={},q1=P.origin??y,{width:Q1,height:Y1,x:L1,y:M1}=CC(h,z.controlDirection,u,z.boundaries,z.keepAspectRatio,q1,E,p),I1=Q1!==n,X1=Y1!==j,f1=L1!==d&&I1,l1=M1!==g&&X1;if(!f1&&!l1&&!I1&&!X1)return;let W1={prevValues:{...k},startX:h.x,startY:h.y,childNodes:v.map((E1)=>({...E1,position:{...E1.position}}))};if(f1||l1||q1[0]===1||q1[1]===1){if(i.x=f1?L1:k.x,i.y=l1?M1:k.y,k.x=i.x,k.y=i.y,v.length>0){let E1=L1-d,j1=M1-g;for(let V0 of v)V0.position={x:V0.position.x-E1+q1[0]*(Q1-n),y:V0.position.y-j1+q1[1]*(Y1-j)},x.push(V0)}}if(I1||X1)i.width=I1&&(!z.resizeDirection||z.resizeDirection==="horizontal")?Q1:k.width,i.height=X1&&(!z.resizeDirection||z.resizeDirection==="vertical")?Y1:k.height,k.width=i.width,k.height=i.height;if(b&&P.expandParent){let E1=q1[0]*(i.width??0);if(i.x&&i.x<E1)k.x=E1,h.x=h.x-(i.x-E1);let j1=q1[1]*(i.height??0);if(i.y&&i.y<j1)k.y=j1,h.y=h.y-(i.y-j1)}let S1=NC({width:k.width,prevWidth:n,height:k.height,prevHeight:j,affectsX:z.controlDirection.affectsX,affectsY:z.controlDirection.affectsY}),v1={...k,direction:S1};if(V?.(m,v1)===!1){k=W1.prevValues,h.x=W1.startX,h.y=W1.startY,v.forEach((E1,j1)=>{E1.position=W1.childNodes[j1].position});return}f?.(m,v1),K(i,x)}).on("end",(m)=>{D?.(m,{...k}),X?.({...k})});W.call(a)}function O(){W.on(".drag",null)}return{update:B,destroy:O}}var tM=u0(i5(),1),oM=u0(dM(),1);var iM=(Q)=>{let U,Z=new Set,K=(R,L)=>{let M=typeof R==="function"?R(U):R;if(!Object.is(M,U)){let I=U;U=(L!=null?L:typeof M!=="object"||M===null)?M:Object.assign({},U,M),Z.forEach((f)=>f(U,I))}},X=()=>U,O={setState:K,getState:X,getInitialState:()=>T,subscribe:(R)=>{return Z.add(R),()=>Z.delete(R)},destroy:()=>{if((import.meta.env?import.meta.env.MODE:void 0)!=="production")console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected.");Z.clear()}},T=U=Q(K,X,O);return O},aM=(Q)=>Q?iM(Q):iM;var{useDebugValue:DC}=tM.default,{useSyncExternalStoreWithSelector:yC}=oM.default,vC=(Q)=>Q;function IX(Q,U=vC,Z){let K=yC(Q.subscribe,Q.getState,Q.getServerState||Q.getInitialState,U,Z);return DC(K),K}var sM=(Q,U)=>{let Z=aM(Q),K=(X,W=U)=>IX(Z,X,W);return Object.assign(K,Z),K},nM=(Q,U)=>Q?sM(Q,U):sM;function N0(Q,U){if(Object.is(Q,U))return!0;if(typeof Q!=="object"||Q===null||typeof U!=="object"||U===null)return!1;if(Q instanceof Map&&U instanceof Map){if(Q.size!==U.size)return!1;for(let[K,X]of Q)if(!Object.is(X,U.get(K)))return!1;return!0}if(Q instanceof Set&&U instanceof Set){if(Q.size!==U.size)return!1;for(let K of Q)if(!U.has(K))return!1;return!0}let Z=Object.keys(Q);if(Z.length!==Object.keys(U).length)return!1;for(let K of Z)if(!Object.prototype.hasOwnProperty.call(U,K)||!Object.is(Q[K],U[K]))return!1;return!0}var CT=u0(PX(),1),pq=K1.createContext(null),uC=pq.Provider,ST=x2.error001("react");function G0(Q,U){let Z=K1.useContext(pq);if(Z===null)throw Error(ST);return IX(Z,Q,U)}function C0(){let Q=K1.useContext(pq);if(Q===null)throw Error(ST);return K1.useMemo(()=>({getState:Q.getState,setState:Q.setState,subscribe:Q.subscribe}),[Q])}var JT={display:"none"},xC={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},jT="react-flow__node-desc",VT="react-flow__edge-desc",hC="react-flow__aria-live",mC=(Q)=>Q.ariaLiveMessage,gC=(Q)=>Q.ariaLabelConfig;function pC({rfId:Q}){let U=G0(mC);return F1.jsx("div",{id:`${hC}-${Q}`,"aria-live":"assertive","aria-atomic":"true",style:xC,children:U})}function cC({rfId:Q,disableKeyboardA11y:U}){let Z=G0(gC);return F1.jsxs(F1.Fragment,{children:[F1.jsx("div",{id:`${jT}-${Q}`,style:JT,children:U?Z["node.a11yDescription.default"]:Z["node.a11yDescription.keyboardDisabled"]}),F1.jsx("div",{id:`${VT}-${Q}`,style:JT,children:Z["edge.a11yDescription.default"]}),!U&&F1.jsx(pC,{rfId:Q})]})}var N8=K1.forwardRef(({position:Q="top-left",children:U,className:Z,style:K,...X},W)=>{let z=`${Q}`.split("-");return F1.jsx("div",{className:y0(["react-flow__panel",Z,...z]),style:K,ref:W,...X,children:U})});N8.displayName="Panel";var $T="https://reactflow.dev/attribution";function lC({proOptions:Q,position:U="bottom-right"}){if(K1.useEffect(()=>{OM("react")},[]),Q?.hideAttribution)return null;return F1.jsx(N8,{position:U,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${$T}`,children:F1.jsx("a",{href:$T,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}var rC=(Q)=>{let U=[],Z=[];for(let[,K]of Q.nodeLookup)if(K.selected)U.push(K.internals.userNode);for(let[,K]of Q.edgeLookup)if(K.selected)Z.push(K);return{selectedNodes:U,selectedEdges:Z}},xq=(Q)=>Q.id;function dC(Q,U){return N0(Q.selectedNodes.map(xq),U.selectedNodes.map(xq))&&N0(Q.selectedEdges.map(xq),U.selectedEdges.map(xq))}function iC({onSelectionChange:Q}){let U=C0(),{selectedNodes:Z,selectedEdges:K}=G0(rC,dC);return K1.useEffect(()=>{let X={nodes:Z,edges:K};Q?.(X),U.getState().onSelectionChangeHandlers.forEach((W)=>W(X))},[Z,K,Q]),null}var aC=(Q)=>!!Q.onSelectionChangeHandlers;function sC({onSelectionChange:Q}){let U=G0(aC);if(Q||U)return F1.jsx(iC,{onSelectionChange:Q});return null}var kT=[0,0],tC={x:0,y:0,zoom:1},oC=["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"],QT=[...oC,"rfId"],nC=(Q)=>({setNodes:Q.setNodes,setEdges:Q.setEdges,setMinZoom:Q.setMinZoom,setMaxZoom:Q.setMaxZoom,setTranslateExtent:Q.setTranslateExtent,setNodeExtent:Q.setNodeExtent,reset:Q.reset,setDefaultNodesAndEdges:Q.setDefaultNodesAndEdges}),qT={translateExtent:s7,nodeOrigin:kT,minZoom:0.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function eC(Q){let{setNodes:U,setEdges:Z,setMinZoom:K,setMaxZoom:X,setTranslateExtent:W,setNodeExtent:z,reset:B,setDefaultNodesAndEdges:O}=G0(nC,N0),T=C0();K1.useEffect(()=>{return O(Q.defaultNodes,Q.defaultEdges),()=>{R.current=qT,B()}},[]);let R=K1.useRef(qT);return K1.useEffect(()=>{for(let L of QT){let M=Q[L],I=R.current[L];if(M===I)continue;if(typeof Q[L]>"u")continue;if(L==="nodes")U(M);else if(L==="edges")Z(M);else if(L==="minZoom")K(M);else if(L==="maxZoom")X(M);else if(L==="translateExtent")W(M);else if(L==="nodeExtent")z(M);else if(L==="ariaLabelConfig")T.setState({ariaLabelConfig:RM(M)});else if(L==="fitView")T.setState({fitViewQueued:M});else if(L==="fitViewOptions")T.setState({fitViewOptions:M});else T.setState({[L]:M})}R.current=Q},QT.map((L)=>Q[L])),null}function UT(){if(typeof window>"u"||!window.matchMedia)return null;return window.matchMedia("(prefers-color-scheme: dark)")}function _S(Q){let[U,Z]=K1.useState(Q==="system"?null:Q);return K1.useEffect(()=>{if(Q!=="system"){Z(Q);return}let K=UT(),X=()=>Z(K?.matches?"dark":"light");return X(),K?.addEventListener("change",X),()=>{K?.removeEventListener("change",X)}},[Q]),U!==null?U:UT()?.matches?"dark":"light"}var GT=typeof document<"u"?document:null;function RJ(Q=null,U={target:GT,actInsideInputWithModifier:!0}){let[Z,K]=K1.useState(!1),X=K1.useRef(!1),W=K1.useRef(new Set([])),[z,B]=K1.useMemo(()=>{if(Q!==null){let T=(Array.isArray(Q)?Q:[Q]).filter((L)=>typeof L==="string").map((L)=>L.replace(/\+/g,`
240
+ root.render(<App />);`),J.unstable_strictMode===!0&&($=!0),J.identifierPrefix!==void 0&&(q=J.identifierPrefix),J.onUncaughtError!==void 0&&(G=J.onUncaughtError),J.onCaughtError!==void 0&&(F=J.onCaughtError),J.onRecoverableError!==void 0&&(Y=J.onRecoverableError)),J=zz(_,1,!1,null,null,$,q,null,G,F,Y,fz),_[h3]=J.current,vG(_),new eG(J)},KV.hydrateRoot=function(_,J,$){if(!V(_))throw Error("Target container is not a DOM element.");Pz(_),J===void 0&&console.error("Must provide initial children as second argument to hydrateRoot. Example usage: hydrateRoot(domContainer, <App />)");var q=!1,G="",F=wY,Y=IY,A=fY,w=null;return $!==null&&$!==void 0&&($.unstable_strictMode===!0&&(q=!0),$.identifierPrefix!==void 0&&(G=$.identifierPrefix),$.onUncaughtError!==void 0&&(F=$.onUncaughtError),$.onCaughtError!==void 0&&(Y=$.onCaughtError),$.onRecoverableError!==void 0&&(A=$.onRecoverableError),$.formState!==void 0&&(w=$.formState)),J=zz(_,1,!0,J,$!=null?$:null,q,G,w,F,Y,A,fz),J.context=Bz(null),$=J.current,q=Q5($),q=x4(q),G=S3(q),G.callback=null,j3($,G,q),q4(q,"hydrateRoot()",null),$=q,J.current.lanes=$,L2(J,$),B4(J),_[h3]=J.current,vG(_),new d$(J)},KV.version="19.2.7",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var CR=j4((pm,NR)=>{var XV=u0(PR());NR.exports=XV});var B1=u0(i5(),1);var F1=u0(zL(),1),K1=u0(i5(),1);function y0(Q){if(typeof Q==="string"||typeof Q==="number")return""+Q;let U="";if(Array.isArray(Q)){for(let Z=0,K;Z<Q.length;Z++)if((K=y0(Q[Z]))!=="")U+=(U&&" ")+K}else for(let Z in Q)if(Q[Z])U+=(U&&" ")+Z;return U}var Ef={value:()=>{}};function AL(){for(var Q=0,U=arguments.length,Z={},K;Q<U;++Q){if(!(K=arguments[Q]+"")||K in Z||/[\s.]/.test(K))throw Error("illegal type: "+K);Z[K]=[]}return new _q(Z)}function _q(Q){this._=Q}function bf(Q,U){return Q.trim().split(/^|\s+/).map(function(Z){var K="",X=Z.indexOf(".");if(X>=0)K=Z.slice(X+1),Z=Z.slice(0,X);if(Z&&!U.hasOwnProperty(Z))throw Error("unknown type: "+Z);return{type:Z,name:K}})}_q.prototype=AL.prototype={constructor:_q,on:function(Q,U){var Z=this._,K=bf(Q+"",Z),X,W=-1,z=K.length;if(arguments.length<2){while(++W<z)if((X=(Q=K[W]).type)&&(X=uf(Z[X],Q.name)))return X;return}if(U!=null&&typeof U!=="function")throw Error("invalid callback: "+U);while(++W<z)if(X=(Q=K[W]).type)Z[X]=BL(Z[X],Q.name,U);else if(U==null)for(X in Z)Z[X]=BL(Z[X],Q.name,null);return this},copy:function(){var Q={},U=this._;for(var Z in U)Q[Z]=U[Z].slice();return new _q(Q)},call:function(Q,U){if((X=arguments.length-2)>0)for(var Z=Array(X),K=0,X,W;K<X;++K)Z[K]=arguments[K+2];if(!this._.hasOwnProperty(Q))throw Error("unknown type: "+Q);for(W=this._[Q],K=0,X=W.length;K<X;++K)W[K].value.apply(U,Z)},apply:function(Q,U,Z){if(!this._.hasOwnProperty(Q))throw Error("unknown type: "+Q);for(var K=this._[Q],X=0,W=K.length;X<W;++X)K[X].value.apply(U,Z)}};function uf(Q,U){for(var Z=0,K=Q.length,X;Z<K;++Z)if((X=Q[Z]).name===U)return X.value}function BL(Q,U,Z){for(var K=0,X=Q.length;K<X;++K)if(Q[K].name===U){Q[K]=Ef,Q=Q.slice(0,K).concat(Q.slice(K+1));break}if(Z!=null)Q.push({name:U,value:Z});return Q}var H8=AL;function x7(Q){return function(){return this.matches(Q)}}function Jq(Q){return function(U){return U.matches(Q)}}var $q="http://www.w3.org/1999/xhtml",SF={svg:"http://www.w3.org/2000/svg",xhtml:$q,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function V4(Q){var U=Q+="",Z=U.indexOf(":");if(Z>=0&&(U=Q.slice(0,Z))!=="xmlns")Q=Q.slice(Z+1);return SF.hasOwnProperty(U)?{space:SF[U],local:Q}:Q}function jF(Q){let U;while(U=Q.sourceEvent)Q=U;return Q}function O2(Q,U){if(Q=jF(Q),U===void 0)U=Q.currentTarget;if(U){var Z=U.ownerSVGElement||U;if(Z.createSVGPoint){var K=Z.createSVGPoint();return K.x=Q.clientX,K.y=Q.clientY,K=K.matrixTransform(U.getScreenCTM().inverse()),[K.x,K.y]}if(U.getBoundingClientRect){var X=U.getBoundingClientRect();return[Q.clientX-X.left-U.clientLeft,Q.clientY-X.top-U.clientTop]}}return[Q.pageX,Q.pageY]}function xf(){}function X6(Q){return Q==null?xf:function(){return this.querySelector(Q)}}function VF(Q){if(typeof Q!=="function")Q=X6(Q);for(var U=this._groups,Z=U.length,K=Array(Z),X=0;X<Z;++X)for(var W=U[X],z=W.length,B=K[X]=Array(z),O,T,R=0;R<z;++R)if((O=W[R])&&(T=Q.call(O,O.__data__,R,W))){if("__data__"in O)T.__data__=O.__data__;B[R]=T}return new x0(K,this._parents)}function kF(Q){return Q==null?[]:Array.isArray(Q)?Q:Array.from(Q)}function hf(){return[]}function h7(Q){return Q==null?hf:function(){return this.querySelectorAll(Q)}}function mf(Q){return function(){return kF(Q.apply(this,arguments))}}function DF(Q){if(typeof Q==="function")Q=mf(Q);else Q=h7(Q);for(var U=this._groups,Z=U.length,K=[],X=[],W=0;W<Z;++W)for(var z=U[W],B=z.length,O,T=0;T<B;++T)if(O=z[T])K.push(Q.call(O,O.__data__,T,z)),X.push(O);return new x0(K,X)}var gf=Array.prototype.find;function pf(Q){return function(){return gf.call(this.children,Q)}}function cf(){return this.firstElementChild}function yF(Q){return this.select(Q==null?cf:pf(typeof Q==="function"?Q:Jq(Q)))}var lf=Array.prototype.filter;function rf(){return Array.from(this.children)}function df(Q){return function(){return lf.call(this.children,Q)}}function vF(Q){return this.selectAll(Q==null?rf:df(typeof Q==="function"?Q:Jq(Q)))}function EF(Q){if(typeof Q!=="function")Q=x7(Q);for(var U=this._groups,Z=U.length,K=Array(Z),X=0;X<Z;++X)for(var W=U[X],z=W.length,B=K[X]=[],O,T=0;T<z;++T)if((O=W[T])&&Q.call(O,O.__data__,T,W))B.push(O);return new x0(K,this._parents)}function c_(Q){return Array(Q.length)}function bF(){return new x0(this._enter||this._groups.map(c_),this._parents)}function l_(Q,U){this.ownerDocument=Q.ownerDocument,this.namespaceURI=Q.namespaceURI,this._next=null,this._parent=Q,this.__data__=U}l_.prototype={constructor:l_,appendChild:function(Q){return this._parent.insertBefore(Q,this._next)},insertBefore:function(Q,U){return this._parent.insertBefore(Q,U)},querySelector:function(Q){return this._parent.querySelector(Q)},querySelectorAll:function(Q){return this._parent.querySelectorAll(Q)}};function uF(Q){return function(){return Q}}function af(Q,U,Z,K,X,W){var z=0,B,O=U.length,T=W.length;for(;z<T;++z)if(B=U[z])B.__data__=W[z],K[z]=B;else Z[z]=new l_(Q,W[z]);for(;z<O;++z)if(B=U[z])X[z]=B}function sf(Q,U,Z,K,X,W,z){var B,O,T=new Map,R=U.length,L=W.length,M=Array(R),f;for(B=0;B<R;++B)if(O=U[B])if(M[B]=f=z.call(O,O.__data__,B,U)+"",T.has(f))X[B]=O;else T.set(f,O);for(B=0;B<L;++B)if(f=z.call(Q,W[B],B,W)+"",O=T.get(f))K[B]=O,O.__data__=W[B],T.delete(f);else Z[B]=new l_(Q,W[B]);for(B=0;B<R;++B)if((O=U[B])&&T.get(M[B])===O)X[B]=O}function tf(Q){return Q.__data__}function xF(Q,U){if(!arguments.length)return Array.from(this,tf);var Z=U?sf:af,K=this._parents,X=this._groups;if(typeof Q!=="function")Q=uF(Q);for(var W=X.length,z=Array(W),B=Array(W),O=Array(W),T=0;T<W;++T){var R=K[T],L=X[T],M=L.length,f=of(Q.call(R,R&&R.__data__,T,K)),I=f.length,D=B[T]=Array(I),V=z[T]=Array(I),k=O[T]=Array(M);Z(R,L,D,V,k,f,U);for(var h=0,P=0,C,v;h<I;++h)if(C=D[h]){if(h>=P)P=h+1;while(!(v=V[P])&&++P<I);C._next=v||null}}return z=new x0(z,K),z._enter=B,z._exit=O,z}function of(Q){return typeof Q==="object"&&"length"in Q?Q:Array.from(Q)}function hF(){return new x0(this._exit||this._groups.map(c_),this._parents)}function mF(Q,U,Z){var K=this.enter(),X=this,W=this.exit();if(typeof Q==="function"){if(K=Q(K),K)K=K.selection()}else K=K.append(Q+"");if(U!=null){if(X=U(X),X)X=X.selection()}if(Z==null)W.remove();else Z(W);return K&&X?K.merge(X).order():X}function gF(Q){var U=Q.selection?Q.selection():Q;for(var Z=this._groups,K=U._groups,X=Z.length,W=K.length,z=Math.min(X,W),B=Array(X),O=0;O<z;++O)for(var T=Z[O],R=K[O],L=T.length,M=B[O]=Array(L),f,I=0;I<L;++I)if(f=T[I]||R[I])M[I]=f;for(;O<X;++O)B[O]=Z[O];return new x0(B,this._parents)}function pF(){for(var Q=this._groups,U=-1,Z=Q.length;++U<Z;)for(var K=Q[U],X=K.length-1,W=K[X],z;--X>=0;)if(z=K[X]){if(W&&z.compareDocumentPosition(W)^4)W.parentNode.insertBefore(z,W);W=z}return this}function cF(Q){if(!Q)Q=nf;function U(L,M){return L&&M?Q(L.__data__,M.__data__):!L-!M}for(var Z=this._groups,K=Z.length,X=Array(K),W=0;W<K;++W){for(var z=Z[W],B=z.length,O=X[W]=Array(B),T,R=0;R<B;++R)if(T=z[R])O[R]=T;O.sort(U)}return new x0(X,this._parents).order()}function nf(Q,U){return Q<U?-1:Q>U?1:Q>=U?0:NaN}function lF(){var Q=arguments[0];return arguments[0]=this,Q.apply(null,arguments),this}function rF(){return Array.from(this)}function dF(){for(var Q=this._groups,U=0,Z=Q.length;U<Z;++U)for(var K=Q[U],X=0,W=K.length;X<W;++X){var z=K[X];if(z)return z}return null}function iF(){let Q=0;for(let U of this)++Q;return Q}function aF(){return!this.node()}function sF(Q){for(var U=this._groups,Z=0,K=U.length;Z<K;++Z)for(var X=U[Z],W=0,z=X.length,B;W<z;++W)if(B=X[W])Q.call(B,B.__data__,W,X);return this}function ef(Q){return function(){this.removeAttribute(Q)}}function _P(Q){return function(){this.removeAttributeNS(Q.space,Q.local)}}function JP(Q,U){return function(){this.setAttribute(Q,U)}}function $P(Q,U){return function(){this.setAttributeNS(Q.space,Q.local,U)}}function QP(Q,U){return function(){var Z=U.apply(this,arguments);if(Z==null)this.removeAttribute(Q);else this.setAttribute(Q,Z)}}function qP(Q,U){return function(){var Z=U.apply(this,arguments);if(Z==null)this.removeAttributeNS(Q.space,Q.local);else this.setAttributeNS(Q.space,Q.local,Z)}}function tF(Q,U){var Z=V4(Q);if(arguments.length<2){var K=this.node();return Z.local?K.getAttributeNS(Z.space,Z.local):K.getAttribute(Z)}return this.each((U==null?Z.local?_P:ef:typeof U==="function"?Z.local?qP:QP:Z.local?$P:JP)(Z,U))}function r_(Q){return Q.ownerDocument&&Q.ownerDocument.defaultView||Q.document&&Q||Q.defaultView}function UP(Q){return function(){this.style.removeProperty(Q)}}function GP(Q,U,Z){return function(){this.style.setProperty(Q,U,Z)}}function ZP(Q,U,Z){return function(){var K=U.apply(this,arguments);if(K==null)this.style.removeProperty(Q);else this.style.setProperty(Q,K,Z)}}function oF(Q,U,Z){return arguments.length>1?this.each((U==null?UP:typeof U==="function"?ZP:GP)(Q,U,Z==null?"":Z)):H6(this.node(),Q)}function H6(Q,U){return Q.style.getPropertyValue(U)||r_(Q).getComputedStyle(Q,null).getPropertyValue(U)}function FP(Q){return function(){delete this[Q]}}function KP(Q,U){return function(){this[Q]=U}}function XP(Q,U){return function(){var Z=U.apply(this,arguments);if(Z==null)delete this[Q];else this[Q]=Z}}function nF(Q,U){return arguments.length>1?this.each((U==null?FP:typeof U==="function"?XP:KP)(Q,U)):this.node()[Q]}function LL(Q){return Q.trim().split(/^|\s+/)}function eF(Q){return Q.classList||new ML(Q)}function ML(Q){this._node=Q,this._names=LL(Q.getAttribute("class")||"")}ML.prototype={add:function(Q){var U=this._names.indexOf(Q);if(U<0)this._names.push(Q),this._node.setAttribute("class",this._names.join(" "))},remove:function(Q){var U=this._names.indexOf(Q);if(U>=0)this._names.splice(U,1),this._node.setAttribute("class",this._names.join(" "))},contains:function(Q){return this._names.indexOf(Q)>=0}};function TL(Q,U){var Z=eF(Q),K=-1,X=U.length;while(++K<X)Z.add(U[K])}function RL(Q,U){var Z=eF(Q),K=-1,X=U.length;while(++K<X)Z.remove(U[K])}function HP(Q){return function(){TL(this,Q)}}function YP(Q){return function(){RL(this,Q)}}function WP(Q,U){return function(){(U.apply(this,arguments)?TL:RL)(this,Q)}}function _K(Q,U){var Z=LL(Q+"");if(arguments.length<2){var K=eF(this.node()),X=-1,W=Z.length;while(++X<W)if(!K.contains(Z[X]))return!1;return!0}return this.each((typeof U==="function"?WP:U?HP:YP)(Z,U))}function zP(){this.textContent=""}function BP(Q){return function(){this.textContent=Q}}function AP(Q){return function(){var U=Q.apply(this,arguments);this.textContent=U==null?"":U}}function JK(Q){return arguments.length?this.each(Q==null?zP:(typeof Q==="function"?AP:BP)(Q)):this.node().textContent}function LP(){this.innerHTML=""}function MP(Q){return function(){this.innerHTML=Q}}function TP(Q){return function(){var U=Q.apply(this,arguments);this.innerHTML=U==null?"":U}}function $K(Q){return arguments.length?this.each(Q==null?LP:(typeof Q==="function"?TP:MP)(Q)):this.node().innerHTML}function RP(){if(this.nextSibling)this.parentNode.appendChild(this)}function QK(){return this.each(RP)}function OP(){if(this.previousSibling)this.parentNode.insertBefore(this,this.parentNode.firstChild)}function qK(){return this.each(OP)}function wP(Q){return function(){var U=this.ownerDocument,Z=this.namespaceURI;return Z===$q&&U.documentElement.namespaceURI===$q?U.createElement(Q):U.createElementNS(Z,Q)}}function IP(Q){return function(){return this.ownerDocument.createElementNS(Q.space,Q.local)}}function d_(Q){var U=V4(Q);return(U.local?IP:wP)(U)}function UK(Q){var U=typeof Q==="function"?Q:d_(Q);return this.select(function(){return this.appendChild(U.apply(this,arguments))})}function fP(){return null}function GK(Q,U){var Z=typeof Q==="function"?Q:d_(Q),K=U==null?fP:typeof U==="function"?U:X6(U);return this.select(function(){return this.insertBefore(Z.apply(this,arguments),K.apply(this,arguments)||null)})}function PP(){var Q=this.parentNode;if(Q)Q.removeChild(this)}function ZK(){return this.each(PP)}function NP(){var Q=this.cloneNode(!1),U=this.parentNode;return U?U.insertBefore(Q,this.nextSibling):Q}function CP(){var Q=this.cloneNode(!0),U=this.parentNode;return U?U.insertBefore(Q,this.nextSibling):Q}function FK(Q){return this.select(Q?CP:NP)}function KK(Q){return arguments.length?this.property("__data__",Q):this.node().__data__}function SP(Q){return function(U){Q.call(this,U,this.__data__)}}function jP(Q){return Q.trim().split(/^|\s+/).map(function(U){var Z="",K=U.indexOf(".");if(K>=0)Z=U.slice(K+1),U=U.slice(0,K);return{type:U,name:Z}})}function VP(Q){return function(){var U=this.__on;if(!U)return;for(var Z=0,K=-1,X=U.length,W;Z<X;++Z)if(W=U[Z],(!Q.type||W.type===Q.type)&&W.name===Q.name)this.removeEventListener(W.type,W.listener,W.options);else U[++K]=W;if(++K)U.length=K;else delete this.__on}}function kP(Q,U,Z){return function(){var K=this.__on,X,W=SP(U);if(K){for(var z=0,B=K.length;z<B;++z)if((X=K[z]).type===Q.type&&X.name===Q.name){this.removeEventListener(X.type,X.listener,X.options),this.addEventListener(X.type,X.listener=W,X.options=Z),X.value=U;return}}if(this.addEventListener(Q.type,W,Z),X={type:Q.type,name:Q.name,value:U,listener:W,options:Z},!K)this.__on=[X];else K.push(X)}}function XK(Q,U,Z){var K=jP(Q+""),X,W=K.length,z;if(arguments.length<2){var B=this.node().__on;if(B){for(var O=0,T=B.length,R;O<T;++O)for(X=0,R=B[O];X<W;++X)if((z=K[X]).type===R.type&&z.name===R.name)return R.value}return}B=U?kP:VP;for(X=0;X<W;++X)this.each(B(K[X],U,Z));return this}function OL(Q,U,Z){var K=r_(Q),X=K.CustomEvent;if(typeof X==="function")X=new X(U,Z);else if(X=K.document.createEvent("Event"),Z)X.initEvent(U,Z.bubbles,Z.cancelable),X.detail=Z.detail;else X.initEvent(U,!1,!1);Q.dispatchEvent(X)}function DP(Q,U){return function(){return OL(this,Q,U)}}function yP(Q,U){return function(){return OL(this,Q,U.apply(this,arguments))}}function HK(Q,U){return this.each((typeof U==="function"?yP:DP)(Q,U))}function*YK(){for(var Q=this._groups,U=0,Z=Q.length;U<Z;++U)for(var K=Q[U],X=0,W=K.length,z;X<W;++X)if(z=K[X])yield z}var WK=[null];function x0(Q,U){this._groups=Q,this._parents=U}function wL(){return new x0([[document.documentElement]],WK)}function vP(){return this}x0.prototype=wL.prototype={constructor:x0,select:VF,selectAll:DF,selectChild:yF,selectChildren:vF,filter:EF,data:xF,enter:bF,exit:hF,join:mF,merge:gF,selection:vP,order:pF,sort:cF,call:lF,nodes:rF,node:dF,size:iF,empty:aF,each:sF,attr:tF,style:oF,property:nF,classed:_K,text:JK,html:$K,raise:QK,lower:qK,append:UK,insert:GK,remove:ZK,clone:FK,datum:KK,on:XK,dispatch:HK,[Symbol.iterator]:YK};var H3=wL;function n0(Q){return typeof Q==="string"?new x0([[document.querySelector(Q)]],[document.documentElement]):new x0([[Q]],WK)}var IL={passive:!1},Y8={capture:!0,passive:!1};function Qq(Q){Q.stopImmediatePropagation()}function Y3(Q){Q.preventDefault(),Q.stopImmediatePropagation()}function m7(Q){var U=Q.document.documentElement,Z=n0(Q).on("dragstart.drag",Y3,Y8);if("onselectstart"in U)Z.on("selectstart.drag",Y3,Y8);else U.__noselect=U.style.MozUserSelect,U.style.MozUserSelect="none"}function i_(Q,U){var Z=Q.document.documentElement,K=n0(Q).on("dragstart.drag",null);if(U)K.on("click.drag",Y3,Y8),setTimeout(function(){K.on("click.drag",null)},0);if("onselectstart"in Z)K.on("selectstart.drag",null);else Z.style.MozUserSelect=Z.__noselect,delete Z.__noselect}var a_=(Q)=>()=>Q;function s_(Q,{sourceEvent:U,subject:Z,target:K,identifier:X,active:W,x:z,y:B,dx:O,dy:T,dispatch:R}){Object.defineProperties(this,{type:{value:Q,enumerable:!0,configurable:!0},sourceEvent:{value:U,enumerable:!0,configurable:!0},subject:{value:Z,enumerable:!0,configurable:!0},target:{value:K,enumerable:!0,configurable:!0},identifier:{value:X,enumerable:!0,configurable:!0},active:{value:W,enumerable:!0,configurable:!0},x:{value:z,enumerable:!0,configurable:!0},y:{value:B,enumerable:!0,configurable:!0},dx:{value:O,enumerable:!0,configurable:!0},dy:{value:T,enumerable:!0,configurable:!0},_:{value:R}})}s_.prototype.on=function(){var Q=this._.on.apply(this._,arguments);return Q===this._?this:Q};function EP(Q){return!Q.ctrlKey&&!Q.button}function bP(){return this.parentNode}function uP(Q,U){return U==null?{x:Q.x,y:Q.y}:U}function xP(){return navigator.maxTouchPoints||"ontouchstart"in this}function t_(){var Q=EP,U=bP,Z=uP,K=xP,X={},W=H8("start","drag","end"),z=0,B,O,T,R,L=0;function M(C){C.on("mousedown.drag",f).filter(K).on("touchstart.drag",V).on("touchmove.drag",k,IL).on("touchend.drag touchcancel.drag",h).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function f(C,v){if(R||!Q.call(this,C,v))return;var b=P(this,U.call(this,C,v),C,v,"mouse");if(!b)return;n0(C.view).on("mousemove.drag",I,Y8).on("mouseup.drag",D,Y8),m7(C.view),Qq(C),T=!1,B=C.clientX,O=C.clientY,b("start",C)}function I(C){if(Y3(C),!T){var v=C.clientX-B,b=C.clientY-O;T=v*v+b*b>L}X.mouse("drag",C)}function D(C){n0(C.view).on("mousemove.drag mouseup.drag",null),i_(C.view,T),Y3(C),X.mouse("end",C)}function V(C,v){if(!Q.call(this,C,v))return;var b=C.changedTouches,E=U.call(this,C,v),p=b.length,a,m;for(a=0;a<p;++a)if(m=P(this,E,C,v,b[a].identifier,b[a]))Qq(C),m("start",C,b[a])}function k(C){var v=C.changedTouches,b=v.length,E,p;for(E=0;E<b;++E)if(p=X[v[E].identifier])Y3(C),p("drag",C,v[E])}function h(C){var v=C.changedTouches,b=v.length,E,p;if(R)clearTimeout(R);R=setTimeout(function(){R=null},500);for(E=0;E<b;++E)if(p=X[v[E].identifier])Qq(C),p("end",C,v[E])}function P(C,v,b,E,p,a){var m=W.copy(),_1=O2(a||b,v),$1,J1,y;if((y=Z.call(C,new s_("beforestart",{sourceEvent:b,target:M,identifier:p,active:z,x:_1[0],y:_1[1],dx:0,dy:0,dispatch:m}),E))==null)return;return $1=y.x-_1[0]||0,J1=y.y-_1[1]||0,function u(x,d,g){var n=_1,j;switch(x){case"start":X[p]=u,j=z++;break;case"end":delete X[p],--z;case"drag":_1=O2(g||d,v),j=z;break}m.call(x,C,new s_(x,{sourceEvent:d,subject:y,target:M,identifier:p,active:j,x:_1[0]+$1,y:_1[1]+J1,dx:_1[0]-n[0],dy:_1[1]-n[1],dispatch:m}),E)}}return M.filter=function(C){return arguments.length?(Q=typeof C==="function"?C:a_(!!C),M):Q},M.container=function(C){return arguments.length?(U=typeof C==="function"?C:a_(C),M):U},M.subject=function(C){return arguments.length?(Z=typeof C==="function"?C:a_(C),M):Z},M.touchable=function(C){return arguments.length?(K=typeof C==="function"?C:a_(!!C),M):K},M.on=function(){var C=W.on.apply(W,arguments);return C===W?M:C},M.clickDistance=function(C){return arguments.length?(L=(C=+C)*C,M):Math.sqrt(L)},M}function o_(Q,U,Z){Q.prototype=U.prototype=Z,Z.constructor=Q}function zK(Q,U){var Z=Object.create(Q.prototype);for(var K in U)Z[K]=U[K];return Z}function _J(){}var n_=0.7,Gq=1/n_,g7="\\s*([+-]?\\d+)\\s*",e_="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",k4="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",hP=/^#([0-9a-f]{3,8})$/,mP=new RegExp(`^rgb\\(${g7},${g7},${g7}\\)$`),gP=new RegExp(`^rgb\\(${k4},${k4},${k4}\\)$`),pP=new RegExp(`^rgba\\(${g7},${g7},${g7},${e_}\\)$`),cP=new RegExp(`^rgba\\(${k4},${k4},${k4},${e_}\\)$`),lP=new RegExp(`^hsl\\(${e_},${k4},${k4}\\)$`),rP=new RegExp(`^hsla\\(${e_},${k4},${k4},${e_}\\)$`),fL={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};o_(_J,s5,{copy(Q){return Object.assign(new this.constructor,this,Q)},displayable(){return this.rgb().displayable()},hex:PL,formatHex:PL,formatHex8:dP,formatHsl:iP,formatRgb:NL,toString:NL});function PL(){return this.rgb().formatHex()}function dP(){return this.rgb().formatHex8()}function iP(){return DL(this).formatHsl()}function NL(){return this.rgb().formatRgb()}function s5(Q){var U,Z;return Q=(Q+"").trim().toLowerCase(),(U=hP.exec(Q))?(Z=U[1].length,U=parseInt(U[1],16),Z===6?CL(U):Z===3?new s2(U>>8&15|U>>4&240,U>>4&15|U&240,(U&15)<<4|U&15,1):Z===8?qq(U>>24&255,U>>16&255,U>>8&255,(U&255)/255):Z===4?qq(U>>12&15|U>>8&240,U>>8&15|U>>4&240,U>>4&15|U&240,((U&15)<<4|U&15)/255):null):(U=mP.exec(Q))?new s2(U[1],U[2],U[3],1):(U=gP.exec(Q))?new s2(U[1]*255/100,U[2]*255/100,U[3]*255/100,1):(U=pP.exec(Q))?qq(U[1],U[2],U[3],U[4]):(U=cP.exec(Q))?qq(U[1]*255/100,U[2]*255/100,U[3]*255/100,U[4]):(U=lP.exec(Q))?VL(U[1],U[2]/100,U[3]/100,1):(U=rP.exec(Q))?VL(U[1],U[2]/100,U[3]/100,U[4]):fL.hasOwnProperty(Q)?CL(fL[Q]):Q==="transparent"?new s2(NaN,NaN,NaN,0):null}function CL(Q){return new s2(Q>>16&255,Q>>8&255,Q&255,1)}function qq(Q,U,Z,K){if(K<=0)Q=U=Z=NaN;return new s2(Q,U,Z,K)}function aP(Q){if(!(Q instanceof _J))Q=s5(Q);if(!Q)return new s2;return Q=Q.rgb(),new s2(Q.r,Q.g,Q.b,Q.opacity)}function p7(Q,U,Z,K){return arguments.length===1?aP(Q):new s2(Q,U,Z,K==null?1:K)}function s2(Q,U,Z,K){this.r=+Q,this.g=+U,this.b=+Z,this.opacity=+K}o_(s2,p7,zK(_J,{brighter(Q){return Q=Q==null?Gq:Math.pow(Gq,Q),new s2(this.r*Q,this.g*Q,this.b*Q,this.opacity)},darker(Q){return Q=Q==null?n_:Math.pow(n_,Q),new s2(this.r*Q,this.g*Q,this.b*Q,this.opacity)},rgb(){return this},clamp(){return new s2(z8(this.r),z8(this.g),z8(this.b),Zq(this.opacity))},displayable(){return-0.5<=this.r&&this.r<255.5&&(-0.5<=this.g&&this.g<255.5)&&(-0.5<=this.b&&this.b<255.5)&&(0<=this.opacity&&this.opacity<=1)},hex:SL,formatHex:SL,formatHex8:sP,formatRgb:jL,toString:jL}));function SL(){return`#${W8(this.r)}${W8(this.g)}${W8(this.b)}`}function sP(){return`#${W8(this.r)}${W8(this.g)}${W8(this.b)}${W8((isNaN(this.opacity)?1:this.opacity)*255)}`}function jL(){let Q=Zq(this.opacity);return`${Q===1?"rgb(":"rgba("}${z8(this.r)}, ${z8(this.g)}, ${z8(this.b)}${Q===1?")":`, ${Q})`}`}function Zq(Q){return isNaN(Q)?1:Math.max(0,Math.min(1,Q))}function z8(Q){return Math.max(0,Math.min(255,Math.round(Q)||0))}function W8(Q){return Q=z8(Q),(Q<16?"0":"")+Q.toString(16)}function VL(Q,U,Z,K){if(K<=0)Q=U=Z=NaN;else if(Z<=0||Z>=1)Q=U=NaN;else if(U<=0)Q=NaN;return new a5(Q,U,Z,K)}function DL(Q){if(Q instanceof a5)return new a5(Q.h,Q.s,Q.l,Q.opacity);if(!(Q instanceof _J))Q=s5(Q);if(!Q)return new a5;if(Q instanceof a5)return Q;Q=Q.rgb();var U=Q.r/255,Z=Q.g/255,K=Q.b/255,X=Math.min(U,Z,K),W=Math.max(U,Z,K),z=NaN,B=W-X,O=(W+X)/2;if(B){if(U===W)z=(Z-K)/B+(Z<K)*6;else if(Z===W)z=(K-U)/B+2;else z=(U-Z)/B+4;B/=O<0.5?W+X:2-W-X,z*=60}else B=O>0&&O<1?0:z;return new a5(z,B,O,Q.opacity)}function yL(Q,U,Z,K){return arguments.length===1?DL(Q):new a5(Q,U,Z,K==null?1:K)}function a5(Q,U,Z,K){this.h=+Q,this.s=+U,this.l=+Z,this.opacity=+K}o_(a5,yL,zK(_J,{brighter(Q){return Q=Q==null?Gq:Math.pow(Gq,Q),new a5(this.h,this.s,this.l*Q,this.opacity)},darker(Q){return Q=Q==null?n_:Math.pow(n_,Q),new a5(this.h,this.s,this.l*Q,this.opacity)},rgb(){var Q=this.h%360+(this.h<0)*360,U=isNaN(Q)||isNaN(this.s)?0:this.s,Z=this.l,K=Z+(Z<0.5?Z:1-Z)*U,X=2*Z-K;return new s2(BK(Q>=240?Q-240:Q+120,X,K),BK(Q,X,K),BK(Q<120?Q+240:Q-120,X,K),this.opacity)},clamp(){return new a5(kL(this.h),Uq(this.s),Uq(this.l),Zq(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 Q=Zq(this.opacity);return`${Q===1?"hsl(":"hsla("}${kL(this.h)}, ${Uq(this.s)*100}%, ${Uq(this.l)*100}%${Q===1?")":`, ${Q})`}`}}));function kL(Q){return Q=(Q||0)%360,Q<0?Q+360:Q}function Uq(Q){return Math.max(0,Math.min(1,Q||0))}function BK(Q,U,Z){return(Q<60?U+(Z-U)*Q/60:Q<180?Z:Q<240?U+(Z-U)*(240-Q)/60:U)*255}function AK(Q,U,Z,K,X){var W=Q*Q,z=W*Q;return((1-3*Q+3*W-z)*U+(4-6*W+3*z)*Z+(1+3*Q+3*W-3*z)*K+z*X)/6}function LK(Q){var U=Q.length-1;return function(Z){var K=Z<=0?Z=0:Z>=1?(Z=1,U-1):Math.floor(Z*U),X=Q[K],W=Q[K+1],z=K>0?Q[K-1]:2*X-W,B=K<U-1?Q[K+2]:2*W-X;return AK((Z-K/U)*U,z,X,W,B)}}function MK(Q){var U=Q.length;return function(Z){var K=Math.floor(((Z%=1)<0?++Z:Z)*U),X=Q[(K+U-1)%U],W=Q[K%U],z=Q[(K+1)%U],B=Q[(K+2)%U];return AK((Z-K/U)*U,X,W,z,B)}}var JJ=(Q)=>()=>Q;function tP(Q,U){return function(Z){return Q+Z*U}}function oP(Q,U,Z){return Q=Math.pow(Q,Z),U=Math.pow(U,Z)-Q,Z=1/Z,function(K){return Math.pow(Q+K*U,Z)}}function vL(Q){return(Q=+Q)===1?Fq:function(U,Z){return Z-U?oP(U,Z,Q):JJ(isNaN(U)?Z:U)}}function Fq(Q,U){var Z=U-Q;return Z?tP(Q,Z):JJ(isNaN(Q)?U:Q)}var B8=function Q(U){var Z=vL(U);function K(X,W){var z=Z((X=p7(X)).r,(W=p7(W)).r),B=Z(X.g,W.g),O=Z(X.b,W.b),T=Fq(X.opacity,W.opacity);return function(R){return X.r=z(R),X.g=B(R),X.b=O(R),X.opacity=T(R),X+""}}return K.gamma=Q,K}(1);function EL(Q){return function(U){var Z=U.length,K=Array(Z),X=Array(Z),W=Array(Z),z,B;for(z=0;z<Z;++z)B=p7(U[z]),K[z]=B.r||0,X[z]=B.g||0,W[z]=B.b||0;return K=Q(K),X=Q(X),W=Q(W),B.opacity=1,function(O){return B.r=K(O),B.g=X(O),B.b=W(O),B+""}}}var nP=EL(LK),eP=EL(MK);function TK(Q,U){if(!U)U=[];var Z=Q?Math.min(U.length,Q.length):0,K=U.slice(),X;return function(W){for(X=0;X<Z;++X)K[X]=Q[X]*(1-W)+U[X]*W;return K}}function bL(Q){return ArrayBuffer.isView(Q)&&!(Q instanceof DataView)}function uL(Q,U){var Z=U?U.length:0,K=Q?Math.min(Z,Q.length):0,X=Array(K),W=Array(Z),z;for(z=0;z<K;++z)X[z]=D4(Q[z],U[z]);for(;z<Z;++z)W[z]=U[z];return function(B){for(z=0;z<K;++z)W[z]=X[z](B);return W}}function RK(Q,U){var Z=new Date;return Q=+Q,U=+U,function(K){return Z.setTime(Q*(1-K)+U*K),Z}}function w2(Q,U){return Q=+Q,U=+U,function(Z){return Q*(1-Z)+U*Z}}function OK(Q,U){var Z={},K={},X;if(Q===null||typeof Q!=="object")Q={};if(U===null||typeof U!=="object")U={};for(X in U)if(X in Q)Z[X]=D4(Q[X],U[X]);else K[X]=U[X];return function(W){for(X in Z)K[X]=Z[X](W);return K}}var IK=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,wK=new RegExp(IK.source,"g");function _N(Q){return function(){return Q}}function JN(Q){return function(U){return Q(U)+""}}function c7(Q,U){var Z=IK.lastIndex=wK.lastIndex=0,K,X,W,z=-1,B=[],O=[];Q=Q+"",U=U+"";while((K=IK.exec(Q))&&(X=wK.exec(U))){if((W=X.index)>Z)if(W=U.slice(Z,W),B[z])B[z]+=W;else B[++z]=W;if((K=K[0])===(X=X[0]))if(B[z])B[z]+=X;else B[++z]=X;else B[++z]=null,O.push({i:z,x:w2(K,X)});Z=wK.lastIndex}if(Z<U.length)if(W=U.slice(Z),B[z])B[z]+=W;else B[++z]=W;return B.length<2?O[0]?JN(O[0].x):_N(U):(U=O.length,function(T){for(var R=0,L;R<U;++R)B[(L=O[R]).i]=L.x(T);return B.join("")})}function D4(Q,U){var Z=typeof U,K;return U==null||Z==="boolean"?JJ(U):(Z==="number"?w2:Z==="string"?(K=s5(U))?(U=K,B8):c7:U instanceof s5?B8:U instanceof Date?RK:bL(U)?TK:Array.isArray(U)?uL:typeof U.valueOf!=="function"&&typeof U.toString!=="function"||isNaN(U)?OK:w2)(Q,U)}var xL=180/Math.PI,Kq={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Xq(Q,U,Z,K,X,W){var z,B,O;if(z=Math.sqrt(Q*Q+U*U))Q/=z,U/=z;if(O=Q*Z+U*K)Z-=Q*O,K-=U*O;if(B=Math.sqrt(Z*Z+K*K))Z/=B,K/=B,O/=B;if(Q*K<U*Z)Q=-Q,U=-U,O=-O,z=-z;return{translateX:X,translateY:W,rotate:Math.atan2(U,Q)*xL,skewX:Math.atan(O)*xL,scaleX:z,scaleY:B}}var Hq;function hL(Q){let U=new(typeof DOMMatrix==="function"?DOMMatrix:WebKitCSSMatrix)(Q+"");return U.isIdentity?Kq:Xq(U.a,U.b,U.c,U.d,U.e,U.f)}function mL(Q){if(Q==null)return Kq;if(!Hq)Hq=document.createElementNS("http://www.w3.org/2000/svg","g");if(Hq.setAttribute("transform",Q),!(Q=Hq.transform.baseVal.consolidate()))return Kq;return Q=Q.matrix,Xq(Q.a,Q.b,Q.c,Q.d,Q.e,Q.f)}function gL(Q,U,Z,K){function X(T){return T.length?T.pop()+" ":""}function W(T,R,L,M,f,I){if(T!==L||R!==M){var D=f.push("translate(",null,U,null,Z);I.push({i:D-4,x:w2(T,L)},{i:D-2,x:w2(R,M)})}else if(L||M)f.push("translate("+L+U+M+Z)}function z(T,R,L,M){if(T!==R){if(T-R>180)R+=360;else if(R-T>180)T+=360;M.push({i:L.push(X(L)+"rotate(",null,K)-2,x:w2(T,R)})}else if(R)L.push(X(L)+"rotate("+R+K)}function B(T,R,L,M){if(T!==R)M.push({i:L.push(X(L)+"skewX(",null,K)-2,x:w2(T,R)});else if(R)L.push(X(L)+"skewX("+R+K)}function O(T,R,L,M,f,I){if(T!==L||R!==M){var D=f.push(X(f)+"scale(",null,",",null,")");I.push({i:D-4,x:w2(T,L)},{i:D-2,x:w2(R,M)})}else if(L!==1||M!==1)f.push(X(f)+"scale("+L+","+M+")")}return function(T,R){var L=[],M=[];return T=Q(T),R=Q(R),W(T.translateX,T.translateY,R.translateX,R.translateY,L,M),z(T.rotate,R.rotate,L,M),B(T.skewX,R.skewX,L,M),O(T.scaleX,T.scaleY,R.scaleX,R.scaleY,L,M),T=R=null,function(f){var I=-1,D=M.length,V;while(++I<D)L[(V=M[I]).i]=V.x(f);return L.join("")}}}var fK=gL(hL,"px, ","px)","deg)"),PK=gL(mL,", ",")",")");var $N=0.000000000001;function pL(Q){return((Q=Math.exp(Q))+1/Q)/2}function QN(Q){return((Q=Math.exp(Q))-1/Q)/2}function qN(Q){return((Q=Math.exp(2*Q))-1)/(Q+1)}var A8=function Q(U,Z,K){function X(W,z){var B=W[0],O=W[1],T=W[2],R=z[0],L=z[1],M=z[2],f=R-B,I=L-O,D=f*f+I*I,V,k;if(D<$N)k=Math.log(M/T)/U,V=function(E){return[B+E*f,O+E*I,T*Math.exp(U*E*k)]};else{var h=Math.sqrt(D),P=(M*M-T*T+K*D)/(2*T*Z*h),C=(M*M-T*T-K*D)/(2*M*Z*h),v=Math.log(Math.sqrt(P*P+1)-P),b=Math.log(Math.sqrt(C*C+1)-C);k=(b-v)/U,V=function(E){var p=E*k,a=pL(v),m=T/(Z*h)*(a*qN(U*p+v)-QN(v));return[B+m*f,O+m*I,T*a/pL(U*p+v)]}}return V.duration=k*1000*U/Math.SQRT2,V}return X.rho=function(W){var z=Math.max(0.001,+W),B=z*z,O=B*B;return Q(z,B,O)},X}(Math.SQRT2,2,4);var l7=0,QJ=0,$J=0,lL=1000,Yq,qJ,Wq=0,L8=0,zq=0,UJ=typeof performance==="object"&&performance.now?performance:Date,rL=typeof window==="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(Q){setTimeout(Q,17)};function ZJ(){return L8||(rL(UN),L8=UJ.now()+zq)}function UN(){L8=0}function GJ(){this._call=this._time=this._next=null}GJ.prototype=Bq.prototype={constructor:GJ,restart:function(Q,U,Z){if(typeof Q!=="function")throw TypeError("callback is not a function");if(Z=(Z==null?ZJ():+Z)+(U==null?0:+U),!this._next&&qJ!==this){if(qJ)qJ._next=this;else Yq=this;qJ=this}this._call=Q,this._time=Z,NK()},stop:function(){if(this._call)this._call=null,this._time=1/0,NK()}};function Bq(Q,U,Z){var K=new GJ;return K.restart(Q,U,Z),K}function dL(){ZJ(),++l7;var Q=Yq,U;while(Q){if((U=L8-Q._time)>=0)Q._call.call(void 0,U);Q=Q._next}--l7}function cL(){L8=(Wq=UJ.now())+zq,l7=QJ=0;try{dL()}finally{l7=0,ZN(),L8=0}}function GN(){var Q=UJ.now(),U=Q-Wq;if(U>lL)zq-=U,Wq=Q}function ZN(){var Q,U=Yq,Z,K=1/0;while(U)if(U._call){if(K>U._time)K=U._time;Q=U,U=U._next}else Z=U._next,U._next=null,U=Q?Q._next=Z:Yq=Z;qJ=Q,NK(K)}function NK(Q){if(l7)return;if(QJ)QJ=clearTimeout(QJ);var U=Q-L8;if(U>24){if(Q<1/0)QJ=setTimeout(cL,Q-UJ.now()-zq);if($J)$J=clearInterval($J)}else{if(!$J)Wq=UJ.now(),$J=setInterval(GN,lL);l7=1,rL(cL)}}function FJ(Q,U,Z){var K=new GJ;return U=U==null?0:+U,K.restart((X)=>{K.stop(),Q(X+U)},U,Z),K}var FN=H8("start","end","cancel","interrupt"),KN=[],sL=0,iL=1,Lq=2,Aq=3,aL=4,Mq=5,KJ=6;function W3(Q,U,Z,K,X,W){var z=Q.__transition;if(!z)Q.__transition={};else if(Z in z)return;XN(Q,Z,{name:U,index:K,group:X,on:FN,tween:KN,time:W.time,delay:W.delay,duration:W.duration,ease:W.ease,timer:null,state:sL})}function XJ(Q,U){var Z=e0(Q,U);if(Z.state>sL)throw Error("too late; already scheduled");return Z}function W2(Q,U){var Z=e0(Q,U);if(Z.state>Aq)throw Error("too late; already running");return Z}function e0(Q,U){var Z=Q.__transition;if(!Z||!(Z=Z[U]))throw Error("transition not found");return Z}function XN(Q,U,Z){var K=Q.__transition,X;K[U]=Z,Z.timer=Bq(W,0,Z.time);function W(T){if(Z.state=iL,Z.timer.restart(z,Z.delay,Z.time),Z.delay<=T)z(T-Z.delay)}function z(T){var R,L,M,f;if(Z.state!==iL)return O();for(R in K){if(f=K[R],f.name!==Z.name)continue;if(f.state===Aq)return FJ(z);if(f.state===aL)f.state=KJ,f.timer.stop(),f.on.call("interrupt",Q,Q.__data__,f.index,f.group),delete K[R];else if(+R<U)f.state=KJ,f.timer.stop(),f.on.call("cancel",Q,Q.__data__,f.index,f.group),delete K[R]}if(FJ(function(){if(Z.state===Aq)Z.state=aL,Z.timer.restart(B,Z.delay,Z.time),B(T)}),Z.state=Lq,Z.on.call("start",Q,Q.__data__,Z.index,Z.group),Z.state!==Lq)return;Z.state=Aq,X=Array(M=Z.tween.length);for(R=0,L=-1;R<M;++R)if(f=Z.tween[R].value.call(Q,Q.__data__,Z.index,Z.group))X[++L]=f;X.length=L+1}function B(T){var R=T<Z.duration?Z.ease.call(null,T/Z.duration):(Z.timer.restart(O),Z.state=Mq,1),L=-1,M=X.length;while(++L<M)X[L].call(Q,R);if(Z.state===Mq)Z.on.call("end",Q,Q.__data__,Z.index,Z.group),O()}function O(){Z.state=KJ,Z.timer.stop(),delete K[U];for(var T in K)return;delete Q.__transition}}function Y6(Q,U){var Z=Q.__transition,K,X,W=!0,z;if(!Z)return;U=U==null?null:U+"";for(z in Z){if((K=Z[z]).name!==U){W=!1;continue}X=K.state>Lq&&K.state<Mq,K.state=KJ,K.timer.stop(),K.on.call(X?"interrupt":"cancel",Q,Q.__data__,K.index,K.group),delete Z[z]}if(W)delete Q.__transition}function CK(Q){return this.each(function(){Y6(this,Q)})}function HN(Q,U){var Z,K;return function(){var X=W2(this,Q),W=X.tween;if(W!==Z){K=Z=W;for(var z=0,B=K.length;z<B;++z)if(K[z].name===U){K=K.slice(),K.splice(z,1);break}}X.tween=K}}function YN(Q,U,Z){var K,X;if(typeof Z!=="function")throw Error();return function(){var W=W2(this,Q),z=W.tween;if(z!==K){X=(K=z).slice();for(var B={name:U,value:Z},O=0,T=X.length;O<T;++O)if(X[O].name===U){X[O]=B;break}if(O===T)X.push(B)}W.tween=X}}function SK(Q,U){var Z=this._id;if(Q+="",arguments.length<2){var K=e0(this.node(),Z).tween;for(var X=0,W=K.length,z;X<W;++X)if((z=K[X]).name===Q)return z.value;return null}return this.each((U==null?HN:YN)(Z,Q,U))}function r7(Q,U,Z){var K=Q._id;return Q.each(function(){var X=W2(this,K);(X.value||(X.value={}))[U]=Z.apply(this,arguments)}),function(X){return e0(X,K).value[U]}}function HJ(Q,U){var Z;return(typeof U==="number"?w2:U instanceof s5?B8:(Z=s5(U))?(U=Z,B8):c7)(Q,U)}function WN(Q){return function(){this.removeAttribute(Q)}}function zN(Q){return function(){this.removeAttributeNS(Q.space,Q.local)}}function BN(Q,U,Z){var K,X=Z+"",W;return function(){var z=this.getAttribute(Q);return z===X?null:z===K?W:W=U(K=z,Z)}}function AN(Q,U,Z){var K,X=Z+"",W;return function(){var z=this.getAttributeNS(Q.space,Q.local);return z===X?null:z===K?W:W=U(K=z,Z)}}function LN(Q,U,Z){var K,X,W;return function(){var z,B=Z(this),O;if(B==null)return void this.removeAttribute(Q);return z=this.getAttribute(Q),O=B+"",z===O?null:z===K&&O===X?W:(X=O,W=U(K=z,B))}}function MN(Q,U,Z){var K,X,W;return function(){var z,B=Z(this),O;if(B==null)return void this.removeAttributeNS(Q.space,Q.local);return z=this.getAttributeNS(Q.space,Q.local),O=B+"",z===O?null:z===K&&O===X?W:(X=O,W=U(K=z,B))}}function jK(Q,U){var Z=V4(Q),K=Z==="transform"?PK:HJ;return this.attrTween(Q,typeof U==="function"?(Z.local?MN:LN)(Z,K,r7(this,"attr."+Q,U)):U==null?(Z.local?zN:WN)(Z):(Z.local?AN:BN)(Z,K,U))}function TN(Q,U){return function(Z){this.setAttribute(Q,U.call(this,Z))}}function RN(Q,U){return function(Z){this.setAttributeNS(Q.space,Q.local,U.call(this,Z))}}function ON(Q,U){var Z,K;function X(){var W=U.apply(this,arguments);if(W!==K)Z=(K=W)&&RN(Q,W);return Z}return X._value=U,X}function wN(Q,U){var Z,K;function X(){var W=U.apply(this,arguments);if(W!==K)Z=(K=W)&&TN(Q,W);return Z}return X._value=U,X}function VK(Q,U){var Z="attr."+Q;if(arguments.length<2)return(Z=this.tween(Z))&&Z._value;if(U==null)return this.tween(Z,null);if(typeof U!=="function")throw Error();var K=V4(Q);return this.tween(Z,(K.local?ON:wN)(K,U))}function IN(Q,U){return function(){XJ(this,Q).delay=+U.apply(this,arguments)}}function fN(Q,U){return U=+U,function(){XJ(this,Q).delay=U}}function kK(Q){var U=this._id;return arguments.length?this.each((typeof Q==="function"?IN:fN)(U,Q)):e0(this.node(),U).delay}function PN(Q,U){return function(){W2(this,Q).duration=+U.apply(this,arguments)}}function NN(Q,U){return U=+U,function(){W2(this,Q).duration=U}}function DK(Q){var U=this._id;return arguments.length?this.each((typeof Q==="function"?PN:NN)(U,Q)):e0(this.node(),U).duration}function CN(Q,U){if(typeof U!=="function")throw Error();return function(){W2(this,Q).ease=U}}function yK(Q){var U=this._id;return arguments.length?this.each(CN(U,Q)):e0(this.node(),U).ease}function SN(Q,U){return function(){var Z=U.apply(this,arguments);if(typeof Z!=="function")throw Error();W2(this,Q).ease=Z}}function vK(Q){if(typeof Q!=="function")throw Error();return this.each(SN(this._id,Q))}function EK(Q){if(typeof Q!=="function")Q=x7(Q);for(var U=this._groups,Z=U.length,K=Array(Z),X=0;X<Z;++X)for(var W=U[X],z=W.length,B=K[X]=[],O,T=0;T<z;++T)if((O=W[T])&&Q.call(O,O.__data__,T,W))B.push(O);return new u2(K,this._parents,this._name,this._id)}function bK(Q){if(Q._id!==this._id)throw Error();for(var U=this._groups,Z=Q._groups,K=U.length,X=Z.length,W=Math.min(K,X),z=Array(K),B=0;B<W;++B)for(var O=U[B],T=Z[B],R=O.length,L=z[B]=Array(R),M,f=0;f<R;++f)if(M=O[f]||T[f])L[f]=M;for(;B<K;++B)z[B]=U[B];return new u2(z,this._parents,this._name,this._id)}function jN(Q){return(Q+"").trim().split(/^|\s+/).every(function(U){var Z=U.indexOf(".");if(Z>=0)U=U.slice(0,Z);return!U||U==="start"})}function VN(Q,U,Z){var K,X,W=jN(U)?XJ:W2;return function(){var z=W(this,Q),B=z.on;if(B!==K)(X=(K=B).copy()).on(U,Z);z.on=X}}function uK(Q,U){var Z=this._id;return arguments.length<2?e0(this.node(),Z).on.on(Q):this.each(VN(Z,Q,U))}function kN(Q){return function(){var U=this.parentNode;for(var Z in this.__transition)if(+Z!==Q)return;if(U)U.removeChild(this)}}function xK(){return this.on("end.remove",kN(this._id))}function hK(Q){var U=this._name,Z=this._id;if(typeof Q!=="function")Q=X6(Q);for(var K=this._groups,X=K.length,W=Array(X),z=0;z<X;++z)for(var B=K[z],O=B.length,T=W[z]=Array(O),R,L,M=0;M<O;++M)if((R=B[M])&&(L=Q.call(R,R.__data__,M,B))){if("__data__"in R)L.__data__=R.__data__;T[M]=L,W3(T[M],U,Z,M,T,e0(R,Z))}return new u2(W,this._parents,U,Z)}function mK(Q){var U=this._name,Z=this._id;if(typeof Q!=="function")Q=h7(Q);for(var K=this._groups,X=K.length,W=[],z=[],B=0;B<X;++B)for(var O=K[B],T=O.length,R,L=0;L<T;++L)if(R=O[L]){for(var M=Q.call(R,R.__data__,L,O),f,I=e0(R,Z),D=0,V=M.length;D<V;++D)if(f=M[D])W3(f,U,Z,D,M,I);W.push(M),z.push(R)}return new u2(W,z,U,Z)}var DN=H3.prototype.constructor;function gK(){return new DN(this._groups,this._parents)}function yN(Q,U){var Z,K,X;return function(){var W=H6(this,Q),z=(this.style.removeProperty(Q),H6(this,Q));return W===z?null:W===Z&&z===K?X:X=U(Z=W,K=z)}}function tL(Q){return function(){this.style.removeProperty(Q)}}function vN(Q,U,Z){var K,X=Z+"",W;return function(){var z=H6(this,Q);return z===X?null:z===K?W:W=U(K=z,Z)}}function EN(Q,U,Z){var K,X,W;return function(){var z=H6(this,Q),B=Z(this),O=B+"";if(B==null)O=B=(this.style.removeProperty(Q),H6(this,Q));return z===O?null:z===K&&O===X?W:(X=O,W=U(K=z,B))}}function bN(Q,U){var Z,K,X,W="style."+U,z="end."+W,B;return function(){var O=W2(this,Q),T=O.on,R=O.value[W]==null?B||(B=tL(U)):void 0;if(T!==Z||X!==R)(K=(Z=T).copy()).on(z,X=R);O.on=K}}function pK(Q,U,Z){var K=(Q+="")==="transform"?fK:HJ;return U==null?this.styleTween(Q,yN(Q,K)).on("end.style."+Q,tL(Q)):typeof U==="function"?this.styleTween(Q,EN(Q,K,r7(this,"style."+Q,U))).each(bN(this._id,Q)):this.styleTween(Q,vN(Q,K,U),Z).on("end.style."+Q,null)}function uN(Q,U,Z){return function(K){this.style.setProperty(Q,U.call(this,K),Z)}}function xN(Q,U,Z){var K,X;function W(){var z=U.apply(this,arguments);if(z!==X)K=(X=z)&&uN(Q,z,Z);return K}return W._value=U,W}function cK(Q,U,Z){var K="style."+(Q+="");if(arguments.length<2)return(K=this.tween(K))&&K._value;if(U==null)return this.tween(K,null);if(typeof U!=="function")throw Error();return this.tween(K,xN(Q,U,Z==null?"":Z))}function hN(Q){return function(){this.textContent=Q}}function mN(Q){return function(){var U=Q(this);this.textContent=U==null?"":U}}function lK(Q){return this.tween("text",typeof Q==="function"?mN(r7(this,"text",Q)):hN(Q==null?"":Q+""))}function gN(Q){return function(U){this.textContent=Q.call(this,U)}}function pN(Q){var U,Z;function K(){var X=Q.apply(this,arguments);if(X!==Z)U=(Z=X)&&gN(X);return U}return K._value=Q,K}function rK(Q){var U="text";if(arguments.length<1)return(U=this.tween(U))&&U._value;if(Q==null)return this.tween(U,null);if(typeof Q!=="function")throw Error();return this.tween(U,pN(Q))}function dK(){var Q=this._name,U=this._id,Z=Tq();for(var K=this._groups,X=K.length,W=0;W<X;++W)for(var z=K[W],B=z.length,O,T=0;T<B;++T)if(O=z[T]){var R=e0(O,U);W3(O,Q,Z,T,z,{time:R.time+R.delay+R.duration,delay:0,duration:R.duration,ease:R.ease})}return new u2(K,this._parents,Q,Z)}function iK(){var Q,U,Z=this,K=Z._id,X=Z.size();return new Promise(function(W,z){var B={value:z},O={value:function(){if(--X===0)W()}};if(Z.each(function(){var T=W2(this,K),R=T.on;if(R!==Q)U=(Q=R).copy(),U._.cancel.push(B),U._.interrupt.push(B),U._.end.push(O);T.on=U}),X===0)W()})}var cN=0;function u2(Q,U,Z,K){this._groups=Q,this._parents=U,this._name=Z,this._id=K}function oL(Q){return H3().transition(Q)}function Tq(){return++cN}var z3=H3.prototype;u2.prototype=oL.prototype={constructor:u2,select:hK,selectAll:mK,selectChild:z3.selectChild,selectChildren:z3.selectChildren,filter:EK,merge:bK,selection:gK,transition:dK,call:z3.call,nodes:z3.nodes,node:z3.node,size:z3.size,empty:z3.empty,each:z3.each,on:uK,attr:jK,attrTween:VK,style:pK,styleTween:cK,text:lK,textTween:rK,remove:xK,tween:SK,delay:kK,duration:DK,ease:yK,easeVarying:vK,end:iK,[Symbol.iterator]:z3[Symbol.iterator]};function Rq(Q){return((Q*=2)<=1?Q*Q*Q:(Q-=2)*Q*Q+2)/2}var lN={time:null,delay:0,duration:250,ease:Rq};function rN(Q,U){var Z;while(!(Z=Q.__transition)||!(Z=Z[U]))if(!(Q=Q.parentNode))throw Error(`transition ${U} not found`);return Z}function aK(Q){var U,Z;if(Q instanceof u2)U=Q._id,Q=Q._name;else U=Tq(),(Z=lN).time=ZJ(),Q=Q==null?null:Q+"";for(var K=this._groups,X=K.length,W=0;W<X;++W)for(var z=K[W],B=z.length,O,T=0;T<B;++T)if(O=z[T])W3(O,Q,U,T,z,Z||rN(O,U));return new u2(K,this._parents,Q,U)}H3.prototype.interrupt=CK;H3.prototype.transition=aK;var YJ=(Q)=>()=>Q;function sK(Q,{sourceEvent:U,target:Z,transform:K,dispatch:X}){Object.defineProperties(this,{type:{value:Q,enumerable:!0,configurable:!0},sourceEvent:{value:U,enumerable:!0,configurable:!0},target:{value:Z,enumerable:!0,configurable:!0},transform:{value:K,enumerable:!0,configurable:!0},_:{value:X}})}function t5(Q,U,Z){this.k=Q,this.x=U,this.y=Z}t5.prototype={constructor:t5,scale:function(Q){return Q===1?this:new t5(this.k*Q,this.x,this.y)},translate:function(Q,U){return Q===0&U===0?this:new t5(this.k,this.x+this.k*Q,this.y+this.k*U)},apply:function(Q){return[Q[0]*this.k+this.x,Q[1]*this.k+this.y]},applyX:function(Q){return Q*this.k+this.x},applyY:function(Q){return Q*this.k+this.y},invert:function(Q){return[(Q[0]-this.x)/this.k,(Q[1]-this.y)/this.k]},invertX:function(Q){return(Q-this.x)/this.k},invertY:function(Q){return(Q-this.y)/this.k},rescaleX:function(Q){return Q.copy().domain(Q.range().map(this.invertX,this).map(Q.invert,Q))},rescaleY:function(Q){return Q.copy().domain(Q.range().map(this.invertY,this).map(Q.invert,Q))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var M8=new t5(1,0,0);WJ.prototype=t5.prototype;function WJ(Q){while(!Q.__zoom)if(!(Q=Q.parentNode))return M8;return Q.__zoom}function Oq(Q){Q.stopImmediatePropagation()}function T8(Q){Q.preventDefault(),Q.stopImmediatePropagation()}function dN(Q){return(!Q.ctrlKey||Q.type==="wheel")&&!Q.button}function iN(){var Q=this;if(Q instanceof SVGElement){if(Q=Q.ownerSVGElement||Q,Q.hasAttribute("viewBox"))return Q=Q.viewBox.baseVal,[[Q.x,Q.y],[Q.x+Q.width,Q.y+Q.height]];return[[0,0],[Q.width.baseVal.value,Q.height.baseVal.value]]}return[[0,0],[Q.clientWidth,Q.clientHeight]]}function nL(){return this.__zoom||M8}function aN(Q){return-Q.deltaY*(Q.deltaMode===1?0.05:Q.deltaMode?1:0.002)*(Q.ctrlKey?10:1)}function sN(){return navigator.maxTouchPoints||"ontouchstart"in this}function tN(Q,U,Z){var K=Q.invertX(U[0][0])-Z[0][0],X=Q.invertX(U[1][0])-Z[1][0],W=Q.invertY(U[0][1])-Z[0][1],z=Q.invertY(U[1][1])-Z[1][1];return Q.translate(X>K?(K+X)/2:Math.min(0,K)||Math.max(0,X),z>W?(W+z)/2:Math.min(0,W)||Math.max(0,z))}function zJ(){var Q=dN,U=iN,Z=tN,K=aN,X=sN,W=[0,1/0],z=[[-1/0,-1/0],[1/0,1/0]],B=250,O=A8,T=H8("start","zoom","end"),R,L,M,f=500,I=150,D=0,V=10;function k(y){y.property("__zoom",nL).on("wheel.zoom",p,{passive:!1}).on("mousedown.zoom",a).on("dblclick.zoom",m).filter(X).on("touchstart.zoom",_1).on("touchmove.zoom",$1).on("touchend.zoom touchcancel.zoom",J1).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}k.transform=function(y,u,x,d){var g=y.selection?y.selection():y;if(g.property("__zoom",nL),y!==g)v(y,u,x,d);else g.interrupt().each(function(){b(this,arguments).event(d).start().zoom(null,typeof u==="function"?u.apply(this,arguments):u).end()})},k.scaleBy=function(y,u,x,d){k.scaleTo(y,function(){var g=this.__zoom.k,n=typeof u==="function"?u.apply(this,arguments):u;return g*n},x,d)},k.scaleTo=function(y,u,x,d){k.transform(y,function(){var g=U.apply(this,arguments),n=this.__zoom,j=x==null?C(g):typeof x==="function"?x.apply(this,arguments):x,i=n.invert(j),q1=typeof u==="function"?u.apply(this,arguments):u;return Z(P(h(n,q1),j,i),g,z)},x,d)},k.translateBy=function(y,u,x,d){k.transform(y,function(){return Z(this.__zoom.translate(typeof u==="function"?u.apply(this,arguments):u,typeof x==="function"?x.apply(this,arguments):x),U.apply(this,arguments),z)},null,d)},k.translateTo=function(y,u,x,d,g){k.transform(y,function(){var n=U.apply(this,arguments),j=this.__zoom,i=d==null?C(n):typeof d==="function"?d.apply(this,arguments):d;return Z(M8.translate(i[0],i[1]).scale(j.k).translate(typeof u==="function"?-u.apply(this,arguments):-u,typeof x==="function"?-x.apply(this,arguments):-x),n,z)},d,g)};function h(y,u){return u=Math.max(W[0],Math.min(W[1],u)),u===y.k?y:new t5(u,y.x,y.y)}function P(y,u,x){var d=u[0]-x[0]*y.k,g=u[1]-x[1]*y.k;return d===y.x&&g===y.y?y:new t5(y.k,d,g)}function C(y){return[(+y[0][0]+ +y[1][0])/2,(+y[0][1]+ +y[1][1])/2]}function v(y,u,x,d){y.on("start.zoom",function(){b(this,arguments).event(d).start()}).on("interrupt.zoom end.zoom",function(){b(this,arguments).event(d).end()}).tween("zoom",function(){var g=this,n=arguments,j=b(g,n).event(d),i=U.apply(g,n),q1=x==null?C(i):typeof x==="function"?x.apply(g,n):x,Q1=Math.max(i[1][0]-i[0][0],i[1][1]-i[0][1]),Y1=g.__zoom,L1=typeof u==="function"?u.apply(g,n):u,M1=O(Y1.invert(q1).concat(Q1/Y1.k),L1.invert(q1).concat(Q1/L1.k));return function(I1){if(I1===1)I1=L1;else{var X1=M1(I1),f1=Q1/X1[2];I1=new t5(f1,q1[0]-X1[0]*f1,q1[1]-X1[1]*f1)}j.zoom(null,I1)}})}function b(y,u,x){return!x&&y.__zooming||new E(y,u)}function E(y,u){this.that=y,this.args=u,this.active=0,this.sourceEvent=null,this.extent=U.apply(y,u),this.taps=0}E.prototype={event:function(y){if(y)this.sourceEvent=y;return this},start:function(){if(++this.active===1)this.that.__zooming=this,this.emit("start");return this},zoom:function(y,u){if(this.mouse&&y!=="mouse")this.mouse[1]=u.invert(this.mouse[0]);if(this.touch0&&y!=="touch")this.touch0[1]=u.invert(this.touch0[0]);if(this.touch1&&y!=="touch")this.touch1[1]=u.invert(this.touch1[0]);return this.that.__zoom=u,this.emit("zoom"),this},end:function(){if(--this.active===0)delete this.that.__zooming,this.emit("end");return this},emit:function(y){var u=n0(this.that).datum();T.call(y,this.that,new sK(y,{sourceEvent:this.sourceEvent,target:k,type:y,transform:this.that.__zoom,dispatch:T}),u)}};function p(y,...u){if(!Q.apply(this,arguments))return;var x=b(this,u).event(y),d=this.__zoom,g=Math.max(W[0],Math.min(W[1],d.k*Math.pow(2,K.apply(this,arguments)))),n=O2(y);if(x.wheel){if(x.mouse[0][0]!==n[0]||x.mouse[0][1]!==n[1])x.mouse[1]=d.invert(x.mouse[0]=n);clearTimeout(x.wheel)}else if(d.k===g)return;else x.mouse=[n,d.invert(n)],Y6(this),x.start();T8(y),x.wheel=setTimeout(j,I),x.zoom("mouse",Z(P(h(d,g),x.mouse[0],x.mouse[1]),x.extent,z));function j(){x.wheel=null,x.end()}}function a(y,...u){if(M||!Q.apply(this,arguments))return;var x=y.currentTarget,d=b(this,u,!0).event(y),g=n0(y.view).on("mousemove.zoom",q1,!0).on("mouseup.zoom",Q1,!0),n=O2(y,x),j=y.clientX,i=y.clientY;m7(y.view),Oq(y),d.mouse=[n,this.__zoom.invert(n)],Y6(this),d.start();function q1(Y1){if(T8(Y1),!d.moved){var L1=Y1.clientX-j,M1=Y1.clientY-i;d.moved=L1*L1+M1*M1>D}d.event(Y1).zoom("mouse",Z(P(d.that.__zoom,d.mouse[0]=O2(Y1,x),d.mouse[1]),d.extent,z))}function Q1(Y1){g.on("mousemove.zoom mouseup.zoom",null),i_(Y1.view,d.moved),T8(Y1),d.event(Y1).end()}}function m(y,...u){if(!Q.apply(this,arguments))return;var x=this.__zoom,d=O2(y.changedTouches?y.changedTouches[0]:y,this),g=x.invert(d),n=x.k*(y.shiftKey?0.5:2),j=Z(P(h(x,n),d,g),U.apply(this,u),z);if(T8(y),B>0)n0(this).transition().duration(B).call(v,j,d,y);else n0(this).call(k.transform,j,d,y)}function _1(y,...u){if(!Q.apply(this,arguments))return;var x=y.touches,d=x.length,g=b(this,u,y.changedTouches.length===d).event(y),n,j,i,q1;Oq(y);for(j=0;j<d;++j)if(i=x[j],q1=O2(i,this),q1=[q1,this.__zoom.invert(q1),i.identifier],!g.touch0)g.touch0=q1,n=!0,g.taps=1+!!R;else if(!g.touch1&&g.touch0[2]!==q1[2])g.touch1=q1,g.taps=0;if(R)R=clearTimeout(R);if(n){if(g.taps<2)L=q1[0],R=setTimeout(function(){R=null},f);Y6(this),g.start()}}function $1(y,...u){if(!this.__zooming)return;var x=b(this,u).event(y),d=y.changedTouches,g=d.length,n,j,i,q1;T8(y);for(n=0;n<g;++n)if(j=d[n],i=O2(j,this),x.touch0&&x.touch0[2]===j.identifier)x.touch0[0]=i;else if(x.touch1&&x.touch1[2]===j.identifier)x.touch1[0]=i;if(j=x.that.__zoom,x.touch1){var Q1=x.touch0[0],Y1=x.touch0[1],L1=x.touch1[0],M1=x.touch1[1],I1=(I1=L1[0]-Q1[0])*I1+(I1=L1[1]-Q1[1])*I1,X1=(X1=M1[0]-Y1[0])*X1+(X1=M1[1]-Y1[1])*X1;j=h(j,Math.sqrt(I1/X1)),i=[(Q1[0]+L1[0])/2,(Q1[1]+L1[1])/2],q1=[(Y1[0]+M1[0])/2,(Y1[1]+M1[1])/2]}else if(x.touch0)i=x.touch0[0],q1=x.touch0[1];else return;x.zoom("touch",Z(P(j,i,q1),x.extent,z))}function J1(y,...u){if(!this.__zooming)return;var x=b(this,u).event(y),d=y.changedTouches,g=d.length,n,j;if(Oq(y),M)clearTimeout(M);M=setTimeout(function(){M=null},f);for(n=0;n<g;++n)if(j=d[n],x.touch0&&x.touch0[2]===j.identifier)delete x.touch0;else if(x.touch1&&x.touch1[2]===j.identifier)delete x.touch1;if(x.touch1&&!x.touch0)x.touch0=x.touch1,delete x.touch1;if(x.touch0)x.touch0[1]=this.__zoom.invert(x.touch0[0]);else if(x.end(),x.taps===2){if(j=O2(j,this),Math.hypot(L[0]-j[0],L[1]-j[1])<V){var i=n0(this).on("dblclick.zoom");if(i)i.apply(this,arguments)}}}return k.wheelDelta=function(y){return arguments.length?(K=typeof y==="function"?y:YJ(+y),k):K},k.filter=function(y){return arguments.length?(Q=typeof y==="function"?y:YJ(!!y),k):Q},k.touchable=function(y){return arguments.length?(X=typeof y==="function"?y:YJ(!!y),k):X},k.extent=function(y){return arguments.length?(U=typeof y==="function"?y:YJ([[+y[0][0],+y[0][1]],[+y[1][0],+y[1][1]]]),k):U},k.scaleExtent=function(y){return arguments.length?(W[0]=+y[0],W[1]=+y[1],k):[W[0],W[1]]},k.translateExtent=function(y){return arguments.length?(z[0][0]=+y[0][0],z[1][0]=+y[1][0],z[0][1]=+y[0][1],z[1][1]=+y[1][1],k):[[z[0][0],z[0][1]],[z[1][0],z[1][1]]]},k.constrain=function(y){return arguments.length?(Z=y,k):Z},k.duration=function(y){return arguments.length?(B=+y,k):B},k.interpolate=function(y){return arguments.length?(O=y,k):O},k.on=function(){var y=T.on.apply(T,arguments);return y===T?k:y},k.clickDistance=function(y){return arguments.length?(D=(y=+y)*y,k):Math.sqrt(D)},k.tapDistance=function(y){return arguments.length?(V=+y,k):V},k}var x2={error001:(Q="react")=>`Seems like you have not used ${Q==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${Q}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:(Q)=>`Node type "${Q}" 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:(Q)=>`The old edge with id=${Q} does not exist.`,error009:(Q)=>`Marker type "${Q}" doesn't exist.`,error008:(Q,{id:U,sourceHandle:Z,targetHandle:K})=>`Couldn't create edge for ${Q} handle id: "${Q==="source"?Z:K}", edge id: ${U}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:(Q)=>`Edge type "${Q}" not found. Using fallback type "default".`,error012:(Q)=>`Node with id "${Q}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(Q="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${Q}/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:(Q)=>`Edge with id "${Q}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},s7=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],_X=["Enter"," ","Escape"],JX={"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:Q,x:U,y:Z})=>`Moved selected node ${Q}. New position, x: ${U}, y: ${Z}`,"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"},A6;(function(Q){Q.Strict="strict",Q.Loose="loose"})(A6||(A6={}));var B3;(function(Q){Q.Free="free",Q.Vertical="vertical",Q.Horizontal="horizontal"})(B3||(B3={}));var R8;(function(Q){Q.Partial="partial",Q.Full="full"})(R8||(R8={}));var $X={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},y4;(function(Q){Q.Bezier="default",Q.Straight="straight",Q.Step="step",Q.SmoothStep="smoothstep",Q.SimpleBezier="simplebezier"})(y4||(y4={}));var i7;(function(Q){Q.Arrow="arrow",Q.ArrowClosed="arrowclosed"})(i7||(i7={}));var C1;(function(Q){Q.Left="left",Q.Top="top",Q.Right="right",Q.Bottom="bottom"})(C1||(C1={}));var eL={[C1.Left]:C1.Right,[C1.Right]:C1.Left,[C1.Top]:C1.Bottom,[C1.Bottom]:C1.Top},QX=(Q)=>!!Q&&typeof Q==="object"&&("id"in Q)&&("source"in Q)&&("target"in Q),WM=(Q)=>!!Q&&typeof Q==="object"&&("id"in Q)&&("position"in Q)&&!("source"in Q)&&!("target"in Q),qX=(Q)=>!!Q&&typeof Q==="object"&&("id"in Q)&&("internals"in Q)&&!("source"in Q)&&!("target"in Q);var AJ=(Q,U=[0,0])=>{let{width:Z,height:K}=y5(Q),X=Q.origin??U,W=Z*X[0],z=K*X[1];return{x:Q.position.x-W,y:Q.position.y-z}},UX=(Q,U={nodeOrigin:[0,0]})=>{if(!U.nodeLookup)console.warn("Please use `getNodesBounds` from `useReactFlow`/`useSvelteFlow` hook to ensure correct values for sub flows. If not possible, you have to provide a nodeLookup to support sub flows.");if(Q.length===0)return{x:0,y:0,width:0,height:0};let Z=!1,K=Q.reduce((X,W)=>{let z=typeof W==="string",B=!U.nodeLookup&&!z?W:void 0;if(U.nodeLookup)B=z?U.nodeLookup.get(W):!qX(W)?U.nodeLookup.get(W.id):W;if(!B)return X;return Z=!0,Cq(X,fq(B,U.nodeOrigin))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Z?Sq(K):{x:0,y:0,width:0,height:0}},f8=(Q,U={})=>{let Z={x:1/0,y:1/0,x2:-1/0,y2:-1/0},K=!1;return Q.forEach((X)=>{if(U.filter===void 0||U.filter(X))Z=Cq(Z,fq(X)),K=!0}),K?Sq(Z):{x:0,y:0,width:0,height:0}},Pq=(Q,U,[Z,K,X]=[0,0,1],W=!1,z=!1)=>{let B=(U.x-Z)/X,O=(U.y-K)/X,T=U.width/X,R=U.height/X,L=[];for(let M of Q.values()){let{measured:f,selectable:I=!0,hidden:D=!1}=M;if(z&&!I||D)continue;let V=f.width??M.width??M.initialWidth??0,k=f.height??M.height??M.initialHeight??0,{x:h,y:P}=M.internals.positionAbsolute,C=MM(B,O,T,R,h,P,V,k),v=V*k,b=W&&C>0;if(!M.internals.handleBounds||b||C>=v||M.dragging)L.push(M)}return L},zM=(Q,U)=>{let Z=new Set;return Q.forEach((K)=>{Z.add(K.id)}),U.filter((K)=>Z.has(K.source)||Z.has(K.target))};function oN(Q,U){let Z=new Map,K=U?.nodes?new Set(U.nodes.map((X)=>X.id)):null;return Q.forEach((X)=>{let W;if(U?.includeHiddenNodes){let{width:z,height:B}=y5(X);W=z>0&&B>0}else W=Boolean(X.measured.width&&X.measured.height&&!X.hidden);if(W&&(!K||K.has(X.id)))Z.set(X.id,X)}),Z}async function BM({nodes:Q,width:U,height:Z,panZoom:K,minZoom:X,maxZoom:W},z){if(Q.size===0)return!0;let B=oN(Q,z),O=f8(B),T=MJ(O,U,Z,z?.minZoom??X,z?.maxZoom??W,z?.padding??0.1);return await K.setViewport(T,{duration:z?.duration,ease:z?.ease,interpolate:z?.interpolate}),!0}function GX({nodeId:Q,nextPosition:U,nodeLookup:Z,nodeOrigin:K=[0,0],nodeExtent:X,onError:W}){let z=Z.get(Q),B=z.parentId?Z.get(z.parentId):void 0,{x:O,y:T}=B?B.internals.positionAbsolute:{x:0,y:0},R=z.origin??K,L=z.extent||X;if(z.extent==="parent"&&!z.expandParent)if(!B)W?.("005",x2.error005());else{let{width:f,height:I}=y5(B);if(f&&I)L=[[O,T],[O+f,T+I]]}else if(B&&I8(z.extent))L=[[z.extent[0][0]+O,z.extent[0][1]+T],[z.extent[1][0]+O,z.extent[1][1]+T]];let M=I8(L)?O8(U,L,z.measured):U;if(z.measured.width===void 0||z.measured.height===void 0)W?.("015",x2.error015());return{position:{x:M.x-O+(z.measured.width??0)*R[0],y:M.y-T+(z.measured.height??0)*R[1]},positionAbsolute:M}}async function AM({nodesToRemove:Q=[],edgesToRemove:U=[],nodes:Z,edges:K,onBeforeDelete:X}){let W=new Set(Q.map((M)=>M.id)),z=[];for(let M of Z){if(M.deletable===!1)continue;let f=W.has(M.id),I=!f&&M.parentId&&z.find((D)=>D.id===M.parentId);if(f||I)z.push(M)}let B=new Set(U.map((M)=>M.id)),O=K.filter((M)=>M.deletable!==!1),R=zM(z,O);for(let M of O)if(B.has(M.id)&&!R.find((I)=>I.id===M.id))R.push(M);if(!X)return{edges:R,nodes:z};let L=await X({nodes:z,edges:R});if(typeof L==="boolean")return L?{edges:R,nodes:z}:{edges:[],nodes:[]};return L}var a7=(Q,U=0,Z=1)=>Math.min(Math.max(Q,U),Z),O8=(Q={x:0,y:0},U,Z)=>({x:a7(Q.x,U[0][0],U[1][0]-(Z?.width??0)),y:a7(Q.y,U[0][1],U[1][1]-(Z?.height??0))});function LM(Q,U,Z){let{width:K,height:X}=y5(Z),{x:W,y:z}=Z.internals.positionAbsolute;return O8(Q,[[W,z],[W+K,z+X]],U)}var _M=(Q,U,Z)=>{if(Q<U)return a7(Math.abs(Q-U),1,U)/U;else if(Q>Z)return-a7(Math.abs(Q-Z),1,U)/U;return 0},Nq=(Q,U,Z=15,K=40)=>{let X=_M(Q.x,K,U.width-K)*Z,W=_M(Q.y,K,U.height-K)*Z;return[X,W]},Cq=(Q,U)=>({x:Math.min(Q.x,U.x),y:Math.min(Q.y,U.y),x2:Math.max(Q.x2,U.x2),y2:Math.max(Q.y2,U.y2)}),eK=({x:Q,y:U,width:Z,height:K})=>({x:Q,y:U,x2:Q+Z,y2:U+K}),Sq=({x:Q,y:U,x2:Z,y2:K})=>({x:Q,y:U,width:Z-Q,height:K-U}),t7=(Q,U=[0,0])=>{let{x:Z,y:K}=qX(Q)?Q.internals.positionAbsolute:AJ(Q,U);return{x:Z,y:K,width:Q.measured?.width??Q.width??Q.initialWidth??0,height:Q.measured?.height??Q.height??Q.initialHeight??0}},fq=(Q,U=[0,0])=>{let{x:Z,y:K}=qX(Q)?Q.internals.positionAbsolute:AJ(Q,U);return{x:Z,y:K,x2:Z+(Q.measured?.width??Q.width??Q.initialWidth??0),y2:K+(Q.measured?.height??Q.height??Q.initialHeight??0)}},ZX=(Q,U)=>Sq(Cq(eK(Q),eK(U))),MM=(Q,U,Z,K,X,W,z,B)=>{let O=Math.max(0,Math.min(Q+Z,X+z)-Math.max(Q,X)),T=Math.max(0,Math.min(U+K,W+B)-Math.max(U,W));return Math.ceil(O*T)},LJ=(Q,U)=>MM(Q.x,Q.y,Q.width,Q.height,U.x,U.y,U.width,U.height),FX=(Q)=>k5(Q.width)&&k5(Q.height)&&k5(Q.x)&&k5(Q.y),k5=(Q)=>!isNaN(Q)&&isFinite(Q),KX=(Q,U)=>(Z,K)=>{console.warn(`[${Q}]: ${K} Help: ${U}error#${Z}`)},o7=(Q,U=[1,1])=>{return{x:U[0]*Math.round(Q.x/U[0]),y:U[1]*Math.round(Q.y/U[1])}},n7=({x:Q,y:U},[Z,K,X],W=!1,z=[1,1])=>{let B={x:(Q-Z)/X,y:(U-K)/X};return W?o7(B,z):B},w8=({x:Q,y:U},[Z,K,X])=>{return{x:Q*X+Z,y:U*X+K}};function d7(Q,U){if(typeof Q==="number")return Math.floor((U-U/(1+Q))*0.5);if(typeof Q==="string"&&Q.endsWith("px")){let Z=parseFloat(Q);if(!Number.isNaN(Z))return Math.floor(Z)}if(typeof Q==="string"&&Q.endsWith("%")){let Z=parseFloat(Q);if(!Number.isNaN(Z))return Math.floor(U*Z*0.01)}return console.error(`The padding value "${Q}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function nN(Q,U,Z){if(typeof Q==="string"||typeof Q==="number"){let K=d7(Q,Z),X=d7(Q,U);return{top:K,right:X,bottom:K,left:X,x:X*2,y:K*2}}if(typeof Q==="object"){let K=d7(Q.top??Q.y??0,Z),X=d7(Q.bottom??Q.y??0,Z),W=d7(Q.left??Q.x??0,U),z=d7(Q.right??Q.x??0,U);return{top:K,right:z,bottom:X,left:W,x:W+z,y:K+X}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function eN(Q,U,Z,K,X,W){let{x:z,y:B}=w8(Q,[U,Z,K]),{x:O,y:T}=w8({x:Q.x+Q.width,y:Q.y+Q.height},[U,Z,K]),R=X-O,L=W-T;return{left:Math.floor(z),top:Math.floor(B),right:Math.floor(R),bottom:Math.floor(L)}}var MJ=(Q,U,Z,K,X,W)=>{let z=nN(W,U,Z),B=(U-z.x)/Q.width,O=(Z-z.y)/Q.height,T=Math.min(B,O),R=a7(T,K,X),L=Q.x+Q.width/2,M=Q.y+Q.height/2,f=U/2-L*R,I=Z/2-M*R,D=eN(Q,f,I,R,U,Z),V={left:Math.min(D.left-z.left,0),top:Math.min(D.top-z.top,0),right:Math.min(D.right-z.right,0),bottom:Math.min(D.bottom-z.bottom,0)};return{x:f-V.left+V.right,y:I-V.top+V.bottom,zoom:R}},e7=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function I8(Q){return Q!==void 0&&Q!==null&&Q!=="parent"}function y5(Q){return{width:Q.measured?.width??Q.width??Q.initialWidth??0,height:Q.measured?.height??Q.height??Q.initialHeight??0}}function XX(Q){return(Q.measured?.width??Q.width??Q.initialWidth)!==void 0&&(Q.measured?.height??Q.height??Q.initialHeight)!==void 0}function HX(Q,U={width:0,height:0},Z,K,X){let W={...Q},z=K.get(Z);if(z){let B=z.origin||X;W.x+=z.internals.positionAbsolute.x-(U.width??0)*B[0],W.y+=z.internals.positionAbsolute.y-(U.height??0)*B[1]}return W}function YX(Q,U){if(Q.size!==U.size)return!1;for(let Z of Q)if(!U.has(Z))return!1;return!0}function TM(){let Q,U;return{promise:new Promise((K,X)=>{Q=K,U=X}),resolve:Q,reject:U}}function RM(Q){return{...JX,...Q||{}}}function _C(Q){if(typeof document>"u")return!0;let U=document.querySelector(`.${Q}-flow__pane`);if(!U||!U.isConnected)return!0;let Z=getComputedStyle(U);if(Z.display==="none")return!0;if(Z.visibility==="hidden"||Z.visibility==="collapse")return!0;if(Z.opacity==="0")return!0;if(Z.width==="0"&&Z.height==="0")return!0;let K=U.getBoundingClientRect();if(K.width===0&&K.height===0)return!0;let X=document.querySelector(`.${Q}-flow__attribution`);if(!X||!X.isConnected)return!1;let W=getComputedStyle(X);if(W.display==="none")return!1;if(W.visibility==="hidden"||W.visibility==="collapse")return!1;if(W.opacity==="0")return!1;let z=X.getBoundingClientRect();if(z.width===0&&z.height===0)return!1;return!0}var JM=!1;function OM(Q){if(JM)return;JM=!0;let U=`${Q.charAt(0).toUpperCase()+Q.slice(1)} Flow`;setTimeout(()=>{if(!_C(Q))console.warn(`${U}: It seems like you are hiding the attribution. Please only do this when you are subscribed to ${U} Pro: https://${Q}flow.dev/remove-attr
241
+ %cYou can ignore this warning if you are subscribed.`,"font-style: italic;")},1000)}function WX(Q){return Q===null?null:Q?"valid":"invalid"}function BJ(Q,{snapGrid:U=[0,0],snapToGrid:Z=!1,transform:K,containerBounds:X}){let{x:W,y:z}=D5(Q),B=n7({x:W-(X?.left??0),y:z-(X?.top??0)},K),{x:O,y:T}=Z?o7(B,U):B;return{xSnapped:O,ySnapped:T,...B}}var jq=(Q)=>({width:Q.offsetWidth,height:Q.offsetHeight}),zX=(Q)=>Q?.getRootNode?.()||window?.document,JC=["INPUT","SELECT","TEXTAREA"];function BX(Q){let U=Q.composedPath?.()?.[0]||Q.target;if(U?.nodeType!==1)return!1;return JC.includes(U.nodeName)||U.hasAttribute("contenteditable")||!!U.closest(".nokey")}var AX=(Q)=>("clientX"in Q),D5=(Q,U)=>{let Z=AX(Q),K=Z?Q.clientX:Q.touches?.[0].clientX,X=Z?Q.clientY:Q.touches?.[0].clientY;return{x:K-(U?.left??0),y:X-(U?.top??0)}},$M=(Q,U,Z,K,X)=>{let W=U.querySelectorAll(`.${Q}`);if(!W||!W.length)return null;return Array.from(W).map((z)=>{let B=z.getBoundingClientRect();return{id:z.getAttribute("data-handleid"),type:Q,nodeId:X,position:z.getAttribute("data-handlepos"),x:(B.left-Z.left)/K,y:(B.top-Z.top)/K,...jq(z)}})};function Vq({sourceX:Q,sourceY:U,targetX:Z,targetY:K,sourceControlX:X,sourceControlY:W,targetControlX:z,targetControlY:B}){let O=Q*0.125+X*0.375+z*0.375+Z*0.125,T=U*0.125+W*0.375+B*0.375+K*0.125,R=Math.abs(O-Q),L=Math.abs(T-U);return[O,T,R,L]}function wq(Q,U){if(Q>=0)return 0.5*Q;return U*25*Math.sqrt(-Q)}function QM({pos:Q,x1:U,y1:Z,x2:K,y2:X,c:W}){switch(Q){case C1.Left:return[U-wq(U-K,W),Z];case C1.Right:return[U+wq(K-U,W),Z];case C1.Top:return[U,Z-wq(Z-X,W)];case C1.Bottom:return[U,Z+wq(X-Z,W)]}}function kq({sourceX:Q,sourceY:U,sourcePosition:Z=C1.Bottom,targetX:K,targetY:X,targetPosition:W=C1.Top,curvature:z=0.25}){let[B,O]=QM({pos:Z,x1:Q,y1:U,x2:K,y2:X,c:z}),[T,R]=QM({pos:W,x1:K,y1:X,x2:Q,y2:U,c:z}),[L,M,f,I]=Vq({sourceX:Q,sourceY:U,targetX:K,targetY:X,sourceControlX:B,sourceControlY:O,targetControlX:T,targetControlY:R});return[`M${Q},${U} C${B},${O} ${T},${R} ${K},${X}`,L,M,f,I]}function LX({sourceX:Q,sourceY:U,targetX:Z,targetY:K}){let X=Math.abs(Z-Q)/2,W=Z<Q?Z+X:Z-X,z=Math.abs(K-U)/2,B=K<U?K+z:K-z;return[W,B,X,z]}function wM({sourceNode:Q,targetNode:U,selected:Z=!1,zIndex:K=0,elevateOnSelect:X=!1,zIndexMode:W="basic"}){if(W==="manual")return K;let z=X&&Z?K+1000:K,B=Math.max(Q.parentId||X&&Q.selected?Q.internals.z:0,U.parentId||X&&U.selected?U.internals.z:0);return z+B}function IM({sourceNode:Q,targetNode:U,width:Z,height:K,transform:X}){let W=Cq(fq(Q),fq(U));if(W.x===W.x2)W.x2+=1;if(W.y===W.y2)W.y2+=1;let z={x:-X[0]/X[2],y:-X[1]/X[2],width:Z/X[2],height:K/X[2]};return LJ(z,Sq(W))>0}var $C=({source:Q,sourceHandle:U,target:Z,targetHandle:K})=>`xy-edge__${Q}${U||""}-${Z}${K||""}`,QC=(Q,U)=>{return U.some((Z)=>Z.source===Q.source&&Z.target===Q.target&&(Z.sourceHandle===Q.sourceHandle||!Z.sourceHandle&&!Q.sourceHandle)&&(Z.targetHandle===Q.targetHandle||!Z.targetHandle&&!Q.targetHandle))},fM=(Q,U,Z={})=>{if(!Q.source||!Q.target)return Z.onError?.("006",x2.error006()),U;let K=Z.getEdgeId||$C,X;if(QX(Q))X={...Q};else X={...Q,id:K(Q)};if(QC(X,U))return U;if(X.sourceHandle===null)delete X.sourceHandle;if(X.targetHandle===null)delete X.targetHandle;return U.concat(X)};function Dq({sourceX:Q,sourceY:U,targetX:Z,targetY:K}){let[X,W,z,B]=LX({sourceX:Q,sourceY:U,targetX:Z,targetY:K});return[`M ${Q},${U}L ${Z},${K}`,X,W,z,B]}var qM={[C1.Left]:{x:-1,y:0},[C1.Right]:{x:1,y:0},[C1.Top]:{x:0,y:-1},[C1.Bottom]:{x:0,y:1}},qC=({source:Q,sourcePosition:U=C1.Bottom,target:Z})=>{if(U===C1.Left||U===C1.Right)return Q.x<Z.x?{x:1,y:0}:{x:-1,y:0};return Q.y<Z.y?{x:0,y:1}:{x:0,y:-1}},UM=(Q,U)=>Math.sqrt(Math.pow(U.x-Q.x,2)+Math.pow(U.y-Q.y,2));function UC({source:Q,sourcePosition:U=C1.Bottom,target:Z,targetPosition:K=C1.Top,center:X,offset:W,stepPosition:z}){let B=qM[U],O=qM[K],T={x:Q.x+B.x*W,y:Q.y+B.y*W},R={x:Z.x+O.x*W,y:Z.y+O.y*W},L=qC({source:T,sourcePosition:U,target:R}),M=L.x!==0?"x":"y",f=L[M],I=[],D,V,k={x:0,y:0},h={x:0,y:0},[,,P,C]=LX({sourceX:Q.x,sourceY:Q.y,targetX:Z.x,targetY:Z.y});if(B[M]*O[M]===-1){if(M==="x")D=X.x??T.x+(R.x-T.x)*z,V=X.y??(T.y+R.y)/2;else D=X.x??(T.x+R.x)/2,V=X.y??T.y+(R.y-T.y)*z;let p=[{x:D,y:T.y},{x:D,y:R.y}],a=[{x:T.x,y:V},{x:R.x,y:V}];if(B[M]===f)I=M==="x"?p:a;else I=M==="x"?a:p}else{let p=[{x:T.x,y:R.y}],a=[{x:R.x,y:T.y}];if(M==="x")I=B.x===f?a:p;else I=B.y===f?p:a;if(U===K){let y=Math.abs(Q[M]-Z[M]);if(y<=W){let u=Math.min(W-1,W-y);if(B[M]===f)k[M]=(T[M]>Q[M]?-1:1)*u;else h[M]=(R[M]>Z[M]?-1:1)*u}}if(U!==K){let y=M==="x"?"y":"x",u=B[M]===O[y],x=T[y]>R[y],d=T[y]<R[y];if(B[M]===1&&(!u&&x||u&&d)||B[M]!==1&&(!u&&d||u&&x))I=M==="x"?p:a}let m={x:T.x+k.x,y:T.y+k.y},_1={x:R.x+h.x,y:R.y+h.y},$1=Math.max(Math.abs(m.x-I[0].x),Math.abs(_1.x-I[0].x)),J1=Math.max(Math.abs(m.y-I[0].y),Math.abs(_1.y-I[0].y));if($1>=J1)D=(m.x+_1.x)/2,V=I[0].y;else D=I[0].x,V=(m.y+_1.y)/2}let v={x:T.x+k.x,y:T.y+k.y},b={x:R.x+h.x,y:R.y+h.y};return[[Q,...v.x!==I[0].x||v.y!==I[0].y?[v]:[],...I,...b.x!==I[I.length-1].x||b.y!==I[I.length-1].y?[b]:[],Z],D,V,P,C]}function GC(Q,U,Z,K){let X=Math.min(UM(Q,U)/2,UM(U,Z)/2,K),{x:W,y:z}=U;if(Q.x===W&&W===Z.x||Q.y===z&&z===Z.y)return`L${W} ${z}`;if(Q.y===z){let T=Q.x<Z.x?-1:1,R=Q.y<Z.y?1:-1;return`L ${W+X*T},${z}Q ${W},${z} ${W},${z+X*R}`}let B=Q.x<Z.x?1:-1,O=Q.y<Z.y?-1:1;return`L ${W},${z+X*O}Q ${W},${z} ${W+X*B},${z}`}function TJ({sourceX:Q,sourceY:U,sourcePosition:Z=C1.Bottom,targetX:K,targetY:X,targetPosition:W=C1.Top,borderRadius:z=5,centerX:B,centerY:O,offset:T=20,stepPosition:R=0.5}){let[L,M,f,I,D]=UC({source:{x:Q,y:U},sourcePosition:Z,target:{x:K,y:X},targetPosition:W,center:{x:B,y:O},offset:T,stepPosition:R}),V=`M${L[0].x} ${L[0].y}`;for(let k=1;k<L.length-1;k++)V+=GC(L[k-1],L[k],L[k+1],z);return V+=`L${L[L.length-1].x} ${L[L.length-1].y}`,[V,M,f,I,D]}function GM(Q){return Q&&!!(Q.internals.handleBounds||Q.handles?.length)&&!!(Q.measured.width||Q.width||Q.initialWidth)}function PM(Q){let{sourceNode:U,targetNode:Z}=Q;if(!GM(U)||!GM(Z))return null;let K=U.internals.handleBounds||ZM(U.handles),X=Z.internals.handleBounds||ZM(Z.handles),W=FM(K?.source??[],Q.sourceHandle),z=FM(Q.connectionMode===A6.Strict?X?.target??[]:(X?.target??[]).concat(X?.source??[]),Q.targetHandle);if(!W||!z)return Q.onError?.("008",x2.error008(!W?"source":"target",{id:Q.id,sourceHandle:Q.sourceHandle,targetHandle:Q.targetHandle})),null;let B=W?.position||C1.Bottom,O=z?.position||C1.Top,T=L6(U,W,B),R=L6(Z,z,O);return{sourceX:T.x,sourceY:T.y,targetX:R.x,targetY:R.y,sourcePosition:B,targetPosition:O}}function ZM(Q){if(!Q)return null;let U=[],Z=[];for(let K of Q)if(K.width=K.width??1,K.height=K.height??1,K.type==="source")U.push(K);else if(K.type==="target")Z.push(K);return{source:U,target:Z}}function L6(Q,U,Z=C1.Left,K=!1){let X=(U?.x??0)+Q.internals.positionAbsolute.x,W=(U?.y??0)+Q.internals.positionAbsolute.y,{width:z,height:B}=U??y5(Q);if(K)return{x:X+z/2,y:W+B/2};switch(U?.position??Z){case C1.Top:return{x:X+z/2,y:W};case C1.Right:return{x:X+z,y:W+B/2};case C1.Bottom:return{x:X+z/2,y:W+B};case C1.Left:return{x:X,y:W+B/2}}}function FM(Q,U){if(!Q)return null;return(!U?Q[0]:Q.find((Z)=>Z.id===U))||null}function yq(Q,U){if(!Q)return"";if(typeof Q==="string")return Q;return`${U?`${U}__`:""}${Object.keys(Q).sort().map((K)=>`${K}=${Q[K]}`).join("&")}`}function NM(Q,{id:U,defaultColor:Z,defaultMarkerStart:K,defaultMarkerEnd:X}){let W=new Set;return Q.reduce((z,B)=>{return[B.markerStart||K,B.markerEnd||X].forEach((O)=>{if(O&&typeof O==="object"){let T=yq(O,U);if(!W.has(T))z.push({id:T,color:O.color||Z,...O}),W.add(T)}}),z},[]).sort((z,B)=>z.id.localeCompare(B.id))}function CM(Q,U,Z,K,X){let W=0.5;if(X==="start")W=0;else if(X==="end")W=1;let z=[(Q.x+Q.width*W)*U.zoom+U.x,Q.y*U.zoom+U.y-K],B=[-100*W,-100];switch(Z){case C1.Right:z=[(Q.x+Q.width)*U.zoom+U.x+K,(Q.y+Q.height*W)*U.zoom+U.y],B=[0,-100*W];break;case C1.Bottom:z[1]=(Q.y+Q.height)*U.zoom+U.y+K,B[1]=0;break;case C1.Left:z=[Q.x*U.zoom+U.x-K,(Q.y+Q.height*W)*U.zoom+U.y],B=[-100,-100*W];break}return`translate(${z[0]}px, ${z[1]}px) translate(${B[0]}%, ${B[1]}%)`}var SM=1000,ZC=10,MX={nodeOrigin:[0,0],nodeExtent:s7,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},FC={...MX,checkEquality:!0};function TX(Q,U){let Z={...Q};for(let K in U)if(U[K]!==void 0)Z[K]=U[K];return Z}function jM(Q,U,Z){let K=TX(MX,Z);for(let X of Q.values())if(X.parentId)OX(X,Q,U,K);else{let W=AJ(X,K.nodeOrigin),z=I8(X.extent)?X.extent:K.nodeExtent,B=O8(W,z,y5(X));X.internals.positionAbsolute=B}}function KC(Q,U){if(!Q.handles)return!Q.measured?void 0:U?.internals.handleBounds;let Z=[],K=[];for(let X of Q.handles){let W={id:X.id,width:X.width??1,height:X.height??1,nodeId:Q.id,x:X.x,y:X.y,position:X.position,type:X.type};if(X.type==="source")Z.push(W);else if(X.type==="target")K.push(W)}return{source:Z,target:K}}function RX(Q){return Q==="manual"}function vq(Q,U,Z,K={}){let X=TX(FC,K),W={i:0},z=new Map(U),B=X?.elevateNodesOnSelect&&!RX(X.zIndexMode)?SM:0,O=Q.length>0,T=!1;U.clear(),Z.clear();for(let R of Q){let L=z.get(R.id);if(X.checkEquality&&R===L?.internals.userNode)U.set(R.id,L);else{let M=AJ(R,X.nodeOrigin),f=I8(R.extent)?R.extent:X.nodeExtent,I=O8(M,f,y5(R));L={...X.defaults,...R,measured:{width:R.measured?.width,height:R.measured?.height},internals:{positionAbsolute:I,handleBounds:KC(R,L),z:VM(R,B,X.zIndexMode),userNode:R}},U.set(R.id,L)}if((L.measured===void 0||L.measured.width===void 0||L.measured.height===void 0)&&!L.hidden)O=!1;if(R.parentId)OX(L,U,Z,K,W);T||=R.selected??!1}return{nodesInitialized:O,hasSelectedNodes:T}}function XC(Q,U){if(!Q.parentId)return;let Z=U.get(Q.parentId);if(Z)Z.set(Q.id,Q);else U.set(Q.parentId,new Map([[Q.id,Q]]))}function OX(Q,U,Z,K,X){let{elevateNodesOnSelect:W,nodeOrigin:z,nodeExtent:B,zIndexMode:O}=TX(MX,K),T=Q.parentId,R=U.get(T);if(!R){console.warn(`Parent node ${T} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}if(XC(Q,Z),X&&!R.parentId&&R.internals.rootParentIndex===void 0&&O==="auto")R.internals.rootParentIndex=++X.i,R.internals.z=R.internals.z+X.i*ZC;if(X&&R.internals.rootParentIndex!==void 0)X.i=R.internals.rootParentIndex;let L=W&&!RX(O)?SM:0,{x:M,y:f,z:I}=HC(Q,R,z,B,L,O),{positionAbsolute:D}=Q.internals,V=M!==D.x||f!==D.y;if(V||I!==Q.internals.z)U.set(Q.id,{...Q,internals:{...Q.internals,positionAbsolute:V?{x:M,y:f}:D,z:I}})}function VM(Q,U,Z){let K=k5(Q.zIndex)?Q.zIndex:0;if(RX(Z))return K;return K+(Q.selected?U:0)}function HC(Q,U,Z,K,X,W){let{x:z,y:B}=U.internals.positionAbsolute,O=y5(Q),T=AJ(Q,Z),R=I8(Q.extent)?O8(T,Q.extent,O):T,L=O8({x:z+R.x,y:B+R.y},K,O);if(Q.extent==="parent")L=LM(L,O,U);let M=VM(Q,X,W),f=U.internals.z??0;return{x:L.x,y:L.y,z:f>=M?f+1:M}}function Eq(Q,U,Z,K=[0,0]){let X=[],W=new Map;for(let z of Q){let B=U.get(z.parentId);if(!B)continue;let O=W.get(z.parentId)?.expandedRect??t7(B),T=ZX(O,z.rect);W.set(z.parentId,{expandedRect:T,parent:B})}if(W.size>0)W.forEach(({expandedRect:z,parent:B},O)=>{let T=B.internals.positionAbsolute,R=y5(B),L=B.origin??K,M=z.x<T.x?Math.round(Math.abs(T.x-z.x)):0,f=z.y<T.y?Math.round(Math.abs(T.y-z.y)):0,I=Math.max(R.width,Math.round(z.width)),D=Math.max(R.height,Math.round(z.height)),V=(I-R.width)*L[0],k=(D-R.height)*L[1];if(M>0||f>0||V||k)X.push({id:O,type:"position",position:{x:B.position.x-M+V,y:B.position.y-f+k}}),Z.get(O)?.forEach((h)=>{if(!Q.some((P)=>P.id===h.id))X.push({id:h.id,type:"position",position:{x:h.position.x+M,y:h.position.y+f}})});if(R.width<z.width||R.height<z.height||M||f)X.push({id:O,type:"dimensions",setAttributes:!0,dimensions:{width:I+(M?L[0]*M-V:0),height:D+(f?L[1]*f-k:0)}})});return X}function kM(Q,U,Z,K,X,W,z){let B=K?.querySelector(".xyflow__viewport"),O=!1;if(!B)return{changes:[],updatedInternals:O};let T=[],R=window.getComputedStyle(B),{m22:L}=new window.DOMMatrixReadOnly(R.transform),M=[];for(let f of Q.values()){let I=U.get(f.id);if(!I)continue;if(I.hidden){U.set(I.id,{...I,internals:{...I.internals,handleBounds:void 0}}),O=!0;continue}let D=jq(f.nodeElement),V=I.measured.width!==D.width||I.measured.height!==D.height;if(!!(D.width&&D.height&&(V||!I.internals.handleBounds||f.force))){let h=f.nodeElement.getBoundingClientRect(),P=I8(I.extent)?I.extent:W,{positionAbsolute:C}=I.internals;if(I.parentId&&I.extent==="parent"){let b=U.get(I.parentId);if(b)C=LM(C,D,b)}else if(P)C=O8(C,P,D);let v={...I,measured:D,internals:{...I.internals,positionAbsolute:C,handleBounds:{source:$M("source",f.nodeElement,h,L,I.id),target:$M("target",f.nodeElement,h,L,I.id)}}};if(U.set(I.id,v),I.parentId)OX(v,U,Z,{nodeOrigin:X,zIndexMode:z});if(O=!0,V){if(T.push({id:I.id,type:"dimensions",dimensions:D}),I.expandParent&&I.parentId)M.push({id:I.id,parentId:I.parentId,rect:t7(v,X)})}}}if(M.length>0){let f=Eq(M,U,Z,X);T.push(...f)}return{changes:T,updatedInternals:O}}async function DM({delta:Q,panZoom:U,transform:Z,translateExtent:K,width:X,height:W}){if(!U||!Q.x&&!Q.y)return!1;let z=await U.setViewportConstrained({x:Z[0]+Q.x,y:Z[1]+Q.y,zoom:Z[2]},[[0,0],[X,W]],K);return!!z&&(z.x!==Z[0]||z.y!==Z[1]||z.k!==Z[2])}function KM(Q,U,Z,K,X,W){let z=X,B=K.get(z)||new Map;K.set(z,B.set(Z,U)),z=`${X}-${Q}`;let O=K.get(z)||new Map;if(K.set(z,O.set(Z,U)),W){z=`${X}-${Q}-${W}`;let T=K.get(z)||new Map;K.set(z,T.set(Z,U))}}function wX(Q,U,Z){Q.clear(),U.clear();for(let K of Z){let{source:X,target:W,sourceHandle:z=null,targetHandle:B=null}=K,O={edgeId:K.id,source:X,target:W,sourceHandle:z,targetHandle:B},T=`${X}-${z}--${W}-${B}`,R=`${W}-${B}--${X}-${z}`;KM("source",O,R,Q,X,z),KM("target",O,T,Q,W,B),U.set(K.id,K)}}function yM(Q,U){if(!Q.parentId)return!1;let Z=U.get(Q.parentId);if(!Z)return!1;if(Z.selected)return!0;return yM(Z,U)}function XM(Q,U,Z){let K=Q;do{if(K?.matches?.(U))return!0;if(K===Z)return!1;K=K?.parentElement}while(K);return!1}function YC(Q,U,Z,K){let X=new Map;for(let[W,z]of Q)if((z.selected||z.id===K)&&(!z.parentId||!yM(z,Q))&&(z.draggable||U&&typeof z.draggable>"u")){let B=Q.get(W);if(B)X.set(W,{id:W,position:B.position||{x:0,y:0},distance:{x:Z.x-B.internals.positionAbsolute.x,y:Z.y-B.internals.positionAbsolute.y},extent:B.extent,parentId:B.parentId,origin:B.origin,expandParent:B.expandParent,internals:{positionAbsolute:B.internals.positionAbsolute||{x:0,y:0}},measured:{width:B.measured.width??0,height:B.measured.height??0}})}return X}function tK({nodeId:Q,dragItems:U,nodeLookup:Z,dragging:K=!0}){let X=[];for(let[z,B]of U){let O=Z.get(z)?.internals.userNode;if(O)X.push({...O,position:B.position,dragging:K})}if(!Q)return[X[0],X];let W=Z.get(Q)?.internals.userNode;return[!W?X[0]:{...W,position:U.get(Q)?.position||W.position,dragging:K},X]}function WC({dragItems:Q,snapGrid:U,x:Z,y:K}){let X=Q.values().next().value;if(!X)return null;let W={x:Z-X.distance.x,y:K-X.distance.y},z=o7(W,U);return{x:z.x-W.x,y:z.y-W.y}}function vM({onNodeMouseDown:Q,getStoreItems:U,onDragStart:Z,onDrag:K,onDragStop:X}){let W={x:null,y:null},z=0,B=new Map,O=!1,T={x:0,y:0},R=null,L=!1,M=null,f=!1,I=!1,D=null;function V({noDragClassName:h,handleSelector:P,domNode:C,isSelectable:v,nodeId:b,nodeClickDistance:E=0}){M=n0(C);function p({x:$1,y:J1}){let{nodeLookup:y,nodeExtent:u,snapGrid:x,snapToGrid:d,nodeOrigin:g,onNodeDrag:n,onSelectionDrag:j,onError:i,updateNodePositions:q1}=U();W={x:$1,y:J1};let Q1=!1,Y1=B.size>1,L1=Y1&&u?eK(f8(B)):null,M1=Y1&&d?WC({dragItems:B,snapGrid:x,x:$1,y:J1}):null;for(let[I1,X1]of B){if(!y.has(I1))continue;let f1={x:$1-X1.distance.x,y:J1-X1.distance.y};if(d)f1=M1?{x:Math.round(f1.x+M1.x),y:Math.round(f1.y+M1.y)}:o7(f1,x);let l1=null;if(Y1&&u&&!X1.extent&&L1){let{positionAbsolute:v1}=X1.internals,c1=v1.x-L1.x+u[0][0],E1=v1.x+X1.measured.width-L1.x2+u[1][0],j1=v1.y-L1.y+u[0][1],V0=v1.y+X1.measured.height-L1.y2+u[1][1];l1=[[c1,j1],[E1,V0]]}let{position:W1,positionAbsolute:S1}=GX({nodeId:I1,nextPosition:f1,nodeLookup:y,nodeExtent:l1?l1:u,nodeOrigin:g,onError:i});Q1=Q1||X1.position.x!==W1.x||X1.position.y!==W1.y,X1.position=W1,X1.internals.positionAbsolute=S1}if(I=I||Q1,!Q1)return;if(q1(B,!0),D&&(K||n||!b&&j)){let[I1,X1]=tK({nodeId:b,dragItems:B,nodeLookup:y});if(K?.(D,B,I1,X1),n?.(D,I1,X1),!b)j?.(D,X1)}}async function a(){if(!R)return;let{transform:$1,panBy:J1,autoPanSpeed:y,autoPanOnNodeDrag:u}=U();if(!u){O=!1,cancelAnimationFrame(z);return}let[x,d]=Nq(T,R,y);if(x!==0||d!==0){if(W.x=(W.x??0)-x/$1[2],W.y=(W.y??0)-d/$1[2],await J1({x,y:d}))p(W)}z=requestAnimationFrame(a)}function m($1){let{nodeLookup:J1,multiSelectionActive:y,nodesDraggable:u,transform:x,snapGrid:d,snapToGrid:g,selectNodesOnDrag:n,onNodeDragStart:j,onSelectionDragStart:i,unselectNodesAndEdges:q1}=U();if(L=!0,(!n||!v)&&!y&&b){if(!J1.get(b)?.selected)q1()}if(v&&n&&b)Q?.(b);let Q1=BJ($1.sourceEvent,{transform:x,snapGrid:d,snapToGrid:g,containerBounds:R});if(W=Q1,B=YC(J1,u,Q1,b),B.size>0&&(Z||j||!b&&i)){let[Y1,L1]=tK({nodeId:b,dragItems:B,nodeLookup:J1});if(Z?.($1.sourceEvent,B,Y1,L1),j?.($1.sourceEvent,Y1,L1),!b)i?.($1.sourceEvent,L1)}}let _1=t_().clickDistance(E).on("start",($1)=>{let{domNode:J1,nodeDragThreshold:y,transform:u,snapGrid:x,snapToGrid:d}=U();if(R=J1?.getBoundingClientRect()||null,f=!1,I=!1,D=$1.sourceEvent,y===0)m($1);W=BJ($1.sourceEvent,{transform:u,snapGrid:x,snapToGrid:d,containerBounds:R}),T=D5($1.sourceEvent,R)}).on("drag",($1)=>{let{autoPanOnNodeDrag:J1,transform:y,snapGrid:u,snapToGrid:x,nodeDragThreshold:d,nodeLookup:g}=U(),n=BJ($1.sourceEvent,{transform:y,snapGrid:u,snapToGrid:x,containerBounds:R});if(D=$1.sourceEvent,$1.sourceEvent.type==="touchmove"&&$1.sourceEvent.touches.length>1||b&&!g.has(b))f=!0;if(f)return;if(!O&&J1&&L)O=!0,a();if(!L){let j=D5($1.sourceEvent,R),i=j.x-T.x,q1=j.y-T.y;if(Math.sqrt(i*i+q1*q1)>d)m($1)}if((W.x!==n.xSnapped||W.y!==n.ySnapped)&&B&&L)T=D5($1.sourceEvent,R),p(n)}).on("end",($1)=>{if(!L||f){if(f&&B.size>0)U().updateNodePositions(B,!1);return}if(O=!1,L=!1,cancelAnimationFrame(z),B.size>0){let{nodeLookup:J1,updateNodePositions:y,onNodeDragStop:u,onSelectionDragStop:x}=U();if(I)y(B,!1),I=!1;if(X||u||!b&&x){let[d,g]=tK({nodeId:b,dragItems:B,nodeLookup:J1,dragging:!1});if(X?.($1.sourceEvent,B,d,g),u?.($1.sourceEvent,d,g),!b)x?.($1.sourceEvent,g)}}}).filter(($1)=>{let J1=$1.target;return!$1.button&&(!h||!XM(J1,`.${h}`,C))&&(!P||XM(J1,P,C))});M.call(_1)}function k(){M?.on(".drag",null)}return{update:V,destroy:k}}function zC(Q,U,Z){let K=[],X={x:Q.x-Z,y:Q.y-Z,width:Z*2,height:Z*2};for(let W of U.values())if(LJ(X,t7(W))>0)K.push(W);return K}var BC=250;function AC(Q,U,Z,K){let X=[],W=1/0,z=zC(Q,Z,U+BC);for(let B of z){let O=[...B.internals.handleBounds?.source??[],...B.internals.handleBounds?.target??[]];for(let T of O){if(K.nodeId===T.nodeId&&K.type===T.type&&K.id===T.id)continue;let{x:R,y:L}=L6(B,T,T.position,!0),M=Math.sqrt(Math.pow(R-Q.x,2)+Math.pow(L-Q.y,2));if(M>U)continue;if(M<W)X=[{...T,x:R,y:L}],W=M;else if(M===W)X.push({...T,x:R,y:L})}}if(!X.length)return null;if(X.length>1){let B=K.type==="source"?"target":"source";return X.find((O)=>O.type===B)??X[0]}return X[0]}function EM(Q,U,Z,K,X,W=!1){let z=K.get(Q);if(!z)return null;let B=X==="strict"?z.internals.handleBounds?.[U]:[...z.internals.handleBounds?.source??[],...z.internals.handleBounds?.target??[]],O=(Z?B?.find((T)=>T.id===Z):B?.[0])??null;return O&&W?{...O,...L6(z,O,O.position,!0)}:O}function bM(Q,U){if(Q)return Q;else if(U?.classList.contains("target"))return"target";else if(U?.classList.contains("source"))return"source";return null}function LC(Q,U){let Z=null;if(U)Z=!0;else if(Q&&!U)Z=!1;return Z}var uM=()=>!0;function MC(Q,{connectionMode:U,connectionRadius:Z,handleId:K,nodeId:X,edgeUpdaterType:W,isTarget:z,domNode:B,nodeLookup:O,lib:T,autoPanOnConnect:R,flowId:L,panBy:M,cancelConnection:f,onConnectStart:I,onConnect:D,onConnectEnd:V,isValidConnection:k=uM,onReconnectEnd:h,updateConnection:P,getTransform:C,getFromHandle:v,autoPanSpeed:b,dragThreshold:E=1,handleDomNode:p}){let a=zX(Q.target),m=0,_1,{x:$1,y:J1}=D5(Q),y=bM(W,p),u=B?.getBoundingClientRect(),x=!1;if(!u||!y)return;let d=EM(X,y,K,O,U);if(!d)return;let g=D5(Q,u),n=!1,j=null,i=!1,q1=null;function Q1(){if(!R||!u)return;let[W1,S1]=Nq(g,u,b);M({x:W1,y:S1}),m=requestAnimationFrame(Q1)}let Y1={...d,nodeId:X,type:y,position:d.position},L1=O.get(X),I1={inProgress:!0,isValid:null,from:L6(L1,Y1,C1.Left,!0),fromHandle:Y1,fromPosition:Y1.position,fromNode:L1,to:g,toHandle:null,toPosition:eL[Y1.position],toNode:null,pointer:g};function X1(){x=!0,P(I1),I?.(Q,{nodeId:X,handleId:K,handleType:y})}if(E===0)X1();function f1(W1){if(!x){let{x:V0,y:b1}=D5(W1),Z2=V0-$1,_0=b1-J1;if(!(Z2*Z2+_0*_0>E*E))return;X1()}if(!v()||!Y1){l1(W1);return}let S1=C();if(g=D5(W1,u),_1=AC(n7(g,S1,!1,[1,1]),Z,O,Y1),!n)Q1(),n=!0;let v1=xM(W1,{handle:_1,connectionMode:U,fromNodeId:X,fromHandleId:K,fromType:z?"target":"source",isValidConnection:k,doc:a,lib:T,flowId:L,nodeLookup:O});q1=v1.handleDomNode,j=v1.connection,i=LC(!!_1,v1.isValid);let c1=O.get(X),E1=c1?L6(c1,Y1,C1.Left,!0):I1.from,j1={...I1,from:E1,isValid:i,to:v1.toHandle&&i?w8({x:v1.toHandle.x,y:v1.toHandle.y},S1):g,toHandle:v1.toHandle,toPosition:i&&v1.toHandle?v1.toHandle.position:eL[Y1.position],toNode:v1.toHandle?O.get(v1.toHandle.nodeId):null,pointer:g};P(j1),I1=j1}function l1(W1){if("touches"in W1&&W1.touches.length>0)return;if(x){if((_1||q1)&&j&&i)D?.(j);let{inProgress:S1,...v1}=I1,c1={...v1,toPosition:I1.toHandle?I1.toPosition:null};if(V?.(W1,c1),W)h?.(W1,c1)}f(),cancelAnimationFrame(m),n=!1,i=!1,j=null,q1=null,a.removeEventListener("mousemove",f1),a.removeEventListener("mouseup",l1),a.removeEventListener("touchmove",f1),a.removeEventListener("touchend",l1)}a.addEventListener("mousemove",f1),a.addEventListener("mouseup",l1),a.addEventListener("touchmove",f1),a.addEventListener("touchend",l1)}function xM(Q,{handle:U,connectionMode:Z,fromNodeId:K,fromHandleId:X,fromType:W,doc:z,lib:B,flowId:O,isValidConnection:T=uM,nodeLookup:R}){let L=W==="target",M=U?z.querySelector(`.${B}-flow__handle[data-id="${O}-${U?.nodeId}-${U?.id}-${U?.type}"]`):null,{x:f,y:I}=D5(Q),D=z.elementFromPoint(f,I),V=D?.classList.contains(`${B}-flow__handle`)?D:M,k={handleDomNode:V,isValid:!1,connection:null,toHandle:null};if(V){let h=bM(void 0,V),P=V.getAttribute("data-nodeid"),C=V.getAttribute("data-handleid"),v=V.classList.contains("connectable"),b=V.classList.contains("connectableend");if(!P||!h)return k;let E={source:L?P:K,sourceHandle:L?C:X,target:L?K:P,targetHandle:L?X:C};k.connection=E;let a=v&&b&&(Z===A6.Strict?L&&h==="source"||!L&&h==="target":P!==K||C!==X);k.isValid=a&&T(E),k.toHandle=EM(P,h,C,R,Z,!0)}return k}var bq={onPointerDown:MC,isValid:xM};function hM({domNode:Q,panZoom:U,getTransform:Z,getViewScale:K}){let X=n0(Q);function W({translateExtent:B,width:O,height:T,zoomStep:R=1,pannable:L=!0,zoomable:M=!0,inversePan:f=!1}){let I=(P)=>{if(P.sourceEvent.type!=="wheel"||!U)return;let C=Z(),v=P.sourceEvent.ctrlKey&&e7()?10:1,b=-P.sourceEvent.deltaY*(P.sourceEvent.deltaMode===1?0.05:P.sourceEvent.deltaMode?1:0.002)*R,E=C[2]*Math.pow(2,b*v);U.scaleTo(E)},D=[0,0],V=(P)=>{if(P.sourceEvent.type==="mousedown"||P.sourceEvent.type==="touchstart")D=[P.sourceEvent.clientX??P.sourceEvent.touches[0].clientX,P.sourceEvent.clientY??P.sourceEvent.touches[0].clientY]},k=(P)=>{let C=Z();if(P.sourceEvent.type!=="mousemove"&&P.sourceEvent.type!=="touchmove"||!U)return;let v=[P.sourceEvent.clientX??P.sourceEvent.touches[0].clientX,P.sourceEvent.clientY??P.sourceEvent.touches[0].clientY],b=[v[0]-D[0],v[1]-D[1]];D=v;let E=K()*Math.max(C[2],Math.log(C[2]))*(f?-1:1),p={x:C[0]-b[0]*E,y:C[1]-b[1]*E},a=[[0,0],[O,T]];U.setViewportConstrained({x:p.x,y:p.y,zoom:C[2]},a,B)},h=zJ().on("start",V).on("zoom",L?k:null).on("zoom.wheel",M?I:null);X.call(h,{})}function z(){X.on("zoom",null)}return{update:W,destroy:z,pointer:O2}}var uq=(Q)=>({x:Q.x,y:Q.y,zoom:Q.k}),oK=({x:Q,y:U,zoom:Z})=>M8.translate(Q,U).scale(Z),B6=(Q,U)=>Q.target.closest(`.${U}`),mM=(Q,U)=>U===2&&Array.isArray(Q)&&Q.includes(2),TC=(Q)=>((Q*=2)<=1?Q*Q*Q:(Q-=2)*Q*Q+2)/2,nK=(Q,U=0,Z=TC,K=()=>{})=>{let X=typeof U==="number"&&U>0;if(!X)K();return X?Q.transition().duration(U).ease(Z).on("end",K):Q},gM=(Q)=>{let U=Q.ctrlKey&&e7()?10:1;return-Q.deltaY*(Q.deltaMode===1?0.05:Q.deltaMode?1:0.002)*U};function RC({zoomPanValues:Q,noWheelClassName:U,d3Selection:Z,d3Zoom:K,panOnScrollMode:X,panOnScrollSpeed:W,zoomOnPinch:z,onPanZoomStart:B,onPanZoom:O,onPanZoomEnd:T}){return(R)=>{if(B6(R,U)){if(R.ctrlKey)R.preventDefault();return!1}R.preventDefault(),R.stopImmediatePropagation();let L=Z.property("__zoom").k||1;if(R.ctrlKey&&z){let V=O2(R),k=gM(R),h=L*Math.pow(2,k);K.scaleTo(Z,h,V,R);return}let M=R.deltaMode===1?20:1,f=X===B3.Vertical?0:R.deltaX*M,I=X===B3.Horizontal?0:R.deltaY*M;if(!e7()&&R.shiftKey&&X!==B3.Vertical)f=R.deltaY*M,I=0;K.translateBy(Z,-(f/L)*W,-(I/L)*W,{internal:!0});let D=uq(Z.property("__zoom"));if(clearTimeout(Q.panScrollTimeout),!Q.isPanScrolling)Q.isPanScrolling=!0,B?.(R,D);else O?.(R,D);Q.panScrollTimeout=setTimeout(()=>{T?.(R,D),Q.isPanScrolling=!1},150)}}function OC({noWheelClassName:Q,preventScrolling:U,d3ZoomHandler:Z}){return function(K,X){let W=K.type==="wheel",z=!U&&W&&!K.ctrlKey,B=B6(K,Q);if(K.ctrlKey&&W&&B)K.preventDefault();if(z||B)return null;K.preventDefault(),Z.call(this,K,X)}}function wC({zoomPanValues:Q,onDraggingChange:U,onPanZoomStart:Z}){return(K)=>{if(K.sourceEvent?.internal)return;let X=uq(K.transform);if(Q.mouseButton=K.sourceEvent?.button||0,Q.isZoomingOrPanning=!0,Q.prevViewport=X,K.sourceEvent?.type==="mousedown")U(!0);if(Z)Z?.(K.sourceEvent,X)}}function IC({zoomPanValues:Q,panOnDrag:U,onPaneContextMenu:Z,onTransformChange:K,onPanZoom:X}){return(W)=>{if(Q.usedRightMouseButton=!!(Z&&mM(U,Q.mouseButton??0)),!W.sourceEvent?.sync)K([W.transform.x,W.transform.y,W.transform.k]);if(X&&!W.sourceEvent?.internal)X?.(W.sourceEvent,uq(W.transform))}}function fC({zoomPanValues:Q,panOnDrag:U,panOnScroll:Z,onDraggingChange:K,onPanZoomEnd:X,onPaneContextMenu:W}){return(z)=>{if(z.sourceEvent?.internal)return;if(Q.isZoomingOrPanning=!1,W&&mM(U,Q.mouseButton??0)&&!Q.usedRightMouseButton&&z.sourceEvent)W(z.sourceEvent);if(Q.usedRightMouseButton=!1,K(!1),X){let B=uq(z.transform);Q.prevViewport=B,clearTimeout(Q.timerId),Q.timerId=setTimeout(()=>{X?.(z.sourceEvent,B)},Z?150:0)}}}function PC({panActivationKeyPressed:Q,zoomActivationKeyPressed:U,zoomOnScroll:Z,zoomOnPinch:K,panOnDrag:X,panOnScroll:W,zoomOnDoubleClick:z,userSelectionActive:B,noWheelClassName:O,noPanClassName:T,lib:R,connectionInProgress:L}){return(M)=>{let f=U||Z,I=K&&M.ctrlKey,D=M.type==="wheel";if(M.button===1&&M.type==="mousedown"&&(B6(M,`${R}-flow__node`)||B6(M,`${R}-flow__edge`)||B6(M,`${R}-flow__selection`)||B6(M,`${R}-flow__nodesselection`)))return!0;if(!X&&!f&&!W&&!z&&!K)return!1;if(B)return!1;if(L&&!D)return!1;if(B6(M,O)&&D)return!1;if(B6(M,T)&&(!D||W&&D&&!U))return!1;if(!K&&M.ctrlKey&&D)return!1;if(!K&&M.type==="touchstart"&&M.touches?.length>1)return M.preventDefault(),!1;if(!f&&!W&&!I&&D)return!1;if(!X&&(M.type==="mousedown"||M.type==="touchstart"))return!1;if(Array.isArray(X)&&!X.includes(M.button)&&M.type==="mousedown")return!1;let V=Array.isArray(X)&&X.includes(M.button)||!M.button||M.button<=1;return(!M.ctrlKey||D||Q)&&V}}function pM({domNode:Q,minZoom:U,maxZoom:Z,translateExtent:K,viewport:X,onPanZoom:W,onPanZoomStart:z,onPanZoomEnd:B,onDraggingChange:O}){let T={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},R=Q.getBoundingClientRect(),L=[[0,0],[R.width,R.height]];(typeof ResizeObserver<"u"?new ResizeObserver((J1)=>{let y=J1[0];if(y)L=[[0,0],[y.contentRect.width,y.contentRect.height]]}):null)?.observe(Q);let f=zJ().extent(()=>L).scaleExtent([U,Z]).translateExtent(K),I=n0(Q).call(f);C({x:X.x,y:X.y,zoom:a7(X.zoom,U,Z)},[[0,0],[R.width,R.height]],K);let D=I.on("wheel.zoom"),V=I.on("dblclick.zoom");f.wheelDelta(gM);async function k(J1,y){if(I)return new Promise((u)=>{f?.interpolate(y?.interpolate==="linear"?D4:A8).transform(nK(I,y?.duration,y?.ease,()=>u(!0)),J1)});return!1}function h({noWheelClassName:J1,noPanClassName:y,onPaneContextMenu:u,userSelectionActive:x,panOnScroll:d,panOnDrag:g,panOnScrollMode:n,panOnScrollSpeed:j,preventScrolling:i,zoomOnPinch:q1,zoomOnScroll:Q1,zoomOnDoubleClick:Y1,panActivationKeyPressed:L1=!1,zoomActivationKeyPressed:M1,lib:I1,onTransformChange:X1,connectionInProgress:f1,paneClickDistance:l1,selectionOnDrag:W1}){if(x&&!T.isZoomingOrPanning)P();let S1=d&&!M1&&!x;f.clickDistance(W1?1/0:!k5(l1)||l1<0?0:l1);let v1=S1?RC({zoomPanValues:T,noWheelClassName:J1,d3Selection:I,d3Zoom:f,panOnScrollMode:n,panOnScrollSpeed:j,zoomOnPinch:q1,onPanZoomStart:z,onPanZoom:W,onPanZoomEnd:B}):OC({noWheelClassName:J1,preventScrolling:i,d3ZoomHandler:D});I.on("wheel.zoom",v1,{passive:!1});let c1=wC({zoomPanValues:T,onDraggingChange:O,onPanZoomStart:z});f.on("start",c1);let E1=IC({zoomPanValues:T,panOnDrag:g,onPaneContextMenu:!!u,onPanZoom:W,onTransformChange:X1});f.on("zoom",E1);let j1=fC({zoomPanValues:T,panOnDrag:g,panOnScroll:d,onPaneContextMenu:u,onPanZoomEnd:B,onDraggingChange:O});f.on("end",j1);let V0=PC({panActivationKeyPressed:L1,zoomActivationKeyPressed:M1,panOnDrag:g,zoomOnScroll:Q1,panOnScroll:d,zoomOnDoubleClick:Y1,zoomOnPinch:q1,userSelectionActive:x,noPanClassName:y,noWheelClassName:J1,lib:I1,connectionInProgress:f1});if(f.filter(V0),Y1)I.on("dblclick.zoom",V);else I.on("dblclick.zoom",null)}function P(){f.on("zoom",null)}async function C(J1,y,u){let x=oK(J1),d=f?.constrain()(x,y,u);if(d)await k(d);return d}async function v(J1,y){let u=oK(J1);return await k(u,y),u}function b(J1){if(I){let y=oK(J1),u=I.property("__zoom");if(u.k!==J1.zoom||u.x!==J1.x||u.y!==J1.y)f?.transform(I,y,null,{sync:!0})}}function E(){let J1=I?WJ(I.node()):{x:0,y:0,k:1};return{x:J1.x,y:J1.y,zoom:J1.k}}async function p(J1,y){if(I)return new Promise((u)=>{f?.interpolate(y?.interpolate==="linear"?D4:A8).scaleTo(nK(I,y?.duration,y?.ease,()=>u(!0)),J1)});return!1}async function a(J1,y){if(I)return new Promise((u)=>{f?.interpolate(y?.interpolate==="linear"?D4:A8).scaleBy(nK(I,y?.duration,y?.ease,()=>u(!0)),J1)});return!1}function m(J1){f?.scaleExtent(J1)}function _1(J1){f?.translateExtent(J1)}function $1(J1){let y=!k5(J1)||J1<0?0:J1;f?.clickDistance(y)}return{update:h,destroy:P,setViewport:v,setViewportConstrained:C,getViewport:E,scaleTo:p,scaleBy:a,setScaleExtent:m,setTranslateExtent:_1,syncViewport:b,setClickDistance:$1}}var M6;(function(Q){Q.Line="line",Q.Handle="handle"})(M6||(M6={}));function NC({width:Q,prevWidth:U,height:Z,prevHeight:K,affectsX:X,affectsY:W}){let z=Q-U,B=Z-K,O=[z>0?1:z<0?-1:0,B>0?1:B<0?-1:0];if(z&&X)O[0]=O[0]*-1;if(B&&W)O[1]=O[1]*-1;return O}function HM(Q){let U=Q.includes("right")||Q.includes("left"),Z=Q.includes("bottom")||Q.includes("top"),K=Q.includes("left"),X=Q.includes("top");return{isHorizontal:U,isVertical:Z,affectsX:K,affectsY:X}}function W6(Q,U){return Math.max(0,U-Q)}function z6(Q,U){return Math.max(0,Q-U)}function Iq(Q,U,Z){return Math.max(0,U-Q,Q-Z)}function YM(Q,U){return Q?!U:U}function CC(Q,U,Z,K,X,W,z,B){let{affectsX:O,affectsY:T}=U,{isHorizontal:R,isVertical:L}=U,M=R&&L,{xSnapped:f,ySnapped:I}=Z,{minWidth:D,maxWidth:V,minHeight:k,maxHeight:h}=K,{x:P,y:C,width:v,height:b,aspectRatio:E}=Q,p=Math.floor(R?f-Q.pointerX:0),a=Math.floor(L?I-Q.pointerY:0),m=v+(O?-p:p),_1=b+(T?-a:a),$1=-W[0]*v,J1=-W[1]*b,y=Iq(m,D,V),u=Iq(_1,k,h);if(z){let g=0,n=0;if(O&&p<0)g=W6(P+p+$1,z[0][0]);else if(!O&&p>0)g=z6(P+m+$1,z[1][0]);if(T&&a<0)n=W6(C+a+J1,z[0][1]);else if(!T&&a>0)n=z6(C+_1+J1,z[1][1]);y=Math.max(y,g),u=Math.max(u,n)}if(B){let g=0,n=0;if(O&&p>0)g=z6(P+p,B[0][0]);else if(!O&&p<0)g=W6(P+m,B[1][0]);if(T&&a>0)n=z6(C+a,B[0][1]);else if(!T&&a<0)n=W6(C+_1,B[1][1]);y=Math.max(y,g),u=Math.max(u,n)}if(X){if(R){let g=Iq(m/E,k,h)*E;if(y=Math.max(y,g),z){let n=0;if(!O&&!T||O&&!T&&M)n=z6(C+J1+m/E,z[1][1])*E;else n=W6(C+J1+(O?p:-p)/E,z[0][1])*E;y=Math.max(y,n)}if(B){let n=0;if(!O&&!T||O&&!T&&M)n=W6(C+m/E,B[1][1])*E;else n=z6(C+(O?p:-p)/E,B[0][1])*E;y=Math.max(y,n)}}if(L){let g=Iq(_1*E,D,V)/E;if(u=Math.max(u,g),z){let n=0;if(!O&&!T||T&&!O&&M)n=z6(P+_1*E+$1,z[1][0])/E;else n=W6(P+(T?a:-a)*E+$1,z[0][0])/E;u=Math.max(u,n)}if(B){let n=0;if(!O&&!T||T&&!O&&M)n=W6(P+_1*E,B[1][0])/E;else n=z6(P+(T?a:-a)*E,B[0][0])/E;u=Math.max(u,n)}}}if(a=a+(a<0?u:-u),p=p+(p<0?y:-y),X)if(M)if(m>_1*E)a=(YM(O,T)?-p:p)/E;else p=(YM(O,T)?-a:a)*E;else if(R)a=p/E,T=O;else p=a*E,O=T;let x=O?P+p:P,d=T?C+a:C;return{width:v+(O?-p:p),height:b+(T?-a:a),x:W[0]*p*(!O?1:-1)+x,y:W[1]*a*(!T?1:-1)+d}}var cM={width:0,height:0,x:0,y:0},SC={...cM,pointerX:0,pointerY:0,aspectRatio:1};function jC(Q,U,Z){let K=U.position.x+Q.position.x,X=U.position.y+Q.position.y,W=Q.measured.width??0,z=Q.measured.height??0,B=Z[0]*W,O=Z[1]*z;return[[K-B,X-O],[K+W-B,X+z-O]]}function lM({domNode:Q,nodeId:U,getStoreItems:Z,onChange:K,onEnd:X}){let W=n0(Q),z={controlDirection:HM("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function B({controlPosition:T,boundaries:R,keepAspectRatio:L,resizeDirection:M,onResizeStart:f,onResize:I,onResizeEnd:D,shouldResize:V}){let k={...cM},h={...SC};z={boundaries:R,resizeDirection:M,keepAspectRatio:L,controlDirection:HM(T)};let P=void 0,C=null,v=[],b=void 0,E=void 0,p=void 0,a=t_().on("start",(m)=>{let{nodeLookup:_1,transform:$1,snapGrid:J1,snapToGrid:y,nodeOrigin:u,paneDomNode:x}=Z();if(P=_1.get(U),!P)return;C=x?.getBoundingClientRect()??null;let{xSnapped:d,ySnapped:g}=BJ(m.sourceEvent,{transform:$1,snapGrid:J1,snapToGrid:y,containerBounds:C});if(k={width:P.measured.width??0,height:P.measured.height??0,x:P.position.x??0,y:P.position.y??0},h={...k,pointerX:d,pointerY:g,aspectRatio:k.width/k.height},b=void 0,E=I8(P.extent)?P.extent:void 0,P.parentId&&(P.extent==="parent"||P.expandParent))b=_1.get(P.parentId);if(b&&P.extent==="parent")E=[[0,0],[b.measured.width,b.measured.height]];v=[],p=void 0;for(let[n,j]of _1)if(j.parentId===U){if(v.push({id:n,position:{...j.position},extent:j.extent}),j.extent==="parent"||j.expandParent){let i=jC(j,P,j.origin??u);if(p)p=[[Math.min(i[0][0],p[0][0]),Math.min(i[0][1],p[0][1])],[Math.max(i[1][0],p[1][0]),Math.max(i[1][1],p[1][1])]];else p=i}}f?.(m,{...k})}).on("drag",(m)=>{let{transform:_1,snapGrid:$1,snapToGrid:J1,nodeOrigin:y}=Z(),u=BJ(m.sourceEvent,{transform:_1,snapGrid:$1,snapToGrid:J1,containerBounds:C}),x=[];if(!P)return;let{x:d,y:g,width:n,height:j}=k,i={},q1=P.origin??y,{width:Q1,height:Y1,x:L1,y:M1}=CC(h,z.controlDirection,u,z.boundaries,z.keepAspectRatio,q1,E,p),I1=Q1!==n,X1=Y1!==j,f1=L1!==d&&I1,l1=M1!==g&&X1;if(!f1&&!l1&&!I1&&!X1)return;let W1={prevValues:{...k},startX:h.x,startY:h.y,childNodes:v.map((E1)=>({...E1,position:{...E1.position}}))};if(f1||l1||q1[0]===1||q1[1]===1){if(i.x=f1?L1:k.x,i.y=l1?M1:k.y,k.x=i.x,k.y=i.y,v.length>0){let E1=L1-d,j1=M1-g;for(let V0 of v)V0.position={x:V0.position.x-E1+q1[0]*(Q1-n),y:V0.position.y-j1+q1[1]*(Y1-j)},x.push(V0)}}if(I1||X1)i.width=I1&&(!z.resizeDirection||z.resizeDirection==="horizontal")?Q1:k.width,i.height=X1&&(!z.resizeDirection||z.resizeDirection==="vertical")?Y1:k.height,k.width=i.width,k.height=i.height;if(b&&P.expandParent){let E1=q1[0]*(i.width??0);if(i.x&&i.x<E1)k.x=E1,h.x=h.x-(i.x-E1);let j1=q1[1]*(i.height??0);if(i.y&&i.y<j1)k.y=j1,h.y=h.y-(i.y-j1)}let S1=NC({width:k.width,prevWidth:n,height:k.height,prevHeight:j,affectsX:z.controlDirection.affectsX,affectsY:z.controlDirection.affectsY}),v1={...k,direction:S1};if(V?.(m,v1)===!1){k=W1.prevValues,h.x=W1.startX,h.y=W1.startY,v.forEach((E1,j1)=>{E1.position=W1.childNodes[j1].position});return}I?.(m,v1),K(i,x)}).on("end",(m)=>{D?.(m,{...k}),X?.({...k})});W.call(a)}function O(){W.on(".drag",null)}return{update:B,destroy:O}}var tM=u0(i5(),1),oM=u0(dM(),1);var iM=(Q)=>{let U,Z=new Set,K=(R,L)=>{let M=typeof R==="function"?R(U):R;if(!Object.is(M,U)){let f=U;U=(L!=null?L:typeof M!=="object"||M===null)?M:Object.assign({},U,M),Z.forEach((I)=>I(U,f))}},X=()=>U,O={setState:K,getState:X,getInitialState:()=>T,subscribe:(R)=>{return Z.add(R),()=>Z.delete(R)},destroy:()=>{if((import.meta.env?import.meta.env.MODE:void 0)!=="production")console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected.");Z.clear()}},T=U=Q(K,X,O);return O},aM=(Q)=>Q?iM(Q):iM;var{useDebugValue:DC}=tM.default,{useSyncExternalStoreWithSelector:yC}=oM.default,vC=(Q)=>Q;function IX(Q,U=vC,Z){let K=yC(Q.subscribe,Q.getState,Q.getServerState||Q.getInitialState,U,Z);return DC(K),K}var sM=(Q,U)=>{let Z=aM(Q),K=(X,W=U)=>IX(Z,X,W);return Object.assign(K,Z),K},nM=(Q,U)=>Q?sM(Q,U):sM;function N0(Q,U){if(Object.is(Q,U))return!0;if(typeof Q!=="object"||Q===null||typeof U!=="object"||U===null)return!1;if(Q instanceof Map&&U instanceof Map){if(Q.size!==U.size)return!1;for(let[K,X]of Q)if(!Object.is(X,U.get(K)))return!1;return!0}if(Q instanceof Set&&U instanceof Set){if(Q.size!==U.size)return!1;for(let K of Q)if(!U.has(K))return!1;return!0}let Z=Object.keys(Q);if(Z.length!==Object.keys(U).length)return!1;for(let K of Z)if(!Object.prototype.hasOwnProperty.call(U,K)||!Object.is(Q[K],U[K]))return!1;return!0}var CT=u0(PX(),1),pq=K1.createContext(null),uC=pq.Provider,ST=x2.error001("react");function G0(Q,U){let Z=K1.useContext(pq);if(Z===null)throw Error(ST);return IX(Z,Q,U)}function C0(){let Q=K1.useContext(pq);if(Q===null)throw Error(ST);return K1.useMemo(()=>({getState:Q.getState,setState:Q.setState,subscribe:Q.subscribe}),[Q])}var JT={display:"none"},xC={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},jT="react-flow__node-desc",VT="react-flow__edge-desc",hC="react-flow__aria-live",mC=(Q)=>Q.ariaLiveMessage,gC=(Q)=>Q.ariaLabelConfig;function pC({rfId:Q}){let U=G0(mC);return F1.jsx("div",{id:`${hC}-${Q}`,"aria-live":"assertive","aria-atomic":"true",style:xC,children:U})}function cC({rfId:Q,disableKeyboardA11y:U}){let Z=G0(gC);return F1.jsxs(F1.Fragment,{children:[F1.jsx("div",{id:`${jT}-${Q}`,style:JT,children:U?Z["node.a11yDescription.default"]:Z["node.a11yDescription.keyboardDisabled"]}),F1.jsx("div",{id:`${VT}-${Q}`,style:JT,children:Z["edge.a11yDescription.default"]}),!U&&F1.jsx(pC,{rfId:Q})]})}var N8=K1.forwardRef(({position:Q="top-left",children:U,className:Z,style:K,...X},W)=>{let z=`${Q}`.split("-");return F1.jsx("div",{className:y0(["react-flow__panel",Z,...z]),style:K,ref:W,...X,children:U})});N8.displayName="Panel";var $T="https://reactflow.dev/attribution";function lC({proOptions:Q,position:U="bottom-right"}){if(K1.useEffect(()=>{OM("react")},[]),Q?.hideAttribution)return null;return F1.jsx(N8,{position:U,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${$T}`,children:F1.jsx("a",{href:$T,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}var rC=(Q)=>{let U=[],Z=[];for(let[,K]of Q.nodeLookup)if(K.selected)U.push(K.internals.userNode);for(let[,K]of Q.edgeLookup)if(K.selected)Z.push(K);return{selectedNodes:U,selectedEdges:Z}},xq=(Q)=>Q.id;function dC(Q,U){return N0(Q.selectedNodes.map(xq),U.selectedNodes.map(xq))&&N0(Q.selectedEdges.map(xq),U.selectedEdges.map(xq))}function iC({onSelectionChange:Q}){let U=C0(),{selectedNodes:Z,selectedEdges:K}=G0(rC,dC);return K1.useEffect(()=>{let X={nodes:Z,edges:K};Q?.(X),U.getState().onSelectionChangeHandlers.forEach((W)=>W(X))},[Z,K,Q]),null}var aC=(Q)=>!!Q.onSelectionChangeHandlers;function sC({onSelectionChange:Q}){let U=G0(aC);if(Q||U)return F1.jsx(iC,{onSelectionChange:Q});return null}var kT=[0,0],tC={x:0,y:0,zoom:1},oC=["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"],QT=[...oC,"rfId"],nC=(Q)=>({setNodes:Q.setNodes,setEdges:Q.setEdges,setMinZoom:Q.setMinZoom,setMaxZoom:Q.setMaxZoom,setTranslateExtent:Q.setTranslateExtent,setNodeExtent:Q.setNodeExtent,reset:Q.reset,setDefaultNodesAndEdges:Q.setDefaultNodesAndEdges}),qT={translateExtent:s7,nodeOrigin:kT,minZoom:0.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function eC(Q){let{setNodes:U,setEdges:Z,setMinZoom:K,setMaxZoom:X,setTranslateExtent:W,setNodeExtent:z,reset:B,setDefaultNodesAndEdges:O}=G0(nC,N0),T=C0();K1.useEffect(()=>{return O(Q.defaultNodes,Q.defaultEdges),()=>{R.current=qT,B()}},[]);let R=K1.useRef(qT);return K1.useEffect(()=>{for(let L of QT){let M=Q[L],f=R.current[L];if(M===f)continue;if(typeof Q[L]>"u")continue;if(L==="nodes")U(M);else if(L==="edges")Z(M);else if(L==="minZoom")K(M);else if(L==="maxZoom")X(M);else if(L==="translateExtent")W(M);else if(L==="nodeExtent")z(M);else if(L==="ariaLabelConfig")T.setState({ariaLabelConfig:RM(M)});else if(L==="fitView")T.setState({fitViewQueued:M});else if(L==="fitViewOptions")T.setState({fitViewOptions:M});else T.setState({[L]:M})}R.current=Q},QT.map((L)=>Q[L])),null}function UT(){if(typeof window>"u"||!window.matchMedia)return null;return window.matchMedia("(prefers-color-scheme: dark)")}function _S(Q){let[U,Z]=K1.useState(Q==="system"?null:Q);return K1.useEffect(()=>{if(Q!=="system"){Z(Q);return}let K=UT(),X=()=>Z(K?.matches?"dark":"light");return X(),K?.addEventListener("change",X),()=>{K?.removeEventListener("change",X)}},[Q]),U!==null?U:UT()?.matches?"dark":"light"}var GT=typeof document<"u"?document:null;function RJ(Q=null,U={target:GT,actInsideInputWithModifier:!0}){let[Z,K]=K1.useState(!1),X=K1.useRef(!1),W=K1.useRef(new Set([])),[z,B]=K1.useMemo(()=>{if(Q!==null){let T=(Array.isArray(Q)?Q:[Q]).filter((L)=>typeof L==="string").map((L)=>L.replace(/\+/g,`
242
242
  `).replace(`
243
243
 
244
244
  `,`
245
245
  +`).split(`
246
- `)),R=T.reduce((L,M)=>L.concat(...M),[]);return[T,R]}return[[],[]]},[Q]);return K1.useEffect(()=>{let O=U?.target??GT,T=U?.actInsideInputWithModifier??!0;if(Q!==null){let R=(I)=>{if(X.current=I.ctrlKey||I.metaKey||I.shiftKey||I.altKey,(!X.current||X.current&&!T)&&BX(I))return!1;let D=FT(I.code,B);if(W.current.add(I[D]),ZT(z,W.current,!1)){let V=I.composedPath?.()?.[0]||I.target,k=V?.nodeName==="BUTTON"||V?.nodeName==="A";if(U.preventDefault!==!1&&(X.current||!k))I.preventDefault();K(!0)}},L=(I)=>{let f=FT(I.code,B);if(ZT(z,W.current,!0))K(!1),W.current.clear();else W.current.delete(I[f]);if(I.key==="Meta")W.current.clear();X.current=!1},M=()=>{W.current.clear(),K(!1)};return O?.addEventListener("keydown",R),O?.addEventListener("keyup",L),window.addEventListener("blur",M),window.addEventListener("contextmenu",M),()=>{O?.removeEventListener("keydown",R),O?.removeEventListener("keyup",L),window.removeEventListener("blur",M),window.removeEventListener("contextmenu",M)}}},[Q,K]),Z}function ZT(Q,U,Z){return Q.filter((K)=>Z||K.length===U.size).some((K)=>K.every((X)=>U.has(X)))}function FT(Q,U){return U.includes(Q)?"code":"key"}var JS=()=>{let Q=C0();return K1.useMemo(()=>{return{zoomIn:async(U)=>{let{panZoom:Z}=Q.getState();return Z?Z.scaleBy(1.2,U):!1},zoomOut:async(U)=>{let{panZoom:Z}=Q.getState();return Z?Z.scaleBy(0.8333333333333334,U):!1},zoomTo:async(U,Z)=>{let{panZoom:K}=Q.getState();return K?K.scaleTo(U,Z):!1},getZoom:()=>Q.getState().transform[2],setViewport:async(U,Z)=>{let{transform:[K,X,W],panZoom:z}=Q.getState();if(!z)return!1;return await z.setViewport({x:U.x??K,y:U.y??X,zoom:U.zoom??W},Z),!0},getViewport:()=>{let[U,Z,K]=Q.getState().transform;return{x:U,y:Z,zoom:K}},setCenter:async(U,Z,K)=>{return Q.getState().setCenter(U,Z,K)},fitBounds:async(U,Z)=>{let{width:K,height:X,minZoom:W,maxZoom:z,panZoom:B}=Q.getState(),O=MJ(U,K,X,W,z,Z?.padding??0.1);if(!B)return!1;return await B.setViewport(O,{duration:Z?.duration,ease:Z?.ease,interpolate:Z?.interpolate}),!0},screenToFlowPosition:(U,Z={})=>{let{transform:K,snapGrid:X,snapToGrid:W,domNode:z}=Q.getState();if(!z)return U;let{x:B,y:O}=z.getBoundingClientRect(),T={x:U.x-B,y:U.y-O},R=Z.snapGrid??X,L=Z.snapToGrid??W;return n7(T,K,L,R)},flowToScreenPosition:(U)=>{let{transform:Z,domNode:K}=Q.getState();if(!K)return U;let{x:X,y:W}=K.getBoundingClientRect(),z=w8(U,Z);return{x:z.x+X,y:z.y+W}}}},[])};function DT(Q,U){let Z=[],K=new Map,X=[];for(let W of Q)if(W.type==="add"){X.push(W);continue}else if(W.type==="remove"||W.type==="replace")K.set(W.id,[W]);else{let z=K.get(W.id);if(z)z.push(W);else K.set(W.id,[W])}for(let W of U){let z=K.get(W.id);if(!z){Z.push(W);continue}if(z[0].type==="remove")continue;if(z[0].type==="replace"){Z.push({...z[0].item});continue}let B={...W};for(let O of z)$S(O,B);Z.push(B)}if(X.length)X.forEach((W)=>{if(W.index!==void 0)Z.splice(W.index,0,{...W.item});else Z.push({...W.item})});return Z}function $S(Q,U){switch(Q.type){case"select":{U.selected=Q.selected;break}case"position":{if(typeof Q.position<"u")U.position=Q.position;if(typeof Q.dragging<"u")U.dragging=Q.dragging;break}case"dimensions":{if(typeof Q.dimensions<"u"){if(U.measured={...Q.dimensions},Q.setAttributes){if(Q.setAttributes===!0||Q.setAttributes==="width")U.width=Q.dimensions.width;if(Q.setAttributes===!0||Q.setAttributes==="height")U.height=Q.dimensions.height}}if(typeof Q.resizing==="boolean")U.resizing=Q.resizing;break}}}function yT(Q,U){return DT(Q,U)}function QS(Q,U){return DT(Q,U)}function P8(Q,U){return{id:Q,type:"select",selected:U}}function _9(Q,U=new Set,Z=!1){let K=[];for(let[X,W]of Q){let z=U.has(X);if(!(W.selected===void 0&&!z)&&W.selected!==z){if(Z)W.selected=z;K.push(P8(W.id,z))}}return K}function KT({items:Q=[],lookup:U}){let Z=[],K=new Map(Q.map((X)=>[X.id,X]));for(let[X,W]of Q.entries()){let z=U.get(W.id),B=z?.internals?.userNode??z;if(B!==void 0&&B!==W)Z.push({id:W.id,item:W,type:"replace"});if(B===void 0)Z.push({item:W,type:"add",index:X})}for(let[X]of U)if(K.get(X)===void 0)Z.push({id:X,type:"remove"});return Z}function XT(Q){return{id:Q.id,type:"remove"}}var qS=KX("React Flow","https://reactflow.dev/");function US(Q,U,Z={}){return fM(Q,U,{...Z,onError:Z.onError??qS})}var HT=(Q)=>WM(Q),GS=(Q)=>QX(Q);function vT(Q){return K1.forwardRef(Q)}var ET=typeof window<"u"?K1.useLayoutEffect:K1.useEffect;function YT(Q){let[U,Z]=K1.useState(BigInt(0)),[K]=K1.useState(()=>ZS(()=>Z((X)=>X+BigInt(1))));return ET(()=>{let X=K.get();if(X.length)Q(X),K.reset()},[U]),K}function ZS(Q){let U=[];return{get:()=>U,reset:()=>{U=[]},push:(Z)=>{U.push(Z),Q()}}}var bT=K1.createContext(null);function FS({children:Q}){let U=C0(),Z=K1.useCallback((B)=>{let{nodes:O=[],setNodes:T,hasDefaultNodes:R,onNodesChange:L,nodeLookup:M,fitViewQueued:I,onNodesChangeMiddlewareMap:f}=U.getState(),D=O;for(let k of B)D=typeof k==="function"?k(D):k;let V=KT({items:D,lookup:M});for(let k of f.values())V=k(V);if(R)T(D);if(V.length>0)L?.(V);else if(I)window.requestAnimationFrame(()=>{let{fitViewQueued:k,nodes:h,setNodes:P}=U.getState();if(k)P(h)})},[]),K=YT(Z),X=K1.useCallback((B)=>{let{edges:O=[],setEdges:T,hasDefaultEdges:R,onEdgesChange:L,edgeLookup:M}=U.getState(),I=O;for(let f of B)I=typeof f==="function"?f(I):f;if(R)T(I);else if(L)L(KT({items:I,lookup:M}))},[]),W=YT(X),z=K1.useMemo(()=>({nodeQueue:K,edgeQueue:W}),[]);return F1.jsx(bT.Provider,{value:z,children:Q})}function KS(){let Q=K1.useContext(bT);if(!Q)throw Error("useBatchContext must be used within a BatchProvider");return Q}var XS=(Q)=>!!Q.panZoom;function OJ(){let Q=JS(),U=C0(),Z=KS(),K=G0(XS),X=K1.useMemo(()=>{let W=(L)=>U.getState().nodeLookup.get(L),z=(L)=>{Z.nodeQueue.push(L)},B=(L)=>{Z.edgeQueue.push(L)},O=(L)=>{let{nodeLookup:M,nodeOrigin:I}=U.getState(),f=HT(L)?L:M.get(L.id),D=f.parentId?HX(f.position,f.measured,f.parentId,M,I):f.position,V={...f,position:D,width:f.measured?.width??f.width,height:f.measured?.height??f.height};return t7(V)},T=(L,M,I={replace:!1})=>{z((f)=>f.map((D)=>{if(D.id===L){let V=typeof M==="function"?M(D):M;return I.replace&&HT(V)?V:{...D,...V}}return D}))},R=(L,M,I={replace:!1})=>{B((f)=>f.map((D)=>{if(D.id===L){let V=typeof M==="function"?M(D):M;return I.replace&&GS(V)?V:{...D,...V}}return D}))};return{getNodes:()=>U.getState().nodes.map((L)=>({...L})),getNode:(L)=>W(L)?.internals.userNode,getInternalNode:W,getEdges:()=>{let{edges:L=[]}=U.getState();return L.map((M)=>({...M}))},getEdge:(L)=>U.getState().edgeLookup.get(L),setNodes:z,setEdges:B,addNodes:(L)=>{let M=Array.isArray(L)?L:[L];Z.nodeQueue.push((I)=>[...I,...M])},addEdges:(L)=>{let M=Array.isArray(L)?L:[L];Z.edgeQueue.push((I)=>[...I,...M])},toObject:()=>{let{nodes:L=[],edges:M=[],transform:I}=U.getState(),[f,D,V]=I;return{nodes:L.map((k)=>({...k})),edges:M.map((k)=>({...k})),viewport:{x:f,y:D,zoom:V}}},deleteElements:async({nodes:L=[],edges:M=[]})=>{let{nodes:I,edges:f,onNodesDelete:D,onEdgesDelete:V,triggerNodeChanges:k,triggerEdgeChanges:h,onDelete:P,onBeforeDelete:C}=U.getState(),{nodes:v,edges:b}=await AM({nodesToRemove:L,edgesToRemove:M,nodes:I,edges:f,onBeforeDelete:C}),E=b.length>0,p=v.length>0;if(E){let a=b.map(XT);V?.(b),h(a)}if(p){let a=v.map(XT);D?.(v),k(a)}if(p||E)P?.({nodes:v,edges:b});return{deletedNodes:v,deletedEdges:b}},getIntersectingNodes:(L,M=!0,I)=>{let f=FX(L),D=f?L:O(L),V=I!==void 0;if(!D)return[];return(I||U.getState().nodes).filter((k)=>{let h=U.getState().nodeLookup.get(k.id);if(h&&!f&&(k.id===L.id||!h.internals.positionAbsolute))return!1;let P=t7(V?k:h),C=LJ(P,D);return M&&C>0||C>=P.width*P.height||C>=D.width*D.height})},isNodeIntersecting:(L,M,I=!0)=>{let D=FX(L)?L:O(L);if(!D)return!1;let V=LJ(D,M);return I&&V>0||V>=M.width*M.height||V>=D.width*D.height},updateNode:T,updateNodeData:(L,M,I={replace:!1})=>{T(L,(f)=>{let D=typeof M==="function"?M(f):M;return I.replace?{...f,data:D}:{...f,data:{...f.data,...D}}},I)},updateEdge:R,updateEdgeData:(L,M,I={replace:!1})=>{R(L,(f)=>{let D=typeof M==="function"?M(f):M;return I.replace?{...f,data:D}:{...f,data:{...f.data,...D}}},I)},getNodesBounds:(L)=>{let{nodeLookup:M,nodeOrigin:I}=U.getState();return UX(L,{nodeLookup:M,nodeOrigin:I})},getHandleConnections:({type:L,id:M,nodeId:I})=>Array.from(U.getState().connectionLookup.get(`${I}-${L}${M?`-${M}`:""}`)?.values()??[]),getNodeConnections:({type:L,handleId:M,nodeId:I})=>Array.from(U.getState().connectionLookup.get(`${I}${L?M?`-${L}-${M}`:`-${L}`:""}`)?.values()??[]),fitView:async(L)=>{let M=U.getState().fitViewResolver??TM();return U.setState({fitViewQueued:!0,fitViewOptions:L,fitViewResolver:M}),Z.nodeQueue.push((I)=>[...I]),M.promise}}},[]);return K1.useMemo(()=>{return{...X,...Q,viewportInitialized:K}},[K])}var WT=(Q)=>Q.selected,HS=typeof window<"u"?window:void 0;function YS({deleteKeyCode:Q,multiSelectionKeyCode:U}){let Z=C0(),{deleteElements:K}=OJ(),X=RJ(Q,{actInsideInputWithModifier:!1}),W=RJ(U,{target:HS});K1.useEffect(()=>{if(X){let{edges:z,nodes:B}=Z.getState();K({nodes:B.filter(WT),edges:z.filter(WT)}),Z.setState({nodesSelectionActive:!1})}},[X]),K1.useEffect(()=>{Z.setState({multiSelectionActive:W})},[W])}function WS(Q){let U=C0();K1.useEffect(()=>{let Z=()=>{if(!Q.current||!(Q.current.checkVisibility?.()??!0))return!1;let K=jq(Q.current);if(K.height===0||K.width===0)U.getState().onError?.("004",x2.error004());U.setState({width:K.width||500,height:K.height||500})};if(Q.current){Z(),window.addEventListener("resize",Z);let K=new ResizeObserver(()=>Z());return K.observe(Q.current),()=>{if(window.removeEventListener("resize",Z),K&&Q.current)K.unobserve(Q.current)}}},[])}var cq={position:"absolute",width:"100%",height:"100%",top:0,left:0},zS=(Q)=>({userSelectionActive:Q.userSelectionActive,lib:Q.lib,connectionInProgress:Q.connection.inProgress});function BS({onPaneContextMenu:Q,zoomOnScroll:U=!0,zoomOnPinch:Z=!0,panOnScroll:K=!1,panActivationKeyPressed:X,panOnScrollSpeed:W=0.5,panOnScrollMode:z=B3.Free,zoomOnDoubleClick:B=!0,panOnDrag:O=!0,defaultViewport:T,translateExtent:R,minZoom:L,maxZoom:M,zoomActivationKeyCode:I,preventScrolling:f=!0,children:D,noWheelClassName:V,noPanClassName:k,onViewportChange:h,isControlledViewport:P,paneClickDistance:C,selectionOnDrag:v}){let b=C0(),E=K1.useRef(null),{userSelectionActive:p,lib:a,connectionInProgress:m}=G0(zS,N0),_1=RJ(I),$1=K1.useRef();WS(E);let J1=K1.useCallback((y)=>{if(h?.({x:y[0],y:y[1],zoom:y[2]}),!P)b.setState({transform:y})},[h,P]);return K1.useEffect(()=>{if(E.current){$1.current=pM({domNode:E.current,minZoom:L,maxZoom:M,translateExtent:R,viewport:T,onDraggingChange:(d)=>b.setState((g)=>g.paneDragging===d?g:{paneDragging:d}),onPanZoomStart:(d,g)=>{let{onViewportChangeStart:n,onMoveStart:j}=b.getState();j?.(d,g),n?.(g)},onPanZoom:(d,g)=>{let{onViewportChange:n,onMove:j}=b.getState();j?.(d,g),n?.(g)},onPanZoomEnd:(d,g)=>{let{onViewportChangeEnd:n,onMoveEnd:j}=b.getState();j?.(d,g),n?.(g)}});let{x:y,y:u,zoom:x}=$1.current.getViewport();return b.setState({panZoom:$1.current,transform:[y,u,x],domNode:E.current.closest(".react-flow")}),()=>{$1.current?.destroy()}}},[]),K1.useEffect(()=>{$1.current?.update({onPaneContextMenu:Q,zoomOnScroll:U,zoomOnPinch:Z,panOnScroll:K,panActivationKeyPressed:X,panOnScrollSpeed:W,panOnScrollMode:z,zoomOnDoubleClick:B,panOnDrag:O,zoomActivationKeyPressed:_1,preventScrolling:f,noPanClassName:k,userSelectionActive:p,noWheelClassName:V,lib:a,onTransformChange:J1,connectionInProgress:m,selectionOnDrag:v,paneClickDistance:C})},[Q,U,Z,K,X,W,z,B,O,_1,f,k,p,V,a,J1,m,v,C]),F1.jsx("div",{className:"react-flow__renderer",ref:E,style:cq,children:D})}var AS=(Q)=>({userSelectionActive:Q.userSelectionActive,userSelectionRect:Q.userSelectionRect});function LS(){let{userSelectionActive:Q,userSelectionRect:U}=G0(AS,N0);if(!(Q&&U))return null;return F1.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:U.width,height:U.height,transform:`translate(${U.x}px, ${U.y}px)`}})}var NX=(Q,U)=>{return(Z)=>{if(Z.target!==U.current)return;Q?.(Z)}},MS=(Q)=>({userSelectionActive:Q.userSelectionActive,elementsSelectable:Q.elementsSelectable,dragging:Q.paneDragging,panBy:Q.panBy,autoPanSpeed:Q.autoPanSpeed});function TS({isSelecting:Q,selectionKeyPressed:U,selectionMode:Z=R8.Full,panOnDrag:K,autoPanOnSelection:X,paneClickDistance:W,selectionOnDrag:z,onSelectionStart:B,onSelectionEnd:O,onPaneClick:T,onPaneContextMenu:R,onPaneScroll:L,onPaneMouseEnter:M,onPaneMouseMove:I,onPaneMouseLeave:f,children:D}){let V=K1.useRef(0),k=C0(),{userSelectionActive:h,elementsSelectable:P,dragging:C,panBy:v,autoPanSpeed:b}=G0(MS,N0),E=P&&(Q||h),p=K1.useRef(null),a=K1.useRef(),m=K1.useRef(new Set),_1=K1.useRef(new Set),$1=K1.useRef(!1),J1=K1.useRef(!1),y=K1.useRef({x:0,y:0}),u=K1.useRef(!1),x=(X1)=>{if(J1.current||$1.current||k.getState().connection.inProgress){J1.current=!1,$1.current=!1;return}T?.(X1),k.getState().resetSelectedElements(),k.setState({nodesSelectionActive:!1})},d=(X1)=>{if(Array.isArray(K)&&K?.includes(2)){X1.preventDefault();return}R?.(X1)},g=L?(X1)=>L(X1):void 0,n=(X1)=>{if(J1.current)X1.stopPropagation(),J1.current=!1},j=(X1)=>{if(X1.pointerType==="touch"&&K!==!1&&!U)return;let{domNode:f1,transform:l1}=k.getState();if(a.current=f1?.getBoundingClientRect(),!a.current)return;let W1=X1.target===p.current;if(!W1&&!!X1.target.closest(".nokey")||!Q||!(z&&W1||U)||X1.button!==0||!X1.isPrimary)return;X1.target?.setPointerCapture?.(X1.pointerId),J1.current=!1;let{x:c1,y:E1}=D5(X1.nativeEvent,a.current),j1=n7({x:c1,y:E1},l1);if(k.setState({userSelectionRect:{width:0,height:0,startX:j1.x,startY:j1.y,x:c1,y:E1}}),!W1)X1.stopPropagation(),X1.preventDefault()};function i(X1,f1){let{userSelectionRect:l1}=k.getState();if(!l1)return;let{transform:W1,nodeLookup:S1,edgeLookup:v1,connectionLookup:c1,triggerNodeChanges:E1,triggerEdgeChanges:j1,defaultEdgeOptions:V0}=k.getState(),b1={x:l1.startX,y:l1.startY},{x:Z2,y:_0}=w8(b1,W1),h2={startX:b1.x,startY:b1.y,x:X1<Z2?X1:Z2,y:f1<_0?f1:_0,width:Math.abs(X1-Z2),height:Math.abs(f1-_0)},z2=m.current,I2=_1.current;m.current=new Set(Pq(S1,h2,W1,Z===R8.Partial,!0).map((P2)=>P2.id)),_1.current=new Set;let f2=V0?.selectable??!0;for(let P2 of m.current){let B2=c1.get(P2);if(!B2)continue;for(let{edgeId:A2}of B2.values()){let L2=v1.get(A2);if(L2&&(L2.selectable??f2))_1.current.add(A2)}}if(!YX(z2,m.current)){let P2=_9(S1,m.current,!0);E1(P2)}if(!YX(I2,_1.current)){let P2=_9(v1,_1.current);j1(P2)}k.setState({userSelectionRect:h2,userSelectionActive:!0,nodesSelectionActive:!1})}function q1(){if(!X||!a.current)return;let[X1,f1]=Nq(y.current,a.current,b);v({x:X1,y:f1}).then((l1)=>{if(!J1.current||!l1){V.current=requestAnimationFrame(q1);return}let{x:W1,y:S1}=y.current;i(W1,S1),V.current=requestAnimationFrame(q1)})}let Q1=()=>{cancelAnimationFrame(V.current),V.current=0,u.current=!1};K1.useEffect(()=>{return()=>Q1()},[]);let Y1=(X1)=>{let{userSelectionRect:f1,transform:l1,resetSelectedElements:W1}=k.getState();if(!a.current||!f1)return;let{x:S1,y:v1}=D5(X1.nativeEvent,a.current);y.current={x:S1,y:v1};let c1=w8({x:f1.startX,y:f1.startY},l1);if(!J1.current){let E1=U?0:W;if(Math.hypot(S1-c1.x,v1-c1.y)<=E1)return;W1(),B?.(X1)}if(J1.current=!0,!u.current)q1(),u.current=!0;i(S1,v1)},L1=(X1)=>{if(!E){if(X1.target===p.current&&k.getState().connection.inProgress)$1.current=!0;return}if(X1.button!==0)return;if(X1.target?.releasePointerCapture?.(X1.pointerId),!h&&X1.target===p.current&&k.getState().userSelectionRect)x?.(X1);if(k.setState({userSelectionActive:!1,userSelectionRect:null}),J1.current)O?.(X1),k.setState({nodesSelectionActive:m.current.size>0});Q1()},M1=(X1)=>{X1.target?.releasePointerCapture?.(X1.pointerId),Q1()},I1=K===!0||Array.isArray(K)&&K.includes(0);return F1.jsxs("div",{className:y0(["react-flow__pane",{draggable:I1,dragging:C,selection:Q}]),onClick:E?void 0:NX(x,p),onContextMenu:NX(d,p),onWheel:NX(g,p),onPointerEnter:E?void 0:M,onPointerMove:E?Y1:I,onPointerUp:L1,onPointerCancel:E?M1:void 0,onPointerDownCapture:E?j:void 0,onClickCapture:E?n:void 0,onPointerLeave:f,ref:p,style:cq,children:[D,F1.jsx(LS,{})]})}function SX({id:Q,store:U,unselect:Z=!1,nodeRef:K}){let{addSelectedNodes:X,unselectNodesAndEdges:W,multiSelectionActive:z,nodeLookup:B,onError:O}=U.getState(),T=B.get(Q);if(!T){O?.("012",x2.error012(Q));return}if(U.setState({nodesSelectionActive:!1}),!T.selected)X([Q]);else if(Z||T.selected&&z)W({nodes:[T],edges:[]}),requestAnimationFrame(()=>K?.current?.blur())}function uT({nodeRef:Q,disabled:U=!1,noDragClassName:Z,handleSelector:K,nodeId:X,isSelectable:W,nodeClickDistance:z}){let B=C0(),[O,T]=K1.useState(!1),R=K1.useRef();return K1.useEffect(()=>{if(U)return;return R.current=vM({getStoreItems:()=>B.getState(),onNodeMouseDown:(L)=>{SX({id:L,store:B,nodeRef:Q})},onDragStart:()=>{T(!0)},onDragStop:()=>{T(!1)}}),()=>{R.current?.destroy(),R.current=void 0}},[U,B,Q]),K1.useEffect(()=>{if(U||!Q.current||!R.current)return;R.current.update({noDragClassName:Z,handleSelector:K,domNode:Q.current,isSelectable:W,nodeId:X,nodeClickDistance:z})},[Z,K,U,W,Q,X,z]),O}var RS=(Q)=>(U)=>U.selected&&(U.draggable||Q&&typeof U.draggable>"u");function xT(){let Q=C0();return K1.useCallback((Z)=>{let{nodeExtent:K,snapToGrid:X,snapGrid:W,nodesDraggable:z,onError:B,updateNodePositions:O,nodeLookup:T,nodeOrigin:R}=Q.getState(),L=new Map,M=RS(z),I=X?W[0]:5,f=X?W[1]:5,D=Z.direction.x*I*Z.factor,V=Z.direction.y*f*Z.factor;for(let[,k]of T){if(!M(k))continue;let h={x:k.internals.positionAbsolute.x+D,y:k.internals.positionAbsolute.y+V};if(X)h=o7(h,W);let{position:P,positionAbsolute:C}=GX({nodeId:k.id,nextPosition:h,nodeLookup:T,nodeExtent:K,nodeOrigin:R,onError:B});k.position=P,k.internals.positionAbsolute=C,L.set(k.id,k)}O(L)},[])}var jX=K1.createContext(null),OS=jX.Provider;jX.Consumer;var VX=()=>{return K1.useContext(jX)},wS=(Q)=>({connectOnClick:Q.connectOnClick,noPanClassName:Q.noPanClassName,rfId:Q.rfId}),hT=K1.createContext(null);function IS({children:Q}){let U=G0(wS,N0);return F1.jsx(hT.Provider,{value:U,children:Q})}function fS(){let Q=K1.useContext(hT);if(!Q)throw Error("useHandleConfig must be used within a HandleConfigProvider");return Q}var PS={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},NS=(Q,U,Z)=>(K)=>{let{connectionClickStartHandle:X,connectionMode:W,connection:z}=K,{fromHandle:B,toHandle:O,isValid:T}=z;if(!B&&!X)return PS;let R=O?.nodeId===Q&&O?.id===U&&O?.type===Z;return{connectingFrom:B?.nodeId===Q&&B?.id===U&&B?.type===Z,connectingTo:R,clickConnecting:X?.nodeId===Q&&X?.id===U&&X?.type===Z,isPossibleEndHandle:W===A6.Strict?B?.type!==Z:Q!==B?.nodeId||U!==B?.id,connectionInProcess:!!B,clickConnectionInProcess:!!X,valid:R&&T}};function CS({type:Q="source",position:U=C1.Top,isValidConnection:Z,isConnectable:K=!0,isConnectableStart:X=!0,isConnectableEnd:W=!0,id:z,onConnect:B,children:O,className:T,onMouseDown:R,onTouchStart:L,...M},I){let f=z||null,D=Q==="target",V=C0(),k=VX(),{connectOnClick:h,noPanClassName:P,rfId:C}=fS(),{connectingFrom:v,connectingTo:b,clickConnecting:E,isPossibleEndHandle:p,connectionInProcess:a,clickConnectionInProcess:m,valid:_1}=G0(NS(k,f,Q),N0);if(!k)V.getState().onError?.("010",x2.error010());let $1=(u)=>{let{defaultEdgeOptions:x,onConnect:d,hasDefaultEdges:g}=V.getState(),n={...x,...u};if(g){let{edges:j,setEdges:i,onError:q1}=V.getState();i(US(n,j,{onError:q1}))}d?.(n),B?.(n)},J1=(u)=>{if(!k)return;let x=AX(u.nativeEvent);if(X&&(x&&u.button===0||!x)){let d=V.getState();bq.onPointerDown(u.nativeEvent,{handleDomNode:u.currentTarget,autoPanOnConnect:d.autoPanOnConnect,connectionMode:d.connectionMode,connectionRadius:d.connectionRadius,domNode:d.domNode,nodeLookup:d.nodeLookup,lib:d.lib,isTarget:D,handleId:f,nodeId:k,flowId:d.rfId,panBy:d.panBy,cancelConnection:d.cancelConnection,onConnectStart:d.onConnectStart,onConnectEnd:(...g)=>V.getState().onConnectEnd?.(...g),updateConnection:d.updateConnection,onConnect:$1,isValidConnection:Z||((...g)=>V.getState().isValidConnection?.(...g)??!0),getTransform:()=>V.getState().transform,getFromHandle:()=>V.getState().connection.fromHandle,autoPanSpeed:d.autoPanSpeed,dragThreshold:d.connectionDragThreshold})}if(x)R?.(u);else L?.(u)},y=(u)=>{let{onClickConnectStart:x,onClickConnectEnd:d,connectionClickStartHandle:g,connectionMode:n,isValidConnection:j,lib:i,rfId:q1,nodeLookup:Q1,connection:Y1}=V.getState();if(!k||!g&&!X)return;if(!g){x?.(u.nativeEvent,{nodeId:k,handleId:f,handleType:Q}),V.setState({connectionClickStartHandle:{nodeId:k,type:Q,id:f}});return}let L1=zX(u.target),M1=Z||j,{connection:I1,isValid:X1}=bq.isValid(u.nativeEvent,{handle:{nodeId:k,id:f,type:Q},connectionMode:n,fromNodeId:g.nodeId,fromHandleId:g.id||null,fromType:g.type,isValidConnection:M1,flowId:q1,doc:L1,lib:i,nodeLookup:Q1});if(X1&&I1)$1(I1);let f1=structuredClone(Y1);delete f1.inProgress,f1.toPosition=f1.toHandle?f1.toHandle.position:null,d?.(u,f1),V.setState({connectionClickStartHandle:null})};return F1.jsx("div",{"data-handleid":f,"data-nodeid":k,"data-handlepos":U,"data-id":`${C}-${k}-${f}-${Q}`,className:y0(["react-flow__handle",`react-flow__handle-${U}`,"nodrag",P,T,{source:!D,target:D,connectable:K,connectablestart:X,connectableend:W,clickconnecting:E,connectingfrom:v,connectingto:b,valid:_1,connectionindicator:K&&(!a||p)&&(a||m?W:X)}]),onMouseDown:J1,onTouchStart:J1,onClick:h?y:void 0,ref:I,...M,children:O})}var mq=K1.memo(vT(CS));function SS({data:Q,isConnectable:U,sourcePosition:Z=C1.Bottom}){return F1.jsxs(F1.Fragment,{children:[Q?.label,F1.jsx(mq,{type:"source",position:Z,isConnectable:U})]})}function jS({data:Q,isConnectable:U,targetPosition:Z=C1.Top,sourcePosition:K=C1.Bottom}){return F1.jsxs(F1.Fragment,{children:[F1.jsx(mq,{type:"target",position:Z,isConnectable:U}),Q?.label,F1.jsx(mq,{type:"source",position:K,isConnectable:U})]})}function VS(){return null}function kS({data:Q,isConnectable:U,targetPosition:Z=C1.Top}){return F1.jsxs(F1.Fragment,{children:[F1.jsx(mq,{type:"target",position:Z,isConnectable:U}),Q?.label]})}var gq={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},zT={input:SS,default:jS,output:kS,group:VS};function DS(Q){if(Q.internals.handleBounds===void 0)return{width:Q.width??Q.initialWidth??Q.style?.width,height:Q.height??Q.initialHeight??Q.style?.height};return{width:Q.width??Q.style?.width,height:Q.height??Q.style?.height}}var yS=(Q)=>{let{width:U,height:Z,x:K,y:X}=f8(Q.nodeLookup,{filter:(W)=>!!W.selected});return{width:k5(U)?U:null,height:k5(Z)?Z:null,userSelectionActive:Q.userSelectionActive,transformString:`translate(${Q.transform[0]}px,${Q.transform[1]}px) scale(${Q.transform[2]}) translate(${K}px,${X}px)`}};function vS({onSelectionContextMenu:Q,noPanClassName:U,disableKeyboardA11y:Z}){let K=C0(),{width:X,height:W,transformString:z,userSelectionActive:B}=G0(yS,N0),O=xT(),T=K1.useRef(null);K1.useEffect(()=>{if(!Z)T.current?.focus({preventScroll:!0})},[Z]);let R=!B&&X!==null&&W!==null;if(uT({nodeRef:T,disabled:!R}),!R)return null;let L=Q?(I)=>{let f=K.getState().nodes.filter((D)=>D.selected);Q(I,f)}:void 0,M=(I)=>{if(Object.prototype.hasOwnProperty.call(gq,I.key))I.preventDefault(),O({direction:gq[I.key],factor:I.shiftKey?4:1})};return F1.jsx("div",{className:y0(["react-flow__nodesselection","react-flow__container",U]),style:{transform:z},children:F1.jsx("div",{ref:T,className:"react-flow__nodesselection-rect",onContextMenu:L,tabIndex:Z?void 0:-1,onKeyDown:Z?void 0:M,style:{width:X,height:W}})})}var BT=typeof window<"u"?window:void 0,ES=(Q)=>{return{nodesSelectionActive:Q.nodesSelectionActive,userSelectionActive:Q.userSelectionActive}};function mT({children:Q,onPaneClick:U,onPaneMouseEnter:Z,onPaneMouseMove:K,onPaneMouseLeave:X,onPaneContextMenu:W,onPaneScroll:z,paneClickDistance:B,deleteKeyCode:O,selectionKeyCode:T,selectionOnDrag:R,selectionMode:L,onSelectionStart:M,onSelectionEnd:I,multiSelectionKeyCode:f,panActivationKeyCode:D,zoomActivationKeyCode:V,elementsSelectable:k,zoomOnScroll:h,zoomOnPinch:P,panOnScroll:C,panOnScrollSpeed:v,panOnScrollMode:b,zoomOnDoubleClick:E,panOnDrag:p,autoPanOnSelection:a,defaultViewport:m,translateExtent:_1,minZoom:$1,maxZoom:J1,preventScrolling:y,onSelectionContextMenu:u,noWheelClassName:x,noPanClassName:d,disableKeyboardA11y:g,onViewportChange:n,isControlledViewport:j}){let{nodesSelectionActive:i,userSelectionActive:q1}=G0(ES,N0),Q1=RJ(T,{target:BT}),Y1=RJ(D,{target:BT}),L1=Y1||p,M1=Y1||C,I1=R&&L1!==!0,X1=Q1||q1||I1;return YS({deleteKeyCode:O,multiSelectionKeyCode:f}),F1.jsx(BS,{onPaneContextMenu:W,elementsSelectable:k,zoomOnScroll:h,zoomOnPinch:P,panOnScroll:M1,panActivationKeyPressed:Y1,panOnScrollSpeed:v,panOnScrollMode:b,zoomOnDoubleClick:E,panOnDrag:!Q1&&L1,defaultViewport:m,translateExtent:_1,minZoom:$1,maxZoom:J1,zoomActivationKeyCode:V,preventScrolling:y,noWheelClassName:x,noPanClassName:d,onViewportChange:n,isControlledViewport:j,paneClickDistance:B,selectionOnDrag:I1,children:F1.jsxs(TS,{onSelectionStart:M,onSelectionEnd:I,onPaneClick:U,onPaneMouseEnter:Z,onPaneMouseMove:K,onPaneMouseLeave:X,onPaneContextMenu:W,onPaneScroll:z,panOnDrag:L1,autoPanOnSelection:a,isSelecting:!!X1,selectionMode:L,selectionKeyPressed:Q1,paneClickDistance:B,selectionOnDrag:I1,children:[Q,i&&F1.jsx(vS,{onSelectionContextMenu:u,noPanClassName:d,disableKeyboardA11y:g})]})})}mT.displayName="FlowRenderer";var bS=K1.memo(mT),uS=(Q)=>(U)=>{return Q?Pq(U.nodeLookup,{x:0,y:0,width:U.width,height:U.height},U.transform,!0).map((Z)=>Z.id):Array.from(U.nodeLookup.keys())};function xS(Q){return G0(K1.useCallback(uS(Q),[Q]),N0)}var hS=(Q)=>Q.updateNodeInternals;function mS(){let Q=G0(hS),[U]=K1.useState(()=>{if(typeof ResizeObserver>"u")return null;return new ResizeObserver((Z)=>{let K=new Map;Z.forEach((X)=>{let W=X.target.getAttribute("data-id");K.set(W,{id:W,nodeElement:X.target,force:!0})}),Q(K)})});return K1.useEffect(()=>{return()=>{U?.disconnect()}},[U]),U}function gS({node:Q,nodeType:U,hasDimensions:Z,resizeObserver:K}){let X=C0(),W=K1.useRef(null),z=K1.useRef(null),B=K1.useRef(Q.sourcePosition),O=K1.useRef(Q.targetPosition),T=K1.useRef(U),R=Z&&!!Q.internals.handleBounds;return K1.useEffect(()=>{if(W.current&&!Q.hidden&&(!R||z.current!==W.current)){if(z.current)K?.unobserve(z.current);K?.observe(W.current),z.current=W.current}},[R,Q.hidden]),K1.useEffect(()=>{return()=>{if(z.current)K?.unobserve(z.current),z.current=null}},[]),K1.useEffect(()=>{if(W.current){let L=T.current!==U,M=B.current!==Q.sourcePosition,I=O.current!==Q.targetPosition;if(L||M||I)T.current=U,B.current=Q.sourcePosition,O.current=Q.targetPosition,X.getState().updateNodeInternals(new Map([[Q.id,{id:Q.id,nodeElement:W.current,force:!0}]]))}},[Q.id,U,Q.sourcePosition,Q.targetPosition]),W}function pS({id:Q,onClick:U,onMouseEnter:Z,onMouseMove:K,onMouseLeave:X,onContextMenu:W,onDoubleClick:z,nodesDraggable:B,elementsSelectable:O,nodesConnectable:T,nodesFocusable:R,resizeObserver:L,noDragClassName:M,noPanClassName:I,disableKeyboardA11y:f,rfId:D,nodeTypes:V,nodeClickDistance:k,onError:h}){let{node:P,internals:C,isParent:v}=G0((X1)=>{let f1=X1.nodeLookup.get(Q),l1=X1.parentLookup.has(Q);return{node:f1,internals:f1.internals,isParent:l1}},N0),b=P.type||"default",E=V?.[b]||zT[b];if(E===void 0)h?.("003",x2.error003(b)),b="default",E=V?.default||zT.default;let p=!!(P.draggable||B&&typeof P.draggable>"u"),a=!!(P.selectable||O&&typeof P.selectable>"u"),m=!!(P.connectable||T&&typeof P.connectable>"u"),_1=!!(P.focusable||R&&typeof P.focusable>"u"),$1=C0(),J1=XX(P),y=gS({node:P,nodeType:b,hasDimensions:J1,resizeObserver:L}),u=uT({nodeRef:y,disabled:P.hidden||!p,noDragClassName:M,handleSelector:P.dragHandle,nodeId:Q,isSelectable:a,nodeClickDistance:k}),x=xT();if(P.hidden)return null;let d=y5(P),g=DS(P),n=a||p||U||Z||K||X,j=Z?(X1)=>Z(X1,{...C.userNode}):void 0,i=K?(X1)=>K(X1,{...C.userNode}):void 0,q1=X?(X1)=>X(X1,{...C.userNode}):void 0,Q1=W?(X1)=>W(X1,{...C.userNode}):void 0,Y1=z?(X1)=>z(X1,{...C.userNode}):void 0,L1=(X1)=>{let{selectNodesOnDrag:f1,nodeDragThreshold:l1}=$1.getState();if(a&&(!f1||!p||l1>0))SX({id:Q,store:$1,nodeRef:y});if(U)U(X1,{...C.userNode})},M1=(X1)=>{if(BX(X1.nativeEvent)||f)return;if(_X.includes(X1.key)&&a){let f1=X1.key==="Escape";SX({id:Q,store:$1,unselect:f1,nodeRef:y})}else if(p&&P.selected&&Object.prototype.hasOwnProperty.call(gq,X1.key)){X1.preventDefault();let{ariaLabelConfig:f1}=$1.getState();$1.setState({ariaLiveMessage:f1["node.a11yDescription.ariaLiveMessage"]({direction:X1.key.replace("Arrow","").toLowerCase(),x:~~C.positionAbsolute.x,y:~~C.positionAbsolute.y})}),x({direction:gq[X1.key],factor:X1.shiftKey?4:1})}},I1=()=>{if(f||!y.current?.matches(":focus-visible"))return;let{transform:X1,width:f1,height:l1,autoPanOnNodeFocus:W1,setCenter:S1}=$1.getState();if(!W1)return;if(!(Pq(new Map([[Q,P]]),{x:0,y:0,width:f1,height:l1},X1,!0).length>0))S1(P.position.x+d.width/2,P.position.y+d.height/2,{zoom:X1[2]})};return F1.jsx("div",{className:y0(["react-flow__node",`react-flow__node-${b}`,{[I]:p},P.className,{selected:P.selected,selectable:a,parent:v,draggable:p,dragging:u}]),ref:y,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:n?"all":"none",visibility:J1?"visible":"hidden",...P.style,...g},"data-id":Q,"data-testid":`rf__node-${Q}`,onMouseEnter:j,onMouseMove:i,onMouseLeave:q1,onContextMenu:Q1,onClick:L1,onDoubleClick:Y1,onKeyDown:_1?M1:void 0,tabIndex:_1?0:void 0,onFocus:_1?I1:void 0,role:P.ariaRole??(_1?"group":void 0),"aria-roledescription":"node","aria-describedby":f?void 0:`${jT}-${D}`,"aria-label":P.ariaLabel,...P.domAttributes,children:F1.jsx(OS,{value:Q,children:F1.jsx(E,{id:Q,data:P.data,type:b,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:P.selected??!1,selectable:a,draggable:p,deletable:P.deletable??!0,isConnectable:m,sourcePosition:P.sourcePosition,targetPosition:P.targetPosition,dragging:u,dragHandle:P.dragHandle,zIndex:C.z,parentId:P.parentId,...d})})})}var cS=K1.memo(pS),lS=(Q)=>({nodesConnectable:Q.nodesConnectable,nodesFocusable:Q.nodesFocusable,elementsSelectable:Q.elementsSelectable,onError:Q.onError});function gT(Q){let{nodesConnectable:U,nodesFocusable:Z,elementsSelectable:K,onError:X}=G0(lS,N0),W=xS(Q.onlyRenderVisibleElements),z=mS();return F1.jsx("div",{className:"react-flow__nodes",style:cq,children:W.map((B)=>{return F1.jsx(cS,{id:B,nodeTypes:Q.nodeTypes,nodeExtent:Q.nodeExtent,onClick:Q.onNodeClick,onMouseEnter:Q.onNodeMouseEnter,onMouseMove:Q.onNodeMouseMove,onMouseLeave:Q.onNodeMouseLeave,onContextMenu:Q.onNodeContextMenu,onDoubleClick:Q.onNodeDoubleClick,noDragClassName:Q.noDragClassName,noPanClassName:Q.noPanClassName,rfId:Q.rfId,disableKeyboardA11y:Q.disableKeyboardA11y,resizeObserver:z,nodesDraggable:Q.nodesDraggable??!0,nodesConnectable:U,nodesFocusable:Z,elementsSelectable:K,nodeClickDistance:Q.nodeClickDistance,onError:X},B)})})}gT.displayName="NodeRenderer";var rS=K1.memo(gT);function dS(Q){return G0(K1.useCallback((Z)=>{if(!Q)return Z.edges.map((X)=>X.id);let K=[];if(Z.width&&Z.height)for(let X of Z.edges){let W=Z.nodeLookup.get(X.source),z=Z.nodeLookup.get(X.target);if(W&&z&&IM({sourceNode:W,targetNode:z,width:Z.width,height:Z.height,transform:Z.transform}))K.push(X.id)}return K},[Q]),N0)}var iS=({color:Q="none",strokeWidth:U=1})=>{let Z={strokeWidth:U,...Q&&{stroke:Q}};return F1.jsx("polyline",{className:"arrow",style:Z,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},aS=({color:Q="none",strokeWidth:U=1})=>{let Z={strokeWidth:U,...Q&&{stroke:Q,fill:Q}};return F1.jsx("polyline",{className:"arrowclosed",style:Z,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},AT={[i7.Arrow]:iS,[i7.ArrowClosed]:aS};function sS(Q){let U=C0();return K1.useMemo(()=>{if(!Object.prototype.hasOwnProperty.call(AT,Q))return U.getState().onError?.("009",x2.error009(Q)),null;return AT[Q]},[Q])}var tS=({id:Q,type:U,color:Z,width:K=12.5,height:X=12.5,markerUnits:W="strokeWidth",strokeWidth:z,orient:B="auto-start-reverse"})=>{let O=sS(U);if(!O)return null;return F1.jsx("marker",{className:"react-flow__arrowhead",id:Q,markerWidth:`${K}`,markerHeight:`${X}`,viewBox:"-10 -10 20 20",markerUnits:W,orient:B,refX:"0",refY:"0",children:F1.jsx(O,{color:Z,strokeWidth:z})})},pT=({defaultColor:Q,rfId:U})=>{let Z=G0((W)=>W.edges),K=G0((W)=>W.defaultEdgeOptions),X=K1.useMemo(()=>{return NM(Z,{id:U,defaultColor:Q,defaultMarkerStart:K?.markerStart,defaultMarkerEnd:K?.markerEnd})},[Z,K,U,Q]);if(!X.length)return null;return F1.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:F1.jsx("defs",{children:X.map((W)=>F1.jsx(tS,{id:W.id,type:W.type,color:W.color,width:W.width,height:W.height,markerUnits:W.markerUnits,strokeWidth:W.strokeWidth,orient:W.orient},W.id))})})};pT.displayName="MarkerDefinitions";var oS=K1.memo(pT);function cT({x:Q,y:U,label:Z,labelStyle:K,labelShowBg:X=!0,labelBgStyle:W,labelBgPadding:z=[2,4],labelBgBorderRadius:B=2,children:O,className:T,...R}){let[L,M]=K1.useState({x:1,y:0,width:0,height:0}),I=y0(["react-flow__edge-textwrapper",T]),f=K1.useRef(null);if(K1.useEffect(()=>{if(f.current){let D=f.current.getBBox();M({x:D.x,y:D.y,width:D.width,height:D.height})}},[Z]),!Z)return null;return F1.jsxs("g",{transform:`translate(${Q-L.width/2} ${U-L.height/2})`,className:I,visibility:L.width?"visible":"hidden",...R,children:[X&&F1.jsx("rect",{width:L.width+2*z[0],x:-z[0],y:-z[1],height:L.height+2*z[1],className:"react-flow__edge-textbg",style:W,rx:B,ry:B}),F1.jsx("text",{className:"react-flow__edge-text",y:L.height/2,dy:"0.3em",ref:f,style:K,children:Z}),O]})}cT.displayName="EdgeText";var nS=K1.memo(cT);function lq({path:Q,labelX:U,labelY:Z,label:K,labelStyle:X,labelShowBg:W,labelBgStyle:z,labelBgPadding:B,labelBgBorderRadius:O,interactionWidth:T=20,...R}){return F1.jsxs(F1.Fragment,{children:[F1.jsx("path",{...R,d:Q,fill:"none",className:y0(["react-flow__edge-path",R.className])}),T?F1.jsx("path",{d:Q,fill:"none",strokeOpacity:0,strokeWidth:T,className:"react-flow__edge-interaction"}):null,K&&k5(U)&&k5(Z)?F1.jsx(nS,{x:U,y:Z,label:K,labelStyle:X,labelShowBg:W,labelBgStyle:z,labelBgPadding:B,labelBgBorderRadius:O}):null]})}function LT({pos:Q,x1:U,y1:Z,x2:K,y2:X}){if(Q===C1.Left||Q===C1.Right)return[0.5*(U+K),Z];return[U,0.5*(Z+X)]}function lT({sourceX:Q,sourceY:U,sourcePosition:Z=C1.Bottom,targetX:K,targetY:X,targetPosition:W=C1.Top}){let[z,B]=LT({pos:Z,x1:Q,y1:U,x2:K,y2:X}),[O,T]=LT({pos:W,x1:K,y1:X,x2:Q,y2:U}),[R,L,M,I]=Vq({sourceX:Q,sourceY:U,targetX:K,targetY:X,sourceControlX:z,sourceControlY:B,targetControlX:O,targetControlY:T});return[`M${Q},${U} C${z},${B} ${O},${T} ${K},${X}`,R,L,M,I]}function rT(Q){return K1.memo(({id:U,sourceX:Z,sourceY:K,targetX:X,targetY:W,sourcePosition:z,targetPosition:B,label:O,labelStyle:T,labelShowBg:R,labelBgStyle:L,labelBgPadding:M,labelBgBorderRadius:I,style:f,markerEnd:D,markerStart:V,interactionWidth:k})=>{let[h,P,C]=lT({sourceX:Z,sourceY:K,sourcePosition:z,targetX:X,targetY:W,targetPosition:B}),v=Q.isInternal?void 0:U;return F1.jsx(lq,{id:v,path:h,labelX:P,labelY:C,label:O,labelStyle:T,labelShowBg:R,labelBgStyle:L,labelBgPadding:M,labelBgBorderRadius:I,style:f,markerEnd:D,markerStart:V,interactionWidth:k})})}var eS=rT({isInternal:!1}),dT=rT({isInternal:!0});eS.displayName="SimpleBezierEdge";dT.displayName="SimpleBezierEdgeInternal";function iT(Q){return K1.memo(({id:U,sourceX:Z,sourceY:K,targetX:X,targetY:W,label:z,labelStyle:B,labelShowBg:O,labelBgStyle:T,labelBgPadding:R,labelBgBorderRadius:L,style:M,sourcePosition:I=C1.Bottom,targetPosition:f=C1.Top,markerEnd:D,markerStart:V,pathOptions:k,interactionWidth:h})=>{let[P,C,v]=TJ({sourceX:Z,sourceY:K,sourcePosition:I,targetX:X,targetY:W,targetPosition:f,borderRadius:k?.borderRadius,offset:k?.offset,stepPosition:k?.stepPosition}),b=Q.isInternal?void 0:U;return F1.jsx(lq,{id:b,path:P,labelX:C,labelY:v,label:z,labelStyle:B,labelShowBg:O,labelBgStyle:T,labelBgPadding:R,labelBgBorderRadius:L,style:M,markerEnd:D,markerStart:V,interactionWidth:h})})}var aT=iT({isInternal:!1}),sT=iT({isInternal:!0});aT.displayName="SmoothStepEdge";sT.displayName="SmoothStepEdgeInternal";function tT(Q){return K1.memo(({id:U,...Z})=>{let K=Q.isInternal?void 0:U;return F1.jsx(aT,{...Z,id:K,pathOptions:K1.useMemo(()=>({borderRadius:0,offset:Z.pathOptions?.offset}),[Z.pathOptions?.offset])})})}var _j=tT({isInternal:!1}),oT=tT({isInternal:!0});_j.displayName="StepEdge";oT.displayName="StepEdgeInternal";function nT(Q){return K1.memo(({id:U,sourceX:Z,sourceY:K,targetX:X,targetY:W,label:z,labelStyle:B,labelShowBg:O,labelBgStyle:T,labelBgPadding:R,labelBgBorderRadius:L,style:M,markerEnd:I,markerStart:f,interactionWidth:D})=>{let[V,k,h]=Dq({sourceX:Z,sourceY:K,targetX:X,targetY:W}),P=Q.isInternal?void 0:U;return F1.jsx(lq,{id:P,path:V,labelX:k,labelY:h,label:z,labelStyle:B,labelShowBg:O,labelBgStyle:T,labelBgPadding:R,labelBgBorderRadius:L,style:M,markerEnd:I,markerStart:f,interactionWidth:D})})}var Jj=nT({isInternal:!1}),eT=nT({isInternal:!0});Jj.displayName="StraightEdge";eT.displayName="StraightEdgeInternal";function _R(Q){return K1.memo(({id:U,sourceX:Z,sourceY:K,targetX:X,targetY:W,sourcePosition:z=C1.Bottom,targetPosition:B=C1.Top,label:O,labelStyle:T,labelShowBg:R,labelBgStyle:L,labelBgPadding:M,labelBgBorderRadius:I,style:f,markerEnd:D,markerStart:V,pathOptions:k,interactionWidth:h})=>{let[P,C,v]=kq({sourceX:Z,sourceY:K,sourcePosition:z,targetX:X,targetY:W,targetPosition:B,curvature:k?.curvature}),b=Q.isInternal?void 0:U;return F1.jsx(lq,{id:b,path:P,labelX:C,labelY:v,label:O,labelStyle:T,labelShowBg:R,labelBgStyle:L,labelBgPadding:M,labelBgBorderRadius:I,style:f,markerEnd:D,markerStart:V,interactionWidth:h})})}var $j=_R({isInternal:!1}),JR=_R({isInternal:!0});$j.displayName="BezierEdge";JR.displayName="BezierEdgeInternal";var MT={default:JR,straight:eT,step:oT,smoothstep:sT,simplebezier:dT},TT={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},Qj=(Q,U,Z)=>{if(Z===C1.Left)return Q-U;if(Z===C1.Right)return Q+U;return Q},qj=(Q,U,Z)=>{if(Z===C1.Top)return Q-U;if(Z===C1.Bottom)return Q+U;return Q},RT="react-flow__edgeupdater";function OT({position:Q,centerX:U,centerY:Z,radius:K=10,onMouseDown:X,onMouseEnter:W,onMouseOut:z,type:B}){return F1.jsx("circle",{onMouseDown:X,onMouseEnter:W,onMouseOut:z,className:y0([RT,`${RT}-${B}`]),cx:Qj(U,K,Q),cy:qj(Z,K,Q),r:K,stroke:"transparent",fill:"transparent"})}function Uj({isReconnectable:Q,reconnectRadius:U,edge:Z,sourceX:K,sourceY:X,targetX:W,targetY:z,sourcePosition:B,targetPosition:O,onReconnect:T,onReconnectStart:R,onReconnectEnd:L,setReconnecting:M,setUpdateHover:I}){let f=C0(),D=(C,v)=>{if(C.button!==0)return;let{autoPanOnConnect:b,domNode:E,connectionMode:p,connectionRadius:a,lib:m,onConnectStart:_1,cancelConnection:$1,nodeLookup:J1,rfId:y,panBy:u,updateConnection:x}=f.getState(),d=v.type==="target",g=(i,q1)=>{M(!1),L?.(i,Z,v.type,q1)},n=(i)=>T?.(Z,i),j=(i,q1)=>{M(!0),R?.(C,Z,v.type),_1?.(i,q1)};bq.onPointerDown(C.nativeEvent,{autoPanOnConnect:b,connectionMode:p,connectionRadius:a,domNode:E,handleId:v.id,nodeId:v.nodeId,nodeLookup:J1,isTarget:d,edgeUpdaterType:v.type,lib:m,flowId:y,cancelConnection:$1,panBy:u,isValidConnection:(...i)=>f.getState().isValidConnection?.(...i)??!0,onConnect:n,onConnectStart:j,onConnectEnd:(...i)=>f.getState().onConnectEnd?.(...i),onReconnectEnd:g,updateConnection:x,getTransform:()=>f.getState().transform,getFromHandle:()=>f.getState().connection.fromHandle,dragThreshold:f.getState().connectionDragThreshold,handleDomNode:C.currentTarget})},V=(C)=>D(C,{nodeId:Z.target,id:Z.targetHandle??null,type:"target"}),k=(C)=>D(C,{nodeId:Z.source,id:Z.sourceHandle??null,type:"source"}),h=()=>I(!0),P=()=>I(!1);return F1.jsxs(F1.Fragment,{children:[(Q===!0||Q==="source")&&F1.jsx(OT,{position:B,centerX:K,centerY:X,radius:U,onMouseDown:V,onMouseEnter:h,onMouseOut:P,type:"source"}),(Q===!0||Q==="target")&&F1.jsx(OT,{position:O,centerX:W,centerY:z,radius:U,onMouseDown:k,onMouseEnter:h,onMouseOut:P,type:"target"})]})}function Gj({id:Q,edgesFocusable:U,edgesReconnectable:Z,elementsSelectable:K,onClick:X,onDoubleClick:W,onContextMenu:z,onMouseEnter:B,onMouseMove:O,onMouseLeave:T,reconnectRadius:R,onReconnect:L,onReconnectStart:M,onReconnectEnd:I,rfId:f,edgeTypes:D,noPanClassName:V,onError:k,disableKeyboardA11y:h}){let P=G0((S1)=>S1.edgeLookup.get(Q)),C=G0((S1)=>S1.defaultEdgeOptions);P=C?{...C,...P}:P;let v=P.type||"default",b=D?.[v]||MT[v];if(b===void 0)k?.("011",x2.error011(v)),v="default",b=D?.default||MT.default;let E=!!(P.focusable||U&&typeof P.focusable>"u"),p=typeof L<"u"&&(P.reconnectable||Z&&typeof P.reconnectable>"u"),a=!!(P.selectable||K&&typeof P.selectable>"u"),m=K1.useRef(null),[_1,$1]=K1.useState(!1),[J1,y]=K1.useState(!1),u=C0(),{zIndex:x=P.zIndex,sourceX:d,sourceY:g,targetX:n,targetY:j,sourcePosition:i,targetPosition:q1}=G0(K1.useCallback((S1)=>{let v1=S1.nodeLookup.get(P.source),c1=S1.nodeLookup.get(P.target);if(!v1||!c1)return TT;let E1=PM({id:Q,sourceNode:v1,targetNode:c1,sourceHandle:P.sourceHandle||null,targetHandle:P.targetHandle||null,connectionMode:S1.connectionMode,onError:k}),j1=wM({selected:P.selected,zIndex:P.zIndex,sourceNode:v1,targetNode:c1,elevateOnSelect:S1.elevateEdgesOnSelect,zIndexMode:S1.zIndexMode});return{...E1||TT,zIndex:j1}},[P.source,P.target,P.sourceHandle,P.targetHandle,P.selected,P.zIndex,k]),N0),Q1=K1.useMemo(()=>P.markerStart?`url('#${yq(P.markerStart,f)}')`:void 0,[P.markerStart,f]),Y1=K1.useMemo(()=>P.markerEnd?`url('#${yq(P.markerEnd,f)}')`:void 0,[P.markerEnd,f]);if(P.hidden||d===null||g===null||n===null||j===null)return null;let L1=(S1)=>{let{addSelectedEdges:v1,unselectNodesAndEdges:c1,multiSelectionActive:E1}=u.getState();if(a)if(u.setState({nodesSelectionActive:!1}),P.selected&&E1)c1({nodes:[],edges:[P]}),m.current?.blur();else v1([Q]);if(X)X(S1,P)},M1=W?(S1)=>{W(S1,{...P})}:void 0,I1=z?(S1)=>{z(S1,{...P})}:void 0,X1=B?(S1)=>{B(S1,{...P})}:void 0,f1=O?(S1)=>{O(S1,{...P})}:void 0,l1=T?(S1)=>{T(S1,{...P})}:void 0,W1=(S1)=>{if(!h&&_X.includes(S1.key)&&a){let{unselectNodesAndEdges:v1,addSelectedEdges:c1}=u.getState();if(S1.key==="Escape")m.current?.blur(),v1({edges:[P]});else c1([Q])}};return F1.jsx("svg",{style:{zIndex:x},children:F1.jsxs("g",{className:y0(["react-flow__edge",`react-flow__edge-${v}`,P.className,V,{selected:P.selected,animated:P.animated,inactive:!a&&!X,updating:_1,selectable:a}]),onClick:L1,onDoubleClick:M1,onContextMenu:I1,onMouseEnter:X1,onMouseMove:f1,onMouseLeave:l1,onKeyDown:E?W1:void 0,tabIndex:E?0:void 0,role:P.ariaRole??(E?"group":"img"),"aria-roledescription":"edge","data-id":Q,"data-testid":`rf__edge-${Q}`,"aria-label":P.ariaLabel===null?void 0:P.ariaLabel||`Edge from ${P.source} to ${P.target}`,"aria-describedby":E?`${VT}-${f}`:void 0,ref:m,...P.domAttributes,children:[!J1&&F1.jsx(b,{id:Q,source:P.source,target:P.target,type:P.type,selected:P.selected,animated:P.animated,selectable:a,deletable:P.deletable??!0,label:P.label,labelStyle:P.labelStyle,labelShowBg:P.labelShowBg,labelBgStyle:P.labelBgStyle,labelBgPadding:P.labelBgPadding,labelBgBorderRadius:P.labelBgBorderRadius,sourceX:d,sourceY:g,targetX:n,targetY:j,sourcePosition:i,targetPosition:q1,data:P.data,style:P.style,sourceHandleId:P.sourceHandle,targetHandleId:P.targetHandle,markerStart:Q1,markerEnd:Y1,pathOptions:"pathOptions"in P?P.pathOptions:void 0,interactionWidth:P.interactionWidth}),p&&F1.jsx(Uj,{edge:P,isReconnectable:p,reconnectRadius:R,onReconnect:L,onReconnectStart:M,onReconnectEnd:I,sourceX:d,sourceY:g,targetX:n,targetY:j,sourcePosition:i,targetPosition:q1,setUpdateHover:$1,setReconnecting:y})]})})}var Zj=K1.memo(Gj),Fj=(Q)=>({edgesFocusable:Q.edgesFocusable,edgesReconnectable:Q.edgesReconnectable,elementsSelectable:Q.elementsSelectable,connectionMode:Q.connectionMode,onError:Q.onError});function $R({defaultMarkerColor:Q,onlyRenderVisibleElements:U,rfId:Z,edgeTypes:K,noPanClassName:X,onReconnect:W,onEdgeContextMenu:z,onEdgeMouseEnter:B,onEdgeMouseMove:O,onEdgeMouseLeave:T,onEdgeClick:R,reconnectRadius:L,onEdgeDoubleClick:M,onReconnectStart:I,onReconnectEnd:f,disableKeyboardA11y:D}){let{edgesFocusable:V,edgesReconnectable:k,elementsSelectable:h,onError:P}=G0(Fj,N0),C=dS(U);return F1.jsxs("div",{className:"react-flow__edges",children:[F1.jsx(oS,{defaultColor:Q,rfId:Z}),C.map((v)=>{return F1.jsx(Zj,{id:v,edgesFocusable:V,edgesReconnectable:k,elementsSelectable:h,noPanClassName:X,onReconnect:W,onContextMenu:z,onMouseEnter:B,onMouseMove:O,onMouseLeave:T,onClick:R,reconnectRadius:L,onDoubleClick:M,onReconnectStart:I,onReconnectEnd:f,rfId:Z,onError:P,edgeTypes:K,disableKeyboardA11y:D},v)})]})}$R.displayName="EdgeRenderer";var Kj=K1.memo($R),wT=(Q)=>`translate(${Q[0]}px,${Q[1]}px) scale(${Q[2]})`;function Xj({children:Q}){let U=C0(),Z=K1.useRef(null),[K]=K1.useState(()=>U.getState().transform);return ET(()=>{let X=null,W=()=>{let z=U.getState().transform;if(X&&z[0]===X[0]&&z[1]===X[1]&&z[2]===X[2])return;if(X=z,Z.current)Z.current.style.transform=wT(z)};return W(),U.subscribe(W)},[U]),F1.jsx("div",{ref:Z,className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:wT(K)},children:Q})}function Hj(Q){let U=OJ(),Z=K1.useRef(!1);K1.useEffect(()=>{if(!Z.current&&U.viewportInitialized&&Q)setTimeout(()=>Q(U),1),Z.current=!0},[Q,U.viewportInitialized])}var Yj=(Q)=>Q.panZoom?.syncViewport;function Wj(Q){let U=G0(Yj),Z=C0();return K1.useEffect(()=>{if(Q)U?.(Q),Z.setState({transform:[Q.x,Q.y,Q.zoom]})},[Q,U]),null}function IT(Q){return Q.connection.inProgress?{...Q.connection,to:n7(Q.connection.to,Q.transform)}:{...Q.connection}}function zj(Q){if(Q)return(Z)=>{let K=IT(Z);return Q(K)};return IT}function Bj(Q){let U=zj(Q);return G0(U,N0)}var Aj=(Q)=>({nodesConnectable:Q.nodesConnectable,isValid:Q.connection.isValid,inProgress:Q.connection.inProgress,width:Q.width,height:Q.height});function Lj({containerStyle:Q,style:U,type:Z,component:K}){let{nodesConnectable:X,width:W,height:z,isValid:B,inProgress:O}=G0(Aj,N0);if(!(W&&X&&O))return null;return F1.jsx("svg",{style:Q,width:W,height:z,className:"react-flow__connectionline react-flow__container",children:F1.jsx("g",{className:y0(["react-flow__connection",WX(B)]),children:F1.jsx(QR,{style:U,type:Z,CustomComponent:K,isValid:B})})})}var QR=({style:Q,type:U=y4.Bezier,CustomComponent:Z,isValid:K})=>{let{inProgress:X,from:W,fromNode:z,fromHandle:B,fromPosition:O,to:T,toNode:R,toHandle:L,toPosition:M,pointer:I}=Bj();if(!X)return;if(Z)return F1.jsx(Z,{connectionLineType:U,connectionLineStyle:Q,fromNode:z,fromHandle:B,fromX:W.x,fromY:W.y,toX:T.x,toY:T.y,fromPosition:O,toPosition:M,connectionStatus:WX(K),toNode:R,toHandle:L,pointer:I});let f="",D={sourceX:W.x,sourceY:W.y,sourcePosition:O,targetX:T.x,targetY:T.y,targetPosition:M};switch(U){case y4.Bezier:[f]=kq(D);break;case y4.SimpleBezier:[f]=lT(D);break;case y4.Step:[f]=TJ({...D,borderRadius:0});break;case y4.SmoothStep:[f]=TJ(D);break;default:[f]=Dq(D)}return F1.jsx("path",{d:f,fill:"none",className:"react-flow__connection-path",style:Q})};QR.displayName="ConnectionLine";var Mj={};function fT(Q=Mj){let U=K1.useRef(Q),Z=C0();K1.useEffect(()=>{{let K=new Set([...Object.keys(U.current),...Object.keys(Q)]);for(let X of K)if(U.current[X]!==Q[X]){Z.getState().onError?.("002",x2.error002());break}U.current=Q}},[Q])}function Tj(){let Q=C0(),U=K1.useRef(!1);K1.useEffect(()=>{if(!U.current){let Z=document.querySelector(".react-flow__pane");if(Z&&window.getComputedStyle(Z).zIndex!=="1")Q.getState().onError?.("013",x2.error013("react"));U.current=!0}},[])}function qR({nodeTypes:Q,edgeTypes:U,onInit:Z,onNodeClick:K,onEdgeClick:X,onNodeDoubleClick:W,onEdgeDoubleClick:z,onNodeMouseEnter:B,onNodeMouseMove:O,onNodeMouseLeave:T,onNodeContextMenu:R,onSelectionContextMenu:L,onSelectionStart:M,onSelectionEnd:I,connectionLineType:f,connectionLineStyle:D,connectionLineComponent:V,connectionLineContainerStyle:k,selectionKeyCode:h,selectionOnDrag:P,selectionMode:C,multiSelectionKeyCode:v,panActivationKeyCode:b,zoomActivationKeyCode:E,deleteKeyCode:p,onlyRenderVisibleElements:a,elementsSelectable:m,defaultViewport:_1,translateExtent:$1,minZoom:J1,maxZoom:y,preventScrolling:u,defaultMarkerColor:x,zoomOnScroll:d,zoomOnPinch:g,panOnScroll:n,panOnScrollSpeed:j,panOnScrollMode:i,zoomOnDoubleClick:q1,panOnDrag:Q1,autoPanOnSelection:Y1,onPaneClick:L1,onPaneMouseEnter:M1,onPaneMouseMove:I1,onPaneMouseLeave:X1,onPaneScroll:f1,onPaneContextMenu:l1,paneClickDistance:W1,nodeClickDistance:S1,onEdgeContextMenu:v1,onEdgeMouseEnter:c1,onEdgeMouseMove:E1,onEdgeMouseLeave:j1,reconnectRadius:V0,onReconnect:b1,onReconnectStart:Z2,onReconnectEnd:_0,noDragClassName:h2,noWheelClassName:z2,noPanClassName:I2,disableKeyboardA11y:f2,nodeExtent:P2,rfId:B2,viewport:A2,onViewportChange:L2,nodesDraggable:M3}){return fT(Q),fT(U),Tj(),Hj(Z),Wj(A2),F1.jsx(bS,{onPaneClick:L1,onPaneMouseEnter:M1,onPaneMouseMove:I1,onPaneMouseLeave:X1,onPaneContextMenu:l1,onPaneScroll:f1,paneClickDistance:W1,deleteKeyCode:p,selectionKeyCode:h,selectionOnDrag:P,selectionMode:C,onSelectionStart:M,onSelectionEnd:I,multiSelectionKeyCode:v,panActivationKeyCode:b,zoomActivationKeyCode:E,elementsSelectable:m,zoomOnScroll:d,zoomOnPinch:g,zoomOnDoubleClick:q1,panOnScroll:n,panOnScrollSpeed:j,panOnScrollMode:i,panOnDrag:Q1,autoPanOnSelection:Y1,defaultViewport:_1,translateExtent:$1,minZoom:J1,maxZoom:y,onSelectionContextMenu:L,preventScrolling:u,noDragClassName:h2,noWheelClassName:z2,noPanClassName:I2,disableKeyboardA11y:f2,onViewportChange:L2,isControlledViewport:!!A2,children:F1.jsxs(Xj,{children:[F1.jsx(Kj,{edgeTypes:U,onEdgeClick:X,onEdgeDoubleClick:z,onReconnect:b1,onReconnectStart:Z2,onReconnectEnd:_0,onlyRenderVisibleElements:a,onEdgeContextMenu:v1,onEdgeMouseEnter:c1,onEdgeMouseMove:E1,onEdgeMouseLeave:j1,reconnectRadius:V0,defaultMarkerColor:x,noPanClassName:I2,disableKeyboardA11y:f2,rfId:B2}),F1.jsx(Lj,{style:D,type:f,component:V,containerStyle:k}),F1.jsx("div",{className:"react-flow__edgelabel-renderer"}),F1.jsx(rS,{nodeTypes:Q,onNodeClick:K,onNodeDoubleClick:W,onNodeMouseEnter:B,onNodeMouseMove:O,onNodeMouseLeave:T,onNodeContextMenu:R,nodeClickDistance:S1,onlyRenderVisibleElements:a,noPanClassName:I2,noDragClassName:h2,disableKeyboardA11y:f2,nodeExtent:P2,rfId:B2,nodesDraggable:M3}),F1.jsx("div",{className:"react-flow__viewport-portal"})]})})}qR.displayName="GraphView";var Rj=K1.memo(qR),Oj=KX("React Flow","https://reactflow.dev/"),PT=({nodes:Q,edges:U,defaultNodes:Z,defaultEdges:K,width:X,height:W,fitView:z,fitViewOptions:B,minZoom:O=0.5,maxZoom:T=2,nodeOrigin:R,nodeExtent:L,zIndexMode:M="basic"}={})=>{let I=new Map,f=new Map,D=new Map,V=new Map,k=K??U??[],h=Z??Q??[],P=R??[0,0],C=L??s7;wX(D,V,k);let{nodesInitialized:v}=vq(h,I,f,{nodeOrigin:P,nodeExtent:C,zIndexMode:M}),b=[0,0,1];if(z&&X&&W){let E=f8(I,{filter:(_1)=>!!((_1.width||_1.initialWidth)&&(_1.height||_1.initialHeight))}),{x:p,y:a,zoom:m}=MJ(E,X,W,O,T,B?.padding??0.1);b=[p,a,m]}return{rfId:"1",width:X??0,height:W??0,transform:b,nodes:h,nodesInitialized:v,nodeLookup:I,parentLookup:f,edges:k,edgeLookup:V,connectionLookup:D,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:Z!==void 0,hasDefaultEdges:K!==void 0,panZoom:null,minZoom:O,maxZoom:T,translateExtent:s7,nodeExtent:C,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:A6.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:P,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:z??!1,fitViewOptions:B,fitViewResolver:null,connection:{...$X},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Oj,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:JX,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}},wj=({nodes:Q,edges:U,defaultNodes:Z,defaultEdges:K,width:X,height:W,fitView:z,fitViewOptions:B,minZoom:O,maxZoom:T,nodeOrigin:R,nodeExtent:L,zIndexMode:M})=>nM((I,f)=>{async function D(){let{nodeLookup:V,panZoom:k,fitViewOptions:h,fitViewResolver:P,width:C,height:v,minZoom:b,maxZoom:E}=f();if(!k)return;await BM({nodes:V,width:C,height:v,panZoom:k,minZoom:b,maxZoom:E},h),P?.resolve(!0),I({fitViewResolver:null})}return{...PT({nodes:Q,edges:U,width:X,height:W,fitView:z,fitViewOptions:B,minZoom:O,maxZoom:T,nodeOrigin:R,nodeExtent:L,defaultNodes:Z,defaultEdges:K,zIndexMode:M}),setNodes:(V)=>{let{nodeLookup:k,parentLookup:h,nodeOrigin:P,nodeExtent:C,elevateNodesOnSelect:v,fitViewQueued:b,zIndexMode:E,nodesSelectionActive:p}=f(),{nodesInitialized:a,hasSelectedNodes:m}=vq(V,k,h,{nodeOrigin:P,nodeExtent:C,elevateNodesOnSelect:v,checkEquality:!0,zIndexMode:E}),_1=p&&m;if(b&&a)D(),I({nodes:V,nodesInitialized:a,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:_1});else I({nodes:V,nodesInitialized:a,nodesSelectionActive:_1})},setEdges:(V)=>{let{connectionLookup:k,edgeLookup:h}=f();wX(k,h,V),I({edges:V})},setDefaultNodesAndEdges:(V,k)=>{if(V){let{setNodes:h}=f();h(V),I({hasDefaultNodes:!0})}if(k){let{setEdges:h}=f();h(k),I({hasDefaultEdges:!0})}},updateNodeInternals:(V)=>{let{triggerNodeChanges:k,nodeLookup:h,parentLookup:P,domNode:C,nodeOrigin:v,nodeExtent:b,debug:E,fitViewQueued:p,zIndexMode:a}=f(),{changes:m,updatedInternals:_1}=kM(V,h,P,C,v,b,a);if(!_1)return;if(jM(h,P,{nodeOrigin:v,nodeExtent:b,zIndexMode:a}),p)D(),I({fitViewQueued:!1,fitViewOptions:void 0});else I({});if(m?.length>0){if(E)console.log("React Flow: trigger node changes",m);k?.(m)}},updateNodePositions:(V,k=!1)=>{let h=[],P=[],{nodeLookup:C,triggerNodeChanges:v,connection:b,updateConnection:E,onNodesChangeMiddlewareMap:p}=f();for(let[a,m]of V){let _1=C.get(a),$1=!!(_1?.expandParent&&_1?.parentId&&m?.position),J1={id:a,type:"position",position:$1?{x:Math.max(0,m.position.x),y:Math.max(0,m.position.y)}:m.position,dragging:k};if(_1&&b.inProgress&&b.fromNode.id===_1.id){let y=L6(_1,b.fromHandle,C1.Left,!0);E({...b,from:y})}if($1&&_1.parentId)h.push({id:a,parentId:_1.parentId,rect:{...m.internals.positionAbsolute,width:m.measured.width??0,height:m.measured.height??0}});P.push(J1)}if(h.length>0){let{parentLookup:a,nodeOrigin:m}=f(),_1=Eq(h,C,a,m);P.push(..._1)}for(let a of p.values())P=a(P);v(P)},triggerNodeChanges:(V)=>{let{onNodesChange:k,setNodes:h,nodes:P,hasDefaultNodes:C,debug:v}=f();if(V?.length){if(C){let b=yT(V,P);h(b)}if(v)console.log("React Flow: trigger node changes",V);k?.(V)}},triggerEdgeChanges:(V)=>{let{onEdgesChange:k,setEdges:h,edges:P,hasDefaultEdges:C,debug:v}=f();if(V?.length){if(C){let b=QS(V,P);h(b)}if(v)console.log("React Flow: trigger edge changes",V);k?.(V)}},addSelectedNodes:(V)=>{let{multiSelectionActive:k,edgeLookup:h,nodeLookup:P,triggerNodeChanges:C,triggerEdgeChanges:v}=f();if(k){let b=V.map((E)=>P8(E,!0));C(b);return}C(_9(P,new Set([...V]),!0)),v(_9(h))},addSelectedEdges:(V)=>{let{multiSelectionActive:k,edgeLookup:h,nodeLookup:P,triggerNodeChanges:C,triggerEdgeChanges:v}=f();if(k){let b=V.map((E)=>P8(E,!0));v(b);return}v(_9(h,new Set([...V]))),C(_9(P,new Set,!0))},unselectNodesAndEdges:({nodes:V,edges:k}={})=>{let{edges:h,nodes:P,nodeLookup:C,triggerNodeChanges:v,triggerEdgeChanges:b}=f(),E=V?V:P,p=k?k:h,a=[];for(let _1 of E){if(!_1.selected)continue;let $1=C.get(_1.id);if($1)$1.selected=!1;a.push(P8(_1.id,!1))}let m=[];for(let _1 of p){if(!_1.selected)continue;m.push(P8(_1.id,!1))}v(a),b(m)},setMinZoom:(V)=>{let{panZoom:k,maxZoom:h}=f();k?.setScaleExtent([V,h]),I({minZoom:V})},setMaxZoom:(V)=>{let{panZoom:k,minZoom:h}=f();k?.setScaleExtent([h,V]),I({maxZoom:V})},setTranslateExtent:(V)=>{f().panZoom?.setTranslateExtent(V),I({translateExtent:V})},resetSelectedElements:()=>{let{edges:V,nodes:k,triggerNodeChanges:h,triggerEdgeChanges:P,elementsSelectable:C}=f();if(!C)return;let v=k.reduce((E,p)=>p.selected?[...E,P8(p.id,!1)]:E,[]),b=V.reduce((E,p)=>p.selected?[...E,P8(p.id,!1)]:E,[]);h(v),P(b)},setNodeExtent:(V)=>{let{nodes:k,nodeLookup:h,parentLookup:P,nodeOrigin:C,elevateNodesOnSelect:v,nodeExtent:b,zIndexMode:E}=f();if(V[0][0]===b[0][0]&&V[0][1]===b[0][1]&&V[1][0]===b[1][0]&&V[1][1]===b[1][1])return;vq(k,h,P,{nodeOrigin:C,nodeExtent:V,elevateNodesOnSelect:v,checkEquality:!1,zIndexMode:E}),I({nodeExtent:V})},panBy:(V)=>{let{transform:k,width:h,height:P,panZoom:C,translateExtent:v}=f();return DM({delta:V,panZoom:C,transform:k,translateExtent:v,width:h,height:P})},setCenter:async(V,k,h)=>{let{width:P,height:C,maxZoom:v,panZoom:b}=f();if(!b)return!1;let E=typeof h?.zoom<"u"?h.zoom:v;return await b.setViewport({x:P/2-V*E,y:C/2-k*E,zoom:E},{duration:h?.duration,ease:h?.ease,interpolate:h?.interpolate}),!0},cancelConnection:()=>{I({connection:{...$X}})},updateConnection:(V)=>{I({connection:V})},reset:()=>I({...PT()})}},Object.is);function kX({initialNodes:Q,initialEdges:U,defaultNodes:Z,defaultEdges:K,initialWidth:X,initialHeight:W,initialMinZoom:z,initialMaxZoom:B,initialFitViewOptions:O,fitView:T,nodeOrigin:R,nodeExtent:L,zIndexMode:M,children:I}){let[f]=K1.useState(()=>wj({nodes:Q,edges:U,defaultNodes:Z,defaultEdges:K,width:X,height:W,fitView:T,minZoom:z,maxZoom:B,fitViewOptions:O,nodeOrigin:R,nodeExtent:L,zIndexMode:M}));return F1.jsx(uC,{value:f,children:F1.jsx(FS,{children:F1.jsx(IS,{children:I})})})}function Ij({children:Q,nodes:U,edges:Z,defaultNodes:K,defaultEdges:X,width:W,height:z,fitView:B,fitViewOptions:O,minZoom:T,maxZoom:R,nodeOrigin:L,nodeExtent:M,zIndexMode:I}){if(K1.useContext(pq))return F1.jsx(F1.Fragment,{children:Q});return F1.jsx(kX,{initialNodes:U,initialEdges:Z,defaultNodes:K,defaultEdges:X,initialWidth:W,initialHeight:z,fitView:B,initialFitViewOptions:O,initialMinZoom:T,initialMaxZoom:R,nodeOrigin:L,nodeExtent:M,zIndexMode:I,children:Q})}var fj={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function Pj({nodes:Q,edges:U,defaultNodes:Z,defaultEdges:K,className:X,nodeTypes:W,edgeTypes:z,onNodeClick:B,onEdgeClick:O,onInit:T,onMove:R,onMoveStart:L,onMoveEnd:M,onConnect:I,onConnectStart:f,onConnectEnd:D,onClickConnectStart:V,onClickConnectEnd:k,onNodeMouseEnter:h,onNodeMouseMove:P,onNodeMouseLeave:C,onNodeContextMenu:v,onNodeDoubleClick:b,onNodeDragStart:E,onNodeDrag:p,onNodeDragStop:a,onNodesDelete:m,onEdgesDelete:_1,onDelete:$1,onSelectionChange:J1,onSelectionDragStart:y,onSelectionDrag:u,onSelectionDragStop:x,onSelectionContextMenu:d,onSelectionStart:g,onSelectionEnd:n,onBeforeDelete:j,connectionMode:i,connectionLineType:q1=y4.Bezier,connectionLineStyle:Q1,connectionLineComponent:Y1,connectionLineContainerStyle:L1,deleteKeyCode:M1="Backspace",selectionKeyCode:I1="Shift",selectionOnDrag:X1=!1,selectionMode:f1=R8.Full,panActivationKeyCode:l1="Space",multiSelectionKeyCode:W1=e7()?"Meta":"Control",zoomActivationKeyCode:S1=e7()?"Meta":"Control",snapToGrid:v1,snapGrid:c1,onlyRenderVisibleElements:E1=!1,selectNodesOnDrag:j1,nodesDraggable:V0,autoPanOnNodeFocus:b1,nodesConnectable:Z2,nodesFocusable:_0,nodeOrigin:h2=kT,edgesFocusable:z2,edgesReconnectable:I2,elementsSelectable:f2=!0,defaultViewport:P2=tC,minZoom:B2=0.5,maxZoom:A2=2,translateExtent:L2=s7,preventScrolling:M3=!0,nodeExtent:v5,defaultMarkerColor:b4="#b1b1b7",zoomOnScroll:u4=!0,zoomOnPinch:x4=!0,panOnScroll:I6=!1,panOnScrollSpeed:e5=0.5,panOnScrollMode:S=B3.Free,zoomOnDoubleClick:e=!0,panOnDrag:A1=!0,onPaneClick:R1,onPaneMouseEnter:P1,onPaneMouseMove:h1,onPaneMouseLeave:m1,onPaneScroll:U0,onPaneContextMenu:V1,paneClickDistance:J2=1,nodeClickDistance:N2=0,children:_4,onReconnect:f6,onReconnectStart:SJ,onReconnectEnd:v8,onEdgeContextMenu:E8,onEdgeDoubleClick:E5,onEdgeMouseEnter:m2,onEdgeMouseMove:jJ,onEdgeMouseLeave:eq,reconnectRadius:G9=10,onNodesChange:VJ,onEdgesChange:b8,noDragClassName:g2="nodrag",noWheelClassName:kJ="nowheel",noPanClassName:u8="nopan",fitView:Z9,fitViewOptions:x8,connectOnClick:DJ,attributionPosition:yJ,proOptions:T3,defaultEdgeOptions:vJ,elevateNodesOnSelect:EJ=!0,elevateEdgesOnSelect:bJ=!1,disableKeyboardA11y:F9=!1,autoPanOnConnect:uJ,autoPanOnNodeDrag:C2,autoPanOnSelection:R3=!0,autoPanSpeed:h4,connectionRadius:xJ,isValidConnection:P6,onError:h8,style:K9,id:O3,nodeDragThreshold:w3,connectionDragThreshold:X9,viewport:_U,onViewportChange:JU,width:hJ,height:H9,colorMode:Y9="light",debug:mJ,onScroll:W9,ariaLabelConfig:gJ,zIndexMode:pJ="basic",...cJ},z9){let I3=O3||"1",N6=_S(Y9),$U=K1.useCallback((B9)=>{B9.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),W9?.(B9)},[W9]);return F1.jsx("div",{"data-testid":"rf__wrapper",...cJ,onScroll:$U,style:{...K9,...fj},ref:z9,className:y0(["react-flow",X,N6]),id:O3,role:"application",children:F1.jsxs(Ij,{nodes:Q,edges:U,width:hJ,height:H9,fitView:Z9,fitViewOptions:x8,minZoom:B2,maxZoom:A2,nodeOrigin:h2,nodeExtent:v5,zIndexMode:pJ,children:[F1.jsx(eC,{nodes:Q,edges:U,defaultNodes:Z,defaultEdges:K,onConnect:I,onConnectStart:f,onConnectEnd:D,onClickConnectStart:V,onClickConnectEnd:k,nodesDraggable:V0,autoPanOnNodeFocus:b1,nodesConnectable:Z2,nodesFocusable:_0,edgesFocusable:z2,edgesReconnectable:I2,elementsSelectable:f2,elevateNodesOnSelect:EJ,elevateEdgesOnSelect:bJ,minZoom:B2,maxZoom:A2,nodeExtent:v5,onNodesChange:VJ,onEdgesChange:b8,snapToGrid:v1,snapGrid:c1,connectionMode:i,translateExtent:L2,connectOnClick:DJ,defaultEdgeOptions:vJ,fitView:Z9,fitViewOptions:x8,onNodesDelete:m,onEdgesDelete:_1,onDelete:$1,onNodeDragStart:E,onNodeDrag:p,onNodeDragStop:a,onSelectionDrag:u,onSelectionDragStart:y,onSelectionDragStop:x,onMove:R,onMoveStart:L,onMoveEnd:M,noPanClassName:u8,nodeOrigin:h2,rfId:I3,autoPanOnConnect:uJ,autoPanOnNodeDrag:C2,autoPanSpeed:h4,onError:h8,connectionRadius:xJ,isValidConnection:P6,selectNodesOnDrag:j1,nodeDragThreshold:w3,connectionDragThreshold:X9,onBeforeDelete:j,debug:mJ,ariaLabelConfig:gJ,zIndexMode:pJ}),F1.jsx(Rj,{onInit:T,onNodeClick:B,onEdgeClick:O,onNodeMouseEnter:h,onNodeMouseMove:P,onNodeMouseLeave:C,onNodeContextMenu:v,onNodeDoubleClick:b,nodeTypes:W,edgeTypes:z,connectionLineType:q1,connectionLineStyle:Q1,connectionLineComponent:Y1,connectionLineContainerStyle:L1,selectionKeyCode:I1,selectionOnDrag:X1,selectionMode:f1,deleteKeyCode:M1,multiSelectionKeyCode:W1,panActivationKeyCode:l1,zoomActivationKeyCode:S1,onlyRenderVisibleElements:E1,defaultViewport:P2,translateExtent:L2,minZoom:B2,maxZoom:A2,preventScrolling:M3,zoomOnScroll:u4,zoomOnPinch:x4,zoomOnDoubleClick:e,panOnScroll:I6,panOnScrollSpeed:e5,panOnScrollMode:S,panOnDrag:A1,autoPanOnSelection:R3,onPaneClick:R1,onPaneMouseEnter:P1,onPaneMouseMove:h1,onPaneMouseLeave:m1,onPaneScroll:U0,onPaneContextMenu:V1,paneClickDistance:J2,nodeClickDistance:N2,onSelectionContextMenu:d,onSelectionStart:g,onSelectionEnd:n,onReconnect:f6,onReconnectStart:SJ,onReconnectEnd:v8,onEdgeContextMenu:E8,onEdgeDoubleClick:E5,onEdgeMouseEnter:m2,onEdgeMouseMove:jJ,onEdgeMouseLeave:eq,reconnectRadius:G9,defaultMarkerColor:b4,noDragClassName:g2,noWheelClassName:kJ,noPanClassName:u8,rfId:I3,disableKeyboardA11y:F9,nodeExtent:v5,viewport:_U,onViewportChange:JU,nodesDraggable:V0}),F1.jsx(sC,{onSelectionChange:J1}),_4,F1.jsx(lC,{proOptions:T3,position:yJ}),F1.jsx(cC,{rfId:I3,disableKeyboardA11y:F9})]})})}var UR=vT(Pj);function GR(Q){let[U,Z]=K1.useState(Q),K=K1.useCallback((X)=>Z((W)=>yT(X,W)),[]);return[U,Z,K]}var Zm=x2.error014();function Nj({dimensions:Q,lineWidth:U,variant:Z,className:K}){return F1.jsx("path",{strokeWidth:U,d:`M${Q[0]/2} 0 V${Q[1]} M0 ${Q[1]/2} H${Q[0]}`,className:y0(["react-flow__background-pattern",Z,K])})}function Cj({radius:Q,className:U}){return F1.jsx("circle",{cx:Q,cy:Q,r:Q,className:y0(["react-flow__background-pattern","dots",U])})}var v4;(function(Q){Q.Lines="lines",Q.Dots="dots",Q.Cross="cross"})(v4||(v4={}));var Sj={[v4.Dots]:1,[v4.Lines]:1,[v4.Cross]:6},jj=(Q)=>({transform:Q.transform,patternId:`pattern-${Q.rfId}`});function ZR({id:Q,variant:U=v4.Dots,gap:Z=20,size:K,lineWidth:X=1,offset:W=0,color:z,bgColor:B,style:O,className:T,patternClassName:R}){let L=K1.useRef(null),{transform:M,patternId:I}=G0(jj,N0),f=K||Sj[U],D=U===v4.Dots,V=U===v4.Cross,k=Array.isArray(Z)?Z:[Z,Z],h=[k[0]*M[2]||1,k[1]*M[2]||1],P=f*M[2],C=Array.isArray(W)?W:[W,W],v=V?[P,P]:h,b=[C[0]*M[2]+v[0]/2,C[1]*M[2]+v[1]/2],E=`${I}${Q?Q:""}`;return F1.jsxs("svg",{className:y0(["react-flow__background",T]),style:{...O,...cq,"--xy-background-color-props":B,"--xy-background-pattern-color-props":z},ref:L,"data-testid":"rf__background",children:[F1.jsx("pattern",{id:E,x:M[0]%h[0],y:M[1]%h[1],width:h[0],height:h[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${b[0]},-${b[1]})`,children:D?F1.jsx(Cj,{radius:P/2,className:R}):F1.jsx(Nj,{dimensions:v,lineWidth:X,variant:U,className:R})}),F1.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${E})`})]})}ZR.displayName="Background";var FR=K1.memo(ZR);function Vj(){return F1.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:F1.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function kj(){return F1.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:F1.jsx("path",{d:"M0 0h32v4.2H0z"})})}function Dj(){return F1.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:F1.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 yj(){return F1.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:F1.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 vj(){return F1.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:F1.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 hq({children:Q,className:U,...Z}){return F1.jsx("button",{type:"button",className:y0(["react-flow__controls-button",U]),...Z,children:Q})}var Ej=(Q)=>({isInteractive:Q.nodesDraggable||Q.nodesConnectable||Q.elementsSelectable,minZoomReached:Q.transform[2]<=Q.minZoom,maxZoomReached:Q.transform[2]>=Q.maxZoom,ariaLabelConfig:Q.ariaLabelConfig});function KR({style:Q,showZoom:U=!0,showFitView:Z=!0,showInteractive:K=!0,fitViewOptions:X,onZoomIn:W,onZoomOut:z,onFitView:B,onInteractiveChange:O,className:T,children:R,position:L="bottom-left",orientation:M="vertical","aria-label":I}){let f=C0(),{isInteractive:D,minZoomReached:V,maxZoomReached:k,ariaLabelConfig:h}=G0(Ej,N0),{zoomIn:P,zoomOut:C,fitView:v}=OJ(),b=()=>{P(),W?.()},E=()=>{C(),z?.()},p=()=>{v(X),B?.()},a=()=>{f.setState({nodesDraggable:!D,nodesConnectable:!D,elementsSelectable:!D}),O?.(!D)};return F1.jsxs(N8,{className:y0(["react-flow__controls",M==="horizontal"?"horizontal":"vertical",T]),position:L,style:Q,"data-testid":"rf__controls","aria-label":I??h["controls.ariaLabel"],children:[U&&F1.jsxs(F1.Fragment,{children:[F1.jsx(hq,{onClick:b,className:"react-flow__controls-zoomin",title:h["controls.zoomIn.ariaLabel"],"aria-label":h["controls.zoomIn.ariaLabel"],disabled:k,children:F1.jsx(Vj,{})}),F1.jsx(hq,{onClick:E,className:"react-flow__controls-zoomout",title:h["controls.zoomOut.ariaLabel"],"aria-label":h["controls.zoomOut.ariaLabel"],disabled:V,children:F1.jsx(kj,{})})]}),Z&&F1.jsx(hq,{className:"react-flow__controls-fitview",onClick:p,title:h["controls.fitView.ariaLabel"],"aria-label":h["controls.fitView.ariaLabel"],children:F1.jsx(Dj,{})}),K&&F1.jsx(hq,{className:"react-flow__controls-interactive",onClick:a,title:h["controls.interactive.ariaLabel"],"aria-label":h["controls.interactive.ariaLabel"],children:D?F1.jsx(vj,{}):F1.jsx(yj,{})}),R]})}KR.displayName="Controls";var XR=K1.memo(KR);function bj({id:Q,x:U,y:Z,width:K,height:X,style:W,color:z,strokeColor:B,strokeWidth:O,className:T,borderRadius:R,shapeRendering:L,selected:M,onClick:I}){let{background:f,backgroundColor:D}=W||{},V=z||f||D;return F1.jsx("rect",{className:y0(["react-flow__minimap-node",{selected:M},T]),x:U,y:Z,rx:R,ry:R,width:K,height:X,style:{fill:V,stroke:B,strokeWidth:O},shapeRendering:L,onClick:I?(k)=>I(k,Q):void 0})}var uj=K1.memo(bj),xj=(Q)=>Q.nodes.map((U)=>U.id),CX=(Q)=>Q instanceof Function?Q:()=>Q;function hj({nodeStrokeColor:Q,nodeColor:U,nodeClassName:Z="",nodeBorderRadius:K=5,nodeStrokeWidth:X,nodeComponent:W=uj,onClick:z}){let B=G0(xj,N0),O=CX(U),T=CX(Q),R=CX(Z),L=typeof window>"u"||!!window.chrome?"crispEdges":"geometricPrecision";return F1.jsx(F1.Fragment,{children:B.map((M)=>F1.jsx(gj,{id:M,nodeColorFunc:O,nodeStrokeColorFunc:T,nodeClassNameFunc:R,nodeBorderRadius:K,nodeStrokeWidth:X,NodeComponent:W,onClick:z,shapeRendering:L},M))})}function mj({id:Q,nodeColorFunc:U,nodeStrokeColorFunc:Z,nodeClassNameFunc:K,nodeBorderRadius:X,nodeStrokeWidth:W,shapeRendering:z,NodeComponent:B,onClick:O}){let{node:T,x:R,y:L,width:M,height:I}=G0((f)=>{let D=f.nodeLookup.get(Q);if(!D)return{node:void 0,x:0,y:0,width:0,height:0};let V=D.internals.userNode,{x:k,y:h}=D.internals.positionAbsolute,{width:P,height:C}=y5(V);return{node:V,x:k,y:h,width:P,height:C}},N0);if(!T||T.hidden||!XX(T))return null;return F1.jsx(B,{x:R,y:L,width:M,height:I,style:T.style,selected:!!T.selected,className:K(T),color:U(T),borderRadius:X,strokeColor:Z(T),strokeWidth:W,shapeRendering:z,onClick:O,id:T.id})}var gj=K1.memo(mj),pj=K1.memo(hj),cj=200,lj=150,rj=(Q)=>!Q.hidden,dj=(Q)=>{let U={x:-Q.transform[0]/Q.transform[2],y:-Q.transform[1]/Q.transform[2],width:Q.width/Q.transform[2],height:Q.height/Q.transform[2]},Z=!1;for(let K of Q.nodeLookup.values())if(!K.hidden){Z=!0;break}return{viewBB:U,boundingRect:Z?ZX(f8(Q.nodeLookup,{filter:rj}),U):U,rfId:Q.rfId,panZoom:Q.panZoom,translateExtent:Q.translateExtent,flowWidth:Q.width,flowHeight:Q.height,ariaLabelConfig:Q.ariaLabelConfig}},NT=(Q,U)=>Q.x===U.x&&Q.y===U.y&&Q.width===U.width&&Q.height===U.height,ij=(Q,U)=>NT(Q.viewBB,U.viewBB)&&NT(Q.boundingRect,U.boundingRect)&&Q.rfId===U.rfId&&Q.panZoom===U.panZoom&&Q.translateExtent===U.translateExtent&&Q.flowWidth===U.flowWidth&&Q.flowHeight===U.flowHeight&&Q.ariaLabelConfig===U.ariaLabelConfig,aj="react-flow__minimap-desc";function HR({style:Q,className:U,nodeStrokeColor:Z,nodeColor:K,nodeClassName:X="",nodeBorderRadius:W=5,nodeStrokeWidth:z,nodeComponent:B,bgColor:O,maskColor:T,maskStrokeColor:R,maskStrokeWidth:L,position:M="bottom-right",onClick:I,onNodeClick:f,pannable:D=!1,zoomable:V=!1,ariaLabel:k,inversePan:h,zoomStep:P=1,offsetScale:C=5}){let v=C0(),b=K1.useRef(null),{boundingRect:E,panZoom:p,viewBB:a,rfId:m,translateExtent:_1,flowWidth:$1,flowHeight:J1,ariaLabelConfig:y}=G0(dj,ij),u=Q?.width??cj,x=Q?.height??lj,d=E.width/u,g=E.height/x,n=Math.max(d,g),j=n*u,i=n*x,q1=C*n,Q1=E.x-(j-E.width)/2-q1,Y1=E.y-(i-E.height)/2-q1,L1=j+q1*2,M1=i+q1*2,I1=`${aj}-${m}`,X1=K1.useRef(0),f1=K1.useRef();X1.current=n,K1.useEffect(()=>{let c1=v.getState().panZoom;if(b.current&&c1)return f1.current=hM({domNode:b.current,panZoom:c1,getTransform:()=>v.getState().transform,getViewScale:()=>X1.current}),()=>{f1.current?.destroy()}},[p]),K1.useEffect(()=>{f1.current?.update({translateExtent:_1,width:$1,height:J1,inversePan:h,pannable:D,zoomStep:P,zoomable:V})},[D,V,h,P,_1,$1,J1]);let l1=I?(c1)=>{let[E1,j1]=f1.current?.pointer(c1)||[0,0];I(c1,{x:E1,y:j1})}:void 0,W1=K1.useCallback((c1,E1)=>{let j1=v.getState().nodeLookup.get(E1).internals.userNode;f?.(c1,j1)},[f]),S1=f?W1:void 0,v1=k??y["minimap.ariaLabel"];return F1.jsx(N8,{position:M,style:{...Q,"--xy-minimap-background-color-props":typeof O==="string"?O:void 0,"--xy-minimap-mask-background-color-props":typeof T==="string"?T:void 0,"--xy-minimap-mask-stroke-color-props":typeof R==="string"?R:void 0,"--xy-minimap-mask-stroke-width-props":typeof L==="number"?L*n:void 0,"--xy-minimap-node-background-color-props":typeof K==="string"?K:void 0,"--xy-minimap-node-stroke-color-props":typeof Z==="string"?Z:void 0,"--xy-minimap-node-stroke-width-props":typeof z==="number"?z:void 0},className:y0(["react-flow__minimap",U]),"data-testid":"rf__minimap",children:F1.jsxs("svg",{width:u,height:x,viewBox:`${Q1} ${Y1} ${L1} ${M1}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":I1,ref:b,onClick:l1,children:[v1&&F1.jsx("title",{id:I1,children:v1}),F1.jsx(pj,{onClick:S1,nodeColor:K,nodeStrokeColor:Z,nodeBorderRadius:W,nodeClassName:X,nodeStrokeWidth:z,nodeComponent:B}),F1.jsx("path",{className:"react-flow__minimap-mask",d:`M${Q1-q1},${Y1-q1}h${L1+q1*2}v${M1+q1*2}h${-L1-q1*2}z
247
- M${a.x},${a.y}h${a.width}v${a.height}h${-a.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}HR.displayName="MiniMap";var YR=K1.memo(HR),sj=(Q)=>(U)=>Q?`${Math.max(1/U.transform[2],1)}`:void 0,tj={[M6.Line]:"right",[M6.Handle]:"bottom-right"};function oj({nodeId:Q,position:U,variant:Z=M6.Handle,className:K,style:X=void 0,children:W,color:z,minWidth:B=10,minHeight:O=10,maxWidth:T=Number.MAX_VALUE,maxHeight:R=Number.MAX_VALUE,keepAspectRatio:L=!1,resizeDirection:M,autoScale:I=!0,shouldResize:f,onResizeStart:D,onResize:V,onResizeEnd:k}){let h=VX(),P=typeof Q==="string"?Q:h,C=C0(),v=K1.useRef(null),b=Z===M6.Handle,E=G0(K1.useCallback(sj(b&&I),[b,I]),N0),p=K1.useRef(null),a=U??tj[Z];K1.useEffect(()=>{if(!v.current||!P)return;if(!p.current)p.current=lM({domNode:v.current,nodeId:P,getStoreItems:()=>{let{nodeLookup:_1,transform:$1,snapGrid:J1,snapToGrid:y,nodeOrigin:u,domNode:x}=C.getState();return{nodeLookup:_1,transform:$1,snapGrid:J1,snapToGrid:y,nodeOrigin:u,paneDomNode:x}},onChange:(_1,$1)=>{let{triggerNodeChanges:J1,nodeLookup:y,parentLookup:u,nodeOrigin:x}=C.getState(),d=[],g={x:_1.x,y:_1.y},n=y.get(P);if(n&&n.expandParent&&n.parentId){let j=n.origin??x,i=_1.width??n.measured.width??0,q1=_1.height??n.measured.height??0,Q1={id:n.id,parentId:n.parentId,rect:{width:i,height:q1,...HX({x:_1.x??n.position.x,y:_1.y??n.position.y},{width:i,height:q1},n.parentId,y,j)}},Y1=Eq([Q1],y,u,x);d.push(...Y1),g.x=_1.x?Math.max(j[0]*i,_1.x):void 0,g.y=_1.y?Math.max(j[1]*q1,_1.y):void 0}if(g.x!==void 0&&g.y!==void 0){let j={id:P,type:"position",position:{...g}};d.push(j)}if(_1.width!==void 0&&_1.height!==void 0){let i={id:P,type:"dimensions",resizing:!0,setAttributes:!M?!0:M==="horizontal"?"width":"height",dimensions:{width:_1.width,height:_1.height}};d.push(i)}for(let j of $1){let i={...j,type:"position"};d.push(i)}J1(d)},onEnd:({width:_1,height:$1})=>{let J1={id:P,type:"dimensions",resizing:!1,dimensions:{width:_1,height:$1}};C.getState().triggerNodeChanges([J1])}});return p.current.update({controlPosition:a,boundaries:{minWidth:B,minHeight:O,maxWidth:T,maxHeight:R},keepAspectRatio:L,resizeDirection:M,onResizeStart:D,onResize:V,onResizeEnd:k,shouldResize:f}),()=>{p.current?.destroy()}},[a,B,O,T,R,L,D,V,k,f]);let m=a.split("-");return F1.jsx("div",{className:y0(["react-flow__resize-control","nodrag",...m,Z,K]),ref:v,style:{...X,scale:E,...z&&{[b?"backgroundColor":"borderColor"]:z}},children:W})}var Fm=K1.memo(oj);var nj=(Q)=>Q.domNode?.querySelector(".react-flow__renderer");function ej({children:Q}){let U=G0(nj);if(!U)return null;return CT.createPortal(Q,U)}var _V=(Q,U)=>Q?.internals.positionAbsolute.x!==U?.internals.positionAbsolute.x||Q?.internals.positionAbsolute.y!==U?.internals.positionAbsolute.y||Q?.measured.width!==U?.measured.width||Q?.measured.height!==U?.measured.height||Q?.selected!==U?.selected||Q?.internals.z!==U?.internals.z,JV=(Q,U)=>{if(Q.size!==U.size)return!1;for(let[Z,K]of Q)if(_V(K,U.get(Z)))return!1;return!0},$V=(Q)=>({x:Q.transform[0],y:Q.transform[1],zoom:Q.transform[2],selectedNodesCount:Q.nodes.filter((U)=>U.selected).length});function WR({nodeId:Q,children:U,className:Z,style:K,isVisible:X,position:W=C1.Top,offset:z=10,align:B="center",...O}){let T=VX(),R=K1.useCallback((v)=>{return(Array.isArray(Q)?Q:[Q||T||""]).reduce((p,a)=>{let m=v.nodeLookup.get(a);if(m)p.set(m.id,m);return p},new Map)},[Q,T]),L=G0(R,JV),{x:M,y:I,zoom:f,selectedNodesCount:D}=G0($V,N0);if(!(typeof X==="boolean"?X:L.size===1&&L.values().next().value?.selected&&D===1)||!L.size)return null;let k=f8(L),h=Array.from(L.values()),P=Math.max(...h.map((v)=>v.internals.z+1)),C={position:"absolute",transform:CM(k,{x:M,y:I,zoom:f},W,z,B),zIndex:P,...K};return F1.jsx(ej,{children:F1.jsx("div",{style:C,className:y0(["react-flow__node-toolbar",Z]),...O,"data-id":h.reduce((v,b)=>`${v}${b.id} `,"").trim(),children:U})})}var _2=u0(i5(),1);var zR={x:{title:"X",fill:"currentColor",d:"M18.901 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584-6.638 7.584H.474l8.6-9.83L0 1.154h7.594l5.243 6.932ZM17.61 20.644h2.039L6.486 3.24H4.298Z"},youtube:{title:"YouTube",fill:"#FF0000",d:"M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"},tiktok:{title:"TikTok",fill:"currentColor",d:"M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z"},discord:{title:"Discord",fill:"#5865F2",d:"M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z"},resend:{title:"Resend",fill:"currentColor",d:"M2.023 0v24h5.553v-8.434h2.998L15.326 24h6.65l-5.372-9.258a7.652 7.652 0 0 0 3.316-3.016c.709-1.21 1.062-2.57 1.062-4.08 0-1.462-.353-2.767-1.062-3.91-.709-1.165-1.692-2.079-2.95-2.742C15.737.331 14.355 0 12.823 0Zm5.553 4.87h4.219c.731 0 1.349.125 1.851.376.526.252.925.618 1.2 1.098.274.457.412.994.412 1.611S15.132 9.12 14.88 9.6c-.229.48-.572.856-1.03 1.13-.434.252-.948.38-1.542.38H7.576Z"},linkedin:{title:"LinkedIn",fill:"#0A66C2",d:"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"},reddit:{title:"Reddit",fill:"#FF4500",d:"M12 0C5.373 0 0 5.373 0 12c0 3.314 1.343 6.314 3.515 8.485l-2.286 2.286C.775 23.225 1.097 24 1.738 24H12c6.627 0 12-5.373 12-12S18.627 0 12 0Zm4.388 3.199c1.104 0 1.999.895 1.999 1.999 0 1.105-.895 2-1.999 2-.946 0-1.739-.657-1.947-1.539v.002c-1.147.162-2.032 1.15-2.032 2.341v.007c1.776.067 3.4.567 4.686 1.363.473-.363 1.064-.58 1.707-.58 1.547 0 2.802 1.254 2.802 2.802 0 1.117-.655 2.081-1.601 2.531-.088 3.256-3.637 5.876-7.997 5.876-4.361 0-7.905-2.617-7.998-5.87-.954-.447-1.614-1.415-1.614-2.538 0-1.548 1.255-2.802 2.803-2.802.645 0 1.239.218 1.712.585 1.275-.79 2.881-1.291 4.64-1.365v-.01c0-1.663 1.263-3.034 2.88-3.207.188-.911.993-1.595 1.959-1.595Zm-8.085 8.376c-.784 0-1.459.78-1.506 1.797-.047 1.016.64 1.429 1.426 1.429.786 0 1.371-.369 1.418-1.385.047-1.017-.553-1.841-1.338-1.841Zm7.406 0c-.786 0-1.385.824-1.338 1.841.047 1.017.634 1.385 1.418 1.385.785 0 1.473-.413 1.426-1.429-.046-1.017-.721-1.797-1.506-1.797Zm-3.703 4.013c-.974 0-1.907.048-2.77.135-.147.015-.241.168-.183.305.483 1.154 1.622 1.964 2.953 1.964 1.33 0 2.47-.81 2.953-1.964.057-.137-.037-.29-.184-.305-.863-.087-1.795-.135-2.769-.135Z"},bluesky:{title:"Bluesky",fill:"#0285FF",d:"M12 10.8c-1.087-2.114-4.046-6.053-6.798-7.995C2.566.944 1.561 1.266.902 1.565.139 1.908 0 3.08 0 3.768c0 .69.378 5.65.624 6.479.815 2.736 3.713 3.66 6.383 3.364.136-.02.275-.039.415-.056-.138.022-.276.04-.415.056-3.912.58-7.387 2.005-2.83 7.078 5.013 5.19 6.87-1.113 7.823-4.308.953 3.195 2.05 9.271 7.733 4.308 4.267-4.308 1.172-6.498-2.74-7.078a8.741 8.741 0 0 1-.415-.056c.14.017.279.036.415.056 2.67.297 5.568-.628 6.383-3.364.246-.828.624-5.79.624-6.478 0-.69-.139-1.861-.902-2.206-.659-.298-1.664-.62-4.3 1.24C16.046 4.748 13.087 8.687 12 10.8Z"},instagram:{title:"Instagram",fill:"#FF0069",d:"M7.0301.084c-1.2768.0602-2.1487.264-2.911.5634-.7888.3075-1.4575.72-2.1228 1.3877-.6652.6677-1.075 1.3368-1.3802 2.127-.2954.7638-.4956 1.6365-.552 2.914-.0564 1.2775-.0689 1.6882-.0626 4.947.0062 3.2586.0206 3.6671.0825 4.9473.061 1.2765.264 2.1482.5635 2.9107.308.7889.72 1.4573 1.388 2.1228.6679.6655 1.3365 1.0743 2.1285 1.38.7632.295 1.6361.4961 2.9134.552 1.2773.056 1.6884.069 4.9462.0627 3.2578-.0062 3.668-.0207 4.9478-.0814 1.28-.0607 2.147-.2652 2.9098-.5633.7889-.3086 1.4578-.72 2.1228-1.3881.665-.6682 1.0745-1.3378 1.3795-2.1284.2957-.7632.4966-1.636.552-2.9124.056-1.2809.0692-1.6898.063-4.948-.0063-3.2583-.021-3.6668-.0817-4.9465-.0607-1.2797-.264-2.1487-.5633-2.9117-.3084-.7889-.72-1.4568-1.3876-2.1228C21.2982 1.33 20.628.9208 19.8378.6165 19.074.321 18.2017.1197 16.9244.0645 15.6471.0093 15.236-.005 11.977.0014 8.718.0076 8.31.0215 7.0301.0839m.1402 21.6932c-1.17-.0509-1.8053-.2453-2.2287-.408-.5606-.216-.96-.4771-1.3819-.895-.422-.4178-.6811-.8186-.9-1.378-.1644-.4234-.3624-1.058-.4171-2.228-.0595-1.2645-.072-1.6442-.079-4.848-.007-3.2037.0053-3.583.0607-4.848.05-1.169.2456-1.805.408-2.2282.216-.5613.4762-.96.895-1.3816.4188-.4217.8184-.6814 1.3783-.9003.423-.1651 1.0575-.3614 2.227-.4171 1.2655-.06 1.6447-.072 4.848-.079 3.2033-.007 3.5835.005 4.8495.0608 1.169.0508 1.8053.2445 2.228.408.5608.216.96.4754 1.3816.895.4217.4194.6816.8176.9005 1.3787.1653.4217.3617 1.056.4169 2.2263.0602 1.2655.0739 1.645.0796 4.848.0058 3.203-.0055 3.5834-.061 4.848-.051 1.17-.245 1.8055-.408 2.2294-.216.5604-.4763.96-.8954 1.3814-.419.4215-.8181.6811-1.3783.9-.4224.1649-1.0577.3617-2.2262.4174-1.2656.0595-1.6448.072-4.8493.079-3.2045.007-3.5825-.006-4.848-.0608M16.953 5.5864A1.44 1.44 0 1 0 18.39 4.144a1.44 1.44 0 0 0-1.437 1.4424M5.8385 12.012c.0067 3.4032 2.7706 6.1557 6.173 6.1493 3.4026-.0065 6.157-2.7701 6.1506-6.1733-.0065-3.4032-2.771-6.1565-6.174-6.1498-3.403.0067-6.156 2.771-6.1496 6.1738M8 12.0077a4 4 0 1 1 4.008 3.9921A3.9996 3.9996 0 0 1 8 12.0077"},github:{title:"GitHub",fill:"currentColor",d:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"},stripe:{title:"Stripe",fill:"#635BFF",d:"M13.976 9.15c-2.172-.806-3.356-1.426-3.356-2.409 0-.831.683-1.305 1.901-1.305 2.227 0 4.515.858 6.09 1.631l.89-5.494C18.252.975 15.697 0 12.165 0 9.667 0 7.589.654 6.104 1.872 4.56 3.147 3.757 4.992 3.757 7.218c0 4.039 2.467 5.76 6.476 7.219 2.585.92 3.445 1.574 3.445 2.583 0 .98-.84 1.545-2.354 1.545-1.875 0-4.965-.921-6.99-2.109l-.9 5.555C5.175 22.99 8.385 24 11.714 24c2.641 0 4.843-.624 6.328-1.813 1.664-1.305 2.525-3.236 2.525-5.732 0-4.128-2.524-5.851-6.594-7.305h.003z"},slack:{title:"Slack",fill:"#4A154B",d:"M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zM6.313 15.165a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zM8.834 6.313a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312zM18.956 8.834a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V8.834zM17.688 8.834a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312zM15.165 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zM15.165 17.688a2.527 2.527 0 0 1-2.52-2.523 2.526 2.526 0 0 1 2.52-2.52h6.313A2.527 2.527 0 0 1 24 15.165a2.528 2.528 0 0 1-2.522 2.523h-6.313z"},openai:{title:"OpenAI",fill:"#412991",d:"M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z"},anthropic:{title:"Anthropic",fill:"currentColor",d:"M17.3041 3.541h-3.6718l6.696 16.918H24Zm-10.6082 0L0 20.459h3.7442l1.3693-3.5527h7.0052l1.3693 3.5528h3.7442L10.5363 3.5409Zm-.3712 10.2232 2.2914-5.9456 2.2914 5.9456Z"},twilio:{title:"Twilio",fill:"#F22F46",d:"M12 0C5.381-.008.008 5.352 0 11.971V12c0 6.64 5.359 12 12 12 6.64 0 12-5.36 12-12 0-6.641-5.36-12-12-12zm0 20.801c-4.846.015-8.786-3.904-8.801-8.75V12c-.014-4.846 3.904-8.786 8.75-8.801H12c4.847-.014 8.786 3.904 8.801 8.75V12c.015 4.847-3.904 8.786-8.75 8.801H12zm5.44-11.76c0 1.359-1.12 2.479-2.481 2.479-1.366-.007-2.472-1.113-2.479-2.479 0-1.361 1.12-2.481 2.479-2.481 1.361 0 2.481 1.12 2.481 2.481zm0 5.919c0 1.36-1.12 2.48-2.481 2.48-1.367-.008-2.473-1.114-2.479-2.48 0-1.359 1.12-2.479 2.479-2.479 1.361-.001 2.481 1.12 2.481 2.479zm-5.919 0c0 1.36-1.12 2.48-2.479 2.48-1.368-.007-2.475-1.113-2.481-2.48 0-1.359 1.12-2.479 2.481-2.479 1.358-.001 2.479 1.12 2.479 2.479zm0-5.919c0 1.359-1.12 2.479-2.479 2.479-1.367-.007-2.475-1.112-2.481-2.479 0-1.361 1.12-2.481 2.481-2.481 1.358 0 2.479 1.12 2.479 2.481z"},sendgrid:{title:"SendGrid",fill:"#51A9E3",d:"M.8 24h13.6c.88 0 1.6-.72 1.6-1.6v-4.8c0-.88-.72-1.6-1.6-1.6H9.6c-.88 0-1.6-.72-1.6-1.6V9.6C8 8.72 7.28 8 6.4 8H1.6C.72 8 0 8.72 0 9.6v13.6c0 .44.36.8.8.8zM23.2 0H9.6C8.72 0 8 .72 8 1.6v4.8C8 7.28 8.72 8 9.6 8h4.8c.88 0 1.6.72 1.6 1.6v4.8c0 .88.72 1.6 1.6 1.6h4.8c.88 0 1.6-.72 1.6-1.6V.8c0-.44-.36-.8-.8-.8Z"},mailgun:{title:"Mailgun",fill:"#F06B66",d:"M11.837 0c6.602 0 11.984 5.381 11.984 11.994-.017 2.99-3.264 4.84-5.844 3.331a3.805 3.805 0 0 1-.06-.035l-.055-.033-.022.055c-2.554 4.63-9.162 4.758-11.894.232-2.732-4.527.46-10.313 5.746-10.416a6.868 6.868 0 0 1 7.002 6.866 1.265 1.265 0 0 0 2.52 0c0-5.18-4.197-9.38-9.377-9.387C4.611 2.594.081 10.41 3.683 16.673c3.238 5.632 11.08 6.351 15.289 1.402l1.997 1.686A11.95 11.95 0 0 1 11.837 24C2.6 23.72-2.87 13.543 1.992 5.684A12.006 12.006 0 0 1 11.837 0Zm0 7.745c-3.276-.163-5.5 3.281-4.003 6.2a4.26 4.26 0 0 0 4.014 2.31c3.276-.171 5.137-3.824 3.35-6.575a4.26 4.26 0 0 0-3.36-1.935Zm0 2.53c1.324 0 2.152 1.433 1.49 2.58a1.72 1.72 0 0 1-1.49.86 1.72 1.72 0 1 1 0-3.44Z"},notion:{title:"Notion",fill:"currentColor",d:"M4.459 4.208c.746.606 1.026.56 2.428.466l13.215-.793c.28 0 .047-.28-.046-.326L17.86 1.968c-.42-.326-.981-.7-2.055-.607L3.01 2.295c-.466.046-.56.28-.374.466zm.793 3.08v13.904c0 .747.373 1.027 1.214.98l14.523-.84c.841-.046.935-.56.935-1.167V6.354c0-.606-.233-.933-.748-.887l-15.177.887c-.56.047-.747.327-.747.933zm14.337.745c.093.42 0 .84-.42.888l-.7.14v10.264c-.608.327-1.168.514-1.635.514-.748 0-.935-.234-1.495-.933l-4.577-7.186v6.952L12.21 19s0 .84-1.168.84l-3.222.186c-.093-.186 0-.653.327-.746l.84-.233V9.854L7.822 9.76c-.094-.42.14-1.026.793-1.073l3.456-.233 4.764 7.279v-6.44l-1.215-.139c-.093-.514.28-.887.747-.933zM1.936 1.035l13.31-.98c1.634-.14 2.055-.047 3.082.7l4.249 2.986c.7.513.934.653.934 1.213v16.378c0 1.026-.373 1.634-1.68 1.726l-15.458.934c-.98.047-1.448-.093-1.962-.747l-3.129-4.06c-.56-.747-.793-1.306-.793-1.96V2.667c0-.839.374-1.54 1.447-1.632z"},linear:{title:"Linear",fill:"#5E6AD2",d:"M2.886 4.18A11.982 11.982 0 0 1 11.99 0C18.624 0 24 5.376 24 12.009c0 3.64-1.62 6.903-4.18 9.105L2.887 4.18ZM1.817 5.626l16.556 16.556c-.524.33-1.075.62-1.65.866L.951 7.277c.247-.575.537-1.126.866-1.65ZM.322 9.163l14.515 14.515c-.71.172-1.443.282-2.195.322L0 11.358a12 12 0 0 1 .322-2.195Zm-.17 4.862 9.823 9.824a12.02 12.02 0 0 1-9.824-9.824Z"},jira:{title:"Jira",fill:"#0052CC",d:"M11.571 11.513H0a5.218 5.218 0 0 0 5.232 5.215h2.13v2.057A5.215 5.215 0 0 0 12.575 24V12.518a1.005 1.005 0 0 0-1.005-1.005zm5.723-5.756H5.736a5.215 5.215 0 0 0 5.215 5.214h2.129v2.058a5.218 5.218 0 0 0 5.215 5.214V6.758a1.001 1.001 0 0 0-1.001-1.001zM23.013 0H11.455a5.215 5.215 0 0 0 5.215 5.215h2.129v2.057A5.215 5.215 0 0 0 24 12.483V1.005A1.001 1.001 0 0 0 23.013 0Z"},hubspot:{title:"HubSpot",fill:"#FF7A59",d:"M18.164 7.93V5.084a2.198 2.198 0 001.267-1.978v-.067A2.2 2.2 0 0017.238.845h-.067a2.2 2.2 0 00-2.193 2.193v.067a2.196 2.196 0 001.252 1.973l.013.006v2.852a6.22 6.22 0 00-2.969 1.31l.012-.01-7.828-6.095A2.497 2.497 0 104.3 4.656l-.012.006 7.697 5.991a6.176 6.176 0 00-1.038 3.446c0 1.343.425 2.588 1.147 3.607l-.013-.02-2.342 2.343a1.968 1.968 0 00-.58-.095h-.002a2.033 2.033 0 102.033 2.033 1.978 1.978 0 00-.1-.595l.005.014 2.317-2.317a6.247 6.247 0 104.782-11.134l-.036-.005zm-.964 9.378a3.206 3.206 0 113.215-3.207v.002a3.206 3.206 0 01-3.207 3.207z"},paypal:{title:"PayPal",fill:"#003087",d:"M7.016 19.198h-4.2a.562.562 0 0 1-.555-.65L5.093.584A.692.692 0 0 1 5.776 0h7.222c3.417 0 5.904 2.488 5.846 5.5-.006.25-.027.5-.066.747A6.794 6.794 0 0 1 12.071 12H8.743a.69.69 0 0 0-.682.583l-.325 2.056-.013.083-.692 4.39-.015.087zM19.79 6.142c-.01.087-.01.175-.023.261a7.76 7.76 0 0 1-7.695 6.598H9.007l-.283 1.795-.013.083-.692 4.39-.134.843-.014.088H6.86l-.497 3.15a.562.562 0 0 0 .555.65h3.612c.34 0 .63-.249.683-.585l.952-6.031a.692.692 0 0 1 .683-.584h2.126a6.793 6.793 0 0 0 6.707-5.752c.306-1.95-.466-3.744-1.89-4.906z"},shopify:{title:"Shopify",fill:"#7AB55C",d:"M15.337 23.979l7.216-1.561s-2.604-17.613-2.625-17.73c-.018-.116-.114-.192-.211-.192s-1.929-.136-1.929-.136-1.275-1.274-1.439-1.411c-.045-.037-.075-.057-.121-.074l-.914 21.104h.023zM11.71 11.305s-.81-.424-1.774-.424c-1.447 0-1.504.906-1.504 1.141 0 1.232 3.24 1.715 3.24 4.629 0 2.295-1.44 3.76-3.406 3.76-2.354 0-3.54-1.465-3.54-1.465l.646-2.086s1.245 1.066 2.28 1.066c.675 0 .975-.545.975-.932 0-1.619-2.654-1.694-2.654-4.359-.034-2.237 1.571-4.416 4.827-4.416 1.257 0 1.875.361 1.875.361l-.945 2.715-.02.01zM11.17.83c.136 0 .271.038.405.135-.984.465-2.064 1.639-2.508 3.992-.656.213-1.293.405-1.889.578C7.697 3.75 8.951.84 11.17.84V.83zm1.235 2.949v.135c-.754.232-1.583.484-2.394.736.466-1.777 1.333-2.645 2.085-2.971.193.501.309 1.176.309 2.1zm.539-2.234c.694.074 1.141.867 1.429 1.755-.349.114-.735.231-1.158.366v-.252c0-.752-.096-1.371-.271-1.871v.002zm2.992 1.289c-.02 0-.06.021-.078.021s-.289.075-.714.21c-.423-1.233-1.176-2.37-2.508-2.37h-.115C12.135.209 11.669 0 11.265 0 8.159 0 6.675 3.877 6.21 5.846c-1.194.365-2.063.636-2.16.674-.675.213-.694.232-.772.87-.075.462-1.83 14.063-1.83 14.063L15.009 24l.927-21.166z"},sentry:{title:"Sentry",fill:"#362D59",d:"M13.91 2.505c-.873-1.448-2.972-1.448-3.844 0L6.904 7.92a15.478 15.478 0 0 1 8.53 12.811h-2.221A13.301 13.301 0 0 0 5.784 9.814l-2.926 5.06a7.65 7.65 0 0 1 4.435 5.848H2.194a.365.365 0 0 1-.298-.534l1.413-2.402a5.16 5.16 0 0 0-1.614-.913L.296 19.275a2.182 2.182 0 0 0 .812 2.999 2.24 2.24 0 0 0 1.086.288h6.983a9.322 9.322 0 0 0-3.845-8.318l1.11-1.922a11.47 11.47 0 0 1 4.95 10.24h5.915a17.242 17.242 0 0 0-7.885-15.28l2.244-3.845a.37.37 0 0 1 .504-.13c.255.14 9.75 16.708 9.928 16.9a.365.365 0 0 1-.327.543h-2.287c.029.612.029 1.223 0 1.831h2.297a2.206 2.206 0 0 0 1.922-3.31z"},vercel:{title:"Vercel",fill:"currentColor",d:"M24 22.525H0l12-21.05 12 21.05z"},supabase:{title:"Supabase",fill:"#3FCF8E",d:"M11.9 1.036c-.015-.986-1.26-1.41-1.874-.637L.764 12.05C-.33 13.427.65 15.455 2.409 15.455h9.579l.113 7.51c.014.985 1.259 1.408 1.873.636l9.262-11.653c1.093-1.375.113-3.403-1.645-3.403h-9.642z"},clerk:{title:"Clerk",fill:"#6C47FF",d:"m21.47 20.829-2.881-2.881a.572.572 0 0 0-.7-.084 6.854 6.854 0 0 1-7.081 0 .576.576 0 0 0-.7.084l-2.881 2.881a.576.576 0 0 0-.103.69.57.57 0 0 0 .166.186 12 12 0 0 0 14.113 0 .58.58 0 0 0 .239-.423.576.576 0 0 0-.172-.453Zm.002-17.668-2.88 2.88a.569.569 0 0 1-.701.084A6.857 6.857 0 0 0 8.724 8.08a6.862 6.862 0 0 0-1.222 3.692 6.86 6.86 0 0 0 .978 3.764.573.573 0 0 1-.083.699l-2.881 2.88a.567.567 0 0 1-.864-.063A11.993 11.993 0 0 1 6.771 2.7a11.99 11.99 0 0 1 14.637-.405.566.566 0 0 1 .232.418.57.57 0 0 1-.168.448Zm-7.118 12.261a3.427 3.427 0 1 0 0-6.854 3.427 3.427 0 0 0 0 6.854Z"},aws:{title:"Amazon Web Services",fill:"#232F3E",d:"M6.763 10.036c0 .296.032.535.088.71.064.176.144.368.256.576.04.063.056.127.056.183 0 .08-.048.16-.152.24l-.503.335a.383.383 0 0 1-.208.072c-.08 0-.16-.04-.239-.112a2.47 2.47 0 0 1-.287-.375 6.18 6.18 0 0 1-.248-.471c-.622.734-1.405 1.101-2.347 1.101-.67 0-1.205-.191-1.596-.574-.391-.384-.59-.894-.59-1.533 0-.678.239-1.23.726-1.644.487-.415 1.133-.623 1.955-.623.272 0 .551.024.846.064.296.04.6.104.918.176v-.583c0-.607-.127-1.03-.375-1.277-.255-.248-.686-.367-1.3-.367-.28 0-.568.031-.863.103-.295.072-.583.16-.862.272a2.287 2.287 0 0 1-.28.104.488.488 0 0 1-.127.023c-.112 0-.168-.08-.168-.247v-.391c0-.128.016-.224.056-.28a.597.597 0 0 1 .224-.167c.279-.144.614-.264 1.005-.36a4.84 4.84 0 0 1 1.246-.151c.95 0 1.644.216 2.091.647.439.43.662 1.085.662 1.963v2.586zm-3.24 1.214c.263 0 .534-.048.822-.144.287-.096.543-.271.758-.51.128-.152.224-.32.272-.512.047-.191.08-.423.08-.694v-.335a6.66 6.66 0 0 0-.735-.136 6.02 6.02 0 0 0-.75-.048c-.535 0-.926.104-1.19.32-.263.215-.39.518-.39.917 0 .375.095.655.295.846.191.2.47.296.838.296zm6.41.862c-.144 0-.24-.024-.304-.08-.064-.048-.12-.16-.168-.311L7.586 5.55a1.398 1.398 0 0 1-.072-.32c0-.128.064-.2.191-.2h.783c.151 0 .255.025.31.08.065.048.113.16.16.312l1.342 5.284 1.245-5.284c.04-.16.088-.264.151-.312a.549.549 0 0 1 .32-.08h.638c.152 0 .256.025.32.08.063.048.12.16.151.312l1.261 5.348 1.381-5.348c.048-.16.104-.264.16-.312a.52.52 0 0 1 .311-.08h.743c.127 0 .2.065.2.2 0 .04-.009.08-.017.128a1.137 1.137 0 0 1-.056.2l-1.923 6.17c-.048.16-.104.263-.168.311a.51.51 0 0 1-.303.08h-.687c-.151 0-.255-.024-.32-.08-.063-.056-.119-.16-.15-.32l-1.238-5.148-1.23 5.14c-.04.16-.087.264-.15.32-.065.056-.177.08-.32.08zm10.256.215c-.415 0-.83-.048-1.229-.143-.399-.096-.71-.2-.918-.32-.128-.071-.215-.151-.247-.223a.563.563 0 0 1-.048-.224v-.407c0-.167.064-.247.183-.247.048 0 .096.008.144.024.048.016.12.048.2.08.271.12.566.215.878.279.319.064.63.096.95.096.502 0 .894-.088 1.165-.264a.86.86 0 0 0 .415-.758.777.777 0 0 0-.215-.559c-.144-.151-.416-.287-.807-.415l-1.157-.36c-.583-.183-1.014-.454-1.277-.813a1.902 1.902 0 0 1-.4-1.158c0-.335.073-.63.216-.886.144-.255.335-.479.575-.654.24-.184.51-.32.83-.415.32-.096.655-.136 1.006-.136.175 0 .359.008.535.032.183.024.35.056.518.088.16.04.312.08.455.127.144.048.256.096.336.144a.69.69 0 0 1 .24.2.43.43 0 0 1 .071.263v.375c0 .168-.064.256-.184.256a.83.83 0 0 1-.303-.096 3.652 3.652 0 0 0-1.532-.311c-.455 0-.815.071-1.062.223-.248.152-.375.383-.375.71 0 .224.08.416.24.567.159.152.454.304.877.44l1.134.358c.574.184.99.44 1.237.767.247.327.367.702.367 1.117 0 .343-.072.655-.207.926-.144.272-.336.511-.583.703-.248.2-.543.343-.886.447-.36.111-.734.167-1.142.167zM21.698 16.207c-2.626 1.94-6.442 2.969-9.722 2.969-4.598 0-8.74-1.7-11.87-4.526-.247-.223-.024-.527.272-.351 3.384 1.963 7.559 3.153 11.877 3.153 2.914 0 6.114-.607 9.06-1.852.439-.2.814.287.383.607zM22.792 14.961c-.336-.43-2.22-.207-3.074-.103-.255.032-.295-.192-.063-.36 1.5-1.053 3.967-.75 4.254-.399.287.36-.08 2.826-1.485 4.007-.215.184-.423.088-.327-.151.32-.79 1.03-2.57.695-2.994z"},figma:{title:"Figma",fill:"#F24E1E",d:"M15.852 8.981h-4.588V0h4.588c2.476 0 4.49 2.014 4.49 4.49s-2.014 4.491-4.49 4.491zM12.735 7.51h3.117c1.665 0 3.019-1.355 3.019-3.019s-1.355-3.019-3.019-3.019h-3.117V7.51zm0 1.471H8.148c-2.476 0-4.49-2.014-4.49-4.49S5.672 0 8.148 0h4.588v8.981zm-4.587-7.51c-1.665 0-3.019 1.355-3.019 3.019s1.354 3.02 3.019 3.02h3.117V1.471H8.148zm4.587 15.019H8.148c-2.476 0-4.49-2.014-4.49-4.49s2.014-4.49 4.49-4.49h4.588v8.98zM8.148 8.981c-1.665 0-3.019 1.355-3.019 3.019s1.355 3.019 3.019 3.019h3.117V8.981H8.148zM8.172 24c-2.489 0-4.515-2.014-4.515-4.49s2.014-4.49 4.49-4.49h4.588v4.441c0 2.503-2.047 4.539-4.563 4.539zm-.024-7.51a3.023 3.023 0 0 0-3.019 3.019c0 1.665 1.365 3.019 3.044 3.019 1.705 0 3.093-1.376 3.093-3.068v-2.97H8.148zm7.704 0h-.098c-2.476 0-4.49-2.014-4.49-4.49s2.014-4.49 4.49-4.49h.098c2.476 0 4.49 2.014 4.49 4.49s-2.014 4.49-4.49 4.49zm-.097-7.509c-1.665 0-3.019 1.355-3.019 3.019s1.355 3.019 3.019 3.019h.098c1.665 0 3.019-1.355 3.019-3.019s-1.355-3.019-3.019-3.019h-.098z"},airtable:{title:"Airtable",fill:"#18BFFF",d:"M11.992 1.966c-.434 0-.87.086-1.28.257L1.779 5.917c-.503.208-.49.908.012 1.116l8.982 3.558a3.266 3.266 0 0 0 2.454 0l8.982-3.558c.503-.196.503-.908.012-1.116l-8.957-3.694a3.255 3.255 0 0 0-1.272-.257zM23.4 8.056a.589.589 0 0 0-.222.045l-10.012 3.877a.612.612 0 0 0-.38.564v8.896a.6.6 0 0 0 .821.552L23.62 18.1a.583.583 0 0 0 .38-.551V8.653a.6.6 0 0 0-.6-.596zM.676 8.095a.644.644 0 0 0-.48.19C.086 8.396 0 8.53 0 8.69v8.355c0 .442.515.737.908.54l6.27-3.006.307-.147 2.969-1.436c.466-.22.43-.908-.061-1.092L.883 8.138a.57.57 0 0 0-.207-.044z"},intercom:{title:"Intercom",fill:"#6AFDEF",d:"M21 0H3C1.343 0 0 1.343 0 3v18c0 1.658 1.343 3 3 3h18c1.658 0 3-1.342 3-3V3c0-1.657-1.342-3-3-3zm-5.801 4.399c0-.44.36-.8.802-.8.44 0 .8.36.8.8v10.688c0 .442-.36.801-.8.801-.443 0-.802-.359-.802-.801V4.399zM11.2 3.994c0-.44.357-.799.8-.799s.8.359.8.799v11.602c0 .44-.357.8-.8.8s-.8-.36-.8-.8V3.994zm-4 .405c0-.44.359-.8.799-.8.443 0 .802.36.802.8v10.688c0 .442-.36.801-.802.801-.44 0-.799-.359-.799-.801V4.399zM3.199 6c0-.442.36-.8.802-.8.44 0 .799.358.799.8v7.195c0 .441-.359.8-.799.8-.443 0-.802-.36-.802-.8V6zM20.52 18.202c-.123.105-3.086 2.593-8.52 2.593-5.433 0-8.397-2.486-8.521-2.593-.335-.288-.375-.792-.086-1.128.285-.334.79-.375 1.125-.09.047.041 2.693 2.211 7.481 2.211 4.848 0 7.456-2.186 7.479-2.207.334-.289.839-.25 1.128.086.289.336.25.84-.086 1.128zm.281-5.007c0 .441-.36.8-.801.8-.441 0-.801-.36-.801-.8V6c0-.442.361-.8.801-.8.441 0 .801.357.801.8v7.195z"},posthog:{title:"PostHog",fill:"currentColor",d:"M9.854 14.5 5 9.647.854 5.5A.5.5 0 0 0 0 5.854V8.44a.5.5 0 0 0 .146.353L5 13.647l.147.146L9.854 18.5l.146.147v-.049c.065.03.134.049.207.049h2.586a.5.5 0 0 0 .353-.854L9.854 14.5zm0-5-4-4a.487.487 0 0 0-.409-.144.515.515 0 0 0-.356.21.493.493 0 0 0-.089.288V8.44a.5.5 0 0 0 .147.353l9 9a.5.5 0 0 0 .853-.354v-2.585a.5.5 0 0 0-.146-.354l-5-5zm1-4a.5.5 0 0 0-.854.354V8.44a.5.5 0 0 0 .147.353l4 4a.5.5 0 0 0 .853-.354V9.854a.5.5 0 0 0-.146-.354l-4-4zm12.647 11.515a3.863 3.863 0 0 1-2.232-1.1l-4.708-4.707a.5.5 0 0 0-.854.354v6.585a.5.5 0 0 0 .5.5H23.5a.5.5 0 0 0 .5-.5v-.6c0-.276-.225-.497-.499-.532zm-5.394.032a.8.8 0 1 1 0-1.6.8.8 0 0 1 0 1.6zM.854 15.5a.5.5 0 0 0-.854.354v2.293a.5.5 0 0 0 .5.5h2.293c.222 0 .39-.135.462-.309a.493.493 0 0 0-.109-.545L.854 15.501zM5 14.647.854 10.5a.5.5 0 0 0-.854.353v2.586a.5.5 0 0 0 .146.353L4.854 18.5l.146.147h2.793a.5.5 0 0 0 .353-.854L5 14.647z"},datadog:{title:"Datadog",fill:"#632CA6",d:"M19.57 17.04l-1.997-1.316-1.665 2.782-1.937-.567-1.706 2.604.087.82 9.274-1.71-.538-5.794zm-8.649-2.498l1.488-.204c.241.108.409.15.697.223.45.117.97.23 1.741-.16.18-.088.553-.43.704-.625l6.096-1.106.622 7.527-10.444 1.882zm11.325-2.712l-.602.115L20.488 0 .789 2.285l2.427 19.693 2.306-.334c-.184-.263-.471-.581-.96-.989-.68-.564-.44-1.522-.039-2.127.53-1.022 3.26-2.322 3.106-3.956-.056-.594-.15-1.368-.702-1.898-.02.22.017.432.017.432s-.227-.289-.34-.683c-.112-.15-.2-.199-.319-.4-.085.233-.073.503-.073.503s-.186-.437-.216-.807c-.11.166-.137.48-.137.48s-.241-.69-.186-1.062c-.11-.323-.436-.965-.343-2.424.6.421 1.924.321 2.44-.439.171-.251.288-.939-.086-2.293-.24-.868-.835-2.16-1.066-2.651l-.028.02c.122.395.374 1.223.47 1.625.293 1.218.372 1.642.234 2.204-.116.488-.397.808-1.107 1.165-.71.358-1.653-.514-1.713-.562-.69-.55-1.224-1.447-1.284-1.883-.062-.477.275-.763.445-1.153-.243.07-.514.192-.514.192s.323-.334.722-.624c.165-.109.262-.178.436-.323a9.762 9.762 0 0 0-.456.003s.42-.227.855-.392c-.318-.014-.623-.003-.623-.003s.937-.419 1.678-.727c.509-.208 1.006-.147 1.286.257.367.53.752.817 1.569.996.501-.223.653-.337 1.284-.509.554-.61.99-.688.99-.688s-.216.198-.274.51c.314-.249.66-.455.66-.455s-.134.164-.259.426l.03.043c.366-.22.797-.394.797-.394s-.123.156-.268.358c.277-.002.838.012 1.056.037 1.285.028 1.552-1.374 2.045-1.55.618-.22.894-.353 1.947.68.903.888 1.609 2.477 1.259 2.833-.294.295-.874-.115-1.516-.916a3.466 3.466 0 0 1-.716-1.562 1.533 1.533 0 0 0-.497-.85s.23.51.23.96c0 .246.03 1.165.424 1.68-.039.076-.057.374-.1.43-.458-.554-1.443-.95-1.604-1.067.544.445 1.793 1.468 2.273 2.449.453.927.186 1.777.416 1.997.065.063.976 1.197 1.15 1.767.306.994.019 2.038-.381 2.685l-1.117.174c-.163-.045-.273-.068-.42-.153.08-.143.241-.5.243-.572l-.063-.111c-.348.492-.93.97-1.414 1.245-.633.359-1.363.304-1.838.156-1.348-.415-2.623-1.327-2.93-1.566 0 0-.01.191.048.234.34.383 1.119 1.077 1.872 1.56l-1.605.177.759 5.908c-.337.048-.39.071-.757.124-.325-1.147-.946-1.895-1.624-2.332-.599-.384-1.424-.47-2.214-.314l-.05.059a2.851 2.851 0 0 1 1.863.444c.654.413 1.181 1.481 1.375 2.124.248.822.42 1.7-.248 2.632-.476.662-1.864 1.028-2.986.237.3.481.705.876 1.25.95.809.11 1.577-.03 2.106-.574.452-.464.69-1.434.628-2.456l.714-.104.258 1.834 11.827-1.424zM15.05 6.848c-.034.075-.085.125-.007.37l.004.014.013.032.032.073c.14.287.295.558.552.696.067-.011.136-.019.207-.023.242-.01.395.028.492.08.009-.048.01-.119.005-.222-.018-.364.072-.982-.626-1.308-.264-.122-.634-.084-.757.068a.302.302 0 0 1 .058.013c.186.066.06.13.027.207m1.958 3.392c-.092-.05-.52-.03-.821.005-.574.068-1.193.267-1.328.372-.247.191-.135.523.047.66.511.382.96.638 1.432.575.29-.038.546-.497.728-.914.124-.288.124-.598-.058-.698m-5.077-2.942c.162-.154-.805-.355-1.556.156-.554.378-.571 1.187-.041 1.646.053.046.096.078.137.104a4.77 4.77 0 0 1 1.396-.412c.113-.125.243-.345.21-.745-.044-.542-.455-.456-.146-.749"},algolia:{title:"Algolia",fill:"#003DFF",d:"M12 0C5.445 0 .103 5.285.01 11.817c-.097 6.634 5.285 12.131 11.92 12.17a11.91 11.91 0 0 0 5.775-1.443.281.281 0 0 0 .052-.457l-1.122-.994a.79.79 0 0 0-.833-.14 9.693 9.693 0 0 1-3.923.77c-5.36-.067-9.692-4.527-9.607-9.888.084-5.293 4.417-9.573 9.73-9.573h9.73v17.296l-5.522-4.907a.407.407 0 0 0-.596.063 4.52 4.52 0 0 1-3.934 1.793 4.538 4.538 0 0 1-4.192-4.168 4.53 4.53 0 0 1 4.512-4.872 4.532 4.532 0 0 1 4.509 4.126c.018.205.11.397.265.533l1.438 1.275a.28.28 0 0 0 .462-.158 6.82 6.82 0 0 0 .099-1.725c-.232-3.376-2.966-6.092-6.345-6.3-3.873-.24-7.11 2.79-7.214 6.588-.1 3.7 2.933 6.892 6.634 6.974a6.75 6.75 0 0 0 4.136-1.294l7.212 6.394a.48.48 0 0 0 .797-.36V.456A.456.456 0 0 0 23.54 0Z"},cloudflare:{title:"Cloudflare",fill:"#F38020",d:"M16.5088 16.8447c.1475-.5068.0908-.9707-.1553-1.3154-.2246-.3164-.6045-.499-1.0615-.5205l-8.6592-.1123a.1559.1559 0 0 1-.1333-.0713c-.0283-.042-.0351-.0986-.021-.1553.0278-.084.1123-.1484.2036-.1562l8.7359-.1123c1.0351-.0489 2.1601-.8868 2.5537-1.9136l.499-1.3013c.0215-.0561.0293-.1128.0147-.168-.5625-2.5463-2.835-4.4453-5.5499-4.4453-2.5039 0-4.6284 1.6177-5.3876 3.8614-.4927-.3658-1.1187-.5625-1.794-.499-1.2026.119-2.1665 1.083-2.2861 2.2856-.0283.31-.0069.6128.0635.894C1.5683 13.171 0 14.7754 0 16.752c0 .1748.0142.3515.0352.5273.0141.083.0844.1475.1689.1475h15.9814c.0909 0 .1758-.0645.2032-.1553l.12-.4268zm2.7568-5.5634c-.0771 0-.1611 0-.2383.0112-.0566 0-.1054.0415-.127.0976l-.3378 1.1744c-.1475.5068-.0918.9707.1543 1.3164.2256.3164.6055.498 1.0625.5195l1.8437.1133c.0557 0 .1055.0263.1329.0703.0283.043.0351.1074.0214.1562-.0283.084-.1132.1485-.204.1553l-1.921.1123c-1.041.0488-2.1582.8867-2.5527 1.914l-.1406.3585c-.0283.0713.0215.1416.0986.1416h6.5977c.0771 0 .1474-.0489.169-.126.1122-.4082.1757-.837.1757-1.2803 0-2.6025-2.125-4.727-4.7344-4.727"},upstash:{title:"Upstash",fill:"#00E9A3",d:"M13.8027 0C11.193 0 8.583.9952 6.5918 2.9863c-3.9823 3.9823-3.9823 10.4396 0 14.4219 1.9911 1.9911 5.2198 1.9911 7.211 0 1.991-1.9911 1.991-5.2198 0-7.211L12 12c.9956.9956.9956 2.6098 0 3.6055-.9956.9955-2.6099.9955-3.6055 0-2.9866-2.9868-2.9866-7.8297 0-10.8164 2.9868-2.9868 7.8297-2.9868 10.8164 0l1.8028-1.8028C19.0225.9952 16.4125 0 13.8027 0zM12 12c-.9956-.9956-.9956-2.6098 0-3.6055.9956-.9955 2.6098-.9955 3.6055 0 2.9867 2.9868 2.9867 7.8297 0 10.8164-2.9867 2.9868-7.8297 2.9868-10.8164 0l-1.8028 1.8028c3.9823 3.9822 10.4396 3.9822 14.4219 0 3.9823-3.9824 3.9823-10.4396 0-14.4219-.9956-.9956-2.3006-1.4922-3.6055-1.4922-1.3048 0-2.6099.4966-3.6054 1.4922-1.9912 1.9912-1.9912 5.2198 0 7.211z"},mixpanel:{title:"Mixpanel",fill:"#7856FF",d:"M6.967 9.996h3.053c-.763-.477-1.048-1.145-1.431-2.384L7.443 3.366C6.919 1.458 6.49.551 4.39.551H.004v1.145h.621c1.286 0 1.431.477 1.814 1.908L3.44 7.326c.524 1.814 1.337 2.67 3.53 2.67h-.003Zm7.06 0h3.053c2.194 0 2.956-.86 3.484-2.67l1.001-3.722c.382-1.431.57-1.908 1.814-1.908H24V.551h-4.34c-2.146 0-2.576.86-3.053 2.815l-1.145 4.246c-.384 1.286-.673 1.907-1.435 2.384Zm-4.007 4.008h4.007V9.996H10.02v4.008ZM0 23.449h4.39c2.1 0 2.529-.907 3.053-2.815l1.146-4.246c.383-1.239.668-1.907 1.431-2.384H6.967c-2.194 0-3.007.86-3.531 2.67l-1.001 3.722c-.383 1.431-.524 1.907-1.814 1.907H0v1.146Zm19.65 0h4.343v-1.146h-.622c-1.239 0-1.431-.476-1.814-1.907l-1.001-3.722c-.524-1.814-1.286-2.67-3.483-2.67h-3.046c.762.477 1.041 1.098 1.424 2.384l1.145 4.246c.477 1.955.907 2.815 3.054 2.815Z"},gemini:{title:"Google Gemini",fill:"#8E75B2",d:"M11.04 19.32Q12 21.51 12 24q0-2.49.93-4.68.96-2.19 2.58-3.81t3.81-2.55Q21.51 12 24 12q-2.49 0-4.68-.93a12.3 12.3 0 0 1-3.81-2.58 12.3 12.3 0 0 1-2.58-3.81Q12 2.49 12 0q0 2.49-.96 4.68-.93 2.19-2.55 3.81a12.3 12.3 0 0 1-3.81 2.58Q2.49 12 0 12q2.49 0 4.68.96 2.19.93 3.81 2.55t2.55 3.81"}};var y1=u0(wJ(),1),qV="https://brand.volter.ai/logo/twin-world/svg?size=64&variant=mono";function rq({href:Q,onClick:U}){return y1.jsxDEV("h1",{children:y1.jsxDEV("a",{href:Q,onClick:U,children:[y1.jsxDEV("img",{src:qV,alt:"",width:24,height:24,style:{verticalAlign:"middle"}},void 0,!1,void 0,this),y1.jsxDEV("span",{className:"brand-name",children:" Volter World"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}async function z5(Q){return(await Q.json().catch(()=>({}))).error??`answered ${Q.status}`}function AR(Q,U,Z=0,K=""){let[X,W]=_2.useState({state:"loading"});return _2.useEffect(()=>{W({state:"loading"})},[K,U]),_2.useEffect(()=>{if(!U)return;let z=!0;return(async()=>{try{let B=await Q(U),O=B.ok?{state:"ok",data:await B.json()}:{state:"error",status:B.status,error:await z5(B)};if(z)W(O)}catch(B){if(z)W({state:"error",status:0,error:String(B)})}})(),()=>{z=!1}},[K,U,Z]),X}function B5({load:Q,what:U,retry:Z,lines:K=3}){if(Q.state==="loading")return y1.jsxDEV(UV,{lines:K,label:`Loading ${U}…`},void 0,!1,void 0,this);if(Q.state==="error")return y1.jsxDEV("div",{role:"alert",className:"error-state",children:[y1.jsxDEV("span",{children:["Could not read ",U,": ",Q.error]},void 0,!0,void 0,this),Z?y1.jsxDEV("button",{type:"button",onClick:Z,children:"Try again"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this);return null}function UV({lines:Q=3,label:U="Loading…"}){return y1.jsxDEV("div",{className:"skeleton",role:"status","aria-label":U,children:Array.from({length:Q},(Z,K)=>y1.jsxDEV("span",{style:{width:`${[92,76,84,64,88][K%5]}%`}},K,!1,void 0,this))},void 0,!1,void 0,this)}function h0({iso:Q,time:U}){if(!Q)return y1.jsxDEV("span",{children:"—"},void 0,!1,void 0,this);let Z=new Date(Q);return y1.jsxDEV("time",{dateTime:Q,title:Q,children:Number.isNaN(Z.getTime())?Q:U?Z.toLocaleTimeString():Z.toLocaleString()},void 0,!1,void 0,this)}var IJ=(Q)=>Q?new Date(Q).toLocaleString():"—";function dq(Q){let U=Q?Date.parse(Q):Number.NaN;if(Number.isNaN(U))return"—";let Z=Math.max(0,Math.round((Date.now()-U)/1000));return Z<60?"just now":Z<3600?`${Math.round(Z/60)}m ago`:Z<86400?`${Math.round(Z/3600)}h ago`:`${Math.round(Z/86400)}d ago`}function J9(Q,U){let Z=U.replace(/[_-]+/g," "),K=Z.endsWith("s")?Z:/[^aeiou]y$/.test(Z)?`${Z.slice(0,-1)}ies`:/(ch|sh|x)$/.test(Z)?`${Z}es`:`${Z}s`;return`${Q} ${Q===1?Z:K}`}var EX=(Q)=>Q.length<=1?Q.join(""):`${Q.slice(0,-1).join(", ")} and ${Q[Q.length-1]}`,GV={github:"GitHub",openai:"OpenAI",aws:"AWS",hubspot:"HubSpot",paypal:"PayPal",youtube:"YouTube",tiktok:"TikTok",linkedin:"LinkedIn",xai:"xAI",sendgrid:"SendGrid",elevenlabs:"ElevenLabs",assemblyai:"AssemblyAI",planetscale:"PlanetScale",googleoauth:"Google sign-in",npm:"npm","npm-registry":"npm registry",posthog:"PostHog",mongodb:"MongoDB",pagerduty:"PagerDuty",mailgun:"Mailgun",turbopuffer:"turbopuffer"},F0=(Q)=>GV[Q]??Q.charAt(0).toUpperCase()+Q.slice(1);function A5({vendor:Q}){let U=zR[Q];return y1.jsxDEV("span",{className:U?"mark logo":"mark","aria-hidden":"true",children:U?y1.jsxDEV("svg",{viewBox:"0 0 24 24",children:y1.jsxDEV("path",{d:U.d,fill:U.fill},void 0,!1,void 0,this)},void 0,!1,void 0,this):F0(Q).charAt(0)},void 0,!1,void 0,this)}var BR=(Q)=>{Q.currentTarget.closest("details")?.removeAttribute("open")},DX="volter.theme",LR=()=>{try{let Q=localStorage.getItem(DX);return Q==="light"||Q==="dark"?Q:"system"}catch{return"system"}};function bX(Q=LR()){let U=document.documentElement;if(Q==="system")U.removeAttribute("data-theme");else U.setAttribute("data-theme",Q)}function MR(){let[Q,U]=_2.useState(LR),Z=(K)=>{try{if(K==="system")localStorage.removeItem(DX);else localStorage.setItem(DX,K)}catch{}bX(K),U(K)};return y1.jsxDEV("div",{className:"theme-choice",role:"radiogroup","aria-label":"Theme",children:["system","light","dark"].map((K)=>y1.jsxDEV("button",{type:"button",role:"radio","aria-checked":Q===K,onClick:()=>Z(K),children:K==="system"?"System":K==="light"?"Light":"Dark"},K,!1,void 0,this))},void 0,!1,void 0,this)}function TR(){return _2.useEffect(()=>{let Q=()=>[...document.querySelectorAll("details.menu[open], details.clock-more[open]")],U=(K)=>{if(K.key!=="Escape"||document.querySelector("dialog[open]"))return;let X=Q();if(!X.length)return;for(let W of X)W.removeAttribute("open");X[X.length-1].querySelector("summary")?.focus()},Z=(K)=>{let X=K.target;for(let W of Q())if(!X||!W.contains(X))W.removeAttribute("open")};return document.addEventListener("keydown",U),document.addEventListener("click",Z),()=>{document.removeEventListener("keydown",U),document.removeEventListener("click",Z)}},[]),null}function S8({open:Q,onClose:U,title:Z,children:K,footer:X,wide:W}){let z=_2.useRef(null),B=_2.useId();return _2.useEffect(()=>{let O=z.current;if(!O)return;if(Q&&!O.open){O.showModal();let T=O.querySelector(".dialog-body :is(input:not([type=hidden]):not([disabled]), select, textarea)");if(T?.focus(),T instanceof HTMLInputElement&&T.value&&/^(text|search|email|url)$/.test(T.type))T.select()}if(!Q&&O.open)O.close()},[Q]),y1.jsxDEV("dialog",{ref:z,className:W?"dialog wide":"dialog","aria-labelledby":B,onClose:U,onCancel:(O)=>{O.preventDefault(),U()},onMouseDown:(O)=>{if(O.target===z.current)U()},children:Q?y1.jsxDEV(y1.Fragment,{children:[y1.jsxDEV("div",{className:"dialog-head",children:[y1.jsxDEV("h2",{id:B,children:Z},void 0,!1,void 0,this),y1.jsxDEV("button",{type:"button",className:"icon-button","aria-label":"Close",onClick:U,children:"✕"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),y1.jsxDEV("div",{className:"dialog-body",children:K},void 0,!1,void 0,this),X?y1.jsxDEV("div",{className:"dialog-foot",children:X},void 0,!1,void 0,this):null]},void 0,!0,void 0,this):null},void 0,!1,void 0,this)}var yX="volter:confirm";function o5(Q){return new Promise((U)=>{window.dispatchEvent(new CustomEvent(yX,{detail:{ask:Q,resolve:U}}))})}function RR(){let[Q,U]=_2.useState(null),[Z,K]=_2.useState("");_2.useEffect(()=>{let B=(O)=>{K(""),U(O.detail)};return window.addEventListener(yX,B),()=>window.removeEventListener(yX,B)},[]);let X=(B)=>{Q?.resolve(B),U(null)},W=Q?.ask,z=!W?.typed||Z===W.typed;return y1.jsxDEV(S8,{open:Boolean(Q),onClose:()=>X(!1),title:W?.title??"",footer:y1.jsxDEV(y1.Fragment,{children:[y1.jsxDEV("button",{type:"button",onClick:()=>X(!1),children:"Cancel"},void 0,!1,void 0,this),y1.jsxDEV("button",{type:"button",className:W?.danger?"danger-button":"primary",disabled:!z,onClick:()=>X(!0),children:W?.action},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:[W?.body?y1.jsxDEV("div",{className:"confirm-body",children:W.body},void 0,!1,void 0,this):null,W?.typed?y1.jsxDEV("div",{className:"typed-confirm",children:[y1.jsxDEV("p",{children:["Type ",y1.jsxDEV("code",{children:W.typed},void 0,!1,void 0,this)," to confirm."]},void 0,!0,void 0,this),y1.jsxDEV("input",{autoFocus:!0,"aria-label":`Type ${W.typed} to confirm`,value:Z,onChange:(B)=>K(B.target.value),onKeyDown:(B)=>{if(B.key==="Enter"&&z)X(!0)},autoComplete:"off",spellCheck:!1},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)}var vX="volter:toast";function t2(Q,U="ok"){window.dispatchEvent(new CustomEvent(vX,{detail:{text:Q,kind:U}}))}function OR(){let[Q,U]=_2.useState([]);return _2.useEffect(()=>{let Z=0,K=(X)=>{let{text:W,kind:z}=X.detail,B=++Z;if(U((O)=>[...O.slice(-3),{id:B,text:W,kind:z}]),z!=="error")setTimeout(()=>U((O)=>O.filter((T)=>T.id!==B)),4500)};return window.addEventListener(vX,K),()=>window.removeEventListener(vX,K)},[]),y1.jsxDEV("div",{className:"toasts",role:"region","aria-label":"Notifications",children:Q.map((Z)=>y1.jsxDEV("div",{className:`toast ${Z.kind}`,role:Z.kind==="error"?"alert":"status",children:[y1.jsxDEV("span",{children:Z.text},void 0,!1,void 0,this),y1.jsxDEV("button",{type:"button",className:"icon-button","aria-label":"Dismiss",onClick:()=>U((K)=>K.filter((X)=>X.id!==Z.id)),children:"✕"},void 0,!1,void 0,this)]},Z.id,!0,void 0,this))},void 0,!1,void 0,this)}function uX({value:Q,label:U,secret:Z}){let[K,X]=_2.useState(!1);return y1.jsxDEV("div",{className:"copy-field",children:[U?y1.jsxDEV("span",{className:"copy-label",children:U},void 0,!1,void 0,this):null,y1.jsxDEV("div",{className:"copy-row",children:[y1.jsxDEV("input",{readOnly:!0,value:Q,"aria-label":U??"Value",onFocus:(z)=>z.currentTarget.select(),spellCheck:!1},void 0,!1,void 0,this),y1.jsxDEV("button",{type:"button",onClick:()=>{navigator.clipboard?.writeText(Q).then(()=>{X(!0),setTimeout(()=>X(!1),1600),t2(Z?"Copied. Keep it somewhere safe":"Copied")}).catch(()=>t2("Your browser would not copy it: select it and copy","error"))},children:K?"Copied":"Copy"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function xX({label:Q,items:U}){return y1.jsxDEV("details",{className:"menu row-menu",children:[y1.jsxDEV("summary",{className:"icon-button",role:"button","aria-haspopup":"menu","aria-label":Q,title:Q,children:"⋯"},void 0,!1,void 0,this),y1.jsxDEV("div",{className:"popover menu-list",role:"menu",children:U.filter((Z)=>Boolean(Z)).map((Z)=>Z.href?y1.jsxDEV("a",{role:"menuitem",href:Z.href,className:Z.danger?"danger-item":void 0,onClick:BR,children:Z.label},Z.label,!1,void 0,this):y1.jsxDEV("button",{type:"button",role:"menuitem",disabled:Z.disabled,className:Z.danger?"danger-item":void 0,onClick:(K)=>{BR(K),Z.onSelect?.()},children:Z.label},Z.label,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function wR({title:Q,children:U,action:Z}){return y1.jsxDEV("div",{className:"empty-state",children:[y1.jsxDEV("p",{className:"empty-title",children:Q},void 0,!1,void 0,this),U?y1.jsxDEV("div",{className:"empty-body",children:U},void 0,!1,void 0,this):null,Z?y1.jsxDEV("div",{className:"empty-action",children:Z},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}function IR(){return _2.useEffect(()=>{let Q=(Z)=>{let K=document.querySelector("main.app"),X=Z.target;if(K?.hasAttribute("data-drawer")&&X&&!X.closest(".side")&&!X.closest(".drawer-button"))K.removeAttribute("data-drawer")},U=(Z)=>{if(Z.key==="Escape")ZV()};return document.addEventListener("click",Q),document.addEventListener("keydown",U),()=>{document.removeEventListener("click",Q),document.removeEventListener("keydown",U)}},[]),y1.jsxDEV("button",{type:"button",className:"icon-button drawer-button","aria-label":"Menu",onClick:()=>{document.querySelector("main.app")?.toggleAttribute("data-drawer")},children:"☰"},void 0,!1,void 0,this)}var ZV=()=>{document.querySelector("main.app")?.removeAttribute("data-drawer")};var ER=u0(CR(),1);function mX(Q={}){let U=(K,X)=>Q.tools?`${X} (\`${K}\`)`:`\`${K}\``,Z=["Set up Volter World for this app, so its calls to Stripe, Slack, GitHub, OpenAI and the other services it uses go to local twins instead of the real APIs. The app keeps its real SDKs and code.","",Q.tools?"1. You have the Volter World tools (volter mcp). If the `volter` command is missing, install it: `npm install -g @volter/world`.":"1. Install the command and your agent tooling: `npm install -g @volter/world`, then `volter agents install --yes`.",`2. In the app's folder, ${U("volter world init --install","world_init")}: it detects the vendors the app calls and installs their twins. Show me the vendors it detected and why, before keeping them.`,`3. ${Q.tools?"Start it with world_up":"Start it: `volter world up`"}, then run the tests inside it: ${U("volter world run -- <the test command>","world_run")}. Fix anything that fails because a call went to the real service.`,`4. Tell me what the app did at each vendor (${U("volter world log","world_log")}), and give me the dashboard link (${Q.tools?"world_view":"`volter world view --no-open`, started in the background: it keeps running"}).`];if(Q.platform){let K=Q.world??"<org>/<world>";Z.push(`5. Share it with my team on ${Q.platform}: ${U(`volter login ${Q.platform}`,"platform_login")} gives a link and a code for me to approve in my browser. Once I have, link it with ${U(`volter remote add origin ${K} --create`,"remote_link with create: true")}${Q.world?"":" (ask me for <org>/<world>)"}, then send what the app did: ${U('volter world changeset -m "<what and why>"',"world_changeset")} and ${U("volter world push","world_push")}.`)}return Z.push("","The guide: https://world.volter.ai/docs/guides/use-with-a-coding-agent.md"),Z.join(`
248
- `)}var H=u0(wJ(),1),iq="volter.console.token",NJ=document.getElementById("root"),q0=NJ.dataset.base??"/-/console",B0=window.location.origin,w6=(NJ.dataset.worlds??B0).replace(/\/+$/,""),bR=(NJ.dataset.names??"").split(",").filter((Q)=>Q!==""),R6=NJ.dataset.worldOrigin==="1",k8=window.fetch.bind(window),O6="(session)",uR="(pass)",fJ=(Q)=>{try{if(Q&&!R6)sessionStorage.setItem(iq,Q);else sessionStorage.removeItem(iq);localStorage.removeItem(iq)}catch{}},xR="volter.console.portal",hR=(Q)=>{try{if(typeof Q==="string"&&/^https?:$/.test(new URL(Q).protocol))sessionStorage.setItem(xR,new URL(Q).origin)}catch{}},HV=()=>{return y8.get("token")??""},o2=()=>{try{let Q=sessionStorage.getItem(xR)??"";return Q&&/^https?:$/.test(new URL(Q).protocol)?new URL(Q).origin:""}catch{return""}},YV=()=>{let Q=HV();if(R6){if(fJ(""),y8.get("pass"))return uR;let U=new URLSearchParams(window.location.search).has("signin");if(U)try{window.history.replaceState(null,"",window.location.pathname+window.location.hash)}catch{}return Q||(U?"":O6)}if(Q)return fJ(Q),Q;try{return sessionStorage.getItem(iq)??""}catch{return""}};async function X0(Q,U,Z={}){return k8(`${B0}${U}`,{...Z,headers:{...Z.headers??{},...Q===O6?{}:{"x-volter-token":Q},...Z.body&&!Z.headers?.["content-type"]?{"content-type":"application/json"}:{}}})}function L5(Q,U,Z=0){return AR((K)=>X0(Q,K),U,Z,Q)}var U9=(Q)=>{let U=new Date(Q),Z=(K)=>String(K).padStart(2,"0");return`${U.getFullYear()}-${Z(U.getMonth()+1)}-${Z(U.getDate())}T${Z(U.getHours())}:${Z(U.getMinutes())}`},SR=(Q)=>new Date(Math.ceil(Date.parse(Q)/60000)*60000).toISOString(),nq=(Q)=>Q.operation==="observed"?`observed${Q.provenance==="placeholder"?" (default data)":" (vendor)"}`:Q.receipt?`${Q.receipt.status??""} ${Q.receipt.externalId??""} ${Q.receipt.reason??""}`.trim():Q.provenance==="placeholder"?"default data":"unpushed",mR=(Q)=>Q.actor?`${Q.actor.kind}${Q.actor.id?` ${Q.actor.id}`:""}`:"—",gR=(Q)=>{let U=/^[0-9a-f]{2}-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2}$/.exec(Q??"");return U?{trace:U[1],span:U[2]}:null},lX="volter.console.snapshots",L3=()=>{try{return JSON.parse(sessionStorage.getItem(lX)??"{}")}catch{return{}}},pR=new Map,rX=(Q)=>{if(R6){if(Q.token||Q.readToken)pR.set(Q.name,{token:Q.token,readToken:Q.readToken});Q={...Q,token:"",readToken:""}}try{sessionStorage.setItem(lX,JSON.stringify({...L3(),[Q.name]:Q}))}catch{}},cR=(Q)=>pR.get(Q)?.readToken||L3()[Q]?.readToken||"",PJ=(Q)=>{try{let U=L3();delete U[Q],sessionStorage.setItem(lX,JSON.stringify(U))}catch{}},y8=new URLSearchParams(window.location.hash.slice(1)),Q9=y8.get("close")??"";function CJ(Q){if(typeof Q!=="string")return null;let U;try{U=new URL(Q)}catch{return null}return(U.protocol==="http:"||U.protocol==="https:")&&U.origin===Q.replace(/\/+$/,"")?U:null}function dX(Q){let U=CJ(Q);if(!U)return null;let Z=new URL(B0);if(U.protocol!==Z.protocol||U.port!==Z.port)return null;if(U.hostname===Z.hostname)return U.origin;let K=/^[a-z0-9](?:[a-z0-9]|-(?!-))*--[a-z0-9](?:[a-z0-9]|-(?!-))*\./;if(!K.test(U.hostname))return null;let X=U.hostname.replace(K,"");return X===Z.hostname||K.test(Z.hostname)&&X===Z.hostname.replace(K,"")?U.origin:null}function WV(Q){let U;try{U=JSON.parse(Q)}catch{return null}let Z=/^[a-z0-9][a-z0-9-]*\/[a-z0-9][a-z0-9-]*$/i;if(typeof U.name!=="string"||!Z.test(U.name)||typeof U.parent!=="string"||!Z.test(U.parent)||typeof U.at!=="string")return null;let K=U.parentOrigin===void 0?void 0:dX(U.parentOrigin);return{name:U.name,parent:U.parent,token:typeof U.token==="string"?U.token:"",readToken:typeof U.readToken==="string"?U.readToken:"",at:U.at,expiresAt:typeof U.expiresAt==="string"?U.expiresAt:null,...K?{parentOrigin:K}:{}}}{let Q=y8.get("snapshot");if(Q){let U=WV(Q);if(U&&!L3()[U.name])rX(U)}}var lR="volter.console.home",rR=(Q)=>{let U=CJ(Q);if(!U)return null;let Z=new URL(B0).hostname,K=Z.replace(/^[a-z0-9](?:[a-z0-9]|-(?!-))*--[a-z0-9](?:[a-z0-9]|-(?!-))*\./,"");return U.hostname===Z||U.hostname===K?U.origin:null};{let Q=rR(y8.get("home"));if(Q)try{sessionStorage.setItem(lR,Q)}catch{}}if(["token","pass","portal","snapshot","home","close"].some((Q)=>y8.has(Q)))try{window.history.replaceState(null,"",window.location.pathname+window.location.search)}catch{}var q9=()=>{try{return rR(sessionStorage.getItem(lR))??""}catch{return""}};function iX(Q,U,Z,K){let X=new URLSearchParams({token:U,home:q9()||B0}),W=L3()[Z];if(W)X.set("snapshot",JSON.stringify(W));window.location.replace(`${Q}${K??`${window.location.pathname}${window.location.search}`}#${X.toString()}`)}function V8(){return window.location.pathname.slice(q0.length).split("/").filter(Boolean).map((Q)=>{try{return decodeURIComponent(Q)}catch{return""}})}var jR=/^[a-z0-9](?:[a-z0-9]|-(?!-))*$/i,T6=(Q,U)=>Q&&U&&jR.test(Q)&&jR.test(U)?`${Q}/${U}`:"";function v0(Q){window.history.pushState(null,"",`${q0}/${Q.map(encodeURIComponent).join("/")}`),window.dispatchEvent(new PopStateEvent("popstate"))}function cX(Q,U){let Z=dX(L3()[Q]?.origin);if(Z&&Z!==B0){iX(Z,cR(Q),Q,`${q0}/${U.map(encodeURIComponent).join("/")}`);return}v0(U)}async function VR(){let[Q,U]=V8(),Z=T6(Q,U),K=Z?[Z]:bR;if(K.length===0){let X=await k8(`${B0}/-/ping`).catch(()=>null);K=X?.ok?(await X.json().catch(()=>({}))).worlds??[]:[]}K=K.filter((X)=>{let[W,z,...B]=X.split("/");return B.length===0&&T6(W,z)===X});for(let X of K){let W=await k8(`${B0}/-/${X}/session`,{method:"POST"}).catch(()=>null);if(!W)continue;let z=await W.json().catch(()=>({})),B=CJ(z.origin)?.origin;if(W.status===409&&B&&B!==B0)return window.location.replace(`${B}${q0}/${X}`),"moved";if(W.ok&&z.local)return{token:typeof z.token==="string"&&z.token?z.token:O6}}return null}function zV(){let[Q,U]=B1.useState(YV()),[Z,K]=B1.useState(!1),[X,W]=B1.useState(!1),[z,B]=B1.useState(""),[O,T]=B1.useState(null),[R,L]=B1.useState(null),[M,I]=B1.useState(V8());B1.useEffect(()=>{let x=()=>I(V8());return window.addEventListener("popstate",x),()=>window.removeEventListener("popstate",x)},[]),B1.useEffect(()=>{let[x,d]=V8(),g=T6(x,d),[n,j]=g?g.split("/"):[],i=L3()[Q9];if(!Q9||!Q||!n||!j||!i?.made||i.parent!==`${n}/${j}`||T6(...Q9.split("/"))!==Q9)return;try{window.history.replaceState(null,"",window.location.pathname+window.location.search)}catch{}X0(Q,`/-/${n}/${j}/branches/${Q9}`,{method:"DELETE"}).catch(()=>null).then(()=>PJ(Q9))},[Q]);let f=B1.useCallback(async(x)=>{if(L(null),!x){let j=await VR();if(j==="moved")return;if(j){if(K(!0),j.token!==O6)fJ(j.token);U(j.token);return}T(null),W(!0);return}if(R6&&x===O6){let j=await VR();if(j==="moved")return;if(j)K(!0)}if(R6&&x===uR){let[j,i]=V8(),q1=T6(j,i),[Q1,Y1]=q1?q1.split("/"):[],L1=Q1&&Y1?await k8(`${B0}/-/${Q1}/${Y1}/session`,{method:"POST",headers:{"x-volter-pass":y8.get("pass")??""}}).catch(()=>null):null;if(!L1){L(`${B0} did not answer: no session was opened`),T(null);return}if(!L1.ok){L(`${await z5(L1)}. Open it again from the platform.`),T(null);return}hR((await L1.json().catch(()=>({}))).issuer),U(O6);return}if(R6&&x!==O6){let[j,i]=V8(),q1=T6(j,i),[Q1,Y1]=q1?q1.split("/"):[],L1=Q1&&Y1?await k8(`${B0}/-/${Q1}/${Y1}/session`,{method:"POST",headers:{"x-volter-token":x}}).catch(()=>null):null;if(!L1){L(`${B0} did not answer: no session was opened`),T(null);return}if(!L1.ok){let M1=await z5(L1);L(L1.status===401||L1.status===403?`That token does not open ${Q1}/${Y1}.`:L1.status===409?`${Q1}/${Y1}'s session lives at another origin: ${M1}`:`The World could not open a session (${L1.status}): ${M1}`),T(null);return}U(O6);return}let d=R6?new Response(null,{status:404}):await X0(x,"/-/worlds");if(d.ok){let{worlds:j}=await d.json();T({kind:"admin",worlds:j});return}if(d.status===429){L("You are asking faster than the platform allows — wait a moment and reload."),T(null);return}if(d.status>=500){let j=await d.json().catch(()=>({}));L(`The platform could not list your worlds${j.error?`: ${j.error}`:""}. Reload; if it stays, the status page says what is wrong.`),T(null);return}let g=bR;if(g.length===0){let j=await k8(`${B0}/-/ping`);if(!j.ok){L(`${B0} does not answer as a host`),T(null);return}if(g=(await j.json()).worlds??[],g.length===0){L(`${B0} does not list its worlds: open the console with the World's URL (volter world console <url>/<org>/<world>)`),T(null);return}}let n=[];for(let j of g){let i=await X0(x,`/-/${j}/twins`);if(i.ok){let q1=await i.json();n.push({name:j,base:`${w6}/${j}`,twins:(q1.twins??[]).map((Q1)=>({vendor:Q1.twin,protocol:Q1.protocol??null,root:Q1.root??null}))})}}if(n.length===0){L("This link or key opens no World here: it was revoked, or it has ended."),T(null);return}T({kind:"world",worlds:n})},[]);B1.useEffect(()=>{f(Q)},[Q,f]);let D=(x)=>O?.kind==="admin"?O.worlds.find((d)=>d.name===x)?.token??Q:Q,[V,k]=B1.useState("");if(!Q||!O&&!R)return H.jsxDEV("main",{children:[H.jsxDEV(rq,{href:`${q0}/`},void 0,!1,void 0,this),Q&&!O&&!R||!Q&&!X?H.jsxDEV("p",{children:"Opening…"},void 0,!1,void 0,this):H.jsxDEV("form",{onSubmit:(x)=>{x.preventDefault(),fJ(z.trim()),U(z.trim())},children:[H.jsxDEV("p",{children:"A host's admin token opens every world it serves; a world's token opens that world."},void 0,!1,void 0,this),H.jsxDEV("label",{children:["Token ",H.jsxDEV("input",{name:"token",type:"password",value:z,onChange:(x)=>B(x.target.value),autoFocus:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("button",{type:"submit",children:"Open"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this);let h=()=>{if(Z){window.location.reload();return}if(R6){let[x,d]=V8(),g=T6(x,d),[n,j]=g?g.split("/"):[],i=()=>window.location.replace(o2()?`${o2()}/`:`${B0}${q0}/${n&&j?`${n}/${j}`:""}?signin`);if(setTimeout(i,2000),n&&j)k8(`${B0}/-/${n}/${j}/session/end`,{method:"POST"}).catch(()=>null).then(i);else i();return}if(O)for(let x of O.worlds)navigator.sendBeacon(`${x.base.replace(/\/[^/]+\/[^/]+$/,"")}/-/${x.name}/session/end`);fJ(""),U(""),B(""),T(null),v0([])};if(R||!O)return H.jsxDEV("main",{children:[H.jsxDEV(rq,{href:`${q0}/`},void 0,!1,void 0,this),H.jsxDEV("p",{role:"alert",children:R??"nothing answered"},void 0,!1,void 0,this),o2()?H.jsxDEV("a",{className:"button",href:`${o2()}/`,children:["Back to ",new URL(o2()).host]},void 0,!0,void 0,this):H.jsxDEV("button",{onClick:h,children:Z?"Try again":"Use another token"},void 0,!1,void 0,this)]},void 0,!0,void 0,this);let[P,C,v,b,E]=M,p=v==="~",a=/^[A-Za-z0-9_-]+$/,m=p||!v||!a.test(v)?void 0:v,_1=E&&a.test(E)?E:void 0,$1=T6(P,C),J1=$1?L3()[$1]??null:null,y=(x)=>cR(x)||D(x),u=async(x)=>{let d=dX(x.parentOrigin);if(d&&d!==B0){PJ(x.name),window.location.assign(`${d}${q0}/${x.parent}#close=${encodeURIComponent(x.name)}`);return}if(x.made)await X0(D(x.parent),`/-/${x.parent}/branches/${x.name}`,{method:"DELETE"}).catch(()=>null),PJ(x.name);v0(x.parent.split("/"))};return H.jsxDEV("main",{className:$1?"app":void 0,children:[H.jsxDEV("header",{children:[$1?H.jsxDEV(IR,{},void 0,!1,void 0,this):null,H.jsxDEV(rq,{href:`${q9()&&q9()!==B0?q9():""}${q0}/`,onClick:(x)=>{if(q9()&&q9()!==B0)return;x.preventDefault(),v0([])}},void 0,!1,void 0,this),H.jsxDEV("nav",{"aria-label":"breadcrumb",className:"crumbs",children:[$1?H.jsxDEV(H.Fragment,{children:[H.jsxDEV("span",{className:"crumb-sep","aria-hidden":"true",children:"/"},void 0,!1,void 0,this),H.jsxDEV("span",{children:$1.split("/")[0]},void 0,!1,void 0,this),H.jsxDEV("span",{className:"crumb-sep","aria-hidden":"true",children:"/"},void 0,!1,void 0,this),H.jsxDEV("a",{href:`${q0}/${$1}`,className:"crumb-world",onClick:(x)=>{x.preventDefault(),v0($1.split("/"))},children:$1.split("/")[1]},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,m?H.jsxDEV("span",{children:[" / ",m]},void 0,!0,void 0,this):null,p&&b==="trace"?H.jsxDEV("span",{children:" / trace"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),o2()?H.jsxDEV("a",{href:`${o2()}/${$1?encodeURIComponent($1.split("/")[0]):""}`,title:`Back to the platform at ${new URL(o2()).host}`,className:"back-link",children:["← ",H.jsxDEV("span",{className:"back-text",children:$1?`${$1.split("/")[0]}'s Worlds`:new URL(o2()).host},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,H.jsxDEV("span",{className:"mode",children:Z?"on this machine":J1?"a snapshot, read only":V?`signed in as ${V}`:O.kind==="admin"?"host: admin":"opened with a link or key"},void 0,!1,void 0,this),Z?null:H.jsxDEV("button",{onClick:h,children:"Sign out"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$1?H.jsxDEV(MV,{name:$1,token:y($1),twin:m,tab:p?b??"overview":"overview",arg:p?_1:void 0,admin:J1?null:O.kind==="admin"?Q:null,snapshot:J1,onReturn:u,opens:(x)=>!!L3()[x]||O.kind==="admin"&&O.worlds.some((d)=>d.name===x),onRemoved:()=>{f(Q),v0([])},onWho:k},$1,!1,void 0,this):H.jsxDEV(BV,{mode:O,admin:O.kind==="admin"?Q:null,reload:()=>f(Q)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function BV({mode:Q,admin:U,reload:Z}){let[K,X]=B1.useState(""),[W,z]=B1.useState(""),[B,O]=B1.useState(""),[T,R]=B1.useState(null),L=async(V)=>{if(!await o5({title:`Rotate the tokens of ${V}?`,body:"Every app, script and person holding the current tokens loses access at once. The new ones are shown once.",action:"Rotate tokens",danger:!0}))return;let k=await X0(U,`/-/worlds/${V}/rotate`,{method:"POST"}),h=await k.json().catch(()=>({}));R(k.ok?`rotated ${V}: the new tokens are shown once — token ${h.token} · read token ${h.readToken}`:h.error??`answered ${k.status}`),await Z()},M=async(V)=>{let k=await X0(U,`/-/worlds/${V}`,{method:"DELETE"}),h=await k.json().catch(()=>({}));R(k.ok?`removed ${V}`:h.error??`answered ${k.status}`),await Z()},[I,f]=B1.useState(!1),D=async(V)=>{V.preventDefault(),R(null),f(!0);try{let k=await X0(U,"/-/worlds",{method:"POST",body:JSON.stringify({org:K,world:W,vendors:B.split(",").map((P)=>P.trim()).filter(Boolean)})}),h=await k.json();if(!k.ok){R(h.error??`the host answered ${k.status}`);return}R(`provisioned ${h.name}`),z(""),O(""),await Z()}finally{f(!1)}};return H.jsxDEV("section",{"aria-labelledby":"worlds",children:[H.jsxDEV("h2",{id:"worlds",children:"Worlds"},void 0,!1,void 0,this),H.jsxDEV("p",{className:"lede",children:"A World is a copy of the services your app uses (Stripe, Slack, GitHub…), with none of the real consequences: your app talks to it, and you can see everything it did on each vendor's own screens."},void 0,!1,void 0,this),H.jsxDEV("table",{children:[H.jsxDEV("thead",{children:H.jsxDEV("tr",{children:[H.jsxDEV("th",{children:"world"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"address"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"stand-ins for"},void 0,!1,void 0,this),U?H.jsxDEV("th",{children:"actions"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("tbody",{children:Q.worlds.map((V)=>H.jsxDEV("tr",{children:[H.jsxDEV("td",{children:H.jsxDEV("a",{href:`${q0}/${V.name}`,onClick:(k)=>{k.preventDefault(),v0(V.name.split("/"))},children:V.name},void 0,!1,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("td",{children:H.jsxDEV("code",{children:V.base},void 0,!1,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("td",{children:V.twins.map((k)=>F0(k.vendor)).join(", ")||"—"},void 0,!1,void 0,this),U?H.jsxDEV("td",{children:[H.jsxDEV("button",{type:"button","aria-label":`Rotate the tokens of ${V.name}`,onClick:()=>void L(V.name),children:"Rotate tokens"},void 0,!1,void 0,this)," ",H.jsxDEV("button",{type:"button","aria-label":`Remove ${V.name}`,onClick:()=>void o5({title:`Remove ${V.name}?`,body:"The host stops serving it and its whole history goes with it. This cannot be undone.",action:"Remove World",danger:!0,typed:V.name}).then((k)=>{if(k)M(V.name)}),children:"Remove world"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},V.name,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),U?H.jsxDEV("form",{onSubmit:D,"aria-labelledby":"provision",children:[H.jsxDEV("h3",{id:"provision",children:"Provision a world"},void 0,!1,void 0,this),H.jsxDEV("label",{children:["Org ",H.jsxDEV("input",{name:"org",value:K,onChange:(V)=>X(V.target.value),required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("label",{children:["World ",H.jsxDEV("input",{name:"world",value:W,onChange:(V)=>z(V.target.value),required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("label",{children:["Twins ",H.jsxDEV("input",{name:"vendors",value:B,onChange:(V)=>O(V.target.value),placeholder:"github, slack",required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("button",{type:"submit",disabled:I,children:I?"Provisioning… (a host boots the world; ten seconds or so)":"Provision"},void 0,!1,void 0,this),T?H.jsxDEV("p",{role:"status",children:T},void 0,!1,void 0,this):null]},void 0,!0,void 0,this):T?H.jsxDEV("p",{role:"status",children:T},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}var gX=[["overview","Dashboard"],["branches","Branches"],["settings","Settings"],["branch","Overview"],["changes","Changes"],["changesets","Changesets"],["activity","Activity"],["vendors","Vendors"],["canvas","All screens"]],AV={dashboard:"overview",mirrors:"vendors",screens:"canvas",timeline:"activity",monitoring:"activity",trace:"activity",operations:"settings"},D8=(Q,U)=>`${w6}/${Q}/${U}/`,kR={verify:"verified",use:"used",issue:"issued",revoke:"revoked",rotate:"rotated",seed:"seeded",upsert:"saved",set:"set",start:"started",finish:"finished",fail:"failed",schedule:"scheduled",deliver:"delivered",like:"liked",follow:"followed",reply:"replied",create:"created",update:"updated",delete:"deleted",record:"recorded",remove:"removed",add:"added",send:"sent",post:"posted",postmessage:"posted",cancel:"canceled",close:"closed",open:"opened",publish:"published",upload:"uploaded",invite:"invited",archive:"archived",merge:"merged",refund:"refunded",capture:"captured",confirm:"confirmed",pay:"paid"};function n5(Q){let U=Q.operation??Q.op,Z=(U.includes(".")?U.slice(U.lastIndexOf(".")+1):U).toLowerCase(),K=Q.subject.type.replace(/[_-]+/g," ").trim(),X=`${K.charAt(0).toUpperCase()}${K.slice(1)}`,W=/(^|\.)twin\./.test(U)||/^seed_/.test(Z),z=U.replace(/[._]+/g," ").trim(),B=W?`${X} seeded`:kR[Z]?`${X} ${kR[Z]}`:`${z.charAt(0).toUpperCase()}${z.slice(1)}`,O=Q.fields??{},T=["title","name","email","text","subject","summary","description"].map((L)=>O[L]).find((L)=>typeof L==="string"&&L.trim()!=="")??null,R=T===null?null:T.replace(/<([@#!])[^|>]*\|([^>]+)>/g,(L,M,I)=>`${M==="!"?"@":M}${I}`).replace(/<(?:https?:[^|>]+)\|([^>]+)>/g,"$1").replace(/<(https?:[^>]+)>/g,"$1");return{what:B,label:R===null?null:R.length>80?`${R.slice(0,79)}…`:R}}var aq=(Q)=>/token|password|secret|key|credential/i.test(Q.subject.type)&&Q.subject.id.length>6?`••••${Q.subject.id.slice(-4)}`:Q.subject.id,oq=(Q,U)=>!Q.actor?"":Q.actor.kind==="system"?`by ${F0(U)}`:Q.actor.id?`by ${Q.actor.id}`:Q.actor.kind==="agent"||Q.actor.kind==="app"?"by your app":`by ${Q.actor.kind}`,LV=(Q)=>Q.operation==="observed"||Q.receipt||Q.provenance==="placeholder"?nq(Q):null;function MV({name:Q,token:U,twin:Z,tab:K,arg:X,admin:W,snapshot:z,onReturn:B,opens:O,onRemoved:T,onWho:R}){let[L,M]=B1.useState("pending"),[I,f]=B1.useState(null),[D,V]=B1.useState(0),[k,h]=B1.useState(null);B1.useEffect(()=>{let Q1=!0;return f(null),X0(U,`/-/${Q}/session`,{method:"POST"}).then(async(Y1)=>{let L1=await Y1.json().catch(()=>({}));if(hR(L1.issuer),L1.who)R?.(L1.who);h(typeof L1.signsAs==="string"?L1.signsAs:null);let M1=CJ(L1.origin)?.origin;if(Y1.status===409&&M1&&M1!==B0){iX(M1,U,Q);return}if(!Q1)return;if(M(!Y1.ok?"unknown":L1.scope==="read"?"read":L1.scope==="write"?"write":"unknown"),!Y1.ok)f(L1.error??`answered ${Y1.status}`)}).catch((Y1)=>{if(Q1)M("unknown"),f(`the World did not answer: ${Y1 instanceof Error?Y1.message:String(Y1)}`)}),()=>{Q1=!1}},[Q,U,D]);let P=I?{state:"error",error:I}:L==="pending"?{state:"pending"}:{state:"ok",scope:L},C=L==="write",v=(Q1)=>{if(Q1.status===403)M("read")},[b,E]=B1.useState(0);B1.useEffect(()=>{let Q1=setInterval(()=>{if(!document.hidden)E((Y1)=>Y1+1)},5000);return()=>clearInterval(Q1)},[]);let[p,a]=B1.useState(0),m=L5(U,`/-/${Q}/clock`,b+p),_1=L5(U,`/-/${Q}/twins`),$1=L5(U,`/-/${Q}/branches`,p),J1=L5(U,`/-/${Q}/map`,Math.floor(b/2)),y=!($1.state==="error"&&($1.status===404||$1.status===405));if(Z)return H.jsxDEV(cV,{name:Q,token:U,twin:Z},void 0,!1,void 0,this);let u=gX.some(([Q1])=>Q1===K)?K:AV[K]??"overview",x=_1.state==="ok"?_1.data.twins.map((Q1)=>Q1.twin):[],d=(Q1)=>J1.state==="ok"?(J1.data.twins.find((Y1)=>Y1.twin===Q1)?.resources??[]).reduce((Y1,L1)=>Y1+L1.count,0):0,g=u==="vendors"&&X?X:void 0,n=()=>{M("pending"),V((Q1)=>Q1+1)};if(u==="canvas"||u==="vendors"&&!g)return H.jsxDEV(bV,{name:Q,twins:_1,session:P,retry:n,snapshot:z,back:()=>v0(Q.split("/"))},void 0,!1,void 0,this);let j=g?F0(g):gX.find(([Q1])=>Q1===u)?.[1]??"",i=(Q1)=>(Y1)=>{Y1.preventDefault(),v0([...Q.split("/"),...Q1])},q1=(Q1,Y1=gX.find(([L1])=>L1===Q1)?.[1]??Q1)=>{let L1=u===Q1&&!g;return H.jsxDEV("a",{href:`${q0}/${Q}/~/${Q1}`,"aria-current":L1?"page":void 0,className:L1?"on":void 0,onClick:i(["~",Q1]),children:Y1},void 0,!1,void 0,this)};return H.jsxDEV("div",{className:"shell",children:[H.jsxDEV("aside",{className:"side",children:[H.jsxDEV("nav",{"aria-label":`${Q} pages`,className:"side-nav",children:[H.jsxDEV(TV,{name:Q},void 0,!1,void 0,this),H.jsxDEV("p",{className:"side-group",children:"World"},void 0,!1,void 0,this),q1("overview"),y?q1("branches"):null,q1("settings"),H.jsxDEV(RV,{name:Q,snapshot:z,branches:y?$1:null,opens:O},void 0,!1,void 0,this),H.jsxDEV("p",{className:"side-group",children:"Branch"},void 0,!1,void 0,this),q1("branch"),q1("changes"),q1("changesets"),q1("activity"),H.jsxDEV("p",{className:"side-group",children:"Vendors"},void 0,!1,void 0,this),H.jsxDEV("a",{href:`${q0}/${Q}/~/canvas`,className:"all-screens",onClick:i(["~","canvas"]),children:[H.jsxDEV("span",{className:"mark","aria-hidden":"true",children:"▦"},void 0,!1,void 0,this),H.jsxDEV("span",{children:"All screens"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("ul",{className:"side-vendors",children:x.map((Q1)=>H.jsxDEV("li",{children:H.jsxDEV("a",{href:`${q0}/${Q}/~/vendors/${Q1}`,"aria-current":g===Q1?"page":void 0,className:g===Q1?"on":void 0,onClick:i(["~","vendors",Q1]),children:[H.jsxDEV(A5,{vendor:Q1},void 0,!1,void 0,this),H.jsxDEV("span",{children:F0(Q1)},void 0,!1,void 0,this),H.jsxDEV("span",{className:"count",children:d(Q1)||""},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},Q1,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("div",{className:"side-foot",children:H.jsxDEV(MR,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("div",{className:"content",children:[z?H.jsxDEV("div",{className:"snapshot",role:"region","aria-label":"Snapshot",children:[H.jsxDEV("span",{children:["You are looking at ",H.jsxDEV("strong",{children:z.parent},void 0,!1,void 0,this)," as it was at ",H.jsxDEV(h0,{iso:z.at},void 0,!1,void 0,this)," · a read-only copy (read-only snapshot) · ",z.expiresAt?Date.parse(z.expiresAt)<=Date.now()?H.jsxDEV(H.Fragment,{children:["gone since ",H.jsxDEV(h0,{iso:z.expiresAt},void 0,!1,void 0,this)]},void 0,!0,void 0,this):H.jsxDEV(H.Fragment,{children:["goes away ",H.jsxDEV(h0,{iso:z.expiresAt},void 0,!1,void 0,this)]},void 0,!0,void 0,this):"kept until you go back"]},void 0,!0,void 0,this),H.jsxDEV("button",{type:"button",onClick:()=>void B(z),children:"Return to live"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,H.jsxDEV("div",{className:"content-head",children:[H.jsxDEV("h2",{id:"world",children:[g?H.jsxDEV("span",{className:"vendor-cell",children:[H.jsxDEV(A5,{vendor:g},void 0,!1,void 0,this),j]},void 0,!0,void 0,this):j,L==="read"?H.jsxDEV(H.Fragment,{children:[" ",H.jsxDEV("span",{className:"badge read-only",title:"This token reads the World; it changes nothing",children:"Read only"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),H.jsxDEV("div",{className:"head-actions",children:[H.jsxDEV(IV,{name:Q,token:U,clock:m,canWrite:C&&!z,onChanged:()=>a((Q1)=>Q1+1),refused:v},void 0,!1,void 0,this),!z&&C&&y&&$1.state!=="loading"?H.jsxDEV(fV,{name:Q,token:U,clock:m,refused:v},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("div",{role:"region","aria-labelledby":"world",className:"panel",children:[u==="overview"?H.jsxDEV(wV,{name:Q,token:U,map:J1,vendors:x,twins:_1,session:P,branches:y?$1:null,canWrite:C&&!z,tick:b,...z?{snapshotOf:z.parent}:{}},void 0,!1,void 0,this):null,u==="branch"?H.jsxDEV(OV,{name:Q,token:U,map:J1,vendors:x,tick:b},void 0,!1,void 0,this):null,u==="vendors"?H.jsxDEV(CV,{name:Q,token:U,twins:_1,session:P,retry:n,selected:g},void 0,!1,void 0,this):null,u==="activity"&&K==="trace"?H.jsxDEV(yV,{name:Q,token:U,id:X??""},void 0,!1,void 0,this):null,u==="activity"&&K!=="trace"?H.jsxDEV(DV,{name:Q,token:U,vendors:x},void 0,!1,void 0,this):null,u==="changes"?H.jsxDEV(mV,{name:Q,token:U},void 0,!1,void 0,this):null,u==="changesets"?H.jsxDEV(xV,{name:Q,token:U,signsAs:k,canWrite:C&&!z,rooted:J1.state==="ok"?J1.data.twins.filter((Q1)=>Q1.root).map((Q1)=>Q1.twin):[],...X?{open:X}:{},refused:v},void 0,!1,void 0,this):null,u==="branches"?H.jsxDEV(PV,{name:Q,token:U,canWrite:C,branches:y?$1:null,opens:O,onBranchesChanged:()=>a((Q1)=>Q1+1),refused:v},void 0,!1,void 0,this):null,u==="settings"?H.jsxDEV(pV,{name:Q,token:U,admin:W,canWrite:C,refused:v,onRemoved:T},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function DR({text:Q}){return H.jsxDEV("button",{type:"button",className:"agent-prompt-button",onClick:()=>{navigator.clipboard?.writeText(Q).then(()=>t2("Copied the prompt: paste it into your coding agent"),()=>t2("Could not copy the prompt","error"))},children:"Copy a prompt for your coding agent"},void 0,!1,void 0,this)}function TV({name:Q}){return H.jsxDEV("details",{className:"menu connect-side",children:[H.jsxDEV("summary",{className:"button connect-button",children:"Connect"},void 0,!1,void 0,this),o2()?H.jsxDEV("div",{className:"popover",children:[H.jsxDEV("p",{children:"Point your app's SDKs here, with a key made on the platform; its calls to these vendors land in this World:"},void 0,!1,void 0,this),H.jsxDEV("pre",{children:[w6,"/",Q,"/<vendor>"]},void 0,!0,void 0,this),H.jsxDEV("a",{className:"button",href:`${o2()}/${encodeURIComponent(Q.split("/")[0]??"")}`,children:"Make a key on the platform"},void 0,!1,void 0,this),H.jsxDEV("p",{className:"mode",children:["Or push a World from your machine: ",H.jsxDEV("code",{children:["volter remote add origin ",Q]},void 0,!0,void 0,this),", then ",H.jsxDEV("code",{children:"volter world push"},void 0,!1,void 0,this),"."]},void 0,!0,void 0,this),H.jsxDEV(DR,{text:mX({platform:o2(),world:Q})},void 0,!1,void 0,this)]},void 0,!0,void 0,this):H.jsxDEV("div",{className:"popover",children:[H.jsxDEV("p",{children:"Run your app in this World; its calls to these vendors land here:"},void 0,!1,void 0,this),H.jsxDEV("pre",{children:"volter world run -- npm start"},void 0,!1,void 0,this),H.jsxDEV("p",{className:"mode",children:["Or point an SDK at ",H.jsxDEV("code",{children:[w6,"/",Q,"/<vendor>"]},void 0,!0,void 0,this)," with the token in ",H.jsxDEV("code",{children:".volter/token"},void 0,!1,void 0,this),"."]},void 0,!0,void 0,this),H.jsxDEV(DR,{text:mX()},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function RV({name:Q,snapshot:U,branches:Z,opens:K}){let X=(B)=>B.split("/").pop()??B,W=U?.parent??Q,z=Z?.state==="ok"?Z.data.branches.filter((B)=>B.name!==Q):[];return H.jsxDEV("details",{className:"menu branch-picker",children:[H.jsxDEV("summary",{children:[H.jsxDEV("svg",{className:"branch-glyph",viewBox:"0 0 16 16",width:"14",height:"14","aria-hidden":"true",children:H.jsxDEV("path",{fill:"currentColor",d:"M5 3.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0Zm0 2.122a2.25 2.25 0 1 0-1.5 0v5.256a2.25 2.25 0 1 0 1.5 0V9.5h4.25A2.25 2.25 0 0 0 11.5 7.25v-.878a2.25 2.25 0 1 0-1.5 0v.878a.75.75 0 0 1-.75.75H5V5.372ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm6.5-9.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"},void 0,!1,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("span",{className:"branch-name",children:U?X(Q):Z?.state==="ok"&&Z.data.checkedOut||X(W)},void 0,!1,void 0,this),H.jsxDEV("span",{className:"badge",children:U?"snapshot":"live"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("div",{className:"popover",children:[H.jsxDEV("p",{className:"mode",children:"Branch"},void 0,!1,void 0,this),H.jsxDEV("ul",{className:"branch-list",children:[H.jsxDEV("li",{children:H.jsxDEV("a",{href:`${q0}/${W}`,"aria-current":!U?"page":void 0,onClick:(B)=>{B.preventDefault(),v0(W.split("/"))},children:[X(W)," ",H.jsxDEV("span",{className:"mode",children:"live"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),U?H.jsxDEV("li",{children:H.jsxDEV("a",{href:`${q0}/${Q}`,"aria-current":"page",onClick:(B)=>B.preventDefault(),children:[X(Q)," ",H.jsxDEV("span",{className:"mode",children:["as of ",H.jsxDEV(h0,{iso:U.at},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this):null,z.map((B)=>H.jsxDEV("li",{children:K(B.name)?H.jsxDEV("a",{href:`${q0}/${B.name}`,onClick:(O)=>{O.preventDefault(),cX(B.name,B.name.split("/"))},children:[X(B.name)," ",H.jsxDEV("span",{className:"mode",children:B.at?.instant?H.jsxDEV(H.Fragment,{children:["as of ",H.jsxDEV(h0,{iso:B.at.instant},void 0,!1,void 0,this)]},void 0,!0,void 0,this):"copy"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):H.jsxDEV("span",{className:"mode",title:"Its token was handed to whoever made it",children:X(B.name)},void 0,!1,void 0,this)},B.name,!1,void 0,this))]},void 0,!0,void 0,this),Z?.state==="ok"&&(Z.data.named?.length??0)>1?H.jsxDEV(H.Fragment,{children:[H.jsxDEV("p",{className:"mode",children:"This World's branches"},void 0,!1,void 0,this),H.jsxDEV("ul",{className:"branch-list",children:Z.data.named.map((B)=>H.jsxDEV("li",{children:H.jsxDEV("span",{"aria-current":B.name===Z.data.checkedOut?"true":void 0,children:[B.name," ",H.jsxDEV("span",{className:"mode",children:B.name===Z.data.checkedOut?"served here":H.jsxDEV("code",{children:["volter world checkout ",B.name]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},B.name,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,Z?.state==="ok"&&z.length===0&&!U&&(Z.data.named?.length??0)<=1?H.jsxDEV("p",{className:"mode",children:"No branches yet. “View an earlier moment…” opens one."},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function OV({name:Q,token:U,map:Z,vendors:K,tick:X}){let W=L5(U,`/-/${Q}/timeline?limit=500`,Math.floor(X/3)),z=Z.state==="ok"?Z.data.twins:[],B=(P)=>(C)=>{C.preventDefault(),v0([...Q.split("/"),...P])},O=Date.now(),T=24,R=3600000,L=W.state==="ok"?W.data.entries:[],M=K.map((P)=>{let C=Array(24).fill(0);for(let v of L){if(v.twin!==P)continue;let b=Date.parse(v.entry.occurredAt),E=23-Math.floor((O-b)/3600000);if(E>=0&&E<24)C[E]+=1}return{vendor:P,counts:C}}),I=Array(24).fill(0).map((P,C)=>M.reduce((v,b)=>v+b.counts[C],0)),f=Math.max(1,...I),D=720,V=160,k=30,h=["var(--volter-data-base)","#7c5cff","#e3572b","#1f9d6b","#d9a400","#2b7de3","#c2417e","#6b7280","#0ea5a4"];return H.jsxDEV(H.Fragment,{children:[H.jsxDEV("div",{className:"block",children:H.jsxDEV("table",{className:"dense services","aria-label":"Vendors on this branch",children:[H.jsxDEV("thead",{children:H.jsxDEV("tr",{children:[H.jsxDEV("th",{children:"Vendor"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"Details"},void 0,!1,void 0,this),H.jsxDEV("th",{},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("tbody",{children:K.map((P)=>{let C=z.find((b)=>b.twin===P),v=[...C?.resources??[]].filter((b)=>b.count>0).sort((b,E)=>E.count-b.count);return H.jsxDEV("tr",{children:[H.jsxDEV("td",{children:H.jsxDEV("span",{className:"vendor-cell",children:[H.jsxDEV(A5,{vendor:P},void 0,!1,void 0,this),H.jsxDEV("a",{href:`${q0}/${Q}/~/vendors/${P}`,onClick:B(["~","vendors",P]),children:F0(P)},void 0,!1,void 0,this)," ",H.jsxDEV("span",{className:C?.root?"badge rooted":"badge",children:C?.root?"connected":"stand-in"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("td",{className:"mode",children:v.length?v.slice(0,4).map((b)=>J9(b.count,b.type)).join(" · "):"nothing yet"},void 0,!1,void 0,this),H.jsxDEV("td",{className:"num",children:C?.mirror?H.jsxDEV("a",{href:`${q0}/${Q}/~/vendors/${P}`,onClick:B(["~","vendors",P]),children:"Screens"},void 0,!1,void 0,this):null},void 0,!1,void 0,this)]},P,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("div",{className:"block chart-block",children:[H.jsxDEV("div",{className:"block-head",children:[H.jsxDEV("h3",{children:"Activity, last 24 hours"},void 0,!1,void 0,this),H.jsxDEV("a",{href:`${q0}/${Q}/~/activity`,onClick:B(["~","activity"]),children:"All activity"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV(B5,{load:W,what:"the activity"},void 0,!1,void 0,this),W.state==="ok"?H.jsxDEV("div",{className:"pad",children:[H.jsxDEV("svg",{viewBox:"0 0 720 182",className:"chart",role:"img","aria-label":`Writes per hour over the last day: ${I.reduce((P,C)=>P+C,0)} in all`,children:[[0.5,1].map((P)=>H.jsxDEV("line",{x1:0,x2:720,y1:160-P*160,y2:160-P*160,className:"grid"},P,!1,void 0,this)),H.jsxDEV("line",{x1:0,x2:720,y1:160,y2:160,className:"axis"},void 0,!1,void 0,this),I.map((P,C)=>{let v=160;return H.jsxDEV("g",{children:M.map((b,E)=>{let p=b.counts[C]/f*152;if(p===0)return null;return v-=p,H.jsxDEV("rect",{x:C*30+2,y:v,width:26,height:p,fill:h[E%h.length],rx:2,children:H.jsxDEV("title",{children:`${F0(b.vendor)}: ${b.counts[C]} in the hour ${23-C===0?"now":`${23-C}h ago`}`},void 0,!1,void 0,this)},b.vendor,!1,void 0,this)})},C,!1,void 0,this)}),[0,6,12,18,23].map((P)=>H.jsxDEV("text",{x:P*30+15,y:176,className:"tick",children:23-P===0?"now":`-${23-P}h`},P,!1,void 0,this))]},void 0,!0,void 0,this),H.jsxDEV("ul",{className:"legend",children:M.filter((P)=>P.counts.some((C)=>C>0)).map((P)=>H.jsxDEV("li",{children:[H.jsxDEV("span",{className:"swatch",style:{background:h[K.indexOf(P.vendor)%h.length]}},void 0,!1,void 0,this),F0(P.vendor)," ",H.jsxDEV("span",{className:"mode",children:P.counts.reduce((C,v)=>C+v,0)},void 0,!1,void 0,this)]},P.vendor,!0,void 0,this))},void 0,!1,void 0,this),I.every((P)=>P===0)?H.jsxDEV("p",{className:"mode",children:"Nothing was written in the last day. Run your app in this World and its calls show up here."},void 0,!1,void 0,this):null]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var pX=0.2;function wV({name:Q,token:U,map:Z,vendors:K,twins:X,session:W,branches:z,canWrite:B,tick:O,snapshotOf:T}){let R=L5(U,`/-/${Q}/diff`,Math.floor(O/2)),L=L5(U,`/-/${Q}/timeline?limit=8`,O),M=Z.state==="ok"?Z.data.twins:[],I=L.state==="ok"?L.data.entries:[],f=X.state==="ok"?X.data.twins.filter((P)=>P.mirror).map((P)=>P.twin):[],D=(P)=>(C)=>{C.preventDefault(),v0([...Q.split("/"),...P])},V=(P)=>{let C=[...M.find((v)=>v.twin===P)?.resources??[]].filter((v)=>v.count>0).sort((v,b)=>b.count-v.count);return C.length?C.slice(0,2).map((v)=>J9(v.count,v.type)).join(" · "):"empty"},k=R.state==="ok"?R.data.changes.length:null,h=z?.state==="ok"?z.data.branches:[];return H.jsxDEV("div",{className:"dash",children:[H.jsxDEV("section",{className:"block dash-screens","aria-labelledby":"screens-head",children:[H.jsxDEV("div",{className:"block-head",children:[H.jsxDEV("h3",{id:"screens-head",children:["Screens ",H.jsxDEV("span",{className:"badge live",children:"live"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("span",{className:"mode",children:[K.length," vendor",K.length===1?"":"s",k!==null?H.jsxDEV(H.Fragment,{children:[" · ",H.jsxDEV("a",{href:`${q0}/${Q}/~/changes`,onClick:D(["~","changes"]),children:[k," change",k===1?"":"s"," since start"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),H.jsxDEV("a",{className:"button",href:`${q0}/${Q}/~/canvas`,onClick:D(["~","canvas"]),children:"Open all screens"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),W.state==="ok"?H.jsxDEV("ul",{className:"thumbs",children:K.map((P)=>H.jsxDEV("li",{children:H.jsxDEV("a",{href:`${q0}/${Q}/~/vendors/${P}`,onClick:D(["~","vendors",P]),"aria-label":`${F0(P)}'s screens`,children:[H.jsxDEV("span",{className:"thumb",children:[f.includes(P)?H.jsxDEV("iframe",{title:`${F0(P)} preview`,src:D8(Q,P),loading:"lazy",tabIndex:-1,style:{width:`${100/pX}%`,height:`${100/pX}%`,transform:`scale(${pX})`}},void 0,!1,void 0,this):H.jsxDEV("span",{className:"thumb-none",children:"No screens"},void 0,!1,void 0,this),H.jsxDEV("span",{className:M.find((C)=>C.twin===P)?.root?"badge rooted thumb-status":"badge thumb-status",children:M.find((C)=>C.twin===P)?.root?"connected":"stand-in"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("span",{className:"thumb-foot",children:[H.jsxDEV(A5,{vendor:P},void 0,!1,void 0,this),H.jsxDEV("b",{children:F0(P)},void 0,!1,void 0,this),H.jsxDEV("span",{className:"mode",children:V(P)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},P,!1,void 0,this))},void 0,!1,void 0,this):H.jsxDEV("p",{className:"mode pad",children:W.state==="error"?`The World did not open its screens: ${W.error}`:"Opening…"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("div",{className:"dash-side",children:z?H.jsxDEV("section",{className:"block","aria-labelledby":"branches-head",children:[H.jsxDEV("div",{className:"block-head",children:[H.jsxDEV("h3",{id:"branches-head",children:"Branches"},void 0,!1,void 0,this),H.jsxDEV("a",{href:`${q0}/${Q}/~/branches`,onClick:D(["~","branches"]),children:"All"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("ul",{className:"mini-feed",children:[H.jsxDEV("li",{children:[H.jsxDEV("svg",{className:"branch-glyph",viewBox:"0 0 16 16",width:"14",height:"14","aria-hidden":"true",children:H.jsxDEV("path",{fill:"currentColor",d:"M5 3.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0Zm0 2.122a2.25 2.25 0 1 0-1.5 0v5.256a2.25 2.25 0 1 0 1.5 0V9.5h4.25A2.25 2.25 0 0 0 11.5 7.25v-.878a2.25 2.25 0 1 0-1.5 0v.878a.75.75 0 0 1-.75.75H5V5.372ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm6.5-9.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"},void 0,!1,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("span",{className:"mini-what",children:T?H.jsxDEV(H.Fragment,{children:[H.jsxDEV("b",{children:Q.split("/")[1]},void 0,!1,void 0,this)," ",H.jsxDEV("span",{className:"badge",children:"snapshot"},void 0,!1,void 0,this)," ",H.jsxDEV("span",{className:"mode",children:["of ",T.split("/")[1]]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):H.jsxDEV(H.Fragment,{children:[H.jsxDEV("b",{children:Q.split("/")[1]},void 0,!1,void 0,this)," ",H.jsxDEV("span",{className:"badge",children:"live"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),h.slice(0,3).map((P)=>H.jsxDEV("li",{children:[H.jsxDEV("svg",{className:"branch-glyph",viewBox:"0 0 16 16",width:"14",height:"14","aria-hidden":"true",children:H.jsxDEV("path",{fill:"currentColor",d:"M5 3.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0Zm0 2.122a2.25 2.25 0 1 0-1.5 0v5.256a2.25 2.25 0 1 0 1.5 0V9.5h4.25A2.25 2.25 0 0 0 11.5 7.25v-.878a2.25 2.25 0 1 0-1.5 0v.878a.75.75 0 0 1-.75.75H5V5.372ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm6.5-9.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"},void 0,!1,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("span",{className:"mini-what",children:[P.name.split("/").pop()," ",H.jsxDEV("span",{className:"mode",children:P.at?.instant?`as of ${new Date(P.at.instant).toLocaleString()}`:"copy"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},P.name,!0,void 0,this))]},void 0,!0,void 0,this),B?H.jsxDEV("p",{className:"mode pad",children:"“View an earlier moment…” above opens a branch as the World was then."},void 0,!1,void 0,this):null]},void 0,!0,void 0,this):null},void 0,!1,void 0,this),H.jsxDEV("section",{className:"block dash-activity","aria-labelledby":"activity-head",children:[H.jsxDEV("div",{className:"block-head",children:[H.jsxDEV("h3",{id:"activity-head",children:"Recent activity"},void 0,!1,void 0,this),H.jsxDEV("a",{href:`${q0}/${Q}/~/activity`,onClick:D(["~","activity"]),children:"View all"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV(B5,{load:L,what:"the activity"},void 0,!1,void 0,this),L.state==="ok"&&I.length===0?H.jsxDEV("div",{className:"empty-block",children:[H.jsxDEV("strong",{children:"No activity yet"},void 0,!1,void 0,this),H.jsxDEV("span",{className:"mode",children:"Run your app in this World and its calls show up here."},void 0,!1,void 0,this)]},void 0,!0,void 0,this):H.jsxDEV("ul",{className:"mini-feed",children:I.map((P)=>{let C=n5(P.entry);return H.jsxDEV("li",{children:[H.jsxDEV(A5,{vendor:P.twin},void 0,!1,void 0,this),H.jsxDEV("span",{className:"mini-what",children:[H.jsxDEV("strong",{children:C.what},void 0,!1,void 0,this),C.label?H.jsxDEV("span",{className:"mode",children:[" ",C.label]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),H.jsxDEV("span",{className:"mode num",title:P.entry.occurredAt,children:dq(P.entry.occurredAt)},void 0,!1,void 0,this)]},E4(P),!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function IV({name:Q,token:U,clock:Z,canWrite:K,onChanged:X,refused:W}){let[z,B]=B1.useState(!1),[O,T]=B1.useState(""),[R,L]=B1.useState(""),[M,I]=B1.useState(null),[f,D]=B1.useState(!1),V=Z.state==="ok"?Z.data:null,k=async(v,b,E)=>{D(!0),I(null);try{let p=await X0(U,`/-/${Q}/${b}`,{method:b==="clock"?"PUT":"POST",body:JSON.stringify(E)});if(!p.ok){W(p),I({ok:!1,text:await z5(p)});return}let a=await p.json();I({ok:!0,text:`${v} — the World is at ${new Date(a.at).toLocaleString()}`}),B(!1),X()}catch(p){I({ok:!1,text:`the World did not answer: ${p instanceof Error?p.message:String(p)}`})}finally{D(!1)}},h=(v)=>{v.preventDefault();let b=new Date(O);if(Number.isNaN(b.getTime())){I({ok:!1,text:"Pick a date and time."});return}if(V&&b.getTime()<Date.parse(V.at)){I({ok:!1,text:`The World's clock only moves forward: pick a time after ${new Date(V.at).toLocaleString()}.`});return}k("Clock set","clock",{at:b.toISOString()})},P=(v,b)=>{k(`Advanced ${b}`,"clock/advance",{by:v})},C=[["1h","1 hour"],["1d","1 day"],["7d","1 week"],["30d","30 days"]];return H.jsxDEV("div",{className:`clock${V?.frozen?" frozen":""}`,role:"region","aria-label":"World clock",children:[H.jsxDEV("p",{className:"clock-now",children:Z.state==="loading"?H.jsxDEV("span",{className:"mode",children:"clock…"},void 0,!1,void 0,this):Z.state==="error"?H.jsxDEV("span",{className:"mode",children:["Clock: ",Z.error]},void 0,!0,void 0,this):V.frozen?H.jsxDEV(H.Fragment,{children:[H.jsxDEV("span",{className:"badge",children:"Simulation"},void 0,!1,void 0,this)," World time ",H.jsxDEV("strong",{children:H.jsxDEV(h0,{iso:V.at},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):H.jsxDEV(H.Fragment,{children:["World time ",H.jsxDEV("strong",{children:H.jsxDEV(h0,{iso:V.at},void 0,!1,void 0,this)},void 0,!1,void 0,this)," ",H.jsxDEV("span",{className:"mode",children:"· real time"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),K&&V?H.jsxDEV("details",{className:"clock-more",children:[H.jsxDEV("summary",{children:"Simulate time…"},void 0,!1,void 0,this),H.jsxDEV("div",{className:"popover",children:[H.jsxDEV("p",{className:"mode",children:"Move this World's clock forward to see what happens later: renewals, expiries, scheduled sends. Like a test clock, it only moves forward; to look back, use “View an earlier moment…”."},void 0,!1,void 0,this),H.jsxDEV("div",{className:"clock-controls",children:[H.jsxDEV("button",{type:"button","aria-expanded":z,onClick:()=>{B(!z),T(U9(SR(V.at))),I(null)},children:"Set time…"},void 0,!1,void 0,this),H.jsxDEV("div",{role:"group","aria-label":"Advance the clock",className:"advance",children:[H.jsxDEV("span",{className:"mode",children:"Advance"},void 0,!1,void 0,this),C.map(([v,b])=>H.jsxDEV("button",{type:"button","aria-label":`Advance ${b}`,disabled:f||!V.frozen,title:V.frozen?void 0:"Set the time first: advancing moves a set clock",onClick:()=>P(v,b),children:b},v,!1,void 0,this)),H.jsxDEV("form",{className:"inline",onSubmit:(v)=>{if(v.preventDefault(),!/^\d+[smhd]$/.test(R.trim())){I({ok:!1,text:"Advance by a number and a unit: 90m, 12h, 3d."});return}P(R.trim(),`by ${R.trim()}`)},children:[H.jsxDEV("label",{className:"sr",children:["Advance by ",H.jsxDEV("input",{name:"advanceBy",value:R,onChange:(v)=>L(v.target.value),placeholder:"90m, 12h, 3d",size:9,disabled:!V.frozen},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("button",{type:"submit",disabled:f||!V.frozen,children:"Advance"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),!V.frozen?H.jsxDEV("p",{className:"mode",children:"The World runs on real time. Set a time to start simulating; then advance it."},void 0,!1,void 0,this):null,z?H.jsxDEV("form",{className:"inline","aria-label":"Set the World time",onSubmit:h,noValidate:!0,children:[H.jsxDEV("label",{children:["World time ",H.jsxDEV("input",{name:"worldTime",type:"datetime-local",value:O,min:U9(SR(V.at)),onChange:(v)=>T(v.target.value),required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("span",{className:"mode",children:Intl.DateTimeFormat().resolvedOptions().timeZone},void 0,!1,void 0,this),H.jsxDEV("button",{type:"submit",disabled:f,children:"Set time"},void 0,!1,void 0,this),H.jsxDEV("button",{type:"button",onClick:()=>B(!1),children:"Cancel"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null,M?H.jsxDEV("p",{role:M.ok?"status":"alert",children:M.text},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}function fV({name:Q,token:U,clock:Z,refused:K}){let[X,W]=B1.useState(!1),[z,B]=B1.useState(""),[O,T]=B1.useState(null),[R,L]=B1.useState(!1),M=Z.state==="ok"?Z.data.at:new Date().toISOString(),I=B1.useRef(null);return B1.useEffect(()=>{if(!X)return;let D=(k)=>{if(k.key==="Escape"&&!document.querySelector("dialog[open]"))W(!1),I.current?.querySelector("button")?.focus()},V=(k)=>{if(!I.current?.contains(k.target))W(!1)};return document.addEventListener("keydown",D),document.addEventListener("click",V),()=>{document.removeEventListener("keydown",D),document.removeEventListener("click",V)}},[X]),H.jsxDEV("div",{className:"as-of",ref:I,children:[H.jsxDEV("button",{type:"button","aria-expanded":X,title:"Open a read-only copy of this World as it was at a moment you pick",onClick:()=>{W(!X),B(U9(M)),T(null)},children:"View an earlier moment…"},void 0,!1,void 0,this),X?H.jsxDEV("form",{className:"inline","aria-label":"View the World as of a past moment",onSubmit:async(D)=>{D.preventDefault(),T(null);let V=new Date(z);if(Number.isNaN(V.getTime())){T("Pick a date and time.");return}if(V.getTime()>Date.parse(M)){T(`That is after the World's present (${new Date(M).toLocaleString()}); a snapshot looks back.`);return}L(!0);try{let k=await X0(U,`/-/${Q}/branches`,{method:"POST",body:JSON.stringify({at:{instant:V.toISOString()},ttl:3600})});if(!k.ok){K(k),T(await z5(k));return}let h=await k.json();rX({name:h.name,parent:Q,token:h.token,readToken:h.readToken,at:V.toISOString(),expiresAt:h.expiresAt??null,parentOrigin:B0,made:!0});let P=CJ(h.origin)?.origin;if(P&&P!==B0){iX(P,h.readToken,h.name,`${q0}/${h.name}`);return}v0(h.name.split("/"))}catch(k){T(`the World did not answer: ${k instanceof Error?k.message:String(k)}`)}finally{L(!1)}},noValidate:!0,children:[H.jsxDEV("label",{children:["As of ",H.jsxDEV("input",{name:"asOf",type:"datetime-local",value:z,max:U9(M),onChange:(D)=>B(D.target.value),required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("button",{type:"submit",disabled:R,children:R?"Opening…":"Open snapshot"},void 0,!1,void 0,this),H.jsxDEV("span",{className:"mode",children:"Opens a read-only copy of this World as it was then; the copy goes away within the hour."},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,O?H.jsxDEV("p",{role:"alert",children:O},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}function PV({name:Q,token:U,canWrite:Z,branches:K,opens:X,onBranchesChanged:W,refused:z}){let B=L5(U,`/-/${Q}/map`),[O,T]=B1.useState(null),R=async(M)=>{if(!await o5({title:`Delete the branch ${M}?`,body:"Whoever holds its tokens loses it, and its history goes with it.",action:"Delete branch",danger:!0}))return;let I=await X0(U,`/-/${Q}/branches/${M}`,{method:"DELETE"}).catch((f)=>f);if(I instanceof Error){T(`delete ${M}: the World did not answer (${I.message})`);return}if(!I.ok){z(I),T(`delete ${M}: ${await z5(I)}`);return}PJ(M),T(`deleted ${M}`),W()},L=B.state==="ok"?B.data.twins.reduce((M,I)=>M+I.resources.reduce((f,D)=>f+D.count,0),0):0;if(K)return H.jsxDEV(NV,{name:Q,token:U,canWrite:Z,branches:K,opens:X,note:O,remove:R,onChanged:W,refused:z},void 0,!1,void 0,this);return H.jsxDEV(H.Fragment,{children:[H.jsxDEV("h3",{children:"Map"},void 0,!1,void 0,this),H.jsxDEV(B5,{load:B,what:"the World's map"},void 0,!1,void 0,this),B.state==="ok"?B.data.twins.length===0?H.jsxDEV("p",{children:"This World holds no twins."},void 0,!1,void 0,this):H.jsxDEV(H.Fragment,{children:[H.jsxDEV("p",{className:"mode",children:[B.data.twins.length," twin",B.data.twins.length===1?"":"s"," · ",L," resource",L===1?"":"s"]},void 0,!0,void 0,this),H.jsxDEV("ul",{className:"map","aria-label":"Twins in this World",children:B.data.twins.map((M)=>{let I=[...M.resources].sort((f,D)=>D.count-f.count);return H.jsxDEV("li",{className:"card","aria-labelledby":`map-${M.twin}`,children:[H.jsxDEV("div",{className:"card-head",children:[H.jsxDEV("h4",{id:`map-${M.twin}`,className:"vendor",children:M.twin},void 0,!1,void 0,this),H.jsxDEV("span",{className:M.root?"badge rooted":"badge",children:M.root?"rooted":"simulated"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("p",{className:"mode",children:[M.root?H.jsxDEV(H.Fragment,{children:["rooted at ",H.jsxDEV("code",{children:M.root.url},void 0,!1,void 0,this)]},void 0,!0,void 0,this):"simulated — no vendor behind it"," · position ",M.position]},void 0,!0,void 0,this),I.length===0?H.jsxDEV("p",{className:"mode",children:"Holds nothing yet."},void 0,!1,void 0,this):H.jsxDEV("ul",{className:"resources",children:[I.slice(0,6).map((f)=>H.jsxDEV("li",{children:[H.jsxDEV("span",{children:f.type},void 0,!1,void 0,this)," ",H.jsxDEV("strong",{children:f.count},void 0,!1,void 0,this)]},f.type,!0,void 0,this)),I.length>6?H.jsxDEV("li",{className:"mode",children:["+",I.length-6," more types"]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),H.jsxDEV("p",{className:"card-actions",children:[M.mirror?H.jsxDEV("a",{className:"button",href:D8(Q,M.twin),target:"_blank",rel:"noopener noreferrer",children:["Open ",M.twin]},void 0,!0,void 0,this):H.jsxDEV("span",{className:"mode",children:"no mirror"},void 0,!1,void 0,this),H.jsxDEV("a",{href:`${q0}/${Q}/${M.twin}`,"aria-label":`Log and tree of ${M.twin}`,onClick:(f)=>{f.preventDefault(),v0([...Q.split("/"),M.twin])},children:"Log & tree"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},M.twin,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)}function NV({name:Q,token:U,canWrite:Z,branches:K,opens:X,note:W,remove:z,onChanged:B,refused:O}){let T=(g)=>g.split("/").pop()??g,R=K.state==="ok"?K.data.branches:[],[L,M]=B1.useState(!1),[I,f]=B1.useState(!1),[D,V]=B1.useState(null),[k,h]=B1.useState(""),[P,C]=B1.useState("now"),[v,b]=B1.useState(""),[E,p]=B1.useState("24"),[a,m]=B1.useState(null),[_1,$1]=B1.useState(null),J1=async(g)=>{m(g),$1(null);let n=await X0(U,`/-/${Q}/branches/${encodeURIComponent(g)}/serve`,{method:"POST"}).catch(()=>null);if(n?.ok){location.reload();return}m(null),$1(n?(await n.json().catch(()=>null))?.error??`${n.status}`:`${B0} did not answer`)},y=async(g,n)=>{let j=await X0(U,`/-/${Q}/branches`,{method:"POST",body:JSON.stringify(g)}).catch(()=>null);if(!j)return`${B0} did not answer`;if(!j.ok)return O(j),await z5(j);let i=await j.json();return rX({name:i.name,parent:Q,token:i.token??"",readToken:i.readToken,at:n,expiresAt:i.expiresAt??null,parentOrigin:B0,...i.origin?{origin:i.origin}:{}}),i},u=async(g)=>{g.preventDefault(),V(null);let n=P==="at"?new Date(v):null;if(n&&Number.isNaN(n.getTime())){V("Pick a date and time, or make it as of now.");return}if(n&&n.getTime()>Date.now()){V("A branch is made as of now or a moment before it.");return}let j=Math.round(Number(E)*3600);f(!0);let i=await y({ttl:j,...n?{at:{instant:n.toISOString()}}:{live:!0},...k.trim()?{label:k.trim()}:{}},(n??new Date).toISOString());if(f(!1),typeof i==="string"){V(i);return}M(!1),h(""),t2(`Made ${T(i.name)}`),B()},x=async(g)=>{if(!await o5({title:`Reset ${T(g.name)} to ${T(Q)}?`,body:`A fresh copy of ${T(Q)} as it is now replaces it, with the same label and the time it had left; what was written to it goes. The copy has a new address and new keys: an app, a CI job or a pull request's preview that holds this branch's must be given the new one.`,action:"Reset branch",danger:!0}))return;let n=g.expiresAt?Math.max(3600,Math.round((Date.parse(g.expiresAt)-Date.now())/1000)):86400,j=T(g.name).startsWith(`${T(Q)}-`)?T(g.name).slice(T(Q).length+1):"",i=/^([a-z0-9][a-z0-9-]*)-[0-9a-f]{4}$/.exec(j)?.[1],q1=await y({ttl:n,live:!0,...i&&!i.startsWith("at-")?{label:i}:{}},new Date().toISOString());if(typeof q1==="string"){t2(`Reset ${T(g.name)}: ${q1}`,"error");return}let Q1=await X0(U,`/-/${Q}/branches/${g.name}`,{method:"DELETE"}).catch(()=>null);if(Q1?.ok)PJ(g.name);t2(Q1?.ok?`Reset: ${T(q1.name)} is ${T(Q)} as it is now`:`Made ${T(q1.name)}; ${T(g.name)} was not removed`),B()},d=(g)=>[...X(g.name)?[{label:"Compare with parent",onSelect:()=>cX(g.name,[...g.name.split("/"),"~","changes"])}]:[],...Z?[{label:"Reset to parent…",onSelect:()=>void x(g)},{label:"Delete…",danger:!0,onSelect:()=>void z(g.name)}]:[]];return H.jsxDEV("div",{"aria-labelledby":"branches",children:[H.jsxDEV("div",{className:"branches-head",children:[H.jsxDEV("p",{className:"lede",children:["Branch this World to look at it as it was, or to change it without touching ",H.jsxDEV("b",{children:T(Q)},void 0,!1,void 0,this),". A branch made here opens read-only in this tab; its parent removes it."]},void 0,!0,void 0,this),Z?H.jsxDEV("button",{type:"button",className:"primary",onClick:()=>{V(null),b(U9(new Date().toISOString())),M(!0)},children:"New branch"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),W?H.jsxDEV("p",{role:"status",children:W},void 0,!1,void 0,this):null,H.jsxDEV(B5,{load:K,what:"the branches"},void 0,!1,void 0,this),K.state==="ok"?H.jsxDEV("div",{className:"block",children:[H.jsxDEV("table",{className:"dense","aria-label":"Branches",children:[H.jsxDEV("thead",{children:H.jsxDEV("tr",{children:[H.jsxDEV("th",{id:"branches",children:"Branch"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"Parent"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"As of"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"Made"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"Goes away"},void 0,!1,void 0,this),H.jsxDEV("th",{},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("tbody",{children:[H.jsxDEV("tr",{children:[H.jsxDEV("td",{children:[H.jsxDEV("b",{children:K.data.checkedOut??T(Q)},void 0,!1,void 0,this)," ",H.jsxDEV("span",{className:"badge",children:K.data.checkedOut?"served here":"default"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("td",{className:"mode",children:"—"},void 0,!1,void 0,this),H.jsxDEV("td",{className:"mode",children:"live"},void 0,!1,void 0,this),H.jsxDEV("td",{className:"mode",children:"—"},void 0,!1,void 0,this),H.jsxDEV("td",{className:"mode",children:"kept"},void 0,!1,void 0,this),H.jsxDEV("td",{},void 0,!1,void 0,this)]},void 0,!0,void 0,this),R.map((g)=>{let n=d(g);return H.jsxDEV("tr",{children:[H.jsxDEV("td",{children:H.jsxDEV("b",{children:T(g.name)},void 0,!1,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("td",{children:T(Q)},void 0,!1,void 0,this),H.jsxDEV("td",{children:g.at?.instant?H.jsxDEV(h0,{iso:g.at.instant},void 0,!1,void 0,this):"when it was made"},void 0,!1,void 0,this),H.jsxDEV("td",{children:H.jsxDEV(h0,{iso:g.createdAt},void 0,!1,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("td",{children:g.expiresAt?H.jsxDEV(h0,{iso:g.expiresAt},void 0,!1,void 0,this):"kept"},void 0,!1,void 0,this),H.jsxDEV("td",{className:"num row-actions",children:[X(g.name)?H.jsxDEV("button",{type:"button","aria-label":`Open ${g.name}`,onClick:()=>cX(g.name,g.name.split("/")),children:"Open"},void 0,!1,void 0,this):H.jsxDEV("span",{className:"mode",title:"Its token was handed to whoever made it",children:"opened by whoever made it"},void 0,!1,void 0,this),n.length?H.jsxDEV(xX,{label:`More for ${T(g.name)}`,items:n},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},g.name,!0,void 0,this)})]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),R.length===0?H.jsxDEV("p",{className:"mode pad",children:"No snapshots yet."},void 0,!1,void 0,this):null]},void 0,!0,void 0,this):null,K.state==="ok"&&(K.data.named?.length??0)>0?H.jsxDEV(H.Fragment,{children:[H.jsxDEV("p",{className:"lede",children:["This World's own branches (",H.jsxDEV("code",{children:"volter world branch"},void 0,!1,void 0,this),"). One runs at a time; ",K.data.canServe?H.jsxDEV(H.Fragment,{children:"“Serve here” stops this one's twins and serves that one in its place."},void 0,!1,void 0,this):H.jsxDEV(H.Fragment,{children:["this host serves one of them; another is served by ",H.jsxDEV("code",{children:"volter world checkout <branch>"},void 0,!1,void 0,this)," where the World lives, then serving again."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),_1?H.jsxDEV("p",{role:"alert",children:_1},void 0,!1,void 0,this):null,H.jsxDEV("div",{className:"block",children:H.jsxDEV("table",{className:"dense","aria-label":"World branches",children:[H.jsxDEV("thead",{children:H.jsxDEV("tr",{children:[H.jsxDEV("th",{children:"Branch"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"State"},void 0,!1,void 0,this),H.jsxDEV("th",{},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("tbody",{children:K.data.named.map((g)=>H.jsxDEV("tr",{children:[H.jsxDEV("td",{children:[H.jsxDEV("b",{children:g.name},void 0,!1,void 0,this),g.name===K.data.checkedOut?H.jsxDEV(H.Fragment,{children:[" ",H.jsxDEV("span",{className:"badge",children:"served here"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),H.jsxDEV("td",{className:"mode",children:g.running?"running":"stopped"},void 0,!1,void 0,this),H.jsxDEV("td",{className:"num row-actions",children:Z&&K.data.canServe&&g.name!==K.data.checkedOut?H.jsxDEV("button",{type:"button",disabled:a!==null,onClick:()=>void J1(g.name),children:a===g.name?"Switching…":"Serve here"},void 0,!1,void 0,this):null},void 0,!1,void 0,this)]},g.name,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,H.jsxDEV(S8,{open:L,onClose:()=>{if(!I)M(!1)},title:`New branch of ${T(Q)}`,footer:H.jsxDEV(H.Fragment,{children:[H.jsxDEV("button",{type:"button",onClick:()=>M(!1),disabled:I,children:"Cancel"},void 0,!1,void 0,this),H.jsxDEV("button",{type:"submit",form:"new-branch",className:"primary",disabled:I,children:I?"Making…":"Make branch"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:H.jsxDEV("form",{id:"new-branch",onSubmit:(g)=>void u(g),className:"stack",children:[H.jsxDEV("label",{children:[H.jsxDEV("span",{children:["Name ",H.jsxDEV("span",{className:"mode",children:"(optional)"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("input",{name:"branchLabel",value:k,onChange:(g)=>h(g.target.value.toLowerCase()),placeholder:"checkout-flow",pattern:"[a-z0-9][a-z0-9-]{0,23}",maxLength:24},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("fieldset",{className:"choice",children:[H.jsxDEV("legend",{children:"As of"},void 0,!1,void 0,this),H.jsxDEV("label",{className:"check",children:[H.jsxDEV("input",{type:"radio",name:"branchWhen",checked:P==="now",onChange:()=>C("now")},void 0,!1,void 0,this)," ",H.jsxDEV("span",{children:"Now: the World as it is, its clock running on"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("label",{className:"check",children:[H.jsxDEV("input",{type:"radio",name:"branchWhen",checked:P==="at",onChange:()=>C("at")},void 0,!1,void 0,this)," ",H.jsxDEV("span",{children:"A moment before now: the World as it was then, its clock stopped there"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),P==="at"?H.jsxDEV("input",{type:"datetime-local","aria-label":"As of",value:v,max:U9(new Date().toISOString()),onChange:(g)=>b(g.target.value)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),H.jsxDEV("label",{children:[H.jsxDEV("span",{children:"Goes away after"},void 0,!1,void 0,this),H.jsxDEV("select",{name:"branchLife",value:E,onChange:(g)=>p(g.target.value),children:[H.jsxDEV("option",{value:"1",children:"1 hour"},void 0,!1,void 0,this),H.jsxDEV("option",{value:"24",children:"1 day"},void 0,!1,void 0,this),H.jsxDEV("option",{value:"72",children:"3 days"},void 0,!1,void 0,this),H.jsxDEV("option",{value:"168",children:"7 days"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),D?H.jsxDEV("p",{role:"alert",children:D},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function CV({name:Q,token:U,twins:Z,session:K,retry:X,selected:W}){let z=L5(U,`/-/${Q}/map`),B=Z.state==="ok"?Z.data.twins:[],O=(L)=>{let M=z.state==="ok"?z.data.twins.find((f)=>f.twin===L):void 0;if(!M)return"";let I=[...M.resources].filter((f)=>f.count>0).sort((f,D)=>D.count-f.count);return I.length===0?"nothing yet":I.slice(0,3).map((f)=>J9(f.count,f.type)).join(" · ")+(I.length>3?" · …":"")},T=(L)=>z.state==="ok"?z.data.twins.find((M)=>M.twin===L)?.root?.url??null:null,R=B.find((L)=>L.twin===W);if(!R)return Z.state==="ok"?H.jsxDEV("p",{className:"mode",children:["This World has no vendor named ",W,". ",H.jsxDEV("a",{href:`${q0}/${Q}/~/canvas`,onClick:(L)=>{L.preventDefault(),v0([...Q.split("/"),"~","canvas"])},children:"All screens"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):H.jsxDEV(B5,{load:Z,what:"the vendors"},void 0,!1,void 0,this);return H.jsxDEV(H.Fragment,{children:[H.jsxDEV(B5,{load:Z,what:"the vendors"},void 0,!1,void 0,this),Z.state==="ok"&&B.length===0?H.jsxDEV("p",{children:"No vendors in this World yet."},void 0,!1,void 0,this):null,R?H.jsxDEV("div",{className:"vendors",children:H.jsxDEV("div",{className:"stage",children:[H.jsxDEV("div",{className:"stage-bar",children:[H.jsxDEV(A5,{vendor:R.twin},void 0,!1,void 0,this),H.jsxDEV("span",{className:"mode",children:[O(R.twin)||"empty",T(R.twin)?` · connected to ${T(R.twin)}`:" · stand-in"]},void 0,!0,void 0,this),H.jsxDEV("span",{className:"stage-actions",children:[B.filter((L)=>L.mirror).length>1?H.jsxDEV("a",{className:"button",href:`${q0}/${Q}/~/vendors`,onClick:(L)=>{L.preventDefault(),v0([...Q.split("/"),"~","vendors"])},children:"All vendors"},void 0,!1,void 0,this):null,R.mirror?H.jsxDEV("a",{className:"button",href:D8(Q,R.twin),target:"_blank",rel:"noopener noreferrer","aria-label":`Open ${F0(R.twin)} in a new tab`,children:"Open in new tab ↗"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),K.state==="ok"&&K.scope==="read"?H.jsxDEV("p",{className:"mode stage-note",children:"You are looking read only: the screens browse, and refuse changes."},void 0,!1,void 0,this):null,K.state==="pending"?H.jsxDEV("p",{className:"mode",role:"status",children:"Opening…"},void 0,!1,void 0,this):null,K.state==="error"?H.jsxDEV("p",{role:"alert",children:["The World did not open its screens: ",K.error," ",H.jsxDEV("button",{type:"button",onClick:X,children:"Try again"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,K.state==="ok"?R.mirror?H.jsxDEV("iframe",{title:`${R.twin} mirror`,src:D8(Q,R.twin)},R.twin,!1,void 0,this):H.jsxDEV("p",{className:"empty",children:[F0(R.twin)," has no screens here yet. What your app did there is in ",H.jsxDEV("a",{href:`${q0}/${Q}/~/activity`,onClick:(L)=>{L.preventDefault(),v0([...Q.split("/"),"~","activity"])},children:"Activity"},void 0,!1,void 0,this),"."]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}function SV(Q){let U=[];for(let Z of Q){let K=U[U.length-1];if(K&&(K[0].operation??K[0].op)===(Z.operation??Z.op))K.push(Z);else U.push([Z])}return U}function jV(Q){let U=[];for(let Z of Q){let K=U[U.length-1],X=Array.isArray(K)?K[0]:K;if(X&&X.twin===Z.twin&&(X.entry.operation??X.entry.op)===(Z.entry.operation??Z.entry.op))if(Array.isArray(K))K.push(Z);else U[U.length-1]=[X,Z];else U.push(Z)}return U.flatMap((Z)=>Array.isArray(Z)&&Z.length<3?Z:[Z])}var VV=50,E4=(Q)=>`${Q.twin}:${Q.position}`,dR=(Q,U)=>Date.parse(U.entry.occurredAt)-Date.parse(Q.entry.occurredAt)||Q.twin.localeCompare(U.twin)||U.position-Q.position;function kV(Q){let U=[];for(let Z of Q){let K=new Date(Z.entry.occurredAt),X=K.toDateString(),W=U[U.length-1];if(!W||W.day!==X)W={day:X,label:K.toLocaleDateString(void 0,{weekday:"short",year:"numeric",month:"short",day:"numeric"}),instants:[]},U.push(W);let z=W.instants[W.instants.length-1];if(z&&Date.parse(z.at)===K.getTime())z.items.push(Z);else W.instants.push({at:Z.entry.occurredAt,items:[Z]})}return U}function yR({name:Q,p:U}){let Z=U.entry,K=gR(Z.traceparent),X=n5(Z),W=LV(Z);return H.jsxDEV("li",{className:"entry",title:`${Z.operation??Z.op} ${Z.subject.type}:${Z.subject.id} · ${mR(Z)} · ${nq(Z)}`,children:[H.jsxDEV("span",{className:"twin-chip",children:[H.jsxDEV(A5,{vendor:U.twin},void 0,!1,void 0,this),F0(U.twin)]},void 0,!0,void 0,this),H.jsxDEV("span",{className:"op",children:X.what},void 0,!1,void 0,this),X.label?H.jsxDEV("span",{className:"label",children:["“",X.label,"”"]},void 0,!0,void 0,this):H.jsxDEV("code",{className:"subject",children:aq(Z)},void 0,!1,void 0,this),H.jsxDEV("span",{className:"actor mode",children:oq(Z,U.twin)},void 0,!1,void 0,this),W?H.jsxDEV("span",{className:"standing",children:W},void 0,!1,void 0,this):null,K?H.jsxDEV("a",{className:"trace-link",href:`${q0}/${Q}/~/trace/${K.trace}`,"aria-label":`View trace ${K.trace.slice(0,8)}`,onClick:(z)=>{z.preventDefault(),v0([...Q.split("/"),"~","trace",K.trace])},children:"trace"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}function DV({name:Q,token:U,vendors:Z}){let[K,X]=B1.useState(null),[W,z]=B1.useState(null),[B,O]=B1.useState(null),[T,R]=B1.useState(null),[L,M]=B1.useState(!1),[I,f]=B1.useState(null),[D,V]=B1.useState({items:[],gap:null}),k=B1.useCallback((E)=>`/-/${Q}/timeline?limit=${VV}${K?`&twin=${encodeURIComponent(K)}`:""}${E?`&before=${encodeURIComponent(E)}`:""}`,[Q,K]),h=B1.useRef(null);h.current=W,B1.useEffect(()=>{let E=!0;z(null),R(null),V({items:[],gap:null}),(async()=>{let a=await X0(U,k());if(!E)return;if(!a.ok){R(await z5(a));return}let m=await a.json();if(!E)return;z(m.entries),O(m.next)})().catch((a)=>{if(E)R(`the World did not answer: ${a instanceof Error?a.message:String(a)}`)});let p=setInterval(()=>{let a=h.current;if(a===null||document.hidden)return;X0(U,k()).then(async(m)=>{if(!m.ok||!E)return;let _1=await m.json();if(!E)return;if(a.length===0){if(_1.entries.length)z(_1.entries),O(_1.next);return}let $1=new Set((h.current??a).map(E4)),J1=_1.entries.filter((y)=>!$1.has(E4(y)));V({items:J1,gap:J1.length===_1.entries.length&&_1.next?_1:null})}).catch(()=>null)},3000);return()=>{E=!1,clearInterval(p)}},[U,k]);let P=()=>{if(D.gap)z(D.gap.entries),O(D.gap.next);else z((E)=>[...D.items,...E??[]].sort(dR));V({items:[],gap:null})},C=async()=>{if(!B)return;M(!0),f(null);try{let E=await X0(U,k(B));if(!E.ok){f(await z5(E));return}let p=await E.json();z((a)=>{let m=new Set((a??[]).map(E4));return[...a??[],...p.entries.filter((_1)=>!m.has(E4(_1)))]}),O(p.next)}catch(E){f(`the World did not answer: ${E instanceof Error?E.message:String(E)}`)}finally{M(!1)}},v=B1.useMemo(()=>kV(W??[]),[W]),b=D.items.length;return H.jsxDEV(H.Fragment,{children:[H.jsxDEV("div",{role:"group","aria-label":"Filter by twin",className:"chips",children:[H.jsxDEV("button",{type:"button","aria-pressed":K===null,onClick:()=>X(null),children:"All vendors"},void 0,!1,void 0,this),Z.map((E)=>H.jsxDEV("button",{type:"button","aria-pressed":K===E,"aria-label":E,onClick:()=>X(K===E?null:E),children:F0(E)},E,!1,void 0,this))]},void 0,!0,void 0,this),H.jsxDEV("div",{"aria-live":"polite",className:"pill-slot",children:b>0?H.jsxDEV("button",{type:"button",className:"pill",onClick:P,children:[D.gap?`${b}+`:b," new change",b===1?"":"s"," — show"]},void 0,!0,void 0,this):null},void 0,!1,void 0,this),T?H.jsxDEV("p",{role:"alert",children:["Could not read the timeline: ",T]},void 0,!0,void 0,this):W===null?H.jsxDEV("p",{className:"mode",role:"status",children:"Loading the timeline…"},void 0,!1,void 0,this):W.length===0?K?H.jsxDEV("p",{children:["Nothing has happened in ",K," yet."]},void 0,!0,void 0,this):H.jsxDEV("div",{className:"empty",children:[H.jsxDEV("p",{children:H.jsxDEV("strong",{children:"Nothing has happened in this World yet."},void 0,!1,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("p",{className:"mode",children:["An entry arrives each time something changes a twin: an app (or a seed script) calling a twin's API at ",H.jsxDEV("code",{children:[w6,"/",Q,"/<twin>"]},void 0,!0,void 0,this),", a mirror's form, a changeset landing. They show here within a few seconds."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):H.jsxDEV("div",{className:"feed","aria-label":"Timeline",children:[v.map((E)=>H.jsxDEV("div",{role:"group","aria-label":E.label,className:"day",children:[H.jsxDEV("h3",{className:"day-head",children:E.label},void 0,!1,void 0,this),H.jsxDEV("ol",{className:"instants",children:E.instants.map((p)=>H.jsxDEV("li",{className:"instant",children:[H.jsxDEV("div",{className:"instant-time",title:p.items.length>1?"These happened at the same moment of the World's clock: their order across vendors is not known.":void 0,children:H.jsxDEV(h0,{iso:p.at,time:!0},void 0,!1,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("ul",{className:"entries",children:jV(p.items).map((a)=>Array.isArray(a)?H.jsxDEV("li",{className:"entry run",children:H.jsxDEV("details",{children:[H.jsxDEV("summary",{children:[H.jsxDEV("span",{className:"twin-chip",children:[H.jsxDEV(A5,{vendor:a[0].twin},void 0,!1,void 0,this),F0(a[0].twin)]},void 0,!0,void 0,this)," ",H.jsxDEV("span",{className:"op",children:[J9(a.length,a[0].entry.subject.type)," ",n5(a[0].entry).what.split(" ").slice(-1)[0]]},void 0,!0,void 0,this)," ",H.jsxDEV("span",{className:"actor mode",children:oq(a[0].entry,a[0].twin)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("ul",{className:"entries",children:a.map((m)=>H.jsxDEV(yR,{name:Q,p:m},E4(m),!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},E4(a[0]),!1,void 0,this):H.jsxDEV(yR,{name:Q,p:a},E4(a),!1,void 0,this))},void 0,!1,void 0,this)]},`${p.at}:${E4(p.items[0])}`,!0,void 0,this))},void 0,!1,void 0,this)]},E.day,!0,void 0,this)),B?H.jsxDEV("button",{type:"button",onClick:()=>void C(),disabled:L,"aria-busy":L,children:"Load older"},void 0,!1,void 0,this):H.jsxDEV("p",{className:"mode",children:["The beginning of this World",K?`'s ${K}`:"","."]},void 0,!0,void 0,this),I?H.jsxDEV("p",{role:"alert",children:["Could not load older changes: ",I]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function yV({name:Q,token:U,id:Z}){let K=/^[0-9a-f]{32}$/.test(Z),X=L5(U,K?`/-/${Q}/timeline?trace=${Z}&limit=500`:null),W=X.state==="ok"?[...X.data.entries].sort((T,R)=>-dR(T,R)):[],z=[...new Set(W.map((T)=>T.twin))],B=W[0]?Date.parse(W[0].entry.occurredAt):0,O=H.jsxDEV("a",{href:`${q0}/${Q}/~/timeline`,onClick:(T)=>{T.preventDefault(),v0([...Q.split("/"),"~","timeline"])},children:"← Timeline"},void 0,!1,void 0,this);return H.jsxDEV(H.Fragment,{children:[H.jsxDEV("p",{children:O},void 0,!1,void 0,this),H.jsxDEV("h3",{children:["Trace ",H.jsxDEV("code",{children:Z},void 0,!1,void 0,this)]},void 0,!0,void 0,this),!K?H.jsxDEV("p",{role:"alert",children:[Z?`${Z} is not a trace id`:"No trace named",": a W3C trace id is 32 hex characters."]},void 0,!0,void 0,this):H.jsxDEV(B5,{load:X,what:"the trace"},void 0,!1,void 0,this),X.state==="ok"&&W.length===0?H.jsxDEV("div",{className:"empty",children:[H.jsxDEV("p",{children:H.jsxDEV("strong",{children:"Nothing in this World carries this trace."},void 0,!1,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("p",{className:"mode",children:["Causes are followed through the W3C ",H.jsxDEV("code",{children:"traceparent"},void 0,!1,void 0,this)," header: an app instrumented with OpenTelemetry sends it with each call, and every entry that call writes keeps it — so one click in the app can be read across Stripe, Slack and the rest. Without it the World knows the order of what happened, not what caused what."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null,W.length>0?H.jsxDEV(H.Fragment,{children:[H.jsxDEV("p",{className:"mode",children:[W.length," step",W.length===1?"":"s"," across ",z.length," twin",z.length===1?"":"s",X.state==="ok"&&X.data.next?" · the first 500 shown":""]},void 0,!0,void 0,this),H.jsxDEV("div",{role:"table","aria-label":"Trace waterfall",className:"waterfall",style:{gridTemplateColumns:`minmax(130px, auto) repeat(${z.length}, minmax(140px, 1fr))`},children:[H.jsxDEV("div",{role:"row",className:"wf-row wf-head",children:[H.jsxDEV("span",{role:"columnheader",children:"time"},void 0,!1,void 0,this),z.map((T)=>H.jsxDEV("span",{role:"columnheader",children:T},T,!1,void 0,this))]},void 0,!0,void 0,this),W.map((T)=>{let R=Date.parse(T.entry.occurredAt)-B,L=gR(T.entry.traceparent)?.span;return H.jsxDEV("div",{role:"row",className:"wf-row",children:[H.jsxDEV("span",{role:"cell",className:"wf-time",children:[H.jsxDEV(h0,{iso:T.entry.occurredAt,time:!0},void 0,!1,void 0,this)," ",H.jsxDEV("span",{className:"mode",children:["+",R," ms"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),z.map((M)=>H.jsxDEV("span",{role:"cell",className:M===T.twin?"wf-cell on":"wf-cell",children:M===T.twin?H.jsxDEV("details",{children:[H.jsxDEV("summary",{children:[T.entry.operation??T.entry.op," ",H.jsxDEV("code",{children:[T.entry.subject.type,":",T.entry.subject.id]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("p",{className:"mode",children:[mR(T.entry)," · ",nq(T.entry)," · position ",T.position,L?H.jsxDEV(H.Fragment,{children:[" · span ",H.jsxDEV("code",{children:L},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),H.jsxDEV(iR,{fields:T.entry.fields},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null},M,!1,void 0,this))]},E4(T),!0,void 0,this)})]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)}function iR({fields:Q}){let U=Object.entries(Q??{});if(U.length===0)return H.jsxDEV("p",{className:"mode",children:"No fields."},void 0,!1,void 0,this);return H.jsxDEV("dl",{className:"fields",children:U.map(([Z,K])=>H.jsxDEV(B1.default.Fragment,{children:[H.jsxDEV("dt",{children:Z},void 0,!1,void 0,this),H.jsxDEV("dd",{children:H.jsxDEV("code",{children:typeof K==="string"?K:JSON.stringify(K)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},Z,!0,void 0,this))},void 0,!1,void 0,this)}var sq=1280,tq=820,vR=160;function vV({data:Q}){let{world:U,vendor:Z,active:K,open:X}=Q;return H.jsxDEV(H.Fragment,{children:[H.jsxDEV(WR,{isVisible:!0,position:C1.Top,align:"start",className:"frame-label",children:[H.jsxDEV(A5,{vendor:Z},void 0,!1,void 0,this),H.jsxDEV("span",{children:F0(Z)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("div",{className:K?"frame on":"frame",style:{width:sq,height:tq},children:[H.jsxDEV("div",{className:"frame-bar",title:"Drag to move",children:[H.jsxDEV(A5,{vendor:Z},void 0,!1,void 0,this),H.jsxDEV("strong",{children:F0(Z)},void 0,!1,void 0,this),H.jsxDEV("span",{className:"frame-url",children:D8(U,Z).replace(/^https?:\/\//,"")},void 0,!1,void 0,this),H.jsxDEV("a",{className:"nodrag",href:`${q0}/${U}/~/vendors/${Z}`,onClick:(W)=>{W.preventDefault(),X(Z)},children:"Open"},void 0,!1,void 0,this),H.jsxDEV("a",{className:"nodrag",href:D8(U,Z),target:"_blank",rel:"noopener noreferrer","aria-label":`Open ${F0(Z)} in a new tab`,children:"↗"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("div",{className:K?"frame-body nodrag nopan nowheel":"frame-body",children:H.jsxDEV("iframe",{title:`${Z} mirror`,src:D8(U,Z),loading:"lazy",style:{pointerEvents:K?"auto":"none"}},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var EV={screen:vV};function bV(Q){return H.jsxDEV(kX,{children:H.jsxDEV(uV,{...Q},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function uV({name:Q,twins:U,session:Z,retry:K,snapshot:X,back:W}){let z=U.state==="ok"?U.data.twins.filter((E)=>E.mirror).map((E)=>E.twin):[],B=`volter.canvas.${Q}`,[O,T]=B1.useState(null),[R,L]=B1.useState(!0),M=OJ(),I=B1.useCallback((E)=>v0([...Q.split("/"),"~","vendors",E]),[Q]),f=Math.max(1,Math.ceil(Math.sqrt(z.length))),D=B1.useCallback(()=>{let E={};try{E=JSON.parse(localStorage.getItem(B)??"{}")}catch{}return z.map((p,a)=>({id:p,type:"screen",dragHandle:".frame-bar",position:E[p]??{x:a%f*(sq+vR),y:Math.floor(a/f)*(tq+vR)},data:{world:Q,vendor:p,active:!1,open:I}}))},[z.join(","),Q,f,I]),[V,k,h]=GR([]);B1.useEffect(()=>{k(D())},[D,k]),B1.useEffect(()=>{k((E)=>E.map((p)=>p.data.active===(p.id===O)?p:{...p,data:{...p.data,active:p.id===O}}))},[O,k]),B1.useEffect(()=>{let E=(p)=>{if(p.key==="Escape")T(null)};return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[]);let P=()=>{try{localStorage.setItem(B,JSON.stringify(Object.fromEntries(V.map((E)=>[E.id,E.position]))))}catch{}},C=(E)=>{T(E);let p=M.getNode(E);if(!p)return;let a=Math.min((window.innerWidth-300)/sq,(window.innerHeight-120)/tq,1);M.setCenter(p.position.x+sq/2-130/a,p.position.y+tq/2,{zoom:a,duration:400})},v=typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches,b=Z.state==="ok"&&U.state==="ok";return H.jsxDEV("div",{className:"canvas full",role:"region","aria-label":"Every vendor's screens",children:H.jsxDEV(UR,{nodes:b?V:[],onNodesChange:h,nodeTypes:EV,onNodeDragStop:P,onNodeClick:(E,p)=>T(p.id),onPaneClick:()=>T(null),fitView:!0,fitViewOptions:{padding:{top:"64px",left:"272px",right:"32px",bottom:"32px"}},minZoom:0.05,maxZoom:1.5,nodesConnectable:!1,elementsSelectable:!1,panOnScroll:!1,zoomOnDoubleClick:!1,colorMode:v?"dark":"light",proOptions:{hideAttribution:!0},children:[H.jsxDEV(FR,{variant:v4.Dots,gap:28,size:1.4},void 0,!1,void 0,this),H.jsxDEV(N8,{position:"top-left",className:"float layers",children:[H.jsxDEV("div",{className:"float-head",children:[H.jsxDEV("button",{type:"button",className:"back",onClick:W,"aria-label":`Back to ${Q}`,children:"←"},void 0,!1,void 0,this),H.jsxDEV("span",{className:"float-title",children:[H.jsxDEV("strong",{children:Q.split("/")[1]},void 0,!1,void 0,this),H.jsxDEV("span",{className:"mode",children:[Q.split("/")[0],X?" · snapshot":""]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("button",{type:"button",className:"ghost","aria-expanded":R,"aria-label":R?"Hide the screens list":"Show the screens list",onClick:()=>L(!R),children:R?"▾":"▸"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),R?H.jsxDEV("ul",{className:"layer-list","aria-label":"Screens",children:[z.map((E)=>H.jsxDEV("li",{children:H.jsxDEV("button",{type:"button",className:O===E?"on":void 0,onClick:()=>C(E),children:[H.jsxDEV(A5,{vendor:E},void 0,!1,void 0,this),H.jsxDEV("span",{children:F0(E)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},E,!1,void 0,this)),U.state==="ok"&&z.length===0?H.jsxDEV("li",{className:"mode",children:"No vendor in this World has screens."},void 0,!1,void 0,this):null]},void 0,!0,void 0,this):null,H.jsxDEV(B5,{load:U,what:"the vendors"},void 0,!1,void 0,this),Z.state==="pending"?H.jsxDEV("p",{className:"mode",role:"status",children:"Opening…"},void 0,!1,void 0,this):null,Z.state==="error"?H.jsxDEV("p",{role:"alert",children:["The World did not open its screens: ",Z.error," ",H.jsxDEV("button",{type:"button",onClick:K,children:"Try again"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),H.jsxDEV(N8,{position:"top-center",className:"float hint mode",children:O?`Using ${F0(O)} · Esc to leave`:"Drag to pan · scroll to zoom · click a screen to use it"},void 0,!1,void 0,this),H.jsxDEV(XR,{showInteractive:!1,position:"bottom-left"},void 0,!1,void 0,this),H.jsxDEV(YR,{pannable:!0,zoomable:!0,nodeBorderRadius:8,position:"bottom-right"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}var aR=(Q)=>{let U=new Map;for(let Z of Q.actions)U.set(Z.service,[...U.get(Z.service)??[],{...Z.action,service:Z.service,op:Z.action.op??Z.action.operation??""}]);return[...U.entries()]};function sR(Q){if(Q.applied)return Q.applied.outcome==="applied"?{label:"Deployed",tone:"done"}:Q.applied.outcome==="partial"?{label:"Partly deployed",tone:"warn"}:{label:"Deploy refused",tone:"bad"};let U=Q.currentHash??Q.contentHash,Z=Q.approvals.filter((X)=>X.contentHash===U).length,K=Q.verification&&Q.verification.contentHash===U?Q.verification:null;if(K&&!K.passed)return{label:"Checks failed",tone:"bad"};if(Z>0)return{label:`Approved by ${Z}`,tone:"good"};if(K)return{label:"Verified",tone:"good"};return{label:"Not verified",tone:"plain"}}function xV({name:Q,token:U,signsAs:Z,canWrite:K,rooted:X,open:W,refused:z}){let[B,O]=B1.useState(0),T=L5(U,`/-/${Q}/changesets`,B),R=(M)=>(I)=>{I.preventDefault(),v0([...Q.split("/"),"~","changesets",M])};if(W){let M=T.state==="ok"?T.data.changesets.find((I)=>I.name===W):void 0;return H.jsxDEV(H.Fragment,{children:[H.jsxDEV("p",{className:"crumbs-line",children:H.jsxDEV("a",{href:`${q0}/${Q}/~/changesets`,onClick:(I)=>{I.preventDefault(),v0([...Q.split("/"),"~","changesets"])},children:"← Changesets"},void 0,!1,void 0,this)},void 0,!1,void 0,this),H.jsxDEV(B5,{load:T,what:"the changesets"},void 0,!1,void 0,this),T.state==="ok"&&!M?H.jsxDEV("p",{className:"mode",children:["This World has no changeset named ",W,"."]},void 0,!0,void 0,this):null,M?H.jsxDEV(hV,{name:Q,token:U,signsAs:Z,c:M,canWrite:K,rooted:X,refused:z,onChanged:()=>O((I)=>I+1)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}let L=T.state==="ok"?[...T.data.changesets].sort((M,I)=>I.createdAt.localeCompare(M.createdAt)):[];return H.jsxDEV(H.Fragment,{children:[H.jsxDEV("p",{className:"lede",children:"A changeset is what this World changed, cut into a piece a person reviews: what it does at each vendor, the World's checks over it, and who approved it. Where the World has a real account behind a vendor, an approved changeset deploys there, with a receipt for each change."},void 0,!1,void 0,this),H.jsxDEV(B5,{load:T,what:"the changesets"},void 0,!1,void 0,this),T.state==="ok"&&L.length===0?H.jsxDEV(wR,{title:"No changesets yet",children:H.jsxDEV("p",{children:["Cut one from what your app did in this World: ",H.jsxDEV("code",{children:'volter world changeset -m "What it does and why"'},void 0,!1,void 0,this),". Pushed to a shared World, it shows up here for review."]},void 0,!0,void 0,this)},void 0,!1,void 0,this):null,L.length>0?H.jsxDEV("div",{className:"block",children:H.jsxDEV("table",{className:"dense","aria-label":"Changesets",children:[H.jsxDEV("thead",{children:H.jsxDEV("tr",{children:[H.jsxDEV("th",{children:"Changeset"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"Changes"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"Made"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"Status"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("tbody",{children:L.map((M)=>{let I=sR(M),f=aR(M).map(([D,V])=>`${V.length} at ${F0(D)}`).join(" · ");return H.jsxDEV("tr",{children:[H.jsxDEV("td",{children:[H.jsxDEV("a",{href:`${q0}/${Q}/~/changesets/${M.name}`,onClick:R(M.name),children:H.jsxDEV("b",{children:M.message??M.name},void 0,!1,void 0,this)},void 0,!1,void 0,this),M.message?H.jsxDEV("span",{className:"mode mono",children:[" ",M.name]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),H.jsxDEV("td",{className:"mode",children:f||"nothing"},void 0,!1,void 0,this),H.jsxDEV("td",{className:"mode",children:H.jsxDEV(h0,{iso:M.createdAt},void 0,!1,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("td",{children:H.jsxDEV("span",{className:`badge cs-${I.tone}`,children:I.label},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},M.name,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}function hV({name:Q,token:U,signsAs:Z,c:K,canWrite:X,rooted:W,refused:z,onChanged:B}){let[O,T]=B1.useState(null),[R,L]=B1.useState(!1),[M,I]=B1.useState(""),[f,D]=B1.useState(""),V=sR(K),k=aR(K),h=k.map(([m])=>m),P=h.some((m)=>W.includes(m)),C=(m)=>m===(K.currentHash??K.contentHash),v=async(m,_1,$1,J1)=>{T(m);try{let y=await X0(U,_1,{method:"POST",...$1===void 0?{}:{body:JSON.stringify($1)}});if(!y.ok)return z(y),t2(`${m}: ${await z5(y)}`,"error"),!1;if(J1)t2(J1);return B(),!0}catch(y){return t2(`${m}: the World did not answer (${y instanceof Error?y.message:String(y)})`,"error"),!1}finally{T(null)}},b=()=>{v("Verify",`/-/${Q}/changesets/${K.name}/verify`,void 0,"Verified: the checks ran over it")},E=async(m)=>{if(m.preventDefault(),await v("Approve",`/-/${Q}/changesets/${K.name}/approve`,{...M.trim()?{note:M.trim()}:{},...Z===null&&f.trim()?{as:f.trim()}:{}},"Approved"))L(!1),I("")},p=async()=>{if(!await o5({title:`Deploy ${K.name} to the real vendors?`,body:H.jsxDEV(H.Fragment,{children:["It performs its ",K.actions.length," change",K.actions.length===1?"":"s"," against the real account",h.filter((m)=>W.includes(m)).length===1?"":"s"," behind ",EX(h.filter((m)=>W.includes(m)).map(F0)),". This cannot be taken back here."]},void 0,!0,void 0,this),action:"Deploy",danger:!0,typed:K.name}))return;v("Deploy",`/-/${Q}/deploy/${K.name}`,{confirm:K.name},"Deployed: the receipts are below")},a=!X?"This session reads the World; it changes nothing":K.applied?"Already deployed":null;return H.jsxDEV("div",{className:"changeset","aria-labelledby":"changeset-title",children:[H.jsxDEV("div",{className:"changeset-head",children:[H.jsxDEV("div",{children:[H.jsxDEV("h3",{id:"changeset-title",children:[K.message??K.name," ",H.jsxDEV("span",{className:`badge cs-${V.tone}`,children:V.label},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("p",{className:"mode",children:[H.jsxDEV("code",{children:K.name},void 0,!1,void 0,this)," · made ",H.jsxDEV(h0,{iso:K.createdAt},void 0,!1,void 0,this)," · ",K.actions.length," change",K.actions.length===1?"":"s"," at ",EX(h.map(F0))||"no vendor"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("div",{className:"changeset-actions",children:[H.jsxDEV("button",{type:"button",onClick:b,disabled:Boolean(a)||O!==null,title:a??"Replay it in a throwaway World and run the World's checks",children:O==="Verify"?"Verifying…":"Verify"},void 0,!1,void 0,this),H.jsxDEV("button",{type:"button",onClick:()=>L(!0),disabled:Boolean(a)||O!==null,title:a??"Sign its current contents as yourself",children:"Approve…"},void 0,!1,void 0,this),P?H.jsxDEV("button",{type:"button",className:"primary",onClick:()=>void p(),disabled:Boolean(a)||O!==null,title:a??"Perform it against the real accounts behind this World",children:O==="Deploy"?"Deploying…":"Deploy…"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),a&&!K.applied?H.jsxDEV("p",{className:"mode",children:[a,"."]},void 0,!0,void 0,this):null,!P&&!K.applied?H.jsxDEV("p",{className:"mode",children:"It stays in this World: no vendor it changes has a real account behind it here (a shared World with a root deploys; see Settings › Real services)."},void 0,!1,void 0,this):null,K.narration?H.jsxDEV("p",{className:"narration",children:K.narration},void 0,!1,void 0,this):null,H.jsxDEV("h4",{children:"Changes"},void 0,!1,void 0,this),k.length===0?H.jsxDEV("p",{className:"mode",children:"It changes nothing."},void 0,!1,void 0,this):H.jsxDEV(tR,{groups:k,idPrefix:`cs-${K.name}`},void 0,!1,void 0,this),H.jsxDEV("h4",{children:"Checks"},void 0,!1,void 0,this),!K.verification?H.jsxDEV("p",{className:"mode",children:"Not verified yet. Verify replays it in a throwaway World and runs this World's checks over the result."},void 0,!1,void 0,this):H.jsxDEV("div",{className:C(K.verification.contentHash)?"":"stale",children:[H.jsxDEV("p",{children:[K.verification.passed?"✓ Passed":"✗ Failed"," · ",H.jsxDEV(h0,{iso:K.verification.at},void 0,!1,void 0,this),C(K.verification.contentHash)?null:H.jsxDEV("span",{className:"mode",children:" · on an earlier version of it: verify again"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),K.verification.results.length?H.jsxDEV("ul",{className:"checks",children:K.verification.results.map((m)=>H.jsxDEV("li",{children:[m.passed?"✓":"✗"," ",H.jsxDEV("code",{children:m.id},void 0,!1,void 0,this)," ",H.jsxDEV("span",{className:"mode",children:F0(m.service)},void 0,!1,void 0,this)]},m.id,!0,void 0,this))},void 0,!1,void 0,this):null,K.verification.refusals?.length?H.jsxDEV("ul",{className:"checks",children:K.verification.refusals.map((m,_1)=>H.jsxDEV("li",{children:["✗ ",H.jsxDEV("code",{children:m.check},void 0,!1,void 0,this)," ",H.jsxDEV("span",{className:"mode",children:[F0(m.service),": ",m.reason]},void 0,!0,void 0,this)]},_1,!0,void 0,this))},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),H.jsxDEV("h4",{children:"Approvals"},void 0,!1,void 0,this),K.approvals.length===0?H.jsxDEV("p",{className:"mode",children:"No one has approved it."},void 0,!1,void 0,this):H.jsxDEV("ul",{className:"approvals",children:K.approvals.map((m,_1)=>H.jsxDEV("li",{children:[H.jsxDEV("b",{children:m.principal},void 0,!1,void 0,this)," ",H.jsxDEV("span",{className:"mode",children:[H.jsxDEV(h0,{iso:m.at},void 0,!1,void 0,this),C(m.contentHash)?"":" · signed an earlier version"]},void 0,!0,void 0,this),m.note?H.jsxDEV("div",{className:"mode",children:["“",m.note,"”"]},void 0,!0,void 0,this):null]},_1,!0,void 0,this))},void 0,!1,void 0,this),K.applied?H.jsxDEV(H.Fragment,{children:[H.jsxDEV("h4",{children:"Deployed"},void 0,!1,void 0,this),H.jsxDEV("p",{children:[K.applied.outcome==="applied"?"Every change reached the real vendors":K.applied.outcome==="partial"?"Some changes reached the real vendors":"The deploy was refused"," · ",H.jsxDEV(h0,{iso:K.applied.at},void 0,!1,void 0,this)]},void 0,!0,void 0,this),K.applied.refusal?.length?H.jsxDEV("ul",{className:"checks",children:K.applied.refusal.map((m,_1)=>H.jsxDEV("li",{className:"mode",children:m},_1,!1,void 0,this))},void 0,!1,void 0,this):null,K.applied.receipts.length?H.jsxDEV("ul",{className:"receipts",children:K.applied.receipts.map((m)=>H.jsxDEV("li",{children:[H.jsxDEV("span",{className:m.status==="failed"?"badge cs-bad":"badge cs-done",children:m.status},void 0,!1,void 0,this)," ",F0(m.service)," ",m.url?H.jsxDEV("a",{href:m.url,target:"_blank",rel:"noopener noreferrer",children:m.externalId??m.url},void 0,!1,void 0,this):m.externalId?H.jsxDEV("code",{children:m.externalId},void 0,!1,void 0,this):null,m.error?H.jsxDEV("span",{className:"mode",children:[" · ",m.error]},void 0,!0,void 0,this):null]},m.actionId,!0,void 0,this))},void 0,!1,void 0,this):null]},void 0,!0,void 0,this):null,H.jsxDEV(S8,{open:R,onClose:()=>{if(!O)L(!1)},title:`Approve ${K.name}`,footer:H.jsxDEV(H.Fragment,{children:[H.jsxDEV("button",{type:"button",onClick:()=>L(!1),disabled:O!==null,children:"Cancel"},void 0,!1,void 0,this),H.jsxDEV("button",{type:"submit",form:"approve-changeset",className:"primary",disabled:O!==null,children:O==="Approve"?"Approving…":"Approve"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:H.jsxDEV("form",{id:"approve-changeset",onSubmit:(m)=>void E(m),className:"stack",children:[H.jsxDEV("p",{className:"mode",children:["You sign its contents as they stand now",Z?H.jsxDEV(H.Fragment,{children:[", recorded as ",H.jsxDEV("b",{children:Z},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,". A later change to it shows your approval as for an earlier version."]},void 0,!0,void 0,this),Z===null?H.jsxDEV("label",{children:[H.jsxDEV("span",{children:"Approving as"},void 0,!1,void 0,this),H.jsxDEV("input",{name:"approveAs",value:f,onChange:(m)=>D(m.target.value),maxLength:80,required:!0,placeholder:"your name or email",autoComplete:"off"},void 0,!1,void 0,this),H.jsxDEV("span",{className:"mode",children:"This World was opened with its token, which names no person: the approval records the name you give."},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,H.jsxDEV("label",{children:[H.jsxDEV("span",{children:["Note ",H.jsxDEV("span",{className:"mode",children:"(optional)"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("textarea",{name:"approveNote",value:M,onChange:(m)=>I(m.target.value),rows:3,maxLength:500},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function tR({groups:Q,idPrefix:U}){return H.jsxDEV(H.Fragment,{children:Q.map(([Z,K])=>H.jsxDEV("div",{className:"compare",role:"group","aria-labelledby":`${U}-${Z}`,children:[H.jsxDEV("h3",{id:`${U}-${Z}`,className:"vendor-cell",children:[H.jsxDEV(A5,{vendor:Z},void 0,!1,void 0,this),F0(Z)," ",H.jsxDEV("span",{className:"mode",children:["· ",K.length," change",K.length===1?"":"s"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("ul",{children:SV(K).map((X)=>X.length>=3?H.jsxDEV("li",{children:H.jsxDEV("details",{children:[H.jsxDEV("summary",{children:[H.jsxDEV("span",{className:"op",children:[J9(X.length,X[0].subject.type)," ",n5(X[0]).what.split(" ").slice(-1)[0]]},void 0,!0,void 0,this)," ",H.jsxDEV("span",{className:"mode",children:[X.map((W)=>n5(W).label??aq(W)).slice(0,4).join(", "),X.length>4?", …":""]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("ul",{children:X.map((W)=>H.jsxDEV("li",{children:[H.jsxDEV("span",{className:"op",children:n5(W).what},void 0,!1,void 0,this)," ",n5(W).label?H.jsxDEV("span",{className:"label",children:["“",n5(W).label,"”"]},void 0,!0,void 0,this):H.jsxDEV("code",{children:aq(W)},void 0,!1,void 0,this)," ",H.jsxDEV("span",{className:"mode",children:[H.jsxDEV(h0,{iso:W.occurredAt},void 0,!1,void 0,this)," · ",oq(W,Z)]},void 0,!0,void 0,this)]},W.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},X[0].id,!1,void 0,this):X.map((W)=>H.jsxDEV("li",{children:H.jsxDEV("details",{children:[H.jsxDEV("summary",{children:[H.jsxDEV("span",{className:"op",children:n5(W).what},void 0,!1,void 0,this)," ",n5(W).label?H.jsxDEV("span",{className:"label",children:["“",n5(W).label,"”"]},void 0,!0,void 0,this):H.jsxDEV("code",{children:aq(W)},void 0,!1,void 0,this)," ",H.jsxDEV("span",{className:"mode",children:[H.jsxDEV(h0,{iso:W.occurredAt},void 0,!1,void 0,this)," · ",oq(W,Z)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV(iR,{fields:W.fields},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},W.id,!1,void 0,this)))},void 0,!1,void 0,this)]},Z,!0,void 0,this))},void 0,!1,void 0,this)}function mV({name:Q,token:U}){let Z=L5(U,`/-/${Q}/diff`),K=B1.useMemo(()=>{let X=new Map;if(Z.state==="ok")for(let W of Z.data.changes)X.set(W.twin,[...X.get(W.twin)??[],W.entry]);return[...X.entries()]},[Z]);return H.jsxDEV(H.Fragment,{children:[H.jsxDEV(B5,{load:Z,what:"the changes"},void 0,!1,void 0,this),Z.state==="ok"?H.jsxDEV(H.Fragment,{children:[H.jsxDEV("p",{className:"mode",children:["What this World changed since it started",Z.data.base.at?H.jsxDEV(H.Fragment,{children:[" (",H.jsxDEV(h0,{iso:Z.data.base.at},void 0,!1,void 0,this),", ",H.jsxDEV("code",{children:Z.data.base.id},void 0,!1,void 0,this),")"]},void 0,!0,void 0,this):H.jsxDEV(H.Fragment,{children:[" (",H.jsxDEV("code",{children:Z.data.base.id},void 0,!1,void 0,this),")"]},void 0,!0,void 0,this),": ",Z.data.changes.length," change",Z.data.changes.length===1?"":"s"," at ",K.length," vendor",K.length===1?"":"s",". A changeset takes these to the real services."]},void 0,!0,void 0,this),K.length===0?H.jsxDEV("p",{className:"empty",children:["No changes since ",Z.data.base.id,Z.data.base.at?H.jsxDEV(H.Fragment,{children:[" (",H.jsxDEV(h0,{iso:Z.data.base.at},void 0,!1,void 0,this),")"]},void 0,!0,void 0,this):null,"."]},void 0,!0,void 0,this):H.jsxDEV(tR,{groups:K,idPrefix:"changes"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)}function gV({name:Q,token:U}){let[Z,K]=B1.useState(0),X=L5(U,`/-/${Q}/keys`,Z),[W,z]=B1.useState(!1),[B,O]=B1.useState(""),[T,R]=B1.useState("write"),[L,M]=B1.useState(!1),[I,f]=B1.useState(null),[D,V]=B1.useState(null),[k,h]=B1.useState(null),P=async()=>{let b=`Read-only link · ${new Date().toLocaleDateString(void 0,{month:"short",day:"numeric"})}`,E=await X0(U,`/-/${Q}/keys`,{method:"POST",body:JSON.stringify({name:b,scope:"read"})}).catch(()=>null),p=E?await E.json().catch(()=>({})):{error:`${B0} did not answer`};if(!E?.ok||!p.key){t2(p.error??"refused","error");return}h(`${window.location.origin}${q0}/${Q}#${new URLSearchParams({token:p.key}).toString()}`),K((a)=>a+1)},C=async(b)=>{b.preventDefault(),M(!0),f(null);let E=await X0(U,`/-/${Q}/keys`,{method:"POST",body:JSON.stringify({name:B.trim(),scope:T})}).catch(()=>null);M(!1);let p=E?await E.json().catch(()=>({})):{error:`${B0} did not answer`};if(!E?.ok||!p.key){f(p.error??"refused");return}z(!1),V({key:p.key,name:B.trim()}),O(""),K((a)=>a+1)},v=async(b)=>{if(!await o5({title:`Revoke ${b.name}?`,body:"Whatever holds it loses this World at once.",action:"Revoke key",danger:!0}))return;let E=await X0(U,`/-/${Q}/keys/${b.id}`,{method:"DELETE"});if(E.ok)t2(`Revoked ${b.name}`);else t2(await z5(E),"error");K((p)=>p+1)};return H.jsxDEV("section",{"aria-labelledby":"keys-head",className:"keys",children:[H.jsxDEV("div",{className:"keys-head",children:[H.jsxDEV("div",{children:[H.jsxDEV("h3",{id:"keys-head",children:"Keys"},void 0,!1,void 0,this),H.jsxDEV("p",{className:"mode",children:"What an app, a script or a CI job holds to reach this World: each named for what holds it and revoked alone. People open the World as themselves; keys are for software."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),o2()?H.jsxDEV("a",{className:"button primary",href:`${o2()}/${encodeURIComponent(Q.split("/")[0]??"")}`,children:"Make a key on the platform"},void 0,!1,void 0,this):H.jsxDEV("div",{className:"head-actions",children:[H.jsxDEV("button",{type:"button",onClick:()=>void P(),children:"Share a read-only link"},void 0,!1,void 0,this),H.jsxDEV("button",{type:"button",className:"primary",onClick:()=>{f(null),z(!0)},children:"Make a key"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV(B5,{load:X,what:"the keys",retry:()=>K((b)=>b+1)},void 0,!1,void 0,this),X.state==="ok"?X.data.keys.length===0?H.jsxDEV("p",{className:"mode",children:"No keys yet. The World's own token opens it too."},void 0,!1,void 0,this):H.jsxDEV("table",{className:"dense","aria-label":"Keys",children:[H.jsxDEV("thead",{children:H.jsxDEV("tr",{children:[H.jsxDEV("th",{children:"Name"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"Access"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"Made"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"Last used"},void 0,!1,void 0,this),H.jsxDEV("th",{className:"num",children:H.jsxDEV("span",{className:"sr",children:"Actions"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("tbody",{children:X.data.keys.map((b)=>H.jsxDEV("tr",{children:[H.jsxDEV("td",{children:b.name},void 0,!1,void 0,this),H.jsxDEV("td",{children:b.scope==="write"?"Read and write":"Read only"},void 0,!1,void 0,this),H.jsxDEV("td",{className:"mode",children:H.jsxDEV("span",{title:IJ(b.createdAt),children:dq(b.createdAt)},void 0,!1,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("td",{className:"mode",children:b.lastUsedAt?dq(b.lastUsedAt):"never"},void 0,!1,void 0,this),H.jsxDEV("td",{className:"num",children:H.jsxDEV(xX,{label:`More for ${b.name}`,items:[{label:"Revoke…",danger:!0,onSelect:()=>void v(b)}]},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},b.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,H.jsxDEV(S8,{open:W,onClose:()=>{if(!L)z(!1)},title:"Make a key",footer:H.jsxDEV(H.Fragment,{children:[H.jsxDEV("button",{type:"button",onClick:()=>z(!1),disabled:L,children:"Cancel"},void 0,!1,void 0,this),H.jsxDEV("button",{type:"submit",form:"make-key",disabled:L||!B.trim(),children:L?"Making…":"Make key"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:H.jsxDEV("form",{id:"make-key",onSubmit:C,"aria-label":"Make a key",children:[H.jsxDEV("label",{children:["Name ",H.jsxDEV("input",{autoFocus:!0,name:"keyName",value:B,onChange:(b)=>O(b.target.value),placeholder:"ci, staging app…",maxLength:80,required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("label",{children:["Access ",H.jsxDEV("select",{value:T,onChange:(b)=>R(b.target.value==="read"?"read":"write"),children:[H.jsxDEV("option",{value:"write",children:"Read and write"},void 0,!1,void 0,this),H.jsxDEV("option",{value:"read",children:"Read only"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),I?H.jsxDEV("p",{role:"alert",children:I},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this),H.jsxDEV(S8,{open:Boolean(D),onClose:()=>V(null),title:`${D?.name??"The key"} is ready`,footer:H.jsxDEV("button",{type:"button",className:"primary",onClick:()=>V(null),children:"Done"},void 0,!1,void 0,this),children:[H.jsxDEV("p",{className:"mode",children:"Copy it now: it is shown this once. Put it where the app reads its secrets."},void 0,!1,void 0,this),D?H.jsxDEV(uX,{label:"Key",value:D.key,secret:!0},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),H.jsxDEV(S8,{open:Boolean(k),onClose:()=>h(null),title:"A read-only link",footer:H.jsxDEV("button",{type:"button",className:"primary",onClick:()=>h(null),children:"Done"},void 0,!1,void 0,this),children:[H.jsxDEV("p",{className:"mode",children:"Whoever opens it sees this World's pages and changes nothing. Copy it now: it is shown this once. It is listed under Keys, where revoking it closes the link at once."},void 0,!1,void 0,this),k?H.jsxDEV(uX,{label:"Link",value:k,secret:!0},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function pV({name:Q,token:U,admin:Z,canWrite:K,refused:X,onRemoved:W}){let[z,B]=B1.useState(null),[O,T]=B1.useState(null),[R,L]=B1.useState(null),[M,I]=B1.useState(null),[f,D]=B1.useState(null),V=B1.useCallback(async()=>{let C=await X0(U,`/-/${Q}/twins`);B(C.ok?(await C.json()).twins:[]);let v=await X0(U,`/-/${Q}/requests?hours=24`);D(v.ok?await v.json():null);let b=await X0(U,`/-/${Q}/changesets`);T(b.ok?(await b.json()).changesets:[])},[Q,U]);B1.useEffect(()=>{V()},[V]);let k=async(C,v,b)=>{L(null);let E=await X0(U,v,b);if(!E.ok)X(E);L(E.ok?`${C}: done`:`${C}: ${await z5(E)}`),await V()},h=async()=>{if(!await o5({title:`Rotate the tokens of ${Q}?`,body:"Every app, script and person holding the current tokens loses access at once. The new ones are shown once.",action:"Rotate tokens",danger:!0}))return;let C=await X0(Z,`/-/worlds/${Q}/rotate`,{method:"POST"});if(C.ok)I(await C.json()),L("rotated: the new tokens are shown once");else L(`rotate: answered ${C.status}`)},P=async()=>{if(!await o5({title:`Remove ${Q}?`,body:"The host stops serving it and its whole history goes with it. This cannot be undone.",action:"Remove World",danger:!0,typed:Q}))return;let C=await X0(Z,`/-/worlds/${Q}`,{method:"DELETE"}).catch((v)=>v);if(C instanceof Error){L(`remove: the host did not answer (${C.message})`);return}if(C.ok)W();else L(`remove: answered ${C.status}`)};return H.jsxDEV(H.Fragment,{children:[R?H.jsxDEV("p",{role:"status",children:R},void 0,!1,void 0,this):null,M?H.jsxDEV("p",{role:"status",children:["token ",H.jsxDEV("code",{children:M.token},void 0,!1,void 0,this)," · read token ",H.jsxDEV("code",{children:M.readToken},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,K?H.jsxDEV(gV,{name:Q,token:U},void 0,!1,void 0,this):null,H.jsxDEV("h3",{children:"Real services"},void 0,!1,void 0,this),H.jsxDEV("p",{className:"mode",children:"Every vendor here is a stand-in. Connect one to its real service to read the real state into this World; give it the real key to send this World's changes there (a changeset's Deploy, below)."},void 0,!1,void 0,this),z===null?H.jsxDEV("p",{children:"Loading…"},void 0,!1,void 0,this):H.jsxDEV("table",{"aria-label":"Real services",children:[H.jsxDEV("thead",{children:H.jsxDEV("tr",{children:[H.jsxDEV("th",{children:"vendor"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"real service"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"real key"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"last read from it"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"last sent"},void 0,!1,void 0,this),K?H.jsxDEV("th",{},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("tbody",{children:z.map((C)=>H.jsxDEV("tr",{children:[H.jsxDEV("td",{children:H.jsxDEV("a",{href:`${q0}/${Q}/${C.twin}`,title:`Its log and stored state · ${C.position??0} changes held${C.protocol?.major!==void 0?` · protocol ${C.protocol.major}${C.protocol.standing&&C.protocol.standing!=="current"?` (${C.protocol.standing})`:""}`:""}`,onClick:(v)=>{v.preventDefault(),v0([...Q.split("/"),C.twin])},children:F0(C.twin)},void 0,!1,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("td",{children:C.root?.url?H.jsxDEV("code",{children:C.root.url},void 0,!1,void 0,this):H.jsxDEV("span",{className:"mode",children:"not connected"},void 0,!1,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("td",{children:C.credential?`sealed ${C.credential.fingerprint??""} · ${IJ(C.credential.placedAt)}`:H.jsxDEV("span",{className:"mode",children:"none"},void 0,!1,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("td",{children:C.refresh?.failed?H.jsxDEV("span",{role:"alert",children:["failed ×",C.refresh.failed.count??1,": ",C.refresh.failed.reason??""]},void 0,!0,void 0,this):C.root?IJ(C.refresh?.observedAt??C.refresh?.at):H.jsxDEV("span",{className:"mode",children:"—"},void 0,!1,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("td",{children:C.lastReceipt?`${C.lastReceipt.status??""} ${C.lastReceipt.externalId??""} ${C.lastReceipt.reason??""}`.trim():H.jsxDEV("span",{className:"mode",children:"—"},void 0,!1,void 0,this)},void 0,!1,void 0,this),K?H.jsxDEV("td",{children:[H.jsxDEV("button",{onClick:()=>void o5({title:`Read ${F0(C.twin)} now?`,body:`The real ${F0(C.twin)}'s current state is read into this World. Nothing is written to ${F0(C.twin)}.`,action:"Read from it"}).then((v)=>{if(v)k(`refresh ${C.twin}`,`/-/${Q}/twins/${C.twin}/refresh`,{method:"POST"})}),disabled:!C.root,title:"Read the real service's current state into this World",children:"Read from it"},void 0,!1,void 0,this)," ",H.jsxDEV("button",{onClick:()=>{let v=window.prompt(`The real ${F0(C.twin)}'s address (its API's URL); empty disconnects it`,C.root?.url??"");if(v===null)return;k(`root ${C.twin}`,`/-/${Q}/twins/${C.twin}/root`,{method:"PUT",body:JSON.stringify(v?{url:v}:null)})},title:"Connect this vendor to the real service's URL (empty disconnects it)",children:"Connect…"},void 0,!1,void 0,this)," ",H.jsxDEV("button",{onClick:()=>{let v=window.prompt(`The real ${F0(C.twin)} key: it is sealed beside this World and never shown again`);if(!v)return;k(`seal ${C.twin}`,`/-/${Q}/twins/${C.twin}/credential`,{method:"PUT",body:v,headers:{"content-type":"text/plain"}})},title:"Give this World the real service's key; it is sealed and never shown again",children:"Real key…"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},C.twin,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("h3",{children:"Traffic (last 24 hours)"},void 0,!1,void 0,this),f===null?H.jsxDEV("p",{className:"mode",children:"No request report for this world."},void 0,!1,void 0,this):f.requests===0?H.jsxDEV("p",{className:"mode",children:["No requests recorded in the last 24 hours. Recording is kept unless the World runs with ",H.jsxDEV("code",{children:"VOLTER_TWIN_REQUEST_JOURNAL=0"},void 0,!1,void 0,this),"; what the requests changed is always in Activity."]},void 0,!0,void 0,this):H.jsxDEV("table",{"aria-label":"Requests by twin",children:[H.jsxDEV("thead",{children:H.jsxDEV("tr",{children:[H.jsxDEV("th",{children:"vendor"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"requests"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"by status"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"p50"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"p95"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"top routes"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("tbody",{children:f.twins.map((C)=>H.jsxDEV("tr",{children:[H.jsxDEV("td",{children:C.twin},void 0,!1,void 0,this),H.jsxDEV("td",{children:C.requests},void 0,!1,void 0,this),H.jsxDEV("td",{children:Object.entries(C.byStatus).map(([v,b])=>`${v}: ${b}`).join(" · ")||"—"},void 0,!1,void 0,this),H.jsxDEV("td",{children:C.p50Ms===null?"—":`${C.p50Ms} ms`},void 0,!1,void 0,this),H.jsxDEV("td",{children:C.p95Ms===null?"—":`${C.p95Ms} ms`},void 0,!1,void 0,this),H.jsxDEV("td",{children:C.topRoutes.slice(0,5).map((v)=>H.jsxDEV("div",{children:[H.jsxDEV("code",{children:v.route},void 0,!1,void 0,this)," ",H.jsxDEV("span",{className:"mode",children:["×",v.requests]},void 0,!0,void 0,this)]},v.route,!0,void 0,this))},void 0,!1,void 0,this)]},C.twin,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("h3",{children:"Sending changes to the real services"},void 0,!1,void 0,this),H.jsxDEV("p",{className:"mode",children:["A changeset is a set of this World's changes (",H.jsxDEV("code",{children:'volter world changeset -m "…"'},void 0,!1,void 0,this),"), verified and approved, then deployed to each connected real service."]},void 0,!0,void 0,this),O===null?H.jsxDEV("p",{children:"Loading…"},void 0,!1,void 0,this):O.length===0?H.jsxDEV("p",{className:"mode",children:"No changesets yet."},void 0,!1,void 0,this):H.jsxDEV("table",{children:[H.jsxDEV("thead",{children:H.jsxDEV("tr",{children:[H.jsxDEV("th",{children:"name"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"changes"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"approvals"},void 0,!1,void 0,this),K?H.jsxDEV("th",{children:"actions"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("tbody",{children:O.map((C)=>H.jsxDEV("tr",{children:[H.jsxDEV("td",{children:C.name},void 0,!1,void 0,this),H.jsxDEV("td",{children:Array.isArray(C.actions)?C.actions.length:"—"},void 0,!1,void 0,this),H.jsxDEV("td",{children:Array.isArray(C.approvals)?C.approvals.length:0},void 0,!1,void 0,this),K?H.jsxDEV("td",{children:[H.jsxDEV("button",{onClick:()=>void k(`verify ${C.name}`,`/-/${Q}/changesets/${encodeURIComponent(C.name)}/verify`,{method:"POST"}),children:"Verify"},void 0,!1,void 0,this)," ",H.jsxDEV("button",{onClick:()=>{let v=window.prompt(`Approve ${C.name} as`);if(!v)return;k(`approve ${C.name}`,`/-/${Q}/changesets/${encodeURIComponent(C.name)}/approve`,{method:"POST",body:JSON.stringify({as:v})})},children:"Approve"},void 0,!1,void 0,this)," ",H.jsxDEV("button",{onClick:()=>void o5({title:`Deploy ${C.name}?`,body:"Its changes are sent to the real services now. That is what the World exists to keep you from doing by accident.",action:"Deploy to the real services",danger:!0,typed:C.name}).then((v)=>{if(v)k(`deploy ${C.name}`,`/-/${Q}/deploy/${encodeURIComponent(C.name)}`,{method:"POST",body:JSON.stringify({confirm:C.name})})}),children:"Deploy"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},C.name,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z?H.jsxDEV("div",{className:"danger",role:"region","aria-label":"Danger zone",children:[H.jsxDEV("h3",{children:"Danger zone"},void 0,!1,void 0,this),H.jsxDEV("p",{children:[H.jsxDEV("button",{onClick:()=>void h(),children:"Rotate tokens"},void 0,!1,void 0,this)," ",H.jsxDEV("span",{className:"mode",children:"New tokens for this World; every app, script and browser using the old ones is signed out."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("p",{children:[H.jsxDEV("button",{onClick:()=>void P(),children:"Remove world"},void 0,!1,void 0,this)," ",H.jsxDEV("span",{className:"mode",children:"Deletes this World and everything in it."},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)}function cV({name:Q,token:U,twin:Z}){let[K,X]=B1.useState("log"),[W,z]=B1.useState(null),[B,O]=B1.useState(null);B1.useEffect(()=>{(async()=>{let f=await X0(U,`/-/${Q}/log/${Z}?limit=1`);if(!f.ok){z({position:0,entries:[]});return}let{position:D}=await f.json(),V=Math.max(0,D-200),h=await(await X0(U,`/-/${Q}/log/${Z}?after=${V}&limit=200&receipts=1`)).json();z({position:h.position,entries:[...h.entries].reverse()});let P=await X0(U,`/-/${Q}/checkpoint/${Z}`);O(P.ok?(await P.json()).tree:[])})()},[Q,U,Z]);let[T,R]=B1.useState(!1);B1.useEffect(()=>{X0(U,`/-/${Q}/twins/${Z}/status`).then(async(f)=>R(f.ok&&(await f.json()).mirror===!0),()=>R(!1))},[Q,U,Z]);let L=`${w6}/${Q}/${Z}/mirror/`,M=()=>{let f=document.createElement("form");f.method="POST",f.action=`${w6}/-/${Q}/session`;for(let[D,V]of[["token",U],["next",`/${Q}/${Z}/mirror/`]]){let k=document.createElement("input");k.type="hidden",k.name=D,k.value=V,f.append(k)}document.body.append(f),f.submit(),f.remove()},I=(f)=>f.operation==="observed"?`observed${f.provenance==="placeholder"?" (default data)":" (vendor)"}`:f.receipt?`${f.receipt.status??""} ${f.receipt.externalId??""} ${f.receipt.reason??""}`.trim():f.provenance==="placeholder"?"default data":"unpushed";return H.jsxDEV("section",{"aria-labelledby":"twin",children:[H.jsxDEV("h2",{id:"twin",children:[Z," in ",Q]},void 0,!0,void 0,this),H.jsxDEV("p",{children:["position ",W?.position??"…"," · ",H.jsxDEV("code",{children:[w6,"/",Q,"/",Z]},void 0,!0,void 0,this),T?H.jsxDEV(H.Fragment,{children:[" · ",H.jsxDEV("a",{href:L,onClick:(f)=>{f.preventDefault(),M()},children:["Open as ",Z," shows it"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),H.jsxDEV("div",{role:"tablist",children:[H.jsxDEV("button",{role:"tab","aria-selected":K==="log",onClick:()=>X("log"),children:"Log"},void 0,!1,void 0,this),H.jsxDEV("button",{role:"tab","aria-selected":K==="tree",onClick:()=>X("tree"),children:"Tree"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),K==="log"?W===null?H.jsxDEV("p",{children:"Loading…"},void 0,!1,void 0,this):W.entries.length===0?H.jsxDEV("p",{children:"No changes yet."},void 0,!1,void 0,this):H.jsxDEV("table",{children:[H.jsxDEV("thead",{children:H.jsxDEV("tr",{children:[H.jsxDEV("th",{children:"when"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"operation"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"subject"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"actor"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"standing"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("tbody",{children:W.entries.map((f)=>H.jsxDEV("tr",{children:[H.jsxDEV("td",{children:IJ(f.occurredAt)},void 0,!1,void 0,this),H.jsxDEV("td",{children:f.operation??f.op},void 0,!1,void 0,this),H.jsxDEV("td",{children:H.jsxDEV("code",{children:[f.subject.type,":",f.subject.id]},void 0,!0,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("td",{children:f.actor?`${f.actor.kind}${f.actor.id?` ${f.actor.id}`:""}`:"—"},void 0,!1,void 0,this),H.jsxDEV("td",{children:nq(f)},void 0,!1,void 0,this)]},f.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):B===null?H.jsxDEV("p",{children:"Loading…"},void 0,!1,void 0,this):B.length===0?H.jsxDEV("p",{children:"The tree is empty."},void 0,!1,void 0,this):H.jsxDEV("table",{children:[H.jsxDEV("thead",{children:H.jsxDEV("tr",{children:[H.jsxDEV("th",{children:"type"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"id"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"fields"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("tbody",{children:B.filter((f)=>f.deleted!==!0).slice(0,500).map((f)=>{let{type:D,id:V,...k}=f;return H.jsxDEV("tr",{children:[H.jsxDEV("td",{children:D},void 0,!1,void 0,this),H.jsxDEV("td",{children:H.jsxDEV("code",{children:V},void 0,!1,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("td",{children:H.jsxDEV("pre",{children:JSON.stringify(k,null,1).slice(0,600)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},`${D}:${V}`,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}bX();ER.createRoot(NJ).render(H.jsxDEV(H.Fragment,{children:[H.jsxDEV(zV,{},void 0,!1,void 0,this),H.jsxDEV(OR,{},void 0,!1,void 0,this),H.jsxDEV(RR,{},void 0,!1,void 0,this),H.jsxDEV(TR,{},void 0,!1,void 0,this)]},void 0,!0,void 0,this));
246
+ `)),R=T.reduce((L,M)=>L.concat(...M),[]);return[T,R]}return[[],[]]},[Q]);return K1.useEffect(()=>{let O=U?.target??GT,T=U?.actInsideInputWithModifier??!0;if(Q!==null){let R=(f)=>{if(X.current=f.ctrlKey||f.metaKey||f.shiftKey||f.altKey,(!X.current||X.current&&!T)&&BX(f))return!1;let D=FT(f.code,B);if(W.current.add(f[D]),ZT(z,W.current,!1)){let V=f.composedPath?.()?.[0]||f.target,k=V?.nodeName==="BUTTON"||V?.nodeName==="A";if(U.preventDefault!==!1&&(X.current||!k))f.preventDefault();K(!0)}},L=(f)=>{let I=FT(f.code,B);if(ZT(z,W.current,!0))K(!1),W.current.clear();else W.current.delete(f[I]);if(f.key==="Meta")W.current.clear();X.current=!1},M=()=>{W.current.clear(),K(!1)};return O?.addEventListener("keydown",R),O?.addEventListener("keyup",L),window.addEventListener("blur",M),window.addEventListener("contextmenu",M),()=>{O?.removeEventListener("keydown",R),O?.removeEventListener("keyup",L),window.removeEventListener("blur",M),window.removeEventListener("contextmenu",M)}}},[Q,K]),Z}function ZT(Q,U,Z){return Q.filter((K)=>Z||K.length===U.size).some((K)=>K.every((X)=>U.has(X)))}function FT(Q,U){return U.includes(Q)?"code":"key"}var JS=()=>{let Q=C0();return K1.useMemo(()=>{return{zoomIn:async(U)=>{let{panZoom:Z}=Q.getState();return Z?Z.scaleBy(1.2,U):!1},zoomOut:async(U)=>{let{panZoom:Z}=Q.getState();return Z?Z.scaleBy(0.8333333333333334,U):!1},zoomTo:async(U,Z)=>{let{panZoom:K}=Q.getState();return K?K.scaleTo(U,Z):!1},getZoom:()=>Q.getState().transform[2],setViewport:async(U,Z)=>{let{transform:[K,X,W],panZoom:z}=Q.getState();if(!z)return!1;return await z.setViewport({x:U.x??K,y:U.y??X,zoom:U.zoom??W},Z),!0},getViewport:()=>{let[U,Z,K]=Q.getState().transform;return{x:U,y:Z,zoom:K}},setCenter:async(U,Z,K)=>{return Q.getState().setCenter(U,Z,K)},fitBounds:async(U,Z)=>{let{width:K,height:X,minZoom:W,maxZoom:z,panZoom:B}=Q.getState(),O=MJ(U,K,X,W,z,Z?.padding??0.1);if(!B)return!1;return await B.setViewport(O,{duration:Z?.duration,ease:Z?.ease,interpolate:Z?.interpolate}),!0},screenToFlowPosition:(U,Z={})=>{let{transform:K,snapGrid:X,snapToGrid:W,domNode:z}=Q.getState();if(!z)return U;let{x:B,y:O}=z.getBoundingClientRect(),T={x:U.x-B,y:U.y-O},R=Z.snapGrid??X,L=Z.snapToGrid??W;return n7(T,K,L,R)},flowToScreenPosition:(U)=>{let{transform:Z,domNode:K}=Q.getState();if(!K)return U;let{x:X,y:W}=K.getBoundingClientRect(),z=w8(U,Z);return{x:z.x+X,y:z.y+W}}}},[])};function DT(Q,U){let Z=[],K=new Map,X=[];for(let W of Q)if(W.type==="add"){X.push(W);continue}else if(W.type==="remove"||W.type==="replace")K.set(W.id,[W]);else{let z=K.get(W.id);if(z)z.push(W);else K.set(W.id,[W])}for(let W of U){let z=K.get(W.id);if(!z){Z.push(W);continue}if(z[0].type==="remove")continue;if(z[0].type==="replace"){Z.push({...z[0].item});continue}let B={...W};for(let O of z)$S(O,B);Z.push(B)}if(X.length)X.forEach((W)=>{if(W.index!==void 0)Z.splice(W.index,0,{...W.item});else Z.push({...W.item})});return Z}function $S(Q,U){switch(Q.type){case"select":{U.selected=Q.selected;break}case"position":{if(typeof Q.position<"u")U.position=Q.position;if(typeof Q.dragging<"u")U.dragging=Q.dragging;break}case"dimensions":{if(typeof Q.dimensions<"u"){if(U.measured={...Q.dimensions},Q.setAttributes){if(Q.setAttributes===!0||Q.setAttributes==="width")U.width=Q.dimensions.width;if(Q.setAttributes===!0||Q.setAttributes==="height")U.height=Q.dimensions.height}}if(typeof Q.resizing==="boolean")U.resizing=Q.resizing;break}}}function yT(Q,U){return DT(Q,U)}function QS(Q,U){return DT(Q,U)}function P8(Q,U){return{id:Q,type:"select",selected:U}}function _9(Q,U=new Set,Z=!1){let K=[];for(let[X,W]of Q){let z=U.has(X);if(!(W.selected===void 0&&!z)&&W.selected!==z){if(Z)W.selected=z;K.push(P8(W.id,z))}}return K}function KT({items:Q=[],lookup:U}){let Z=[],K=new Map(Q.map((X)=>[X.id,X]));for(let[X,W]of Q.entries()){let z=U.get(W.id),B=z?.internals?.userNode??z;if(B!==void 0&&B!==W)Z.push({id:W.id,item:W,type:"replace"});if(B===void 0)Z.push({item:W,type:"add",index:X})}for(let[X]of U)if(K.get(X)===void 0)Z.push({id:X,type:"remove"});return Z}function XT(Q){return{id:Q.id,type:"remove"}}var qS=KX("React Flow","https://reactflow.dev/");function US(Q,U,Z={}){return fM(Q,U,{...Z,onError:Z.onError??qS})}var HT=(Q)=>WM(Q),GS=(Q)=>QX(Q);function vT(Q){return K1.forwardRef(Q)}var ET=typeof window<"u"?K1.useLayoutEffect:K1.useEffect;function YT(Q){let[U,Z]=K1.useState(BigInt(0)),[K]=K1.useState(()=>ZS(()=>Z((X)=>X+BigInt(1))));return ET(()=>{let X=K.get();if(X.length)Q(X),K.reset()},[U]),K}function ZS(Q){let U=[];return{get:()=>U,reset:()=>{U=[]},push:(Z)=>{U.push(Z),Q()}}}var bT=K1.createContext(null);function FS({children:Q}){let U=C0(),Z=K1.useCallback((B)=>{let{nodes:O=[],setNodes:T,hasDefaultNodes:R,onNodesChange:L,nodeLookup:M,fitViewQueued:f,onNodesChangeMiddlewareMap:I}=U.getState(),D=O;for(let k of B)D=typeof k==="function"?k(D):k;let V=KT({items:D,lookup:M});for(let k of I.values())V=k(V);if(R)T(D);if(V.length>0)L?.(V);else if(f)window.requestAnimationFrame(()=>{let{fitViewQueued:k,nodes:h,setNodes:P}=U.getState();if(k)P(h)})},[]),K=YT(Z),X=K1.useCallback((B)=>{let{edges:O=[],setEdges:T,hasDefaultEdges:R,onEdgesChange:L,edgeLookup:M}=U.getState(),f=O;for(let I of B)f=typeof I==="function"?I(f):I;if(R)T(f);else if(L)L(KT({items:f,lookup:M}))},[]),W=YT(X),z=K1.useMemo(()=>({nodeQueue:K,edgeQueue:W}),[]);return F1.jsx(bT.Provider,{value:z,children:Q})}function KS(){let Q=K1.useContext(bT);if(!Q)throw Error("useBatchContext must be used within a BatchProvider");return Q}var XS=(Q)=>!!Q.panZoom;function OJ(){let Q=JS(),U=C0(),Z=KS(),K=G0(XS),X=K1.useMemo(()=>{let W=(L)=>U.getState().nodeLookup.get(L),z=(L)=>{Z.nodeQueue.push(L)},B=(L)=>{Z.edgeQueue.push(L)},O=(L)=>{let{nodeLookup:M,nodeOrigin:f}=U.getState(),I=HT(L)?L:M.get(L.id),D=I.parentId?HX(I.position,I.measured,I.parentId,M,f):I.position,V={...I,position:D,width:I.measured?.width??I.width,height:I.measured?.height??I.height};return t7(V)},T=(L,M,f={replace:!1})=>{z((I)=>I.map((D)=>{if(D.id===L){let V=typeof M==="function"?M(D):M;return f.replace&&HT(V)?V:{...D,...V}}return D}))},R=(L,M,f={replace:!1})=>{B((I)=>I.map((D)=>{if(D.id===L){let V=typeof M==="function"?M(D):M;return f.replace&&GS(V)?V:{...D,...V}}return D}))};return{getNodes:()=>U.getState().nodes.map((L)=>({...L})),getNode:(L)=>W(L)?.internals.userNode,getInternalNode:W,getEdges:()=>{let{edges:L=[]}=U.getState();return L.map((M)=>({...M}))},getEdge:(L)=>U.getState().edgeLookup.get(L),setNodes:z,setEdges:B,addNodes:(L)=>{let M=Array.isArray(L)?L:[L];Z.nodeQueue.push((f)=>[...f,...M])},addEdges:(L)=>{let M=Array.isArray(L)?L:[L];Z.edgeQueue.push((f)=>[...f,...M])},toObject:()=>{let{nodes:L=[],edges:M=[],transform:f}=U.getState(),[I,D,V]=f;return{nodes:L.map((k)=>({...k})),edges:M.map((k)=>({...k})),viewport:{x:I,y:D,zoom:V}}},deleteElements:async({nodes:L=[],edges:M=[]})=>{let{nodes:f,edges:I,onNodesDelete:D,onEdgesDelete:V,triggerNodeChanges:k,triggerEdgeChanges:h,onDelete:P,onBeforeDelete:C}=U.getState(),{nodes:v,edges:b}=await AM({nodesToRemove:L,edgesToRemove:M,nodes:f,edges:I,onBeforeDelete:C}),E=b.length>0,p=v.length>0;if(E){let a=b.map(XT);V?.(b),h(a)}if(p){let a=v.map(XT);D?.(v),k(a)}if(p||E)P?.({nodes:v,edges:b});return{deletedNodes:v,deletedEdges:b}},getIntersectingNodes:(L,M=!0,f)=>{let I=FX(L),D=I?L:O(L),V=f!==void 0;if(!D)return[];return(f||U.getState().nodes).filter((k)=>{let h=U.getState().nodeLookup.get(k.id);if(h&&!I&&(k.id===L.id||!h.internals.positionAbsolute))return!1;let P=t7(V?k:h),C=LJ(P,D);return M&&C>0||C>=P.width*P.height||C>=D.width*D.height})},isNodeIntersecting:(L,M,f=!0)=>{let D=FX(L)?L:O(L);if(!D)return!1;let V=LJ(D,M);return f&&V>0||V>=M.width*M.height||V>=D.width*D.height},updateNode:T,updateNodeData:(L,M,f={replace:!1})=>{T(L,(I)=>{let D=typeof M==="function"?M(I):M;return f.replace?{...I,data:D}:{...I,data:{...I.data,...D}}},f)},updateEdge:R,updateEdgeData:(L,M,f={replace:!1})=>{R(L,(I)=>{let D=typeof M==="function"?M(I):M;return f.replace?{...I,data:D}:{...I,data:{...I.data,...D}}},f)},getNodesBounds:(L)=>{let{nodeLookup:M,nodeOrigin:f}=U.getState();return UX(L,{nodeLookup:M,nodeOrigin:f})},getHandleConnections:({type:L,id:M,nodeId:f})=>Array.from(U.getState().connectionLookup.get(`${f}-${L}${M?`-${M}`:""}`)?.values()??[]),getNodeConnections:({type:L,handleId:M,nodeId:f})=>Array.from(U.getState().connectionLookup.get(`${f}${L?M?`-${L}-${M}`:`-${L}`:""}`)?.values()??[]),fitView:async(L)=>{let M=U.getState().fitViewResolver??TM();return U.setState({fitViewQueued:!0,fitViewOptions:L,fitViewResolver:M}),Z.nodeQueue.push((f)=>[...f]),M.promise}}},[]);return K1.useMemo(()=>{return{...X,...Q,viewportInitialized:K}},[K])}var WT=(Q)=>Q.selected,HS=typeof window<"u"?window:void 0;function YS({deleteKeyCode:Q,multiSelectionKeyCode:U}){let Z=C0(),{deleteElements:K}=OJ(),X=RJ(Q,{actInsideInputWithModifier:!1}),W=RJ(U,{target:HS});K1.useEffect(()=>{if(X){let{edges:z,nodes:B}=Z.getState();K({nodes:B.filter(WT),edges:z.filter(WT)}),Z.setState({nodesSelectionActive:!1})}},[X]),K1.useEffect(()=>{Z.setState({multiSelectionActive:W})},[W])}function WS(Q){let U=C0();K1.useEffect(()=>{let Z=()=>{if(!Q.current||!(Q.current.checkVisibility?.()??!0))return!1;let K=jq(Q.current);if(K.height===0||K.width===0)U.getState().onError?.("004",x2.error004());U.setState({width:K.width||500,height:K.height||500})};if(Q.current){Z(),window.addEventListener("resize",Z);let K=new ResizeObserver(()=>Z());return K.observe(Q.current),()=>{if(window.removeEventListener("resize",Z),K&&Q.current)K.unobserve(Q.current)}}},[])}var cq={position:"absolute",width:"100%",height:"100%",top:0,left:0},zS=(Q)=>({userSelectionActive:Q.userSelectionActive,lib:Q.lib,connectionInProgress:Q.connection.inProgress});function BS({onPaneContextMenu:Q,zoomOnScroll:U=!0,zoomOnPinch:Z=!0,panOnScroll:K=!1,panActivationKeyPressed:X,panOnScrollSpeed:W=0.5,panOnScrollMode:z=B3.Free,zoomOnDoubleClick:B=!0,panOnDrag:O=!0,defaultViewport:T,translateExtent:R,minZoom:L,maxZoom:M,zoomActivationKeyCode:f,preventScrolling:I=!0,children:D,noWheelClassName:V,noPanClassName:k,onViewportChange:h,isControlledViewport:P,paneClickDistance:C,selectionOnDrag:v}){let b=C0(),E=K1.useRef(null),{userSelectionActive:p,lib:a,connectionInProgress:m}=G0(zS,N0),_1=RJ(f),$1=K1.useRef();WS(E);let J1=K1.useCallback((y)=>{if(h?.({x:y[0],y:y[1],zoom:y[2]}),!P)b.setState({transform:y})},[h,P]);return K1.useEffect(()=>{if(E.current){$1.current=pM({domNode:E.current,minZoom:L,maxZoom:M,translateExtent:R,viewport:T,onDraggingChange:(d)=>b.setState((g)=>g.paneDragging===d?g:{paneDragging:d}),onPanZoomStart:(d,g)=>{let{onViewportChangeStart:n,onMoveStart:j}=b.getState();j?.(d,g),n?.(g)},onPanZoom:(d,g)=>{let{onViewportChange:n,onMove:j}=b.getState();j?.(d,g),n?.(g)},onPanZoomEnd:(d,g)=>{let{onViewportChangeEnd:n,onMoveEnd:j}=b.getState();j?.(d,g),n?.(g)}});let{x:y,y:u,zoom:x}=$1.current.getViewport();return b.setState({panZoom:$1.current,transform:[y,u,x],domNode:E.current.closest(".react-flow")}),()=>{$1.current?.destroy()}}},[]),K1.useEffect(()=>{$1.current?.update({onPaneContextMenu:Q,zoomOnScroll:U,zoomOnPinch:Z,panOnScroll:K,panActivationKeyPressed:X,panOnScrollSpeed:W,panOnScrollMode:z,zoomOnDoubleClick:B,panOnDrag:O,zoomActivationKeyPressed:_1,preventScrolling:I,noPanClassName:k,userSelectionActive:p,noWheelClassName:V,lib:a,onTransformChange:J1,connectionInProgress:m,selectionOnDrag:v,paneClickDistance:C})},[Q,U,Z,K,X,W,z,B,O,_1,I,k,p,V,a,J1,m,v,C]),F1.jsx("div",{className:"react-flow__renderer",ref:E,style:cq,children:D})}var AS=(Q)=>({userSelectionActive:Q.userSelectionActive,userSelectionRect:Q.userSelectionRect});function LS(){let{userSelectionActive:Q,userSelectionRect:U}=G0(AS,N0);if(!(Q&&U))return null;return F1.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:U.width,height:U.height,transform:`translate(${U.x}px, ${U.y}px)`}})}var NX=(Q,U)=>{return(Z)=>{if(Z.target!==U.current)return;Q?.(Z)}},MS=(Q)=>({userSelectionActive:Q.userSelectionActive,elementsSelectable:Q.elementsSelectable,dragging:Q.paneDragging,panBy:Q.panBy,autoPanSpeed:Q.autoPanSpeed});function TS({isSelecting:Q,selectionKeyPressed:U,selectionMode:Z=R8.Full,panOnDrag:K,autoPanOnSelection:X,paneClickDistance:W,selectionOnDrag:z,onSelectionStart:B,onSelectionEnd:O,onPaneClick:T,onPaneContextMenu:R,onPaneScroll:L,onPaneMouseEnter:M,onPaneMouseMove:f,onPaneMouseLeave:I,children:D}){let V=K1.useRef(0),k=C0(),{userSelectionActive:h,elementsSelectable:P,dragging:C,panBy:v,autoPanSpeed:b}=G0(MS,N0),E=P&&(Q||h),p=K1.useRef(null),a=K1.useRef(),m=K1.useRef(new Set),_1=K1.useRef(new Set),$1=K1.useRef(!1),J1=K1.useRef(!1),y=K1.useRef({x:0,y:0}),u=K1.useRef(!1),x=(X1)=>{if(J1.current||$1.current||k.getState().connection.inProgress){J1.current=!1,$1.current=!1;return}T?.(X1),k.getState().resetSelectedElements(),k.setState({nodesSelectionActive:!1})},d=(X1)=>{if(Array.isArray(K)&&K?.includes(2)){X1.preventDefault();return}R?.(X1)},g=L?(X1)=>L(X1):void 0,n=(X1)=>{if(J1.current)X1.stopPropagation(),J1.current=!1},j=(X1)=>{if(X1.pointerType==="touch"&&K!==!1&&!U)return;let{domNode:f1,transform:l1}=k.getState();if(a.current=f1?.getBoundingClientRect(),!a.current)return;let W1=X1.target===p.current;if(!W1&&!!X1.target.closest(".nokey")||!Q||!(z&&W1||U)||X1.button!==0||!X1.isPrimary)return;X1.target?.setPointerCapture?.(X1.pointerId),J1.current=!1;let{x:c1,y:E1}=D5(X1.nativeEvent,a.current),j1=n7({x:c1,y:E1},l1);if(k.setState({userSelectionRect:{width:0,height:0,startX:j1.x,startY:j1.y,x:c1,y:E1}}),!W1)X1.stopPropagation(),X1.preventDefault()};function i(X1,f1){let{userSelectionRect:l1}=k.getState();if(!l1)return;let{transform:W1,nodeLookup:S1,edgeLookup:v1,connectionLookup:c1,triggerNodeChanges:E1,triggerEdgeChanges:j1,defaultEdgeOptions:V0}=k.getState(),b1={x:l1.startX,y:l1.startY},{x:Z2,y:_0}=w8(b1,W1),h2={startX:b1.x,startY:b1.y,x:X1<Z2?X1:Z2,y:f1<_0?f1:_0,width:Math.abs(X1-Z2),height:Math.abs(f1-_0)},z2=m.current,I2=_1.current;m.current=new Set(Pq(S1,h2,W1,Z===R8.Partial,!0).map((P2)=>P2.id)),_1.current=new Set;let f2=V0?.selectable??!0;for(let P2 of m.current){let B2=c1.get(P2);if(!B2)continue;for(let{edgeId:A2}of B2.values()){let L2=v1.get(A2);if(L2&&(L2.selectable??f2))_1.current.add(A2)}}if(!YX(z2,m.current)){let P2=_9(S1,m.current,!0);E1(P2)}if(!YX(I2,_1.current)){let P2=_9(v1,_1.current);j1(P2)}k.setState({userSelectionRect:h2,userSelectionActive:!0,nodesSelectionActive:!1})}function q1(){if(!X||!a.current)return;let[X1,f1]=Nq(y.current,a.current,b);v({x:X1,y:f1}).then((l1)=>{if(!J1.current||!l1){V.current=requestAnimationFrame(q1);return}let{x:W1,y:S1}=y.current;i(W1,S1),V.current=requestAnimationFrame(q1)})}let Q1=()=>{cancelAnimationFrame(V.current),V.current=0,u.current=!1};K1.useEffect(()=>{return()=>Q1()},[]);let Y1=(X1)=>{let{userSelectionRect:f1,transform:l1,resetSelectedElements:W1}=k.getState();if(!a.current||!f1)return;let{x:S1,y:v1}=D5(X1.nativeEvent,a.current);y.current={x:S1,y:v1};let c1=w8({x:f1.startX,y:f1.startY},l1);if(!J1.current){let E1=U?0:W;if(Math.hypot(S1-c1.x,v1-c1.y)<=E1)return;W1(),B?.(X1)}if(J1.current=!0,!u.current)q1(),u.current=!0;i(S1,v1)},L1=(X1)=>{if(!E){if(X1.target===p.current&&k.getState().connection.inProgress)$1.current=!0;return}if(X1.button!==0)return;if(X1.target?.releasePointerCapture?.(X1.pointerId),!h&&X1.target===p.current&&k.getState().userSelectionRect)x?.(X1);if(k.setState({userSelectionActive:!1,userSelectionRect:null}),J1.current)O?.(X1),k.setState({nodesSelectionActive:m.current.size>0});Q1()},M1=(X1)=>{X1.target?.releasePointerCapture?.(X1.pointerId),Q1()},I1=K===!0||Array.isArray(K)&&K.includes(0);return F1.jsxs("div",{className:y0(["react-flow__pane",{draggable:I1,dragging:C,selection:Q}]),onClick:E?void 0:NX(x,p),onContextMenu:NX(d,p),onWheel:NX(g,p),onPointerEnter:E?void 0:M,onPointerMove:E?Y1:f,onPointerUp:L1,onPointerCancel:E?M1:void 0,onPointerDownCapture:E?j:void 0,onClickCapture:E?n:void 0,onPointerLeave:I,ref:p,style:cq,children:[D,F1.jsx(LS,{})]})}function SX({id:Q,store:U,unselect:Z=!1,nodeRef:K}){let{addSelectedNodes:X,unselectNodesAndEdges:W,multiSelectionActive:z,nodeLookup:B,onError:O}=U.getState(),T=B.get(Q);if(!T){O?.("012",x2.error012(Q));return}if(U.setState({nodesSelectionActive:!1}),!T.selected)X([Q]);else if(Z||T.selected&&z)W({nodes:[T],edges:[]}),requestAnimationFrame(()=>K?.current?.blur())}function uT({nodeRef:Q,disabled:U=!1,noDragClassName:Z,handleSelector:K,nodeId:X,isSelectable:W,nodeClickDistance:z}){let B=C0(),[O,T]=K1.useState(!1),R=K1.useRef();return K1.useEffect(()=>{if(U)return;return R.current=vM({getStoreItems:()=>B.getState(),onNodeMouseDown:(L)=>{SX({id:L,store:B,nodeRef:Q})},onDragStart:()=>{T(!0)},onDragStop:()=>{T(!1)}}),()=>{R.current?.destroy(),R.current=void 0}},[U,B,Q]),K1.useEffect(()=>{if(U||!Q.current||!R.current)return;R.current.update({noDragClassName:Z,handleSelector:K,domNode:Q.current,isSelectable:W,nodeId:X,nodeClickDistance:z})},[Z,K,U,W,Q,X,z]),O}var RS=(Q)=>(U)=>U.selected&&(U.draggable||Q&&typeof U.draggable>"u");function xT(){let Q=C0();return K1.useCallback((Z)=>{let{nodeExtent:K,snapToGrid:X,snapGrid:W,nodesDraggable:z,onError:B,updateNodePositions:O,nodeLookup:T,nodeOrigin:R}=Q.getState(),L=new Map,M=RS(z),f=X?W[0]:5,I=X?W[1]:5,D=Z.direction.x*f*Z.factor,V=Z.direction.y*I*Z.factor;for(let[,k]of T){if(!M(k))continue;let h={x:k.internals.positionAbsolute.x+D,y:k.internals.positionAbsolute.y+V};if(X)h=o7(h,W);let{position:P,positionAbsolute:C}=GX({nodeId:k.id,nextPosition:h,nodeLookup:T,nodeExtent:K,nodeOrigin:R,onError:B});k.position=P,k.internals.positionAbsolute=C,L.set(k.id,k)}O(L)},[])}var jX=K1.createContext(null),OS=jX.Provider;jX.Consumer;var VX=()=>{return K1.useContext(jX)},wS=(Q)=>({connectOnClick:Q.connectOnClick,noPanClassName:Q.noPanClassName,rfId:Q.rfId}),hT=K1.createContext(null);function IS({children:Q}){let U=G0(wS,N0);return F1.jsx(hT.Provider,{value:U,children:Q})}function fS(){let Q=K1.useContext(hT);if(!Q)throw Error("useHandleConfig must be used within a HandleConfigProvider");return Q}var PS={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},NS=(Q,U,Z)=>(K)=>{let{connectionClickStartHandle:X,connectionMode:W,connection:z}=K,{fromHandle:B,toHandle:O,isValid:T}=z;if(!B&&!X)return PS;let R=O?.nodeId===Q&&O?.id===U&&O?.type===Z;return{connectingFrom:B?.nodeId===Q&&B?.id===U&&B?.type===Z,connectingTo:R,clickConnecting:X?.nodeId===Q&&X?.id===U&&X?.type===Z,isPossibleEndHandle:W===A6.Strict?B?.type!==Z:Q!==B?.nodeId||U!==B?.id,connectionInProcess:!!B,clickConnectionInProcess:!!X,valid:R&&T}};function CS({type:Q="source",position:U=C1.Top,isValidConnection:Z,isConnectable:K=!0,isConnectableStart:X=!0,isConnectableEnd:W=!0,id:z,onConnect:B,children:O,className:T,onMouseDown:R,onTouchStart:L,...M},f){let I=z||null,D=Q==="target",V=C0(),k=VX(),{connectOnClick:h,noPanClassName:P,rfId:C}=fS(),{connectingFrom:v,connectingTo:b,clickConnecting:E,isPossibleEndHandle:p,connectionInProcess:a,clickConnectionInProcess:m,valid:_1}=G0(NS(k,I,Q),N0);if(!k)V.getState().onError?.("010",x2.error010());let $1=(u)=>{let{defaultEdgeOptions:x,onConnect:d,hasDefaultEdges:g}=V.getState(),n={...x,...u};if(g){let{edges:j,setEdges:i,onError:q1}=V.getState();i(US(n,j,{onError:q1}))}d?.(n),B?.(n)},J1=(u)=>{if(!k)return;let x=AX(u.nativeEvent);if(X&&(x&&u.button===0||!x)){let d=V.getState();bq.onPointerDown(u.nativeEvent,{handleDomNode:u.currentTarget,autoPanOnConnect:d.autoPanOnConnect,connectionMode:d.connectionMode,connectionRadius:d.connectionRadius,domNode:d.domNode,nodeLookup:d.nodeLookup,lib:d.lib,isTarget:D,handleId:I,nodeId:k,flowId:d.rfId,panBy:d.panBy,cancelConnection:d.cancelConnection,onConnectStart:d.onConnectStart,onConnectEnd:(...g)=>V.getState().onConnectEnd?.(...g),updateConnection:d.updateConnection,onConnect:$1,isValidConnection:Z||((...g)=>V.getState().isValidConnection?.(...g)??!0),getTransform:()=>V.getState().transform,getFromHandle:()=>V.getState().connection.fromHandle,autoPanSpeed:d.autoPanSpeed,dragThreshold:d.connectionDragThreshold})}if(x)R?.(u);else L?.(u)},y=(u)=>{let{onClickConnectStart:x,onClickConnectEnd:d,connectionClickStartHandle:g,connectionMode:n,isValidConnection:j,lib:i,rfId:q1,nodeLookup:Q1,connection:Y1}=V.getState();if(!k||!g&&!X)return;if(!g){x?.(u.nativeEvent,{nodeId:k,handleId:I,handleType:Q}),V.setState({connectionClickStartHandle:{nodeId:k,type:Q,id:I}});return}let L1=zX(u.target),M1=Z||j,{connection:I1,isValid:X1}=bq.isValid(u.nativeEvent,{handle:{nodeId:k,id:I,type:Q},connectionMode:n,fromNodeId:g.nodeId,fromHandleId:g.id||null,fromType:g.type,isValidConnection:M1,flowId:q1,doc:L1,lib:i,nodeLookup:Q1});if(X1&&I1)$1(I1);let f1=structuredClone(Y1);delete f1.inProgress,f1.toPosition=f1.toHandle?f1.toHandle.position:null,d?.(u,f1),V.setState({connectionClickStartHandle:null})};return F1.jsx("div",{"data-handleid":I,"data-nodeid":k,"data-handlepos":U,"data-id":`${C}-${k}-${I}-${Q}`,className:y0(["react-flow__handle",`react-flow__handle-${U}`,"nodrag",P,T,{source:!D,target:D,connectable:K,connectablestart:X,connectableend:W,clickconnecting:E,connectingfrom:v,connectingto:b,valid:_1,connectionindicator:K&&(!a||p)&&(a||m?W:X)}]),onMouseDown:J1,onTouchStart:J1,onClick:h?y:void 0,ref:f,...M,children:O})}var mq=K1.memo(vT(CS));function SS({data:Q,isConnectable:U,sourcePosition:Z=C1.Bottom}){return F1.jsxs(F1.Fragment,{children:[Q?.label,F1.jsx(mq,{type:"source",position:Z,isConnectable:U})]})}function jS({data:Q,isConnectable:U,targetPosition:Z=C1.Top,sourcePosition:K=C1.Bottom}){return F1.jsxs(F1.Fragment,{children:[F1.jsx(mq,{type:"target",position:Z,isConnectable:U}),Q?.label,F1.jsx(mq,{type:"source",position:K,isConnectable:U})]})}function VS(){return null}function kS({data:Q,isConnectable:U,targetPosition:Z=C1.Top}){return F1.jsxs(F1.Fragment,{children:[F1.jsx(mq,{type:"target",position:Z,isConnectable:U}),Q?.label]})}var gq={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},zT={input:SS,default:jS,output:kS,group:VS};function DS(Q){if(Q.internals.handleBounds===void 0)return{width:Q.width??Q.initialWidth??Q.style?.width,height:Q.height??Q.initialHeight??Q.style?.height};return{width:Q.width??Q.style?.width,height:Q.height??Q.style?.height}}var yS=(Q)=>{let{width:U,height:Z,x:K,y:X}=f8(Q.nodeLookup,{filter:(W)=>!!W.selected});return{width:k5(U)?U:null,height:k5(Z)?Z:null,userSelectionActive:Q.userSelectionActive,transformString:`translate(${Q.transform[0]}px,${Q.transform[1]}px) scale(${Q.transform[2]}) translate(${K}px,${X}px)`}};function vS({onSelectionContextMenu:Q,noPanClassName:U,disableKeyboardA11y:Z}){let K=C0(),{width:X,height:W,transformString:z,userSelectionActive:B}=G0(yS,N0),O=xT(),T=K1.useRef(null);K1.useEffect(()=>{if(!Z)T.current?.focus({preventScroll:!0})},[Z]);let R=!B&&X!==null&&W!==null;if(uT({nodeRef:T,disabled:!R}),!R)return null;let L=Q?(f)=>{let I=K.getState().nodes.filter((D)=>D.selected);Q(f,I)}:void 0,M=(f)=>{if(Object.prototype.hasOwnProperty.call(gq,f.key))f.preventDefault(),O({direction:gq[f.key],factor:f.shiftKey?4:1})};return F1.jsx("div",{className:y0(["react-flow__nodesselection","react-flow__container",U]),style:{transform:z},children:F1.jsx("div",{ref:T,className:"react-flow__nodesselection-rect",onContextMenu:L,tabIndex:Z?void 0:-1,onKeyDown:Z?void 0:M,style:{width:X,height:W}})})}var BT=typeof window<"u"?window:void 0,ES=(Q)=>{return{nodesSelectionActive:Q.nodesSelectionActive,userSelectionActive:Q.userSelectionActive}};function mT({children:Q,onPaneClick:U,onPaneMouseEnter:Z,onPaneMouseMove:K,onPaneMouseLeave:X,onPaneContextMenu:W,onPaneScroll:z,paneClickDistance:B,deleteKeyCode:O,selectionKeyCode:T,selectionOnDrag:R,selectionMode:L,onSelectionStart:M,onSelectionEnd:f,multiSelectionKeyCode:I,panActivationKeyCode:D,zoomActivationKeyCode:V,elementsSelectable:k,zoomOnScroll:h,zoomOnPinch:P,panOnScroll:C,panOnScrollSpeed:v,panOnScrollMode:b,zoomOnDoubleClick:E,panOnDrag:p,autoPanOnSelection:a,defaultViewport:m,translateExtent:_1,minZoom:$1,maxZoom:J1,preventScrolling:y,onSelectionContextMenu:u,noWheelClassName:x,noPanClassName:d,disableKeyboardA11y:g,onViewportChange:n,isControlledViewport:j}){let{nodesSelectionActive:i,userSelectionActive:q1}=G0(ES,N0),Q1=RJ(T,{target:BT}),Y1=RJ(D,{target:BT}),L1=Y1||p,M1=Y1||C,I1=R&&L1!==!0,X1=Q1||q1||I1;return YS({deleteKeyCode:O,multiSelectionKeyCode:I}),F1.jsx(BS,{onPaneContextMenu:W,elementsSelectable:k,zoomOnScroll:h,zoomOnPinch:P,panOnScroll:M1,panActivationKeyPressed:Y1,panOnScrollSpeed:v,panOnScrollMode:b,zoomOnDoubleClick:E,panOnDrag:!Q1&&L1,defaultViewport:m,translateExtent:_1,minZoom:$1,maxZoom:J1,zoomActivationKeyCode:V,preventScrolling:y,noWheelClassName:x,noPanClassName:d,onViewportChange:n,isControlledViewport:j,paneClickDistance:B,selectionOnDrag:I1,children:F1.jsxs(TS,{onSelectionStart:M,onSelectionEnd:f,onPaneClick:U,onPaneMouseEnter:Z,onPaneMouseMove:K,onPaneMouseLeave:X,onPaneContextMenu:W,onPaneScroll:z,panOnDrag:L1,autoPanOnSelection:a,isSelecting:!!X1,selectionMode:L,selectionKeyPressed:Q1,paneClickDistance:B,selectionOnDrag:I1,children:[Q,i&&F1.jsx(vS,{onSelectionContextMenu:u,noPanClassName:d,disableKeyboardA11y:g})]})})}mT.displayName="FlowRenderer";var bS=K1.memo(mT),uS=(Q)=>(U)=>{return Q?Pq(U.nodeLookup,{x:0,y:0,width:U.width,height:U.height},U.transform,!0).map((Z)=>Z.id):Array.from(U.nodeLookup.keys())};function xS(Q){return G0(K1.useCallback(uS(Q),[Q]),N0)}var hS=(Q)=>Q.updateNodeInternals;function mS(){let Q=G0(hS),[U]=K1.useState(()=>{if(typeof ResizeObserver>"u")return null;return new ResizeObserver((Z)=>{let K=new Map;Z.forEach((X)=>{let W=X.target.getAttribute("data-id");K.set(W,{id:W,nodeElement:X.target,force:!0})}),Q(K)})});return K1.useEffect(()=>{return()=>{U?.disconnect()}},[U]),U}function gS({node:Q,nodeType:U,hasDimensions:Z,resizeObserver:K}){let X=C0(),W=K1.useRef(null),z=K1.useRef(null),B=K1.useRef(Q.sourcePosition),O=K1.useRef(Q.targetPosition),T=K1.useRef(U),R=Z&&!!Q.internals.handleBounds;return K1.useEffect(()=>{if(W.current&&!Q.hidden&&(!R||z.current!==W.current)){if(z.current)K?.unobserve(z.current);K?.observe(W.current),z.current=W.current}},[R,Q.hidden]),K1.useEffect(()=>{return()=>{if(z.current)K?.unobserve(z.current),z.current=null}},[]),K1.useEffect(()=>{if(W.current){let L=T.current!==U,M=B.current!==Q.sourcePosition,f=O.current!==Q.targetPosition;if(L||M||f)T.current=U,B.current=Q.sourcePosition,O.current=Q.targetPosition,X.getState().updateNodeInternals(new Map([[Q.id,{id:Q.id,nodeElement:W.current,force:!0}]]))}},[Q.id,U,Q.sourcePosition,Q.targetPosition]),W}function pS({id:Q,onClick:U,onMouseEnter:Z,onMouseMove:K,onMouseLeave:X,onContextMenu:W,onDoubleClick:z,nodesDraggable:B,elementsSelectable:O,nodesConnectable:T,nodesFocusable:R,resizeObserver:L,noDragClassName:M,noPanClassName:f,disableKeyboardA11y:I,rfId:D,nodeTypes:V,nodeClickDistance:k,onError:h}){let{node:P,internals:C,isParent:v}=G0((X1)=>{let f1=X1.nodeLookup.get(Q),l1=X1.parentLookup.has(Q);return{node:f1,internals:f1.internals,isParent:l1}},N0),b=P.type||"default",E=V?.[b]||zT[b];if(E===void 0)h?.("003",x2.error003(b)),b="default",E=V?.default||zT.default;let p=!!(P.draggable||B&&typeof P.draggable>"u"),a=!!(P.selectable||O&&typeof P.selectable>"u"),m=!!(P.connectable||T&&typeof P.connectable>"u"),_1=!!(P.focusable||R&&typeof P.focusable>"u"),$1=C0(),J1=XX(P),y=gS({node:P,nodeType:b,hasDimensions:J1,resizeObserver:L}),u=uT({nodeRef:y,disabled:P.hidden||!p,noDragClassName:M,handleSelector:P.dragHandle,nodeId:Q,isSelectable:a,nodeClickDistance:k}),x=xT();if(P.hidden)return null;let d=y5(P),g=DS(P),n=a||p||U||Z||K||X,j=Z?(X1)=>Z(X1,{...C.userNode}):void 0,i=K?(X1)=>K(X1,{...C.userNode}):void 0,q1=X?(X1)=>X(X1,{...C.userNode}):void 0,Q1=W?(X1)=>W(X1,{...C.userNode}):void 0,Y1=z?(X1)=>z(X1,{...C.userNode}):void 0,L1=(X1)=>{let{selectNodesOnDrag:f1,nodeDragThreshold:l1}=$1.getState();if(a&&(!f1||!p||l1>0))SX({id:Q,store:$1,nodeRef:y});if(U)U(X1,{...C.userNode})},M1=(X1)=>{if(BX(X1.nativeEvent)||I)return;if(_X.includes(X1.key)&&a){let f1=X1.key==="Escape";SX({id:Q,store:$1,unselect:f1,nodeRef:y})}else if(p&&P.selected&&Object.prototype.hasOwnProperty.call(gq,X1.key)){X1.preventDefault();let{ariaLabelConfig:f1}=$1.getState();$1.setState({ariaLiveMessage:f1["node.a11yDescription.ariaLiveMessage"]({direction:X1.key.replace("Arrow","").toLowerCase(),x:~~C.positionAbsolute.x,y:~~C.positionAbsolute.y})}),x({direction:gq[X1.key],factor:X1.shiftKey?4:1})}},I1=()=>{if(I||!y.current?.matches(":focus-visible"))return;let{transform:X1,width:f1,height:l1,autoPanOnNodeFocus:W1,setCenter:S1}=$1.getState();if(!W1)return;if(!(Pq(new Map([[Q,P]]),{x:0,y:0,width:f1,height:l1},X1,!0).length>0))S1(P.position.x+d.width/2,P.position.y+d.height/2,{zoom:X1[2]})};return F1.jsx("div",{className:y0(["react-flow__node",`react-flow__node-${b}`,{[f]:p},P.className,{selected:P.selected,selectable:a,parent:v,draggable:p,dragging:u}]),ref:y,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:n?"all":"none",visibility:J1?"visible":"hidden",...P.style,...g},"data-id":Q,"data-testid":`rf__node-${Q}`,onMouseEnter:j,onMouseMove:i,onMouseLeave:q1,onContextMenu:Q1,onClick:L1,onDoubleClick:Y1,onKeyDown:_1?M1:void 0,tabIndex:_1?0:void 0,onFocus:_1?I1:void 0,role:P.ariaRole??(_1?"group":void 0),"aria-roledescription":"node","aria-describedby":I?void 0:`${jT}-${D}`,"aria-label":P.ariaLabel,...P.domAttributes,children:F1.jsx(OS,{value:Q,children:F1.jsx(E,{id:Q,data:P.data,type:b,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:P.selected??!1,selectable:a,draggable:p,deletable:P.deletable??!0,isConnectable:m,sourcePosition:P.sourcePosition,targetPosition:P.targetPosition,dragging:u,dragHandle:P.dragHandle,zIndex:C.z,parentId:P.parentId,...d})})})}var cS=K1.memo(pS),lS=(Q)=>({nodesConnectable:Q.nodesConnectable,nodesFocusable:Q.nodesFocusable,elementsSelectable:Q.elementsSelectable,onError:Q.onError});function gT(Q){let{nodesConnectable:U,nodesFocusable:Z,elementsSelectable:K,onError:X}=G0(lS,N0),W=xS(Q.onlyRenderVisibleElements),z=mS();return F1.jsx("div",{className:"react-flow__nodes",style:cq,children:W.map((B)=>{return F1.jsx(cS,{id:B,nodeTypes:Q.nodeTypes,nodeExtent:Q.nodeExtent,onClick:Q.onNodeClick,onMouseEnter:Q.onNodeMouseEnter,onMouseMove:Q.onNodeMouseMove,onMouseLeave:Q.onNodeMouseLeave,onContextMenu:Q.onNodeContextMenu,onDoubleClick:Q.onNodeDoubleClick,noDragClassName:Q.noDragClassName,noPanClassName:Q.noPanClassName,rfId:Q.rfId,disableKeyboardA11y:Q.disableKeyboardA11y,resizeObserver:z,nodesDraggable:Q.nodesDraggable??!0,nodesConnectable:U,nodesFocusable:Z,elementsSelectable:K,nodeClickDistance:Q.nodeClickDistance,onError:X},B)})})}gT.displayName="NodeRenderer";var rS=K1.memo(gT);function dS(Q){return G0(K1.useCallback((Z)=>{if(!Q)return Z.edges.map((X)=>X.id);let K=[];if(Z.width&&Z.height)for(let X of Z.edges){let W=Z.nodeLookup.get(X.source),z=Z.nodeLookup.get(X.target);if(W&&z&&IM({sourceNode:W,targetNode:z,width:Z.width,height:Z.height,transform:Z.transform}))K.push(X.id)}return K},[Q]),N0)}var iS=({color:Q="none",strokeWidth:U=1})=>{let Z={strokeWidth:U,...Q&&{stroke:Q}};return F1.jsx("polyline",{className:"arrow",style:Z,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},aS=({color:Q="none",strokeWidth:U=1})=>{let Z={strokeWidth:U,...Q&&{stroke:Q,fill:Q}};return F1.jsx("polyline",{className:"arrowclosed",style:Z,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},AT={[i7.Arrow]:iS,[i7.ArrowClosed]:aS};function sS(Q){let U=C0();return K1.useMemo(()=>{if(!Object.prototype.hasOwnProperty.call(AT,Q))return U.getState().onError?.("009",x2.error009(Q)),null;return AT[Q]},[Q])}var tS=({id:Q,type:U,color:Z,width:K=12.5,height:X=12.5,markerUnits:W="strokeWidth",strokeWidth:z,orient:B="auto-start-reverse"})=>{let O=sS(U);if(!O)return null;return F1.jsx("marker",{className:"react-flow__arrowhead",id:Q,markerWidth:`${K}`,markerHeight:`${X}`,viewBox:"-10 -10 20 20",markerUnits:W,orient:B,refX:"0",refY:"0",children:F1.jsx(O,{color:Z,strokeWidth:z})})},pT=({defaultColor:Q,rfId:U})=>{let Z=G0((W)=>W.edges),K=G0((W)=>W.defaultEdgeOptions),X=K1.useMemo(()=>{return NM(Z,{id:U,defaultColor:Q,defaultMarkerStart:K?.markerStart,defaultMarkerEnd:K?.markerEnd})},[Z,K,U,Q]);if(!X.length)return null;return F1.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:F1.jsx("defs",{children:X.map((W)=>F1.jsx(tS,{id:W.id,type:W.type,color:W.color,width:W.width,height:W.height,markerUnits:W.markerUnits,strokeWidth:W.strokeWidth,orient:W.orient},W.id))})})};pT.displayName="MarkerDefinitions";var oS=K1.memo(pT);function cT({x:Q,y:U,label:Z,labelStyle:K,labelShowBg:X=!0,labelBgStyle:W,labelBgPadding:z=[2,4],labelBgBorderRadius:B=2,children:O,className:T,...R}){let[L,M]=K1.useState({x:1,y:0,width:0,height:0}),f=y0(["react-flow__edge-textwrapper",T]),I=K1.useRef(null);if(K1.useEffect(()=>{if(I.current){let D=I.current.getBBox();M({x:D.x,y:D.y,width:D.width,height:D.height})}},[Z]),!Z)return null;return F1.jsxs("g",{transform:`translate(${Q-L.width/2} ${U-L.height/2})`,className:f,visibility:L.width?"visible":"hidden",...R,children:[X&&F1.jsx("rect",{width:L.width+2*z[0],x:-z[0],y:-z[1],height:L.height+2*z[1],className:"react-flow__edge-textbg",style:W,rx:B,ry:B}),F1.jsx("text",{className:"react-flow__edge-text",y:L.height/2,dy:"0.3em",ref:I,style:K,children:Z}),O]})}cT.displayName="EdgeText";var nS=K1.memo(cT);function lq({path:Q,labelX:U,labelY:Z,label:K,labelStyle:X,labelShowBg:W,labelBgStyle:z,labelBgPadding:B,labelBgBorderRadius:O,interactionWidth:T=20,...R}){return F1.jsxs(F1.Fragment,{children:[F1.jsx("path",{...R,d:Q,fill:"none",className:y0(["react-flow__edge-path",R.className])}),T?F1.jsx("path",{d:Q,fill:"none",strokeOpacity:0,strokeWidth:T,className:"react-flow__edge-interaction"}):null,K&&k5(U)&&k5(Z)?F1.jsx(nS,{x:U,y:Z,label:K,labelStyle:X,labelShowBg:W,labelBgStyle:z,labelBgPadding:B,labelBgBorderRadius:O}):null]})}function LT({pos:Q,x1:U,y1:Z,x2:K,y2:X}){if(Q===C1.Left||Q===C1.Right)return[0.5*(U+K),Z];return[U,0.5*(Z+X)]}function lT({sourceX:Q,sourceY:U,sourcePosition:Z=C1.Bottom,targetX:K,targetY:X,targetPosition:W=C1.Top}){let[z,B]=LT({pos:Z,x1:Q,y1:U,x2:K,y2:X}),[O,T]=LT({pos:W,x1:K,y1:X,x2:Q,y2:U}),[R,L,M,f]=Vq({sourceX:Q,sourceY:U,targetX:K,targetY:X,sourceControlX:z,sourceControlY:B,targetControlX:O,targetControlY:T});return[`M${Q},${U} C${z},${B} ${O},${T} ${K},${X}`,R,L,M,f]}function rT(Q){return K1.memo(({id:U,sourceX:Z,sourceY:K,targetX:X,targetY:W,sourcePosition:z,targetPosition:B,label:O,labelStyle:T,labelShowBg:R,labelBgStyle:L,labelBgPadding:M,labelBgBorderRadius:f,style:I,markerEnd:D,markerStart:V,interactionWidth:k})=>{let[h,P,C]=lT({sourceX:Z,sourceY:K,sourcePosition:z,targetX:X,targetY:W,targetPosition:B}),v=Q.isInternal?void 0:U;return F1.jsx(lq,{id:v,path:h,labelX:P,labelY:C,label:O,labelStyle:T,labelShowBg:R,labelBgStyle:L,labelBgPadding:M,labelBgBorderRadius:f,style:I,markerEnd:D,markerStart:V,interactionWidth:k})})}var eS=rT({isInternal:!1}),dT=rT({isInternal:!0});eS.displayName="SimpleBezierEdge";dT.displayName="SimpleBezierEdgeInternal";function iT(Q){return K1.memo(({id:U,sourceX:Z,sourceY:K,targetX:X,targetY:W,label:z,labelStyle:B,labelShowBg:O,labelBgStyle:T,labelBgPadding:R,labelBgBorderRadius:L,style:M,sourcePosition:f=C1.Bottom,targetPosition:I=C1.Top,markerEnd:D,markerStart:V,pathOptions:k,interactionWidth:h})=>{let[P,C,v]=TJ({sourceX:Z,sourceY:K,sourcePosition:f,targetX:X,targetY:W,targetPosition:I,borderRadius:k?.borderRadius,offset:k?.offset,stepPosition:k?.stepPosition}),b=Q.isInternal?void 0:U;return F1.jsx(lq,{id:b,path:P,labelX:C,labelY:v,label:z,labelStyle:B,labelShowBg:O,labelBgStyle:T,labelBgPadding:R,labelBgBorderRadius:L,style:M,markerEnd:D,markerStart:V,interactionWidth:h})})}var aT=iT({isInternal:!1}),sT=iT({isInternal:!0});aT.displayName="SmoothStepEdge";sT.displayName="SmoothStepEdgeInternal";function tT(Q){return K1.memo(({id:U,...Z})=>{let K=Q.isInternal?void 0:U;return F1.jsx(aT,{...Z,id:K,pathOptions:K1.useMemo(()=>({borderRadius:0,offset:Z.pathOptions?.offset}),[Z.pathOptions?.offset])})})}var _j=tT({isInternal:!1}),oT=tT({isInternal:!0});_j.displayName="StepEdge";oT.displayName="StepEdgeInternal";function nT(Q){return K1.memo(({id:U,sourceX:Z,sourceY:K,targetX:X,targetY:W,label:z,labelStyle:B,labelShowBg:O,labelBgStyle:T,labelBgPadding:R,labelBgBorderRadius:L,style:M,markerEnd:f,markerStart:I,interactionWidth:D})=>{let[V,k,h]=Dq({sourceX:Z,sourceY:K,targetX:X,targetY:W}),P=Q.isInternal?void 0:U;return F1.jsx(lq,{id:P,path:V,labelX:k,labelY:h,label:z,labelStyle:B,labelShowBg:O,labelBgStyle:T,labelBgPadding:R,labelBgBorderRadius:L,style:M,markerEnd:f,markerStart:I,interactionWidth:D})})}var Jj=nT({isInternal:!1}),eT=nT({isInternal:!0});Jj.displayName="StraightEdge";eT.displayName="StraightEdgeInternal";function _R(Q){return K1.memo(({id:U,sourceX:Z,sourceY:K,targetX:X,targetY:W,sourcePosition:z=C1.Bottom,targetPosition:B=C1.Top,label:O,labelStyle:T,labelShowBg:R,labelBgStyle:L,labelBgPadding:M,labelBgBorderRadius:f,style:I,markerEnd:D,markerStart:V,pathOptions:k,interactionWidth:h})=>{let[P,C,v]=kq({sourceX:Z,sourceY:K,sourcePosition:z,targetX:X,targetY:W,targetPosition:B,curvature:k?.curvature}),b=Q.isInternal?void 0:U;return F1.jsx(lq,{id:b,path:P,labelX:C,labelY:v,label:O,labelStyle:T,labelShowBg:R,labelBgStyle:L,labelBgPadding:M,labelBgBorderRadius:f,style:I,markerEnd:D,markerStart:V,interactionWidth:h})})}var $j=_R({isInternal:!1}),JR=_R({isInternal:!0});$j.displayName="BezierEdge";JR.displayName="BezierEdgeInternal";var MT={default:JR,straight:eT,step:oT,smoothstep:sT,simplebezier:dT},TT={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},Qj=(Q,U,Z)=>{if(Z===C1.Left)return Q-U;if(Z===C1.Right)return Q+U;return Q},qj=(Q,U,Z)=>{if(Z===C1.Top)return Q-U;if(Z===C1.Bottom)return Q+U;return Q},RT="react-flow__edgeupdater";function OT({position:Q,centerX:U,centerY:Z,radius:K=10,onMouseDown:X,onMouseEnter:W,onMouseOut:z,type:B}){return F1.jsx("circle",{onMouseDown:X,onMouseEnter:W,onMouseOut:z,className:y0([RT,`${RT}-${B}`]),cx:Qj(U,K,Q),cy:qj(Z,K,Q),r:K,stroke:"transparent",fill:"transparent"})}function Uj({isReconnectable:Q,reconnectRadius:U,edge:Z,sourceX:K,sourceY:X,targetX:W,targetY:z,sourcePosition:B,targetPosition:O,onReconnect:T,onReconnectStart:R,onReconnectEnd:L,setReconnecting:M,setUpdateHover:f}){let I=C0(),D=(C,v)=>{if(C.button!==0)return;let{autoPanOnConnect:b,domNode:E,connectionMode:p,connectionRadius:a,lib:m,onConnectStart:_1,cancelConnection:$1,nodeLookup:J1,rfId:y,panBy:u,updateConnection:x}=I.getState(),d=v.type==="target",g=(i,q1)=>{M(!1),L?.(i,Z,v.type,q1)},n=(i)=>T?.(Z,i),j=(i,q1)=>{M(!0),R?.(C,Z,v.type),_1?.(i,q1)};bq.onPointerDown(C.nativeEvent,{autoPanOnConnect:b,connectionMode:p,connectionRadius:a,domNode:E,handleId:v.id,nodeId:v.nodeId,nodeLookup:J1,isTarget:d,edgeUpdaterType:v.type,lib:m,flowId:y,cancelConnection:$1,panBy:u,isValidConnection:(...i)=>I.getState().isValidConnection?.(...i)??!0,onConnect:n,onConnectStart:j,onConnectEnd:(...i)=>I.getState().onConnectEnd?.(...i),onReconnectEnd:g,updateConnection:x,getTransform:()=>I.getState().transform,getFromHandle:()=>I.getState().connection.fromHandle,dragThreshold:I.getState().connectionDragThreshold,handleDomNode:C.currentTarget})},V=(C)=>D(C,{nodeId:Z.target,id:Z.targetHandle??null,type:"target"}),k=(C)=>D(C,{nodeId:Z.source,id:Z.sourceHandle??null,type:"source"}),h=()=>f(!0),P=()=>f(!1);return F1.jsxs(F1.Fragment,{children:[(Q===!0||Q==="source")&&F1.jsx(OT,{position:B,centerX:K,centerY:X,radius:U,onMouseDown:V,onMouseEnter:h,onMouseOut:P,type:"source"}),(Q===!0||Q==="target")&&F1.jsx(OT,{position:O,centerX:W,centerY:z,radius:U,onMouseDown:k,onMouseEnter:h,onMouseOut:P,type:"target"})]})}function Gj({id:Q,edgesFocusable:U,edgesReconnectable:Z,elementsSelectable:K,onClick:X,onDoubleClick:W,onContextMenu:z,onMouseEnter:B,onMouseMove:O,onMouseLeave:T,reconnectRadius:R,onReconnect:L,onReconnectStart:M,onReconnectEnd:f,rfId:I,edgeTypes:D,noPanClassName:V,onError:k,disableKeyboardA11y:h}){let P=G0((S1)=>S1.edgeLookup.get(Q)),C=G0((S1)=>S1.defaultEdgeOptions);P=C?{...C,...P}:P;let v=P.type||"default",b=D?.[v]||MT[v];if(b===void 0)k?.("011",x2.error011(v)),v="default",b=D?.default||MT.default;let E=!!(P.focusable||U&&typeof P.focusable>"u"),p=typeof L<"u"&&(P.reconnectable||Z&&typeof P.reconnectable>"u"),a=!!(P.selectable||K&&typeof P.selectable>"u"),m=K1.useRef(null),[_1,$1]=K1.useState(!1),[J1,y]=K1.useState(!1),u=C0(),{zIndex:x=P.zIndex,sourceX:d,sourceY:g,targetX:n,targetY:j,sourcePosition:i,targetPosition:q1}=G0(K1.useCallback((S1)=>{let v1=S1.nodeLookup.get(P.source),c1=S1.nodeLookup.get(P.target);if(!v1||!c1)return TT;let E1=PM({id:Q,sourceNode:v1,targetNode:c1,sourceHandle:P.sourceHandle||null,targetHandle:P.targetHandle||null,connectionMode:S1.connectionMode,onError:k}),j1=wM({selected:P.selected,zIndex:P.zIndex,sourceNode:v1,targetNode:c1,elevateOnSelect:S1.elevateEdgesOnSelect,zIndexMode:S1.zIndexMode});return{...E1||TT,zIndex:j1}},[P.source,P.target,P.sourceHandle,P.targetHandle,P.selected,P.zIndex,k]),N0),Q1=K1.useMemo(()=>P.markerStart?`url('#${yq(P.markerStart,I)}')`:void 0,[P.markerStart,I]),Y1=K1.useMemo(()=>P.markerEnd?`url('#${yq(P.markerEnd,I)}')`:void 0,[P.markerEnd,I]);if(P.hidden||d===null||g===null||n===null||j===null)return null;let L1=(S1)=>{let{addSelectedEdges:v1,unselectNodesAndEdges:c1,multiSelectionActive:E1}=u.getState();if(a)if(u.setState({nodesSelectionActive:!1}),P.selected&&E1)c1({nodes:[],edges:[P]}),m.current?.blur();else v1([Q]);if(X)X(S1,P)},M1=W?(S1)=>{W(S1,{...P})}:void 0,I1=z?(S1)=>{z(S1,{...P})}:void 0,X1=B?(S1)=>{B(S1,{...P})}:void 0,f1=O?(S1)=>{O(S1,{...P})}:void 0,l1=T?(S1)=>{T(S1,{...P})}:void 0,W1=(S1)=>{if(!h&&_X.includes(S1.key)&&a){let{unselectNodesAndEdges:v1,addSelectedEdges:c1}=u.getState();if(S1.key==="Escape")m.current?.blur(),v1({edges:[P]});else c1([Q])}};return F1.jsx("svg",{style:{zIndex:x},children:F1.jsxs("g",{className:y0(["react-flow__edge",`react-flow__edge-${v}`,P.className,V,{selected:P.selected,animated:P.animated,inactive:!a&&!X,updating:_1,selectable:a}]),onClick:L1,onDoubleClick:M1,onContextMenu:I1,onMouseEnter:X1,onMouseMove:f1,onMouseLeave:l1,onKeyDown:E?W1:void 0,tabIndex:E?0:void 0,role:P.ariaRole??(E?"group":"img"),"aria-roledescription":"edge","data-id":Q,"data-testid":`rf__edge-${Q}`,"aria-label":P.ariaLabel===null?void 0:P.ariaLabel||`Edge from ${P.source} to ${P.target}`,"aria-describedby":E?`${VT}-${I}`:void 0,ref:m,...P.domAttributes,children:[!J1&&F1.jsx(b,{id:Q,source:P.source,target:P.target,type:P.type,selected:P.selected,animated:P.animated,selectable:a,deletable:P.deletable??!0,label:P.label,labelStyle:P.labelStyle,labelShowBg:P.labelShowBg,labelBgStyle:P.labelBgStyle,labelBgPadding:P.labelBgPadding,labelBgBorderRadius:P.labelBgBorderRadius,sourceX:d,sourceY:g,targetX:n,targetY:j,sourcePosition:i,targetPosition:q1,data:P.data,style:P.style,sourceHandleId:P.sourceHandle,targetHandleId:P.targetHandle,markerStart:Q1,markerEnd:Y1,pathOptions:"pathOptions"in P?P.pathOptions:void 0,interactionWidth:P.interactionWidth}),p&&F1.jsx(Uj,{edge:P,isReconnectable:p,reconnectRadius:R,onReconnect:L,onReconnectStart:M,onReconnectEnd:f,sourceX:d,sourceY:g,targetX:n,targetY:j,sourcePosition:i,targetPosition:q1,setUpdateHover:$1,setReconnecting:y})]})})}var Zj=K1.memo(Gj),Fj=(Q)=>({edgesFocusable:Q.edgesFocusable,edgesReconnectable:Q.edgesReconnectable,elementsSelectable:Q.elementsSelectable,connectionMode:Q.connectionMode,onError:Q.onError});function $R({defaultMarkerColor:Q,onlyRenderVisibleElements:U,rfId:Z,edgeTypes:K,noPanClassName:X,onReconnect:W,onEdgeContextMenu:z,onEdgeMouseEnter:B,onEdgeMouseMove:O,onEdgeMouseLeave:T,onEdgeClick:R,reconnectRadius:L,onEdgeDoubleClick:M,onReconnectStart:f,onReconnectEnd:I,disableKeyboardA11y:D}){let{edgesFocusable:V,edgesReconnectable:k,elementsSelectable:h,onError:P}=G0(Fj,N0),C=dS(U);return F1.jsxs("div",{className:"react-flow__edges",children:[F1.jsx(oS,{defaultColor:Q,rfId:Z}),C.map((v)=>{return F1.jsx(Zj,{id:v,edgesFocusable:V,edgesReconnectable:k,elementsSelectable:h,noPanClassName:X,onReconnect:W,onContextMenu:z,onMouseEnter:B,onMouseMove:O,onMouseLeave:T,onClick:R,reconnectRadius:L,onDoubleClick:M,onReconnectStart:f,onReconnectEnd:I,rfId:Z,onError:P,edgeTypes:K,disableKeyboardA11y:D},v)})]})}$R.displayName="EdgeRenderer";var Kj=K1.memo($R),wT=(Q)=>`translate(${Q[0]}px,${Q[1]}px) scale(${Q[2]})`;function Xj({children:Q}){let U=C0(),Z=K1.useRef(null),[K]=K1.useState(()=>U.getState().transform);return ET(()=>{let X=null,W=()=>{let z=U.getState().transform;if(X&&z[0]===X[0]&&z[1]===X[1]&&z[2]===X[2])return;if(X=z,Z.current)Z.current.style.transform=wT(z)};return W(),U.subscribe(W)},[U]),F1.jsx("div",{ref:Z,className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:wT(K)},children:Q})}function Hj(Q){let U=OJ(),Z=K1.useRef(!1);K1.useEffect(()=>{if(!Z.current&&U.viewportInitialized&&Q)setTimeout(()=>Q(U),1),Z.current=!0},[Q,U.viewportInitialized])}var Yj=(Q)=>Q.panZoom?.syncViewport;function Wj(Q){let U=G0(Yj),Z=C0();return K1.useEffect(()=>{if(Q)U?.(Q),Z.setState({transform:[Q.x,Q.y,Q.zoom]})},[Q,U]),null}function IT(Q){return Q.connection.inProgress?{...Q.connection,to:n7(Q.connection.to,Q.transform)}:{...Q.connection}}function zj(Q){if(Q)return(Z)=>{let K=IT(Z);return Q(K)};return IT}function Bj(Q){let U=zj(Q);return G0(U,N0)}var Aj=(Q)=>({nodesConnectable:Q.nodesConnectable,isValid:Q.connection.isValid,inProgress:Q.connection.inProgress,width:Q.width,height:Q.height});function Lj({containerStyle:Q,style:U,type:Z,component:K}){let{nodesConnectable:X,width:W,height:z,isValid:B,inProgress:O}=G0(Aj,N0);if(!(W&&X&&O))return null;return F1.jsx("svg",{style:Q,width:W,height:z,className:"react-flow__connectionline react-flow__container",children:F1.jsx("g",{className:y0(["react-flow__connection",WX(B)]),children:F1.jsx(QR,{style:U,type:Z,CustomComponent:K,isValid:B})})})}var QR=({style:Q,type:U=y4.Bezier,CustomComponent:Z,isValid:K})=>{let{inProgress:X,from:W,fromNode:z,fromHandle:B,fromPosition:O,to:T,toNode:R,toHandle:L,toPosition:M,pointer:f}=Bj();if(!X)return;if(Z)return F1.jsx(Z,{connectionLineType:U,connectionLineStyle:Q,fromNode:z,fromHandle:B,fromX:W.x,fromY:W.y,toX:T.x,toY:T.y,fromPosition:O,toPosition:M,connectionStatus:WX(K),toNode:R,toHandle:L,pointer:f});let I="",D={sourceX:W.x,sourceY:W.y,sourcePosition:O,targetX:T.x,targetY:T.y,targetPosition:M};switch(U){case y4.Bezier:[I]=kq(D);break;case y4.SimpleBezier:[I]=lT(D);break;case y4.Step:[I]=TJ({...D,borderRadius:0});break;case y4.SmoothStep:[I]=TJ(D);break;default:[I]=Dq(D)}return F1.jsx("path",{d:I,fill:"none",className:"react-flow__connection-path",style:Q})};QR.displayName="ConnectionLine";var Mj={};function fT(Q=Mj){let U=K1.useRef(Q),Z=C0();K1.useEffect(()=>{{let K=new Set([...Object.keys(U.current),...Object.keys(Q)]);for(let X of K)if(U.current[X]!==Q[X]){Z.getState().onError?.("002",x2.error002());break}U.current=Q}},[Q])}function Tj(){let Q=C0(),U=K1.useRef(!1);K1.useEffect(()=>{if(!U.current){let Z=document.querySelector(".react-flow__pane");if(Z&&window.getComputedStyle(Z).zIndex!=="1")Q.getState().onError?.("013",x2.error013("react"));U.current=!0}},[])}function qR({nodeTypes:Q,edgeTypes:U,onInit:Z,onNodeClick:K,onEdgeClick:X,onNodeDoubleClick:W,onEdgeDoubleClick:z,onNodeMouseEnter:B,onNodeMouseMove:O,onNodeMouseLeave:T,onNodeContextMenu:R,onSelectionContextMenu:L,onSelectionStart:M,onSelectionEnd:f,connectionLineType:I,connectionLineStyle:D,connectionLineComponent:V,connectionLineContainerStyle:k,selectionKeyCode:h,selectionOnDrag:P,selectionMode:C,multiSelectionKeyCode:v,panActivationKeyCode:b,zoomActivationKeyCode:E,deleteKeyCode:p,onlyRenderVisibleElements:a,elementsSelectable:m,defaultViewport:_1,translateExtent:$1,minZoom:J1,maxZoom:y,preventScrolling:u,defaultMarkerColor:x,zoomOnScroll:d,zoomOnPinch:g,panOnScroll:n,panOnScrollSpeed:j,panOnScrollMode:i,zoomOnDoubleClick:q1,panOnDrag:Q1,autoPanOnSelection:Y1,onPaneClick:L1,onPaneMouseEnter:M1,onPaneMouseMove:I1,onPaneMouseLeave:X1,onPaneScroll:f1,onPaneContextMenu:l1,paneClickDistance:W1,nodeClickDistance:S1,onEdgeContextMenu:v1,onEdgeMouseEnter:c1,onEdgeMouseMove:E1,onEdgeMouseLeave:j1,reconnectRadius:V0,onReconnect:b1,onReconnectStart:Z2,onReconnectEnd:_0,noDragClassName:h2,noWheelClassName:z2,noPanClassName:I2,disableKeyboardA11y:f2,nodeExtent:P2,rfId:B2,viewport:A2,onViewportChange:L2,nodesDraggable:M3}){return fT(Q),fT(U),Tj(),Hj(Z),Wj(A2),F1.jsx(bS,{onPaneClick:L1,onPaneMouseEnter:M1,onPaneMouseMove:I1,onPaneMouseLeave:X1,onPaneContextMenu:l1,onPaneScroll:f1,paneClickDistance:W1,deleteKeyCode:p,selectionKeyCode:h,selectionOnDrag:P,selectionMode:C,onSelectionStart:M,onSelectionEnd:f,multiSelectionKeyCode:v,panActivationKeyCode:b,zoomActivationKeyCode:E,elementsSelectable:m,zoomOnScroll:d,zoomOnPinch:g,zoomOnDoubleClick:q1,panOnScroll:n,panOnScrollSpeed:j,panOnScrollMode:i,panOnDrag:Q1,autoPanOnSelection:Y1,defaultViewport:_1,translateExtent:$1,minZoom:J1,maxZoom:y,onSelectionContextMenu:L,preventScrolling:u,noDragClassName:h2,noWheelClassName:z2,noPanClassName:I2,disableKeyboardA11y:f2,onViewportChange:L2,isControlledViewport:!!A2,children:F1.jsxs(Xj,{children:[F1.jsx(Kj,{edgeTypes:U,onEdgeClick:X,onEdgeDoubleClick:z,onReconnect:b1,onReconnectStart:Z2,onReconnectEnd:_0,onlyRenderVisibleElements:a,onEdgeContextMenu:v1,onEdgeMouseEnter:c1,onEdgeMouseMove:E1,onEdgeMouseLeave:j1,reconnectRadius:V0,defaultMarkerColor:x,noPanClassName:I2,disableKeyboardA11y:f2,rfId:B2}),F1.jsx(Lj,{style:D,type:I,component:V,containerStyle:k}),F1.jsx("div",{className:"react-flow__edgelabel-renderer"}),F1.jsx(rS,{nodeTypes:Q,onNodeClick:K,onNodeDoubleClick:W,onNodeMouseEnter:B,onNodeMouseMove:O,onNodeMouseLeave:T,onNodeContextMenu:R,nodeClickDistance:S1,onlyRenderVisibleElements:a,noPanClassName:I2,noDragClassName:h2,disableKeyboardA11y:f2,nodeExtent:P2,rfId:B2,nodesDraggable:M3}),F1.jsx("div",{className:"react-flow__viewport-portal"})]})})}qR.displayName="GraphView";var Rj=K1.memo(qR),Oj=KX("React Flow","https://reactflow.dev/"),PT=({nodes:Q,edges:U,defaultNodes:Z,defaultEdges:K,width:X,height:W,fitView:z,fitViewOptions:B,minZoom:O=0.5,maxZoom:T=2,nodeOrigin:R,nodeExtent:L,zIndexMode:M="basic"}={})=>{let f=new Map,I=new Map,D=new Map,V=new Map,k=K??U??[],h=Z??Q??[],P=R??[0,0],C=L??s7;wX(D,V,k);let{nodesInitialized:v}=vq(h,f,I,{nodeOrigin:P,nodeExtent:C,zIndexMode:M}),b=[0,0,1];if(z&&X&&W){let E=f8(f,{filter:(_1)=>!!((_1.width||_1.initialWidth)&&(_1.height||_1.initialHeight))}),{x:p,y:a,zoom:m}=MJ(E,X,W,O,T,B?.padding??0.1);b=[p,a,m]}return{rfId:"1",width:X??0,height:W??0,transform:b,nodes:h,nodesInitialized:v,nodeLookup:f,parentLookup:I,edges:k,edgeLookup:V,connectionLookup:D,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:Z!==void 0,hasDefaultEdges:K!==void 0,panZoom:null,minZoom:O,maxZoom:T,translateExtent:s7,nodeExtent:C,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:A6.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:P,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:z??!1,fitViewOptions:B,fitViewResolver:null,connection:{...$X},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Oj,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:JX,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}},wj=({nodes:Q,edges:U,defaultNodes:Z,defaultEdges:K,width:X,height:W,fitView:z,fitViewOptions:B,minZoom:O,maxZoom:T,nodeOrigin:R,nodeExtent:L,zIndexMode:M})=>nM((f,I)=>{async function D(){let{nodeLookup:V,panZoom:k,fitViewOptions:h,fitViewResolver:P,width:C,height:v,minZoom:b,maxZoom:E}=I();if(!k)return;await BM({nodes:V,width:C,height:v,panZoom:k,minZoom:b,maxZoom:E},h),P?.resolve(!0),f({fitViewResolver:null})}return{...PT({nodes:Q,edges:U,width:X,height:W,fitView:z,fitViewOptions:B,minZoom:O,maxZoom:T,nodeOrigin:R,nodeExtent:L,defaultNodes:Z,defaultEdges:K,zIndexMode:M}),setNodes:(V)=>{let{nodeLookup:k,parentLookup:h,nodeOrigin:P,nodeExtent:C,elevateNodesOnSelect:v,fitViewQueued:b,zIndexMode:E,nodesSelectionActive:p}=I(),{nodesInitialized:a,hasSelectedNodes:m}=vq(V,k,h,{nodeOrigin:P,nodeExtent:C,elevateNodesOnSelect:v,checkEquality:!0,zIndexMode:E}),_1=p&&m;if(b&&a)D(),f({nodes:V,nodesInitialized:a,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:_1});else f({nodes:V,nodesInitialized:a,nodesSelectionActive:_1})},setEdges:(V)=>{let{connectionLookup:k,edgeLookup:h}=I();wX(k,h,V),f({edges:V})},setDefaultNodesAndEdges:(V,k)=>{if(V){let{setNodes:h}=I();h(V),f({hasDefaultNodes:!0})}if(k){let{setEdges:h}=I();h(k),f({hasDefaultEdges:!0})}},updateNodeInternals:(V)=>{let{triggerNodeChanges:k,nodeLookup:h,parentLookup:P,domNode:C,nodeOrigin:v,nodeExtent:b,debug:E,fitViewQueued:p,zIndexMode:a}=I(),{changes:m,updatedInternals:_1}=kM(V,h,P,C,v,b,a);if(!_1)return;if(jM(h,P,{nodeOrigin:v,nodeExtent:b,zIndexMode:a}),p)D(),f({fitViewQueued:!1,fitViewOptions:void 0});else f({});if(m?.length>0){if(E)console.log("React Flow: trigger node changes",m);k?.(m)}},updateNodePositions:(V,k=!1)=>{let h=[],P=[],{nodeLookup:C,triggerNodeChanges:v,connection:b,updateConnection:E,onNodesChangeMiddlewareMap:p}=I();for(let[a,m]of V){let _1=C.get(a),$1=!!(_1?.expandParent&&_1?.parentId&&m?.position),J1={id:a,type:"position",position:$1?{x:Math.max(0,m.position.x),y:Math.max(0,m.position.y)}:m.position,dragging:k};if(_1&&b.inProgress&&b.fromNode.id===_1.id){let y=L6(_1,b.fromHandle,C1.Left,!0);E({...b,from:y})}if($1&&_1.parentId)h.push({id:a,parentId:_1.parentId,rect:{...m.internals.positionAbsolute,width:m.measured.width??0,height:m.measured.height??0}});P.push(J1)}if(h.length>0){let{parentLookup:a,nodeOrigin:m}=I(),_1=Eq(h,C,a,m);P.push(..._1)}for(let a of p.values())P=a(P);v(P)},triggerNodeChanges:(V)=>{let{onNodesChange:k,setNodes:h,nodes:P,hasDefaultNodes:C,debug:v}=I();if(V?.length){if(C){let b=yT(V,P);h(b)}if(v)console.log("React Flow: trigger node changes",V);k?.(V)}},triggerEdgeChanges:(V)=>{let{onEdgesChange:k,setEdges:h,edges:P,hasDefaultEdges:C,debug:v}=I();if(V?.length){if(C){let b=QS(V,P);h(b)}if(v)console.log("React Flow: trigger edge changes",V);k?.(V)}},addSelectedNodes:(V)=>{let{multiSelectionActive:k,edgeLookup:h,nodeLookup:P,triggerNodeChanges:C,triggerEdgeChanges:v}=I();if(k){let b=V.map((E)=>P8(E,!0));C(b);return}C(_9(P,new Set([...V]),!0)),v(_9(h))},addSelectedEdges:(V)=>{let{multiSelectionActive:k,edgeLookup:h,nodeLookup:P,triggerNodeChanges:C,triggerEdgeChanges:v}=I();if(k){let b=V.map((E)=>P8(E,!0));v(b);return}v(_9(h,new Set([...V]))),C(_9(P,new Set,!0))},unselectNodesAndEdges:({nodes:V,edges:k}={})=>{let{edges:h,nodes:P,nodeLookup:C,triggerNodeChanges:v,triggerEdgeChanges:b}=I(),E=V?V:P,p=k?k:h,a=[];for(let _1 of E){if(!_1.selected)continue;let $1=C.get(_1.id);if($1)$1.selected=!1;a.push(P8(_1.id,!1))}let m=[];for(let _1 of p){if(!_1.selected)continue;m.push(P8(_1.id,!1))}v(a),b(m)},setMinZoom:(V)=>{let{panZoom:k,maxZoom:h}=I();k?.setScaleExtent([V,h]),f({minZoom:V})},setMaxZoom:(V)=>{let{panZoom:k,minZoom:h}=I();k?.setScaleExtent([h,V]),f({maxZoom:V})},setTranslateExtent:(V)=>{I().panZoom?.setTranslateExtent(V),f({translateExtent:V})},resetSelectedElements:()=>{let{edges:V,nodes:k,triggerNodeChanges:h,triggerEdgeChanges:P,elementsSelectable:C}=I();if(!C)return;let v=k.reduce((E,p)=>p.selected?[...E,P8(p.id,!1)]:E,[]),b=V.reduce((E,p)=>p.selected?[...E,P8(p.id,!1)]:E,[]);h(v),P(b)},setNodeExtent:(V)=>{let{nodes:k,nodeLookup:h,parentLookup:P,nodeOrigin:C,elevateNodesOnSelect:v,nodeExtent:b,zIndexMode:E}=I();if(V[0][0]===b[0][0]&&V[0][1]===b[0][1]&&V[1][0]===b[1][0]&&V[1][1]===b[1][1])return;vq(k,h,P,{nodeOrigin:C,nodeExtent:V,elevateNodesOnSelect:v,checkEquality:!1,zIndexMode:E}),f({nodeExtent:V})},panBy:(V)=>{let{transform:k,width:h,height:P,panZoom:C,translateExtent:v}=I();return DM({delta:V,panZoom:C,transform:k,translateExtent:v,width:h,height:P})},setCenter:async(V,k,h)=>{let{width:P,height:C,maxZoom:v,panZoom:b}=I();if(!b)return!1;let E=typeof h?.zoom<"u"?h.zoom:v;return await b.setViewport({x:P/2-V*E,y:C/2-k*E,zoom:E},{duration:h?.duration,ease:h?.ease,interpolate:h?.interpolate}),!0},cancelConnection:()=>{f({connection:{...$X}})},updateConnection:(V)=>{f({connection:V})},reset:()=>f({...PT()})}},Object.is);function kX({initialNodes:Q,initialEdges:U,defaultNodes:Z,defaultEdges:K,initialWidth:X,initialHeight:W,initialMinZoom:z,initialMaxZoom:B,initialFitViewOptions:O,fitView:T,nodeOrigin:R,nodeExtent:L,zIndexMode:M,children:f}){let[I]=K1.useState(()=>wj({nodes:Q,edges:U,defaultNodes:Z,defaultEdges:K,width:X,height:W,fitView:T,minZoom:z,maxZoom:B,fitViewOptions:O,nodeOrigin:R,nodeExtent:L,zIndexMode:M}));return F1.jsx(uC,{value:I,children:F1.jsx(FS,{children:F1.jsx(IS,{children:f})})})}function Ij({children:Q,nodes:U,edges:Z,defaultNodes:K,defaultEdges:X,width:W,height:z,fitView:B,fitViewOptions:O,minZoom:T,maxZoom:R,nodeOrigin:L,nodeExtent:M,zIndexMode:f}){if(K1.useContext(pq))return F1.jsx(F1.Fragment,{children:Q});return F1.jsx(kX,{initialNodes:U,initialEdges:Z,defaultNodes:K,defaultEdges:X,initialWidth:W,initialHeight:z,fitView:B,initialFitViewOptions:O,initialMinZoom:T,initialMaxZoom:R,nodeOrigin:L,nodeExtent:M,zIndexMode:f,children:Q})}var fj={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function Pj({nodes:Q,edges:U,defaultNodes:Z,defaultEdges:K,className:X,nodeTypes:W,edgeTypes:z,onNodeClick:B,onEdgeClick:O,onInit:T,onMove:R,onMoveStart:L,onMoveEnd:M,onConnect:f,onConnectStart:I,onConnectEnd:D,onClickConnectStart:V,onClickConnectEnd:k,onNodeMouseEnter:h,onNodeMouseMove:P,onNodeMouseLeave:C,onNodeContextMenu:v,onNodeDoubleClick:b,onNodeDragStart:E,onNodeDrag:p,onNodeDragStop:a,onNodesDelete:m,onEdgesDelete:_1,onDelete:$1,onSelectionChange:J1,onSelectionDragStart:y,onSelectionDrag:u,onSelectionDragStop:x,onSelectionContextMenu:d,onSelectionStart:g,onSelectionEnd:n,onBeforeDelete:j,connectionMode:i,connectionLineType:q1=y4.Bezier,connectionLineStyle:Q1,connectionLineComponent:Y1,connectionLineContainerStyle:L1,deleteKeyCode:M1="Backspace",selectionKeyCode:I1="Shift",selectionOnDrag:X1=!1,selectionMode:f1=R8.Full,panActivationKeyCode:l1="Space",multiSelectionKeyCode:W1=e7()?"Meta":"Control",zoomActivationKeyCode:S1=e7()?"Meta":"Control",snapToGrid:v1,snapGrid:c1,onlyRenderVisibleElements:E1=!1,selectNodesOnDrag:j1,nodesDraggable:V0,autoPanOnNodeFocus:b1,nodesConnectable:Z2,nodesFocusable:_0,nodeOrigin:h2=kT,edgesFocusable:z2,edgesReconnectable:I2,elementsSelectable:f2=!0,defaultViewport:P2=tC,minZoom:B2=0.5,maxZoom:A2=2,translateExtent:L2=s7,preventScrolling:M3=!0,nodeExtent:v5,defaultMarkerColor:b4="#b1b1b7",zoomOnScroll:u4=!0,zoomOnPinch:x4=!0,panOnScroll:I6=!1,panOnScrollSpeed:e5=0.5,panOnScrollMode:S=B3.Free,zoomOnDoubleClick:e=!0,panOnDrag:A1=!0,onPaneClick:R1,onPaneMouseEnter:P1,onPaneMouseMove:h1,onPaneMouseLeave:m1,onPaneScroll:U0,onPaneContextMenu:V1,paneClickDistance:J2=1,nodeClickDistance:N2=0,children:_4,onReconnect:f6,onReconnectStart:SJ,onReconnectEnd:v8,onEdgeContextMenu:E8,onEdgeDoubleClick:E5,onEdgeMouseEnter:m2,onEdgeMouseMove:jJ,onEdgeMouseLeave:eq,reconnectRadius:G9=10,onNodesChange:VJ,onEdgesChange:b8,noDragClassName:g2="nodrag",noWheelClassName:kJ="nowheel",noPanClassName:u8="nopan",fitView:Z9,fitViewOptions:x8,connectOnClick:DJ,attributionPosition:yJ,proOptions:T3,defaultEdgeOptions:vJ,elevateNodesOnSelect:EJ=!0,elevateEdgesOnSelect:bJ=!1,disableKeyboardA11y:F9=!1,autoPanOnConnect:uJ,autoPanOnNodeDrag:C2,autoPanOnSelection:R3=!0,autoPanSpeed:h4,connectionRadius:xJ,isValidConnection:P6,onError:h8,style:K9,id:O3,nodeDragThreshold:w3,connectionDragThreshold:X9,viewport:_U,onViewportChange:JU,width:hJ,height:H9,colorMode:Y9="light",debug:mJ,onScroll:W9,ariaLabelConfig:gJ,zIndexMode:pJ="basic",...cJ},z9){let I3=O3||"1",N6=_S(Y9),$U=K1.useCallback((B9)=>{B9.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),W9?.(B9)},[W9]);return F1.jsx("div",{"data-testid":"rf__wrapper",...cJ,onScroll:$U,style:{...K9,...fj},ref:z9,className:y0(["react-flow",X,N6]),id:O3,role:"application",children:F1.jsxs(Ij,{nodes:Q,edges:U,width:hJ,height:H9,fitView:Z9,fitViewOptions:x8,minZoom:B2,maxZoom:A2,nodeOrigin:h2,nodeExtent:v5,zIndexMode:pJ,children:[F1.jsx(eC,{nodes:Q,edges:U,defaultNodes:Z,defaultEdges:K,onConnect:f,onConnectStart:I,onConnectEnd:D,onClickConnectStart:V,onClickConnectEnd:k,nodesDraggable:V0,autoPanOnNodeFocus:b1,nodesConnectable:Z2,nodesFocusable:_0,edgesFocusable:z2,edgesReconnectable:I2,elementsSelectable:f2,elevateNodesOnSelect:EJ,elevateEdgesOnSelect:bJ,minZoom:B2,maxZoom:A2,nodeExtent:v5,onNodesChange:VJ,onEdgesChange:b8,snapToGrid:v1,snapGrid:c1,connectionMode:i,translateExtent:L2,connectOnClick:DJ,defaultEdgeOptions:vJ,fitView:Z9,fitViewOptions:x8,onNodesDelete:m,onEdgesDelete:_1,onDelete:$1,onNodeDragStart:E,onNodeDrag:p,onNodeDragStop:a,onSelectionDrag:u,onSelectionDragStart:y,onSelectionDragStop:x,onMove:R,onMoveStart:L,onMoveEnd:M,noPanClassName:u8,nodeOrigin:h2,rfId:I3,autoPanOnConnect:uJ,autoPanOnNodeDrag:C2,autoPanSpeed:h4,onError:h8,connectionRadius:xJ,isValidConnection:P6,selectNodesOnDrag:j1,nodeDragThreshold:w3,connectionDragThreshold:X9,onBeforeDelete:j,debug:mJ,ariaLabelConfig:gJ,zIndexMode:pJ}),F1.jsx(Rj,{onInit:T,onNodeClick:B,onEdgeClick:O,onNodeMouseEnter:h,onNodeMouseMove:P,onNodeMouseLeave:C,onNodeContextMenu:v,onNodeDoubleClick:b,nodeTypes:W,edgeTypes:z,connectionLineType:q1,connectionLineStyle:Q1,connectionLineComponent:Y1,connectionLineContainerStyle:L1,selectionKeyCode:I1,selectionOnDrag:X1,selectionMode:f1,deleteKeyCode:M1,multiSelectionKeyCode:W1,panActivationKeyCode:l1,zoomActivationKeyCode:S1,onlyRenderVisibleElements:E1,defaultViewport:P2,translateExtent:L2,minZoom:B2,maxZoom:A2,preventScrolling:M3,zoomOnScroll:u4,zoomOnPinch:x4,zoomOnDoubleClick:e,panOnScroll:I6,panOnScrollSpeed:e5,panOnScrollMode:S,panOnDrag:A1,autoPanOnSelection:R3,onPaneClick:R1,onPaneMouseEnter:P1,onPaneMouseMove:h1,onPaneMouseLeave:m1,onPaneScroll:U0,onPaneContextMenu:V1,paneClickDistance:J2,nodeClickDistance:N2,onSelectionContextMenu:d,onSelectionStart:g,onSelectionEnd:n,onReconnect:f6,onReconnectStart:SJ,onReconnectEnd:v8,onEdgeContextMenu:E8,onEdgeDoubleClick:E5,onEdgeMouseEnter:m2,onEdgeMouseMove:jJ,onEdgeMouseLeave:eq,reconnectRadius:G9,defaultMarkerColor:b4,noDragClassName:g2,noWheelClassName:kJ,noPanClassName:u8,rfId:I3,disableKeyboardA11y:F9,nodeExtent:v5,viewport:_U,onViewportChange:JU,nodesDraggable:V0}),F1.jsx(sC,{onSelectionChange:J1}),_4,F1.jsx(lC,{proOptions:T3,position:yJ}),F1.jsx(cC,{rfId:I3,disableKeyboardA11y:F9})]})})}var UR=vT(Pj);function GR(Q){let[U,Z]=K1.useState(Q),K=K1.useCallback((X)=>Z((W)=>yT(X,W)),[]);return[U,Z,K]}var Zm=x2.error014();function Nj({dimensions:Q,lineWidth:U,variant:Z,className:K}){return F1.jsx("path",{strokeWidth:U,d:`M${Q[0]/2} 0 V${Q[1]} M0 ${Q[1]/2} H${Q[0]}`,className:y0(["react-flow__background-pattern",Z,K])})}function Cj({radius:Q,className:U}){return F1.jsx("circle",{cx:Q,cy:Q,r:Q,className:y0(["react-flow__background-pattern","dots",U])})}var v4;(function(Q){Q.Lines="lines",Q.Dots="dots",Q.Cross="cross"})(v4||(v4={}));var Sj={[v4.Dots]:1,[v4.Lines]:1,[v4.Cross]:6},jj=(Q)=>({transform:Q.transform,patternId:`pattern-${Q.rfId}`});function ZR({id:Q,variant:U=v4.Dots,gap:Z=20,size:K,lineWidth:X=1,offset:W=0,color:z,bgColor:B,style:O,className:T,patternClassName:R}){let L=K1.useRef(null),{transform:M,patternId:f}=G0(jj,N0),I=K||Sj[U],D=U===v4.Dots,V=U===v4.Cross,k=Array.isArray(Z)?Z:[Z,Z],h=[k[0]*M[2]||1,k[1]*M[2]||1],P=I*M[2],C=Array.isArray(W)?W:[W,W],v=V?[P,P]:h,b=[C[0]*M[2]+v[0]/2,C[1]*M[2]+v[1]/2],E=`${f}${Q?Q:""}`;return F1.jsxs("svg",{className:y0(["react-flow__background",T]),style:{...O,...cq,"--xy-background-color-props":B,"--xy-background-pattern-color-props":z},ref:L,"data-testid":"rf__background",children:[F1.jsx("pattern",{id:E,x:M[0]%h[0],y:M[1]%h[1],width:h[0],height:h[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${b[0]},-${b[1]})`,children:D?F1.jsx(Cj,{radius:P/2,className:R}):F1.jsx(Nj,{dimensions:v,lineWidth:X,variant:U,className:R})}),F1.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${E})`})]})}ZR.displayName="Background";var FR=K1.memo(ZR);function Vj(){return F1.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:F1.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function kj(){return F1.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:F1.jsx("path",{d:"M0 0h32v4.2H0z"})})}function Dj(){return F1.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:F1.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 yj(){return F1.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:F1.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 vj(){return F1.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:F1.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 hq({children:Q,className:U,...Z}){return F1.jsx("button",{type:"button",className:y0(["react-flow__controls-button",U]),...Z,children:Q})}var Ej=(Q)=>({isInteractive:Q.nodesDraggable||Q.nodesConnectable||Q.elementsSelectable,minZoomReached:Q.transform[2]<=Q.minZoom,maxZoomReached:Q.transform[2]>=Q.maxZoom,ariaLabelConfig:Q.ariaLabelConfig});function KR({style:Q,showZoom:U=!0,showFitView:Z=!0,showInteractive:K=!0,fitViewOptions:X,onZoomIn:W,onZoomOut:z,onFitView:B,onInteractiveChange:O,className:T,children:R,position:L="bottom-left",orientation:M="vertical","aria-label":f}){let I=C0(),{isInteractive:D,minZoomReached:V,maxZoomReached:k,ariaLabelConfig:h}=G0(Ej,N0),{zoomIn:P,zoomOut:C,fitView:v}=OJ(),b=()=>{P(),W?.()},E=()=>{C(),z?.()},p=()=>{v(X),B?.()},a=()=>{I.setState({nodesDraggable:!D,nodesConnectable:!D,elementsSelectable:!D}),O?.(!D)};return F1.jsxs(N8,{className:y0(["react-flow__controls",M==="horizontal"?"horizontal":"vertical",T]),position:L,style:Q,"data-testid":"rf__controls","aria-label":f??h["controls.ariaLabel"],children:[U&&F1.jsxs(F1.Fragment,{children:[F1.jsx(hq,{onClick:b,className:"react-flow__controls-zoomin",title:h["controls.zoomIn.ariaLabel"],"aria-label":h["controls.zoomIn.ariaLabel"],disabled:k,children:F1.jsx(Vj,{})}),F1.jsx(hq,{onClick:E,className:"react-flow__controls-zoomout",title:h["controls.zoomOut.ariaLabel"],"aria-label":h["controls.zoomOut.ariaLabel"],disabled:V,children:F1.jsx(kj,{})})]}),Z&&F1.jsx(hq,{className:"react-flow__controls-fitview",onClick:p,title:h["controls.fitView.ariaLabel"],"aria-label":h["controls.fitView.ariaLabel"],children:F1.jsx(Dj,{})}),K&&F1.jsx(hq,{className:"react-flow__controls-interactive",onClick:a,title:h["controls.interactive.ariaLabel"],"aria-label":h["controls.interactive.ariaLabel"],children:D?F1.jsx(vj,{}):F1.jsx(yj,{})}),R]})}KR.displayName="Controls";var XR=K1.memo(KR);function bj({id:Q,x:U,y:Z,width:K,height:X,style:W,color:z,strokeColor:B,strokeWidth:O,className:T,borderRadius:R,shapeRendering:L,selected:M,onClick:f}){let{background:I,backgroundColor:D}=W||{},V=z||I||D;return F1.jsx("rect",{className:y0(["react-flow__minimap-node",{selected:M},T]),x:U,y:Z,rx:R,ry:R,width:K,height:X,style:{fill:V,stroke:B,strokeWidth:O},shapeRendering:L,onClick:f?(k)=>f(k,Q):void 0})}var uj=K1.memo(bj),xj=(Q)=>Q.nodes.map((U)=>U.id),CX=(Q)=>Q instanceof Function?Q:()=>Q;function hj({nodeStrokeColor:Q,nodeColor:U,nodeClassName:Z="",nodeBorderRadius:K=5,nodeStrokeWidth:X,nodeComponent:W=uj,onClick:z}){let B=G0(xj,N0),O=CX(U),T=CX(Q),R=CX(Z),L=typeof window>"u"||!!window.chrome?"crispEdges":"geometricPrecision";return F1.jsx(F1.Fragment,{children:B.map((M)=>F1.jsx(gj,{id:M,nodeColorFunc:O,nodeStrokeColorFunc:T,nodeClassNameFunc:R,nodeBorderRadius:K,nodeStrokeWidth:X,NodeComponent:W,onClick:z,shapeRendering:L},M))})}function mj({id:Q,nodeColorFunc:U,nodeStrokeColorFunc:Z,nodeClassNameFunc:K,nodeBorderRadius:X,nodeStrokeWidth:W,shapeRendering:z,NodeComponent:B,onClick:O}){let{node:T,x:R,y:L,width:M,height:f}=G0((I)=>{let D=I.nodeLookup.get(Q);if(!D)return{node:void 0,x:0,y:0,width:0,height:0};let V=D.internals.userNode,{x:k,y:h}=D.internals.positionAbsolute,{width:P,height:C}=y5(V);return{node:V,x:k,y:h,width:P,height:C}},N0);if(!T||T.hidden||!XX(T))return null;return F1.jsx(B,{x:R,y:L,width:M,height:f,style:T.style,selected:!!T.selected,className:K(T),color:U(T),borderRadius:X,strokeColor:Z(T),strokeWidth:W,shapeRendering:z,onClick:O,id:T.id})}var gj=K1.memo(mj),pj=K1.memo(hj),cj=200,lj=150,rj=(Q)=>!Q.hidden,dj=(Q)=>{let U={x:-Q.transform[0]/Q.transform[2],y:-Q.transform[1]/Q.transform[2],width:Q.width/Q.transform[2],height:Q.height/Q.transform[2]},Z=!1;for(let K of Q.nodeLookup.values())if(!K.hidden){Z=!0;break}return{viewBB:U,boundingRect:Z?ZX(f8(Q.nodeLookup,{filter:rj}),U):U,rfId:Q.rfId,panZoom:Q.panZoom,translateExtent:Q.translateExtent,flowWidth:Q.width,flowHeight:Q.height,ariaLabelConfig:Q.ariaLabelConfig}},NT=(Q,U)=>Q.x===U.x&&Q.y===U.y&&Q.width===U.width&&Q.height===U.height,ij=(Q,U)=>NT(Q.viewBB,U.viewBB)&&NT(Q.boundingRect,U.boundingRect)&&Q.rfId===U.rfId&&Q.panZoom===U.panZoom&&Q.translateExtent===U.translateExtent&&Q.flowWidth===U.flowWidth&&Q.flowHeight===U.flowHeight&&Q.ariaLabelConfig===U.ariaLabelConfig,aj="react-flow__minimap-desc";function HR({style:Q,className:U,nodeStrokeColor:Z,nodeColor:K,nodeClassName:X="",nodeBorderRadius:W=5,nodeStrokeWidth:z,nodeComponent:B,bgColor:O,maskColor:T,maskStrokeColor:R,maskStrokeWidth:L,position:M="bottom-right",onClick:f,onNodeClick:I,pannable:D=!1,zoomable:V=!1,ariaLabel:k,inversePan:h,zoomStep:P=1,offsetScale:C=5}){let v=C0(),b=K1.useRef(null),{boundingRect:E,panZoom:p,viewBB:a,rfId:m,translateExtent:_1,flowWidth:$1,flowHeight:J1,ariaLabelConfig:y}=G0(dj,ij),u=Q?.width??cj,x=Q?.height??lj,d=E.width/u,g=E.height/x,n=Math.max(d,g),j=n*u,i=n*x,q1=C*n,Q1=E.x-(j-E.width)/2-q1,Y1=E.y-(i-E.height)/2-q1,L1=j+q1*2,M1=i+q1*2,I1=`${aj}-${m}`,X1=K1.useRef(0),f1=K1.useRef();X1.current=n,K1.useEffect(()=>{let c1=v.getState().panZoom;if(b.current&&c1)return f1.current=hM({domNode:b.current,panZoom:c1,getTransform:()=>v.getState().transform,getViewScale:()=>X1.current}),()=>{f1.current?.destroy()}},[p]),K1.useEffect(()=>{f1.current?.update({translateExtent:_1,width:$1,height:J1,inversePan:h,pannable:D,zoomStep:P,zoomable:V})},[D,V,h,P,_1,$1,J1]);let l1=f?(c1)=>{let[E1,j1]=f1.current?.pointer(c1)||[0,0];f(c1,{x:E1,y:j1})}:void 0,W1=K1.useCallback((c1,E1)=>{let j1=v.getState().nodeLookup.get(E1).internals.userNode;I?.(c1,j1)},[I]),S1=I?W1:void 0,v1=k??y["minimap.ariaLabel"];return F1.jsx(N8,{position:M,style:{...Q,"--xy-minimap-background-color-props":typeof O==="string"?O:void 0,"--xy-minimap-mask-background-color-props":typeof T==="string"?T:void 0,"--xy-minimap-mask-stroke-color-props":typeof R==="string"?R:void 0,"--xy-minimap-mask-stroke-width-props":typeof L==="number"?L*n:void 0,"--xy-minimap-node-background-color-props":typeof K==="string"?K:void 0,"--xy-minimap-node-stroke-color-props":typeof Z==="string"?Z:void 0,"--xy-minimap-node-stroke-width-props":typeof z==="number"?z:void 0},className:y0(["react-flow__minimap",U]),"data-testid":"rf__minimap",children:F1.jsxs("svg",{width:u,height:x,viewBox:`${Q1} ${Y1} ${L1} ${M1}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":I1,ref:b,onClick:l1,children:[v1&&F1.jsx("title",{id:I1,children:v1}),F1.jsx(pj,{onClick:S1,nodeColor:K,nodeStrokeColor:Z,nodeBorderRadius:W,nodeClassName:X,nodeStrokeWidth:z,nodeComponent:B}),F1.jsx("path",{className:"react-flow__minimap-mask",d:`M${Q1-q1},${Y1-q1}h${L1+q1*2}v${M1+q1*2}h${-L1-q1*2}z
247
+ M${a.x},${a.y}h${a.width}v${a.height}h${-a.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}HR.displayName="MiniMap";var YR=K1.memo(HR),sj=(Q)=>(U)=>Q?`${Math.max(1/U.transform[2],1)}`:void 0,tj={[M6.Line]:"right",[M6.Handle]:"bottom-right"};function oj({nodeId:Q,position:U,variant:Z=M6.Handle,className:K,style:X=void 0,children:W,color:z,minWidth:B=10,minHeight:O=10,maxWidth:T=Number.MAX_VALUE,maxHeight:R=Number.MAX_VALUE,keepAspectRatio:L=!1,resizeDirection:M,autoScale:f=!0,shouldResize:I,onResizeStart:D,onResize:V,onResizeEnd:k}){let h=VX(),P=typeof Q==="string"?Q:h,C=C0(),v=K1.useRef(null),b=Z===M6.Handle,E=G0(K1.useCallback(sj(b&&f),[b,f]),N0),p=K1.useRef(null),a=U??tj[Z];K1.useEffect(()=>{if(!v.current||!P)return;if(!p.current)p.current=lM({domNode:v.current,nodeId:P,getStoreItems:()=>{let{nodeLookup:_1,transform:$1,snapGrid:J1,snapToGrid:y,nodeOrigin:u,domNode:x}=C.getState();return{nodeLookup:_1,transform:$1,snapGrid:J1,snapToGrid:y,nodeOrigin:u,paneDomNode:x}},onChange:(_1,$1)=>{let{triggerNodeChanges:J1,nodeLookup:y,parentLookup:u,nodeOrigin:x}=C.getState(),d=[],g={x:_1.x,y:_1.y},n=y.get(P);if(n&&n.expandParent&&n.parentId){let j=n.origin??x,i=_1.width??n.measured.width??0,q1=_1.height??n.measured.height??0,Q1={id:n.id,parentId:n.parentId,rect:{width:i,height:q1,...HX({x:_1.x??n.position.x,y:_1.y??n.position.y},{width:i,height:q1},n.parentId,y,j)}},Y1=Eq([Q1],y,u,x);d.push(...Y1),g.x=_1.x?Math.max(j[0]*i,_1.x):void 0,g.y=_1.y?Math.max(j[1]*q1,_1.y):void 0}if(g.x!==void 0&&g.y!==void 0){let j={id:P,type:"position",position:{...g}};d.push(j)}if(_1.width!==void 0&&_1.height!==void 0){let i={id:P,type:"dimensions",resizing:!0,setAttributes:!M?!0:M==="horizontal"?"width":"height",dimensions:{width:_1.width,height:_1.height}};d.push(i)}for(let j of $1){let i={...j,type:"position"};d.push(i)}J1(d)},onEnd:({width:_1,height:$1})=>{let J1={id:P,type:"dimensions",resizing:!1,dimensions:{width:_1,height:$1}};C.getState().triggerNodeChanges([J1])}});return p.current.update({controlPosition:a,boundaries:{minWidth:B,minHeight:O,maxWidth:T,maxHeight:R},keepAspectRatio:L,resizeDirection:M,onResizeStart:D,onResize:V,onResizeEnd:k,shouldResize:I}),()=>{p.current?.destroy()}},[a,B,O,T,R,L,D,V,k,I]);let m=a.split("-");return F1.jsx("div",{className:y0(["react-flow__resize-control","nodrag",...m,Z,K]),ref:v,style:{...X,scale:E,...z&&{[b?"backgroundColor":"borderColor"]:z}},children:W})}var Fm=K1.memo(oj);var nj=(Q)=>Q.domNode?.querySelector(".react-flow__renderer");function ej({children:Q}){let U=G0(nj);if(!U)return null;return CT.createPortal(Q,U)}var _V=(Q,U)=>Q?.internals.positionAbsolute.x!==U?.internals.positionAbsolute.x||Q?.internals.positionAbsolute.y!==U?.internals.positionAbsolute.y||Q?.measured.width!==U?.measured.width||Q?.measured.height!==U?.measured.height||Q?.selected!==U?.selected||Q?.internals.z!==U?.internals.z,JV=(Q,U)=>{if(Q.size!==U.size)return!1;for(let[Z,K]of Q)if(_V(K,U.get(Z)))return!1;return!0},$V=(Q)=>({x:Q.transform[0],y:Q.transform[1],zoom:Q.transform[2],selectedNodesCount:Q.nodes.filter((U)=>U.selected).length});function WR({nodeId:Q,children:U,className:Z,style:K,isVisible:X,position:W=C1.Top,offset:z=10,align:B="center",...O}){let T=VX(),R=K1.useCallback((v)=>{return(Array.isArray(Q)?Q:[Q||T||""]).reduce((p,a)=>{let m=v.nodeLookup.get(a);if(m)p.set(m.id,m);return p},new Map)},[Q,T]),L=G0(R,JV),{x:M,y:f,zoom:I,selectedNodesCount:D}=G0($V,N0);if(!(typeof X==="boolean"?X:L.size===1&&L.values().next().value?.selected&&D===1)||!L.size)return null;let k=f8(L),h=Array.from(L.values()),P=Math.max(...h.map((v)=>v.internals.z+1)),C={position:"absolute",transform:CM(k,{x:M,y:f,zoom:I},W,z,B),zIndex:P,...K};return F1.jsx(ej,{children:F1.jsx("div",{style:C,className:y0(["react-flow__node-toolbar",Z]),...O,"data-id":h.reduce((v,b)=>`${v}${b.id} `,"").trim(),children:U})})}var _2=u0(i5(),1);var zR={x:{title:"X",fill:"currentColor",d:"M18.901 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584-6.638 7.584H.474l8.6-9.83L0 1.154h7.594l5.243 6.932ZM17.61 20.644h2.039L6.486 3.24H4.298Z"},youtube:{title:"YouTube",fill:"#FF0000",d:"M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"},tiktok:{title:"TikTok",fill:"currentColor",d:"M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z"},discord:{title:"Discord",fill:"#5865F2",d:"M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z"},resend:{title:"Resend",fill:"currentColor",d:"M2.023 0v24h5.553v-8.434h2.998L15.326 24h6.65l-5.372-9.258a7.652 7.652 0 0 0 3.316-3.016c.709-1.21 1.062-2.57 1.062-4.08 0-1.462-.353-2.767-1.062-3.91-.709-1.165-1.692-2.079-2.95-2.742C15.737.331 14.355 0 12.823 0Zm5.553 4.87h4.219c.731 0 1.349.125 1.851.376.526.252.925.618 1.2 1.098.274.457.412.994.412 1.611S15.132 9.12 14.88 9.6c-.229.48-.572.856-1.03 1.13-.434.252-.948.38-1.542.38H7.576Z"},linkedin:{title:"LinkedIn",fill:"#0A66C2",d:"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"},reddit:{title:"Reddit",fill:"#FF4500",d:"M12 0C5.373 0 0 5.373 0 12c0 3.314 1.343 6.314 3.515 8.485l-2.286 2.286C.775 23.225 1.097 24 1.738 24H12c6.627 0 12-5.373 12-12S18.627 0 12 0Zm4.388 3.199c1.104 0 1.999.895 1.999 1.999 0 1.105-.895 2-1.999 2-.946 0-1.739-.657-1.947-1.539v.002c-1.147.162-2.032 1.15-2.032 2.341v.007c1.776.067 3.4.567 4.686 1.363.473-.363 1.064-.58 1.707-.58 1.547 0 2.802 1.254 2.802 2.802 0 1.117-.655 2.081-1.601 2.531-.088 3.256-3.637 5.876-7.997 5.876-4.361 0-7.905-2.617-7.998-5.87-.954-.447-1.614-1.415-1.614-2.538 0-1.548 1.255-2.802 2.803-2.802.645 0 1.239.218 1.712.585 1.275-.79 2.881-1.291 4.64-1.365v-.01c0-1.663 1.263-3.034 2.88-3.207.188-.911.993-1.595 1.959-1.595Zm-8.085 8.376c-.784 0-1.459.78-1.506 1.797-.047 1.016.64 1.429 1.426 1.429.786 0 1.371-.369 1.418-1.385.047-1.017-.553-1.841-1.338-1.841Zm7.406 0c-.786 0-1.385.824-1.338 1.841.047 1.017.634 1.385 1.418 1.385.785 0 1.473-.413 1.426-1.429-.046-1.017-.721-1.797-1.506-1.797Zm-3.703 4.013c-.974 0-1.907.048-2.77.135-.147.015-.241.168-.183.305.483 1.154 1.622 1.964 2.953 1.964 1.33 0 2.47-.81 2.953-1.964.057-.137-.037-.29-.184-.305-.863-.087-1.795-.135-2.769-.135Z"},bluesky:{title:"Bluesky",fill:"#0285FF",d:"M12 10.8c-1.087-2.114-4.046-6.053-6.798-7.995C2.566.944 1.561 1.266.902 1.565.139 1.908 0 3.08 0 3.768c0 .69.378 5.65.624 6.479.815 2.736 3.713 3.66 6.383 3.364.136-.02.275-.039.415-.056-.138.022-.276.04-.415.056-3.912.58-7.387 2.005-2.83 7.078 5.013 5.19 6.87-1.113 7.823-4.308.953 3.195 2.05 9.271 7.733 4.308 4.267-4.308 1.172-6.498-2.74-7.078a8.741 8.741 0 0 1-.415-.056c.14.017.279.036.415.056 2.67.297 5.568-.628 6.383-3.364.246-.828.624-5.79.624-6.478 0-.69-.139-1.861-.902-2.206-.659-.298-1.664-.62-4.3 1.24C16.046 4.748 13.087 8.687 12 10.8Z"},instagram:{title:"Instagram",fill:"#FF0069",d:"M7.0301.084c-1.2768.0602-2.1487.264-2.911.5634-.7888.3075-1.4575.72-2.1228 1.3877-.6652.6677-1.075 1.3368-1.3802 2.127-.2954.7638-.4956 1.6365-.552 2.914-.0564 1.2775-.0689 1.6882-.0626 4.947.0062 3.2586.0206 3.6671.0825 4.9473.061 1.2765.264 2.1482.5635 2.9107.308.7889.72 1.4573 1.388 2.1228.6679.6655 1.3365 1.0743 2.1285 1.38.7632.295 1.6361.4961 2.9134.552 1.2773.056 1.6884.069 4.9462.0627 3.2578-.0062 3.668-.0207 4.9478-.0814 1.28-.0607 2.147-.2652 2.9098-.5633.7889-.3086 1.4578-.72 2.1228-1.3881.665-.6682 1.0745-1.3378 1.3795-2.1284.2957-.7632.4966-1.636.552-2.9124.056-1.2809.0692-1.6898.063-4.948-.0063-3.2583-.021-3.6668-.0817-4.9465-.0607-1.2797-.264-2.1487-.5633-2.9117-.3084-.7889-.72-1.4568-1.3876-2.1228C21.2982 1.33 20.628.9208 19.8378.6165 19.074.321 18.2017.1197 16.9244.0645 15.6471.0093 15.236-.005 11.977.0014 8.718.0076 8.31.0215 7.0301.0839m.1402 21.6932c-1.17-.0509-1.8053-.2453-2.2287-.408-.5606-.216-.96-.4771-1.3819-.895-.422-.4178-.6811-.8186-.9-1.378-.1644-.4234-.3624-1.058-.4171-2.228-.0595-1.2645-.072-1.6442-.079-4.848-.007-3.2037.0053-3.583.0607-4.848.05-1.169.2456-1.805.408-2.2282.216-.5613.4762-.96.895-1.3816.4188-.4217.8184-.6814 1.3783-.9003.423-.1651 1.0575-.3614 2.227-.4171 1.2655-.06 1.6447-.072 4.848-.079 3.2033-.007 3.5835.005 4.8495.0608 1.169.0508 1.8053.2445 2.228.408.5608.216.96.4754 1.3816.895.4217.4194.6816.8176.9005 1.3787.1653.4217.3617 1.056.4169 2.2263.0602 1.2655.0739 1.645.0796 4.848.0058 3.203-.0055 3.5834-.061 4.848-.051 1.17-.245 1.8055-.408 2.2294-.216.5604-.4763.96-.8954 1.3814-.419.4215-.8181.6811-1.3783.9-.4224.1649-1.0577.3617-2.2262.4174-1.2656.0595-1.6448.072-4.8493.079-3.2045.007-3.5825-.006-4.848-.0608M16.953 5.5864A1.44 1.44 0 1 0 18.39 4.144a1.44 1.44 0 0 0-1.437 1.4424M5.8385 12.012c.0067 3.4032 2.7706 6.1557 6.173 6.1493 3.4026-.0065 6.157-2.7701 6.1506-6.1733-.0065-3.4032-2.771-6.1565-6.174-6.1498-3.403.0067-6.156 2.771-6.1496 6.1738M8 12.0077a4 4 0 1 1 4.008 3.9921A3.9996 3.9996 0 0 1 8 12.0077"},github:{title:"GitHub",fill:"currentColor",d:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"},stripe:{title:"Stripe",fill:"#635BFF",d:"M13.976 9.15c-2.172-.806-3.356-1.426-3.356-2.409 0-.831.683-1.305 1.901-1.305 2.227 0 4.515.858 6.09 1.631l.89-5.494C18.252.975 15.697 0 12.165 0 9.667 0 7.589.654 6.104 1.872 4.56 3.147 3.757 4.992 3.757 7.218c0 4.039 2.467 5.76 6.476 7.219 2.585.92 3.445 1.574 3.445 2.583 0 .98-.84 1.545-2.354 1.545-1.875 0-4.965-.921-6.99-2.109l-.9 5.555C5.175 22.99 8.385 24 11.714 24c2.641 0 4.843-.624 6.328-1.813 1.664-1.305 2.525-3.236 2.525-5.732 0-4.128-2.524-5.851-6.594-7.305h.003z"},slack:{title:"Slack",fill:"#4A154B",d:"M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zM6.313 15.165a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zM8.834 6.313a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312zM18.956 8.834a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V8.834zM17.688 8.834a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312zM15.165 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zM15.165 17.688a2.527 2.527 0 0 1-2.52-2.523 2.526 2.526 0 0 1 2.52-2.52h6.313A2.527 2.527 0 0 1 24 15.165a2.528 2.528 0 0 1-2.522 2.523h-6.313z"},openai:{title:"OpenAI",fill:"#412991",d:"M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z"},anthropic:{title:"Anthropic",fill:"currentColor",d:"M17.3041 3.541h-3.6718l6.696 16.918H24Zm-10.6082 0L0 20.459h3.7442l1.3693-3.5527h7.0052l1.3693 3.5528h3.7442L10.5363 3.5409Zm-.3712 10.2232 2.2914-5.9456 2.2914 5.9456Z"},twilio:{title:"Twilio",fill:"#F22F46",d:"M12 0C5.381-.008.008 5.352 0 11.971V12c0 6.64 5.359 12 12 12 6.64 0 12-5.36 12-12 0-6.641-5.36-12-12-12zm0 20.801c-4.846.015-8.786-3.904-8.801-8.75V12c-.014-4.846 3.904-8.786 8.75-8.801H12c4.847-.014 8.786 3.904 8.801 8.75V12c.015 4.847-3.904 8.786-8.75 8.801H12zm5.44-11.76c0 1.359-1.12 2.479-2.481 2.479-1.366-.007-2.472-1.113-2.479-2.479 0-1.361 1.12-2.481 2.479-2.481 1.361 0 2.481 1.12 2.481 2.481zm0 5.919c0 1.36-1.12 2.48-2.481 2.48-1.367-.008-2.473-1.114-2.479-2.48 0-1.359 1.12-2.479 2.479-2.479 1.361-.001 2.481 1.12 2.481 2.479zm-5.919 0c0 1.36-1.12 2.48-2.479 2.48-1.368-.007-2.475-1.113-2.481-2.48 0-1.359 1.12-2.479 2.481-2.479 1.358-.001 2.479 1.12 2.479 2.479zm0-5.919c0 1.359-1.12 2.479-2.479 2.479-1.367-.007-2.475-1.112-2.481-2.479 0-1.361 1.12-2.481 2.481-2.481 1.358 0 2.479 1.12 2.479 2.481z"},sendgrid:{title:"SendGrid",fill:"#51A9E3",d:"M.8 24h13.6c.88 0 1.6-.72 1.6-1.6v-4.8c0-.88-.72-1.6-1.6-1.6H9.6c-.88 0-1.6-.72-1.6-1.6V9.6C8 8.72 7.28 8 6.4 8H1.6C.72 8 0 8.72 0 9.6v13.6c0 .44.36.8.8.8zM23.2 0H9.6C8.72 0 8 .72 8 1.6v4.8C8 7.28 8.72 8 9.6 8h4.8c.88 0 1.6.72 1.6 1.6v4.8c0 .88.72 1.6 1.6 1.6h4.8c.88 0 1.6-.72 1.6-1.6V.8c0-.44-.36-.8-.8-.8Z"},mailgun:{title:"Mailgun",fill:"#F06B66",d:"M11.837 0c6.602 0 11.984 5.381 11.984 11.994-.017 2.99-3.264 4.84-5.844 3.331a3.805 3.805 0 0 1-.06-.035l-.055-.033-.022.055c-2.554 4.63-9.162 4.758-11.894.232-2.732-4.527.46-10.313 5.746-10.416a6.868 6.868 0 0 1 7.002 6.866 1.265 1.265 0 0 0 2.52 0c0-5.18-4.197-9.38-9.377-9.387C4.611 2.594.081 10.41 3.683 16.673c3.238 5.632 11.08 6.351 15.289 1.402l1.997 1.686A11.95 11.95 0 0 1 11.837 24C2.6 23.72-2.87 13.543 1.992 5.684A12.006 12.006 0 0 1 11.837 0Zm0 7.745c-3.276-.163-5.5 3.281-4.003 6.2a4.26 4.26 0 0 0 4.014 2.31c3.276-.171 5.137-3.824 3.35-6.575a4.26 4.26 0 0 0-3.36-1.935Zm0 2.53c1.324 0 2.152 1.433 1.49 2.58a1.72 1.72 0 0 1-1.49.86 1.72 1.72 0 1 1 0-3.44Z"},notion:{title:"Notion",fill:"currentColor",d:"M4.459 4.208c.746.606 1.026.56 2.428.466l13.215-.793c.28 0 .047-.28-.046-.326L17.86 1.968c-.42-.326-.981-.7-2.055-.607L3.01 2.295c-.466.046-.56.28-.374.466zm.793 3.08v13.904c0 .747.373 1.027 1.214.98l14.523-.84c.841-.046.935-.56.935-1.167V6.354c0-.606-.233-.933-.748-.887l-15.177.887c-.56.047-.747.327-.747.933zm14.337.745c.093.42 0 .84-.42.888l-.7.14v10.264c-.608.327-1.168.514-1.635.514-.748 0-.935-.234-1.495-.933l-4.577-7.186v6.952L12.21 19s0 .84-1.168.84l-3.222.186c-.093-.186 0-.653.327-.746l.84-.233V9.854L7.822 9.76c-.094-.42.14-1.026.793-1.073l3.456-.233 4.764 7.279v-6.44l-1.215-.139c-.093-.514.28-.887.747-.933zM1.936 1.035l13.31-.98c1.634-.14 2.055-.047 3.082.7l4.249 2.986c.7.513.934.653.934 1.213v16.378c0 1.026-.373 1.634-1.68 1.726l-15.458.934c-.98.047-1.448-.093-1.962-.747l-3.129-4.06c-.56-.747-.793-1.306-.793-1.96V2.667c0-.839.374-1.54 1.447-1.632z"},linear:{title:"Linear",fill:"#5E6AD2",d:"M2.886 4.18A11.982 11.982 0 0 1 11.99 0C18.624 0 24 5.376 24 12.009c0 3.64-1.62 6.903-4.18 9.105L2.887 4.18ZM1.817 5.626l16.556 16.556c-.524.33-1.075.62-1.65.866L.951 7.277c.247-.575.537-1.126.866-1.65ZM.322 9.163l14.515 14.515c-.71.172-1.443.282-2.195.322L0 11.358a12 12 0 0 1 .322-2.195Zm-.17 4.862 9.823 9.824a12.02 12.02 0 0 1-9.824-9.824Z"},jira:{title:"Jira",fill:"#0052CC",d:"M11.571 11.513H0a5.218 5.218 0 0 0 5.232 5.215h2.13v2.057A5.215 5.215 0 0 0 12.575 24V12.518a1.005 1.005 0 0 0-1.005-1.005zm5.723-5.756H5.736a5.215 5.215 0 0 0 5.215 5.214h2.129v2.058a5.218 5.218 0 0 0 5.215 5.214V6.758a1.001 1.001 0 0 0-1.001-1.001zM23.013 0H11.455a5.215 5.215 0 0 0 5.215 5.215h2.129v2.057A5.215 5.215 0 0 0 24 12.483V1.005A1.001 1.001 0 0 0 23.013 0Z"},hubspot:{title:"HubSpot",fill:"#FF7A59",d:"M18.164 7.93V5.084a2.198 2.198 0 001.267-1.978v-.067A2.2 2.2 0 0017.238.845h-.067a2.2 2.2 0 00-2.193 2.193v.067a2.196 2.196 0 001.252 1.973l.013.006v2.852a6.22 6.22 0 00-2.969 1.31l.012-.01-7.828-6.095A2.497 2.497 0 104.3 4.656l-.012.006 7.697 5.991a6.176 6.176 0 00-1.038 3.446c0 1.343.425 2.588 1.147 3.607l-.013-.02-2.342 2.343a1.968 1.968 0 00-.58-.095h-.002a2.033 2.033 0 102.033 2.033 1.978 1.978 0 00-.1-.595l.005.014 2.317-2.317a6.247 6.247 0 104.782-11.134l-.036-.005zm-.964 9.378a3.206 3.206 0 113.215-3.207v.002a3.206 3.206 0 01-3.207 3.207z"},paypal:{title:"PayPal",fill:"#003087",d:"M7.016 19.198h-4.2a.562.562 0 0 1-.555-.65L5.093.584A.692.692 0 0 1 5.776 0h7.222c3.417 0 5.904 2.488 5.846 5.5-.006.25-.027.5-.066.747A6.794 6.794 0 0 1 12.071 12H8.743a.69.69 0 0 0-.682.583l-.325 2.056-.013.083-.692 4.39-.015.087zM19.79 6.142c-.01.087-.01.175-.023.261a7.76 7.76 0 0 1-7.695 6.598H9.007l-.283 1.795-.013.083-.692 4.39-.134.843-.014.088H6.86l-.497 3.15a.562.562 0 0 0 .555.65h3.612c.34 0 .63-.249.683-.585l.952-6.031a.692.692 0 0 1 .683-.584h2.126a6.793 6.793 0 0 0 6.707-5.752c.306-1.95-.466-3.744-1.89-4.906z"},shopify:{title:"Shopify",fill:"#7AB55C",d:"M15.337 23.979l7.216-1.561s-2.604-17.613-2.625-17.73c-.018-.116-.114-.192-.211-.192s-1.929-.136-1.929-.136-1.275-1.274-1.439-1.411c-.045-.037-.075-.057-.121-.074l-.914 21.104h.023zM11.71 11.305s-.81-.424-1.774-.424c-1.447 0-1.504.906-1.504 1.141 0 1.232 3.24 1.715 3.24 4.629 0 2.295-1.44 3.76-3.406 3.76-2.354 0-3.54-1.465-3.54-1.465l.646-2.086s1.245 1.066 2.28 1.066c.675 0 .975-.545.975-.932 0-1.619-2.654-1.694-2.654-4.359-.034-2.237 1.571-4.416 4.827-4.416 1.257 0 1.875.361 1.875.361l-.945 2.715-.02.01zM11.17.83c.136 0 .271.038.405.135-.984.465-2.064 1.639-2.508 3.992-.656.213-1.293.405-1.889.578C7.697 3.75 8.951.84 11.17.84V.83zm1.235 2.949v.135c-.754.232-1.583.484-2.394.736.466-1.777 1.333-2.645 2.085-2.971.193.501.309 1.176.309 2.1zm.539-2.234c.694.074 1.141.867 1.429 1.755-.349.114-.735.231-1.158.366v-.252c0-.752-.096-1.371-.271-1.871v.002zm2.992 1.289c-.02 0-.06.021-.078.021s-.289.075-.714.21c-.423-1.233-1.176-2.37-2.508-2.37h-.115C12.135.209 11.669 0 11.265 0 8.159 0 6.675 3.877 6.21 5.846c-1.194.365-2.063.636-2.16.674-.675.213-.694.232-.772.87-.075.462-1.83 14.063-1.83 14.063L15.009 24l.927-21.166z"},sentry:{title:"Sentry",fill:"#362D59",d:"M13.91 2.505c-.873-1.448-2.972-1.448-3.844 0L6.904 7.92a15.478 15.478 0 0 1 8.53 12.811h-2.221A13.301 13.301 0 0 0 5.784 9.814l-2.926 5.06a7.65 7.65 0 0 1 4.435 5.848H2.194a.365.365 0 0 1-.298-.534l1.413-2.402a5.16 5.16 0 0 0-1.614-.913L.296 19.275a2.182 2.182 0 0 0 .812 2.999 2.24 2.24 0 0 0 1.086.288h6.983a9.322 9.322 0 0 0-3.845-8.318l1.11-1.922a11.47 11.47 0 0 1 4.95 10.24h5.915a17.242 17.242 0 0 0-7.885-15.28l2.244-3.845a.37.37 0 0 1 .504-.13c.255.14 9.75 16.708 9.928 16.9a.365.365 0 0 1-.327.543h-2.287c.029.612.029 1.223 0 1.831h2.297a2.206 2.206 0 0 0 1.922-3.31z"},vercel:{title:"Vercel",fill:"currentColor",d:"M24 22.525H0l12-21.05 12 21.05z"},supabase:{title:"Supabase",fill:"#3FCF8E",d:"M11.9 1.036c-.015-.986-1.26-1.41-1.874-.637L.764 12.05C-.33 13.427.65 15.455 2.409 15.455h9.579l.113 7.51c.014.985 1.259 1.408 1.873.636l9.262-11.653c1.093-1.375.113-3.403-1.645-3.403h-9.642z"},clerk:{title:"Clerk",fill:"#6C47FF",d:"m21.47 20.829-2.881-2.881a.572.572 0 0 0-.7-.084 6.854 6.854 0 0 1-7.081 0 .576.576 0 0 0-.7.084l-2.881 2.881a.576.576 0 0 0-.103.69.57.57 0 0 0 .166.186 12 12 0 0 0 14.113 0 .58.58 0 0 0 .239-.423.576.576 0 0 0-.172-.453Zm.002-17.668-2.88 2.88a.569.569 0 0 1-.701.084A6.857 6.857 0 0 0 8.724 8.08a6.862 6.862 0 0 0-1.222 3.692 6.86 6.86 0 0 0 .978 3.764.573.573 0 0 1-.083.699l-2.881 2.88a.567.567 0 0 1-.864-.063A11.993 11.993 0 0 1 6.771 2.7a11.99 11.99 0 0 1 14.637-.405.566.566 0 0 1 .232.418.57.57 0 0 1-.168.448Zm-7.118 12.261a3.427 3.427 0 1 0 0-6.854 3.427 3.427 0 0 0 0 6.854Z"},aws:{title:"Amazon Web Services",fill:"#232F3E",d:"M6.763 10.036c0 .296.032.535.088.71.064.176.144.368.256.576.04.063.056.127.056.183 0 .08-.048.16-.152.24l-.503.335a.383.383 0 0 1-.208.072c-.08 0-.16-.04-.239-.112a2.47 2.47 0 0 1-.287-.375 6.18 6.18 0 0 1-.248-.471c-.622.734-1.405 1.101-2.347 1.101-.67 0-1.205-.191-1.596-.574-.391-.384-.59-.894-.59-1.533 0-.678.239-1.23.726-1.644.487-.415 1.133-.623 1.955-.623.272 0 .551.024.846.064.296.04.6.104.918.176v-.583c0-.607-.127-1.03-.375-1.277-.255-.248-.686-.367-1.3-.367-.28 0-.568.031-.863.103-.295.072-.583.16-.862.272a2.287 2.287 0 0 1-.28.104.488.488 0 0 1-.127.023c-.112 0-.168-.08-.168-.247v-.391c0-.128.016-.224.056-.28a.597.597 0 0 1 .224-.167c.279-.144.614-.264 1.005-.36a4.84 4.84 0 0 1 1.246-.151c.95 0 1.644.216 2.091.647.439.43.662 1.085.662 1.963v2.586zm-3.24 1.214c.263 0 .534-.048.822-.144.287-.096.543-.271.758-.51.128-.152.224-.32.272-.512.047-.191.08-.423.08-.694v-.335a6.66 6.66 0 0 0-.735-.136 6.02 6.02 0 0 0-.75-.048c-.535 0-.926.104-1.19.32-.263.215-.39.518-.39.917 0 .375.095.655.295.846.191.2.47.296.838.296zm6.41.862c-.144 0-.24-.024-.304-.08-.064-.048-.12-.16-.168-.311L7.586 5.55a1.398 1.398 0 0 1-.072-.32c0-.128.064-.2.191-.2h.783c.151 0 .255.025.31.08.065.048.113.16.16.312l1.342 5.284 1.245-5.284c.04-.16.088-.264.151-.312a.549.549 0 0 1 .32-.08h.638c.152 0 .256.025.32.08.063.048.12.16.151.312l1.261 5.348 1.381-5.348c.048-.16.104-.264.16-.312a.52.52 0 0 1 .311-.08h.743c.127 0 .2.065.2.2 0 .04-.009.08-.017.128a1.137 1.137 0 0 1-.056.2l-1.923 6.17c-.048.16-.104.263-.168.311a.51.51 0 0 1-.303.08h-.687c-.151 0-.255-.024-.32-.08-.063-.056-.119-.16-.15-.32l-1.238-5.148-1.23 5.14c-.04.16-.087.264-.15.32-.065.056-.177.08-.32.08zm10.256.215c-.415 0-.83-.048-1.229-.143-.399-.096-.71-.2-.918-.32-.128-.071-.215-.151-.247-.223a.563.563 0 0 1-.048-.224v-.407c0-.167.064-.247.183-.247.048 0 .096.008.144.024.048.016.12.048.2.08.271.12.566.215.878.279.319.064.63.096.95.096.502 0 .894-.088 1.165-.264a.86.86 0 0 0 .415-.758.777.777 0 0 0-.215-.559c-.144-.151-.416-.287-.807-.415l-1.157-.36c-.583-.183-1.014-.454-1.277-.813a1.902 1.902 0 0 1-.4-1.158c0-.335.073-.63.216-.886.144-.255.335-.479.575-.654.24-.184.51-.32.83-.415.32-.096.655-.136 1.006-.136.175 0 .359.008.535.032.183.024.35.056.518.088.16.04.312.08.455.127.144.048.256.096.336.144a.69.69 0 0 1 .24.2.43.43 0 0 1 .071.263v.375c0 .168-.064.256-.184.256a.83.83 0 0 1-.303-.096 3.652 3.652 0 0 0-1.532-.311c-.455 0-.815.071-1.062.223-.248.152-.375.383-.375.71 0 .224.08.416.24.567.159.152.454.304.877.44l1.134.358c.574.184.99.44 1.237.767.247.327.367.702.367 1.117 0 .343-.072.655-.207.926-.144.272-.336.511-.583.703-.248.2-.543.343-.886.447-.36.111-.734.167-1.142.167zM21.698 16.207c-2.626 1.94-6.442 2.969-9.722 2.969-4.598 0-8.74-1.7-11.87-4.526-.247-.223-.024-.527.272-.351 3.384 1.963 7.559 3.153 11.877 3.153 2.914 0 6.114-.607 9.06-1.852.439-.2.814.287.383.607zM22.792 14.961c-.336-.43-2.22-.207-3.074-.103-.255.032-.295-.192-.063-.36 1.5-1.053 3.967-.75 4.254-.399.287.36-.08 2.826-1.485 4.007-.215.184-.423.088-.327-.151.32-.79 1.03-2.57.695-2.994z"},figma:{title:"Figma",fill:"#F24E1E",d:"M15.852 8.981h-4.588V0h4.588c2.476 0 4.49 2.014 4.49 4.49s-2.014 4.491-4.49 4.491zM12.735 7.51h3.117c1.665 0 3.019-1.355 3.019-3.019s-1.355-3.019-3.019-3.019h-3.117V7.51zm0 1.471H8.148c-2.476 0-4.49-2.014-4.49-4.49S5.672 0 8.148 0h4.588v8.981zm-4.587-7.51c-1.665 0-3.019 1.355-3.019 3.019s1.354 3.02 3.019 3.02h3.117V1.471H8.148zm4.587 15.019H8.148c-2.476 0-4.49-2.014-4.49-4.49s2.014-4.49 4.49-4.49h4.588v8.98zM8.148 8.981c-1.665 0-3.019 1.355-3.019 3.019s1.355 3.019 3.019 3.019h3.117V8.981H8.148zM8.172 24c-2.489 0-4.515-2.014-4.515-4.49s2.014-4.49 4.49-4.49h4.588v4.441c0 2.503-2.047 4.539-4.563 4.539zm-.024-7.51a3.023 3.023 0 0 0-3.019 3.019c0 1.665 1.365 3.019 3.044 3.019 1.705 0 3.093-1.376 3.093-3.068v-2.97H8.148zm7.704 0h-.098c-2.476 0-4.49-2.014-4.49-4.49s2.014-4.49 4.49-4.49h.098c2.476 0 4.49 2.014 4.49 4.49s-2.014 4.49-4.49 4.49zm-.097-7.509c-1.665 0-3.019 1.355-3.019 3.019s1.355 3.019 3.019 3.019h.098c1.665 0 3.019-1.355 3.019-3.019s-1.355-3.019-3.019-3.019h-.098z"},airtable:{title:"Airtable",fill:"#18BFFF",d:"M11.992 1.966c-.434 0-.87.086-1.28.257L1.779 5.917c-.503.208-.49.908.012 1.116l8.982 3.558a3.266 3.266 0 0 0 2.454 0l8.982-3.558c.503-.196.503-.908.012-1.116l-8.957-3.694a3.255 3.255 0 0 0-1.272-.257zM23.4 8.056a.589.589 0 0 0-.222.045l-10.012 3.877a.612.612 0 0 0-.38.564v8.896a.6.6 0 0 0 .821.552L23.62 18.1a.583.583 0 0 0 .38-.551V8.653a.6.6 0 0 0-.6-.596zM.676 8.095a.644.644 0 0 0-.48.19C.086 8.396 0 8.53 0 8.69v8.355c0 .442.515.737.908.54l6.27-3.006.307-.147 2.969-1.436c.466-.22.43-.908-.061-1.092L.883 8.138a.57.57 0 0 0-.207-.044z"},intercom:{title:"Intercom",fill:"#6AFDEF",d:"M21 0H3C1.343 0 0 1.343 0 3v18c0 1.658 1.343 3 3 3h18c1.658 0 3-1.342 3-3V3c0-1.657-1.342-3-3-3zm-5.801 4.399c0-.44.36-.8.802-.8.44 0 .8.36.8.8v10.688c0 .442-.36.801-.8.801-.443 0-.802-.359-.802-.801V4.399zM11.2 3.994c0-.44.357-.799.8-.799s.8.359.8.799v11.602c0 .44-.357.8-.8.8s-.8-.36-.8-.8V3.994zm-4 .405c0-.44.359-.8.799-.8.443 0 .802.36.802.8v10.688c0 .442-.36.801-.802.801-.44 0-.799-.359-.799-.801V4.399zM3.199 6c0-.442.36-.8.802-.8.44 0 .799.358.799.8v7.195c0 .441-.359.8-.799.8-.443 0-.802-.36-.802-.8V6zM20.52 18.202c-.123.105-3.086 2.593-8.52 2.593-5.433 0-8.397-2.486-8.521-2.593-.335-.288-.375-.792-.086-1.128.285-.334.79-.375 1.125-.09.047.041 2.693 2.211 7.481 2.211 4.848 0 7.456-2.186 7.479-2.207.334-.289.839-.25 1.128.086.289.336.25.84-.086 1.128zm.281-5.007c0 .441-.36.8-.801.8-.441 0-.801-.36-.801-.8V6c0-.442.361-.8.801-.8.441 0 .801.357.801.8v7.195z"},posthog:{title:"PostHog",fill:"currentColor",d:"M9.854 14.5 5 9.647.854 5.5A.5.5 0 0 0 0 5.854V8.44a.5.5 0 0 0 .146.353L5 13.647l.147.146L9.854 18.5l.146.147v-.049c.065.03.134.049.207.049h2.586a.5.5 0 0 0 .353-.854L9.854 14.5zm0-5-4-4a.487.487 0 0 0-.409-.144.515.515 0 0 0-.356.21.493.493 0 0 0-.089.288V8.44a.5.5 0 0 0 .147.353l9 9a.5.5 0 0 0 .853-.354v-2.585a.5.5 0 0 0-.146-.354l-5-5zm1-4a.5.5 0 0 0-.854.354V8.44a.5.5 0 0 0 .147.353l4 4a.5.5 0 0 0 .853-.354V9.854a.5.5 0 0 0-.146-.354l-4-4zm12.647 11.515a3.863 3.863 0 0 1-2.232-1.1l-4.708-4.707a.5.5 0 0 0-.854.354v6.585a.5.5 0 0 0 .5.5H23.5a.5.5 0 0 0 .5-.5v-.6c0-.276-.225-.497-.499-.532zm-5.394.032a.8.8 0 1 1 0-1.6.8.8 0 0 1 0 1.6zM.854 15.5a.5.5 0 0 0-.854.354v2.293a.5.5 0 0 0 .5.5h2.293c.222 0 .39-.135.462-.309a.493.493 0 0 0-.109-.545L.854 15.501zM5 14.647.854 10.5a.5.5 0 0 0-.854.353v2.586a.5.5 0 0 0 .146.353L4.854 18.5l.146.147h2.793a.5.5 0 0 0 .353-.854L5 14.647z"},datadog:{title:"Datadog",fill:"#632CA6",d:"M19.57 17.04l-1.997-1.316-1.665 2.782-1.937-.567-1.706 2.604.087.82 9.274-1.71-.538-5.794zm-8.649-2.498l1.488-.204c.241.108.409.15.697.223.45.117.97.23 1.741-.16.18-.088.553-.43.704-.625l6.096-1.106.622 7.527-10.444 1.882zm11.325-2.712l-.602.115L20.488 0 .789 2.285l2.427 19.693 2.306-.334c-.184-.263-.471-.581-.96-.989-.68-.564-.44-1.522-.039-2.127.53-1.022 3.26-2.322 3.106-3.956-.056-.594-.15-1.368-.702-1.898-.02.22.017.432.017.432s-.227-.289-.34-.683c-.112-.15-.2-.199-.319-.4-.085.233-.073.503-.073.503s-.186-.437-.216-.807c-.11.166-.137.48-.137.48s-.241-.69-.186-1.062c-.11-.323-.436-.965-.343-2.424.6.421 1.924.321 2.44-.439.171-.251.288-.939-.086-2.293-.24-.868-.835-2.16-1.066-2.651l-.028.02c.122.395.374 1.223.47 1.625.293 1.218.372 1.642.234 2.204-.116.488-.397.808-1.107 1.165-.71.358-1.653-.514-1.713-.562-.69-.55-1.224-1.447-1.284-1.883-.062-.477.275-.763.445-1.153-.243.07-.514.192-.514.192s.323-.334.722-.624c.165-.109.262-.178.436-.323a9.762 9.762 0 0 0-.456.003s.42-.227.855-.392c-.318-.014-.623-.003-.623-.003s.937-.419 1.678-.727c.509-.208 1.006-.147 1.286.257.367.53.752.817 1.569.996.501-.223.653-.337 1.284-.509.554-.61.99-.688.99-.688s-.216.198-.274.51c.314-.249.66-.455.66-.455s-.134.164-.259.426l.03.043c.366-.22.797-.394.797-.394s-.123.156-.268.358c.277-.002.838.012 1.056.037 1.285.028 1.552-1.374 2.045-1.55.618-.22.894-.353 1.947.68.903.888 1.609 2.477 1.259 2.833-.294.295-.874-.115-1.516-.916a3.466 3.466 0 0 1-.716-1.562 1.533 1.533 0 0 0-.497-.85s.23.51.23.96c0 .246.03 1.165.424 1.68-.039.076-.057.374-.1.43-.458-.554-1.443-.95-1.604-1.067.544.445 1.793 1.468 2.273 2.449.453.927.186 1.777.416 1.997.065.063.976 1.197 1.15 1.767.306.994.019 2.038-.381 2.685l-1.117.174c-.163-.045-.273-.068-.42-.153.08-.143.241-.5.243-.572l-.063-.111c-.348.492-.93.97-1.414 1.245-.633.359-1.363.304-1.838.156-1.348-.415-2.623-1.327-2.93-1.566 0 0-.01.191.048.234.34.383 1.119 1.077 1.872 1.56l-1.605.177.759 5.908c-.337.048-.39.071-.757.124-.325-1.147-.946-1.895-1.624-2.332-.599-.384-1.424-.47-2.214-.314l-.05.059a2.851 2.851 0 0 1 1.863.444c.654.413 1.181 1.481 1.375 2.124.248.822.42 1.7-.248 2.632-.476.662-1.864 1.028-2.986.237.3.481.705.876 1.25.95.809.11 1.577-.03 2.106-.574.452-.464.69-1.434.628-2.456l.714-.104.258 1.834 11.827-1.424zM15.05 6.848c-.034.075-.085.125-.007.37l.004.014.013.032.032.073c.14.287.295.558.552.696.067-.011.136-.019.207-.023.242-.01.395.028.492.08.009-.048.01-.119.005-.222-.018-.364.072-.982-.626-1.308-.264-.122-.634-.084-.757.068a.302.302 0 0 1 .058.013c.186.066.06.13.027.207m1.958 3.392c-.092-.05-.52-.03-.821.005-.574.068-1.193.267-1.328.372-.247.191-.135.523.047.66.511.382.96.638 1.432.575.29-.038.546-.497.728-.914.124-.288.124-.598-.058-.698m-5.077-2.942c.162-.154-.805-.355-1.556.156-.554.378-.571 1.187-.041 1.646.053.046.096.078.137.104a4.77 4.77 0 0 1 1.396-.412c.113-.125.243-.345.21-.745-.044-.542-.455-.456-.146-.749"},algolia:{title:"Algolia",fill:"#003DFF",d:"M12 0C5.445 0 .103 5.285.01 11.817c-.097 6.634 5.285 12.131 11.92 12.17a11.91 11.91 0 0 0 5.775-1.443.281.281 0 0 0 .052-.457l-1.122-.994a.79.79 0 0 0-.833-.14 9.693 9.693 0 0 1-3.923.77c-5.36-.067-9.692-4.527-9.607-9.888.084-5.293 4.417-9.573 9.73-9.573h9.73v17.296l-5.522-4.907a.407.407 0 0 0-.596.063 4.52 4.52 0 0 1-3.934 1.793 4.538 4.538 0 0 1-4.192-4.168 4.53 4.53 0 0 1 4.512-4.872 4.532 4.532 0 0 1 4.509 4.126c.018.205.11.397.265.533l1.438 1.275a.28.28 0 0 0 .462-.158 6.82 6.82 0 0 0 .099-1.725c-.232-3.376-2.966-6.092-6.345-6.3-3.873-.24-7.11 2.79-7.214 6.588-.1 3.7 2.933 6.892 6.634 6.974a6.75 6.75 0 0 0 4.136-1.294l7.212 6.394a.48.48 0 0 0 .797-.36V.456A.456.456 0 0 0 23.54 0Z"},cloudflare:{title:"Cloudflare",fill:"#F38020",d:"M16.5088 16.8447c.1475-.5068.0908-.9707-.1553-1.3154-.2246-.3164-.6045-.499-1.0615-.5205l-8.6592-.1123a.1559.1559 0 0 1-.1333-.0713c-.0283-.042-.0351-.0986-.021-.1553.0278-.084.1123-.1484.2036-.1562l8.7359-.1123c1.0351-.0489 2.1601-.8868 2.5537-1.9136l.499-1.3013c.0215-.0561.0293-.1128.0147-.168-.5625-2.5463-2.835-4.4453-5.5499-4.4453-2.5039 0-4.6284 1.6177-5.3876 3.8614-.4927-.3658-1.1187-.5625-1.794-.499-1.2026.119-2.1665 1.083-2.2861 2.2856-.0283.31-.0069.6128.0635.894C1.5683 13.171 0 14.7754 0 16.752c0 .1748.0142.3515.0352.5273.0141.083.0844.1475.1689.1475h15.9814c.0909 0 .1758-.0645.2032-.1553l.12-.4268zm2.7568-5.5634c-.0771 0-.1611 0-.2383.0112-.0566 0-.1054.0415-.127.0976l-.3378 1.1744c-.1475.5068-.0918.9707.1543 1.3164.2256.3164.6055.498 1.0625.5195l1.8437.1133c.0557 0 .1055.0263.1329.0703.0283.043.0351.1074.0214.1562-.0283.084-.1132.1485-.204.1553l-1.921.1123c-1.041.0488-2.1582.8867-2.5527 1.914l-.1406.3585c-.0283.0713.0215.1416.0986.1416h6.5977c.0771 0 .1474-.0489.169-.126.1122-.4082.1757-.837.1757-1.2803 0-2.6025-2.125-4.727-4.7344-4.727"},upstash:{title:"Upstash",fill:"#00E9A3",d:"M13.8027 0C11.193 0 8.583.9952 6.5918 2.9863c-3.9823 3.9823-3.9823 10.4396 0 14.4219 1.9911 1.9911 5.2198 1.9911 7.211 0 1.991-1.9911 1.991-5.2198 0-7.211L12 12c.9956.9956.9956 2.6098 0 3.6055-.9956.9955-2.6099.9955-3.6055 0-2.9866-2.9868-2.9866-7.8297 0-10.8164 2.9868-2.9868 7.8297-2.9868 10.8164 0l1.8028-1.8028C19.0225.9952 16.4125 0 13.8027 0zM12 12c-.9956-.9956-.9956-2.6098 0-3.6055.9956-.9955 2.6098-.9955 3.6055 0 2.9867 2.9868 2.9867 7.8297 0 10.8164-2.9867 2.9868-7.8297 2.9868-10.8164 0l-1.8028 1.8028c3.9823 3.9822 10.4396 3.9822 14.4219 0 3.9823-3.9824 3.9823-10.4396 0-14.4219-.9956-.9956-2.3006-1.4922-3.6055-1.4922-1.3048 0-2.6099.4966-3.6054 1.4922-1.9912 1.9912-1.9912 5.2198 0 7.211z"},mixpanel:{title:"Mixpanel",fill:"#7856FF",d:"M6.967 9.996h3.053c-.763-.477-1.048-1.145-1.431-2.384L7.443 3.366C6.919 1.458 6.49.551 4.39.551H.004v1.145h.621c1.286 0 1.431.477 1.814 1.908L3.44 7.326c.524 1.814 1.337 2.67 3.53 2.67h-.003Zm7.06 0h3.053c2.194 0 2.956-.86 3.484-2.67l1.001-3.722c.382-1.431.57-1.908 1.814-1.908H24V.551h-4.34c-2.146 0-2.576.86-3.053 2.815l-1.145 4.246c-.384 1.286-.673 1.907-1.435 2.384Zm-4.007 4.008h4.007V9.996H10.02v4.008ZM0 23.449h4.39c2.1 0 2.529-.907 3.053-2.815l1.146-4.246c.383-1.239.668-1.907 1.431-2.384H6.967c-2.194 0-3.007.86-3.531 2.67l-1.001 3.722c-.383 1.431-.524 1.907-1.814 1.907H0v1.146Zm19.65 0h4.343v-1.146h-.622c-1.239 0-1.431-.476-1.814-1.907l-1.001-3.722c-.524-1.814-1.286-2.67-3.483-2.67h-3.046c.762.477 1.041 1.098 1.424 2.384l1.145 4.246c.477 1.955.907 2.815 3.054 2.815Z"},gemini:{title:"Google Gemini",fill:"#8E75B2",d:"M11.04 19.32Q12 21.51 12 24q0-2.49.93-4.68.96-2.19 2.58-3.81t3.81-2.55Q21.51 12 24 12q-2.49 0-4.68-.93a12.3 12.3 0 0 1-3.81-2.58 12.3 12.3 0 0 1-2.58-3.81Q12 2.49 12 0q0 2.49-.96 4.68-.93 2.19-2.55 3.81a12.3 12.3 0 0 1-3.81 2.58Q2.49 12 0 12q2.49 0 4.68.96 2.19.93 3.81 2.55t2.55 3.81"}};var y1=u0(wJ(),1),qV="https://brand.volter.ai/logo/twin-world/svg?size=64&variant=mono";function rq({href:Q,onClick:U}){return y1.jsxDEV("h1",{children:y1.jsxDEV("a",{href:Q,onClick:U,children:[y1.jsxDEV("img",{src:qV,alt:"",width:24,height:24,style:{verticalAlign:"middle"}},void 0,!1,void 0,this),y1.jsxDEV("span",{className:"brand-name",children:" Volter World"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}async function z5(Q){return(await Q.json().catch(()=>({}))).error??`answered ${Q.status}`}function AR(Q,U,Z=0,K=""){let[X,W]=_2.useState({state:"loading"});return _2.useEffect(()=>{W({state:"loading"})},[K,U]),_2.useEffect(()=>{if(!U)return;let z=!0;return(async()=>{try{let B=await Q(U),O=B.ok?{state:"ok",data:await B.json()}:{state:"error",status:B.status,error:await z5(B)};if(z)W(O)}catch(B){if(z)W({state:"error",status:0,error:String(B)})}})(),()=>{z=!1}},[K,U,Z]),X}function B5({load:Q,what:U,retry:Z,lines:K=3}){if(Q.state==="loading")return y1.jsxDEV(UV,{lines:K,label:`Loading ${U}…`},void 0,!1,void 0,this);if(Q.state==="error")return y1.jsxDEV("div",{role:"alert",className:"error-state",children:[y1.jsxDEV("span",{children:["Could not read ",U,": ",Q.error]},void 0,!0,void 0,this),Z?y1.jsxDEV("button",{type:"button",onClick:Z,children:"Try again"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this);return null}function UV({lines:Q=3,label:U="Loading…"}){return y1.jsxDEV("div",{className:"skeleton",role:"status","aria-label":U,children:Array.from({length:Q},(Z,K)=>y1.jsxDEV("span",{style:{width:`${[92,76,84,64,88][K%5]}%`}},K,!1,void 0,this))},void 0,!1,void 0,this)}function h0({iso:Q,time:U}){if(!Q)return y1.jsxDEV("span",{children:"—"},void 0,!1,void 0,this);let Z=new Date(Q);return y1.jsxDEV("time",{dateTime:Q,title:Q,children:Number.isNaN(Z.getTime())?Q:U?Z.toLocaleTimeString():Z.toLocaleString()},void 0,!1,void 0,this)}var IJ=(Q)=>Q?new Date(Q).toLocaleString():"—";function dq(Q){let U=Q?Date.parse(Q):Number.NaN;if(Number.isNaN(U))return"—";let Z=Math.max(0,Math.round((Date.now()-U)/1000));return Z<60?"just now":Z<3600?`${Math.round(Z/60)}m ago`:Z<86400?`${Math.round(Z/3600)}h ago`:`${Math.round(Z/86400)}d ago`}function J9(Q,U){let Z=U.replace(/[_-]+/g," "),K=Z.endsWith("s")?Z:/[^aeiou]y$/.test(Z)?`${Z.slice(0,-1)}ies`:/(ch|sh|x)$/.test(Z)?`${Z}es`:`${Z}s`;return`${Q} ${Q===1?Z:K}`}var EX=(Q)=>Q.length<=1?Q.join(""):`${Q.slice(0,-1).join(", ")} and ${Q[Q.length-1]}`,GV={github:"GitHub",openai:"OpenAI",aws:"AWS",hubspot:"HubSpot",paypal:"PayPal",youtube:"YouTube",tiktok:"TikTok",linkedin:"LinkedIn",xai:"xAI",sendgrid:"SendGrid",elevenlabs:"ElevenLabs",assemblyai:"AssemblyAI",planetscale:"PlanetScale",googleoauth:"Google sign-in",npm:"npm","npm-registry":"npm registry",posthog:"PostHog",mongodb:"MongoDB",pagerduty:"PagerDuty",mailgun:"Mailgun",turbopuffer:"turbopuffer"},F0=(Q)=>GV[Q]??Q.charAt(0).toUpperCase()+Q.slice(1);function A5({vendor:Q}){let U=zR[Q];return y1.jsxDEV("span",{className:U?"mark logo":"mark","aria-hidden":"true",children:U?y1.jsxDEV("svg",{viewBox:"0 0 24 24",children:y1.jsxDEV("path",{d:U.d,fill:U.fill},void 0,!1,void 0,this)},void 0,!1,void 0,this):F0(Q).charAt(0)},void 0,!1,void 0,this)}var BR=(Q)=>{Q.currentTarget.closest("details")?.removeAttribute("open")},DX="volter.theme",LR=()=>{try{let Q=localStorage.getItem(DX);return Q==="light"||Q==="dark"?Q:"system"}catch{return"system"}};function bX(Q=LR()){let U=document.documentElement;if(Q==="system")U.removeAttribute("data-theme");else U.setAttribute("data-theme",Q)}function MR(){let[Q,U]=_2.useState(LR),Z=(K)=>{try{if(K==="system")localStorage.removeItem(DX);else localStorage.setItem(DX,K)}catch{}bX(K),U(K)};return y1.jsxDEV("div",{className:"theme-choice",role:"radiogroup","aria-label":"Theme",children:["system","light","dark"].map((K)=>y1.jsxDEV("button",{type:"button",role:"radio","aria-checked":Q===K,onClick:()=>Z(K),children:K==="system"?"System":K==="light"?"Light":"Dark"},K,!1,void 0,this))},void 0,!1,void 0,this)}function TR(){return _2.useEffect(()=>{let Q=()=>[...document.querySelectorAll("details.menu[open], details.clock-more[open]")],U=(K)=>{if(K.key!=="Escape"||document.querySelector("dialog[open]"))return;let X=Q();if(!X.length)return;for(let W of X)W.removeAttribute("open");X[X.length-1].querySelector("summary")?.focus()},Z=(K)=>{let X=K.target;for(let W of Q())if(!X||!W.contains(X))W.removeAttribute("open")};return document.addEventListener("keydown",U),document.addEventListener("click",Z),()=>{document.removeEventListener("keydown",U),document.removeEventListener("click",Z)}},[]),null}function S8({open:Q,onClose:U,title:Z,children:K,footer:X,wide:W}){let z=_2.useRef(null),B=_2.useId();return _2.useEffect(()=>{let O=z.current;if(!O)return;if(Q&&!O.open){O.showModal();let T=O.querySelector(".dialog-body :is(input:not([type=hidden]):not([disabled]), select, textarea)");if(T?.focus(),T instanceof HTMLInputElement&&T.value&&/^(text|search|email|url)$/.test(T.type))T.select()}if(!Q&&O.open)O.close()},[Q]),y1.jsxDEV("dialog",{ref:z,className:W?"dialog wide":"dialog","aria-labelledby":B,onClose:U,onCancel:(O)=>{O.preventDefault(),U()},onMouseDown:(O)=>{if(O.target===z.current)U()},children:Q?y1.jsxDEV(y1.Fragment,{children:[y1.jsxDEV("div",{className:"dialog-head",children:[y1.jsxDEV("h2",{id:B,children:Z},void 0,!1,void 0,this),y1.jsxDEV("button",{type:"button",className:"icon-button","aria-label":"Close",onClick:U,children:"✕"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),y1.jsxDEV("div",{className:"dialog-body",children:K},void 0,!1,void 0,this),X?y1.jsxDEV("div",{className:"dialog-foot",children:X},void 0,!1,void 0,this):null]},void 0,!0,void 0,this):null},void 0,!1,void 0,this)}var yX="volter:confirm";function o5(Q){return new Promise((U)=>{window.dispatchEvent(new CustomEvent(yX,{detail:{ask:Q,resolve:U}}))})}function RR(){let[Q,U]=_2.useState(null),[Z,K]=_2.useState("");_2.useEffect(()=>{let B=(O)=>{K(""),U(O.detail)};return window.addEventListener(yX,B),()=>window.removeEventListener(yX,B)},[]);let X=(B)=>{Q?.resolve(B),U(null)},W=Q?.ask,z=!W?.typed||Z===W.typed;return y1.jsxDEV(S8,{open:Boolean(Q),onClose:()=>X(!1),title:W?.title??"",footer:y1.jsxDEV(y1.Fragment,{children:[y1.jsxDEV("button",{type:"button",onClick:()=>X(!1),children:"Cancel"},void 0,!1,void 0,this),y1.jsxDEV("button",{type:"button",className:W?.danger?"danger-button":"primary",disabled:!z,onClick:()=>X(!0),children:W?.action},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:[W?.body?y1.jsxDEV("div",{className:"confirm-body",children:W.body},void 0,!1,void 0,this):null,W?.typed?y1.jsxDEV("div",{className:"typed-confirm",children:[y1.jsxDEV("p",{children:["Type ",y1.jsxDEV("code",{children:W.typed},void 0,!1,void 0,this)," to confirm."]},void 0,!0,void 0,this),y1.jsxDEV("input",{autoFocus:!0,"aria-label":`Type ${W.typed} to confirm`,value:Z,onChange:(B)=>K(B.target.value),onKeyDown:(B)=>{if(B.key==="Enter"&&z)X(!0)},autoComplete:"off",spellCheck:!1},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)}var vX="volter:toast";function t2(Q,U="ok"){window.dispatchEvent(new CustomEvent(vX,{detail:{text:Q,kind:U}}))}function OR(){let[Q,U]=_2.useState([]);return _2.useEffect(()=>{let Z=0,K=(X)=>{let{text:W,kind:z}=X.detail,B=++Z;if(U((O)=>[...O.slice(-3),{id:B,text:W,kind:z}]),z!=="error")setTimeout(()=>U((O)=>O.filter((T)=>T.id!==B)),4500)};return window.addEventListener(vX,K),()=>window.removeEventListener(vX,K)},[]),y1.jsxDEV("div",{className:"toasts",role:"region","aria-label":"Notifications",children:Q.map((Z)=>y1.jsxDEV("div",{className:`toast ${Z.kind}`,role:Z.kind==="error"?"alert":"status",children:[y1.jsxDEV("span",{children:Z.text},void 0,!1,void 0,this),y1.jsxDEV("button",{type:"button",className:"icon-button","aria-label":"Dismiss",onClick:()=>U((K)=>K.filter((X)=>X.id!==Z.id)),children:"✕"},void 0,!1,void 0,this)]},Z.id,!0,void 0,this))},void 0,!1,void 0,this)}function uX({value:Q,label:U,secret:Z}){let[K,X]=_2.useState(!1);return y1.jsxDEV("div",{className:"copy-field",children:[U?y1.jsxDEV("span",{className:"copy-label",children:U},void 0,!1,void 0,this):null,y1.jsxDEV("div",{className:"copy-row",children:[y1.jsxDEV("input",{readOnly:!0,value:Q,"aria-label":U??"Value",onFocus:(z)=>z.currentTarget.select(),spellCheck:!1},void 0,!1,void 0,this),y1.jsxDEV("button",{type:"button",onClick:()=>{navigator.clipboard?.writeText(Q).then(()=>{X(!0),setTimeout(()=>X(!1),1600),t2(Z?"Copied. Keep it somewhere safe":"Copied")}).catch(()=>t2("Your browser would not copy it: select it and copy","error"))},children:K?"Copied":"Copy"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function xX({label:Q,items:U}){return y1.jsxDEV("details",{className:"menu row-menu",children:[y1.jsxDEV("summary",{className:"icon-button",role:"button","aria-haspopup":"menu","aria-label":Q,title:Q,children:"⋯"},void 0,!1,void 0,this),y1.jsxDEV("div",{className:"popover menu-list",role:"menu",children:U.filter((Z)=>Boolean(Z)).map((Z)=>Z.href?y1.jsxDEV("a",{role:"menuitem",href:Z.href,className:Z.danger?"danger-item":void 0,onClick:BR,children:Z.label},Z.label,!1,void 0,this):y1.jsxDEV("button",{type:"button",role:"menuitem",disabled:Z.disabled,className:Z.danger?"danger-item":void 0,onClick:(K)=>{BR(K),Z.onSelect?.()},children:Z.label},Z.label,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function wR({title:Q,children:U,action:Z}){return y1.jsxDEV("div",{className:"empty-state",children:[y1.jsxDEV("p",{className:"empty-title",children:Q},void 0,!1,void 0,this),U?y1.jsxDEV("div",{className:"empty-body",children:U},void 0,!1,void 0,this):null,Z?y1.jsxDEV("div",{className:"empty-action",children:Z},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}function IR(){return _2.useEffect(()=>{let Q=(Z)=>{let K=document.querySelector("main.app"),X=Z.target;if(K?.hasAttribute("data-drawer")&&X&&!X.closest(".side")&&!X.closest(".drawer-button"))K.removeAttribute("data-drawer")},U=(Z)=>{if(Z.key==="Escape")ZV()};return document.addEventListener("click",Q),document.addEventListener("keydown",U),()=>{document.removeEventListener("click",Q),document.removeEventListener("keydown",U)}},[]),y1.jsxDEV("button",{type:"button",className:"icon-button drawer-button","aria-label":"Menu",onClick:()=>{document.querySelector("main.app")?.toggleAttribute("data-drawer")},children:"☰"},void 0,!1,void 0,this)}var ZV=()=>{document.querySelector("main.app")?.removeAttribute("data-drawer")};var ER=u0(CR(),1);function mX(Q={}){let U=(K,X)=>Q.tools?`${X} (\`${K}\`)`:`\`${K}\``,Z=["Set up Volter World for this app, so its calls to Stripe, Slack, GitHub, OpenAI and the other services it uses go to local twins instead of the real APIs. The app keeps its real SDKs and code.","",Q.tools?"1. You have the Volter World tools (volter mcp). If the `volter` command is missing, install it: `npm install -g @volter/world`.":"1. Install the command and your agent tooling: `npm install -g @volter/world`, then `volter agents install --yes`.",`2. In the app's folder, ${U("volter world init --install","world_init")}: it detects the vendors the app calls and installs their twins. Show me the vendors it detected and why, before keeping them.`,`3. ${Q.tools?"Start it with world_up":"Start it: `volter world up`"}, then run the tests inside it: ${U("volter world run -- <the test command>","world_run")}. Fix anything that fails because a call went to the real service.`,`4. Tell me what the app did at each vendor (${U("volter world log","world_log")}), and give me the dashboard link (${Q.tools?"world_view":"`volter world view --no-open`, started in the background: it keeps running"}).`];if(Q.platform){let K=Q.world??"<org>/<world>";Z.push(`5. Share it with my team on ${Q.platform}: ${U(`volter login ${Q.platform}`,"platform_login")} gives a link and a code for me to approve in my browser. Once I have, link it with ${U(`volter remote add origin ${K} --create`,"remote_link with create: true")}${Q.world?"":" (ask me for <org>/<world>)"}, then send what the app did: ${U('volter world changeset -m "<what and why>"',"world_changeset")} and ${U("volter world push","world_push")}.`)}return Z.push("","The guide: https://world.volter.ai/docs/guides/use-with-a-coding-agent.md"),Z.join(`
248
+ `)}var H=u0(wJ(),1),iq="volter.console.token",NJ=document.getElementById("root"),q0=NJ.dataset.base??"/-/console",B0=window.location.origin,w6=(NJ.dataset.worlds??B0).replace(/\/+$/,""),bR=(NJ.dataset.names??"").split(",").filter((Q)=>Q!==""),R6=NJ.dataset.worldOrigin==="1",k8=window.fetch.bind(window),O6="(session)",uR="(pass)",fJ=(Q)=>{try{if(Q&&!R6)sessionStorage.setItem(iq,Q);else sessionStorage.removeItem(iq);localStorage.removeItem(iq)}catch{}},xR="volter.console.portal",hR=(Q)=>{try{if(typeof Q==="string"&&/^https?:$/.test(new URL(Q).protocol))sessionStorage.setItem(xR,new URL(Q).origin)}catch{}},HV=()=>{return y8.get("token")??""},o2=()=>{try{let Q=sessionStorage.getItem(xR)??"";return Q&&/^https?:$/.test(new URL(Q).protocol)?new URL(Q).origin:""}catch{return""}},YV=()=>{let Q=HV();if(R6){if(fJ(""),y8.get("pass"))return uR;let U=new URLSearchParams(window.location.search).has("signin");if(U)try{window.history.replaceState(null,"",window.location.pathname+window.location.hash)}catch{}return Q||(U?"":O6)}if(Q)return fJ(Q),Q;try{return sessionStorage.getItem(iq)??""}catch{return""}};async function X0(Q,U,Z={}){return k8(`${B0}${U}`,{...Z,headers:{...Z.headers??{},...Q===O6?{}:{"x-volter-token":Q},...Z.body&&!Z.headers?.["content-type"]?{"content-type":"application/json"}:{}}})}function L5(Q,U,Z=0){return AR((K)=>X0(Q,K),U,Z,Q)}var U9=(Q)=>{let U=new Date(Q),Z=(K)=>String(K).padStart(2,"0");return`${U.getFullYear()}-${Z(U.getMonth()+1)}-${Z(U.getDate())}T${Z(U.getHours())}:${Z(U.getMinutes())}`},SR=(Q)=>new Date(Math.ceil(Date.parse(Q)/60000)*60000).toISOString(),nq=(Q)=>Q.operation==="observed"?`observed${Q.provenance==="placeholder"?" (default data)":" (vendor)"}`:Q.receipt?`${Q.receipt.status??""} ${Q.receipt.externalId??""} ${Q.receipt.reason??""}`.trim():Q.provenance==="placeholder"?"default data":"unpushed",mR=(Q)=>Q.actor?`${Q.actor.kind}${Q.actor.id?` ${Q.actor.id}`:""}`:"—",gR=(Q)=>{let U=/^[0-9a-f]{2}-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2}$/.exec(Q??"");return U?{trace:U[1],span:U[2]}:null},lX="volter.console.snapshots",L3=()=>{try{return JSON.parse(sessionStorage.getItem(lX)??"{}")}catch{return{}}},pR=new Map,rX=(Q)=>{if(R6){if(Q.token||Q.readToken)pR.set(Q.name,{token:Q.token,readToken:Q.readToken});Q={...Q,token:"",readToken:""}}try{sessionStorage.setItem(lX,JSON.stringify({...L3(),[Q.name]:Q}))}catch{}},cR=(Q)=>pR.get(Q)?.readToken||L3()[Q]?.readToken||"",PJ=(Q)=>{try{let U=L3();delete U[Q],sessionStorage.setItem(lX,JSON.stringify(U))}catch{}},y8=new URLSearchParams(window.location.hash.slice(1)),Q9=y8.get("close")??"";function CJ(Q){if(typeof Q!=="string")return null;let U;try{U=new URL(Q)}catch{return null}return(U.protocol==="http:"||U.protocol==="https:")&&U.origin===Q.replace(/\/+$/,"")?U:null}function dX(Q){let U=CJ(Q);if(!U)return null;let Z=new URL(B0);if(U.protocol!==Z.protocol||U.port!==Z.port)return null;if(U.hostname===Z.hostname)return U.origin;let K=/^[a-z0-9](?:[a-z0-9]|-(?!-))*--[a-z0-9](?:[a-z0-9]|-(?!-))*\./;if(!K.test(U.hostname))return null;let X=U.hostname.replace(K,"");return X===Z.hostname||K.test(Z.hostname)&&X===Z.hostname.replace(K,"")?U.origin:null}function WV(Q){let U;try{U=JSON.parse(Q)}catch{return null}let Z=/^[a-z0-9][a-z0-9-]*\/[a-z0-9][a-z0-9-]*$/i;if(typeof U.name!=="string"||!Z.test(U.name)||typeof U.parent!=="string"||!Z.test(U.parent)||typeof U.at!=="string")return null;let K=U.parentOrigin===void 0?void 0:dX(U.parentOrigin);return{name:U.name,parent:U.parent,token:typeof U.token==="string"?U.token:"",readToken:typeof U.readToken==="string"?U.readToken:"",at:U.at,expiresAt:typeof U.expiresAt==="string"?U.expiresAt:null,...K?{parentOrigin:K}:{}}}{let Q=y8.get("snapshot");if(Q){let U=WV(Q);if(U&&!L3()[U.name])rX(U)}}var lR="volter.console.home",rR=(Q)=>{let U=CJ(Q);if(!U)return null;let Z=new URL(B0).hostname,K=Z.replace(/^[a-z0-9](?:[a-z0-9]|-(?!-))*--[a-z0-9](?:[a-z0-9]|-(?!-))*\./,"");return U.hostname===Z||U.hostname===K?U.origin:null};{let Q=rR(y8.get("home"));if(Q)try{sessionStorage.setItem(lR,Q)}catch{}}if(["token","pass","portal","snapshot","home","close"].some((Q)=>y8.has(Q)))try{window.history.replaceState(null,"",window.location.pathname+window.location.search)}catch{}var q9=()=>{try{return rR(sessionStorage.getItem(lR))??""}catch{return""}};function iX(Q,U,Z,K){let X=new URLSearchParams({token:U,home:q9()||B0}),W=L3()[Z];if(W)X.set("snapshot",JSON.stringify(W));window.location.replace(`${Q}${K??`${window.location.pathname}${window.location.search}`}#${X.toString()}`)}function V8(){return window.location.pathname.slice(q0.length).split("/").filter(Boolean).map((Q)=>{try{return decodeURIComponent(Q)}catch{return""}})}var jR=/^[a-z0-9](?:[a-z0-9]|-(?!-))*$/i,T6=(Q,U)=>Q&&U&&jR.test(Q)&&jR.test(U)?`${Q}/${U}`:"";function v0(Q){window.history.pushState(null,"",`${q0}/${Q.map(encodeURIComponent).join("/")}`),window.dispatchEvent(new PopStateEvent("popstate"))}function cX(Q,U){let Z=dX(L3()[Q]?.origin);if(Z&&Z!==B0){iX(Z,cR(Q),Q,`${q0}/${U.map(encodeURIComponent).join("/")}`);return}v0(U)}async function VR(){let[Q,U]=V8(),Z=T6(Q,U),K=Z?[Z]:bR;if(K.length===0){let X=await k8(`${B0}/-/ping`).catch(()=>null);K=X?.ok?(await X.json().catch(()=>({}))).worlds??[]:[]}K=K.filter((X)=>{let[W,z,...B]=X.split("/");return B.length===0&&T6(W,z)===X});for(let X of K){let W=await k8(`${B0}/-/${X}/session`,{method:"POST"}).catch(()=>null);if(!W)continue;let z=await W.json().catch(()=>({})),B=CJ(z.origin)?.origin;if(W.status===409&&B&&B!==B0)return window.location.replace(`${B}${q0}/${X}`),"moved";if(W.ok&&z.local)return{token:typeof z.token==="string"&&z.token?z.token:O6}}return null}function zV(){let[Q,U]=B1.useState(YV()),[Z,K]=B1.useState(!1),[X,W]=B1.useState(!1),[z,B]=B1.useState(""),[O,T]=B1.useState(null),[R,L]=B1.useState(null),[M,f]=B1.useState(V8());B1.useEffect(()=>{let x=()=>f(V8());return window.addEventListener("popstate",x),()=>window.removeEventListener("popstate",x)},[]),B1.useEffect(()=>{let[x,d]=V8(),g=T6(x,d),[n,j]=g?g.split("/"):[],i=L3()[Q9];if(!Q9||!Q||!n||!j||!i?.made||i.parent!==`${n}/${j}`||T6(...Q9.split("/"))!==Q9)return;try{window.history.replaceState(null,"",window.location.pathname+window.location.search)}catch{}X0(Q,`/-/${n}/${j}/branches/${Q9}`,{method:"DELETE"}).catch(()=>null).then(()=>PJ(Q9))},[Q]);let I=B1.useCallback(async(x)=>{if(L(null),!x){let j=await VR();if(j==="moved")return;if(j){if(K(!0),j.token!==O6)fJ(j.token);U(j.token);return}T(null),W(!0);return}if(R6&&x===O6){let j=await VR();if(j==="moved")return;if(j)K(!0)}if(R6&&x===uR){let[j,i]=V8(),q1=T6(j,i),[Q1,Y1]=q1?q1.split("/"):[],L1=Q1&&Y1?await k8(`${B0}/-/${Q1}/${Y1}/session`,{method:"POST",headers:{"x-volter-pass":y8.get("pass")??""}}).catch(()=>null):null;if(!L1){L(`${B0} did not answer: no session was opened`),T(null);return}if(!L1.ok){L(`${await z5(L1)}. Open it again from the platform.`),T(null);return}hR((await L1.json().catch(()=>({}))).issuer),U(O6);return}if(R6&&x!==O6){let[j,i]=V8(),q1=T6(j,i),[Q1,Y1]=q1?q1.split("/"):[],L1=Q1&&Y1?await k8(`${B0}/-/${Q1}/${Y1}/session`,{method:"POST",headers:{"x-volter-token":x}}).catch(()=>null):null;if(!L1){L(`${B0} did not answer: no session was opened`),T(null);return}if(!L1.ok){let M1=await z5(L1);L(L1.status===401||L1.status===403?`That token does not open ${Q1}/${Y1}.`:L1.status===409?`${Q1}/${Y1}'s session lives at another origin: ${M1}`:`The World could not open a session (${L1.status}): ${M1}`),T(null);return}U(O6);return}let d=R6?new Response(null,{status:404}):await X0(x,"/-/worlds");if(d.ok){let{worlds:j}=await d.json();T({kind:"admin",worlds:j});return}if(d.status===429){L("You are asking faster than the platform allows — wait a moment and reload."),T(null);return}if(d.status>=500){let j=await d.json().catch(()=>({}));L(`The platform could not list your worlds${j.error?`: ${j.error}`:""}. Reload; if it stays, the status page says what is wrong.`),T(null);return}let g=bR;if(g.length===0){let j=await k8(`${B0}/-/ping`);if(!j.ok){L(`${B0} does not answer as a host`),T(null);return}if(g=(await j.json()).worlds??[],g.length===0){L(`${B0} does not list its worlds: open the console with the World's URL (volter world console <url>/<org>/<world>)`),T(null);return}}let n=[];for(let j of g){let i=await X0(x,`/-/${j}/twins`);if(i.ok){let q1=await i.json();n.push({name:j,base:`${w6}/${j}`,twins:(q1.twins??[]).map((Q1)=>({vendor:Q1.twin,protocol:Q1.protocol??null,root:Q1.root??null}))})}}if(n.length===0){L("This link or key opens no World here: it was revoked, or it has ended."),T(null);return}T({kind:"world",worlds:n})},[]);B1.useEffect(()=>{I(Q)},[Q,I]);let D=(x)=>O?.kind==="admin"?O.worlds.find((d)=>d.name===x)?.token??Q:Q,[V,k]=B1.useState("");if(!Q||!O&&!R)return H.jsxDEV("main",{children:[H.jsxDEV(rq,{href:`${q0}/`},void 0,!1,void 0,this),Q&&!O&&!R||!Q&&!X?H.jsxDEV("p",{children:"Opening…"},void 0,!1,void 0,this):H.jsxDEV("form",{onSubmit:(x)=>{x.preventDefault(),fJ(z.trim()),U(z.trim())},children:[H.jsxDEV("p",{children:"A host's admin token opens every world it serves; a world's token opens that world."},void 0,!1,void 0,this),H.jsxDEV("label",{children:["Token ",H.jsxDEV("input",{name:"token",type:"password",value:z,onChange:(x)=>B(x.target.value),autoFocus:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("button",{type:"submit",children:"Open"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this);let h=()=>{if(Z){window.location.reload();return}if(R6){let[x,d]=V8(),g=T6(x,d),[n,j]=g?g.split("/"):[],i=()=>window.location.replace(o2()?`${o2()}/`:`${B0}${q0}/${n&&j?`${n}/${j}`:""}?signin`);if(setTimeout(i,2000),n&&j)k8(`${B0}/-/${n}/${j}/session/end`,{method:"POST"}).catch(()=>null).then(i);else i();return}if(O)for(let x of O.worlds)navigator.sendBeacon(`${x.base.replace(/\/[^/]+\/[^/]+$/,"")}/-/${x.name}/session/end`);fJ(""),U(""),B(""),T(null),v0([])};if(R||!O)return H.jsxDEV("main",{children:[H.jsxDEV(rq,{href:`${q0}/`},void 0,!1,void 0,this),H.jsxDEV("p",{role:"alert",children:R??"nothing answered"},void 0,!1,void 0,this),o2()?H.jsxDEV("a",{className:"button",href:`${o2()}/`,children:["Back to ",new URL(o2()).host]},void 0,!0,void 0,this):H.jsxDEV("button",{onClick:h,children:Z?"Try again":"Use another token"},void 0,!1,void 0,this)]},void 0,!0,void 0,this);let[P,C,v,b,E]=M,p=v==="~",a=/^[A-Za-z0-9_-]+$/,m=p||!v||!a.test(v)?void 0:v,_1=E&&a.test(E)?E:void 0,$1=T6(P,C),J1=$1?L3()[$1]??null:null,y=(x)=>cR(x)||D(x),u=async(x)=>{let d=dX(x.parentOrigin);if(d&&d!==B0){PJ(x.name),window.location.assign(`${d}${q0}/${x.parent}#close=${encodeURIComponent(x.name)}`);return}if(x.made)await X0(D(x.parent),`/-/${x.parent}/branches/${x.name}`,{method:"DELETE"}).catch(()=>null),PJ(x.name);v0(x.parent.split("/"))};return H.jsxDEV("main",{className:$1?"app":void 0,children:[H.jsxDEV("header",{children:[$1?H.jsxDEV(IR,{},void 0,!1,void 0,this):null,H.jsxDEV(rq,{href:`${q9()&&q9()!==B0?q9():""}${q0}/`,onClick:(x)=>{if(q9()&&q9()!==B0)return;x.preventDefault(),v0([])}},void 0,!1,void 0,this),H.jsxDEV("nav",{"aria-label":"breadcrumb",className:"crumbs",children:[$1?H.jsxDEV(H.Fragment,{children:[H.jsxDEV("span",{className:"crumb-sep","aria-hidden":"true",children:"/"},void 0,!1,void 0,this),H.jsxDEV("span",{children:$1.split("/")[0]},void 0,!1,void 0,this),H.jsxDEV("span",{className:"crumb-sep","aria-hidden":"true",children:"/"},void 0,!1,void 0,this),H.jsxDEV("a",{href:`${q0}/${$1}`,className:"crumb-world",onClick:(x)=>{x.preventDefault(),v0($1.split("/"))},children:$1.split("/")[1]},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,m?H.jsxDEV("span",{children:[" / ",m]},void 0,!0,void 0,this):null,p&&b==="trace"?H.jsxDEV("span",{children:" / trace"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),o2()?H.jsxDEV("a",{href:`${o2()}/${$1?encodeURIComponent($1.split("/")[0]):""}`,title:`Back to the platform at ${new URL(o2()).host}`,className:"back-link",children:["← ",H.jsxDEV("span",{className:"back-text",children:$1?`${$1.split("/")[0]}'s Worlds`:new URL(o2()).host},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,H.jsxDEV("span",{className:"mode",children:Z?"on this machine":J1?"a snapshot, read only":V?`signed in as ${V}`:O.kind==="admin"?"host: admin":"opened with a link or key"},void 0,!1,void 0,this),Z?null:H.jsxDEV("button",{onClick:h,children:"Sign out"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$1?H.jsxDEV(MV,{name:$1,token:y($1),twin:m,tab:p?b??"overview":"overview",arg:p?_1:void 0,admin:J1?null:O.kind==="admin"?Q:null,snapshot:J1,onReturn:u,opens:(x)=>!!L3()[x]||O.kind==="admin"&&O.worlds.some((d)=>d.name===x),onRemoved:()=>{I(Q),v0([])},onWho:k},$1,!1,void 0,this):H.jsxDEV(BV,{mode:O,admin:O.kind==="admin"?Q:null,reload:()=>I(Q)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function BV({mode:Q,admin:U,reload:Z}){let[K,X]=B1.useState(""),[W,z]=B1.useState(""),[B,O]=B1.useState(""),[T,R]=B1.useState(null),L=async(V)=>{if(!await o5({title:`Rotate the tokens of ${V}?`,body:"Every app, script and person holding the current tokens loses access at once. The new ones are shown once.",action:"Rotate tokens",danger:!0}))return;let k=await X0(U,`/-/worlds/${V}/rotate`,{method:"POST"}),h=await k.json().catch(()=>({}));R(k.ok?`rotated ${V}: the new tokens are shown once — token ${h.token} · read token ${h.readToken}`:h.error??`answered ${k.status}`),await Z()},M=async(V)=>{let k=await X0(U,`/-/worlds/${V}`,{method:"DELETE"}),h=await k.json().catch(()=>({}));R(k.ok?`removed ${V}`:h.error??`answered ${k.status}`),await Z()},[f,I]=B1.useState(!1),D=async(V)=>{V.preventDefault(),R(null),I(!0);try{let k=await X0(U,"/-/worlds",{method:"POST",body:JSON.stringify({org:K,world:W,vendors:B.split(",").map((P)=>P.trim()).filter(Boolean)})}),h=await k.json();if(!k.ok){R(h.error??`the host answered ${k.status}`);return}R(`provisioned ${h.name}`),z(""),O(""),await Z()}finally{I(!1)}};return H.jsxDEV("section",{"aria-labelledby":"worlds",children:[H.jsxDEV("h2",{id:"worlds",children:"Worlds"},void 0,!1,void 0,this),H.jsxDEV("p",{className:"lede",children:"A World is a copy of the services your app uses (Stripe, Slack, GitHub…), with none of the real consequences: your app talks to it, and you can see everything it did on each vendor's own screens."},void 0,!1,void 0,this),H.jsxDEV("table",{children:[H.jsxDEV("thead",{children:H.jsxDEV("tr",{children:[H.jsxDEV("th",{children:"world"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"address"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"stand-ins for"},void 0,!1,void 0,this),U?H.jsxDEV("th",{children:"actions"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("tbody",{children:Q.worlds.map((V)=>H.jsxDEV("tr",{children:[H.jsxDEV("td",{children:H.jsxDEV("a",{href:`${q0}/${V.name}`,onClick:(k)=>{k.preventDefault(),v0(V.name.split("/"))},children:V.name},void 0,!1,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("td",{children:H.jsxDEV("code",{children:V.base},void 0,!1,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("td",{children:V.twins.map((k)=>F0(k.vendor)).join(", ")||"—"},void 0,!1,void 0,this),U?H.jsxDEV("td",{children:[H.jsxDEV("button",{type:"button","aria-label":`Rotate the tokens of ${V.name}`,onClick:()=>void L(V.name),children:"Rotate tokens"},void 0,!1,void 0,this)," ",H.jsxDEV("button",{type:"button","aria-label":`Remove ${V.name}`,onClick:()=>void o5({title:`Remove ${V.name}?`,body:"The host stops serving it and its whole history goes with it. This cannot be undone.",action:"Remove World",danger:!0,typed:V.name}).then((k)=>{if(k)M(V.name)}),children:"Remove world"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},V.name,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),U?H.jsxDEV("form",{onSubmit:D,"aria-labelledby":"provision",children:[H.jsxDEV("h3",{id:"provision",children:"Provision a world"},void 0,!1,void 0,this),H.jsxDEV("label",{children:["Org ",H.jsxDEV("input",{name:"org",value:K,onChange:(V)=>X(V.target.value),required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("label",{children:["World ",H.jsxDEV("input",{name:"world",value:W,onChange:(V)=>z(V.target.value),required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("label",{children:["Twins ",H.jsxDEV("input",{name:"vendors",value:B,onChange:(V)=>O(V.target.value),placeholder:"github, slack",required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("button",{type:"submit",disabled:f,children:f?"Provisioning… (a host boots the world; ten seconds or so)":"Provision"},void 0,!1,void 0,this),T?H.jsxDEV("p",{role:"status",children:T},void 0,!1,void 0,this):null]},void 0,!0,void 0,this):T?H.jsxDEV("p",{role:"status",children:T},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}var gX=[["overview","Dashboard"],["branches","Branches"],["settings","Settings"],["branch","Overview"],["changes","Changes"],["changesets","Changesets"],["activity","Activity"],["vendors","Vendors"],["canvas","All screens"]],AV={dashboard:"overview",mirrors:"vendors",screens:"canvas",timeline:"activity",monitoring:"activity",trace:"activity",operations:"settings"},D8=(Q,U)=>`${w6}/${Q}/${U}/`,kR={verify:"verified",use:"used",issue:"issued",revoke:"revoked",rotate:"rotated",seed:"seeded",upsert:"saved",set:"set",start:"started",finish:"finished",fail:"failed",schedule:"scheduled",deliver:"delivered",like:"liked",follow:"followed",reply:"replied",create:"created",update:"updated",delete:"deleted",record:"recorded",remove:"removed",add:"added",send:"sent",post:"posted",postmessage:"posted",cancel:"canceled",close:"closed",open:"opened",publish:"published",upload:"uploaded",invite:"invited",archive:"archived",merge:"merged",refund:"refunded",capture:"captured",confirm:"confirmed",pay:"paid"};function n5(Q){let U=Q.operation??Q.op,Z=(U.includes(".")?U.slice(U.lastIndexOf(".")+1):U).toLowerCase(),K=Q.subject.type.replace(/[_-]+/g," ").trim(),X=`${K.charAt(0).toUpperCase()}${K.slice(1)}`,W=/(^|\.)twin\./.test(U)||/^seed_/.test(Z),z=U.replace(/[._]+/g," ").trim(),B=W?`${X} seeded`:kR[Z]?`${X} ${kR[Z]}`:`${z.charAt(0).toUpperCase()}${z.slice(1)}`,O=Q.fields??{},T=["title","name","email","text","subject","summary","description"].map((L)=>O[L]).find((L)=>typeof L==="string"&&L.trim()!=="")??null,R=T===null?null:T.replace(/<([@#!])[^|>]*\|([^>]+)>/g,(L,M,f)=>`${M==="!"?"@":M}${f}`).replace(/<(?:https?:[^|>]+)\|([^>]+)>/g,"$1").replace(/<(https?:[^>]+)>/g,"$1");return{what:B,label:R===null?null:R.length>80?`${R.slice(0,79)}…`:R}}var aq=(Q)=>/token|password|secret|key|credential/i.test(Q.subject.type)&&Q.subject.id.length>6?`••••${Q.subject.id.slice(-4)}`:Q.subject.id,oq=(Q,U)=>!Q.actor?"":Q.actor.kind==="system"?`by ${F0(U)}`:Q.actor.id?`by ${Q.actor.id}`:Q.actor.kind==="agent"||Q.actor.kind==="app"?"by your app":`by ${Q.actor.kind}`,LV=(Q)=>Q.operation==="observed"||Q.receipt||Q.provenance==="placeholder"?nq(Q):null;function MV({name:Q,token:U,twin:Z,tab:K,arg:X,admin:W,snapshot:z,onReturn:B,opens:O,onRemoved:T,onWho:R}){let[L,M]=B1.useState("pending"),[f,I]=B1.useState(null),[D,V]=B1.useState(0),[k,h]=B1.useState(null);B1.useEffect(()=>{let Q1=!0;return I(null),X0(U,`/-/${Q}/session`,{method:"POST"}).then(async(Y1)=>{let L1=await Y1.json().catch(()=>({}));if(hR(L1.issuer),L1.who)R?.(L1.who);h(typeof L1.signsAs==="string"?L1.signsAs:null);let M1=CJ(L1.origin)?.origin;if(Y1.status===409&&M1&&M1!==B0){iX(M1,U,Q);return}if(!Q1)return;if(M(!Y1.ok?"unknown":L1.scope==="read"?"read":L1.scope==="write"?"write":"unknown"),!Y1.ok)I(L1.error??`answered ${Y1.status}`)}).catch((Y1)=>{if(Q1)M("unknown"),I(`the World did not answer: ${Y1 instanceof Error?Y1.message:String(Y1)}`)}),()=>{Q1=!1}},[Q,U,D]);let P=f?{state:"error",error:f}:L==="pending"?{state:"pending"}:{state:"ok",scope:L},C=L==="write",v=(Q1)=>{if(Q1.status===403)M("read")},[b,E]=B1.useState(0);B1.useEffect(()=>{let Q1=setInterval(()=>{if(!document.hidden)E((Y1)=>Y1+1)},5000);return()=>clearInterval(Q1)},[]);let[p,a]=B1.useState(0),m=L5(U,`/-/${Q}/clock`,b+p),_1=L5(U,`/-/${Q}/twins`),$1=L5(U,`/-/${Q}/branches`,p),J1=L5(U,`/-/${Q}/map`,Math.floor(b/2)),y=!($1.state==="error"&&($1.status===404||$1.status===405));if(Z)return H.jsxDEV(cV,{name:Q,token:U,twin:Z},void 0,!1,void 0,this);let u=gX.some(([Q1])=>Q1===K)?K:AV[K]??"overview",x=_1.state==="ok"?_1.data.twins.map((Q1)=>Q1.twin):[],d=(Q1)=>J1.state==="ok"?(J1.data.twins.find((Y1)=>Y1.twin===Q1)?.resources??[]).reduce((Y1,L1)=>Y1+L1.count,0):0,g=u==="vendors"&&X?X:void 0,n=()=>{M("pending"),V((Q1)=>Q1+1)};if(u==="canvas"||u==="vendors"&&!g)return H.jsxDEV(bV,{name:Q,twins:_1,session:P,retry:n,snapshot:z,back:()=>v0(Q.split("/"))},void 0,!1,void 0,this);let j=g?F0(g):gX.find(([Q1])=>Q1===u)?.[1]??"",i=(Q1)=>(Y1)=>{Y1.preventDefault(),v0([...Q.split("/"),...Q1])},q1=(Q1,Y1=gX.find(([L1])=>L1===Q1)?.[1]??Q1)=>{let L1=u===Q1&&!g;return H.jsxDEV("a",{href:`${q0}/${Q}/~/${Q1}`,"aria-current":L1?"page":void 0,className:L1?"on":void 0,onClick:i(["~",Q1]),children:Y1},void 0,!1,void 0,this)};return H.jsxDEV("div",{className:"shell",children:[H.jsxDEV("aside",{className:"side",children:[H.jsxDEV("nav",{"aria-label":`${Q} pages`,className:"side-nav",children:[H.jsxDEV(TV,{name:Q},void 0,!1,void 0,this),H.jsxDEV("p",{className:"side-group",children:"World"},void 0,!1,void 0,this),q1("overview"),y?q1("branches"):null,q1("settings"),H.jsxDEV(RV,{name:Q,snapshot:z,branches:y?$1:null,opens:O},void 0,!1,void 0,this),H.jsxDEV("p",{className:"side-group",children:"Branch"},void 0,!1,void 0,this),q1("branch"),q1("changes"),q1("changesets"),q1("activity"),H.jsxDEV("p",{className:"side-group",children:"Vendors"},void 0,!1,void 0,this),H.jsxDEV("a",{href:`${q0}/${Q}/~/canvas`,className:"all-screens",onClick:i(["~","canvas"]),children:[H.jsxDEV("span",{className:"mark","aria-hidden":"true",children:"▦"},void 0,!1,void 0,this),H.jsxDEV("span",{children:"All screens"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("ul",{className:"side-vendors",children:x.map((Q1)=>H.jsxDEV("li",{children:H.jsxDEV("a",{href:`${q0}/${Q}/~/vendors/${Q1}`,"aria-current":g===Q1?"page":void 0,className:g===Q1?"on":void 0,onClick:i(["~","vendors",Q1]),children:[H.jsxDEV(A5,{vendor:Q1},void 0,!1,void 0,this),H.jsxDEV("span",{children:F0(Q1)},void 0,!1,void 0,this),H.jsxDEV("span",{className:"count",children:d(Q1)||""},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},Q1,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("div",{className:"side-foot",children:H.jsxDEV(MR,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("div",{className:"content",children:[z?H.jsxDEV("div",{className:"snapshot",role:"region","aria-label":"Snapshot",children:[H.jsxDEV("span",{children:["You are looking at ",H.jsxDEV("strong",{children:z.parent},void 0,!1,void 0,this)," as it was at ",H.jsxDEV(h0,{iso:z.at},void 0,!1,void 0,this)," · a read-only copy (read-only snapshot) · ",z.expiresAt?Date.parse(z.expiresAt)<=Date.now()?H.jsxDEV(H.Fragment,{children:["gone since ",H.jsxDEV(h0,{iso:z.expiresAt},void 0,!1,void 0,this)]},void 0,!0,void 0,this):H.jsxDEV(H.Fragment,{children:["goes away ",H.jsxDEV(h0,{iso:z.expiresAt},void 0,!1,void 0,this)]},void 0,!0,void 0,this):"kept until you go back"]},void 0,!0,void 0,this),H.jsxDEV("button",{type:"button",onClick:()=>void B(z),children:"Return to live"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,H.jsxDEV("div",{className:"content-head",children:[H.jsxDEV("h2",{id:"world",children:[g?H.jsxDEV("span",{className:"vendor-cell",children:[H.jsxDEV(A5,{vendor:g},void 0,!1,void 0,this),j]},void 0,!0,void 0,this):j,L==="read"?H.jsxDEV(H.Fragment,{children:[" ",H.jsxDEV("span",{className:"badge read-only",title:"This token reads the World; it changes nothing",children:"Read only"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),H.jsxDEV("div",{className:"head-actions",children:[H.jsxDEV(IV,{name:Q,token:U,clock:m,canWrite:C&&!z,onChanged:()=>a((Q1)=>Q1+1),refused:v},void 0,!1,void 0,this),!z&&C&&y&&$1.state!=="loading"?H.jsxDEV(fV,{name:Q,token:U,clock:m,refused:v},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("div",{role:"region","aria-labelledby":"world",className:"panel",children:[u==="overview"?H.jsxDEV(wV,{name:Q,token:U,map:J1,vendors:x,twins:_1,session:P,branches:y?$1:null,canWrite:C&&!z,tick:b,...z?{snapshotOf:z.parent}:{}},void 0,!1,void 0,this):null,u==="branch"?H.jsxDEV(OV,{name:Q,token:U,map:J1,vendors:x,tick:b},void 0,!1,void 0,this):null,u==="vendors"?H.jsxDEV(CV,{name:Q,token:U,twins:_1,session:P,retry:n,selected:g},void 0,!1,void 0,this):null,u==="activity"&&K==="trace"?H.jsxDEV(yV,{name:Q,token:U,id:X??""},void 0,!1,void 0,this):null,u==="activity"&&K!=="trace"?H.jsxDEV(DV,{name:Q,token:U,vendors:x},void 0,!1,void 0,this):null,u==="changes"?H.jsxDEV(mV,{name:Q,token:U},void 0,!1,void 0,this):null,u==="changesets"?H.jsxDEV(xV,{name:Q,token:U,signsAs:k,canWrite:C&&!z,rooted:J1.state==="ok"?J1.data.twins.filter((Q1)=>Q1.root).map((Q1)=>Q1.twin):[],...X?{open:X}:{},refused:v},void 0,!1,void 0,this):null,u==="branches"?H.jsxDEV(PV,{name:Q,token:U,canWrite:C,branches:y?$1:null,opens:O,onBranchesChanged:()=>a((Q1)=>Q1+1),refused:v},void 0,!1,void 0,this):null,u==="settings"?H.jsxDEV(pV,{name:Q,token:U,admin:W,canWrite:C,refused:v,onRemoved:T},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function DR({text:Q}){return H.jsxDEV("button",{type:"button",className:"agent-prompt-button",onClick:()=>{navigator.clipboard?.writeText(Q).then(()=>t2("Copied the prompt: paste it into your coding agent"),()=>t2("Could not copy the prompt","error"))},children:"Copy a prompt for your coding agent"},void 0,!1,void 0,this)}function TV({name:Q}){return H.jsxDEV("details",{className:"menu connect-side",children:[H.jsxDEV("summary",{className:"button connect-button",children:"Connect"},void 0,!1,void 0,this),o2()?H.jsxDEV("div",{className:"popover",children:[H.jsxDEV("p",{children:"Point your app's SDKs here, with a key made on the platform; its calls to these vendors land in this World:"},void 0,!1,void 0,this),H.jsxDEV("pre",{children:[w6,"/",Q,"/<vendor>"]},void 0,!0,void 0,this),H.jsxDEV("a",{className:"button",href:`${o2()}/${encodeURIComponent(Q.split("/")[0]??"")}`,children:"Make a key on the platform"},void 0,!1,void 0,this),H.jsxDEV("p",{className:"mode",children:["Or push a World from your machine: ",H.jsxDEV("code",{children:["volter remote add origin ",Q]},void 0,!0,void 0,this),", then ",H.jsxDEV("code",{children:"volter world push"},void 0,!1,void 0,this),"."]},void 0,!0,void 0,this),H.jsxDEV(DR,{text:mX({platform:o2(),world:Q})},void 0,!1,void 0,this)]},void 0,!0,void 0,this):H.jsxDEV("div",{className:"popover",children:[H.jsxDEV("p",{children:"Run your app in this World; its calls to these vendors land here:"},void 0,!1,void 0,this),H.jsxDEV("pre",{children:"volter world run -- npm start"},void 0,!1,void 0,this),H.jsxDEV("p",{className:"mode",children:["Or point an SDK at ",H.jsxDEV("code",{children:[w6,"/",Q,"/<vendor>"]},void 0,!0,void 0,this)," with the token in ",H.jsxDEV("code",{children:".volter/token"},void 0,!1,void 0,this),"."]},void 0,!0,void 0,this),H.jsxDEV(DR,{text:mX()},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function RV({name:Q,snapshot:U,branches:Z,opens:K}){let X=(B)=>B.split("/").pop()??B,W=U?.parent??Q,z=Z?.state==="ok"?Z.data.branches.filter((B)=>B.name!==Q):[];return H.jsxDEV("details",{className:"menu branch-picker",children:[H.jsxDEV("summary",{children:[H.jsxDEV("svg",{className:"branch-glyph",viewBox:"0 0 16 16",width:"14",height:"14","aria-hidden":"true",children:H.jsxDEV("path",{fill:"currentColor",d:"M5 3.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0Zm0 2.122a2.25 2.25 0 1 0-1.5 0v5.256a2.25 2.25 0 1 0 1.5 0V9.5h4.25A2.25 2.25 0 0 0 11.5 7.25v-.878a2.25 2.25 0 1 0-1.5 0v.878a.75.75 0 0 1-.75.75H5V5.372ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm6.5-9.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"},void 0,!1,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("span",{className:"branch-name",children:U?X(Q):Z?.state==="ok"&&Z.data.checkedOut||X(W)},void 0,!1,void 0,this),H.jsxDEV("span",{className:"badge",children:U?"snapshot":"live"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("div",{className:"popover",children:[H.jsxDEV("p",{className:"mode",children:"Branch"},void 0,!1,void 0,this),H.jsxDEV("ul",{className:"branch-list",children:[H.jsxDEV("li",{children:H.jsxDEV("a",{href:`${q0}/${W}`,"aria-current":!U?"page":void 0,onClick:(B)=>{B.preventDefault(),v0(W.split("/"))},children:[X(W)," ",H.jsxDEV("span",{className:"mode",children:"live"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),U?H.jsxDEV("li",{children:H.jsxDEV("a",{href:`${q0}/${Q}`,"aria-current":"page",onClick:(B)=>B.preventDefault(),children:[X(Q)," ",H.jsxDEV("span",{className:"mode",children:["as of ",H.jsxDEV(h0,{iso:U.at},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this):null,z.map((B)=>H.jsxDEV("li",{children:K(B.name)?H.jsxDEV("a",{href:`${q0}/${B.name}`,onClick:(O)=>{O.preventDefault(),cX(B.name,B.name.split("/"))},children:[X(B.name)," ",H.jsxDEV("span",{className:"mode",children:B.at?.instant?H.jsxDEV(H.Fragment,{children:["as of ",H.jsxDEV(h0,{iso:B.at.instant},void 0,!1,void 0,this)]},void 0,!0,void 0,this):"copy"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):H.jsxDEV("span",{className:"mode",title:"Its token was handed to whoever made it",children:X(B.name)},void 0,!1,void 0,this)},B.name,!1,void 0,this))]},void 0,!0,void 0,this),Z?.state==="ok"&&(Z.data.named?.length??0)>1?H.jsxDEV(H.Fragment,{children:[H.jsxDEV("p",{className:"mode",children:"This World's branches"},void 0,!1,void 0,this),H.jsxDEV("ul",{className:"branch-list",children:Z.data.named.map((B)=>H.jsxDEV("li",{children:H.jsxDEV("span",{"aria-current":B.name===Z.data.checkedOut?"true":void 0,children:[B.name," ",H.jsxDEV("span",{className:"mode",children:B.name===Z.data.checkedOut?"served here":H.jsxDEV("code",{children:["volter world checkout ",B.name]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},B.name,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,Z?.state==="ok"&&z.length===0&&!U&&(Z.data.named?.length??0)<=1?H.jsxDEV("p",{className:"mode",children:"No branches yet. “View an earlier moment…” opens one."},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function OV({name:Q,token:U,map:Z,vendors:K,tick:X}){let W=L5(U,`/-/${Q}/timeline?limit=500`,Math.floor(X/3)),z=Z.state==="ok"?Z.data.twins:[],B=(P)=>(C)=>{C.preventDefault(),v0([...Q.split("/"),...P])},O=Date.now(),T=24,R=3600000,L=W.state==="ok"?W.data.entries:[],M=K.map((P)=>{let C=Array(24).fill(0);for(let v of L){if(v.twin!==P)continue;let b=Date.parse(v.entry.occurredAt),E=23-Math.floor((O-b)/3600000);if(E>=0&&E<24)C[E]+=1}return{vendor:P,counts:C}}),f=Array(24).fill(0).map((P,C)=>M.reduce((v,b)=>v+b.counts[C],0)),I=Math.max(1,...f),D=720,V=160,k=30,h=["var(--volter-data-base)","#7c5cff","#e3572b","#1f9d6b","#d9a400","#2b7de3","#c2417e","#6b7280","#0ea5a4"];return H.jsxDEV(H.Fragment,{children:[H.jsxDEV("div",{className:"block",children:H.jsxDEV("table",{className:"dense services","aria-label":"Vendors on this branch",children:[H.jsxDEV("thead",{children:H.jsxDEV("tr",{children:[H.jsxDEV("th",{children:"Vendor"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"Details"},void 0,!1,void 0,this),H.jsxDEV("th",{},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("tbody",{children:K.map((P)=>{let C=z.find((b)=>b.twin===P),v=[...C?.resources??[]].filter((b)=>b.count>0).sort((b,E)=>E.count-b.count);return H.jsxDEV("tr",{children:[H.jsxDEV("td",{children:H.jsxDEV("span",{className:"vendor-cell",children:[H.jsxDEV(A5,{vendor:P},void 0,!1,void 0,this),H.jsxDEV("a",{href:`${q0}/${Q}/~/vendors/${P}`,onClick:B(["~","vendors",P]),children:F0(P)},void 0,!1,void 0,this)," ",H.jsxDEV("span",{className:C?.root?"badge rooted":"badge",children:C?.root?"connected":"stand-in"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("td",{className:"mode",children:v.length?v.slice(0,4).map((b)=>J9(b.count,b.type)).join(" · "):"nothing yet"},void 0,!1,void 0,this),H.jsxDEV("td",{className:"num",children:C?.mirror?H.jsxDEV("a",{href:`${q0}/${Q}/~/vendors/${P}`,onClick:B(["~","vendors",P]),children:"Screens"},void 0,!1,void 0,this):null},void 0,!1,void 0,this)]},P,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("div",{className:"block chart-block",children:[H.jsxDEV("div",{className:"block-head",children:[H.jsxDEV("h3",{children:"Activity, last 24 hours"},void 0,!1,void 0,this),H.jsxDEV("a",{href:`${q0}/${Q}/~/activity`,onClick:B(["~","activity"]),children:"All activity"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV(B5,{load:W,what:"the activity"},void 0,!1,void 0,this),W.state==="ok"?H.jsxDEV("div",{className:"pad",children:[H.jsxDEV("svg",{viewBox:"0 0 720 182",className:"chart",role:"img","aria-label":`Writes per hour over the last day: ${f.reduce((P,C)=>P+C,0)} in all`,children:[[0.5,1].map((P)=>H.jsxDEV("line",{x1:0,x2:720,y1:160-P*160,y2:160-P*160,className:"grid"},P,!1,void 0,this)),H.jsxDEV("line",{x1:0,x2:720,y1:160,y2:160,className:"axis"},void 0,!1,void 0,this),f.map((P,C)=>{let v=160;return H.jsxDEV("g",{children:M.map((b,E)=>{let p=b.counts[C]/I*152;if(p===0)return null;return v-=p,H.jsxDEV("rect",{x:C*30+2,y:v,width:26,height:p,fill:h[E%h.length],rx:2,children:H.jsxDEV("title",{children:`${F0(b.vendor)}: ${b.counts[C]} in the hour ${23-C===0?"now":`${23-C}h ago`}`},void 0,!1,void 0,this)},b.vendor,!1,void 0,this)})},C,!1,void 0,this)}),[0,6,12,18,23].map((P)=>H.jsxDEV("text",{x:P*30+15,y:176,className:"tick",children:23-P===0?"now":`-${23-P}h`},P,!1,void 0,this))]},void 0,!0,void 0,this),H.jsxDEV("ul",{className:"legend",children:M.filter((P)=>P.counts.some((C)=>C>0)).map((P)=>H.jsxDEV("li",{children:[H.jsxDEV("span",{className:"swatch",style:{background:h[K.indexOf(P.vendor)%h.length]}},void 0,!1,void 0,this),F0(P.vendor)," ",H.jsxDEV("span",{className:"mode",children:P.counts.reduce((C,v)=>C+v,0)},void 0,!1,void 0,this)]},P.vendor,!0,void 0,this))},void 0,!1,void 0,this),f.every((P)=>P===0)?H.jsxDEV("p",{className:"mode",children:"Nothing was written in the last day. Run your app in this World and its calls show up here."},void 0,!1,void 0,this):null]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var pX=0.2;function wV({name:Q,token:U,map:Z,vendors:K,twins:X,session:W,branches:z,canWrite:B,tick:O,snapshotOf:T}){let R=L5(U,`/-/${Q}/diff`,Math.floor(O/2)),L=L5(U,`/-/${Q}/timeline?limit=8`,O),M=Z.state==="ok"?Z.data.twins:[],f=L.state==="ok"?L.data.entries:[],I=X.state==="ok"?X.data.twins.filter((P)=>P.mirror).map((P)=>P.twin):[],D=(P)=>(C)=>{C.preventDefault(),v0([...Q.split("/"),...P])},V=(P)=>{let C=[...M.find((v)=>v.twin===P)?.resources??[]].filter((v)=>v.count>0).sort((v,b)=>b.count-v.count);return C.length?C.slice(0,2).map((v)=>J9(v.count,v.type)).join(" · "):"empty"},k=R.state==="ok"?R.data.changes.length:null,h=z?.state==="ok"?z.data.branches:[];return H.jsxDEV("div",{className:"dash",children:[H.jsxDEV("section",{className:"block dash-screens","aria-labelledby":"screens-head",children:[H.jsxDEV("div",{className:"block-head",children:[H.jsxDEV("h3",{id:"screens-head",children:["Screens ",H.jsxDEV("span",{className:"badge live",children:"live"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("span",{className:"mode",children:[K.length," vendor",K.length===1?"":"s",k!==null?H.jsxDEV(H.Fragment,{children:[" · ",H.jsxDEV("a",{href:`${q0}/${Q}/~/changes`,onClick:D(["~","changes"]),children:[k," change",k===1?"":"s"," since start"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),H.jsxDEV("a",{className:"button",href:`${q0}/${Q}/~/canvas`,onClick:D(["~","canvas"]),children:"Open all screens"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),W.state==="ok"?H.jsxDEV("ul",{className:"thumbs",children:K.map((P)=>H.jsxDEV("li",{children:H.jsxDEV("a",{href:`${q0}/${Q}/~/vendors/${P}`,onClick:D(["~","vendors",P]),"aria-label":`${F0(P)}'s screens`,children:[H.jsxDEV("span",{className:"thumb",children:[I.includes(P)?H.jsxDEV("iframe",{title:`${F0(P)} preview`,src:D8(Q,P),loading:"lazy",tabIndex:-1,style:{width:`${100/pX}%`,height:`${100/pX}%`,transform:`scale(${pX})`}},void 0,!1,void 0,this):H.jsxDEV("span",{className:"thumb-none",children:"No screens"},void 0,!1,void 0,this),H.jsxDEV("span",{className:M.find((C)=>C.twin===P)?.root?"badge rooted thumb-status":"badge thumb-status",children:M.find((C)=>C.twin===P)?.root?"connected":"stand-in"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("span",{className:"thumb-foot",children:[H.jsxDEV(A5,{vendor:P},void 0,!1,void 0,this),H.jsxDEV("b",{children:F0(P)},void 0,!1,void 0,this),H.jsxDEV("span",{className:"mode",children:V(P)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},P,!1,void 0,this))},void 0,!1,void 0,this):H.jsxDEV("p",{className:"mode pad",children:W.state==="error"?`The World did not open its screens: ${W.error}`:"Opening…"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("div",{className:"dash-side",children:z?H.jsxDEV("section",{className:"block","aria-labelledby":"branches-head",children:[H.jsxDEV("div",{className:"block-head",children:[H.jsxDEV("h3",{id:"branches-head",children:"Branches"},void 0,!1,void 0,this),H.jsxDEV("a",{href:`${q0}/${Q}/~/branches`,onClick:D(["~","branches"]),children:"All"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("ul",{className:"mini-feed",children:[H.jsxDEV("li",{children:[H.jsxDEV("svg",{className:"branch-glyph",viewBox:"0 0 16 16",width:"14",height:"14","aria-hidden":"true",children:H.jsxDEV("path",{fill:"currentColor",d:"M5 3.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0Zm0 2.122a2.25 2.25 0 1 0-1.5 0v5.256a2.25 2.25 0 1 0 1.5 0V9.5h4.25A2.25 2.25 0 0 0 11.5 7.25v-.878a2.25 2.25 0 1 0-1.5 0v.878a.75.75 0 0 1-.75.75H5V5.372ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm6.5-9.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"},void 0,!1,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("span",{className:"mini-what",children:T?H.jsxDEV(H.Fragment,{children:[H.jsxDEV("b",{children:Q.split("/")[1]},void 0,!1,void 0,this)," ",H.jsxDEV("span",{className:"badge",children:"snapshot"},void 0,!1,void 0,this)," ",H.jsxDEV("span",{className:"mode",children:["of ",T.split("/")[1]]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):H.jsxDEV(H.Fragment,{children:[H.jsxDEV("b",{children:Q.split("/")[1]},void 0,!1,void 0,this)," ",H.jsxDEV("span",{className:"badge",children:"live"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),h.slice(0,3).map((P)=>H.jsxDEV("li",{children:[H.jsxDEV("svg",{className:"branch-glyph",viewBox:"0 0 16 16",width:"14",height:"14","aria-hidden":"true",children:H.jsxDEV("path",{fill:"currentColor",d:"M5 3.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0Zm0 2.122a2.25 2.25 0 1 0-1.5 0v5.256a2.25 2.25 0 1 0 1.5 0V9.5h4.25A2.25 2.25 0 0 0 11.5 7.25v-.878a2.25 2.25 0 1 0-1.5 0v.878a.75.75 0 0 1-.75.75H5V5.372ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm6.5-9.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"},void 0,!1,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("span",{className:"mini-what",children:[P.name.split("/").pop()," ",H.jsxDEV("span",{className:"mode",children:P.at?.instant?`as of ${new Date(P.at.instant).toLocaleString()}`:"copy"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},P.name,!0,void 0,this))]},void 0,!0,void 0,this),B?H.jsxDEV("p",{className:"mode pad",children:"“View an earlier moment…” above opens a branch as the World was then."},void 0,!1,void 0,this):null]},void 0,!0,void 0,this):null},void 0,!1,void 0,this),H.jsxDEV("section",{className:"block dash-activity","aria-labelledby":"activity-head",children:[H.jsxDEV("div",{className:"block-head",children:[H.jsxDEV("h3",{id:"activity-head",children:"Recent activity"},void 0,!1,void 0,this),H.jsxDEV("a",{href:`${q0}/${Q}/~/activity`,onClick:D(["~","activity"]),children:"View all"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV(B5,{load:L,what:"the activity"},void 0,!1,void 0,this),L.state==="ok"&&f.length===0?H.jsxDEV("div",{className:"empty-block",children:[H.jsxDEV("strong",{children:"No activity yet"},void 0,!1,void 0,this),H.jsxDEV("span",{className:"mode",children:"Run your app in this World and its calls show up here."},void 0,!1,void 0,this)]},void 0,!0,void 0,this):H.jsxDEV("ul",{className:"mini-feed",children:f.map((P)=>{let C=n5(P.entry);return H.jsxDEV("li",{children:[H.jsxDEV(A5,{vendor:P.twin},void 0,!1,void 0,this),H.jsxDEV("span",{className:"mini-what",children:[H.jsxDEV("strong",{children:C.what},void 0,!1,void 0,this),C.label?H.jsxDEV("span",{className:"mode",children:[" ",C.label]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),H.jsxDEV("span",{className:"mode num",title:P.entry.occurredAt,children:dq(P.entry.occurredAt)},void 0,!1,void 0,this)]},E4(P),!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function IV({name:Q,token:U,clock:Z,canWrite:K,onChanged:X,refused:W}){let[z,B]=B1.useState(!1),[O,T]=B1.useState(""),[R,L]=B1.useState(""),[M,f]=B1.useState(null),[I,D]=B1.useState(!1),V=Z.state==="ok"?Z.data:null,k=async(v,b,E)=>{D(!0),f(null);try{let p=await X0(U,`/-/${Q}/${b}`,{method:b==="clock"?"PUT":"POST",body:JSON.stringify(E)});if(!p.ok){W(p),f({ok:!1,text:await z5(p)});return}let a=await p.json();f({ok:!0,text:`${v} — the World is at ${new Date(a.at).toLocaleString()}`}),B(!1),X()}catch(p){f({ok:!1,text:`the World did not answer: ${p instanceof Error?p.message:String(p)}`})}finally{D(!1)}},h=(v)=>{v.preventDefault();let b=new Date(O);if(Number.isNaN(b.getTime())){f({ok:!1,text:"Pick a date and time."});return}if(V&&b.getTime()<Date.parse(V.at)){f({ok:!1,text:`The World's clock only moves forward: pick a time after ${new Date(V.at).toLocaleString()}.`});return}k("Clock set","clock",{at:b.toISOString()})},P=(v,b)=>{k(`Advanced ${b}`,"clock/advance",{by:v})},C=[["1h","1 hour"],["1d","1 day"],["7d","1 week"],["30d","30 days"]];return H.jsxDEV("div",{className:`clock${V?.frozen?" frozen":""}`,role:"region","aria-label":"World clock",children:[H.jsxDEV("p",{className:"clock-now",children:Z.state==="loading"?H.jsxDEV("span",{className:"mode",children:"clock…"},void 0,!1,void 0,this):Z.state==="error"?H.jsxDEV("span",{className:"mode",children:["Clock: ",Z.error]},void 0,!0,void 0,this):V.frozen?H.jsxDEV(H.Fragment,{children:[H.jsxDEV("span",{className:"badge",children:"Simulation"},void 0,!1,void 0,this)," World time ",H.jsxDEV("strong",{children:H.jsxDEV(h0,{iso:V.at},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):H.jsxDEV(H.Fragment,{children:["World time ",H.jsxDEV("strong",{children:H.jsxDEV(h0,{iso:V.at},void 0,!1,void 0,this)},void 0,!1,void 0,this)," ",H.jsxDEV("span",{className:"mode",children:"· real time"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),K&&V?H.jsxDEV("details",{className:"clock-more",children:[H.jsxDEV("summary",{children:"Simulate time…"},void 0,!1,void 0,this),H.jsxDEV("div",{className:"popover",children:[H.jsxDEV("p",{className:"mode",children:"Move this World's clock forward to see what happens later: renewals, expiries, scheduled sends. Like a test clock, it only moves forward; to look back, use “View an earlier moment…”."},void 0,!1,void 0,this),H.jsxDEV("div",{className:"clock-controls",children:[H.jsxDEV("button",{type:"button","aria-expanded":z,onClick:()=>{B(!z),T(U9(SR(V.at))),f(null)},children:"Set time…"},void 0,!1,void 0,this),H.jsxDEV("div",{role:"group","aria-label":"Advance the clock",className:"advance",children:[H.jsxDEV("span",{className:"mode",children:"Advance"},void 0,!1,void 0,this),C.map(([v,b])=>H.jsxDEV("button",{type:"button","aria-label":`Advance ${b}`,disabled:I||!V.frozen,title:V.frozen?void 0:"Set the time first: advancing moves a set clock",onClick:()=>P(v,b),children:b},v,!1,void 0,this)),H.jsxDEV("form",{className:"inline",onSubmit:(v)=>{if(v.preventDefault(),!/^\d+[smhd]$/.test(R.trim())){f({ok:!1,text:"Advance by a number and a unit: 90m, 12h, 3d."});return}P(R.trim(),`by ${R.trim()}`)},children:[H.jsxDEV("label",{className:"sr",children:["Advance by ",H.jsxDEV("input",{name:"advanceBy",value:R,onChange:(v)=>L(v.target.value),placeholder:"90m, 12h, 3d",size:9,disabled:!V.frozen},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("button",{type:"submit",disabled:I||!V.frozen,children:"Advance"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),!V.frozen?H.jsxDEV("p",{className:"mode",children:"The World runs on real time. Set a time to start simulating; then advance it."},void 0,!1,void 0,this):null,z?H.jsxDEV("form",{className:"inline","aria-label":"Set the World time",onSubmit:h,noValidate:!0,children:[H.jsxDEV("label",{children:["World time ",H.jsxDEV("input",{name:"worldTime",type:"datetime-local",value:O,min:U9(SR(V.at)),onChange:(v)=>T(v.target.value),required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("span",{className:"mode",children:Intl.DateTimeFormat().resolvedOptions().timeZone},void 0,!1,void 0,this),H.jsxDEV("button",{type:"submit",disabled:I,children:"Set time"},void 0,!1,void 0,this),H.jsxDEV("button",{type:"button",onClick:()=>B(!1),children:"Cancel"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null,M?H.jsxDEV("p",{role:M.ok?"status":"alert",children:M.text},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}function fV({name:Q,token:U,clock:Z,refused:K}){let[X,W]=B1.useState(!1),[z,B]=B1.useState(""),[O,T]=B1.useState(null),[R,L]=B1.useState(!1),M=Z.state==="ok"?Z.data.at:new Date().toISOString(),f=B1.useRef(null);return B1.useEffect(()=>{if(!X)return;let D=(k)=>{if(k.key==="Escape"&&!document.querySelector("dialog[open]"))W(!1),f.current?.querySelector("button")?.focus()},V=(k)=>{if(!f.current?.contains(k.target))W(!1)};return document.addEventListener("keydown",D),document.addEventListener("click",V),()=>{document.removeEventListener("keydown",D),document.removeEventListener("click",V)}},[X]),H.jsxDEV("div",{className:"as-of",ref:f,children:[H.jsxDEV("button",{type:"button","aria-expanded":X,title:"Open a read-only copy of this World as it was at a moment you pick",onClick:()=>{W(!X),B(U9(M)),T(null)},children:"View an earlier moment…"},void 0,!1,void 0,this),X?H.jsxDEV("form",{className:"inline","aria-label":"View the World as of a past moment",onSubmit:async(D)=>{D.preventDefault(),T(null);let V=new Date(z);if(Number.isNaN(V.getTime())){T("Pick a date and time.");return}if(V.getTime()>Date.parse(M)){T(`That is after the World's present (${new Date(M).toLocaleString()}); a snapshot looks back.`);return}L(!0);try{let k=await X0(U,`/-/${Q}/branches`,{method:"POST",body:JSON.stringify({at:{instant:V.toISOString()},ttl:3600})});if(!k.ok){K(k),T(await z5(k));return}let h=await k.json();rX({name:h.name,parent:Q,token:h.token,readToken:h.readToken,at:V.toISOString(),expiresAt:h.expiresAt??null,parentOrigin:B0,made:!0});let P=CJ(h.origin)?.origin;if(P&&P!==B0){iX(P,h.readToken,h.name,`${q0}/${h.name}`);return}v0(h.name.split("/"))}catch(k){T(`the World did not answer: ${k instanceof Error?k.message:String(k)}`)}finally{L(!1)}},noValidate:!0,children:[H.jsxDEV("label",{children:["As of ",H.jsxDEV("input",{name:"asOf",type:"datetime-local",value:z,max:U9(M),onChange:(D)=>B(D.target.value),required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("button",{type:"submit",disabled:R,children:R?"Opening…":"Open snapshot"},void 0,!1,void 0,this),H.jsxDEV("span",{className:"mode",children:"Opens a read-only copy of this World as it was then; the copy goes away within the hour."},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,O?H.jsxDEV("p",{role:"alert",children:O},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}function PV({name:Q,token:U,canWrite:Z,branches:K,opens:X,onBranchesChanged:W,refused:z}){let B=L5(U,`/-/${Q}/map`),[O,T]=B1.useState(null),R=async(M)=>{if(!await o5({title:`Delete the branch ${M}?`,body:"Whoever holds its tokens loses it, and its history goes with it.",action:"Delete branch",danger:!0}))return;let f=await X0(U,`/-/${Q}/branches/${M}`,{method:"DELETE"}).catch((I)=>I);if(f instanceof Error){T(`delete ${M}: the World did not answer (${f.message})`);return}if(!f.ok){z(f),T(`delete ${M}: ${await z5(f)}`);return}PJ(M),T(`deleted ${M}`),W()},L=B.state==="ok"?B.data.twins.reduce((M,f)=>M+f.resources.reduce((I,D)=>I+D.count,0),0):0;if(K)return H.jsxDEV(NV,{name:Q,token:U,canWrite:Z,branches:K,opens:X,note:O,remove:R,onChanged:W,refused:z},void 0,!1,void 0,this);return H.jsxDEV(H.Fragment,{children:[H.jsxDEV("h3",{children:"Map"},void 0,!1,void 0,this),H.jsxDEV(B5,{load:B,what:"the World's map"},void 0,!1,void 0,this),B.state==="ok"?B.data.twins.length===0?H.jsxDEV("p",{children:"This World holds no twins."},void 0,!1,void 0,this):H.jsxDEV(H.Fragment,{children:[H.jsxDEV("p",{className:"mode",children:[B.data.twins.length," twin",B.data.twins.length===1?"":"s"," · ",L," resource",L===1?"":"s"]},void 0,!0,void 0,this),H.jsxDEV("ul",{className:"map","aria-label":"Twins in this World",children:B.data.twins.map((M)=>{let f=[...M.resources].sort((I,D)=>D.count-I.count);return H.jsxDEV("li",{className:"card","aria-labelledby":`map-${M.twin}`,children:[H.jsxDEV("div",{className:"card-head",children:[H.jsxDEV("h4",{id:`map-${M.twin}`,className:"vendor",children:M.twin},void 0,!1,void 0,this),H.jsxDEV("span",{className:M.root?"badge rooted":"badge",children:M.root?"rooted":"simulated"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("p",{className:"mode",children:[M.root?H.jsxDEV(H.Fragment,{children:["rooted at ",H.jsxDEV("code",{children:M.root.url},void 0,!1,void 0,this)]},void 0,!0,void 0,this):"simulated — no vendor behind it"," · position ",M.position]},void 0,!0,void 0,this),f.length===0?H.jsxDEV("p",{className:"mode",children:"Holds nothing yet."},void 0,!1,void 0,this):H.jsxDEV("ul",{className:"resources",children:[f.slice(0,6).map((I)=>H.jsxDEV("li",{children:[H.jsxDEV("span",{children:I.type},void 0,!1,void 0,this)," ",H.jsxDEV("strong",{children:I.count},void 0,!1,void 0,this)]},I.type,!0,void 0,this)),f.length>6?H.jsxDEV("li",{className:"mode",children:["+",f.length-6," more types"]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),H.jsxDEV("p",{className:"card-actions",children:[M.mirror?H.jsxDEV("a",{className:"button",href:D8(Q,M.twin),target:"_blank",rel:"noopener noreferrer",children:["Open ",M.twin]},void 0,!0,void 0,this):H.jsxDEV("span",{className:"mode",children:"no mirror"},void 0,!1,void 0,this),H.jsxDEV("a",{href:`${q0}/${Q}/${M.twin}`,"aria-label":`Log and tree of ${M.twin}`,onClick:(I)=>{I.preventDefault(),v0([...Q.split("/"),M.twin])},children:"Log & tree"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},M.twin,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)}function NV({name:Q,token:U,canWrite:Z,branches:K,opens:X,note:W,remove:z,onChanged:B,refused:O}){let T=(g)=>g.split("/").pop()??g,R=K.state==="ok"?K.data.branches:[],[L,M]=B1.useState(!1),[f,I]=B1.useState(!1),[D,V]=B1.useState(null),[k,h]=B1.useState(""),[P,C]=B1.useState("now"),[v,b]=B1.useState(""),[E,p]=B1.useState("24"),[a,m]=B1.useState(null),[_1,$1]=B1.useState(null),J1=async(g)=>{m(g),$1(null);let n=await X0(U,`/-/${Q}/branches/${encodeURIComponent(g)}/serve`,{method:"POST"}).catch(()=>null);if(n?.ok){location.reload();return}m(null),$1(n?(await n.json().catch(()=>null))?.error??`${n.status}`:`${B0} did not answer`)},y=async(g,n)=>{let j=await X0(U,`/-/${Q}/branches`,{method:"POST",body:JSON.stringify(g)}).catch(()=>null);if(!j)return`${B0} did not answer`;if(!j.ok)return O(j),await z5(j);let i=await j.json();return rX({name:i.name,parent:Q,token:i.token??"",readToken:i.readToken,at:n,expiresAt:i.expiresAt??null,parentOrigin:B0,...i.origin?{origin:i.origin}:{}}),i},u=async(g)=>{g.preventDefault(),V(null);let n=P==="at"?new Date(v):null;if(n&&Number.isNaN(n.getTime())){V("Pick a date and time, or make it as of now.");return}if(n&&n.getTime()>Date.now()){V("A branch is made as of now or a moment before it.");return}let j=Math.round(Number(E)*3600);I(!0);let i=await y({ttl:j,...n?{at:{instant:n.toISOString()}}:{live:!0},...k.trim()?{label:k.trim()}:{}},(n??new Date).toISOString());if(I(!1),typeof i==="string"){V(i);return}M(!1),h(""),t2(`Made ${T(i.name)}`),B()},x=async(g)=>{if(!await o5({title:`Reset ${T(g.name)} to ${T(Q)}?`,body:`A fresh copy of ${T(Q)} as it is now replaces it, with the same label and the time it had left; what was written to it goes. The copy has a new address and new keys: an app, a CI job or a pull request's preview that holds this branch's must be given the new one.`,action:"Reset branch",danger:!0}))return;let n=g.expiresAt?Math.max(3600,Math.round((Date.parse(g.expiresAt)-Date.now())/1000)):86400,j=T(g.name).startsWith(`${T(Q)}-`)?T(g.name).slice(T(Q).length+1):"",i=/^([a-z0-9][a-z0-9-]*)-[0-9a-f]{4}$/.exec(j)?.[1],q1=await y({ttl:n,live:!0,...i&&!i.startsWith("at-")?{label:i}:{}},new Date().toISOString());if(typeof q1==="string"){t2(`Reset ${T(g.name)}: ${q1}`,"error");return}let Q1=await X0(U,`/-/${Q}/branches/${g.name}`,{method:"DELETE"}).catch(()=>null);if(Q1?.ok)PJ(g.name);t2(Q1?.ok?`Reset: ${T(q1.name)} is ${T(Q)} as it is now`:`Made ${T(q1.name)}; ${T(g.name)} was not removed`),B()},d=(g)=>[...X(g.name)?[{label:"Compare with parent",onSelect:()=>cX(g.name,[...g.name.split("/"),"~","changes"])}]:[],...Z?[{label:"Reset to parent…",onSelect:()=>void x(g)},{label:"Delete…",danger:!0,onSelect:()=>void z(g.name)}]:[]];return H.jsxDEV("div",{"aria-labelledby":"branches",children:[H.jsxDEV("div",{className:"branches-head",children:[H.jsxDEV("p",{className:"lede",children:["Branch this World to look at it as it was, or to change it without touching ",H.jsxDEV("b",{children:T(Q)},void 0,!1,void 0,this),". A branch made here opens read-only in this tab; its parent removes it."]},void 0,!0,void 0,this),Z?H.jsxDEV("button",{type:"button",className:"primary",onClick:()=>{V(null),b(U9(new Date().toISOString())),M(!0)},children:"New branch"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),W?H.jsxDEV("p",{role:"status",children:W},void 0,!1,void 0,this):null,H.jsxDEV(B5,{load:K,what:"the branches"},void 0,!1,void 0,this),K.state==="ok"?H.jsxDEV("div",{className:"block",children:[H.jsxDEV("table",{className:"dense","aria-label":"Branches",children:[H.jsxDEV("thead",{children:H.jsxDEV("tr",{children:[H.jsxDEV("th",{id:"branches",children:"Branch"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"Parent"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"As of"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"Made"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"Goes away"},void 0,!1,void 0,this),H.jsxDEV("th",{},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("tbody",{children:[H.jsxDEV("tr",{children:[H.jsxDEV("td",{children:[H.jsxDEV("b",{children:K.data.checkedOut??T(Q)},void 0,!1,void 0,this)," ",H.jsxDEV("span",{className:"badge",children:K.data.checkedOut?"served here":"default"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("td",{className:"mode",children:"—"},void 0,!1,void 0,this),H.jsxDEV("td",{className:"mode",children:"live"},void 0,!1,void 0,this),H.jsxDEV("td",{className:"mode",children:"—"},void 0,!1,void 0,this),H.jsxDEV("td",{className:"mode",children:"kept"},void 0,!1,void 0,this),H.jsxDEV("td",{},void 0,!1,void 0,this)]},void 0,!0,void 0,this),R.map((g)=>{let n=d(g);return H.jsxDEV("tr",{children:[H.jsxDEV("td",{children:H.jsxDEV("b",{children:T(g.name)},void 0,!1,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("td",{children:T(Q)},void 0,!1,void 0,this),H.jsxDEV("td",{children:g.at?.instant?H.jsxDEV(h0,{iso:g.at.instant},void 0,!1,void 0,this):"when it was made"},void 0,!1,void 0,this),H.jsxDEV("td",{children:H.jsxDEV(h0,{iso:g.createdAt},void 0,!1,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("td",{children:g.expiresAt?H.jsxDEV(h0,{iso:g.expiresAt},void 0,!1,void 0,this):"kept"},void 0,!1,void 0,this),H.jsxDEV("td",{className:"num row-actions",children:[X(g.name)?H.jsxDEV("button",{type:"button","aria-label":`Open ${g.name}`,onClick:()=>cX(g.name,g.name.split("/")),children:"Open"},void 0,!1,void 0,this):H.jsxDEV("span",{className:"mode",title:"Its token was handed to whoever made it",children:"opened by whoever made it"},void 0,!1,void 0,this),n.length?H.jsxDEV(xX,{label:`More for ${T(g.name)}`,items:n},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},g.name,!0,void 0,this)})]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),R.length===0?H.jsxDEV("p",{className:"mode pad",children:"No snapshots yet."},void 0,!1,void 0,this):null]},void 0,!0,void 0,this):null,K.state==="ok"&&(K.data.named?.length??0)>0?H.jsxDEV(H.Fragment,{children:[H.jsxDEV("p",{className:"lede",children:["This World's own branches (",H.jsxDEV("code",{children:"volter world branch"},void 0,!1,void 0,this),"). One runs at a time; ",K.data.canServe?H.jsxDEV(H.Fragment,{children:"“Serve here” stops this one's twins and serves that one in its place."},void 0,!1,void 0,this):H.jsxDEV(H.Fragment,{children:["this host serves one of them; another is served by ",H.jsxDEV("code",{children:"volter world checkout <branch>"},void 0,!1,void 0,this)," where the World lives, then serving again."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),_1?H.jsxDEV("p",{role:"alert",children:_1},void 0,!1,void 0,this):null,H.jsxDEV("div",{className:"block",children:H.jsxDEV("table",{className:"dense","aria-label":"World branches",children:[H.jsxDEV("thead",{children:H.jsxDEV("tr",{children:[H.jsxDEV("th",{children:"Branch"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"State"},void 0,!1,void 0,this),H.jsxDEV("th",{},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("tbody",{children:K.data.named.map((g)=>H.jsxDEV("tr",{children:[H.jsxDEV("td",{children:[H.jsxDEV("b",{children:g.name},void 0,!1,void 0,this),g.name===K.data.checkedOut?H.jsxDEV(H.Fragment,{children:[" ",H.jsxDEV("span",{className:"badge",children:"served here"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),H.jsxDEV("td",{className:"mode",children:g.running?"running":"stopped"},void 0,!1,void 0,this),H.jsxDEV("td",{className:"num row-actions",children:Z&&K.data.canServe&&g.name!==K.data.checkedOut?H.jsxDEV("button",{type:"button",disabled:a!==null,onClick:()=>void J1(g.name),children:a===g.name?"Switching…":"Serve here"},void 0,!1,void 0,this):null},void 0,!1,void 0,this)]},g.name,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,H.jsxDEV(S8,{open:L,onClose:()=>{if(!f)M(!1)},title:`New branch of ${T(Q)}`,footer:H.jsxDEV(H.Fragment,{children:[H.jsxDEV("button",{type:"button",onClick:()=>M(!1),disabled:f,children:"Cancel"},void 0,!1,void 0,this),H.jsxDEV("button",{type:"submit",form:"new-branch",className:"primary",disabled:f,children:f?"Making…":"Make branch"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:H.jsxDEV("form",{id:"new-branch",onSubmit:(g)=>void u(g),className:"stack",children:[H.jsxDEV("label",{children:[H.jsxDEV("span",{children:["Name ",H.jsxDEV("span",{className:"mode",children:"(optional)"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("input",{name:"branchLabel",value:k,onChange:(g)=>h(g.target.value.toLowerCase()),placeholder:"checkout-flow",pattern:"[a-z0-9][a-z0-9-]{0,23}",maxLength:24},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("fieldset",{className:"choice",children:[H.jsxDEV("legend",{children:"As of"},void 0,!1,void 0,this),H.jsxDEV("label",{className:"check",children:[H.jsxDEV("input",{type:"radio",name:"branchWhen",checked:P==="now",onChange:()=>C("now")},void 0,!1,void 0,this)," ",H.jsxDEV("span",{children:"Now: the World as it is, its clock running on"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("label",{className:"check",children:[H.jsxDEV("input",{type:"radio",name:"branchWhen",checked:P==="at",onChange:()=>C("at")},void 0,!1,void 0,this)," ",H.jsxDEV("span",{children:"A moment before now: the World as it was then, its clock stopped there"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),P==="at"?H.jsxDEV("input",{type:"datetime-local","aria-label":"As of",value:v,max:U9(new Date().toISOString()),onChange:(g)=>b(g.target.value)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),H.jsxDEV("label",{children:[H.jsxDEV("span",{children:"Goes away after"},void 0,!1,void 0,this),H.jsxDEV("select",{name:"branchLife",value:E,onChange:(g)=>p(g.target.value),children:[H.jsxDEV("option",{value:"1",children:"1 hour"},void 0,!1,void 0,this),H.jsxDEV("option",{value:"24",children:"1 day"},void 0,!1,void 0,this),H.jsxDEV("option",{value:"72",children:"3 days"},void 0,!1,void 0,this),H.jsxDEV("option",{value:"168",children:"7 days"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),D?H.jsxDEV("p",{role:"alert",children:D},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function CV({name:Q,token:U,twins:Z,session:K,retry:X,selected:W}){let z=L5(U,`/-/${Q}/map`),B=Z.state==="ok"?Z.data.twins:[],O=(L)=>{let M=z.state==="ok"?z.data.twins.find((I)=>I.twin===L):void 0;if(!M)return"";let f=[...M.resources].filter((I)=>I.count>0).sort((I,D)=>D.count-I.count);return f.length===0?"nothing yet":f.slice(0,3).map((I)=>J9(I.count,I.type)).join(" · ")+(f.length>3?" · …":"")},T=(L)=>z.state==="ok"?z.data.twins.find((M)=>M.twin===L)?.root?.url??null:null,R=B.find((L)=>L.twin===W);if(!R)return Z.state==="ok"?H.jsxDEV("p",{className:"mode",children:["This World has no vendor named ",W,". ",H.jsxDEV("a",{href:`${q0}/${Q}/~/canvas`,onClick:(L)=>{L.preventDefault(),v0([...Q.split("/"),"~","canvas"])},children:"All screens"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):H.jsxDEV(B5,{load:Z,what:"the vendors"},void 0,!1,void 0,this);return H.jsxDEV(H.Fragment,{children:[H.jsxDEV(B5,{load:Z,what:"the vendors"},void 0,!1,void 0,this),Z.state==="ok"&&B.length===0?H.jsxDEV("p",{children:"No vendors in this World yet."},void 0,!1,void 0,this):null,R?H.jsxDEV("div",{className:"vendors",children:H.jsxDEV("div",{className:"stage",children:[H.jsxDEV("div",{className:"stage-bar",children:[H.jsxDEV(A5,{vendor:R.twin},void 0,!1,void 0,this),H.jsxDEV("span",{className:"mode",children:[O(R.twin)||"empty",T(R.twin)?` · connected to ${T(R.twin)}`:" · stand-in"]},void 0,!0,void 0,this),H.jsxDEV("span",{className:"stage-actions",children:[B.filter((L)=>L.mirror).length>1?H.jsxDEV("a",{className:"button",href:`${q0}/${Q}/~/vendors`,onClick:(L)=>{L.preventDefault(),v0([...Q.split("/"),"~","vendors"])},children:"All vendors"},void 0,!1,void 0,this):null,R.mirror?H.jsxDEV("a",{className:"button",href:D8(Q,R.twin),target:"_blank",rel:"noopener noreferrer","aria-label":`Open ${F0(R.twin)} in a new tab`,children:"Open in new tab ↗"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),K.state==="ok"&&K.scope==="read"?H.jsxDEV("p",{className:"mode stage-note",children:"You are looking read only: the screens browse, and refuse changes."},void 0,!1,void 0,this):null,K.state==="pending"?H.jsxDEV("p",{className:"mode",role:"status",children:"Opening…"},void 0,!1,void 0,this):null,K.state==="error"?H.jsxDEV("p",{role:"alert",children:["The World did not open its screens: ",K.error," ",H.jsxDEV("button",{type:"button",onClick:X,children:"Try again"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,K.state==="ok"?R.mirror?H.jsxDEV("iframe",{title:`${R.twin} mirror`,src:D8(Q,R.twin)},R.twin,!1,void 0,this):H.jsxDEV("p",{className:"empty",children:[F0(R.twin)," has no screens here yet. What your app did there is in ",H.jsxDEV("a",{href:`${q0}/${Q}/~/activity`,onClick:(L)=>{L.preventDefault(),v0([...Q.split("/"),"~","activity"])},children:"Activity"},void 0,!1,void 0,this),"."]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}function SV(Q){let U=[];for(let Z of Q){let K=U[U.length-1];if(K&&(K[0].operation??K[0].op)===(Z.operation??Z.op))K.push(Z);else U.push([Z])}return U}function jV(Q){let U=[];for(let Z of Q){let K=U[U.length-1],X=Array.isArray(K)?K[0]:K;if(X&&X.twin===Z.twin&&(X.entry.operation??X.entry.op)===(Z.entry.operation??Z.entry.op))if(Array.isArray(K))K.push(Z);else U[U.length-1]=[X,Z];else U.push(Z)}return U.flatMap((Z)=>Array.isArray(Z)&&Z.length<3?Z:[Z])}var VV=50,E4=(Q)=>`${Q.twin}:${Q.position}`,dR=(Q,U)=>Date.parse(U.entry.occurredAt)-Date.parse(Q.entry.occurredAt)||Q.twin.localeCompare(U.twin)||U.position-Q.position;function kV(Q){let U=[];for(let Z of Q){let K=new Date(Z.entry.occurredAt),X=K.toDateString(),W=U[U.length-1];if(!W||W.day!==X)W={day:X,label:K.toLocaleDateString(void 0,{weekday:"short",year:"numeric",month:"short",day:"numeric"}),instants:[]},U.push(W);let z=W.instants[W.instants.length-1];if(z&&Date.parse(z.at)===K.getTime())z.items.push(Z);else W.instants.push({at:Z.entry.occurredAt,items:[Z]})}return U}function yR({name:Q,p:U}){let Z=U.entry,K=gR(Z.traceparent),X=n5(Z),W=LV(Z);return H.jsxDEV("li",{className:"entry",title:`${Z.operation??Z.op} ${Z.subject.type}:${Z.subject.id} · ${mR(Z)} · ${nq(Z)}`,children:[H.jsxDEV("span",{className:"twin-chip",children:[H.jsxDEV(A5,{vendor:U.twin},void 0,!1,void 0,this),F0(U.twin)]},void 0,!0,void 0,this),H.jsxDEV("span",{className:"op",children:X.what},void 0,!1,void 0,this),X.label?H.jsxDEV("span",{className:"label",children:["“",X.label,"”"]},void 0,!0,void 0,this):H.jsxDEV("code",{className:"subject",children:aq(Z)},void 0,!1,void 0,this),H.jsxDEV("span",{className:"actor mode",children:oq(Z,U.twin)},void 0,!1,void 0,this),W?H.jsxDEV("span",{className:"standing",children:W},void 0,!1,void 0,this):null,K?H.jsxDEV("a",{className:"trace-link",href:`${q0}/${Q}/~/trace/${K.trace}`,"aria-label":`View trace ${K.trace.slice(0,8)}`,onClick:(z)=>{z.preventDefault(),v0([...Q.split("/"),"~","trace",K.trace])},children:"trace"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}function DV({name:Q,token:U,vendors:Z}){let[K,X]=B1.useState(null),[W,z]=B1.useState(null),[B,O]=B1.useState(null),[T,R]=B1.useState(null),[L,M]=B1.useState(!1),[f,I]=B1.useState(null),[D,V]=B1.useState({items:[],gap:null}),k=B1.useCallback((E)=>`/-/${Q}/timeline?limit=${VV}${K?`&twin=${encodeURIComponent(K)}`:""}${E?`&before=${encodeURIComponent(E)}`:""}`,[Q,K]),h=B1.useRef(null);h.current=W,B1.useEffect(()=>{let E=!0;z(null),R(null),V({items:[],gap:null}),(async()=>{let a=await X0(U,k());if(!E)return;if(!a.ok){R(await z5(a));return}let m=await a.json();if(!E)return;z(m.entries),O(m.next)})().catch((a)=>{if(E)R(`the World did not answer: ${a instanceof Error?a.message:String(a)}`)});let p=setInterval(()=>{let a=h.current;if(a===null||document.hidden)return;X0(U,k()).then(async(m)=>{if(!m.ok||!E)return;let _1=await m.json();if(!E)return;if(a.length===0){if(_1.entries.length)z(_1.entries),O(_1.next);return}let $1=new Set((h.current??a).map(E4)),J1=_1.entries.filter((y)=>!$1.has(E4(y)));V({items:J1,gap:J1.length===_1.entries.length&&_1.next?_1:null})}).catch(()=>null)},3000);return()=>{E=!1,clearInterval(p)}},[U,k]);let P=()=>{if(D.gap)z(D.gap.entries),O(D.gap.next);else z((E)=>[...D.items,...E??[]].sort(dR));V({items:[],gap:null})},C=async()=>{if(!B)return;M(!0),I(null);try{let E=await X0(U,k(B));if(!E.ok){I(await z5(E));return}let p=await E.json();z((a)=>{let m=new Set((a??[]).map(E4));return[...a??[],...p.entries.filter((_1)=>!m.has(E4(_1)))]}),O(p.next)}catch(E){I(`the World did not answer: ${E instanceof Error?E.message:String(E)}`)}finally{M(!1)}},v=B1.useMemo(()=>kV(W??[]),[W]),b=D.items.length;return H.jsxDEV(H.Fragment,{children:[H.jsxDEV("div",{role:"group","aria-label":"Filter by twin",className:"chips",children:[H.jsxDEV("button",{type:"button","aria-pressed":K===null,onClick:()=>X(null),children:"All vendors"},void 0,!1,void 0,this),Z.map((E)=>H.jsxDEV("button",{type:"button","aria-pressed":K===E,"aria-label":E,onClick:()=>X(K===E?null:E),children:F0(E)},E,!1,void 0,this))]},void 0,!0,void 0,this),H.jsxDEV("div",{"aria-live":"polite",className:"pill-slot",children:b>0?H.jsxDEV("button",{type:"button",className:"pill",onClick:P,children:[D.gap?`${b}+`:b," new change",b===1?"":"s"," — show"]},void 0,!0,void 0,this):null},void 0,!1,void 0,this),T?H.jsxDEV("p",{role:"alert",children:["Could not read the timeline: ",T]},void 0,!0,void 0,this):W===null?H.jsxDEV("p",{className:"mode",role:"status",children:"Loading the timeline…"},void 0,!1,void 0,this):W.length===0?K?H.jsxDEV("p",{children:["Nothing has happened in ",K," yet."]},void 0,!0,void 0,this):H.jsxDEV("div",{className:"empty",children:[H.jsxDEV("p",{children:H.jsxDEV("strong",{children:"Nothing has happened in this World yet."},void 0,!1,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("p",{className:"mode",children:["An entry arrives each time something changes a twin: an app (or a seed script) calling a twin's API at ",H.jsxDEV("code",{children:[w6,"/",Q,"/<twin>"]},void 0,!0,void 0,this),", a mirror's form, a changeset landing. They show here within a few seconds."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):H.jsxDEV("div",{className:"feed","aria-label":"Timeline",children:[v.map((E)=>H.jsxDEV("div",{role:"group","aria-label":E.label,className:"day",children:[H.jsxDEV("h3",{className:"day-head",children:E.label},void 0,!1,void 0,this),H.jsxDEV("ol",{className:"instants",children:E.instants.map((p)=>H.jsxDEV("li",{className:"instant",children:[H.jsxDEV("div",{className:"instant-time",title:p.items.length>1?"These happened at the same moment of the World's clock: their order across vendors is not known.":void 0,children:H.jsxDEV(h0,{iso:p.at,time:!0},void 0,!1,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("ul",{className:"entries",children:jV(p.items).map((a)=>Array.isArray(a)?H.jsxDEV("li",{className:"entry run",children:H.jsxDEV("details",{children:[H.jsxDEV("summary",{children:[H.jsxDEV("span",{className:"twin-chip",children:[H.jsxDEV(A5,{vendor:a[0].twin},void 0,!1,void 0,this),F0(a[0].twin)]},void 0,!0,void 0,this)," ",H.jsxDEV("span",{className:"op",children:[J9(a.length,a[0].entry.subject.type)," ",n5(a[0].entry).what.split(" ").slice(-1)[0]]},void 0,!0,void 0,this)," ",H.jsxDEV("span",{className:"actor mode",children:oq(a[0].entry,a[0].twin)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("ul",{className:"entries",children:a.map((m)=>H.jsxDEV(yR,{name:Q,p:m},E4(m),!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},E4(a[0]),!1,void 0,this):H.jsxDEV(yR,{name:Q,p:a},E4(a),!1,void 0,this))},void 0,!1,void 0,this)]},`${p.at}:${E4(p.items[0])}`,!0,void 0,this))},void 0,!1,void 0,this)]},E.day,!0,void 0,this)),B?H.jsxDEV("button",{type:"button",onClick:()=>void C(),disabled:L,"aria-busy":L,children:"Load older"},void 0,!1,void 0,this):H.jsxDEV("p",{className:"mode",children:["The beginning of this World",K?`'s ${K}`:"","."]},void 0,!0,void 0,this),f?H.jsxDEV("p",{role:"alert",children:["Could not load older changes: ",f]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function yV({name:Q,token:U,id:Z}){let K=/^[0-9a-f]{32}$/.test(Z),X=L5(U,K?`/-/${Q}/timeline?trace=${Z}&limit=500`:null),W=X.state==="ok"?[...X.data.entries].sort((T,R)=>-dR(T,R)):[],z=[...new Set(W.map((T)=>T.twin))],B=W[0]?Date.parse(W[0].entry.occurredAt):0,O=H.jsxDEV("a",{href:`${q0}/${Q}/~/timeline`,onClick:(T)=>{T.preventDefault(),v0([...Q.split("/"),"~","timeline"])},children:"← Timeline"},void 0,!1,void 0,this);return H.jsxDEV(H.Fragment,{children:[H.jsxDEV("p",{children:O},void 0,!1,void 0,this),H.jsxDEV("h3",{children:["Trace ",H.jsxDEV("code",{children:Z},void 0,!1,void 0,this)]},void 0,!0,void 0,this),!K?H.jsxDEV("p",{role:"alert",children:[Z?`${Z} is not a trace id`:"No trace named",": a W3C trace id is 32 hex characters."]},void 0,!0,void 0,this):H.jsxDEV(B5,{load:X,what:"the trace"},void 0,!1,void 0,this),X.state==="ok"&&W.length===0?H.jsxDEV("div",{className:"empty",children:[H.jsxDEV("p",{children:H.jsxDEV("strong",{children:"Nothing in this World carries this trace."},void 0,!1,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("p",{className:"mode",children:["Causes are followed through the W3C ",H.jsxDEV("code",{children:"traceparent"},void 0,!1,void 0,this)," header: an app instrumented with OpenTelemetry sends it with each call, and every entry that call writes keeps it — so one click in the app can be read across Stripe, Slack and the rest. Without it the World knows the order of what happened, not what caused what."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null,W.length>0?H.jsxDEV(H.Fragment,{children:[H.jsxDEV("p",{className:"mode",children:[W.length," step",W.length===1?"":"s"," across ",z.length," twin",z.length===1?"":"s",X.state==="ok"&&X.data.next?" · the first 500 shown":""]},void 0,!0,void 0,this),H.jsxDEV("div",{role:"table","aria-label":"Trace waterfall",className:"waterfall",style:{gridTemplateColumns:`minmax(130px, auto) repeat(${z.length}, minmax(140px, 1fr))`},children:[H.jsxDEV("div",{role:"row",className:"wf-row wf-head",children:[H.jsxDEV("span",{role:"columnheader",children:"time"},void 0,!1,void 0,this),z.map((T)=>H.jsxDEV("span",{role:"columnheader",children:T},T,!1,void 0,this))]},void 0,!0,void 0,this),W.map((T)=>{let R=Date.parse(T.entry.occurredAt)-B,L=gR(T.entry.traceparent)?.span;return H.jsxDEV("div",{role:"row",className:"wf-row",children:[H.jsxDEV("span",{role:"cell",className:"wf-time",children:[H.jsxDEV(h0,{iso:T.entry.occurredAt,time:!0},void 0,!1,void 0,this)," ",H.jsxDEV("span",{className:"mode",children:["+",R," ms"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),z.map((M)=>H.jsxDEV("span",{role:"cell",className:M===T.twin?"wf-cell on":"wf-cell",children:M===T.twin?H.jsxDEV("details",{children:[H.jsxDEV("summary",{children:[T.entry.operation??T.entry.op," ",H.jsxDEV("code",{children:[T.entry.subject.type,":",T.entry.subject.id]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("p",{className:"mode",children:[mR(T.entry)," · ",nq(T.entry)," · position ",T.position,L?H.jsxDEV(H.Fragment,{children:[" · span ",H.jsxDEV("code",{children:L},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),H.jsxDEV(iR,{fields:T.entry.fields},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null},M,!1,void 0,this))]},E4(T),!0,void 0,this)})]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)}function iR({fields:Q}){let U=Object.entries(Q??{});if(U.length===0)return H.jsxDEV("p",{className:"mode",children:"No fields."},void 0,!1,void 0,this);return H.jsxDEV("dl",{className:"fields",children:U.map(([Z,K])=>H.jsxDEV(B1.default.Fragment,{children:[H.jsxDEV("dt",{children:Z},void 0,!1,void 0,this),H.jsxDEV("dd",{children:H.jsxDEV("code",{children:typeof K==="string"?K:JSON.stringify(K)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},Z,!0,void 0,this))},void 0,!1,void 0,this)}var sq=1280,tq=820,vR=160;function vV({data:Q}){let{world:U,vendor:Z,active:K,open:X}=Q;return H.jsxDEV(H.Fragment,{children:[H.jsxDEV(WR,{isVisible:!0,position:C1.Top,align:"start",className:"frame-label",children:[H.jsxDEV(A5,{vendor:Z},void 0,!1,void 0,this),H.jsxDEV("span",{children:F0(Z)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("div",{className:K?"frame on":"frame",style:{width:sq,height:tq},children:[H.jsxDEV("div",{className:"frame-bar",title:"Drag to move",children:[H.jsxDEV(A5,{vendor:Z},void 0,!1,void 0,this),H.jsxDEV("strong",{children:F0(Z)},void 0,!1,void 0,this),H.jsxDEV("span",{className:"frame-url",children:D8(U,Z).replace(/^https?:\/\//,"")},void 0,!1,void 0,this),H.jsxDEV("a",{className:"nodrag",href:`${q0}/${U}/~/vendors/${Z}`,onClick:(W)=>{W.preventDefault(),X(Z)},children:"Open"},void 0,!1,void 0,this),H.jsxDEV("a",{className:"nodrag",href:D8(U,Z),target:"_blank",rel:"noopener noreferrer","aria-label":`Open ${F0(Z)} in a new tab`,children:"↗"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("div",{className:K?"frame-body nodrag nopan nowheel":"frame-body",children:H.jsxDEV("iframe",{title:`${Z} mirror`,src:D8(U,Z),loading:"lazy",style:{pointerEvents:K?"auto":"none"}},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var EV={screen:vV};function bV(Q){return H.jsxDEV(kX,{children:H.jsxDEV(uV,{...Q},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function uV({name:Q,twins:U,session:Z,retry:K,snapshot:X,back:W}){let z=U.state==="ok"?U.data.twins.filter((E)=>E.mirror).map((E)=>E.twin):[],B=`volter.canvas.${Q}`,[O,T]=B1.useState(null),[R,L]=B1.useState(!0),M=OJ(),f=B1.useCallback((E)=>v0([...Q.split("/"),"~","vendors",E]),[Q]),I=Math.max(1,Math.ceil(Math.sqrt(z.length))),D=B1.useCallback(()=>{let E={};try{E=JSON.parse(localStorage.getItem(B)??"{}")}catch{}return z.map((p,a)=>({id:p,type:"screen",dragHandle:".frame-bar",position:E[p]??{x:a%I*(sq+vR),y:Math.floor(a/I)*(tq+vR)},data:{world:Q,vendor:p,active:!1,open:f}}))},[z.join(","),Q,I,f]),[V,k,h]=GR([]);B1.useEffect(()=>{k(D())},[D,k]),B1.useEffect(()=>{k((E)=>E.map((p)=>p.data.active===(p.id===O)?p:{...p,data:{...p.data,active:p.id===O}}))},[O,k]),B1.useEffect(()=>{let E=(p)=>{if(p.key==="Escape")T(null)};return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[]);let P=()=>{try{localStorage.setItem(B,JSON.stringify(Object.fromEntries(V.map((E)=>[E.id,E.position]))))}catch{}},C=(E)=>{T(E);let p=M.getNode(E);if(!p)return;let a=Math.min((window.innerWidth-300)/sq,(window.innerHeight-120)/tq,1);M.setCenter(p.position.x+sq/2-130/a,p.position.y+tq/2,{zoom:a,duration:400})},v=typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches,b=Z.state==="ok"&&U.state==="ok";return H.jsxDEV("div",{className:"canvas full",role:"region","aria-label":"Every vendor's screens",children:H.jsxDEV(UR,{nodes:b?V:[],onNodesChange:h,nodeTypes:EV,onNodeDragStop:P,onNodeClick:(E,p)=>T(p.id),onPaneClick:()=>T(null),fitView:!0,fitViewOptions:{padding:{top:"64px",left:"272px",right:"32px",bottom:"32px"}},minZoom:0.05,maxZoom:1.5,nodesConnectable:!1,elementsSelectable:!1,panOnScroll:!1,zoomOnDoubleClick:!1,colorMode:v?"dark":"light",proOptions:{hideAttribution:!0},children:[H.jsxDEV(FR,{variant:v4.Dots,gap:28,size:1.4},void 0,!1,void 0,this),H.jsxDEV(N8,{position:"top-left",className:"float layers",children:[H.jsxDEV("div",{className:"float-head",children:[H.jsxDEV("button",{type:"button",className:"back",onClick:W,"aria-label":`Back to ${Q}`,children:"←"},void 0,!1,void 0,this),H.jsxDEV("span",{className:"float-title",children:[H.jsxDEV("strong",{children:Q.split("/")[1]},void 0,!1,void 0,this),H.jsxDEV("span",{className:"mode",children:[Q.split("/")[0],X?" · snapshot":""]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("button",{type:"button",className:"ghost","aria-expanded":R,"aria-label":R?"Hide the screens list":"Show the screens list",onClick:()=>L(!R),children:R?"▾":"▸"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),R?H.jsxDEV("ul",{className:"layer-list","aria-label":"Screens",children:[z.map((E)=>H.jsxDEV("li",{children:H.jsxDEV("button",{type:"button",className:O===E?"on":void 0,onClick:()=>C(E),children:[H.jsxDEV(A5,{vendor:E},void 0,!1,void 0,this),H.jsxDEV("span",{children:F0(E)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},E,!1,void 0,this)),U.state==="ok"&&z.length===0?H.jsxDEV("li",{className:"mode",children:"No vendor in this World has screens."},void 0,!1,void 0,this):null]},void 0,!0,void 0,this):null,H.jsxDEV(B5,{load:U,what:"the vendors"},void 0,!1,void 0,this),Z.state==="pending"?H.jsxDEV("p",{className:"mode",role:"status",children:"Opening…"},void 0,!1,void 0,this):null,Z.state==="error"?H.jsxDEV("p",{role:"alert",children:["The World did not open its screens: ",Z.error," ",H.jsxDEV("button",{type:"button",onClick:K,children:"Try again"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),H.jsxDEV(N8,{position:"top-center",className:"float hint mode",children:O?`Using ${F0(O)} · Esc to leave`:"Drag to pan · scroll to zoom · click a screen to use it"},void 0,!1,void 0,this),H.jsxDEV(XR,{showInteractive:!1,position:"bottom-left"},void 0,!1,void 0,this),H.jsxDEV(YR,{pannable:!0,zoomable:!0,nodeBorderRadius:8,position:"bottom-right"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}var aR=(Q)=>{let U=new Map;for(let Z of Q.actions)U.set(Z.service,[...U.get(Z.service)??[],{...Z.action,service:Z.service,op:Z.action.op??Z.action.operation??""}]);return[...U.entries()]};function sR(Q){if(Q.applied)return Q.applied.outcome==="applied"?{label:"Deployed",tone:"done"}:Q.applied.outcome==="partial"?{label:"Partly deployed",tone:"warn"}:{label:"Deploy refused",tone:"bad"};let U=Q.currentHash??Q.contentHash,Z=Q.approvals.filter((X)=>X.contentHash===U).length,K=Q.verification&&Q.verification.contentHash===U?Q.verification:null;if(K&&!K.passed)return{label:"Checks failed",tone:"bad"};if(Z>0)return{label:`Approved by ${Z}`,tone:"good"};if(K)return{label:"Verified",tone:"good"};return{label:"Not verified",tone:"plain"}}function xV({name:Q,token:U,signsAs:Z,canWrite:K,rooted:X,open:W,refused:z}){let[B,O]=B1.useState(0),T=L5(U,`/-/${Q}/changesets`,B),R=(M)=>(f)=>{f.preventDefault(),v0([...Q.split("/"),"~","changesets",M])};if(W){let M=T.state==="ok"?T.data.changesets.find((f)=>f.name===W):void 0;return H.jsxDEV(H.Fragment,{children:[H.jsxDEV("p",{className:"crumbs-line",children:H.jsxDEV("a",{href:`${q0}/${Q}/~/changesets`,onClick:(f)=>{f.preventDefault(),v0([...Q.split("/"),"~","changesets"])},children:"← Changesets"},void 0,!1,void 0,this)},void 0,!1,void 0,this),H.jsxDEV(B5,{load:T,what:"the changesets"},void 0,!1,void 0,this),T.state==="ok"&&!M?H.jsxDEV("p",{className:"mode",children:["This World has no changeset named ",W,"."]},void 0,!0,void 0,this):null,M?H.jsxDEV(hV,{name:Q,token:U,signsAs:Z,c:M,canWrite:K,rooted:X,refused:z,onChanged:()=>O((f)=>f+1)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}let L=T.state==="ok"?[...T.data.changesets].sort((M,f)=>f.createdAt.localeCompare(M.createdAt)):[];return H.jsxDEV(H.Fragment,{children:[H.jsxDEV("p",{className:"lede",children:"A changeset is what this World changed, cut into a piece a person reviews: what it does at each vendor, the World's checks over it, and who approved it. Where the World has a real account behind a vendor, an approved changeset deploys there, with a receipt for each change."},void 0,!1,void 0,this),H.jsxDEV(B5,{load:T,what:"the changesets"},void 0,!1,void 0,this),T.state==="ok"&&L.length===0?H.jsxDEV(wR,{title:"No changesets yet",children:H.jsxDEV("p",{children:["Cut one from what your app did in this World: ",H.jsxDEV("code",{children:'volter world changeset -m "What it does and why"'},void 0,!1,void 0,this),". Pushed to a shared World, it shows up here for review."]},void 0,!0,void 0,this)},void 0,!1,void 0,this):null,L.length>0?H.jsxDEV("div",{className:"block",children:H.jsxDEV("table",{className:"dense","aria-label":"Changesets",children:[H.jsxDEV("thead",{children:H.jsxDEV("tr",{children:[H.jsxDEV("th",{children:"Changeset"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"Changes"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"Made"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"Status"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("tbody",{children:L.map((M)=>{let f=sR(M),I=aR(M).map(([D,V])=>`${V.length} at ${F0(D)}`).join(" · ");return H.jsxDEV("tr",{children:[H.jsxDEV("td",{children:[H.jsxDEV("a",{href:`${q0}/${Q}/~/changesets/${M.name}`,onClick:R(M.name),children:H.jsxDEV("b",{children:M.message??M.name},void 0,!1,void 0,this)},void 0,!1,void 0,this),M.message?H.jsxDEV("span",{className:"mode mono",children:[" ",M.name]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),H.jsxDEV("td",{className:"mode",children:I||"nothing"},void 0,!1,void 0,this),H.jsxDEV("td",{className:"mode",children:H.jsxDEV(h0,{iso:M.createdAt},void 0,!1,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("td",{children:H.jsxDEV("span",{className:`badge cs-${f.tone}`,children:f.label},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},M.name,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}function hV({name:Q,token:U,signsAs:Z,c:K,canWrite:X,rooted:W,refused:z,onChanged:B}){let[O,T]=B1.useState(null),[R,L]=B1.useState(!1),[M,f]=B1.useState(""),[I,D]=B1.useState(""),V=sR(K),k=aR(K),h=k.map(([m])=>m),P=h.some((m)=>W.includes(m)),C=(m)=>m===(K.currentHash??K.contentHash),v=async(m,_1,$1,J1)=>{T(m);try{let y=await X0(U,_1,{method:"POST",...$1===void 0?{}:{body:JSON.stringify($1)}});if(!y.ok)return z(y),t2(`${m}: ${await z5(y)}`,"error"),!1;if(J1)t2(J1);return B(),!0}catch(y){return t2(`${m}: the World did not answer (${y instanceof Error?y.message:String(y)})`,"error"),!1}finally{T(null)}},b=()=>{v("Verify",`/-/${Q}/changesets/${K.name}/verify`,void 0,"Verified: the checks ran over it")},E=async(m)=>{if(m.preventDefault(),await v("Approve",`/-/${Q}/changesets/${K.name}/approve`,{...M.trim()?{note:M.trim()}:{},...Z===null&&I.trim()?{as:I.trim()}:{}},"Approved"))L(!1),f("")},p=async()=>{if(!await o5({title:`Deploy ${K.name} to the real vendors?`,body:H.jsxDEV(H.Fragment,{children:["It performs its ",K.actions.length," change",K.actions.length===1?"":"s"," against the real account",h.filter((m)=>W.includes(m)).length===1?"":"s"," behind ",EX(h.filter((m)=>W.includes(m)).map(F0)),". This cannot be taken back here."]},void 0,!0,void 0,this),action:"Deploy",danger:!0,typed:K.name}))return;v("Deploy",`/-/${Q}/deploy/${K.name}`,{confirm:K.name},"Deployed: the receipts are below")},a=!X?"This session reads the World; it changes nothing":K.applied?"Already deployed":null;return H.jsxDEV("div",{className:"changeset","aria-labelledby":"changeset-title",children:[H.jsxDEV("div",{className:"changeset-head",children:[H.jsxDEV("div",{children:[H.jsxDEV("h3",{id:"changeset-title",children:[K.message??K.name," ",H.jsxDEV("span",{className:`badge cs-${V.tone}`,children:V.label},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("p",{className:"mode",children:[H.jsxDEV("code",{children:K.name},void 0,!1,void 0,this)," · made ",H.jsxDEV(h0,{iso:K.createdAt},void 0,!1,void 0,this)," · ",K.actions.length," change",K.actions.length===1?"":"s"," at ",EX(h.map(F0))||"no vendor"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("div",{className:"changeset-actions",children:[H.jsxDEV("button",{type:"button",onClick:b,disabled:Boolean(a)||O!==null,title:a??"Replay it in a throwaway World and run the World's checks",children:O==="Verify"?"Verifying…":"Verify"},void 0,!1,void 0,this),H.jsxDEV("button",{type:"button",onClick:()=>L(!0),disabled:Boolean(a)||O!==null,title:a??"Sign its current contents as yourself",children:"Approve…"},void 0,!1,void 0,this),P?H.jsxDEV("button",{type:"button",className:"primary",onClick:()=>void p(),disabled:Boolean(a)||O!==null,title:a??"Perform it against the real accounts behind this World",children:O==="Deploy"?"Deploying…":"Deploy…"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),a&&!K.applied?H.jsxDEV("p",{className:"mode",children:[a,"."]},void 0,!0,void 0,this):null,!P&&!K.applied?H.jsxDEV("p",{className:"mode",children:"It stays in this World: no vendor it changes has a real account behind it here (a shared World with a root deploys; see Settings › Real services)."},void 0,!1,void 0,this):null,K.narration?H.jsxDEV("p",{className:"narration",children:K.narration},void 0,!1,void 0,this):null,H.jsxDEV("h4",{children:"Changes"},void 0,!1,void 0,this),k.length===0?H.jsxDEV("p",{className:"mode",children:"It changes nothing."},void 0,!1,void 0,this):H.jsxDEV(tR,{groups:k,idPrefix:`cs-${K.name}`},void 0,!1,void 0,this),H.jsxDEV("h4",{children:"Checks"},void 0,!1,void 0,this),!K.verification?H.jsxDEV("p",{className:"mode",children:"Not verified yet. Verify replays it in a throwaway World and runs this World's checks over the result."},void 0,!1,void 0,this):H.jsxDEV("div",{className:C(K.verification.contentHash)?"":"stale",children:[H.jsxDEV("p",{children:[K.verification.passed?"✓ Passed":"✗ Failed"," · ",H.jsxDEV(h0,{iso:K.verification.at},void 0,!1,void 0,this),C(K.verification.contentHash)?null:H.jsxDEV("span",{className:"mode",children:" · on an earlier version of it: verify again"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),K.verification.results.length?H.jsxDEV("ul",{className:"checks",children:K.verification.results.map((m)=>H.jsxDEV("li",{children:[m.passed?"✓":"✗"," ",H.jsxDEV("code",{children:m.id},void 0,!1,void 0,this)," ",H.jsxDEV("span",{className:"mode",children:F0(m.service)},void 0,!1,void 0,this)]},m.id,!0,void 0,this))},void 0,!1,void 0,this):null,K.verification.refusals?.length?H.jsxDEV("ul",{className:"checks",children:K.verification.refusals.map((m,_1)=>H.jsxDEV("li",{children:["✗ ",H.jsxDEV("code",{children:m.check},void 0,!1,void 0,this)," ",H.jsxDEV("span",{className:"mode",children:[F0(m.service),": ",m.reason]},void 0,!0,void 0,this)]},_1,!0,void 0,this))},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),H.jsxDEV("h4",{children:"Approvals"},void 0,!1,void 0,this),K.approvals.length===0?H.jsxDEV("p",{className:"mode",children:"No one has approved it."},void 0,!1,void 0,this):H.jsxDEV("ul",{className:"approvals",children:K.approvals.map((m,_1)=>H.jsxDEV("li",{children:[H.jsxDEV("b",{children:m.principal},void 0,!1,void 0,this)," ",H.jsxDEV("span",{className:"mode",children:[H.jsxDEV(h0,{iso:m.at},void 0,!1,void 0,this),C(m.contentHash)?"":" · signed an earlier version"]},void 0,!0,void 0,this),m.note?H.jsxDEV("div",{className:"mode",children:["“",m.note,"”"]},void 0,!0,void 0,this):null]},_1,!0,void 0,this))},void 0,!1,void 0,this),K.applied?H.jsxDEV(H.Fragment,{children:[H.jsxDEV("h4",{children:"Deployed"},void 0,!1,void 0,this),H.jsxDEV("p",{children:[K.applied.outcome==="applied"?"Every change reached the real vendors":K.applied.outcome==="partial"?"Some changes reached the real vendors":"The deploy was refused"," · ",H.jsxDEV(h0,{iso:K.applied.at},void 0,!1,void 0,this)]},void 0,!0,void 0,this),K.applied.refusal?.length?H.jsxDEV("ul",{className:"checks",children:K.applied.refusal.map((m,_1)=>H.jsxDEV("li",{className:"mode",children:m},_1,!1,void 0,this))},void 0,!1,void 0,this):null,K.applied.receipts.length?H.jsxDEV("ul",{className:"receipts",children:K.applied.receipts.map((m)=>H.jsxDEV("li",{children:[H.jsxDEV("span",{className:m.status==="failed"?"badge cs-bad":"badge cs-done",children:m.status},void 0,!1,void 0,this)," ",F0(m.service)," ",m.url?H.jsxDEV("a",{href:m.url,target:"_blank",rel:"noopener noreferrer",children:m.externalId??m.url},void 0,!1,void 0,this):m.externalId?H.jsxDEV("code",{children:m.externalId},void 0,!1,void 0,this):null,m.error?H.jsxDEV("span",{className:"mode",children:[" · ",m.error]},void 0,!0,void 0,this):null]},m.actionId,!0,void 0,this))},void 0,!1,void 0,this):null]},void 0,!0,void 0,this):null,H.jsxDEV(S8,{open:R,onClose:()=>{if(!O)L(!1)},title:`Approve ${K.name}`,footer:H.jsxDEV(H.Fragment,{children:[H.jsxDEV("button",{type:"button",onClick:()=>L(!1),disabled:O!==null,children:"Cancel"},void 0,!1,void 0,this),H.jsxDEV("button",{type:"submit",form:"approve-changeset",className:"primary",disabled:O!==null,children:O==="Approve"?"Approving…":"Approve"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:H.jsxDEV("form",{id:"approve-changeset",onSubmit:(m)=>void E(m),className:"stack",children:[H.jsxDEV("p",{className:"mode",children:["You sign its contents as they stand now",Z?H.jsxDEV(H.Fragment,{children:[", recorded as ",H.jsxDEV("b",{children:Z},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,". A later change to it shows your approval as for an earlier version."]},void 0,!0,void 0,this),Z===null?H.jsxDEV("label",{children:[H.jsxDEV("span",{children:"Approving as"},void 0,!1,void 0,this),H.jsxDEV("input",{name:"approveAs",value:I,onChange:(m)=>D(m.target.value),maxLength:80,required:!0,placeholder:"your name or email",autoComplete:"off"},void 0,!1,void 0,this),H.jsxDEV("span",{className:"mode",children:"This World was opened with its token, which names no person: the approval records the name you give."},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,H.jsxDEV("label",{children:[H.jsxDEV("span",{children:["Note ",H.jsxDEV("span",{className:"mode",children:"(optional)"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("textarea",{name:"approveNote",value:M,onChange:(m)=>f(m.target.value),rows:3,maxLength:500},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function tR({groups:Q,idPrefix:U}){return H.jsxDEV(H.Fragment,{children:Q.map(([Z,K])=>H.jsxDEV("div",{className:"compare",role:"group","aria-labelledby":`${U}-${Z}`,children:[H.jsxDEV("h3",{id:`${U}-${Z}`,className:"vendor-cell",children:[H.jsxDEV(A5,{vendor:Z},void 0,!1,void 0,this),F0(Z)," ",H.jsxDEV("span",{className:"mode",children:["· ",K.length," change",K.length===1?"":"s"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("ul",{children:SV(K).map((X)=>X.length>=3?H.jsxDEV("li",{children:H.jsxDEV("details",{children:[H.jsxDEV("summary",{children:[H.jsxDEV("span",{className:"op",children:[J9(X.length,X[0].subject.type)," ",n5(X[0]).what.split(" ").slice(-1)[0]]},void 0,!0,void 0,this)," ",H.jsxDEV("span",{className:"mode",children:[X.map((W)=>n5(W).label??aq(W)).slice(0,4).join(", "),X.length>4?", …":""]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("ul",{children:X.map((W)=>H.jsxDEV("li",{children:[H.jsxDEV("span",{className:"op",children:n5(W).what},void 0,!1,void 0,this)," ",n5(W).label?H.jsxDEV("span",{className:"label",children:["“",n5(W).label,"”"]},void 0,!0,void 0,this):H.jsxDEV("code",{children:aq(W)},void 0,!1,void 0,this)," ",H.jsxDEV("span",{className:"mode",children:[H.jsxDEV(h0,{iso:W.occurredAt},void 0,!1,void 0,this)," · ",oq(W,Z)]},void 0,!0,void 0,this)]},W.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},X[0].id,!1,void 0,this):X.map((W)=>H.jsxDEV("li",{children:H.jsxDEV("details",{children:[H.jsxDEV("summary",{children:[H.jsxDEV("span",{className:"op",children:n5(W).what},void 0,!1,void 0,this)," ",n5(W).label?H.jsxDEV("span",{className:"label",children:["“",n5(W).label,"”"]},void 0,!0,void 0,this):H.jsxDEV("code",{children:aq(W)},void 0,!1,void 0,this)," ",H.jsxDEV("span",{className:"mode",children:[H.jsxDEV(h0,{iso:W.occurredAt},void 0,!1,void 0,this)," · ",oq(W,Z)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV(iR,{fields:W.fields},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},W.id,!1,void 0,this)))},void 0,!1,void 0,this)]},Z,!0,void 0,this))},void 0,!1,void 0,this)}function mV({name:Q,token:U}){let Z=L5(U,`/-/${Q}/diff`),K=B1.useMemo(()=>{let X=new Map;if(Z.state==="ok")for(let W of Z.data.changes)X.set(W.twin,[...X.get(W.twin)??[],W.entry]);return[...X.entries()]},[Z]);return H.jsxDEV(H.Fragment,{children:[H.jsxDEV(B5,{load:Z,what:"the changes"},void 0,!1,void 0,this),Z.state==="ok"?H.jsxDEV(H.Fragment,{children:[H.jsxDEV("p",{className:"mode",children:["What this World changed since it started",Z.data.base.at?H.jsxDEV(H.Fragment,{children:[" (",H.jsxDEV(h0,{iso:Z.data.base.at},void 0,!1,void 0,this),", ",H.jsxDEV("code",{children:Z.data.base.id},void 0,!1,void 0,this),")"]},void 0,!0,void 0,this):H.jsxDEV(H.Fragment,{children:[" (",H.jsxDEV("code",{children:Z.data.base.id},void 0,!1,void 0,this),")"]},void 0,!0,void 0,this),": ",Z.data.changes.length," change",Z.data.changes.length===1?"":"s"," at ",K.length," vendor",K.length===1?"":"s",". A changeset takes these to the real services."]},void 0,!0,void 0,this),K.length===0?H.jsxDEV("p",{className:"empty",children:["No changes since ",Z.data.base.id,Z.data.base.at?H.jsxDEV(H.Fragment,{children:[" (",H.jsxDEV(h0,{iso:Z.data.base.at},void 0,!1,void 0,this),")"]},void 0,!0,void 0,this):null,"."]},void 0,!0,void 0,this):H.jsxDEV(tR,{groups:K,idPrefix:"changes"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)}function gV({name:Q,token:U}){let[Z,K]=B1.useState(0),X=L5(U,`/-/${Q}/keys`,Z),[W,z]=B1.useState(!1),[B,O]=B1.useState(""),[T,R]=B1.useState("write"),[L,M]=B1.useState(!1),[f,I]=B1.useState(null),[D,V]=B1.useState(null),[k,h]=B1.useState(null),P=async()=>{let b=`Read-only link · ${new Date().toLocaleDateString(void 0,{month:"short",day:"numeric"})}`,E=await X0(U,`/-/${Q}/keys`,{method:"POST",body:JSON.stringify({name:b,scope:"read"})}).catch(()=>null),p=E?await E.json().catch(()=>({})):{error:`${B0} did not answer`};if(!E?.ok||!p.key){t2(p.error??"refused","error");return}h(`${window.location.origin}${q0}/${Q}#${new URLSearchParams({token:p.key}).toString()}`),K((a)=>a+1)},C=async(b)=>{b.preventDefault(),M(!0),I(null);let E=await X0(U,`/-/${Q}/keys`,{method:"POST",body:JSON.stringify({name:B.trim(),scope:T})}).catch(()=>null);M(!1);let p=E?await E.json().catch(()=>({})):{error:`${B0} did not answer`};if(!E?.ok||!p.key){I(p.error??"refused");return}z(!1),V({key:p.key,name:B.trim()}),O(""),K((a)=>a+1)},v=async(b)=>{if(!await o5({title:`Revoke ${b.name}?`,body:"Whatever holds it loses this World at once.",action:"Revoke key",danger:!0}))return;let E=await X0(U,`/-/${Q}/keys/${b.id}`,{method:"DELETE"});if(E.ok)t2(`Revoked ${b.name}`);else t2(await z5(E),"error");K((p)=>p+1)};return H.jsxDEV("section",{"aria-labelledby":"keys-head",className:"keys",children:[H.jsxDEV("div",{className:"keys-head",children:[H.jsxDEV("div",{children:[H.jsxDEV("h3",{id:"keys-head",children:"Keys"},void 0,!1,void 0,this),H.jsxDEV("p",{className:"mode",children:"What an app, a script or a CI job holds to reach this World: each named for what holds it and revoked alone. People open the World as themselves; keys are for software."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),o2()?H.jsxDEV("a",{className:"button primary",href:`${o2()}/${encodeURIComponent(Q.split("/")[0]??"")}`,children:"Make a key on the platform"},void 0,!1,void 0,this):H.jsxDEV("div",{className:"head-actions",children:[H.jsxDEV("button",{type:"button",onClick:()=>void P(),children:"Share a read-only link"},void 0,!1,void 0,this),H.jsxDEV("button",{type:"button",className:"primary",onClick:()=>{I(null),z(!0)},children:"Make a key"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV(B5,{load:X,what:"the keys",retry:()=>K((b)=>b+1)},void 0,!1,void 0,this),X.state==="ok"?X.data.keys.length===0?H.jsxDEV("p",{className:"mode",children:"No keys yet. The World's own token opens it too."},void 0,!1,void 0,this):H.jsxDEV("table",{className:"dense","aria-label":"Keys",children:[H.jsxDEV("thead",{children:H.jsxDEV("tr",{children:[H.jsxDEV("th",{children:"Name"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"Access"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"Made"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"Last used"},void 0,!1,void 0,this),H.jsxDEV("th",{className:"num",children:H.jsxDEV("span",{className:"sr",children:"Actions"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("tbody",{children:X.data.keys.map((b)=>H.jsxDEV("tr",{children:[H.jsxDEV("td",{children:b.name},void 0,!1,void 0,this),H.jsxDEV("td",{children:b.scope==="write"?"Read and write":"Read only"},void 0,!1,void 0,this),H.jsxDEV("td",{className:"mode",children:H.jsxDEV("span",{title:IJ(b.createdAt),children:dq(b.createdAt)},void 0,!1,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("td",{className:"mode",children:b.lastUsedAt?dq(b.lastUsedAt):"never"},void 0,!1,void 0,this),H.jsxDEV("td",{className:"num",children:H.jsxDEV(xX,{label:`More for ${b.name}`,items:[{label:"Revoke…",danger:!0,onSelect:()=>void v(b)}]},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},b.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,H.jsxDEV(S8,{open:W,onClose:()=>{if(!L)z(!1)},title:"Make a key",footer:H.jsxDEV(H.Fragment,{children:[H.jsxDEV("button",{type:"button",onClick:()=>z(!1),disabled:L,children:"Cancel"},void 0,!1,void 0,this),H.jsxDEV("button",{type:"submit",form:"make-key",disabled:L||!B.trim(),children:L?"Making…":"Make key"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:H.jsxDEV("form",{id:"make-key",onSubmit:C,"aria-label":"Make a key",children:[H.jsxDEV("label",{children:["Name ",H.jsxDEV("input",{autoFocus:!0,name:"keyName",value:B,onChange:(b)=>O(b.target.value),placeholder:"ci, staging app…",maxLength:80,required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("label",{children:["Access ",H.jsxDEV("select",{value:T,onChange:(b)=>R(b.target.value==="read"?"read":"write"),children:[H.jsxDEV("option",{value:"write",children:"Read and write"},void 0,!1,void 0,this),H.jsxDEV("option",{value:"read",children:"Read only"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),f?H.jsxDEV("p",{role:"alert",children:f},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this),H.jsxDEV(S8,{open:Boolean(D),onClose:()=>V(null),title:`${D?.name??"The key"} is ready`,footer:H.jsxDEV("button",{type:"button",className:"primary",onClick:()=>V(null),children:"Done"},void 0,!1,void 0,this),children:[H.jsxDEV("p",{className:"mode",children:"Copy it now: it is shown this once. Put it where the app reads its secrets."},void 0,!1,void 0,this),D?H.jsxDEV(uX,{label:"Key",value:D.key,secret:!0},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),H.jsxDEV(S8,{open:Boolean(k),onClose:()=>h(null),title:"A read-only link",footer:H.jsxDEV("button",{type:"button",className:"primary",onClick:()=>h(null),children:"Done"},void 0,!1,void 0,this),children:[H.jsxDEV("p",{className:"mode",children:"Whoever opens it sees this World's pages and changes nothing. Copy it now: it is shown this once. It is listed under Keys, where revoking it closes the link at once."},void 0,!1,void 0,this),k?H.jsxDEV(uX,{label:"Link",value:k,secret:!0},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function pV({name:Q,token:U,admin:Z,canWrite:K,refused:X,onRemoved:W}){let[z,B]=B1.useState(null),[O,T]=B1.useState(null),[R,L]=B1.useState(null),[M,f]=B1.useState(null),[I,D]=B1.useState(null),V=B1.useCallback(async()=>{let C=await X0(U,`/-/${Q}/twins`);B(C.ok?(await C.json()).twins:[]);let v=await X0(U,`/-/${Q}/requests?hours=24`);D(v.ok?await v.json():null);let b=await X0(U,`/-/${Q}/changesets`);T(b.ok?(await b.json()).changesets:[])},[Q,U]);B1.useEffect(()=>{V()},[V]);let k=async(C,v,b)=>{L(null);let E=await X0(U,v,b);if(!E.ok)X(E);L(E.ok?`${C}: done`:`${C}: ${await z5(E)}`),await V()},h=async()=>{if(!await o5({title:`Rotate the tokens of ${Q}?`,body:"Every app, script and person holding the current tokens loses access at once. The new ones are shown once.",action:"Rotate tokens",danger:!0}))return;let C=await X0(Z,`/-/worlds/${Q}/rotate`,{method:"POST"});if(C.ok)f(await C.json()),L("rotated: the new tokens are shown once");else L(`rotate: answered ${C.status}`)},P=async()=>{if(!await o5({title:`Remove ${Q}?`,body:"The host stops serving it and its whole history goes with it. This cannot be undone.",action:"Remove World",danger:!0,typed:Q}))return;let C=await X0(Z,`/-/worlds/${Q}`,{method:"DELETE"}).catch((v)=>v);if(C instanceof Error){L(`remove: the host did not answer (${C.message})`);return}if(C.ok)W();else L(`remove: answered ${C.status}`)};return H.jsxDEV(H.Fragment,{children:[R?H.jsxDEV("p",{role:"status",children:R},void 0,!1,void 0,this):null,M?H.jsxDEV("p",{role:"status",children:["token ",H.jsxDEV("code",{children:M.token},void 0,!1,void 0,this)," · read token ",H.jsxDEV("code",{children:M.readToken},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,K?H.jsxDEV(gV,{name:Q,token:U},void 0,!1,void 0,this):null,H.jsxDEV("h3",{children:"Real services"},void 0,!1,void 0,this),H.jsxDEV("p",{className:"mode",children:"Every vendor here is a stand-in. Connect one to its real service to read the real state into this World; give it the real key to send this World's changes there (a changeset's Deploy, below)."},void 0,!1,void 0,this),z===null?H.jsxDEV("p",{children:"Loading…"},void 0,!1,void 0,this):H.jsxDEV("table",{"aria-label":"Real services",children:[H.jsxDEV("thead",{children:H.jsxDEV("tr",{children:[H.jsxDEV("th",{children:"vendor"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"real service"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"real key"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"last read from it"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"last sent"},void 0,!1,void 0,this),K?H.jsxDEV("th",{},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("tbody",{children:z.map((C)=>H.jsxDEV("tr",{children:[H.jsxDEV("td",{children:H.jsxDEV("a",{href:`${q0}/${Q}/${C.twin}`,title:`Its log and stored state · ${C.position??0} changes held${C.protocol?.major!==void 0?` · protocol ${C.protocol.major}${C.protocol.standing&&C.protocol.standing!=="current"?` (${C.protocol.standing})`:""}`:""}`,onClick:(v)=>{v.preventDefault(),v0([...Q.split("/"),C.twin])},children:F0(C.twin)},void 0,!1,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("td",{children:C.root?.url?H.jsxDEV("code",{children:C.root.url},void 0,!1,void 0,this):H.jsxDEV("span",{className:"mode",children:"not connected"},void 0,!1,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("td",{children:C.credential?`sealed ${C.credential.fingerprint??""} · ${IJ(C.credential.placedAt)}`:H.jsxDEV("span",{className:"mode",children:"none"},void 0,!1,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("td",{children:C.refresh?.failed?H.jsxDEV("span",{role:"alert",children:["failed ×",C.refresh.failed.count??1,": ",C.refresh.failed.reason??""]},void 0,!0,void 0,this):C.root?IJ(C.refresh?.observedAt??C.refresh?.at):H.jsxDEV("span",{className:"mode",children:"—"},void 0,!1,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("td",{children:C.lastReceipt?`${C.lastReceipt.status??""} ${C.lastReceipt.externalId??""} ${C.lastReceipt.reason??""}`.trim():H.jsxDEV("span",{className:"mode",children:"—"},void 0,!1,void 0,this)},void 0,!1,void 0,this),K?H.jsxDEV("td",{children:[H.jsxDEV("button",{onClick:()=>void o5({title:`Read ${F0(C.twin)} now?`,body:`The real ${F0(C.twin)}'s current state is read into this World. Nothing is written to ${F0(C.twin)}.`,action:"Read from it"}).then((v)=>{if(v)k(`refresh ${C.twin}`,`/-/${Q}/twins/${C.twin}/refresh`,{method:"POST"})}),disabled:!C.root,title:"Read the real service's current state into this World",children:"Read from it"},void 0,!1,void 0,this)," ",H.jsxDEV("button",{onClick:()=>{let v=window.prompt(`The real ${F0(C.twin)}'s address (its API's URL); empty disconnects it`,C.root?.url??"");if(v===null)return;k(`root ${C.twin}`,`/-/${Q}/twins/${C.twin}/root`,{method:"PUT",body:JSON.stringify(v?{url:v}:null)})},title:"Connect this vendor to the real service's URL (empty disconnects it)",children:"Connect…"},void 0,!1,void 0,this)," ",H.jsxDEV("button",{onClick:()=>{let v=window.prompt(`The real ${F0(C.twin)} key: it is sealed beside this World and never shown again`);if(!v)return;k(`seal ${C.twin}`,`/-/${Q}/twins/${C.twin}/credential`,{method:"PUT",body:v,headers:{"content-type":"text/plain"}})},title:"Give this World the real service's key; it is sealed and never shown again",children:"Real key…"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},C.twin,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("h3",{children:"Traffic (last 24 hours)"},void 0,!1,void 0,this),I&&(I.journalFailures??0)>0?H.jsxDEV("p",{className:"mode",role:"alert",children:[I.journalFailures," request ",I.journalFailures===1?"line was":"lines were"," not kept by this World's server since it started (its links, and the twins it runs in its own process): those requests are missing below."]},void 0,!0,void 0,this):null,I===null?H.jsxDEV("p",{className:"mode",children:"No request report for this world."},void 0,!1,void 0,this):I.requests===0?H.jsxDEV("p",{className:"mode",children:["No requests recorded in the last 24 hours. Recording is kept unless the World runs with ",H.jsxDEV("code",{children:"VOLTER_TWIN_REQUEST_JOURNAL=0"},void 0,!1,void 0,this),"; what the requests changed is always in Activity."]},void 0,!0,void 0,this):H.jsxDEV("table",{"aria-label":"Requests by twin",children:[H.jsxDEV("thead",{children:H.jsxDEV("tr",{children:[H.jsxDEV("th",{children:"vendor"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"requests"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"by status"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"p50"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"p95"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"top routes"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("tbody",{children:I.twins.map((C)=>H.jsxDEV("tr",{children:[H.jsxDEV("td",{children:C.twin},void 0,!1,void 0,this),H.jsxDEV("td",{children:C.requests},void 0,!1,void 0,this),H.jsxDEV("td",{children:Object.entries(C.byStatus).map(([v,b])=>`${v}: ${b}`).join(" · ")||"—"},void 0,!1,void 0,this),H.jsxDEV("td",{children:C.p50Ms===null?"—":`${C.p50Ms} ms`},void 0,!1,void 0,this),H.jsxDEV("td",{children:C.p95Ms===null?"—":`${C.p95Ms} ms`},void 0,!1,void 0,this),H.jsxDEV("td",{children:C.topRoutes.slice(0,5).map((v)=>H.jsxDEV("div",{children:[H.jsxDEV("code",{children:v.route},void 0,!1,void 0,this)," ",H.jsxDEV("span",{className:"mode",children:["×",v.requests]},void 0,!0,void 0,this)]},v.route,!0,void 0,this))},void 0,!1,void 0,this)]},C.twin,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("h3",{children:"Sending changes to the real services"},void 0,!1,void 0,this),H.jsxDEV("p",{className:"mode",children:["A changeset is a set of this World's changes (",H.jsxDEV("code",{children:'volter world changeset -m "…"'},void 0,!1,void 0,this),"), verified and approved, then deployed to each connected real service."]},void 0,!0,void 0,this),O===null?H.jsxDEV("p",{children:"Loading…"},void 0,!1,void 0,this):O.length===0?H.jsxDEV("p",{className:"mode",children:"No changesets yet."},void 0,!1,void 0,this):H.jsxDEV("table",{children:[H.jsxDEV("thead",{children:H.jsxDEV("tr",{children:[H.jsxDEV("th",{children:"name"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"changes"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"approvals"},void 0,!1,void 0,this),K?H.jsxDEV("th",{children:"actions"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("tbody",{children:O.map((C)=>H.jsxDEV("tr",{children:[H.jsxDEV("td",{children:C.name},void 0,!1,void 0,this),H.jsxDEV("td",{children:Array.isArray(C.actions)?C.actions.length:"—"},void 0,!1,void 0,this),H.jsxDEV("td",{children:Array.isArray(C.approvals)?C.approvals.length:0},void 0,!1,void 0,this),K?H.jsxDEV("td",{children:[H.jsxDEV("button",{onClick:()=>void k(`verify ${C.name}`,`/-/${Q}/changesets/${encodeURIComponent(C.name)}/verify`,{method:"POST"}),children:"Verify"},void 0,!1,void 0,this)," ",H.jsxDEV("button",{onClick:()=>{let v=window.prompt(`Approve ${C.name} as`);if(!v)return;k(`approve ${C.name}`,`/-/${Q}/changesets/${encodeURIComponent(C.name)}/approve`,{method:"POST",body:JSON.stringify({as:v})})},children:"Approve"},void 0,!1,void 0,this)," ",H.jsxDEV("button",{onClick:()=>void o5({title:`Deploy ${C.name}?`,body:"Its changes are sent to the real services now. That is what the World exists to keep you from doing by accident.",action:"Deploy to the real services",danger:!0,typed:C.name}).then((v)=>{if(v)k(`deploy ${C.name}`,`/-/${Q}/deploy/${encodeURIComponent(C.name)}`,{method:"POST",body:JSON.stringify({confirm:C.name})})}),children:"Deploy"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},C.name,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z?H.jsxDEV("div",{className:"danger",role:"region","aria-label":"Danger zone",children:[H.jsxDEV("h3",{children:"Danger zone"},void 0,!1,void 0,this),H.jsxDEV("p",{children:[H.jsxDEV("button",{onClick:()=>void h(),children:"Rotate tokens"},void 0,!1,void 0,this)," ",H.jsxDEV("span",{className:"mode",children:"New tokens for this World; every app, script and browser using the old ones is signed out."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.jsxDEV("p",{children:[H.jsxDEV("button",{onClick:()=>void P(),children:"Remove world"},void 0,!1,void 0,this)," ",H.jsxDEV("span",{className:"mode",children:"Deletes this World and everything in it."},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)}function cV({name:Q,token:U,twin:Z}){let[K,X]=B1.useState("log"),[W,z]=B1.useState(null),[B,O]=B1.useState(null);B1.useEffect(()=>{(async()=>{let I=await X0(U,`/-/${Q}/log/${Z}?limit=1`);if(!I.ok){z({position:0,entries:[]});return}let{position:D}=await I.json(),V=Math.max(0,D-200),h=await(await X0(U,`/-/${Q}/log/${Z}?after=${V}&limit=200&receipts=1`)).json();z({position:h.position,entries:[...h.entries].reverse()});let P=await X0(U,`/-/${Q}/checkpoint/${Z}`);O(P.ok?(await P.json()).tree:[])})()},[Q,U,Z]);let[T,R]=B1.useState(!1);B1.useEffect(()=>{X0(U,`/-/${Q}/twins/${Z}/status`).then(async(I)=>R(I.ok&&(await I.json()).mirror===!0),()=>R(!1))},[Q,U,Z]);let L=`${w6}/${Q}/${Z}/mirror/`,M=()=>{let I=document.createElement("form");I.method="POST",I.action=`${w6}/-/${Q}/session`;for(let[D,V]of[["token",U],["next",`/${Q}/${Z}/mirror/`]]){let k=document.createElement("input");k.type="hidden",k.name=D,k.value=V,I.append(k)}document.body.append(I),I.submit(),I.remove()},f=(I)=>I.operation==="observed"?`observed${I.provenance==="placeholder"?" (default data)":" (vendor)"}`:I.receipt?`${I.receipt.status??""} ${I.receipt.externalId??""} ${I.receipt.reason??""}`.trim():I.provenance==="placeholder"?"default data":"unpushed";return H.jsxDEV("section",{"aria-labelledby":"twin",children:[H.jsxDEV("h2",{id:"twin",children:[Z," in ",Q]},void 0,!0,void 0,this),H.jsxDEV("p",{children:["position ",W?.position??"…"," · ",H.jsxDEV("code",{children:[w6,"/",Q,"/",Z]},void 0,!0,void 0,this),T?H.jsxDEV(H.Fragment,{children:[" · ",H.jsxDEV("a",{href:L,onClick:(I)=>{I.preventDefault(),M()},children:["Open as ",Z," shows it"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),H.jsxDEV("div",{role:"tablist",children:[H.jsxDEV("button",{role:"tab","aria-selected":K==="log",onClick:()=>X("log"),children:"Log"},void 0,!1,void 0,this),H.jsxDEV("button",{role:"tab","aria-selected":K==="tree",onClick:()=>X("tree"),children:"Tree"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),K==="log"?W===null?H.jsxDEV("p",{children:"Loading…"},void 0,!1,void 0,this):W.entries.length===0?H.jsxDEV("p",{children:"No changes yet."},void 0,!1,void 0,this):H.jsxDEV("table",{children:[H.jsxDEV("thead",{children:H.jsxDEV("tr",{children:[H.jsxDEV("th",{children:"when"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"operation"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"subject"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"actor"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"standing"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("tbody",{children:W.entries.map((I)=>H.jsxDEV("tr",{children:[H.jsxDEV("td",{children:IJ(I.occurredAt)},void 0,!1,void 0,this),H.jsxDEV("td",{children:I.operation??I.op},void 0,!1,void 0,this),H.jsxDEV("td",{children:H.jsxDEV("code",{children:[I.subject.type,":",I.subject.id]},void 0,!0,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("td",{children:I.actor?`${I.actor.kind}${I.actor.id?` ${I.actor.id}`:""}`:"—"},void 0,!1,void 0,this),H.jsxDEV("td",{children:nq(I)},void 0,!1,void 0,this)]},I.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):B===null?H.jsxDEV("p",{children:"Loading…"},void 0,!1,void 0,this):B.length===0?H.jsxDEV("p",{children:"The tree is empty."},void 0,!1,void 0,this):H.jsxDEV("table",{children:[H.jsxDEV("thead",{children:H.jsxDEV("tr",{children:[H.jsxDEV("th",{children:"type"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"id"},void 0,!1,void 0,this),H.jsxDEV("th",{children:"fields"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("tbody",{children:B.filter((I)=>I.deleted!==!0).slice(0,500).map((I)=>{let{type:D,id:V,...k}=I;return H.jsxDEV("tr",{children:[H.jsxDEV("td",{children:D},void 0,!1,void 0,this),H.jsxDEV("td",{children:H.jsxDEV("code",{children:V},void 0,!1,void 0,this)},void 0,!1,void 0,this),H.jsxDEV("td",{children:H.jsxDEV("pre",{children:JSON.stringify(k,null,1).slice(0,600)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},`${D}:${V}`,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}bX();ER.createRoot(NJ).render(H.jsxDEV(H.Fragment,{children:[H.jsxDEV(zV,{},void 0,!1,void 0,this),H.jsxDEV(OR,{},void 0,!1,void 0,this),H.jsxDEV(RR,{},void 0,!1,void 0,this),H.jsxDEV(TR,{},void 0,!1,void 0,this)]},void 0,!0,void 0,this));