@volter/world-console 3.0.21 → 3.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- var dQ=Object.create;var{getPrototypeOf:aQ,defineProperty:P8,getOwnPropertyNames:sQ}=Object;var tQ=Object.prototype.hasOwnProperty;function oQ(_){return this[_]}var nQ,eQ,Q0=(_,Q,J)=>{var q=_!=null&&typeof _==="object";if(q){var U=Q?nQ??=new WeakMap:eQ??=new WeakMap,G=U.get(_);if(G)return G}J=_!=null?dQ(aQ(_)):{};let Z=Q||!_||!_.__esModule?P8(J,"default",{value:_,enumerable:!0}):J;for(let F of sQ(_))if(!tQ.call(Z,F))P8(Z,F,{get:oQ.bind(_,F),enumerable:!0});if(q)U.set(_,Z);return Z};var M2=(_,Q)=>()=>(Q||_((Q={exports:{}}).exports,Q),Q.exports);var V0=M2((_J,e5)=>{(function(){function _(T,g){Object.defineProperty(q.prototype,T,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",g[0],g[1])}})}function Q(T){if(T===null||typeof T!=="object")return null;return T=q1&&T[q1]||T["@@iterator"],typeof T==="function"?T:null}function J(T,g){T=(T=T.constructor)&&(T.displayName||T.name)||"ReactClass";var Q1=T+"."+g;G1[Q1]||(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.",g,T),G1[Q1]=!0)}function q(T,g,Q1){this.props=T,this.context=g,this.refs=W1,this.updater=Q1||U1}function U(){}function G(T,g,Q1){this.props=T,this.context=g,this.refs=W1,this.updater=Q1||U1}function Z(){}function F(T){return""+T}function X(T){try{F(T);var g=!1}catch(X1){g=!0}if(g){g=console;var Q1=g.error,J1=typeof Symbol==="function"&&Symbol.toStringTag&&T[Symbol.toStringTag]||T.constructor.name||"Object";return Q1.call(g,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",J1),F(T)}}function Y(T){if(T==null)return null;if(typeof T==="function")return T.$$typeof===I1?null:T.displayName||T.name||null;if(typeof T==="string")return T;switch(T){case m:return"Fragment";case V:return"Profiler";case I:return"StrictMode";case _1:return"Suspense";case s:return"SuspenseList";case e:return"Activity"}if(typeof T==="object")switch(typeof T.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),T.$$typeof){case j:return"Portal";case y:return T.displayName||"Context";case D:return(T._context.displayName||"Context")+".Consumer";case t:var g=T.render;return T=T.displayName,T||(T=g.displayName||g.name||"",T=T!==""?"ForwardRef("+T+")":"ForwardRef"),T;case o:return g=T.displayName||null,g!==null?g:Y(T.type)||"Memo";case p:g=T._payload,T=T._init;try{return Y(T(g))}catch(Q1){}}return null}function K(T){if(T===m)return"<>";if(typeof T==="object"&&T!==null&&T.$$typeof===p)return"<...>";try{var g=Y(T);return g?"<"+g+">":"<...>"}catch(Q1){return"<...>"}}function H(){var T=H1.A;return T===null?null:T.getOwner()}function L(){return Error("react-stack-top-frame")}function z(T){if(m1.call(T,"key")){var g=Object.getOwnPropertyDescriptor(T,"key").get;if(g&&g.isReactWarning)return!1}return T.key!==void 0}function W(T,g){function Q1(){d1||(d1=!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)",g))}Q1.isReactWarning=!0,Object.defineProperty(T,"key",{get:Q1,configurable:!0})}function w(){var T=Y(this.type);return z0[T]||(z0[T]=!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.")),T=this.props.ref,T!==void 0?T:null}function R(T,g,Q1,J1,X1,N1){var T1=Q1.ref;return T={$$typeof:E,type:T,key:g,props:Q1,_owner:J1},(T1!==void 0?T1:null)!==null?Object.defineProperty(T,"ref",{enumerable:!1,get:w}):Object.defineProperty(T,"ref",{enumerable:!1,value:null}),T._store={},Object.defineProperty(T._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(T,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(T,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:X1}),Object.defineProperty(T,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:N1}),Object.freeze&&(Object.freeze(T.props),Object.freeze(T)),T}function A(T,g){return g=R(T.type,g,T.props,T._owner,T._debugStack,T._debugTask),T._store&&(g._store.validated=T._store.validated),g}function O(T){B(T)?T._store&&(T._store.validated=1):typeof T==="object"&&T!==null&&T.$$typeof===p&&(T._payload.status==="fulfilled"?B(T._payload.value)&&T._payload.value._store&&(T._payload.value._store.validated=1):T._store&&(T._store.validated=1))}function B(T){return typeof T==="object"&&T!==null&&T.$$typeof===E}function M(T){var g={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(Q1){return g[Q1]})}function P(T,g){return typeof T==="object"&&T!==null&&T.key!=null?(X(T.key),M(""+T.key)):g.toString(36)}function C(T){switch(T.status){case"fulfilled":return T.value;case"rejected":throw T.reason;default:switch(typeof T.status==="string"?T.then(Z,Z):(T.status="pending",T.then(function(g){T.status==="pending"&&(T.status="fulfilled",T.value=g)},function(g){T.status==="pending"&&(T.status="rejected",T.reason=g)})),T.status){case"fulfilled":return T.value;case"rejected":throw T.reason}}throw T}function f(T,g,Q1,J1,X1){var N1=typeof T;if(N1==="undefined"||N1==="boolean")T=null;var T1=!1;if(T===null)T1=!0;else switch(N1){case"bigint":case"string":case"number":T1=!0;break;case"object":switch(T.$$typeof){case E:case j:T1=!0;break;case p:return T1=T._init,f(T1(T._payload),g,Q1,J1,X1)}}if(T1){T1=T,X1=X1(T1);var y1=J1===""?"."+P(T1,0):J1;return n(X1)?(Q1="",y1!=null&&(Q1=y1.replace(_0,"$&/")+"/"),f(X1,g,Q1,"",function(B0){return B0})):X1!=null&&(B(X1)&&(X1.key!=null&&(T1&&T1.key===X1.key||X(X1.key)),Q1=A(X1,Q1+(X1.key==null||T1&&T1.key===X1.key?"":(""+X1.key).replace(_0,"$&/")+"/")+y1),J1!==""&&T1!=null&&B(T1)&&T1.key==null&&T1._store&&!T1._store.validated&&(Q1._store.validated=2),X1=Q1),g.push(X1)),1}if(T1=0,y1=J1===""?".":J1+":",n(T))for(var O1=0;O1<T.length;O1++)J1=T[O1],N1=y1+P(J1,O1),T1+=f(J1,g,Q1,N1,X1);else if(O1=Q(T),typeof O1==="function")for(O1===T.entries&&(F0||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),F0=!0),T=O1.call(T),O1=0;!(J1=T.next()).done;)J1=J1.value,N1=y1+P(J1,O1++),T1+=f(J1,g,Q1,N1,X1);else if(N1==="object"){if(typeof T.then==="function")return f(C(T),g,Q1,J1,X1);throw g=String(T),Error("Objects are not valid as a React child (found: "+(g==="[object Object]"?"object with keys {"+Object.keys(T).join(", ")+"}":g)+"). If you meant to render a collection of children, use an array instead.")}return T1}function v(T,g,Q1){if(T==null)return T;var J1=[],X1=0;return f(T,J1,"","",function(N1){return g.call(Q1,N1,X1++)}),J1}function N(T){if(T._status===-1){var g=T._ioInfo;g!=null&&(g.start=g.end=performance.now()),g=T._result;var Q1=g();if(Q1.then(function(X1){if(T._status===0||T._status===-1){T._status=1,T._result=X1;var N1=T._ioInfo;N1!=null&&(N1.end=performance.now()),Q1.status===void 0&&(Q1.status="fulfilled",Q1.value=X1)}},function(X1){if(T._status===0||T._status===-1){T._status=2,T._result=X1;var N1=T._ioInfo;N1!=null&&(N1.end=performance.now()),Q1.status===void 0&&(Q1.status="rejected",Q1.reason=X1)}}),g=T._ioInfo,g!=null){g.value=Q1;var J1=Q1.displayName;typeof J1==="string"&&(g.name=J1)}T._status===-1&&(T._status=0,T._result=Q1)}if(T._status===1)return g=T._result,g===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
1
+ var sQ=Object.create;var{getPrototypeOf:tQ,defineProperty:k8,getOwnPropertyNames:oQ}=Object;var nQ=Object.prototype.hasOwnProperty;function eQ(_){return this[_]}var _J,QJ,Q0=(_,Q,J)=>{var q=_!=null&&typeof _==="object";if(q){var U=Q?_J??=new WeakMap:QJ??=new WeakMap,G=U.get(_);if(G)return G}J=_!=null?sQ(tQ(_)):{};let Z=Q||!_||!_.__esModule?k8(J,"default",{value:_,enumerable:!0}):J;for(let F of oQ(_))if(!nQ.call(Z,F))k8(Z,F,{get:eQ.bind(_,F),enumerable:!0});if(q)U.set(_,Z);return Z};var T2=(_,Q)=>()=>(Q||_((Q={exports:{}}).exports,Q),Q.exports);var h0=T2((JJ,Q4)=>{(function(){function _(M,g){Object.defineProperty(q.prototype,M,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",g[0],g[1])}})}function Q(M){if(M===null||typeof M!=="object")return null;return M=J1&&M[J1]||M["@@iterator"],typeof M==="function"?M:null}function J(M,g){M=(M=M.constructor)&&(M.displayName||M.name)||"ReactClass";var _1=M+"."+g;G1[_1]||(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.",g,M),G1[_1]=!0)}function q(M,g,_1){this.props=M,this.context=g,this.refs=M1,this.updater=_1||q1}function U(){}function G(M,g,_1){this.props=M,this.context=g,this.refs=M1,this.updater=_1||q1}function Z(){}function F(M){return""+M}function X(M){try{F(M);var g=!1}catch(K1){g=!0}if(g){g=console;var _1=g.error,$1=typeof Symbol==="function"&&Symbol.toStringTag&&M[Symbol.toStringTag]||M.constructor.name||"Object";return _1.call(g,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",$1),F(M)}}function Y(M){if(M==null)return null;if(typeof M==="function")return M.$$typeof===O1?null:M.displayName||M.name||null;if(typeof M==="string")return M;switch(M){case m:return"Fragment";case V:return"Profiler";case P:return"StrictMode";case Q1:return"Suspense";case a:return"SuspenseList";case n:return"Activity"}if(typeof M==="object")switch(typeof M.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),M.$$typeof){case v:return"Portal";case u:return M.displayName||"Context";case b:return(M._context.displayName||"Context")+".Consumer";case t:var g=M.render;return M=M.displayName,M||(M=g.displayName||g.name||"",M=M!==""?"ForwardRef("+M+")":"ForwardRef"),M;case o:return g=M.displayName||null,g!==null?g:Y(M.type)||"Memo";case p:g=M._payload,M=M._init;try{return Y(M(g))}catch(_1){}}return null}function K(M){if(M===m)return"<>";if(typeof M==="object"&&M!==null&&M.$$typeof===p)return"<...>";try{var g=Y(M);return g?"<"+g+">":"<...>"}catch(_1){return"<...>"}}function H(){var M=X1.A;return M===null?null:M.getOwner()}function L(){return Error("react-stack-top-frame")}function z(M){if(D1.call(M,"key")){var g=Object.getOwnPropertyDescriptor(M,"key").get;if(g&&g.isReactWarning)return!1}return M.key!==void 0}function W(M,g){function _1(){_0||(_0=!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)",g))}_1.isReactWarning=!0,Object.defineProperty(M,"key",{get:_1,configurable:!0})}function I(){var M=Y(this.type);return L0[M]||(L0[M]=!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.")),M=this.props.ref,M!==void 0?M:null}function O(M,g,_1,$1,K1,w1){var R1=_1.ref;return M={$$typeof:x,type:M,key:g,props:_1,_owner:$1},(R1!==void 0?R1:null)!==null?Object.defineProperty(M,"ref",{enumerable:!1,get:I}):Object.defineProperty(M,"ref",{enumerable:!1,value:null}),M._store={},Object.defineProperty(M._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(M,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(M,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:K1}),Object.defineProperty(M,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:w1}),Object.freeze&&(Object.freeze(M.props),Object.freeze(M)),M}function A(M,g){return g=O(M.type,g,M.props,M._owner,M._debugStack,M._debugTask),M._store&&(g._store.validated=M._store.validated),g}function w(M){B(M)?M._store&&(M._store.validated=1):typeof M==="object"&&M!==null&&M.$$typeof===p&&(M._payload.status==="fulfilled"?B(M._payload.value)&&M._payload.value._store&&(M._payload.value._store.validated=1):M._store&&(M._store.validated=1))}function B(M){return typeof M==="object"&&M!==null&&M.$$typeof===x}function T(M){var g={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(_1){return g[_1]})}function R(M,g){return typeof M==="object"&&M!==null&&M.key!=null?(X(M.key),T(""+M.key)):g.toString(36)}function C(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status==="string"?M.then(Z,Z):(M.status="pending",M.then(function(g){M.status==="pending"&&(M.status="fulfilled",M.value=g)},function(g){M.status==="pending"&&(M.status="rejected",M.reason=g)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function f(M,g,_1,$1,K1){var w1=typeof M;if(w1==="undefined"||w1==="boolean")M=null;var R1=!1;if(M===null)R1=!0;else switch(w1){case"bigint":case"string":case"number":R1=!0;break;case"object":switch(M.$$typeof){case x:case v:R1=!0;break;case p:return R1=M._init,f(R1(M._payload),g,_1,$1,K1)}}if(R1){R1=M,K1=K1(R1);var v1=$1===""?"."+R(R1,0):$1;return e(K1)?(_1="",v1!=null&&(_1=v1.replace(F0,"$&/")+"/"),f(K1,g,_1,"",function(R0){return R0})):K1!=null&&(B(K1)&&(K1.key!=null&&(R1&&R1.key===K1.key||X(K1.key)),_1=A(K1,_1+(K1.key==null||R1&&R1.key===K1.key?"":(""+K1.key).replace(F0,"$&/")+"/")+v1),$1!==""&&R1!=null&&B(R1)&&R1.key==null&&R1._store&&!R1._store.validated&&(_1._store.validated=2),K1=_1),g.push(K1)),1}if(R1=0,v1=$1===""?".":$1+":",e(M))for(var I1=0;I1<M.length;I1++)$1=M[I1],w1=v1+R($1,I1),R1+=f($1,g,_1,w1,K1);else if(I1=Q(M),typeof I1==="function")for(I1===M.entries&&(Z0||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),Z0=!0),M=I1.call(M),I1=0;!($1=M.next()).done;)$1=$1.value,w1=v1+R($1,I1++),R1+=f($1,g,_1,w1,K1);else if(w1==="object"){if(typeof M.then==="function")return f(C(M),g,_1,$1,K1);throw g=String(M),Error("Objects are not valid as a React child (found: "+(g==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":g)+"). If you meant to render a collection of children, use an array instead.")}return R1}function y(M,g,_1){if(M==null)return M;var $1=[],K1=0;return f(M,$1,"","",function(w1){return g.call(_1,w1,K1++)}),$1}function N(M){if(M._status===-1){var g=M._ioInfo;g!=null&&(g.start=g.end=performance.now()),g=M._result;var _1=g();if(_1.then(function(K1){if(M._status===0||M._status===-1){M._status=1,M._result=K1;var w1=M._ioInfo;w1!=null&&(w1.end=performance.now()),_1.status===void 0&&(_1.status="fulfilled",_1.value=K1)}},function(K1){if(M._status===0||M._status===-1){M._status=2,M._result=K1;var w1=M._ioInfo;w1!=null&&(w1.end=performance.now()),_1.status===void 0&&(_1.status="rejected",_1.reason=K1)}}),g=M._ioInfo,g!=null){g.value=_1;var $1=_1.displayName;typeof $1==="string"&&(g.name=$1)}M._status===-1&&(M._status=0,M._result=_1)}if(M._status===1)return g=M._result,g===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'))
@@ -6,32 +6,32 @@ Your code should look like:
6
6
  Did you accidentally put curly braces around the import?`,g),"default"in g||console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
7
7
 
8
8
  Your code should look like:
9
- const MyComponent = lazy(() => import('./MyComponent'))`,g),g.default;throw T._result}function k(){var T=H1.H;return T===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:
9
+ const MyComponent = lazy(() => import('./MyComponent'))`,g),g.default;throw M._result}function k(){var M=X1.H;return M===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:
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.`),T}function u(){H1.asyncTransitions--}function i(T){if(f0===null)try{var g=("require"+Math.random()).slice(0,7);f0=(e5&&e5[g]).call(e5,"timers").setImmediate}catch(Q1){f0=function(J1){U2===!1&&(U2=!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 X1=new MessageChannel;X1.port1.onmessage=J1,X1.port2.postMessage(void 0)}}return f0(T)}function l(T){return 1<T.length&&typeof AggregateError==="function"?AggregateError(T):T[0]}function S(T,g){g!==p0-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. "),p0=g}function b(T,g,Q1){var J1=H1.actQueue;if(J1!==null)if(J1.length!==0)try{h(J1),i(function(){return b(T,g,Q1)});return}catch(X1){H1.thrownErrors.push(X1)}else H1.actQueue=null;0<H1.thrownErrors.length?(J1=l(H1.thrownErrors),H1.thrownErrors.length=0,Q1(J1)):g(T)}function h(T){if(!A2){A2=!0;var g=0;try{for(;g<T.length;g++){var Q1=T[g];do{H1.didUsePromise=!1;var J1=Q1(!1);if(J1!==null){if(H1.didUsePromise){T[g]=Q1,T.splice(0,g);return}Q1=J1}else break}while(1)}T.length=0}catch(X1){T.splice(0,g+1),H1.thrownErrors.push(X1)}finally{A2=!1}}}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var E=Symbol.for("react.transitional.element"),j=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),I=Symbol.for("react.strict_mode"),V=Symbol.for("react.profiler"),D=Symbol.for("react.consumer"),y=Symbol.for("react.context"),t=Symbol.for("react.forward_ref"),_1=Symbol.for("react.suspense"),s=Symbol.for("react.suspense_list"),o=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),e=Symbol.for("react.activity"),q1=Symbol.iterator,G1={},U1={isMounted:function(){return!1},enqueueForceUpdate:function(T){J(T,"forceUpdate")},enqueueReplaceState:function(T){J(T,"replaceState")},enqueueSetState:function(T){J(T,"setState")}},K1=Object.assign,W1={};Object.freeze(W1),q.prototype.isReactComponent={},q.prototype.setState=function(T,g){if(typeof T!=="object"&&typeof T!=="function"&&T!=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,T,g,"setState")},q.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};var Y1={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(l0 in Y1)Y1.hasOwnProperty(l0)&&_(l0,Y1[l0]);U.prototype=q.prototype,Y1=G.prototype=new U,Y1.constructor=G,K1(Y1,q.prototype),Y1.isPureReactComponent=!0;var n=Array.isArray,I1=Symbol.for("react.client.reference"),H1={H:null,A:null,T:null,S:null,actQueue:null,asyncTransitions:0,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1,didUsePromise:!1,thrownErrors:[],getCurrentStack:null,recentlyCreatedOwnerStacks:0},m1=Object.prototype.hasOwnProperty,t1=console.createTask?console.createTask:function(){return null};Y1={react_stack_bottom_frame:function(T){return T()}};var d1,N0,z0={},T0=Y1.react_stack_bottom_frame.bind(Y1,L)(),$0=t1(K(L)),F0=!1,_0=/\/+/g,W0=typeof reportError==="function"?reportError:function(T){if(typeof window==="object"&&typeof window.ErrorEvent==="function"){var g=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof T==="object"&&T!==null&&typeof T.message==="string"?String(T.message):String(T),error:T});if(!window.dispatchEvent(g))return}else if(typeof process==="object"&&typeof process.emit==="function"){process.emit("uncaughtException",T);return}console.error(T)},U2=!1,f0=null,p0=0,c0=!1,A2=!1,G2=typeof queueMicrotask==="function"?function(T){queueMicrotask(function(){return queueMicrotask(T)})}:i;Y1=Object.freeze({__proto__:null,c:function(T){return k().useMemoCache(T)}});var l0={map:v,forEach:function(T,g,Q1){v(T,function(){g.apply(this,arguments)},Q1)},count:function(T){var g=0;return v(T,function(){g++}),g},toArray:function(T){return v(T,function(g){return g})||[]},only:function(T){if(!B(T))throw Error("React.Children.only expected to receive a single React element child.");return T}};_J.Activity=e,_J.Children=l0,_J.Component=q,_J.Fragment=m,_J.Profiler=V,_J.PureComponent=G,_J.StrictMode=I,_J.Suspense=_1,_J.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=H1,_J.__COMPILER_RUNTIME=Y1,_J.act=function(T){var g=H1.actQueue,Q1=p0;p0++;var J1=H1.actQueue=g!==null?g:[],X1=!1;try{var N1=T()}catch(O1){H1.thrownErrors.push(O1)}if(0<H1.thrownErrors.length)throw S(g,Q1),T=l(H1.thrownErrors),H1.thrownErrors.length=0,T;if(N1!==null&&typeof N1==="object"&&typeof N1.then==="function"){var T1=N1;return G2(function(){X1||c0||(c0=!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(O1,B0){X1=!0,T1.then(function(j0){if(S(g,Q1),Q1===0){try{h(J1),i(function(){return b(j0,O1,B0)})}catch(x){H1.thrownErrors.push(x)}if(0<H1.thrownErrors.length){var Y5=l(H1.thrownErrors);H1.thrownErrors.length=0,B0(Y5)}}else O1(j0)},function(j0){S(g,Q1),0<H1.thrownErrors.length?(j0=l(H1.thrownErrors),H1.thrownErrors.length=0,B0(j0)):B0(j0)})}}}var y1=N1;if(S(g,Q1),Q1===0&&(h(J1),J1.length!==0&&G2(function(){X1||c0||(c0=!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(() => ...)"))}),H1.actQueue=null),0<H1.thrownErrors.length)throw T=l(H1.thrownErrors),H1.thrownErrors.length=0,T;return{then:function(O1,B0){X1=!0,Q1===0?(H1.actQueue=J1,i(function(){return b(y1,O1,B0)})):O1(y1)}}},_J.cache=function(T){return function(){return T.apply(null,arguments)}},_J.cacheSignal=function(){return null},_J.captureOwnerStack=function(){var T=H1.getCurrentStack;return T===null?null:T()},_J.cloneElement=function(T,g,Q1){if(T===null||T===void 0)throw Error("The argument must be a React element, but you passed "+T+".");var J1=K1({},T.props),X1=T.key,N1=T._owner;if(g!=null){var T1;_:{if(m1.call(g,"ref")&&(T1=Object.getOwnPropertyDescriptor(g,"ref").get)&&T1.isReactWarning){T1=!1;break _}T1=g.ref!==void 0}T1&&(N1=H()),z(g)&&(X(g.key),X1=""+g.key);for(y1 in g)!m1.call(g,y1)||y1==="key"||y1==="__self"||y1==="__source"||y1==="ref"&&g.ref===void 0||(J1[y1]=g[y1])}var y1=arguments.length-2;if(y1===1)J1.children=Q1;else if(1<y1){T1=Array(y1);for(var O1=0;O1<y1;O1++)T1[O1]=arguments[O1+2];J1.children=T1}J1=R(T.type,X1,J1,N1,T._debugStack,T._debugTask);for(X1=2;X1<arguments.length;X1++)O(arguments[X1]);return J1},_J.createContext=function(T){return T={$$typeof:y,_currentValue:T,_currentValue2:T,_threadCount:0,Provider:null,Consumer:null},T.Provider=T,T.Consumer={$$typeof:D,_context:T},T._currentRenderer=null,T._currentRenderer2=null,T},_J.createElement=function(T,g,Q1){for(var J1=2;J1<arguments.length;J1++)O(arguments[J1]);J1={};var X1=null;if(g!=null)for(O1 in N0||!("__self"in g)||"key"in g||(N0=!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")),z(g)&&(X(g.key),X1=""+g.key),g)m1.call(g,O1)&&O1!=="key"&&O1!=="__self"&&O1!=="__source"&&(J1[O1]=g[O1]);var N1=arguments.length-2;if(N1===1)J1.children=Q1;else if(1<N1){for(var T1=Array(N1),y1=0;y1<N1;y1++)T1[y1]=arguments[y1+2];Object.freeze&&Object.freeze(T1),J1.children=T1}if(T&&T.defaultProps)for(O1 in N1=T.defaultProps,N1)J1[O1]===void 0&&(J1[O1]=N1[O1]);X1&&W(J1,typeof T==="function"?T.displayName||T.name||"Unknown":T);var O1=1e4>H1.recentlyCreatedOwnerStacks++;return R(T,X1,J1,H(),O1?Error("react-stack-top-frame"):T0,O1?t1(K(T)):$0)},_J.createRef=function(){var T={current:null};return Object.seal(T),T},_J.forwardRef=function(T){T!=null&&T.$$typeof===o?console.error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof T!=="function"?console.error("forwardRef requires a render function but was given %s.",T===null?"null":typeof T):T.length!==0&&T.length!==2&&console.error("forwardRef render functions accept exactly two parameters: props and ref. %s",T.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),T!=null&&T.defaultProps!=null&&console.error("forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?");var g={$$typeof:t,render:T},Q1;return Object.defineProperty(g,"displayName",{enumerable:!1,configurable:!0,get:function(){return Q1},set:function(J1){Q1=J1,T.name||T.displayName||(Object.defineProperty(T,"name",{value:J1}),T.displayName=J1)}}),g},_J.isValidElement=B,_J.lazy=function(T){T={_status:-1,_result:T};var g={$$typeof:p,_payload:T,_init:N},Q1={name:"lazy",start:-1,end:-1,value:null,owner:null,debugStack:Error("react-stack-top-frame"),debugTask:console.createTask?console.createTask("lazy()"):null};return T._ioInfo=Q1,g._debugInfo=[{awaited:Q1}],g},_J.memo=function(T,g){T==null&&console.error("memo: The first argument must be a component. Instead received: %s",T===null?"null":typeof T),g={$$typeof:o,type:T,compare:g===void 0?null:g};var Q1;return Object.defineProperty(g,"displayName",{enumerable:!1,configurable:!0,get:function(){return Q1},set:function(J1){Q1=J1,T.name||T.displayName||(Object.defineProperty(T,"name",{value:J1}),T.displayName=J1)}}),g},_J.startTransition=function(T){var g=H1.T,Q1={};Q1._updatedFibers=new Set,H1.T=Q1;try{var J1=T(),X1=H1.S;X1!==null&&X1(Q1,J1),typeof J1==="object"&&J1!==null&&typeof J1.then==="function"&&(H1.asyncTransitions++,J1.then(u,u),J1.then(Z,W0))}catch(N1){W0(N1)}finally{g===null&&Q1._updatedFibers&&(T=Q1._updatedFibers.size,Q1._updatedFibers.clear(),10<T&&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.")),g!==null&&Q1.types!==null&&(g.types!==null&&g.types!==Q1.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."),g.types=Q1.types),H1.T=g}},_J.unstable_useCacheRefresh=function(){return k().useCacheRefresh()},_J.use=function(T){return k().use(T)},_J.useActionState=function(T,g,Q1){return k().useActionState(T,g,Q1)},_J.useCallback=function(T,g){return k().useCallback(T,g)},_J.useContext=function(T){var g=k();return T.$$typeof===D&&console.error("Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"),g.useContext(T)},_J.useDebugValue=function(T,g){return k().useDebugValue(T,g)},_J.useDeferredValue=function(T,g){return k().useDeferredValue(T,g)},_J.useEffect=function(T,g){return T==null&&console.warn("React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"),k().useEffect(T,g)},_J.useEffectEvent=function(T){return k().useEffectEvent(T)},_J.useId=function(){return k().useId()},_J.useImperativeHandle=function(T,g,Q1){return k().useImperativeHandle(T,g,Q1)},_J.useInsertionEffect=function(T,g){return T==null&&console.warn("React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"),k().useInsertionEffect(T,g)},_J.useLayoutEffect=function(T,g){return T==null&&console.warn("React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"),k().useLayoutEffect(T,g)},_J.useMemo=function(T,g){return k().useMemo(T,g)},_J.useOptimistic=function(T,g){return k().useOptimistic(T,g)},_J.useReducer=function(T,g,Q1){return k().useReducer(T,g,Q1)},_J.useRef=function(T){return k().useRef(T)},_J.useState=function(T){return k().useState(T)},_J.useSyncExternalStore=function(T,g,Q1){return k().useSyncExternalStore(T,g,Q1)},_J.useTransition=function(){return k().useTransition()},_J.version="19.2.7",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var N8=M2((QJ)=>{var T2=Q0(V0());(function(){function _(I){if(I==null)return null;if(typeof I==="function")return I.$$typeof===k?null:I.displayName||I.name||null;if(typeof I==="string")return I;switch(I){case w:return"Fragment";case A:return"Profiler";case R:return"StrictMode";case P:return"Suspense";case C:return"SuspenseList";case N:return"Activity"}if(typeof I==="object")switch(typeof I.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),I.$$typeof){case W:return"Portal";case B:return I.displayName||"Context";case O:return(I._context.displayName||"Context")+".Consumer";case M:var V=I.render;return I=I.displayName,I||(I=V.displayName||V.name||"",I=I!==""?"ForwardRef("+I+")":"ForwardRef"),I;case f:return V=I.displayName||null,V!==null?V:_(I.type)||"Memo";case v:V=I._payload,I=I._init;try{return _(I(V))}catch(D){}}return null}function Q(I){return""+I}function J(I){try{Q(I);var V=!1}catch(t){V=!0}if(V){V=console;var D=V.error,y=typeof Symbol==="function"&&Symbol.toStringTag&&I[Symbol.toStringTag]||I.constructor.name||"Object";return D.call(V,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",y),Q(I)}}function q(I){if(I===w)return"<>";if(typeof I==="object"&&I!==null&&I.$$typeof===v)return"<...>";try{var V=_(I);return V?"<"+V+">":"<...>"}catch(D){return"<...>"}}function U(){var I=u.A;return I===null?null:I.getOwner()}function G(){return Error("react-stack-top-frame")}function Z(I){if(i.call(I,"key")){var V=Object.getOwnPropertyDescriptor(I,"key").get;if(V&&V.isReactWarning)return!1}return I.key!==void 0}function F(I,V){function D(){b||(b=!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)",V))}D.isReactWarning=!0,Object.defineProperty(I,"key",{get:D,configurable:!0})}function X(){var I=_(this.type);return h[I]||(h[I]=!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.")),I=this.props.ref,I!==void 0?I:null}function Y(I,V,D,y,t,_1){var s=D.ref;return I={$$typeof:z,type:I,key:V,props:D,_owner:y},(s!==void 0?s:null)!==null?Object.defineProperty(I,"ref",{enumerable:!1,get:X}):Object.defineProperty(I,"ref",{enumerable:!1,value:null}),I._store={},Object.defineProperty(I._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(I,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(I,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:t}),Object.defineProperty(I,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:_1}),Object.freeze&&(Object.freeze(I.props),Object.freeze(I)),I}function K(I,V,D,y,t,_1){var s=V.children;if(s!==void 0)if(y)if(l(s)){for(y=0;y<s.length;y++)H(s[y]);Object.freeze&&Object.freeze(s)}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 H(s);if(i.call(V,"key")){s=_(I);var o=Object.keys(V).filter(function(e){return e!=="key"});y=0<o.length?"{key: someKey, "+o.join(": ..., ")+": ...}":"{key: someKey}",m[s+y]||(o=0<o.length?"{"+o.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.`),M}function E(){X1.asyncTransitions--}function c(M){if(C0===null)try{var g=("require"+Math.random()).slice(0,7);C0=(Q4&&Q4[g]).call(Q4,"timers").setImmediate}catch(_1){C0=function($1){r0===!1&&(r0=!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 K1=new MessageChannel;K1.port1.onmessage=$1,K1.port2.postMessage(void 0)}}return C0(M)}function l(M){return 1<M.length&&typeof AggregateError==="function"?AggregateError(M):M[0]}function S(M,g){g!==S0-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. "),S0=g}function j(M,g,_1){var $1=X1.actQueue;if($1!==null)if($1.length!==0)try{D($1),c(function(){return j(M,g,_1)});return}catch(K1){X1.thrownErrors.push(K1)}else X1.actQueue=null;0<X1.thrownErrors.length?($1=l(X1.thrownErrors),X1.thrownErrors.length=0,_1($1)):g(M)}function D(M){if(!B2){B2=!0;var g=0;try{for(;g<M.length;g++){var _1=M[g];do{X1.didUsePromise=!1;var $1=_1(!1);if($1!==null){if(X1.didUsePromise){M[g]=_1,M.splice(0,g);return}_1=$1}else break}while(1)}M.length=0}catch(K1){M.splice(0,g+1),X1.thrownErrors.push(K1)}finally{B2=!1}}}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var x=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),P=Symbol.for("react.strict_mode"),V=Symbol.for("react.profiler"),b=Symbol.for("react.consumer"),u=Symbol.for("react.context"),t=Symbol.for("react.forward_ref"),Q1=Symbol.for("react.suspense"),a=Symbol.for("react.suspense_list"),o=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),n=Symbol.for("react.activity"),J1=Symbol.iterator,G1={},q1={isMounted:function(){return!1},enqueueForceUpdate:function(M){J(M,"forceUpdate")},enqueueReplaceState:function(M){J(M,"replaceState")},enqueueSetState:function(M){J(M,"setState")}},Y1=Object.assign,M1={};Object.freeze(M1),q.prototype.isReactComponent={},q.prototype.setState=function(M,g){if(typeof M!=="object"&&typeof M!=="function"&&M!=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,M,g,"setState")},q.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};var L1={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(u0 in L1)L1.hasOwnProperty(u0)&&_(u0,L1[u0]);U.prototype=q.prototype,L1=G.prototype=new U,L1.constructor=G,Y1(L1,q.prototype),L1.isPureReactComponent=!0;var e=Array.isArray,O1=Symbol.for("react.client.reference"),X1={H:null,A:null,T:null,S:null,actQueue:null,asyncTransitions:0,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1,didUsePromise:!1,thrownErrors:[],getCurrentStack:null,recentlyCreatedOwnerStacks:0},D1=Object.prototype.hasOwnProperty,a1=console.createTask?console.createTask:function(){return null};L1={react_stack_bottom_frame:function(M){return M()}};var _0,T0,L0={},z0=L1.react_stack_bottom_frame.bind(L1,L)(),t1=a1(K(L)),Z0=!1,F0=/\/+/g,W0=typeof reportError==="function"?reportError:function(M){if(typeof window==="object"&&typeof window.ErrorEvent==="function"){var g=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof M==="object"&&M!==null&&typeof M.message==="string"?String(M.message):String(M),error:M});if(!window.dispatchEvent(g))return}else if(typeof process==="object"&&typeof process.emit==="function"){process.emit("uncaughtException",M);return}console.error(M)},r0=!1,C0=null,S0=0,i0=!1,B2=!1,M2=typeof queueMicrotask==="function"?function(M){queueMicrotask(function(){return queueMicrotask(M)})}:c;L1=Object.freeze({__proto__:null,c:function(M){return k().useMemoCache(M)}});var u0={map:y,forEach:function(M,g,_1){y(M,function(){g.apply(this,arguments)},_1)},count:function(M){var g=0;return y(M,function(){g++}),g},toArray:function(M){return y(M,function(g){return g})||[]},only:function(M){if(!B(M))throw Error("React.Children.only expected to receive a single React element child.");return M}};JJ.Activity=n,JJ.Children=u0,JJ.Component=q,JJ.Fragment=m,JJ.Profiler=V,JJ.PureComponent=G,JJ.StrictMode=P,JJ.Suspense=Q1,JJ.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=X1,JJ.__COMPILER_RUNTIME=L1,JJ.act=function(M){var g=X1.actQueue,_1=S0;S0++;var $1=X1.actQueue=g!==null?g:[],K1=!1;try{var w1=M()}catch(I1){X1.thrownErrors.push(I1)}if(0<X1.thrownErrors.length)throw S(g,_1),M=l(X1.thrownErrors),X1.thrownErrors.length=0,M;if(w1!==null&&typeof w1==="object"&&typeof w1.then==="function"){var R1=w1;return M2(function(){K1||i0||(i0=!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(I1,R0){K1=!0,R1.then(function(O0){if(S(g,_1),_1===0){try{D($1),c(function(){return j(O0,I1,R0)})}catch(G2){X1.thrownErrors.push(G2)}if(0<X1.thrownErrors.length){var r2=l(X1.thrownErrors);X1.thrownErrors.length=0,R0(r2)}}else I1(O0)},function(O0){S(g,_1),0<X1.thrownErrors.length?(O0=l(X1.thrownErrors),X1.thrownErrors.length=0,R0(O0)):R0(O0)})}}}var v1=w1;if(S(g,_1),_1===0&&(D($1),$1.length!==0&&M2(function(){K1||i0||(i0=!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(() => ...)"))}),X1.actQueue=null),0<X1.thrownErrors.length)throw M=l(X1.thrownErrors),X1.thrownErrors.length=0,M;return{then:function(I1,R0){K1=!0,_1===0?(X1.actQueue=$1,c(function(){return j(v1,I1,R0)})):I1(v1)}}},JJ.cache=function(M){return function(){return M.apply(null,arguments)}},JJ.cacheSignal=function(){return null},JJ.captureOwnerStack=function(){var M=X1.getCurrentStack;return M===null?null:M()},JJ.cloneElement=function(M,g,_1){if(M===null||M===void 0)throw Error("The argument must be a React element, but you passed "+M+".");var $1=Y1({},M.props),K1=M.key,w1=M._owner;if(g!=null){var R1;_:{if(D1.call(g,"ref")&&(R1=Object.getOwnPropertyDescriptor(g,"ref").get)&&R1.isReactWarning){R1=!1;break _}R1=g.ref!==void 0}R1&&(w1=H()),z(g)&&(X(g.key),K1=""+g.key);for(v1 in g)!D1.call(g,v1)||v1==="key"||v1==="__self"||v1==="__source"||v1==="ref"&&g.ref===void 0||($1[v1]=g[v1])}var v1=arguments.length-2;if(v1===1)$1.children=_1;else if(1<v1){R1=Array(v1);for(var I1=0;I1<v1;I1++)R1[I1]=arguments[I1+2];$1.children=R1}$1=O(M.type,K1,$1,w1,M._debugStack,M._debugTask);for(K1=2;K1<arguments.length;K1++)w(arguments[K1]);return $1},JJ.createContext=function(M){return M={$$typeof:u,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null},M.Provider=M,M.Consumer={$$typeof:b,_context:M},M._currentRenderer=null,M._currentRenderer2=null,M},JJ.createElement=function(M,g,_1){for(var $1=2;$1<arguments.length;$1++)w(arguments[$1]);$1={};var K1=null;if(g!=null)for(I1 in T0||!("__self"in g)||"key"in g||(T0=!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")),z(g)&&(X(g.key),K1=""+g.key),g)D1.call(g,I1)&&I1!=="key"&&I1!=="__self"&&I1!=="__source"&&($1[I1]=g[I1]);var w1=arguments.length-2;if(w1===1)$1.children=_1;else if(1<w1){for(var R1=Array(w1),v1=0;v1<w1;v1++)R1[v1]=arguments[v1+2];Object.freeze&&Object.freeze(R1),$1.children=R1}if(M&&M.defaultProps)for(I1 in w1=M.defaultProps,w1)$1[I1]===void 0&&($1[I1]=w1[I1]);K1&&W($1,typeof M==="function"?M.displayName||M.name||"Unknown":M);var I1=1e4>X1.recentlyCreatedOwnerStacks++;return O(M,K1,$1,H(),I1?Error("react-stack-top-frame"):z0,I1?a1(K(M)):t1)},JJ.createRef=function(){var M={current:null};return Object.seal(M),M},JJ.forwardRef=function(M){M!=null&&M.$$typeof===o?console.error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof M!=="function"?console.error("forwardRef requires a render function but was given %s.",M===null?"null":typeof M):M.length!==0&&M.length!==2&&console.error("forwardRef render functions accept exactly two parameters: props and ref. %s",M.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),M!=null&&M.defaultProps!=null&&console.error("forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?");var g={$$typeof:t,render:M},_1;return Object.defineProperty(g,"displayName",{enumerable:!1,configurable:!0,get:function(){return _1},set:function($1){_1=$1,M.name||M.displayName||(Object.defineProperty(M,"name",{value:$1}),M.displayName=$1)}}),g},JJ.isValidElement=B,JJ.lazy=function(M){M={_status:-1,_result:M};var g={$$typeof:p,_payload:M,_init:N},_1={name:"lazy",start:-1,end:-1,value:null,owner:null,debugStack:Error("react-stack-top-frame"),debugTask:console.createTask?console.createTask("lazy()"):null};return M._ioInfo=_1,g._debugInfo=[{awaited:_1}],g},JJ.memo=function(M,g){M==null&&console.error("memo: The first argument must be a component. Instead received: %s",M===null?"null":typeof M),g={$$typeof:o,type:M,compare:g===void 0?null:g};var _1;return Object.defineProperty(g,"displayName",{enumerable:!1,configurable:!0,get:function(){return _1},set:function($1){_1=$1,M.name||M.displayName||(Object.defineProperty(M,"name",{value:$1}),M.displayName=$1)}}),g},JJ.startTransition=function(M){var g=X1.T,_1={};_1._updatedFibers=new Set,X1.T=_1;try{var $1=M(),K1=X1.S;K1!==null&&K1(_1,$1),typeof $1==="object"&&$1!==null&&typeof $1.then==="function"&&(X1.asyncTransitions++,$1.then(E,E),$1.then(Z,W0))}catch(w1){W0(w1)}finally{g===null&&_1._updatedFibers&&(M=_1._updatedFibers.size,_1._updatedFibers.clear(),10<M&&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.")),g!==null&&_1.types!==null&&(g.types!==null&&g.types!==_1.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."),g.types=_1.types),X1.T=g}},JJ.unstable_useCacheRefresh=function(){return k().useCacheRefresh()},JJ.use=function(M){return k().use(M)},JJ.useActionState=function(M,g,_1){return k().useActionState(M,g,_1)},JJ.useCallback=function(M,g){return k().useCallback(M,g)},JJ.useContext=function(M){var g=k();return M.$$typeof===b&&console.error("Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"),g.useContext(M)},JJ.useDebugValue=function(M,g){return k().useDebugValue(M,g)},JJ.useDeferredValue=function(M,g){return k().useDeferredValue(M,g)},JJ.useEffect=function(M,g){return M==null&&console.warn("React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"),k().useEffect(M,g)},JJ.useEffectEvent=function(M){return k().useEffectEvent(M)},JJ.useId=function(){return k().useId()},JJ.useImperativeHandle=function(M,g,_1){return k().useImperativeHandle(M,g,_1)},JJ.useInsertionEffect=function(M,g){return M==null&&console.warn("React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"),k().useInsertionEffect(M,g)},JJ.useLayoutEffect=function(M,g){return M==null&&console.warn("React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"),k().useLayoutEffect(M,g)},JJ.useMemo=function(M,g){return k().useMemo(M,g)},JJ.useOptimistic=function(M,g){return k().useOptimistic(M,g)},JJ.useReducer=function(M,g,_1){return k().useReducer(M,g,_1)},JJ.useRef=function(M){return k().useRef(M)},JJ.useState=function(M){return k().useState(M)},JJ.useSyncExternalStore=function(M,g,_1){return k().useSyncExternalStore(M,g,_1)},JJ.useTransition=function(){return k().useTransition()},JJ.version="19.2.7",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var v8=T2(($J)=>{var R2=Q0(h0());(function(){function _(P){if(P==null)return null;if(typeof P==="function")return P.$$typeof===k?null:P.displayName||P.name||null;if(typeof P==="string")return P;switch(P){case I:return"Fragment";case A:return"Profiler";case O:return"StrictMode";case R:return"Suspense";case C:return"SuspenseList";case N:return"Activity"}if(typeof P==="object")switch(typeof P.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),P.$$typeof){case W:return"Portal";case B:return P.displayName||"Context";case w:return(P._context.displayName||"Context")+".Consumer";case T:var V=P.render;return P=P.displayName,P||(P=V.displayName||V.name||"",P=P!==""?"ForwardRef("+P+")":"ForwardRef"),P;case f:return V=P.displayName||null,V!==null?V:_(P.type)||"Memo";case y:V=P._payload,P=P._init;try{return _(P(V))}catch(b){}}return null}function Q(P){return""+P}function J(P){try{Q(P);var V=!1}catch(t){V=!0}if(V){V=console;var b=V.error,u=typeof Symbol==="function"&&Symbol.toStringTag&&P[Symbol.toStringTag]||P.constructor.name||"Object";return b.call(V,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",u),Q(P)}}function q(P){if(P===I)return"<>";if(typeof P==="object"&&P!==null&&P.$$typeof===y)return"<...>";try{var V=_(P);return V?"<"+V+">":"<...>"}catch(b){return"<...>"}}function U(){var P=E.A;return P===null?null:P.getOwner()}function G(){return Error("react-stack-top-frame")}function Z(P){if(c.call(P,"key")){var V=Object.getOwnPropertyDescriptor(P,"key").get;if(V&&V.isReactWarning)return!1}return P.key!==void 0}function F(P,V){function b(){j||(j=!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)",V))}b.isReactWarning=!0,Object.defineProperty(P,"key",{get:b,configurable:!0})}function X(){var P=_(this.type);return D[P]||(D[P]=!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.")),P=this.props.ref,P!==void 0?P:null}function Y(P,V,b,u,t,Q1){var a=b.ref;return P={$$typeof:z,type:P,key:V,props:b,_owner:u},(a!==void 0?a:null)!==null?Object.defineProperty(P,"ref",{enumerable:!1,get:X}):Object.defineProperty(P,"ref",{enumerable:!1,value:null}),P._store={},Object.defineProperty(P._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(P,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(P,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:t}),Object.defineProperty(P,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Q1}),Object.freeze&&(Object.freeze(P.props),Object.freeze(P)),P}function K(P,V,b,u,t,Q1){var a=V.children;if(a!==void 0)if(u)if(l(a)){for(u=0;u<a.length;u++)H(a[u]);Object.freeze&&Object.freeze(a)}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 H(a);if(c.call(V,"key")){a=_(P);var o=Object.keys(V).filter(function(n){return n!=="key"});u=0<o.length?"{key: someKey, "+o.join(": ..., ")+": ...}":"{key: someKey}",m[a+u]||(o=0<o.length?"{"+o.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} />`,y,s,o,s),m[s+y]=!0)}if(s=null,D!==void 0&&(J(D),s=""+D),Z(V)&&(J(V.key),s=""+V.key),"key"in V){D={};for(var p in V)p!=="key"&&(D[p]=V[p])}else D=V;return s&&F(D,typeof I==="function"?I.displayName||I.name||"Unknown":I),Y(I,s,D,U(),t,_1)}function H(I){L(I)?I._store&&(I._store.validated=1):typeof I==="object"&&I!==null&&I.$$typeof===v&&(I._payload.status==="fulfilled"?L(I._payload.value)&&I._payload.value._store&&(I._payload.value._store.validated=1):I._store&&(I._store.validated=1))}function L(I){return typeof I==="object"&&I!==null&&I.$$typeof===z}var z=Symbol.for("react.transitional.element"),W=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),O=Symbol.for("react.consumer"),B=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),C=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),N=Symbol.for("react.activity"),k=Symbol.for("react.client.reference"),u=T2.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,i=Object.prototype.hasOwnProperty,l=Array.isArray,S=console.createTask?console.createTask:function(){return null};T2={react_stack_bottom_frame:function(I){return I()}};var b,h={},E=T2.react_stack_bottom_frame.bind(T2,G)(),j=S(q(G)),m={};QJ.Fragment=w,QJ.jsx=function(I,V,D){var y=1e4>u.recentlyCreatedOwnerStacks++;return K(I,V,D,!1,y?Error("react-stack-top-frame"):E,y?S(q(I)):j)},QJ.jsxs=function(I,V,D){var y=1e4>u.recentlyCreatedOwnerStacks++;return K(I,V,D,!0,y?Error("react-stack-top-frame"):E,y?S(q(I)):j)}})()});var q9=M2((tq)=>{var A0=Q0(V0());(function(){function _(L,z){return L===z&&(L!==0||1/L===1/z)||L!==L&&z!==z}function Q(L,z){Y||A0.startTransition===void 0||(Y=!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 W=z();if(!K){var w=z();U(W,w)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),K=!0)}w=G({inst:{value:W,getSnapshot:z}});var R=w[0].inst,A=w[1];return F(function(){R.value=W,R.getSnapshot=z,J(R)&&A({inst:R})},[L,W,z]),Z(function(){return J(R)&&A({inst:R}),L(function(){J(R)&&A({inst:R})})},[L]),X(W),W}function J(L){var z=L.getSnapshot;L=L.value;try{var W=z();return!U(L,W)}catch(w){return!0}}function q(L,z){return z()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var U=typeof Object.is==="function"?Object.is:_,G=A0.useState,Z=A0.useEffect,F=A0.useLayoutEffect,X=A0.useDebugValue,Y=!1,K=!1,H=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?q:Q;tq.useSyncExternalStore=A0.useSyncExternalStore!==void 0?A0.useSyncExternalStore:H,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var U9=M2((oq)=>{var o0=Q0(V0());(function(){function _(X,Y){return X===Y&&(X!==0||1/X===1/Y)||X!==X&&Y!==Y}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var Q=q9(),J=typeof Object.is==="function"?Object.is:_,q=Q.useSyncExternalStore,U=o0.useRef,G=o0.useEffect,Z=o0.useMemo,F=o0.useDebugValue;oq.useSyncExternalStoreWithSelector=function(X,Y,K,H,L){var z=U(null);if(z.current===null){var W={hasValue:!1,value:null};z.current=W}else W=z.current;z=Z(function(){function R(P){if(!A){if(A=!0,O=P,P=H(P),L!==void 0&&W.hasValue){var C=W.value;if(L(C,P))return B=C}return B=P}if(C=B,J(O,P))return C;var f=H(P);if(L!==void 0&&L(C,f))return O=P,C;return O=P,B=f}var A=!1,O,B,M=K===void 0?null:K;return[function(){return R(Y())},M===null?void 0:function(){return R(M())}]},[Y,K,H,L]);var w=q(X,z[0],z[1]);return G(function(){W.hasValue=!0,W.value=w},[w]),F(w),w},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var Y9=M2((QU)=>{var t6=Q0(V0());(function(){function _(){}function Q(K){return""+K}function J(K,H,L){var z=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;try{Q(z);var W=!1}catch(w){W=!0}return W&&(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&&z[Symbol.toStringTag]||z.constructor.name||"Object"),Q(z)),{$$typeof:X,key:z==null?null:""+z,children:K,containerInfo:H,implementation:L}}function q(K,H){if(K==="font")return"";if(typeof H==="string")return H==="use-credentials"?H:""}function U(K){return K===null?"`null`":K===void 0?"`undefined`":K===""?"an empty string":'something with type "'+typeof K+'"'}function G(K){return K===null?"`null`":K===void 0?"`undefined`":K===""?"an empty string":typeof K==="string"?JSON.stringify(K):typeof K==="number"?"`"+K+"`":'something with type "'+typeof K+'"'}function Z(){var K=Y.H;return K===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} />`,u,a,o,a),m[a+u]=!0)}if(a=null,b!==void 0&&(J(b),a=""+b),Z(V)&&(J(V.key),a=""+V.key),"key"in V){b={};for(var p in V)p!=="key"&&(b[p]=V[p])}else b=V;return a&&F(b,typeof P==="function"?P.displayName||P.name||"Unknown":P),Y(P,a,b,U(),t,Q1)}function H(P){L(P)?P._store&&(P._store.validated=1):typeof P==="object"&&P!==null&&P.$$typeof===y&&(P._payload.status==="fulfilled"?L(P._payload.value)&&P._payload.value._store&&(P._payload.value._store.validated=1):P._store&&(P._store.validated=1))}function L(P){return typeof P==="object"&&P!==null&&P.$$typeof===z}var z=Symbol.for("react.transitional.element"),W=Symbol.for("react.portal"),I=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),B=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),C=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),N=Symbol.for("react.activity"),k=Symbol.for("react.client.reference"),E=R2.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,c=Object.prototype.hasOwnProperty,l=Array.isArray,S=console.createTask?console.createTask:function(){return null};R2={react_stack_bottom_frame:function(P){return P()}};var j,D={},x=R2.react_stack_bottom_frame.bind(R2,G)(),v=S(q(G)),m={};$J.Fragment=I,$J.jsx=function(P,V,b){var u=1e4>E.recentlyCreatedOwnerStacks++;return K(P,V,b,!1,u?Error("react-stack-top-frame"):x,u?S(q(P)):v)},$J.jsxs=function(P,V,b){var u=1e4>E.recentlyCreatedOwnerStacks++;return K(P,V,b,!0,u?Error("react-stack-top-frame"):x,u?S(q(P)):v)}})()});var X9=T2((nq)=>{var B0=Q0(h0());(function(){function _(L,z){return L===z&&(L!==0||1/L===1/z)||L!==L&&z!==z}function Q(L,z){Y||B0.startTransition===void 0||(Y=!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 W=z();if(!K){var I=z();U(W,I)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),K=!0)}I=G({inst:{value:W,getSnapshot:z}});var O=I[0].inst,A=I[1];return F(function(){O.value=W,O.getSnapshot=z,J(O)&&A({inst:O})},[L,W,z]),Z(function(){return J(O)&&A({inst:O}),L(function(){J(O)&&A({inst:O})})},[L]),X(W),W}function J(L){var z=L.getSnapshot;L=L.value;try{var W=z();return!U(L,W)}catch(I){return!0}}function q(L,z){return z()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var U=typeof Object.is==="function"?Object.is:_,G=B0.useState,Z=B0.useEffect,F=B0.useLayoutEffect,X=B0.useDebugValue,Y=!1,K=!1,H=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?q:Q;nq.useSyncExternalStore=B0.useSyncExternalStore!==void 0?B0.useSyncExternalStore:H,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var K9=T2((eq)=>{var e0=Q0(h0());(function(){function _(X,Y){return X===Y&&(X!==0||1/X===1/Y)||X!==X&&Y!==Y}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var Q=X9(),J=typeof Object.is==="function"?Object.is:_,q=Q.useSyncExternalStore,U=e0.useRef,G=e0.useEffect,Z=e0.useMemo,F=e0.useDebugValue;eq.useSyncExternalStoreWithSelector=function(X,Y,K,H,L){var z=U(null);if(z.current===null){var W={hasValue:!1,value:null};z.current=W}else W=z.current;z=Z(function(){function O(R){if(!A){if(A=!0,w=R,R=H(R),L!==void 0&&W.hasValue){var C=W.value;if(L(C,R))return B=C}return B=R}if(C=B,J(w,R))return C;var f=H(R);if(L!==void 0&&L(C,f))return w=R,C;return w=R,B=f}var A=!1,w,B,T=K===void 0?null:K;return[function(){return O(Y())},T===null?void 0:function(){return O(T())}]},[Y,K,H,L]);var I=q(X,z[0],z[1]);return G(function(){W.hasValue=!0,W.value=I},[I]),F(I),I},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var M9=T2(($U)=>{var J8=Q0(h0());(function(){function _(){}function Q(K){return""+K}function J(K,H,L){var z=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;try{Q(z);var W=!1}catch(I){W=!0}return W&&(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&&z[Symbol.toStringTag]||z.constructor.name||"Object"),Q(z)),{$$typeof:X,key:z==null?null:""+z,children:K,containerInfo:H,implementation:L}}function q(K,H){if(K==="font")return"";if(typeof H==="string")return H==="use-credentials"?H:""}function U(K){return K===null?"`null`":K===void 0?"`undefined`":K===""?"an empty string":'something with type "'+typeof K+'"'}function G(K){return K===null?"`null`":K===void 0?"`undefined`":K===""?"an empty string":typeof K==="string"?JSON.stringify(K):typeof K==="number"?"`"+K+"`":'something with type "'+typeof K+'"'}function Z(){var K=Y.H;return K===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.`),K}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var F={d:{f:_,r:function(){throw Error("Invalid form element. requestFormReset must be passed a form that was rendered by React.")},D:_,C:_,L:_,m:_,X:_,S:_,M:_},p:0,findDOMNode:null},X=Symbol.for("react.portal"),Y=t6.__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"),QU.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=F,QU.createPortal=function(K,H){var L=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!H||H.nodeType!==1&&H.nodeType!==9&&H.nodeType!==11)throw Error("Target container is not a DOM element.");return J(K,H,null,L)},QU.flushSync=function(K){var H=Y.T,L=F.p;try{if(Y.T=null,F.p=2,K)return K()}finally{Y.T=H,F.p=L,F.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.")}},QU.preconnect=function(K,H){typeof K==="string"&&K?H!=null&&typeof H!=="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.",G(H)):H!=null&&typeof H.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.",U(H.crossOrigin)):console.error("ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",U(K)),typeof K==="string"&&(H?(H=H.crossOrigin,H=typeof H==="string"?H==="use-credentials"?H:"":void 0):H=null,F.d.C(K,H))},QU.prefetchDNS=function(K){if(typeof K!=="string"||!K)console.error("ReactDOM.prefetchDNS(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",U(K));else if(1<arguments.length){var H=arguments[1];typeof H==="object"&&H.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`.",G(H)):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`.",G(H))}typeof K==="string"&&F.d.D(K)},QU.preinit=function(K,H){if(typeof K==="string"&&K?H==null||typeof H!=="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.",G(H)):H.as!=="style"&&H.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".',G(H.as)):console.error("ReactDOM.preinit(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",U(K)),typeof K==="string"&&H&&typeof H.as==="string"){var L=H.as,z=q(L,H.crossOrigin),W=typeof H.integrity==="string"?H.integrity:void 0,w=typeof H.fetchPriority==="string"?H.fetchPriority:void 0;L==="style"?F.d.S(K,typeof H.precedence==="string"?H.precedence:void 0,{crossOrigin:z,integrity:W,fetchPriority:w}):L==="script"&&F.d.X(K,{crossOrigin:z,integrity:W,fetchPriority:w,nonce:typeof H.nonce==="string"?H.nonce:void 0})}},QU.preinitModule=function(K,H){var L="";if(typeof K==="string"&&K||(L+=" The `href` argument encountered was "+U(K)+"."),H!==void 0&&typeof H!=="object"?L+=" The `options` argument encountered was "+U(H)+".":H&&("as"in H)&&H.as!=="script"&&(L+=" The `as` option encountered was "+G(H.as)+"."),L)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",L);else switch(L=H&&typeof H.as==="string"?H.as:"script",L){case"script":break;default:L=G(L),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)',L,K)}if(typeof K==="string")if(typeof H==="object"&&H!==null){if(H.as==null||H.as==="script")L=q(H.as,H.crossOrigin),F.d.M(K,{crossOrigin:L,integrity:typeof H.integrity==="string"?H.integrity:void 0,nonce:typeof H.nonce==="string"?H.nonce:void 0})}else H==null&&F.d.M(K)},QU.preload=function(K,H){var L="";if(typeof K==="string"&&K||(L+=" The `href` argument encountered was "+U(K)+"."),H==null||typeof H!=="object"?L+=" The `options` argument encountered was "+U(H)+".":typeof H.as==="string"&&H.as||(L+=" The `as` option encountered was "+U(H.as)+"."),L&&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',L),typeof K==="string"&&typeof H==="object"&&H!==null&&typeof H.as==="string"){L=H.as;var z=q(L,H.crossOrigin);F.d.L(K,L,{crossOrigin:z,integrity:typeof H.integrity==="string"?H.integrity:void 0,nonce:typeof H.nonce==="string"?H.nonce:void 0,type:typeof H.type==="string"?H.type:void 0,fetchPriority:typeof H.fetchPriority==="string"?H.fetchPriority:void 0,referrerPolicy:typeof H.referrerPolicy==="string"?H.referrerPolicy:void 0,imageSrcSet:typeof H.imageSrcSet==="string"?H.imageSrcSet:void 0,imageSizes:typeof H.imageSizes==="string"?H.imageSizes:void 0,media:typeof H.media==="string"?H.media:void 0})}},QU.preloadModule=function(K,H){var L="";typeof K==="string"&&K||(L+=" The `href` argument encountered was "+U(K)+"."),H!==void 0&&typeof H!=="object"?L+=" The `options` argument encountered was "+U(H)+".":H&&("as"in H)&&typeof H.as!=="string"&&(L+=" The `as` option encountered was "+U(H.as)+"."),L&&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',L),typeof K==="string"&&(H?(L=q(H.as,H.crossOrigin),F.d.m(K,{as:typeof H.as==="string"&&H.as!=="script"?H.as:void 0,crossOrigin:L,integrity:typeof H.integrity==="string"?H.integrity:void 0})):F.d.m(K))},QU.requestFormReset=function(K){F.d.r(K)},QU.unstable_batchedUpdates=function(K,H){return K(H)},QU.useFormState=function(K,H,L){return Z().useFormState(K,H,L)},QU.useFormStatus=function(){return Z().useHostTransitionStatus()},QU.version="19.2.7",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var z9=M2((NA,L9)=>{var JU=Q0(Y9());L9.exports=JU});var r5=M2((wZ)=>{var h2=Q0(V0());(function(){function _(I){if(I==null)return null;if(typeof I==="function")return I.$$typeof===k?null:I.displayName||I.name||null;if(typeof I==="string")return I;switch(I){case w:return"Fragment";case A:return"Profiler";case R:return"StrictMode";case P:return"Suspense";case C:return"SuspenseList";case N:return"Activity"}if(typeof I==="object")switch(typeof I.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),I.$$typeof){case W:return"Portal";case B:return I.displayName||"Context";case O:return(I._context.displayName||"Context")+".Consumer";case M:var V=I.render;return I=I.displayName,I||(I=V.displayName||V.name||"",I=I!==""?"ForwardRef("+I+")":"ForwardRef"),I;case f:return V=I.displayName||null,V!==null?V:_(I.type)||"Memo";case v:V=I._payload,I=I._init;try{return _(I(V))}catch(D){}}return null}function Q(I){return""+I}function J(I){try{Q(I);var V=!1}catch(t){V=!0}if(V){V=console;var D=V.error,y=typeof Symbol==="function"&&Symbol.toStringTag&&I[Symbol.toStringTag]||I.constructor.name||"Object";return D.call(V,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",y),Q(I)}}function q(I){if(I===w)return"<>";if(typeof I==="object"&&I!==null&&I.$$typeof===v)return"<...>";try{var V=_(I);return V?"<"+V+">":"<...>"}catch(D){return"<...>"}}function U(){var I=u.A;return I===null?null:I.getOwner()}function G(){return Error("react-stack-top-frame")}function Z(I){if(i.call(I,"key")){var V=Object.getOwnPropertyDescriptor(I,"key").get;if(V&&V.isReactWarning)return!1}return I.key!==void 0}function F(I,V){function D(){b||(b=!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)",V))}D.isReactWarning=!0,Object.defineProperty(I,"key",{get:D,configurable:!0})}function X(){var I=_(this.type);return h[I]||(h[I]=!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.")),I=this.props.ref,I!==void 0?I:null}function Y(I,V,D,y,t,_1){var s=D.ref;return I={$$typeof:z,type:I,key:V,props:D,_owner:y},(s!==void 0?s:null)!==null?Object.defineProperty(I,"ref",{enumerable:!1,get:X}):Object.defineProperty(I,"ref",{enumerable:!1,value:null}),I._store={},Object.defineProperty(I._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(I,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(I,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:t}),Object.defineProperty(I,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:_1}),Object.freeze&&(Object.freeze(I.props),Object.freeze(I)),I}function K(I,V,D,y,t,_1){var s=V.children;if(s!==void 0)if(y)if(l(s)){for(y=0;y<s.length;y++)H(s[y]);Object.freeze&&Object.freeze(s)}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 H(s);if(i.call(V,"key")){s=_(I);var o=Object.keys(V).filter(function(e){return e!=="key"});y=0<o.length?"{key: someKey, "+o.join(": ..., ")+": ...}":"{key: someKey}",m[s+y]||(o=0<o.length?"{"+o.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.`),K}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var F={d:{f:_,r:function(){throw Error("Invalid form element. requestFormReset must be passed a form that was rendered by React.")},D:_,C:_,L:_,m:_,X:_,S:_,M:_},p:0,findDOMNode:null},X=Symbol.for("react.portal"),Y=J8.__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"),$U.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=F,$U.createPortal=function(K,H){var L=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!H||H.nodeType!==1&&H.nodeType!==9&&H.nodeType!==11)throw Error("Target container is not a DOM element.");return J(K,H,null,L)},$U.flushSync=function(K){var H=Y.T,L=F.p;try{if(Y.T=null,F.p=2,K)return K()}finally{Y.T=H,F.p=L,F.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.")}},$U.preconnect=function(K,H){typeof K==="string"&&K?H!=null&&typeof H!=="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.",G(H)):H!=null&&typeof H.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.",U(H.crossOrigin)):console.error("ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",U(K)),typeof K==="string"&&(H?(H=H.crossOrigin,H=typeof H==="string"?H==="use-credentials"?H:"":void 0):H=null,F.d.C(K,H))},$U.prefetchDNS=function(K){if(typeof K!=="string"||!K)console.error("ReactDOM.prefetchDNS(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",U(K));else if(1<arguments.length){var H=arguments[1];typeof H==="object"&&H.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`.",G(H)):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`.",G(H))}typeof K==="string"&&F.d.D(K)},$U.preinit=function(K,H){if(typeof K==="string"&&K?H==null||typeof H!=="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.",G(H)):H.as!=="style"&&H.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".',G(H.as)):console.error("ReactDOM.preinit(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",U(K)),typeof K==="string"&&H&&typeof H.as==="string"){var L=H.as,z=q(L,H.crossOrigin),W=typeof H.integrity==="string"?H.integrity:void 0,I=typeof H.fetchPriority==="string"?H.fetchPriority:void 0;L==="style"?F.d.S(K,typeof H.precedence==="string"?H.precedence:void 0,{crossOrigin:z,integrity:W,fetchPriority:I}):L==="script"&&F.d.X(K,{crossOrigin:z,integrity:W,fetchPriority:I,nonce:typeof H.nonce==="string"?H.nonce:void 0})}},$U.preinitModule=function(K,H){var L="";if(typeof K==="string"&&K||(L+=" The `href` argument encountered was "+U(K)+"."),H!==void 0&&typeof H!=="object"?L+=" The `options` argument encountered was "+U(H)+".":H&&("as"in H)&&H.as!=="script"&&(L+=" The `as` option encountered was "+G(H.as)+"."),L)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",L);else switch(L=H&&typeof H.as==="string"?H.as:"script",L){case"script":break;default:L=G(L),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)',L,K)}if(typeof K==="string")if(typeof H==="object"&&H!==null){if(H.as==null||H.as==="script")L=q(H.as,H.crossOrigin),F.d.M(K,{crossOrigin:L,integrity:typeof H.integrity==="string"?H.integrity:void 0,nonce:typeof H.nonce==="string"?H.nonce:void 0})}else H==null&&F.d.M(K)},$U.preload=function(K,H){var L="";if(typeof K==="string"&&K||(L+=" The `href` argument encountered was "+U(K)+"."),H==null||typeof H!=="object"?L+=" The `options` argument encountered was "+U(H)+".":typeof H.as==="string"&&H.as||(L+=" The `as` option encountered was "+U(H.as)+"."),L&&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',L),typeof K==="string"&&typeof H==="object"&&H!==null&&typeof H.as==="string"){L=H.as;var z=q(L,H.crossOrigin);F.d.L(K,L,{crossOrigin:z,integrity:typeof H.integrity==="string"?H.integrity:void 0,nonce:typeof H.nonce==="string"?H.nonce:void 0,type:typeof H.type==="string"?H.type:void 0,fetchPriority:typeof H.fetchPriority==="string"?H.fetchPriority:void 0,referrerPolicy:typeof H.referrerPolicy==="string"?H.referrerPolicy:void 0,imageSrcSet:typeof H.imageSrcSet==="string"?H.imageSrcSet:void 0,imageSizes:typeof H.imageSizes==="string"?H.imageSizes:void 0,media:typeof H.media==="string"?H.media:void 0})}},$U.preloadModule=function(K,H){var L="";typeof K==="string"&&K||(L+=" The `href` argument encountered was "+U(K)+"."),H!==void 0&&typeof H!=="object"?L+=" The `options` argument encountered was "+U(H)+".":H&&("as"in H)&&typeof H.as!=="string"&&(L+=" The `as` option encountered was "+U(H.as)+"."),L&&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',L),typeof K==="string"&&(H?(L=q(H.as,H.crossOrigin),F.d.m(K,{as:typeof H.as==="string"&&H.as!=="script"?H.as:void 0,crossOrigin:L,integrity:typeof H.integrity==="string"?H.integrity:void 0})):F.d.m(K))},$U.requestFormReset=function(K){F.d.r(K)},$U.unstable_batchedUpdates=function(K,H){return K(H)},$U.useFormState=function(K,H,L){return Z().useFormState(K,H,L)},$U.useFormStatus=function(){return Z().useHostTransitionStatus()},$U.version="19.2.7",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var R9=T2((CB,T9)=>{var qU=Q0(M9());T9.exports=qU});var d5=T2((wZ)=>{var D2=Q0(h0());(function(){function _(P){if(P==null)return null;if(typeof P==="function")return P.$$typeof===k?null:P.displayName||P.name||null;if(typeof P==="string")return P;switch(P){case I:return"Fragment";case A:return"Profiler";case O:return"StrictMode";case R:return"Suspense";case C:return"SuspenseList";case N:return"Activity"}if(typeof P==="object")switch(typeof P.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),P.$$typeof){case W:return"Portal";case B:return P.displayName||"Context";case w:return(P._context.displayName||"Context")+".Consumer";case T:var V=P.render;return P=P.displayName,P||(P=V.displayName||V.name||"",P=P!==""?"ForwardRef("+P+")":"ForwardRef"),P;case f:return V=P.displayName||null,V!==null?V:_(P.type)||"Memo";case y:V=P._payload,P=P._init;try{return _(P(V))}catch(b){}}return null}function Q(P){return""+P}function J(P){try{Q(P);var V=!1}catch(t){V=!0}if(V){V=console;var b=V.error,u=typeof Symbol==="function"&&Symbol.toStringTag&&P[Symbol.toStringTag]||P.constructor.name||"Object";return b.call(V,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",u),Q(P)}}function q(P){if(P===I)return"<>";if(typeof P==="object"&&P!==null&&P.$$typeof===y)return"<...>";try{var V=_(P);return V?"<"+V+">":"<...>"}catch(b){return"<...>"}}function U(){var P=E.A;return P===null?null:P.getOwner()}function G(){return Error("react-stack-top-frame")}function Z(P){if(c.call(P,"key")){var V=Object.getOwnPropertyDescriptor(P,"key").get;if(V&&V.isReactWarning)return!1}return P.key!==void 0}function F(P,V){function b(){j||(j=!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)",V))}b.isReactWarning=!0,Object.defineProperty(P,"key",{get:b,configurable:!0})}function X(){var P=_(this.type);return D[P]||(D[P]=!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.")),P=this.props.ref,P!==void 0?P:null}function Y(P,V,b,u,t,Q1){var a=b.ref;return P={$$typeof:z,type:P,key:V,props:b,_owner:u},(a!==void 0?a:null)!==null?Object.defineProperty(P,"ref",{enumerable:!1,get:X}):Object.defineProperty(P,"ref",{enumerable:!1,value:null}),P._store={},Object.defineProperty(P._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(P,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(P,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:t}),Object.defineProperty(P,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Q1}),Object.freeze&&(Object.freeze(P.props),Object.freeze(P)),P}function K(P,V,b,u,t,Q1){var a=V.children;if(a!==void 0)if(u)if(l(a)){for(u=0;u<a.length;u++)H(a[u]);Object.freeze&&Object.freeze(a)}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 H(a);if(c.call(V,"key")){a=_(P);var o=Object.keys(V).filter(function(n){return n!=="key"});u=0<o.length?"{key: someKey, "+o.join(": ..., ")+": ...}":"{key: someKey}",m[a+u]||(o=0<o.length?"{"+o.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} />`,y,s,o,s),m[s+y]=!0)}if(s=null,D!==void 0&&(J(D),s=""+D),Z(V)&&(J(V.key),s=""+V.key),"key"in V){D={};for(var p in V)p!=="key"&&(D[p]=V[p])}else D=V;return s&&F(D,typeof I==="function"?I.displayName||I.name||"Unknown":I),Y(I,s,D,U(),t,_1)}function H(I){L(I)?I._store&&(I._store.validated=1):typeof I==="object"&&I!==null&&I.$$typeof===v&&(I._payload.status==="fulfilled"?L(I._payload.value)&&I._payload.value._store&&(I._payload.value._store.validated=1):I._store&&(I._store.validated=1))}function L(I){return typeof I==="object"&&I!==null&&I.$$typeof===z}var z=Symbol.for("react.transitional.element"),W=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),O=Symbol.for("react.consumer"),B=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),C=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),N=Symbol.for("react.activity"),k=Symbol.for("react.client.reference"),u=h2.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,i=Object.prototype.hasOwnProperty,l=Array.isArray,S=console.createTask?console.createTask:function(){return null};h2={react_stack_bottom_frame:function(I){return I()}};var b,h={},E=h2.react_stack_bottom_frame.bind(h2,G)(),j=S(q(G)),m={};wZ.Fragment=w,wZ.jsxDEV=function(I,V,D,y){var t=1e4>u.recentlyCreatedOwnerStacks++;return K(I,V,D,y,t?Error("react-stack-top-frame"):E,t?S(q(I)):j)}})()});var c=Q0(V0(),1);var r=Q0(N8(),1),d=Q0(V0(),1);function g1(_){if(typeof _==="string"||typeof _==="number")return""+_;let Q="";if(Array.isArray(_)){for(let J=0,q;J<_.length;J++)if((q=g1(_[J]))!=="")Q+=(Q&&" ")+q}else for(let J in _)if(_[J])Q+=(Q&&" ")+J;return Q}var JJ={value:()=>{}};function C8(){for(var _=0,Q=arguments.length,J={},q;_<Q;++_){if(!(q=arguments[_]+"")||q in J||/[\s.]/.test(q))throw Error("illegal type: "+q);J[q]=[]}return new _4(J)}function _4(_){this._=_}function $J(_,Q){return _.trim().split(/^|\s+/).map(function(J){var q="",U=J.indexOf(".");if(U>=0)q=J.slice(U+1),J=J.slice(0,U);if(J&&!Q.hasOwnProperty(J))throw Error("unknown type: "+J);return{type:J,name:q}})}_4.prototype=C8.prototype={constructor:_4,on:function(_,Q){var J=this._,q=$J(_+"",J),U,G=-1,Z=q.length;if(arguments.length<2){while(++G<Z)if((U=(_=q[G]).type)&&(U=qJ(J[U],_.name)))return U;return}if(Q!=null&&typeof Q!=="function")throw Error("invalid callback: "+Q);while(++G<Z)if(U=(_=q[G]).type)J[U]=f8(J[U],_.name,Q);else if(Q==null)for(U in J)J[U]=f8(J[U],_.name,null);return this},copy:function(){var _={},Q=this._;for(var J in Q)_[J]=Q[J].slice();return new _4(_)},call:function(_,Q){if((U=arguments.length-2)>0)for(var J=Array(U),q=0,U,G;q<U;++q)J[q]=arguments[q+2];if(!this._.hasOwnProperty(_))throw Error("unknown type: "+_);for(G=this._[_],q=0,U=G.length;q<U;++q)G[q].value.apply(Q,J)},apply:function(_,Q,J){if(!this._.hasOwnProperty(_))throw Error("unknown type: "+_);for(var q=this._[_],U=0,G=q.length;U<G;++U)q[U].value.apply(Q,J)}};function qJ(_,Q){for(var J=0,q=_.length,U;J<q;++J)if((U=_[J]).name===Q)return U.value}function f8(_,Q,J){for(var q=0,U=_.length;q<U;++q)if(_[q].name===Q){_[q]=JJ,_=_.slice(0,q).concat(_.slice(q+1));break}if(J!=null)_.push({name:Q,value:J});return _}var R2=C8;function i2(_){return function(){return this.matches(_)}}function Q4(_){return function(Q){return Q.matches(_)}}var J4="http://www.w3.org/1999/xhtml",_3={svg:"http://www.w3.org/2000/svg",xhtml:J4,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function u0(_){var Q=_+="",J=Q.indexOf(":");if(J>=0&&(Q=_.slice(0,J))!=="xmlns")_=_.slice(J+1);return _3.hasOwnProperty(Q)?{space:_3[Q],local:_}:_}function Q3(_){let Q;while(Q=_.sourceEvent)_=Q;return _}function q0(_,Q){if(_=Q3(_),Q===void 0)Q=_.currentTarget;if(Q){var J=Q.ownerSVGElement||Q;if(J.createSVGPoint){var q=J.createSVGPoint();return q.x=_.clientX,q.y=_.clientY,q=q.matrixTransform(Q.getScreenCTM().inverse()),[q.x,q.y]}if(Q.getBoundingClientRect){var U=Q.getBoundingClientRect();return[_.clientX-U.left-Q.clientLeft,_.clientY-U.top-Q.clientTop]}}return[_.pageX,_.pageY]}function UJ(){}function Z2(_){return _==null?UJ:function(){return this.querySelector(_)}}function J3(_){if(typeof _!=="function")_=Z2(_);for(var Q=this._groups,J=Q.length,q=Array(J),U=0;U<J;++U)for(var G=Q[U],Z=G.length,F=q[U]=Array(Z),X,Y,K=0;K<Z;++K)if((X=G[K])&&(Y=_.call(X,X.__data__,K,G))){if("__data__"in X)Y.__data__=X.__data__;F[K]=Y}return new i1(q,this._parents)}function $3(_){return _==null?[]:Array.isArray(_)?_:Array.from(_)}function GJ(){return[]}function r2(_){return _==null?GJ:function(){return this.querySelectorAll(_)}}function ZJ(_){return function(){return $3(_.apply(this,arguments))}}function q3(_){if(typeof _==="function")_=ZJ(_);else _=r2(_);for(var Q=this._groups,J=Q.length,q=[],U=[],G=0;G<J;++G)for(var Z=Q[G],F=Z.length,X,Y=0;Y<F;++Y)if(X=Z[Y])q.push(_.call(X,X.__data__,Y,Z)),U.push(X);return new i1(q,U)}var FJ=Array.prototype.find;function HJ(_){return function(){return FJ.call(this.children,_)}}function XJ(){return this.firstElementChild}function U3(_){return this.select(_==null?XJ:HJ(typeof _==="function"?_:Q4(_)))}var KJ=Array.prototype.filter;function YJ(){return Array.from(this.children)}function LJ(_){return function(){return KJ.call(this.children,_)}}function G3(_){return this.selectAll(_==null?YJ:LJ(typeof _==="function"?_:Q4(_)))}function Z3(_){if(typeof _!=="function")_=i2(_);for(var Q=this._groups,J=Q.length,q=Array(J),U=0;U<J;++U)for(var G=Q[U],Z=G.length,F=q[U]=[],X,Y=0;Y<Z;++Y)if((X=G[Y])&&_.call(X,X.__data__,Y,G))F.push(X);return new i1(q,this._parents)}function L5(_){return Array(_.length)}function F3(){return new i1(this._enter||this._groups.map(L5),this._parents)}function z5(_,Q){this.ownerDocument=_.ownerDocument,this.namespaceURI=_.namespaceURI,this._next=null,this._parent=_,this.__data__=Q}z5.prototype={constructor:z5,appendChild:function(_){return this._parent.insertBefore(_,this._next)},insertBefore:function(_,Q){return this._parent.insertBefore(_,Q)},querySelector:function(_){return this._parent.querySelector(_)},querySelectorAll:function(_){return this._parent.querySelectorAll(_)}};function H3(_){return function(){return _}}function zJ(_,Q,J,q,U,G){var Z=0,F,X=Q.length,Y=G.length;for(;Z<Y;++Z)if(F=Q[Z])F.__data__=G[Z],q[Z]=F;else J[Z]=new z5(_,G[Z]);for(;Z<X;++Z)if(F=Q[Z])U[Z]=F}function WJ(_,Q,J,q,U,G,Z){var F,X,Y=new Map,K=Q.length,H=G.length,L=Array(K),z;for(F=0;F<K;++F)if(X=Q[F])if(L[F]=z=Z.call(X,X.__data__,F,Q)+"",Y.has(z))U[F]=X;else Y.set(z,X);for(F=0;F<H;++F)if(z=Z.call(_,G[F],F,G)+"",X=Y.get(z))q[F]=X,X.__data__=G[F],Y.delete(z);else J[F]=new z5(_,G[F]);for(F=0;F<K;++F)if((X=Q[F])&&Y.get(L[F])===X)U[F]=X}function BJ(_){return _.__data__}function X3(_,Q){if(!arguments.length)return Array.from(this,BJ);var J=Q?WJ:zJ,q=this._parents,U=this._groups;if(typeof _!=="function")_=H3(_);for(var G=U.length,Z=Array(G),F=Array(G),X=Array(G),Y=0;Y<G;++Y){var K=q[Y],H=U[Y],L=H.length,z=AJ(_.call(K,K&&K.__data__,Y,q)),W=z.length,w=F[Y]=Array(W),R=Z[Y]=Array(W),A=X[Y]=Array(L);J(K,H,w,R,A,z,Q);for(var O=0,B=0,M,P;O<W;++O)if(M=w[O]){if(O>=B)B=O+1;while(!(P=R[B])&&++B<W);M._next=P||null}}return Z=new i1(Z,q),Z._enter=F,Z._exit=X,Z}function AJ(_){return typeof _==="object"&&"length"in _?_:Array.from(_)}function K3(){return new i1(this._exit||this._groups.map(L5),this._parents)}function Y3(_,Q,J){var q=this.enter(),U=this,G=this.exit();if(typeof _==="function"){if(q=_(q),q)q=q.selection()}else q=q.append(_+"");if(Q!=null){if(U=Q(U),U)U=U.selection()}if(J==null)G.remove();else J(G);return q&&U?q.merge(U).order():U}function L3(_){var Q=_.selection?_.selection():_;for(var J=this._groups,q=Q._groups,U=J.length,G=q.length,Z=Math.min(U,G),F=Array(U),X=0;X<Z;++X)for(var Y=J[X],K=q[X],H=Y.length,L=F[X]=Array(H),z,W=0;W<H;++W)if(z=Y[W]||K[W])L[W]=z;for(;X<U;++X)F[X]=J[X];return new i1(F,this._parents)}function z3(){for(var _=this._groups,Q=-1,J=_.length;++Q<J;)for(var q=_[Q],U=q.length-1,G=q[U],Z;--U>=0;)if(Z=q[U]){if(G&&Z.compareDocumentPosition(G)^4)G.parentNode.insertBefore(Z,G);G=Z}return this}function W3(_){if(!_)_=MJ;function Q(H,L){return H&&L?_(H.__data__,L.__data__):!H-!L}for(var J=this._groups,q=J.length,U=Array(q),G=0;G<q;++G){for(var Z=J[G],F=Z.length,X=U[G]=Array(F),Y,K=0;K<F;++K)if(Y=Z[K])X[K]=Y;X.sort(Q)}return new i1(U,this._parents).order()}function MJ(_,Q){return _<Q?-1:_>Q?1:_>=Q?0:NaN}function B3(){var _=arguments[0];return arguments[0]=this,_.apply(null,arguments),this}function A3(){return Array.from(this)}function M3(){for(var _=this._groups,Q=0,J=_.length;Q<J;++Q)for(var q=_[Q],U=0,G=q.length;U<G;++U){var Z=q[U];if(Z)return Z}return null}function T3(){let _=0;for(let Q of this)++_;return _}function R3(){return!this.node()}function O3(_){for(var Q=this._groups,J=0,q=Q.length;J<q;++J)for(var U=Q[J],G=0,Z=U.length,F;G<Z;++G)if(F=U[G])_.call(F,F.__data__,G,U);return this}function TJ(_){return function(){this.removeAttribute(_)}}function RJ(_){return function(){this.removeAttributeNS(_.space,_.local)}}function OJ(_,Q){return function(){this.setAttribute(_,Q)}}function IJ(_,Q){return function(){this.setAttributeNS(_.space,_.local,Q)}}function wJ(_,Q){return function(){var J=Q.apply(this,arguments);if(J==null)this.removeAttribute(_);else this.setAttribute(_,J)}}function PJ(_,Q){return function(){var J=Q.apply(this,arguments);if(J==null)this.removeAttributeNS(_.space,_.local);else this.setAttributeNS(_.space,_.local,J)}}function I3(_,Q){var J=u0(_);if(arguments.length<2){var q=this.node();return J.local?q.getAttributeNS(J.space,J.local):q.getAttribute(J)}return this.each((Q==null?J.local?RJ:TJ:typeof Q==="function"?J.local?PJ:wJ:J.local?IJ:OJ)(J,Q))}function W5(_){return _.ownerDocument&&_.ownerDocument.defaultView||_.document&&_||_.defaultView}function NJ(_){return function(){this.style.removeProperty(_)}}function fJ(_,Q,J){return function(){this.style.setProperty(_,Q,J)}}function CJ(_,Q,J){return function(){var q=Q.apply(this,arguments);if(q==null)this.style.removeProperty(_);else this.style.setProperty(_,q,J)}}function w3(_,Q,J){return arguments.length>1?this.each((Q==null?NJ:typeof Q==="function"?CJ:fJ)(_,Q,J==null?"":J)):F2(this.node(),_)}function F2(_,Q){return _.style.getPropertyValue(Q)||W5(_).getComputedStyle(_,null).getPropertyValue(Q)}function SJ(_){return function(){delete this[_]}}function vJ(_,Q){return function(){this[_]=Q}}function kJ(_,Q){return function(){var J=Q.apply(this,arguments);if(J==null)delete this[_];else this[_]=J}}function P3(_,Q){return arguments.length>1?this.each((Q==null?SJ:typeof Q==="function"?kJ:vJ)(_,Q)):this.node()[_]}function S8(_){return _.trim().split(/^|\s+/)}function N3(_){return _.classList||new v8(_)}function v8(_){this._node=_,this._names=S8(_.getAttribute("class")||"")}v8.prototype={add:function(_){var Q=this._names.indexOf(_);if(Q<0)this._names.push(_),this._node.setAttribute("class",this._names.join(" "))},remove:function(_){var Q=this._names.indexOf(_);if(Q>=0)this._names.splice(Q,1),this._node.setAttribute("class",this._names.join(" "))},contains:function(_){return this._names.indexOf(_)>=0}};function k8(_,Q){var J=N3(_),q=-1,U=Q.length;while(++q<U)J.add(Q[q])}function y8(_,Q){var J=N3(_),q=-1,U=Q.length;while(++q<U)J.remove(Q[q])}function yJ(_){return function(){k8(this,_)}}function jJ(_){return function(){y8(this,_)}}function VJ(_,Q){return function(){(Q.apply(this,arguments)?k8:y8)(this,_)}}function f3(_,Q){var J=S8(_+"");if(arguments.length<2){var q=N3(this.node()),U=-1,G=J.length;while(++U<G)if(!q.contains(J[U]))return!1;return!0}return this.each((typeof Q==="function"?VJ:Q?yJ:jJ)(J,Q))}function uJ(){this.textContent=""}function hJ(_){return function(){this.textContent=_}}function DJ(_){return function(){var Q=_.apply(this,arguments);this.textContent=Q==null?"":Q}}function C3(_){return arguments.length?this.each(_==null?uJ:(typeof _==="function"?DJ:hJ)(_)):this.node().textContent}function bJ(){this.innerHTML=""}function EJ(_){return function(){this.innerHTML=_}}function xJ(_){return function(){var Q=_.apply(this,arguments);this.innerHTML=Q==null?"":Q}}function S3(_){return arguments.length?this.each(_==null?bJ:(typeof _==="function"?xJ:EJ)(_)):this.node().innerHTML}function mJ(){if(this.nextSibling)this.parentNode.appendChild(this)}function v3(){return this.each(mJ)}function gJ(){if(this.previousSibling)this.parentNode.insertBefore(this,this.parentNode.firstChild)}function k3(){return this.each(gJ)}function pJ(_){return function(){var Q=this.ownerDocument,J=this.namespaceURI;return J===J4&&Q.documentElement.namespaceURI===J4?Q.createElement(_):Q.createElementNS(J,_)}}function cJ(_){return function(){return this.ownerDocument.createElementNS(_.space,_.local)}}function B5(_){var Q=u0(_);return(Q.local?cJ:pJ)(Q)}function y3(_){var Q=typeof _==="function"?_:B5(_);return this.select(function(){return this.appendChild(Q.apply(this,arguments))})}function lJ(){return null}function j3(_,Q){var J=typeof _==="function"?_:B5(_),q=Q==null?lJ:typeof Q==="function"?Q:Z2(Q);return this.select(function(){return this.insertBefore(J.apply(this,arguments),q.apply(this,arguments)||null)})}function iJ(){var _=this.parentNode;if(_)_.removeChild(this)}function V3(){return this.each(iJ)}function rJ(){var _=this.cloneNode(!1),Q=this.parentNode;return Q?Q.insertBefore(_,this.nextSibling):_}function dJ(){var _=this.cloneNode(!0),Q=this.parentNode;return Q?Q.insertBefore(_,this.nextSibling):_}function u3(_){return this.select(_?dJ:rJ)}function h3(_){return arguments.length?this.property("__data__",_):this.node().__data__}function aJ(_){return function(Q){_.call(this,Q,this.__data__)}}function sJ(_){return _.trim().split(/^|\s+/).map(function(Q){var J="",q=Q.indexOf(".");if(q>=0)J=Q.slice(q+1),Q=Q.slice(0,q);return{type:Q,name:J}})}function tJ(_){return function(){var Q=this.__on;if(!Q)return;for(var J=0,q=-1,U=Q.length,G;J<U;++J)if(G=Q[J],(!_.type||G.type===_.type)&&G.name===_.name)this.removeEventListener(G.type,G.listener,G.options);else Q[++q]=G;if(++q)Q.length=q;else delete this.__on}}function oJ(_,Q,J){return function(){var q=this.__on,U,G=aJ(Q);if(q){for(var Z=0,F=q.length;Z<F;++Z)if((U=q[Z]).type===_.type&&U.name===_.name){this.removeEventListener(U.type,U.listener,U.options),this.addEventListener(U.type,U.listener=G,U.options=J),U.value=Q;return}}if(this.addEventListener(_.type,G,J),U={type:_.type,name:_.name,value:Q,listener:G,options:J},!q)this.__on=[U];else q.push(U)}}function D3(_,Q,J){var q=sJ(_+""),U,G=q.length,Z;if(arguments.length<2){var F=this.node().__on;if(F){for(var X=0,Y=F.length,K;X<Y;++X)for(U=0,K=F[X];U<G;++U)if((Z=q[U]).type===K.type&&Z.name===K.name)return K.value}return}F=Q?oJ:tJ;for(U=0;U<G;++U)this.each(F(q[U],Q,J));return this}function j8(_,Q,J){var q=W5(_),U=q.CustomEvent;if(typeof U==="function")U=new U(Q,J);else if(U=q.document.createEvent("Event"),J)U.initEvent(Q,J.bubbles,J.cancelable),U.detail=J.detail;else U.initEvent(Q,!1,!1);_.dispatchEvent(U)}function nJ(_,Q){return function(){return j8(this,_,Q)}}function eJ(_,Q){return function(){return j8(this,_,Q.apply(this,arguments))}}function b3(_,Q){return this.each((typeof Q==="function"?eJ:nJ)(_,Q))}function*E3(){for(var _=this._groups,Q=0,J=_.length;Q<J;++Q)for(var q=_[Q],U=0,G=q.length,Z;U<G;++U)if(Z=q[U])yield Z}var x3=[null];function i1(_,Q){this._groups=_,this._parents=Q}function V8(){return new i1([[document.documentElement]],x3)}function _$(){return this}i1.prototype=V8.prototype={constructor:i1,select:J3,selectAll:q3,selectChild:U3,selectChildren:G3,filter:Z3,data:X3,enter:F3,exit:K3,join:Y3,merge:L3,selection:_$,order:z3,sort:W3,call:B3,nodes:A3,node:M3,size:T3,empty:R3,each:O3,attr:I3,style:w3,property:P3,classed:f3,text:C3,html:S3,raise:v3,lower:k3,append:y3,insert:j3,remove:V3,clone:u3,datum:h3,on:D3,dispatch:b3,[Symbol.iterator]:E3};var i0=V8;function o1(_){return typeof _==="string"?new i1([[document.querySelector(_)]],[document.documentElement]):new i1([[_]],x3)}var u8={passive:!1},O2={capture:!0,passive:!1};function $4(_){_.stopImmediatePropagation()}function r0(_){_.preventDefault(),_.stopImmediatePropagation()}function d2(_){var Q=_.document.documentElement,J=o1(_).on("dragstart.drag",r0,O2);if("onselectstart"in Q)J.on("selectstart.drag",r0,O2);else Q.__noselect=Q.style.MozUserSelect,Q.style.MozUserSelect="none"}function A5(_,Q){var J=_.document.documentElement,q=o1(_).on("dragstart.drag",null);if(Q)q.on("click.drag",r0,O2),setTimeout(function(){q.on("click.drag",null)},0);if("onselectstart"in J)q.on("selectstart.drag",null);else J.style.MozUserSelect=J.__noselect,delete J.__noselect}var M5=(_)=>()=>_;function T5(_,{sourceEvent:Q,subject:J,target:q,identifier:U,active:G,x:Z,y:F,dx:X,dy:Y,dispatch:K}){Object.defineProperties(this,{type:{value:_,enumerable:!0,configurable:!0},sourceEvent:{value:Q,enumerable:!0,configurable:!0},subject:{value:J,enumerable:!0,configurable:!0},target:{value:q,enumerable:!0,configurable:!0},identifier:{value:U,enumerable:!0,configurable:!0},active:{value:G,enumerable:!0,configurable:!0},x:{value:Z,enumerable:!0,configurable:!0},y:{value:F,enumerable:!0,configurable:!0},dx:{value:X,enumerable:!0,configurable:!0},dy:{value:Y,enumerable:!0,configurable:!0},_:{value:K}})}T5.prototype.on=function(){var _=this._.on.apply(this._,arguments);return _===this._?this:_};function Q$(_){return!_.ctrlKey&&!_.button}function J$(){return this.parentNode}function $$(_,Q){return Q==null?{x:_.x,y:_.y}:Q}function q$(){return navigator.maxTouchPoints||"ontouchstart"in this}function R5(){var _=Q$,Q=J$,J=$$,q=q$,U={},G=R2("start","drag","end"),Z=0,F,X,Y,K,H=0;function L(M){M.on("mousedown.drag",z).filter(q).on("touchstart.drag",R).on("touchmove.drag",A,u8).on("touchend.drag touchcancel.drag",O).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function z(M,P){if(K||!_.call(this,M,P))return;var C=B(this,Q.call(this,M,P),M,P,"mouse");if(!C)return;o1(M.view).on("mousemove.drag",W,O2).on("mouseup.drag",w,O2),d2(M.view),$4(M),Y=!1,F=M.clientX,X=M.clientY,C("start",M)}function W(M){if(r0(M),!Y){var P=M.clientX-F,C=M.clientY-X;Y=P*P+C*C>H}U.mouse("drag",M)}function w(M){o1(M.view).on("mousemove.drag mouseup.drag",null),A5(M.view,Y),r0(M),U.mouse("end",M)}function R(M,P){if(!_.call(this,M,P))return;var C=M.changedTouches,f=Q.call(this,M,P),v=C.length,N,k;for(N=0;N<v;++N)if(k=B(this,f,M,P,C[N].identifier,C[N]))$4(M),k("start",M,C[N])}function A(M){var P=M.changedTouches,C=P.length,f,v;for(f=0;f<C;++f)if(v=U[P[f].identifier])r0(M),v("drag",M,P[f])}function O(M){var P=M.changedTouches,C=P.length,f,v;if(K)clearTimeout(K);K=setTimeout(function(){K=null},500);for(f=0;f<C;++f)if(v=U[P[f].identifier])$4(M),v("end",M,P[f])}function B(M,P,C,f,v,N){var k=G.copy(),u=q0(N||C,P),i,l,S;if((S=J.call(M,new T5("beforestart",{sourceEvent:C,target:L,identifier:v,active:Z,x:u[0],y:u[1],dx:0,dy:0,dispatch:k}),f))==null)return;return i=S.x-u[0]||0,l=S.y-u[1]||0,function b(h,E,j){var m=u,I;switch(h){case"start":U[v]=b,I=Z++;break;case"end":delete U[v],--Z;case"drag":u=q0(j||E,P),I=Z;break}k.call(h,M,new T5(h,{sourceEvent:E,subject:S,target:L,identifier:v,active:I,x:u[0]+i,y:u[1]+l,dx:u[0]-m[0],dy:u[1]-m[1],dispatch:k}),f)}}return L.filter=function(M){return arguments.length?(_=typeof M==="function"?M:M5(!!M),L):_},L.container=function(M){return arguments.length?(Q=typeof M==="function"?M:M5(M),L):Q},L.subject=function(M){return arguments.length?(J=typeof M==="function"?M:M5(M),L):J},L.touchable=function(M){return arguments.length?(q=typeof M==="function"?M:M5(!!M),L):q},L.on=function(){var M=G.on.apply(G,arguments);return M===G?L:M},L.clickDistance=function(M){return arguments.length?(H=(M=+M)*M,L):Math.sqrt(H)},L}function O5(_,Q,J){_.prototype=Q.prototype=J,J.constructor=_}function m3(_,Q){var J=Object.create(_.prototype);for(var q in Q)J[q]=Q[q];return J}function P5(){}var I5=0.7,G4=1/I5,a2="\\s*([+-]?\\d+)\\s*",w5="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",h0="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",U$=/^#([0-9a-f]{3,8})$/,G$=new RegExp(`^rgb\\(${a2},${a2},${a2}\\)$`),Z$=new RegExp(`^rgb\\(${h0},${h0},${h0}\\)$`),F$=new RegExp(`^rgba\\(${a2},${a2},${a2},${w5}\\)$`),H$=new RegExp(`^rgba\\(${h0},${h0},${h0},${w5}\\)$`),X$=new RegExp(`^hsl\\(${w5},${h0},${h0}\\)$`),K$=new RegExp(`^hsla\\(${w5},${h0},${h0},${w5}\\)$`),h8={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};O5(P5,S0,{copy(_){return Object.assign(new this.constructor,this,_)},displayable(){return this.rgb().displayable()},hex:D8,formatHex:D8,formatHex8:Y$,formatHsl:L$,formatRgb:b8,toString:b8});function D8(){return this.rgb().formatHex()}function Y$(){return this.rgb().formatHex8()}function L$(){return c8(this).formatHsl()}function b8(){return this.rgb().formatRgb()}function S0(_){var Q,J;return _=(_+"").trim().toLowerCase(),(Q=U$.exec(_))?(J=Q[1].length,Q=parseInt(Q[1],16),J===6?E8(Q):J===3?new Y0(Q>>8&15|Q>>4&240,Q>>4&15|Q&240,(Q&15)<<4|Q&15,1):J===8?q4(Q>>24&255,Q>>16&255,Q>>8&255,(Q&255)/255):J===4?q4(Q>>12&15|Q>>8&240,Q>>8&15|Q>>4&240,Q>>4&15|Q&240,((Q&15)<<4|Q&15)/255):null):(Q=G$.exec(_))?new Y0(Q[1],Q[2],Q[3],1):(Q=Z$.exec(_))?new Y0(Q[1]*255/100,Q[2]*255/100,Q[3]*255/100,1):(Q=F$.exec(_))?q4(Q[1],Q[2],Q[3],Q[4]):(Q=H$.exec(_))?q4(Q[1]*255/100,Q[2]*255/100,Q[3]*255/100,Q[4]):(Q=X$.exec(_))?g8(Q[1],Q[2]/100,Q[3]/100,1):(Q=K$.exec(_))?g8(Q[1],Q[2]/100,Q[3]/100,Q[4]):h8.hasOwnProperty(_)?E8(h8[_]):_==="transparent"?new Y0(NaN,NaN,NaN,0):null}function E8(_){return new Y0(_>>16&255,_>>8&255,_&255,1)}function q4(_,Q,J,q){if(q<=0)_=Q=J=NaN;return new Y0(_,Q,J,q)}function z$(_){if(!(_ instanceof P5))_=S0(_);if(!_)return new Y0;return _=_.rgb(),new Y0(_.r,_.g,_.b,_.opacity)}function s2(_,Q,J,q){return arguments.length===1?z$(_):new Y0(_,Q,J,q==null?1:q)}function Y0(_,Q,J,q){this.r=+_,this.g=+Q,this.b=+J,this.opacity=+q}O5(Y0,s2,m3(P5,{brighter(_){return _=_==null?G4:Math.pow(G4,_),new Y0(this.r*_,this.g*_,this.b*_,this.opacity)},darker(_){return _=_==null?I5:Math.pow(I5,_),new Y0(this.r*_,this.g*_,this.b*_,this.opacity)},rgb(){return this},clamp(){return new Y0(w2(this.r),w2(this.g),w2(this.b),Z4(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:x8,formatHex:x8,formatHex8:W$,formatRgb:m8,toString:m8}));function x8(){return`#${I2(this.r)}${I2(this.g)}${I2(this.b)}`}function W$(){return`#${I2(this.r)}${I2(this.g)}${I2(this.b)}${I2((isNaN(this.opacity)?1:this.opacity)*255)}`}function m8(){let _=Z4(this.opacity);return`${_===1?"rgb(":"rgba("}${w2(this.r)}, ${w2(this.g)}, ${w2(this.b)}${_===1?")":`, ${_})`}`}function Z4(_){return isNaN(_)?1:Math.max(0,Math.min(1,_))}function w2(_){return Math.max(0,Math.min(255,Math.round(_)||0))}function I2(_){return _=w2(_),(_<16?"0":"")+_.toString(16)}function g8(_,Q,J,q){if(q<=0)_=Q=J=NaN;else if(J<=0||J>=1)_=Q=NaN;else if(Q<=0)_=NaN;return new C0(_,Q,J,q)}function c8(_){if(_ instanceof C0)return new C0(_.h,_.s,_.l,_.opacity);if(!(_ instanceof P5))_=S0(_);if(!_)return new C0;if(_ instanceof C0)return _;_=_.rgb();var Q=_.r/255,J=_.g/255,q=_.b/255,U=Math.min(Q,J,q),G=Math.max(Q,J,q),Z=NaN,F=G-U,X=(G+U)/2;if(F){if(Q===G)Z=(J-q)/F+(J<q)*6;else if(J===G)Z=(q-Q)/F+2;else Z=(Q-J)/F+4;F/=X<0.5?G+U:2-G-U,Z*=60}else F=X>0&&X<1?0:Z;return new C0(Z,F,X,_.opacity)}function l8(_,Q,J,q){return arguments.length===1?c8(_):new C0(_,Q,J,q==null?1:q)}function C0(_,Q,J,q){this.h=+_,this.s=+Q,this.l=+J,this.opacity=+q}O5(C0,l8,m3(P5,{brighter(_){return _=_==null?G4:Math.pow(G4,_),new C0(this.h,this.s,this.l*_,this.opacity)},darker(_){return _=_==null?I5:Math.pow(I5,_),new C0(this.h,this.s,this.l*_,this.opacity)},rgb(){var _=this.h%360+(this.h<0)*360,Q=isNaN(_)||isNaN(this.s)?0:this.s,J=this.l,q=J+(J<0.5?J:1-J)*Q,U=2*J-q;return new Y0(g3(_>=240?_-240:_+120,U,q),g3(_,U,q),g3(_<120?_+240:_-120,U,q),this.opacity)},clamp(){return new C0(p8(this.h),U4(this.s),U4(this.l),Z4(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 _=Z4(this.opacity);return`${_===1?"hsl(":"hsla("}${p8(this.h)}, ${U4(this.s)*100}%, ${U4(this.l)*100}%${_===1?")":`, ${_})`}`}}));function p8(_){return _=(_||0)%360,_<0?_+360:_}function U4(_){return Math.max(0,Math.min(1,_||0))}function g3(_,Q,J){return(_<60?Q+(J-Q)*_/60:_<180?J:_<240?Q+(J-Q)*(240-_)/60:Q)*255}function p3(_,Q,J,q,U){var G=_*_,Z=G*_;return((1-3*_+3*G-Z)*Q+(4-6*G+3*Z)*J+(1+3*_+3*G-3*Z)*q+Z*U)/6}function c3(_){var Q=_.length-1;return function(J){var q=J<=0?J=0:J>=1?(J=1,Q-1):Math.floor(J*Q),U=_[q],G=_[q+1],Z=q>0?_[q-1]:2*U-G,F=q<Q-1?_[q+2]:2*G-U;return p3((J-q/Q)*Q,Z,U,G,F)}}function l3(_){var Q=_.length;return function(J){var q=Math.floor(((J%=1)<0?++J:J)*Q),U=_[(q+Q-1)%Q],G=_[q%Q],Z=_[(q+1)%Q],F=_[(q+2)%Q];return p3((J-q/Q)*Q,U,G,Z,F)}}var N5=(_)=>()=>_;function B$(_,Q){return function(J){return _+J*Q}}function A$(_,Q,J){return _=Math.pow(_,J),Q=Math.pow(Q,J)-_,J=1/J,function(q){return Math.pow(_+q*Q,J)}}function i8(_){return(_=+_)===1?F4:function(Q,J){return J-Q?A$(Q,J,_):N5(isNaN(Q)?J:Q)}}function F4(_,Q){var J=Q-_;return J?B$(_,J):N5(isNaN(_)?Q:_)}var P2=function _(Q){var J=i8(Q);function q(U,G){var Z=J((U=s2(U)).r,(G=s2(G)).r),F=J(U.g,G.g),X=J(U.b,G.b),Y=F4(U.opacity,G.opacity);return function(K){return U.r=Z(K),U.g=F(K),U.b=X(K),U.opacity=Y(K),U+""}}return q.gamma=_,q}(1);function r8(_){return function(Q){var J=Q.length,q=Array(J),U=Array(J),G=Array(J),Z,F;for(Z=0;Z<J;++Z)F=s2(Q[Z]),q[Z]=F.r||0,U[Z]=F.g||0,G[Z]=F.b||0;return q=_(q),U=_(U),G=_(G),F.opacity=1,function(X){return F.r=q(X),F.g=U(X),F.b=G(X),F+""}}}var M$=r8(c3),T$=r8(l3);function i3(_,Q){if(!Q)Q=[];var J=_?Math.min(Q.length,_.length):0,q=Q.slice(),U;return function(G){for(U=0;U<J;++U)q[U]=_[U]*(1-G)+Q[U]*G;return q}}function d8(_){return ArrayBuffer.isView(_)&&!(_ instanceof DataView)}function a8(_,Q){var J=Q?Q.length:0,q=_?Math.min(J,_.length):0,U=Array(q),G=Array(J),Z;for(Z=0;Z<q;++Z)U[Z]=D0(_[Z],Q[Z]);for(;Z<J;++Z)G[Z]=Q[Z];return function(F){for(Z=0;Z<q;++Z)G[Z]=U[Z](F);return G}}function r3(_,Q){var J=new Date;return _=+_,Q=+Q,function(q){return J.setTime(_*(1-q)+Q*q),J}}function U0(_,Q){return _=+_,Q=+Q,function(J){return _*(1-J)+Q*J}}function d3(_,Q){var J={},q={},U;if(_===null||typeof _!=="object")_={};if(Q===null||typeof Q!=="object")Q={};for(U in Q)if(U in _)J[U]=D0(_[U],Q[U]);else q[U]=Q[U];return function(G){for(U in J)q[U]=J[U](G);return q}}var s3=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,a3=new RegExp(s3.source,"g");function R$(_){return function(){return _}}function O$(_){return function(Q){return _(Q)+""}}function t2(_,Q){var J=s3.lastIndex=a3.lastIndex=0,q,U,G,Z=-1,F=[],X=[];_=_+"",Q=Q+"";while((q=s3.exec(_))&&(U=a3.exec(Q))){if((G=U.index)>J)if(G=Q.slice(J,G),F[Z])F[Z]+=G;else F[++Z]=G;if((q=q[0])===(U=U[0]))if(F[Z])F[Z]+=U;else F[++Z]=U;else F[++Z]=null,X.push({i:Z,x:U0(q,U)});J=a3.lastIndex}if(J<Q.length)if(G=Q.slice(J),F[Z])F[Z]+=G;else F[++Z]=G;return F.length<2?X[0]?O$(X[0].x):R$(Q):(Q=X.length,function(Y){for(var K=0,H;K<Q;++K)F[(H=X[K]).i]=H.x(Y);return F.join("")})}function D0(_,Q){var J=typeof Q,q;return Q==null||J==="boolean"?N5(Q):(J==="number"?U0:J==="string"?(q=S0(Q))?(Q=q,P2):t2:Q instanceof S0?P2:Q instanceof Date?r3:d8(Q)?i3:Array.isArray(Q)?a8:typeof Q.valueOf!=="function"&&typeof Q.toString!=="function"||isNaN(Q)?d3:U0)(_,Q)}var s8=180/Math.PI,H4={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function X4(_,Q,J,q,U,G){var Z,F,X;if(Z=Math.sqrt(_*_+Q*Q))_/=Z,Q/=Z;if(X=_*J+Q*q)J-=_*X,q-=Q*X;if(F=Math.sqrt(J*J+q*q))J/=F,q/=F,X/=F;if(_*q<Q*J)_=-_,Q=-Q,X=-X,Z=-Z;return{translateX:U,translateY:G,rotate:Math.atan2(Q,_)*s8,skewX:Math.atan(X)*s8,scaleX:Z,scaleY:F}}var K4;function t8(_){let Q=new(typeof DOMMatrix==="function"?DOMMatrix:WebKitCSSMatrix)(_+"");return Q.isIdentity?H4:X4(Q.a,Q.b,Q.c,Q.d,Q.e,Q.f)}function o8(_){if(_==null)return H4;if(!K4)K4=document.createElementNS("http://www.w3.org/2000/svg","g");if(K4.setAttribute("transform",_),!(_=K4.transform.baseVal.consolidate()))return H4;return _=_.matrix,X4(_.a,_.b,_.c,_.d,_.e,_.f)}function n8(_,Q,J,q){function U(Y){return Y.length?Y.pop()+" ":""}function G(Y,K,H,L,z,W){if(Y!==H||K!==L){var w=z.push("translate(",null,Q,null,J);W.push({i:w-4,x:U0(Y,H)},{i:w-2,x:U0(K,L)})}else if(H||L)z.push("translate("+H+Q+L+J)}function Z(Y,K,H,L){if(Y!==K){if(Y-K>180)K+=360;else if(K-Y>180)Y+=360;L.push({i:H.push(U(H)+"rotate(",null,q)-2,x:U0(Y,K)})}else if(K)H.push(U(H)+"rotate("+K+q)}function F(Y,K,H,L){if(Y!==K)L.push({i:H.push(U(H)+"skewX(",null,q)-2,x:U0(Y,K)});else if(K)H.push(U(H)+"skewX("+K+q)}function X(Y,K,H,L,z,W){if(Y!==H||K!==L){var w=z.push(U(z)+"scale(",null,",",null,")");W.push({i:w-4,x:U0(Y,H)},{i:w-2,x:U0(K,L)})}else if(H!==1||L!==1)z.push(U(z)+"scale("+H+","+L+")")}return function(Y,K){var H=[],L=[];return Y=_(Y),K=_(K),G(Y.translateX,Y.translateY,K.translateX,K.translateY,H,L),Z(Y.rotate,K.rotate,H,L),F(Y.skewX,K.skewX,H,L),X(Y.scaleX,Y.scaleY,K.scaleX,K.scaleY,H,L),Y=K=null,function(z){var W=-1,w=L.length,R;while(++W<w)H[(R=L[W]).i]=R.x(z);return H.join("")}}}var t3=n8(t8,"px, ","px)","deg)"),o3=n8(o8,", ",")",")");var I$=0.000000000001;function e8(_){return((_=Math.exp(_))+1/_)/2}function w$(_){return((_=Math.exp(_))-1/_)/2}function P$(_){return((_=Math.exp(2*_))-1)/(_+1)}var N2=function _(Q,J,q){function U(G,Z){var F=G[0],X=G[1],Y=G[2],K=Z[0],H=Z[1],L=Z[2],z=K-F,W=H-X,w=z*z+W*W,R,A;if(w<I$)A=Math.log(L/Y)/Q,R=function(f){return[F+f*z,X+f*W,Y*Math.exp(Q*f*A)]};else{var O=Math.sqrt(w),B=(L*L-Y*Y+q*w)/(2*Y*J*O),M=(L*L-Y*Y-q*w)/(2*L*J*O),P=Math.log(Math.sqrt(B*B+1)-B),C=Math.log(Math.sqrt(M*M+1)-M);A=(C-P)/Q,R=function(f){var v=f*A,N=e8(P),k=Y/(J*O)*(N*P$(Q*v+P)-w$(P));return[F+k*z,X+k*W,Y*N/e8(Q*v+P)]}}return R.duration=A*1000*Q/Math.SQRT2,R}return U.rho=function(G){var Z=Math.max(0.001,+G),F=Z*Z,X=F*F;return _(Z,F,X)},U}(Math.SQRT2,2,4);var o2=0,C5=0,f5=0,Q7=1000,Y4,S5,L4=0,f2=0,z4=0,v5=typeof performance==="object"&&performance.now?performance:Date,J7=typeof window==="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(_){setTimeout(_,17)};function y5(){return f2||(J7(N$),f2=v5.now()+z4)}function N$(){f2=0}function k5(){this._call=this._time=this._next=null}k5.prototype=W4.prototype={constructor:k5,restart:function(_,Q,J){if(typeof _!=="function")throw TypeError("callback is not a function");if(J=(J==null?y5():+J)+(Q==null?0:+Q),!this._next&&S5!==this){if(S5)S5._next=this;else Y4=this;S5=this}this._call=_,this._time=J,n3()},stop:function(){if(this._call)this._call=null,this._time=1/0,n3()}};function W4(_,Q,J){var q=new k5;return q.restart(_,Q,J),q}function $7(){y5(),++o2;var _=Y4,Q;while(_){if((Q=f2-_._time)>=0)_._call.call(void 0,Q);_=_._next}--o2}function _7(){f2=(L4=v5.now())+z4,o2=C5=0;try{$7()}finally{o2=0,C$(),f2=0}}function f$(){var _=v5.now(),Q=_-L4;if(Q>Q7)z4-=Q,L4=_}function C$(){var _,Q=Y4,J,q=1/0;while(Q)if(Q._call){if(q>Q._time)q=Q._time;_=Q,Q=Q._next}else J=Q._next,Q._next=null,Q=_?_._next=J:Y4=J;S5=_,n3(q)}function n3(_){if(o2)return;if(C5)C5=clearTimeout(C5);var Q=_-f2;if(Q>24){if(_<1/0)C5=setTimeout(_7,_-v5.now()-z4);if(f5)f5=clearInterval(f5)}else{if(!f5)L4=v5.now(),f5=setInterval(f$,Q7);o2=1,J7(_7)}}function j5(_,Q,J){var q=new k5;return Q=Q==null?0:+Q,q.restart((U)=>{q.stop(),_(U+Q)},Q,J),q}var S$=R2("start","end","cancel","interrupt"),v$=[],G7=0,q7=1,A4=2,B4=3,U7=4,M4=5,V5=6;function d0(_,Q,J,q,U,G){var Z=_.__transition;if(!Z)_.__transition={};else if(J in Z)return;k$(_,J,{name:Q,index:q,group:U,on:S$,tween:v$,time:G.time,delay:G.delay,duration:G.duration,ease:G.ease,timer:null,state:G7})}function u5(_,Q){var J=n1(_,Q);if(J.state>G7)throw Error("too late; already scheduled");return J}function J0(_,Q){var J=n1(_,Q);if(J.state>B4)throw Error("too late; already running");return J}function n1(_,Q){var J=_.__transition;if(!J||!(J=J[Q]))throw Error("transition not found");return J}function k$(_,Q,J){var q=_.__transition,U;q[Q]=J,J.timer=W4(G,0,J.time);function G(Y){if(J.state=q7,J.timer.restart(Z,J.delay,J.time),J.delay<=Y)Z(Y-J.delay)}function Z(Y){var K,H,L,z;if(J.state!==q7)return X();for(K in q){if(z=q[K],z.name!==J.name)continue;if(z.state===B4)return j5(Z);if(z.state===U7)z.state=V5,z.timer.stop(),z.on.call("interrupt",_,_.__data__,z.index,z.group),delete q[K];else if(+K<Q)z.state=V5,z.timer.stop(),z.on.call("cancel",_,_.__data__,z.index,z.group),delete q[K]}if(j5(function(){if(J.state===B4)J.state=U7,J.timer.restart(F,J.delay,J.time),F(Y)}),J.state=A4,J.on.call("start",_,_.__data__,J.index,J.group),J.state!==A4)return;J.state=B4,U=Array(L=J.tween.length);for(K=0,H=-1;K<L;++K)if(z=J.tween[K].value.call(_,_.__data__,J.index,J.group))U[++H]=z;U.length=H+1}function F(Y){var K=Y<J.duration?J.ease.call(null,Y/J.duration):(J.timer.restart(X),J.state=M4,1),H=-1,L=U.length;while(++H<L)U[H].call(_,K);if(J.state===M4)J.on.call("end",_,_.__data__,J.index,J.group),X()}function X(){J.state=V5,J.timer.stop(),delete q[Q];for(var Y in q)return;delete _.__transition}}function H2(_,Q){var J=_.__transition,q,U,G=!0,Z;if(!J)return;Q=Q==null?null:Q+"";for(Z in J){if((q=J[Z]).name!==Q){G=!1;continue}U=q.state>A4&&q.state<M4,q.state=V5,q.timer.stop(),q.on.call(U?"interrupt":"cancel",_,_.__data__,q.index,q.group),delete J[Z]}if(G)delete _.__transition}function e3(_){return this.each(function(){H2(this,_)})}function y$(_,Q){var J,q;return function(){var U=J0(this,_),G=U.tween;if(G!==J){q=J=G;for(var Z=0,F=q.length;Z<F;++Z)if(q[Z].name===Q){q=q.slice(),q.splice(Z,1);break}}U.tween=q}}function j$(_,Q,J){var q,U;if(typeof J!=="function")throw Error();return function(){var G=J0(this,_),Z=G.tween;if(Z!==q){U=(q=Z).slice();for(var F={name:Q,value:J},X=0,Y=U.length;X<Y;++X)if(U[X].name===Q){U[X]=F;break}if(X===Y)U.push(F)}G.tween=U}}function _6(_,Q){var J=this._id;if(_+="",arguments.length<2){var q=n1(this.node(),J).tween;for(var U=0,G=q.length,Z;U<G;++U)if((Z=q[U]).name===_)return Z.value;return null}return this.each((Q==null?y$:j$)(J,_,Q))}function n2(_,Q,J){var q=_._id;return _.each(function(){var U=J0(this,q);(U.value||(U.value={}))[Q]=J.apply(this,arguments)}),function(U){return n1(U,q).value[Q]}}function h5(_,Q){var J;return(typeof Q==="number"?U0:Q instanceof S0?P2:(J=S0(Q))?(Q=J,P2):t2)(_,Q)}function V$(_){return function(){this.removeAttribute(_)}}function u$(_){return function(){this.removeAttributeNS(_.space,_.local)}}function h$(_,Q,J){var q,U=J+"",G;return function(){var Z=this.getAttribute(_);return Z===U?null:Z===q?G:G=Q(q=Z,J)}}function D$(_,Q,J){var q,U=J+"",G;return function(){var Z=this.getAttributeNS(_.space,_.local);return Z===U?null:Z===q?G:G=Q(q=Z,J)}}function b$(_,Q,J){var q,U,G;return function(){var Z,F=J(this),X;if(F==null)return void this.removeAttribute(_);return Z=this.getAttribute(_),X=F+"",Z===X?null:Z===q&&X===U?G:(U=X,G=Q(q=Z,F))}}function E$(_,Q,J){var q,U,G;return function(){var Z,F=J(this),X;if(F==null)return void this.removeAttributeNS(_.space,_.local);return Z=this.getAttributeNS(_.space,_.local),X=F+"",Z===X?null:Z===q&&X===U?G:(U=X,G=Q(q=Z,F))}}function Q6(_,Q){var J=u0(_),q=J==="transform"?o3:h5;return this.attrTween(_,typeof Q==="function"?(J.local?E$:b$)(J,q,n2(this,"attr."+_,Q)):Q==null?(J.local?u$:V$)(J):(J.local?D$:h$)(J,q,Q))}function x$(_,Q){return function(J){this.setAttribute(_,Q.call(this,J))}}function m$(_,Q){return function(J){this.setAttributeNS(_.space,_.local,Q.call(this,J))}}function g$(_,Q){var J,q;function U(){var G=Q.apply(this,arguments);if(G!==q)J=(q=G)&&m$(_,G);return J}return U._value=Q,U}function p$(_,Q){var J,q;function U(){var G=Q.apply(this,arguments);if(G!==q)J=(q=G)&&x$(_,G);return J}return U._value=Q,U}function J6(_,Q){var J="attr."+_;if(arguments.length<2)return(J=this.tween(J))&&J._value;if(Q==null)return this.tween(J,null);if(typeof Q!=="function")throw Error();var q=u0(_);return this.tween(J,(q.local?g$:p$)(q,Q))}function c$(_,Q){return function(){u5(this,_).delay=+Q.apply(this,arguments)}}function l$(_,Q){return Q=+Q,function(){u5(this,_).delay=Q}}function $6(_){var Q=this._id;return arguments.length?this.each((typeof _==="function"?c$:l$)(Q,_)):n1(this.node(),Q).delay}function i$(_,Q){return function(){J0(this,_).duration=+Q.apply(this,arguments)}}function r$(_,Q){return Q=+Q,function(){J0(this,_).duration=Q}}function q6(_){var Q=this._id;return arguments.length?this.each((typeof _==="function"?i$:r$)(Q,_)):n1(this.node(),Q).duration}function d$(_,Q){if(typeof Q!=="function")throw Error();return function(){J0(this,_).ease=Q}}function U6(_){var Q=this._id;return arguments.length?this.each(d$(Q,_)):n1(this.node(),Q).ease}function a$(_,Q){return function(){var J=Q.apply(this,arguments);if(typeof J!=="function")throw Error();J0(this,_).ease=J}}function G6(_){if(typeof _!=="function")throw Error();return this.each(a$(this._id,_))}function Z6(_){if(typeof _!=="function")_=i2(_);for(var Q=this._groups,J=Q.length,q=Array(J),U=0;U<J;++U)for(var G=Q[U],Z=G.length,F=q[U]=[],X,Y=0;Y<Z;++Y)if((X=G[Y])&&_.call(X,X.__data__,Y,G))F.push(X);return new H0(q,this._parents,this._name,this._id)}function F6(_){if(_._id!==this._id)throw Error();for(var Q=this._groups,J=_._groups,q=Q.length,U=J.length,G=Math.min(q,U),Z=Array(q),F=0;F<G;++F)for(var X=Q[F],Y=J[F],K=X.length,H=Z[F]=Array(K),L,z=0;z<K;++z)if(L=X[z]||Y[z])H[z]=L;for(;F<q;++F)Z[F]=Q[F];return new H0(Z,this._parents,this._name,this._id)}function s$(_){return(_+"").trim().split(/^|\s+/).every(function(Q){var J=Q.indexOf(".");if(J>=0)Q=Q.slice(0,J);return!Q||Q==="start"})}function t$(_,Q,J){var q,U,G=s$(Q)?u5:J0;return function(){var Z=G(this,_),F=Z.on;if(F!==q)(U=(q=F).copy()).on(Q,J);Z.on=U}}function H6(_,Q){var J=this._id;return arguments.length<2?n1(this.node(),J).on.on(_):this.each(t$(J,_,Q))}function o$(_){return function(){var Q=this.parentNode;for(var J in this.__transition)if(+J!==_)return;if(Q)Q.removeChild(this)}}function X6(){return this.on("end.remove",o$(this._id))}function K6(_){var Q=this._name,J=this._id;if(typeof _!=="function")_=Z2(_);for(var q=this._groups,U=q.length,G=Array(U),Z=0;Z<U;++Z)for(var F=q[Z],X=F.length,Y=G[Z]=Array(X),K,H,L=0;L<X;++L)if((K=F[L])&&(H=_.call(K,K.__data__,L,F))){if("__data__"in K)H.__data__=K.__data__;Y[L]=H,d0(Y[L],Q,J,L,Y,n1(K,J))}return new H0(G,this._parents,Q,J)}function Y6(_){var Q=this._name,J=this._id;if(typeof _!=="function")_=r2(_);for(var q=this._groups,U=q.length,G=[],Z=[],F=0;F<U;++F)for(var X=q[F],Y=X.length,K,H=0;H<Y;++H)if(K=X[H]){for(var L=_.call(K,K.__data__,H,X),z,W=n1(K,J),w=0,R=L.length;w<R;++w)if(z=L[w])d0(z,Q,J,w,L,W);G.push(L),Z.push(K)}return new H0(G,Z,Q,J)}var n$=i0.prototype.constructor;function L6(){return new n$(this._groups,this._parents)}function e$(_,Q){var J,q,U;return function(){var G=F2(this,_),Z=(this.style.removeProperty(_),F2(this,_));return G===Z?null:G===J&&Z===q?U:U=Q(J=G,q=Z)}}function Z7(_){return function(){this.style.removeProperty(_)}}function _q(_,Q,J){var q,U=J+"",G;return function(){var Z=F2(this,_);return Z===U?null:Z===q?G:G=Q(q=Z,J)}}function Qq(_,Q,J){var q,U,G;return function(){var Z=F2(this,_),F=J(this),X=F+"";if(F==null)X=F=(this.style.removeProperty(_),F2(this,_));return Z===X?null:Z===q&&X===U?G:(U=X,G=Q(q=Z,F))}}function Jq(_,Q){var J,q,U,G="style."+Q,Z="end."+G,F;return function(){var X=J0(this,_),Y=X.on,K=X.value[G]==null?F||(F=Z7(Q)):void 0;if(Y!==J||U!==K)(q=(J=Y).copy()).on(Z,U=K);X.on=q}}function z6(_,Q,J){var q=(_+="")==="transform"?t3:h5;return Q==null?this.styleTween(_,e$(_,q)).on("end.style."+_,Z7(_)):typeof Q==="function"?this.styleTween(_,Qq(_,q,n2(this,"style."+_,Q))).each(Jq(this._id,_)):this.styleTween(_,_q(_,q,Q),J).on("end.style."+_,null)}function $q(_,Q,J){return function(q){this.style.setProperty(_,Q.call(this,q),J)}}function qq(_,Q,J){var q,U;function G(){var Z=Q.apply(this,arguments);if(Z!==U)q=(U=Z)&&$q(_,Z,J);return q}return G._value=Q,G}function W6(_,Q,J){var q="style."+(_+="");if(arguments.length<2)return(q=this.tween(q))&&q._value;if(Q==null)return this.tween(q,null);if(typeof Q!=="function")throw Error();return this.tween(q,qq(_,Q,J==null?"":J))}function Uq(_){return function(){this.textContent=_}}function Gq(_){return function(){var Q=_(this);this.textContent=Q==null?"":Q}}function B6(_){return this.tween("text",typeof _==="function"?Gq(n2(this,"text",_)):Uq(_==null?"":_+""))}function Zq(_){return function(Q){this.textContent=_.call(this,Q)}}function Fq(_){var Q,J;function q(){var U=_.apply(this,arguments);if(U!==J)Q=(J=U)&&Zq(U);return Q}return q._value=_,q}function A6(_){var Q="text";if(arguments.length<1)return(Q=this.tween(Q))&&Q._value;if(_==null)return this.tween(Q,null);if(typeof _!=="function")throw Error();return this.tween(Q,Fq(_))}function M6(){var _=this._name,Q=this._id,J=T4();for(var q=this._groups,U=q.length,G=0;G<U;++G)for(var Z=q[G],F=Z.length,X,Y=0;Y<F;++Y)if(X=Z[Y]){var K=n1(X,Q);d0(X,_,J,Y,Z,{time:K.time+K.delay+K.duration,delay:0,duration:K.duration,ease:K.ease})}return new H0(q,this._parents,_,J)}function T6(){var _,Q,J=this,q=J._id,U=J.size();return new Promise(function(G,Z){var F={value:Z},X={value:function(){if(--U===0)G()}};if(J.each(function(){var Y=J0(this,q),K=Y.on;if(K!==_)Q=(_=K).copy(),Q._.cancel.push(F),Q._.interrupt.push(F),Q._.end.push(X);Y.on=Q}),U===0)G()})}var Hq=0;function H0(_,Q,J,q){this._groups=_,this._parents=Q,this._name=J,this._id=q}function F7(_){return i0().transition(_)}function T4(){return++Hq}var a0=i0.prototype;H0.prototype=F7.prototype={constructor:H0,select:K6,selectAll:Y6,selectChild:a0.selectChild,selectChildren:a0.selectChildren,filter:Z6,merge:F6,selection:L6,transition:M6,call:a0.call,nodes:a0.nodes,node:a0.node,size:a0.size,empty:a0.empty,each:a0.each,on:H6,attr:Q6,attrTween:J6,style:z6,styleTween:W6,text:B6,textTween:A6,remove:X6,tween:_6,delay:$6,duration:q6,ease:U6,easeVarying:G6,end:T6,[Symbol.iterator]:a0[Symbol.iterator]};function R4(_){return((_*=2)<=1?_*_*_:(_-=2)*_*_+2)/2}var Xq={time:null,delay:0,duration:250,ease:R4};function Kq(_,Q){var J;while(!(J=_.__transition)||!(J=J[Q]))if(!(_=_.parentNode))throw Error(`transition ${Q} not found`);return J}function R6(_){var Q,J;if(_ instanceof H0)Q=_._id,_=_._name;else Q=T4(),(J=Xq).time=y5(),_=_==null?null:_+"";for(var q=this._groups,U=q.length,G=0;G<U;++G)for(var Z=q[G],F=Z.length,X,Y=0;Y<F;++Y)if(X=Z[Y])d0(X,_,Q,Y,Z,J||Kq(X,Q));return new H0(q,this._parents,_,Q)}i0.prototype.interrupt=e3;i0.prototype.transition=R6;var D5=(_)=>()=>_;function O6(_,{sourceEvent:Q,target:J,transform:q,dispatch:U}){Object.defineProperties(this,{type:{value:_,enumerable:!0,configurable:!0},sourceEvent:{value:Q,enumerable:!0,configurable:!0},target:{value:J,enumerable:!0,configurable:!0},transform:{value:q,enumerable:!0,configurable:!0},_:{value:U}})}function v0(_,Q,J){this.k=_,this.x=Q,this.y=J}v0.prototype={constructor:v0,scale:function(_){return _===1?this:new v0(this.k*_,this.x,this.y)},translate:function(_,Q){return _===0&Q===0?this:new v0(this.k,this.x+this.k*_,this.y+this.k*Q)},apply:function(_){return[_[0]*this.k+this.x,_[1]*this.k+this.y]},applyX:function(_){return _*this.k+this.x},applyY:function(_){return _*this.k+this.y},invert:function(_){return[(_[0]-this.x)/this.k,(_[1]-this.y)/this.k]},invertX:function(_){return(_-this.x)/this.k},invertY:function(_){return(_-this.y)/this.k},rescaleX:function(_){return _.copy().domain(_.range().map(this.invertX,this).map(_.invert,_))},rescaleY:function(_){return _.copy().domain(_.range().map(this.invertY,this).map(_.invert,_))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var C2=new v0(1,0,0);b5.prototype=v0.prototype;function b5(_){while(!_.__zoom)if(!(_=_.parentNode))return C2;return _.__zoom}function O4(_){_.stopImmediatePropagation()}function S2(_){_.preventDefault(),_.stopImmediatePropagation()}function Yq(_){return(!_.ctrlKey||_.type==="wheel")&&!_.button}function Lq(){var _=this;if(_ instanceof SVGElement){if(_=_.ownerSVGElement||_,_.hasAttribute("viewBox"))return _=_.viewBox.baseVal,[[_.x,_.y],[_.x+_.width,_.y+_.height]];return[[0,0],[_.width.baseVal.value,_.height.baseVal.value]]}return[[0,0],[_.clientWidth,_.clientHeight]]}function H7(){return this.__zoom||C2}function zq(_){return-_.deltaY*(_.deltaMode===1?0.05:_.deltaMode?1:0.002)*(_.ctrlKey?10:1)}function Wq(){return navigator.maxTouchPoints||"ontouchstart"in this}function Bq(_,Q,J){var q=_.invertX(Q[0][0])-J[0][0],U=_.invertX(Q[1][0])-J[1][0],G=_.invertY(Q[0][1])-J[0][1],Z=_.invertY(Q[1][1])-J[1][1];return _.translate(U>q?(q+U)/2:Math.min(0,q)||Math.max(0,U),Z>G?(G+Z)/2:Math.min(0,G)||Math.max(0,Z))}function E5(){var _=Yq,Q=Lq,J=Bq,q=zq,U=Wq,G=[0,1/0],Z=[[-1/0,-1/0],[1/0,1/0]],F=250,X=N2,Y=R2("start","zoom","end"),K,H,L,z=500,W=150,w=0,R=10;function A(S){S.property("__zoom",H7).on("wheel.zoom",v,{passive:!1}).on("mousedown.zoom",N).on("dblclick.zoom",k).filter(U).on("touchstart.zoom",u).on("touchmove.zoom",i).on("touchend.zoom touchcancel.zoom",l).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}A.transform=function(S,b,h,E){var j=S.selection?S.selection():S;if(j.property("__zoom",H7),S!==j)P(S,b,h,E);else j.interrupt().each(function(){C(this,arguments).event(E).start().zoom(null,typeof b==="function"?b.apply(this,arguments):b).end()})},A.scaleBy=function(S,b,h,E){A.scaleTo(S,function(){var j=this.__zoom.k,m=typeof b==="function"?b.apply(this,arguments):b;return j*m},h,E)},A.scaleTo=function(S,b,h,E){A.transform(S,function(){var j=Q.apply(this,arguments),m=this.__zoom,I=h==null?M(j):typeof h==="function"?h.apply(this,arguments):h,V=m.invert(I),D=typeof b==="function"?b.apply(this,arguments):b;return J(B(O(m,D),I,V),j,Z)},h,E)},A.translateBy=function(S,b,h,E){A.transform(S,function(){return J(this.__zoom.translate(typeof b==="function"?b.apply(this,arguments):b,typeof h==="function"?h.apply(this,arguments):h),Q.apply(this,arguments),Z)},null,E)},A.translateTo=function(S,b,h,E,j){A.transform(S,function(){var m=Q.apply(this,arguments),I=this.__zoom,V=E==null?M(m):typeof E==="function"?E.apply(this,arguments):E;return J(C2.translate(V[0],V[1]).scale(I.k).translate(typeof b==="function"?-b.apply(this,arguments):-b,typeof h==="function"?-h.apply(this,arguments):-h),m,Z)},E,j)};function O(S,b){return b=Math.max(G[0],Math.min(G[1],b)),b===S.k?S:new v0(b,S.x,S.y)}function B(S,b,h){var E=b[0]-h[0]*S.k,j=b[1]-h[1]*S.k;return E===S.x&&j===S.y?S:new v0(S.k,E,j)}function M(S){return[(+S[0][0]+ +S[1][0])/2,(+S[0][1]+ +S[1][1])/2]}function P(S,b,h,E){S.on("start.zoom",function(){C(this,arguments).event(E).start()}).on("interrupt.zoom end.zoom",function(){C(this,arguments).event(E).end()}).tween("zoom",function(){var j=this,m=arguments,I=C(j,m).event(E),V=Q.apply(j,m),D=h==null?M(V):typeof h==="function"?h.apply(j,m):h,y=Math.max(V[1][0]-V[0][0],V[1][1]-V[0][1]),t=j.__zoom,_1=typeof b==="function"?b.apply(j,m):b,s=X(t.invert(D).concat(y/t.k),_1.invert(D).concat(y/_1.k));return function(o){if(o===1)o=_1;else{var p=s(o),e=y/p[2];o=new v0(e,D[0]-p[0]*e,D[1]-p[1]*e)}I.zoom(null,o)}})}function C(S,b,h){return!h&&S.__zooming||new f(S,b)}function f(S,b){this.that=S,this.args=b,this.active=0,this.sourceEvent=null,this.extent=Q.apply(S,b),this.taps=0}f.prototype={event:function(S){if(S)this.sourceEvent=S;return this},start:function(){if(++this.active===1)this.that.__zooming=this,this.emit("start");return this},zoom:function(S,b){if(this.mouse&&S!=="mouse")this.mouse[1]=b.invert(this.mouse[0]);if(this.touch0&&S!=="touch")this.touch0[1]=b.invert(this.touch0[0]);if(this.touch1&&S!=="touch")this.touch1[1]=b.invert(this.touch1[0]);return this.that.__zoom=b,this.emit("zoom"),this},end:function(){if(--this.active===0)delete this.that.__zooming,this.emit("end");return this},emit:function(S){var b=o1(this.that).datum();Y.call(S,this.that,new O6(S,{sourceEvent:this.sourceEvent,target:A,type:S,transform:this.that.__zoom,dispatch:Y}),b)}};function v(S,...b){if(!_.apply(this,arguments))return;var h=C(this,b).event(S),E=this.__zoom,j=Math.max(G[0],Math.min(G[1],E.k*Math.pow(2,q.apply(this,arguments)))),m=q0(S);if(h.wheel){if(h.mouse[0][0]!==m[0]||h.mouse[0][1]!==m[1])h.mouse[1]=E.invert(h.mouse[0]=m);clearTimeout(h.wheel)}else if(E.k===j)return;else h.mouse=[m,E.invert(m)],H2(this),h.start();S2(S),h.wheel=setTimeout(I,W),h.zoom("mouse",J(B(O(E,j),h.mouse[0],h.mouse[1]),h.extent,Z));function I(){h.wheel=null,h.end()}}function N(S,...b){if(L||!_.apply(this,arguments))return;var h=S.currentTarget,E=C(this,b,!0).event(S),j=o1(S.view).on("mousemove.zoom",D,!0).on("mouseup.zoom",y,!0),m=q0(S,h),I=S.clientX,V=S.clientY;d2(S.view),O4(S),E.mouse=[m,this.__zoom.invert(m)],H2(this),E.start();function D(t){if(S2(t),!E.moved){var _1=t.clientX-I,s=t.clientY-V;E.moved=_1*_1+s*s>w}E.event(t).zoom("mouse",J(B(E.that.__zoom,E.mouse[0]=q0(t,h),E.mouse[1]),E.extent,Z))}function y(t){j.on("mousemove.zoom mouseup.zoom",null),A5(t.view,E.moved),S2(t),E.event(t).end()}}function k(S,...b){if(!_.apply(this,arguments))return;var h=this.__zoom,E=q0(S.changedTouches?S.changedTouches[0]:S,this),j=h.invert(E),m=h.k*(S.shiftKey?0.5:2),I=J(B(O(h,m),E,j),Q.apply(this,b),Z);if(S2(S),F>0)o1(this).transition().duration(F).call(P,I,E,S);else o1(this).call(A.transform,I,E,S)}function u(S,...b){if(!_.apply(this,arguments))return;var h=S.touches,E=h.length,j=C(this,b,S.changedTouches.length===E).event(S),m,I,V,D;O4(S);for(I=0;I<E;++I)if(V=h[I],D=q0(V,this),D=[D,this.__zoom.invert(D),V.identifier],!j.touch0)j.touch0=D,m=!0,j.taps=1+!!K;else if(!j.touch1&&j.touch0[2]!==D[2])j.touch1=D,j.taps=0;if(K)K=clearTimeout(K);if(m){if(j.taps<2)H=D[0],K=setTimeout(function(){K=null},z);H2(this),j.start()}}function i(S,...b){if(!this.__zooming)return;var h=C(this,b).event(S),E=S.changedTouches,j=E.length,m,I,V,D;S2(S);for(m=0;m<j;++m)if(I=E[m],V=q0(I,this),h.touch0&&h.touch0[2]===I.identifier)h.touch0[0]=V;else if(h.touch1&&h.touch1[2]===I.identifier)h.touch1[0]=V;if(I=h.that.__zoom,h.touch1){var y=h.touch0[0],t=h.touch0[1],_1=h.touch1[0],s=h.touch1[1],o=(o=_1[0]-y[0])*o+(o=_1[1]-y[1])*o,p=(p=s[0]-t[0])*p+(p=s[1]-t[1])*p;I=O(I,Math.sqrt(o/p)),V=[(y[0]+_1[0])/2,(y[1]+_1[1])/2],D=[(t[0]+s[0])/2,(t[1]+s[1])/2]}else if(h.touch0)V=h.touch0[0],D=h.touch0[1];else return;h.zoom("touch",J(B(I,V,D),h.extent,Z))}function l(S,...b){if(!this.__zooming)return;var h=C(this,b).event(S),E=S.changedTouches,j=E.length,m,I;if(O4(S),L)clearTimeout(L);L=setTimeout(function(){L=null},z);for(m=0;m<j;++m)if(I=E[m],h.touch0&&h.touch0[2]===I.identifier)delete h.touch0;else if(h.touch1&&h.touch1[2]===I.identifier)delete h.touch1;if(h.touch1&&!h.touch0)h.touch0=h.touch1,delete h.touch1;if(h.touch0)h.touch0[1]=this.__zoom.invert(h.touch0[0]);else if(h.end(),h.taps===2){if(I=q0(I,this),Math.hypot(H[0]-I[0],H[1]-I[1])<R){var V=o1(this).on("dblclick.zoom");if(V)V.apply(this,arguments)}}}return A.wheelDelta=function(S){return arguments.length?(q=typeof S==="function"?S:D5(+S),A):q},A.filter=function(S){return arguments.length?(_=typeof S==="function"?S:D5(!!S),A):_},A.touchable=function(S){return arguments.length?(U=typeof S==="function"?S:D5(!!S),A):U},A.extent=function(S){return arguments.length?(Q=typeof S==="function"?S:D5([[+S[0][0],+S[0][1]],[+S[1][0],+S[1][1]]]),A):Q},A.scaleExtent=function(S){return arguments.length?(G[0]=+S[0],G[1]=+S[1],A):[G[0],G[1]]},A.translateExtent=function(S){return arguments.length?(Z[0][0]=+S[0][0],Z[1][0]=+S[1][0],Z[0][1]=+S[0][1],Z[1][1]=+S[1][1],A):[[Z[0][0],Z[0][1]],[Z[1][0],Z[1][1]]]},A.constrain=function(S){return arguments.length?(J=S,A):J},A.duration=function(S){return arguments.length?(F=+S,A):F},A.interpolate=function(S){return arguments.length?(X=S,A):X},A.on=function(){var S=Y.on.apply(Y,arguments);return S===Y?A:S},A.clickDistance=function(S){return arguments.length?(w=(S=+S)*S,A):Math.sqrt(w)},A.tapDistance=function(S){return arguments.length?(R=+S,A):R},A}var X0={error001:(_="react")=>`Seems like you have not used ${_==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${_}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:(_)=>`Node type "${_}" 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:(_)=>`The old edge with id=${_} does not exist.`,error009:(_)=>`Marker type "${_}" doesn't exist.`,error008:(_,{id:Q,sourceHandle:J,targetHandle:q})=>`Couldn't create edge for ${_} handle id: "${_==="source"?J:q}", edge id: ${Q}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:(_)=>`Edge type "${_}" not found. Using fallback type "default".`,error012:(_)=>`Node with id "${_}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(_="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${_}/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:(_)=>`Edge with id "${_}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},J5=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],f6=["Enter"," ","Escape"],C6={"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:_,x:Q,y:J})=>`Moved selected node ${_}. New position, x: ${Q}, y: ${J}`,"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"},L2;(function(_){_.Strict="strict",_.Loose="loose"})(L2||(L2={}));var s0;(function(_){_.Free="free",_.Vertical="vertical",_.Horizontal="horizontal"})(s0||(s0={}));var v2;(function(_){_.Partial="partial",_.Full="full"})(v2||(v2={}));var S6={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},b0;(function(_){_.Bezier="default",_.Straight="straight",_.Step="step",_.SmoothStep="smoothstep",_.SimpleBezier="simplebezier"})(b0||(b0={}));var _5;(function(_){_.Arrow="arrow",_.ArrowClosed="arrowclosed"})(_5||(_5={}));var F1;(function(_){_.Left="left",_.Top="top",_.Right="right",_.Bottom="bottom"})(F1||(F1={}));var X7={[F1.Left]:F1.Right,[F1.Right]:F1.Left,[F1.Top]:F1.Bottom,[F1.Bottom]:F1.Top},v6=(_)=>!!_&&typeof _==="object"&&("id"in _)&&("source"in _)&&("target"in _),P7=(_)=>!!_&&typeof _==="object"&&("id"in _)&&("position"in _)&&!("source"in _)&&!("target"in _),k6=(_)=>!!_&&typeof _==="object"&&("id"in _)&&("internals"in _)&&!("source"in _)&&!("target"in _);var m5=(_,Q=[0,0])=>{let{width:J,height:q}=I0(_),U=_.origin??Q,G=J*U[0],Z=q*U[1];return{x:_.position.x-G,y:_.position.y-Z}},y6=(_,Q={nodeOrigin:[0,0]})=>{if(!Q.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(_.length===0)return{x:0,y:0,width:0,height:0};let J=!1,q=_.reduce((U,G)=>{let Z=typeof G==="string",F=!Q.nodeLookup&&!Z?G:void 0;if(Q.nodeLookup)F=Z?Q.nodeLookup.get(G):!k6(G)?Q.nodeLookup.get(G.id):G;if(!F)return U;return J=!0,C4(U,P4(F,Q.nodeOrigin))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return J?S4(q):{x:0,y:0,width:0,height:0}},V2=(_,Q={})=>{let J={x:1/0,y:1/0,x2:-1/0,y2:-1/0},q=!1;return _.forEach((U)=>{if(Q.filter===void 0||Q.filter(U))J=C4(J,P4(U)),q=!0}),q?S4(J):{x:0,y:0,width:0,height:0}},N4=(_,Q,[J,q,U]=[0,0,1],G=!1,Z=!1)=>{let F=(Q.x-J)/U,X=(Q.y-q)/U,Y=Q.width/U,K=Q.height/U,H=[];for(let L of _.values()){let{measured:z,selectable:W=!0,hidden:w=!1}=L;if(Z&&!W||w)continue;let R=z.width??L.width??L.initialWidth??0,A=z.height??L.height??L.initialHeight??0,{x:O,y:B}=L.internals.positionAbsolute,M=v7(F,X,Y,K,O,B,R,A),P=R*A,C=G&&M>0;if(!L.internals.handleBounds||C||M>=P||L.dragging)H.push(L)}return H},N7=(_,Q)=>{let J=new Set;return _.forEach((q)=>{J.add(q.id)}),Q.filter((q)=>J.has(q.source)||J.has(q.target))};function Aq(_,Q){let J=new Map,q=Q?.nodes?new Set(Q.nodes.map((U)=>U.id)):null;return _.forEach((U)=>{let G;if(Q?.includeHiddenNodes){let{width:Z,height:F}=I0(U);G=Z>0&&F>0}else G=Boolean(U.measured.width&&U.measured.height&&!U.hidden);if(G&&(!q||q.has(U.id)))J.set(U.id,U)}),J}async function f7({nodes:_,width:Q,height:J,panZoom:q,minZoom:U,maxZoom:G},Z){if(_.size===0)return!0;let F=Aq(_,Z),X=V2(F),Y=p5(X,Q,J,Z?.minZoom??U,Z?.maxZoom??G,Z?.padding??0.1);return await q.setViewport(Y,{duration:Z?.duration,ease:Z?.ease,interpolate:Z?.interpolate}),!0}function j6({nodeId:_,nextPosition:Q,nodeLookup:J,nodeOrigin:q=[0,0],nodeExtent:U,onError:G}){let Z=J.get(_),F=Z.parentId?J.get(Z.parentId):void 0,{x:X,y:Y}=F?F.internals.positionAbsolute:{x:0,y:0},K=Z.origin??q,H=Z.extent||U;if(Z.extent==="parent"&&!Z.expandParent)if(!F)G?.("005",X0.error005());else{let{width:z,height:W}=I0(F);if(z&&W)H=[[X,Y],[X+z,Y+W]]}else if(F&&j2(Z.extent))H=[[Z.extent[0][0]+X,Z.extent[0][1]+Y],[Z.extent[1][0]+X,Z.extent[1][1]+Y]];let L=j2(H)?k2(Q,H,Z.measured):Q;if(Z.measured.width===void 0||Z.measured.height===void 0)G?.("015",X0.error015());return{position:{x:L.x-X+(Z.measured.width??0)*K[0],y:L.y-Y+(Z.measured.height??0)*K[1]},positionAbsolute:L}}async function C7({nodesToRemove:_=[],edgesToRemove:Q=[],nodes:J,edges:q,onBeforeDelete:U}){let G=new Set(_.map((L)=>L.id)),Z=[];for(let L of J){if(L.deletable===!1)continue;let z=G.has(L.id),W=!z&&L.parentId&&Z.find((w)=>w.id===L.parentId);if(z||W)Z.push(L)}let F=new Set(Q.map((L)=>L.id)),X=q.filter((L)=>L.deletable!==!1),K=N7(Z,X);for(let L of X)if(F.has(L.id)&&!K.find((W)=>W.id===L.id))K.push(L);if(!U)return{edges:K,nodes:Z};let H=await U({nodes:Z,edges:K});if(typeof H==="boolean")return H?{edges:K,nodes:Z}:{edges:[],nodes:[]};return H}var Q5=(_,Q=0,J=1)=>Math.min(Math.max(_,Q),J),k2=(_={x:0,y:0},Q,J)=>({x:Q5(_.x,Q[0][0],Q[1][0]-(J?.width??0)),y:Q5(_.y,Q[0][1],Q[1][1]-(J?.height??0))});function S7(_,Q,J){let{width:q,height:U}=I0(J),{x:G,y:Z}=J.internals.positionAbsolute;return k2(_,[[G,Z],[G+q,Z+U]],Q)}var K7=(_,Q,J)=>{if(_<Q)return Q5(Math.abs(_-Q),1,Q)/Q;else if(_>J)return-Q5(Math.abs(_-J),1,Q)/Q;return 0},f4=(_,Q,J=15,q=40)=>{let U=K7(_.x,q,Q.width-q)*J,G=K7(_.y,q,Q.height-q)*J;return[U,G]},C4=(_,Q)=>({x:Math.min(_.x,Q.x),y:Math.min(_.y,Q.y),x2:Math.max(_.x2,Q.x2),y2:Math.max(_.y2,Q.y2)}),N6=({x:_,y:Q,width:J,height:q})=>({x:_,y:Q,x2:_+J,y2:Q+q}),S4=({x:_,y:Q,x2:J,y2:q})=>({x:_,y:Q,width:J-_,height:q-Q}),$5=(_,Q=[0,0])=>{let{x:J,y:q}=k6(_)?_.internals.positionAbsolute:m5(_,Q);return{x:J,y:q,width:_.measured?.width??_.width??_.initialWidth??0,height:_.measured?.height??_.height??_.initialHeight??0}},P4=(_,Q=[0,0])=>{let{x:J,y:q}=k6(_)?_.internals.positionAbsolute:m5(_,Q);return{x:J,y:q,x2:J+(_.measured?.width??_.width??_.initialWidth??0),y2:q+(_.measured?.height??_.height??_.initialHeight??0)}},V6=(_,Q)=>S4(C4(N6(_),N6(Q))),v7=(_,Q,J,q,U,G,Z,F)=>{let X=Math.max(0,Math.min(_+J,U+Z)-Math.max(_,U)),Y=Math.max(0,Math.min(Q+q,G+F)-Math.max(Q,G));return Math.ceil(X*Y)},g5=(_,Q)=>v7(_.x,_.y,_.width,_.height,Q.x,Q.y,Q.width,Q.height),u6=(_)=>R0(_.width)&&R0(_.height)&&R0(_.x)&&R0(_.y),R0=(_)=>!isNaN(_)&&isFinite(_),h6=(_,Q)=>(J,q)=>{console.warn(`[${_}]: ${q} Help: ${Q}error#${J}`)},q5=(_,Q=[1,1])=>{return{x:Q[0]*Math.round(_.x/Q[0]),y:Q[1]*Math.round(_.y/Q[1])}},U5=({x:_,y:Q},[J,q,U],G=!1,Z=[1,1])=>{let F={x:(_-J)/U,y:(Q-q)/U};return G?q5(F,Z):F},y2=({x:_,y:Q},[J,q,U])=>{return{x:_*U+J,y:Q*U+q}};function e2(_,Q){if(typeof _==="number")return Math.floor((Q-Q/(1+_))*0.5);if(typeof _==="string"&&_.endsWith("px")){let J=parseFloat(_);if(!Number.isNaN(J))return Math.floor(J)}if(typeof _==="string"&&_.endsWith("%")){let J=parseFloat(_);if(!Number.isNaN(J))return Math.floor(Q*J*0.01)}return console.error(`The padding value "${_}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Mq(_,Q,J){if(typeof _==="string"||typeof _==="number"){let q=e2(_,J),U=e2(_,Q);return{top:q,right:U,bottom:q,left:U,x:U*2,y:q*2}}if(typeof _==="object"){let q=e2(_.top??_.y??0,J),U=e2(_.bottom??_.y??0,J),G=e2(_.left??_.x??0,Q),Z=e2(_.right??_.x??0,Q);return{top:q,right:Z,bottom:U,left:G,x:G+Z,y:q+U}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Tq(_,Q,J,q,U,G){let{x:Z,y:F}=y2(_,[Q,J,q]),{x:X,y:Y}=y2({x:_.x+_.width,y:_.y+_.height},[Q,J,q]),K=U-X,H=G-Y;return{left:Math.floor(Z),top:Math.floor(F),right:Math.floor(K),bottom:Math.floor(H)}}var p5=(_,Q,J,q,U,G)=>{let Z=Mq(G,Q,J),F=(Q-Z.x)/_.width,X=(J-Z.y)/_.height,Y=Math.min(F,X),K=Q5(Y,q,U),H=_.x+_.width/2,L=_.y+_.height/2,z=Q/2-H*K,W=J/2-L*K,w=Tq(_,z,W,K,Q,J),R={left:Math.min(w.left-Z.left,0),top:Math.min(w.top-Z.top,0),right:Math.min(w.right-Z.right,0),bottom:Math.min(w.bottom-Z.bottom,0)};return{x:z-R.left+R.right,y:W-R.top+R.bottom,zoom:K}},G5=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function j2(_){return _!==void 0&&_!==null&&_!=="parent"}function I0(_){return{width:_.measured?.width??_.width??_.initialWidth??0,height:_.measured?.height??_.height??_.initialHeight??0}}function D6(_){return(_.measured?.width??_.width??_.initialWidth)!==void 0&&(_.measured?.height??_.height??_.initialHeight)!==void 0}function b6(_,Q={width:0,height:0},J,q,U){let G={..._},Z=q.get(J);if(Z){let F=Z.origin||U;G.x+=Z.internals.positionAbsolute.x-(Q.width??0)*F[0],G.y+=Z.internals.positionAbsolute.y-(Q.height??0)*F[1]}return G}function E6(_,Q){if(_.size!==Q.size)return!1;for(let J of _)if(!Q.has(J))return!1;return!0}function k7(){let _,Q;return{promise:new Promise((q,U)=>{_=q,Q=U}),resolve:_,reject:Q}}function y7(_){return{...C6,..._||{}}}function Rq(_){if(typeof document>"u")return!0;let Q=document.querySelector(`.${_}-flow__pane`);if(!Q||!Q.isConnected)return!0;let J=getComputedStyle(Q);if(J.display==="none")return!0;if(J.visibility==="hidden"||J.visibility==="collapse")return!0;if(J.opacity==="0")return!0;if(J.width==="0"&&J.height==="0")return!0;let q=Q.getBoundingClientRect();if(q.width===0&&q.height===0)return!0;let U=document.querySelector(`.${_}-flow__attribution`);if(!U||!U.isConnected)return!1;let G=getComputedStyle(U);if(G.display==="none")return!1;if(G.visibility==="hidden"||G.visibility==="collapse")return!1;if(G.opacity==="0")return!1;let Z=U.getBoundingClientRect();if(Z.width===0&&Z.height===0)return!1;return!0}var Y7=!1;function j7(_){if(Y7)return;Y7=!0;let Q=`${_.charAt(0).toUpperCase()+_.slice(1)} Flow`;setTimeout(()=>{if(!Rq(_))console.warn(`${Q}: It seems like you are hiding the attribution. Please only do this when you are subscribed to ${Q} Pro: https://${_}flow.dev/remove-attr
28
- %cYou can ignore this warning if you are subscribed.`,"font-style: italic;")},1000)}function x6(_){return _===null?null:_?"valid":"invalid"}function x5(_,{snapGrid:Q=[0,0],snapToGrid:J=!1,transform:q,containerBounds:U}){let{x:G,y:Z}=O0(_),F=U5({x:G-(U?.left??0),y:Z-(U?.top??0)},q),{x:X,y:Y}=J?q5(F,Q):F;return{xSnapped:X,ySnapped:Y,...F}}var v4=(_)=>({width:_.offsetWidth,height:_.offsetHeight}),m6=(_)=>_?.getRootNode?.()||window?.document,Oq=["INPUT","SELECT","TEXTAREA"];function g6(_){let Q=_.composedPath?.()?.[0]||_.target;if(Q?.nodeType!==1)return!1;return Oq.includes(Q.nodeName)||Q.hasAttribute("contenteditable")||!!Q.closest(".nokey")}var p6=(_)=>("clientX"in _),O0=(_,Q)=>{let J=p6(_),q=J?_.clientX:_.touches?.[0].clientX,U=J?_.clientY:_.touches?.[0].clientY;return{x:q-(Q?.left??0),y:U-(Q?.top??0)}},L7=(_,Q,J,q,U)=>{let G=Q.querySelectorAll(`.${_}`);if(!G||!G.length)return null;return Array.from(G).map((Z)=>{let F=Z.getBoundingClientRect();return{id:Z.getAttribute("data-handleid"),type:_,nodeId:U,position:Z.getAttribute("data-handlepos"),x:(F.left-J.left)/q,y:(F.top-J.top)/q,...v4(Z)}})};function k4({sourceX:_,sourceY:Q,targetX:J,targetY:q,sourceControlX:U,sourceControlY:G,targetControlX:Z,targetControlY:F}){let X=_*0.125+U*0.375+Z*0.375+J*0.125,Y=Q*0.125+G*0.375+F*0.375+q*0.125,K=Math.abs(X-_),H=Math.abs(Y-Q);return[X,Y,K,H]}function I4(_,Q){if(_>=0)return 0.5*_;return Q*25*Math.sqrt(-_)}function z7({pos:_,x1:Q,y1:J,x2:q,y2:U,c:G}){switch(_){case F1.Left:return[Q-I4(Q-q,G),J];case F1.Right:return[Q+I4(q-Q,G),J];case F1.Top:return[Q,J-I4(J-U,G)];case F1.Bottom:return[Q,J+I4(U-J,G)]}}function y4({sourceX:_,sourceY:Q,sourcePosition:J=F1.Bottom,targetX:q,targetY:U,targetPosition:G=F1.Top,curvature:Z=0.25}){let[F,X]=z7({pos:J,x1:_,y1:Q,x2:q,y2:U,c:Z}),[Y,K]=z7({pos:G,x1:q,y1:U,x2:_,y2:Q,c:Z}),[H,L,z,W]=k4({sourceX:_,sourceY:Q,targetX:q,targetY:U,sourceControlX:F,sourceControlY:X,targetControlX:Y,targetControlY:K});return[`M${_},${Q} C${F},${X} ${Y},${K} ${q},${U}`,H,L,z,W]}function c6({sourceX:_,sourceY:Q,targetX:J,targetY:q}){let U=Math.abs(J-_)/2,G=J<_?J+U:J-U,Z=Math.abs(q-Q)/2,F=q<Q?q+Z:q-Z;return[G,F,U,Z]}function V7({sourceNode:_,targetNode:Q,selected:J=!1,zIndex:q=0,elevateOnSelect:U=!1,zIndexMode:G="basic"}){if(G==="manual")return q;let Z=U&&J?q+1000:q,F=Math.max(_.parentId||U&&_.selected?_.internals.z:0,Q.parentId||U&&Q.selected?Q.internals.z:0);return Z+F}function u7({sourceNode:_,targetNode:Q,width:J,height:q,transform:U}){let G=C4(P4(_),P4(Q));if(G.x===G.x2)G.x2+=1;if(G.y===G.y2)G.y2+=1;let Z={x:-U[0]/U[2],y:-U[1]/U[2],width:J/U[2],height:q/U[2]};return g5(Z,S4(G))>0}var Iq=({source:_,sourceHandle:Q,target:J,targetHandle:q})=>`xy-edge__${_}${Q||""}-${J}${q||""}`,wq=(_,Q)=>{return Q.some((J)=>J.source===_.source&&J.target===_.target&&(J.sourceHandle===_.sourceHandle||!J.sourceHandle&&!_.sourceHandle)&&(J.targetHandle===_.targetHandle||!J.targetHandle&&!_.targetHandle))},h7=(_,Q,J={})=>{if(!_.source||!_.target)return J.onError?.("006",X0.error006()),Q;let q=J.getEdgeId||Iq,U;if(v6(_))U={..._};else U={..._,id:q(_)};if(wq(U,Q))return Q;if(U.sourceHandle===null)delete U.sourceHandle;if(U.targetHandle===null)delete U.targetHandle;return Q.concat(U)};function j4({sourceX:_,sourceY:Q,targetX:J,targetY:q}){let[U,G,Z,F]=c6({sourceX:_,sourceY:Q,targetX:J,targetY:q});return[`M ${_},${Q}L ${J},${q}`,U,G,Z,F]}var W7={[F1.Left]:{x:-1,y:0},[F1.Right]:{x:1,y:0},[F1.Top]:{x:0,y:-1},[F1.Bottom]:{x:0,y:1}},Pq=({source:_,sourcePosition:Q=F1.Bottom,target:J})=>{if(Q===F1.Left||Q===F1.Right)return _.x<J.x?{x:1,y:0}:{x:-1,y:0};return _.y<J.y?{x:0,y:1}:{x:0,y:-1}},B7=(_,Q)=>Math.sqrt(Math.pow(Q.x-_.x,2)+Math.pow(Q.y-_.y,2));function Nq({source:_,sourcePosition:Q=F1.Bottom,target:J,targetPosition:q=F1.Top,center:U,offset:G,stepPosition:Z}){let F=W7[Q],X=W7[q],Y={x:_.x+F.x*G,y:_.y+F.y*G},K={x:J.x+X.x*G,y:J.y+X.y*G},H=Pq({source:Y,sourcePosition:Q,target:K}),L=H.x!==0?"x":"y",z=H[L],W=[],w,R,A={x:0,y:0},O={x:0,y:0},[,,B,M]=c6({sourceX:_.x,sourceY:_.y,targetX:J.x,targetY:J.y});if(F[L]*X[L]===-1){if(L==="x")w=U.x??Y.x+(K.x-Y.x)*Z,R=U.y??(Y.y+K.y)/2;else w=U.x??(Y.x+K.x)/2,R=U.y??Y.y+(K.y-Y.y)*Z;let v=[{x:w,y:Y.y},{x:w,y:K.y}],N=[{x:Y.x,y:R},{x:K.x,y:R}];if(F[L]===z)W=L==="x"?v:N;else W=L==="x"?N:v}else{let v=[{x:Y.x,y:K.y}],N=[{x:K.x,y:Y.y}];if(L==="x")W=F.x===z?N:v;else W=F.y===z?v:N;if(Q===q){let S=Math.abs(_[L]-J[L]);if(S<=G){let b=Math.min(G-1,G-S);if(F[L]===z)A[L]=(Y[L]>_[L]?-1:1)*b;else O[L]=(K[L]>J[L]?-1:1)*b}}if(Q!==q){let S=L==="x"?"y":"x",b=F[L]===X[S],h=Y[S]>K[S],E=Y[S]<K[S];if(F[L]===1&&(!b&&h||b&&E)||F[L]!==1&&(!b&&E||b&&h))W=L==="x"?v:N}let k={x:Y.x+A.x,y:Y.y+A.y},u={x:K.x+O.x,y:K.y+O.y},i=Math.max(Math.abs(k.x-W[0].x),Math.abs(u.x-W[0].x)),l=Math.max(Math.abs(k.y-W[0].y),Math.abs(u.y-W[0].y));if(i>=l)w=(k.x+u.x)/2,R=W[0].y;else w=W[0].x,R=(k.y+u.y)/2}let P={x:Y.x+A.x,y:Y.y+A.y},C={x:K.x+O.x,y:K.y+O.y};return[[_,...P.x!==W[0].x||P.y!==W[0].y?[P]:[],...W,...C.x!==W[W.length-1].x||C.y!==W[W.length-1].y?[C]:[],J],w,R,B,M]}function fq(_,Q,J,q){let U=Math.min(B7(_,Q)/2,B7(Q,J)/2,q),{x:G,y:Z}=Q;if(_.x===G&&G===J.x||_.y===Z&&Z===J.y)return`L${G} ${Z}`;if(_.y===Z){let Y=_.x<J.x?-1:1,K=_.y<J.y?1:-1;return`L ${G+U*Y},${Z}Q ${G},${Z} ${G},${Z+U*K}`}let F=_.x<J.x?1:-1,X=_.y<J.y?-1:1;return`L ${G},${Z+U*X}Q ${G},${Z} ${G+U*F},${Z}`}function c5({sourceX:_,sourceY:Q,sourcePosition:J=F1.Bottom,targetX:q,targetY:U,targetPosition:G=F1.Top,borderRadius:Z=5,centerX:F,centerY:X,offset:Y=20,stepPosition:K=0.5}){let[H,L,z,W,w]=Nq({source:{x:_,y:Q},sourcePosition:J,target:{x:q,y:U},targetPosition:G,center:{x:F,y:X},offset:Y,stepPosition:K}),R=`M${H[0].x} ${H[0].y}`;for(let A=1;A<H.length-1;A++)R+=fq(H[A-1],H[A],H[A+1],Z);return R+=`L${H[H.length-1].x} ${H[H.length-1].y}`,[R,L,z,W,w]}function A7(_){return _&&!!(_.internals.handleBounds||_.handles?.length)&&!!(_.measured.width||_.width||_.initialWidth)}function D7(_){let{sourceNode:Q,targetNode:J}=_;if(!A7(Q)||!A7(J))return null;let q=Q.internals.handleBounds||M7(Q.handles),U=J.internals.handleBounds||M7(J.handles),G=T7(q?.source??[],_.sourceHandle),Z=T7(_.connectionMode===L2.Strict?U?.target??[]:(U?.target??[]).concat(U?.source??[]),_.targetHandle);if(!G||!Z)return _.onError?.("008",X0.error008(!G?"source":"target",{id:_.id,sourceHandle:_.sourceHandle,targetHandle:_.targetHandle})),null;let F=G?.position||F1.Bottom,X=Z?.position||F1.Top,Y=z2(Q,G,F),K=z2(J,Z,X);return{sourceX:Y.x,sourceY:Y.y,targetX:K.x,targetY:K.y,sourcePosition:F,targetPosition:X}}function M7(_){if(!_)return null;let Q=[],J=[];for(let q of _)if(q.width=q.width??1,q.height=q.height??1,q.type==="source")Q.push(q);else if(q.type==="target")J.push(q);return{source:Q,target:J}}function z2(_,Q,J=F1.Left,q=!1){let U=(Q?.x??0)+_.internals.positionAbsolute.x,G=(Q?.y??0)+_.internals.positionAbsolute.y,{width:Z,height:F}=Q??I0(_);if(q)return{x:U+Z/2,y:G+F/2};switch(Q?.position??J){case F1.Top:return{x:U+Z/2,y:G};case F1.Right:return{x:U+Z,y:G+F/2};case F1.Bottom:return{x:U+Z/2,y:G+F};case F1.Left:return{x:U,y:G+F/2}}}function T7(_,Q){if(!_)return null;return(!Q?_[0]:_.find((J)=>J.id===Q))||null}function V4(_,Q){if(!_)return"";if(typeof _==="string")return _;return`${Q?`${Q}__`:""}${Object.keys(_).sort().map((q)=>`${q}=${_[q]}`).join("&")}`}function b7(_,{id:Q,defaultColor:J,defaultMarkerStart:q,defaultMarkerEnd:U}){let G=new Set;return _.reduce((Z,F)=>{return[F.markerStart||q,F.markerEnd||U].forEach((X)=>{if(X&&typeof X==="object"){let Y=V4(X,Q);if(!G.has(Y))Z.push({id:Y,color:X.color||J,...X}),G.add(Y)}}),Z},[]).sort((Z,F)=>Z.id.localeCompare(F.id))}function E7(_,Q,J,q,U){let G=0.5;if(U==="start")G=0;else if(U==="end")G=1;let Z=[(_.x+_.width*G)*Q.zoom+Q.x,_.y*Q.zoom+Q.y-q],F=[-100*G,-100];switch(J){case F1.Right:Z=[(_.x+_.width)*Q.zoom+Q.x+q,(_.y+_.height*G)*Q.zoom+Q.y],F=[0,-100*G];break;case F1.Bottom:Z[1]=(_.y+_.height)*Q.zoom+Q.y+q,F[1]=0;break;case F1.Left:Z=[_.x*Q.zoom+Q.x-q,(_.y+_.height*G)*Q.zoom+Q.y],F=[-100,-100*G];break}return`translate(${Z[0]}px, ${Z[1]}px) translate(${F[0]}%, ${F[1]}%)`}var x7=1000,Cq=10,l6={nodeOrigin:[0,0],nodeExtent:J5,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},Sq={...l6,checkEquality:!0};function i6(_,Q){let J={..._};for(let q in Q)if(Q[q]!==void 0)J[q]=Q[q];return J}function m7(_,Q,J){let q=i6(l6,J);for(let U of _.values())if(U.parentId)d6(U,_,Q,q);else{let G=m5(U,q.nodeOrigin),Z=j2(U.extent)?U.extent:q.nodeExtent,F=k2(G,Z,I0(U));U.internals.positionAbsolute=F}}function vq(_,Q){if(!_.handles)return!_.measured?void 0:Q?.internals.handleBounds;let J=[],q=[];for(let U of _.handles){let G={id:U.id,width:U.width??1,height:U.height??1,nodeId:_.id,x:U.x,y:U.y,position:U.position,type:U.type};if(U.type==="source")J.push(G);else if(U.type==="target")q.push(G)}return{source:J,target:q}}function r6(_){return _==="manual"}function u4(_,Q,J,q={}){let U=i6(Sq,q),G={i:0},Z=new Map(Q),F=U?.elevateNodesOnSelect&&!r6(U.zIndexMode)?x7:0,X=_.length>0,Y=!1;Q.clear(),J.clear();for(let K of _){let H=Z.get(K.id);if(U.checkEquality&&K===H?.internals.userNode)Q.set(K.id,H);else{let L=m5(K,U.nodeOrigin),z=j2(K.extent)?K.extent:U.nodeExtent,W=k2(L,z,I0(K));H={...U.defaults,...K,measured:{width:K.measured?.width,height:K.measured?.height},internals:{positionAbsolute:W,handleBounds:vq(K,H),z:g7(K,F,U.zIndexMode),userNode:K}},Q.set(K.id,H)}if((H.measured===void 0||H.measured.width===void 0||H.measured.height===void 0)&&!H.hidden)X=!1;if(K.parentId)d6(H,Q,J,q,G);Y||=K.selected??!1}return{nodesInitialized:X,hasSelectedNodes:Y}}function kq(_,Q){if(!_.parentId)return;let J=Q.get(_.parentId);if(J)J.set(_.id,_);else Q.set(_.parentId,new Map([[_.id,_]]))}function d6(_,Q,J,q,U){let{elevateNodesOnSelect:G,nodeOrigin:Z,nodeExtent:F,zIndexMode:X}=i6(l6,q),Y=_.parentId,K=Q.get(Y);if(!K){console.warn(`Parent node ${Y} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}if(kq(_,J),U&&!K.parentId&&K.internals.rootParentIndex===void 0&&X==="auto")K.internals.rootParentIndex=++U.i,K.internals.z=K.internals.z+U.i*Cq;if(U&&K.internals.rootParentIndex!==void 0)U.i=K.internals.rootParentIndex;let H=G&&!r6(X)?x7:0,{x:L,y:z,z:W}=yq(_,K,Z,F,H,X),{positionAbsolute:w}=_.internals,R=L!==w.x||z!==w.y;if(R||W!==_.internals.z)Q.set(_.id,{..._,internals:{..._.internals,positionAbsolute:R?{x:L,y:z}:w,z:W}})}function g7(_,Q,J){let q=R0(_.zIndex)?_.zIndex:0;if(r6(J))return q;return q+(_.selected?Q:0)}function yq(_,Q,J,q,U,G){let{x:Z,y:F}=Q.internals.positionAbsolute,X=I0(_),Y=m5(_,J),K=j2(_.extent)?k2(Y,_.extent,X):Y,H=k2({x:Z+K.x,y:F+K.y},q,X);if(_.extent==="parent")H=S7(H,X,Q);let L=g7(_,U,G),z=Q.internals.z??0;return{x:H.x,y:H.y,z:z>=L?z+1:L}}function h4(_,Q,J,q=[0,0]){let U=[],G=new Map;for(let Z of _){let F=Q.get(Z.parentId);if(!F)continue;let X=G.get(Z.parentId)?.expandedRect??$5(F),Y=V6(X,Z.rect);G.set(Z.parentId,{expandedRect:Y,parent:F})}if(G.size>0)G.forEach(({expandedRect:Z,parent:F},X)=>{let Y=F.internals.positionAbsolute,K=I0(F),H=F.origin??q,L=Z.x<Y.x?Math.round(Math.abs(Y.x-Z.x)):0,z=Z.y<Y.y?Math.round(Math.abs(Y.y-Z.y)):0,W=Math.max(K.width,Math.round(Z.width)),w=Math.max(K.height,Math.round(Z.height)),R=(W-K.width)*H[0],A=(w-K.height)*H[1];if(L>0||z>0||R||A)U.push({id:X,type:"position",position:{x:F.position.x-L+R,y:F.position.y-z+A}}),J.get(X)?.forEach((O)=>{if(!_.some((B)=>B.id===O.id))U.push({id:O.id,type:"position",position:{x:O.position.x+L,y:O.position.y+z}})});if(K.width<Z.width||K.height<Z.height||L||z)U.push({id:X,type:"dimensions",setAttributes:!0,dimensions:{width:W+(L?H[0]*L-R:0),height:w+(z?H[1]*z-A:0)}})});return U}function p7(_,Q,J,q,U,G,Z){let F=q?.querySelector(".xyflow__viewport"),X=!1;if(!F)return{changes:[],updatedInternals:X};let Y=[],K=window.getComputedStyle(F),{m22:H}=new window.DOMMatrixReadOnly(K.transform),L=[];for(let z of _.values()){let W=Q.get(z.id);if(!W)continue;if(W.hidden){Q.set(W.id,{...W,internals:{...W.internals,handleBounds:void 0}}),X=!0;continue}let w=v4(z.nodeElement),R=W.measured.width!==w.width||W.measured.height!==w.height;if(!!(w.width&&w.height&&(R||!W.internals.handleBounds||z.force))){let O=z.nodeElement.getBoundingClientRect(),B=j2(W.extent)?W.extent:G,{positionAbsolute:M}=W.internals;if(W.parentId&&W.extent==="parent"){let C=Q.get(W.parentId);if(C)M=S7(M,w,C)}else if(B)M=k2(M,B,w);let P={...W,measured:w,internals:{...W.internals,positionAbsolute:M,handleBounds:{source:L7("source",z.nodeElement,O,H,W.id),target:L7("target",z.nodeElement,O,H,W.id)}}};if(Q.set(W.id,P),W.parentId)d6(P,Q,J,{nodeOrigin:U,zIndexMode:Z});if(X=!0,R){if(Y.push({id:W.id,type:"dimensions",dimensions:w}),W.expandParent&&W.parentId)L.push({id:W.id,parentId:W.parentId,rect:$5(P,U)})}}}if(L.length>0){let z=h4(L,Q,J,U);Y.push(...z)}return{changes:Y,updatedInternals:X}}async function c7({delta:_,panZoom:Q,transform:J,translateExtent:q,width:U,height:G}){if(!Q||!_.x&&!_.y)return!1;let Z=await Q.setViewportConstrained({x:J[0]+_.x,y:J[1]+_.y,zoom:J[2]},[[0,0],[U,G]],q);return!!Z&&(Z.x!==J[0]||Z.y!==J[1]||Z.k!==J[2])}function R7(_,Q,J,q,U,G){let Z=U,F=q.get(Z)||new Map;q.set(Z,F.set(J,Q)),Z=`${U}-${_}`;let X=q.get(Z)||new Map;if(q.set(Z,X.set(J,Q)),G){Z=`${U}-${_}-${G}`;let Y=q.get(Z)||new Map;q.set(Z,Y.set(J,Q))}}function a6(_,Q,J){_.clear(),Q.clear();for(let q of J){let{source:U,target:G,sourceHandle:Z=null,targetHandle:F=null}=q,X={edgeId:q.id,source:U,target:G,sourceHandle:Z,targetHandle:F},Y=`${U}-${Z}--${G}-${F}`,K=`${G}-${F}--${U}-${Z}`;R7("source",X,K,_,U,Z),R7("target",X,Y,_,G,F),Q.set(q.id,q)}}function l7(_,Q){if(!_.parentId)return!1;let J=Q.get(_.parentId);if(!J)return!1;if(J.selected)return!0;return l7(J,Q)}function O7(_,Q,J){let q=_;do{if(q?.matches?.(Q))return!0;if(q===J)return!1;q=q?.parentElement}while(q);return!1}function jq(_,Q,J,q){let U=new Map;for(let[G,Z]of _)if((Z.selected||Z.id===q)&&(!Z.parentId||!l7(Z,_))&&(Z.draggable||Q&&typeof Z.draggable>"u")){let F=_.get(G);if(F)U.set(G,{id:G,position:F.position||{x:0,y:0},distance:{x:J.x-F.internals.positionAbsolute.x,y:J.y-F.internals.positionAbsolute.y},extent:F.extent,parentId:F.parentId,origin:F.origin,expandParent:F.expandParent,internals:{positionAbsolute:F.internals.positionAbsolute||{x:0,y:0}},measured:{width:F.measured.width??0,height:F.measured.height??0}})}return U}function I6({nodeId:_,dragItems:Q,nodeLookup:J,dragging:q=!0}){let U=[];for(let[Z,F]of Q){let X=J.get(Z)?.internals.userNode;if(X)U.push({...X,position:F.position,dragging:q})}if(!_)return[U[0],U];let G=J.get(_)?.internals.userNode;return[!G?U[0]:{...G,position:Q.get(_)?.position||G.position,dragging:q},U]}function Vq({dragItems:_,snapGrid:Q,x:J,y:q}){let U=_.values().next().value;if(!U)return null;let G={x:J-U.distance.x,y:q-U.distance.y},Z=q5(G,Q);return{x:Z.x-G.x,y:Z.y-G.y}}function i7({onNodeMouseDown:_,getStoreItems:Q,onDragStart:J,onDrag:q,onDragStop:U}){let G={x:null,y:null},Z=0,F=new Map,X=!1,Y={x:0,y:0},K=null,H=!1,L=null,z=!1,W=!1,w=null;function R({noDragClassName:O,handleSelector:B,domNode:M,isSelectable:P,nodeId:C,nodeClickDistance:f=0}){L=o1(M);function v({x:i,y:l}){let{nodeLookup:S,nodeExtent:b,snapGrid:h,snapToGrid:E,nodeOrigin:j,onNodeDrag:m,onSelectionDrag:I,onError:V,updateNodePositions:D}=Q();G={x:i,y:l};let y=!1,t=F.size>1,_1=t&&b?N6(V2(F)):null,s=t&&E?Vq({dragItems:F,snapGrid:h,x:i,y:l}):null;for(let[o,p]of F){if(!S.has(o))continue;let e={x:i-p.distance.x,y:l-p.distance.y};if(E)e=s?{x:Math.round(e.x+s.x),y:Math.round(e.y+s.y)}:q5(e,h);let q1=null;if(t&&b&&!p.extent&&_1){let{positionAbsolute:K1}=p.internals,W1=K1.x-_1.x+b[0][0],Y1=K1.x+p.measured.width-_1.x2+b[1][0],n=K1.y-_1.y+b[0][1],I1=K1.y+p.measured.height-_1.y2+b[1][1];q1=[[W1,n],[Y1,I1]]}let{position:G1,positionAbsolute:U1}=j6({nodeId:o,nextPosition:e,nodeLookup:S,nodeExtent:q1?q1:b,nodeOrigin:j,onError:V});y=y||p.position.x!==G1.x||p.position.y!==G1.y,p.position=G1,p.internals.positionAbsolute=U1}if(W=W||y,!y)return;if(D(F,!0),w&&(q||m||!C&&I)){let[o,p]=I6({nodeId:C,dragItems:F,nodeLookup:S});if(q?.(w,F,o,p),m?.(w,o,p),!C)I?.(w,p)}}async function N(){if(!K)return;let{transform:i,panBy:l,autoPanSpeed:S,autoPanOnNodeDrag:b}=Q();if(!b){X=!1,cancelAnimationFrame(Z);return}let[h,E]=f4(Y,K,S);if(h!==0||E!==0){if(G.x=(G.x??0)-h/i[2],G.y=(G.y??0)-E/i[2],await l({x:h,y:E}))v(G)}Z=requestAnimationFrame(N)}function k(i){let{nodeLookup:l,multiSelectionActive:S,nodesDraggable:b,transform:h,snapGrid:E,snapToGrid:j,selectNodesOnDrag:m,onNodeDragStart:I,onSelectionDragStart:V,unselectNodesAndEdges:D}=Q();if(H=!0,(!m||!P)&&!S&&C){if(!l.get(C)?.selected)D()}if(P&&m&&C)_?.(C);let y=x5(i.sourceEvent,{transform:h,snapGrid:E,snapToGrid:j,containerBounds:K});if(G=y,F=jq(l,b,y,C),F.size>0&&(J||I||!C&&V)){let[t,_1]=I6({nodeId:C,dragItems:F,nodeLookup:l});if(J?.(i.sourceEvent,F,t,_1),I?.(i.sourceEvent,t,_1),!C)V?.(i.sourceEvent,_1)}}let u=R5().clickDistance(f).on("start",(i)=>{let{domNode:l,nodeDragThreshold:S,transform:b,snapGrid:h,snapToGrid:E}=Q();if(K=l?.getBoundingClientRect()||null,z=!1,W=!1,w=i.sourceEvent,S===0)k(i);G=x5(i.sourceEvent,{transform:b,snapGrid:h,snapToGrid:E,containerBounds:K}),Y=O0(i.sourceEvent,K)}).on("drag",(i)=>{let{autoPanOnNodeDrag:l,transform:S,snapGrid:b,snapToGrid:h,nodeDragThreshold:E,nodeLookup:j}=Q(),m=x5(i.sourceEvent,{transform:S,snapGrid:b,snapToGrid:h,containerBounds:K});if(w=i.sourceEvent,i.sourceEvent.type==="touchmove"&&i.sourceEvent.touches.length>1||C&&!j.has(C))z=!0;if(z)return;if(!X&&l&&H)X=!0,N();if(!H){let I=O0(i.sourceEvent,K),V=I.x-Y.x,D=I.y-Y.y;if(Math.sqrt(V*V+D*D)>E)k(i)}if((G.x!==m.xSnapped||G.y!==m.ySnapped)&&F&&H)Y=O0(i.sourceEvent,K),v(m)}).on("end",(i)=>{if(!H||z){if(z&&F.size>0)Q().updateNodePositions(F,!1);return}if(X=!1,H=!1,cancelAnimationFrame(Z),F.size>0){let{nodeLookup:l,updateNodePositions:S,onNodeDragStop:b,onSelectionDragStop:h}=Q();if(W)S(F,!1),W=!1;if(U||b||!C&&h){let[E,j]=I6({nodeId:C,dragItems:F,nodeLookup:l,dragging:!1});if(U?.(i.sourceEvent,F,E,j),b?.(i.sourceEvent,E,j),!C)h?.(i.sourceEvent,j)}}}).filter((i)=>{let l=i.target;return!i.button&&(!O||!O7(l,`.${O}`,M))&&(!B||O7(l,B,M))});L.call(u)}function A(){L?.on(".drag",null)}return{update:R,destroy:A}}function uq(_,Q,J){let q=[],U={x:_.x-J,y:_.y-J,width:J*2,height:J*2};for(let G of Q.values())if(g5(U,$5(G))>0)q.push(G);return q}var hq=250;function Dq(_,Q,J,q){let U=[],G=1/0,Z=uq(_,J,Q+hq);for(let F of Z){let X=[...F.internals.handleBounds?.source??[],...F.internals.handleBounds?.target??[]];for(let Y of X){if(q.nodeId===Y.nodeId&&q.type===Y.type&&q.id===Y.id)continue;let{x:K,y:H}=z2(F,Y,Y.position,!0),L=Math.sqrt(Math.pow(K-_.x,2)+Math.pow(H-_.y,2));if(L>Q)continue;if(L<G)U=[{...Y,x:K,y:H}],G=L;else if(L===G)U.push({...Y,x:K,y:H})}}if(!U.length)return null;if(U.length>1){let F=q.type==="source"?"target":"source";return U.find((X)=>X.type===F)??U[0]}return U[0]}function r7(_,Q,J,q,U,G=!1){let Z=q.get(_);if(!Z)return null;let F=U==="strict"?Z.internals.handleBounds?.[Q]:[...Z.internals.handleBounds?.source??[],...Z.internals.handleBounds?.target??[]],X=(J?F?.find((Y)=>Y.id===J):F?.[0])??null;return X&&G?{...X,...z2(Z,X,X.position,!0)}:X}function d7(_,Q){if(_)return _;else if(Q?.classList.contains("target"))return"target";else if(Q?.classList.contains("source"))return"source";return null}function bq(_,Q){let J=null;if(Q)J=!0;else if(_&&!Q)J=!1;return J}var a7=()=>!0;function Eq(_,{connectionMode:Q,connectionRadius:J,handleId:q,nodeId:U,edgeUpdaterType:G,isTarget:Z,domNode:F,nodeLookup:X,lib:Y,autoPanOnConnect:K,flowId:H,panBy:L,cancelConnection:z,onConnectStart:W,onConnect:w,onConnectEnd:R,isValidConnection:A=a7,onReconnectEnd:O,updateConnection:B,getTransform:M,getFromHandle:P,autoPanSpeed:C,dragThreshold:f=1,handleDomNode:v}){let N=m6(_.target),k=0,u,{x:i,y:l}=O0(_),S=d7(G,v),b=F?.getBoundingClientRect(),h=!1;if(!b||!S)return;let E=r7(U,S,q,X,Q);if(!E)return;let j=O0(_,b),m=!1,I=null,V=!1,D=null;function y(){if(!K||!b)return;let[G1,U1]=f4(j,b,C);L({x:G1,y:U1}),k=requestAnimationFrame(y)}let t={...E,nodeId:U,type:S,position:E.position},_1=X.get(U),o={inProgress:!0,isValid:null,from:z2(_1,t,F1.Left,!0),fromHandle:t,fromPosition:t.position,fromNode:_1,to:j,toHandle:null,toPosition:X7[t.position],toNode:null,pointer:j};function p(){h=!0,B(o),W?.(_,{nodeId:U,handleId:q,handleType:S})}if(f===0)p();function e(G1){if(!h){let{x:I1,y:H1}=O0(G1),m1=I1-i,t1=H1-l;if(!(m1*m1+t1*t1>f*f))return;p()}if(!P()||!t){q1(G1);return}let U1=M();if(j=O0(G1,b),u=Dq(U5(j,U1,!1,[1,1]),J,X,t),!m)y(),m=!0;let K1=s7(G1,{handle:u,connectionMode:Q,fromNodeId:U,fromHandleId:q,fromType:Z?"target":"source",isValidConnection:A,doc:N,lib:Y,flowId:H,nodeLookup:X});D=K1.handleDomNode,I=K1.connection,V=bq(!!u,K1.isValid);let W1=X.get(U),Y1=W1?z2(W1,t,F1.Left,!0):o.from,n={...o,from:Y1,isValid:V,to:K1.toHandle&&V?y2({x:K1.toHandle.x,y:K1.toHandle.y},U1):j,toHandle:K1.toHandle,toPosition:V&&K1.toHandle?K1.toHandle.position:X7[t.position],toNode:K1.toHandle?X.get(K1.toHandle.nodeId):null,pointer:j};B(n),o=n}function q1(G1){if("touches"in G1&&G1.touches.length>0)return;if(h){if((u||D)&&I&&V)w?.(I);let{inProgress:U1,...K1}=o,W1={...K1,toPosition:o.toHandle?o.toPosition:null};if(R?.(G1,W1),G)O?.(G1,W1)}z(),cancelAnimationFrame(k),m=!1,V=!1,I=null,D=null,N.removeEventListener("mousemove",e),N.removeEventListener("mouseup",q1),N.removeEventListener("touchmove",e),N.removeEventListener("touchend",q1)}N.addEventListener("mousemove",e),N.addEventListener("mouseup",q1),N.addEventListener("touchmove",e),N.addEventListener("touchend",q1)}function s7(_,{handle:Q,connectionMode:J,fromNodeId:q,fromHandleId:U,fromType:G,doc:Z,lib:F,flowId:X,isValidConnection:Y=a7,nodeLookup:K}){let H=G==="target",L=Q?Z.querySelector(`.${F}-flow__handle[data-id="${X}-${Q?.nodeId}-${Q?.id}-${Q?.type}"]`):null,{x:z,y:W}=O0(_),w=Z.elementFromPoint(z,W),R=w?.classList.contains(`${F}-flow__handle`)?w:L,A={handleDomNode:R,isValid:!1,connection:null,toHandle:null};if(R){let O=d7(void 0,R),B=R.getAttribute("data-nodeid"),M=R.getAttribute("data-handleid"),P=R.classList.contains("connectable"),C=R.classList.contains("connectableend");if(!B||!O)return A;let f={source:H?B:q,sourceHandle:H?M:U,target:H?q:B,targetHandle:H?U:M};A.connection=f;let N=P&&C&&(J===L2.Strict?H&&O==="source"||!H&&O==="target":B!==q||M!==U);A.isValid=N&&Y(f),A.toHandle=r7(B,O,M,K,J,!0)}return A}var D4={onPointerDown:Eq,isValid:s7};function t7({domNode:_,panZoom:Q,getTransform:J,getViewScale:q}){let U=o1(_);function G({translateExtent:F,width:X,height:Y,zoomStep:K=1,pannable:H=!0,zoomable:L=!0,inversePan:z=!1}){let W=(B)=>{if(B.sourceEvent.type!=="wheel"||!Q)return;let M=J(),P=B.sourceEvent.ctrlKey&&G5()?10:1,C=-B.sourceEvent.deltaY*(B.sourceEvent.deltaMode===1?0.05:B.sourceEvent.deltaMode?1:0.002)*K,f=M[2]*Math.pow(2,C*P);Q.scaleTo(f)},w=[0,0],R=(B)=>{if(B.sourceEvent.type==="mousedown"||B.sourceEvent.type==="touchstart")w=[B.sourceEvent.clientX??B.sourceEvent.touches[0].clientX,B.sourceEvent.clientY??B.sourceEvent.touches[0].clientY]},A=(B)=>{let M=J();if(B.sourceEvent.type!=="mousemove"&&B.sourceEvent.type!=="touchmove"||!Q)return;let P=[B.sourceEvent.clientX??B.sourceEvent.touches[0].clientX,B.sourceEvent.clientY??B.sourceEvent.touches[0].clientY],C=[P[0]-w[0],P[1]-w[1]];w=P;let f=q()*Math.max(M[2],Math.log(M[2]))*(z?-1:1),v={x:M[0]-C[0]*f,y:M[1]-C[1]*f},N=[[0,0],[X,Y]];Q.setViewportConstrained({x:v.x,y:v.y,zoom:M[2]},N,F)},O=E5().on("start",R).on("zoom",H?A:null).on("zoom.wheel",L?W:null);U.call(O,{})}function Z(){U.on("zoom",null)}return{update:G,destroy:Z,pointer:q0}}var b4=(_)=>({x:_.x,y:_.y,zoom:_.k}),w6=({x:_,y:Q,zoom:J})=>C2.translate(_,Q).scale(J),Y2=(_,Q)=>_.target.closest(`.${Q}`),o7=(_,Q)=>Q===2&&Array.isArray(_)&&_.includes(2),xq=(_)=>((_*=2)<=1?_*_*_:(_-=2)*_*_+2)/2,P6=(_,Q=0,J=xq,q=()=>{})=>{let U=typeof Q==="number"&&Q>0;if(!U)q();return U?_.transition().duration(Q).ease(J).on("end",q):_},n7=(_)=>{let Q=_.ctrlKey&&G5()?10:1;return-_.deltaY*(_.deltaMode===1?0.05:_.deltaMode?1:0.002)*Q};function mq({zoomPanValues:_,noWheelClassName:Q,d3Selection:J,d3Zoom:q,panOnScrollMode:U,panOnScrollSpeed:G,zoomOnPinch:Z,onPanZoomStart:F,onPanZoom:X,onPanZoomEnd:Y}){return(K)=>{if(Y2(K,Q)){if(K.ctrlKey)K.preventDefault();return!1}K.preventDefault(),K.stopImmediatePropagation();let H=J.property("__zoom").k||1;if(K.ctrlKey&&Z){let R=q0(K),A=n7(K),O=H*Math.pow(2,A);q.scaleTo(J,O,R,K);return}let L=K.deltaMode===1?20:1,z=U===s0.Vertical?0:K.deltaX*L,W=U===s0.Horizontal?0:K.deltaY*L;if(!G5()&&K.shiftKey&&U!==s0.Vertical)z=K.deltaY*L,W=0;q.translateBy(J,-(z/H)*G,-(W/H)*G,{internal:!0});let w=b4(J.property("__zoom"));if(clearTimeout(_.panScrollTimeout),!_.isPanScrolling)_.isPanScrolling=!0,F?.(K,w);else X?.(K,w);_.panScrollTimeout=setTimeout(()=>{Y?.(K,w),_.isPanScrolling=!1},150)}}function gq({noWheelClassName:_,preventScrolling:Q,d3ZoomHandler:J}){return function(q,U){let G=q.type==="wheel",Z=!Q&&G&&!q.ctrlKey,F=Y2(q,_);if(q.ctrlKey&&G&&F)q.preventDefault();if(Z||F)return null;q.preventDefault(),J.call(this,q,U)}}function pq({zoomPanValues:_,onDraggingChange:Q,onPanZoomStart:J}){return(q)=>{if(q.sourceEvent?.internal)return;let U=b4(q.transform);if(_.mouseButton=q.sourceEvent?.button||0,_.isZoomingOrPanning=!0,_.prevViewport=U,q.sourceEvent?.type==="mousedown")Q(!0);if(J)J?.(q.sourceEvent,U)}}function cq({zoomPanValues:_,panOnDrag:Q,onPaneContextMenu:J,onTransformChange:q,onPanZoom:U}){return(G)=>{if(_.usedRightMouseButton=!!(J&&o7(Q,_.mouseButton??0)),!G.sourceEvent?.sync)q([G.transform.x,G.transform.y,G.transform.k]);if(U&&!G.sourceEvent?.internal)U?.(G.sourceEvent,b4(G.transform))}}function lq({zoomPanValues:_,panOnDrag:Q,panOnScroll:J,onDraggingChange:q,onPanZoomEnd:U,onPaneContextMenu:G}){return(Z)=>{if(Z.sourceEvent?.internal)return;if(_.isZoomingOrPanning=!1,G&&o7(Q,_.mouseButton??0)&&!_.usedRightMouseButton&&Z.sourceEvent)G(Z.sourceEvent);if(_.usedRightMouseButton=!1,q(!1),U){let F=b4(Z.transform);_.prevViewport=F,clearTimeout(_.timerId),_.timerId=setTimeout(()=>{U?.(Z.sourceEvent,F)},J?150:0)}}}function iq({panActivationKeyPressed:_,zoomActivationKeyPressed:Q,zoomOnScroll:J,zoomOnPinch:q,panOnDrag:U,panOnScroll:G,zoomOnDoubleClick:Z,userSelectionActive:F,noWheelClassName:X,noPanClassName:Y,lib:K,connectionInProgress:H}){return(L)=>{let z=Q||J,W=q&&L.ctrlKey,w=L.type==="wheel";if(L.button===1&&L.type==="mousedown"&&(Y2(L,`${K}-flow__node`)||Y2(L,`${K}-flow__edge`)||Y2(L,`${K}-flow__selection`)||Y2(L,`${K}-flow__nodesselection`)))return!0;if(!U&&!z&&!G&&!Z&&!q)return!1;if(F)return!1;if(H&&!w)return!1;if(Y2(L,X)&&w)return!1;if(Y2(L,Y)&&(!w||G&&w&&!Q))return!1;if(!q&&L.ctrlKey&&w)return!1;if(!q&&L.type==="touchstart"&&L.touches?.length>1)return L.preventDefault(),!1;if(!z&&!G&&!W&&w)return!1;if(!U&&(L.type==="mousedown"||L.type==="touchstart"))return!1;if(Array.isArray(U)&&!U.includes(L.button)&&L.type==="mousedown")return!1;let R=Array.isArray(U)&&U.includes(L.button)||!L.button||L.button<=1;return(!L.ctrlKey||w||_)&&R}}function e7({domNode:_,minZoom:Q,maxZoom:J,translateExtent:q,viewport:U,onPanZoom:G,onPanZoomStart:Z,onPanZoomEnd:F,onDraggingChange:X}){let Y={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},K=_.getBoundingClientRect(),H=[[0,0],[K.width,K.height]];(typeof ResizeObserver<"u"?new ResizeObserver((l)=>{let S=l[0];if(S)H=[[0,0],[S.contentRect.width,S.contentRect.height]]}):null)?.observe(_);let z=E5().extent(()=>H).scaleExtent([Q,J]).translateExtent(q),W=o1(_).call(z);M({x:U.x,y:U.y,zoom:Q5(U.zoom,Q,J)},[[0,0],[K.width,K.height]],q);let w=W.on("wheel.zoom"),R=W.on("dblclick.zoom");z.wheelDelta(n7);async function A(l,S){if(W)return new Promise((b)=>{z?.interpolate(S?.interpolate==="linear"?D0:N2).transform(P6(W,S?.duration,S?.ease,()=>b(!0)),l)});return!1}function O({noWheelClassName:l,noPanClassName:S,onPaneContextMenu:b,userSelectionActive:h,panOnScroll:E,panOnDrag:j,panOnScrollMode:m,panOnScrollSpeed:I,preventScrolling:V,zoomOnPinch:D,zoomOnScroll:y,zoomOnDoubleClick:t,panActivationKeyPressed:_1=!1,zoomActivationKeyPressed:s,lib:o,onTransformChange:p,connectionInProgress:e,paneClickDistance:q1,selectionOnDrag:G1}){if(h&&!Y.isZoomingOrPanning)B();let U1=E&&!s&&!h;z.clickDistance(G1?1/0:!R0(q1)||q1<0?0:q1);let K1=U1?mq({zoomPanValues:Y,noWheelClassName:l,d3Selection:W,d3Zoom:z,panOnScrollMode:m,panOnScrollSpeed:I,zoomOnPinch:D,onPanZoomStart:Z,onPanZoom:G,onPanZoomEnd:F}):gq({noWheelClassName:l,preventScrolling:V,d3ZoomHandler:w});W.on("wheel.zoom",K1,{passive:!1});let W1=pq({zoomPanValues:Y,onDraggingChange:X,onPanZoomStart:Z});z.on("start",W1);let Y1=cq({zoomPanValues:Y,panOnDrag:j,onPaneContextMenu:!!b,onPanZoom:G,onTransformChange:p});z.on("zoom",Y1);let n=lq({zoomPanValues:Y,panOnDrag:j,panOnScroll:E,onPaneContextMenu:b,onPanZoomEnd:F,onDraggingChange:X});z.on("end",n);let I1=iq({panActivationKeyPressed:_1,zoomActivationKeyPressed:s,panOnDrag:j,zoomOnScroll:y,panOnScroll:E,zoomOnDoubleClick:t,zoomOnPinch:D,userSelectionActive:h,noPanClassName:S,noWheelClassName:l,lib:o,connectionInProgress:e});if(z.filter(I1),t)W.on("dblclick.zoom",R);else W.on("dblclick.zoom",null)}function B(){z.on("zoom",null)}async function M(l,S,b){let h=w6(l),E=z?.constrain()(h,S,b);if(E)await A(E);return E}async function P(l,S){let b=w6(l);return await A(b,S),b}function C(l){if(W){let S=w6(l),b=W.property("__zoom");if(b.k!==l.zoom||b.x!==l.x||b.y!==l.y)z?.transform(W,S,null,{sync:!0})}}function f(){let l=W?b5(W.node()):{x:0,y:0,k:1};return{x:l.x,y:l.y,zoom:l.k}}async function v(l,S){if(W)return new Promise((b)=>{z?.interpolate(S?.interpolate==="linear"?D0:N2).scaleTo(P6(W,S?.duration,S?.ease,()=>b(!0)),l)});return!1}async function N(l,S){if(W)return new Promise((b)=>{z?.interpolate(S?.interpolate==="linear"?D0:N2).scaleBy(P6(W,S?.duration,S?.ease,()=>b(!0)),l)});return!1}function k(l){z?.scaleExtent(l)}function u(l){z?.translateExtent(l)}function i(l){let S=!R0(l)||l<0?0:l;z?.clickDistance(S)}return{update:O,destroy:B,setViewport:P,setViewportConstrained:M,getViewport:f,scaleTo:v,scaleBy:N,setScaleExtent:k,setTranslateExtent:u,syncViewport:C,setClickDistance:i}}var t0;(function(_){_.Line="line",_.Handle="handle"})(t0||(t0={}));var _9=["top-left","top-right","bottom-left","bottom-right"],Q9=["top","right","bottom","left"];function rq({width:_,prevWidth:Q,height:J,prevHeight:q,affectsX:U,affectsY:G}){let Z=_-Q,F=J-q,X=[Z>0?1:Z<0?-1:0,F>0?1:F<0?-1:0];if(Z&&U)X[0]=X[0]*-1;if(F&&G)X[1]=X[1]*-1;return X}function I7(_){let Q=_.includes("right")||_.includes("left"),J=_.includes("bottom")||_.includes("top"),q=_.includes("left"),U=_.includes("top");return{isHorizontal:Q,isVertical:J,affectsX:q,affectsY:U}}function X2(_,Q){return Math.max(0,Q-_)}function K2(_,Q){return Math.max(0,_-Q)}function w4(_,Q,J){return Math.max(0,Q-_,_-J)}function w7(_,Q){return _?!Q:Q}function dq(_,Q,J,q,U,G,Z,F){let{affectsX:X,affectsY:Y}=Q,{isHorizontal:K,isVertical:H}=Q,L=K&&H,{xSnapped:z,ySnapped:W}=J,{minWidth:w,maxWidth:R,minHeight:A,maxHeight:O}=q,{x:B,y:M,width:P,height:C,aspectRatio:f}=_,v=Math.floor(K?z-_.pointerX:0),N=Math.floor(H?W-_.pointerY:0),k=P+(X?-v:v),u=C+(Y?-N:N),i=-G[0]*P,l=-G[1]*C,S=w4(k,w,R),b=w4(u,A,O);if(Z){let j=0,m=0;if(X&&v<0)j=X2(B+v+i,Z[0][0]);else if(!X&&v>0)j=K2(B+k+i,Z[1][0]);if(Y&&N<0)m=X2(M+N+l,Z[0][1]);else if(!Y&&N>0)m=K2(M+u+l,Z[1][1]);S=Math.max(S,j),b=Math.max(b,m)}if(F){let j=0,m=0;if(X&&v>0)j=K2(B+v,F[0][0]);else if(!X&&v<0)j=X2(B+k,F[1][0]);if(Y&&N>0)m=K2(M+N,F[0][1]);else if(!Y&&N<0)m=X2(M+u,F[1][1]);S=Math.max(S,j),b=Math.max(b,m)}if(U){if(K){let j=w4(k/f,A,O)*f;if(S=Math.max(S,j),Z){let m=0;if(!X&&!Y||X&&!Y&&L)m=K2(M+l+k/f,Z[1][1])*f;else m=X2(M+l+(X?v:-v)/f,Z[0][1])*f;S=Math.max(S,m)}if(F){let m=0;if(!X&&!Y||X&&!Y&&L)m=X2(M+k/f,F[1][1])*f;else m=K2(M+(X?v:-v)/f,F[0][1])*f;S=Math.max(S,m)}}if(H){let j=w4(u*f,w,R)/f;if(b=Math.max(b,j),Z){let m=0;if(!X&&!Y||Y&&!X&&L)m=K2(B+u*f+i,Z[1][0])/f;else m=X2(B+(Y?N:-N)*f+i,Z[0][0])/f;b=Math.max(b,m)}if(F){let m=0;if(!X&&!Y||Y&&!X&&L)m=X2(B+u*f,F[1][0])/f;else m=K2(B+(Y?N:-N)*f,F[0][0])/f;b=Math.max(b,m)}}}if(N=N+(N<0?b:-b),v=v+(v<0?S:-S),U)if(L)if(k>u*f)N=(w7(X,Y)?-v:v)/f;else v=(w7(X,Y)?-N:N)*f;else if(K)N=v/f,Y=X;else v=N*f,X=Y;let h=X?B+v:B,E=Y?M+N:M;return{width:P+(X?-v:v),height:C+(Y?-N:N),x:G[0]*v*(!X?1:-1)+h,y:G[1]*N*(!Y?1:-1)+E}}var J9={width:0,height:0,x:0,y:0},aq={...J9,pointerX:0,pointerY:0,aspectRatio:1};function sq(_,Q,J){let q=Q.position.x+_.position.x,U=Q.position.y+_.position.y,G=_.measured.width??0,Z=_.measured.height??0,F=J[0]*G,X=J[1]*Z;return[[q-F,U-X],[q+G-F,U+Z-X]]}function $9({domNode:_,nodeId:Q,getStoreItems:J,onChange:q,onEnd:U}){let G=o1(_),Z={controlDirection:I7("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function F({controlPosition:Y,boundaries:K,keepAspectRatio:H,resizeDirection:L,onResizeStart:z,onResize:W,onResizeEnd:w,shouldResize:R}){let A={...J9},O={...aq};Z={boundaries:K,resizeDirection:L,keepAspectRatio:H,controlDirection:I7(Y)};let B=void 0,M=null,P=[],C=void 0,f=void 0,v=void 0,N=R5().on("start",(k)=>{let{nodeLookup:u,transform:i,snapGrid:l,snapToGrid:S,nodeOrigin:b,paneDomNode:h}=J();if(B=u.get(Q),!B)return;M=h?.getBoundingClientRect()??null;let{xSnapped:E,ySnapped:j}=x5(k.sourceEvent,{transform:i,snapGrid:l,snapToGrid:S,containerBounds:M});if(A={width:B.measured.width??0,height:B.measured.height??0,x:B.position.x??0,y:B.position.y??0},O={...A,pointerX:E,pointerY:j,aspectRatio:A.width/A.height},C=void 0,f=j2(B.extent)?B.extent:void 0,B.parentId&&(B.extent==="parent"||B.expandParent))C=u.get(B.parentId);if(C&&B.extent==="parent")f=[[0,0],[C.measured.width,C.measured.height]];P=[],v=void 0;for(let[m,I]of u)if(I.parentId===Q){if(P.push({id:m,position:{...I.position},extent:I.extent}),I.extent==="parent"||I.expandParent){let V=sq(I,B,I.origin??b);if(v)v=[[Math.min(V[0][0],v[0][0]),Math.min(V[0][1],v[0][1])],[Math.max(V[1][0],v[1][0]),Math.max(V[1][1],v[1][1])]];else v=V}}z?.(k,{...A})}).on("drag",(k)=>{let{transform:u,snapGrid:i,snapToGrid:l,nodeOrigin:S}=J(),b=x5(k.sourceEvent,{transform:u,snapGrid:i,snapToGrid:l,containerBounds:M}),h=[];if(!B)return;let{x:E,y:j,width:m,height:I}=A,V={},D=B.origin??S,{width:y,height:t,x:_1,y:s}=dq(O,Z.controlDirection,b,Z.boundaries,Z.keepAspectRatio,D,f,v),o=y!==m,p=t!==I,e=_1!==E&&o,q1=s!==j&&p;if(!e&&!q1&&!o&&!p)return;let G1={prevValues:{...A},startX:O.x,startY:O.y,childNodes:P.map((Y1)=>({...Y1,position:{...Y1.position}}))};if(e||q1||D[0]===1||D[1]===1){if(V.x=e?_1:A.x,V.y=q1?s:A.y,A.x=V.x,A.y=V.y,P.length>0){let Y1=_1-E,n=s-j;for(let I1 of P)I1.position={x:I1.position.x-Y1+D[0]*(y-m),y:I1.position.y-n+D[1]*(t-I)},h.push(I1)}}if(o||p)V.width=o&&(!Z.resizeDirection||Z.resizeDirection==="horizontal")?y:A.width,V.height=p&&(!Z.resizeDirection||Z.resizeDirection==="vertical")?t:A.height,A.width=V.width,A.height=V.height;if(C&&B.expandParent){let Y1=D[0]*(V.width??0);if(V.x&&V.x<Y1)A.x=Y1,O.x=O.x-(V.x-Y1);let n=D[1]*(V.height??0);if(V.y&&V.y<n)A.y=n,O.y=O.y-(V.y-n)}let U1=rq({width:A.width,prevWidth:m,height:A.height,prevHeight:I,affectsX:Z.controlDirection.affectsX,affectsY:Z.controlDirection.affectsY}),K1={...A,direction:U1};if(R?.(k,K1)===!1){A=G1.prevValues,O.x=G1.startX,O.y=G1.startY,P.forEach((Y1,n)=>{Y1.position=G1.childNodes[n].position});return}W?.(k,K1),q(V,h)}).on("end",(k)=>{w?.(k,{...A}),U?.({...A})});G.call(N)}function X(){G.on(".drag",null)}return{update:F,destroy:X}}var H9=Q0(V0(),1),X9=Q0(U9(),1);var G9=(_)=>{let Q,J=new Set,q=(K,H)=>{let L=typeof K==="function"?K(Q):K;if(!Object.is(L,Q)){let z=Q;Q=(H!=null?H:typeof L!=="object"||L===null)?L:Object.assign({},Q,L),J.forEach((W)=>W(Q,z))}},U=()=>Q,X={setState:q,getState:U,getInitialState:()=>Y,subscribe:(K)=>{return J.add(K),()=>J.delete(K)},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.");J.clear()}},Y=Q=_(q,U,X);return X},Z9=(_)=>_?G9(_):G9;var{useDebugValue:nq}=H9.default,{useSyncExternalStoreWithSelector:eq}=X9.default,_U=(_)=>_;function s6(_,Q=_U,J){let q=eq(_.subscribe,_.getState,_.getServerState||_.getInitialState,Q,J);return nq(q),q}var F9=(_,Q)=>{let J=Z9(_),q=(U,G=Q)=>s6(J,U,G);return Object.assign(q,J),q},K9=(_,Q)=>_?F9(_,Q):F9;function b1(_,Q){if(Object.is(_,Q))return!0;if(typeof _!=="object"||_===null||typeof Q!=="object"||Q===null)return!1;if(_ instanceof Map&&Q instanceof Map){if(_.size!==Q.size)return!1;for(let[q,U]of _)if(!Object.is(U,Q.get(q)))return!1;return!0}if(_ instanceof Set&&Q instanceof Set){if(_.size!==Q.size)return!1;for(let q of _)if(!Q.has(q))return!1;return!0}let J=Object.keys(_);if(J.length!==Object.keys(Q).length)return!1;for(let q of J)if(!Object.prototype.hasOwnProperty.call(Q,q)||!Object.is(_[q],Q[q]))return!1;return!0}var p9=Q0(z9(),1),p4=d.createContext(null),$U=p4.Provider,c9=X0.error001("react");function C1(_,Q){let J=d.useContext(p4);if(J===null)throw Error(c9);return s6(J,_,Q)}function E1(){let _=d.useContext(p4);if(_===null)throw Error(c9);return d.useMemo(()=>({getState:_.getState,setState:_.setState,subscribe:_.subscribe}),[_])}var W9={display:"none"},qU={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},l9="react-flow__node-desc",i9="react-flow__edge-desc",UU="react-flow__aria-live",GU=(_)=>_.ariaLiveMessage,ZU=(_)=>_.ariaLabelConfig;function FU({rfId:_}){let Q=C1(GU);return r.jsx("div",{id:`${UU}-${_}`,"aria-live":"assertive","aria-atomic":"true",style:qU,children:Q})}function HU({rfId:_,disableKeyboardA11y:Q}){let J=C1(ZU);return r.jsxs(r.Fragment,{children:[r.jsx("div",{id:`${l9}-${_}`,style:W9,children:Q?J["node.a11yDescription.default"]:J["node.a11yDescription.keyboardDisabled"]}),r.jsx("div",{id:`${i9}-${_}`,style:W9,children:J["edge.a11yDescription.default"]}),!Q&&r.jsx(FU,{rfId:_})]})}var x0=d.forwardRef(({position:_="top-left",children:Q,className:J,style:q,...U},G)=>{let Z=`${_}`.split("-");return r.jsx("div",{className:g1(["react-flow__panel",J,...Z]),style:q,ref:G,...U,children:Q})});x0.displayName="Panel";var B9="https://reactflow.dev/attribution";function XU({proOptions:_,position:Q="bottom-right"}){if(d.useEffect(()=>{j7("react")},[]),_?.hideAttribution)return null;return r.jsx(x0,{position:Q,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${B9}`,children:r.jsx("a",{href:B9,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}var KU=(_)=>{let Q=[],J=[];for(let[,q]of _.nodeLookup)if(q.selected)Q.push(q.internals.userNode);for(let[,q]of _.edgeLookup)if(q.selected)J.push(q);return{selectedNodes:Q,selectedEdges:J}},E4=(_)=>_.id;function YU(_,Q){return b1(_.selectedNodes.map(E4),Q.selectedNodes.map(E4))&&b1(_.selectedEdges.map(E4),Q.selectedEdges.map(E4))}function LU({onSelectionChange:_}){let Q=E1(),{selectedNodes:J,selectedEdges:q}=C1(KU,YU);return d.useEffect(()=>{let U={nodes:J,edges:q};_?.(U),Q.getState().onSelectionChangeHandlers.forEach((G)=>G(U))},[J,q,_]),null}var zU=(_)=>!!_.onSelectionChangeHandlers;function WU({onSelectionChange:_}){let Q=C1(zU);if(_||Q)return r.jsx(LU,{onSelectionChange:_});return null}var r9=[0,0],BU={x:0,y:0,zoom:1},AU=["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"],A9=[...AU,"rfId"],MU=(_)=>({setNodes:_.setNodes,setEdges:_.setEdges,setMinZoom:_.setMinZoom,setMaxZoom:_.setMaxZoom,setTranslateExtent:_.setTranslateExtent,setNodeExtent:_.setNodeExtent,reset:_.reset,setDefaultNodesAndEdges:_.setDefaultNodesAndEdges}),M9={translateExtent:J5,nodeOrigin:r9,minZoom:0.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function TU(_){let{setNodes:Q,setEdges:J,setMinZoom:q,setMaxZoom:U,setTranslateExtent:G,setNodeExtent:Z,reset:F,setDefaultNodesAndEdges:X}=C1(MU,b1),Y=E1();d.useEffect(()=>{return X(_.defaultNodes,_.defaultEdges),()=>{K.current=M9,F()}},[]);let K=d.useRef(M9);return d.useEffect(()=>{for(let H of A9){let L=_[H],z=K.current[H];if(L===z)continue;if(typeof _[H]>"u")continue;if(H==="nodes")Q(L);else if(H==="edges")J(L);else if(H==="minZoom")q(L);else if(H==="maxZoom")U(L);else if(H==="translateExtent")G(L);else if(H==="nodeExtent")Z(L);else if(H==="ariaLabelConfig")Y.setState({ariaLabelConfig:y7(L)});else if(H==="fitView")Y.setState({fitViewQueued:L});else if(H==="fitViewOptions")Y.setState({fitViewOptions:L});else Y.setState({[H]:L})}K.current=_},A9.map((H)=>_[H])),null}function T9(){if(typeof window>"u"||!window.matchMedia)return null;return window.matchMedia("(prefers-color-scheme: dark)")}function RU(_){let[Q,J]=d.useState(_==="system"?null:_);return d.useEffect(()=>{if(_!=="system"){J(_);return}let q=T9(),U=()=>J(q?.matches?"dark":"light");return U(),q?.addEventListener("change",U),()=>{q?.removeEventListener("change",U)}},[_]),Q!==null?Q:T9()?.matches?"dark":"light"}var R9=typeof document<"u"?document:null;function l5(_=null,Q={target:R9,actInsideInputWithModifier:!0}){let[J,q]=d.useState(!1),U=d.useRef(!1),G=d.useRef(new Set([])),[Z,F]=d.useMemo(()=>{if(_!==null){let Y=(Array.isArray(_)?_:[_]).filter((H)=>typeof H==="string").map((H)=>H.replace(/\+/g,`
27
+ <%s key={someKey} {...props} />`,u,a,o,a),m[a+u]=!0)}if(a=null,b!==void 0&&(J(b),a=""+b),Z(V)&&(J(V.key),a=""+V.key),"key"in V){b={};for(var p in V)p!=="key"&&(b[p]=V[p])}else b=V;return a&&F(b,typeof P==="function"?P.displayName||P.name||"Unknown":P),Y(P,a,b,U(),t,Q1)}function H(P){L(P)?P._store&&(P._store.validated=1):typeof P==="object"&&P!==null&&P.$$typeof===y&&(P._payload.status==="fulfilled"?L(P._payload.value)&&P._payload.value._store&&(P._payload.value._store.validated=1):P._store&&(P._store.validated=1))}function L(P){return typeof P==="object"&&P!==null&&P.$$typeof===z}var z=Symbol.for("react.transitional.element"),W=Symbol.for("react.portal"),I=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),B=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),C=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),N=Symbol.for("react.activity"),k=Symbol.for("react.client.reference"),E=D2.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,c=Object.prototype.hasOwnProperty,l=Array.isArray,S=console.createTask?console.createTask:function(){return null};D2={react_stack_bottom_frame:function(P){return P()}};var j,D={},x=D2.react_stack_bottom_frame.bind(D2,G)(),v=S(q(G)),m={};wZ.Fragment=I,wZ.jsxDEV=function(P,V,b,u){var t=1e4>E.recentlyCreatedOwnerStacks++;return K(P,V,b,u,t?Error("react-stack-top-frame"):x,t?S(q(P)):v)}})()});var r=Q0(h0(),1);var i=Q0(v8(),1),d=Q0(h0(),1);function l1(_){if(typeof _==="string"||typeof _==="number")return""+_;let Q="";if(Array.isArray(_)){for(let J=0,q;J<_.length;J++)if((q=l1(_[J]))!=="")Q+=(Q&&" ")+q}else for(let J in _)if(_[J])Q+=(Q&&" ")+J;return Q}var qJ={value:()=>{}};function V8(){for(var _=0,Q=arguments.length,J={},q;_<Q;++_){if(!(q=arguments[_]+"")||q in J||/[\s.]/.test(q))throw Error("illegal type: "+q);J[q]=[]}return new J4(J)}function J4(_){this._=_}function UJ(_,Q){return _.trim().split(/^|\s+/).map(function(J){var q="",U=J.indexOf(".");if(U>=0)q=J.slice(U+1),J=J.slice(0,U);if(J&&!Q.hasOwnProperty(J))throw Error("unknown type: "+J);return{type:J,name:q}})}J4.prototype=V8.prototype={constructor:J4,on:function(_,Q){var J=this._,q=UJ(_+"",J),U,G=-1,Z=q.length;if(arguments.length<2){while(++G<Z)if((U=(_=q[G]).type)&&(U=GJ(J[U],_.name)))return U;return}if(Q!=null&&typeof Q!=="function")throw Error("invalid callback: "+Q);while(++G<Z)if(U=(_=q[G]).type)J[U]=j8(J[U],_.name,Q);else if(Q==null)for(U in J)J[U]=j8(J[U],_.name,null);return this},copy:function(){var _={},Q=this._;for(var J in Q)_[J]=Q[J].slice();return new J4(_)},call:function(_,Q){if((U=arguments.length-2)>0)for(var J=Array(U),q=0,U,G;q<U;++q)J[q]=arguments[q+2];if(!this._.hasOwnProperty(_))throw Error("unknown type: "+_);for(G=this._[_],q=0,U=G.length;q<U;++q)G[q].value.apply(Q,J)},apply:function(_,Q,J){if(!this._.hasOwnProperty(_))throw Error("unknown type: "+_);for(var q=this._[_],U=0,G=q.length;U<G;++U)q[U].value.apply(Q,J)}};function GJ(_,Q){for(var J=0,q=_.length,U;J<q;++J)if((U=_[J]).name===Q)return U.value}function j8(_,Q,J){for(var q=0,U=_.length;q<U;++q)if(_[q].name===Q){_[q]=qJ,_=_.slice(0,q).concat(_.slice(q+1));break}if(J!=null)_.push({name:Q,value:J});return _}var O2=V8;function i2(_){return function(){return this.matches(_)}}function $4(_){return function(Q){return Q.matches(_)}}var q4="http://www.w3.org/1999/xhtml",G3={svg:"http://www.w3.org/2000/svg",xhtml:q4,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function D0(_){var Q=_+="",J=Q.indexOf(":");if(J>=0&&(Q=_.slice(0,J))!=="xmlns")_=_.slice(J+1);return G3.hasOwnProperty(Q)?{space:G3[Q],local:_}:_}function Z3(_){let Q;while(Q=_.sourceEvent)_=Q;return _}function $0(_,Q){if(_=Z3(_),Q===void 0)Q=_.currentTarget;if(Q){var J=Q.ownerSVGElement||Q;if(J.createSVGPoint){var q=J.createSVGPoint();return q.x=_.clientX,q.y=_.clientY,q=q.matrixTransform(Q.getScreenCTM().inverse()),[q.x,q.y]}if(Q.getBoundingClientRect){var U=Q.getBoundingClientRect();return[_.clientX-U.left-Q.clientLeft,_.clientY-U.top-Q.clientTop]}}return[_.pageX,_.pageY]}function ZJ(){}function Z2(_){return _==null?ZJ:function(){return this.querySelector(_)}}function F3(_){if(typeof _!=="function")_=Z2(_);for(var Q=this._groups,J=Q.length,q=Array(J),U=0;U<J;++U)for(var G=Q[U],Z=G.length,F=q[U]=Array(Z),X,Y,K=0;K<Z;++K)if((X=G[K])&&(Y=_.call(X,X.__data__,K,G))){if("__data__"in X)Y.__data__=X.__data__;F[K]=Y}return new i1(q,this._parents)}function H3(_){return _==null?[]:Array.isArray(_)?_:Array.from(_)}function FJ(){return[]}function d2(_){return _==null?FJ:function(){return this.querySelectorAll(_)}}function HJ(_){return function(){return H3(_.apply(this,arguments))}}function X3(_){if(typeof _==="function")_=HJ(_);else _=d2(_);for(var Q=this._groups,J=Q.length,q=[],U=[],G=0;G<J;++G)for(var Z=Q[G],F=Z.length,X,Y=0;Y<F;++Y)if(X=Z[Y])q.push(_.call(X,X.__data__,Y,Z)),U.push(X);return new i1(q,U)}var XJ=Array.prototype.find;function KJ(_){return function(){return XJ.call(this.children,_)}}function YJ(){return this.firstElementChild}function K3(_){return this.select(_==null?YJ:KJ(typeof _==="function"?_:$4(_)))}var LJ=Array.prototype.filter;function zJ(){return Array.from(this.children)}function WJ(_){return function(){return LJ.call(this.children,_)}}function Y3(_){return this.selectAll(_==null?zJ:WJ(typeof _==="function"?_:$4(_)))}function L3(_){if(typeof _!=="function")_=i2(_);for(var Q=this._groups,J=Q.length,q=Array(J),U=0;U<J;++U)for(var G=Q[U],Z=G.length,F=q[U]=[],X,Y=0;Y<Z;++Y)if((X=G[Y])&&_.call(X,X.__data__,Y,G))F.push(X);return new i1(q,this._parents)}function z5(_){return Array(_.length)}function z3(){return new i1(this._enter||this._groups.map(z5),this._parents)}function W5(_,Q){this.ownerDocument=_.ownerDocument,this.namespaceURI=_.namespaceURI,this._next=null,this._parent=_,this.__data__=Q}W5.prototype={constructor:W5,appendChild:function(_){return this._parent.insertBefore(_,this._next)},insertBefore:function(_,Q){return this._parent.insertBefore(_,Q)},querySelector:function(_){return this._parent.querySelector(_)},querySelectorAll:function(_){return this._parent.querySelectorAll(_)}};function W3(_){return function(){return _}}function AJ(_,Q,J,q,U,G){var Z=0,F,X=Q.length,Y=G.length;for(;Z<Y;++Z)if(F=Q[Z])F.__data__=G[Z],q[Z]=F;else J[Z]=new W5(_,G[Z]);for(;Z<X;++Z)if(F=Q[Z])U[Z]=F}function BJ(_,Q,J,q,U,G,Z){var F,X,Y=new Map,K=Q.length,H=G.length,L=Array(K),z;for(F=0;F<K;++F)if(X=Q[F])if(L[F]=z=Z.call(X,X.__data__,F,Q)+"",Y.has(z))U[F]=X;else Y.set(z,X);for(F=0;F<H;++F)if(z=Z.call(_,G[F],F,G)+"",X=Y.get(z))q[F]=X,X.__data__=G[F],Y.delete(z);else J[F]=new W5(_,G[F]);for(F=0;F<K;++F)if((X=Q[F])&&Y.get(L[F])===X)U[F]=X}function MJ(_){return _.__data__}function A3(_,Q){if(!arguments.length)return Array.from(this,MJ);var J=Q?BJ:AJ,q=this._parents,U=this._groups;if(typeof _!=="function")_=W3(_);for(var G=U.length,Z=Array(G),F=Array(G),X=Array(G),Y=0;Y<G;++Y){var K=q[Y],H=U[Y],L=H.length,z=TJ(_.call(K,K&&K.__data__,Y,q)),W=z.length,I=F[Y]=Array(W),O=Z[Y]=Array(W),A=X[Y]=Array(L);J(K,H,I,O,A,z,Q);for(var w=0,B=0,T,R;w<W;++w)if(T=I[w]){if(w>=B)B=w+1;while(!(R=O[B])&&++B<W);T._next=R||null}}return Z=new i1(Z,q),Z._enter=F,Z._exit=X,Z}function TJ(_){return typeof _==="object"&&"length"in _?_:Array.from(_)}function B3(){return new i1(this._exit||this._groups.map(z5),this._parents)}function M3(_,Q,J){var q=this.enter(),U=this,G=this.exit();if(typeof _==="function"){if(q=_(q),q)q=q.selection()}else q=q.append(_+"");if(Q!=null){if(U=Q(U),U)U=U.selection()}if(J==null)G.remove();else J(G);return q&&U?q.merge(U).order():U}function T3(_){var Q=_.selection?_.selection():_;for(var J=this._groups,q=Q._groups,U=J.length,G=q.length,Z=Math.min(U,G),F=Array(U),X=0;X<Z;++X)for(var Y=J[X],K=q[X],H=Y.length,L=F[X]=Array(H),z,W=0;W<H;++W)if(z=Y[W]||K[W])L[W]=z;for(;X<U;++X)F[X]=J[X];return new i1(F,this._parents)}function R3(){for(var _=this._groups,Q=-1,J=_.length;++Q<J;)for(var q=_[Q],U=q.length-1,G=q[U],Z;--U>=0;)if(Z=q[U]){if(G&&Z.compareDocumentPosition(G)^4)G.parentNode.insertBefore(Z,G);G=Z}return this}function O3(_){if(!_)_=RJ;function Q(H,L){return H&&L?_(H.__data__,L.__data__):!H-!L}for(var J=this._groups,q=J.length,U=Array(q),G=0;G<q;++G){for(var Z=J[G],F=Z.length,X=U[G]=Array(F),Y,K=0;K<F;++K)if(Y=Z[K])X[K]=Y;X.sort(Q)}return new i1(U,this._parents).order()}function RJ(_,Q){return _<Q?-1:_>Q?1:_>=Q?0:NaN}function I3(){var _=arguments[0];return arguments[0]=this,_.apply(null,arguments),this}function P3(){return Array.from(this)}function N3(){for(var _=this._groups,Q=0,J=_.length;Q<J;++Q)for(var q=_[Q],U=0,G=q.length;U<G;++U){var Z=q[U];if(Z)return Z}return null}function w3(){let _=0;for(let Q of this)++_;return _}function f3(){return!this.node()}function C3(_){for(var Q=this._groups,J=0,q=Q.length;J<q;++J)for(var U=Q[J],G=0,Z=U.length,F;G<Z;++G)if(F=U[G])_.call(F,F.__data__,G,U);return this}function OJ(_){return function(){this.removeAttribute(_)}}function IJ(_){return function(){this.removeAttributeNS(_.space,_.local)}}function PJ(_,Q){return function(){this.setAttribute(_,Q)}}function NJ(_,Q){return function(){this.setAttributeNS(_.space,_.local,Q)}}function wJ(_,Q){return function(){var J=Q.apply(this,arguments);if(J==null)this.removeAttribute(_);else this.setAttribute(_,J)}}function fJ(_,Q){return function(){var J=Q.apply(this,arguments);if(J==null)this.removeAttributeNS(_.space,_.local);else this.setAttributeNS(_.space,_.local,J)}}function S3(_,Q){var J=D0(_);if(arguments.length<2){var q=this.node();return J.local?q.getAttributeNS(J.space,J.local):q.getAttribute(J)}return this.each((Q==null?J.local?IJ:OJ:typeof Q==="function"?J.local?fJ:wJ:J.local?NJ:PJ)(J,Q))}function A5(_){return _.ownerDocument&&_.ownerDocument.defaultView||_.document&&_||_.defaultView}function CJ(_){return function(){this.style.removeProperty(_)}}function SJ(_,Q,J){return function(){this.style.setProperty(_,Q,J)}}function yJ(_,Q,J){return function(){var q=Q.apply(this,arguments);if(q==null)this.style.removeProperty(_);else this.style.setProperty(_,q,J)}}function y3(_,Q,J){return arguments.length>1?this.each((Q==null?CJ:typeof Q==="function"?yJ:SJ)(_,Q,J==null?"":J)):F2(this.node(),_)}function F2(_,Q){return _.style.getPropertyValue(Q)||A5(_).getComputedStyle(_,null).getPropertyValue(Q)}function kJ(_){return function(){delete this[_]}}function vJ(_,Q){return function(){this[_]=Q}}function jJ(_,Q){return function(){var J=Q.apply(this,arguments);if(J==null)delete this[_];else this[_]=J}}function k3(_,Q){return arguments.length>1?this.each((Q==null?kJ:typeof Q==="function"?jJ:vJ)(_,Q)):this.node()[_]}function u8(_){return _.trim().split(/^|\s+/)}function v3(_){return _.classList||new h8(_)}function h8(_){this._node=_,this._names=u8(_.getAttribute("class")||"")}h8.prototype={add:function(_){var Q=this._names.indexOf(_);if(Q<0)this._names.push(_),this._node.setAttribute("class",this._names.join(" "))},remove:function(_){var Q=this._names.indexOf(_);if(Q>=0)this._names.splice(Q,1),this._node.setAttribute("class",this._names.join(" "))},contains:function(_){return this._names.indexOf(_)>=0}};function D8(_,Q){var J=v3(_),q=-1,U=Q.length;while(++q<U)J.add(Q[q])}function b8(_,Q){var J=v3(_),q=-1,U=Q.length;while(++q<U)J.remove(Q[q])}function VJ(_){return function(){D8(this,_)}}function uJ(_){return function(){b8(this,_)}}function hJ(_,Q){return function(){(Q.apply(this,arguments)?D8:b8)(this,_)}}function j3(_,Q){var J=u8(_+"");if(arguments.length<2){var q=v3(this.node()),U=-1,G=J.length;while(++U<G)if(!q.contains(J[U]))return!1;return!0}return this.each((typeof Q==="function"?hJ:Q?VJ:uJ)(J,Q))}function DJ(){this.textContent=""}function bJ(_){return function(){this.textContent=_}}function EJ(_){return function(){var Q=_.apply(this,arguments);this.textContent=Q==null?"":Q}}function V3(_){return arguments.length?this.each(_==null?DJ:(typeof _==="function"?EJ:bJ)(_)):this.node().textContent}function xJ(){this.innerHTML=""}function mJ(_){return function(){this.innerHTML=_}}function gJ(_){return function(){var Q=_.apply(this,arguments);this.innerHTML=Q==null?"":Q}}function u3(_){return arguments.length?this.each(_==null?xJ:(typeof _==="function"?gJ:mJ)(_)):this.node().innerHTML}function pJ(){if(this.nextSibling)this.parentNode.appendChild(this)}function h3(){return this.each(pJ)}function cJ(){if(this.previousSibling)this.parentNode.insertBefore(this,this.parentNode.firstChild)}function D3(){return this.each(cJ)}function lJ(_){return function(){var Q=this.ownerDocument,J=this.namespaceURI;return J===q4&&Q.documentElement.namespaceURI===q4?Q.createElement(_):Q.createElementNS(J,_)}}function rJ(_){return function(){return this.ownerDocument.createElementNS(_.space,_.local)}}function B5(_){var Q=D0(_);return(Q.local?rJ:lJ)(Q)}function b3(_){var Q=typeof _==="function"?_:B5(_);return this.select(function(){return this.appendChild(Q.apply(this,arguments))})}function iJ(){return null}function E3(_,Q){var J=typeof _==="function"?_:B5(_),q=Q==null?iJ:typeof Q==="function"?Q:Z2(Q);return this.select(function(){return this.insertBefore(J.apply(this,arguments),q.apply(this,arguments)||null)})}function dJ(){var _=this.parentNode;if(_)_.removeChild(this)}function x3(){return this.each(dJ)}function aJ(){var _=this.cloneNode(!1),Q=this.parentNode;return Q?Q.insertBefore(_,this.nextSibling):_}function sJ(){var _=this.cloneNode(!0),Q=this.parentNode;return Q?Q.insertBefore(_,this.nextSibling):_}function m3(_){return this.select(_?sJ:aJ)}function g3(_){return arguments.length?this.property("__data__",_):this.node().__data__}function tJ(_){return function(Q){_.call(this,Q,this.__data__)}}function oJ(_){return _.trim().split(/^|\s+/).map(function(Q){var J="",q=Q.indexOf(".");if(q>=0)J=Q.slice(q+1),Q=Q.slice(0,q);return{type:Q,name:J}})}function nJ(_){return function(){var Q=this.__on;if(!Q)return;for(var J=0,q=-1,U=Q.length,G;J<U;++J)if(G=Q[J],(!_.type||G.type===_.type)&&G.name===_.name)this.removeEventListener(G.type,G.listener,G.options);else Q[++q]=G;if(++q)Q.length=q;else delete this.__on}}function eJ(_,Q,J){return function(){var q=this.__on,U,G=tJ(Q);if(q){for(var Z=0,F=q.length;Z<F;++Z)if((U=q[Z]).type===_.type&&U.name===_.name){this.removeEventListener(U.type,U.listener,U.options),this.addEventListener(U.type,U.listener=G,U.options=J),U.value=Q;return}}if(this.addEventListener(_.type,G,J),U={type:_.type,name:_.name,value:Q,listener:G,options:J},!q)this.__on=[U];else q.push(U)}}function p3(_,Q,J){var q=oJ(_+""),U,G=q.length,Z;if(arguments.length<2){var F=this.node().__on;if(F){for(var X=0,Y=F.length,K;X<Y;++X)for(U=0,K=F[X];U<G;++U)if((Z=q[U]).type===K.type&&Z.name===K.name)return K.value}return}F=Q?eJ:nJ;for(U=0;U<G;++U)this.each(F(q[U],Q,J));return this}function E8(_,Q,J){var q=A5(_),U=q.CustomEvent;if(typeof U==="function")U=new U(Q,J);else if(U=q.document.createEvent("Event"),J)U.initEvent(Q,J.bubbles,J.cancelable),U.detail=J.detail;else U.initEvent(Q,!1,!1);_.dispatchEvent(U)}function _$(_,Q){return function(){return E8(this,_,Q)}}function Q$(_,Q){return function(){return E8(this,_,Q.apply(this,arguments))}}function c3(_,Q){return this.each((typeof Q==="function"?Q$:_$)(_,Q))}function*l3(){for(var _=this._groups,Q=0,J=_.length;Q<J;++Q)for(var q=_[Q],U=0,G=q.length,Z;U<G;++U)if(Z=q[U])yield Z}var r3=[null];function i1(_,Q){this._groups=_,this._parents=Q}function x8(){return new i1([[document.documentElement]],r3)}function J$(){return this}i1.prototype=x8.prototype={constructor:i1,select:F3,selectAll:X3,selectChild:K3,selectChildren:Y3,filter:L3,data:A3,enter:z3,exit:B3,join:M3,merge:T3,selection:J$,order:R3,sort:O3,call:I3,nodes:P3,node:N3,size:w3,empty:f3,each:C3,attr:S3,style:y3,property:k3,classed:j3,text:V3,html:u3,raise:h3,lower:D3,append:b3,insert:E3,remove:x3,clone:m3,datum:g3,on:p3,dispatch:c3,[Symbol.iterator]:l3};var d0=x8;function o1(_){return typeof _==="string"?new i1([[document.querySelector(_)]],[document.documentElement]):new i1([[_]],r3)}var m8={passive:!1},I2={capture:!0,passive:!1};function U4(_){_.stopImmediatePropagation()}function a0(_){_.preventDefault(),_.stopImmediatePropagation()}function a2(_){var Q=_.document.documentElement,J=o1(_).on("dragstart.drag",a0,I2);if("onselectstart"in Q)J.on("selectstart.drag",a0,I2);else Q.__noselect=Q.style.MozUserSelect,Q.style.MozUserSelect="none"}function M5(_,Q){var J=_.document.documentElement,q=o1(_).on("dragstart.drag",null);if(Q)q.on("click.drag",a0,I2),setTimeout(function(){q.on("click.drag",null)},0);if("onselectstart"in J)q.on("selectstart.drag",null);else J.style.MozUserSelect=J.__noselect,delete J.__noselect}var T5=(_)=>()=>_;function R5(_,{sourceEvent:Q,subject:J,target:q,identifier:U,active:G,x:Z,y:F,dx:X,dy:Y,dispatch:K}){Object.defineProperties(this,{type:{value:_,enumerable:!0,configurable:!0},sourceEvent:{value:Q,enumerable:!0,configurable:!0},subject:{value:J,enumerable:!0,configurable:!0},target:{value:q,enumerable:!0,configurable:!0},identifier:{value:U,enumerable:!0,configurable:!0},active:{value:G,enumerable:!0,configurable:!0},x:{value:Z,enumerable:!0,configurable:!0},y:{value:F,enumerable:!0,configurable:!0},dx:{value:X,enumerable:!0,configurable:!0},dy:{value:Y,enumerable:!0,configurable:!0},_:{value:K}})}R5.prototype.on=function(){var _=this._.on.apply(this._,arguments);return _===this._?this:_};function $$(_){return!_.ctrlKey&&!_.button}function q$(){return this.parentNode}function U$(_,Q){return Q==null?{x:_.x,y:_.y}:Q}function G$(){return navigator.maxTouchPoints||"ontouchstart"in this}function O5(){var _=$$,Q=q$,J=U$,q=G$,U={},G=O2("start","drag","end"),Z=0,F,X,Y,K,H=0;function L(T){T.on("mousedown.drag",z).filter(q).on("touchstart.drag",O).on("touchmove.drag",A,m8).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function z(T,R){if(K||!_.call(this,T,R))return;var C=B(this,Q.call(this,T,R),T,R,"mouse");if(!C)return;o1(T.view).on("mousemove.drag",W,I2).on("mouseup.drag",I,I2),a2(T.view),U4(T),Y=!1,F=T.clientX,X=T.clientY,C("start",T)}function W(T){if(a0(T),!Y){var R=T.clientX-F,C=T.clientY-X;Y=R*R+C*C>H}U.mouse("drag",T)}function I(T){o1(T.view).on("mousemove.drag mouseup.drag",null),M5(T.view,Y),a0(T),U.mouse("end",T)}function O(T,R){if(!_.call(this,T,R))return;var C=T.changedTouches,f=Q.call(this,T,R),y=C.length,N,k;for(N=0;N<y;++N)if(k=B(this,f,T,R,C[N].identifier,C[N]))U4(T),k("start",T,C[N])}function A(T){var R=T.changedTouches,C=R.length,f,y;for(f=0;f<C;++f)if(y=U[R[f].identifier])a0(T),y("drag",T,R[f])}function w(T){var R=T.changedTouches,C=R.length,f,y;if(K)clearTimeout(K);K=setTimeout(function(){K=null},500);for(f=0;f<C;++f)if(y=U[R[f].identifier])U4(T),y("end",T,R[f])}function B(T,R,C,f,y,N){var k=G.copy(),E=$0(N||C,R),c,l,S;if((S=J.call(T,new R5("beforestart",{sourceEvent:C,target:L,identifier:y,active:Z,x:E[0],y:E[1],dx:0,dy:0,dispatch:k}),f))==null)return;return c=S.x-E[0]||0,l=S.y-E[1]||0,function j(D,x,v){var m=E,P;switch(D){case"start":U[y]=j,P=Z++;break;case"end":delete U[y],--Z;case"drag":E=$0(v||x,R),P=Z;break}k.call(D,T,new R5(D,{sourceEvent:x,subject:S,target:L,identifier:y,active:P,x:E[0]+c,y:E[1]+l,dx:E[0]-m[0],dy:E[1]-m[1],dispatch:k}),f)}}return L.filter=function(T){return arguments.length?(_=typeof T==="function"?T:T5(!!T),L):_},L.container=function(T){return arguments.length?(Q=typeof T==="function"?T:T5(T),L):Q},L.subject=function(T){return arguments.length?(J=typeof T==="function"?T:T5(T),L):J},L.touchable=function(T){return arguments.length?(q=typeof T==="function"?T:T5(!!T),L):q},L.on=function(){var T=G.on.apply(G,arguments);return T===G?L:T},L.clickDistance=function(T){return arguments.length?(H=(T=+T)*T,L):Math.sqrt(H)},L}function I5(_,Q,J){_.prototype=Q.prototype=J,J.constructor=_}function i3(_,Q){var J=Object.create(_.prototype);for(var q in Q)J[q]=Q[q];return J}function w5(){}var P5=0.7,F4=1/P5,s2="\\s*([+-]?\\d+)\\s*",N5="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",b0="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Z$=/^#([0-9a-f]{3,8})$/,F$=new RegExp(`^rgb\\(${s2},${s2},${s2}\\)$`),H$=new RegExp(`^rgb\\(${b0},${b0},${b0}\\)$`),X$=new RegExp(`^rgba\\(${s2},${s2},${s2},${N5}\\)$`),K$=new RegExp(`^rgba\\(${b0},${b0},${b0},${N5}\\)$`),Y$=new RegExp(`^hsl\\(${N5},${b0},${b0}\\)$`),L$=new RegExp(`^hsla\\(${N5},${b0},${b0},${N5}\\)$`),g8={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};I5(w5,k0,{copy(_){return Object.assign(new this.constructor,this,_)},displayable(){return this.rgb().displayable()},hex:p8,formatHex:p8,formatHex8:z$,formatHsl:W$,formatRgb:c8,toString:c8});function p8(){return this.rgb().formatHex()}function z$(){return this.rgb().formatHex8()}function W$(){return s8(this).formatHsl()}function c8(){return this.rgb().formatRgb()}function k0(_){var Q,J;return _=(_+"").trim().toLowerCase(),(Q=Z$.exec(_))?(J=Q[1].length,Q=parseInt(Q[1],16),J===6?l8(Q):J===3?new K0(Q>>8&15|Q>>4&240,Q>>4&15|Q&240,(Q&15)<<4|Q&15,1):J===8?G4(Q>>24&255,Q>>16&255,Q>>8&255,(Q&255)/255):J===4?G4(Q>>12&15|Q>>8&240,Q>>8&15|Q>>4&240,Q>>4&15|Q&240,((Q&15)<<4|Q&15)/255):null):(Q=F$.exec(_))?new K0(Q[1],Q[2],Q[3],1):(Q=H$.exec(_))?new K0(Q[1]*255/100,Q[2]*255/100,Q[3]*255/100,1):(Q=X$.exec(_))?G4(Q[1],Q[2],Q[3],Q[4]):(Q=K$.exec(_))?G4(Q[1]*255/100,Q[2]*255/100,Q[3]*255/100,Q[4]):(Q=Y$.exec(_))?d8(Q[1],Q[2]/100,Q[3]/100,1):(Q=L$.exec(_))?d8(Q[1],Q[2]/100,Q[3]/100,Q[4]):g8.hasOwnProperty(_)?l8(g8[_]):_==="transparent"?new K0(NaN,NaN,NaN,0):null}function l8(_){return new K0(_>>16&255,_>>8&255,_&255,1)}function G4(_,Q,J,q){if(q<=0)_=Q=J=NaN;return new K0(_,Q,J,q)}function A$(_){if(!(_ instanceof w5))_=k0(_);if(!_)return new K0;return _=_.rgb(),new K0(_.r,_.g,_.b,_.opacity)}function t2(_,Q,J,q){return arguments.length===1?A$(_):new K0(_,Q,J,q==null?1:q)}function K0(_,Q,J,q){this.r=+_,this.g=+Q,this.b=+J,this.opacity=+q}I5(K0,t2,i3(w5,{brighter(_){return _=_==null?F4:Math.pow(F4,_),new K0(this.r*_,this.g*_,this.b*_,this.opacity)},darker(_){return _=_==null?P5:Math.pow(P5,_),new K0(this.r*_,this.g*_,this.b*_,this.opacity)},rgb(){return this},clamp(){return new K0(N2(this.r),N2(this.g),N2(this.b),H4(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:r8,formatHex:r8,formatHex8:B$,formatRgb:i8,toString:i8}));function r8(){return`#${P2(this.r)}${P2(this.g)}${P2(this.b)}`}function B$(){return`#${P2(this.r)}${P2(this.g)}${P2(this.b)}${P2((isNaN(this.opacity)?1:this.opacity)*255)}`}function i8(){let _=H4(this.opacity);return`${_===1?"rgb(":"rgba("}${N2(this.r)}, ${N2(this.g)}, ${N2(this.b)}${_===1?")":`, ${_})`}`}function H4(_){return isNaN(_)?1:Math.max(0,Math.min(1,_))}function N2(_){return Math.max(0,Math.min(255,Math.round(_)||0))}function P2(_){return _=N2(_),(_<16?"0":"")+_.toString(16)}function d8(_,Q,J,q){if(q<=0)_=Q=J=NaN;else if(J<=0||J>=1)_=Q=NaN;else if(Q<=0)_=NaN;return new y0(_,Q,J,q)}function s8(_){if(_ instanceof y0)return new y0(_.h,_.s,_.l,_.opacity);if(!(_ instanceof w5))_=k0(_);if(!_)return new y0;if(_ instanceof y0)return _;_=_.rgb();var Q=_.r/255,J=_.g/255,q=_.b/255,U=Math.min(Q,J,q),G=Math.max(Q,J,q),Z=NaN,F=G-U,X=(G+U)/2;if(F){if(Q===G)Z=(J-q)/F+(J<q)*6;else if(J===G)Z=(q-Q)/F+2;else Z=(Q-J)/F+4;F/=X<0.5?G+U:2-G-U,Z*=60}else F=X>0&&X<1?0:Z;return new y0(Z,F,X,_.opacity)}function t8(_,Q,J,q){return arguments.length===1?s8(_):new y0(_,Q,J,q==null?1:q)}function y0(_,Q,J,q){this.h=+_,this.s=+Q,this.l=+J,this.opacity=+q}I5(y0,t8,i3(w5,{brighter(_){return _=_==null?F4:Math.pow(F4,_),new y0(this.h,this.s,this.l*_,this.opacity)},darker(_){return _=_==null?P5:Math.pow(P5,_),new y0(this.h,this.s,this.l*_,this.opacity)},rgb(){var _=this.h%360+(this.h<0)*360,Q=isNaN(_)||isNaN(this.s)?0:this.s,J=this.l,q=J+(J<0.5?J:1-J)*Q,U=2*J-q;return new K0(d3(_>=240?_-240:_+120,U,q),d3(_,U,q),d3(_<120?_+240:_-120,U,q),this.opacity)},clamp(){return new y0(a8(this.h),Z4(this.s),Z4(this.l),H4(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 _=H4(this.opacity);return`${_===1?"hsl(":"hsla("}${a8(this.h)}, ${Z4(this.s)*100}%, ${Z4(this.l)*100}%${_===1?")":`, ${_})`}`}}));function a8(_){return _=(_||0)%360,_<0?_+360:_}function Z4(_){return Math.max(0,Math.min(1,_||0))}function d3(_,Q,J){return(_<60?Q+(J-Q)*_/60:_<180?J:_<240?Q+(J-Q)*(240-_)/60:Q)*255}function a3(_,Q,J,q,U){var G=_*_,Z=G*_;return((1-3*_+3*G-Z)*Q+(4-6*G+3*Z)*J+(1+3*_+3*G-3*Z)*q+Z*U)/6}function s3(_){var Q=_.length-1;return function(J){var q=J<=0?J=0:J>=1?(J=1,Q-1):Math.floor(J*Q),U=_[q],G=_[q+1],Z=q>0?_[q-1]:2*U-G,F=q<Q-1?_[q+2]:2*G-U;return a3((J-q/Q)*Q,Z,U,G,F)}}function t3(_){var Q=_.length;return function(J){var q=Math.floor(((J%=1)<0?++J:J)*Q),U=_[(q+Q-1)%Q],G=_[q%Q],Z=_[(q+1)%Q],F=_[(q+2)%Q];return a3((J-q/Q)*Q,U,G,Z,F)}}var f5=(_)=>()=>_;function M$(_,Q){return function(J){return _+J*Q}}function T$(_,Q,J){return _=Math.pow(_,J),Q=Math.pow(Q,J)-_,J=1/J,function(q){return Math.pow(_+q*Q,J)}}function o8(_){return(_=+_)===1?X4:function(Q,J){return J-Q?T$(Q,J,_):f5(isNaN(Q)?J:Q)}}function X4(_,Q){var J=Q-_;return J?M$(_,J):f5(isNaN(_)?Q:_)}var w2=function _(Q){var J=o8(Q);function q(U,G){var Z=J((U=t2(U)).r,(G=t2(G)).r),F=J(U.g,G.g),X=J(U.b,G.b),Y=X4(U.opacity,G.opacity);return function(K){return U.r=Z(K),U.g=F(K),U.b=X(K),U.opacity=Y(K),U+""}}return q.gamma=_,q}(1);function n8(_){return function(Q){var J=Q.length,q=Array(J),U=Array(J),G=Array(J),Z,F;for(Z=0;Z<J;++Z)F=t2(Q[Z]),q[Z]=F.r||0,U[Z]=F.g||0,G[Z]=F.b||0;return q=_(q),U=_(U),G=_(G),F.opacity=1,function(X){return F.r=q(X),F.g=U(X),F.b=G(X),F+""}}}var R$=n8(s3),O$=n8(t3);function o3(_,Q){if(!Q)Q=[];var J=_?Math.min(Q.length,_.length):0,q=Q.slice(),U;return function(G){for(U=0;U<J;++U)q[U]=_[U]*(1-G)+Q[U]*G;return q}}function e8(_){return ArrayBuffer.isView(_)&&!(_ instanceof DataView)}function _7(_,Q){var J=Q?Q.length:0,q=_?Math.min(J,_.length):0,U=Array(q),G=Array(J),Z;for(Z=0;Z<q;++Z)U[Z]=E0(_[Z],Q[Z]);for(;Z<J;++Z)G[Z]=Q[Z];return function(F){for(Z=0;Z<q;++Z)G[Z]=U[Z](F);return G}}function n3(_,Q){var J=new Date;return _=+_,Q=+Q,function(q){return J.setTime(_*(1-q)+Q*q),J}}function q0(_,Q){return _=+_,Q=+Q,function(J){return _*(1-J)+Q*J}}function e3(_,Q){var J={},q={},U;if(_===null||typeof _!=="object")_={};if(Q===null||typeof Q!=="object")Q={};for(U in Q)if(U in _)J[U]=E0(_[U],Q[U]);else q[U]=Q[U];return function(G){for(U in J)q[U]=J[U](G);return q}}var Q6=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,_6=new RegExp(Q6.source,"g");function I$(_){return function(){return _}}function P$(_){return function(Q){return _(Q)+""}}function o2(_,Q){var J=Q6.lastIndex=_6.lastIndex=0,q,U,G,Z=-1,F=[],X=[];_=_+"",Q=Q+"";while((q=Q6.exec(_))&&(U=_6.exec(Q))){if((G=U.index)>J)if(G=Q.slice(J,G),F[Z])F[Z]+=G;else F[++Z]=G;if((q=q[0])===(U=U[0]))if(F[Z])F[Z]+=U;else F[++Z]=U;else F[++Z]=null,X.push({i:Z,x:q0(q,U)});J=_6.lastIndex}if(J<Q.length)if(G=Q.slice(J),F[Z])F[Z]+=G;else F[++Z]=G;return F.length<2?X[0]?P$(X[0].x):I$(Q):(Q=X.length,function(Y){for(var K=0,H;K<Q;++K)F[(H=X[K]).i]=H.x(Y);return F.join("")})}function E0(_,Q){var J=typeof Q,q;return Q==null||J==="boolean"?f5(Q):(J==="number"?q0:J==="string"?(q=k0(Q))?(Q=q,w2):o2:Q instanceof k0?w2:Q instanceof Date?n3:e8(Q)?o3:Array.isArray(Q)?_7:typeof Q.valueOf!=="function"&&typeof Q.toString!=="function"||isNaN(Q)?e3:q0)(_,Q)}var Q7=180/Math.PI,K4={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Y4(_,Q,J,q,U,G){var Z,F,X;if(Z=Math.sqrt(_*_+Q*Q))_/=Z,Q/=Z;if(X=_*J+Q*q)J-=_*X,q-=Q*X;if(F=Math.sqrt(J*J+q*q))J/=F,q/=F,X/=F;if(_*q<Q*J)_=-_,Q=-Q,X=-X,Z=-Z;return{translateX:U,translateY:G,rotate:Math.atan2(Q,_)*Q7,skewX:Math.atan(X)*Q7,scaleX:Z,scaleY:F}}var L4;function J7(_){let Q=new(typeof DOMMatrix==="function"?DOMMatrix:WebKitCSSMatrix)(_+"");return Q.isIdentity?K4:Y4(Q.a,Q.b,Q.c,Q.d,Q.e,Q.f)}function $7(_){if(_==null)return K4;if(!L4)L4=document.createElementNS("http://www.w3.org/2000/svg","g");if(L4.setAttribute("transform",_),!(_=L4.transform.baseVal.consolidate()))return K4;return _=_.matrix,Y4(_.a,_.b,_.c,_.d,_.e,_.f)}function q7(_,Q,J,q){function U(Y){return Y.length?Y.pop()+" ":""}function G(Y,K,H,L,z,W){if(Y!==H||K!==L){var I=z.push("translate(",null,Q,null,J);W.push({i:I-4,x:q0(Y,H)},{i:I-2,x:q0(K,L)})}else if(H||L)z.push("translate("+H+Q+L+J)}function Z(Y,K,H,L){if(Y!==K){if(Y-K>180)K+=360;else if(K-Y>180)Y+=360;L.push({i:H.push(U(H)+"rotate(",null,q)-2,x:q0(Y,K)})}else if(K)H.push(U(H)+"rotate("+K+q)}function F(Y,K,H,L){if(Y!==K)L.push({i:H.push(U(H)+"skewX(",null,q)-2,x:q0(Y,K)});else if(K)H.push(U(H)+"skewX("+K+q)}function X(Y,K,H,L,z,W){if(Y!==H||K!==L){var I=z.push(U(z)+"scale(",null,",",null,")");W.push({i:I-4,x:q0(Y,H)},{i:I-2,x:q0(K,L)})}else if(H!==1||L!==1)z.push(U(z)+"scale("+H+","+L+")")}return function(Y,K){var H=[],L=[];return Y=_(Y),K=_(K),G(Y.translateX,Y.translateY,K.translateX,K.translateY,H,L),Z(Y.rotate,K.rotate,H,L),F(Y.skewX,K.skewX,H,L),X(Y.scaleX,Y.scaleY,K.scaleX,K.scaleY,H,L),Y=K=null,function(z){var W=-1,I=L.length,O;while(++W<I)H[(O=L[W]).i]=O.x(z);return H.join("")}}}var J6=q7(J7,"px, ","px)","deg)"),$6=q7($7,", ",")",")");var N$=0.000000000001;function U7(_){return((_=Math.exp(_))+1/_)/2}function w$(_){return((_=Math.exp(_))-1/_)/2}function f$(_){return((_=Math.exp(2*_))-1)/(_+1)}var f2=function _(Q,J,q){function U(G,Z){var F=G[0],X=G[1],Y=G[2],K=Z[0],H=Z[1],L=Z[2],z=K-F,W=H-X,I=z*z+W*W,O,A;if(I<N$)A=Math.log(L/Y)/Q,O=function(f){return[F+f*z,X+f*W,Y*Math.exp(Q*f*A)]};else{var w=Math.sqrt(I),B=(L*L-Y*Y+q*I)/(2*Y*J*w),T=(L*L-Y*Y-q*I)/(2*L*J*w),R=Math.log(Math.sqrt(B*B+1)-B),C=Math.log(Math.sqrt(T*T+1)-T);A=(C-R)/Q,O=function(f){var y=f*A,N=U7(R),k=Y/(J*w)*(N*f$(Q*y+R)-w$(R));return[F+k*z,X+k*W,Y*N/U7(Q*y+R)]}}return O.duration=A*1000*Q/Math.SQRT2,O}return U.rho=function(G){var Z=Math.max(0.001,+G),F=Z*Z,X=F*F;return _(Z,F,X)},U}(Math.SQRT2,2,4);var n2=0,S5=0,C5=0,Z7=1000,z4,y5,W4=0,C2=0,A4=0,k5=typeof performance==="object"&&performance.now?performance:Date,F7=typeof window==="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(_){setTimeout(_,17)};function j5(){return C2||(F7(C$),C2=k5.now()+A4)}function C$(){C2=0}function v5(){this._call=this._time=this._next=null}v5.prototype=B4.prototype={constructor:v5,restart:function(_,Q,J){if(typeof _!=="function")throw TypeError("callback is not a function");if(J=(J==null?j5():+J)+(Q==null?0:+Q),!this._next&&y5!==this){if(y5)y5._next=this;else z4=this;y5=this}this._call=_,this._time=J,q6()},stop:function(){if(this._call)this._call=null,this._time=1/0,q6()}};function B4(_,Q,J){var q=new v5;return q.restart(_,Q,J),q}function H7(){j5(),++n2;var _=z4,Q;while(_){if((Q=C2-_._time)>=0)_._call.call(void 0,Q);_=_._next}--n2}function G7(){C2=(W4=k5.now())+A4,n2=S5=0;try{H7()}finally{n2=0,y$(),C2=0}}function S$(){var _=k5.now(),Q=_-W4;if(Q>Z7)A4-=Q,W4=_}function y$(){var _,Q=z4,J,q=1/0;while(Q)if(Q._call){if(q>Q._time)q=Q._time;_=Q,Q=Q._next}else J=Q._next,Q._next=null,Q=_?_._next=J:z4=J;y5=_,q6(q)}function q6(_){if(n2)return;if(S5)S5=clearTimeout(S5);var Q=_-C2;if(Q>24){if(_<1/0)S5=setTimeout(G7,_-k5.now()-A4);if(C5)C5=clearInterval(C5)}else{if(!C5)W4=k5.now(),C5=setInterval(S$,Z7);n2=1,F7(G7)}}function V5(_,Q,J){var q=new v5;return Q=Q==null?0:+Q,q.restart((U)=>{q.stop(),_(U+Q)},Q,J),q}var k$=O2("start","end","cancel","interrupt"),v$=[],Y7=0,X7=1,T4=2,M4=3,K7=4,R4=5,u5=6;function s0(_,Q,J,q,U,G){var Z=_.__transition;if(!Z)_.__transition={};else if(J in Z)return;j$(_,J,{name:Q,index:q,group:U,on:k$,tween:v$,time:G.time,delay:G.delay,duration:G.duration,ease:G.ease,timer:null,state:Y7})}function h5(_,Q){var J=n1(_,Q);if(J.state>Y7)throw Error("too late; already scheduled");return J}function J0(_,Q){var J=n1(_,Q);if(J.state>M4)throw Error("too late; already running");return J}function n1(_,Q){var J=_.__transition;if(!J||!(J=J[Q]))throw Error("transition not found");return J}function j$(_,Q,J){var q=_.__transition,U;q[Q]=J,J.timer=B4(G,0,J.time);function G(Y){if(J.state=X7,J.timer.restart(Z,J.delay,J.time),J.delay<=Y)Z(Y-J.delay)}function Z(Y){var K,H,L,z;if(J.state!==X7)return X();for(K in q){if(z=q[K],z.name!==J.name)continue;if(z.state===M4)return V5(Z);if(z.state===K7)z.state=u5,z.timer.stop(),z.on.call("interrupt",_,_.__data__,z.index,z.group),delete q[K];else if(+K<Q)z.state=u5,z.timer.stop(),z.on.call("cancel",_,_.__data__,z.index,z.group),delete q[K]}if(V5(function(){if(J.state===M4)J.state=K7,J.timer.restart(F,J.delay,J.time),F(Y)}),J.state=T4,J.on.call("start",_,_.__data__,J.index,J.group),J.state!==T4)return;J.state=M4,U=Array(L=J.tween.length);for(K=0,H=-1;K<L;++K)if(z=J.tween[K].value.call(_,_.__data__,J.index,J.group))U[++H]=z;U.length=H+1}function F(Y){var K=Y<J.duration?J.ease.call(null,Y/J.duration):(J.timer.restart(X),J.state=R4,1),H=-1,L=U.length;while(++H<L)U[H].call(_,K);if(J.state===R4)J.on.call("end",_,_.__data__,J.index,J.group),X()}function X(){J.state=u5,J.timer.stop(),delete q[Q];for(var Y in q)return;delete _.__transition}}function H2(_,Q){var J=_.__transition,q,U,G=!0,Z;if(!J)return;Q=Q==null?null:Q+"";for(Z in J){if((q=J[Z]).name!==Q){G=!1;continue}U=q.state>T4&&q.state<R4,q.state=u5,q.timer.stop(),q.on.call(U?"interrupt":"cancel",_,_.__data__,q.index,q.group),delete J[Z]}if(G)delete _.__transition}function U6(_){return this.each(function(){H2(this,_)})}function V$(_,Q){var J,q;return function(){var U=J0(this,_),G=U.tween;if(G!==J){q=J=G;for(var Z=0,F=q.length;Z<F;++Z)if(q[Z].name===Q){q=q.slice(),q.splice(Z,1);break}}U.tween=q}}function u$(_,Q,J){var q,U;if(typeof J!=="function")throw Error();return function(){var G=J0(this,_),Z=G.tween;if(Z!==q){U=(q=Z).slice();for(var F={name:Q,value:J},X=0,Y=U.length;X<Y;++X)if(U[X].name===Q){U[X]=F;break}if(X===Y)U.push(F)}G.tween=U}}function G6(_,Q){var J=this._id;if(_+="",arguments.length<2){var q=n1(this.node(),J).tween;for(var U=0,G=q.length,Z;U<G;++U)if((Z=q[U]).name===_)return Z.value;return null}return this.each((Q==null?V$:u$)(J,_,Q))}function e2(_,Q,J){var q=_._id;return _.each(function(){var U=J0(this,q);(U.value||(U.value={}))[Q]=J.apply(this,arguments)}),function(U){return n1(U,q).value[Q]}}function D5(_,Q){var J;return(typeof Q==="number"?q0:Q instanceof k0?w2:(J=k0(Q))?(Q=J,w2):o2)(_,Q)}function h$(_){return function(){this.removeAttribute(_)}}function D$(_){return function(){this.removeAttributeNS(_.space,_.local)}}function b$(_,Q,J){var q,U=J+"",G;return function(){var Z=this.getAttribute(_);return Z===U?null:Z===q?G:G=Q(q=Z,J)}}function E$(_,Q,J){var q,U=J+"",G;return function(){var Z=this.getAttributeNS(_.space,_.local);return Z===U?null:Z===q?G:G=Q(q=Z,J)}}function x$(_,Q,J){var q,U,G;return function(){var Z,F=J(this),X;if(F==null)return void this.removeAttribute(_);return Z=this.getAttribute(_),X=F+"",Z===X?null:Z===q&&X===U?G:(U=X,G=Q(q=Z,F))}}function m$(_,Q,J){var q,U,G;return function(){var Z,F=J(this),X;if(F==null)return void this.removeAttributeNS(_.space,_.local);return Z=this.getAttributeNS(_.space,_.local),X=F+"",Z===X?null:Z===q&&X===U?G:(U=X,G=Q(q=Z,F))}}function Z6(_,Q){var J=D0(_),q=J==="transform"?$6:D5;return this.attrTween(_,typeof Q==="function"?(J.local?m$:x$)(J,q,e2(this,"attr."+_,Q)):Q==null?(J.local?D$:h$)(J):(J.local?E$:b$)(J,q,Q))}function g$(_,Q){return function(J){this.setAttribute(_,Q.call(this,J))}}function p$(_,Q){return function(J){this.setAttributeNS(_.space,_.local,Q.call(this,J))}}function c$(_,Q){var J,q;function U(){var G=Q.apply(this,arguments);if(G!==q)J=(q=G)&&p$(_,G);return J}return U._value=Q,U}function l$(_,Q){var J,q;function U(){var G=Q.apply(this,arguments);if(G!==q)J=(q=G)&&g$(_,G);return J}return U._value=Q,U}function F6(_,Q){var J="attr."+_;if(arguments.length<2)return(J=this.tween(J))&&J._value;if(Q==null)return this.tween(J,null);if(typeof Q!=="function")throw Error();var q=D0(_);return this.tween(J,(q.local?c$:l$)(q,Q))}function r$(_,Q){return function(){h5(this,_).delay=+Q.apply(this,arguments)}}function i$(_,Q){return Q=+Q,function(){h5(this,_).delay=Q}}function H6(_){var Q=this._id;return arguments.length?this.each((typeof _==="function"?r$:i$)(Q,_)):n1(this.node(),Q).delay}function d$(_,Q){return function(){J0(this,_).duration=+Q.apply(this,arguments)}}function a$(_,Q){return Q=+Q,function(){J0(this,_).duration=Q}}function X6(_){var Q=this._id;return arguments.length?this.each((typeof _==="function"?d$:a$)(Q,_)):n1(this.node(),Q).duration}function s$(_,Q){if(typeof Q!=="function")throw Error();return function(){J0(this,_).ease=Q}}function K6(_){var Q=this._id;return arguments.length?this.each(s$(Q,_)):n1(this.node(),Q).ease}function t$(_,Q){return function(){var J=Q.apply(this,arguments);if(typeof J!=="function")throw Error();J0(this,_).ease=J}}function Y6(_){if(typeof _!=="function")throw Error();return this.each(t$(this._id,_))}function L6(_){if(typeof _!=="function")_=i2(_);for(var Q=this._groups,J=Q.length,q=Array(J),U=0;U<J;++U)for(var G=Q[U],Z=G.length,F=q[U]=[],X,Y=0;Y<Z;++Y)if((X=G[Y])&&_.call(X,X.__data__,Y,G))F.push(X);return new H0(q,this._parents,this._name,this._id)}function z6(_){if(_._id!==this._id)throw Error();for(var Q=this._groups,J=_._groups,q=Q.length,U=J.length,G=Math.min(q,U),Z=Array(q),F=0;F<G;++F)for(var X=Q[F],Y=J[F],K=X.length,H=Z[F]=Array(K),L,z=0;z<K;++z)if(L=X[z]||Y[z])H[z]=L;for(;F<q;++F)Z[F]=Q[F];return new H0(Z,this._parents,this._name,this._id)}function o$(_){return(_+"").trim().split(/^|\s+/).every(function(Q){var J=Q.indexOf(".");if(J>=0)Q=Q.slice(0,J);return!Q||Q==="start"})}function n$(_,Q,J){var q,U,G=o$(Q)?h5:J0;return function(){var Z=G(this,_),F=Z.on;if(F!==q)(U=(q=F).copy()).on(Q,J);Z.on=U}}function W6(_,Q){var J=this._id;return arguments.length<2?n1(this.node(),J).on.on(_):this.each(n$(J,_,Q))}function e$(_){return function(){var Q=this.parentNode;for(var J in this.__transition)if(+J!==_)return;if(Q)Q.removeChild(this)}}function A6(){return this.on("end.remove",e$(this._id))}function B6(_){var Q=this._name,J=this._id;if(typeof _!=="function")_=Z2(_);for(var q=this._groups,U=q.length,G=Array(U),Z=0;Z<U;++Z)for(var F=q[Z],X=F.length,Y=G[Z]=Array(X),K,H,L=0;L<X;++L)if((K=F[L])&&(H=_.call(K,K.__data__,L,F))){if("__data__"in K)H.__data__=K.__data__;Y[L]=H,s0(Y[L],Q,J,L,Y,n1(K,J))}return new H0(G,this._parents,Q,J)}function M6(_){var Q=this._name,J=this._id;if(typeof _!=="function")_=d2(_);for(var q=this._groups,U=q.length,G=[],Z=[],F=0;F<U;++F)for(var X=q[F],Y=X.length,K,H=0;H<Y;++H)if(K=X[H]){for(var L=_.call(K,K.__data__,H,X),z,W=n1(K,J),I=0,O=L.length;I<O;++I)if(z=L[I])s0(z,Q,J,I,L,W);G.push(L),Z.push(K)}return new H0(G,Z,Q,J)}var _q=d0.prototype.constructor;function T6(){return new _q(this._groups,this._parents)}function Qq(_,Q){var J,q,U;return function(){var G=F2(this,_),Z=(this.style.removeProperty(_),F2(this,_));return G===Z?null:G===J&&Z===q?U:U=Q(J=G,q=Z)}}function L7(_){return function(){this.style.removeProperty(_)}}function Jq(_,Q,J){var q,U=J+"",G;return function(){var Z=F2(this,_);return Z===U?null:Z===q?G:G=Q(q=Z,J)}}function $q(_,Q,J){var q,U,G;return function(){var Z=F2(this,_),F=J(this),X=F+"";if(F==null)X=F=(this.style.removeProperty(_),F2(this,_));return Z===X?null:Z===q&&X===U?G:(U=X,G=Q(q=Z,F))}}function qq(_,Q){var J,q,U,G="style."+Q,Z="end."+G,F;return function(){var X=J0(this,_),Y=X.on,K=X.value[G]==null?F||(F=L7(Q)):void 0;if(Y!==J||U!==K)(q=(J=Y).copy()).on(Z,U=K);X.on=q}}function R6(_,Q,J){var q=(_+="")==="transform"?J6:D5;return Q==null?this.styleTween(_,Qq(_,q)).on("end.style."+_,L7(_)):typeof Q==="function"?this.styleTween(_,$q(_,q,e2(this,"style."+_,Q))).each(qq(this._id,_)):this.styleTween(_,Jq(_,q,Q),J).on("end.style."+_,null)}function Uq(_,Q,J){return function(q){this.style.setProperty(_,Q.call(this,q),J)}}function Gq(_,Q,J){var q,U;function G(){var Z=Q.apply(this,arguments);if(Z!==U)q=(U=Z)&&Uq(_,Z,J);return q}return G._value=Q,G}function O6(_,Q,J){var q="style."+(_+="");if(arguments.length<2)return(q=this.tween(q))&&q._value;if(Q==null)return this.tween(q,null);if(typeof Q!=="function")throw Error();return this.tween(q,Gq(_,Q,J==null?"":J))}function Zq(_){return function(){this.textContent=_}}function Fq(_){return function(){var Q=_(this);this.textContent=Q==null?"":Q}}function I6(_){return this.tween("text",typeof _==="function"?Fq(e2(this,"text",_)):Zq(_==null?"":_+""))}function Hq(_){return function(Q){this.textContent=_.call(this,Q)}}function Xq(_){var Q,J;function q(){var U=_.apply(this,arguments);if(U!==J)Q=(J=U)&&Hq(U);return Q}return q._value=_,q}function P6(_){var Q="text";if(arguments.length<1)return(Q=this.tween(Q))&&Q._value;if(_==null)return this.tween(Q,null);if(typeof _!=="function")throw Error();return this.tween(Q,Xq(_))}function N6(){var _=this._name,Q=this._id,J=O4();for(var q=this._groups,U=q.length,G=0;G<U;++G)for(var Z=q[G],F=Z.length,X,Y=0;Y<F;++Y)if(X=Z[Y]){var K=n1(X,Q);s0(X,_,J,Y,Z,{time:K.time+K.delay+K.duration,delay:0,duration:K.duration,ease:K.ease})}return new H0(q,this._parents,_,J)}function w6(){var _,Q,J=this,q=J._id,U=J.size();return new Promise(function(G,Z){var F={value:Z},X={value:function(){if(--U===0)G()}};if(J.each(function(){var Y=J0(this,q),K=Y.on;if(K!==_)Q=(_=K).copy(),Q._.cancel.push(F),Q._.interrupt.push(F),Q._.end.push(X);Y.on=Q}),U===0)G()})}var Kq=0;function H0(_,Q,J,q){this._groups=_,this._parents=Q,this._name=J,this._id=q}function z7(_){return d0().transition(_)}function O4(){return++Kq}var t0=d0.prototype;H0.prototype=z7.prototype={constructor:H0,select:B6,selectAll:M6,selectChild:t0.selectChild,selectChildren:t0.selectChildren,filter:L6,merge:z6,selection:T6,transition:N6,call:t0.call,nodes:t0.nodes,node:t0.node,size:t0.size,empty:t0.empty,each:t0.each,on:W6,attr:Z6,attrTween:F6,style:R6,styleTween:O6,text:I6,textTween:P6,remove:A6,tween:G6,delay:H6,duration:X6,ease:K6,easeVarying:Y6,end:w6,[Symbol.iterator]:t0[Symbol.iterator]};function I4(_){return((_*=2)<=1?_*_*_:(_-=2)*_*_+2)/2}var Yq={time:null,delay:0,duration:250,ease:I4};function Lq(_,Q){var J;while(!(J=_.__transition)||!(J=J[Q]))if(!(_=_.parentNode))throw Error(`transition ${Q} not found`);return J}function f6(_){var Q,J;if(_ instanceof H0)Q=_._id,_=_._name;else Q=O4(),(J=Yq).time=j5(),_=_==null?null:_+"";for(var q=this._groups,U=q.length,G=0;G<U;++G)for(var Z=q[G],F=Z.length,X,Y=0;Y<F;++Y)if(X=Z[Y])s0(X,_,Q,Y,Z,J||Lq(X,Q));return new H0(q,this._parents,_,Q)}d0.prototype.interrupt=U6;d0.prototype.transition=f6;var b5=(_)=>()=>_;function C6(_,{sourceEvent:Q,target:J,transform:q,dispatch:U}){Object.defineProperties(this,{type:{value:_,enumerable:!0,configurable:!0},sourceEvent:{value:Q,enumerable:!0,configurable:!0},target:{value:J,enumerable:!0,configurable:!0},transform:{value:q,enumerable:!0,configurable:!0},_:{value:U}})}function v0(_,Q,J){this.k=_,this.x=Q,this.y=J}v0.prototype={constructor:v0,scale:function(_){return _===1?this:new v0(this.k*_,this.x,this.y)},translate:function(_,Q){return _===0&Q===0?this:new v0(this.k,this.x+this.k*_,this.y+this.k*Q)},apply:function(_){return[_[0]*this.k+this.x,_[1]*this.k+this.y]},applyX:function(_){return _*this.k+this.x},applyY:function(_){return _*this.k+this.y},invert:function(_){return[(_[0]-this.x)/this.k,(_[1]-this.y)/this.k]},invertX:function(_){return(_-this.x)/this.k},invertY:function(_){return(_-this.y)/this.k},rescaleX:function(_){return _.copy().domain(_.range().map(this.invertX,this).map(_.invert,_))},rescaleY:function(_){return _.copy().domain(_.range().map(this.invertY,this).map(_.invert,_))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var S2=new v0(1,0,0);E5.prototype=v0.prototype;function E5(_){while(!_.__zoom)if(!(_=_.parentNode))return S2;return _.__zoom}function P4(_){_.stopImmediatePropagation()}function y2(_){_.preventDefault(),_.stopImmediatePropagation()}function zq(_){return(!_.ctrlKey||_.type==="wheel")&&!_.button}function Wq(){var _=this;if(_ instanceof SVGElement){if(_=_.ownerSVGElement||_,_.hasAttribute("viewBox"))return _=_.viewBox.baseVal,[[_.x,_.y],[_.x+_.width,_.y+_.height]];return[[0,0],[_.width.baseVal.value,_.height.baseVal.value]]}return[[0,0],[_.clientWidth,_.clientHeight]]}function W7(){return this.__zoom||S2}function Aq(_){return-_.deltaY*(_.deltaMode===1?0.05:_.deltaMode?1:0.002)*(_.ctrlKey?10:1)}function Bq(){return navigator.maxTouchPoints||"ontouchstart"in this}function Mq(_,Q,J){var q=_.invertX(Q[0][0])-J[0][0],U=_.invertX(Q[1][0])-J[1][0],G=_.invertY(Q[0][1])-J[0][1],Z=_.invertY(Q[1][1])-J[1][1];return _.translate(U>q?(q+U)/2:Math.min(0,q)||Math.max(0,U),Z>G?(G+Z)/2:Math.min(0,G)||Math.max(0,Z))}function x5(){var _=zq,Q=Wq,J=Mq,q=Aq,U=Bq,G=[0,1/0],Z=[[-1/0,-1/0],[1/0,1/0]],F=250,X=f2,Y=O2("start","zoom","end"),K,H,L,z=500,W=150,I=0,O=10;function A(S){S.property("__zoom",W7).on("wheel.zoom",y,{passive:!1}).on("mousedown.zoom",N).on("dblclick.zoom",k).filter(U).on("touchstart.zoom",E).on("touchmove.zoom",c).on("touchend.zoom touchcancel.zoom",l).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}A.transform=function(S,j,D,x){var v=S.selection?S.selection():S;if(v.property("__zoom",W7),S!==v)R(S,j,D,x);else v.interrupt().each(function(){C(this,arguments).event(x).start().zoom(null,typeof j==="function"?j.apply(this,arguments):j).end()})},A.scaleBy=function(S,j,D,x){A.scaleTo(S,function(){var v=this.__zoom.k,m=typeof j==="function"?j.apply(this,arguments):j;return v*m},D,x)},A.scaleTo=function(S,j,D,x){A.transform(S,function(){var v=Q.apply(this,arguments),m=this.__zoom,P=D==null?T(v):typeof D==="function"?D.apply(this,arguments):D,V=m.invert(P),b=typeof j==="function"?j.apply(this,arguments):j;return J(B(w(m,b),P,V),v,Z)},D,x)},A.translateBy=function(S,j,D,x){A.transform(S,function(){return J(this.__zoom.translate(typeof j==="function"?j.apply(this,arguments):j,typeof D==="function"?D.apply(this,arguments):D),Q.apply(this,arguments),Z)},null,x)},A.translateTo=function(S,j,D,x,v){A.transform(S,function(){var m=Q.apply(this,arguments),P=this.__zoom,V=x==null?T(m):typeof x==="function"?x.apply(this,arguments):x;return J(S2.translate(V[0],V[1]).scale(P.k).translate(typeof j==="function"?-j.apply(this,arguments):-j,typeof D==="function"?-D.apply(this,arguments):-D),m,Z)},x,v)};function w(S,j){return j=Math.max(G[0],Math.min(G[1],j)),j===S.k?S:new v0(j,S.x,S.y)}function B(S,j,D){var x=j[0]-D[0]*S.k,v=j[1]-D[1]*S.k;return x===S.x&&v===S.y?S:new v0(S.k,x,v)}function T(S){return[(+S[0][0]+ +S[1][0])/2,(+S[0][1]+ +S[1][1])/2]}function R(S,j,D,x){S.on("start.zoom",function(){C(this,arguments).event(x).start()}).on("interrupt.zoom end.zoom",function(){C(this,arguments).event(x).end()}).tween("zoom",function(){var v=this,m=arguments,P=C(v,m).event(x),V=Q.apply(v,m),b=D==null?T(V):typeof D==="function"?D.apply(v,m):D,u=Math.max(V[1][0]-V[0][0],V[1][1]-V[0][1]),t=v.__zoom,Q1=typeof j==="function"?j.apply(v,m):j,a=X(t.invert(b).concat(u/t.k),Q1.invert(b).concat(u/Q1.k));return function(o){if(o===1)o=Q1;else{var p=a(o),n=u/p[2];o=new v0(n,b[0]-p[0]*n,b[1]-p[1]*n)}P.zoom(null,o)}})}function C(S,j,D){return!D&&S.__zooming||new f(S,j)}function f(S,j){this.that=S,this.args=j,this.active=0,this.sourceEvent=null,this.extent=Q.apply(S,j),this.taps=0}f.prototype={event:function(S){if(S)this.sourceEvent=S;return this},start:function(){if(++this.active===1)this.that.__zooming=this,this.emit("start");return this},zoom:function(S,j){if(this.mouse&&S!=="mouse")this.mouse[1]=j.invert(this.mouse[0]);if(this.touch0&&S!=="touch")this.touch0[1]=j.invert(this.touch0[0]);if(this.touch1&&S!=="touch")this.touch1[1]=j.invert(this.touch1[0]);return this.that.__zoom=j,this.emit("zoom"),this},end:function(){if(--this.active===0)delete this.that.__zooming,this.emit("end");return this},emit:function(S){var j=o1(this.that).datum();Y.call(S,this.that,new C6(S,{sourceEvent:this.sourceEvent,target:A,type:S,transform:this.that.__zoom,dispatch:Y}),j)}};function y(S,...j){if(!_.apply(this,arguments))return;var D=C(this,j).event(S),x=this.__zoom,v=Math.max(G[0],Math.min(G[1],x.k*Math.pow(2,q.apply(this,arguments)))),m=$0(S);if(D.wheel){if(D.mouse[0][0]!==m[0]||D.mouse[0][1]!==m[1])D.mouse[1]=x.invert(D.mouse[0]=m);clearTimeout(D.wheel)}else if(x.k===v)return;else D.mouse=[m,x.invert(m)],H2(this),D.start();y2(S),D.wheel=setTimeout(P,W),D.zoom("mouse",J(B(w(x,v),D.mouse[0],D.mouse[1]),D.extent,Z));function P(){D.wheel=null,D.end()}}function N(S,...j){if(L||!_.apply(this,arguments))return;var D=S.currentTarget,x=C(this,j,!0).event(S),v=o1(S.view).on("mousemove.zoom",b,!0).on("mouseup.zoom",u,!0),m=$0(S,D),P=S.clientX,V=S.clientY;a2(S.view),P4(S),x.mouse=[m,this.__zoom.invert(m)],H2(this),x.start();function b(t){if(y2(t),!x.moved){var Q1=t.clientX-P,a=t.clientY-V;x.moved=Q1*Q1+a*a>I}x.event(t).zoom("mouse",J(B(x.that.__zoom,x.mouse[0]=$0(t,D),x.mouse[1]),x.extent,Z))}function u(t){v.on("mousemove.zoom mouseup.zoom",null),M5(t.view,x.moved),y2(t),x.event(t).end()}}function k(S,...j){if(!_.apply(this,arguments))return;var D=this.__zoom,x=$0(S.changedTouches?S.changedTouches[0]:S,this),v=D.invert(x),m=D.k*(S.shiftKey?0.5:2),P=J(B(w(D,m),x,v),Q.apply(this,j),Z);if(y2(S),F>0)o1(this).transition().duration(F).call(R,P,x,S);else o1(this).call(A.transform,P,x,S)}function E(S,...j){if(!_.apply(this,arguments))return;var D=S.touches,x=D.length,v=C(this,j,S.changedTouches.length===x).event(S),m,P,V,b;P4(S);for(P=0;P<x;++P)if(V=D[P],b=$0(V,this),b=[b,this.__zoom.invert(b),V.identifier],!v.touch0)v.touch0=b,m=!0,v.taps=1+!!K;else if(!v.touch1&&v.touch0[2]!==b[2])v.touch1=b,v.taps=0;if(K)K=clearTimeout(K);if(m){if(v.taps<2)H=b[0],K=setTimeout(function(){K=null},z);H2(this),v.start()}}function c(S,...j){if(!this.__zooming)return;var D=C(this,j).event(S),x=S.changedTouches,v=x.length,m,P,V,b;y2(S);for(m=0;m<v;++m)if(P=x[m],V=$0(P,this),D.touch0&&D.touch0[2]===P.identifier)D.touch0[0]=V;else if(D.touch1&&D.touch1[2]===P.identifier)D.touch1[0]=V;if(P=D.that.__zoom,D.touch1){var u=D.touch0[0],t=D.touch0[1],Q1=D.touch1[0],a=D.touch1[1],o=(o=Q1[0]-u[0])*o+(o=Q1[1]-u[1])*o,p=(p=a[0]-t[0])*p+(p=a[1]-t[1])*p;P=w(P,Math.sqrt(o/p)),V=[(u[0]+Q1[0])/2,(u[1]+Q1[1])/2],b=[(t[0]+a[0])/2,(t[1]+a[1])/2]}else if(D.touch0)V=D.touch0[0],b=D.touch0[1];else return;D.zoom("touch",J(B(P,V,b),D.extent,Z))}function l(S,...j){if(!this.__zooming)return;var D=C(this,j).event(S),x=S.changedTouches,v=x.length,m,P;if(P4(S),L)clearTimeout(L);L=setTimeout(function(){L=null},z);for(m=0;m<v;++m)if(P=x[m],D.touch0&&D.touch0[2]===P.identifier)delete D.touch0;else if(D.touch1&&D.touch1[2]===P.identifier)delete D.touch1;if(D.touch1&&!D.touch0)D.touch0=D.touch1,delete D.touch1;if(D.touch0)D.touch0[1]=this.__zoom.invert(D.touch0[0]);else if(D.end(),D.taps===2){if(P=$0(P,this),Math.hypot(H[0]-P[0],H[1]-P[1])<O){var V=o1(this).on("dblclick.zoom");if(V)V.apply(this,arguments)}}}return A.wheelDelta=function(S){return arguments.length?(q=typeof S==="function"?S:b5(+S),A):q},A.filter=function(S){return arguments.length?(_=typeof S==="function"?S:b5(!!S),A):_},A.touchable=function(S){return arguments.length?(U=typeof S==="function"?S:b5(!!S),A):U},A.extent=function(S){return arguments.length?(Q=typeof S==="function"?S:b5([[+S[0][0],+S[0][1]],[+S[1][0],+S[1][1]]]),A):Q},A.scaleExtent=function(S){return arguments.length?(G[0]=+S[0],G[1]=+S[1],A):[G[0],G[1]]},A.translateExtent=function(S){return arguments.length?(Z[0][0]=+S[0][0],Z[1][0]=+S[1][0],Z[0][1]=+S[0][1],Z[1][1]=+S[1][1],A):[[Z[0][0],Z[0][1]],[Z[1][0],Z[1][1]]]},A.constrain=function(S){return arguments.length?(J=S,A):J},A.duration=function(S){return arguments.length?(F=+S,A):F},A.interpolate=function(S){return arguments.length?(X=S,A):X},A.on=function(){var S=Y.on.apply(Y,arguments);return S===Y?A:S},A.clickDistance=function(S){return arguments.length?(I=(S=+S)*S,A):Math.sqrt(I)},A.tapDistance=function(S){return arguments.length?(O=+S,A):O},A}var X0={error001:(_="react")=>`Seems like you have not used ${_==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${_}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:(_)=>`Node type "${_}" 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:(_)=>`The old edge with id=${_} does not exist.`,error009:(_)=>`Marker type "${_}" doesn't exist.`,error008:(_,{id:Q,sourceHandle:J,targetHandle:q})=>`Couldn't create edge for ${_} handle id: "${_==="source"?J:q}", edge id: ${Q}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:(_)=>`Edge type "${_}" not found. Using fallback type "default".`,error012:(_)=>`Node with id "${_}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(_="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${_}/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:(_)=>`Edge with id "${_}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},$5=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],j6=["Enter"," ","Escape"],V6={"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:_,x:Q,y:J})=>`Moved selected node ${_}. New position, x: ${Q}, y: ${J}`,"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"},L2;(function(_){_.Strict="strict",_.Loose="loose"})(L2||(L2={}));var o0;(function(_){_.Free="free",_.Vertical="vertical",_.Horizontal="horizontal"})(o0||(o0={}));var k2;(function(_){_.Partial="partial",_.Full="full"})(k2||(k2={}));var u6={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},x0;(function(_){_.Bezier="default",_.Straight="straight",_.Step="step",_.SmoothStep="smoothstep",_.SimpleBezier="simplebezier"})(x0||(x0={}));var Q5;(function(_){_.Arrow="arrow",_.ArrowClosed="arrowclosed"})(Q5||(Q5={}));var H1;(function(_){_.Left="left",_.Top="top",_.Right="right",_.Bottom="bottom"})(H1||(H1={}));var A7={[H1.Left]:H1.Right,[H1.Right]:H1.Left,[H1.Top]:H1.Bottom,[H1.Bottom]:H1.Top},h6=(_)=>!!_&&typeof _==="object"&&("id"in _)&&("source"in _)&&("target"in _),k7=(_)=>!!_&&typeof _==="object"&&("id"in _)&&("position"in _)&&!("source"in _)&&!("target"in _),D6=(_)=>!!_&&typeof _==="object"&&("id"in _)&&("internals"in _)&&!("source"in _)&&!("target"in _);var g5=(_,Q=[0,0])=>{let{width:J,height:q}=N0(_),U=_.origin??Q,G=J*U[0],Z=q*U[1];return{x:_.position.x-G,y:_.position.y-Z}},b6=(_,Q={nodeOrigin:[0,0]})=>{if(!Q.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(_.length===0)return{x:0,y:0,width:0,height:0};let J=!1,q=_.reduce((U,G)=>{let Z=typeof G==="string",F=!Q.nodeLookup&&!Z?G:void 0;if(Q.nodeLookup)F=Z?Q.nodeLookup.get(G):!D6(G)?Q.nodeLookup.get(G.id):G;if(!F)return U;return J=!0,y4(U,f4(F,Q.nodeOrigin))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return J?k4(q):{x:0,y:0,width:0,height:0}},u2=(_,Q={})=>{let J={x:1/0,y:1/0,x2:-1/0,y2:-1/0},q=!1;return _.forEach((U)=>{if(Q.filter===void 0||Q.filter(U))J=y4(J,f4(U)),q=!0}),q?k4(J):{x:0,y:0,width:0,height:0}},C4=(_,Q,[J,q,U]=[0,0,1],G=!1,Z=!1)=>{let F=(Q.x-J)/U,X=(Q.y-q)/U,Y=Q.width/U,K=Q.height/U,H=[];for(let L of _.values()){let{measured:z,selectable:W=!0,hidden:I=!1}=L;if(Z&&!W||I)continue;let O=z.width??L.width??L.initialWidth??0,A=z.height??L.height??L.initialHeight??0,{x:w,y:B}=L.internals.positionAbsolute,T=h7(F,X,Y,K,w,B,O,A),R=O*A,C=G&&T>0;if(!L.internals.handleBounds||C||T>=R||L.dragging)H.push(L)}return H},v7=(_,Q)=>{let J=new Set;return _.forEach((q)=>{J.add(q.id)}),Q.filter((q)=>J.has(q.source)||J.has(q.target))};function Tq(_,Q){let J=new Map,q=Q?.nodes?new Set(Q.nodes.map((U)=>U.id)):null;return _.forEach((U)=>{let G;if(Q?.includeHiddenNodes){let{width:Z,height:F}=N0(U);G=Z>0&&F>0}else G=Boolean(U.measured.width&&U.measured.height&&!U.hidden);if(G&&(!q||q.has(U.id)))J.set(U.id,U)}),J}async function j7({nodes:_,width:Q,height:J,panZoom:q,minZoom:U,maxZoom:G},Z){if(_.size===0)return!0;let F=Tq(_,Z),X=u2(F),Y=c5(X,Q,J,Z?.minZoom??U,Z?.maxZoom??G,Z?.padding??0.1);return await q.setViewport(Y,{duration:Z?.duration,ease:Z?.ease,interpolate:Z?.interpolate}),!0}function E6({nodeId:_,nextPosition:Q,nodeLookup:J,nodeOrigin:q=[0,0],nodeExtent:U,onError:G}){let Z=J.get(_),F=Z.parentId?J.get(Z.parentId):void 0,{x:X,y:Y}=F?F.internals.positionAbsolute:{x:0,y:0},K=Z.origin??q,H=Z.extent||U;if(Z.extent==="parent"&&!Z.expandParent)if(!F)G?.("005",X0.error005());else{let{width:z,height:W}=N0(F);if(z&&W)H=[[X,Y],[X+z,Y+W]]}else if(F&&V2(Z.extent))H=[[Z.extent[0][0]+X,Z.extent[0][1]+Y],[Z.extent[1][0]+X,Z.extent[1][1]+Y]];let L=V2(H)?v2(Q,H,Z.measured):Q;if(Z.measured.width===void 0||Z.measured.height===void 0)G?.("015",X0.error015());return{position:{x:L.x-X+(Z.measured.width??0)*K[0],y:L.y-Y+(Z.measured.height??0)*K[1]},positionAbsolute:L}}async function V7({nodesToRemove:_=[],edgesToRemove:Q=[],nodes:J,edges:q,onBeforeDelete:U}){let G=new Set(_.map((L)=>L.id)),Z=[];for(let L of J){if(L.deletable===!1)continue;let z=G.has(L.id),W=!z&&L.parentId&&Z.find((I)=>I.id===L.parentId);if(z||W)Z.push(L)}let F=new Set(Q.map((L)=>L.id)),X=q.filter((L)=>L.deletable!==!1),K=v7(Z,X);for(let L of X)if(F.has(L.id)&&!K.find((W)=>W.id===L.id))K.push(L);if(!U)return{edges:K,nodes:Z};let H=await U({nodes:Z,edges:K});if(typeof H==="boolean")return H?{edges:K,nodes:Z}:{edges:[],nodes:[]};return H}var J5=(_,Q=0,J=1)=>Math.min(Math.max(_,Q),J),v2=(_={x:0,y:0},Q,J)=>({x:J5(_.x,Q[0][0],Q[1][0]-(J?.width??0)),y:J5(_.y,Q[0][1],Q[1][1]-(J?.height??0))});function u7(_,Q,J){let{width:q,height:U}=N0(J),{x:G,y:Z}=J.internals.positionAbsolute;return v2(_,[[G,Z],[G+q,Z+U]],Q)}var B7=(_,Q,J)=>{if(_<Q)return J5(Math.abs(_-Q),1,Q)/Q;else if(_>J)return-J5(Math.abs(_-J),1,Q)/Q;return 0},S4=(_,Q,J=15,q=40)=>{let U=B7(_.x,q,Q.width-q)*J,G=B7(_.y,q,Q.height-q)*J;return[U,G]},y4=(_,Q)=>({x:Math.min(_.x,Q.x),y:Math.min(_.y,Q.y),x2:Math.max(_.x2,Q.x2),y2:Math.max(_.y2,Q.y2)}),v6=({x:_,y:Q,width:J,height:q})=>({x:_,y:Q,x2:_+J,y2:Q+q}),k4=({x:_,y:Q,x2:J,y2:q})=>({x:_,y:Q,width:J-_,height:q-Q}),q5=(_,Q=[0,0])=>{let{x:J,y:q}=D6(_)?_.internals.positionAbsolute:g5(_,Q);return{x:J,y:q,width:_.measured?.width??_.width??_.initialWidth??0,height:_.measured?.height??_.height??_.initialHeight??0}},f4=(_,Q=[0,0])=>{let{x:J,y:q}=D6(_)?_.internals.positionAbsolute:g5(_,Q);return{x:J,y:q,x2:J+(_.measured?.width??_.width??_.initialWidth??0),y2:q+(_.measured?.height??_.height??_.initialHeight??0)}},x6=(_,Q)=>k4(y4(v6(_),v6(Q))),h7=(_,Q,J,q,U,G,Z,F)=>{let X=Math.max(0,Math.min(_+J,U+Z)-Math.max(_,U)),Y=Math.max(0,Math.min(Q+q,G+F)-Math.max(Q,G));return Math.ceil(X*Y)},p5=(_,Q)=>h7(_.x,_.y,_.width,_.height,Q.x,Q.y,Q.width,Q.height),m6=(_)=>I0(_.width)&&I0(_.height)&&I0(_.x)&&I0(_.y),I0=(_)=>!isNaN(_)&&isFinite(_),g6=(_,Q)=>(J,q)=>{console.warn(`[${_}]: ${q} Help: ${Q}error#${J}`)},U5=(_,Q=[1,1])=>{return{x:Q[0]*Math.round(_.x/Q[0]),y:Q[1]*Math.round(_.y/Q[1])}},G5=({x:_,y:Q},[J,q,U],G=!1,Z=[1,1])=>{let F={x:(_-J)/U,y:(Q-q)/U};return G?U5(F,Z):F},j2=({x:_,y:Q},[J,q,U])=>{return{x:_*U+J,y:Q*U+q}};function _5(_,Q){if(typeof _==="number")return Math.floor((Q-Q/(1+_))*0.5);if(typeof _==="string"&&_.endsWith("px")){let J=parseFloat(_);if(!Number.isNaN(J))return Math.floor(J)}if(typeof _==="string"&&_.endsWith("%")){let J=parseFloat(_);if(!Number.isNaN(J))return Math.floor(Q*J*0.01)}return console.error(`The padding value "${_}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Rq(_,Q,J){if(typeof _==="string"||typeof _==="number"){let q=_5(_,J),U=_5(_,Q);return{top:q,right:U,bottom:q,left:U,x:U*2,y:q*2}}if(typeof _==="object"){let q=_5(_.top??_.y??0,J),U=_5(_.bottom??_.y??0,J),G=_5(_.left??_.x??0,Q),Z=_5(_.right??_.x??0,Q);return{top:q,right:Z,bottom:U,left:G,x:G+Z,y:q+U}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Oq(_,Q,J,q,U,G){let{x:Z,y:F}=j2(_,[Q,J,q]),{x:X,y:Y}=j2({x:_.x+_.width,y:_.y+_.height},[Q,J,q]),K=U-X,H=G-Y;return{left:Math.floor(Z),top:Math.floor(F),right:Math.floor(K),bottom:Math.floor(H)}}var c5=(_,Q,J,q,U,G)=>{let Z=Rq(G,Q,J),F=(Q-Z.x)/_.width,X=(J-Z.y)/_.height,Y=Math.min(F,X),K=J5(Y,q,U),H=_.x+_.width/2,L=_.y+_.height/2,z=Q/2-H*K,W=J/2-L*K,I=Oq(_,z,W,K,Q,J),O={left:Math.min(I.left-Z.left,0),top:Math.min(I.top-Z.top,0),right:Math.min(I.right-Z.right,0),bottom:Math.min(I.bottom-Z.bottom,0)};return{x:z-O.left+O.right,y:W-O.top+O.bottom,zoom:K}},Z5=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function V2(_){return _!==void 0&&_!==null&&_!=="parent"}function N0(_){return{width:_.measured?.width??_.width??_.initialWidth??0,height:_.measured?.height??_.height??_.initialHeight??0}}function p6(_){return(_.measured?.width??_.width??_.initialWidth)!==void 0&&(_.measured?.height??_.height??_.initialHeight)!==void 0}function c6(_,Q={width:0,height:0},J,q,U){let G={..._},Z=q.get(J);if(Z){let F=Z.origin||U;G.x+=Z.internals.positionAbsolute.x-(Q.width??0)*F[0],G.y+=Z.internals.positionAbsolute.y-(Q.height??0)*F[1]}return G}function l6(_,Q){if(_.size!==Q.size)return!1;for(let J of _)if(!Q.has(J))return!1;return!0}function D7(){let _,Q;return{promise:new Promise((q,U)=>{_=q,Q=U}),resolve:_,reject:Q}}function b7(_){return{...V6,..._||{}}}function Iq(_){if(typeof document>"u")return!0;let Q=document.querySelector(`.${_}-flow__pane`);if(!Q||!Q.isConnected)return!0;let J=getComputedStyle(Q);if(J.display==="none")return!0;if(J.visibility==="hidden"||J.visibility==="collapse")return!0;if(J.opacity==="0")return!0;if(J.width==="0"&&J.height==="0")return!0;let q=Q.getBoundingClientRect();if(q.width===0&&q.height===0)return!0;let U=document.querySelector(`.${_}-flow__attribution`);if(!U||!U.isConnected)return!1;let G=getComputedStyle(U);if(G.display==="none")return!1;if(G.visibility==="hidden"||G.visibility==="collapse")return!1;if(G.opacity==="0")return!1;let Z=U.getBoundingClientRect();if(Z.width===0&&Z.height===0)return!1;return!0}var M7=!1;function E7(_){if(M7)return;M7=!0;let Q=`${_.charAt(0).toUpperCase()+_.slice(1)} Flow`;setTimeout(()=>{if(!Iq(_))console.warn(`${Q}: It seems like you are hiding the attribution. Please only do this when you are subscribed to ${Q} Pro: https://${_}flow.dev/remove-attr
28
+ %cYou can ignore this warning if you are subscribed.`,"font-style: italic;")},1000)}function r6(_){return _===null?null:_?"valid":"invalid"}function m5(_,{snapGrid:Q=[0,0],snapToGrid:J=!1,transform:q,containerBounds:U}){let{x:G,y:Z}=P0(_),F=G5({x:G-(U?.left??0),y:Z-(U?.top??0)},q),{x:X,y:Y}=J?U5(F,Q):F;return{xSnapped:X,ySnapped:Y,...F}}var v4=(_)=>({width:_.offsetWidth,height:_.offsetHeight}),i6=(_)=>_?.getRootNode?.()||window?.document,Pq=["INPUT","SELECT","TEXTAREA"];function d6(_){let Q=_.composedPath?.()?.[0]||_.target;if(Q?.nodeType!==1)return!1;return Pq.includes(Q.nodeName)||Q.hasAttribute("contenteditable")||!!Q.closest(".nokey")}var a6=(_)=>("clientX"in _),P0=(_,Q)=>{let J=a6(_),q=J?_.clientX:_.touches?.[0].clientX,U=J?_.clientY:_.touches?.[0].clientY;return{x:q-(Q?.left??0),y:U-(Q?.top??0)}},T7=(_,Q,J,q,U)=>{let G=Q.querySelectorAll(`.${_}`);if(!G||!G.length)return null;return Array.from(G).map((Z)=>{let F=Z.getBoundingClientRect();return{id:Z.getAttribute("data-handleid"),type:_,nodeId:U,position:Z.getAttribute("data-handlepos"),x:(F.left-J.left)/q,y:(F.top-J.top)/q,...v4(Z)}})};function j4({sourceX:_,sourceY:Q,targetX:J,targetY:q,sourceControlX:U,sourceControlY:G,targetControlX:Z,targetControlY:F}){let X=_*0.125+U*0.375+Z*0.375+J*0.125,Y=Q*0.125+G*0.375+F*0.375+q*0.125,K=Math.abs(X-_),H=Math.abs(Y-Q);return[X,Y,K,H]}function N4(_,Q){if(_>=0)return 0.5*_;return Q*25*Math.sqrt(-_)}function R7({pos:_,x1:Q,y1:J,x2:q,y2:U,c:G}){switch(_){case H1.Left:return[Q-N4(Q-q,G),J];case H1.Right:return[Q+N4(q-Q,G),J];case H1.Top:return[Q,J-N4(J-U,G)];case H1.Bottom:return[Q,J+N4(U-J,G)]}}function V4({sourceX:_,sourceY:Q,sourcePosition:J=H1.Bottom,targetX:q,targetY:U,targetPosition:G=H1.Top,curvature:Z=0.25}){let[F,X]=R7({pos:J,x1:_,y1:Q,x2:q,y2:U,c:Z}),[Y,K]=R7({pos:G,x1:q,y1:U,x2:_,y2:Q,c:Z}),[H,L,z,W]=j4({sourceX:_,sourceY:Q,targetX:q,targetY:U,sourceControlX:F,sourceControlY:X,targetControlX:Y,targetControlY:K});return[`M${_},${Q} C${F},${X} ${Y},${K} ${q},${U}`,H,L,z,W]}function s6({sourceX:_,sourceY:Q,targetX:J,targetY:q}){let U=Math.abs(J-_)/2,G=J<_?J+U:J-U,Z=Math.abs(q-Q)/2,F=q<Q?q+Z:q-Z;return[G,F,U,Z]}function x7({sourceNode:_,targetNode:Q,selected:J=!1,zIndex:q=0,elevateOnSelect:U=!1,zIndexMode:G="basic"}){if(G==="manual")return q;let Z=U&&J?q+1000:q,F=Math.max(_.parentId||U&&_.selected?_.internals.z:0,Q.parentId||U&&Q.selected?Q.internals.z:0);return Z+F}function m7({sourceNode:_,targetNode:Q,width:J,height:q,transform:U}){let G=y4(f4(_),f4(Q));if(G.x===G.x2)G.x2+=1;if(G.y===G.y2)G.y2+=1;let Z={x:-U[0]/U[2],y:-U[1]/U[2],width:J/U[2],height:q/U[2]};return p5(Z,k4(G))>0}var Nq=({source:_,sourceHandle:Q,target:J,targetHandle:q})=>`xy-edge__${_}${Q||""}-${J}${q||""}`,wq=(_,Q)=>{return Q.some((J)=>J.source===_.source&&J.target===_.target&&(J.sourceHandle===_.sourceHandle||!J.sourceHandle&&!_.sourceHandle)&&(J.targetHandle===_.targetHandle||!J.targetHandle&&!_.targetHandle))},g7=(_,Q,J={})=>{if(!_.source||!_.target)return J.onError?.("006",X0.error006()),Q;let q=J.getEdgeId||Nq,U;if(h6(_))U={..._};else U={..._,id:q(_)};if(wq(U,Q))return Q;if(U.sourceHandle===null)delete U.sourceHandle;if(U.targetHandle===null)delete U.targetHandle;return Q.concat(U)};function u4({sourceX:_,sourceY:Q,targetX:J,targetY:q}){let[U,G,Z,F]=s6({sourceX:_,sourceY:Q,targetX:J,targetY:q});return[`M ${_},${Q}L ${J},${q}`,U,G,Z,F]}var O7={[H1.Left]:{x:-1,y:0},[H1.Right]:{x:1,y:0},[H1.Top]:{x:0,y:-1},[H1.Bottom]:{x:0,y:1}},fq=({source:_,sourcePosition:Q=H1.Bottom,target:J})=>{if(Q===H1.Left||Q===H1.Right)return _.x<J.x?{x:1,y:0}:{x:-1,y:0};return _.y<J.y?{x:0,y:1}:{x:0,y:-1}},I7=(_,Q)=>Math.sqrt(Math.pow(Q.x-_.x,2)+Math.pow(Q.y-_.y,2));function Cq({source:_,sourcePosition:Q=H1.Bottom,target:J,targetPosition:q=H1.Top,center:U,offset:G,stepPosition:Z}){let F=O7[Q],X=O7[q],Y={x:_.x+F.x*G,y:_.y+F.y*G},K={x:J.x+X.x*G,y:J.y+X.y*G},H=fq({source:Y,sourcePosition:Q,target:K}),L=H.x!==0?"x":"y",z=H[L],W=[],I,O,A={x:0,y:0},w={x:0,y:0},[,,B,T]=s6({sourceX:_.x,sourceY:_.y,targetX:J.x,targetY:J.y});if(F[L]*X[L]===-1){if(L==="x")I=U.x??Y.x+(K.x-Y.x)*Z,O=U.y??(Y.y+K.y)/2;else I=U.x??(Y.x+K.x)/2,O=U.y??Y.y+(K.y-Y.y)*Z;let y=[{x:I,y:Y.y},{x:I,y:K.y}],N=[{x:Y.x,y:O},{x:K.x,y:O}];if(F[L]===z)W=L==="x"?y:N;else W=L==="x"?N:y}else{let y=[{x:Y.x,y:K.y}],N=[{x:K.x,y:Y.y}];if(L==="x")W=F.x===z?N:y;else W=F.y===z?y:N;if(Q===q){let S=Math.abs(_[L]-J[L]);if(S<=G){let j=Math.min(G-1,G-S);if(F[L]===z)A[L]=(Y[L]>_[L]?-1:1)*j;else w[L]=(K[L]>J[L]?-1:1)*j}}if(Q!==q){let S=L==="x"?"y":"x",j=F[L]===X[S],D=Y[S]>K[S],x=Y[S]<K[S];if(F[L]===1&&(!j&&D||j&&x)||F[L]!==1&&(!j&&x||j&&D))W=L==="x"?y:N}let k={x:Y.x+A.x,y:Y.y+A.y},E={x:K.x+w.x,y:K.y+w.y},c=Math.max(Math.abs(k.x-W[0].x),Math.abs(E.x-W[0].x)),l=Math.max(Math.abs(k.y-W[0].y),Math.abs(E.y-W[0].y));if(c>=l)I=(k.x+E.x)/2,O=W[0].y;else I=W[0].x,O=(k.y+E.y)/2}let R={x:Y.x+A.x,y:Y.y+A.y},C={x:K.x+w.x,y:K.y+w.y};return[[_,...R.x!==W[0].x||R.y!==W[0].y?[R]:[],...W,...C.x!==W[W.length-1].x||C.y!==W[W.length-1].y?[C]:[],J],I,O,B,T]}function Sq(_,Q,J,q){let U=Math.min(I7(_,Q)/2,I7(Q,J)/2,q),{x:G,y:Z}=Q;if(_.x===G&&G===J.x||_.y===Z&&Z===J.y)return`L${G} ${Z}`;if(_.y===Z){let Y=_.x<J.x?-1:1,K=_.y<J.y?1:-1;return`L ${G+U*Y},${Z}Q ${G},${Z} ${G},${Z+U*K}`}let F=_.x<J.x?1:-1,X=_.y<J.y?-1:1;return`L ${G},${Z+U*X}Q ${G},${Z} ${G+U*F},${Z}`}function l5({sourceX:_,sourceY:Q,sourcePosition:J=H1.Bottom,targetX:q,targetY:U,targetPosition:G=H1.Top,borderRadius:Z=5,centerX:F,centerY:X,offset:Y=20,stepPosition:K=0.5}){let[H,L,z,W,I]=Cq({source:{x:_,y:Q},sourcePosition:J,target:{x:q,y:U},targetPosition:G,center:{x:F,y:X},offset:Y,stepPosition:K}),O=`M${H[0].x} ${H[0].y}`;for(let A=1;A<H.length-1;A++)O+=Sq(H[A-1],H[A],H[A+1],Z);return O+=`L${H[H.length-1].x} ${H[H.length-1].y}`,[O,L,z,W,I]}function P7(_){return _&&!!(_.internals.handleBounds||_.handles?.length)&&!!(_.measured.width||_.width||_.initialWidth)}function p7(_){let{sourceNode:Q,targetNode:J}=_;if(!P7(Q)||!P7(J))return null;let q=Q.internals.handleBounds||N7(Q.handles),U=J.internals.handleBounds||N7(J.handles),G=w7(q?.source??[],_.sourceHandle),Z=w7(_.connectionMode===L2.Strict?U?.target??[]:(U?.target??[]).concat(U?.source??[]),_.targetHandle);if(!G||!Z)return _.onError?.("008",X0.error008(!G?"source":"target",{id:_.id,sourceHandle:_.sourceHandle,targetHandle:_.targetHandle})),null;let F=G?.position||H1.Bottom,X=Z?.position||H1.Top,Y=z2(Q,G,F),K=z2(J,Z,X);return{sourceX:Y.x,sourceY:Y.y,targetX:K.x,targetY:K.y,sourcePosition:F,targetPosition:X}}function N7(_){if(!_)return null;let Q=[],J=[];for(let q of _)if(q.width=q.width??1,q.height=q.height??1,q.type==="source")Q.push(q);else if(q.type==="target")J.push(q);return{source:Q,target:J}}function z2(_,Q,J=H1.Left,q=!1){let U=(Q?.x??0)+_.internals.positionAbsolute.x,G=(Q?.y??0)+_.internals.positionAbsolute.y,{width:Z,height:F}=Q??N0(_);if(q)return{x:U+Z/2,y:G+F/2};switch(Q?.position??J){case H1.Top:return{x:U+Z/2,y:G};case H1.Right:return{x:U+Z,y:G+F/2};case H1.Bottom:return{x:U+Z/2,y:G+F};case H1.Left:return{x:U,y:G+F/2}}}function w7(_,Q){if(!_)return null;return(!Q?_[0]:_.find((J)=>J.id===Q))||null}function h4(_,Q){if(!_)return"";if(typeof _==="string")return _;return`${Q?`${Q}__`:""}${Object.keys(_).sort().map((q)=>`${q}=${_[q]}`).join("&")}`}function c7(_,{id:Q,defaultColor:J,defaultMarkerStart:q,defaultMarkerEnd:U}){let G=new Set;return _.reduce((Z,F)=>{return[F.markerStart||q,F.markerEnd||U].forEach((X)=>{if(X&&typeof X==="object"){let Y=h4(X,Q);if(!G.has(Y))Z.push({id:Y,color:X.color||J,...X}),G.add(Y)}}),Z},[]).sort((Z,F)=>Z.id.localeCompare(F.id))}function l7(_,Q,J,q,U){let G=0.5;if(U==="start")G=0;else if(U==="end")G=1;let Z=[(_.x+_.width*G)*Q.zoom+Q.x,_.y*Q.zoom+Q.y-q],F=[-100*G,-100];switch(J){case H1.Right:Z=[(_.x+_.width)*Q.zoom+Q.x+q,(_.y+_.height*G)*Q.zoom+Q.y],F=[0,-100*G];break;case H1.Bottom:Z[1]=(_.y+_.height)*Q.zoom+Q.y+q,F[1]=0;break;case H1.Left:Z=[_.x*Q.zoom+Q.x-q,(_.y+_.height*G)*Q.zoom+Q.y],F=[-100,-100*G];break}return`translate(${Z[0]}px, ${Z[1]}px) translate(${F[0]}%, ${F[1]}%)`}var r7=1000,yq=10,t6={nodeOrigin:[0,0],nodeExtent:$5,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},kq={...t6,checkEquality:!0};function o6(_,Q){let J={..._};for(let q in Q)if(Q[q]!==void 0)J[q]=Q[q];return J}function i7(_,Q,J){let q=o6(t6,J);for(let U of _.values())if(U.parentId)e6(U,_,Q,q);else{let G=g5(U,q.nodeOrigin),Z=V2(U.extent)?U.extent:q.nodeExtent,F=v2(G,Z,N0(U));U.internals.positionAbsolute=F}}function vq(_,Q){if(!_.handles)return!_.measured?void 0:Q?.internals.handleBounds;let J=[],q=[];for(let U of _.handles){let G={id:U.id,width:U.width??1,height:U.height??1,nodeId:_.id,x:U.x,y:U.y,position:U.position,type:U.type};if(U.type==="source")J.push(G);else if(U.type==="target")q.push(G)}return{source:J,target:q}}function n6(_){return _==="manual"}function D4(_,Q,J,q={}){let U=o6(kq,q),G={i:0},Z=new Map(Q),F=U?.elevateNodesOnSelect&&!n6(U.zIndexMode)?r7:0,X=_.length>0,Y=!1;Q.clear(),J.clear();for(let K of _){let H=Z.get(K.id);if(U.checkEquality&&K===H?.internals.userNode)Q.set(K.id,H);else{let L=g5(K,U.nodeOrigin),z=V2(K.extent)?K.extent:U.nodeExtent,W=v2(L,z,N0(K));H={...U.defaults,...K,measured:{width:K.measured?.width,height:K.measured?.height},internals:{positionAbsolute:W,handleBounds:vq(K,H),z:d7(K,F,U.zIndexMode),userNode:K}},Q.set(K.id,H)}if((H.measured===void 0||H.measured.width===void 0||H.measured.height===void 0)&&!H.hidden)X=!1;if(K.parentId)e6(H,Q,J,q,G);Y||=K.selected??!1}return{nodesInitialized:X,hasSelectedNodes:Y}}function jq(_,Q){if(!_.parentId)return;let J=Q.get(_.parentId);if(J)J.set(_.id,_);else Q.set(_.parentId,new Map([[_.id,_]]))}function e6(_,Q,J,q,U){let{elevateNodesOnSelect:G,nodeOrigin:Z,nodeExtent:F,zIndexMode:X}=o6(t6,q),Y=_.parentId,K=Q.get(Y);if(!K){console.warn(`Parent node ${Y} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}if(jq(_,J),U&&!K.parentId&&K.internals.rootParentIndex===void 0&&X==="auto")K.internals.rootParentIndex=++U.i,K.internals.z=K.internals.z+U.i*yq;if(U&&K.internals.rootParentIndex!==void 0)U.i=K.internals.rootParentIndex;let H=G&&!n6(X)?r7:0,{x:L,y:z,z:W}=Vq(_,K,Z,F,H,X),{positionAbsolute:I}=_.internals,O=L!==I.x||z!==I.y;if(O||W!==_.internals.z)Q.set(_.id,{..._,internals:{..._.internals,positionAbsolute:O?{x:L,y:z}:I,z:W}})}function d7(_,Q,J){let q=I0(_.zIndex)?_.zIndex:0;if(n6(J))return q;return q+(_.selected?Q:0)}function Vq(_,Q,J,q,U,G){let{x:Z,y:F}=Q.internals.positionAbsolute,X=N0(_),Y=g5(_,J),K=V2(_.extent)?v2(Y,_.extent,X):Y,H=v2({x:Z+K.x,y:F+K.y},q,X);if(_.extent==="parent")H=u7(H,X,Q);let L=d7(_,U,G),z=Q.internals.z??0;return{x:H.x,y:H.y,z:z>=L?z+1:L}}function b4(_,Q,J,q=[0,0]){let U=[],G=new Map;for(let Z of _){let F=Q.get(Z.parentId);if(!F)continue;let X=G.get(Z.parentId)?.expandedRect??q5(F),Y=x6(X,Z.rect);G.set(Z.parentId,{expandedRect:Y,parent:F})}if(G.size>0)G.forEach(({expandedRect:Z,parent:F},X)=>{let Y=F.internals.positionAbsolute,K=N0(F),H=F.origin??q,L=Z.x<Y.x?Math.round(Math.abs(Y.x-Z.x)):0,z=Z.y<Y.y?Math.round(Math.abs(Y.y-Z.y)):0,W=Math.max(K.width,Math.round(Z.width)),I=Math.max(K.height,Math.round(Z.height)),O=(W-K.width)*H[0],A=(I-K.height)*H[1];if(L>0||z>0||O||A)U.push({id:X,type:"position",position:{x:F.position.x-L+O,y:F.position.y-z+A}}),J.get(X)?.forEach((w)=>{if(!_.some((B)=>B.id===w.id))U.push({id:w.id,type:"position",position:{x:w.position.x+L,y:w.position.y+z}})});if(K.width<Z.width||K.height<Z.height||L||z)U.push({id:X,type:"dimensions",setAttributes:!0,dimensions:{width:W+(L?H[0]*L-O:0),height:I+(z?H[1]*z-A:0)}})});return U}function a7(_,Q,J,q,U,G,Z){let F=q?.querySelector(".xyflow__viewport"),X=!1;if(!F)return{changes:[],updatedInternals:X};let Y=[],K=window.getComputedStyle(F),{m22:H}=new window.DOMMatrixReadOnly(K.transform),L=[];for(let z of _.values()){let W=Q.get(z.id);if(!W)continue;if(W.hidden){Q.set(W.id,{...W,internals:{...W.internals,handleBounds:void 0}}),X=!0;continue}let I=v4(z.nodeElement),O=W.measured.width!==I.width||W.measured.height!==I.height;if(!!(I.width&&I.height&&(O||!W.internals.handleBounds||z.force))){let w=z.nodeElement.getBoundingClientRect(),B=V2(W.extent)?W.extent:G,{positionAbsolute:T}=W.internals;if(W.parentId&&W.extent==="parent"){let C=Q.get(W.parentId);if(C)T=u7(T,I,C)}else if(B)T=v2(T,B,I);let R={...W,measured:I,internals:{...W.internals,positionAbsolute:T,handleBounds:{source:T7("source",z.nodeElement,w,H,W.id),target:T7("target",z.nodeElement,w,H,W.id)}}};if(Q.set(W.id,R),W.parentId)e6(R,Q,J,{nodeOrigin:U,zIndexMode:Z});if(X=!0,O){if(Y.push({id:W.id,type:"dimensions",dimensions:I}),W.expandParent&&W.parentId)L.push({id:W.id,parentId:W.parentId,rect:q5(R,U)})}}}if(L.length>0){let z=b4(L,Q,J,U);Y.push(...z)}return{changes:Y,updatedInternals:X}}async function s7({delta:_,panZoom:Q,transform:J,translateExtent:q,width:U,height:G}){if(!Q||!_.x&&!_.y)return!1;let Z=await Q.setViewportConstrained({x:J[0]+_.x,y:J[1]+_.y,zoom:J[2]},[[0,0],[U,G]],q);return!!Z&&(Z.x!==J[0]||Z.y!==J[1]||Z.k!==J[2])}function f7(_,Q,J,q,U,G){let Z=U,F=q.get(Z)||new Map;q.set(Z,F.set(J,Q)),Z=`${U}-${_}`;let X=q.get(Z)||new Map;if(q.set(Z,X.set(J,Q)),G){Z=`${U}-${_}-${G}`;let Y=q.get(Z)||new Map;q.set(Z,Y.set(J,Q))}}function _8(_,Q,J){_.clear(),Q.clear();for(let q of J){let{source:U,target:G,sourceHandle:Z=null,targetHandle:F=null}=q,X={edgeId:q.id,source:U,target:G,sourceHandle:Z,targetHandle:F},Y=`${U}-${Z}--${G}-${F}`,K=`${G}-${F}--${U}-${Z}`;f7("source",X,K,_,U,Z),f7("target",X,Y,_,G,F),Q.set(q.id,q)}}function t7(_,Q){if(!_.parentId)return!1;let J=Q.get(_.parentId);if(!J)return!1;if(J.selected)return!0;return t7(J,Q)}function C7(_,Q,J){let q=_;do{if(q?.matches?.(Q))return!0;if(q===J)return!1;q=q?.parentElement}while(q);return!1}function uq(_,Q,J,q){let U=new Map;for(let[G,Z]of _)if((Z.selected||Z.id===q)&&(!Z.parentId||!t7(Z,_))&&(Z.draggable||Q&&typeof Z.draggable>"u")){let F=_.get(G);if(F)U.set(G,{id:G,position:F.position||{x:0,y:0},distance:{x:J.x-F.internals.positionAbsolute.x,y:J.y-F.internals.positionAbsolute.y},extent:F.extent,parentId:F.parentId,origin:F.origin,expandParent:F.expandParent,internals:{positionAbsolute:F.internals.positionAbsolute||{x:0,y:0}},measured:{width:F.measured.width??0,height:F.measured.height??0}})}return U}function S6({nodeId:_,dragItems:Q,nodeLookup:J,dragging:q=!0}){let U=[];for(let[Z,F]of Q){let X=J.get(Z)?.internals.userNode;if(X)U.push({...X,position:F.position,dragging:q})}if(!_)return[U[0],U];let G=J.get(_)?.internals.userNode;return[!G?U[0]:{...G,position:Q.get(_)?.position||G.position,dragging:q},U]}function hq({dragItems:_,snapGrid:Q,x:J,y:q}){let U=_.values().next().value;if(!U)return null;let G={x:J-U.distance.x,y:q-U.distance.y},Z=U5(G,Q);return{x:Z.x-G.x,y:Z.y-G.y}}function o7({onNodeMouseDown:_,getStoreItems:Q,onDragStart:J,onDrag:q,onDragStop:U}){let G={x:null,y:null},Z=0,F=new Map,X=!1,Y={x:0,y:0},K=null,H=!1,L=null,z=!1,W=!1,I=null;function O({noDragClassName:w,handleSelector:B,domNode:T,isSelectable:R,nodeId:C,nodeClickDistance:f=0}){L=o1(T);function y({x:c,y:l}){let{nodeLookup:S,nodeExtent:j,snapGrid:D,snapToGrid:x,nodeOrigin:v,onNodeDrag:m,onSelectionDrag:P,onError:V,updateNodePositions:b}=Q();G={x:c,y:l};let u=!1,t=F.size>1,Q1=t&&j?v6(u2(F)):null,a=t&&x?hq({dragItems:F,snapGrid:D,x:c,y:l}):null;for(let[o,p]of F){if(!S.has(o))continue;let n={x:c-p.distance.x,y:l-p.distance.y};if(x)n=a?{x:Math.round(n.x+a.x),y:Math.round(n.y+a.y)}:U5(n,D);let J1=null;if(t&&j&&!p.extent&&Q1){let{positionAbsolute:Y1}=p.internals,M1=Y1.x-Q1.x+j[0][0],L1=Y1.x+p.measured.width-Q1.x2+j[1][0],e=Y1.y-Q1.y+j[0][1],O1=Y1.y+p.measured.height-Q1.y2+j[1][1];J1=[[M1,e],[L1,O1]]}let{position:G1,positionAbsolute:q1}=E6({nodeId:o,nextPosition:n,nodeLookup:S,nodeExtent:J1?J1:j,nodeOrigin:v,onError:V});u=u||p.position.x!==G1.x||p.position.y!==G1.y,p.position=G1,p.internals.positionAbsolute=q1}if(W=W||u,!u)return;if(b(F,!0),I&&(q||m||!C&&P)){let[o,p]=S6({nodeId:C,dragItems:F,nodeLookup:S});if(q?.(I,F,o,p),m?.(I,o,p),!C)P?.(I,p)}}async function N(){if(!K)return;let{transform:c,panBy:l,autoPanSpeed:S,autoPanOnNodeDrag:j}=Q();if(!j){X=!1,cancelAnimationFrame(Z);return}let[D,x]=S4(Y,K,S);if(D!==0||x!==0){if(G.x=(G.x??0)-D/c[2],G.y=(G.y??0)-x/c[2],await l({x:D,y:x}))y(G)}Z=requestAnimationFrame(N)}function k(c){let{nodeLookup:l,multiSelectionActive:S,nodesDraggable:j,transform:D,snapGrid:x,snapToGrid:v,selectNodesOnDrag:m,onNodeDragStart:P,onSelectionDragStart:V,unselectNodesAndEdges:b}=Q();if(H=!0,(!m||!R)&&!S&&C){if(!l.get(C)?.selected)b()}if(R&&m&&C)_?.(C);let u=m5(c.sourceEvent,{transform:D,snapGrid:x,snapToGrid:v,containerBounds:K});if(G=u,F=uq(l,j,u,C),F.size>0&&(J||P||!C&&V)){let[t,Q1]=S6({nodeId:C,dragItems:F,nodeLookup:l});if(J?.(c.sourceEvent,F,t,Q1),P?.(c.sourceEvent,t,Q1),!C)V?.(c.sourceEvent,Q1)}}let E=O5().clickDistance(f).on("start",(c)=>{let{domNode:l,nodeDragThreshold:S,transform:j,snapGrid:D,snapToGrid:x}=Q();if(K=l?.getBoundingClientRect()||null,z=!1,W=!1,I=c.sourceEvent,S===0)k(c);G=m5(c.sourceEvent,{transform:j,snapGrid:D,snapToGrid:x,containerBounds:K}),Y=P0(c.sourceEvent,K)}).on("drag",(c)=>{let{autoPanOnNodeDrag:l,transform:S,snapGrid:j,snapToGrid:D,nodeDragThreshold:x,nodeLookup:v}=Q(),m=m5(c.sourceEvent,{transform:S,snapGrid:j,snapToGrid:D,containerBounds:K});if(I=c.sourceEvent,c.sourceEvent.type==="touchmove"&&c.sourceEvent.touches.length>1||C&&!v.has(C))z=!0;if(z)return;if(!X&&l&&H)X=!0,N();if(!H){let P=P0(c.sourceEvent,K),V=P.x-Y.x,b=P.y-Y.y;if(Math.sqrt(V*V+b*b)>x)k(c)}if((G.x!==m.xSnapped||G.y!==m.ySnapped)&&F&&H)Y=P0(c.sourceEvent,K),y(m)}).on("end",(c)=>{if(!H||z){if(z&&F.size>0)Q().updateNodePositions(F,!1);return}if(X=!1,H=!1,cancelAnimationFrame(Z),F.size>0){let{nodeLookup:l,updateNodePositions:S,onNodeDragStop:j,onSelectionDragStop:D}=Q();if(W)S(F,!1),W=!1;if(U||j||!C&&D){let[x,v]=S6({nodeId:C,dragItems:F,nodeLookup:l,dragging:!1});if(U?.(c.sourceEvent,F,x,v),j?.(c.sourceEvent,x,v),!C)D?.(c.sourceEvent,v)}}}).filter((c)=>{let l=c.target;return!c.button&&(!w||!C7(l,`.${w}`,T))&&(!B||C7(l,B,T))});L.call(E)}function A(){L?.on(".drag",null)}return{update:O,destroy:A}}function Dq(_,Q,J){let q=[],U={x:_.x-J,y:_.y-J,width:J*2,height:J*2};for(let G of Q.values())if(p5(U,q5(G))>0)q.push(G);return q}var bq=250;function Eq(_,Q,J,q){let U=[],G=1/0,Z=Dq(_,J,Q+bq);for(let F of Z){let X=[...F.internals.handleBounds?.source??[],...F.internals.handleBounds?.target??[]];for(let Y of X){if(q.nodeId===Y.nodeId&&q.type===Y.type&&q.id===Y.id)continue;let{x:K,y:H}=z2(F,Y,Y.position,!0),L=Math.sqrt(Math.pow(K-_.x,2)+Math.pow(H-_.y,2));if(L>Q)continue;if(L<G)U=[{...Y,x:K,y:H}],G=L;else if(L===G)U.push({...Y,x:K,y:H})}}if(!U.length)return null;if(U.length>1){let F=q.type==="source"?"target":"source";return U.find((X)=>X.type===F)??U[0]}return U[0]}function n7(_,Q,J,q,U,G=!1){let Z=q.get(_);if(!Z)return null;let F=U==="strict"?Z.internals.handleBounds?.[Q]:[...Z.internals.handleBounds?.source??[],...Z.internals.handleBounds?.target??[]],X=(J?F?.find((Y)=>Y.id===J):F?.[0])??null;return X&&G?{...X,...z2(Z,X,X.position,!0)}:X}function e7(_,Q){if(_)return _;else if(Q?.classList.contains("target"))return"target";else if(Q?.classList.contains("source"))return"source";return null}function xq(_,Q){let J=null;if(Q)J=!0;else if(_&&!Q)J=!1;return J}var _9=()=>!0;function mq(_,{connectionMode:Q,connectionRadius:J,handleId:q,nodeId:U,edgeUpdaterType:G,isTarget:Z,domNode:F,nodeLookup:X,lib:Y,autoPanOnConnect:K,flowId:H,panBy:L,cancelConnection:z,onConnectStart:W,onConnect:I,onConnectEnd:O,isValidConnection:A=_9,onReconnectEnd:w,updateConnection:B,getTransform:T,getFromHandle:R,autoPanSpeed:C,dragThreshold:f=1,handleDomNode:y}){let N=i6(_.target),k=0,E,{x:c,y:l}=P0(_),S=e7(G,y),j=F?.getBoundingClientRect(),D=!1;if(!j||!S)return;let x=n7(U,S,q,X,Q);if(!x)return;let v=P0(_,j),m=!1,P=null,V=!1,b=null;function u(){if(!K||!j)return;let[G1,q1]=S4(v,j,C);L({x:G1,y:q1}),k=requestAnimationFrame(u)}let t={...x,nodeId:U,type:S,position:x.position},Q1=X.get(U),o={inProgress:!0,isValid:null,from:z2(Q1,t,H1.Left,!0),fromHandle:t,fromPosition:t.position,fromNode:Q1,to:v,toHandle:null,toPosition:A7[t.position],toNode:null,pointer:v};function p(){D=!0,B(o),W?.(_,{nodeId:U,handleId:q,handleType:S})}if(f===0)p();function n(G1){if(!D){let{x:O1,y:X1}=P0(G1),D1=O1-c,a1=X1-l;if(!(D1*D1+a1*a1>f*f))return;p()}if(!R()||!t){J1(G1);return}let q1=T();if(v=P0(G1,j),E=Eq(G5(v,q1,!1,[1,1]),J,X,t),!m)u(),m=!0;let Y1=Q9(G1,{handle:E,connectionMode:Q,fromNodeId:U,fromHandleId:q,fromType:Z?"target":"source",isValidConnection:A,doc:N,lib:Y,flowId:H,nodeLookup:X});b=Y1.handleDomNode,P=Y1.connection,V=xq(!!E,Y1.isValid);let M1=X.get(U),L1=M1?z2(M1,t,H1.Left,!0):o.from,e={...o,from:L1,isValid:V,to:Y1.toHandle&&V?j2({x:Y1.toHandle.x,y:Y1.toHandle.y},q1):v,toHandle:Y1.toHandle,toPosition:V&&Y1.toHandle?Y1.toHandle.position:A7[t.position],toNode:Y1.toHandle?X.get(Y1.toHandle.nodeId):null,pointer:v};B(e),o=e}function J1(G1){if("touches"in G1&&G1.touches.length>0)return;if(D){if((E||b)&&P&&V)I?.(P);let{inProgress:q1,...Y1}=o,M1={...Y1,toPosition:o.toHandle?o.toPosition:null};if(O?.(G1,M1),G)w?.(G1,M1)}z(),cancelAnimationFrame(k),m=!1,V=!1,P=null,b=null,N.removeEventListener("mousemove",n),N.removeEventListener("mouseup",J1),N.removeEventListener("touchmove",n),N.removeEventListener("touchend",J1)}N.addEventListener("mousemove",n),N.addEventListener("mouseup",J1),N.addEventListener("touchmove",n),N.addEventListener("touchend",J1)}function Q9(_,{handle:Q,connectionMode:J,fromNodeId:q,fromHandleId:U,fromType:G,doc:Z,lib:F,flowId:X,isValidConnection:Y=_9,nodeLookup:K}){let H=G==="target",L=Q?Z.querySelector(`.${F}-flow__handle[data-id="${X}-${Q?.nodeId}-${Q?.id}-${Q?.type}"]`):null,{x:z,y:W}=P0(_),I=Z.elementFromPoint(z,W),O=I?.classList.contains(`${F}-flow__handle`)?I:L,A={handleDomNode:O,isValid:!1,connection:null,toHandle:null};if(O){let w=e7(void 0,O),B=O.getAttribute("data-nodeid"),T=O.getAttribute("data-handleid"),R=O.classList.contains("connectable"),C=O.classList.contains("connectableend");if(!B||!w)return A;let f={source:H?B:q,sourceHandle:H?T:U,target:H?q:B,targetHandle:H?U:T};A.connection=f;let N=R&&C&&(J===L2.Strict?H&&w==="source"||!H&&w==="target":B!==q||T!==U);A.isValid=N&&Y(f),A.toHandle=n7(B,w,T,K,J,!0)}return A}var E4={onPointerDown:mq,isValid:Q9};function J9({domNode:_,panZoom:Q,getTransform:J,getViewScale:q}){let U=o1(_);function G({translateExtent:F,width:X,height:Y,zoomStep:K=1,pannable:H=!0,zoomable:L=!0,inversePan:z=!1}){let W=(B)=>{if(B.sourceEvent.type!=="wheel"||!Q)return;let T=J(),R=B.sourceEvent.ctrlKey&&Z5()?10:1,C=-B.sourceEvent.deltaY*(B.sourceEvent.deltaMode===1?0.05:B.sourceEvent.deltaMode?1:0.002)*K,f=T[2]*Math.pow(2,C*R);Q.scaleTo(f)},I=[0,0],O=(B)=>{if(B.sourceEvent.type==="mousedown"||B.sourceEvent.type==="touchstart")I=[B.sourceEvent.clientX??B.sourceEvent.touches[0].clientX,B.sourceEvent.clientY??B.sourceEvent.touches[0].clientY]},A=(B)=>{let T=J();if(B.sourceEvent.type!=="mousemove"&&B.sourceEvent.type!=="touchmove"||!Q)return;let R=[B.sourceEvent.clientX??B.sourceEvent.touches[0].clientX,B.sourceEvent.clientY??B.sourceEvent.touches[0].clientY],C=[R[0]-I[0],R[1]-I[1]];I=R;let f=q()*Math.max(T[2],Math.log(T[2]))*(z?-1:1),y={x:T[0]-C[0]*f,y:T[1]-C[1]*f},N=[[0,0],[X,Y]];Q.setViewportConstrained({x:y.x,y:y.y,zoom:T[2]},N,F)},w=x5().on("start",O).on("zoom",H?A:null).on("zoom.wheel",L?W:null);U.call(w,{})}function Z(){U.on("zoom",null)}return{update:G,destroy:Z,pointer:$0}}var x4=(_)=>({x:_.x,y:_.y,zoom:_.k}),y6=({x:_,y:Q,zoom:J})=>S2.translate(_,Q).scale(J),Y2=(_,Q)=>_.target.closest(`.${Q}`),$9=(_,Q)=>Q===2&&Array.isArray(_)&&_.includes(2),gq=(_)=>((_*=2)<=1?_*_*_:(_-=2)*_*_+2)/2,k6=(_,Q=0,J=gq,q=()=>{})=>{let U=typeof Q==="number"&&Q>0;if(!U)q();return U?_.transition().duration(Q).ease(J).on("end",q):_},q9=(_)=>{let Q=_.ctrlKey&&Z5()?10:1;return-_.deltaY*(_.deltaMode===1?0.05:_.deltaMode?1:0.002)*Q};function pq({zoomPanValues:_,noWheelClassName:Q,d3Selection:J,d3Zoom:q,panOnScrollMode:U,panOnScrollSpeed:G,zoomOnPinch:Z,onPanZoomStart:F,onPanZoom:X,onPanZoomEnd:Y}){return(K)=>{if(Y2(K,Q)){if(K.ctrlKey)K.preventDefault();return!1}K.preventDefault(),K.stopImmediatePropagation();let H=J.property("__zoom").k||1;if(K.ctrlKey&&Z){let O=$0(K),A=q9(K),w=H*Math.pow(2,A);q.scaleTo(J,w,O,K);return}let L=K.deltaMode===1?20:1,z=U===o0.Vertical?0:K.deltaX*L,W=U===o0.Horizontal?0:K.deltaY*L;if(!Z5()&&K.shiftKey&&U!==o0.Vertical)z=K.deltaY*L,W=0;q.translateBy(J,-(z/H)*G,-(W/H)*G,{internal:!0});let I=x4(J.property("__zoom"));if(clearTimeout(_.panScrollTimeout),!_.isPanScrolling)_.isPanScrolling=!0,F?.(K,I);else X?.(K,I);_.panScrollTimeout=setTimeout(()=>{Y?.(K,I),_.isPanScrolling=!1},150)}}function cq({noWheelClassName:_,preventScrolling:Q,d3ZoomHandler:J}){return function(q,U){let G=q.type==="wheel",Z=!Q&&G&&!q.ctrlKey,F=Y2(q,_);if(q.ctrlKey&&G&&F)q.preventDefault();if(Z||F)return null;q.preventDefault(),J.call(this,q,U)}}function lq({zoomPanValues:_,onDraggingChange:Q,onPanZoomStart:J}){return(q)=>{if(q.sourceEvent?.internal)return;let U=x4(q.transform);if(_.mouseButton=q.sourceEvent?.button||0,_.isZoomingOrPanning=!0,_.prevViewport=U,q.sourceEvent?.type==="mousedown")Q(!0);if(J)J?.(q.sourceEvent,U)}}function rq({zoomPanValues:_,panOnDrag:Q,onPaneContextMenu:J,onTransformChange:q,onPanZoom:U}){return(G)=>{if(_.usedRightMouseButton=!!(J&&$9(Q,_.mouseButton??0)),!G.sourceEvent?.sync)q([G.transform.x,G.transform.y,G.transform.k]);if(U&&!G.sourceEvent?.internal)U?.(G.sourceEvent,x4(G.transform))}}function iq({zoomPanValues:_,panOnDrag:Q,panOnScroll:J,onDraggingChange:q,onPanZoomEnd:U,onPaneContextMenu:G}){return(Z)=>{if(Z.sourceEvent?.internal)return;if(_.isZoomingOrPanning=!1,G&&$9(Q,_.mouseButton??0)&&!_.usedRightMouseButton&&Z.sourceEvent)G(Z.sourceEvent);if(_.usedRightMouseButton=!1,q(!1),U){let F=x4(Z.transform);_.prevViewport=F,clearTimeout(_.timerId),_.timerId=setTimeout(()=>{U?.(Z.sourceEvent,F)},J?150:0)}}}function dq({panActivationKeyPressed:_,zoomActivationKeyPressed:Q,zoomOnScroll:J,zoomOnPinch:q,panOnDrag:U,panOnScroll:G,zoomOnDoubleClick:Z,userSelectionActive:F,noWheelClassName:X,noPanClassName:Y,lib:K,connectionInProgress:H}){return(L)=>{let z=Q||J,W=q&&L.ctrlKey,I=L.type==="wheel";if(L.button===1&&L.type==="mousedown"&&(Y2(L,`${K}-flow__node`)||Y2(L,`${K}-flow__edge`)||Y2(L,`${K}-flow__selection`)||Y2(L,`${K}-flow__nodesselection`)))return!0;if(!U&&!z&&!G&&!Z&&!q)return!1;if(F)return!1;if(H&&!I)return!1;if(Y2(L,X)&&I)return!1;if(Y2(L,Y)&&(!I||G&&I&&!Q))return!1;if(!q&&L.ctrlKey&&I)return!1;if(!q&&L.type==="touchstart"&&L.touches?.length>1)return L.preventDefault(),!1;if(!z&&!G&&!W&&I)return!1;if(!U&&(L.type==="mousedown"||L.type==="touchstart"))return!1;if(Array.isArray(U)&&!U.includes(L.button)&&L.type==="mousedown")return!1;let O=Array.isArray(U)&&U.includes(L.button)||!L.button||L.button<=1;return(!L.ctrlKey||I||_)&&O}}function U9({domNode:_,minZoom:Q,maxZoom:J,translateExtent:q,viewport:U,onPanZoom:G,onPanZoomStart:Z,onPanZoomEnd:F,onDraggingChange:X}){let Y={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},K=_.getBoundingClientRect(),H=[[0,0],[K.width,K.height]];(typeof ResizeObserver<"u"?new ResizeObserver((l)=>{let S=l[0];if(S)H=[[0,0],[S.contentRect.width,S.contentRect.height]]}):null)?.observe(_);let z=x5().extent(()=>H).scaleExtent([Q,J]).translateExtent(q),W=o1(_).call(z);T({x:U.x,y:U.y,zoom:J5(U.zoom,Q,J)},[[0,0],[K.width,K.height]],q);let I=W.on("wheel.zoom"),O=W.on("dblclick.zoom");z.wheelDelta(q9);async function A(l,S){if(W)return new Promise((j)=>{z?.interpolate(S?.interpolate==="linear"?E0:f2).transform(k6(W,S?.duration,S?.ease,()=>j(!0)),l)});return!1}function w({noWheelClassName:l,noPanClassName:S,onPaneContextMenu:j,userSelectionActive:D,panOnScroll:x,panOnDrag:v,panOnScrollMode:m,panOnScrollSpeed:P,preventScrolling:V,zoomOnPinch:b,zoomOnScroll:u,zoomOnDoubleClick:t,panActivationKeyPressed:Q1=!1,zoomActivationKeyPressed:a,lib:o,onTransformChange:p,connectionInProgress:n,paneClickDistance:J1,selectionOnDrag:G1}){if(D&&!Y.isZoomingOrPanning)B();let q1=x&&!a&&!D;z.clickDistance(G1?1/0:!I0(J1)||J1<0?0:J1);let Y1=q1?pq({zoomPanValues:Y,noWheelClassName:l,d3Selection:W,d3Zoom:z,panOnScrollMode:m,panOnScrollSpeed:P,zoomOnPinch:b,onPanZoomStart:Z,onPanZoom:G,onPanZoomEnd:F}):cq({noWheelClassName:l,preventScrolling:V,d3ZoomHandler:I});W.on("wheel.zoom",Y1,{passive:!1});let M1=lq({zoomPanValues:Y,onDraggingChange:X,onPanZoomStart:Z});z.on("start",M1);let L1=rq({zoomPanValues:Y,panOnDrag:v,onPaneContextMenu:!!j,onPanZoom:G,onTransformChange:p});z.on("zoom",L1);let e=iq({zoomPanValues:Y,panOnDrag:v,panOnScroll:x,onPaneContextMenu:j,onPanZoomEnd:F,onDraggingChange:X});z.on("end",e);let O1=dq({panActivationKeyPressed:Q1,zoomActivationKeyPressed:a,panOnDrag:v,zoomOnScroll:u,panOnScroll:x,zoomOnDoubleClick:t,zoomOnPinch:b,userSelectionActive:D,noPanClassName:S,noWheelClassName:l,lib:o,connectionInProgress:n});if(z.filter(O1),t)W.on("dblclick.zoom",O);else W.on("dblclick.zoom",null)}function B(){z.on("zoom",null)}async function T(l,S,j){let D=y6(l),x=z?.constrain()(D,S,j);if(x)await A(x);return x}async function R(l,S){let j=y6(l);return await A(j,S),j}function C(l){if(W){let S=y6(l),j=W.property("__zoom");if(j.k!==l.zoom||j.x!==l.x||j.y!==l.y)z?.transform(W,S,null,{sync:!0})}}function f(){let l=W?E5(W.node()):{x:0,y:0,k:1};return{x:l.x,y:l.y,zoom:l.k}}async function y(l,S){if(W)return new Promise((j)=>{z?.interpolate(S?.interpolate==="linear"?E0:f2).scaleTo(k6(W,S?.duration,S?.ease,()=>j(!0)),l)});return!1}async function N(l,S){if(W)return new Promise((j)=>{z?.interpolate(S?.interpolate==="linear"?E0:f2).scaleBy(k6(W,S?.duration,S?.ease,()=>j(!0)),l)});return!1}function k(l){z?.scaleExtent(l)}function E(l){z?.translateExtent(l)}function c(l){let S=!I0(l)||l<0?0:l;z?.clickDistance(S)}return{update:w,destroy:B,setViewport:R,setViewportConstrained:T,getViewport:f,scaleTo:y,scaleBy:N,setScaleExtent:k,setTranslateExtent:E,syncViewport:C,setClickDistance:c}}var n0;(function(_){_.Line="line",_.Handle="handle"})(n0||(n0={}));var G9=["top-left","top-right","bottom-left","bottom-right"],Z9=["top","right","bottom","left"];function aq({width:_,prevWidth:Q,height:J,prevHeight:q,affectsX:U,affectsY:G}){let Z=_-Q,F=J-q,X=[Z>0?1:Z<0?-1:0,F>0?1:F<0?-1:0];if(Z&&U)X[0]=X[0]*-1;if(F&&G)X[1]=X[1]*-1;return X}function S7(_){let Q=_.includes("right")||_.includes("left"),J=_.includes("bottom")||_.includes("top"),q=_.includes("left"),U=_.includes("top");return{isHorizontal:Q,isVertical:J,affectsX:q,affectsY:U}}function X2(_,Q){return Math.max(0,Q-_)}function K2(_,Q){return Math.max(0,_-Q)}function w4(_,Q,J){return Math.max(0,Q-_,_-J)}function y7(_,Q){return _?!Q:Q}function sq(_,Q,J,q,U,G,Z,F){let{affectsX:X,affectsY:Y}=Q,{isHorizontal:K,isVertical:H}=Q,L=K&&H,{xSnapped:z,ySnapped:W}=J,{minWidth:I,maxWidth:O,minHeight:A,maxHeight:w}=q,{x:B,y:T,width:R,height:C,aspectRatio:f}=_,y=Math.floor(K?z-_.pointerX:0),N=Math.floor(H?W-_.pointerY:0),k=R+(X?-y:y),E=C+(Y?-N:N),c=-G[0]*R,l=-G[1]*C,S=w4(k,I,O),j=w4(E,A,w);if(Z){let v=0,m=0;if(X&&y<0)v=X2(B+y+c,Z[0][0]);else if(!X&&y>0)v=K2(B+k+c,Z[1][0]);if(Y&&N<0)m=X2(T+N+l,Z[0][1]);else if(!Y&&N>0)m=K2(T+E+l,Z[1][1]);S=Math.max(S,v),j=Math.max(j,m)}if(F){let v=0,m=0;if(X&&y>0)v=K2(B+y,F[0][0]);else if(!X&&y<0)v=X2(B+k,F[1][0]);if(Y&&N>0)m=K2(T+N,F[0][1]);else if(!Y&&N<0)m=X2(T+E,F[1][1]);S=Math.max(S,v),j=Math.max(j,m)}if(U){if(K){let v=w4(k/f,A,w)*f;if(S=Math.max(S,v),Z){let m=0;if(!X&&!Y||X&&!Y&&L)m=K2(T+l+k/f,Z[1][1])*f;else m=X2(T+l+(X?y:-y)/f,Z[0][1])*f;S=Math.max(S,m)}if(F){let m=0;if(!X&&!Y||X&&!Y&&L)m=X2(T+k/f,F[1][1])*f;else m=K2(T+(X?y:-y)/f,F[0][1])*f;S=Math.max(S,m)}}if(H){let v=w4(E*f,I,O)/f;if(j=Math.max(j,v),Z){let m=0;if(!X&&!Y||Y&&!X&&L)m=K2(B+E*f+c,Z[1][0])/f;else m=X2(B+(Y?N:-N)*f+c,Z[0][0])/f;j=Math.max(j,m)}if(F){let m=0;if(!X&&!Y||Y&&!X&&L)m=X2(B+E*f,F[1][0])/f;else m=K2(B+(Y?N:-N)*f,F[0][0])/f;j=Math.max(j,m)}}}if(N=N+(N<0?j:-j),y=y+(y<0?S:-S),U)if(L)if(k>E*f)N=(y7(X,Y)?-y:y)/f;else y=(y7(X,Y)?-N:N)*f;else if(K)N=y/f,Y=X;else y=N*f,X=Y;let D=X?B+y:B,x=Y?T+N:T;return{width:R+(X?-y:y),height:C+(Y?-N:N),x:G[0]*y*(!X?1:-1)+D,y:G[1]*N*(!Y?1:-1)+x}}var F9={width:0,height:0,x:0,y:0},tq={...F9,pointerX:0,pointerY:0,aspectRatio:1};function oq(_,Q,J){let q=Q.position.x+_.position.x,U=Q.position.y+_.position.y,G=_.measured.width??0,Z=_.measured.height??0,F=J[0]*G,X=J[1]*Z;return[[q-F,U-X],[q+G-F,U+Z-X]]}function H9({domNode:_,nodeId:Q,getStoreItems:J,onChange:q,onEnd:U}){let G=o1(_),Z={controlDirection:S7("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function F({controlPosition:Y,boundaries:K,keepAspectRatio:H,resizeDirection:L,onResizeStart:z,onResize:W,onResizeEnd:I,shouldResize:O}){let A={...F9},w={...tq};Z={boundaries:K,resizeDirection:L,keepAspectRatio:H,controlDirection:S7(Y)};let B=void 0,T=null,R=[],C=void 0,f=void 0,y=void 0,N=O5().on("start",(k)=>{let{nodeLookup:E,transform:c,snapGrid:l,snapToGrid:S,nodeOrigin:j,paneDomNode:D}=J();if(B=E.get(Q),!B)return;T=D?.getBoundingClientRect()??null;let{xSnapped:x,ySnapped:v}=m5(k.sourceEvent,{transform:c,snapGrid:l,snapToGrid:S,containerBounds:T});if(A={width:B.measured.width??0,height:B.measured.height??0,x:B.position.x??0,y:B.position.y??0},w={...A,pointerX:x,pointerY:v,aspectRatio:A.width/A.height},C=void 0,f=V2(B.extent)?B.extent:void 0,B.parentId&&(B.extent==="parent"||B.expandParent))C=E.get(B.parentId);if(C&&B.extent==="parent")f=[[0,0],[C.measured.width,C.measured.height]];R=[],y=void 0;for(let[m,P]of E)if(P.parentId===Q){if(R.push({id:m,position:{...P.position},extent:P.extent}),P.extent==="parent"||P.expandParent){let V=oq(P,B,P.origin??j);if(y)y=[[Math.min(V[0][0],y[0][0]),Math.min(V[0][1],y[0][1])],[Math.max(V[1][0],y[1][0]),Math.max(V[1][1],y[1][1])]];else y=V}}z?.(k,{...A})}).on("drag",(k)=>{let{transform:E,snapGrid:c,snapToGrid:l,nodeOrigin:S}=J(),j=m5(k.sourceEvent,{transform:E,snapGrid:c,snapToGrid:l,containerBounds:T}),D=[];if(!B)return;let{x,y:v,width:m,height:P}=A,V={},b=B.origin??S,{width:u,height:t,x:Q1,y:a}=sq(w,Z.controlDirection,j,Z.boundaries,Z.keepAspectRatio,b,f,y),o=u!==m,p=t!==P,n=Q1!==x&&o,J1=a!==v&&p;if(!n&&!J1&&!o&&!p)return;let G1={prevValues:{...A},startX:w.x,startY:w.y,childNodes:R.map((L1)=>({...L1,position:{...L1.position}}))};if(n||J1||b[0]===1||b[1]===1){if(V.x=n?Q1:A.x,V.y=J1?a:A.y,A.x=V.x,A.y=V.y,R.length>0){let L1=Q1-x,e=a-v;for(let O1 of R)O1.position={x:O1.position.x-L1+b[0]*(u-m),y:O1.position.y-e+b[1]*(t-P)},D.push(O1)}}if(o||p)V.width=o&&(!Z.resizeDirection||Z.resizeDirection==="horizontal")?u:A.width,V.height=p&&(!Z.resizeDirection||Z.resizeDirection==="vertical")?t:A.height,A.width=V.width,A.height=V.height;if(C&&B.expandParent){let L1=b[0]*(V.width??0);if(V.x&&V.x<L1)A.x=L1,w.x=w.x-(V.x-L1);let e=b[1]*(V.height??0);if(V.y&&V.y<e)A.y=e,w.y=w.y-(V.y-e)}let q1=aq({width:A.width,prevWidth:m,height:A.height,prevHeight:P,affectsX:Z.controlDirection.affectsX,affectsY:Z.controlDirection.affectsY}),Y1={...A,direction:q1};if(O?.(k,Y1)===!1){A=G1.prevValues,w.x=G1.startX,w.y=G1.startY,R.forEach((L1,e)=>{L1.position=G1.childNodes[e].position});return}W?.(k,Y1),q(V,D)}).on("end",(k)=>{I?.(k,{...A}),U?.({...A})});G.call(N)}function X(){G.on(".drag",null)}return{update:F,destroy:X}}var W9=Q0(h0(),1),A9=Q0(K9(),1);var Y9=(_)=>{let Q,J=new Set,q=(K,H)=>{let L=typeof K==="function"?K(Q):K;if(!Object.is(L,Q)){let z=Q;Q=(H!=null?H:typeof L!=="object"||L===null)?L:Object.assign({},Q,L),J.forEach((W)=>W(Q,z))}},U=()=>Q,X={setState:q,getState:U,getInitialState:()=>Y,subscribe:(K)=>{return J.add(K),()=>J.delete(K)},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.");J.clear()}},Y=Q=_(q,U,X);return X},L9=(_)=>_?Y9(_):Y9;var{useDebugValue:_U}=W9.default,{useSyncExternalStoreWithSelector:QU}=A9.default,JU=(_)=>_;function Q8(_,Q=JU,J){let q=QU(_.subscribe,_.getState,_.getServerState||_.getInitialState,Q,J);return _U(q),q}var z9=(_,Q)=>{let J=L9(_),q=(U,G=Q)=>Q8(J,U,G);return Object.assign(q,J),q},B9=(_,Q)=>_?z9(_,Q):z9;function E1(_,Q){if(Object.is(_,Q))return!0;if(typeof _!=="object"||_===null||typeof Q!=="object"||Q===null)return!1;if(_ instanceof Map&&Q instanceof Map){if(_.size!==Q.size)return!1;for(let[q,U]of _)if(!Object.is(U,Q.get(q)))return!1;return!0}if(_ instanceof Set&&Q instanceof Set){if(_.size!==Q.size)return!1;for(let q of _)if(!Q.has(q))return!1;return!0}let J=Object.keys(_);if(J.length!==Object.keys(Q).length)return!1;for(let q of J)if(!Object.prototype.hasOwnProperty.call(Q,q)||!Object.is(_[q],Q[q]))return!1;return!0}var a9=Q0(R9(),1),l4=d.createContext(null),UU=l4.Provider,s9=X0.error001("react");function S1(_,Q){let J=d.useContext(l4);if(J===null)throw Error(s9);return Q8(J,_,Q)}function x1(){let _=d.useContext(l4);if(_===null)throw Error(s9);return d.useMemo(()=>({getState:_.getState,setState:_.setState,subscribe:_.subscribe}),[_])}var O9={display:"none"},GU={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},t9="react-flow__node-desc",o9="react-flow__edge-desc",ZU="react-flow__aria-live",FU=(_)=>_.ariaLiveMessage,HU=(_)=>_.ariaLabelConfig;function XU({rfId:_}){let Q=S1(FU);return i.jsx("div",{id:`${ZU}-${_}`,"aria-live":"assertive","aria-atomic":"true",style:GU,children:Q})}function KU({rfId:_,disableKeyboardA11y:Q}){let J=S1(HU);return i.jsxs(i.Fragment,{children:[i.jsx("div",{id:`${t9}-${_}`,style:O9,children:Q?J["node.a11yDescription.default"]:J["node.a11yDescription.keyboardDisabled"]}),i.jsx("div",{id:`${o9}-${_}`,style:O9,children:J["edge.a11yDescription.default"]}),!Q&&i.jsx(XU,{rfId:_})]})}var g0=d.forwardRef(({position:_="top-left",children:Q,className:J,style:q,...U},G)=>{let Z=`${_}`.split("-");return i.jsx("div",{className:l1(["react-flow__panel",J,...Z]),style:q,ref:G,...U,children:Q})});g0.displayName="Panel";var I9="https://reactflow.dev/attribution";function YU({proOptions:_,position:Q="bottom-right"}){if(d.useEffect(()=>{E7("react")},[]),_?.hideAttribution)return null;return i.jsx(g0,{position:Q,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${I9}`,children:i.jsx("a",{href:I9,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}var LU=(_)=>{let Q=[],J=[];for(let[,q]of _.nodeLookup)if(q.selected)Q.push(q.internals.userNode);for(let[,q]of _.edgeLookup)if(q.selected)J.push(q);return{selectedNodes:Q,selectedEdges:J}},m4=(_)=>_.id;function zU(_,Q){return E1(_.selectedNodes.map(m4),Q.selectedNodes.map(m4))&&E1(_.selectedEdges.map(m4),Q.selectedEdges.map(m4))}function WU({onSelectionChange:_}){let Q=x1(),{selectedNodes:J,selectedEdges:q}=S1(LU,zU);return d.useEffect(()=>{let U={nodes:J,edges:q};_?.(U),Q.getState().onSelectionChangeHandlers.forEach((G)=>G(U))},[J,q,_]),null}var AU=(_)=>!!_.onSelectionChangeHandlers;function BU({onSelectionChange:_}){let Q=S1(AU);if(_||Q)return i.jsx(WU,{onSelectionChange:_});return null}var n9=[0,0],MU={x:0,y:0,zoom:1},TU=["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"],P9=[...TU,"rfId"],RU=(_)=>({setNodes:_.setNodes,setEdges:_.setEdges,setMinZoom:_.setMinZoom,setMaxZoom:_.setMaxZoom,setTranslateExtent:_.setTranslateExtent,setNodeExtent:_.setNodeExtent,reset:_.reset,setDefaultNodesAndEdges:_.setDefaultNodesAndEdges}),N9={translateExtent:$5,nodeOrigin:n9,minZoom:0.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function OU(_){let{setNodes:Q,setEdges:J,setMinZoom:q,setMaxZoom:U,setTranslateExtent:G,setNodeExtent:Z,reset:F,setDefaultNodesAndEdges:X}=S1(RU,E1),Y=x1();d.useEffect(()=>{return X(_.defaultNodes,_.defaultEdges),()=>{K.current=N9,F()}},[]);let K=d.useRef(N9);return d.useEffect(()=>{for(let H of P9){let L=_[H],z=K.current[H];if(L===z)continue;if(typeof _[H]>"u")continue;if(H==="nodes")Q(L);else if(H==="edges")J(L);else if(H==="minZoom")q(L);else if(H==="maxZoom")U(L);else if(H==="translateExtent")G(L);else if(H==="nodeExtent")Z(L);else if(H==="ariaLabelConfig")Y.setState({ariaLabelConfig:b7(L)});else if(H==="fitView")Y.setState({fitViewQueued:L});else if(H==="fitViewOptions")Y.setState({fitViewOptions:L});else Y.setState({[H]:L})}K.current=_},P9.map((H)=>_[H])),null}function w9(){if(typeof window>"u"||!window.matchMedia)return null;return window.matchMedia("(prefers-color-scheme: dark)")}function IU(_){let[Q,J]=d.useState(_==="system"?null:_);return d.useEffect(()=>{if(_!=="system"){J(_);return}let q=w9(),U=()=>J(q?.matches?"dark":"light");return U(),q?.addEventListener("change",U),()=>{q?.removeEventListener("change",U)}},[_]),Q!==null?Q:w9()?.matches?"dark":"light"}var f9=typeof document<"u"?document:null;function r5(_=null,Q={target:f9,actInsideInputWithModifier:!0}){let[J,q]=d.useState(!1),U=d.useRef(!1),G=d.useRef(new Set([])),[Z,F]=d.useMemo(()=>{if(_!==null){let Y=(Array.isArray(_)?_:[_]).filter((H)=>typeof H==="string").map((H)=>H.replace(/\+/g,`
29
29
  `).replace(`
30
30
 
31
31
  `,`
32
32
  +`).split(`
33
- `)),K=Y.reduce((H,L)=>H.concat(...L),[]);return[Y,K]}return[[],[]]},[_]);return d.useEffect(()=>{let X=Q?.target??R9,Y=Q?.actInsideInputWithModifier??!0;if(_!==null){let K=(z)=>{if(U.current=z.ctrlKey||z.metaKey||z.shiftKey||z.altKey,(!U.current||U.current&&!Y)&&g6(z))return!1;let w=I9(z.code,F);if(G.current.add(z[w]),O9(Z,G.current,!1)){let R=z.composedPath?.()?.[0]||z.target,A=R?.nodeName==="BUTTON"||R?.nodeName==="A";if(Q.preventDefault!==!1&&(U.current||!A))z.preventDefault();q(!0)}},H=(z)=>{let W=I9(z.code,F);if(O9(Z,G.current,!0))q(!1),G.current.clear();else G.current.delete(z[W]);if(z.key==="Meta")G.current.clear();U.current=!1},L=()=>{G.current.clear(),q(!1)};return X?.addEventListener("keydown",K),X?.addEventListener("keyup",H),window.addEventListener("blur",L),window.addEventListener("contextmenu",L),()=>{X?.removeEventListener("keydown",K),X?.removeEventListener("keyup",H),window.removeEventListener("blur",L),window.removeEventListener("contextmenu",L)}}},[_,q]),J}function O9(_,Q,J){return _.filter((q)=>J||q.length===Q.size).some((q)=>q.every((U)=>Q.has(U)))}function I9(_,Q){return Q.includes(_)?"code":"key"}var OU=()=>{let _=E1();return d.useMemo(()=>{return{zoomIn:async(Q)=>{let{panZoom:J}=_.getState();return J?J.scaleBy(1.2,Q):!1},zoomOut:async(Q)=>{let{panZoom:J}=_.getState();return J?J.scaleBy(0.8333333333333334,Q):!1},zoomTo:async(Q,J)=>{let{panZoom:q}=_.getState();return q?q.scaleTo(Q,J):!1},getZoom:()=>_.getState().transform[2],setViewport:async(Q,J)=>{let{transform:[q,U,G],panZoom:Z}=_.getState();if(!Z)return!1;return await Z.setViewport({x:Q.x??q,y:Q.y??U,zoom:Q.zoom??G},J),!0},getViewport:()=>{let[Q,J,q]=_.getState().transform;return{x:Q,y:J,zoom:q}},setCenter:async(Q,J,q)=>{return _.getState().setCenter(Q,J,q)},fitBounds:async(Q,J)=>{let{width:q,height:U,minZoom:G,maxZoom:Z,panZoom:F}=_.getState(),X=p5(Q,q,U,G,Z,J?.padding??0.1);if(!F)return!1;return await F.setViewport(X,{duration:J?.duration,ease:J?.ease,interpolate:J?.interpolate}),!0},screenToFlowPosition:(Q,J={})=>{let{transform:q,snapGrid:U,snapToGrid:G,domNode:Z}=_.getState();if(!Z)return Q;let{x:F,y:X}=Z.getBoundingClientRect(),Y={x:Q.x-F,y:Q.y-X},K=J.snapGrid??U,H=J.snapToGrid??G;return U5(Y,q,H,K)},flowToScreenPosition:(Q)=>{let{transform:J,domNode:q}=_.getState();if(!q)return Q;let{x:U,y:G}=q.getBoundingClientRect(),Z=y2(Q,J);return{x:Z.x+U,y:Z.y+G}}}},[])};function d9(_,Q){let J=[],q=new Map,U=[];for(let G of _)if(G.type==="add"){U.push(G);continue}else if(G.type==="remove"||G.type==="replace")q.set(G.id,[G]);else{let Z=q.get(G.id);if(Z)Z.push(G);else q.set(G.id,[G])}for(let G of Q){let Z=q.get(G.id);if(!Z){J.push(G);continue}if(Z[0].type==="remove")continue;if(Z[0].type==="replace"){J.push({...Z[0].item});continue}let F={...G};for(let X of Z)IU(X,F);J.push(F)}if(U.length)U.forEach((G)=>{if(G.index!==void 0)J.splice(G.index,0,{...G.item});else J.push({...G.item})});return J}function IU(_,Q){switch(_.type){case"select":{Q.selected=_.selected;break}case"position":{if(typeof _.position<"u")Q.position=_.position;if(typeof _.dragging<"u")Q.dragging=_.dragging;break}case"dimensions":{if(typeof _.dimensions<"u"){if(Q.measured={..._.dimensions},_.setAttributes){if(_.setAttributes===!0||_.setAttributes==="width")Q.width=_.dimensions.width;if(_.setAttributes===!0||_.setAttributes==="height")Q.height=_.dimensions.height}}if(typeof _.resizing==="boolean")Q.resizing=_.resizing;break}}}function a9(_,Q){return d9(_,Q)}function wU(_,Q){return d9(_,Q)}function u2(_,Q){return{id:_,type:"select",selected:Q}}function Z5(_,Q=new Set,J=!1){let q=[];for(let[U,G]of _){let Z=Q.has(U);if(!(G.selected===void 0&&!Z)&&G.selected!==Z){if(J)G.selected=Z;q.push(u2(G.id,Z))}}return q}function w9({items:_=[],lookup:Q}){let J=[],q=new Map(_.map((U)=>[U.id,U]));for(let[U,G]of _.entries()){let Z=Q.get(G.id),F=Z?.internals?.userNode??Z;if(F!==void 0&&F!==G)J.push({id:G.id,item:G,type:"replace"});if(F===void 0)J.push({item:G,type:"add",index:U})}for(let[U]of Q)if(q.get(U)===void 0)J.push({id:U,type:"remove"});return J}function P9(_){return{id:_.id,type:"remove"}}var PU=h6("React Flow","https://reactflow.dev/");function NU(_,Q,J={}){return h7(_,Q,{...J,onError:J.onError??PU})}var N9=(_)=>P7(_),fU=(_)=>v6(_);function s9(_){return d.forwardRef(_)}var t9=typeof window<"u"?d.useLayoutEffect:d.useEffect;function f9(_){let[Q,J]=d.useState(BigInt(0)),[q]=d.useState(()=>CU(()=>J((U)=>U+BigInt(1))));return t9(()=>{let U=q.get();if(U.length)_(U),q.reset()},[Q]),q}function CU(_){let Q=[];return{get:()=>Q,reset:()=>{Q=[]},push:(J)=>{Q.push(J),_()}}}var o9=d.createContext(null);function SU({children:_}){let Q=E1(),J=d.useCallback((F)=>{let{nodes:X=[],setNodes:Y,hasDefaultNodes:K,onNodesChange:H,nodeLookup:L,fitViewQueued:z,onNodesChangeMiddlewareMap:W}=Q.getState(),w=X;for(let A of F)w=typeof A==="function"?A(w):A;let R=w9({items:w,lookup:L});for(let A of W.values())R=A(R);if(K)Y(w);if(R.length>0)H?.(R);else if(z)window.requestAnimationFrame(()=>{let{fitViewQueued:A,nodes:O,setNodes:B}=Q.getState();if(A)B(O)})},[]),q=f9(J),U=d.useCallback((F)=>{let{edges:X=[],setEdges:Y,hasDefaultEdges:K,onEdgesChange:H,edgeLookup:L}=Q.getState(),z=X;for(let W of F)z=typeof W==="function"?W(z):W;if(K)Y(z);else if(H)H(w9({items:z,lookup:L}))},[]),G=f9(U),Z=d.useMemo(()=>({nodeQueue:q,edgeQueue:G}),[]);return r.jsx(o9.Provider,{value:Z,children:_})}function vU(){let _=d.useContext(o9);if(!_)throw Error("useBatchContext must be used within a BatchProvider");return _}var kU=(_)=>!!_.panZoom;function i5(){let _=OU(),Q=E1(),J=vU(),q=C1(kU),U=d.useMemo(()=>{let G=(H)=>Q.getState().nodeLookup.get(H),Z=(H)=>{J.nodeQueue.push(H)},F=(H)=>{J.edgeQueue.push(H)},X=(H)=>{let{nodeLookup:L,nodeOrigin:z}=Q.getState(),W=N9(H)?H:L.get(H.id),w=W.parentId?b6(W.position,W.measured,W.parentId,L,z):W.position,R={...W,position:w,width:W.measured?.width??W.width,height:W.measured?.height??W.height};return $5(R)},Y=(H,L,z={replace:!1})=>{Z((W)=>W.map((w)=>{if(w.id===H){let R=typeof L==="function"?L(w):L;return z.replace&&N9(R)?R:{...w,...R}}return w}))},K=(H,L,z={replace:!1})=>{F((W)=>W.map((w)=>{if(w.id===H){let R=typeof L==="function"?L(w):L;return z.replace&&fU(R)?R:{...w,...R}}return w}))};return{getNodes:()=>Q.getState().nodes.map((H)=>({...H})),getNode:(H)=>G(H)?.internals.userNode,getInternalNode:G,getEdges:()=>{let{edges:H=[]}=Q.getState();return H.map((L)=>({...L}))},getEdge:(H)=>Q.getState().edgeLookup.get(H),setNodes:Z,setEdges:F,addNodes:(H)=>{let L=Array.isArray(H)?H:[H];J.nodeQueue.push((z)=>[...z,...L])},addEdges:(H)=>{let L=Array.isArray(H)?H:[H];J.edgeQueue.push((z)=>[...z,...L])},toObject:()=>{let{nodes:H=[],edges:L=[],transform:z}=Q.getState(),[W,w,R]=z;return{nodes:H.map((A)=>({...A})),edges:L.map((A)=>({...A})),viewport:{x:W,y:w,zoom:R}}},deleteElements:async({nodes:H=[],edges:L=[]})=>{let{nodes:z,edges:W,onNodesDelete:w,onEdgesDelete:R,triggerNodeChanges:A,triggerEdgeChanges:O,onDelete:B,onBeforeDelete:M}=Q.getState(),{nodes:P,edges:C}=await C7({nodesToRemove:H,edgesToRemove:L,nodes:z,edges:W,onBeforeDelete:M}),f=C.length>0,v=P.length>0;if(f){let N=C.map(P9);R?.(C),O(N)}if(v){let N=P.map(P9);w?.(P),A(N)}if(v||f)B?.({nodes:P,edges:C});return{deletedNodes:P,deletedEdges:C}},getIntersectingNodes:(H,L=!0,z)=>{let W=u6(H),w=W?H:X(H),R=z!==void 0;if(!w)return[];return(z||Q.getState().nodes).filter((A)=>{let O=Q.getState().nodeLookup.get(A.id);if(O&&!W&&(A.id===H.id||!O.internals.positionAbsolute))return!1;let B=$5(R?A:O),M=g5(B,w);return L&&M>0||M>=B.width*B.height||M>=w.width*w.height})},isNodeIntersecting:(H,L,z=!0)=>{let w=u6(H)?H:X(H);if(!w)return!1;let R=g5(w,L);return z&&R>0||R>=L.width*L.height||R>=w.width*w.height},updateNode:Y,updateNodeData:(H,L,z={replace:!1})=>{Y(H,(W)=>{let w=typeof L==="function"?L(W):L;return z.replace?{...W,data:w}:{...W,data:{...W.data,...w}}},z)},updateEdge:K,updateEdgeData:(H,L,z={replace:!1})=>{K(H,(W)=>{let w=typeof L==="function"?L(W):L;return z.replace?{...W,data:w}:{...W,data:{...W.data,...w}}},z)},getNodesBounds:(H)=>{let{nodeLookup:L,nodeOrigin:z}=Q.getState();return y6(H,{nodeLookup:L,nodeOrigin:z})},getHandleConnections:({type:H,id:L,nodeId:z})=>Array.from(Q.getState().connectionLookup.get(`${z}-${H}${L?`-${L}`:""}`)?.values()??[]),getNodeConnections:({type:H,handleId:L,nodeId:z})=>Array.from(Q.getState().connectionLookup.get(`${z}${H?L?`-${H}-${L}`:`-${H}`:""}`)?.values()??[]),fitView:async(H)=>{let L=Q.getState().fitViewResolver??k7();return Q.setState({fitViewQueued:!0,fitViewOptions:H,fitViewResolver:L}),J.nodeQueue.push((z)=>[...z]),L.promise}}},[]);return d.useMemo(()=>{return{...U,..._,viewportInitialized:q}},[q])}var C9=(_)=>_.selected,yU=typeof window<"u"?window:void 0;function jU({deleteKeyCode:_,multiSelectionKeyCode:Q}){let J=E1(),{deleteElements:q}=i5(),U=l5(_,{actInsideInputWithModifier:!1}),G=l5(Q,{target:yU});d.useEffect(()=>{if(U){let{edges:Z,nodes:F}=J.getState();q({nodes:F.filter(C9),edges:Z.filter(C9)}),J.setState({nodesSelectionActive:!1})}},[U]),d.useEffect(()=>{J.setState({multiSelectionActive:G})},[G])}function VU(_){let Q=E1();d.useEffect(()=>{let J=()=>{if(!_.current||!(_.current.checkVisibility?.()??!0))return!1;let q=v4(_.current);if(q.height===0||q.width===0)Q.getState().onError?.("004",X0.error004());Q.setState({width:q.width||500,height:q.height||500})};if(_.current){J(),window.addEventListener("resize",J);let q=new ResizeObserver(()=>J());return q.observe(_.current),()=>{if(window.removeEventListener("resize",J),q&&_.current)q.unobserve(_.current)}}},[])}var c4={position:"absolute",width:"100%",height:"100%",top:0,left:0},uU=(_)=>({userSelectionActive:_.userSelectionActive,lib:_.lib,connectionInProgress:_.connection.inProgress});function hU({onPaneContextMenu:_,zoomOnScroll:Q=!0,zoomOnPinch:J=!0,panOnScroll:q=!1,panActivationKeyPressed:U,panOnScrollSpeed:G=0.5,panOnScrollMode:Z=s0.Free,zoomOnDoubleClick:F=!0,panOnDrag:X=!0,defaultViewport:Y,translateExtent:K,minZoom:H,maxZoom:L,zoomActivationKeyCode:z,preventScrolling:W=!0,children:w,noWheelClassName:R,noPanClassName:A,onViewportChange:O,isControlledViewport:B,paneClickDistance:M,selectionOnDrag:P}){let C=E1(),f=d.useRef(null),{userSelectionActive:v,lib:N,connectionInProgress:k}=C1(uU,b1),u=l5(z),i=d.useRef();VU(f);let l=d.useCallback((S)=>{if(O?.({x:S[0],y:S[1],zoom:S[2]}),!B)C.setState({transform:S})},[O,B]);return d.useEffect(()=>{if(f.current){i.current=e7({domNode:f.current,minZoom:H,maxZoom:L,translateExtent:K,viewport:Y,onDraggingChange:(E)=>C.setState((j)=>j.paneDragging===E?j:{paneDragging:E}),onPanZoomStart:(E,j)=>{let{onViewportChangeStart:m,onMoveStart:I}=C.getState();I?.(E,j),m?.(j)},onPanZoom:(E,j)=>{let{onViewportChange:m,onMove:I}=C.getState();I?.(E,j),m?.(j)},onPanZoomEnd:(E,j)=>{let{onViewportChangeEnd:m,onMoveEnd:I}=C.getState();I?.(E,j),m?.(j)}});let{x:S,y:b,zoom:h}=i.current.getViewport();return C.setState({panZoom:i.current,transform:[S,b,h],domNode:f.current.closest(".react-flow")}),()=>{i.current?.destroy()}}},[]),d.useEffect(()=>{i.current?.update({onPaneContextMenu:_,zoomOnScroll:Q,zoomOnPinch:J,panOnScroll:q,panActivationKeyPressed:U,panOnScrollSpeed:G,panOnScrollMode:Z,zoomOnDoubleClick:F,panOnDrag:X,zoomActivationKeyPressed:u,preventScrolling:W,noPanClassName:A,userSelectionActive:v,noWheelClassName:R,lib:N,onTransformChange:l,connectionInProgress:k,selectionOnDrag:P,paneClickDistance:M})},[_,Q,J,q,U,G,Z,F,X,u,W,A,v,R,N,l,k,P,M]),r.jsx("div",{className:"react-flow__renderer",ref:f,style:c4,children:w})}var DU=(_)=>({userSelectionActive:_.userSelectionActive,userSelectionRect:_.userSelectionRect});function bU(){let{userSelectionActive:_,userSelectionRect:Q}=C1(DU,b1);if(!(_&&Q))return null;return r.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:Q.width,height:Q.height,transform:`translate(${Q.x}px, ${Q.y}px)`}})}var o6=(_,Q)=>{return(J)=>{if(J.target!==Q.current)return;_?.(J)}},EU=(_)=>({userSelectionActive:_.userSelectionActive,elementsSelectable:_.elementsSelectable,dragging:_.paneDragging,panBy:_.panBy,autoPanSpeed:_.autoPanSpeed});function xU({isSelecting:_,selectionKeyPressed:Q,selectionMode:J=v2.Full,panOnDrag:q,autoPanOnSelection:U,paneClickDistance:G,selectionOnDrag:Z,onSelectionStart:F,onSelectionEnd:X,onPaneClick:Y,onPaneContextMenu:K,onPaneScroll:H,onPaneMouseEnter:L,onPaneMouseMove:z,onPaneMouseLeave:W,children:w}){let R=d.useRef(0),A=E1(),{userSelectionActive:O,elementsSelectable:B,dragging:M,panBy:P,autoPanSpeed:C}=C1(EU,b1),f=B&&(_||O),v=d.useRef(null),N=d.useRef(),k=d.useRef(new Set),u=d.useRef(new Set),i=d.useRef(!1),l=d.useRef(!1),S=d.useRef({x:0,y:0}),b=d.useRef(!1),h=(p)=>{if(l.current||i.current||A.getState().connection.inProgress){l.current=!1,i.current=!1;return}Y?.(p),A.getState().resetSelectedElements(),A.setState({nodesSelectionActive:!1})},E=(p)=>{if(Array.isArray(q)&&q?.includes(2)){p.preventDefault();return}K?.(p)},j=H?(p)=>H(p):void 0,m=(p)=>{if(l.current)p.stopPropagation(),l.current=!1},I=(p)=>{if(p.pointerType==="touch"&&q!==!1&&!Q)return;let{domNode:e,transform:q1}=A.getState();if(N.current=e?.getBoundingClientRect(),!N.current)return;let G1=p.target===v.current;if(!G1&&!!p.target.closest(".nokey")||!_||!(Z&&G1||Q)||p.button!==0||!p.isPrimary)return;p.target?.setPointerCapture?.(p.pointerId),l.current=!1;let{x:W1,y:Y1}=O0(p.nativeEvent,N.current),n=U5({x:W1,y:Y1},q1);if(A.setState({userSelectionRect:{width:0,height:0,startX:n.x,startY:n.y,x:W1,y:Y1}}),!G1)p.stopPropagation(),p.preventDefault()};function V(p,e){let{userSelectionRect:q1}=A.getState();if(!q1)return;let{transform:G1,nodeLookup:U1,edgeLookup:K1,connectionLookup:W1,triggerNodeChanges:Y1,triggerEdgeChanges:n,defaultEdgeOptions:I1}=A.getState(),H1={x:q1.startX,y:q1.startY},{x:m1,y:t1}=y2(H1,G1),d1={startX:H1.x,startY:H1.y,x:p<m1?p:m1,y:e<t1?e:t1,width:Math.abs(p-m1),height:Math.abs(e-t1)},N0=k.current,z0=u.current;k.current=new Set(N4(U1,d1,G1,J===v2.Partial,!0).map(($0)=>$0.id)),u.current=new Set;let T0=I1?.selectable??!0;for(let $0 of k.current){let F0=W1.get($0);if(!F0)continue;for(let{edgeId:_0}of F0.values()){let W0=K1.get(_0);if(W0&&(W0.selectable??T0))u.current.add(_0)}}if(!E6(N0,k.current)){let $0=Z5(U1,k.current,!0);Y1($0)}if(!E6(z0,u.current)){let $0=Z5(K1,u.current);n($0)}A.setState({userSelectionRect:d1,userSelectionActive:!0,nodesSelectionActive:!1})}function D(){if(!U||!N.current)return;let[p,e]=f4(S.current,N.current,C);P({x:p,y:e}).then((q1)=>{if(!l.current||!q1){R.current=requestAnimationFrame(D);return}let{x:G1,y:U1}=S.current;V(G1,U1),R.current=requestAnimationFrame(D)})}let y=()=>{cancelAnimationFrame(R.current),R.current=0,b.current=!1};d.useEffect(()=>{return()=>y()},[]);let t=(p)=>{let{userSelectionRect:e,transform:q1,resetSelectedElements:G1}=A.getState();if(!N.current||!e)return;let{x:U1,y:K1}=O0(p.nativeEvent,N.current);S.current={x:U1,y:K1};let W1=y2({x:e.startX,y:e.startY},q1);if(!l.current){let Y1=Q?0:G;if(Math.hypot(U1-W1.x,K1-W1.y)<=Y1)return;G1(),F?.(p)}if(l.current=!0,!b.current)D(),b.current=!0;V(U1,K1)},_1=(p)=>{if(!f){if(p.target===v.current&&A.getState().connection.inProgress)i.current=!0;return}if(p.button!==0)return;if(p.target?.releasePointerCapture?.(p.pointerId),!O&&p.target===v.current&&A.getState().userSelectionRect)h?.(p);if(A.setState({userSelectionActive:!1,userSelectionRect:null}),l.current)X?.(p),A.setState({nodesSelectionActive:k.current.size>0});y()},s=(p)=>{p.target?.releasePointerCapture?.(p.pointerId),y()},o=q===!0||Array.isArray(q)&&q.includes(0);return r.jsxs("div",{className:g1(["react-flow__pane",{draggable:o,dragging:M,selection:_}]),onClick:f?void 0:o6(h,v),onContextMenu:o6(E,v),onWheel:o6(j,v),onPointerEnter:f?void 0:L,onPointerMove:f?t:z,onPointerUp:_1,onPointerCancel:f?s:void 0,onPointerDownCapture:f?I:void 0,onClickCapture:f?m:void 0,onPointerLeave:W,ref:v,style:c4,children:[w,r.jsx(bU,{})]})}function e6({id:_,store:Q,unselect:J=!1,nodeRef:q}){let{addSelectedNodes:U,unselectNodesAndEdges:G,multiSelectionActive:Z,nodeLookup:F,onError:X}=Q.getState(),Y=F.get(_);if(!Y){X?.("012",X0.error012(_));return}if(Q.setState({nodesSelectionActive:!1}),!Y.selected)U([_]);else if(J||Y.selected&&Z)G({nodes:[Y],edges:[]}),requestAnimationFrame(()=>q?.current?.blur())}function n9({nodeRef:_,disabled:Q=!1,noDragClassName:J,handleSelector:q,nodeId:U,isSelectable:G,nodeClickDistance:Z}){let F=E1(),[X,Y]=d.useState(!1),K=d.useRef();return d.useEffect(()=>{if(Q)return;return K.current=i7({getStoreItems:()=>F.getState(),onNodeMouseDown:(H)=>{e6({id:H,store:F,nodeRef:_})},onDragStart:()=>{Y(!0)},onDragStop:()=>{Y(!1)}}),()=>{K.current?.destroy(),K.current=void 0}},[Q,F,_]),d.useEffect(()=>{if(Q||!_.current||!K.current)return;K.current.update({noDragClassName:J,handleSelector:q,domNode:_.current,isSelectable:G,nodeId:U,nodeClickDistance:Z})},[J,q,Q,G,_,U,Z]),X}var mU=(_)=>(Q)=>Q.selected&&(Q.draggable||_&&typeof Q.draggable>"u");function e9(){let _=E1();return d.useCallback((J)=>{let{nodeExtent:q,snapToGrid:U,snapGrid:G,nodesDraggable:Z,onError:F,updateNodePositions:X,nodeLookup:Y,nodeOrigin:K}=_.getState(),H=new Map,L=mU(Z),z=U?G[0]:5,W=U?G[1]:5,w=J.direction.x*z*J.factor,R=J.direction.y*W*J.factor;for(let[,A]of Y){if(!L(A))continue;let O={x:A.internals.positionAbsolute.x+w,y:A.internals.positionAbsolute.y+R};if(U)O=q5(O,G);let{position:B,positionAbsolute:M}=j6({nodeId:A.id,nextPosition:O,nodeLookup:Y,nodeExtent:q,nodeOrigin:K,onError:F});A.position=B,A.internals.positionAbsolute=M,H.set(A.id,A)}X(H)},[])}var _8=d.createContext(null),gU=_8.Provider;_8.Consumer;var Q8=()=>{return d.useContext(_8)},pU=(_)=>({connectOnClick:_.connectOnClick,noPanClassName:_.noPanClassName,rfId:_.rfId}),__=d.createContext(null);function cU({children:_}){let Q=C1(pU,b1);return r.jsx(__.Provider,{value:Q,children:_})}function lU(){let _=d.useContext(__);if(!_)throw Error("useHandleConfig must be used within a HandleConfigProvider");return _}var iU={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},rU=(_,Q,J)=>(q)=>{let{connectionClickStartHandle:U,connectionMode:G,connection:Z}=q,{fromHandle:F,toHandle:X,isValid:Y}=Z;if(!F&&!U)return iU;let K=X?.nodeId===_&&X?.id===Q&&X?.type===J;return{connectingFrom:F?.nodeId===_&&F?.id===Q&&F?.type===J,connectingTo:K,clickConnecting:U?.nodeId===_&&U?.id===Q&&U?.type===J,isPossibleEndHandle:G===L2.Strict?F?.type!==J:_!==F?.nodeId||Q!==F?.id,connectionInProcess:!!F,clickConnectionInProcess:!!U,valid:K&&Y}};function dU({type:_="source",position:Q=F1.Top,isValidConnection:J,isConnectable:q=!0,isConnectableStart:U=!0,isConnectableEnd:G=!0,id:Z,onConnect:F,children:X,className:Y,onMouseDown:K,onTouchStart:H,...L},z){let W=Z||null,w=_==="target",R=E1(),A=Q8(),{connectOnClick:O,noPanClassName:B,rfId:M}=lU(),{connectingFrom:P,connectingTo:C,clickConnecting:f,isPossibleEndHandle:v,connectionInProcess:N,clickConnectionInProcess:k,valid:u}=C1(rU(A,W,_),b1);if(!A)R.getState().onError?.("010",X0.error010());let i=(b)=>{let{defaultEdgeOptions:h,onConnect:E,hasDefaultEdges:j}=R.getState(),m={...h,...b};if(j){let{edges:I,setEdges:V,onError:D}=R.getState();V(NU(m,I,{onError:D}))}E?.(m),F?.(m)},l=(b)=>{if(!A)return;let h=p6(b.nativeEvent);if(U&&(h&&b.button===0||!h)){let E=R.getState();D4.onPointerDown(b.nativeEvent,{handleDomNode:b.currentTarget,autoPanOnConnect:E.autoPanOnConnect,connectionMode:E.connectionMode,connectionRadius:E.connectionRadius,domNode:E.domNode,nodeLookup:E.nodeLookup,lib:E.lib,isTarget:w,handleId:W,nodeId:A,flowId:E.rfId,panBy:E.panBy,cancelConnection:E.cancelConnection,onConnectStart:E.onConnectStart,onConnectEnd:(...j)=>R.getState().onConnectEnd?.(...j),updateConnection:E.updateConnection,onConnect:i,isValidConnection:J||((...j)=>R.getState().isValidConnection?.(...j)??!0),getTransform:()=>R.getState().transform,getFromHandle:()=>R.getState().connection.fromHandle,autoPanSpeed:E.autoPanSpeed,dragThreshold:E.connectionDragThreshold})}if(h)K?.(b);else H?.(b)},S=(b)=>{let{onClickConnectStart:h,onClickConnectEnd:E,connectionClickStartHandle:j,connectionMode:m,isValidConnection:I,lib:V,rfId:D,nodeLookup:y,connection:t}=R.getState();if(!A||!j&&!U)return;if(!j){h?.(b.nativeEvent,{nodeId:A,handleId:W,handleType:_}),R.setState({connectionClickStartHandle:{nodeId:A,type:_,id:W}});return}let _1=m6(b.target),s=J||I,{connection:o,isValid:p}=D4.isValid(b.nativeEvent,{handle:{nodeId:A,id:W,type:_},connectionMode:m,fromNodeId:j.nodeId,fromHandleId:j.id||null,fromType:j.type,isValidConnection:s,flowId:D,doc:_1,lib:V,nodeLookup:y});if(p&&o)i(o);let e=structuredClone(t);delete e.inProgress,e.toPosition=e.toHandle?e.toHandle.position:null,E?.(b,e),R.setState({connectionClickStartHandle:null})};return r.jsx("div",{"data-handleid":W,"data-nodeid":A,"data-handlepos":Q,"data-id":`${M}-${A}-${W}-${_}`,className:g1(["react-flow__handle",`react-flow__handle-${Q}`,"nodrag",B,Y,{source:!w,target:w,connectable:q,connectablestart:U,connectableend:G,clickconnecting:f,connectingfrom:P,connectingto:C,valid:u,connectionindicator:q&&(!N||v)&&(N||k?G:U)}]),onMouseDown:l,onTouchStart:l,onClick:O?S:void 0,ref:z,...L,children:X})}var m4=d.memo(s9(dU));function aU({data:_,isConnectable:Q,sourcePosition:J=F1.Bottom}){return r.jsxs(r.Fragment,{children:[_?.label,r.jsx(m4,{type:"source",position:J,isConnectable:Q})]})}function sU({data:_,isConnectable:Q,targetPosition:J=F1.Top,sourcePosition:q=F1.Bottom}){return r.jsxs(r.Fragment,{children:[r.jsx(m4,{type:"target",position:J,isConnectable:Q}),_?.label,r.jsx(m4,{type:"source",position:q,isConnectable:Q})]})}function tU(){return null}function oU({data:_,isConnectable:Q,targetPosition:J=F1.Top}){return r.jsxs(r.Fragment,{children:[r.jsx(m4,{type:"target",position:J,isConnectable:Q}),_?.label]})}var g4={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},S9={input:aU,default:sU,output:oU,group:tU};function nU(_){if(_.internals.handleBounds===void 0)return{width:_.width??_.initialWidth??_.style?.width,height:_.height??_.initialHeight??_.style?.height};return{width:_.width??_.style?.width,height:_.height??_.style?.height}}var eU=(_)=>{let{width:Q,height:J,x:q,y:U}=V2(_.nodeLookup,{filter:(G)=>!!G.selected});return{width:R0(Q)?Q:null,height:R0(J)?J:null,userSelectionActive:_.userSelectionActive,transformString:`translate(${_.transform[0]}px,${_.transform[1]}px) scale(${_.transform[2]}) translate(${q}px,${U}px)`}};function _G({onSelectionContextMenu:_,noPanClassName:Q,disableKeyboardA11y:J}){let q=E1(),{width:U,height:G,transformString:Z,userSelectionActive:F}=C1(eU,b1),X=e9(),Y=d.useRef(null);d.useEffect(()=>{if(!J)Y.current?.focus({preventScroll:!0})},[J]);let K=!F&&U!==null&&G!==null;if(n9({nodeRef:Y,disabled:!K}),!K)return null;let H=_?(z)=>{let W=q.getState().nodes.filter((w)=>w.selected);_(z,W)}:void 0,L=(z)=>{if(Object.prototype.hasOwnProperty.call(g4,z.key))z.preventDefault(),X({direction:g4[z.key],factor:z.shiftKey?4:1})};return r.jsx("div",{className:g1(["react-flow__nodesselection","react-flow__container",Q]),style:{transform:Z},children:r.jsx("div",{ref:Y,className:"react-flow__nodesselection-rect",onContextMenu:H,tabIndex:J?void 0:-1,onKeyDown:J?void 0:L,style:{width:U,height:G}})})}var v9=typeof window<"u"?window:void 0,QG=(_)=>{return{nodesSelectionActive:_.nodesSelectionActive,userSelectionActive:_.userSelectionActive}};function Q_({children:_,onPaneClick:Q,onPaneMouseEnter:J,onPaneMouseMove:q,onPaneMouseLeave:U,onPaneContextMenu:G,onPaneScroll:Z,paneClickDistance:F,deleteKeyCode:X,selectionKeyCode:Y,selectionOnDrag:K,selectionMode:H,onSelectionStart:L,onSelectionEnd:z,multiSelectionKeyCode:W,panActivationKeyCode:w,zoomActivationKeyCode:R,elementsSelectable:A,zoomOnScroll:O,zoomOnPinch:B,panOnScroll:M,panOnScrollSpeed:P,panOnScrollMode:C,zoomOnDoubleClick:f,panOnDrag:v,autoPanOnSelection:N,defaultViewport:k,translateExtent:u,minZoom:i,maxZoom:l,preventScrolling:S,onSelectionContextMenu:b,noWheelClassName:h,noPanClassName:E,disableKeyboardA11y:j,onViewportChange:m,isControlledViewport:I}){let{nodesSelectionActive:V,userSelectionActive:D}=C1(QG,b1),y=l5(Y,{target:v9}),t=l5(w,{target:v9}),_1=t||v,s=t||M,o=K&&_1!==!0,p=y||D||o;return jU({deleteKeyCode:X,multiSelectionKeyCode:W}),r.jsx(hU,{onPaneContextMenu:G,elementsSelectable:A,zoomOnScroll:O,zoomOnPinch:B,panOnScroll:s,panActivationKeyPressed:t,panOnScrollSpeed:P,panOnScrollMode:C,zoomOnDoubleClick:f,panOnDrag:!y&&_1,defaultViewport:k,translateExtent:u,minZoom:i,maxZoom:l,zoomActivationKeyCode:R,preventScrolling:S,noWheelClassName:h,noPanClassName:E,onViewportChange:m,isControlledViewport:I,paneClickDistance:F,selectionOnDrag:o,children:r.jsxs(xU,{onSelectionStart:L,onSelectionEnd:z,onPaneClick:Q,onPaneMouseEnter:J,onPaneMouseMove:q,onPaneMouseLeave:U,onPaneContextMenu:G,onPaneScroll:Z,panOnDrag:_1,autoPanOnSelection:N,isSelecting:!!p,selectionMode:H,selectionKeyPressed:y,paneClickDistance:F,selectionOnDrag:o,children:[_,V&&r.jsx(_G,{onSelectionContextMenu:b,noPanClassName:E,disableKeyboardA11y:j})]})})}Q_.displayName="FlowRenderer";var JG=d.memo(Q_),$G=(_)=>(Q)=>{return _?N4(Q.nodeLookup,{x:0,y:0,width:Q.width,height:Q.height},Q.transform,!0).map((J)=>J.id):Array.from(Q.nodeLookup.keys())};function qG(_){return C1(d.useCallback($G(_),[_]),b1)}var UG=(_)=>_.updateNodeInternals;function GG(){let _=C1(UG),[Q]=d.useState(()=>{if(typeof ResizeObserver>"u")return null;return new ResizeObserver((J)=>{let q=new Map;J.forEach((U)=>{let G=U.target.getAttribute("data-id");q.set(G,{id:G,nodeElement:U.target,force:!0})}),_(q)})});return d.useEffect(()=>{return()=>{Q?.disconnect()}},[Q]),Q}function ZG({node:_,nodeType:Q,hasDimensions:J,resizeObserver:q}){let U=E1(),G=d.useRef(null),Z=d.useRef(null),F=d.useRef(_.sourcePosition),X=d.useRef(_.targetPosition),Y=d.useRef(Q),K=J&&!!_.internals.handleBounds;return d.useEffect(()=>{if(G.current&&!_.hidden&&(!K||Z.current!==G.current)){if(Z.current)q?.unobserve(Z.current);q?.observe(G.current),Z.current=G.current}},[K,_.hidden]),d.useEffect(()=>{return()=>{if(Z.current)q?.unobserve(Z.current),Z.current=null}},[]),d.useEffect(()=>{if(G.current){let H=Y.current!==Q,L=F.current!==_.sourcePosition,z=X.current!==_.targetPosition;if(H||L||z)Y.current=Q,F.current=_.sourcePosition,X.current=_.targetPosition,U.getState().updateNodeInternals(new Map([[_.id,{id:_.id,nodeElement:G.current,force:!0}]]))}},[_.id,Q,_.sourcePosition,_.targetPosition]),G}function FG({id:_,onClick:Q,onMouseEnter:J,onMouseMove:q,onMouseLeave:U,onContextMenu:G,onDoubleClick:Z,nodesDraggable:F,elementsSelectable:X,nodesConnectable:Y,nodesFocusable:K,resizeObserver:H,noDragClassName:L,noPanClassName:z,disableKeyboardA11y:W,rfId:w,nodeTypes:R,nodeClickDistance:A,onError:O}){let{node:B,internals:M,isParent:P}=C1((p)=>{let e=p.nodeLookup.get(_),q1=p.parentLookup.has(_);return{node:e,internals:e.internals,isParent:q1}},b1),C=B.type||"default",f=R?.[C]||S9[C];if(f===void 0)O?.("003",X0.error003(C)),C="default",f=R?.default||S9.default;let v=!!(B.draggable||F&&typeof B.draggable>"u"),N=!!(B.selectable||X&&typeof B.selectable>"u"),k=!!(B.connectable||Y&&typeof B.connectable>"u"),u=!!(B.focusable||K&&typeof B.focusable>"u"),i=E1(),l=D6(B),S=ZG({node:B,nodeType:C,hasDimensions:l,resizeObserver:H}),b=n9({nodeRef:S,disabled:B.hidden||!v,noDragClassName:L,handleSelector:B.dragHandle,nodeId:_,isSelectable:N,nodeClickDistance:A}),h=e9();if(B.hidden)return null;let E=I0(B),j=nU(B),m=N||v||Q||J||q||U,I=J?(p)=>J(p,{...M.userNode}):void 0,V=q?(p)=>q(p,{...M.userNode}):void 0,D=U?(p)=>U(p,{...M.userNode}):void 0,y=G?(p)=>G(p,{...M.userNode}):void 0,t=Z?(p)=>Z(p,{...M.userNode}):void 0,_1=(p)=>{let{selectNodesOnDrag:e,nodeDragThreshold:q1}=i.getState();if(N&&(!e||!v||q1>0))e6({id:_,store:i,nodeRef:S});if(Q)Q(p,{...M.userNode})},s=(p)=>{if(g6(p.nativeEvent)||W)return;if(f6.includes(p.key)&&N){let e=p.key==="Escape";e6({id:_,store:i,unselect:e,nodeRef:S})}else if(v&&B.selected&&Object.prototype.hasOwnProperty.call(g4,p.key)){p.preventDefault();let{ariaLabelConfig:e}=i.getState();i.setState({ariaLiveMessage:e["node.a11yDescription.ariaLiveMessage"]({direction:p.key.replace("Arrow","").toLowerCase(),x:~~M.positionAbsolute.x,y:~~M.positionAbsolute.y})}),h({direction:g4[p.key],factor:p.shiftKey?4:1})}},o=()=>{if(W||!S.current?.matches(":focus-visible"))return;let{transform:p,width:e,height:q1,autoPanOnNodeFocus:G1,setCenter:U1}=i.getState();if(!G1)return;if(!(N4(new Map([[_,B]]),{x:0,y:0,width:e,height:q1},p,!0).length>0))U1(B.position.x+E.width/2,B.position.y+E.height/2,{zoom:p[2]})};return r.jsx("div",{className:g1(["react-flow__node",`react-flow__node-${C}`,{[z]:v},B.className,{selected:B.selected,selectable:N,parent:P,draggable:v,dragging:b}]),ref:S,style:{zIndex:M.z,transform:`translate(${M.positionAbsolute.x}px,${M.positionAbsolute.y}px)`,pointerEvents:m?"all":"none",visibility:l?"visible":"hidden",...B.style,...j},"data-id":_,"data-testid":`rf__node-${_}`,onMouseEnter:I,onMouseMove:V,onMouseLeave:D,onContextMenu:y,onClick:_1,onDoubleClick:t,onKeyDown:u?s:void 0,tabIndex:u?0:void 0,onFocus:u?o:void 0,role:B.ariaRole??(u?"group":void 0),"aria-roledescription":"node","aria-describedby":W?void 0:`${l9}-${w}`,"aria-label":B.ariaLabel,...B.domAttributes,children:r.jsx(gU,{value:_,children:r.jsx(f,{id:_,data:B.data,type:C,positionAbsoluteX:M.positionAbsolute.x,positionAbsoluteY:M.positionAbsolute.y,selected:B.selected??!1,selectable:N,draggable:v,deletable:B.deletable??!0,isConnectable:k,sourcePosition:B.sourcePosition,targetPosition:B.targetPosition,dragging:b,dragHandle:B.dragHandle,zIndex:M.z,parentId:B.parentId,...E})})})}var HG=d.memo(FG),XG=(_)=>({nodesConnectable:_.nodesConnectable,nodesFocusable:_.nodesFocusable,elementsSelectable:_.elementsSelectable,onError:_.onError});function J_(_){let{nodesConnectable:Q,nodesFocusable:J,elementsSelectable:q,onError:U}=C1(XG,b1),G=qG(_.onlyRenderVisibleElements),Z=GG();return r.jsx("div",{className:"react-flow__nodes",style:c4,children:G.map((F)=>{return r.jsx(HG,{id:F,nodeTypes:_.nodeTypes,nodeExtent:_.nodeExtent,onClick:_.onNodeClick,onMouseEnter:_.onNodeMouseEnter,onMouseMove:_.onNodeMouseMove,onMouseLeave:_.onNodeMouseLeave,onContextMenu:_.onNodeContextMenu,onDoubleClick:_.onNodeDoubleClick,noDragClassName:_.noDragClassName,noPanClassName:_.noPanClassName,rfId:_.rfId,disableKeyboardA11y:_.disableKeyboardA11y,resizeObserver:Z,nodesDraggable:_.nodesDraggable??!0,nodesConnectable:Q,nodesFocusable:J,elementsSelectable:q,nodeClickDistance:_.nodeClickDistance,onError:U},F)})})}J_.displayName="NodeRenderer";var KG=d.memo(J_);function YG(_){return C1(d.useCallback((J)=>{if(!_)return J.edges.map((U)=>U.id);let q=[];if(J.width&&J.height)for(let U of J.edges){let G=J.nodeLookup.get(U.source),Z=J.nodeLookup.get(U.target);if(G&&Z&&u7({sourceNode:G,targetNode:Z,width:J.width,height:J.height,transform:J.transform}))q.push(U.id)}return q},[_]),b1)}var LG=({color:_="none",strokeWidth:Q=1})=>{let J={strokeWidth:Q,..._&&{stroke:_}};return r.jsx("polyline",{className:"arrow",style:J,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},zG=({color:_="none",strokeWidth:Q=1})=>{let J={strokeWidth:Q,..._&&{stroke:_,fill:_}};return r.jsx("polyline",{className:"arrowclosed",style:J,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},k9={[_5.Arrow]:LG,[_5.ArrowClosed]:zG};function WG(_){let Q=E1();return d.useMemo(()=>{if(!Object.prototype.hasOwnProperty.call(k9,_))return Q.getState().onError?.("009",X0.error009(_)),null;return k9[_]},[_])}var BG=({id:_,type:Q,color:J,width:q=12.5,height:U=12.5,markerUnits:G="strokeWidth",strokeWidth:Z,orient:F="auto-start-reverse"})=>{let X=WG(Q);if(!X)return null;return r.jsx("marker",{className:"react-flow__arrowhead",id:_,markerWidth:`${q}`,markerHeight:`${U}`,viewBox:"-10 -10 20 20",markerUnits:G,orient:F,refX:"0",refY:"0",children:r.jsx(X,{color:J,strokeWidth:Z})})},$_=({defaultColor:_,rfId:Q})=>{let J=C1((G)=>G.edges),q=C1((G)=>G.defaultEdgeOptions),U=d.useMemo(()=>{return b7(J,{id:Q,defaultColor:_,defaultMarkerStart:q?.markerStart,defaultMarkerEnd:q?.markerEnd})},[J,q,Q,_]);if(!U.length)return null;return r.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:r.jsx("defs",{children:U.map((G)=>r.jsx(BG,{id:G.id,type:G.type,color:G.color,width:G.width,height:G.height,markerUnits:G.markerUnits,strokeWidth:G.strokeWidth,orient:G.orient},G.id))})})};$_.displayName="MarkerDefinitions";var AG=d.memo($_);function q_({x:_,y:Q,label:J,labelStyle:q,labelShowBg:U=!0,labelBgStyle:G,labelBgPadding:Z=[2,4],labelBgBorderRadius:F=2,children:X,className:Y,...K}){let[H,L]=d.useState({x:1,y:0,width:0,height:0}),z=g1(["react-flow__edge-textwrapper",Y]),W=d.useRef(null);if(d.useEffect(()=>{if(W.current){let w=W.current.getBBox();L({x:w.x,y:w.y,width:w.width,height:w.height})}},[J]),!J)return null;return r.jsxs("g",{transform:`translate(${_-H.width/2} ${Q-H.height/2})`,className:z,visibility:H.width?"visible":"hidden",...K,children:[U&&r.jsx("rect",{width:H.width+2*Z[0],x:-Z[0],y:-Z[1],height:H.height+2*Z[1],className:"react-flow__edge-textbg",style:G,rx:F,ry:F}),r.jsx("text",{className:"react-flow__edge-text",y:H.height/2,dy:"0.3em",ref:W,style:q,children:J}),X]})}q_.displayName="EdgeText";var MG=d.memo(q_);function l4({path:_,labelX:Q,labelY:J,label:q,labelStyle:U,labelShowBg:G,labelBgStyle:Z,labelBgPadding:F,labelBgBorderRadius:X,interactionWidth:Y=20,...K}){return r.jsxs(r.Fragment,{children:[r.jsx("path",{...K,d:_,fill:"none",className:g1(["react-flow__edge-path",K.className])}),Y?r.jsx("path",{d:_,fill:"none",strokeOpacity:0,strokeWidth:Y,className:"react-flow__edge-interaction"}):null,q&&R0(Q)&&R0(J)?r.jsx(MG,{x:Q,y:J,label:q,labelStyle:U,labelShowBg:G,labelBgStyle:Z,labelBgPadding:F,labelBgBorderRadius:X}):null]})}function y9({pos:_,x1:Q,y1:J,x2:q,y2:U}){if(_===F1.Left||_===F1.Right)return[0.5*(Q+q),J];return[Q,0.5*(J+U)]}function U_({sourceX:_,sourceY:Q,sourcePosition:J=F1.Bottom,targetX:q,targetY:U,targetPosition:G=F1.Top}){let[Z,F]=y9({pos:J,x1:_,y1:Q,x2:q,y2:U}),[X,Y]=y9({pos:G,x1:q,y1:U,x2:_,y2:Q}),[K,H,L,z]=k4({sourceX:_,sourceY:Q,targetX:q,targetY:U,sourceControlX:Z,sourceControlY:F,targetControlX:X,targetControlY:Y});return[`M${_},${Q} C${Z},${F} ${X},${Y} ${q},${U}`,K,H,L,z]}function G_(_){return d.memo(({id:Q,sourceX:J,sourceY:q,targetX:U,targetY:G,sourcePosition:Z,targetPosition:F,label:X,labelStyle:Y,labelShowBg:K,labelBgStyle:H,labelBgPadding:L,labelBgBorderRadius:z,style:W,markerEnd:w,markerStart:R,interactionWidth:A})=>{let[O,B,M]=U_({sourceX:J,sourceY:q,sourcePosition:Z,targetX:U,targetY:G,targetPosition:F}),P=_.isInternal?void 0:Q;return r.jsx(l4,{id:P,path:O,labelX:B,labelY:M,label:X,labelStyle:Y,labelShowBg:K,labelBgStyle:H,labelBgPadding:L,labelBgBorderRadius:z,style:W,markerEnd:w,markerStart:R,interactionWidth:A})})}var TG=G_({isInternal:!1}),Z_=G_({isInternal:!0});TG.displayName="SimpleBezierEdge";Z_.displayName="SimpleBezierEdgeInternal";function F_(_){return d.memo(({id:Q,sourceX:J,sourceY:q,targetX:U,targetY:G,label:Z,labelStyle:F,labelShowBg:X,labelBgStyle:Y,labelBgPadding:K,labelBgBorderRadius:H,style:L,sourcePosition:z=F1.Bottom,targetPosition:W=F1.Top,markerEnd:w,markerStart:R,pathOptions:A,interactionWidth:O})=>{let[B,M,P]=c5({sourceX:J,sourceY:q,sourcePosition:z,targetX:U,targetY:G,targetPosition:W,borderRadius:A?.borderRadius,offset:A?.offset,stepPosition:A?.stepPosition}),C=_.isInternal?void 0:Q;return r.jsx(l4,{id:C,path:B,labelX:M,labelY:P,label:Z,labelStyle:F,labelShowBg:X,labelBgStyle:Y,labelBgPadding:K,labelBgBorderRadius:H,style:L,markerEnd:w,markerStart:R,interactionWidth:O})})}var H_=F_({isInternal:!1}),X_=F_({isInternal:!0});H_.displayName="SmoothStepEdge";X_.displayName="SmoothStepEdgeInternal";function K_(_){return d.memo(({id:Q,...J})=>{let q=_.isInternal?void 0:Q;return r.jsx(H_,{...J,id:q,pathOptions:d.useMemo(()=>({borderRadius:0,offset:J.pathOptions?.offset}),[J.pathOptions?.offset])})})}var RG=K_({isInternal:!1}),Y_=K_({isInternal:!0});RG.displayName="StepEdge";Y_.displayName="StepEdgeInternal";function L_(_){return d.memo(({id:Q,sourceX:J,sourceY:q,targetX:U,targetY:G,label:Z,labelStyle:F,labelShowBg:X,labelBgStyle:Y,labelBgPadding:K,labelBgBorderRadius:H,style:L,markerEnd:z,markerStart:W,interactionWidth:w})=>{let[R,A,O]=j4({sourceX:J,sourceY:q,targetX:U,targetY:G}),B=_.isInternal?void 0:Q;return r.jsx(l4,{id:B,path:R,labelX:A,labelY:O,label:Z,labelStyle:F,labelShowBg:X,labelBgStyle:Y,labelBgPadding:K,labelBgBorderRadius:H,style:L,markerEnd:z,markerStart:W,interactionWidth:w})})}var OG=L_({isInternal:!1}),z_=L_({isInternal:!0});OG.displayName="StraightEdge";z_.displayName="StraightEdgeInternal";function W_(_){return d.memo(({id:Q,sourceX:J,sourceY:q,targetX:U,targetY:G,sourcePosition:Z=F1.Bottom,targetPosition:F=F1.Top,label:X,labelStyle:Y,labelShowBg:K,labelBgStyle:H,labelBgPadding:L,labelBgBorderRadius:z,style:W,markerEnd:w,markerStart:R,pathOptions:A,interactionWidth:O})=>{let[B,M,P]=y4({sourceX:J,sourceY:q,sourcePosition:Z,targetX:U,targetY:G,targetPosition:F,curvature:A?.curvature}),C=_.isInternal?void 0:Q;return r.jsx(l4,{id:C,path:B,labelX:M,labelY:P,label:X,labelStyle:Y,labelShowBg:K,labelBgStyle:H,labelBgPadding:L,labelBgBorderRadius:z,style:W,markerEnd:w,markerStart:R,interactionWidth:O})})}var IG=W_({isInternal:!1}),B_=W_({isInternal:!0});IG.displayName="BezierEdge";B_.displayName="BezierEdgeInternal";var j9={default:B_,straight:z_,step:Y_,smoothstep:X_,simplebezier:Z_},V9={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},wG=(_,Q,J)=>{if(J===F1.Left)return _-Q;if(J===F1.Right)return _+Q;return _},PG=(_,Q,J)=>{if(J===F1.Top)return _-Q;if(J===F1.Bottom)return _+Q;return _},u9="react-flow__edgeupdater";function h9({position:_,centerX:Q,centerY:J,radius:q=10,onMouseDown:U,onMouseEnter:G,onMouseOut:Z,type:F}){return r.jsx("circle",{onMouseDown:U,onMouseEnter:G,onMouseOut:Z,className:g1([u9,`${u9}-${F}`]),cx:wG(Q,q,_),cy:PG(J,q,_),r:q,stroke:"transparent",fill:"transparent"})}function NG({isReconnectable:_,reconnectRadius:Q,edge:J,sourceX:q,sourceY:U,targetX:G,targetY:Z,sourcePosition:F,targetPosition:X,onReconnect:Y,onReconnectStart:K,onReconnectEnd:H,setReconnecting:L,setUpdateHover:z}){let W=E1(),w=(M,P)=>{if(M.button!==0)return;let{autoPanOnConnect:C,domNode:f,connectionMode:v,connectionRadius:N,lib:k,onConnectStart:u,cancelConnection:i,nodeLookup:l,rfId:S,panBy:b,updateConnection:h}=W.getState(),E=P.type==="target",j=(V,D)=>{L(!1),H?.(V,J,P.type,D)},m=(V)=>Y?.(J,V),I=(V,D)=>{L(!0),K?.(M,J,P.type),u?.(V,D)};D4.onPointerDown(M.nativeEvent,{autoPanOnConnect:C,connectionMode:v,connectionRadius:N,domNode:f,handleId:P.id,nodeId:P.nodeId,nodeLookup:l,isTarget:E,edgeUpdaterType:P.type,lib:k,flowId:S,cancelConnection:i,panBy:b,isValidConnection:(...V)=>W.getState().isValidConnection?.(...V)??!0,onConnect:m,onConnectStart:I,onConnectEnd:(...V)=>W.getState().onConnectEnd?.(...V),onReconnectEnd:j,updateConnection:h,getTransform:()=>W.getState().transform,getFromHandle:()=>W.getState().connection.fromHandle,dragThreshold:W.getState().connectionDragThreshold,handleDomNode:M.currentTarget})},R=(M)=>w(M,{nodeId:J.target,id:J.targetHandle??null,type:"target"}),A=(M)=>w(M,{nodeId:J.source,id:J.sourceHandle??null,type:"source"}),O=()=>z(!0),B=()=>z(!1);return r.jsxs(r.Fragment,{children:[(_===!0||_==="source")&&r.jsx(h9,{position:F,centerX:q,centerY:U,radius:Q,onMouseDown:R,onMouseEnter:O,onMouseOut:B,type:"source"}),(_===!0||_==="target")&&r.jsx(h9,{position:X,centerX:G,centerY:Z,radius:Q,onMouseDown:A,onMouseEnter:O,onMouseOut:B,type:"target"})]})}function fG({id:_,edgesFocusable:Q,edgesReconnectable:J,elementsSelectable:q,onClick:U,onDoubleClick:G,onContextMenu:Z,onMouseEnter:F,onMouseMove:X,onMouseLeave:Y,reconnectRadius:K,onReconnect:H,onReconnectStart:L,onReconnectEnd:z,rfId:W,edgeTypes:w,noPanClassName:R,onError:A,disableKeyboardA11y:O}){let B=C1((U1)=>U1.edgeLookup.get(_)),M=C1((U1)=>U1.defaultEdgeOptions);B=M?{...M,...B}:B;let P=B.type||"default",C=w?.[P]||j9[P];if(C===void 0)A?.("011",X0.error011(P)),P="default",C=w?.default||j9.default;let f=!!(B.focusable||Q&&typeof B.focusable>"u"),v=typeof H<"u"&&(B.reconnectable||J&&typeof B.reconnectable>"u"),N=!!(B.selectable||q&&typeof B.selectable>"u"),k=d.useRef(null),[u,i]=d.useState(!1),[l,S]=d.useState(!1),b=E1(),{zIndex:h=B.zIndex,sourceX:E,sourceY:j,targetX:m,targetY:I,sourcePosition:V,targetPosition:D}=C1(d.useCallback((U1)=>{let K1=U1.nodeLookup.get(B.source),W1=U1.nodeLookup.get(B.target);if(!K1||!W1)return V9;let Y1=D7({id:_,sourceNode:K1,targetNode:W1,sourceHandle:B.sourceHandle||null,targetHandle:B.targetHandle||null,connectionMode:U1.connectionMode,onError:A}),n=V7({selected:B.selected,zIndex:B.zIndex,sourceNode:K1,targetNode:W1,elevateOnSelect:U1.elevateEdgesOnSelect,zIndexMode:U1.zIndexMode});return{...Y1||V9,zIndex:n}},[B.source,B.target,B.sourceHandle,B.targetHandle,B.selected,B.zIndex,A]),b1),y=d.useMemo(()=>B.markerStart?`url('#${V4(B.markerStart,W)}')`:void 0,[B.markerStart,W]),t=d.useMemo(()=>B.markerEnd?`url('#${V4(B.markerEnd,W)}')`:void 0,[B.markerEnd,W]);if(B.hidden||E===null||j===null||m===null||I===null)return null;let _1=(U1)=>{let{addSelectedEdges:K1,unselectNodesAndEdges:W1,multiSelectionActive:Y1}=b.getState();if(N)if(b.setState({nodesSelectionActive:!1}),B.selected&&Y1)W1({nodes:[],edges:[B]}),k.current?.blur();else K1([_]);if(U)U(U1,B)},s=G?(U1)=>{G(U1,{...B})}:void 0,o=Z?(U1)=>{Z(U1,{...B})}:void 0,p=F?(U1)=>{F(U1,{...B})}:void 0,e=X?(U1)=>{X(U1,{...B})}:void 0,q1=Y?(U1)=>{Y(U1,{...B})}:void 0,G1=(U1)=>{if(!O&&f6.includes(U1.key)&&N){let{unselectNodesAndEdges:K1,addSelectedEdges:W1}=b.getState();if(U1.key==="Escape")k.current?.blur(),K1({edges:[B]});else W1([_])}};return r.jsx("svg",{style:{zIndex:h},children:r.jsxs("g",{className:g1(["react-flow__edge",`react-flow__edge-${P}`,B.className,R,{selected:B.selected,animated:B.animated,inactive:!N&&!U,updating:u,selectable:N}]),onClick:_1,onDoubleClick:s,onContextMenu:o,onMouseEnter:p,onMouseMove:e,onMouseLeave:q1,onKeyDown:f?G1:void 0,tabIndex:f?0:void 0,role:B.ariaRole??(f?"group":"img"),"aria-roledescription":"edge","data-id":_,"data-testid":`rf__edge-${_}`,"aria-label":B.ariaLabel===null?void 0:B.ariaLabel||`Edge from ${B.source} to ${B.target}`,"aria-describedby":f?`${i9}-${W}`:void 0,ref:k,...B.domAttributes,children:[!l&&r.jsx(C,{id:_,source:B.source,target:B.target,type:B.type,selected:B.selected,animated:B.animated,selectable:N,deletable:B.deletable??!0,label:B.label,labelStyle:B.labelStyle,labelShowBg:B.labelShowBg,labelBgStyle:B.labelBgStyle,labelBgPadding:B.labelBgPadding,labelBgBorderRadius:B.labelBgBorderRadius,sourceX:E,sourceY:j,targetX:m,targetY:I,sourcePosition:V,targetPosition:D,data:B.data,style:B.style,sourceHandleId:B.sourceHandle,targetHandleId:B.targetHandle,markerStart:y,markerEnd:t,pathOptions:"pathOptions"in B?B.pathOptions:void 0,interactionWidth:B.interactionWidth}),v&&r.jsx(NG,{edge:B,isReconnectable:v,reconnectRadius:K,onReconnect:H,onReconnectStart:L,onReconnectEnd:z,sourceX:E,sourceY:j,targetX:m,targetY:I,sourcePosition:V,targetPosition:D,setUpdateHover:i,setReconnecting:S})]})})}var CG=d.memo(fG),SG=(_)=>({edgesFocusable:_.edgesFocusable,edgesReconnectable:_.edgesReconnectable,elementsSelectable:_.elementsSelectable,connectionMode:_.connectionMode,onError:_.onError});function A_({defaultMarkerColor:_,onlyRenderVisibleElements:Q,rfId:J,edgeTypes:q,noPanClassName:U,onReconnect:G,onEdgeContextMenu:Z,onEdgeMouseEnter:F,onEdgeMouseMove:X,onEdgeMouseLeave:Y,onEdgeClick:K,reconnectRadius:H,onEdgeDoubleClick:L,onReconnectStart:z,onReconnectEnd:W,disableKeyboardA11y:w}){let{edgesFocusable:R,edgesReconnectable:A,elementsSelectable:O,onError:B}=C1(SG,b1),M=YG(Q);return r.jsxs("div",{className:"react-flow__edges",children:[r.jsx(AG,{defaultColor:_,rfId:J}),M.map((P)=>{return r.jsx(CG,{id:P,edgesFocusable:R,edgesReconnectable:A,elementsSelectable:O,noPanClassName:U,onReconnect:G,onContextMenu:Z,onMouseEnter:F,onMouseMove:X,onMouseLeave:Y,onClick:K,reconnectRadius:H,onDoubleClick:L,onReconnectStart:z,onReconnectEnd:W,rfId:J,onError:B,edgeTypes:q,disableKeyboardA11y:w},P)})]})}A_.displayName="EdgeRenderer";var vG=d.memo(A_),D9=(_)=>`translate(${_[0]}px,${_[1]}px) scale(${_[2]})`;function kG({children:_}){let Q=E1(),J=d.useRef(null),[q]=d.useState(()=>Q.getState().transform);return t9(()=>{let U=null,G=()=>{let Z=Q.getState().transform;if(U&&Z[0]===U[0]&&Z[1]===U[1]&&Z[2]===U[2])return;if(U=Z,J.current)J.current.style.transform=D9(Z)};return G(),Q.subscribe(G)},[Q]),r.jsx("div",{ref:J,className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:D9(q)},children:_})}function yG(_){let Q=i5(),J=d.useRef(!1);d.useEffect(()=>{if(!J.current&&Q.viewportInitialized&&_)setTimeout(()=>_(Q),1),J.current=!0},[_,Q.viewportInitialized])}var jG=(_)=>_.panZoom?.syncViewport;function VG(_){let Q=C1(jG),J=E1();return d.useEffect(()=>{if(_)Q?.(_),J.setState({transform:[_.x,_.y,_.zoom]})},[_,Q]),null}function b9(_){return _.connection.inProgress?{..._.connection,to:U5(_.connection.to,_.transform)}:{..._.connection}}function uG(_){if(_)return(J)=>{let q=b9(J);return _(q)};return b9}function hG(_){let Q=uG(_);return C1(Q,b1)}var DG=(_)=>({nodesConnectable:_.nodesConnectable,isValid:_.connection.isValid,inProgress:_.connection.inProgress,width:_.width,height:_.height});function bG({containerStyle:_,style:Q,type:J,component:q}){let{nodesConnectable:U,width:G,height:Z,isValid:F,inProgress:X}=C1(DG,b1);if(!(G&&U&&X))return null;return r.jsx("svg",{style:_,width:G,height:Z,className:"react-flow__connectionline react-flow__container",children:r.jsx("g",{className:g1(["react-flow__connection",x6(F)]),children:r.jsx(M_,{style:Q,type:J,CustomComponent:q,isValid:F})})})}var M_=({style:_,type:Q=b0.Bezier,CustomComponent:J,isValid:q})=>{let{inProgress:U,from:G,fromNode:Z,fromHandle:F,fromPosition:X,to:Y,toNode:K,toHandle:H,toPosition:L,pointer:z}=hG();if(!U)return;if(J)return r.jsx(J,{connectionLineType:Q,connectionLineStyle:_,fromNode:Z,fromHandle:F,fromX:G.x,fromY:G.y,toX:Y.x,toY:Y.y,fromPosition:X,toPosition:L,connectionStatus:x6(q),toNode:K,toHandle:H,pointer:z});let W="",w={sourceX:G.x,sourceY:G.y,sourcePosition:X,targetX:Y.x,targetY:Y.y,targetPosition:L};switch(Q){case b0.Bezier:[W]=y4(w);break;case b0.SimpleBezier:[W]=U_(w);break;case b0.Step:[W]=c5({...w,borderRadius:0});break;case b0.SmoothStep:[W]=c5(w);break;default:[W]=j4(w)}return r.jsx("path",{d:W,fill:"none",className:"react-flow__connection-path",style:_})};M_.displayName="ConnectionLine";var EG={};function E9(_=EG){let Q=d.useRef(_),J=E1();d.useEffect(()=>{{let q=new Set([...Object.keys(Q.current),...Object.keys(_)]);for(let U of q)if(Q.current[U]!==_[U]){J.getState().onError?.("002",X0.error002());break}Q.current=_}},[_])}function xG(){let _=E1(),Q=d.useRef(!1);d.useEffect(()=>{if(!Q.current){let J=document.querySelector(".react-flow__pane");if(J&&window.getComputedStyle(J).zIndex!=="1")_.getState().onError?.("013",X0.error013("react"));Q.current=!0}},[])}function T_({nodeTypes:_,edgeTypes:Q,onInit:J,onNodeClick:q,onEdgeClick:U,onNodeDoubleClick:G,onEdgeDoubleClick:Z,onNodeMouseEnter:F,onNodeMouseMove:X,onNodeMouseLeave:Y,onNodeContextMenu:K,onSelectionContextMenu:H,onSelectionStart:L,onSelectionEnd:z,connectionLineType:W,connectionLineStyle:w,connectionLineComponent:R,connectionLineContainerStyle:A,selectionKeyCode:O,selectionOnDrag:B,selectionMode:M,multiSelectionKeyCode:P,panActivationKeyCode:C,zoomActivationKeyCode:f,deleteKeyCode:v,onlyRenderVisibleElements:N,elementsSelectable:k,defaultViewport:u,translateExtent:i,minZoom:l,maxZoom:S,preventScrolling:b,defaultMarkerColor:h,zoomOnScroll:E,zoomOnPinch:j,panOnScroll:m,panOnScrollSpeed:I,panOnScrollMode:V,zoomOnDoubleClick:D,panOnDrag:y,autoPanOnSelection:t,onPaneClick:_1,onPaneMouseEnter:s,onPaneMouseMove:o,onPaneMouseLeave:p,onPaneScroll:e,onPaneContextMenu:q1,paneClickDistance:G1,nodeClickDistance:U1,onEdgeContextMenu:K1,onEdgeMouseEnter:W1,onEdgeMouseMove:Y1,onEdgeMouseLeave:n,reconnectRadius:I1,onReconnect:H1,onReconnectStart:m1,onReconnectEnd:t1,noDragClassName:d1,noWheelClassName:N0,noPanClassName:z0,disableKeyboardA11y:T0,nodeExtent:$0,rfId:F0,viewport:_0,onViewportChange:W0,nodesDraggable:U2}){return E9(_),E9(Q),xG(),yG(J),VG(_0),r.jsx(JG,{onPaneClick:_1,onPaneMouseEnter:s,onPaneMouseMove:o,onPaneMouseLeave:p,onPaneContextMenu:q1,onPaneScroll:e,paneClickDistance:G1,deleteKeyCode:v,selectionKeyCode:O,selectionOnDrag:B,selectionMode:M,onSelectionStart:L,onSelectionEnd:z,multiSelectionKeyCode:P,panActivationKeyCode:C,zoomActivationKeyCode:f,elementsSelectable:k,zoomOnScroll:E,zoomOnPinch:j,zoomOnDoubleClick:D,panOnScroll:m,panOnScrollSpeed:I,panOnScrollMode:V,panOnDrag:y,autoPanOnSelection:t,defaultViewport:u,translateExtent:i,minZoom:l,maxZoom:S,onSelectionContextMenu:H,preventScrolling:b,noDragClassName:d1,noWheelClassName:N0,noPanClassName:z0,disableKeyboardA11y:T0,onViewportChange:W0,isControlledViewport:!!_0,children:r.jsxs(kG,{children:[r.jsx(vG,{edgeTypes:Q,onEdgeClick:U,onEdgeDoubleClick:Z,onReconnect:H1,onReconnectStart:m1,onReconnectEnd:t1,onlyRenderVisibleElements:N,onEdgeContextMenu:K1,onEdgeMouseEnter:W1,onEdgeMouseMove:Y1,onEdgeMouseLeave:n,reconnectRadius:I1,defaultMarkerColor:h,noPanClassName:z0,disableKeyboardA11y:T0,rfId:F0}),r.jsx(bG,{style:w,type:W,component:R,containerStyle:A}),r.jsx("div",{className:"react-flow__edgelabel-renderer"}),r.jsx(KG,{nodeTypes:_,onNodeClick:q,onNodeDoubleClick:G,onNodeMouseEnter:F,onNodeMouseMove:X,onNodeMouseLeave:Y,onNodeContextMenu:K,nodeClickDistance:U1,onlyRenderVisibleElements:N,noPanClassName:z0,noDragClassName:d1,disableKeyboardA11y:T0,nodeExtent:$0,rfId:F0,nodesDraggable:U2}),r.jsx("div",{className:"react-flow__viewport-portal"})]})})}T_.displayName="GraphView";var mG=d.memo(T_),gG=h6("React Flow","https://reactflow.dev/"),x9=({nodes:_,edges:Q,defaultNodes:J,defaultEdges:q,width:U,height:G,fitView:Z,fitViewOptions:F,minZoom:X=0.5,maxZoom:Y=2,nodeOrigin:K,nodeExtent:H,zIndexMode:L="basic"}={})=>{let z=new Map,W=new Map,w=new Map,R=new Map,A=q??Q??[],O=J??_??[],B=K??[0,0],M=H??J5;a6(w,R,A);let{nodesInitialized:P}=u4(O,z,W,{nodeOrigin:B,nodeExtent:M,zIndexMode:L}),C=[0,0,1];if(Z&&U&&G){let f=V2(z,{filter:(u)=>!!((u.width||u.initialWidth)&&(u.height||u.initialHeight))}),{x:v,y:N,zoom:k}=p5(f,U,G,X,Y,F?.padding??0.1);C=[v,N,k]}return{rfId:"1",width:U??0,height:G??0,transform:C,nodes:O,nodesInitialized:P,nodeLookup:z,parentLookup:W,edges:A,edgeLookup:R,connectionLookup:w,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:J!==void 0,hasDefaultEdges:q!==void 0,panZoom:null,minZoom:X,maxZoom:Y,translateExtent:J5,nodeExtent:M,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:L2.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:B,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:F,fitViewResolver:null,connection:{...S6},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:gG,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:C6,zIndexMode:L,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}},pG=({nodes:_,edges:Q,defaultNodes:J,defaultEdges:q,width:U,height:G,fitView:Z,fitViewOptions:F,minZoom:X,maxZoom:Y,nodeOrigin:K,nodeExtent:H,zIndexMode:L})=>K9((z,W)=>{async function w(){let{nodeLookup:R,panZoom:A,fitViewOptions:O,fitViewResolver:B,width:M,height:P,minZoom:C,maxZoom:f}=W();if(!A)return;await f7({nodes:R,width:M,height:P,panZoom:A,minZoom:C,maxZoom:f},O),B?.resolve(!0),z({fitViewResolver:null})}return{...x9({nodes:_,edges:Q,width:U,height:G,fitView:Z,fitViewOptions:F,minZoom:X,maxZoom:Y,nodeOrigin:K,nodeExtent:H,defaultNodes:J,defaultEdges:q,zIndexMode:L}),setNodes:(R)=>{let{nodeLookup:A,parentLookup:O,nodeOrigin:B,nodeExtent:M,elevateNodesOnSelect:P,fitViewQueued:C,zIndexMode:f,nodesSelectionActive:v}=W(),{nodesInitialized:N,hasSelectedNodes:k}=u4(R,A,O,{nodeOrigin:B,nodeExtent:M,elevateNodesOnSelect:P,checkEquality:!0,zIndexMode:f}),u=v&&k;if(C&&N)w(),z({nodes:R,nodesInitialized:N,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:u});else z({nodes:R,nodesInitialized:N,nodesSelectionActive:u})},setEdges:(R)=>{let{connectionLookup:A,edgeLookup:O}=W();a6(A,O,R),z({edges:R})},setDefaultNodesAndEdges:(R,A)=>{if(R){let{setNodes:O}=W();O(R),z({hasDefaultNodes:!0})}if(A){let{setEdges:O}=W();O(A),z({hasDefaultEdges:!0})}},updateNodeInternals:(R)=>{let{triggerNodeChanges:A,nodeLookup:O,parentLookup:B,domNode:M,nodeOrigin:P,nodeExtent:C,debug:f,fitViewQueued:v,zIndexMode:N}=W(),{changes:k,updatedInternals:u}=p7(R,O,B,M,P,C,N);if(!u)return;if(m7(O,B,{nodeOrigin:P,nodeExtent:C,zIndexMode:N}),v)w(),z({fitViewQueued:!1,fitViewOptions:void 0});else z({});if(k?.length>0){if(f)console.log("React Flow: trigger node changes",k);A?.(k)}},updateNodePositions:(R,A=!1)=>{let O=[],B=[],{nodeLookup:M,triggerNodeChanges:P,connection:C,updateConnection:f,onNodesChangeMiddlewareMap:v}=W();for(let[N,k]of R){let u=M.get(N),i=!!(u?.expandParent&&u?.parentId&&k?.position),l={id:N,type:"position",position:i?{x:Math.max(0,k.position.x),y:Math.max(0,k.position.y)}:k.position,dragging:A};if(u&&C.inProgress&&C.fromNode.id===u.id){let S=z2(u,C.fromHandle,F1.Left,!0);f({...C,from:S})}if(i&&u.parentId)O.push({id:N,parentId:u.parentId,rect:{...k.internals.positionAbsolute,width:k.measured.width??0,height:k.measured.height??0}});B.push(l)}if(O.length>0){let{parentLookup:N,nodeOrigin:k}=W(),u=h4(O,M,N,k);B.push(...u)}for(let N of v.values())B=N(B);P(B)},triggerNodeChanges:(R)=>{let{onNodesChange:A,setNodes:O,nodes:B,hasDefaultNodes:M,debug:P}=W();if(R?.length){if(M){let C=a9(R,B);O(C)}if(P)console.log("React Flow: trigger node changes",R);A?.(R)}},triggerEdgeChanges:(R)=>{let{onEdgesChange:A,setEdges:O,edges:B,hasDefaultEdges:M,debug:P}=W();if(R?.length){if(M){let C=wU(R,B);O(C)}if(P)console.log("React Flow: trigger edge changes",R);A?.(R)}},addSelectedNodes:(R)=>{let{multiSelectionActive:A,edgeLookup:O,nodeLookup:B,triggerNodeChanges:M,triggerEdgeChanges:P}=W();if(A){let C=R.map((f)=>u2(f,!0));M(C);return}M(Z5(B,new Set([...R]),!0)),P(Z5(O))},addSelectedEdges:(R)=>{let{multiSelectionActive:A,edgeLookup:O,nodeLookup:B,triggerNodeChanges:M,triggerEdgeChanges:P}=W();if(A){let C=R.map((f)=>u2(f,!0));P(C);return}P(Z5(O,new Set([...R]))),M(Z5(B,new Set,!0))},unselectNodesAndEdges:({nodes:R,edges:A}={})=>{let{edges:O,nodes:B,nodeLookup:M,triggerNodeChanges:P,triggerEdgeChanges:C}=W(),f=R?R:B,v=A?A:O,N=[];for(let u of f){if(!u.selected)continue;let i=M.get(u.id);if(i)i.selected=!1;N.push(u2(u.id,!1))}let k=[];for(let u of v){if(!u.selected)continue;k.push(u2(u.id,!1))}P(N),C(k)},setMinZoom:(R)=>{let{panZoom:A,maxZoom:O}=W();A?.setScaleExtent([R,O]),z({minZoom:R})},setMaxZoom:(R)=>{let{panZoom:A,minZoom:O}=W();A?.setScaleExtent([O,R]),z({maxZoom:R})},setTranslateExtent:(R)=>{W().panZoom?.setTranslateExtent(R),z({translateExtent:R})},resetSelectedElements:()=>{let{edges:R,nodes:A,triggerNodeChanges:O,triggerEdgeChanges:B,elementsSelectable:M}=W();if(!M)return;let P=A.reduce((f,v)=>v.selected?[...f,u2(v.id,!1)]:f,[]),C=R.reduce((f,v)=>v.selected?[...f,u2(v.id,!1)]:f,[]);O(P),B(C)},setNodeExtent:(R)=>{let{nodes:A,nodeLookup:O,parentLookup:B,nodeOrigin:M,elevateNodesOnSelect:P,nodeExtent:C,zIndexMode:f}=W();if(R[0][0]===C[0][0]&&R[0][1]===C[0][1]&&R[1][0]===C[1][0]&&R[1][1]===C[1][1])return;u4(A,O,B,{nodeOrigin:M,nodeExtent:R,elevateNodesOnSelect:P,checkEquality:!1,zIndexMode:f}),z({nodeExtent:R})},panBy:(R)=>{let{transform:A,width:O,height:B,panZoom:M,translateExtent:P}=W();return c7({delta:R,panZoom:M,transform:A,translateExtent:P,width:O,height:B})},setCenter:async(R,A,O)=>{let{width:B,height:M,maxZoom:P,panZoom:C}=W();if(!C)return!1;let f=typeof O?.zoom<"u"?O.zoom:P;return await C.setViewport({x:B/2-R*f,y:M/2-A*f,zoom:f},{duration:O?.duration,ease:O?.ease,interpolate:O?.interpolate}),!0},cancelConnection:()=>{z({connection:{...S6}})},updateConnection:(R)=>{z({connection:R})},reset:()=>z({...x9()})}},Object.is);function J8({initialNodes:_,initialEdges:Q,defaultNodes:J,defaultEdges:q,initialWidth:U,initialHeight:G,initialMinZoom:Z,initialMaxZoom:F,initialFitViewOptions:X,fitView:Y,nodeOrigin:K,nodeExtent:H,zIndexMode:L,children:z}){let[W]=d.useState(()=>pG({nodes:_,edges:Q,defaultNodes:J,defaultEdges:q,width:U,height:G,fitView:Y,minZoom:Z,maxZoom:F,fitViewOptions:X,nodeOrigin:K,nodeExtent:H,zIndexMode:L}));return r.jsx($U,{value:W,children:r.jsx(SU,{children:r.jsx(cU,{children:z})})})}function cG({children:_,nodes:Q,edges:J,defaultNodes:q,defaultEdges:U,width:G,height:Z,fitView:F,fitViewOptions:X,minZoom:Y,maxZoom:K,nodeOrigin:H,nodeExtent:L,zIndexMode:z}){if(d.useContext(p4))return r.jsx(r.Fragment,{children:_});return r.jsx(J8,{initialNodes:Q,initialEdges:J,defaultNodes:q,defaultEdges:U,initialWidth:G,initialHeight:Z,fitView:F,initialFitViewOptions:X,initialMinZoom:Y,initialMaxZoom:K,nodeOrigin:H,nodeExtent:L,zIndexMode:z,children:_})}var lG={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function iG({nodes:_,edges:Q,defaultNodes:J,defaultEdges:q,className:U,nodeTypes:G,edgeTypes:Z,onNodeClick:F,onEdgeClick:X,onInit:Y,onMove:K,onMoveStart:H,onMoveEnd:L,onConnect:z,onConnectStart:W,onConnectEnd:w,onClickConnectStart:R,onClickConnectEnd:A,onNodeMouseEnter:O,onNodeMouseMove:B,onNodeMouseLeave:M,onNodeContextMenu:P,onNodeDoubleClick:C,onNodeDragStart:f,onNodeDrag:v,onNodeDragStop:N,onNodesDelete:k,onEdgesDelete:u,onDelete:i,onSelectionChange:l,onSelectionDragStart:S,onSelectionDrag:b,onSelectionDragStop:h,onSelectionContextMenu:E,onSelectionStart:j,onSelectionEnd:m,onBeforeDelete:I,connectionMode:V,connectionLineType:D=b0.Bezier,connectionLineStyle:y,connectionLineComponent:t,connectionLineContainerStyle:_1,deleteKeyCode:s="Backspace",selectionKeyCode:o="Shift",selectionOnDrag:p=!1,selectionMode:e=v2.Full,panActivationKeyCode:q1="Space",multiSelectionKeyCode:G1=G5()?"Meta":"Control",zoomActivationKeyCode:U1=G5()?"Meta":"Control",snapToGrid:K1,snapGrid:W1,onlyRenderVisibleElements:Y1=!1,selectNodesOnDrag:n,nodesDraggable:I1,autoPanOnNodeFocus:H1,nodesConnectable:m1,nodesFocusable:t1,nodeOrigin:d1=r9,edgesFocusable:N0,edgesReconnectable:z0,elementsSelectable:T0=!0,defaultViewport:$0=BU,minZoom:F0=0.5,maxZoom:_0=2,translateExtent:W0=J5,preventScrolling:U2=!0,nodeExtent:f0,defaultMarkerColor:p0="#b1b1b7",zoomOnScroll:c0=!0,zoomOnPinch:A2=!0,panOnScroll:G2=!1,panOnScrollSpeed:l0=0.5,panOnScrollMode:T=s0.Free,zoomOnDoubleClick:g=!0,panOnDrag:Q1=!0,onPaneClick:J1,onPaneMouseEnter:X1,onPaneMouseMove:N1,onPaneMouseLeave:T1,onPaneScroll:y1,onPaneContextMenu:O1,paneClickDistance:B0=1,nodeClickDistance:j0=0,children:Y5,onReconnect:x,onReconnectStart:a,onReconnectEnd:$1,onEdgeContextMenu:Z1,onEdgeDoubleClick:f1,onEdgeMouseEnter:L1,onEdgeMouseMove:A1,onEdgeMouseLeave:R1,reconnectRadius:S1=10,onNodesChange:a1,onEdgesChange:w1,noDragClassName:l1="nodrag",noWheelClassName:u1="nowheel",noPanClassName:l2="nopan",fitView:K0,fitViewOptions:D1,connectOnClick:RQ,attributionPosition:OQ,proOptions:IQ,defaultEdgeOptions:wQ,elevateNodesOnSelect:PQ=!0,elevateEdgesOnSelect:NQ=!1,disableKeyboardA11y:T8=!1,autoPanOnConnect:fQ,autoPanOnNodeDrag:CQ,autoPanOnSelection:SQ=!0,autoPanSpeed:vQ,connectionRadius:kQ,isValidConnection:yQ,onError:jQ,style:VQ,id:R8,nodeDragThreshold:uQ,connectionDragThreshold:hQ,viewport:DQ,onViewportChange:bQ,width:EQ,height:xQ,colorMode:mQ="light",debug:gQ,onScroll:O8,ariaLabelConfig:pQ,zIndexMode:I8="basic",...cQ},lQ){let e4=R8||"1",iQ=RU(mQ),rQ=d.useCallback((w8)=>{w8.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),O8?.(w8)},[O8]);return r.jsx("div",{"data-testid":"rf__wrapper",...cQ,onScroll:rQ,style:{...VQ,...lG},ref:lQ,className:g1(["react-flow",U,iQ]),id:R8,role:"application",children:r.jsxs(cG,{nodes:_,edges:Q,width:EQ,height:xQ,fitView:K0,fitViewOptions:D1,minZoom:F0,maxZoom:_0,nodeOrigin:d1,nodeExtent:f0,zIndexMode:I8,children:[r.jsx(TU,{nodes:_,edges:Q,defaultNodes:J,defaultEdges:q,onConnect:z,onConnectStart:W,onConnectEnd:w,onClickConnectStart:R,onClickConnectEnd:A,nodesDraggable:I1,autoPanOnNodeFocus:H1,nodesConnectable:m1,nodesFocusable:t1,edgesFocusable:N0,edgesReconnectable:z0,elementsSelectable:T0,elevateNodesOnSelect:PQ,elevateEdgesOnSelect:NQ,minZoom:F0,maxZoom:_0,nodeExtent:f0,onNodesChange:a1,onEdgesChange:w1,snapToGrid:K1,snapGrid:W1,connectionMode:V,translateExtent:W0,connectOnClick:RQ,defaultEdgeOptions:wQ,fitView:K0,fitViewOptions:D1,onNodesDelete:k,onEdgesDelete:u,onDelete:i,onNodeDragStart:f,onNodeDrag:v,onNodeDragStop:N,onSelectionDrag:b,onSelectionDragStart:S,onSelectionDragStop:h,onMove:K,onMoveStart:H,onMoveEnd:L,noPanClassName:l2,nodeOrigin:d1,rfId:e4,autoPanOnConnect:fQ,autoPanOnNodeDrag:CQ,autoPanSpeed:vQ,onError:jQ,connectionRadius:kQ,isValidConnection:yQ,selectNodesOnDrag:n,nodeDragThreshold:uQ,connectionDragThreshold:hQ,onBeforeDelete:I,debug:gQ,ariaLabelConfig:pQ,zIndexMode:I8}),r.jsx(mG,{onInit:Y,onNodeClick:F,onEdgeClick:X,onNodeMouseEnter:O,onNodeMouseMove:B,onNodeMouseLeave:M,onNodeContextMenu:P,onNodeDoubleClick:C,nodeTypes:G,edgeTypes:Z,connectionLineType:D,connectionLineStyle:y,connectionLineComponent:t,connectionLineContainerStyle:_1,selectionKeyCode:o,selectionOnDrag:p,selectionMode:e,deleteKeyCode:s,multiSelectionKeyCode:G1,panActivationKeyCode:q1,zoomActivationKeyCode:U1,onlyRenderVisibleElements:Y1,defaultViewport:$0,translateExtent:W0,minZoom:F0,maxZoom:_0,preventScrolling:U2,zoomOnScroll:c0,zoomOnPinch:A2,zoomOnDoubleClick:g,panOnScroll:G2,panOnScrollSpeed:l0,panOnScrollMode:T,panOnDrag:Q1,autoPanOnSelection:SQ,onPaneClick:J1,onPaneMouseEnter:X1,onPaneMouseMove:N1,onPaneMouseLeave:T1,onPaneScroll:y1,onPaneContextMenu:O1,paneClickDistance:B0,nodeClickDistance:j0,onSelectionContextMenu:E,onSelectionStart:j,onSelectionEnd:m,onReconnect:x,onReconnectStart:a,onReconnectEnd:$1,onEdgeContextMenu:Z1,onEdgeDoubleClick:f1,onEdgeMouseEnter:L1,onEdgeMouseMove:A1,onEdgeMouseLeave:R1,reconnectRadius:S1,defaultMarkerColor:p0,noDragClassName:l1,noWheelClassName:u1,noPanClassName:l2,rfId:e4,disableKeyboardA11y:T8,nodeExtent:f0,viewport:DQ,onViewportChange:bQ,nodesDraggable:I1}),r.jsx(WU,{onSelectionChange:l}),Y5,r.jsx(XU,{proOptions:IQ,position:OQ}),r.jsx(HU,{rfId:e4,disableKeyboardA11y:T8})]})})}var R_=s9(iG);function O_(_){let[Q,J]=d.useState(_),q=d.useCallback((U)=>J((G)=>a9(U,G)),[]);return[Q,J,q]}var bA=X0.error014();function rG({dimensions:_,lineWidth:Q,variant:J,className:q}){return r.jsx("path",{strokeWidth:Q,d:`M${_[0]/2} 0 V${_[1]} M0 ${_[1]/2} H${_[0]}`,className:g1(["react-flow__background-pattern",J,q])})}function dG({radius:_,className:Q}){return r.jsx("circle",{cx:_,cy:_,r:_,className:g1(["react-flow__background-pattern","dots",Q])})}var E0;(function(_){_.Lines="lines",_.Dots="dots",_.Cross="cross"})(E0||(E0={}));var aG={[E0.Dots]:1,[E0.Lines]:1,[E0.Cross]:6},sG=(_)=>({transform:_.transform,patternId:`pattern-${_.rfId}`});function I_({id:_,variant:Q=E0.Dots,gap:J=20,size:q,lineWidth:U=1,offset:G=0,color:Z,bgColor:F,style:X,className:Y,patternClassName:K}){let H=d.useRef(null),{transform:L,patternId:z}=C1(sG,b1),W=q||aG[Q],w=Q===E0.Dots,R=Q===E0.Cross,A=Array.isArray(J)?J:[J,J],O=[A[0]*L[2]||1,A[1]*L[2]||1],B=W*L[2],M=Array.isArray(G)?G:[G,G],P=R?[B,B]:O,C=[M[0]*L[2]+P[0]/2,M[1]*L[2]+P[1]/2],f=`${z}${_?_:""}`;return r.jsxs("svg",{className:g1(["react-flow__background",Y]),style:{...X,...c4,"--xy-background-color-props":F,"--xy-background-pattern-color-props":Z},ref:H,"data-testid":"rf__background",children:[r.jsx("pattern",{id:f,x:L[0]%O[0],y:L[1]%O[1],width:O[0],height:O[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${C[0]},-${C[1]})`,children:w?r.jsx(dG,{radius:B/2,className:K}):r.jsx(rG,{dimensions:P,lineWidth:U,variant:Q,className:K})}),r.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${f})`})]})}I_.displayName="Background";var w_=d.memo(I_);function tG(){return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:r.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function oG(){return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:r.jsx("path",{d:"M0 0h32v4.2H0z"})})}function nG(){return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:r.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 eG(){return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:r.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 _Z(){return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:r.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 x4({children:_,className:Q,...J}){return r.jsx("button",{type:"button",className:g1(["react-flow__controls-button",Q]),...J,children:_})}var QZ=(_)=>({isInteractive:_.nodesDraggable||_.nodesConnectable||_.elementsSelectable,minZoomReached:_.transform[2]<=_.minZoom,maxZoomReached:_.transform[2]>=_.maxZoom,ariaLabelConfig:_.ariaLabelConfig});function P_({style:_,showZoom:Q=!0,showFitView:J=!0,showInteractive:q=!0,fitViewOptions:U,onZoomIn:G,onZoomOut:Z,onFitView:F,onInteractiveChange:X,className:Y,children:K,position:H="bottom-left",orientation:L="vertical","aria-label":z}){let W=E1(),{isInteractive:w,minZoomReached:R,maxZoomReached:A,ariaLabelConfig:O}=C1(QZ,b1),{zoomIn:B,zoomOut:M,fitView:P}=i5(),C=()=>{B(),G?.()},f=()=>{M(),Z?.()},v=()=>{P(U),F?.()},N=()=>{W.setState({nodesDraggable:!w,nodesConnectable:!w,elementsSelectable:!w}),X?.(!w)};return r.jsxs(x0,{className:g1(["react-flow__controls",L==="horizontal"?"horizontal":"vertical",Y]),position:H,style:_,"data-testid":"rf__controls","aria-label":z??O["controls.ariaLabel"],children:[Q&&r.jsxs(r.Fragment,{children:[r.jsx(x4,{onClick:C,className:"react-flow__controls-zoomin",title:O["controls.zoomIn.ariaLabel"],"aria-label":O["controls.zoomIn.ariaLabel"],disabled:A,children:r.jsx(tG,{})}),r.jsx(x4,{onClick:f,className:"react-flow__controls-zoomout",title:O["controls.zoomOut.ariaLabel"],"aria-label":O["controls.zoomOut.ariaLabel"],disabled:R,children:r.jsx(oG,{})})]}),J&&r.jsx(x4,{className:"react-flow__controls-fitview",onClick:v,title:O["controls.fitView.ariaLabel"],"aria-label":O["controls.fitView.ariaLabel"],children:r.jsx(nG,{})}),q&&r.jsx(x4,{className:"react-flow__controls-interactive",onClick:N,title:O["controls.interactive.ariaLabel"],"aria-label":O["controls.interactive.ariaLabel"],children:w?r.jsx(_Z,{}):r.jsx(eG,{})}),K]})}P_.displayName="Controls";var N_=d.memo(P_);function JZ({id:_,x:Q,y:J,width:q,height:U,style:G,color:Z,strokeColor:F,strokeWidth:X,className:Y,borderRadius:K,shapeRendering:H,selected:L,onClick:z}){let{background:W,backgroundColor:w}=G||{},R=Z||W||w;return r.jsx("rect",{className:g1(["react-flow__minimap-node",{selected:L},Y]),x:Q,y:J,rx:K,ry:K,width:q,height:U,style:{fill:R,stroke:F,strokeWidth:X},shapeRendering:H,onClick:z?(A)=>z(A,_):void 0})}var $Z=d.memo(JZ),qZ=(_)=>_.nodes.map((Q)=>Q.id),n6=(_)=>_ instanceof Function?_:()=>_;function UZ({nodeStrokeColor:_,nodeColor:Q,nodeClassName:J="",nodeBorderRadius:q=5,nodeStrokeWidth:U,nodeComponent:G=$Z,onClick:Z}){let F=C1(qZ,b1),X=n6(Q),Y=n6(_),K=n6(J),H=typeof window>"u"||!!window.chrome?"crispEdges":"geometricPrecision";return r.jsx(r.Fragment,{children:F.map((L)=>r.jsx(ZZ,{id:L,nodeColorFunc:X,nodeStrokeColorFunc:Y,nodeClassNameFunc:K,nodeBorderRadius:q,nodeStrokeWidth:U,NodeComponent:G,onClick:Z,shapeRendering:H},L))})}function GZ({id:_,nodeColorFunc:Q,nodeStrokeColorFunc:J,nodeClassNameFunc:q,nodeBorderRadius:U,nodeStrokeWidth:G,shapeRendering:Z,NodeComponent:F,onClick:X}){let{node:Y,x:K,y:H,width:L,height:z}=C1((W)=>{let w=W.nodeLookup.get(_);if(!w)return{node:void 0,x:0,y:0,width:0,height:0};let R=w.internals.userNode,{x:A,y:O}=w.internals.positionAbsolute,{width:B,height:M}=I0(R);return{node:R,x:A,y:O,width:B,height:M}},b1);if(!Y||Y.hidden||!D6(Y))return null;return r.jsx(F,{x:K,y:H,width:L,height:z,style:Y.style,selected:!!Y.selected,className:q(Y),color:Q(Y),borderRadius:U,strokeColor:J(Y),strokeWidth:G,shapeRendering:Z,onClick:X,id:Y.id})}var ZZ=d.memo(GZ),FZ=d.memo(UZ),HZ=200,XZ=150,KZ=(_)=>!_.hidden,YZ=(_)=>{let Q={x:-_.transform[0]/_.transform[2],y:-_.transform[1]/_.transform[2],width:_.width/_.transform[2],height:_.height/_.transform[2]},J=!1;for(let q of _.nodeLookup.values())if(!q.hidden){J=!0;break}return{viewBB:Q,boundingRect:J?V6(V2(_.nodeLookup,{filter:KZ}),Q):Q,rfId:_.rfId,panZoom:_.panZoom,translateExtent:_.translateExtent,flowWidth:_.width,flowHeight:_.height,ariaLabelConfig:_.ariaLabelConfig}},m9=(_,Q)=>_.x===Q.x&&_.y===Q.y&&_.width===Q.width&&_.height===Q.height,LZ=(_,Q)=>m9(_.viewBB,Q.viewBB)&&m9(_.boundingRect,Q.boundingRect)&&_.rfId===Q.rfId&&_.panZoom===Q.panZoom&&_.translateExtent===Q.translateExtent&&_.flowWidth===Q.flowWidth&&_.flowHeight===Q.flowHeight&&_.ariaLabelConfig===Q.ariaLabelConfig,zZ="react-flow__minimap-desc";function f_({style:_,className:Q,nodeStrokeColor:J,nodeColor:q,nodeClassName:U="",nodeBorderRadius:G=5,nodeStrokeWidth:Z,nodeComponent:F,bgColor:X,maskColor:Y,maskStrokeColor:K,maskStrokeWidth:H,position:L="bottom-right",onClick:z,onNodeClick:W,pannable:w=!1,zoomable:R=!1,ariaLabel:A,inversePan:O,zoomStep:B=1,offsetScale:M=5}){let P=E1(),C=d.useRef(null),{boundingRect:f,panZoom:v,viewBB:N,rfId:k,translateExtent:u,flowWidth:i,flowHeight:l,ariaLabelConfig:S}=C1(YZ,LZ),b=_?.width??HZ,h=_?.height??XZ,E=f.width/b,j=f.height/h,m=Math.max(E,j),I=m*b,V=m*h,D=M*m,y=f.x-(I-f.width)/2-D,t=f.y-(V-f.height)/2-D,_1=I+D*2,s=V+D*2,o=`${zZ}-${k}`,p=d.useRef(0),e=d.useRef();p.current=m,d.useEffect(()=>{let W1=P.getState().panZoom;if(C.current&&W1)return e.current=t7({domNode:C.current,panZoom:W1,getTransform:()=>P.getState().transform,getViewScale:()=>p.current}),()=>{e.current?.destroy()}},[v]),d.useEffect(()=>{e.current?.update({translateExtent:u,width:i,height:l,inversePan:O,pannable:w,zoomStep:B,zoomable:R})},[w,R,O,B,u,i,l]);let q1=z?(W1)=>{let[Y1,n]=e.current?.pointer(W1)||[0,0];z(W1,{x:Y1,y:n})}:void 0,G1=d.useCallback((W1,Y1)=>{let n=P.getState().nodeLookup.get(Y1).internals.userNode;W?.(W1,n)},[W]),U1=W?G1:void 0,K1=A??S["minimap.ariaLabel"];return r.jsx(x0,{position:L,style:{..._,"--xy-minimap-background-color-props":typeof X==="string"?X:void 0,"--xy-minimap-mask-background-color-props":typeof Y==="string"?Y:void 0,"--xy-minimap-mask-stroke-color-props":typeof K==="string"?K:void 0,"--xy-minimap-mask-stroke-width-props":typeof H==="number"?H*m:void 0,"--xy-minimap-node-background-color-props":typeof q==="string"?q:void 0,"--xy-minimap-node-stroke-color-props":typeof J==="string"?J:void 0,"--xy-minimap-node-stroke-width-props":typeof Z==="number"?Z:void 0},className:g1(["react-flow__minimap",Q]),"data-testid":"rf__minimap",children:r.jsxs("svg",{width:b,height:h,viewBox:`${y} ${t} ${_1} ${s}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":o,ref:C,onClick:q1,children:[K1&&r.jsx("title",{id:o,children:K1}),r.jsx(FZ,{onClick:U1,nodeColor:q,nodeStrokeColor:J,nodeBorderRadius:G,nodeClassName:U,nodeStrokeWidth:Z,nodeComponent:F}),r.jsx("path",{className:"react-flow__minimap-mask",d:`M${y-D},${t-D}h${_1+D*2}v${s+D*2}h${-_1-D*2}z
34
- M${N.x},${N.y}h${N.width}v${N.height}h${-N.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}f_.displayName="MiniMap";var C_=d.memo(f_),WZ=(_)=>(Q)=>_?`${Math.max(1/Q.transform[2],1)}`:void 0,BZ={[t0.Line]:"right",[t0.Handle]:"bottom-right"};function AZ({nodeId:_,position:Q,variant:J=t0.Handle,className:q,style:U=void 0,children:G,color:Z,minWidth:F=10,minHeight:X=10,maxWidth:Y=Number.MAX_VALUE,maxHeight:K=Number.MAX_VALUE,keepAspectRatio:H=!1,resizeDirection:L,autoScale:z=!0,shouldResize:W,onResizeStart:w,onResize:R,onResizeEnd:A}){let O=Q8(),B=typeof _==="string"?_:O,M=E1(),P=d.useRef(null),C=J===t0.Handle,f=C1(d.useCallback(WZ(C&&z),[C,z]),b1),v=d.useRef(null),N=Q??BZ[J];d.useEffect(()=>{if(!P.current||!B)return;if(!v.current)v.current=$9({domNode:P.current,nodeId:B,getStoreItems:()=>{let{nodeLookup:u,transform:i,snapGrid:l,snapToGrid:S,nodeOrigin:b,domNode:h}=M.getState();return{nodeLookup:u,transform:i,snapGrid:l,snapToGrid:S,nodeOrigin:b,paneDomNode:h}},onChange:(u,i)=>{let{triggerNodeChanges:l,nodeLookup:S,parentLookup:b,nodeOrigin:h}=M.getState(),E=[],j={x:u.x,y:u.y},m=S.get(B);if(m&&m.expandParent&&m.parentId){let I=m.origin??h,V=u.width??m.measured.width??0,D=u.height??m.measured.height??0,y={id:m.id,parentId:m.parentId,rect:{width:V,height:D,...b6({x:u.x??m.position.x,y:u.y??m.position.y},{width:V,height:D},m.parentId,S,I)}},t=h4([y],S,b,h);E.push(...t),j.x=u.x?Math.max(I[0]*V,u.x):void 0,j.y=u.y?Math.max(I[1]*D,u.y):void 0}if(j.x!==void 0&&j.y!==void 0){let I={id:B,type:"position",position:{...j}};E.push(I)}if(u.width!==void 0&&u.height!==void 0){let V={id:B,type:"dimensions",resizing:!0,setAttributes:!L?!0:L==="horizontal"?"width":"height",dimensions:{width:u.width,height:u.height}};E.push(V)}for(let I of i){let V={...I,type:"position"};E.push(V)}l(E)},onEnd:({width:u,height:i})=>{let l={id:B,type:"dimensions",resizing:!1,dimensions:{width:u,height:i}};M.getState().triggerNodeChanges([l])}});return v.current.update({controlPosition:N,boundaries:{minWidth:F,minHeight:X,maxWidth:Y,maxHeight:K},keepAspectRatio:H,resizeDirection:L,onResizeStart:w,onResize:R,onResizeEnd:A,shouldResize:W}),()=>{v.current?.destroy()}},[N,F,X,Y,K,H,w,R,A,W]);let k=N.split("-");return r.jsx("div",{className:g1(["react-flow__resize-control","nodrag",...k,J,q]),ref:P,style:{...U,scale:f,...Z&&{[C?"backgroundColor":"borderColor"]:Z}},children:G})}var g9=d.memo(AZ);function S_({nodeId:_,isVisible:Q=!0,handleClassName:J,handleStyle:q,lineClassName:U,lineStyle:G,color:Z,minWidth:F=10,minHeight:X=10,maxWidth:Y=Number.MAX_VALUE,maxHeight:K=Number.MAX_VALUE,keepAspectRatio:H=!1,autoScale:L=!0,shouldResize:z,onResizeStart:W,onResize:w,onResizeEnd:R}){if(!Q)return null;return r.jsxs(r.Fragment,{children:[Q9.map((A)=>r.jsx(g9,{className:U,style:G,nodeId:_,position:A,variant:t0.Line,color:Z,minWidth:F,minHeight:X,maxWidth:Y,maxHeight:K,onResizeStart:W,keepAspectRatio:H,autoScale:L,shouldResize:z,onResize:w,onResizeEnd:R},A)),_9.map((A)=>r.jsx(g9,{className:J,style:q,nodeId:_,position:A,color:Z,minWidth:F,minHeight:X,maxWidth:Y,maxHeight:K,onResizeStart:W,keepAspectRatio:H,autoScale:L,shouldResize:z,onResize:w,onResizeEnd:R},A))]})}var MZ=(_)=>_.domNode?.querySelector(".react-flow__renderer");function TZ({children:_}){let Q=C1(MZ);if(!Q)return null;return p9.createPortal(_,Q)}var RZ=(_,Q)=>_?.internals.positionAbsolute.x!==Q?.internals.positionAbsolute.x||_?.internals.positionAbsolute.y!==Q?.internals.positionAbsolute.y||_?.measured.width!==Q?.measured.width||_?.measured.height!==Q?.measured.height||_?.selected!==Q?.selected||_?.internals.z!==Q?.internals.z,OZ=(_,Q)=>{if(_.size!==Q.size)return!1;for(let[J,q]of _)if(RZ(q,Q.get(J)))return!1;return!0},IZ=(_)=>({x:_.transform[0],y:_.transform[1],zoom:_.transform[2],selectedNodesCount:_.nodes.filter((Q)=>Q.selected).length});function $8({nodeId:_,children:Q,className:J,style:q,isVisible:U,position:G=F1.Top,offset:Z=10,align:F="center",...X}){let Y=Q8(),K=d.useCallback((P)=>{return(Array.isArray(_)?_:[_||Y||""]).reduce((v,N)=>{let k=P.nodeLookup.get(N);if(k)v.set(k.id,k);return v},new Map)},[_,Y]),H=C1(K,OZ),{x:L,y:z,zoom:W,selectedNodesCount:w}=C1(IZ,b1);if(!(typeof U==="boolean"?U:H.size===1&&H.values().next().value?.selected&&w===1)||!H.size)return null;let A=V2(H),O=Array.from(H.values()),B=Math.max(...O.map((P)=>P.internals.z+1)),M={position:"absolute",transform:E7(A,{x:L,y:z,zoom:W},G,Z,F),zIndex:B,...q};return r.jsx(TZ,{children:r.jsx("div",{style:M,className:g1(["react-flow__node-toolbar",J]),...X,"data-id":O.reduce((P,C)=>`${P}${C.id} `,"").trim(),children:Q})})}var e1=Q0(V0(),1);var v_={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 z1=Q0(r5(),1),PZ="https://brand.volter.ai/logo/twin-world/svg?size=64&variant=mono";function d5({href:_,onClick:Q}){return z1.jsxDEV("h1",{children:z1.jsxDEV("a",{href:_,onClick:Q,children:[z1.jsxDEV("img",{src:PZ,alt:"",width:24,height:24,style:{verticalAlign:"middle"}},void 0,!1,void 0,this),z1.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 n0(_){return(await _.json().catch(()=>({}))).error??`answered ${_.status}`}function y_(_,Q,J=0,q=""){let[U,G]=e1.useState({state:"loading"});return e1.useEffect(()=>{G({state:"loading"})},[q,Q]),e1.useEffect(()=>{if(!Q)return;let Z=!0;return(async()=>{try{let F=await _(Q),X=F.ok?{state:"ok",data:await F.json()}:{state:"error",status:F.status,error:await n0(F)};if(Z)G(X)}catch(F){if(Z)G({state:"error",status:0,error:String(F)})}})(),()=>{Z=!1}},[q,Q,J]),U}function G0({load:_,what:Q,retry:J,lines:q=3}){if(_.state==="loading")return z1.jsxDEV(NZ,{lines:q,label:`Loading ${Q}…`},void 0,!1,void 0,this);if(_.state==="error")return z1.jsxDEV("div",{role:"alert",className:"error-state",children:[z1.jsxDEV("span",{children:["Could not read ",Q,": ",_.error]},void 0,!0,void 0,this),J?z1.jsxDEV("button",{type:"button",onClick:J,children:"Try again"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this);return null}function NZ({lines:_=3,label:Q="Loading…"}){return z1.jsxDEV("div",{className:"skeleton",role:"status","aria-label":Q,children:Array.from({length:_},(J,q)=>z1.jsxDEV("span",{style:{width:`${[92,76,84,64,88][q%5]}%`}},q,!1,void 0,this))},void 0,!1,void 0,this)}function V1({iso:_,time:Q}){if(!_)return z1.jsxDEV("span",{children:"—"},void 0,!1,void 0,this);let J=new Date(_);return z1.jsxDEV("time",{dateTime:_,title:_,children:Number.isNaN(J.getTime())?_:Q?J.toLocaleTimeString():J.toLocaleString()},void 0,!1,void 0,this)}var D2=(_)=>_?new Date(_).toLocaleString():"—";function G8(_){let Q=_?Date.parse(_):Number.NaN;if(Number.isNaN(Q))return"—";let J=Math.max(0,Math.round((Date.now()-Q)/1000));return J<60?"just now":J<3600?`${Math.round(J/60)}m ago`:J<86400?`${Math.round(J/3600)}h ago`:`${Math.round(J/86400)}d ago`}function x1(_,Q){let J=Q.replace(/[_-]+/g," "),q=J.endsWith("s")?J:/[^aeiou]y$/.test(J)?`${J.slice(0,-1)}ies`:/(ch|sh|x)$/.test(J)?`${J}es`:`${J}s`;return`${_} ${_===1?J:q}`}var b2=(_)=>_.length<=1?_.join(""):`${_.slice(0,-1).join(", ")} and ${_[_.length-1]}`,fZ={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"},B1=(_)=>fZ[_]??_.charAt(0).toUpperCase()+_.slice(1);function r1({vendor:_}){let Q=v_[_];return z1.jsxDEV("span",{className:Q?"mark logo":"mark","aria-hidden":"true",children:Q?z1.jsxDEV("svg",{viewBox:"0 0 24 24",children:z1.jsxDEV("path",{d:Q.d,fill:Q.fill},void 0,!1,void 0,this)},void 0,!1,void 0,this):B1(_).charAt(0)},void 0,!1,void 0,this)}var k_=(_)=>{_.currentTarget.closest("details")?.removeAttribute("open")},CZ="volter.theme",Z8=()=>{try{let _=localStorage.getItem(CZ);return _==="light"||_==="dark"?_:"system"}catch{return"system"}};function j_(_=Z8()){let Q=document.documentElement;if(_==="system")Q.removeAttribute("data-theme");else Q.setAttribute("data-theme",_)}function V_(){return e1.useEffect(()=>{let _=()=>[...document.querySelectorAll("details.menu[open], details.clock-more[open]")],Q=(q)=>{if(q.key!=="Escape"||document.querySelector("dialog[open]"))return;let U=_();if(!U.length)return;for(let G of U)G.removeAttribute("open");U[U.length-1].querySelector("summary")?.focus()},J=(q)=>{let U=q.target;for(let G of _())if(!U||!G.contains(U))G.removeAttribute("open")};return document.addEventListener("keydown",Q),document.addEventListener("click",J),()=>{document.removeEventListener("keydown",Q),document.removeEventListener("click",J)}},[]),null}function M0({open:_,onClose:Q,title:J,children:q,footer:U,wide:G}){let Z=e1.useRef(null),F=e1.useId();return e1.useEffect(()=>{let X=Z.current;if(!X)return;if(_&&!X.open){X.showModal();let Y=X.querySelector(".dialog-body :is(input:not([type=hidden]):not([disabled]), select, textarea)");if(Y?.focus(),Y instanceof HTMLInputElement&&Y.value&&/^(text|search|email|url)$/.test(Y.type))Y.select()}if(!_&&X.open)X.close()},[_]),z1.jsxDEV("dialog",{ref:Z,className:G==="window"?"dialog window":G?"dialog wide":"dialog","aria-labelledby":F,onClose:Q,onCancel:(X)=>{X.preventDefault(),Q()},onMouseDown:(X)=>{if(X.target===Z.current)Q()},children:_?z1.jsxDEV(z1.Fragment,{children:[z1.jsxDEV("div",{className:"dialog-head",children:[z1.jsxDEV("h2",{id:F,children:J},void 0,!1,void 0,this),z1.jsxDEV("button",{type:"button",className:"icon-button","aria-label":"Close",onClick:Q,children:"✕"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z1.jsxDEV("div",{className:"dialog-body",children:q},void 0,!1,void 0,this),U?z1.jsxDEV("div",{className:"dialog-foot",children:U},void 0,!1,void 0,this):null]},void 0,!0,void 0,this):null},void 0,!1,void 0,this)}var q8="volter:confirm";function m0(_){return new Promise((Q)=>{window.dispatchEvent(new CustomEvent(q8,{detail:{ask:_,resolve:Q}}))})}function u_(){let[_,Q]=e1.useState(null),[J,q]=e1.useState("");e1.useEffect(()=>{let F=(X)=>{q(""),Q(X.detail)};return window.addEventListener(q8,F),()=>window.removeEventListener(q8,F)},[]);let U=(F)=>{_?.resolve(F),Q(null)},G=_?.ask,Z=!G?.typed||J===G.typed;return z1.jsxDEV(M0,{open:Boolean(_),onClose:()=>U(!1),title:G?.title??"",footer:z1.jsxDEV(z1.Fragment,{children:[z1.jsxDEV("button",{type:"button",onClick:()=>U(!1),children:"Cancel"},void 0,!1,void 0,this),z1.jsxDEV("button",{type:"button",className:G?.danger?"danger-button":"primary",disabled:!Z,onClick:()=>U(!0),children:G?.action},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:[G?.body?z1.jsxDEV("div",{className:"confirm-body",children:G.body},void 0,!1,void 0,this):null,G?.typed?z1.jsxDEV("div",{className:"typed-confirm",children:[z1.jsxDEV("p",{children:["Type ",z1.jsxDEV("code",{children:G.typed},void 0,!1,void 0,this)," to confirm."]},void 0,!0,void 0,this),z1.jsxDEV("input",{autoFocus:!0,"aria-label":`Type ${G.typed} to confirm`,value:J,onChange:(F)=>q(F.target.value),onKeyDown:(F)=>{if(F.key==="Enter"&&Z)U(!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 U8="volter:toast";function p1(_,Q="ok"){window.dispatchEvent(new CustomEvent(U8,{detail:{text:_,kind:Q}}))}function h_(){let[_,Q]=e1.useState([]);return e1.useEffect(()=>{let J=0,q=(U)=>{let{text:G,kind:Z}=U.detail,F=++J;if(Q((X)=>[...X.slice(-3),{id:F,text:G,kind:Z}]),Z!=="error")setTimeout(()=>Q((X)=>X.filter((Y)=>Y.id!==F)),4500)};return window.addEventListener(U8,q),()=>window.removeEventListener(U8,q)},[]),z1.jsxDEV("div",{className:"toasts",role:"region","aria-label":"Notifications",children:_.map((J)=>z1.jsxDEV("div",{className:`toast ${J.kind}`,role:J.kind==="error"?"alert":"status",children:[z1.jsxDEV("span",{children:J.text},void 0,!1,void 0,this),z1.jsxDEV("button",{type:"button",className:"icon-button","aria-label":"Dismiss",onClick:()=>Q((q)=>q.filter((U)=>U.id!==J.id)),children:"✕"},void 0,!1,void 0,this)]},J.id,!0,void 0,this))},void 0,!1,void 0,this)}function F8({value:_,label:Q,secret:J}){let[q,U]=e1.useState(!1);return z1.jsxDEV("div",{className:"copy-field",children:[Q?z1.jsxDEV("span",{className:"copy-label",children:Q},void 0,!1,void 0,this):null,z1.jsxDEV("div",{className:"copy-row",children:[z1.jsxDEV("input",{readOnly:!0,value:_,"aria-label":Q??"Value",onFocus:(Z)=>Z.currentTarget.select(),spellCheck:!1},void 0,!1,void 0,this),z1.jsxDEV("button",{type:"button",onClick:()=>{navigator.clipboard?.writeText(_).then(()=>{U(!0),setTimeout(()=>U(!1),1600),p1(J?"Copied. Keep it somewhere safe":"Copied")}).catch(()=>p1("Your browser would not copy it: select it and copy","error"))},children:q?"Copied":"Copy"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function D_({label:_,items:Q}){return z1.jsxDEV("details",{className:"menu row-menu",children:[z1.jsxDEV("summary",{className:"icon-button",role:"button","aria-haspopup":"menu","aria-label":_,title:_,children:"⋯"},void 0,!1,void 0,this),z1.jsxDEV("div",{className:"popover menu-list",role:"menu",children:Q.filter((J)=>Boolean(J)).map((J)=>J.href?z1.jsxDEV("a",{role:"menuitem",href:J.href,className:J.danger?"danger-item":void 0,onClick:k_,children:J.label},J.label,!1,void 0,this):z1.jsxDEV("button",{type:"button",role:"menuitem",disabled:J.disabled,className:J.danger?"danger-item":void 0,onClick:(q)=>{k_(q),J.onSelect?.()},children:J.label},J.label,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function F5({title:_,children:Q,action:J}){return z1.jsxDEV("div",{className:"empty-state",children:[z1.jsxDEV("p",{className:"empty-title",children:_},void 0,!1,void 0,this),Q?z1.jsxDEV("div",{className:"empty-body",children:Q},void 0,!1,void 0,this):null,J?z1.jsxDEV("div",{className:"empty-action",children:J},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}function b_(){return e1.useEffect(()=>{let _=(J)=>{let q=document.querySelector("main.app"),U=J.target;if(q?.hasAttribute("data-drawer")&&U&&!U.closest(".side")&&!U.closest(".drawer-button"))q.removeAttribute("data-drawer")},Q=(J)=>{if(J.key==="Escape")SZ()};return document.addEventListener("click",_),document.addEventListener("keydown",Q),()=>{document.removeEventListener("click",_),document.removeEventListener("keydown",Q)}},[]),z1.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 SZ=()=>{document.querySelector("main.app")?.removeAttribute("data-drawer")};function i4(_={}){let Q=(q,U)=>_.tools?`${U} (\`${q}\`)`:`\`${q}\``,J=["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.","",_.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, ${Q("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. ${_.tools?"Start it with world_up":"Start it: `volter world up`"}, then run the tests inside it: ${Q("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 (${Q("volter world log","world_log")}), and give me the dashboard link (${_.tools?"world_view":"`volter world view --no-open`, started in the background: it keeps running"}).`];if(_.platform){let q=_.world??"<org>/<world>";J.push(`5. Share it with my team on ${_.platform}: ${Q(`volter login ${_.platform}`,"platform_login")} gives a link and a code for me to approve in my browser. Once I have, link it with ${Q(`volter remote add origin ${q} --create`,"remote_link with create: true")}${_.world?"":" (ask me for <org>/<world>)"}, then send what the app did: ${Q('volter world changeset -m "<what and why>"',"world_changeset")} and ${Q("volter world push","world_push")}.`)}return J.push("","The guide: https://world.volter.ai/docs/guides/use-with-a-coding-agent.md"),J.join(`
35
- `)}var E_={"git-commit-horizontal":[["rect",{x:"9",y:"9",width:"6",height:"6"}],["path",{d:"M3 12h6M15 12h6"}]],"arrow-down-to-line":[["path",{d:"M12 17V3"}],["path",{d:"m6 11 6 6 6-6"}],["path",{d:"M19 21H5"}]],"arrow-up-from-line":[["path",{d:"m18 9-6-6-6 6"}],["path",{d:"M12 3v14"}],["path",{d:"M5 21h14"}]],"git-branch":[["rect",{x:"4",y:"3",width:"4",height:"4"}],["rect",{x:"4",y:"17",width:"4",height:"4"}],["rect",{x:"16",y:"5",width:"4",height:"4"}],["path",{d:"M6 7v10M18 9v2a4 4 0 0 1-4 4H6"}]],monitor:[["rect",{x:"3",y:"4",width:"18",height:"13"}],["path",{d:"M8 21h8M12 17v4"}]],vault:[["rect",{width:"18",height:"18",x:"3",y:"3"}],["rect",{x:"6.3",y:"6.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}],["path",{d:"m7.9 7.9 2.7 2.7"}],["rect",{x:"15.3",y:"6.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}],["path",{d:"m13.4 10.6 2.7-2.7"}],["rect",{x:"6.3",y:"15.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}],["path",{d:"m7.9 16.1 2.7-2.7"}],["rect",{x:"15.3",y:"15.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}],["path",{d:"m13.4 13.4 2.7 2.7"}],["circle",{cx:"12",cy:"12",r:"2"}]],settings:[["circle",{cx:"12",cy:"12",r:"3"}],["circle",{cx:"12",cy:"12",r:"7"}],["path",{d:"M12 2v3M12 19v3M2 12h3M19 12h3M4.9 4.9L7 7M17 17l2.1 2.1M4.9 19.1L7 17M17 7l2.1-2.1"}]],history:[["path",{d:"M3 12a9 9 0 1 0 3-6.7"}],["path",{d:"M3 4v5h5"}],["path",{d:"M12 7v5l3 3"}]],activity:[["path",{d:"M2 12h4l3-8 6 16 3-8h4"}]],"file-diff":[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"}],["path",{d:"M9 10h6"}],["path",{d:"M12 13V7"}],["path",{d:"M9 17h6"}]],"square-plus":[["rect",{x:"4",y:"4",width:"16",height:"16"}],["path",{d:"M12 8v8M8 12h8"}]],"square-minus":[["rect",{width:"18",height:"18",x:"3",y:"3"}],["path",{d:"M8 12h8"}]],"square-dot":[["rect",{width:"18",height:"18",x:"3",y:"3"}],["rect",{x:"10.8",y:"10.8",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}]],cloud:[["path",{d:"M7 19a5 5 0 0 1-.5-10A6 6 0 0 1 18 8a4.5 4.5 0 0 1 .5 11z"}]],"refresh-cw":[["path",{d:"M20 12a8 8 0 0 1-14.3 4.9M4 12a8 8 0 0 1 14.3-4.9"}],["path",{d:"M19 3v5h-5M5 21v-5h5"}]],clock:[["circle",{cx:"12",cy:"12",r:"9"}],["path",{d:"M12 7v5l3 3"}]],"key-round":[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z"}],["rect",{x:"15.3",y:"6.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}]],plug:[["path",{d:"M9 3v5M15 3v5M6 8h12v4a6 6 0 0 1-12 0zM12 18v3"}]],"list-checks":[["path",{d:"M11 6h9M11 12h9M11 18h9"}],["path",{d:"M3 6l1.5 1.5L7 5M3 12l1.5 1.5L7 11M3 18l1.5 1.5L7 17"}]],palette:[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z"}],["rect",{x:"12.3",y:"5.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}],["rect",{x:"16.3",y:"9.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}],["rect",{x:"5.3",y:"11.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}],["rect",{x:"7.3",y:"6.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}]],check:[["path",{d:"M4 12l5 5L20 6"}]],plus:[["path",{d:"M12 4v16M4 12h16"}]],"chevron-down":[["path",{d:"M5 9l7 7 7-7"}]],"external-link":[["path",{d:"M14 4h6v6M20 4l-9 9"}],["path",{d:"M18 14v6H4V6h6"}]],"table-2":[["path",{d:"M3 9h18"}],["path",{d:"M9 3v18"}],["rect",{x:"3",y:"3",width:"18",height:"18"}]],"scroll-text":[["path",{d:"M15 12h-5"}],["path",{d:"M15 8h-5"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3"}]],"layout-grid":[["rect",{x:"4",y:"4",width:"7",height:"7"}],["rect",{x:"13",y:"4",width:"7",height:"7"}],["rect",{x:"4",y:"13",width:"7",height:"7"}],["rect",{x:"13",y:"13",width:"7",height:"7"}]],globe:[["circle",{cx:"12",cy:"12",r:"9"}],["path",{d:"M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18"}]],"arrow-left":[["path",{d:"M20 12H5M11 6l-6 6 6 6"}]],link:[["path",{d:"M9 15l6-6"}],["path",{d:"M11 6l2-2a4.2 4.2 0 0 1 6 6l-2 2M13 18l-2 2a4.2 4.2 0 0 1-6-6l2-2"}]],user:[["circle",{cx:"12",cy:"8",r:"4"}],["path",{d:"M4 21v-1a6 6 0 0 1 6-6h4a6 6 0 0 1 6 6v1"}]],"log-out":[["path",{d:"M10 4H4v16h6M9 12h11M16 8l4 4-4 4"}]]};var $=Q0(r5(),1),d4="volter.console.token",t5=document.getElementById("root"),M1=t5.dataset.base??"/-/console",k1=window.location.origin,Q2=(t5.dataset.worlds??k1).replace(/\/+$/,""),a_=(t5.dataset.names??"").split(",").filter((_)=>_!==""),_2=t5.dataset.worldOrigin==="1",p2=window.fetch.bind(window),W2="(session)",s_="(pass)",a5=(_)=>{try{if(_&&!_2)sessionStorage.setItem(d4,_);else sessionStorage.removeItem(d4);localStorage.removeItem(d4)}catch{}},t_="volter.console.portal",o_=(_)=>{try{if(typeof _==="string"&&/^https?:$/.test(new URL(_).protocol))sessionStorage.setItem(t_,new URL(_).origin)}catch{}},vZ=()=>{return c2.get("token")??""},Z0=()=>{try{let _=sessionStorage.getItem(t_)??"";return _&&/^https?:$/.test(new URL(_).protocol)?new URL(_).origin:""}catch{return""}},kZ=()=>{let _=vZ();if(_2){if(a5(""),c2.get("pass"))return s_;let Q=new URLSearchParams(window.location.search).has("signin");if(Q)try{window.history.replaceState(null,"",window.location.pathname+window.location.hash)}catch{}return _||(Q?"":W2)}if(_)return a5(_),_;try{return sessionStorage.getItem(d4)??""}catch{return""}};function s1(_){let Q=_.trim();if(/not ready/i.test(Q)&&/(never verified|not verified|no approvals)/i.test(Q)){let G=[],Z=[];if(/(never verified|not verified)/i.test(Q))G.push("it is not verified yet"),Z.push("verify");if(/no approvals/i.test(Q))G.push("no one has approved it"),Z.push("approve");return{text:`Not ready to deploy: ${b2(G)}.`,acts:Z}}let J=/no credential (?:is )?sealed for ([a-z0-9_-]+)/i.exec(Q);if(J)return{text:`No credential is sealed for ${B1(J[1])}: seal one in Settings › Vault.`,acts:["vault"]};if(/has no origin/i.test(Q))return{text:"This World has no remote: name one in Settings › Remote.",acts:["remote"]};let q=/the ([a-z0-9_-]+) twin has no root/i.exec(Q)??/:\s*([a-z0-9_, -]+?) (?:has|have) no root/i.exec(Q);if(q){let G=q[1].split(/,\s*/).filter(Boolean).map(B1);return{text:`${b2(G)} ${G.length===1?"is":"are"} not connected to ${G.length===1?"its":"their"} real service: Settings › Real services.`,acts:["settings"]}}if(/opening a seal is/i.test(Q))return{text:"A key cannot seal a credential: open the World as yourself.",acts:[]};if(/a key manages no keys/i.test(Q))return{text:"A key cannot manage keys: open the World as yourself.",acts:[]};if(/^PUT origin:/i.test(Q))return{text:"That is not a World's address: https://<host>/<org>/<world>",acts:[]};if(/^clock: \{/i.test(Q))return{text:"Pick a date and time.",acts:[]};if(/^advance: \{/i.test(Q))return{text:"Advance by a number and a unit: 90m, 12h, 3d.",acts:[]};if(/^branches: \{/i.test(Q))return{text:"That branch could not be made: pick now, or an instant before it.",acts:[]};if(/^approve: \{/i.test(Q))return{text:"Name who approves.",acts:[]};if(/a browser deploys only what it names/i.test(Q))return{text:"A deploy is confirmed by its name: use Deploy again.",acts:[]};if(/^no such door/i.test(Q))return{text:"This World does not answer that here.",acts:[]};return{text:Q.replace(/\s*[—–-]+\s*(?:run\s+)?`[^`]*`/g,"").replace(/\s*[—–-]+\s*(?:PUT|POST|GET|DELETE)\s+\/-\/\S+(?:\s*\{[^}]*\})?/g,"").replace(/\s*\(\s*`[^`]*`\s*\)/g,"").replace(/`(?:volter|printf|curl|npm|bun)[^`]*`/g,"").replace(/:\s*\{[^}]*\}/g,"").replace(/\(\s*\)/g,"").replace(/\s*;\s*(?=[;.]|$)/g,"").replace(/\s+([,.;:])/g,"$1").trim()||_,acts:[]}}var L0=async(_)=>s1(await n0(_)).text,yZ={vault:["vault","Open Vault"],remote:["remote","Open Remote"],settings:["settings/services","Open Real services"]};function n_({name:_,acts:Q}){let J=Q.map((q)=>yZ[q]).filter((q)=>Boolean(q));if(J.length===0)return null;return $.jsxDEV($.Fragment,{children:J.map(([q,U])=>$.jsxDEV(c.default.Fragment,{children:[" ",$.jsxDEV("a",{href:`${M1}/${_}/~/${q}`,onClick:(G)=>{G.preventDefault(),j1([..._.split("/"),"~",...q.split("/")])},children:U},void 0,!1,void 0,this)]},q,!0,void 0,this))},void 0,!1,void 0,this)}async function v1(_,Q,J={}){return p2(`${k1}${Q}`,{...J,headers:{...J.headers??{},..._===W2?{}:{"x-volter-token":_},...J.body&&!J.headers?.["content-type"]?{"content-type":"application/json"}:{}}})}function h1(_,Q,J=0){let q=y_((U)=>v1(_,U),Q,J,_);return q.state==="error"?{...q,error:s1(q.error).text}:q}var K5=(_)=>{let Q=new Date(_),J=(q)=>String(q).padStart(2,"0");return`${Q.getFullYear()}-${J(Q.getMonth()+1)}-${J(Q.getDate())}T${J(Q.getHours())}:${J(Q.getMinutes())}`},x_=(_)=>new Date(Math.ceil(Date.parse(_)/60000)*60000).toISOString(),e_=(_)=>_.operation==="observed"?`observed${_.provenance==="placeholder"?" (default data)":" (vendor)"}`:_.receipt?`${_.receipt.status??""} ${_.receipt.externalId??""} ${_.receipt.reason??""}`.trim():_.provenance==="placeholder"?"default data":"unpushed",jZ=(_)=>{let Q=/^[0-9a-f]{2}-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2}$/.exec(_??"");return Q?{trace:Q[1],span:Q[2]}:null},L8="volter.console.snapshots",J2=()=>{try{return JSON.parse(sessionStorage.getItem(L8)??"{}")}catch{return{}}},_Q=new Map,z8=(_)=>{if(_2){if(_.token||_.readToken)_Q.set(_.name,{token:_.token,readToken:_.readToken});_={..._,token:"",readToken:""}}try{sessionStorage.setItem(L8,JSON.stringify({...J2(),[_.name]:_}))}catch{}},W8=(_)=>_Q.get(_)?.readToken||J2()[_]?.readToken||"",a4=(_)=>{try{let Q=J2();delete Q[_],sessionStorage.setItem(L8,JSON.stringify(Q))}catch{}},c2=new URLSearchParams(window.location.hash.slice(1)),H5=c2.get("close")??"";function o5(_){if(typeof _!=="string")return null;let Q;try{Q=new URL(_)}catch{return null}return(Q.protocol==="http:"||Q.protocol==="https:")&&Q.origin===_.replace(/\/+$/,"")?Q:null}function B8(_){let Q=o5(_);if(!Q)return null;let J=new URL(k1);if(Q.protocol!==J.protocol||Q.port!==J.port)return null;if(Q.hostname===J.hostname)return Q.origin;let q=/^[a-z0-9](?:[a-z0-9]|-(?!-))*--[a-z0-9](?:[a-z0-9]|-(?!-))*\./;if(!q.test(Q.hostname))return null;let U=Q.hostname.replace(q,"");return U===J.hostname||q.test(J.hostname)&&U===J.hostname.replace(q,"")?Q.origin:null}function VZ(_){let Q;try{Q=JSON.parse(_)}catch{return null}let J=/^[a-z0-9][a-z0-9-]*\/[a-z0-9][a-z0-9-]*$/i;if(typeof Q.name!=="string"||!J.test(Q.name)||typeof Q.parent!=="string"||!J.test(Q.parent)||typeof Q.at!=="string")return null;let q=Q.parentOrigin===void 0?void 0:B8(Q.parentOrigin);return{name:Q.name,parent:Q.parent,token:typeof Q.token==="string"?Q.token:"",readToken:typeof Q.readToken==="string"?Q.readToken:"",at:Q.at,expiresAt:typeof Q.expiresAt==="string"?Q.expiresAt:null,...q?{parentOrigin:q}:{}}}{let _=c2.get("snapshot");if(_){let Q=VZ(_);if(Q&&!J2()[Q.name])z8(Q)}}var QQ="volter.console.home",JQ=(_)=>{let Q=o5(_);if(!Q)return null;let J=new URL(k1).hostname,q=J.replace(/^[a-z0-9](?:[a-z0-9]|-(?!-))*--[a-z0-9](?:[a-z0-9]|-(?!-))*\./,"");return Q.hostname===J||Q.hostname===q?Q.origin:null};{let _=JQ(c2.get("home"));if(_)try{sessionStorage.setItem(QQ,_)}catch{}}if(["token","pass","portal","snapshot","home","close"].some((_)=>c2.has(_)))try{window.history.replaceState(null,"",window.location.pathname+window.location.search)}catch{}var y0=()=>{try{return JQ(sessionStorage.getItem(QQ))??""}catch{return""}};function A8(_,Q,J,q){let U=new URLSearchParams({token:Q,home:y0()||k1}),G=J2()[J];if(G)U.set("snapshot",JSON.stringify(G));window.location.replace(`${_}${q??`${window.location.pathname}${window.location.search}`}#${U.toString()}`)}var t4=t5.dataset.route==="memory"?"":null;function QM(_){t4=_,window.dispatchEvent(new PopStateEvent("popstate"))}function x2(){return(t4??window.location.pathname.slice(M1.length)).split("/").filter(Boolean).map((_)=>{try{return decodeURIComponent(_)}catch{return""}})}var m_=/^[a-z0-9](?:[a-z0-9]|-(?!-))*$/i,e0=(_,Q)=>_&&Q&&m_.test(_)&&m_.test(Q)?`${_}/${Q}`:"";function j1(_){let Q=`/${_.map(encodeURIComponent).join("/")}`;if(t4!==null)t4=Q;else window.history.pushState(null,"",`${M1}${Q}`);window.dispatchEvent(new PopStateEvent("popstate"))}function $Q(_,Q){let J=B8(J2()[_]?.origin);if(J&&J!==k1){A8(J,W8(_),_,`${M1}/${Q.map(encodeURIComponent).join("/")}`);return}j1(Q)}async function g_(){let[_,Q]=x2(),J=e0(_,Q),q=J?[J]:a_;if(q.length===0){let U=await p2(`${k1}/-/ping`).catch(()=>null);q=U?.ok?(await U.json().catch(()=>({}))).worlds??[]:[]}q=q.filter((U)=>{let[G,Z,...F]=U.split("/");return F.length===0&&e0(G,Z)===U});for(let U of q){let G=await p2(`${k1}/-/${U}/session`,{method:"POST"}).catch(()=>null);if(!G)continue;let Z=await G.json().catch(()=>({})),F=o5(Z.origin)?.origin;if(G.status===409&&F&&F!==k1)return window.location.replace(`${F}${M1}/${U}`),"moved";if(G.ok&&Z.local)return{token:typeof Z.token==="string"&&Z.token?Z.token:W2}}return null}function uZ(){let[_,Q]=c.useState(Z8),J=(q)=>()=>{try{if(q==="system")localStorage.removeItem("volter.theme");else localStorage.setItem("volter.theme",q)}catch{}j_(q),Q(q)};return $.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"menu-label",children:"Appearance"},void 0,!1,void 0,this),$.jsxDEV("div",{className:"theme-choice",role:"radiogroup","aria-label":"Appearance",children:["system","light","dark"].map((q)=>$.jsxDEV("button",{type:"button",role:"radio","aria-checked":_===q,onClick:J(q),children:q==="system"?"System":q==="light"?"Light":"Dark"},q,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function hZ(){let[_,Q]=c.useState(kZ()),[J,q]=c.useState(!1),[U,G]=c.useState(!1),[Z,F]=c.useState(""),[X,Y]=c.useState(null),[K,H]=c.useState(null),[L,z]=c.useState(x2());c.useEffect(()=>{let D=()=>z(x2());return window.addEventListener("popstate",D),()=>window.removeEventListener("popstate",D)},[]),c.useEffect(()=>{let[D,y]=x2(),t=e0(D,y),[_1,s]=t?t.split("/"):[],o=J2()[H5];if(!H5||!_||!_1||!s||!o?.made||o.parent!==`${_1}/${s}`||e0(...H5.split("/"))!==H5)return;try{window.history.replaceState(null,"",window.location.pathname+window.location.search)}catch{}v1(_,`/-/${_1}/${s}/branches/${H5}`,{method:"DELETE"}).catch(()=>null).then(()=>a4(H5))},[_]);let W=c.useCallback(async(D)=>{if(H(null),!D){let s=await g_();if(s==="moved")return;if(s){if(q(!0),s.token!==W2)a5(s.token);Q(s.token);return}Y(null),G(!0);return}if(_2&&D===W2){let s=await g_();if(s==="moved")return;if(s)q(!0)}if(_2&&D===s_){let[s,o]=x2(),p=e0(s,o),[e,q1]=p?p.split("/"):[],G1=e&&q1?await p2(`${k1}/-/${e}/${q1}/session`,{method:"POST",headers:{"x-volter-pass":c2.get("pass")??""}}).catch(()=>null):null;if(!G1){H(`${k1} did not answer: no session was opened`),Y(null);return}if(!G1.ok){H(`${await L0(G1)}. Open it again from the platform.`),Y(null);return}o_((await G1.json().catch(()=>({}))).issuer),Q(W2);return}if(_2&&D!==W2){let[s,o]=x2(),p=e0(s,o),[e,q1]=p?p.split("/"):[],G1=e&&q1?await p2(`${k1}/-/${e}/${q1}/session`,{method:"POST",headers:{"x-volter-token":D}}).catch(()=>null):null;if(!G1){H(`${k1} did not answer: no session was opened`),Y(null);return}if(!G1.ok){let U1=await L0(G1);H(G1.status===401||G1.status===403?`That token does not open ${e}/${q1}.`:G1.status===409?`${e}/${q1}'s session lives at another origin: ${U1}`:`The World could not open a session (${G1.status}): ${U1}`),Y(null);return}Q(W2);return}let y=_2?new Response(null,{status:404}):await v1(D,"/-/worlds");if(y.ok){let{worlds:s}=await y.json();Y({kind:"admin",worlds:s});return}if(y.status===429){H("You are asking faster than the platform allows — wait a moment and reload."),Y(null);return}if(y.status>=500){let s=await y.json().catch(()=>({}));H(`The platform could not list your worlds${s.error?`: ${s.error}`:""}. Reload; if it stays, the status page says what is wrong.`),Y(null);return}let t=a_;if(t.length===0){let s=await p2(`${k1}/-/ping`);if(!s.ok){H(`${k1} does not answer as a host`),Y(null);return}if(t=(await s.json()).worlds??[],t.length===0){H(`${k1} does not list its Worlds: open a World at its own address, ${k1}${M1}/<org>/<world>`),Y(null);return}}let _1=[];for(let s of t){let o=await v1(D,`/-/${s}/twins`);if(o.ok){let p=await o.json();_1.push({name:s,base:`${Q2}/${s}`,twins:(p.twins??[]).map((e)=>({vendor:e.twin,protocol:e.protocol??null,root:e.root??null}))})}}if(_1.length===0){H("This link or key opens no World here: it was revoked, or it has ended."),Y(null);return}Y({kind:"world",worlds:_1})},[]);c.useEffect(()=>{W(_)},[_,W]);let w=(D)=>X?.kind==="admin"?X.worlds.find((y)=>y.name===D)?.token??_:_,[R,A]=c.useState("");if(!_||!X&&!K)return $.jsxDEV("main",{className:"app gate",children:$.jsxDEV("div",{className:"gate-window",children:[$.jsxDEV(d5,{href:`${M1}/`},void 0,!1,void 0,this),_&&!X&&!K||!_&&!U?$.jsxDEV("p",{className:"mode",children:"Opening…"},void 0,!1,void 0,this):$.jsxDEV("form",{onSubmit:(D)=>{D.preventDefault(),a5(Z.trim()),Q(Z.trim())},className:"stack",children:[$.jsxDEV("h2",{children:"Open a World"},void 0,!1,void 0,this),$.jsxDEV("p",{className:"mode",children:"A World's token opens that World. A host's admin token opens every World it serves."},void 0,!1,void 0,this),$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"Token"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"token",type:"password",value:Z,onChange:(D)=>F(D.target.value),autoFocus:!0,autoComplete:"off"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"submit",className:"primary",children:"Open"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this);let O=()=>H("This link or key opens no World here: it was revoked, or it has ended."),B=()=>{if(J){window.location.reload();return}if(_2){let[D,y]=x2(),t=e0(D,y),[_1,s]=t?t.split("/"):[],o=()=>window.location.replace(Z0()?`${Z0()}/`:`${k1}${M1}/${_1&&s?`${_1}/${s}`:""}?signin`);if(setTimeout(o,2000),_1&&s)p2(`${k1}/-/${_1}/${s}/session/end`,{method:"POST"}).catch(()=>null).then(o);else o();return}if(X)for(let D of X.worlds)navigator.sendBeacon(`${D.base.replace(/\/[^/]+\/[^/]+$/,"")}/-/${D.name}/session/end`);a5(""),Q(""),F(""),Y(null),j1([])};if(K||!X)return $.jsxDEV("main",{className:"app gate",children:$.jsxDEV("div",{className:"gate-window",children:[$.jsxDEV(d5,{href:`${M1}/`},void 0,!1,void 0,this),$.jsxDEV("h2",{children:"Could not open it"},void 0,!1,void 0,this),$.jsxDEV("p",{role:"alert",children:K??"nothing answered"},void 0,!1,void 0,this),Z0()?$.jsxDEV("a",{className:"button primary",href:`${Z0()}/`,children:["Back to ",new URL(Z0()).host]},void 0,!0,void 0,this):$.jsxDEV("button",{type:"button",className:"primary",onClick:B,children:J?"Try again":"Use another token"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this);let[M,P,C,f,v,N,k]=L,u=C==="~",i=/^[A-Za-z0-9_-]+$/,l=/^[^\u0000-\u001f\u007f]{1,200}$/,S=u||!C||!i.test(C)?void 0:C,b=v&&i.test(v)?N!==void 0&&f!=="changes"&&f!=="screens"?e0(v,N)||void 0:v:void 0,h=f==="changes"&&v==="changesets"&&N&&i.test(N)?N:f==="screens"&&N&&k&&/^[A-Za-z0-9_.-]+$/.test(N)&&l.test(k)?`${N}:${k}`:void 0,E=e0(M,P),j=E?J2()[E]??null:null,m=(D)=>W8(D)||w(D),I=j?X.kind==="admin"?X.worlds.find((D)=>D.name===j.parent)?.token??null:X.worlds.some((D)=>D.name===j.parent)?_:null:null,V=async(D)=>{let y=B8(D.parentOrigin);if(y&&y!==k1){a4(D.name),window.location.assign(`${y}${M1}/${D.parent}#close=${encodeURIComponent(D.name)}`);return}if(D.made)await v1(w(D.parent),`/-/${D.parent}/branches/${D.name}`,{method:"DELETE"}).catch(()=>null),a4(D.name);j1(D.parent.split("/"))};return $.jsxDEV("main",{className:E?"app workspace":"app home",children:[E?null:$.jsxDEV("header",{children:[E?$.jsxDEV(b_,{},void 0,!1,void 0,this):null,$.jsxDEV(d5,{href:`${y0()&&y0()!==k1?y0():""}${M1}/`,onClick:(D)=>{if(y0()&&y0()!==k1)return;D.preventDefault(),j1([])}},void 0,!1,void 0,this),$.jsxDEV("nav",{"aria-label":"breadcrumb",className:"crumbs",children:[E?$.jsxDEV($.Fragment,{children:[$.jsxDEV("span",{className:"crumb-sep","aria-hidden":"true",children:"/"},void 0,!1,void 0,this),$.jsxDEV("span",{children:E.split("/")[0]},void 0,!1,void 0,this),$.jsxDEV("span",{className:"crumb-sep","aria-hidden":"true",children:"/"},void 0,!1,void 0,this),$.jsxDEV("a",{href:`${M1}/${E}`,className:"crumb-world",onClick:(D)=>{D.preventDefault(),j1(E.split("/"))},children:E.split("/")[1]},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,S?$.jsxDEV("span",{children:[" / ",S]},void 0,!0,void 0,this):null,u&&f==="trace"?$.jsxDEV("span",{children:" / trace"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),Z0()?$.jsxDEV("a",{href:`${Z0()}/${E?encodeURIComponent(E.split("/")[0]):""}`,title:`Back to the platform at ${new URL(Z0()).host}`,className:"back-link",children:["← ",$.jsxDEV("span",{className:"back-text",children:E?`${E.split("/")[0]}'s Worlds`:new URL(Z0()).host},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,E?null:$.jsxDEV("span",{className:"mode",children:J?"on this machine":R?`signed in as ${R}`:X.kind==="admin"?"host: admin":"opened with a link or key"},void 0,!1,void 0,this),E||J?null:$.jsxDEV("button",{onClick:B,children:"Sign out"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),E?$.jsxDEV(xZ,{name:E,token:m(E),twin:S,tab:u?f??"overview":"overview",arg:u?b:void 0,...u&&h?{sub:h}:{},admin:j?null:X.kind==="admin"?_:null,snapshot:j,parentToken:I,who:{local:J,person:R||null,admin:X.kind==="admin"},onSignOut:B,onReturn:V,opens:(D)=>!!J2()[D]||X.kind==="admin"&&X.worlds.some((y)=>y.name===D),onRemoved:()=>{W(_),j1([])},onWho:A,onEnded:O,worlds:X.worlds.map((D)=>D.name)},E,!1,void 0,this):$.jsxDEV(DZ,{mode:X,admin:X.kind==="admin"?_:null,reload:()=>W(_)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function DZ({mode:_,admin:Q,reload:J}){let[q,U]=c.useState(""),[G,Z]=c.useState(""),[F,X]=c.useState(""),[Y,K]=c.useState(null),H=async(f)=>{if(!await m0({title:`Rotate the tokens of ${f}?`,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 v=await v1(Q,`/-/worlds/${f}/rotate`,{method:"POST"}),N=await v.json().catch(()=>({}));K(v.ok?`rotated ${f}: the new tokens are shown once — token ${N.token} · read token ${N.readToken}`:N.error?s1(N.error).text:`answered ${v.status}`),await J()},L=async(f)=>{let v=await v1(Q,`/-/worlds/${f}`,{method:"DELETE"}),N=await v.json().catch(()=>({}));K(v.ok?`removed ${f}`:N.error?s1(N.error).text:`answered ${v.status}`),await J()},[z,W]=c.useState(!1),[w,R]=c.useState(!1),[A,O]=c.useState(""),B=async(f)=>{f.preventDefault(),K(null),W(!0);try{let v=await v1(Q,"/-/worlds",{method:"POST",body:JSON.stringify({org:q,world:G,vendors:F.split(",").map((k)=>k.trim()).filter(Boolean)})}),N=await v.json();if(!v.ok){K(N.error?s1(N.error).text:`the host answered ${v.status}`);return}K(`provisioned ${N.name}`),Z(""),X(""),R(!1),await J()}finally{W(!1)}},M=A.trim().toLowerCase(),P=_.worlds.filter((f)=>!M||f.name.toLowerCase().includes(M)||f.twins.some((v)=>v.vendor.includes(M))),C=[...new Set(P.map((f)=>f.name.split("/")[0]))];return $.jsxDEV("section",{className:"home-window","aria-labelledby":"worlds",children:[$.jsxDEV("div",{className:"home-head",children:[$.jsxDEV("h2",{id:"worlds",children:"Worlds"},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:[x1(_.worlds.length,"World")," ",Q?"this host serves":"this key opens"]},void 0,!0,void 0,this),Q?$.jsxDEV("button",{type:"button",className:"primary",onClick:()=>{K(null),R(!0)},children:[$.jsxDEV(P1,{name:"plus",size:16},void 0,!1,void 0,this),"New World"]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"home-find",children:$.jsxDEV("input",{type:"search",placeholder:"Filter by World or vendor","aria-label":"Filter Worlds",value:A,onChange:(f)=>O(f.target.value)},void 0,!1,void 0,this)},void 0,!1,void 0,this),Y&&!w?$.jsxDEV("p",{role:"status",className:"home-note",children:Y},void 0,!1,void 0,this):null,C.map((f)=>$.jsxDEV(c.default.Fragment,{children:[$.jsxDEV("p",{className:"menu-label home-org",children:f},void 0,!1,void 0,this),$.jsxDEV("ul",{className:"home-list",children:P.filter((v)=>v.name.split("/")[0]===f).map((v)=>$.jsxDEV("li",{children:[$.jsxDEV("a",{href:`${M1}/${v.name}`,onClick:(N)=>{N.preventDefault(),j1(v.name.split("/"))},children:[$.jsxDEV(P1,{name:"globe",size:20},void 0,!1,void 0,this),$.jsxDEV("span",{className:"ws-row-text",children:[$.jsxDEV("b",{children:v.name.split("/")[1]},void 0,!1,void 0,this),$.jsxDEV("small",{children:$.jsxDEV("code",{children:v.base},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("span",{className:"home-vendors",children:v.twins.map((N)=>$.jsxDEV("span",{title:B1(N.vendor),children:$.jsxDEV(r1,{vendor:N.vendor},void 0,!1,void 0,this)},N.vendor,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Q?$.jsxDEV("details",{className:"menu home-more",children:[$.jsxDEV("summary",{"aria-label":`More for ${v.name}`,children:"⋯"},void 0,!1,void 0,this),$.jsxDEV("div",{className:"popover menu-list",children:[$.jsxDEV("button",{type:"button",onClick:(N)=>{N.currentTarget.closest("details")?.removeAttribute("open"),H(v.name)},children:"Rotate tokens…"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",className:"danger-item",onClick:(N)=>{N.currentTarget.closest("details")?.removeAttribute("open"),m0({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)L(v.name)})},children:"Remove World…"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null]},v.name,!0,void 0,this))},void 0,!1,void 0,this)]},f,!0,void 0,this)),P.length===0?$.jsxDEV("p",{className:"mode home-note",children:M?`No World matches ${A}.`:"No Worlds here yet."},void 0,!1,void 0,this):null,$.jsxDEV(M0,{open:w,onClose:()=>{if(!z)R(!1)},title:"New World",footer:$.jsxDEV($.Fragment,{children:[$.jsxDEV("button",{type:"button",onClick:()=>R(!1),disabled:z,children:"Cancel"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"submit",form:"provision",className:"primary",disabled:z,children:z?"Making… (ten seconds or so)":"Make World"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:$.jsxDEV("form",{id:"provision",onSubmit:B,className:"stack",children:[$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"Org"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"org",value:q,onChange:(f)=>U(f.target.value),required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"World"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"world",value:G,onChange:(f)=>Z(f.target.value),required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"Vendors"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"vendors",value:F,onChange:(f)=>X(f.target.value),placeholder:"stripe, slack",required:!0},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:"A twin of each, with its default data."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y?$.jsxDEV("p",{role:"status",children:Y},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)}var bZ=["changes","events","trace","vendors","screens","canvas","branches","settings","remote","vault"],EZ=(_,Q)=>{let J=Q?.screens?.find((q)=>q.path.replace(/\/+$/,"")==="")??Q?.screens?.find((q)=>!/[{<]/.test(q.path));return Q&&J?`${Q2}/${_}/${Q.twin}${J.path.startsWith("/")?J.path:`/${J.path}`}`:null},p_={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 P0(_){let Q=_.operation??_.op,J=(Q.includes(".")?Q.slice(Q.lastIndexOf(".")+1):Q).toLowerCase(),q=_.subject.type.replace(/[_-]+/g," ").trim(),U=`${q.charAt(0).toUpperCase()}${q.slice(1)}`,G=/(^|\.)twin\./.test(Q)||/^seed_/.test(J),Z=Q.replace(/[._]+/g," ").trim(),F=G?`${U} seeded`:p_[J]?`${U} ${p_[J]}`:`${Z.charAt(0).toUpperCase()}${Z.slice(1)}`,X=_.fields??{},Y=["title","name","email","text","subject","summary","description"].map((H)=>X[H]).find((H)=>typeof H==="string"&&H.trim()!=="")??null,K=Y===null?null:Y.replace(/<([@#!])[^|>]*\|([^>]+)>/g,(H,L,z)=>`${L==="!"?"@":L}${z}`).replace(/<(?:https?:[^|>]+)\|([^>]+)>/g,"$1").replace(/<(https?:[^>]+)>/g,"$1");return{what:F,label:K===null?null:K.length>80?`${K.slice(0,79)}…`:K}}var $2=(_)=>/token|password|secret|key|credential/i.test(_.subject.type)&&_.subject.id.length>6?`••••${_.subject.id.slice(-4)}`:_.subject.id;function xZ({name:_,token:Q,twin:J,tab:q,arg:U,sub:G,admin:Z,snapshot:F,parentToken:X,who:Y,onSignOut:K,onReturn:H,opens:L,onRemoved:z,onWho:W,onEnded:w,worlds:R=[]}){let[A,O]=c.useState("pending"),[B,M]=c.useState(null),[P,C]=c.useState(0),[f,v]=c.useState(null);c.useEffect(()=>{let p=!0;return M(null),v1(Q,`/-/${_}/session`,{method:"POST"}).then(async(e)=>{let q1=await e.json().catch(()=>({}));if(o_(q1.issuer),q1.who)W?.(q1.who);v(typeof q1.signsAs==="string"?q1.signsAs:null);let G1=o5(q1.origin)?.origin;if(e.status===409&&G1&&G1!==k1){A8(G1,Q,_);return}if(!p)return;if(O(!e.ok?"unknown":q1.scope==="read"?"read":q1.scope==="write"?"write":"unknown"),!e.ok)M(q1.error?s1(q1.error).text:`answered ${e.status}`)}).catch((e)=>{if(p)O("unknown"),M(`the World did not answer: ${e instanceof Error?e.message:String(e)}`)}),()=>{p=!1}},[_,Q,P]);let N=B?{state:"error",error:B}:A==="pending"?{state:"pending"}:{state:"ok",scope:A},k=A==="write",u=(p)=>{if(p.status!==403)return;p.clone().json().then((e)=>{if(/read token|opens only reads|write access|reads only/i.test(e?.error??""))O("read")},()=>null)},[i,l]=c.useState(0);c.useEffect(()=>{let p=setInterval(()=>{if(!document.hidden)l((e)=>e+1)},5000);return()=>clearInterval(p)},[]);let[S,b]=c.useState(0),h=h1(Q,`/-/${_}/clock`,i+S);c.useEffect(()=>{if(_2&&!F&&h.state==="error"&&h.status===401)w?.()},[h,F,w]);let E=h1(Q,`/-/${_}/twins`),j=h1(Q,`/-/${_}/branches`,S),m=h1(Q,`/-/${_}/map`,Math.floor(i/2)),I=!(j.state==="error"&&(j.status===404||j.status===405)),V=bZ.includes(q)?q:"overview",D=E.state==="ok"?E.data.twins.map((p)=>p.twin):[];if(J&&E.state==="ok"&&!D.includes(J))return $.jsxDEV("main",{className:"center",children:$.jsxDEV(F5,{title:`${_} has no ${J}`,action:$.jsxDEV("a",{href:`${M1}/${_}`,onClick:(p)=>{p.preventDefault(),j1(_.split("/"))},children:["Open ",_]},void 0,!0,void 0,this),children:$.jsxDEV("p",{children:["No vendor of this World is called ",J,". Its changesets are under Changes › History."]},void 0,!0,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this);let y=V==="vendors"&&U?U:void 0,t=()=>{O("pending"),C((p)=>p+1)};if(V==="canvas"||V==="vendors"&&!y||q==="screens"&&!U)return $.jsxDEV(LF,{name:_,token:Q,twins:E,session:N,retry:t,snapshot:F,back:()=>j1(_.split("/")),canWrite:k&&!F},void 0,!1,void 0,this);let s=q==="settings"?{kind:"settings",tab:((p)=>qQ.find(([e])=>e===p)?.[0]??"account")(U)}:q==="remote"?{kind:"settings",tab:"remote"}:q==="vault"?{kind:"settings",tab:"vault"}:q==="branches"?{kind:"branches",...U?{open:U}:{}}:null,o=J?"vendor":q==="screens"&&U?"screen":V==="vendors"&&y?"vendor":q==="trace"?"trace":q==="events"?"events":q==="changes"&&U==="changesets"?"history":"changes";return $.jsxDEV(sZ,{name:_,token:Q,view:o,win:s,who:Y,snapshot:F,onReturn:H,onSignOut:K,worlds:R,session:N,retry:t,...o==="vendor"?{arg:J??y}:o==="events"||o==="trace"||o==="screen"?U?{arg:U}:{}:{},...G?{sub:G}:{},twins:E,map:m,branches:I?j:null,clock:h,canWrite:k&&!F,refused:u,signsAs:f,opens:L,tick:i,admin:Z,onRemoved:z,onClock:()=>b((p)=>p+1),scope:F?"read":A},void 0,!1,void 0,this)}function P1({name:_,size:Q=20}){return $.jsxDEV("svg",{className:"icon",viewBox:"0 0 24 24",width:Q,height:Q,fill:"none",stroke:"currentColor",strokeWidth:Q<=16?1.75:1.5,strokeLinecap:"square",strokeLinejoin:"miter","aria-hidden":"true",children:(E_[_]??[]).map(([J,q],U)=>c.default.createElement(J,{key:U,...q}))},void 0,!1,void 0,this)}function o4(_){let Q=(J)=>{let q=(J.operation??J.op).toLowerCase();return q.includes(".")?q.slice(q.lastIndexOf(".")+1):q};if(_.some((J)=>/^(delete|remove|archive|revoke)/.test(Q(J))||J.fields?.deleted===!0))return{icon:"square-minus",word:"removed",tone:"removed"};if(/^(create|add|insert|issue|send|post|upload|invite|record|seed)/.test(Q(_[0])))return{icon:"square-plus",word:"made",tone:"added"};return{icon:"square-dot",word:"changed",tone:"changed"}}var qQ=[["account","Account","user"],["changesets","Changesets","git-commit-horizontal"],["remote","Remote","cloud"],["access","Access","key-round"],["services","Real services","plug"],["vault","Vault","vault"],["checks","Checks","list-checks"],["clock","Clock","clock"],["appearance","Appearance","palette"]],mZ=(_,Q)=>{let J=Q.split("/").pop()??Q,q=_.split("/").pop()??"";return J.startsWith(`${q}-`)?J.slice(q.length+1):J},m2=(_)=>_.replace(/^_+/,"").replace(/[_-]+/g," ");function UQ({record:_,history:Q}){let J=_.writes[_.writes.length-1],q=P0(J),U=o4(_.writes),G=new Set(_.writes.map((H)=>H.id)),Z=_.writes[0].occurredAt,F={};if(Q){for(let H of Q)if(!G.has(H.id)&&!H.landsId&&!H.aliasOf&&H.subject.type===J.subject.type&&H.subject.id===J.subject.id&&H.occurredAt<=Z)Object.assign(F,H.fields??{})}let X={...F};for(let H of _.writes)Object.assign(X,H.fields??{});let Y=U.tone==="added"&&Object.keys(F).length===0,K=[...new Set([...Object.keys(F),...Object.keys(X)])].filter((H)=>!MQ(F[H],X[H]));return $.jsxDEV("div",{className:"ws-diff","aria-label":`${q.label??$2(J)}: its changes`,children:[$.jsxDEV("div",{className:"ws-diff-head",children:[$.jsxDEV("span",{className:`ws-kind ${U.tone}`,title:U.word,children:$.jsxDEV(P1,{name:U.icon,size:16},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV(r1,{vendor:_.twin},void 0,!1,void 0,this),$.jsxDEV("div",{className:"cell-label",children:[$.jsxDEV("b",{children:q.label??$2(J)},void 0,!1,void 0,this),$.jsxDEV("small",{children:[B1(_.twin)," · ",J.subject.type.replace(/^_+/,"").replace(/[_-]+/g," ")," ",$.jsxDEV("code",{children:$2(J)},void 0,!1,void 0,this)," · ",U.word," here"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("ol",{className:"ws-writes",children:_.writes.map((H)=>$.jsxDEV("li",{children:[$.jsxDEV("b",{children:P0(H).what},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:[$.jsxDEV(V1,{iso:H.occurredAt},void 0,!1,void 0,this)," · ",s5(H)]},void 0,!0,void 0,this)]},H.id,!0,void 0,this))},void 0,!1,void 0,this),Q===null?$.jsxDEV("p",{className:"mode pad",children:"Reading its history…"},void 0,!1,void 0,this):K.length===0?$.jsxDEV("p",{className:"mode pad",children:"No field holds a new value."},void 0,!1,void 0,this):$.jsxDEV("table",{className:"ws-fields","aria-label":"Fields before and after",children:[$.jsxDEV("thead",{children:$.jsxDEV("tr",{children:[$.jsxDEV("th",{children:"Field"},void 0,!1,void 0,this),Y?null:$.jsxDEV("th",{children:"Before"},void 0,!1,void 0,this),$.jsxDEV("th",{children:U.tone==="removed"?"After":"Now"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("tbody",{children:K.map((H)=>$.jsxDEV("tr",{children:[$.jsxDEV("th",{scope:"row",children:$.jsxDEV("code",{children:H},void 0,!1,void 0,this)},void 0,!1,void 0,this),Y?null:$.jsxDEV("td",{className:H in F?"was":"none",children:H in F?$.jsxDEV(q2,{v:F[H]},void 0,!1,void 0,this):$.jsxDEV("span",{className:"mode",children:"—"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{className:H in X?"now":"none",children:H in X?$.jsxDEV(q2,{v:X[H]},void 0,!1,void 0,this):$.jsxDEV("span",{className:"mode",children:"—"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},H,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function GQ({records:_,selected:Q,onPick:J,label:q}){let[U,G]=c.useState(()=>{try{return localStorage.getItem("volter.console.records")==="tree"}catch{return!1}}),Z=(Y)=>{G(Y);try{localStorage.setItem("volter.console.records",Y?"tree":"path")}catch{}},F=(Y,K)=>{let H=Y.writes[Y.writes.length-1],L=P0(H),z=o4(Y.writes);return $.jsxDEV("li",{children:$.jsxDEV("button",{type:"button",className:[Q===Y.key?"on":"",K?"nested":""].join(" ").trim()||void 0,"aria-pressed":Q===Y.key,onClick:()=>J(Y.key),children:[K?null:$.jsxDEV(r1,{vendor:Y.twin},void 0,!1,void 0,this),$.jsxDEV("span",{className:"ws-row-text",children:[$.jsxDEV("b",{children:L.label??$2(H)},void 0,!1,void 0,this),$.jsxDEV("small",{children:[m2(H.subject.type)," · ",L.what.split(" ").slice(-1)[0],Y.writes.length>1?` · ${x1(Y.writes.length,"write")}`:""]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("span",{className:`ws-kind ${z.tone}`,title:z.word,"aria-label":z.word,children:$.jsxDEV(P1,{name:z.icon,size:16},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},Y.key,!1,void 0,this)},X=[...new Set(_.map((Y)=>Y.twin))];return $.jsxDEV($.Fragment,{children:[$.jsxDEV("div",{className:"ws-view-switch",role:"group","aria-label":"List the records by",children:[$.jsxDEV("button",{type:"button","aria-pressed":!U,className:U?void 0:"on",onClick:()=>Z(!1),children:"Path"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button","aria-pressed":U,className:U?"on":void 0,onClick:()=>Z(!0),children:"Tree"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("ul",{className:"ws-list","aria-label":q,children:U?X.map((Y)=>{let K=_.filter((H)=>H.twin===Y);return $.jsxDEV("li",{className:"ws-group",children:[$.jsxDEV("p",{className:"ws-group-head",children:[$.jsxDEV(r1,{vendor:Y},void 0,!1,void 0,this),$.jsxDEV("b",{children:B1(Y)},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:K.length},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("ul",{children:K.map((H)=>F(H,!0))},void 0,!1,void 0,this)]},Y,!0,void 0,this)}):_.map((Y)=>F(Y,!1))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function gZ({name:_,token:Q,branches:J,opens:q,refused:U,onChanged:G}){let[Z,F]=c.useState(""),[X,Y]=c.useState(!1),K=J?.state==="ok"&&J.data.checkedOut||_.split("/")[1],H=J?.state==="ok"&&J.data.named?.length?J.data.named:[{name:K,running:!0}],L=J?.state==="ok"?J.data.branches:[],z=Z.trim().toLowerCase(),W=(R)=>!z||R.toLowerCase().includes(z),w=(R)=>{R.currentTarget.closest("details")?.removeAttribute("open")};return $.jsxDEV("details",{className:"menu ws-pick",children:[$.jsxDEV("summary",{title:"The branch served here",children:[$.jsxDEV(P1,{name:"git-branch",size:16},void 0,!1,void 0,this),$.jsxDEV("span",{className:"ws-pick-label",children:[$.jsxDEV("small",{children:"Branch"},void 0,!1,void 0,this),$.jsxDEV("b",{children:K},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(P1,{name:"chevron-down",size:16},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"popover ws-branch-menu",children:[$.jsxDEV("div",{className:"ws-branch-find",children:[$.jsxDEV("input",{type:"search",placeholder:"Filter","aria-label":"Filter branches",value:Z,onChange:(R)=>F(R.target.value)},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",onClick:(R)=>{w(R),Y(!0)},disabled:!J,children:"New branch"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("p",{className:"menu-label",children:"This World"},void 0,!1,void 0,this),$.jsxDEV("ul",{className:"ws-branch-list",children:H.filter((R)=>W(R.name)).map((R)=>$.jsxDEV("li",{className:R.name===K?"current":void 0,children:[$.jsxDEV("span",{className:"tick",children:R.name===K?$.jsxDEV(P1,{name:"check",size:16},void 0,!1,void 0,this):$.jsxDEV(P1,{name:"git-branch",size:16},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("span",{className:"name",children:R.name},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:R.name===K?"served here":R.running?"running":"stopped"},void 0,!1,void 0,this)]},R.name,!0,void 0,this))},void 0,!1,void 0,this),$.jsxDEV("p",{className:"menu-label",children:"Branches of it"},void 0,!1,void 0,this),L.length===0?$.jsxDEV("p",{className:"mode ws-branch-none",children:"None yet. New branch makes one, from now or as the World was."},void 0,!1,void 0,this):$.jsxDEV("ul",{className:"ws-branch-list",children:L.filter((R)=>W(R.name)).map((R)=>{let A=$.jsxDEV($.Fragment,{children:[$.jsxDEV("span",{className:"tick",children:$.jsxDEV(P1,{name:"git-branch",size:16},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("span",{className:"name",children:mZ(_,R.name)},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:R.at?.instant?$.jsxDEV($.Fragment,{children:["as of ",$.jsxDEV(V1,{iso:R.at.instant,time:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this):"live"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),O=R.expiresAt?`Goes away ${new Date(R.expiresAt).toLocaleString()}`:"Kept";return $.jsxDEV("li",{children:q(R.name)?$.jsxDEV("a",{href:`${M1}/${R.name}`,title:O,onClick:(B)=>{B.preventDefault(),w(B),$Q(R.name,R.name.split("/"))},children:A},void 0,!1,void 0,this):$.jsxDEV("span",{title:`${O}. Its tokens went to whoever made it; it opens from their page.`,children:A},void 0,!1,void 0,this)},R.name,!1,void 0,this)})},void 0,!1,void 0,this),$.jsxDEV("div",{className:"ws-branch-foot",children:$.jsxDEV("a",{href:`${M1}/${_}/~/branches`,onClick:(R)=>{R.preventDefault(),w(R),j1([..._.split("/"),"~","branches"])},children:"Manage branches…"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(HQ,{name:_,token:Q,open:X,onClose:()=>Y(!1),onMade:G,refused:U},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function ZQ({name:_,view:Q,changes:J,changesets:q}){let U=(G)=>(Z)=>{Z.preventDefault(),j1([..._.split("/"),"~",...G])};return $.jsxDEV("nav",{className:"tabs ws-pane-tabs","aria-label":"Changes and history",children:[$.jsxDEV("a",{href:`${M1}/${_}/~/changes`,className:Q==="changes"?"on":void 0,"aria-current":Q==="changes"?"page":void 0,onClick:U(["changes"]),children:["Changes",J?$.jsxDEV("span",{className:"count",children:J},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("a",{href:`${M1}/${_}/~/changes/changesets`,className:Q==="history"?"on":void 0,"aria-current":Q==="history"?"page":void 0,onClick:U(["changes","changesets"]),children:["History",q?$.jsxDEV("span",{className:"count",children:q},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function pZ({name:_,token:Q,sets:J,sub:q,signsAs:U,canWrite:G,rooted:Z,refused:F,onChanged:X,changes:Y,withScreens:K,required:H}){let[L,z]=c.useState(null),[W,w]=c.useState(!1),R=J.state==="ok"?[...J.data.changesets].sort((v,N)=>N.createdAt.localeCompare(v.createdAt)):[],A=R.find((v)=>v.name===q)??R[0],O=c.useMemo(()=>{let v=new Map;for(let N of A?BQ(A):[]){let k=`${N.twin}:${N.entry.subject.type}:${N.entry.subject.id}`,u=v.get(k)??{key:k,twin:N.twin,writes:[]};u.writes.push(N.entry),v.set(k,u)}return[...v.values()]},[A]),B=O.find((v)=>v.key===L)??O[0],M=h1(Q,B?`/-/${_}/log/${B.twin}`:null),P={added:0,removed:0,changed:0};for(let v of O)P[o4(v.writes).tone]=(P[o4(v.writes).tone]??0)+1;let C=A?n4(A):null,f=A?AQ(A,H):null;return $.jsxDEV("div",{className:"ws-two",children:[$.jsxDEV("div",{className:"ws-files",children:[$.jsxDEV(ZQ,{name:_,view:"history",changes:Y,changesets:R.length},void 0,!1,void 0,this),$.jsxDEV(G0,{load:J,what:"the changesets",lines:4},void 0,!1,void 0,this),$.jsxDEV("ul",{className:"ws-list ws-commits","aria-label":"Changesets",children:R.map((v)=>{let N=A?.name===v.name,k=n4(v).label==="Not sent";return $.jsxDEV("li",{children:$.jsxDEV("a",{href:`${M1}/${_}/~/changes/changesets/${v.name}`,className:N?"on":void 0,"aria-current":N?"true":void 0,onClick:(u)=>{u.preventDefault(),z(null),j1([..._.split("/"),"~","changes","changesets",v.name])},children:[$.jsxDEV("span",{className:"ws-row-text",children:[$.jsxDEV("b",{children:K8(v)},void 0,!1,void 0,this),$.jsxDEV("small",{children:[v.owner??(v.cutBy?s4(v.cutBy):"unrecorded")," • ",$.jsxDEV(V1,{iso:v.createdAt},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),k?$.jsxDEV("span",{className:"ws-unpushed",title:"Not pushed to the remote yet",children:$.jsxDEV(P1,{name:"arrow-up-from-line",size:16},void 0,!1,void 0,this)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},v.name,!1,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-pane-right",children:[J.state==="ok"&&!A?$.jsxDEV(F5,{title:"No changesets yet",children:$.jsxDEV("p",{children:"Cut one from Changes: the cut box is at its foot."},void 0,!1,void 0,this)},void 0,!1,void 0,this):null,A&&C&&f?$.jsxDEV($.Fragment,{children:[$.jsxDEV("div",{className:"ws-commit-head",children:[$.jsxDEV("div",{className:"ws-commit-title",children:[$.jsxDEV("h3",{children:K8(A)},void 0,!1,void 0,this),$.jsxDEV("p",{className:"ws-commit-stat",children:[$.jsxDEV(P1,{name:"file-diff",size:16},void 0,!1,void 0,this)," ",x1(O.length,"changed record"),P.added?$.jsxDEV("span",{className:"plus",children:[" +",P.added]},void 0,!0,void 0,this):null,P.removed?$.jsxDEV("span",{className:"minus",children:[" −",P.removed]},void 0,!0,void 0,this):null,P.changed?$.jsxDEV("span",{className:"dot",children:[" •",P.changed]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("p",{className:"mode ws-commit-meta",children:[$.jsxDEV("code",{children:A.name},void 0,!1,void 0,this)," · ",$.jsxDEV(V1,{iso:A.createdAt},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("p",{className:"ws-commit-who",children:[["Owner",A.owner??(A.cutBy&&/^(token|token:read)$|^key:(?!.* for:)/.test(A.cutBy)?"no person: a service’s":"unrecorded")],["Cut by",A.cutBy?A.pushedBy&&A.applied===null&&A.cutBy==="machine"?"the machine it was cut on":s4(A.cutBy):"unrecorded"],...A.pushedBy?[["Pushed by",s4(A.pushedBy)]]:[]].map(([v,N])=>$.jsxDEV("span",{children:[$.jsxDEV("span",{className:"mode",children:v},void 0,!1,void 0,this)," ",N]},v,!0,void 0,this))},void 0,!1,void 0,this),A.pushedBy?$.jsxDEV("p",{className:"mode ws-commit-meta",children:A.applied===null?"Owner and cut by are as the World it was cut in recorded them; pushed by is this World's own record.":"Owner and cut by are this World’s record; pushed by is as the remote recorded it."},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"button",onClick:()=>w(!0),title:"Where it went, the checks, the approvals; Verify, Approve and Deploy",children:[$.jsxDEV("span",{className:`badge cs-${C.tone}`,children:C.label},void 0,!1,void 0,this),$.jsxDEV("span",{className:`badge cs-${f.tone}`,children:f.label},void 0,!1,void 0,this),"Review…"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-two inner",children:[$.jsxDEV("div",{className:"ws-files",children:$.jsxDEV(GQ,{records:O,...B?{selected:B.key}:{},onPick:z,label:"Records it changed"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("div",{className:"ws-detail",children:B?$.jsxDEV(UQ,{record:B,history:M.state==="ok"?M.data.entries:M.state==="error"?[]:null},void 0,!1,void 0,this):$.jsxDEV("p",{className:"mode pad",children:"It changes nothing."},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(M0,{open:W,onClose:()=>w(!1),title:`Review: ${K8(A)}`,wide:!0,children:[$.jsxDEV(d_,{name:_,token:Q,signsAs:U,c:A,canWrite:G,rooted:Z,refused:F,onChanged:X,part:"head",required:H},`h:${A.name}`,!1,void 0,this),$.jsxDEV(d_,{name:_,token:Q,signsAs:U,c:A,canWrite:G,rooted:Z,refused:F,onChanged:X,part:"review",required:H},`r:${A.name}`,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function cZ({name:_,token:Q,vendors:J,vendor:q,tick:U}){let[G,Z]=c.useState(c_*4),[F,X]=c.useState(""),[Y,K]=c.useState(null),H=h1(Q,`/-/${_}/timeline?limit=${G}${q?`&twin=${encodeURIComponent(q)}`:""}`,Math.floor(U/2)),L=H.state==="ok"?ZF(H.data.entries):[],z=[...new Set(L.map((P)=>P0(P.entry).what))].sort(),W=L.filter((P)=>!F||P0(P.entry).what===F),w=W.find((P)=>X5(P)===Y)??W[0],R=(P)=>(C)=>{C.preventDefault(),K(null),j1([..._.split("/"),"~","events",...P?[P]:[]])},A=w?.entry.input&&typeof w.entry.input==="object"?w.entry.input.body:void 0,O=w?jZ(w.entry.traceparent):null,B=w?l_(w):null,M=w?$F(w.entry):[];return $.jsxDEV("div",{className:"ws-events",children:[$.jsxDEV("div",{className:"ws-filterbar",children:[$.jsxDEV("nav",{className:"ws-seg","aria-label":"Vendor",children:[$.jsxDEV("a",{href:`${M1}/${_}/~/events`,className:!q?"on":void 0,"aria-current":!q?"page":void 0,onClick:R(),children:"All"},void 0,!1,void 0,this),J.map((P)=>$.jsxDEV("a",{href:`${M1}/${_}/~/events/${P}`,className:q===P?"on":void 0,"aria-current":q===P?"page":void 0,onClick:R(P),children:[$.jsxDEV(r1,{vendor:P},void 0,!1,void 0,this),B1(P)]},P,!0,void 0,this))]},void 0,!0,void 0,this),$.jsxDEV("select",{"aria-label":"Operation",value:F,onChange:(P)=>{X(P.target.value),K(null)},children:[$.jsxDEV("option",{value:"",children:"Every operation"},void 0,!1,void 0,this),z.map((P)=>$.jsxDEV("option",{value:P,children:P},P,!1,void 0,this))]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-grid-wrap",children:[$.jsxDEV(G0,{load:H,what:"the events",lines:6},void 0,!1,void 0,this),$.jsxDEV("table",{className:"ws-grid","aria-label":"Events",children:[$.jsxDEV("thead",{children:$.jsxDEV("tr",{children:[$.jsxDEV("th",{children:"Time"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Vendor"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"What"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Record"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"By"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Receipt"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("tbody",{children:W.map((P)=>{let C=P0(P.entry),f=l_(P),v=w&&X5(P)===X5(w);return $.jsxDEV("tr",{className:v?"on":void 0,"aria-selected":v,onClick:()=>K(X5(P)),children:[$.jsxDEV("td",{className:"mono",children:$.jsxDEV(V1,{iso:P.entry.occurredAt,time:!0},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:$.jsxDEV("span",{className:"vendor-cell",children:[$.jsxDEV(r1,{vendor:P.twin},void 0,!1,void 0,this),B1(P.twin)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:$.jsxDEV("b",{children:C.what},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{className:"ws-cell-clip",children:C.label?`“${C.label}”`:$.jsxDEV("code",{children:$2(P.entry)},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{className:"mode",children:s5(P.entry,P.caller)},void 0,!1,void 0,this),$.jsxDEV("td",{children:f?$.jsxDEV("span",{className:f.bad?"badge cs-bad":f.status==="deployed"?"badge cs-done":"badge",children:f.status},void 0,!1,void 0,this):$.jsxDEV("span",{className:"mode",children:e_(P.entry)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},X5(P),!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-event-detail",children:w?$.jsxDEV($.Fragment,{children:[$.jsxDEV("div",{className:"ws-event-line",children:[$.jsxDEV("span",{className:"badge",children:KQ(w.entry)},void 0,!1,void 0,this),B?$.jsxDEV("span",{className:B.bad?"badge cs-bad":"badge cs-good",children:B.status},void 0,!1,void 0,this):null,$.jsxDEV("code",{children:[w.entry.subject.type,":",$2(w.entry)]},void 0,!0,void 0,this),$.jsxDEV("span",{className:"mode",children:[$.jsxDEV(V1,{iso:w.entry.occurredAt},void 0,!1,void 0,this)," · ",s5(w.entry,w.caller)]},void 0,!0,void 0,this),O?$.jsxDEV("a",{href:`${M1}/${_}/~/trace/${O.trace}`,onClick:(P)=>{P.preventDefault(),j1([..._.split("/"),"~","trace",O.trace])},children:"Its trace →"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-event-panes",children:[$.jsxDEV("div",{role:"region","aria-label":"The request",children:[$.jsxDEV("h4",{children:"Request"},void 0,!1,void 0,this),A!==void 0?$.jsxDEV(UF,{body:A},void 0,!1,void 0,this):$.jsxDEV("p",{className:"mode",children:"No request body: the World or the vendor wrote it."},void 0,!1,void 0,this),M.length?$.jsxDEV($.Fragment,{children:[$.jsxDEV("h4",{children:"Usage"},void 0,!1,void 0,this),$.jsxDEV("dl",{className:"fields",children:M.map(([P,C])=>$.jsxDEV(c.default.Fragment,{children:[$.jsxDEV("dt",{children:P},void 0,!1,void 0,this),$.jsxDEV("dd",{children:C},void 0,!1,void 0,this)]},P,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("div",{role:"region","aria-label":"What it wrote",children:[$.jsxDEV("h4",{children:"Written"},void 0,!1,void 0,this),$.jsxDEV(LQ,{fields:w.entry.fields},void 0,!1,void 0,this),$.jsxDEV("h4",{children:w.copies.length?"Receipts":"Receipt"},void 0,!1,void 0,this),$.jsxDEV("p",{className:"mode",children:w.copies.length?w.copies.map((P)=>P.entry.receipt?.status??"landed copy").join(" · "):GF(w.entry)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):$.jsxDEV("p",{className:"mode pad",children:"Nothing written here yet."},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("div",{className:"ws-foot mode",children:[$.jsxDEV("span",{children:[w?`${W.indexOf(w)+1} of ${W.length}`:W.length," events",q?` at ${B1(q)}`:""]},void 0,!0,void 0,this),H.state==="ok"&&H.data.next?$.jsxDEV("button",{type:"button",onClick:()=>Z((P)=>P+c_*4),children:"Load older"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function lZ({name:_,token:Q,id:J}){let q=/^[0-9a-f]{32}$/.test(J),U=h1(Q,q?`/-/${_}/timeline?trace=${J}&limit=500`:null),G=U.state==="ok"?[...U.data.entries].sort((H,L)=>-XQ(H,L)):[],[Z,F]=c.useState(null),X=G[0]?Date.parse(G[0].entry.occurredAt):0,Y=G.length?Math.max(1,Date.parse(G[G.length-1].entry.occurredAt)-X):1,K=[...new Set(G.map((H)=>H.twin))];return $.jsxDEV("div",{className:"ws-sheet ws-trace",children:[$.jsxDEV("p",{className:"crumbs-line",children:$.jsxDEV("a",{href:`${M1}/${_}/~/events`,onClick:(H)=>{H.preventDefault(),j1([..._.split("/"),"~","events"])},children:[$.jsxDEV(P1,{name:"arrow-left",size:16},void 0,!1,void 0,this)," Events"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("h2",{children:[G[0]?`${P0(G[0].entry).what} …`:"Trace"," ",$.jsxDEV("code",{className:"mode",children:J.slice(0,12)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),!q?$.jsxDEV("p",{role:"alert",children:[J?`${J} is not a trace id`:"No trace named",": a W3C trace id is 32 hex characters."]},void 0,!0,void 0,this):$.jsxDEV(G0,{load:U,what:"the trace"},void 0,!1,void 0,this),G.length?$.jsxDEV("p",{className:"ws-trace-meta",children:["Started ",$.jsxDEV("b",{children:$.jsxDEV(V1,{iso:G[0].entry.occurredAt},void 0,!1,void 0,this)},void 0,!1,void 0,this)," · Took ",$.jsxDEV("b",{children:[Y," ms"]},void 0,!0,void 0,this)," · Vendors ",$.jsxDEV("b",{children:K.map(B1).join(", ")},void 0,!1,void 0,this)," · Writes ",$.jsxDEV("b",{children:G.length},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,U.state==="ok"&&G.length===0?$.jsxDEV(F5,{title:"Nothing in this World carries this trace",children:$.jsxDEV("p",{children:["An app instrumented with OpenTelemetry sends a ",$.jsxDEV("code",{children:"traceparent"},void 0,!1,void 0,this)," with each call, and every write that call makes keeps it, so one click reads across every vendor."]},void 0,!0,void 0,this)},void 0,!1,void 0,this):null,G.length?$.jsxDEV("div",{className:"ws-spans",role:"table","aria-label":"The trace's writes",children:[$.jsxDEV("div",{className:"ws-span head",role:"row",children:[$.jsxDEV("span",{role:"columnheader",children:"Vendor and what"},void 0,!1,void 0,this),$.jsxDEV("span",{role:"columnheader",className:"ws-ticks",children:[$.jsxDEV("span",{children:"0 ms"},void 0,!1,void 0,this),$.jsxDEV("span",{children:[Math.round(Y/2)," ms"]},void 0,!0,void 0,this),$.jsxDEV("span",{children:[Y," ms"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),G.map((H)=>{let L=Date.parse(H.entry.occurredAt)-X,z=X5(H),W=P0(H.entry);return $.jsxDEV(c.default.Fragment,{children:[$.jsxDEV("div",{className:Z===z?"ws-span on":"ws-span",role:"row",onClick:()=>F(Z===z?null:z),children:[$.jsxDEV("span",{role:"cell",className:"ws-span-name",children:[$.jsxDEV(r1,{vendor:H.twin},void 0,!1,void 0,this),$.jsxDEV("b",{children:B1(H.twin)},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:[W.what,W.label?` “${W.label}”`:""]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("span",{role:"cell",className:"ws-span-track",children:[$.jsxDEV("span",{className:"ws-span-dot",style:{left:`${L/Y*100}%`}},void 0,!1,void 0,this),$.jsxDEV("span",{className:"ws-span-at mode",style:{left:`${L/Y*100}%`},children:["+",L," ms"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z===z?$.jsxDEV("div",{className:"ws-span-detail",children:[$.jsxDEV("p",{className:"mode",children:[$.jsxDEV("code",{children:KQ(H.entry)},void 0,!1,void 0,this)," on ",$.jsxDEV("code",{children:[H.entry.subject.type,":",$2(H.entry)]},void 0,!0,void 0,this)," · ",s5(H.entry,H.caller)," · ",e_(H.entry)]},void 0,!0,void 0,this),$.jsxDEV(LQ,{fields:H.entry.fields},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},z,!0,void 0,this)})]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)}function iZ({name:_,token:Q,vendor:J,withScreens:q,tick:U}){let G=h1(Q,`/-/${_}/checkpoint/${J}`,Math.floor(U/6)),Z=G.state==="ok"?G.data.tree.filter((M)=>M.deleted!==!0):[],F=[...new Set(Z.map((M)=>M.type))].map((M)=>({type:M,count:Z.filter((P)=>P.type===M).length})).sort((M,P)=>Number(M.type.startsWith("_"))-Number(P.type.startsWith("_"))||m2(M.type).localeCompare(m2(P.type))),[X,Y]=c.useState(null),[K,H]=c.useState(null),L=F.some((M)=>M.type===X)?X:F[0]?.type,z=Z.filter((M)=>M.type===L),W=z.find((M)=>M.id===K)??z[0],w=["name","email","title","text","description","subject","amount","percent_off","unit_amount","currency","status","channel","customer","product"],R=new Set(["id","type","object","livemode","created","updated","updatedAt","deleted"]),A=(M)=>!R.has(M)&&z.some((P)=>P[M]!==void 0&&P[M]!==null&&typeof P[M]!=="object"),O=[...new Set(z.flatMap((M)=>Object.keys(M)))],B=[...w.filter(A),...O.filter((M)=>!w.includes(M)&&A(M))].slice(0,4);return $.jsxDEV("div",{className:"ws-table-app",children:[$.jsxDEV("nav",{className:"ws-tables","aria-label":`${B1(J)}'s records`,children:[$.jsxDEV("div",{className:"ws-list-head",children:$.jsxDEV("span",{className:"vendor-cell",children:[$.jsxDEV(r1,{vendor:J},void 0,!1,void 0,this),B1(J)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV(G0,{load:G,what:"what it stores",lines:4},void 0,!1,void 0,this),$.jsxDEV("p",{className:"menu-label",children:"Stores"},void 0,!1,void 0,this),F.map((M)=>$.jsxDEV("a",{href:`#${M.type}`,className:L===M.type?"on":void 0,"aria-current":L===M.type?"true":void 0,onClick:(P)=>{P.preventDefault(),Y(M.type),H(null)},children:[$.jsxDEV(P1,{name:"table-2",size:16},void 0,!1,void 0,this),$.jsxDEV("span",{children:m2(M.type)},void 0,!1,void 0,this),$.jsxDEV("span",{className:"count",children:M.count},void 0,!1,void 0,this)]},M.type,!0,void 0,this)),$.jsxDEV("p",{className:"menu-label",children:"Also"},void 0,!1,void 0,this),$.jsxDEV("a",{href:`${M1}/${_}/~/events/${J}`,onClick:(M)=>{M.preventDefault(),j1([..._.split("/"),"~","events",J])},children:[$.jsxDEV(P1,{name:"activity",size:16},void 0,!1,void 0,this),$.jsxDEV("span",{children:"Its events"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q?$.jsxDEV("a",{href:`${M1}/${_}/~/screens/${J}`,onClick:(M)=>{M.preventDefault(),j1([..._.split("/"),"~","screens",J])},children:[$.jsxDEV(P1,{name:"monitor",size:16},void 0,!1,void 0,this),$.jsxDEV("span",{children:"Its screens"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-grid-wrap",children:[G.state==="ok"&&F.length===0?$.jsxDEV(F5,{title:`${B1(J)} stores nothing yet`,children:$.jsxDEV("p",{children:"What your app makes there shows here, by type."},void 0,!1,void 0,this)},void 0,!1,void 0,this):null,z.length?$.jsxDEV("table",{className:"ws-grid","aria-label":`${m2(L??"")} records`,children:[$.jsxDEV("thead",{children:$.jsxDEV("tr",{children:[$.jsxDEV("th",{children:"id"},void 0,!1,void 0,this),B.map((M)=>$.jsxDEV("th",{children:M},M,!1,void 0,this)),$.jsxDEV("th",{children:"updated"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("tbody",{children:z.map((M)=>$.jsxDEV("tr",{className:W?.id===M.id?"on":void 0,"aria-selected":W?.id===M.id,onClick:()=>H(M.id),children:[$.jsxDEV("td",{children:$.jsxDEV("code",{children:M.id},void 0,!1,void 0,this)},void 0,!1,void 0,this),B.map((P)=>$.jsxDEV("td",{className:"ws-cell-clip",children:M[P]===void 0||M[P]===null?$.jsxDEV("span",{className:"mode",children:"—"},void 0,!1,void 0,this):String(M[P])},P,!1,void 0,this)),$.jsxDEV("td",{className:"mode",children:typeof M.updatedAt==="string"?$.jsxDEV(V1,{iso:M.updatedAt},void 0,!1,void 0,this):"—"},void 0,!1,void 0,this)]},M.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("aside",{className:"ws-record","aria-label":"The selected record",children:W?$.jsxDEV($.Fragment,{children:[$.jsxDEV("div",{className:"ws-list-head",children:[$.jsxDEV("span",{children:m2(W.type)},void 0,!1,void 0,this),$.jsxDEV("code",{children:W.id},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("dl",{className:"ws-record-fields",children:Object.entries(W).filter(([M])=>M!=="type"&&M!=="id").map(([M,P])=>$.jsxDEV(c.default.Fragment,{children:[$.jsxDEV("dt",{children:M},void 0,!1,void 0,this),$.jsxDEV("dd",{children:$.jsxDEV(q2,{v:P},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},M,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null},void 0,!1,void 0,this),$.jsxDEV("div",{className:"ws-foot mode",children:W?`${z.indexOf(W)+1} of ${x1(z.length,m2(L??"record"))}`:""},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function rZ({name:_,vendor:Q,url:J,mapError:q,holding:U,session:G,retry:Z}){return $.jsxDEV("div",{className:"ws-screen",children:[$.jsxDEV("div",{className:"ws-screen-bar",children:[$.jsxDEV("span",{className:"vendor-cell",children:[$.jsxDEV(r1,{vendor:Q},void 0,!1,void 0,this),$.jsxDEV("b",{children:B1(Q)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("span",{className:"mode",children:U},void 0,!1,void 0,this),$.jsxDEV("a",{href:`${M1}/${_}/~/vendors/${Q}`,onClick:(F)=>{F.preventDefault(),j1([..._.split("/"),"~","vendors",Q])},children:[$.jsxDEV(P1,{name:"table-2",size:16},void 0,!1,void 0,this),"Its records"]},void 0,!0,void 0,this),J?$.jsxDEV("a",{href:J,target:"_blank",rel:"noopener noreferrer",children:[$.jsxDEV(P1,{name:"external-link",size:16},void 0,!1,void 0,this),"New tab"]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),G.state==="ok"&&G.scope==="read"?$.jsxDEV("p",{className:"mode ws-screens-note",children:"You are looking read only: the screens browse, and refuse changes."},void 0,!1,void 0,this):null,q?$.jsxDEV("p",{role:"alert",className:"ws-screens-note",children:["The World did not say where its screens are: ",q]},void 0,!0,void 0,this):G.state==="pending"||J===void 0?$.jsxDEV("p",{className:"mode ws-screens-note",role:"status",children:"Opening…"},void 0,!1,void 0,this):null,G.state==="error"?$.jsxDEV("p",{role:"alert",className:"ws-screens-note",children:["The World did not open its screens: ",G.error," ",$.jsxDEV("button",{type:"button",onClick:Z,children:"Try again"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,G.state==="ok"&&J===null?$.jsxDEV("p",{className:"mode ws-screens-note",children:[B1(Q),"'s pack lists no screens."]},void 0,!0,void 0,this):null,G.state==="ok"&&J?$.jsxDEV("iframe",{title:`${B1(Q)}, as this World shows it`,src:J},Q,!1,void 0,this):null]},void 0,!0,void 0,this)}function dZ({name:_,token:Q,who:J,scope:q}){let[U,G]=c.useState(0),Z=h1(Q,`/-/${_}/twins`),F=h1(Q,`/-/${_}/rules`,U),X=F.state==="ok"?F.data.changesets:null,[Y,K]=c.useState(null),[H,L]=c.useState(null),[z,W]=c.useState(!1),[w,R]=c.useState([]),A=Y??X?.approvals??1,O=H??X?.summary??"required",B=X!==null&&(A!==(X.approvals??1)||O!==(X.summary??"required")),M=(k,u)=>{if(R((i)=>[{ok:k,text:u,at:new Date().toISOString(),n:++n5},...i].slice(0,3)),!k)p1(u,"error")},P=async(k)=>{k.preventDefault(),W(!0);try{let u=await v1(Q,`/-/${_}/rules`,{method:"PUT",body:JSON.stringify({changesets:{approvals:A,summary:O}})});if(!u.ok){M(!1,`Save: ${await L0(u)}`);return}M(!0,`Saved: ${A===0?"no approval":x1(A,"approval")} before a deploy; a summary ${O==="required"?"required":"generated when none is given"}.`),K(null),L(null),G((i)=>i+1)}finally{W(!1)}},C={gated:"a person deploys an approved changeset",auto:"a push deploys at once",hold:"nothing deploys"},f=J.person?$.jsxDEV($.Fragment,{children:[$.jsxDEV("b",{children:J.person},void 0,!1,void 0,this),J.local?", signed in on this machine":""]},void 0,!0,void 0,this):J.local?$.jsxDEV($.Fragment,{children:[$.jsxDEV("b",{children:"this machine"},void 0,!1,void 0,this),": no one is signed in here, so no person owns them until they are pushed by one"]},void 0,!0,void 0,this):J.admin?$.jsxDEV($.Fragment,{children:$.jsxDEV("b",{children:"the host's admin"},void 0,!1,void 0,this)},void 0,!1,void 0,this):$.jsxDEV($.Fragment,{children:[$.jsxDEV("b",{children:"this token"},void 0,!1,void 0,this),", a service"]},void 0,!0,void 0,this),v=Z.state==="ok"?Z.data.twins.filter((k)=>k.root?.url):[],N=q!=="write"?"This session reads the World; it changes no rules":null;return $.jsxDEV($.Fragment,{children:[$.jsxDEV("h3",{className:"settings-head",children:"Changesets"},void 0,!1,void 0,this),$.jsxDEV("p",{className:"mode",children:"This World's rules, kept with it and shared by everyone who works in it. A person or the World's token changes them; a key never does, so an agent cannot relax the review its own changes go through."},void 0,!1,void 0,this),$.jsxDEV(G0,{load:F,what:"the rules",lines:2},void 0,!1,void 0,this),$.jsxDEV("form",{className:"ws-rules",onSubmit:(k)=>void P(k),"aria-label":"Changeset rules",children:[$.jsxDEV("div",{className:"ws-rule",children:[$.jsxDEV("h4",{children:"Recorded as"},void 0,!1,void 0,this),$.jsxDEV("p",{children:["What you cut here is recorded as ",f,". An agent's or an app's key cuts as itself, for the person it was made for; a World's token cuts as a service."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-rule",children:[$.jsxDEV("h4",{children:"A cut's summary"},void 0,!1,void 0,this),$.jsxDEV("fieldset",{className:"choice",disabled:Boolean(N)||X===null,children:[$.jsxDEV("label",{className:"check",children:[$.jsxDEV("input",{type:"radio",name:"summary",checked:O==="required",onChange:()=>L("required")},void 0,!1,void 0,this)," ",$.jsxDEV("span",{children:"Required: whoever cuts says what it does and why"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("label",{className:"check",children:[$.jsxDEV("input",{type:"radio",name:"summary",checked:O==="generated",onChange:()=>L("generated")},void 0,!1,void 0,this)," ",$.jsxDEV("span",{children:"Generated from its changes when none is given"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("p",{className:"mode",children:"Either way a cut takes every change not yet in a changeset: there is no staging."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-rule",children:[$.jsxDEV("h4",{children:"Ready to deploy"},void 0,!1,void 0,this),$.jsxDEV("ul",{className:"ws-rule-list",children:$.jsxDEV("li",{children:[$.jsxDEV(P1,{name:"check",size:16},void 0,!1,void 0,this),"Verified: replayed in a throwaway World, the World's checks passing"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("label",{className:"ws-rule-row",children:[$.jsxDEV("span",{children:"Approved by"},void 0,!1,void 0,this),$.jsxDEV("select",{value:A,onChange:(k)=>K(Number(k.target.value)),disabled:Boolean(N)||X===null,"aria-label":"Approvals required",children:[0,1,2,3,4,5].map((k)=>$.jsxDEV("option",{value:k,children:k===0?"no one: verified is enough":k===1?"1 person":`${k} different people`},k,!1,void 0,this))},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:"for its contents as they stand"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-rule",children:[$.jsxDEV("h4",{children:"Deploys to"},void 0,!1,void 0,this),Z.state==="ok"&&v.length===0?$.jsxDEV("p",{className:"mode",children:"No vendor here is connected to its real service, so nothing deploys from this World."},void 0,!1,void 0,this):null,v.length?$.jsxDEV("ul",{className:"ws-rule-list",children:v.map((k)=>$.jsxDEV("li",{children:[$.jsxDEV(r1,{vendor:k.twin},void 0,!1,void 0,this),B1(k.twin),": ",C[k.root.deploy??"gated"]??"gated"]},k.twin,!0,void 0,this))},void 0,!1,void 0,this):null,$.jsxDEV("p",{className:"mode",children:[$.jsxDEV("a",{href:`${M1}/${_}/~/settings/services`,onClick:(k)=>{k.preventDefault(),j1([..._.split("/"),"~","settings","services"])},children:"Real services"},void 0,!1,void 0,this)," sets each vendor's deploy policy."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(B2,{log:w,name:_},void 0,!1,void 0,this),$.jsxDEV("div",{className:"row-actions",children:[$.jsxDEV("button",{type:"submit",className:"primary",disabled:Boolean(N)||z||!B,title:N??void 0,children:z?"Saving…":"Save"},void 0,!1,void 0,this),B?$.jsxDEV("button",{type:"button",onClick:()=>{K(null),L(null)},children:"Cancel"},void 0,!1,void 0,this):null,N?$.jsxDEV("span",{className:"mode",children:[N,"."]},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)}function aZ({who:_,scope:Q,snapshot:J,portal:q,onSignOut:U}){let G=Q==="write"?"Reads and changes this World":Q==="read"?"Reads this World; changes nothing":"…",[Z,F]=J?["A snapshot",`of ${J.parent}, read only`]:_.local&&_.person?[_.person,"Signed in on this machine: this World is served here, and acts as you"]:_.local?["This machine","Served here, with no one signed in: what you do is recorded as this machine"]:_.person?[_.person,q?`Signed in through ${new URL(q).host}`:"Signed in"]:_.admin?["The host's admin","Opened with the host admin token: every World it serves"]:["A link or key","Opened with a token for this World"];return $.jsxDEV($.Fragment,{children:[$.jsxDEV("h3",{className:"settings-head",children:"Account"},void 0,!1,void 0,this),$.jsxDEV("div",{className:"ws-account",children:[$.jsxDEV("span",{className:"ws-account-face","aria-hidden":"true",children:$.jsxDEV(P1,{name:_.person?"user":_.local?"monitor":J?"clock":"key-round",size:20},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("div",{className:"cell-label",children:[$.jsxDEV("b",{children:Z},void 0,!1,void 0,this),$.jsxDEV("small",{children:F},void 0,!1,void 0,this),$.jsxDEV("small",{children:G},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),_.local||J?null:$.jsxDEV("p",{children:$.jsxDEV("button",{type:"button",onClick:U,children:[$.jsxDEV(P1,{name:"log-out",size:16},void 0,!1,void 0,this),_.person?"Sign out":_.admin?"Sign out of the host":"Use another token"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),q&&_.person?$.jsxDEV("p",{className:"mode",children:["Your profile, orgs and keys are on ",$.jsxDEV("a",{href:`${q}/`,children:new URL(q).host},void 0,!1,void 0,this),"."]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)}function sZ({name:_,token:Q,view:J,sub:q,arg:U,win:G,who:Z,snapshot:F,onReturn:X,onSignOut:Y,worlds:K,session:H,retry:L,twins:z,map:W,branches:w,clock:R,canWrite:A,refused:O,signsAs:B,opens:M,tick:P,admin:C,onRemoved:f,onClock:v,scope:N}){let k=TQ(_,Q,P,O),[u,i]=c.useState(0),l=u*1e5+Math.floor(P/2),S=h1(Q,`/-/${_}/diff`,l),b=h1(Q,`/-/${_}/changesets`,l),h=h1(Q,`/-/${_}/rules`,l),[E,j]=c.useState(null),m=(n)=>(I1)=>{I1?.preventDefault(),j1([..._.split("/"),"~",...n])},I=z.state==="ok"?z.data.twins.map((n)=>n.twin):[],V=new Map((W.state==="ok"?W.data.twins:[]).flatMap((n)=>{let I1=EZ(_,n);return I1?[[n.twin,I1]]:[]})),D=[...V.keys()],y=W.state==="ok"?W.data.twins.filter((n)=>n.root).map((n)=>n.twin):[],t=(n)=>W.state==="ok"?(W.data.twins.find((I1)=>I1.twin===n)?.resources??[]).reduce((I1,H1)=>I1+H1.count,0):0,_1=w?.state==="ok"&&w.data.checkedOut||_.split("/")[1],s=c.useMemo(()=>{if(S.state!=="ok")return[];let n=new Map;for(let I1 of S.data.changes){let H1=`${I1.twin}:${I1.entry.subject.type}:${I1.entry.subject.id}`,m1=n.get(H1)??{key:H1,twin:I1.twin,writes:[]};m1.writes.push(I1.entry),n.set(H1,m1)}return[...n.values()]},[S]),o=s.find((n)=>n.key===E)??s[0],p=h1(Q,J==="changes"&&o?`/-/${_}/log/${o.twin}`:null,l),e=S.state==="ok"?S.data.changes.length:0,q1=k.waiting.length,G1=k.there,U1=k.origin.state==="ok"?k.origin.data.origin:null,K1=!A?"This session reads the World; it changes nothing":!G1?"No remote: name one in Settings › Remote":null,W1=(n,I1,H1,m1,t1,d1)=>$.jsxDEV("a",{href:`${M1}/${_}/~/${m1}`,className:n?"on":void 0,"aria-current":n?"page":void 0,onClick:t1,children:[I1,$.jsxDEV("span",{children:H1},void 0,!1,void 0,this),d1?$.jsxDEV("span",{className:"count",children:d1},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),Y1=(n)=>{n.currentTarget.closest("details")?.removeAttribute("open")};return $.jsxDEV("div",{className:"ws",children:[$.jsxDEV("div",{className:"ws-bar",role:"toolbar","aria-label":`${_} toolbar`,children:[$.jsxDEV("div",{className:"ws-left",children:[$.jsxDEV(d5,{href:`${M1}/${_}`,onClick:(n)=>{n.preventDefault(),m(["changes"])()}},void 0,!1,void 0,this),$.jsxDEV("details",{className:"menu ws-pick",children:[$.jsxDEV("summary",{title:"This World",children:[$.jsxDEV(P1,{name:"globe",size:16},void 0,!1,void 0,this),$.jsxDEV("span",{className:"ws-pick-label",children:[$.jsxDEV("small",{children:"World"},void 0,!1,void 0,this),$.jsxDEV("b",{children:_},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(P1,{name:"chevron-down",size:16},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"popover menu-list ws-world-menu",children:[Z.local?null:$.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"menu-label",children:"Worlds"},void 0,!1,void 0,this),K.map((n)=>$.jsxDEV("a",{href:`${M1}/${n}`,className:n===_?"on":void 0,onClick:(I1)=>{I1.preventDefault(),Y1(I1),j1(n.split("/"))},children:[n===_?$.jsxDEV(P1,{name:"check",size:16},void 0,!1,void 0,this):$.jsxDEV(P1,{name:"globe",size:16},void 0,!1,void 0,this),n]},n,!0,void 0,this)),$.jsxDEV("a",{href:`${y0()&&y0()!==k1?y0():""}${M1}/`,onClick:(n)=>{if(y0()&&y0()!==k1)return;n.preventDefault(),Y1(n),j1([])},children:[$.jsxDEV(P1,{name:"layout-grid",size:16},void 0,!1,void 0,this),"All Worlds",Z0()?` on ${new URL(Z0()).host}`:""]},void 0,!0,void 0,this),$.jsxDEV("hr",{},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("p",{className:"menu-label",children:"Connect an app"},void 0,!1,void 0,this),Z0()?$.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"ws-menu-text",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),$.jsxDEV("pre",{children:[Q2,"/",_,"/<vendor>"]},void 0,!0,void 0,this),$.jsxDEV(H8,{text:i4({platform:Z0(),world:_})},void 0,!1,void 0,this)]},void 0,!0,void 0,this):!Z.local?$.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"ws-menu-text",children:"Point your app's SDKs here with a key from Settings › Access; its calls to these vendors land in this World:"},void 0,!1,void 0,this),$.jsxDEV("pre",{children:[Q2,"/",_,"/<vendor>"]},void 0,!0,void 0,this),$.jsxDEV(H8,{text:i4()},void 0,!1,void 0,this)]},void 0,!0,void 0,this):$.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"ws-menu-text",children:"Run it in this World; its calls to these vendors land here:"},void 0,!1,void 0,this),$.jsxDEV("pre",{children:"volter world run -- npm start"},void 0,!1,void 0,this),$.jsxDEV("p",{className:"ws-menu-text mode",children:["Or point an SDK at ",$.jsxDEV("code",{children:[Q2,"/",_,"/<vendor>"]},void 0,!0,void 0,this)," with the token in ",$.jsxDEV("code",{children:".volter/token"},void 0,!1,void 0,this),"."]},void 0,!0,void 0,this),$.jsxDEV(H8,{text:i4()},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("hr",{},void 0,!1,void 0,this),$.jsxDEV("a",{href:`${M1}/${_}/~/settings`,onClick:(n)=>{Y1(n),m(["settings"])(n)},children:[$.jsxDEV(P1,{name:"settings",size:16},void 0,!1,void 0,this),"Settings…"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(gZ,{name:_,token:Q,branches:w,opens:M,refused:O,onChanged:v},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-where",title:"Where this is",children:[$.jsxDEV("span",{children:_},void 0,!1,void 0,this),$.jsxDEV("span",{className:"sep",children:":"},void 0,!1,void 0,this),$.jsxDEV("span",{children:_1},void 0,!1,void 0,this),$.jsxDEV("span",{className:"sep",children:":"},void 0,!1,void 0,this),U1?$.jsxDEV("a",{href:`${M1}/${_}/~/remote`,onClick:m(["remote"]),children:["origin ",U1.namespace,q1?$.jsxDEV("b",{children:[" ↑",q1]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this):$.jsxDEV("a",{href:`${M1}/${_}/~/remote`,onClick:m(["remote"]),children:"no remote"},void 0,!1,void 0,this),$.jsxDEV("span",{className:"sep",children:":"},void 0,!1,void 0,this),$.jsxDEV("a",{href:`${M1}/${_}/~/settings/clock`,onClick:m(["settings","clock"]),children:R.state==="ok"?$.jsxDEV($.Fragment,{children:[R.data.frozen?"stopped at ":"",$.jsxDEV(V1,{iso:R.data.at,time:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this):"…"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-right",children:[$.jsxDEV("button",{type:"button",className:"ws-btn",onClick:()=>void k.pull(),disabled:Boolean(K1)||k.busy!==null,title:K1??`Fetch what ${G1} has and move this branch onto it`,children:[$.jsxDEV(P1,{name:"arrow-down-to-line",size:16},void 0,!1,void 0,this),k.busy==="Pull"?"Pulling…":"Pull"]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"button",className:"ws-btn",onClick:()=>void k.push(),disabled:Boolean(K1)||k.busy!==null||q1===0,title:K1??(q1?`Push ${x1(q1,"changeset")} to ${G1}`:`Every changeset is at ${G1}`),children:[$.jsxDEV(P1,{name:"arrow-up-from-line",size:16},void 0,!1,void 0,this),k.busy==="Push"?"Pushing…":"Push",q1?$.jsxDEV("span",{className:"ws-btn-count",children:q1},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"button",className:"ws-btn icon-only","aria-label":"Settings",title:"Settings",onClick:()=>m(["settings"])(),children:$.jsxDEV(P1,{name:"settings",size:16},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),F?$.jsxDEV("div",{className:"ws-banner",role:"region","aria-label":"Snapshot",children:[$.jsxDEV(P1,{name:"clock",size:16},void 0,!1,void 0,this),$.jsxDEV("span",{children:["You are looking at ",$.jsxDEV("b",{children:F.parent},void 0,!1,void 0,this)," as it was at ",$.jsxDEV(V1,{iso:F.at},void 0,!1,void 0,this),": a read-only snapshot",F.expiresAt?$.jsxDEV($.Fragment,{children:[", gone ",$.jsxDEV(V1,{iso:F.expiresAt},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,"."]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"button",onClick:()=>void X(F),children:"Return to live"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,k.log.length?$.jsxDEV("div",{className:"ws-said",children:$.jsxDEV(B2,{log:k.log.slice(0,1),name:_},void 0,!1,void 0,this)},void 0,!1,void 0,this):null,$.jsxDEV("div",{className:"ws-body",children:[$.jsxDEV("nav",{className:"ws-side","aria-label":`${_} places`,children:[I.length?$.jsxDEV("a",{href:`${M1}/${_}/~/screens`,className:J==="screen"?"ws-screens-entry on":"ws-screens-entry",onClick:m(["screens"]),title:`The board: ${b2(I.map(B1))}`,children:[$.jsxDEV(P1,{name:"layout-grid",size:16},void 0,!1,void 0,this),$.jsxDEV("span",{children:"Board"},void 0,!1,void 0,this),$.jsxDEV("span",{className:"ws-screens-marks",children:[I.slice(0,3).map((n)=>$.jsxDEV(r1,{vendor:n},n,!1,void 0,this)),I.length>3?$.jsxDEV("span",{className:"more",children:["+",I.length-3]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null,$.jsxDEV("p",{className:"side-group",children:"Workspace"},void 0,!1,void 0,this),W1(J==="changes"||J==="history",$.jsxDEV(P1,{name:"file-diff",size:16},void 0,!1,void 0,this),"Changes","changes",m(["changes"]),s.length?String(s.length):void 0),W1(J==="events"&&!U||J==="trace",$.jsxDEV(P1,{name:"activity",size:16},void 0,!1,void 0,this),"Events","events",m(["events"])),$.jsxDEV("p",{className:"side-group",children:"Records"},void 0,!1,void 0,this),I.map((n)=>$.jsxDEV(c.default.Fragment,{children:W1(J==="vendor"&&U===n,$.jsxDEV(r1,{vendor:n},void 0,!1,void 0,this),B1(n),`vendors/${n}`,m(["vendors",n]),t(n)?String(t(n)):void 0)},n,!1,void 0,this)),$.jsxDEV("p",{className:"side-group",children:"Remote"},void 0,!1,void 0,this),W1(!1,$.jsxDEV(P1,{name:"cloud",size:16},void 0,!1,void 0,this),G1?"origin":"Name a remote…","remote",m(["remote"]),q1?`↑${q1}`:void 0)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-main",role:"main",children:[J==="changes"?$.jsxDEV("div",{className:"ws-status",children:[$.jsxDEV("div",{className:"ws-files",children:[$.jsxDEV(ZQ,{name:_,view:"changes",changes:s.length,changesets:b.state==="ok"?b.data.changesets.length:0},void 0,!1,void 0,this),$.jsxDEV("div",{className:"ws-list-head",children:[$.jsxDEV("span",{children:"Not in a changeset"},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:S.state==="ok"?`${x1(s.length,"record")} · ${x1(e,"write")}`:""},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(G0,{load:S,what:"the changes",lines:4},void 0,!1,void 0,this),$.jsxDEV(GQ,{records:s,...o?{selected:o.key}:{},onPick:j,label:"Changed records"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-detail",children:[S.state==="ok"&&!o?$.jsxDEV(F5,{title:"No changes on this branch",action:q1>0&&G1?$.jsxDEV("button",{type:"button",className:"primary",disabled:Boolean(K1)||k.busy!==null,onClick:()=>void k.push(),children:["Push ",x1(q1,"changeset")," to origin"]},void 0,!0,void 0,this):void 0,children:$.jsxDEV("p",{children:["What your app writes to this World lands here, record by record, to cut into a changeset. Everything since ",S.data.base.at?$.jsxDEV(V1,{iso:S.data.base.at},void 0,!1,void 0,this):$.jsxDEV("code",{children:S.data.base.id},void 0,!1,void 0,this)," is in one already."]},void 0,!0,void 0,this)},void 0,!1,void 0,this):null,o?$.jsxDEV(UQ,{record:o,history:p.state==="ok"?p.data.entries:p.state==="error"?[]:null},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV(AF,{pinned:!0,generated:h.state==="ok"&&h.data.changesets.summary==="generated",author:{face:$.jsxDEV(P1,{name:Z.person?"user":Z.local?"monitor":"key-round",size:18},void 0,!1,void 0,this),who:Z.person??(Z.local?"This machine":Z.admin?"The host's admin":"A token"),account:`${M1}/${_}/~/settings/account`,branch:_1},name:_,token:Q,changes:e,canWrite:A,refused:O,onCut:()=>{i((n)=>n+1),j(null)}},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,J==="history"?$.jsxDEV(pZ,{name:_,token:Q,sets:b,changes:s.length,withScreens:D,required:h.state==="ok"?h.data.changesets.approvals??1:1,...q?{sub:q}:{},signsAs:B,canWrite:A,rooted:y,refused:O,onChanged:()=>i((n)=>n+1)},void 0,!1,void 0,this):null,J==="events"?$.jsxDEV(cZ,{name:_,token:Q,vendors:I,...U&&I.includes(U)?{vendor:U}:{},tick:P},U??"",!1,void 0,this):null,J==="trace"?$.jsxDEV(lZ,{name:_,token:Q,id:U??""},void 0,!1,void 0,this):null,J==="vendor"&&U?$.jsxDEV(iZ,{name:_,token:Q,vendor:U,withScreens:D.includes(U),tick:P},U,!1,void 0,this):null,J==="screen"&&U?$.jsxDEV(rZ,{name:_,vendor:U,url:W.state==="ok"?V.get(U)??null:void 0,...W.state==="error"?{mapError:W.error}:{},holding:oZ(W.state==="ok"?W.data.twins.find((n)=>n.twin===U)?.resources??[]:[]),session:H,retry:L},U,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(M0,{open:G?.kind==="settings",onClose:()=>m(["changes"])(),title:"Settings",wide:"window",children:G?.kind==="settings"?$.jsxDEV("div",{className:"ws-settings",children:[$.jsxDEV("nav",{"aria-label":"Settings",children:qQ.map(([n,I1,H1])=>$.jsxDEV("a",{href:`${M1}/${_}/~/settings/${n}`,className:G.tab===n?"on":void 0,"aria-current":G.tab===n?"page":void 0,onClick:m(["settings",n]),children:[$.jsxDEV(P1,{name:H1,size:16},void 0,!1,void 0,this),I1]},n,!0,void 0,this))},void 0,!1,void 0,this),$.jsxDEV("div",{className:"ws-settings-pane",children:[N==="read"?$.jsxDEV("p",{className:"mode",children:[$.jsxDEV("span",{className:"badge read-only",children:"Read only"},void 0,!1,void 0,this)," This session reads the World; it changes nothing."]},void 0,!0,void 0,this):null,G.tab==="account"?$.jsxDEV(aZ,{who:Z,scope:N,snapshot:F,portal:Z0(),onSignOut:Y},void 0,!1,void 0,this):null,G.tab==="changesets"?$.jsxDEV(dZ,{name:_,token:Q,who:Z,scope:N},void 0,!1,void 0,this):null,G.tab==="remote"?$.jsxDEV(TF,{name:_,token:Q,canWrite:A,tick:P,refused:O},void 0,!1,void 0,this):null,G.tab==="access"||G.tab==="services"||G.tab==="checks"||G.tab==="clock"?$.jsxDEV(OF,{name:_,token:Q,admin:C,canWrite:A,refused:O,onRemoved:f,only:G.tab},void 0,!1,void 0,this):null,G.tab==="vault"?$.jsxDEV(RF,{name:_,token:Q,canWrite:A,refused:O},void 0,!1,void 0,this):null,G.tab==="appearance"?$.jsxDEV($.Fragment,{children:[$.jsxDEV("h3",{className:"settings-head",children:"Appearance"},void 0,!1,void 0,this),$.jsxDEV(uZ,{},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):null},void 0,!1,void 0,this),$.jsxDEV(M0,{open:G?.kind==="branches",onClose:()=>m(["changes"])(),title:"Branches",wide:!0,children:G?.kind==="branches"?$.jsxDEV(_F,{name:_,token:Q,canWrite:A,branches:w,opens:M,...G.open?{open:G.open}:{},onChanged:v,refused:O},void 0,!1,void 0,this):null},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function H8({text:_}){return $.jsxDEV("button",{type:"button",className:"agent-prompt-button",onClick:()=>{navigator.clipboard?.writeText(_).then(()=>p1("Copied the prompt: paste it into your coding agent"),()=>p1("Could not copy the prompt","error"))},children:"Copy a prompt for your coding agent"},void 0,!1,void 0,this)}var M8=(_)=>`${_.url.replace(/\/+$/,"")}/${_.namespace}`,tZ=(_)=>_.filter((Q)=>Q.applied===null||Q.applied.outcome==="refused"),oZ=(_,Q=4)=>{let J=[..._].filter((q)=>q.count>0).sort((q,U)=>U.count-q.count);return J.length?J.slice(0,Q).map((q)=>x1(q.count,q.type.replace(/^_+/,""))).join(" · ")+(J.length>Q?` · +${J.length-Q} more`:""):"nothing yet"},FQ=$.jsxDEV("svg",{className:"branch-glyph",viewBox:"0 0 16 16",width:"14",height:"14","aria-hidden":"true",children:$.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);function nZ({name:_,token:Q,clock:J,canWrite:q,onChanged:U,refused:G,open:Z}){let[F,X]=c.useState(!1),[Y,K]=c.useState(""),[H,L]=c.useState(""),[z,W]=c.useState(null),[w,R]=c.useState(!1),A=J.state==="ok"?J.data:null,O=async(C,f,v)=>{R(!0),W(null);try{let N=await v1(Q,`/-/${_}/${f}`,{method:f==="clock"?"PUT":"POST",body:JSON.stringify(v)});if(!N.ok){G(N),W({ok:!1,text:await L0(N)});return}let k=await N.json();W({ok:!0,text:`${C} — the World is at ${new Date(k.at).toLocaleString()}`}),X(!1),U()}catch(N){W({ok:!1,text:`the World did not answer: ${N instanceof Error?N.message:String(N)}`})}finally{R(!1)}},B=(C)=>{C.preventDefault();let f=new Date(Y);if(Number.isNaN(f.getTime())){W({ok:!1,text:"Pick a date and time."});return}if(A&&f.getTime()<Date.parse(A.at)){W({ok:!1,text:`The World's clock only moves forward: pick a time after ${new Date(A.at).toLocaleString()}.`});return}O("Clock set","clock",{at:f.toISOString()})},M=(C,f)=>{O(`Advanced ${f}`,"clock/advance",{by:C})},P=[["1h","1 hour"],["1d","1 day"],["7d","1 week"],["30d","30 days"]];return $.jsxDEV("div",{className:`clock${A?.frozen?" frozen":""}`,role:"region","aria-label":"World clock",children:[$.jsxDEV("p",{className:"clock-now",children:J.state==="loading"?$.jsxDEV("span",{className:"mode",children:"clock…"},void 0,!1,void 0,this):J.state==="error"?$.jsxDEV("span",{className:"mode",children:["Clock: ",J.error]},void 0,!0,void 0,this):A.frozen?$.jsxDEV($.Fragment,{children:[$.jsxDEV("span",{className:"badge",children:"Simulation"},void 0,!1,void 0,this)," World time ",$.jsxDEV("strong",{children:$.jsxDEV(V1,{iso:A.at},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):$.jsxDEV($.Fragment,{children:["World time ",$.jsxDEV("strong",{children:$.jsxDEV(V1,{iso:A.at},void 0,!1,void 0,this)},void 0,!1,void 0,this)," ",$.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),q&&A?$.jsxDEV("details",{className:Z?"clock-more inline":"clock-more",open:Z||void 0,children:[$.jsxDEV("summary",{children:"Simulate time…"},void 0,!1,void 0,this),$.jsxDEV("div",{className:Z?void 0:"popover",children:[$.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, the branch picker’s Manage branches… views an earlier moment."},void 0,!1,void 0,this),$.jsxDEV("div",{className:"clock-controls",children:[$.jsxDEV("button",{type:"button","aria-expanded":F,onClick:()=>{X(!F),K(K5(x_(A.at))),W(null)},children:"Set time…"},void 0,!1,void 0,this),$.jsxDEV("div",{role:"group","aria-label":"Advance the clock",className:"advance",children:[$.jsxDEV("span",{className:"mode",children:"Advance"},void 0,!1,void 0,this),P.map(([C,f])=>$.jsxDEV("button",{type:"button","aria-label":`Advance ${f}`,disabled:w||!A.frozen,title:A.frozen?void 0:"Set the time first: advancing moves a set clock",onClick:()=>M(C,f),children:f},C,!1,void 0,this)),$.jsxDEV("form",{className:"inline",onSubmit:(C)=>{if(C.preventDefault(),!/^\d+[smhd]$/.test(H.trim())){W({ok:!1,text:"Advance by a number and a unit: 90m, 12h, 3d."});return}M(H.trim(),`by ${H.trim()}`)},children:[$.jsxDEV("label",{className:"sr",children:["Advance by ",$.jsxDEV("input",{name:"advanceBy",value:H,onChange:(C)=>L(C.target.value),placeholder:"90m, 12h, 3d",size:9,disabled:!A.frozen},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"submit",disabled:w||!A.frozen,children:"Advance"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),!A.frozen?$.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,F?$.jsxDEV("form",{className:"inline","aria-label":"Set the World time",onSubmit:B,noValidate:!0,children:[$.jsxDEV("label",{children:["World time ",$.jsxDEV("input",{name:"worldTime",type:"datetime-local",value:Y,min:K5(x_(A.at)),onChange:(C)=>K(C.target.value),required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("span",{className:"mode",children:Intl.DateTimeFormat().resolvedOptions().timeZone},void 0,!1,void 0,this),$.jsxDEV("button",{type:"submit",disabled:w,children:"Set time"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",onClick:()=>X(!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,z?$.jsxDEV("p",{role:z.ok?"status":"alert",children:z.text},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}function eZ({name:_,token:Q,clock:J,refused:q}){let[U,G]=c.useState(!1),[Z,F]=c.useState(""),[X,Y]=c.useState(null),[K,H]=c.useState(!1),L=J.state==="ok"?J.data.at:new Date().toISOString(),z=c.useRef(null);return c.useEffect(()=>{if(!U)return;let w=(A)=>{if(A.key==="Escape"&&!document.querySelector("dialog[open]"))G(!1),z.current?.querySelector("button")?.focus()},R=(A)=>{if(!z.current?.contains(A.target))G(!1)};return document.addEventListener("keydown",w),document.addEventListener("click",R),()=>{document.removeEventListener("keydown",w),document.removeEventListener("click",R)}},[U]),$.jsxDEV("div",{className:"as-of",ref:z,children:[$.jsxDEV("button",{type:"button","aria-expanded":U,title:"Open a read-only copy of this World as it was at a moment you pick",onClick:()=>{G(!U),F(K5(L)),Y(null)},children:"View an earlier moment…"},void 0,!1,void 0,this),U?$.jsxDEV("form",{className:"inline","aria-label":"View the World as of a past moment",onSubmit:async(w)=>{w.preventDefault(),Y(null);let R=new Date(Z);if(Number.isNaN(R.getTime())){Y("Pick a date and time.");return}if(R.getTime()>Date.parse(L)){Y(`That is after the World's present (${new Date(L).toLocaleString()}); a snapshot looks back.`);return}H(!0);try{let A=await v1(Q,`/-/${_}/branches`,{method:"POST",body:JSON.stringify({at:{instant:R.toISOString()},ttl:3600})});if(!A.ok){q(A),Y(await L0(A));return}let O=await A.json();z8({name:O.name,parent:_,token:O.token,readToken:O.readToken,at:R.toISOString(),expiresAt:O.expiresAt??null,parentOrigin:k1,made:!0});let B=o5(O.origin)?.origin;if(B&&B!==k1){A8(B,O.readToken,O.name,`${M1}/${O.name}`);return}j1(O.name.split("/"))}catch(A){Y(`the World did not answer: ${A instanceof Error?A.message:String(A)}`)}finally{H(!1)}},noValidate:!0,children:[$.jsxDEV("label",{children:["As of ",$.jsxDEV("input",{name:"asOf",type:"datetime-local",value:Z,max:K5(L),onChange:(w)=>F(w.target.value),required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"submit",disabled:K,children:K?"Opening…":"Open snapshot"},void 0,!1,void 0,this),$.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,X?$.jsxDEV("p",{role:"alert",children:X},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}function HQ({name:_,token:Q,open:J,onClose:q,onMade:U,refused:G}){let Z=(f)=>f.split("/").pop()??f,[F,X]=c.useState(!1),[Y,K]=c.useState(null),[H,L]=c.useState(""),[z,W]=c.useState("now"),[w,R]=c.useState(""),[A,O]=c.useState("24"),[B,M]=c.useState(!0);c.useEffect(()=>{if(J)K(null),R(K5(new Date().toISOString()))},[J]);let P=async(f)=>{f.preventDefault(),K(null);let v=z==="at"?new Date(w):null;if(v&&Number.isNaN(v.getTime())){K("Pick a date and time, or make it as of now.");return}if(v&&v.getTime()>Date.now()){K("A branch is made as of now or a moment before it.");return}X(!0);let N=await v1(Q,`/-/${_}/branches`,{method:"POST",body:JSON.stringify({ttl:Math.round(Number(A)*3600),...v?{at:{instant:v.toISOString()}}:B?{live:!0}:{},...H.trim()?{label:H.trim()}:{}})}).catch(()=>null);if(X(!1),!N){K(`${k1} did not answer`);return}if(!N.ok){G(N),K(await L0(N));return}let k=await N.json();z8({name:k.name,parent:_,token:k.token??"",readToken:k.readToken,at:(v??new Date).toISOString(),expiresAt:k.expiresAt??null,parentOrigin:k1,...k.origin?{origin:k.origin}:{}}),q(),L(""),p1(`Made ${Z(k.name)}`),U()};return $.jsxDEV(M0,{open:J,onClose:()=>{if(!F)q()},title:`New branch of ${Z(_)}`,footer:$.jsxDEV($.Fragment,{children:[$.jsxDEV("button",{type:"button",onClick:()=>q(),disabled:F,children:"Cancel"},void 0,!1,void 0,this),$.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:$.jsxDEV("form",{id:"new-branch",onSubmit:(f)=>void P(f),className:"stack",children:[$.jsxDEV("label",{children:[$.jsxDEV("span",{children:["Label ",$.jsxDEV("span",{className:"mode",children:"(optional)"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("input",{name:"branchLabel",value:H,onChange:(f)=>L(f.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),$.jsxDEV("fieldset",{className:"choice",children:[$.jsxDEV("legend",{children:"From"},void 0,!1,void 0,this),$.jsxDEV("label",{className:"check",children:[$.jsxDEV("input",{type:"radio",name:"branchWhen",checked:z==="now",onChange:()=>W("now")},void 0,!1,void 0,this)," ",$.jsxDEV("span",{children:"Now: the World as it is"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z==="now"?$.jsxDEV("label",{className:"check sub",children:[$.jsxDEV("input",{type:"checkbox",name:"branchLive",checked:B,onChange:(f)=>M(f.target.checked)},void 0,!1,void 0,this)," ",$.jsxDEV("span",{children:"Live: its clock keeps this World's time, as a pull request's preview does (else it stops now)"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,$.jsxDEV("label",{className:"check",children:[$.jsxDEV("input",{type:"radio",name:"branchWhen",checked:z==="at",onChange:()=>W("at")},void 0,!1,void 0,this)," ",$.jsxDEV("span",{children:"An instant before now: the World as it was then, its clock stopped there"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z==="at"?$.jsxDEV("input",{type:"datetime-local","aria-label":"As of",value:w,max:K5(new Date().toISOString()),onChange:(f)=>R(f.target.value)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"Goes away after"},void 0,!1,void 0,this),$.jsxDEV("select",{name:"branchLife",value:A,onChange:(f)=>O(f.target.value),children:[$.jsxDEV("option",{value:"1",children:"1 hour"},void 0,!1,void 0,this),$.jsxDEV("option",{value:"24",children:"1 day"},void 0,!1,void 0,this),$.jsxDEV("option",{value:"72",children:"3 days"},void 0,!1,void 0,this),$.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),Y?$.jsxDEV("p",{role:"alert",children:Y},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function _F({name:_,token:Q,canWrite:J,branches:q,opens:U,open:G,onChanged:Z,refused:F,snapshotOf:X}){let Y=h1(Q,`/-/${_}/clock`),K=(O)=>O.split("/").pop()??O,[H,L]=c.useState(!1),z=(O)=>(B)=>{B.preventDefault(),j1([..._.split("/"),"~","branches",...O?O.split("/"):[]])};if(!q)return $.jsxDEV("p",{className:"mode",children:"This host makes no branches of a World."},void 0,!1,void 0,this);let W=q.state==="ok"?q.data.branches:[],w=q.state==="ok"&&(q.data.named?.length??0)>0?q.data.named:[{name:K(_),running:!0}],R=q.state==="ok"?q.data.checkedOut??K(_):K(_),A=async(O)=>{if(!await m0({title:`Remove the branch ${K(O)}?`,body:"Whoever holds its tokens loses it, and its history goes with it.",action:"Remove branch",danger:!0}))return;let B=await v1(Q,`/-/${_}/branches/${O}`,{method:"DELETE"}).catch((M)=>M);if(B instanceof Error){p1(`Remove ${K(O)}: the World did not answer (${B.message})`,"error");return}if(!B.ok){F(B),p1(`Remove ${K(O)}: ${await L0(B)}`,"error");return}a4(O),p1(`Removed ${K(O)}`),Z(),j1([..._.split("/"),"~","branches"])};if(G){let O=G.includes("/")?W.find((M)=>M.name===G):void 0,B=G.includes("/")?void 0:w.find((M)=>M.name===G);return $.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"crumbs-line",children:$.jsxDEV("a",{href:`${M1}/${_}/~/branches`,onClick:z(),children:"← Branches"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV(G0,{load:q,what:"the branches"},void 0,!1,void 0,this),q.state==="ok"&&!O&&!B?$.jsxDEV("p",{className:"mode",children:["This World has no branch named ",G,"."]},void 0,!0,void 0,this):null,O?$.jsxDEV(QF,{name:_,b:O,canWrite:J,opens:U(O.name),remove:()=>void A(O.name)},void 0,!1,void 0,this):null,B&&!O?$.jsxDEV(JF,{name:_,token:Q,b:B,served:B.name===R,canWrite:J,canServe:q.state==="ok"&&Boolean(q.data.canServe)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}return $.jsxDEV("div",{"aria-labelledby":"branches",children:[$.jsxDEV("div",{className:"branches-head",children:[$.jsxDEV("p",{className:"lede",children:["Branch this World to look at it as it was, or to change it without touching ",$.jsxDEV("b",{children:R},void 0,!1,void 0,this),". Each branch's name opens its page."]},void 0,!0,void 0,this),J?$.jsxDEV("div",{className:"head-actions",children:[X?null:$.jsxDEV(eZ,{name:_,token:Q,clock:Y,refused:F},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",className:"primary",onClick:()=>L(!0),children:"New branch"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV(G0,{load:q,what:"the branches"},void 0,!1,void 0,this),q.state==="ok"?$.jsxDEV("div",{className:"block",children:$.jsxDEV("table",{className:"dense","aria-label":"Branches",children:[$.jsxDEV("thead",{children:$.jsxDEV("tr",{children:[$.jsxDEV("th",{id:"branches",children:"Branch"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Parent"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"As of"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Made"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Goes away"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("tbody",{children:[w.map((O)=>$.jsxDEV("tr",{children:[$.jsxDEV("td",{children:[$.jsxDEV("a",{href:`${M1}/${_}/~/branches/${O.name}`,onClick:z(O.name),children:$.jsxDEV("b",{children:O.name},void 0,!1,void 0,this)},void 0,!1,void 0,this),O.name===R?$.jsxDEV($.Fragment,{children:[" ",$.jsxDEV("span",{className:"badge live",children:"served here"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):O.running?null:$.jsxDEV($.Fragment,{children:[" ",$.jsxDEV("span",{className:"badge",children:"stopped"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("td",{className:"mode",children:"—"},void 0,!1,void 0,this),$.jsxDEV("td",{className:"mode",children:"live"},void 0,!1,void 0,this),$.jsxDEV("td",{className:"mode",children:"—"},void 0,!1,void 0,this),$.jsxDEV("td",{className:"mode",children:"kept"},void 0,!1,void 0,this)]},`own:${O.name}`,!0,void 0,this)),W.map((O)=>$.jsxDEV("tr",{children:[$.jsxDEV("td",{children:$.jsxDEV("a",{href:`${M1}/${_}/~/branches/${O.name}`,onClick:z(O.name),children:$.jsxDEV("b",{children:K(O.name)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:K(O.from??_)},void 0,!1,void 0,this),$.jsxDEV("td",{children:O.at?.instant?$.jsxDEV(V1,{iso:O.at.instant},void 0,!1,void 0,this):$.jsxDEV("span",{className:"mode",children:"live"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:$.jsxDEV(V1,{iso:O.createdAt},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:O.expiresAt?$.jsxDEV(V1,{iso:O.expiresAt},void 0,!1,void 0,this):"kept"},void 0,!1,void 0,this)]},O.name,!0,void 0,this))]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this):null,$.jsxDEV(HQ,{name:_,token:Q,open:H,onClose:()=>L(!1),onMade:Z,refused:F},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function QF({name:_,b:Q,canWrite:J,opens:q,remove:U}){let G=(X)=>X.split("/").pop()??X,Z=W8(Q.name),F=h1(Z,Z?`/-/${Q.name}/diff`:null);return $.jsxDEV("div",{className:"branch-page",children:[$.jsxDEV("div",{className:"changeset-head",children:[$.jsxDEV("h3",{children:[FQ," ",G(Q.name)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"changeset-actions",children:[q?$.jsxDEV("button",{type:"button",className:"primary",onClick:()=>$Q(Q.name,Q.name.split("/")),children:"Open"},void 0,!1,void 0,this):null,J?$.jsxDEV("button",{type:"button",className:"danger-button",onClick:U,children:"Remove…"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"block",children:$.jsxDEV("dl",{className:"fields pad",children:[$.jsxDEV("dt",{children:"Name"},void 0,!1,void 0,this),$.jsxDEV("dd",{children:$.jsxDEV("code",{children:Q.name},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("dt",{children:"Parent"},void 0,!1,void 0,this),$.jsxDEV("dd",{children:G(Q.from??_)},void 0,!1,void 0,this),$.jsxDEV("dt",{children:"As of"},void 0,!1,void 0,this),$.jsxDEV("dd",{children:Q.at?.instant?$.jsxDEV(V1,{iso:Q.at.instant},void 0,!1,void 0,this):"live: it keeps its parent's time"},void 0,!1,void 0,this),$.jsxDEV("dt",{children:"Made"},void 0,!1,void 0,this),$.jsxDEV("dd",{children:$.jsxDEV(V1,{iso:Q.createdAt},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("dt",{children:"Goes away"},void 0,!1,void 0,this),$.jsxDEV("dd",{children:Q.expiresAt?$.jsxDEV(V1,{iso:Q.expiresAt},void 0,!1,void 0,this):"kept"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),!q?$.jsxDEV("p",{className:"mode",children:"Its tokens were handed to whoever made it: it opens, and shows its own changes, in their tab."},void 0,!1,void 0,this):null,F.state==="ok"?$.jsxDEV($.Fragment,{children:[$.jsxDEV("h4",{children:"Its changes"},void 0,!1,void 0,this),F.data.changes.length===0?$.jsxDEV("p",{className:"mode",children:"Nothing written on it since it branched."},void 0,!1,void 0,this):$.jsxDEV(BF,{changes:F.data.changes,idPrefix:`branch-${G(Q.name)}`},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)}function JF({name:_,token:Q,b:J,served:q,canWrite:U,canServe:G}){let[Z,F]=c.useState(!1),[X,Y]=c.useState(null),K=async()=>{F(!0),Y(null);let H=await v1(Q,`/-/${_}/branches/${encodeURIComponent(J.name)}/serve`,{method:"POST"}).catch(()=>null);if(H?.ok){location.reload();return}F(!1),Y(H?await L0(H):`${k1} did not answer`)};return $.jsxDEV("div",{className:"branch-page",children:[$.jsxDEV("div",{className:"changeset-head",children:[$.jsxDEV("h3",{children:[FQ," ",J.name," ",q?$.jsxDEV("span",{className:"badge live",children:"served here"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"changeset-actions",children:U&&G&&!q?$.jsxDEV("button",{type:"button",className:"primary",disabled:Z,onClick:()=>void K(),children:Z?"Switching…":"Serve here"},void 0,!1,void 0,this):null},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"block",children:$.jsxDEV("dl",{className:"fields pad",children:[$.jsxDEV("dt",{children:"Name"},void 0,!1,void 0,this),$.jsxDEV("dd",{children:$.jsxDEV("code",{children:J.name},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("dt",{children:"Kind"},void 0,!1,void 0,this),$.jsxDEV("dd",{children:"one of this World's own branches"},void 0,!1,void 0,this),$.jsxDEV("dt",{children:"State"},void 0,!1,void 0,this),$.jsxDEV("dd",{children:J.running?"running":"stopped"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),q?$.jsxDEV("p",{className:"mode",children:["This is the branch these pages show: its changes are on ",$.jsxDEV("a",{href:`${M1}/${_}/~/changes`,onClick:(H)=>{H.preventDefault(),j1([..._.split("/"),"~","changes"])},children:"Changes"},void 0,!1,void 0,this),"."]},void 0,!0,void 0,this):G?$.jsxDEV("p",{className:"mode",children:["“Serve here” stops this one's twins and serves ",J.name," in its place."]},void 0,!0,void 0,this):$.jsxDEV("p",{className:"mode",children:"This host serves one of the World's own branches at a time, and does not switch them from this page."},void 0,!1,void 0,this),X?$.jsxDEV("p",{role:"alert",children:X},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}var c_=50,X5=(_)=>`${_.twin}:${_.position}`,XQ=(_,Q)=>Date.parse(Q.entry.occurredAt)-Date.parse(_.entry.occurredAt)||_.twin.localeCompare(Q.twin)||Q.position-_.position,s4=(_)=>{if(!_)return"someone";if(_.startsWith("key:")){let[Q,J]=_.slice(4).split(" for:");return J?`${Q}, for ${J}`:Q||"a key"}if(_.startsWith("person:"))return _.slice(7);return _==="machine"?"this machine":_==="person"?"a session with no name":_==="token:read"?"the read-only token":_==="token"?"the World's token":_},s5=(_,Q)=>{let J=typeof Q==="string"?Q:typeof _.caller==="string"?_.caller:"";if(J.startsWith("key:")&&J.length>4)return`by ${s4(J)}`;if(J.startsWith("person:")&&J.length>7)return`by ${J.slice(7)}`;if(J==="machine")return"by this machine";if(J==="person")return"by a session with no name";if(J==="key")return"by a key";if(J==="token:read")return"by the read-only token";if(J==="token")return"by the World's token";return _.actor?.kind==="system"?"by the vendor":_.actor?.id?`by ${_.actor.id}`:"by an app"},KQ=(_)=>_.operation??_.op;function $F(_){let Q=_.fields??{},J=Q.usage!==null&&typeof Q.usage==="object"?Q.usage:Q,q=(...Y)=>Y.map((K)=>J[K]??Q[K]).find((K)=>typeof K==="number"),U=[],G=q("prompt_tokens","input_tokens"),Z=q("completion_tokens","output_tokens"),F=q("total_tokens");if(G!==void 0)U.push(["tokens in",G.toLocaleString()]);if(Z!==void 0)U.push(["tokens out",Z.toLocaleString()]);if(F!==void 0)U.push(["tokens in all",F.toLocaleString()]);let X=q("cost_usd","cost");if(X!==void 0)U.push(["cost",`$${X<0.01?X.toPrecision(2):X.toFixed(2)}`]);return U}function YQ({text:_,at:Q=280}){if(_.length<=Q)return $.jsxDEV("span",{className:"text",children:_},void 0,!1,void 0,this);return $.jsxDEV("details",{className:"folded",children:[$.jsxDEV("summary",{children:[$.jsxDEV("span",{className:"text",children:[_.slice(0,Q),"…"]},void 0,!0,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:["show all ",_.length.toLocaleString()," characters"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("span",{className:"text",children:_},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function q2({v:_}){if(typeof _==="string")return $.jsxDEV(YQ,{text:_},void 0,!1,void 0,this);if(_===null||typeof _!=="object")return $.jsxDEV("code",{children:String(_)},void 0,!1,void 0,this);let Q=JSON.stringify(_,null,2);return Q.length<=160?$.jsxDEV("code",{children:JSON.stringify(_)},void 0,!1,void 0,this):$.jsxDEV("details",{className:"folded",children:[$.jsxDEV("summary",{children:$.jsxDEV("code",{children:[JSON.stringify(_).slice(0,120),"…"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("pre",{children:Q},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var qF=(_)=>typeof _==="string"?_:Array.isArray(_)?_.map((Q)=>Q&&typeof Q==="object"&&typeof Q.text==="string"?Q.text:"").filter(Boolean).join(`
36
- `):JSON.stringify(_??"");function UF({body:_}){if(_===null||typeof _!=="object"||Array.isArray(_))return $.jsxDEV(q2,{v:_},void 0,!1,void 0,this);let Q=_,J=Array.isArray(Q.messages)?Q.messages:null,q=Object.entries(Q).filter(([U])=>!(J&&U==="messages"));return $.jsxDEV($.Fragment,{children:[q.length?$.jsxDEV("dl",{className:"fields",children:q.map(([U,G])=>$.jsxDEV(c.default.Fragment,{children:[$.jsxDEV("dt",{children:U},void 0,!1,void 0,this),$.jsxDEV("dd",{children:$.jsxDEV(q2,{v:G},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},U,!0,void 0,this))},void 0,!1,void 0,this):null,J?$.jsxDEV("ol",{className:"messages",children:J.map((U,G)=>$.jsxDEV("li",{children:[$.jsxDEV("span",{className:"role",children:typeof U.role==="string"?U.role:"message"},void 0,!1,void 0,this),$.jsxDEV(YQ,{text:qF(U.content)},void 0,!1,void 0,this)]},G,!0,void 0,this))},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}function LQ({fields:_}){let Q=Object.entries(_??{});if(Q.length===0)return $.jsxDEV("p",{className:"mode",children:"No fields."},void 0,!1,void 0,this);return $.jsxDEV("dl",{className:"fields",children:Q.map(([J,q])=>$.jsxDEV(c.default.Fragment,{children:[$.jsxDEV("dt",{children:J},void 0,!1,void 0,this),$.jsxDEV("dd",{children:$.jsxDEV(q2,{v:q},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},J,!0,void 0,this))},void 0,!1,void 0,this)}var GF=(_)=>_.receipt?`${_.receipt.status??""}${_.receipt.externalId?` · ${_.receipt.externalId}`:""}${_.receipt.reason?` · ${_.receipt.reason}`:""}`:_.operation==="observed"?"observed from the vendor":_.provenance==="placeholder"?"default data":"none: it has not left this World";function ZF(_){let Q=new Map,J=[],q=[],U=new Map;for(let G of _){if(G.entry.landsId||G.entry.aliasOf){q.push(G);continue}let Z={...G,copies:[]};if(J.push(Z),!Q.has(`${G.twin}:${G.entry.id}`))Q.set(`${G.twin}:${G.entry.id}`,Z);if(!U.has(`${G.twin}:${G.entry.subject.type}:${G.entry.subject.id}`))U.set(`${G.twin}:${G.entry.subject.type}:${G.entry.subject.id}`,Z)}for(let G of q){let Z=G.entry.landsId?Q.get(`${G.twin}:${G.entry.landsId}`):G.entry.aliasOf?U.get(`${G.twin}:${G.entry.subject.type}:${G.entry.aliasOf}`):void 0;if(Z)Z.copies.push(G);else J.push({...G,copies:[]})}return J.sort(XQ)}var X8={deployed:5,confirmed:4,landed:3,replayed:2,skipped:1};function l_(_){let Q=[_.entry.receipt,..._.copies.map((U)=>U.entry.receipt)].filter((U)=>Boolean(U?.status));if(Q.length===0)return null;let J=Q.find((U)=>U.status==="failed"||U.status==="refused"),q=[...Q].sort((U,G)=>(X8[G.status]??0)-(X8[U.status]??0))[0];return J&&!(X8[q.status]>=5)?{status:J.status,bad:!0}:{status:q.status,bad:!1}}var k0=1280,g0=820,r4=160,w0=72,Y8=120,FF=72,c1=(_)=>`${_.vendor}:${_.id}`,E2=(_)=>`${_.vendor}:section:${_.section.id}`,g2=(_)=>[_.section.id,..._.section.aka??[]].map((Q)=>`${_.vendor}:section:${Q}`),zQ=(_,Q)=>Q.at&&("site"in Q.at)?Q.at.site:Q.at?`${Q2}/${_}/${Q.vendor}${Q.at.screen}`:null,i_=(_,Q)=>_.include?Q.filter((J)=>_.include.includes(c1(J))||g2(J).some((q)=>_.include.includes(q))):Q.filter((J)=>!(_.hidden??[]).includes(c1(J)));function HF({data:_}){let{frame:Q,url:J,active:q,picked:U,boards:G,addTo:Z,remove:F,compare:X,grab:Y}=_,K=c1(Q),H=G.filter((z)=>z.include&&!z.include.includes(K)&&!g2(Q).some((W)=>z.include.includes(W))),L=C1((z)=>z.transform[2]*(w0+Y8)>=FF);return $.jsxDEV($.Fragment,{children:[$.jsxDEV($8,{isVisible:L||U||q,position:F1.Top,align:"start",className:"frame-label",children:[$.jsxDEV("span",{className:"frame-name",onPointerDown:Y,children:[$.jsxDEV(r1,{vendor:Q.vendor},void 0,!1,void 0,this),$.jsxDEV("span",{children:Q.title},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Q.changes?$.jsxDEV("button",{type:"button",className:"frame-changed nodrag",onClick:()=>X(K),title:`${x1(Q.changes,"change")} here, not in a changeset: compare before and now`,children:[$.jsxDEV(P1,{name:"square-dot",size:14},void 0,!1,void 0,this),Q.changes]},void 0,!0,void 0,this):U?$.jsxDEV("button",{type:"button",className:"ghost nodrag",onClick:()=>X(K),title:"Compare with a branch of this World","aria-label":`Compare ${Q.title} with a branch`,children:$.jsxDEV(P1,{name:"file-diff",size:14},void 0,!1,void 0,this)},void 0,!1,void 0,this):null,U&&H.length?$.jsxDEV("select",{className:"nodrag frame-add",value:"","aria-label":`Add ${Q.title} to a board`,onChange:(z)=>{if(z.target.value)Z(z.target.value,K)},children:[$.jsxDEV("option",{value:"",children:"Add to board…"},void 0,!1,void 0,this),H.map((z)=>$.jsxDEV("option",{value:z.id,children:z.name},z.id,!1,void 0,this))]},void 0,!0,void 0,this):null,U&&F?$.jsxDEV("button",{type:"button",className:"ghost nodrag",onClick:()=>F.act(K),title:F.label,"aria-label":F.label,children:"✕"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("div",{className:q?"frame on":U?"frame picked":"frame",style:{width:k0,height:g0},children:[$.jsxDEV("div",{className:"frame-bar",children:[$.jsxDEV(r1,{vendor:Q.vendor},void 0,!1,void 0,this),$.jsxDEV("strong",{children:[B1(Q.vendor)," · ",Q.kind]},void 0,!0,void 0,this),$.jsxDEV("span",{className:"frame-url",children:Q.url.replace(/^https?:\/\//,"")},void 0,!1,void 0,this),J?$.jsxDEV("a",{className:"nodrag",href:J,target:"_blank",rel:"noopener noreferrer","aria-label":`Open ${Q.title} in a new tab`,children:"↗"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("div",{className:q?"frame-body nodrag nopan nowheel":"frame-body",children:J?$.jsxDEV("iframe",{title:Q.title,src:J,loading:"lazy",style:{pointerEvents:q?"auto":"none"}},void 0,!1,void 0,this):$.jsxDEV("div",{className:"frame-none",children:[$.jsxDEV("p",{children:$.jsxDEV("strong",{children:Q.unseen==="sites-not-routed"?`This World shows ${Q.title} only at its own local address.`:`${B1(Q.vendor)}'s twin draws no page for this ${Q.kind} yet.`},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("p",{className:"mode",children:Q.url},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function WQ({name:_,label:Q,done:J}){let q=c.useRef(!1),U=(G)=>{if(q.current)return;q.current=!0,J(G?.trim()&&G.trim()!==_?G.trim().slice(0,80):null)};return $.jsxDEV("input",{className:"nodrag nopan name-field","aria-label":Q,defaultValue:_,size:Math.max(8,_.length+2),autoFocus:!0,onFocus:(G)=>G.currentTarget.select(),onKeyDown:(G)=>{if(G.key==="Enter")U(G.currentTarget.value);else if(G.key==="Escape")U(null)},onBlur:(G)=>U(G.currentTarget.value)},void 0,!1,void 0,this)}function XF({data:_}){return $.jsxDEV($.Fragment,{children:[$.jsxDEV(S_,{isVisible:_.picked&&_.editable,minWidth:480,minHeight:360,color:"var(--accent)",onResizeEnd:_.resized},void 0,!1,void 0,this),$.jsxDEV($8,{isVisible:!0,position:F1.Top,align:"start",offset:-30,className:"section-tag",children:[_.renaming?$.jsxDEV(WQ,{name:_.name,label:"Name this section",done:(Q)=>_.renamed(_.key,Q)},void 0,!1,void 0,this):$.jsxDEV("button",{type:"button",className:_.picked?"nodrag on":"nodrag",onPointerDown:_.grab,onClick:()=>_.pick(_.key),onDoubleClick:()=>{if(_.editable)_.rename(_.key)},title:_.editable?"Double-click to rename":void 0,children:[_.vendor?$.jsxDEV(r1,{vendor:_.vendor},void 0,!1,void 0,this):null,$.jsxDEV("span",{children:_.name},void 0,!1,void 0,this)]},void 0,!0,void 0,this),_.picked&&_.editable&&!_.renaming?$.jsxDEV("button",{type:"button",className:"ghost nodrag",onClick:()=>_.remove(_.key),"aria-label":`Remove the section ${_.name}`,title:"Remove the section (its frames stay)",children:"✕"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("div",{className:_.picked?"section-box on":"section-box"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function r_({url:_,title:Q}){return $.jsxDEV("div",{className:"compare-thumb",style:{width:420,height:420*g0/k0},children:$.jsxDEV("iframe",{title:Q,src:_,loading:"lazy",style:{width:k0,height:g0,transform:`scale(${420/k0})`}},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function KF({name:_,token:Q,frame:J,onClose:q,reads:U}){let[G,Z]=c.useState(J.since?"before":""),[F,X]=c.useState({state:"opening"}),[Y,K]=c.useState(null),H=c.useRef(new Set),L=h1(Q,`/-/${_}/branches`,U),z=L.state==="ok"?L.data.branches.filter((O)=>O.name!==Y&&!H.current.has(O.name)):[],W=h1(Q,`/-/${_}/board/changes?frame=${encodeURIComponent(c1(J))}`,U),w=async(O,B,M)=>{let P=J.at;if("site"in P){let v=new URL(J.url),N=B&&/^https?:\/\/\{host\}\./.test(B)?B.replace("{host}",v.hostname.toLowerCase()):null;return N?{url:`${N}${v.pathname}${v.search}`}:{why:"This World shows its branches' sites only on this machine."}}let C=`${Q2}/-/${_}/branches/${O}/pages?${new URLSearchParams({land:`/${O}/${J.vendor}${P.screen}`}).toString()}`,f=await fetch(C,{credentials:"same-origin",redirect:"manual"}).catch(()=>null);if(M())return{why:""};return f?.type==="opaqueredirect"?{url:C}:{why:`This World does not show its branches' pages${f?`: ${await L0(f)}`:""}.`}};c.useEffect(()=>{if(!J.at){X({state:"none",why:`${B1(J.vendor)}'s twin draws no page for this ${J.kind} yet; its changes are listed below.`});return}if(G===""){X({state:"none",why:"Choose a branch of this World to set beside it."});return}let O=!1;if(G!=="before"){X({state:"opening"});let v=L.state==="ok"?L.data.branches.find((k)=>k.name===G):void 0,N=setTimeout(()=>void w(G,v?.sites??null,()=>O).then((k)=>{if(!O)X("url"in k?{state:"ok",url:k.url}:{state:"none",why:k.why})}),300);return()=>{O=!0,clearTimeout(N)}}if(!J.since){X({state:"none",why:"Nothing here has changed since the World was last cut."});return}X({state:"opening"});let B=new Date(Date.parse(J.since)-1).toISOString(),M=null,P=setTimeout(()=>void(async()=>{let v=await v1(Q,`/-/${_}/branches`,{method:"POST",body:JSON.stringify({at:{instant:B},ttl:3600}),signal:AbortSignal.timeout(60000)}).catch(()=>null);if(!v?.ok){X({state:"none",why:`The World made no copy of itself as it was then${v?`: ${await L0(v)}`:""}.`});return}let N=await v.json();if(M=N.name,K(N.name),H.current.add(N.name),O){v1(Q,`/-/${_}/branches/${N.name}`,{method:"DELETE"}).catch(()=>null);return}let k=await w(N.name,N.sites??null,()=>O);if(!O)X("url"in k?{state:"ok",url:k.url,at:B}:{state:"none",why:k.why})})(),500),C=()=>{if(M)v1(Q,`/-/${_}/branches/${M}`,{method:"DELETE",keepalive:!0}).catch(()=>null);M=null},f=(v)=>{if(!v.persisted)C()};return window.addEventListener("pagehide",f),()=>{O=!0,clearTimeout(P),window.removeEventListener("pagehide",f),C(),K(null)}},[_,Q,J.vendor,J.id,J.since,G]);let R=zQ(_,J),A=!J.at||G!==""?null:L.state==="ok"&&z.length===0?"This World has no branches to set beside it: make one under Branches.":L.state==="error"?`The World's branches could not be read: ${L.error}`:null;return $.jsxDEV("div",{className:"compare",role:"dialog","aria-label":`Changes to ${J.title}`,children:[$.jsxDEV("div",{className:"compare-head",children:[$.jsxDEV(r1,{vendor:J.vendor},void 0,!1,void 0,this),$.jsxDEV("strong",{children:J.title},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:J.changes?`${x1(J.changes,"change")} not yet cut${J.since?`, since ${D2(J.since)}`:""}`:"No changes here not yet cut"},void 0,!1,void 0,this),J.at?$.jsxDEV("label",{className:"compare-base",children:["Compare with"," ",$.jsxDEV("select",{value:G,onChange:(O)=>Z(O.target.value),children:[G===""?$.jsxDEV("option",{value:"",children:"Choose a branch…"},void 0,!1,void 0,this):null,J.since||G==="before"?$.jsxDEV("option",{value:"before",children:"Before these changes"},void 0,!1,void 0,this):null,G&&G!=="before"&&!z.some((O)=>O.name===G)?$.jsxDEV("option",{value:G,children:G.split("/")[1]},void 0,!1,void 0,this):null,z.map((O)=>$.jsxDEV("option",{value:O.name,children:[O.name.split("/")[1],O.at?.label?` (${O.at.label})`:O.at?.instant?` (as of ${D2(O.at.instant)})`:O.at?.live?" (live)":""]},O.name,!0,void 0,this))]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null,$.jsxDEV("button",{type:"button",className:"ghost",onClick:q,"aria-label":"Close the comparison",children:"✕"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"compare-sides",children:[$.jsxDEV("figure",{children:[$.jsxDEV("figcaption",{children:G==="before"?`Before${F.state==="ok"&&F.at?` · as of ${D2(F.at)}`:""}`:G?G.split("/")[1]:"A branch"},void 0,!1,void 0,this),A?$.jsxDEV("p",{className:"mode compare-note",children:A},void 0,!1,void 0,this):F.state==="ok"?$.jsxDEV(r_,{url:F.url,title:`${J.title} before`},void 0,!1,void 0,this):F.state==="opening"?$.jsxDEV("p",{className:"mode compare-note",role:"status",children:"Opening the World as it was…"},void 0,!1,void 0,this):$.jsxDEV("p",{className:"mode compare-note",children:F.why},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("figure",{children:[$.jsxDEV("figcaption",{children:"Now"},void 0,!1,void 0,this),R?$.jsxDEV(r_,{url:R,title:`${J.title} now`},void 0,!1,void 0,this):$.jsxDEV("p",{className:"mode compare-note",children:[B1(J.vendor),"'s twin draws no page for this ",J.kind," yet."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),W.state==="error"?$.jsxDEV("p",{role:"alert",className:"mode",children:["Its changes could not be read: ",W.error]},void 0,!0,void 0,this):null,G!=="before"&&G&&W.state==="ok"&&W.data.acts.length?$.jsxDEV("p",{className:"mode compare-acts-head",children:"This World's own changes here, not yet cut:"},void 0,!1,void 0,this):null,$.jsxDEV("ol",{className:"compare-acts",children:(W.state==="ok"?W.data.acts:[]).map((O)=>{let B=O.entries[0],M=P0({...B,service:J.vendor,id:"",occurredAt:O.at});return $.jsxDEV("li",{children:[$.jsxDEV("span",{className:"mode",children:D2(O.at)},void 0,!1,void 0,this),$.jsxDEV("details",{children:[$.jsxDEV("summary",{children:[$.jsxDEV("strong",{children:M.what},void 0,!1,void 0,this),M.label?` · ${M.label}`:"",O.writes>1?$.jsxDEV("span",{className:"mode",children:[" and ",x1(O.writes-1,"more write")]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("ul",{children:[O.entries.map((P,C)=>$.jsxDEV("li",{children:[$.jsxDEV("code",{children:P.operation??P.op},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:[P.subject.type," ",$2(P)]},void 0,!0,void 0,this)]},C,!0,void 0,this)),O.writes>O.entries.length?$.jsxDEV("li",{className:"mode",children:["and ",x1(O.writes-O.entries.length,"more write")]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},`${O.at}:${B.subject.type}:${B.subject.id}`,!0,void 0,this)})},void 0,!1,void 0,this),W.state==="ok"&&W.data.total>W.data.acts.length?$.jsxDEV("p",{className:"mode",children:["and ",x1(W.data.total-W.data.acts.length,"earlier change"),", in Changes"]},void 0,!0,void 0,this):null,$.jsxDEV("a",{className:"compare-all",href:`${M1}/${_}/~/changes`,onClick:(O)=>{O.preventDefault(),j1([..._.split("/"),"~","changes"])},children:"Every change in the World →"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var YF={screen:HF,section:XF};function LF(_){return $.jsxDEV(J8,{children:$.jsxDEV(zF,{..._},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function zF({name:_,token:Q,session:J,retry:q,snapshot:U,back:G,canWrite:Z}){let F=c.useRef(null),X=c.useRef(0),Y=c.useRef(Promise.resolve()),K=c.useRef(0),[,H]=c.useState(0),[L,z]=c.useState({state:"loading"}),[W,w]=c.useState(null),[R,A]=c.useState(0),O=c.useRef(0),B=c.useRef(0),M=c.useCallback(async()=>{let x=K.current,a=++O.current,$1=await v1(Q,`/-/${_}/board`,{signal:AbortSignal.timeout(15000)}).catch(()=>null),Z1=$1?.ok?await $1.json().catch(()=>null):null;if(a<B.current)return;if(B.current=a,!Z1?.frames||!Z1.boards||!Z1.version){let f1=$1?`the World answered ${$1.status}`:"the World did not answer";z((L1)=>L1.state==="ok"?L1:{state:"error",status:$1?.status??0,error:f1}),w(f1);return}if(w(null),A((f1)=>f1+1),x===K.current&&X.current===0)F.current={boards:Z1.boards,version:Z1.version};z({state:"ok",data:Z1})},[Q,_]);c.useEffect(()=>{M();let x=setInterval(()=>{if(!document.hidden)M()},1e4);return()=>clearInterval(x)},[M]);let P=L.state==="ok"?L.data.frames:[],C=F.current?.boards??[{id:"everything",name:"Everything"}],[f,v]=c.useState(null),N=P.some((x)=>x.changes),k=f??(N?"changes":"everything"),u=(k==="changes"?C[0]:C.find((x)=>x.id===k))??C[0],[i,l]=c.useState(new Set),S=Z&&!U,b=c.useCallback((x)=>{if(!F.current)return p1("The board is being read again: make that change once it shows","error"),Promise.resolve();F.current={...F.current,boards:x(F.current.boards)},X.current+=1,K.current+=1,H(($1)=>$1+1);let a=Y.current.then(async()=>{let $1=F.current;if(!$1)return;try{let Z1=await v1(Q,`/-/${_}/board`,{method:"PUT",body:JSON.stringify({boards:$1.boards,version:$1.version}),signal:AbortSignal.timeout(15000)}),f1=await Z1.json().catch(()=>null);if(Z1.ok&&f1?.boards&&f1.version)F.current={boards:X.current>1&&F.current?F.current.boards:f1.boards,version:f1.version};else if(Z1.status===409&&f1?.boards&&f1.version)F.current={boards:f1.boards,version:f1.version},p1("Someone else changed the board first: it is shown as they left it","error");else throw Error(f1?.error??`the World answered ${Z1.status}`)}catch(Z1){p1(`The board was not kept: ${Z1 instanceof Error?Z1.message:String(Z1)}`,"error"),F.current=null;let f1=await v1(Q,`/-/${_}/board`,{signal:AbortSignal.timeout(15000)}).catch(()=>null),L1=f1?.ok?await f1.json().catch(()=>null):null;if(L1?.boards&&L1.version)F.current={boards:L1.boards,version:L1.version}}}).finally(()=>{if(X.current-=1,K.current+=1,H(($1)=>$1+1),X.current===0&&!F.current)M()});return Y.current=a,a},[Q,_,M]),h=(x,a)=>{b(($1)=>$1.map((Z1)=>Z1.id===x?a(Z1):Z1))},E=(x)=>x.parent?`${x.vendor}:${x.parent}`:null,j=new Set(P.map(c1)),m=(x)=>{let a=E(x);return!a||!j.has(a)},I=k==="changes"?P.filter((x)=>x.changes):u.include?i_(u,P):i_(u,P).filter((x)=>m(x)||i.has(E(x))),V=P.filter((x)=>x.changes&&!I.includes(x)).reduce((x,a)=>x+a.changes,0),[D,y]=c.useState(null),[t,_1]=c.useState(null),[s,o]=c.useState(null),p=i5(),e=C.filter((x)=>x.include),q1=(x,a)=>h(x,($1)=>({...$1,include:[...$1.include??[],a]})),G1={label:u.include?"Take it off this board":"Hide it",act:(x)=>{_1(null),h(u.id,(a)=>a.include?{...a,include:a.include.filter(($1)=>$1!==x)}:{...a,hidden:[...a.hidden??[],x]})}},U1=(x)=>({x:x.position.x,y:x.position.y,w:x.width??x.measured?.width??k0,h:x.height??x.measured?.height??g0}),K1=(x,a)=>{let $1=U1(x),Z1=$1.x+$1.w/2,f1=$1.y+$1.h/2;return a.filter((L1)=>L1.type==="section").map((L1,A1)=>({s:L1,i:A1})).filter(({s:L1})=>{let A1=U1(L1);return Z1>=A1.x&&Z1<=A1.x+A1.w&&f1>=A1.y&&f1<=A1.y+A1.h}).sort((L1,A1)=>U1(L1.s).w*U1(L1.s).h-U1(A1.s).w*U1(A1.s).h||A1.i-L1.i)[0]?.s},W1=c.useCallback(()=>{let x=new Map;for(let R1 of I){let S1=u.placed?.[c1(R1)];if(S1)x.set(c1(R1),S1)}let a=Math.max(-r4,...[...x.values()].map((R1)=>R1.y+g0)),$1=[...new Set(I.map(E2))];for(let R1 of $1){let S1=I.filter((u1)=>E2(u1)===R1),a1=S1.filter((u1)=>x.has(c1(u1))).map((u1)=>x.get(c1(u1))),w1=a1.length?Math.max(...a1.map((u1)=>u1.x))+k0+r4:0,l1=a1.length?Math.min(...a1.map((u1)=>u1.y)):a+r4+w0*2+Y8;for(let u1 of S1)if(!x.has(c1(u1)))x.set(c1(u1),{x:w1,y:l1}),w1+=k0+r4;a=Math.max(a,l1+g0)}let Z1=u.sections??{},f1=(R1,S1,a1,w1,l1)=>({id:`sec:${R1}`,type:"section",position:{x:S1.x,y:S1.y},width:S1.w,height:S1.h,zIndex:0,draggable:S,data:{key:R1,name:a1,vendor:w1,named:l1}}),L1=[];for(let R1 of $1){let S1=I.find((D1)=>E2(D1)===R1),a1=g2(S1).find((D1)=>Z1[D1])??R1,w1=Z1[a1];if(w1?.gone)continue;let l1=I.filter((D1)=>E2(D1)===R1).map((D1)=>x.get(c1(D1))),u1={x:Math.min(...l1.map((D1)=>D1.x))-w0,y:Math.min(...l1.map((D1)=>D1.y))-w0-Y8,w:0,h:0};u1.w=Math.max(...l1.map((D1)=>D1.x))+k0+w0-u1.x,u1.h=Math.max(...l1.map((D1)=>D1.y))+g0+w0-u1.y;let l2=I.filter((D1)=>E2(D1)===R1&&!u.placed?.[c1(D1)]).map((D1)=>x.get(c1(D1))),K0=w1?{...w1}:u1;if(w1)for(let D1 of l2)K0.w=Math.max(K0.w,D1.x+k0+w0-K0.x),K0.h=Math.max(K0.h,D1.y+g0+w0-K0.y);L1.push(f1(a1,K0,w1?.name??`${B1(S1.vendor)} · ${S1.section.title}`,S1.vendor,Boolean(w1?.name)))}for(let[R1,S1]of Object.entries(Z1))if(R1.startsWith("user:")&&!S1.gone)L1.push(f1(R1,S1,S1.name??"Section",null,!0));let A1=I.map((R1)=>({id:c1(R1),type:"screen",zIndex:1,width:k0,height:g0,draggable:S,position:x.get(c1(R1)),data:{world:_,frame:R1,url:zQ(_,R1)}}));return[...L1,...A1]},[JSON.stringify(I),JSON.stringify(u),_,S]),[Y1,n,I1]=O_([]),H1=C1((x)=>x.transform[2]),m1=c.useRef("");c.useEffect(()=>{let x=W1();if(n(x),x.length&&m1.current!==k)m1.current=k,requestAnimationFrame(()=>{p.fitView({padding:{top:"72px",left:"272px",right:"40px",bottom:"72px"},duration:0})})},[W1,n]);let t1=(x,a=[],$1={})=>{let Z1=Object.fromEntries(a.map((L1)=>{let A1=p.getNode(`sec:${L1}`);if(!A1)return[L1,void 0];let R1=U1(A1),S1=A1.data,a1=$1[L1]??(S1.named?S1.name:void 0);return[L1,{x:Math.round(R1.x),y:Math.round(R1.y),w:Math.round(R1.w),h:Math.round(R1.h),...a1?{name:a1.slice(0,80)}:{}}]}).filter(([,L1])=>L1!==void 0)),f1=Object.fromEntries(Object.entries(x).map(([L1,A1])=>[L1,{x:Math.round(A1.x),y:Math.round(A1.y)}]));h(u.id,(L1)=>({...L1,placed:{...L1.placed??{},...f1},sections:{...L1.sections??{},...Z1}}))},d1=c.useRef(null),N0=(x,a)=>{if(a.type!=="section"){d1.current=null;return}let $1=p.getNodes(),Z1=U1(a),f1=(L1)=>{let A1=U1(L1);if(L1.type==="screen"){let R1=A1.x+A1.w/2,S1=A1.y+A1.h/2;return R1>=Z1.x&&R1<=Z1.x+Z1.w&&S1>=Z1.y&&S1<=Z1.y+Z1.h}return L1.id!==a.id&&A1.x>=Z1.x&&A1.y>=Z1.y&&A1.x+A1.w<=Z1.x+Z1.w&&A1.y+A1.h<=Z1.y+Z1.h};d1.current={id:a.id,from:{...a.position},members:$1.filter(f1).map((L1)=>({id:L1.id,x:L1.position.x,y:L1.position.y}))}},z0=(x,a)=>{let $1=d1.current;if(!$1||$1.id!==a.id)return;let Z1=a.position.x-$1.from.x,f1=a.position.y-$1.from.y,L1=new Map($1.members.map((A1)=>[A1.id,A1]));n((A1)=>A1.map((R1)=>{let S1=L1.get(R1.id);return S1?{...R1,position:{x:S1.x+Z1,y:S1.y+f1}}:R1}))},T0=(x,a)=>{let $1=d1.current;d1.current=null;let Z1=a.position.x-($1?.from.x??a.position.x),f1=a.position.y-($1?.from.y??a.position.y),L1=a.type==="screen"?[{id:a.id,x:a.position.x,y:a.position.y}]:($1?.members??[]).map((A1)=>({...A1,x:A1.x+Z1,y:A1.y+f1}));requestAnimationFrame(()=>{let A1=p.getNodes(),R1=new Map(L1.filter((w1)=>!w1.id.startsWith("sec:")).map((w1)=>[w1.id,{x:w1.x,y:w1.y}])),S1=new Set([...a.type==="section"?[a.data.key]:[],...L1.filter((w1)=>w1.id.startsWith("sec:")).map((w1)=>w1.id.slice(4))]),a1=new Set(A1.filter((w1)=>R1.has(w1.id)).flatMap((w1)=>g2(w1.data.frame)));for(let w1 of A1){if(w1.type==="screen"&&g2(w1.data.frame).some((l1)=>a1.has(l1))&&!R1.has(w1.id))R1.set(w1.id,{x:w1.position.x,y:w1.position.y});if(w1.type==="section"&&a1.has(w1.data.key))S1.add(w1.data.key)}t1(Object.fromEntries(R1),[...S1])})},$0=(x)=>Object.fromEntries(p.getNodes().filter((a)=>a.type==="screen"&&g2(a.data.frame).includes(x)).map((a)=>[a.id,{x:a.position.x,y:a.position.y}])),[F0,_0]=c.useState(null),W0=(x)=>{_1(`sec:${x}`),_0(x)},U2=(x,a)=>{if(_0(null),!a)return;n(($1)=>$1.map((Z1)=>Z1.id===`sec:${x}`?{...Z1,data:{...Z1.data,name:a,named:!0}}:Z1)),requestAnimationFrame(()=>t1($0(x),[x],{[x]:a}))},f0=(x)=>{_1(null);let a=p.getNode(`sec:${x}`);h(u.id,($1)=>{let Z1=Object.fromEntries(Object.entries($1.sections??{}).filter(([f1])=>f1!==x));return{...$1,sections:x.startsWith("user:")?Z1:{...Z1,[x]:{...a?{x:Math.round(a.position.x),y:Math.round(a.position.y),w:Math.round(U1(a).w),h:Math.round(U1(a).h)}:{x:0,y:0,w:0,h:0},gone:!0}}}})},p0=()=>{let x=t?p.getNode(t):void 0,a=p.screenToFlowPosition({x:window.innerWidth/2,y:window.innerHeight/2}),$1=x?.type==="screen"?{x:x.position.x-w0,y:x.position.y-w0,w:k0+w0*2,h:g0+w0*2}:{x:a.x-900,y:a.y-600,w:1800,h:1200},Z1=`user:${Date.now().toString(36)}`,f1=Object.keys(u.sections??{}).filter((L1)=>L1.startsWith("user:")).length+1;_1(`sec:${Z1}`),h(u.id,(L1)=>({...L1,sections:{...L1.sections??{},[Z1]:{x:Math.round($1.x),y:Math.round($1.y),w:Math.round($1.w),h:Math.round($1.h),name:`Section ${f1}`}}}))},c0=(x)=>(a)=>{if(!S||a.button!==0)return;let $1=p.getNode(x);if(!$1)return;let Z1=a.currentTarget;Z1.setPointerCapture(a.pointerId);let{clientX:f1,clientY:L1}=a,A1={...$1.position},R1=!1,S1=(l1)=>{let u1=p.getZoom();return{...$1,position:{x:A1.x+(l1.clientX-f1)/u1,y:A1.y+(l1.clientY-L1)/u1}}},a1=(l1)=>{if(!R1&&Math.hypot(l1.clientX-f1,l1.clientY-L1)<4)return;if(!R1)R1=!0,N0(null,$1);let u1=S1(l1);n((l2)=>l2.map((K0)=>K0.id===x?{...K0,position:u1.position}:K0)),z0(null,u1)},w1=(l1)=>{if(Z1.removeEventListener("pointermove",a1),Z1.removeEventListener("pointerup",w1),Z1.removeEventListener("pointercancel",w1),R1)T0(null,S1(l1)),Z1.addEventListener("click",(u1)=>{u1.stopPropagation(),u1.preventDefault()},{capture:!0,once:!0});else if($1.type==="screen")_1(x)};Z1.addEventListener("pointermove",a1),Z1.addEventListener("pointerup",w1),Z1.addEventListener("pointercancel",w1)},A2=Y1.map((x)=>x.type==="section"?{...x,data:{...x.data,grab:c0(x.id),picked:t===x.id,editable:S,renaming:S&&F0===x.data.key,pick:(a)=>_1(`sec:${a}`),rename:W0,renamed:U2,remove:f0,resized:()=>requestAnimationFrame(()=>{let a=x.data.key;t1($0(a),[a])})}}:{...x,data:{...x.data,grab:c0(x.id),active:D===x.id,picked:t===x.id,boards:S?e:[],addTo:q1,remove:!S||u.include&&!u.include.includes(x.id)?null:G1,compare:(a)=>{_1(a),o(a)}}});c.useEffect(()=>{let x=(a)=>{if(a.target?.closest("input, textarea, select, [contenteditable]"))return;if(a.key==="Escape"){if(D)y(null);else _1(null);return}if(!S||D)return;if((a.key==="Delete"||a.key==="Backspace")&&t){if(a.preventDefault(),t.startsWith("sec:"))f0(t.slice(4));else if(!u.include||u.include.includes(t))G1.act(t);else p1("It is on this board with its whole group: take the group off in the list to remove it","error");return}if(a.key==="S"&&a.shiftKey&&!a.metaKey&&!a.ctrlKey)a.preventDefault(),p0()};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)});let G2=(x)=>{_1(x);let a=p.getNode(x);if(!a)return;let $1=U1(a);p.fitBounds({x:$1.x,y:$1.y,width:$1.w,height:$1.h},{padding:0.15,duration:400})},l0=()=>{let x=`board-${Date.now().toString(36)}`;v(x),b((a)=>[...a,{id:x,name:`Board ${a.length}`,include:[]}])},T=()=>_0(`board:${u.id}`),g=()=>{let x=u.id;v(null),b((a)=>a.filter(($1)=>$1.id!==x))},Q1=[...new Map(P.map((x)=>[E2(x),x])).values()],J1=u.include?[...Q1.filter((x)=>!g2(x).some((a)=>u.include.includes(a))).map((x)=>({key:E2(x),label:`${B1(x.vendor)} · ${x.section.title} (all)`})),...P.filter((x)=>!I.includes(x)).map((x)=>({key:c1(x),label:x.title}))]:[],X1=u.include?[]:P.filter((x)=>(u.hidden??[]).includes(c1(x))),N1=Y1.filter((x)=>x.type==="section"),T1=Y1.filter((x)=>x.type==="screen"),y1=new Map(T1.map((x)=>[x.id,K1(x,Y1)?.id??null])),O1=new Map;for(let x of P){let a=E(x);if(a&&j.has(a))O1.set(a,(O1.get(a)??0)+1)}let B0=(x)=>{let a=x.data.frame;return $.jsxDEV("li",{children:[$.jsxDEV("button",{type:"button",className:t===x.id?"on":void 0,onClick:()=>G2(x.id),onDoubleClick:()=>y(x.id),children:[$.jsxDEV(r1,{vendor:a.vendor},void 0,!1,void 0,this),$.jsxDEV("span",{children:a.title},void 0,!1,void 0,this),a.changes?$.jsxDEV("span",{className:"layer-changed",title:`${x1(a.changes,"change")}, not in a changeset: its mark on the board compares before and now`,children:[$.jsxDEV(P1,{name:"square-dot",size:14},void 0,!1,void 0,this),a.changes]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),O1.get(x.id)&&k!=="changes"&&!u.include?$.jsxDEV("button",{type:"button",className:"ghost layer-open","aria-expanded":i.has(x.id),onClick:()=>l(($1)=>{let Z1=new Set($1);if(Z1.has(x.id))Z1.delete(x.id);else Z1.add(x.id);return Z1}),title:i.has(x.id)?"Close the pages under it":"Open the pages under it",children:[i.has(x.id)?"−":"+",O1.get(x.id)]},void 0,!0,void 0,this):null]},x.id,!0,void 0,this)},j0=typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches,Y5=J.state==="ok"&&L.state==="ok";return $.jsxDEV("div",{className:"canvas full",role:"region","aria-label":"The World's board",style:{"--zoom":H1},children:$.jsxDEV(R_,{nodes:Y5?A2:[],onNodesChange:I1,nodeTypes:YF,onNodeDragStart:N0,onNodeDrag:z0,onNodeDragStop:T0,onNodeClick:(x,a)=>{if(a.id!==D)_1(a.id)},onNodeDoubleClick:(x,a)=>{if(a.type==="screen")_1(a.id),y(a.id)},onPaneClick:()=>{y(null),_1(null)},minZoom:0.03,maxZoom:1.5,nodesConnectable:!1,elementsSelectable:!1,panOnScroll:!0,zoomOnPinch:!0,zoomOnScroll:!1,zoomOnDoubleClick:!1,colorMode:j0?"dark":"light",proOptions:{hideAttribution:!0},children:[$.jsxDEV(w_,{variant:E0.Dots,gap:28*2**Math.max(0,Math.ceil(Math.log2(16/(28*H1)))),size:2/H1},void 0,!1,void 0,this),$.jsxDEV(x0,{position:"top-left",className:"float layers",children:[$.jsxDEV("div",{className:"float-head",children:[$.jsxDEV("button",{type:"button",className:"back",onClick:G,"aria-label":`Back to ${_}`,children:"←"},void 0,!1,void 0,this),$.jsxDEV("span",{className:"float-title",children:[$.jsxDEV("strong",{children:_.split("/")[1]},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:[_.split("/")[0],U?" · snapshot":""]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"board-tabs",role:"tablist","aria-label":"Boards",children:[$.jsxDEV("button",{type:"button",role:"tab","aria-selected":k==="changes",className:k==="changes"?"on":void 0,onClick:()=>{_1(null),y(null),v("changes")},title:"The pages whose records changed and are not yet in a changeset",children:["Changes",N?` (${P.filter((x)=>x.changes).length})`:""]},void 0,!0,void 0,this),C.map((x)=>F0===`board:${x.id}`?$.jsxDEV(WQ,{name:x.name,label:"Name this board",done:(a)=>{if(_0(null),a)h(x.id,($1)=>({...$1,name:a}))}},x.id,!1,void 0,this):$.jsxDEV("button",{type:"button",role:"tab","aria-selected":k!=="changes"&&x.id===u.id,className:k!=="changes"&&x.id===u.id?"on":void 0,onClick:()=>{_1(null),y(null),v(x.id)},onDoubleClick:S&&x.id===u.id&&x.include?T:void 0,children:x.name},x.id,!1,void 0,this)),S?$.jsxDEV("button",{type:"button",className:"ghost",onClick:l0,"aria-label":"A new board",children:"+"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),u.include&&S?$.jsxDEV("div",{className:"board-acts",children:[$.jsxDEV("button",{type:"button",className:"ghost",onClick:T,children:"Rename"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",className:"ghost",onClick:g,children:"Delete board"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,$.jsxDEV("ul",{className:"layer-list","aria-label":"Layers",children:[N1.map((x)=>{let a=x.data;return $.jsxDEV("li",{children:[$.jsxDEV("button",{type:"button",className:t===x.id?"layer-section on":"layer-section",onClick:()=>G2(x.id),onDoubleClick:()=>{if(S)G2(x.id),W0(a.key)},children:[a.vendor?$.jsxDEV(r1,{vendor:a.vendor},void 0,!1,void 0,this):$.jsxDEV(P1,{name:"layout-grid",size:14},void 0,!1,void 0,this),$.jsxDEV("span",{children:a.name},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("ul",{className:"layer-list inner",children:T1.filter(($1)=>y1.get($1.id)===x.id).map(B0)},void 0,!1,void 0,this)]},x.id,!0,void 0,this)}),T1.filter((x)=>!y1.get(x.id)).map(B0)]},void 0,!0,void 0,this),u.include&&!I.length?$.jsxDEV("p",{className:"mode pad-s",children:"An empty board: add frames from Everything, or below."},void 0,!1,void 0,this):null,J1.length&&S?$.jsxDEV("select",{className:"board-add",value:"","aria-label":"Add to this board",onChange:(x)=>{let a=x.target.value;if(a)h(u.id,($1)=>({...$1,include:[...$1.include??[],a]}))},children:[$.jsxDEV("option",{value:"",children:"Add to this board…"},void 0,!1,void 0,this),J1.map((x)=>$.jsxDEV("option",{value:x.key,children:x.label},x.key,!1,void 0,this))]},void 0,!0,void 0,this):null,X1.length?$.jsxDEV("details",{className:"board-hidden",children:[$.jsxDEV("summary",{children:["Hidden (",X1.length,")"]},void 0,!0,void 0,this),$.jsxDEV("ul",{className:"layer-list",children:X1.map((x)=>$.jsxDEV("li",{children:S?$.jsxDEV("button",{type:"button",onClick:()=>h(u.id,(a)=>({...a,hidden:(a.hidden??[]).filter(($1)=>$1!==c1(x))})),children:[$.jsxDEV("span",{children:x.title},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:"Show"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):$.jsxDEV("span",{className:"pad-s",children:x.title},void 0,!1,void 0,this)},c1(x),!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,V?$.jsxDEV("button",{type:"button",className:"board-elsewhere",onClick:()=>v("changes"),children:[$.jsxDEV(P1,{name:"square-dot",size:14},void 0,!1,void 0,this),x1(V,"change")," not on this board"]},void 0,!0,void 0,this):null,$.jsxDEV(G0,{load:L,what:"the board"},void 0,!1,void 0,this),W&&L.state==="ok"?$.jsxDEV("p",{role:"alert",className:"pad-s",children:["The board could not be read again (",W,"): it shows what was last read."]},void 0,!0,void 0,this):null,J.state==="pending"?$.jsxDEV("p",{className:"mode",role:"status",children:"Opening…"},void 0,!1,void 0,this):null,J.state==="error"?$.jsxDEV("p",{role:"alert",children:["The World did not open its screens: ",J.error," ",$.jsxDEV("button",{type:"button",onClick:q,children:"Try again"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),D?$.jsxDEV(x0,{position:"top-center",className:"float hint using",children:[$.jsxDEV("span",{className:"mode",children:["Using ",I.find((x)=>c1(x)===D)?.title??D]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"button",onClick:()=>y(null),children:["Done ",$.jsxDEV("kbd",{children:"Esc"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):$.jsxDEV(x0,{position:"top-center",className:"float hint mode",children:"Scroll to pan · pinch or ⌘ scroll to zoom · double-click a frame to use it"},void 0,!1,void 0,this),S?$.jsxDEV(x0,{position:"bottom-center",className:"float board-tools",children:$.jsxDEV("button",{type:"button",className:"ghost",onClick:p0,title:"Section (⇧S): around the selected frame, else in the middle",children:[$.jsxDEV(P1,{name:"layout-grid",size:16},void 0,!1,void 0,this),$.jsxDEV("span",{children:"Section"},void 0,!1,void 0,this),$.jsxDEV("kbd",{children:"⇧S"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this):null,s&&I.some((x)=>c1(x)===s)?$.jsxDEV(x0,{position:"top-right",className:"float compare-panel",children:$.jsxDEV(KF,{name:_,token:Q,frame:I.find((x)=>c1(x)===s),onClose:()=>o(null),reads:R},s,!1,void 0,this)},void 0,!1,void 0,this):null,$.jsxDEV(N_,{showInteractive:!1,position:"bottom-left"},void 0,!1,void 0,this),$.jsxDEV(C_,{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 BQ=(_)=>_.actions.map((Q)=>({twin:Q.service,entry:{...Q.action,service:Q.service,op:Q.action.op??Q.action.operation??""}})),WF=(_)=>{let Q=_.action.input??{};return!(typeof Q.operationId==="string"||Q.graphql!==void 0&&Q.graphql!==null)};function n4(_){let Q=_.actions.filter(WF).length,J=_.actions.length-Q,q=_.applied?.receipts??[],U=_.deployed??[],G=new Set([...U.filter((X)=>X.status==="deployed"),...q.filter((X)=>X.status==="confirmed")].map((X)=>X.actionId)).size,Z=new Set([...U.filter((X)=>X.status==="refused"||X.status==="failed"),...q.filter((X)=>X.status==="failed")].map((X)=>X.actionId)).size,F={performed:G,failed:Z,total:J,own:Q};if(J>0&&G>=J)return{label:"Deployed",tone:"done",...F};if(G>0)return{label:`Partly deployed: ${G} of ${J}`,tone:"warn",...F};if(Z>0)return{label:`${Z} refused or failed`,tone:"bad",...F};if(q.some((X)=>X.status==="replayed")&&q.every((X)=>X.status==="replayed"||X.status==="skipped"))return{label:"Pushed",tone:"good",...F};return{label:"Not sent",tone:"plain",...F}}var K8=(_)=>_.message??_.narration?.split(`
37
- `)[0]?.replace(/ setting .*$/,"")??_.name;function AQ(_,Q=1){let J=_.currentHash??_.contentHash,q=_.readiness?.approvers??new Set(_.approvals.filter((G)=>G.contentHash===J).map((G)=>G.principal)).size,U=_.verification&&_.verification.contentHash===J?_.verification:null;if(U&&!U.passed)return{label:"Checks failed",tone:"bad"};if(q>0&&q<Q)return{label:`Approved by ${q} of ${Q}`,tone:"plain"};if(q>0)return{label:`Approved by ${q}`,tone:"good"};if(U)return{label:"Verified",tone:"good"};return{label:"Not verified",tone:"plain"}}function d_({name:_,token:Q,signsAs:J,c:q,canWrite:U,rooted:G,refused:Z,onChanged:F,part:X,required:Y}){let K=X==="head",H=X==="review",[L,z]=c.useState(null),[W,w]=c.useState(!1),[R,A]=c.useState(""),[O,B]=c.useState(""),[M,P]=c.useState(null),C=h1(Q,`/-/${_}/origin`),f=n4(q),v=AQ(q,Y),N=BQ(q),k=[...new Set(N.map((y)=>y.twin))],u=k.some((y)=>G.includes(y)),i=(y)=>y===(q.currentHash??q.contentHash),l=q.applied?.receipts??[],S=(q.deployed??[]).filter((y)=>y.status!=="landed"),b=l.filter((y)=>y.status==="confirmed").length,h=S.filter((y)=>y.status==="deployed"),E=async(y,t,_1,s)=>{z(y),P(null);try{let o=await v1(Q,t,{method:"POST",..._1===void 0?{}:{body:JSON.stringify(_1)}});if(!o.ok)return Z(o),P({what:y,...s1(await n0(o))}),!1;if(s)p1(s);return F(),!0}catch(o){return P({what:y,text:`the World did not answer (${o instanceof Error?o.message:String(o)})`,acts:[]}),!1}finally{z(null)}},j=()=>{E("Verify",`/-/${_}/changesets/${q.name}/verify`,void 0,"Verified: the checks ran over it")},m=async(y)=>{if(y.preventDefault(),await E("Approve",`/-/${_}/changesets/${q.name}/approve`,{...R.trim()?{note:R.trim()}:{},...J===null&&O.trim()?{as:O.trim()}:{}},"Approved"))w(!1),A("")},I=async()=>{let y=k.filter((t)=>G.includes(t));if(!await m0({title:`Deploy ${q.name} to the real vendors?`,body:$.jsxDEV($.Fragment,{children:["It performs its ",q.actions.length," change",q.actions.length===1?"":"s"," against the real account",y.length===1?"":"s"," behind ",b2(y.map(B1)),". This cannot be taken back here."]},void 0,!0,void 0,this),action:"Deploy",danger:!0,typed:q.name}))return;z("Deploy"),P(null);try{let t=await v1(Q,`/-/${_}/deploy/${q.name}`,{method:"POST",body:JSON.stringify({confirm:q.name})});if(!t.ok){Z(t),P({what:"Deploy",...s1(await n0(t))});return}let _1=await v1(Q,`/-/${_}/changesets/${q.name}`),s=_1.ok?await _1.json():null;if(!s){p1("Deploy: sent; reading its receipts failed","info"),F();return}let o=n4(s);p1(`Deploy: ${o.performed} of ${o.total} change${o.total===1?"":"s"} performed at the vendor${o.failed?`; ${o.failed} refused or failed`:""}`,o.failed?"error":o.performed?"ok":"info"),F()}catch(t){P({what:"Deploy",text:`the World did not answer (${t instanceof Error?t.message:String(t)})`,acts:[]})}finally{z(null)}},V=!U?"This session reads the World; it changes nothing":f.label==="Deployed"?"Already deployed: every change was performed at the vendor":null,D=C.state==="ok"&&C.data.origin?M8(C.data.origin):null;return $.jsxDEV("div",{className:"changeset","aria-labelledby":"changeset-title",children:[K?$.jsxDEV($.Fragment,{children:[$.jsxDEV("div",{className:"changeset-head",children:[$.jsxDEV("div",{children:[$.jsxDEV("h3",{id:"changeset-title",children:[q.message??q.name," ",$.jsxDEV("span",{className:`badge cs-${f.tone}`,children:f.label},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:`badge cs-${v.tone}`,children:v.label},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("p",{className:"mode",children:[$.jsxDEV("code",{children:q.name},void 0,!1,void 0,this)," · made ",$.jsxDEV(V1,{iso:q.createdAt},void 0,!1,void 0,this)," · ",q.actions.length," change",q.actions.length===1?"":"s"," at ",b2(k.map(B1))||"no vendor"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"changeset-actions",children:[$.jsxDEV("button",{type:"button",onClick:j,disabled:Boolean(V)||L!==null,title:V??"Replay it in a throwaway World and run the World's checks",children:L==="Verify"?"Verifying…":"Verify"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",onClick:()=>w(!0),disabled:Boolean(V)||L!==null,title:V??"Sign its current contents as yourself",children:"Approve…"},void 0,!1,void 0,this),u?$.jsxDEV("button",{type:"button",className:"primary",onClick:()=>void I(),disabled:Boolean(V)||L!==null,title:V??"Perform it against the real accounts behind this World",children:L==="Deploy"?"Deploying…":"Deploy…"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),V&&f.label!=="Deployed"?$.jsxDEV("p",{className:"mode",children:[V,"."]},void 0,!0,void 0,this):null,M?$.jsxDEV("div",{role:"alert",className:"refusal",children:[$.jsxDEV("span",{children:[$.jsxDEV("b",{children:M.what},void 0,!1,void 0,this),": ",M.text]},void 0,!0,void 0,this),M.acts.includes("verify")&&U?$.jsxDEV("button",{type:"button",onClick:j,disabled:L!==null,children:"Verify"},void 0,!1,void 0,this):null,M.acts.includes("approve")&&U?$.jsxDEV("button",{type:"button",onClick:()=>w(!0),disabled:L!==null,children:"Approve…"},void 0,!1,void 0,this):null,$.jsxDEV(n_,{name:_,acts:M.acts},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this):null,H?$.jsxDEV($.Fragment,{children:[q.narration?$.jsxDEV("p",{className:"narration",children:q.narration},void 0,!1,void 0,this):null,$.jsxDEV("h4",{children:"Where it went"},void 0,!1,void 0,this),$.jsxDEV("div",{className:"block where",children:[f.performed>0?$.jsxDEV("p",{className:"pad",children:[f.performed>=f.total?"Deployed":"Partly deployed",": ",f.performed," of ",f.total," change",f.total===1?"":"s",f.own?` (and ${f.own} of the World's own, which stay in it)`:""," performed at ",b2([...new Set([...h.map((y)=>y.service),...l.filter((y)=>y.status==="confirmed").map((y)=>y.service)].map(B1))]),h.length?` (${h.length} from here`:" (",h.length&&b?", ":"",b?`${b} by the remote`:"",")."]},void 0,!0,void 0,this):f.label==="Pushed"?$.jsxDEV("p",{className:"pad",children:["Pushed to the remote",D?$.jsxDEV($.Fragment,{children:[" ",$.jsxDEV("code",{children:D},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,q.applied?$.jsxDEV($.Fragment,{children:[" · ",$.jsxDEV(V1,{iso:q.applied.at},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,": every change was replayed there. No vendor has performed any of it."]},void 0,!0,void 0,this):f.failed===0?$.jsxDEV("p",{className:"pad",children:["Not sent: it is only in this World.",q.applied?.outcome==="refused"?" A push was refused (below); Push sends it again.":$.jsxDEV($.Fragment,{children:[" Push sends it to the remote World",u?"; Deploy, to the real vendors behind it":"","."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null,f.failed>0?$.jsxDEV("p",{className:"pad failed",role:"alert",children:[f.failed," change",f.failed===1?" was":"s were"," refused or failed at the vendor",[...S.filter((y)=>y.reason&&(y.status==="refused"||y.status==="failed")).map((y)=>y.reason),...l.filter((y)=>y.status==="failed"&&y.error).map((y)=>y.error)].slice(0,3).map((y)=>`: ${s1(y).text}`).join(""),"."]},void 0,!0,void 0,this):null,q.applied?.refusal?.length?$.jsxDEV("ul",{className:"checks pad",children:q.applied.refusal.map((y,t)=>$.jsxDEV("li",{className:"mode",children:s1(y).text},t,!1,void 0,this))},void 0,!1,void 0,this):null,S.length?$.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"pad where-sub mode",children:"At the vendor"},void 0,!1,void 0,this),$.jsxDEV("ul",{className:"receipts pad",children:S.map((y)=>$.jsxDEV("li",{children:[$.jsxDEV("span",{className:y.status==="refused"||y.status==="failed"?"badge cs-bad":y.status==="deployed"?"badge cs-done":"badge",children:y.status},void 0,!1,void 0,this)," ",B1(y.service)," ",y.status==="deployed"?y.url?$.jsxDEV("a",{href:y.url,target:"_blank",rel:"noopener noreferrer",children:y.externalId??y.url},void 0,!1,void 0,this):y.externalId?$.jsxDEV("code",{children:y.externalId},void 0,!1,void 0,this):null:null,y.reason?$.jsxDEV("span",{className:"mode",children:[" · ",s1(y.reason).text]},void 0,!0,void 0,this):null," ",$.jsxDEV("span",{className:"mode",children:["· ",$.jsxDEV(V1,{iso:y.at},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},`v:${y.actionId}`,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,l.length?$.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"pad where-sub mode",children:"At the remote"},void 0,!1,void 0,this),$.jsxDEV("ul",{className:"receipts pad",children:l.map((y)=>$.jsxDEV("li",{children:[$.jsxDEV("span",{className:y.status==="failed"?"badge cs-bad":y.status==="confirmed"?"badge cs-done":"badge",children:y.status},void 0,!1,void 0,this)," ",B1(y.service)," ",$.jsxDEV("span",{className:"mode",children:y.status==="replayed"?"replayed at the remote World":y.status==="confirmed"?"performed at the vendor by the remote":""},void 0,!1,void 0,this),y.status==="confirmed"&&y.externalId?$.jsxDEV($.Fragment,{children:[" ",$.jsxDEV("code",{children:y.externalId},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,y.error?$.jsxDEV("span",{className:"mode",children:[" · ",s1(y.error).text]},void 0,!0,void 0,this):null]},`r:${y.actionId}`,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),!u&&f.label!=="Deployed"?$.jsxDEV("p",{className:"mode",children:["No vendor it changes is connected to its real service here, so it does not deploy from this World. ",$.jsxDEV("a",{href:`${M1}/${_}/~/settings/services`,onClick:(y)=>{y.preventDefault(),j1([..._.split("/"),"~","settings","services"])},children:"Connect a vendor in Settings › Real services"},void 0,!1,void 0,this)," to deploy."]},void 0,!0,void 0,this):null,$.jsxDEV("h4",{children:"Checks"},void 0,!1,void 0,this),!q.verification?$.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):$.jsxDEV("div",{className:i(q.verification.contentHash)?"":"stale",children:[$.jsxDEV("p",{children:[q.verification.passed?"✓ Passed":"✗ Failed"," · ",$.jsxDEV(V1,{iso:q.verification.at},void 0,!1,void 0,this),i(q.verification.contentHash)?null:$.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),q.verification.results.length?$.jsxDEV("ul",{className:"checks",children:q.verification.results.map((y)=>$.jsxDEV("li",{children:[y.passed?"✓":"✗"," ",$.jsxDEV("code",{children:y.id},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:B1(y.service)},void 0,!1,void 0,this)]},y.id,!0,void 0,this))},void 0,!1,void 0,this):null,q.verification.refusals?.length?$.jsxDEV("ul",{className:"checks",children:q.verification.refusals.map((y,t)=>$.jsxDEV("li",{children:["✗ ",$.jsxDEV("code",{children:y.check},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:[B1(y.service),": ",y.reason]},void 0,!0,void 0,this)]},t,!0,void 0,this))},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("h4",{children:"Approvals"},void 0,!1,void 0,this),q.approvals.length===0?$.jsxDEV("p",{className:"mode",children:"No one has approved it."},void 0,!1,void 0,this):$.jsxDEV("ul",{className:"approvals",children:q.approvals.map((y,t)=>$.jsxDEV("li",{children:[$.jsxDEV("b",{children:y.principal},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:[$.jsxDEV(V1,{iso:y.at},void 0,!1,void 0,this),i(y.contentHash)?"":" · signed an earlier version"]},void 0,!0,void 0,this),y.note?$.jsxDEV("div",{className:"mode",children:["“",y.note,"”"]},void 0,!0,void 0,this):null]},t,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,$.jsxDEV(M0,{open:W,onClose:()=>{if(!L)w(!1)},title:`Approve ${q.name}`,footer:$.jsxDEV($.Fragment,{children:[$.jsxDEV("button",{type:"button",onClick:()=>w(!1),disabled:L!==null,children:"Cancel"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"submit",form:"approve-changeset",className:"primary",disabled:L!==null,children:L==="Approve"?"Approving…":"Approve"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:$.jsxDEV("form",{id:"approve-changeset",onSubmit:(y)=>void m(y),className:"stack",children:[$.jsxDEV("p",{className:"mode",children:["You sign its contents as they stand now",J?$.jsxDEV($.Fragment,{children:[", recorded as ",$.jsxDEV("b",{children:J},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),J===null?$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"Approving as"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"approveAs",value:O,onChange:(y)=>B(y.target.value),maxLength:80,required:!0,placeholder:"your name or email",autoComplete:"off"},void 0,!1,void 0,this),$.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,$.jsxDEV("label",{children:[$.jsxDEV("span",{children:["Note ",$.jsxDEV("span",{className:"mode",children:"(optional)"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("textarea",{name:"approveNote",value:R,onChange:(y)=>A(y.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)}var MQ=(_,Q)=>JSON.stringify(_)===JSON.stringify(Q);function BF({changes:_,idPrefix:Q}){let J=[...new Set(_.map((q)=>q.twin))];return $.jsxDEV($.Fragment,{children:J.map((q)=>{let U=_.filter((Z)=>Z.twin===q).map((Z)=>Z.entry),G=[...new Set(U.map((Z)=>`${Z.subject.type}:${Z.subject.id}`))];return $.jsxDEV("div",{className:"compare",role:"group","aria-labelledby":`${Q}-${q}`,children:[$.jsxDEV("h3",{id:`${Q}-${q}`,className:"vendor-cell",children:[$.jsxDEV(r1,{vendor:q},void 0,!1,void 0,this),B1(q)," ",$.jsxDEV("span",{className:"mode",children:["· ",x1(G.length,"record"),", ",x1(U.length,"write")]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("ul",{children:G.map((Z)=>{let F=U.filter((H)=>`${H.subject.type}:${H.subject.id}`===Z),X=F[F.length-1],Y=P0(X),K={};return $.jsxDEV("li",{className:"record",children:[$.jsxDEV("p",{className:"record-head",children:[$.jsxDEV("span",{className:"kind",children:X.subject.type.replace(/^_+/,"").replace(/[_-]+/g," ")},void 0,!1,void 0,this)," ",Y.label?$.jsxDEV("span",{className:"label",children:["“",Y.label,"”"]},void 0,!0,void 0,this):null," ",$.jsxDEV("code",{children:$2(X)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.map((H)=>{let L=H.fields??{},z=Object.entries(L).filter(([w,R])=>!(w in K)||!MQ(K[w],R)),W=K;return K={...K,...L},$.jsxDEV("div",{className:"write",children:[$.jsxDEV("p",{className:"mode",children:[$.jsxDEV("span",{className:"op",children:P0(H).what},void 0,!1,void 0,this)," · ",$.jsxDEV(V1,{iso:H.occurredAt},void 0,!1,void 0,this)," · ",s5(H)]},void 0,!0,void 0,this),z.length===0?$.jsxDEV("p",{className:"mode",children:"It set no field to a new value."},void 0,!1,void 0,this):$.jsxDEV("dl",{className:"fields field-diff","aria-label":`Fields ${P0(H).what} set`,children:z.map(([w,R])=>$.jsxDEV(c.default.Fragment,{children:[$.jsxDEV("dt",{children:w},void 0,!1,void 0,this),$.jsxDEV("dd",{children:w in W?$.jsxDEV("span",{className:"changed",children:[$.jsxDEV("del",{children:$.jsxDEV(q2,{v:W[w]},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("span",{className:"arrow","aria-label":"becomes",children:"→"},void 0,!1,void 0,this),$.jsxDEV("ins",{children:$.jsxDEV(q2,{v:R},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):$.jsxDEV(q2,{v:R},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},w,!0,void 0,this))},void 0,!1,void 0,this)]},H.id,!0,void 0,this)})]},Z,!0,void 0,this)})},void 0,!1,void 0,this)]},q,!0,void 0,this)})},void 0,!1,void 0,this)}function AF({name:_,token:Q,changes:J,canWrite:q,refused:U,onCut:G,pinned:Z,generated:F,inputRef:X,author:Y}){let[K,H]=c.useState(""),[L,z]=c.useState(!1),[W,w]=c.useState([]),R=(O,B,M)=>{w((P)=>[{ok:O,text:B,at:new Date().toISOString(),n:++n5,...M?.length?{acts:M}:{}},...P].slice(0,4))},A=async(O)=>{O.preventDefault(),z(!0);try{let B=await v1(Q,`/-/${_}/changesets`,{method:"POST",body:JSON.stringify(K.trim()?{message:K.trim()}:{})});if(!B.ok){U(B);let P=s1(await n0(B));R(!1,`Cut a changeset: ${P.text}`,P.acts);return}let M=await B.json();R(!0,`Cut ${M.name??"a changeset"}: ${x1(M.actions?.length??0,"change")}, ready to review in History and push.`),H(""),G()}catch(B){R(!1,`Cut a changeset: the World did not answer (${B instanceof Error?B.message:String(B)})`)}finally{z(!1)}};if(Z){let O=!q?"This session reads the World; it changes nothing":J===0?"Nothing to cut: no change is outside a changeset":null;return $.jsxDEV("div",{className:"ws-cut",children:[$.jsxDEV(B2,{log:W,name:_},void 0,!1,void 0,this),$.jsxDEV("form",{onSubmit:(B)=>void A(B),"aria-label":"Cut a changeset",children:[Y?$.jsxDEV("a",{className:"ws-author",href:Y.account,title:`${Y.who}: your account`,onClick:(B)=>{B.preventDefault(),j1(Y.account.slice(M1.length+1).split("/"))},children:Y.face},void 0,!1,void 0,this):null,$.jsxDEV("input",{ref:X,name:"changesetMessage","aria-label":"Summary",value:K,onChange:(B)=>H(B.target.value),placeholder:J===0?"Nothing to cut":F?"Summary (optional)":"Summary (required)",required:!F,maxLength:200,disabled:Boolean(O),title:O??void 0},void 0,!1,void 0,this),$.jsxDEV("button",{type:"submit",className:"primary",disabled:Boolean(O)||L,title:O??void 0,children:L?"Cutting…":J===0?"Cut a changeset":$.jsxDEV($.Fragment,{children:["Cut ",x1(J,"change"),Y?$.jsxDEV($.Fragment,{children:[" on ",$.jsxDEV("b",{children:Y.branch},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)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}if(!q||J===0)return $.jsxDEV(B2,{log:W,name:_},void 0,!1,void 0,this);return $.jsxDEV($.Fragment,{children:[$.jsxDEV("form",{className:"block cut pad",onSubmit:(O)=>void A(O),"aria-label":"Cut a changeset",children:[$.jsxDEV("label",{children:[$.jsxDEV("span",{children:["Cut ",J===1?"this change":`these ${J} changes`," into a changeset: what it does and why"]},void 0,!0,void 0,this),$.jsxDEV("input",{name:"changesetMessage",value:K,onChange:(O)=>H(O.target.value),placeholder:"Welcome email for new sign-ups",required:!0,maxLength:200,disabled:J===0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"submit",className:"primary",disabled:L||J===0,children:L?"Cutting…":"Cut a changeset"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(B2,{log:W,name:_},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function MF({name:_,token:Q}){let[J,q]=c.useState(0),U=h1(Q,`/-/${_}/keys`,J),[G,Z]=c.useState(!1),[F,X]=c.useState(""),[Y,K]=c.useState("write"),[H,L]=c.useState(!1),[z,W]=c.useState(null),[w,R]=c.useState(null),[A,O]=c.useState(null),B=async()=>{let C=`Read-only link · ${new Date().toLocaleDateString(void 0,{month:"short",day:"numeric"})}`,f=await v1(Q,`/-/${_}/keys`,{method:"POST",body:JSON.stringify({name:C,scope:"read"})}).catch(()=>null),v=f?await f.json().catch(()=>({})):{error:`${k1} did not answer`};if(!f?.ok||!v.key){p1(v.error?s1(v.error).text:"refused","error");return}O(`${window.location.origin}${M1}/${_}#${new URLSearchParams({token:v.key}).toString()}`),q((N)=>N+1)},M=async(C)=>{C.preventDefault(),L(!0),W(null);let f=await v1(Q,`/-/${_}/keys`,{method:"POST",body:JSON.stringify({name:F.trim(),scope:Y})}).catch(()=>null);L(!1);let v=f?await f.json().catch(()=>({})):{error:`${k1} did not answer`};if(!f?.ok||!v.key){W(v.error?s1(v.error).text:"refused");return}Z(!1),R({key:v.key,name:F.trim()}),X(""),q((N)=>N+1)},P=async(C)=>{if(!await m0({title:`Revoke ${C.name}?`,body:"Whatever holds it loses this World at once.",action:"Revoke key",danger:!0}))return;let f=await v1(Q,`/-/${_}/keys/${C.id}`,{method:"DELETE"});if(f.ok)p1(`Revoked ${C.name}`);else p1(await L0(f),"error");q((v)=>v+1)};return $.jsxDEV("section",{"aria-labelledby":"keys-head",className:"keys",children:[$.jsxDEV("div",{className:"keys-head",children:[$.jsxDEV("div",{children:[$.jsxDEV("h3",{id:"keys-head",children:"Keys"},void 0,!1,void 0,this),$.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),Z0()?$.jsxDEV("a",{className:"button primary",href:`${Z0()}/${encodeURIComponent(_.split("/")[0]??"")}`,children:"Make a key on the platform"},void 0,!1,void 0,this):$.jsxDEV("div",{className:"head-actions",children:[$.jsxDEV("button",{type:"button",onClick:()=>void B(),children:"Share a read-only link"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",className:"primary",onClick:()=>{W(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),$.jsxDEV(G0,{load:U,what:"the keys",retry:()=>q((C)=>C+1)},void 0,!1,void 0,this),U.state==="ok"?U.data.keys.length===0?$.jsxDEV("p",{className:"mode",children:"No keys yet. The World's own token opens it too."},void 0,!1,void 0,this):$.jsxDEV("table",{className:"dense","aria-label":"Keys",children:[$.jsxDEV("thead",{children:$.jsxDEV("tr",{children:[$.jsxDEV("th",{children:"Name"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"For"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Access"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Made"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Last used"},void 0,!1,void 0,this),$.jsxDEV("th",{className:"num",children:$.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),$.jsxDEV("tbody",{children:U.data.keys.map((C)=>$.jsxDEV("tr",{children:[$.jsxDEV("td",{children:C.name},void 0,!1,void 0,this),$.jsxDEV("td",{children:C.person??$.jsxDEV("span",{className:"mode",title:"It acts as itself: a service",children:"no one: a service"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:C.scope==="write"?"Read and write":"Read only"},void 0,!1,void 0,this),$.jsxDEV("td",{className:"mode",children:$.jsxDEV("span",{title:D2(C.createdAt),children:G8(C.createdAt)},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{className:"mode",children:C.lastUsedAt?G8(C.lastUsedAt):"never"},void 0,!1,void 0,this),$.jsxDEV("td",{className:"num",children:$.jsxDEV(D_,{label:`More for ${C.name}`,items:[{label:"Revoke…",danger:!0,onSelect:()=>void P(C)}]},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},C.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,$.jsxDEV(M0,{open:G,onClose:()=>{if(!H)Z(!1)},title:"Make a key",footer:$.jsxDEV($.Fragment,{children:[$.jsxDEV("button",{type:"button",onClick:()=>Z(!1),disabled:H,children:"Cancel"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"submit",form:"make-key",disabled:H||!F.trim(),children:H?"Making…":"Make key"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:$.jsxDEV("form",{id:"make-key",onSubmit:M,"aria-label":"Make a key",children:[$.jsxDEV("label",{children:["Name ",$.jsxDEV("input",{autoFocus:!0,name:"keyName",value:F,onChange:(C)=>X(C.target.value),placeholder:"ci, staging app…",maxLength:80,required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("label",{children:["Access ",$.jsxDEV("select",{value:Y,onChange:(C)=>K(C.target.value==="read"?"read":"write"),children:[$.jsxDEV("option",{value:"write",children:"Read and write"},void 0,!1,void 0,this),$.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),z?$.jsxDEV("p",{role:"alert",children:z},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV(M0,{open:Boolean(w),onClose:()=>R(null),title:`${w?.name??"The key"} is ready`,footer:$.jsxDEV("button",{type:"button",className:"primary",onClick:()=>R(null),children:"Done"},void 0,!1,void 0,this),children:[$.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),w?$.jsxDEV(F8,{label:"Key",value:w.key,secret:!0},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV(M0,{open:Boolean(A),onClose:()=>O(null),title:"A read-only link",footer:$.jsxDEV("button",{type:"button",className:"primary",onClick:()=>O(null),children:"Done"},void 0,!1,void 0,this),children:[$.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),A?$.jsxDEV(F8,{label:"Link",value:A,secret:!0},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var n5=0;function B2({log:_,name:Q}){if(_.length===0)return null;return $.jsxDEV("ul",{className:"narration-log",role:"status","aria-live":"polite",children:_.map((J)=>$.jsxDEV("li",{className:J.ok?"ok":"bad",children:[$.jsxDEV("span",{className:"mode",children:$.jsxDEV(V1,{iso:J.at,time:!0},void 0,!1,void 0,this)},void 0,!1,void 0,this)," ",J.text,J.acts?$.jsxDEV(n_,{name:Q,acts:J.acts},void 0,!1,void 0,this):null]},J.n,!0,void 0,this))},void 0,!1,void 0,this)}function TQ(_,Q,J,q){let[U,G]=c.useState(0),Z=U*1e5+Math.floor(J/2),F=h1(Q,`/-/${_}/origin`,Z),X=h1(Q,`/-/${_}/diff`,Z),Y=h1(Q,`/-/${_}/changesets`,Z),[K,H]=c.useState([]),[L,z]=c.useState(null),W=(P,C,f)=>{if(H((v)=>[{ok:P,text:C,at:new Date().toISOString(),n:++n5,...f?.length?{acts:f}:{}},...v].slice(0,8)),!P)p1(C,"error")},w=async(P,C,f)=>{z(P);try{let v=await v1(Q,`/-/${_}/${C}`,f);if(!v.ok){q(v);let N=s1(await n0(v));return W(!1,`${P}: ${N.text}`,N.acts),null}return await v.json()}catch(v){return W(!1,`${P}: the World did not answer (${v instanceof Error?v.message:String(v)})`),null}finally{z(null),G((v)=>v+1)}},R=F.state==="ok"&&F.data.origin?M8(F.data.origin):null,A=X.state==="ok"?X.data.changes.length:null,O=Y.state==="ok"&&R?tZ(Y.data.changesets.filter((P)=>!P.pushedBy)).sort((P,C)=>P.createdAt.localeCompare(C.createdAt)):[];return{origin:F,diff:X,sets:Y,there:R,changes:A,waiting:O,log:K,busy:L,say:W,send:w,push:async()=>{let P=await w("Push","origin/push",{method:"POST"});if(!P)return;if(P.pushed.length===0){W(!0,"Nothing to push: every changeset is already at the remote.");return}for(let C of P.pushed){let f=C.receipts??[],v=f.filter((l)=>l.status==="replayed").length,N=f.filter((l)=>l.status==="confirmed").length,k=f.filter((l)=>l.status==="failed").length,u=C.outcome==="applied"&&k===0;if(C.outcome==="refused"){W(!1,`Push of ${C.changeset} was refused${C.refusal?.length?`: ${C.refusal.map((l)=>s1(l).text).join("; ")}`:""}.`);continue}let i=[`${v} of ${x1(f.length,"change")} replayed there`,...N?[`${N} performed at the vendor by the remote`]:[],...k?[`${k} failed`]:[]];W(u,`${C.outcome==="partial"?"Partly pushed":"Pushed"} ${C.changeset} to ${R??"the remote"}: ${i.join("; ")}${C.refusal?.length?` (${C.refusal.map((l)=>s1(l).text).join("; ")})`:""}.`)}},pull:async()=>{let P=await w("Pull","origin/pull",{method:"POST"});if(!P)return;let C=Object.entries(P.appended).filter(([,v])=>v>0),f=P.rebased.flatMap((v)=>v.conflicts.map((N)=>`${B1(v.twin)} ${N.subject.type}:${N.subject.id} ${N.field}`));W(f.length===0,`Pulled from ${R??"the remote"}: ${C.length?C.map(([v,N])=>`${x1(N,"entry")} at ${B1(v)}`).join(", "):"nothing new"}${f.length?`; conflicts at ${f.join(", ")}`:""}.`)}}}function TF({name:_,token:Q,canWrite:J,tick:q,refused:U}){let{origin:G,there:Z,changes:F,log:X,busy:Y,say:K,send:H,push:L,pull:z}=TQ(_,Q,q,U),[W,w]=c.useState(""),[R,A]=c.useState(""),[O,B]=c.useState(!1),M=async(C)=>{C.preventDefault();let f=await H("Name the remote","origin",{method:"PUT",body:JSON.stringify({url:W.trim(),token:R.trim()})});if(f){let v=Object.values(f.appended??{}).reduce((N,k)=>N+k,0);K(!0,`The remote is ${M8(f.origin)}: its history came in (${x1(v,"entry")}).`),A(""),B(!1)}},P=!J?"This session reads the World; it changes nothing":null;return $.jsxDEV($.Fragment,{children:[$.jsxDEV("div",{className:"block remote",children:[$.jsxDEV("div",{className:"block-head",children:[$.jsxDEV("h3",{children:"Origin"},void 0,!1,void 0,this),J?$.jsxDEV("button",{type:"button",onClick:()=>{w(Z??""),B(!O)},"aria-expanded":O,children:Z?"Change the remote…":"Name a remote…"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"pad",children:[G.state==="ok"?Z?$.jsxDEV("p",{children:[$.jsxDEV("code",{className:"big",children:Z},void 0,!1,void 0,this),G.data.origin?.fetchedAt?$.jsxDEV("span",{className:"mode",children:[" · last fetched ",$.jsxDEV(V1,{iso:G.data.origin.fetchedAt},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this):$.jsxDEV("p",{children:"No remote — this World keeps its default data. Name one to push its changesets to a shared World and pull what others pushed there."},void 0,!1,void 0,this):$.jsxDEV(G0,{load:G,what:"the remote",lines:1},void 0,!1,void 0,this),O?$.jsxDEV("form",{className:"stack origin-form",onSubmit:(C)=>void M(C),"aria-label":"Name the remote",children:[$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"The World's address"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"originUrl",value:W,onChange:(C)=>w(C.target.value),placeholder:"https://worlds.example.com/acme/team",required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"A key or token that opens it"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"originToken",type:"password",value:R,onChange:(C)=>A(C.target.value),required:!0,autoComplete:"off"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("p",{className:"mode",children:"Naming it brings its history in. Your pushes are recorded there as whoever this key was made for, or as the key itself."},void 0,!1,void 0,this),$.jsxDEV("div",{className:"row-actions",children:[$.jsxDEV("button",{type:"submit",className:"primary",disabled:Y!==null,children:Y==="Name the remote"?"Bringing its history in…":"Save the remote"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",onClick:()=>B(!1),children:"Cancel"},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)]},void 0,!0,void 0,this),$.jsxDEV(B2,{log:X,name:_},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function RF({name:_,token:Q,canWrite:J,refused:q}){let[U,G]=c.useState(0),Z=h1(Q,`/-/${_}/twins`,U),F=h1(Q,`/-/${_}/links`,U),X=h1(Q,`/-/${_}/requests?hours=24`,U),[Y,K]=c.useState({}),[H,L]=c.useState(null),[z,W]=c.useState(""),[w,R]=c.useState(!1),[A,O]=c.useState([]),B=(N,k,u)=>{if(O((i)=>[{ok:N,text:k,at:new Date().toISOString(),n:++n5,...u?.length?{acts:u}:{}},...i].slice(0,6)),!N)p1(k,"error")},M=F.state==="ok"?Object.keys(F.data.links).sort():[];c.useEffect(()=>{let N=!0;return Promise.all(M.map(async(k)=>{let u=await v1(Q,`/-/${_}/twins/${k}/credential`).catch(()=>null),i=u?.ok?await u.json():null;return[k,i?.credential??null]})).then((k)=>{if(N)K(Object.fromEntries(k))}),()=>{N=!1}},[_,Q,M.join(","),U]);let P=async(N)=>{if(N.preventDefault(),!H||!z)return;R(!0);let k=await v1(Q,`/-/${_}/twins/${H.vendor}/credential`,{method:"PUT",body:z,headers:{"content-type":"text/plain"}}).catch(()=>null);if(R(!1),!k){B(!1,`Seal ${H.vendor}: ${k1} did not answer`);return}if(!k.ok){q(k);let i=s1(await n0(k));B(!1,`Seal ${B1(H.vendor)}: ${i.text}`,i.acts);return}let u=await k.json().catch(()=>({}));B(!0,`Sealed a credential for ${B1(H.vendor)}${u.fingerprint?` (${u.fingerprint})`:""}: it opens for ${u.boundTo??H.to} only, and is never shown again.`),W(""),L(null),G((i)=>i+1)},C=async(N)=>{if(!await m0({title:`Remove the link ${N}?`,body:`Requests to ${Q2}/${_}/${N}/… stop being forwarded to ${F.state==="ok"?F.data.links[N]?.origin:"its origin"}.`,action:"Remove link",danger:!0}))return;let k=await v1(Q,`/-/${_}/links/${N}`,{method:"DELETE"}).catch(()=>null);if(!k?.ok){if(k)q(k);B(!1,`Remove ${N}: ${k?await L0(k):"the World did not answer"}`);return}B(!0,`Removed the link ${N}.`),G((u)=>u+1)},f=(N)=>N?$.jsxDEV($.Fragment,{children:[$.jsxDEV("span",{className:"badge rooted",children:"sealed"},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:[N.fingerprint?$.jsxDEV("code",{children:N.fingerprint},void 0,!1,void 0,this):null," · ",$.jsxDEV(V1,{iso:N.placedAt},void 0,!1,void 0,this),N.sealedBy?` · by ${N.sealedBy==="vault"?"the vault":"the host's key"}`:""]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):$.jsxDEV("span",{className:"mode",children:"none"},void 0,!1,void 0,this),v=Z.state==="ok"?Z.data.twins:[];return $.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"lede",children:"A real vendor's credential lives in one place, sealed: beside this World, bound to where it goes. It is never readable back; this page says only that one is sealed, when, by what, and for where."},void 0,!1,void 0,this),$.jsxDEV(B2,{log:A,name:_},void 0,!1,void 0,this),$.jsxDEV("section",{className:"block","aria-labelledby":"creds-head",children:[$.jsxDEV("div",{className:"block-head",children:$.jsxDEV("h3",{id:"creds-head",children:"Vendors"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV(G0,{load:Z,what:"the vendors"},void 0,!1,void 0,this),Z.state==="ok"?$.jsxDEV("table",{className:"dense","aria-label":"Credentials by vendor",children:[$.jsxDEV("thead",{children:$.jsxDEV("tr",{children:[$.jsxDEV("th",{children:"Vendor"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Credential"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Bound to"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Real service"},void 0,!1,void 0,this),J?$.jsxDEV("th",{className:"num",children:$.jsxDEV("span",{className:"sr",children:"Actions"},void 0,!1,void 0,this)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("tbody",{children:v.map((N)=>$.jsxDEV("tr",{children:[$.jsxDEV("td",{children:$.jsxDEV("span",{className:"vendor-cell",children:[$.jsxDEV(r1,{vendor:N.twin},void 0,!1,void 0,this),B1(N.twin)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:f(N.credential)},void 0,!1,void 0,this),$.jsxDEV("td",{children:N.credential?.boundTo?$.jsxDEV("code",{children:N.credential.boundTo},void 0,!1,void 0,this):$.jsxDEV("span",{className:"mode",children:"—"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:N.root?.url?$.jsxDEV("code",{children:N.root.url},void 0,!1,void 0,this):$.jsxDEV("span",{className:"mode",children:"none: a stand-in"},void 0,!1,void 0,this)},void 0,!1,void 0,this),J?$.jsxDEV("td",{className:"num",children:$.jsxDEV("button",{type:"button",disabled:!N.root?.url,title:N.root?.url?`Seal ${B1(N.twin)}'s real credential for ${N.root.url}`:"Connect it to its real service first (Settings › Real services): a credential is sealed for where it goes",onClick:()=>{W(""),L({vendor:N.twin,to:N.root.url})},children:N.credential?"Replace…":"Seal a credential…"},void 0,!1,void 0,this)},void 0,!1,void 0,this):null]},N.twin,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,Z.state==="ok"&&v.every((N)=>!N.root?.url)?$.jsxDEV("p",{className:"mode pad",children:"No vendor here has a real service behind it, so none holds a credential. Connect one in Settings › Real services; its credential is sealed here."},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("section",{className:"block","aria-labelledby":"links-head",children:[$.jsxDEV("div",{className:"block-head",children:[$.jsxDEV("h3",{id:"links-head",children:"Links"},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:"a vendor with no twin, forwarded with its sealed credential"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(G0,{load:F,what:"the links"},void 0,!1,void 0,this),X.state==="ok"&&(X.data.journalFailures??0)>0?$.jsxDEV("p",{className:"mode pad",role:"alert",children:[X.data.journalFailures," request ",X.data.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 from what this page counts."]},void 0,!0,void 0,this):null,F.state==="ok"&&M.length===0?$.jsxDEV("p",{className:"mode pad",children:["No links. A link forwards requests for a vendor with no twin here, at ",$.jsxDEV("code",{children:[Q2,"/",_,"/<link>/…"]},void 0,!0,void 0,this),", to that vendor's real API with the credential sealed for it."]},void 0,!0,void 0,this):null,M.length?$.jsxDEV("table",{className:"dense","aria-label":"Links",children:[$.jsxDEV("thead",{children:$.jsxDEV("tr",{children:[$.jsxDEV("th",{children:"Link"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Origin"},void 0,!1,void 0,this),$.jsxDEV("th",{className:"num",children:"Requests, 24h"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Credential"},void 0,!1,void 0,this),J?$.jsxDEV("th",{className:"num",children:$.jsxDEV("span",{className:"sr",children:"Actions"},void 0,!1,void 0,this)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("tbody",{children:M.map((N)=>{let k=F.state==="ok"?F.data.links[N].origin:"",u=X.state==="ok"?X.data.twins.find((i)=>i.twin===N):void 0;return $.jsxDEV("tr",{children:[$.jsxDEV("td",{children:$.jsxDEV("b",{children:N},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:$.jsxDEV("code",{children:k},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{className:"num",children:u?$.jsxDEV("span",{title:Object.entries(u.byStatus).map(([i,l])=>`${i}: ${l}`).join(" · "),children:u.requests},void 0,!1,void 0,this):$.jsxDEV("span",{className:"mode",children:"—"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:[f(Y[N]??null),Y[N]?.boundTo?$.jsxDEV("div",{className:"mode",children:["bound to ",$.jsxDEV("code",{children:Y[N].boundTo},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),J?$.jsxDEV("td",{className:"num row-actions",children:[$.jsxDEV("button",{type:"button",onClick:()=>{W(""),L({vendor:N,to:k})},children:Y[N]?"Replace…":"Seal a credential…"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",onClick:()=>void C(N),children:"Remove…"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},N,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV(M0,{open:Boolean(H),onClose:()=>{if(!w)L(null)},title:`Seal ${H?B1(H.vendor):""}'s credential`,footer:$.jsxDEV($.Fragment,{children:[$.jsxDEV("button",{type:"button",onClick:()=>L(null),disabled:w,children:"Cancel"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"submit",form:"seal-credential",className:"primary",disabled:w||!z,children:w?"Sealing…":"Seal it"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:$.jsxDEV("form",{id:"seal-credential",className:"stack",onSubmit:(N)=>void P(N),children:[$.jsxDEV("p",{className:"mode",children:["It is sealed for ",$.jsxDEV("code",{children:H?.to},void 0,!1,void 0,this)," and opens there only. It is never shown again, here or anywhere."]},void 0,!0,void 0,this),$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"The real key"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"credential",type:"password",value:z,onChange:(N)=>W(N.target.value),autoComplete:"off",required:!0,autoFocus:!0},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 OF({name:_,token:Q,admin:J,canWrite:q,refused:U,onRemoved:G,only:Z}){let F=(j)=>!Z||Z===j,[X,Y]=c.useState(0),K=h1(Q,`/-/${_}/twins`,X),H=h1(Q,`/-/${_}/checks`,X),[L,z]=c.useState(0),W=h1(Q,`/-/${_}/clock`,L),[w,R]=c.useState([]),[A,O]=c.useState(null),[B,M]=c.useState(null),[P,C]=c.useState(""),[f,v]=c.useState("gated"),[N,k]=c.useState(!1),u=(j,m,I)=>{if(R((V)=>[{ok:j,text:m,at:new Date().toISOString(),n:++n5,...I?.length?{acts:I}:{}},...V].slice(0,6)),!j)p1(m,"error")},i=async(j,m,I)=>{let V=await v1(Q,m,I).catch(()=>null);if(!V)return u(!1,`${j}: the World did not answer`),!1;if(!V.ok){U(V);let D=s1(await n0(V));return u(!1,`${j}: ${D.text}`,D.acts),!1}return u(!0,`${j}: done.`),Y((D)=>D+1),!0},l=async(j)=>{if(j.preventDefault(),!B)return;k(!0);let m=B.root??{},I=await i(P.trim()?`Connect ${B1(B.twin)} to ${P.trim()}`:`Disconnect ${B1(B.twin)}`,`/-/${_}/twins/${B.twin}/root`,{method:"PUT",body:JSON.stringify(P.trim()?{...m,url:P.trim(),deploy:f}:null)});if(k(!1),I)M(null)},S=async()=>{if(!await m0({title:`Rotate the tokens of ${_}?`,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 j=await v1(J,`/-/worlds/${_}/rotate`,{method:"POST"});if(j.ok)O(await j.json()),u(!0,"Rotated: the new tokens are shown once, below.");else u(!1,`Rotate: ${await L0(j)}`)},b=async()=>{if(!await m0({title:`Remove ${_}?`,body:"The host stops serving it and its whole history goes with it. This cannot be undone.",action:"Remove World",danger:!0,typed:_}))return;let j=await v1(J,`/-/worlds/${_}`,{method:"DELETE"}).catch((m)=>m);if(j instanceof Error){u(!1,`Remove: the host did not answer (${j.message})`);return}if(j.ok)G();else u(!1,`Remove: ${await L0(j)}`)},h=K.state==="ok"?K.data.twins:[],E={gated:"gated: a person deploys an approved changeset",auto:"auto: a push deploys at once",hold:"hold: nothing deploys"};return $.jsxDEV($.Fragment,{children:[$.jsxDEV(B2,{log:w,name:_},void 0,!1,void 0,this),F("access")?$.jsxDEV($.Fragment,{children:[$.jsxDEV("h3",{className:"settings-head",children:"Access"},void 0,!1,void 0,this),q?$.jsxDEV(MF,{name:_,token:Q},void 0,!1,void 0,this):$.jsxDEV("p",{className:"mode",children:"This session reads the World: its keys are managed by whoever holds its token."},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,F("services")?$.jsxDEV($.Fragment,{children:[$.jsxDEV("h3",{className:"settings-head",children:"Real services"},void 0,!1,void 0,this),$.jsxDEV("p",{className:"mode",children:[h.some((j)=>j.root?.url)?null:"Every vendor here is a stand-in. ","Connect a vendor to its real service to read the real state into this World; its real credential is sealed in the Vault, and an approved changeset deploys there by its policy."]},void 0,!0,void 0,this),$.jsxDEV(G0,{load:K,what:"the vendors"},void 0,!1,void 0,this),K.state==="ok"?$.jsxDEV("div",{className:"block",children:$.jsxDEV("table",{className:"dense","aria-label":"Real services",children:[$.jsxDEV("thead",{children:$.jsxDEV("tr",{children:[$.jsxDEV("th",{children:"Vendor"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Real service"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Deploy policy"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Last read from it"},void 0,!1,void 0,this),q?$.jsxDEV("th",{className:"num",children:$.jsxDEV("span",{className:"sr",children:"Actions"},void 0,!1,void 0,this)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("tbody",{children:h.map((j)=>{let m=j.root;return $.jsxDEV("tr",{children:[$.jsxDEV("td",{children:$.jsxDEV("span",{className:"vendor-cell",children:[$.jsxDEV(r1,{vendor:j.twin},void 0,!1,void 0,this),$.jsxDEV("a",{href:`${M1}/${_}/${j.twin}`,title:`Its log and stored state · ${j.position??0} entries`,onClick:(I)=>{I.preventDefault(),j1([..._.split("/"),j.twin])},children:B1(j.twin)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:m?.url?$.jsxDEV("code",{children:m.url},void 0,!1,void 0,this):$.jsxDEV("span",{className:"mode",children:"not connected"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{className:"mode",children:m?.url?E[m.deploy??""]??m.deploy??"—":"—"},void 0,!1,void 0,this),$.jsxDEV("td",{children:j.refresh?.failed?$.jsxDEV("span",{role:"alert",children:["failed ×",j.refresh.failed.count??1,": ",j.refresh.failed.reason??""]},void 0,!0,void 0,this):m?.url?D2(j.refresh?.observedAt??j.refresh?.at):$.jsxDEV("span",{className:"mode",children:"—"},void 0,!1,void 0,this)},void 0,!1,void 0,this),q?$.jsxDEV("td",{className:"num row-actions",children:[$.jsxDEV("button",{type:"button",onClick:()=>{C(m?.url??""),v(m?.deploy==="auto"||m?.deploy==="hold"?m.deploy:"gated"),M(j)},children:m?.url?"Change…":"Connect…"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",disabled:!m?.url,title:m?.url?"Read the real service's current state into this World":"Connect it first",onClick:()=>void m0({title:`Read ${B1(j.twin)} now?`,body:`The real ${B1(j.twin)}'s current state is read into this World. Nothing is written to ${B1(j.twin)}.`,action:"Read from it"}).then((I)=>{if(I)i(`Read from ${B1(j.twin)}`,`/-/${_}/twins/${j.twin}/refresh`,{method:"POST"})}),children:"Read from it"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},j.twin,!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):null,F("clock")?$.jsxDEV($.Fragment,{children:[$.jsxDEV("h3",{className:"settings-head",children:"Clock"},void 0,!1,void 0,this),$.jsxDEV("p",{className:"mode",children:"The instant every vendor here stamps from. Set it and move it forward to see what happens later: renewals, expiries, scheduled sends."},void 0,!1,void 0,this),$.jsxDEV(nZ,{name:_,token:Q,clock:W,canWrite:q,onChanged:()=>z((j)=>j+1),refused:U,open:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,F("checks")?$.jsxDEV($.Fragment,{children:[$.jsxDEV("h3",{className:"settings-head",children:"Checks"},void 0,!1,void 0,this),$.jsxDEV("p",{className:"mode",children:"JavaScript the World runs over every change before it is performed (a changeset's Verify runs them too)."},void 0,!1,void 0,this),$.jsxDEV(G0,{load:H,what:"the checks"},void 0,!1,void 0,this),H.state==="ok"?H.data.checks.length===0?$.jsxDEV("p",{className:"mode",children:"No checks: every change is performed as it comes."},void 0,!1,void 0,this):$.jsxDEV("div",{className:"block",children:$.jsxDEV("table",{className:"dense","aria-label":"Checks",children:$.jsxDEV("tbody",{children:H.data.checks.map((j)=>$.jsxDEV("tr",{children:$.jsxDEV("td",{children:$.jsxDEV("code",{children:j},void 0,!1,void 0,this)},void 0,!1,void 0,this)},j,!1,void 0,this))},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this):null,J&&!Z?$.jsxDEV("div",{className:"danger",role:"region","aria-label":"Danger zone",children:[$.jsxDEV("h3",{children:"Danger zone"},void 0,!1,void 0,this),A?$.jsxDEV("p",{role:"status",children:["token ",$.jsxDEV("code",{children:A.token},void 0,!1,void 0,this)," · read token ",$.jsxDEV("code",{children:A.readToken},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,$.jsxDEV("p",{children:[$.jsxDEV("button",{type:"button",onClick:()=>void S(),children:"Rotate tokens"},void 0,!1,void 0,this)," ",$.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),$.jsxDEV("p",{children:[$.jsxDEV("button",{type:"button",onClick:()=>void b(),children:"Remove world"},void 0,!1,void 0,this)," ",$.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,$.jsxDEV(M0,{open:Boolean(B),onClose:()=>{if(!N)M(null)},title:`Connect ${B?B1(B.twin):""} to its real service`,footer:$.jsxDEV($.Fragment,{children:[$.jsxDEV("button",{type:"button",onClick:()=>M(null),disabled:N,children:"Cancel"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"submit",form:"connect-root",className:"primary",disabled:N,children:N?"Saving…":P.trim()?"Connect":"Disconnect"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:$.jsxDEV("form",{id:"connect-root",className:"stack",onSubmit:(j)=>void l(j),children:[$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"The real service's API address"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"rootUrl",value:P,onChange:(j)=>C(j.target.value),placeholder:"https://api.openai.com",autoFocus:!0},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:"Empty disconnects it."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"Deploy policy"},void 0,!1,void 0,this),$.jsxDEV("select",{name:"rootDeploy",value:f,onChange:(j)=>v(j.target.value==="auto"?"auto":j.target.value==="hold"?"hold":"gated"),children:["gated","auto","hold"].map((j)=>$.jsxDEV("option",{value:j,children:E[j]},j,!1,void 0,this))},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 JM(){return $.jsxDEV($.Fragment,{children:[$.jsxDEV(hZ,{},void 0,!1,void 0,this),$.jsxDEV(h_,{},void 0,!1,void 0,this),$.jsxDEV(u_,{},void 0,!1,void 0,this),$.jsxDEV(V_,{},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}export{QM as openAt,t5 as ROOT,JM as ConsolePage};
33
+ `)),K=Y.reduce((H,L)=>H.concat(...L),[]);return[Y,K]}return[[],[]]},[_]);return d.useEffect(()=>{let X=Q?.target??f9,Y=Q?.actInsideInputWithModifier??!0;if(_!==null){let K=(z)=>{if(U.current=z.ctrlKey||z.metaKey||z.shiftKey||z.altKey,(!U.current||U.current&&!Y)&&d6(z))return!1;let I=S9(z.code,F);if(G.current.add(z[I]),C9(Z,G.current,!1)){let O=z.composedPath?.()?.[0]||z.target,A=O?.nodeName==="BUTTON"||O?.nodeName==="A";if(Q.preventDefault!==!1&&(U.current||!A))z.preventDefault();q(!0)}},H=(z)=>{let W=S9(z.code,F);if(C9(Z,G.current,!0))q(!1),G.current.clear();else G.current.delete(z[W]);if(z.key==="Meta")G.current.clear();U.current=!1},L=()=>{G.current.clear(),q(!1)};return X?.addEventListener("keydown",K),X?.addEventListener("keyup",H),window.addEventListener("blur",L),window.addEventListener("contextmenu",L),()=>{X?.removeEventListener("keydown",K),X?.removeEventListener("keyup",H),window.removeEventListener("blur",L),window.removeEventListener("contextmenu",L)}}},[_,q]),J}function C9(_,Q,J){return _.filter((q)=>J||q.length===Q.size).some((q)=>q.every((U)=>Q.has(U)))}function S9(_,Q){return Q.includes(_)?"code":"key"}var PU=()=>{let _=x1();return d.useMemo(()=>{return{zoomIn:async(Q)=>{let{panZoom:J}=_.getState();return J?J.scaleBy(1.2,Q):!1},zoomOut:async(Q)=>{let{panZoom:J}=_.getState();return J?J.scaleBy(0.8333333333333334,Q):!1},zoomTo:async(Q,J)=>{let{panZoom:q}=_.getState();return q?q.scaleTo(Q,J):!1},getZoom:()=>_.getState().transform[2],setViewport:async(Q,J)=>{let{transform:[q,U,G],panZoom:Z}=_.getState();if(!Z)return!1;return await Z.setViewport({x:Q.x??q,y:Q.y??U,zoom:Q.zoom??G},J),!0},getViewport:()=>{let[Q,J,q]=_.getState().transform;return{x:Q,y:J,zoom:q}},setCenter:async(Q,J,q)=>{return _.getState().setCenter(Q,J,q)},fitBounds:async(Q,J)=>{let{width:q,height:U,minZoom:G,maxZoom:Z,panZoom:F}=_.getState(),X=c5(Q,q,U,G,Z,J?.padding??0.1);if(!F)return!1;return await F.setViewport(X,{duration:J?.duration,ease:J?.ease,interpolate:J?.interpolate}),!0},screenToFlowPosition:(Q,J={})=>{let{transform:q,snapGrid:U,snapToGrid:G,domNode:Z}=_.getState();if(!Z)return Q;let{x:F,y:X}=Z.getBoundingClientRect(),Y={x:Q.x-F,y:Q.y-X},K=J.snapGrid??U,H=J.snapToGrid??G;return G5(Y,q,H,K)},flowToScreenPosition:(Q)=>{let{transform:J,domNode:q}=_.getState();if(!q)return Q;let{x:U,y:G}=q.getBoundingClientRect(),Z=j2(Q,J);return{x:Z.x+U,y:Z.y+G}}}},[])};function e9(_,Q){let J=[],q=new Map,U=[];for(let G of _)if(G.type==="add"){U.push(G);continue}else if(G.type==="remove"||G.type==="replace")q.set(G.id,[G]);else{let Z=q.get(G.id);if(Z)Z.push(G);else q.set(G.id,[G])}for(let G of Q){let Z=q.get(G.id);if(!Z){J.push(G);continue}if(Z[0].type==="remove")continue;if(Z[0].type==="replace"){J.push({...Z[0].item});continue}let F={...G};for(let X of Z)NU(X,F);J.push(F)}if(U.length)U.forEach((G)=>{if(G.index!==void 0)J.splice(G.index,0,{...G.item});else J.push({...G.item})});return J}function NU(_,Q){switch(_.type){case"select":{Q.selected=_.selected;break}case"position":{if(typeof _.position<"u")Q.position=_.position;if(typeof _.dragging<"u")Q.dragging=_.dragging;break}case"dimensions":{if(typeof _.dimensions<"u"){if(Q.measured={..._.dimensions},_.setAttributes){if(_.setAttributes===!0||_.setAttributes==="width")Q.width=_.dimensions.width;if(_.setAttributes===!0||_.setAttributes==="height")Q.height=_.dimensions.height}}if(typeof _.resizing==="boolean")Q.resizing=_.resizing;break}}}function __(_,Q){return e9(_,Q)}function wU(_,Q){return e9(_,Q)}function h2(_,Q){return{id:_,type:"select",selected:Q}}function F5(_,Q=new Set,J=!1){let q=[];for(let[U,G]of _){let Z=Q.has(U);if(!(G.selected===void 0&&!Z)&&G.selected!==Z){if(J)G.selected=Z;q.push(h2(G.id,Z))}}return q}function y9({items:_=[],lookup:Q}){let J=[],q=new Map(_.map((U)=>[U.id,U]));for(let[U,G]of _.entries()){let Z=Q.get(G.id),F=Z?.internals?.userNode??Z;if(F!==void 0&&F!==G)J.push({id:G.id,item:G,type:"replace"});if(F===void 0)J.push({item:G,type:"add",index:U})}for(let[U]of Q)if(q.get(U)===void 0)J.push({id:U,type:"remove"});return J}function k9(_){return{id:_.id,type:"remove"}}var fU=g6("React Flow","https://reactflow.dev/");function CU(_,Q,J={}){return g7(_,Q,{...J,onError:J.onError??fU})}var v9=(_)=>k7(_),SU=(_)=>h6(_);function Q_(_){return d.forwardRef(_)}var J_=typeof window<"u"?d.useLayoutEffect:d.useEffect;function j9(_){let[Q,J]=d.useState(BigInt(0)),[q]=d.useState(()=>yU(()=>J((U)=>U+BigInt(1))));return J_(()=>{let U=q.get();if(U.length)_(U),q.reset()},[Q]),q}function yU(_){let Q=[];return{get:()=>Q,reset:()=>{Q=[]},push:(J)=>{Q.push(J),_()}}}var $_=d.createContext(null);function kU({children:_}){let Q=x1(),J=d.useCallback((F)=>{let{nodes:X=[],setNodes:Y,hasDefaultNodes:K,onNodesChange:H,nodeLookup:L,fitViewQueued:z,onNodesChangeMiddlewareMap:W}=Q.getState(),I=X;for(let A of F)I=typeof A==="function"?A(I):A;let O=y9({items:I,lookup:L});for(let A of W.values())O=A(O);if(K)Y(I);if(O.length>0)H?.(O);else if(z)window.requestAnimationFrame(()=>{let{fitViewQueued:A,nodes:w,setNodes:B}=Q.getState();if(A)B(w)})},[]),q=j9(J),U=d.useCallback((F)=>{let{edges:X=[],setEdges:Y,hasDefaultEdges:K,onEdgesChange:H,edgeLookup:L}=Q.getState(),z=X;for(let W of F)z=typeof W==="function"?W(z):W;if(K)Y(z);else if(H)H(y9({items:z,lookup:L}))},[]),G=j9(U),Z=d.useMemo(()=>({nodeQueue:q,edgeQueue:G}),[]);return i.jsx($_.Provider,{value:Z,children:_})}function vU(){let _=d.useContext($_);if(!_)throw Error("useBatchContext must be used within a BatchProvider");return _}var jU=(_)=>!!_.panZoom;function i5(){let _=PU(),Q=x1(),J=vU(),q=S1(jU),U=d.useMemo(()=>{let G=(H)=>Q.getState().nodeLookup.get(H),Z=(H)=>{J.nodeQueue.push(H)},F=(H)=>{J.edgeQueue.push(H)},X=(H)=>{let{nodeLookup:L,nodeOrigin:z}=Q.getState(),W=v9(H)?H:L.get(H.id),I=W.parentId?c6(W.position,W.measured,W.parentId,L,z):W.position,O={...W,position:I,width:W.measured?.width??W.width,height:W.measured?.height??W.height};return q5(O)},Y=(H,L,z={replace:!1})=>{Z((W)=>W.map((I)=>{if(I.id===H){let O=typeof L==="function"?L(I):L;return z.replace&&v9(O)?O:{...I,...O}}return I}))},K=(H,L,z={replace:!1})=>{F((W)=>W.map((I)=>{if(I.id===H){let O=typeof L==="function"?L(I):L;return z.replace&&SU(O)?O:{...I,...O}}return I}))};return{getNodes:()=>Q.getState().nodes.map((H)=>({...H})),getNode:(H)=>G(H)?.internals.userNode,getInternalNode:G,getEdges:()=>{let{edges:H=[]}=Q.getState();return H.map((L)=>({...L}))},getEdge:(H)=>Q.getState().edgeLookup.get(H),setNodes:Z,setEdges:F,addNodes:(H)=>{let L=Array.isArray(H)?H:[H];J.nodeQueue.push((z)=>[...z,...L])},addEdges:(H)=>{let L=Array.isArray(H)?H:[H];J.edgeQueue.push((z)=>[...z,...L])},toObject:()=>{let{nodes:H=[],edges:L=[],transform:z}=Q.getState(),[W,I,O]=z;return{nodes:H.map((A)=>({...A})),edges:L.map((A)=>({...A})),viewport:{x:W,y:I,zoom:O}}},deleteElements:async({nodes:H=[],edges:L=[]})=>{let{nodes:z,edges:W,onNodesDelete:I,onEdgesDelete:O,triggerNodeChanges:A,triggerEdgeChanges:w,onDelete:B,onBeforeDelete:T}=Q.getState(),{nodes:R,edges:C}=await V7({nodesToRemove:H,edgesToRemove:L,nodes:z,edges:W,onBeforeDelete:T}),f=C.length>0,y=R.length>0;if(f){let N=C.map(k9);O?.(C),w(N)}if(y){let N=R.map(k9);I?.(R),A(N)}if(y||f)B?.({nodes:R,edges:C});return{deletedNodes:R,deletedEdges:C}},getIntersectingNodes:(H,L=!0,z)=>{let W=m6(H),I=W?H:X(H),O=z!==void 0;if(!I)return[];return(z||Q.getState().nodes).filter((A)=>{let w=Q.getState().nodeLookup.get(A.id);if(w&&!W&&(A.id===H.id||!w.internals.positionAbsolute))return!1;let B=q5(O?A:w),T=p5(B,I);return L&&T>0||T>=B.width*B.height||T>=I.width*I.height})},isNodeIntersecting:(H,L,z=!0)=>{let I=m6(H)?H:X(H);if(!I)return!1;let O=p5(I,L);return z&&O>0||O>=L.width*L.height||O>=I.width*I.height},updateNode:Y,updateNodeData:(H,L,z={replace:!1})=>{Y(H,(W)=>{let I=typeof L==="function"?L(W):L;return z.replace?{...W,data:I}:{...W,data:{...W.data,...I}}},z)},updateEdge:K,updateEdgeData:(H,L,z={replace:!1})=>{K(H,(W)=>{let I=typeof L==="function"?L(W):L;return z.replace?{...W,data:I}:{...W,data:{...W.data,...I}}},z)},getNodesBounds:(H)=>{let{nodeLookup:L,nodeOrigin:z}=Q.getState();return b6(H,{nodeLookup:L,nodeOrigin:z})},getHandleConnections:({type:H,id:L,nodeId:z})=>Array.from(Q.getState().connectionLookup.get(`${z}-${H}${L?`-${L}`:""}`)?.values()??[]),getNodeConnections:({type:H,handleId:L,nodeId:z})=>Array.from(Q.getState().connectionLookup.get(`${z}${H?L?`-${H}-${L}`:`-${H}`:""}`)?.values()??[]),fitView:async(H)=>{let L=Q.getState().fitViewResolver??D7();return Q.setState({fitViewQueued:!0,fitViewOptions:H,fitViewResolver:L}),J.nodeQueue.push((z)=>[...z]),L.promise}}},[]);return d.useMemo(()=>{return{...U,..._,viewportInitialized:q}},[q])}var V9=(_)=>_.selected,VU=typeof window<"u"?window:void 0;function uU({deleteKeyCode:_,multiSelectionKeyCode:Q}){let J=x1(),{deleteElements:q}=i5(),U=r5(_,{actInsideInputWithModifier:!1}),G=r5(Q,{target:VU});d.useEffect(()=>{if(U){let{edges:Z,nodes:F}=J.getState();q({nodes:F.filter(V9),edges:Z.filter(V9)}),J.setState({nodesSelectionActive:!1})}},[U]),d.useEffect(()=>{J.setState({multiSelectionActive:G})},[G])}function hU(_){let Q=x1();d.useEffect(()=>{let J=()=>{if(!_.current||!(_.current.checkVisibility?.()??!0))return!1;let q=v4(_.current);if(q.height===0||q.width===0)Q.getState().onError?.("004",X0.error004());Q.setState({width:q.width||500,height:q.height||500})};if(_.current){J(),window.addEventListener("resize",J);let q=new ResizeObserver(()=>J());return q.observe(_.current),()=>{if(window.removeEventListener("resize",J),q&&_.current)q.unobserve(_.current)}}},[])}var r4={position:"absolute",width:"100%",height:"100%",top:0,left:0},DU=(_)=>({userSelectionActive:_.userSelectionActive,lib:_.lib,connectionInProgress:_.connection.inProgress});function bU({onPaneContextMenu:_,zoomOnScroll:Q=!0,zoomOnPinch:J=!0,panOnScroll:q=!1,panActivationKeyPressed:U,panOnScrollSpeed:G=0.5,panOnScrollMode:Z=o0.Free,zoomOnDoubleClick:F=!0,panOnDrag:X=!0,defaultViewport:Y,translateExtent:K,minZoom:H,maxZoom:L,zoomActivationKeyCode:z,preventScrolling:W=!0,children:I,noWheelClassName:O,noPanClassName:A,onViewportChange:w,isControlledViewport:B,paneClickDistance:T,selectionOnDrag:R}){let C=x1(),f=d.useRef(null),{userSelectionActive:y,lib:N,connectionInProgress:k}=S1(DU,E1),E=r5(z),c=d.useRef();hU(f);let l=d.useCallback((S)=>{if(w?.({x:S[0],y:S[1],zoom:S[2]}),!B)C.setState({transform:S})},[w,B]);return d.useEffect(()=>{if(f.current){c.current=U9({domNode:f.current,minZoom:H,maxZoom:L,translateExtent:K,viewport:Y,onDraggingChange:(x)=>C.setState((v)=>v.paneDragging===x?v:{paneDragging:x}),onPanZoomStart:(x,v)=>{let{onViewportChangeStart:m,onMoveStart:P}=C.getState();P?.(x,v),m?.(v)},onPanZoom:(x,v)=>{let{onViewportChange:m,onMove:P}=C.getState();P?.(x,v),m?.(v)},onPanZoomEnd:(x,v)=>{let{onViewportChangeEnd:m,onMoveEnd:P}=C.getState();P?.(x,v),m?.(v)}});let{x:S,y:j,zoom:D}=c.current.getViewport();return C.setState({panZoom:c.current,transform:[S,j,D],domNode:f.current.closest(".react-flow")}),()=>{c.current?.destroy()}}},[]),d.useEffect(()=>{c.current?.update({onPaneContextMenu:_,zoomOnScroll:Q,zoomOnPinch:J,panOnScroll:q,panActivationKeyPressed:U,panOnScrollSpeed:G,panOnScrollMode:Z,zoomOnDoubleClick:F,panOnDrag:X,zoomActivationKeyPressed:E,preventScrolling:W,noPanClassName:A,userSelectionActive:y,noWheelClassName:O,lib:N,onTransformChange:l,connectionInProgress:k,selectionOnDrag:R,paneClickDistance:T})},[_,Q,J,q,U,G,Z,F,X,E,W,A,y,O,N,l,k,R,T]),i.jsx("div",{className:"react-flow__renderer",ref:f,style:r4,children:I})}var EU=(_)=>({userSelectionActive:_.userSelectionActive,userSelectionRect:_.userSelectionRect});function xU(){let{userSelectionActive:_,userSelectionRect:Q}=S1(EU,E1);if(!(_&&Q))return null;return i.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:Q.width,height:Q.height,transform:`translate(${Q.x}px, ${Q.y}px)`}})}var $8=(_,Q)=>{return(J)=>{if(J.target!==Q.current)return;_?.(J)}},mU=(_)=>({userSelectionActive:_.userSelectionActive,elementsSelectable:_.elementsSelectable,dragging:_.paneDragging,panBy:_.panBy,autoPanSpeed:_.autoPanSpeed});function gU({isSelecting:_,selectionKeyPressed:Q,selectionMode:J=k2.Full,panOnDrag:q,autoPanOnSelection:U,paneClickDistance:G,selectionOnDrag:Z,onSelectionStart:F,onSelectionEnd:X,onPaneClick:Y,onPaneContextMenu:K,onPaneScroll:H,onPaneMouseEnter:L,onPaneMouseMove:z,onPaneMouseLeave:W,children:I}){let O=d.useRef(0),A=x1(),{userSelectionActive:w,elementsSelectable:B,dragging:T,panBy:R,autoPanSpeed:C}=S1(mU,E1),f=B&&(_||w),y=d.useRef(null),N=d.useRef(),k=d.useRef(new Set),E=d.useRef(new Set),c=d.useRef(!1),l=d.useRef(!1),S=d.useRef({x:0,y:0}),j=d.useRef(!1),D=(p)=>{if(l.current||c.current||A.getState().connection.inProgress){l.current=!1,c.current=!1;return}Y?.(p),A.getState().resetSelectedElements(),A.setState({nodesSelectionActive:!1})},x=(p)=>{if(Array.isArray(q)&&q?.includes(2)){p.preventDefault();return}K?.(p)},v=H?(p)=>H(p):void 0,m=(p)=>{if(l.current)p.stopPropagation(),l.current=!1},P=(p)=>{if(p.pointerType==="touch"&&q!==!1&&!Q)return;let{domNode:n,transform:J1}=A.getState();if(N.current=n?.getBoundingClientRect(),!N.current)return;let G1=p.target===y.current;if(!G1&&!!p.target.closest(".nokey")||!_||!(Z&&G1||Q)||p.button!==0||!p.isPrimary)return;p.target?.setPointerCapture?.(p.pointerId),l.current=!1;let{x:M1,y:L1}=P0(p.nativeEvent,N.current),e=G5({x:M1,y:L1},J1);if(A.setState({userSelectionRect:{width:0,height:0,startX:e.x,startY:e.y,x:M1,y:L1}}),!G1)p.stopPropagation(),p.preventDefault()};function V(p,n){let{userSelectionRect:J1}=A.getState();if(!J1)return;let{transform:G1,nodeLookup:q1,edgeLookup:Y1,connectionLookup:M1,triggerNodeChanges:L1,triggerEdgeChanges:e,defaultEdgeOptions:O1}=A.getState(),X1={x:J1.startX,y:J1.startY},{x:D1,y:a1}=j2(X1,G1),_0={startX:X1.x,startY:X1.y,x:p<D1?p:D1,y:n<a1?n:a1,width:Math.abs(p-D1),height:Math.abs(n-a1)},T0=k.current,L0=E.current;k.current=new Set(C4(q1,_0,G1,J===k2.Partial,!0).map((t1)=>t1.id)),E.current=new Set;let z0=O1?.selectable??!0;for(let t1 of k.current){let Z0=M1.get(t1);if(!Z0)continue;for(let{edgeId:F0}of Z0.values()){let W0=Y1.get(F0);if(W0&&(W0.selectable??z0))E.current.add(F0)}}if(!l6(T0,k.current)){let t1=F5(q1,k.current,!0);L1(t1)}if(!l6(L0,E.current)){let t1=F5(Y1,E.current);e(t1)}A.setState({userSelectionRect:_0,userSelectionActive:!0,nodesSelectionActive:!1})}function b(){if(!U||!N.current)return;let[p,n]=S4(S.current,N.current,C);R({x:p,y:n}).then((J1)=>{if(!l.current||!J1){O.current=requestAnimationFrame(b);return}let{x:G1,y:q1}=S.current;V(G1,q1),O.current=requestAnimationFrame(b)})}let u=()=>{cancelAnimationFrame(O.current),O.current=0,j.current=!1};d.useEffect(()=>{return()=>u()},[]);let t=(p)=>{let{userSelectionRect:n,transform:J1,resetSelectedElements:G1}=A.getState();if(!N.current||!n)return;let{x:q1,y:Y1}=P0(p.nativeEvent,N.current);S.current={x:q1,y:Y1};let M1=j2({x:n.startX,y:n.startY},J1);if(!l.current){let L1=Q?0:G;if(Math.hypot(q1-M1.x,Y1-M1.y)<=L1)return;G1(),F?.(p)}if(l.current=!0,!j.current)b(),j.current=!0;V(q1,Y1)},Q1=(p)=>{if(!f){if(p.target===y.current&&A.getState().connection.inProgress)c.current=!0;return}if(p.button!==0)return;if(p.target?.releasePointerCapture?.(p.pointerId),!w&&p.target===y.current&&A.getState().userSelectionRect)D?.(p);if(A.setState({userSelectionActive:!1,userSelectionRect:null}),l.current)X?.(p),A.setState({nodesSelectionActive:k.current.size>0});u()},a=(p)=>{p.target?.releasePointerCapture?.(p.pointerId),u()},o=q===!0||Array.isArray(q)&&q.includes(0);return i.jsxs("div",{className:l1(["react-flow__pane",{draggable:o,dragging:T,selection:_}]),onClick:f?void 0:$8(D,y),onContextMenu:$8(x,y),onWheel:$8(v,y),onPointerEnter:f?void 0:L,onPointerMove:f?t:z,onPointerUp:Q1,onPointerCancel:f?a:void 0,onPointerDownCapture:f?P:void 0,onClickCapture:f?m:void 0,onPointerLeave:W,ref:y,style:r4,children:[I,i.jsx(xU,{})]})}function U8({id:_,store:Q,unselect:J=!1,nodeRef:q}){let{addSelectedNodes:U,unselectNodesAndEdges:G,multiSelectionActive:Z,nodeLookup:F,onError:X}=Q.getState(),Y=F.get(_);if(!Y){X?.("012",X0.error012(_));return}if(Q.setState({nodesSelectionActive:!1}),!Y.selected)U([_]);else if(J||Y.selected&&Z)G({nodes:[Y],edges:[]}),requestAnimationFrame(()=>q?.current?.blur())}function q_({nodeRef:_,disabled:Q=!1,noDragClassName:J,handleSelector:q,nodeId:U,isSelectable:G,nodeClickDistance:Z}){let F=x1(),[X,Y]=d.useState(!1),K=d.useRef();return d.useEffect(()=>{if(Q)return;return K.current=o7({getStoreItems:()=>F.getState(),onNodeMouseDown:(H)=>{U8({id:H,store:F,nodeRef:_})},onDragStart:()=>{Y(!0)},onDragStop:()=>{Y(!1)}}),()=>{K.current?.destroy(),K.current=void 0}},[Q,F,_]),d.useEffect(()=>{if(Q||!_.current||!K.current)return;K.current.update({noDragClassName:J,handleSelector:q,domNode:_.current,isSelectable:G,nodeId:U,nodeClickDistance:Z})},[J,q,Q,G,_,U,Z]),X}var pU=(_)=>(Q)=>Q.selected&&(Q.draggable||_&&typeof Q.draggable>"u");function U_(){let _=x1();return d.useCallback((J)=>{let{nodeExtent:q,snapToGrid:U,snapGrid:G,nodesDraggable:Z,onError:F,updateNodePositions:X,nodeLookup:Y,nodeOrigin:K}=_.getState(),H=new Map,L=pU(Z),z=U?G[0]:5,W=U?G[1]:5,I=J.direction.x*z*J.factor,O=J.direction.y*W*J.factor;for(let[,A]of Y){if(!L(A))continue;let w={x:A.internals.positionAbsolute.x+I,y:A.internals.positionAbsolute.y+O};if(U)w=U5(w,G);let{position:B,positionAbsolute:T}=E6({nodeId:A.id,nextPosition:w,nodeLookup:Y,nodeExtent:q,nodeOrigin:K,onError:F});A.position=B,A.internals.positionAbsolute=T,H.set(A.id,A)}X(H)},[])}var G8=d.createContext(null),cU=G8.Provider;G8.Consumer;var Z8=()=>{return d.useContext(G8)},lU=(_)=>({connectOnClick:_.connectOnClick,noPanClassName:_.noPanClassName,rfId:_.rfId}),G_=d.createContext(null);function rU({children:_}){let Q=S1(lU,E1);return i.jsx(G_.Provider,{value:Q,children:_})}function iU(){let _=d.useContext(G_);if(!_)throw Error("useHandleConfig must be used within a HandleConfigProvider");return _}var dU={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},aU=(_,Q,J)=>(q)=>{let{connectionClickStartHandle:U,connectionMode:G,connection:Z}=q,{fromHandle:F,toHandle:X,isValid:Y}=Z;if(!F&&!U)return dU;let K=X?.nodeId===_&&X?.id===Q&&X?.type===J;return{connectingFrom:F?.nodeId===_&&F?.id===Q&&F?.type===J,connectingTo:K,clickConnecting:U?.nodeId===_&&U?.id===Q&&U?.type===J,isPossibleEndHandle:G===L2.Strict?F?.type!==J:_!==F?.nodeId||Q!==F?.id,connectionInProcess:!!F,clickConnectionInProcess:!!U,valid:K&&Y}};function sU({type:_="source",position:Q=H1.Top,isValidConnection:J,isConnectable:q=!0,isConnectableStart:U=!0,isConnectableEnd:G=!0,id:Z,onConnect:F,children:X,className:Y,onMouseDown:K,onTouchStart:H,...L},z){let W=Z||null,I=_==="target",O=x1(),A=Z8(),{connectOnClick:w,noPanClassName:B,rfId:T}=iU(),{connectingFrom:R,connectingTo:C,clickConnecting:f,isPossibleEndHandle:y,connectionInProcess:N,clickConnectionInProcess:k,valid:E}=S1(aU(A,W,_),E1);if(!A)O.getState().onError?.("010",X0.error010());let c=(j)=>{let{defaultEdgeOptions:D,onConnect:x,hasDefaultEdges:v}=O.getState(),m={...D,...j};if(v){let{edges:P,setEdges:V,onError:b}=O.getState();V(CU(m,P,{onError:b}))}x?.(m),F?.(m)},l=(j)=>{if(!A)return;let D=a6(j.nativeEvent);if(U&&(D&&j.button===0||!D)){let x=O.getState();E4.onPointerDown(j.nativeEvent,{handleDomNode:j.currentTarget,autoPanOnConnect:x.autoPanOnConnect,connectionMode:x.connectionMode,connectionRadius:x.connectionRadius,domNode:x.domNode,nodeLookup:x.nodeLookup,lib:x.lib,isTarget:I,handleId:W,nodeId:A,flowId:x.rfId,panBy:x.panBy,cancelConnection:x.cancelConnection,onConnectStart:x.onConnectStart,onConnectEnd:(...v)=>O.getState().onConnectEnd?.(...v),updateConnection:x.updateConnection,onConnect:c,isValidConnection:J||((...v)=>O.getState().isValidConnection?.(...v)??!0),getTransform:()=>O.getState().transform,getFromHandle:()=>O.getState().connection.fromHandle,autoPanSpeed:x.autoPanSpeed,dragThreshold:x.connectionDragThreshold})}if(D)K?.(j);else H?.(j)},S=(j)=>{let{onClickConnectStart:D,onClickConnectEnd:x,connectionClickStartHandle:v,connectionMode:m,isValidConnection:P,lib:V,rfId:b,nodeLookup:u,connection:t}=O.getState();if(!A||!v&&!U)return;if(!v){D?.(j.nativeEvent,{nodeId:A,handleId:W,handleType:_}),O.setState({connectionClickStartHandle:{nodeId:A,type:_,id:W}});return}let Q1=i6(j.target),a=J||P,{connection:o,isValid:p}=E4.isValid(j.nativeEvent,{handle:{nodeId:A,id:W,type:_},connectionMode:m,fromNodeId:v.nodeId,fromHandleId:v.id||null,fromType:v.type,isValidConnection:a,flowId:b,doc:Q1,lib:V,nodeLookup:u});if(p&&o)c(o);let n=structuredClone(t);delete n.inProgress,n.toPosition=n.toHandle?n.toHandle.position:null,x?.(j,n),O.setState({connectionClickStartHandle:null})};return i.jsx("div",{"data-handleid":W,"data-nodeid":A,"data-handlepos":Q,"data-id":`${T}-${A}-${W}-${_}`,className:l1(["react-flow__handle",`react-flow__handle-${Q}`,"nodrag",B,Y,{source:!I,target:I,connectable:q,connectablestart:U,connectableend:G,clickconnecting:f,connectingfrom:R,connectingto:C,valid:E,connectionindicator:q&&(!N||y)&&(N||k?G:U)}]),onMouseDown:l,onTouchStart:l,onClick:w?S:void 0,ref:z,...L,children:X})}var p4=d.memo(Q_(sU));function tU({data:_,isConnectable:Q,sourcePosition:J=H1.Bottom}){return i.jsxs(i.Fragment,{children:[_?.label,i.jsx(p4,{type:"source",position:J,isConnectable:Q})]})}function oU({data:_,isConnectable:Q,targetPosition:J=H1.Top,sourcePosition:q=H1.Bottom}){return i.jsxs(i.Fragment,{children:[i.jsx(p4,{type:"target",position:J,isConnectable:Q}),_?.label,i.jsx(p4,{type:"source",position:q,isConnectable:Q})]})}function nU(){return null}function eU({data:_,isConnectable:Q,targetPosition:J=H1.Top}){return i.jsxs(i.Fragment,{children:[i.jsx(p4,{type:"target",position:J,isConnectable:Q}),_?.label]})}var c4={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},u9={input:tU,default:oU,output:eU,group:nU};function _G(_){if(_.internals.handleBounds===void 0)return{width:_.width??_.initialWidth??_.style?.width,height:_.height??_.initialHeight??_.style?.height};return{width:_.width??_.style?.width,height:_.height??_.style?.height}}var QG=(_)=>{let{width:Q,height:J,x:q,y:U}=u2(_.nodeLookup,{filter:(G)=>!!G.selected});return{width:I0(Q)?Q:null,height:I0(J)?J:null,userSelectionActive:_.userSelectionActive,transformString:`translate(${_.transform[0]}px,${_.transform[1]}px) scale(${_.transform[2]}) translate(${q}px,${U}px)`}};function JG({onSelectionContextMenu:_,noPanClassName:Q,disableKeyboardA11y:J}){let q=x1(),{width:U,height:G,transformString:Z,userSelectionActive:F}=S1(QG,E1),X=U_(),Y=d.useRef(null);d.useEffect(()=>{if(!J)Y.current?.focus({preventScroll:!0})},[J]);let K=!F&&U!==null&&G!==null;if(q_({nodeRef:Y,disabled:!K}),!K)return null;let H=_?(z)=>{let W=q.getState().nodes.filter((I)=>I.selected);_(z,W)}:void 0,L=(z)=>{if(Object.prototype.hasOwnProperty.call(c4,z.key))z.preventDefault(),X({direction:c4[z.key],factor:z.shiftKey?4:1})};return i.jsx("div",{className:l1(["react-flow__nodesselection","react-flow__container",Q]),style:{transform:Z},children:i.jsx("div",{ref:Y,className:"react-flow__nodesselection-rect",onContextMenu:H,tabIndex:J?void 0:-1,onKeyDown:J?void 0:L,style:{width:U,height:G}})})}var h9=typeof window<"u"?window:void 0,$G=(_)=>{return{nodesSelectionActive:_.nodesSelectionActive,userSelectionActive:_.userSelectionActive}};function Z_({children:_,onPaneClick:Q,onPaneMouseEnter:J,onPaneMouseMove:q,onPaneMouseLeave:U,onPaneContextMenu:G,onPaneScroll:Z,paneClickDistance:F,deleteKeyCode:X,selectionKeyCode:Y,selectionOnDrag:K,selectionMode:H,onSelectionStart:L,onSelectionEnd:z,multiSelectionKeyCode:W,panActivationKeyCode:I,zoomActivationKeyCode:O,elementsSelectable:A,zoomOnScroll:w,zoomOnPinch:B,panOnScroll:T,panOnScrollSpeed:R,panOnScrollMode:C,zoomOnDoubleClick:f,panOnDrag:y,autoPanOnSelection:N,defaultViewport:k,translateExtent:E,minZoom:c,maxZoom:l,preventScrolling:S,onSelectionContextMenu:j,noWheelClassName:D,noPanClassName:x,disableKeyboardA11y:v,onViewportChange:m,isControlledViewport:P}){let{nodesSelectionActive:V,userSelectionActive:b}=S1($G,E1),u=r5(Y,{target:h9}),t=r5(I,{target:h9}),Q1=t||y,a=t||T,o=K&&Q1!==!0,p=u||b||o;return uU({deleteKeyCode:X,multiSelectionKeyCode:W}),i.jsx(bU,{onPaneContextMenu:G,elementsSelectable:A,zoomOnScroll:w,zoomOnPinch:B,panOnScroll:a,panActivationKeyPressed:t,panOnScrollSpeed:R,panOnScrollMode:C,zoomOnDoubleClick:f,panOnDrag:!u&&Q1,defaultViewport:k,translateExtent:E,minZoom:c,maxZoom:l,zoomActivationKeyCode:O,preventScrolling:S,noWheelClassName:D,noPanClassName:x,onViewportChange:m,isControlledViewport:P,paneClickDistance:F,selectionOnDrag:o,children:i.jsxs(gU,{onSelectionStart:L,onSelectionEnd:z,onPaneClick:Q,onPaneMouseEnter:J,onPaneMouseMove:q,onPaneMouseLeave:U,onPaneContextMenu:G,onPaneScroll:Z,panOnDrag:Q1,autoPanOnSelection:N,isSelecting:!!p,selectionMode:H,selectionKeyPressed:u,paneClickDistance:F,selectionOnDrag:o,children:[_,V&&i.jsx(JG,{onSelectionContextMenu:j,noPanClassName:x,disableKeyboardA11y:v})]})})}Z_.displayName="FlowRenderer";var qG=d.memo(Z_),UG=(_)=>(Q)=>{return _?C4(Q.nodeLookup,{x:0,y:0,width:Q.width,height:Q.height},Q.transform,!0).map((J)=>J.id):Array.from(Q.nodeLookup.keys())};function GG(_){return S1(d.useCallback(UG(_),[_]),E1)}var ZG=(_)=>_.updateNodeInternals;function FG(){let _=S1(ZG),[Q]=d.useState(()=>{if(typeof ResizeObserver>"u")return null;return new ResizeObserver((J)=>{let q=new Map;J.forEach((U)=>{let G=U.target.getAttribute("data-id");q.set(G,{id:G,nodeElement:U.target,force:!0})}),_(q)})});return d.useEffect(()=>{return()=>{Q?.disconnect()}},[Q]),Q}function HG({node:_,nodeType:Q,hasDimensions:J,resizeObserver:q}){let U=x1(),G=d.useRef(null),Z=d.useRef(null),F=d.useRef(_.sourcePosition),X=d.useRef(_.targetPosition),Y=d.useRef(Q),K=J&&!!_.internals.handleBounds;return d.useEffect(()=>{if(G.current&&!_.hidden&&(!K||Z.current!==G.current)){if(Z.current)q?.unobserve(Z.current);q?.observe(G.current),Z.current=G.current}},[K,_.hidden]),d.useEffect(()=>{return()=>{if(Z.current)q?.unobserve(Z.current),Z.current=null}},[]),d.useEffect(()=>{if(G.current){let H=Y.current!==Q,L=F.current!==_.sourcePosition,z=X.current!==_.targetPosition;if(H||L||z)Y.current=Q,F.current=_.sourcePosition,X.current=_.targetPosition,U.getState().updateNodeInternals(new Map([[_.id,{id:_.id,nodeElement:G.current,force:!0}]]))}},[_.id,Q,_.sourcePosition,_.targetPosition]),G}function XG({id:_,onClick:Q,onMouseEnter:J,onMouseMove:q,onMouseLeave:U,onContextMenu:G,onDoubleClick:Z,nodesDraggable:F,elementsSelectable:X,nodesConnectable:Y,nodesFocusable:K,resizeObserver:H,noDragClassName:L,noPanClassName:z,disableKeyboardA11y:W,rfId:I,nodeTypes:O,nodeClickDistance:A,onError:w}){let{node:B,internals:T,isParent:R}=S1((p)=>{let n=p.nodeLookup.get(_),J1=p.parentLookup.has(_);return{node:n,internals:n.internals,isParent:J1}},E1),C=B.type||"default",f=O?.[C]||u9[C];if(f===void 0)w?.("003",X0.error003(C)),C="default",f=O?.default||u9.default;let y=!!(B.draggable||F&&typeof B.draggable>"u"),N=!!(B.selectable||X&&typeof B.selectable>"u"),k=!!(B.connectable||Y&&typeof B.connectable>"u"),E=!!(B.focusable||K&&typeof B.focusable>"u"),c=x1(),l=p6(B),S=HG({node:B,nodeType:C,hasDimensions:l,resizeObserver:H}),j=q_({nodeRef:S,disabled:B.hidden||!y,noDragClassName:L,handleSelector:B.dragHandle,nodeId:_,isSelectable:N,nodeClickDistance:A}),D=U_();if(B.hidden)return null;let x=N0(B),v=_G(B),m=N||y||Q||J||q||U,P=J?(p)=>J(p,{...T.userNode}):void 0,V=q?(p)=>q(p,{...T.userNode}):void 0,b=U?(p)=>U(p,{...T.userNode}):void 0,u=G?(p)=>G(p,{...T.userNode}):void 0,t=Z?(p)=>Z(p,{...T.userNode}):void 0,Q1=(p)=>{let{selectNodesOnDrag:n,nodeDragThreshold:J1}=c.getState();if(N&&(!n||!y||J1>0))U8({id:_,store:c,nodeRef:S});if(Q)Q(p,{...T.userNode})},a=(p)=>{if(d6(p.nativeEvent)||W)return;if(j6.includes(p.key)&&N){let n=p.key==="Escape";U8({id:_,store:c,unselect:n,nodeRef:S})}else if(y&&B.selected&&Object.prototype.hasOwnProperty.call(c4,p.key)){p.preventDefault();let{ariaLabelConfig:n}=c.getState();c.setState({ariaLiveMessage:n["node.a11yDescription.ariaLiveMessage"]({direction:p.key.replace("Arrow","").toLowerCase(),x:~~T.positionAbsolute.x,y:~~T.positionAbsolute.y})}),D({direction:c4[p.key],factor:p.shiftKey?4:1})}},o=()=>{if(W||!S.current?.matches(":focus-visible"))return;let{transform:p,width:n,height:J1,autoPanOnNodeFocus:G1,setCenter:q1}=c.getState();if(!G1)return;if(!(C4(new Map([[_,B]]),{x:0,y:0,width:n,height:J1},p,!0).length>0))q1(B.position.x+x.width/2,B.position.y+x.height/2,{zoom:p[2]})};return i.jsx("div",{className:l1(["react-flow__node",`react-flow__node-${C}`,{[z]:y},B.className,{selected:B.selected,selectable:N,parent:R,draggable:y,dragging:j}]),ref:S,style:{zIndex:T.z,transform:`translate(${T.positionAbsolute.x}px,${T.positionAbsolute.y}px)`,pointerEvents:m?"all":"none",visibility:l?"visible":"hidden",...B.style,...v},"data-id":_,"data-testid":`rf__node-${_}`,onMouseEnter:P,onMouseMove:V,onMouseLeave:b,onContextMenu:u,onClick:Q1,onDoubleClick:t,onKeyDown:E?a:void 0,tabIndex:E?0:void 0,onFocus:E?o:void 0,role:B.ariaRole??(E?"group":void 0),"aria-roledescription":"node","aria-describedby":W?void 0:`${t9}-${I}`,"aria-label":B.ariaLabel,...B.domAttributes,children:i.jsx(cU,{value:_,children:i.jsx(f,{id:_,data:B.data,type:C,positionAbsoluteX:T.positionAbsolute.x,positionAbsoluteY:T.positionAbsolute.y,selected:B.selected??!1,selectable:N,draggable:y,deletable:B.deletable??!0,isConnectable:k,sourcePosition:B.sourcePosition,targetPosition:B.targetPosition,dragging:j,dragHandle:B.dragHandle,zIndex:T.z,parentId:B.parentId,...x})})})}var KG=d.memo(XG),YG=(_)=>({nodesConnectable:_.nodesConnectable,nodesFocusable:_.nodesFocusable,elementsSelectable:_.elementsSelectable,onError:_.onError});function F_(_){let{nodesConnectable:Q,nodesFocusable:J,elementsSelectable:q,onError:U}=S1(YG,E1),G=GG(_.onlyRenderVisibleElements),Z=FG();return i.jsx("div",{className:"react-flow__nodes",style:r4,children:G.map((F)=>{return i.jsx(KG,{id:F,nodeTypes:_.nodeTypes,nodeExtent:_.nodeExtent,onClick:_.onNodeClick,onMouseEnter:_.onNodeMouseEnter,onMouseMove:_.onNodeMouseMove,onMouseLeave:_.onNodeMouseLeave,onContextMenu:_.onNodeContextMenu,onDoubleClick:_.onNodeDoubleClick,noDragClassName:_.noDragClassName,noPanClassName:_.noPanClassName,rfId:_.rfId,disableKeyboardA11y:_.disableKeyboardA11y,resizeObserver:Z,nodesDraggable:_.nodesDraggable??!0,nodesConnectable:Q,nodesFocusable:J,elementsSelectable:q,nodeClickDistance:_.nodeClickDistance,onError:U},F)})})}F_.displayName="NodeRenderer";var LG=d.memo(F_);function zG(_){return S1(d.useCallback((J)=>{if(!_)return J.edges.map((U)=>U.id);let q=[];if(J.width&&J.height)for(let U of J.edges){let G=J.nodeLookup.get(U.source),Z=J.nodeLookup.get(U.target);if(G&&Z&&m7({sourceNode:G,targetNode:Z,width:J.width,height:J.height,transform:J.transform}))q.push(U.id)}return q},[_]),E1)}var WG=({color:_="none",strokeWidth:Q=1})=>{let J={strokeWidth:Q,..._&&{stroke:_}};return i.jsx("polyline",{className:"arrow",style:J,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},AG=({color:_="none",strokeWidth:Q=1})=>{let J={strokeWidth:Q,..._&&{stroke:_,fill:_}};return i.jsx("polyline",{className:"arrowclosed",style:J,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},D9={[Q5.Arrow]:WG,[Q5.ArrowClosed]:AG};function BG(_){let Q=x1();return d.useMemo(()=>{if(!Object.prototype.hasOwnProperty.call(D9,_))return Q.getState().onError?.("009",X0.error009(_)),null;return D9[_]},[_])}var MG=({id:_,type:Q,color:J,width:q=12.5,height:U=12.5,markerUnits:G="strokeWidth",strokeWidth:Z,orient:F="auto-start-reverse"})=>{let X=BG(Q);if(!X)return null;return i.jsx("marker",{className:"react-flow__arrowhead",id:_,markerWidth:`${q}`,markerHeight:`${U}`,viewBox:"-10 -10 20 20",markerUnits:G,orient:F,refX:"0",refY:"0",children:i.jsx(X,{color:J,strokeWidth:Z})})},H_=({defaultColor:_,rfId:Q})=>{let J=S1((G)=>G.edges),q=S1((G)=>G.defaultEdgeOptions),U=d.useMemo(()=>{return c7(J,{id:Q,defaultColor:_,defaultMarkerStart:q?.markerStart,defaultMarkerEnd:q?.markerEnd})},[J,q,Q,_]);if(!U.length)return null;return i.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:i.jsx("defs",{children:U.map((G)=>i.jsx(MG,{id:G.id,type:G.type,color:G.color,width:G.width,height:G.height,markerUnits:G.markerUnits,strokeWidth:G.strokeWidth,orient:G.orient},G.id))})})};H_.displayName="MarkerDefinitions";var TG=d.memo(H_);function X_({x:_,y:Q,label:J,labelStyle:q,labelShowBg:U=!0,labelBgStyle:G,labelBgPadding:Z=[2,4],labelBgBorderRadius:F=2,children:X,className:Y,...K}){let[H,L]=d.useState({x:1,y:0,width:0,height:0}),z=l1(["react-flow__edge-textwrapper",Y]),W=d.useRef(null);if(d.useEffect(()=>{if(W.current){let I=W.current.getBBox();L({x:I.x,y:I.y,width:I.width,height:I.height})}},[J]),!J)return null;return i.jsxs("g",{transform:`translate(${_-H.width/2} ${Q-H.height/2})`,className:z,visibility:H.width?"visible":"hidden",...K,children:[U&&i.jsx("rect",{width:H.width+2*Z[0],x:-Z[0],y:-Z[1],height:H.height+2*Z[1],className:"react-flow__edge-textbg",style:G,rx:F,ry:F}),i.jsx("text",{className:"react-flow__edge-text",y:H.height/2,dy:"0.3em",ref:W,style:q,children:J}),X]})}X_.displayName="EdgeText";var RG=d.memo(X_);function i4({path:_,labelX:Q,labelY:J,label:q,labelStyle:U,labelShowBg:G,labelBgStyle:Z,labelBgPadding:F,labelBgBorderRadius:X,interactionWidth:Y=20,...K}){return i.jsxs(i.Fragment,{children:[i.jsx("path",{...K,d:_,fill:"none",className:l1(["react-flow__edge-path",K.className])}),Y?i.jsx("path",{d:_,fill:"none",strokeOpacity:0,strokeWidth:Y,className:"react-flow__edge-interaction"}):null,q&&I0(Q)&&I0(J)?i.jsx(RG,{x:Q,y:J,label:q,labelStyle:U,labelShowBg:G,labelBgStyle:Z,labelBgPadding:F,labelBgBorderRadius:X}):null]})}function b9({pos:_,x1:Q,y1:J,x2:q,y2:U}){if(_===H1.Left||_===H1.Right)return[0.5*(Q+q),J];return[Q,0.5*(J+U)]}function K_({sourceX:_,sourceY:Q,sourcePosition:J=H1.Bottom,targetX:q,targetY:U,targetPosition:G=H1.Top}){let[Z,F]=b9({pos:J,x1:_,y1:Q,x2:q,y2:U}),[X,Y]=b9({pos:G,x1:q,y1:U,x2:_,y2:Q}),[K,H,L,z]=j4({sourceX:_,sourceY:Q,targetX:q,targetY:U,sourceControlX:Z,sourceControlY:F,targetControlX:X,targetControlY:Y});return[`M${_},${Q} C${Z},${F} ${X},${Y} ${q},${U}`,K,H,L,z]}function Y_(_){return d.memo(({id:Q,sourceX:J,sourceY:q,targetX:U,targetY:G,sourcePosition:Z,targetPosition:F,label:X,labelStyle:Y,labelShowBg:K,labelBgStyle:H,labelBgPadding:L,labelBgBorderRadius:z,style:W,markerEnd:I,markerStart:O,interactionWidth:A})=>{let[w,B,T]=K_({sourceX:J,sourceY:q,sourcePosition:Z,targetX:U,targetY:G,targetPosition:F}),R=_.isInternal?void 0:Q;return i.jsx(i4,{id:R,path:w,labelX:B,labelY:T,label:X,labelStyle:Y,labelShowBg:K,labelBgStyle:H,labelBgPadding:L,labelBgBorderRadius:z,style:W,markerEnd:I,markerStart:O,interactionWidth:A})})}var OG=Y_({isInternal:!1}),L_=Y_({isInternal:!0});OG.displayName="SimpleBezierEdge";L_.displayName="SimpleBezierEdgeInternal";function z_(_){return d.memo(({id:Q,sourceX:J,sourceY:q,targetX:U,targetY:G,label:Z,labelStyle:F,labelShowBg:X,labelBgStyle:Y,labelBgPadding:K,labelBgBorderRadius:H,style:L,sourcePosition:z=H1.Bottom,targetPosition:W=H1.Top,markerEnd:I,markerStart:O,pathOptions:A,interactionWidth:w})=>{let[B,T,R]=l5({sourceX:J,sourceY:q,sourcePosition:z,targetX:U,targetY:G,targetPosition:W,borderRadius:A?.borderRadius,offset:A?.offset,stepPosition:A?.stepPosition}),C=_.isInternal?void 0:Q;return i.jsx(i4,{id:C,path:B,labelX:T,labelY:R,label:Z,labelStyle:F,labelShowBg:X,labelBgStyle:Y,labelBgPadding:K,labelBgBorderRadius:H,style:L,markerEnd:I,markerStart:O,interactionWidth:w})})}var W_=z_({isInternal:!1}),A_=z_({isInternal:!0});W_.displayName="SmoothStepEdge";A_.displayName="SmoothStepEdgeInternal";function B_(_){return d.memo(({id:Q,...J})=>{let q=_.isInternal?void 0:Q;return i.jsx(W_,{...J,id:q,pathOptions:d.useMemo(()=>({borderRadius:0,offset:J.pathOptions?.offset}),[J.pathOptions?.offset])})})}var IG=B_({isInternal:!1}),M_=B_({isInternal:!0});IG.displayName="StepEdge";M_.displayName="StepEdgeInternal";function T_(_){return d.memo(({id:Q,sourceX:J,sourceY:q,targetX:U,targetY:G,label:Z,labelStyle:F,labelShowBg:X,labelBgStyle:Y,labelBgPadding:K,labelBgBorderRadius:H,style:L,markerEnd:z,markerStart:W,interactionWidth:I})=>{let[O,A,w]=u4({sourceX:J,sourceY:q,targetX:U,targetY:G}),B=_.isInternal?void 0:Q;return i.jsx(i4,{id:B,path:O,labelX:A,labelY:w,label:Z,labelStyle:F,labelShowBg:X,labelBgStyle:Y,labelBgPadding:K,labelBgBorderRadius:H,style:L,markerEnd:z,markerStart:W,interactionWidth:I})})}var PG=T_({isInternal:!1}),R_=T_({isInternal:!0});PG.displayName="StraightEdge";R_.displayName="StraightEdgeInternal";function O_(_){return d.memo(({id:Q,sourceX:J,sourceY:q,targetX:U,targetY:G,sourcePosition:Z=H1.Bottom,targetPosition:F=H1.Top,label:X,labelStyle:Y,labelShowBg:K,labelBgStyle:H,labelBgPadding:L,labelBgBorderRadius:z,style:W,markerEnd:I,markerStart:O,pathOptions:A,interactionWidth:w})=>{let[B,T,R]=V4({sourceX:J,sourceY:q,sourcePosition:Z,targetX:U,targetY:G,targetPosition:F,curvature:A?.curvature}),C=_.isInternal?void 0:Q;return i.jsx(i4,{id:C,path:B,labelX:T,labelY:R,label:X,labelStyle:Y,labelShowBg:K,labelBgStyle:H,labelBgPadding:L,labelBgBorderRadius:z,style:W,markerEnd:I,markerStart:O,interactionWidth:w})})}var NG=O_({isInternal:!1}),I_=O_({isInternal:!0});NG.displayName="BezierEdge";I_.displayName="BezierEdgeInternal";var E9={default:I_,straight:R_,step:M_,smoothstep:A_,simplebezier:L_},x9={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},wG=(_,Q,J)=>{if(J===H1.Left)return _-Q;if(J===H1.Right)return _+Q;return _},fG=(_,Q,J)=>{if(J===H1.Top)return _-Q;if(J===H1.Bottom)return _+Q;return _},m9="react-flow__edgeupdater";function g9({position:_,centerX:Q,centerY:J,radius:q=10,onMouseDown:U,onMouseEnter:G,onMouseOut:Z,type:F}){return i.jsx("circle",{onMouseDown:U,onMouseEnter:G,onMouseOut:Z,className:l1([m9,`${m9}-${F}`]),cx:wG(Q,q,_),cy:fG(J,q,_),r:q,stroke:"transparent",fill:"transparent"})}function CG({isReconnectable:_,reconnectRadius:Q,edge:J,sourceX:q,sourceY:U,targetX:G,targetY:Z,sourcePosition:F,targetPosition:X,onReconnect:Y,onReconnectStart:K,onReconnectEnd:H,setReconnecting:L,setUpdateHover:z}){let W=x1(),I=(T,R)=>{if(T.button!==0)return;let{autoPanOnConnect:C,domNode:f,connectionMode:y,connectionRadius:N,lib:k,onConnectStart:E,cancelConnection:c,nodeLookup:l,rfId:S,panBy:j,updateConnection:D}=W.getState(),x=R.type==="target",v=(V,b)=>{L(!1),H?.(V,J,R.type,b)},m=(V)=>Y?.(J,V),P=(V,b)=>{L(!0),K?.(T,J,R.type),E?.(V,b)};E4.onPointerDown(T.nativeEvent,{autoPanOnConnect:C,connectionMode:y,connectionRadius:N,domNode:f,handleId:R.id,nodeId:R.nodeId,nodeLookup:l,isTarget:x,edgeUpdaterType:R.type,lib:k,flowId:S,cancelConnection:c,panBy:j,isValidConnection:(...V)=>W.getState().isValidConnection?.(...V)??!0,onConnect:m,onConnectStart:P,onConnectEnd:(...V)=>W.getState().onConnectEnd?.(...V),onReconnectEnd:v,updateConnection:D,getTransform:()=>W.getState().transform,getFromHandle:()=>W.getState().connection.fromHandle,dragThreshold:W.getState().connectionDragThreshold,handleDomNode:T.currentTarget})},O=(T)=>I(T,{nodeId:J.target,id:J.targetHandle??null,type:"target"}),A=(T)=>I(T,{nodeId:J.source,id:J.sourceHandle??null,type:"source"}),w=()=>z(!0),B=()=>z(!1);return i.jsxs(i.Fragment,{children:[(_===!0||_==="source")&&i.jsx(g9,{position:F,centerX:q,centerY:U,radius:Q,onMouseDown:O,onMouseEnter:w,onMouseOut:B,type:"source"}),(_===!0||_==="target")&&i.jsx(g9,{position:X,centerX:G,centerY:Z,radius:Q,onMouseDown:A,onMouseEnter:w,onMouseOut:B,type:"target"})]})}function SG({id:_,edgesFocusable:Q,edgesReconnectable:J,elementsSelectable:q,onClick:U,onDoubleClick:G,onContextMenu:Z,onMouseEnter:F,onMouseMove:X,onMouseLeave:Y,reconnectRadius:K,onReconnect:H,onReconnectStart:L,onReconnectEnd:z,rfId:W,edgeTypes:I,noPanClassName:O,onError:A,disableKeyboardA11y:w}){let B=S1((q1)=>q1.edgeLookup.get(_)),T=S1((q1)=>q1.defaultEdgeOptions);B=T?{...T,...B}:B;let R=B.type||"default",C=I?.[R]||E9[R];if(C===void 0)A?.("011",X0.error011(R)),R="default",C=I?.default||E9.default;let f=!!(B.focusable||Q&&typeof B.focusable>"u"),y=typeof H<"u"&&(B.reconnectable||J&&typeof B.reconnectable>"u"),N=!!(B.selectable||q&&typeof B.selectable>"u"),k=d.useRef(null),[E,c]=d.useState(!1),[l,S]=d.useState(!1),j=x1(),{zIndex:D=B.zIndex,sourceX:x,sourceY:v,targetX:m,targetY:P,sourcePosition:V,targetPosition:b}=S1(d.useCallback((q1)=>{let Y1=q1.nodeLookup.get(B.source),M1=q1.nodeLookup.get(B.target);if(!Y1||!M1)return x9;let L1=p7({id:_,sourceNode:Y1,targetNode:M1,sourceHandle:B.sourceHandle||null,targetHandle:B.targetHandle||null,connectionMode:q1.connectionMode,onError:A}),e=x7({selected:B.selected,zIndex:B.zIndex,sourceNode:Y1,targetNode:M1,elevateOnSelect:q1.elevateEdgesOnSelect,zIndexMode:q1.zIndexMode});return{...L1||x9,zIndex:e}},[B.source,B.target,B.sourceHandle,B.targetHandle,B.selected,B.zIndex,A]),E1),u=d.useMemo(()=>B.markerStart?`url('#${h4(B.markerStart,W)}')`:void 0,[B.markerStart,W]),t=d.useMemo(()=>B.markerEnd?`url('#${h4(B.markerEnd,W)}')`:void 0,[B.markerEnd,W]);if(B.hidden||x===null||v===null||m===null||P===null)return null;let Q1=(q1)=>{let{addSelectedEdges:Y1,unselectNodesAndEdges:M1,multiSelectionActive:L1}=j.getState();if(N)if(j.setState({nodesSelectionActive:!1}),B.selected&&L1)M1({nodes:[],edges:[B]}),k.current?.blur();else Y1([_]);if(U)U(q1,B)},a=G?(q1)=>{G(q1,{...B})}:void 0,o=Z?(q1)=>{Z(q1,{...B})}:void 0,p=F?(q1)=>{F(q1,{...B})}:void 0,n=X?(q1)=>{X(q1,{...B})}:void 0,J1=Y?(q1)=>{Y(q1,{...B})}:void 0,G1=(q1)=>{if(!w&&j6.includes(q1.key)&&N){let{unselectNodesAndEdges:Y1,addSelectedEdges:M1}=j.getState();if(q1.key==="Escape")k.current?.blur(),Y1({edges:[B]});else M1([_])}};return i.jsx("svg",{style:{zIndex:D},children:i.jsxs("g",{className:l1(["react-flow__edge",`react-flow__edge-${R}`,B.className,O,{selected:B.selected,animated:B.animated,inactive:!N&&!U,updating:E,selectable:N}]),onClick:Q1,onDoubleClick:a,onContextMenu:o,onMouseEnter:p,onMouseMove:n,onMouseLeave:J1,onKeyDown:f?G1:void 0,tabIndex:f?0:void 0,role:B.ariaRole??(f?"group":"img"),"aria-roledescription":"edge","data-id":_,"data-testid":`rf__edge-${_}`,"aria-label":B.ariaLabel===null?void 0:B.ariaLabel||`Edge from ${B.source} to ${B.target}`,"aria-describedby":f?`${o9}-${W}`:void 0,ref:k,...B.domAttributes,children:[!l&&i.jsx(C,{id:_,source:B.source,target:B.target,type:B.type,selected:B.selected,animated:B.animated,selectable:N,deletable:B.deletable??!0,label:B.label,labelStyle:B.labelStyle,labelShowBg:B.labelShowBg,labelBgStyle:B.labelBgStyle,labelBgPadding:B.labelBgPadding,labelBgBorderRadius:B.labelBgBorderRadius,sourceX:x,sourceY:v,targetX:m,targetY:P,sourcePosition:V,targetPosition:b,data:B.data,style:B.style,sourceHandleId:B.sourceHandle,targetHandleId:B.targetHandle,markerStart:u,markerEnd:t,pathOptions:"pathOptions"in B?B.pathOptions:void 0,interactionWidth:B.interactionWidth}),y&&i.jsx(CG,{edge:B,isReconnectable:y,reconnectRadius:K,onReconnect:H,onReconnectStart:L,onReconnectEnd:z,sourceX:x,sourceY:v,targetX:m,targetY:P,sourcePosition:V,targetPosition:b,setUpdateHover:c,setReconnecting:S})]})})}var yG=d.memo(SG),kG=(_)=>({edgesFocusable:_.edgesFocusable,edgesReconnectable:_.edgesReconnectable,elementsSelectable:_.elementsSelectable,connectionMode:_.connectionMode,onError:_.onError});function P_({defaultMarkerColor:_,onlyRenderVisibleElements:Q,rfId:J,edgeTypes:q,noPanClassName:U,onReconnect:G,onEdgeContextMenu:Z,onEdgeMouseEnter:F,onEdgeMouseMove:X,onEdgeMouseLeave:Y,onEdgeClick:K,reconnectRadius:H,onEdgeDoubleClick:L,onReconnectStart:z,onReconnectEnd:W,disableKeyboardA11y:I}){let{edgesFocusable:O,edgesReconnectable:A,elementsSelectable:w,onError:B}=S1(kG,E1),T=zG(Q);return i.jsxs("div",{className:"react-flow__edges",children:[i.jsx(TG,{defaultColor:_,rfId:J}),T.map((R)=>{return i.jsx(yG,{id:R,edgesFocusable:O,edgesReconnectable:A,elementsSelectable:w,noPanClassName:U,onReconnect:G,onContextMenu:Z,onMouseEnter:F,onMouseMove:X,onMouseLeave:Y,onClick:K,reconnectRadius:H,onDoubleClick:L,onReconnectStart:z,onReconnectEnd:W,rfId:J,onError:B,edgeTypes:q,disableKeyboardA11y:I},R)})]})}P_.displayName="EdgeRenderer";var vG=d.memo(P_),p9=(_)=>`translate(${_[0]}px,${_[1]}px) scale(${_[2]})`;function jG({children:_}){let Q=x1(),J=d.useRef(null),[q]=d.useState(()=>Q.getState().transform);return J_(()=>{let U=null,G=()=>{let Z=Q.getState().transform;if(U&&Z[0]===U[0]&&Z[1]===U[1]&&Z[2]===U[2])return;if(U=Z,J.current)J.current.style.transform=p9(Z)};return G(),Q.subscribe(G)},[Q]),i.jsx("div",{ref:J,className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:p9(q)},children:_})}function VG(_){let Q=i5(),J=d.useRef(!1);d.useEffect(()=>{if(!J.current&&Q.viewportInitialized&&_)setTimeout(()=>_(Q),1),J.current=!0},[_,Q.viewportInitialized])}var uG=(_)=>_.panZoom?.syncViewport;function hG(_){let Q=S1(uG),J=x1();return d.useEffect(()=>{if(_)Q?.(_),J.setState({transform:[_.x,_.y,_.zoom]})},[_,Q]),null}function c9(_){return _.connection.inProgress?{..._.connection,to:G5(_.connection.to,_.transform)}:{..._.connection}}function DG(_){if(_)return(J)=>{let q=c9(J);return _(q)};return c9}function bG(_){let Q=DG(_);return S1(Q,E1)}var EG=(_)=>({nodesConnectable:_.nodesConnectable,isValid:_.connection.isValid,inProgress:_.connection.inProgress,width:_.width,height:_.height});function xG({containerStyle:_,style:Q,type:J,component:q}){let{nodesConnectable:U,width:G,height:Z,isValid:F,inProgress:X}=S1(EG,E1);if(!(G&&U&&X))return null;return i.jsx("svg",{style:_,width:G,height:Z,className:"react-flow__connectionline react-flow__container",children:i.jsx("g",{className:l1(["react-flow__connection",r6(F)]),children:i.jsx(N_,{style:Q,type:J,CustomComponent:q,isValid:F})})})}var N_=({style:_,type:Q=x0.Bezier,CustomComponent:J,isValid:q})=>{let{inProgress:U,from:G,fromNode:Z,fromHandle:F,fromPosition:X,to:Y,toNode:K,toHandle:H,toPosition:L,pointer:z}=bG();if(!U)return;if(J)return i.jsx(J,{connectionLineType:Q,connectionLineStyle:_,fromNode:Z,fromHandle:F,fromX:G.x,fromY:G.y,toX:Y.x,toY:Y.y,fromPosition:X,toPosition:L,connectionStatus:r6(q),toNode:K,toHandle:H,pointer:z});let W="",I={sourceX:G.x,sourceY:G.y,sourcePosition:X,targetX:Y.x,targetY:Y.y,targetPosition:L};switch(Q){case x0.Bezier:[W]=V4(I);break;case x0.SimpleBezier:[W]=K_(I);break;case x0.Step:[W]=l5({...I,borderRadius:0});break;case x0.SmoothStep:[W]=l5(I);break;default:[W]=u4(I)}return i.jsx("path",{d:W,fill:"none",className:"react-flow__connection-path",style:_})};N_.displayName="ConnectionLine";var mG={};function l9(_=mG){let Q=d.useRef(_),J=x1();d.useEffect(()=>{{let q=new Set([...Object.keys(Q.current),...Object.keys(_)]);for(let U of q)if(Q.current[U]!==_[U]){J.getState().onError?.("002",X0.error002());break}Q.current=_}},[_])}function gG(){let _=x1(),Q=d.useRef(!1);d.useEffect(()=>{if(!Q.current){let J=document.querySelector(".react-flow__pane");if(J&&window.getComputedStyle(J).zIndex!=="1")_.getState().onError?.("013",X0.error013("react"));Q.current=!0}},[])}function w_({nodeTypes:_,edgeTypes:Q,onInit:J,onNodeClick:q,onEdgeClick:U,onNodeDoubleClick:G,onEdgeDoubleClick:Z,onNodeMouseEnter:F,onNodeMouseMove:X,onNodeMouseLeave:Y,onNodeContextMenu:K,onSelectionContextMenu:H,onSelectionStart:L,onSelectionEnd:z,connectionLineType:W,connectionLineStyle:I,connectionLineComponent:O,connectionLineContainerStyle:A,selectionKeyCode:w,selectionOnDrag:B,selectionMode:T,multiSelectionKeyCode:R,panActivationKeyCode:C,zoomActivationKeyCode:f,deleteKeyCode:y,onlyRenderVisibleElements:N,elementsSelectable:k,defaultViewport:E,translateExtent:c,minZoom:l,maxZoom:S,preventScrolling:j,defaultMarkerColor:D,zoomOnScroll:x,zoomOnPinch:v,panOnScroll:m,panOnScrollSpeed:P,panOnScrollMode:V,zoomOnDoubleClick:b,panOnDrag:u,autoPanOnSelection:t,onPaneClick:Q1,onPaneMouseEnter:a,onPaneMouseMove:o,onPaneMouseLeave:p,onPaneScroll:n,onPaneContextMenu:J1,paneClickDistance:G1,nodeClickDistance:q1,onEdgeContextMenu:Y1,onEdgeMouseEnter:M1,onEdgeMouseMove:L1,onEdgeMouseLeave:e,reconnectRadius:O1,onReconnect:X1,onReconnectStart:D1,onReconnectEnd:a1,noDragClassName:_0,noWheelClassName:T0,noPanClassName:L0,disableKeyboardA11y:z0,nodeExtent:t1,rfId:Z0,viewport:F0,onViewportChange:W0,nodesDraggable:r0}){return l9(_),l9(Q),gG(),VG(J),hG(F0),i.jsx(qG,{onPaneClick:Q1,onPaneMouseEnter:a,onPaneMouseMove:o,onPaneMouseLeave:p,onPaneContextMenu:J1,onPaneScroll:n,paneClickDistance:G1,deleteKeyCode:y,selectionKeyCode:w,selectionOnDrag:B,selectionMode:T,onSelectionStart:L,onSelectionEnd:z,multiSelectionKeyCode:R,panActivationKeyCode:C,zoomActivationKeyCode:f,elementsSelectable:k,zoomOnScroll:x,zoomOnPinch:v,zoomOnDoubleClick:b,panOnScroll:m,panOnScrollSpeed:P,panOnScrollMode:V,panOnDrag:u,autoPanOnSelection:t,defaultViewport:E,translateExtent:c,minZoom:l,maxZoom:S,onSelectionContextMenu:H,preventScrolling:j,noDragClassName:_0,noWheelClassName:T0,noPanClassName:L0,disableKeyboardA11y:z0,onViewportChange:W0,isControlledViewport:!!F0,children:i.jsxs(jG,{children:[i.jsx(vG,{edgeTypes:Q,onEdgeClick:U,onEdgeDoubleClick:Z,onReconnect:X1,onReconnectStart:D1,onReconnectEnd:a1,onlyRenderVisibleElements:N,onEdgeContextMenu:Y1,onEdgeMouseEnter:M1,onEdgeMouseMove:L1,onEdgeMouseLeave:e,reconnectRadius:O1,defaultMarkerColor:D,noPanClassName:L0,disableKeyboardA11y:z0,rfId:Z0}),i.jsx(xG,{style:I,type:W,component:O,containerStyle:A}),i.jsx("div",{className:"react-flow__edgelabel-renderer"}),i.jsx(LG,{nodeTypes:_,onNodeClick:q,onNodeDoubleClick:G,onNodeMouseEnter:F,onNodeMouseMove:X,onNodeMouseLeave:Y,onNodeContextMenu:K,nodeClickDistance:q1,onlyRenderVisibleElements:N,noPanClassName:L0,noDragClassName:_0,disableKeyboardA11y:z0,nodeExtent:t1,rfId:Z0,nodesDraggable:r0}),i.jsx("div",{className:"react-flow__viewport-portal"})]})})}w_.displayName="GraphView";var pG=d.memo(w_),cG=g6("React Flow","https://reactflow.dev/"),r9=({nodes:_,edges:Q,defaultNodes:J,defaultEdges:q,width:U,height:G,fitView:Z,fitViewOptions:F,minZoom:X=0.5,maxZoom:Y=2,nodeOrigin:K,nodeExtent:H,zIndexMode:L="basic"}={})=>{let z=new Map,W=new Map,I=new Map,O=new Map,A=q??Q??[],w=J??_??[],B=K??[0,0],T=H??$5;_8(I,O,A);let{nodesInitialized:R}=D4(w,z,W,{nodeOrigin:B,nodeExtent:T,zIndexMode:L}),C=[0,0,1];if(Z&&U&&G){let f=u2(z,{filter:(E)=>!!((E.width||E.initialWidth)&&(E.height||E.initialHeight))}),{x:y,y:N,zoom:k}=c5(f,U,G,X,Y,F?.padding??0.1);C=[y,N,k]}return{rfId:"1",width:U??0,height:G??0,transform:C,nodes:w,nodesInitialized:R,nodeLookup:z,parentLookup:W,edges:A,edgeLookup:O,connectionLookup:I,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:J!==void 0,hasDefaultEdges:q!==void 0,panZoom:null,minZoom:X,maxZoom:Y,translateExtent:$5,nodeExtent:T,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:L2.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:B,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:F,fitViewResolver:null,connection:{...u6},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:cG,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:V6,zIndexMode:L,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}},lG=({nodes:_,edges:Q,defaultNodes:J,defaultEdges:q,width:U,height:G,fitView:Z,fitViewOptions:F,minZoom:X,maxZoom:Y,nodeOrigin:K,nodeExtent:H,zIndexMode:L})=>B9((z,W)=>{async function I(){let{nodeLookup:O,panZoom:A,fitViewOptions:w,fitViewResolver:B,width:T,height:R,minZoom:C,maxZoom:f}=W();if(!A)return;await j7({nodes:O,width:T,height:R,panZoom:A,minZoom:C,maxZoom:f},w),B?.resolve(!0),z({fitViewResolver:null})}return{...r9({nodes:_,edges:Q,width:U,height:G,fitView:Z,fitViewOptions:F,minZoom:X,maxZoom:Y,nodeOrigin:K,nodeExtent:H,defaultNodes:J,defaultEdges:q,zIndexMode:L}),setNodes:(O)=>{let{nodeLookup:A,parentLookup:w,nodeOrigin:B,nodeExtent:T,elevateNodesOnSelect:R,fitViewQueued:C,zIndexMode:f,nodesSelectionActive:y}=W(),{nodesInitialized:N,hasSelectedNodes:k}=D4(O,A,w,{nodeOrigin:B,nodeExtent:T,elevateNodesOnSelect:R,checkEquality:!0,zIndexMode:f}),E=y&&k;if(C&&N)I(),z({nodes:O,nodesInitialized:N,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:E});else z({nodes:O,nodesInitialized:N,nodesSelectionActive:E})},setEdges:(O)=>{let{connectionLookup:A,edgeLookup:w}=W();_8(A,w,O),z({edges:O})},setDefaultNodesAndEdges:(O,A)=>{if(O){let{setNodes:w}=W();w(O),z({hasDefaultNodes:!0})}if(A){let{setEdges:w}=W();w(A),z({hasDefaultEdges:!0})}},updateNodeInternals:(O)=>{let{triggerNodeChanges:A,nodeLookup:w,parentLookup:B,domNode:T,nodeOrigin:R,nodeExtent:C,debug:f,fitViewQueued:y,zIndexMode:N}=W(),{changes:k,updatedInternals:E}=a7(O,w,B,T,R,C,N);if(!E)return;if(i7(w,B,{nodeOrigin:R,nodeExtent:C,zIndexMode:N}),y)I(),z({fitViewQueued:!1,fitViewOptions:void 0});else z({});if(k?.length>0){if(f)console.log("React Flow: trigger node changes",k);A?.(k)}},updateNodePositions:(O,A=!1)=>{let w=[],B=[],{nodeLookup:T,triggerNodeChanges:R,connection:C,updateConnection:f,onNodesChangeMiddlewareMap:y}=W();for(let[N,k]of O){let E=T.get(N),c=!!(E?.expandParent&&E?.parentId&&k?.position),l={id:N,type:"position",position:c?{x:Math.max(0,k.position.x),y:Math.max(0,k.position.y)}:k.position,dragging:A};if(E&&C.inProgress&&C.fromNode.id===E.id){let S=z2(E,C.fromHandle,H1.Left,!0);f({...C,from:S})}if(c&&E.parentId)w.push({id:N,parentId:E.parentId,rect:{...k.internals.positionAbsolute,width:k.measured.width??0,height:k.measured.height??0}});B.push(l)}if(w.length>0){let{parentLookup:N,nodeOrigin:k}=W(),E=b4(w,T,N,k);B.push(...E)}for(let N of y.values())B=N(B);R(B)},triggerNodeChanges:(O)=>{let{onNodesChange:A,setNodes:w,nodes:B,hasDefaultNodes:T,debug:R}=W();if(O?.length){if(T){let C=__(O,B);w(C)}if(R)console.log("React Flow: trigger node changes",O);A?.(O)}},triggerEdgeChanges:(O)=>{let{onEdgesChange:A,setEdges:w,edges:B,hasDefaultEdges:T,debug:R}=W();if(O?.length){if(T){let C=wU(O,B);w(C)}if(R)console.log("React Flow: trigger edge changes",O);A?.(O)}},addSelectedNodes:(O)=>{let{multiSelectionActive:A,edgeLookup:w,nodeLookup:B,triggerNodeChanges:T,triggerEdgeChanges:R}=W();if(A){let C=O.map((f)=>h2(f,!0));T(C);return}T(F5(B,new Set([...O]),!0)),R(F5(w))},addSelectedEdges:(O)=>{let{multiSelectionActive:A,edgeLookup:w,nodeLookup:B,triggerNodeChanges:T,triggerEdgeChanges:R}=W();if(A){let C=O.map((f)=>h2(f,!0));R(C);return}R(F5(w,new Set([...O]))),T(F5(B,new Set,!0))},unselectNodesAndEdges:({nodes:O,edges:A}={})=>{let{edges:w,nodes:B,nodeLookup:T,triggerNodeChanges:R,triggerEdgeChanges:C}=W(),f=O?O:B,y=A?A:w,N=[];for(let E of f){if(!E.selected)continue;let c=T.get(E.id);if(c)c.selected=!1;N.push(h2(E.id,!1))}let k=[];for(let E of y){if(!E.selected)continue;k.push(h2(E.id,!1))}R(N),C(k)},setMinZoom:(O)=>{let{panZoom:A,maxZoom:w}=W();A?.setScaleExtent([O,w]),z({minZoom:O})},setMaxZoom:(O)=>{let{panZoom:A,minZoom:w}=W();A?.setScaleExtent([w,O]),z({maxZoom:O})},setTranslateExtent:(O)=>{W().panZoom?.setTranslateExtent(O),z({translateExtent:O})},resetSelectedElements:()=>{let{edges:O,nodes:A,triggerNodeChanges:w,triggerEdgeChanges:B,elementsSelectable:T}=W();if(!T)return;let R=A.reduce((f,y)=>y.selected?[...f,h2(y.id,!1)]:f,[]),C=O.reduce((f,y)=>y.selected?[...f,h2(y.id,!1)]:f,[]);w(R),B(C)},setNodeExtent:(O)=>{let{nodes:A,nodeLookup:w,parentLookup:B,nodeOrigin:T,elevateNodesOnSelect:R,nodeExtent:C,zIndexMode:f}=W();if(O[0][0]===C[0][0]&&O[0][1]===C[0][1]&&O[1][0]===C[1][0]&&O[1][1]===C[1][1])return;D4(A,w,B,{nodeOrigin:T,nodeExtent:O,elevateNodesOnSelect:R,checkEquality:!1,zIndexMode:f}),z({nodeExtent:O})},panBy:(O)=>{let{transform:A,width:w,height:B,panZoom:T,translateExtent:R}=W();return s7({delta:O,panZoom:T,transform:A,translateExtent:R,width:w,height:B})},setCenter:async(O,A,w)=>{let{width:B,height:T,maxZoom:R,panZoom:C}=W();if(!C)return!1;let f=typeof w?.zoom<"u"?w.zoom:R;return await C.setViewport({x:B/2-O*f,y:T/2-A*f,zoom:f},{duration:w?.duration,ease:w?.ease,interpolate:w?.interpolate}),!0},cancelConnection:()=>{z({connection:{...u6}})},updateConnection:(O)=>{z({connection:O})},reset:()=>z({...r9()})}},Object.is);function F8({initialNodes:_,initialEdges:Q,defaultNodes:J,defaultEdges:q,initialWidth:U,initialHeight:G,initialMinZoom:Z,initialMaxZoom:F,initialFitViewOptions:X,fitView:Y,nodeOrigin:K,nodeExtent:H,zIndexMode:L,children:z}){let[W]=d.useState(()=>lG({nodes:_,edges:Q,defaultNodes:J,defaultEdges:q,width:U,height:G,fitView:Y,minZoom:Z,maxZoom:F,fitViewOptions:X,nodeOrigin:K,nodeExtent:H,zIndexMode:L}));return i.jsx(UU,{value:W,children:i.jsx(kU,{children:i.jsx(rU,{children:z})})})}function rG({children:_,nodes:Q,edges:J,defaultNodes:q,defaultEdges:U,width:G,height:Z,fitView:F,fitViewOptions:X,minZoom:Y,maxZoom:K,nodeOrigin:H,nodeExtent:L,zIndexMode:z}){if(d.useContext(l4))return i.jsx(i.Fragment,{children:_});return i.jsx(F8,{initialNodes:Q,initialEdges:J,defaultNodes:q,defaultEdges:U,initialWidth:G,initialHeight:Z,fitView:F,initialFitViewOptions:X,initialMinZoom:Y,initialMaxZoom:K,nodeOrigin:H,nodeExtent:L,zIndexMode:z,children:_})}var iG={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function dG({nodes:_,edges:Q,defaultNodes:J,defaultEdges:q,className:U,nodeTypes:G,edgeTypes:Z,onNodeClick:F,onEdgeClick:X,onInit:Y,onMove:K,onMoveStart:H,onMoveEnd:L,onConnect:z,onConnectStart:W,onConnectEnd:I,onClickConnectStart:O,onClickConnectEnd:A,onNodeMouseEnter:w,onNodeMouseMove:B,onNodeMouseLeave:T,onNodeContextMenu:R,onNodeDoubleClick:C,onNodeDragStart:f,onNodeDrag:y,onNodeDragStop:N,onNodesDelete:k,onEdgesDelete:E,onDelete:c,onSelectionChange:l,onSelectionDragStart:S,onSelectionDrag:j,onSelectionDragStop:D,onSelectionContextMenu:x,onSelectionStart:v,onSelectionEnd:m,onBeforeDelete:P,connectionMode:V,connectionLineType:b=x0.Bezier,connectionLineStyle:u,connectionLineComponent:t,connectionLineContainerStyle:Q1,deleteKeyCode:a="Backspace",selectionKeyCode:o="Shift",selectionOnDrag:p=!1,selectionMode:n=k2.Full,panActivationKeyCode:J1="Space",multiSelectionKeyCode:G1=Z5()?"Meta":"Control",zoomActivationKeyCode:q1=Z5()?"Meta":"Control",snapToGrid:Y1,snapGrid:M1,onlyRenderVisibleElements:L1=!1,selectNodesOnDrag:e,nodesDraggable:O1,autoPanOnNodeFocus:X1,nodesConnectable:D1,nodesFocusable:a1,nodeOrigin:_0=n9,edgesFocusable:T0,edgesReconnectable:L0,elementsSelectable:z0=!0,defaultViewport:t1=MU,minZoom:Z0=0.5,maxZoom:F0=2,translateExtent:W0=$5,preventScrolling:r0=!0,nodeExtent:C0,defaultMarkerColor:S0="#b1b1b7",zoomOnScroll:i0=!0,zoomOnPinch:B2=!0,panOnScroll:M2=!1,panOnScrollSpeed:u0=0.5,panOnScrollMode:M=o0.Free,zoomOnDoubleClick:g=!0,panOnDrag:_1=!0,onPaneClick:$1,onPaneMouseEnter:K1,onPaneMouseMove:w1,onPaneMouseLeave:R1,onPaneScroll:v1,onPaneContextMenu:I1,paneClickDistance:R0=1,nodeClickDistance:O0=0,children:r2,onReconnect:G2,onReconnectStart:_4,onReconnectEnd:$3,onEdgeContextMenu:q3,onEdgeDoubleClick:h,onEdgeMouseEnter:s,onEdgeMouseMove:U1,onEdgeMouseLeave:Z1,reconnectRadius:C1=10,onNodesChange:F1,onEdgesChange:z1,noDragClassName:A1="nodrag",noWheelClassName:f1="nowheel",noPanClassName:p1="nopan",fitView:P1,fitViewOptions:c1,connectOnClick:h1,attributionPosition:L5,proOptions:A0,defaultEdgeOptions:b1,elevateNodesOnSelect:fQ=!0,elevateEdgesOnSelect:CQ=!1,disableKeyboardA11y:w8=!1,autoPanOnConnect:SQ,autoPanOnNodeDrag:yQ,autoPanOnSelection:kQ=!0,autoPanSpeed:vQ,connectionRadius:jQ,isValidConnection:VQ,onError:uQ,style:hQ,id:f8,nodeDragThreshold:DQ,connectionDragThreshold:bQ,viewport:EQ,onViewportChange:xQ,width:mQ,height:gQ,colorMode:pQ="light",debug:cQ,onScroll:C8,ariaLabelConfig:lQ,zIndexMode:S8="basic",...rQ},iQ){let U3=f8||"1",dQ=IU(pQ),aQ=d.useCallback((y8)=>{y8.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),C8?.(y8)},[C8]);return i.jsx("div",{"data-testid":"rf__wrapper",...rQ,onScroll:aQ,style:{...hQ,...iG},ref:iQ,className:l1(["react-flow",U,dQ]),id:f8,role:"application",children:i.jsxs(rG,{nodes:_,edges:Q,width:mQ,height:gQ,fitView:P1,fitViewOptions:c1,minZoom:Z0,maxZoom:F0,nodeOrigin:_0,nodeExtent:C0,zIndexMode:S8,children:[i.jsx(OU,{nodes:_,edges:Q,defaultNodes:J,defaultEdges:q,onConnect:z,onConnectStart:W,onConnectEnd:I,onClickConnectStart:O,onClickConnectEnd:A,nodesDraggable:O1,autoPanOnNodeFocus:X1,nodesConnectable:D1,nodesFocusable:a1,edgesFocusable:T0,edgesReconnectable:L0,elementsSelectable:z0,elevateNodesOnSelect:fQ,elevateEdgesOnSelect:CQ,minZoom:Z0,maxZoom:F0,nodeExtent:C0,onNodesChange:F1,onEdgesChange:z1,snapToGrid:Y1,snapGrid:M1,connectionMode:V,translateExtent:W0,connectOnClick:h1,defaultEdgeOptions:b1,fitView:P1,fitViewOptions:c1,onNodesDelete:k,onEdgesDelete:E,onDelete:c,onNodeDragStart:f,onNodeDrag:y,onNodeDragStop:N,onSelectionDrag:j,onSelectionDragStart:S,onSelectionDragStop:D,onMove:K,onMoveStart:H,onMoveEnd:L,noPanClassName:p1,nodeOrigin:_0,rfId:U3,autoPanOnConnect:SQ,autoPanOnNodeDrag:yQ,autoPanSpeed:vQ,onError:uQ,connectionRadius:jQ,isValidConnection:VQ,selectNodesOnDrag:e,nodeDragThreshold:DQ,connectionDragThreshold:bQ,onBeforeDelete:P,debug:cQ,ariaLabelConfig:lQ,zIndexMode:S8}),i.jsx(pG,{onInit:Y,onNodeClick:F,onEdgeClick:X,onNodeMouseEnter:w,onNodeMouseMove:B,onNodeMouseLeave:T,onNodeContextMenu:R,onNodeDoubleClick:C,nodeTypes:G,edgeTypes:Z,connectionLineType:b,connectionLineStyle:u,connectionLineComponent:t,connectionLineContainerStyle:Q1,selectionKeyCode:o,selectionOnDrag:p,selectionMode:n,deleteKeyCode:a,multiSelectionKeyCode:G1,panActivationKeyCode:J1,zoomActivationKeyCode:q1,onlyRenderVisibleElements:L1,defaultViewport:t1,translateExtent:W0,minZoom:Z0,maxZoom:F0,preventScrolling:r0,zoomOnScroll:i0,zoomOnPinch:B2,zoomOnDoubleClick:g,panOnScroll:M2,panOnScrollSpeed:u0,panOnScrollMode:M,panOnDrag:_1,autoPanOnSelection:kQ,onPaneClick:$1,onPaneMouseEnter:K1,onPaneMouseMove:w1,onPaneMouseLeave:R1,onPaneScroll:v1,onPaneContextMenu:I1,paneClickDistance:R0,nodeClickDistance:O0,onSelectionContextMenu:x,onSelectionStart:v,onSelectionEnd:m,onReconnect:G2,onReconnectStart:_4,onReconnectEnd:$3,onEdgeContextMenu:q3,onEdgeDoubleClick:h,onEdgeMouseEnter:s,onEdgeMouseMove:U1,onEdgeMouseLeave:Z1,reconnectRadius:C1,defaultMarkerColor:S0,noDragClassName:A1,noWheelClassName:f1,noPanClassName:p1,rfId:U3,disableKeyboardA11y:w8,nodeExtent:C0,viewport:EQ,onViewportChange:xQ,nodesDraggable:O1}),i.jsx(BU,{onSelectionChange:l}),r2,i.jsx(YU,{proOptions:A0,position:L5}),i.jsx(KU,{rfId:U3,disableKeyboardA11y:w8})]})})}var f_=Q_(dG);function C_(_){let[Q,J]=d.useState(_),q=d.useCallback((U)=>J((G)=>__(U,G)),[]);return[Q,J,q]}var xB=X0.error014();function aG({dimensions:_,lineWidth:Q,variant:J,className:q}){return i.jsx("path",{strokeWidth:Q,d:`M${_[0]/2} 0 V${_[1]} M0 ${_[1]/2} H${_[0]}`,className:l1(["react-flow__background-pattern",J,q])})}function sG({radius:_,className:Q}){return i.jsx("circle",{cx:_,cy:_,r:_,className:l1(["react-flow__background-pattern","dots",Q])})}var m0;(function(_){_.Lines="lines",_.Dots="dots",_.Cross="cross"})(m0||(m0={}));var tG={[m0.Dots]:1,[m0.Lines]:1,[m0.Cross]:6},oG=(_)=>({transform:_.transform,patternId:`pattern-${_.rfId}`});function S_({id:_,variant:Q=m0.Dots,gap:J=20,size:q,lineWidth:U=1,offset:G=0,color:Z,bgColor:F,style:X,className:Y,patternClassName:K}){let H=d.useRef(null),{transform:L,patternId:z}=S1(oG,E1),W=q||tG[Q],I=Q===m0.Dots,O=Q===m0.Cross,A=Array.isArray(J)?J:[J,J],w=[A[0]*L[2]||1,A[1]*L[2]||1],B=W*L[2],T=Array.isArray(G)?G:[G,G],R=O?[B,B]:w,C=[T[0]*L[2]+R[0]/2,T[1]*L[2]+R[1]/2],f=`${z}${_?_:""}`;return i.jsxs("svg",{className:l1(["react-flow__background",Y]),style:{...X,...r4,"--xy-background-color-props":F,"--xy-background-pattern-color-props":Z},ref:H,"data-testid":"rf__background",children:[i.jsx("pattern",{id:f,x:L[0]%w[0],y:L[1]%w[1],width:w[0],height:w[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${C[0]},-${C[1]})`,children:I?i.jsx(sG,{radius:B/2,className:K}):i.jsx(aG,{dimensions:R,lineWidth:U,variant:Q,className:K})}),i.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${f})`})]})}S_.displayName="Background";var y_=d.memo(S_);function nG(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:i.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function eG(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:i.jsx("path",{d:"M0 0h32v4.2H0z"})})}function _Z(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:i.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 QZ(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:i.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 JZ(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:i.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 g4({children:_,className:Q,...J}){return i.jsx("button",{type:"button",className:l1(["react-flow__controls-button",Q]),...J,children:_})}var $Z=(_)=>({isInteractive:_.nodesDraggable||_.nodesConnectable||_.elementsSelectable,minZoomReached:_.transform[2]<=_.minZoom,maxZoomReached:_.transform[2]>=_.maxZoom,ariaLabelConfig:_.ariaLabelConfig});function k_({style:_,showZoom:Q=!0,showFitView:J=!0,showInteractive:q=!0,fitViewOptions:U,onZoomIn:G,onZoomOut:Z,onFitView:F,onInteractiveChange:X,className:Y,children:K,position:H="bottom-left",orientation:L="vertical","aria-label":z}){let W=x1(),{isInteractive:I,minZoomReached:O,maxZoomReached:A,ariaLabelConfig:w}=S1($Z,E1),{zoomIn:B,zoomOut:T,fitView:R}=i5(),C=()=>{B(),G?.()},f=()=>{T(),Z?.()},y=()=>{R(U),F?.()},N=()=>{W.setState({nodesDraggable:!I,nodesConnectable:!I,elementsSelectable:!I}),X?.(!I)};return i.jsxs(g0,{className:l1(["react-flow__controls",L==="horizontal"?"horizontal":"vertical",Y]),position:H,style:_,"data-testid":"rf__controls","aria-label":z??w["controls.ariaLabel"],children:[Q&&i.jsxs(i.Fragment,{children:[i.jsx(g4,{onClick:C,className:"react-flow__controls-zoomin",title:w["controls.zoomIn.ariaLabel"],"aria-label":w["controls.zoomIn.ariaLabel"],disabled:A,children:i.jsx(nG,{})}),i.jsx(g4,{onClick:f,className:"react-flow__controls-zoomout",title:w["controls.zoomOut.ariaLabel"],"aria-label":w["controls.zoomOut.ariaLabel"],disabled:O,children:i.jsx(eG,{})})]}),J&&i.jsx(g4,{className:"react-flow__controls-fitview",onClick:y,title:w["controls.fitView.ariaLabel"],"aria-label":w["controls.fitView.ariaLabel"],children:i.jsx(_Z,{})}),q&&i.jsx(g4,{className:"react-flow__controls-interactive",onClick:N,title:w["controls.interactive.ariaLabel"],"aria-label":w["controls.interactive.ariaLabel"],children:I?i.jsx(JZ,{}):i.jsx(QZ,{})}),K]})}k_.displayName="Controls";var v_=d.memo(k_);function qZ({id:_,x:Q,y:J,width:q,height:U,style:G,color:Z,strokeColor:F,strokeWidth:X,className:Y,borderRadius:K,shapeRendering:H,selected:L,onClick:z}){let{background:W,backgroundColor:I}=G||{},O=Z||W||I;return i.jsx("rect",{className:l1(["react-flow__minimap-node",{selected:L},Y]),x:Q,y:J,rx:K,ry:K,width:q,height:U,style:{fill:O,stroke:F,strokeWidth:X},shapeRendering:H,onClick:z?(A)=>z(A,_):void 0})}var UZ=d.memo(qZ),GZ=(_)=>_.nodes.map((Q)=>Q.id),q8=(_)=>_ instanceof Function?_:()=>_;function ZZ({nodeStrokeColor:_,nodeColor:Q,nodeClassName:J="",nodeBorderRadius:q=5,nodeStrokeWidth:U,nodeComponent:G=UZ,onClick:Z}){let F=S1(GZ,E1),X=q8(Q),Y=q8(_),K=q8(J),H=typeof window>"u"||!!window.chrome?"crispEdges":"geometricPrecision";return i.jsx(i.Fragment,{children:F.map((L)=>i.jsx(HZ,{id:L,nodeColorFunc:X,nodeStrokeColorFunc:Y,nodeClassNameFunc:K,nodeBorderRadius:q,nodeStrokeWidth:U,NodeComponent:G,onClick:Z,shapeRendering:H},L))})}function FZ({id:_,nodeColorFunc:Q,nodeStrokeColorFunc:J,nodeClassNameFunc:q,nodeBorderRadius:U,nodeStrokeWidth:G,shapeRendering:Z,NodeComponent:F,onClick:X}){let{node:Y,x:K,y:H,width:L,height:z}=S1((W)=>{let I=W.nodeLookup.get(_);if(!I)return{node:void 0,x:0,y:0,width:0,height:0};let O=I.internals.userNode,{x:A,y:w}=I.internals.positionAbsolute,{width:B,height:T}=N0(O);return{node:O,x:A,y:w,width:B,height:T}},E1);if(!Y||Y.hidden||!p6(Y))return null;return i.jsx(F,{x:K,y:H,width:L,height:z,style:Y.style,selected:!!Y.selected,className:q(Y),color:Q(Y),borderRadius:U,strokeColor:J(Y),strokeWidth:G,shapeRendering:Z,onClick:X,id:Y.id})}var HZ=d.memo(FZ),XZ=d.memo(ZZ),KZ=200,YZ=150,LZ=(_)=>!_.hidden,zZ=(_)=>{let Q={x:-_.transform[0]/_.transform[2],y:-_.transform[1]/_.transform[2],width:_.width/_.transform[2],height:_.height/_.transform[2]},J=!1;for(let q of _.nodeLookup.values())if(!q.hidden){J=!0;break}return{viewBB:Q,boundingRect:J?x6(u2(_.nodeLookup,{filter:LZ}),Q):Q,rfId:_.rfId,panZoom:_.panZoom,translateExtent:_.translateExtent,flowWidth:_.width,flowHeight:_.height,ariaLabelConfig:_.ariaLabelConfig}},i9=(_,Q)=>_.x===Q.x&&_.y===Q.y&&_.width===Q.width&&_.height===Q.height,WZ=(_,Q)=>i9(_.viewBB,Q.viewBB)&&i9(_.boundingRect,Q.boundingRect)&&_.rfId===Q.rfId&&_.panZoom===Q.panZoom&&_.translateExtent===Q.translateExtent&&_.flowWidth===Q.flowWidth&&_.flowHeight===Q.flowHeight&&_.ariaLabelConfig===Q.ariaLabelConfig,AZ="react-flow__minimap-desc";function j_({style:_,className:Q,nodeStrokeColor:J,nodeColor:q,nodeClassName:U="",nodeBorderRadius:G=5,nodeStrokeWidth:Z,nodeComponent:F,bgColor:X,maskColor:Y,maskStrokeColor:K,maskStrokeWidth:H,position:L="bottom-right",onClick:z,onNodeClick:W,pannable:I=!1,zoomable:O=!1,ariaLabel:A,inversePan:w,zoomStep:B=1,offsetScale:T=5}){let R=x1(),C=d.useRef(null),{boundingRect:f,panZoom:y,viewBB:N,rfId:k,translateExtent:E,flowWidth:c,flowHeight:l,ariaLabelConfig:S}=S1(zZ,WZ),j=_?.width??KZ,D=_?.height??YZ,x=f.width/j,v=f.height/D,m=Math.max(x,v),P=m*j,V=m*D,b=T*m,u=f.x-(P-f.width)/2-b,t=f.y-(V-f.height)/2-b,Q1=P+b*2,a=V+b*2,o=`${AZ}-${k}`,p=d.useRef(0),n=d.useRef();p.current=m,d.useEffect(()=>{let M1=R.getState().panZoom;if(C.current&&M1)return n.current=J9({domNode:C.current,panZoom:M1,getTransform:()=>R.getState().transform,getViewScale:()=>p.current}),()=>{n.current?.destroy()}},[y]),d.useEffect(()=>{n.current?.update({translateExtent:E,width:c,height:l,inversePan:w,pannable:I,zoomStep:B,zoomable:O})},[I,O,w,B,E,c,l]);let J1=z?(M1)=>{let[L1,e]=n.current?.pointer(M1)||[0,0];z(M1,{x:L1,y:e})}:void 0,G1=d.useCallback((M1,L1)=>{let e=R.getState().nodeLookup.get(L1).internals.userNode;W?.(M1,e)},[W]),q1=W?G1:void 0,Y1=A??S["minimap.ariaLabel"];return i.jsx(g0,{position:L,style:{..._,"--xy-minimap-background-color-props":typeof X==="string"?X:void 0,"--xy-minimap-mask-background-color-props":typeof Y==="string"?Y:void 0,"--xy-minimap-mask-stroke-color-props":typeof K==="string"?K:void 0,"--xy-minimap-mask-stroke-width-props":typeof H==="number"?H*m:void 0,"--xy-minimap-node-background-color-props":typeof q==="string"?q:void 0,"--xy-minimap-node-stroke-color-props":typeof J==="string"?J:void 0,"--xy-minimap-node-stroke-width-props":typeof Z==="number"?Z:void 0},className:l1(["react-flow__minimap",Q]),"data-testid":"rf__minimap",children:i.jsxs("svg",{width:j,height:D,viewBox:`${u} ${t} ${Q1} ${a}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":o,ref:C,onClick:J1,children:[Y1&&i.jsx("title",{id:o,children:Y1}),i.jsx(XZ,{onClick:q1,nodeColor:q,nodeStrokeColor:J,nodeBorderRadius:G,nodeClassName:U,nodeStrokeWidth:Z,nodeComponent:F}),i.jsx("path",{className:"react-flow__minimap-mask",d:`M${u-b},${t-b}h${Q1+b*2}v${a+b*2}h${-Q1-b*2}z
34
+ M${N.x},${N.y}h${N.width}v${N.height}h${-N.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}j_.displayName="MiniMap";var V_=d.memo(j_),BZ=(_)=>(Q)=>_?`${Math.max(1/Q.transform[2],1)}`:void 0,MZ={[n0.Line]:"right",[n0.Handle]:"bottom-right"};function TZ({nodeId:_,position:Q,variant:J=n0.Handle,className:q,style:U=void 0,children:G,color:Z,minWidth:F=10,minHeight:X=10,maxWidth:Y=Number.MAX_VALUE,maxHeight:K=Number.MAX_VALUE,keepAspectRatio:H=!1,resizeDirection:L,autoScale:z=!0,shouldResize:W,onResizeStart:I,onResize:O,onResizeEnd:A}){let w=Z8(),B=typeof _==="string"?_:w,T=x1(),R=d.useRef(null),C=J===n0.Handle,f=S1(d.useCallback(BZ(C&&z),[C,z]),E1),y=d.useRef(null),N=Q??MZ[J];d.useEffect(()=>{if(!R.current||!B)return;if(!y.current)y.current=H9({domNode:R.current,nodeId:B,getStoreItems:()=>{let{nodeLookup:E,transform:c,snapGrid:l,snapToGrid:S,nodeOrigin:j,domNode:D}=T.getState();return{nodeLookup:E,transform:c,snapGrid:l,snapToGrid:S,nodeOrigin:j,paneDomNode:D}},onChange:(E,c)=>{let{triggerNodeChanges:l,nodeLookup:S,parentLookup:j,nodeOrigin:D}=T.getState(),x=[],v={x:E.x,y:E.y},m=S.get(B);if(m&&m.expandParent&&m.parentId){let P=m.origin??D,V=E.width??m.measured.width??0,b=E.height??m.measured.height??0,u={id:m.id,parentId:m.parentId,rect:{width:V,height:b,...c6({x:E.x??m.position.x,y:E.y??m.position.y},{width:V,height:b},m.parentId,S,P)}},t=b4([u],S,j,D);x.push(...t),v.x=E.x?Math.max(P[0]*V,E.x):void 0,v.y=E.y?Math.max(P[1]*b,E.y):void 0}if(v.x!==void 0&&v.y!==void 0){let P={id:B,type:"position",position:{...v}};x.push(P)}if(E.width!==void 0&&E.height!==void 0){let V={id:B,type:"dimensions",resizing:!0,setAttributes:!L?!0:L==="horizontal"?"width":"height",dimensions:{width:E.width,height:E.height}};x.push(V)}for(let P of c){let V={...P,type:"position"};x.push(V)}l(x)},onEnd:({width:E,height:c})=>{let l={id:B,type:"dimensions",resizing:!1,dimensions:{width:E,height:c}};T.getState().triggerNodeChanges([l])}});return y.current.update({controlPosition:N,boundaries:{minWidth:F,minHeight:X,maxWidth:Y,maxHeight:K},keepAspectRatio:H,resizeDirection:L,onResizeStart:I,onResize:O,onResizeEnd:A,shouldResize:W}),()=>{y.current?.destroy()}},[N,F,X,Y,K,H,I,O,A,W]);let k=N.split("-");return i.jsx("div",{className:l1(["react-flow__resize-control","nodrag",...k,J,q]),ref:R,style:{...U,scale:f,...Z&&{[C?"backgroundColor":"borderColor"]:Z}},children:G})}var d9=d.memo(TZ);function u_({nodeId:_,isVisible:Q=!0,handleClassName:J,handleStyle:q,lineClassName:U,lineStyle:G,color:Z,minWidth:F=10,minHeight:X=10,maxWidth:Y=Number.MAX_VALUE,maxHeight:K=Number.MAX_VALUE,keepAspectRatio:H=!1,autoScale:L=!0,shouldResize:z,onResizeStart:W,onResize:I,onResizeEnd:O}){if(!Q)return null;return i.jsxs(i.Fragment,{children:[Z9.map((A)=>i.jsx(d9,{className:U,style:G,nodeId:_,position:A,variant:n0.Line,color:Z,minWidth:F,minHeight:X,maxWidth:Y,maxHeight:K,onResizeStart:W,keepAspectRatio:H,autoScale:L,shouldResize:z,onResize:I,onResizeEnd:O},A)),G9.map((A)=>i.jsx(d9,{className:J,style:q,nodeId:_,position:A,color:Z,minWidth:F,minHeight:X,maxWidth:Y,maxHeight:K,onResizeStart:W,keepAspectRatio:H,autoScale:L,shouldResize:z,onResize:I,onResizeEnd:O},A))]})}var RZ=(_)=>_.domNode?.querySelector(".react-flow__renderer");function OZ({children:_}){let Q=S1(RZ);if(!Q)return null;return a9.createPortal(_,Q)}var IZ=(_,Q)=>_?.internals.positionAbsolute.x!==Q?.internals.positionAbsolute.x||_?.internals.positionAbsolute.y!==Q?.internals.positionAbsolute.y||_?.measured.width!==Q?.measured.width||_?.measured.height!==Q?.measured.height||_?.selected!==Q?.selected||_?.internals.z!==Q?.internals.z,PZ=(_,Q)=>{if(_.size!==Q.size)return!1;for(let[J,q]of _)if(IZ(q,Q.get(J)))return!1;return!0},NZ=(_)=>({x:_.transform[0],y:_.transform[1],zoom:_.transform[2],selectedNodesCount:_.nodes.filter((Q)=>Q.selected).length});function H8({nodeId:_,children:Q,className:J,style:q,isVisible:U,position:G=H1.Top,offset:Z=10,align:F="center",...X}){let Y=Z8(),K=d.useCallback((R)=>{return(Array.isArray(_)?_:[_||Y||""]).reduce((y,N)=>{let k=R.nodeLookup.get(N);if(k)y.set(k.id,k);return y},new Map)},[_,Y]),H=S1(K,PZ),{x:L,y:z,zoom:W,selectedNodesCount:I}=S1(NZ,E1);if(!(typeof U==="boolean"?U:H.size===1&&H.values().next().value?.selected&&I===1)||!H.size)return null;let A=u2(H),w=Array.from(H.values()),B=Math.max(...w.map((R)=>R.internals.z+1)),T={position:"absolute",transform:l7(A,{x:L,y:z,zoom:W},G,Z,F),zIndex:B,...q};return i.jsx(OZ,{children:i.jsx("div",{style:T,className:l1(["react-flow__node-toolbar",J]),...X,"data-id":w.reduce((R,C)=>`${R}${C.id} `,"").trim(),children:Q})})}var e1=Q0(h0(),1);var h_={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 W1=Q0(d5(),1),fZ="https://brand.volter.ai/logo/twin-world/svg?size=64&variant=mono";function a5({href:_,onClick:Q}){return W1.jsxDEV("h1",{children:W1.jsxDEV("a",{href:_,onClick:Q,children:[W1.jsxDEV("img",{src:fZ,alt:"",width:24,height:24,style:{verticalAlign:"middle"}},void 0,!1,void 0,this),W1.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 _2(_){return(await _.json().catch(()=>({}))).error??`answered ${_.status}`}function b_(_,Q,J=0,q=""){let[U,G]=e1.useState({state:"loading"});return e1.useEffect(()=>{G({state:"loading"})},[q,Q]),e1.useEffect(()=>{if(!Q)return;let Z=!0;return(async()=>{try{let F=await _(Q),X=F.ok?{state:"ok",data:await F.json()}:{state:"error",status:F.status,error:await _2(F)};if(Z)G(X)}catch(F){if(Z)G({state:"error",status:0,error:String(F)})}})(),()=>{Z=!1}},[q,Q,J]),U}function U0({load:_,what:Q,retry:J,lines:q=3}){if(_.state==="loading")return W1.jsxDEV(CZ,{lines:q,label:`Loading ${Q}…`},void 0,!1,void 0,this);if(_.state==="error")return W1.jsxDEV("div",{role:"alert",className:"error-state",children:[W1.jsxDEV("span",{children:["Could not read ",Q,": ",_.error]},void 0,!0,void 0,this),J?W1.jsxDEV("button",{type:"button",onClick:J,children:"Try again"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this);return null}function CZ({lines:_=3,label:Q="Loading…"}){return W1.jsxDEV("div",{className:"skeleton",role:"status","aria-label":Q,children:Array.from({length:_},(J,q)=>W1.jsxDEV("span",{style:{width:`${[92,76,84,64,88][q%5]}%`}},q,!1,void 0,this))},void 0,!1,void 0,this)}function u1({iso:_,time:Q}){if(!_)return W1.jsxDEV("span",{children:"—"},void 0,!1,void 0,this);let J=new Date(_);return W1.jsxDEV("time",{dateTime:_,title:_,children:Number.isNaN(J.getTime())?_:Q?J.toLocaleTimeString():J.toLocaleString()},void 0,!1,void 0,this)}var b2=(_)=>_?new Date(_).toLocaleString():"—";function Y8(_){let Q=_?Date.parse(_):Number.NaN;if(Number.isNaN(Q))return"—";let J=Math.max(0,Math.round((Date.now()-Q)/1000));return J<60?"just now":J<3600?`${Math.round(J/60)}m ago`:J<86400?`${Math.round(J/3600)}h ago`:`${Math.round(J/86400)}d ago`}function m1(_,Q){let J=Q.replace(/[_-]+/g," "),q=J.endsWith("s")?J:/[^aeiou]y$/.test(J)?`${J.slice(0,-1)}ies`:/(ch|sh|x)$/.test(J)?`${J}es`:`${J}s`;return`${_} ${_===1?J:q}`}var E2=(_)=>_.length<=1?_.join(""):`${_.slice(0,-1).join(", ")} and ${_[_.length-1]}`,SZ={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"},B1=(_)=>SZ[_]??_.charAt(0).toUpperCase()+_.slice(1);function d1({vendor:_}){let Q=h_[_];return W1.jsxDEV("span",{className:Q?"mark logo":"mark","aria-hidden":"true",children:Q?W1.jsxDEV("svg",{viewBox:"0 0 24 24",children:W1.jsxDEV("path",{d:Q.d,fill:Q.fill},void 0,!1,void 0,this)},void 0,!1,void 0,this):B1(_).charAt(0)},void 0,!1,void 0,this)}var D_=(_)=>{_.currentTarget.closest("details")?.removeAttribute("open")},yZ="volter.theme",L8=()=>{try{let _=localStorage.getItem(yZ);return _==="light"||_==="dark"?_:"system"}catch{return"system"}};function E_(_=L8()){let Q=document.documentElement;if(_==="system")Q.removeAttribute("data-theme");else Q.setAttribute("data-theme",_)}function x_(){return e1.useEffect(()=>{let _=()=>[...document.querySelectorAll("details.menu[open], details.clock-more[open]")],Q=(q)=>{if(q.key!=="Escape"||document.querySelector("dialog[open]"))return;let U=_();if(!U.length)return;for(let G of U)G.removeAttribute("open");U[U.length-1].querySelector("summary")?.focus()},J=(q)=>{let U=q.target;for(let G of _())if(!U||!G.contains(U))G.removeAttribute("open")};return document.addEventListener("keydown",Q),document.addEventListener("click",J),()=>{document.removeEventListener("keydown",Q),document.removeEventListener("click",J)}},[]),null}function M0({open:_,onClose:Q,title:J,children:q,footer:U,wide:G}){let Z=e1.useRef(null),F=e1.useId();return e1.useEffect(()=>{let X=Z.current;if(!X)return;if(_&&!X.open){X.showModal();let Y=X.querySelector(".dialog-body :is(input:not([type=hidden]):not([disabled]), select, textarea)");if(Y?.focus(),Y instanceof HTMLInputElement&&Y.value&&/^(text|search|email|url)$/.test(Y.type))Y.select()}if(!_&&X.open)X.close()},[_]),W1.jsxDEV("dialog",{ref:Z,className:G==="window"?"dialog window":G?"dialog wide":"dialog","aria-labelledby":F,onClose:Q,onCancel:(X)=>{X.preventDefault(),Q()},onMouseDown:(X)=>{if(X.target===Z.current)Q()},children:_?W1.jsxDEV(W1.Fragment,{children:[W1.jsxDEV("div",{className:"dialog-head",children:[W1.jsxDEV("h2",{id:F,children:J},void 0,!1,void 0,this),W1.jsxDEV("button",{type:"button",className:"icon-button","aria-label":"Close",onClick:Q,children:"✕"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),W1.jsxDEV("div",{className:"dialog-body",children:q},void 0,!1,void 0,this),U?W1.jsxDEV("div",{className:"dialog-foot",children:U},void 0,!1,void 0,this):null]},void 0,!0,void 0,this):null},void 0,!1,void 0,this)}var X8="volter:confirm";function p0(_){return new Promise((Q)=>{window.dispatchEvent(new CustomEvent(X8,{detail:{ask:_,resolve:Q}}))})}function m_(){let[_,Q]=e1.useState(null),[J,q]=e1.useState("");e1.useEffect(()=>{let F=(X)=>{q(""),Q(X.detail)};return window.addEventListener(X8,F),()=>window.removeEventListener(X8,F)},[]);let U=(F)=>{_?.resolve(F),Q(null)},G=_?.ask,Z=!G?.typed||J===G.typed;return W1.jsxDEV(M0,{open:Boolean(_),onClose:()=>U(!1),title:G?.title??"",footer:W1.jsxDEV(W1.Fragment,{children:[W1.jsxDEV("button",{type:"button",onClick:()=>U(!1),children:"Cancel"},void 0,!1,void 0,this),W1.jsxDEV("button",{type:"button",className:G?.danger?"danger-button":"primary",disabled:!Z,onClick:()=>U(!0),children:G?.action},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:[G?.body?W1.jsxDEV("div",{className:"confirm-body",children:G.body},void 0,!1,void 0,this):null,G?.typed?W1.jsxDEV("div",{className:"typed-confirm",children:[W1.jsxDEV("p",{children:["Type ",W1.jsxDEV("code",{children:G.typed},void 0,!1,void 0,this)," to confirm."]},void 0,!0,void 0,this),W1.jsxDEV("input",{autoFocus:!0,"aria-label":`Type ${G.typed} to confirm`,value:J,onChange:(F)=>q(F.target.value),onKeyDown:(F)=>{if(F.key==="Enter"&&Z)U(!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 K8="volter:toast";function r1(_,Q="ok"){window.dispatchEvent(new CustomEvent(K8,{detail:{text:_,kind:Q}}))}function g_(){let[_,Q]=e1.useState([]);return e1.useEffect(()=>{let J=0,q=(U)=>{let{text:G,kind:Z}=U.detail,F=++J;if(Q((X)=>[...X.slice(-3),{id:F,text:G,kind:Z}]),Z!=="error")setTimeout(()=>Q((X)=>X.filter((Y)=>Y.id!==F)),4500)};return window.addEventListener(K8,q),()=>window.removeEventListener(K8,q)},[]),W1.jsxDEV("div",{className:"toasts",role:"region","aria-label":"Notifications",children:_.map((J)=>W1.jsxDEV("div",{className:`toast ${J.kind}`,role:J.kind==="error"?"alert":"status",children:[W1.jsxDEV("span",{children:J.text},void 0,!1,void 0,this),W1.jsxDEV("button",{type:"button",className:"icon-button","aria-label":"Dismiss",onClick:()=>Q((q)=>q.filter((U)=>U.id!==J.id)),children:"✕"},void 0,!1,void 0,this)]},J.id,!0,void 0,this))},void 0,!1,void 0,this)}function z8({value:_,label:Q,secret:J}){let[q,U]=e1.useState(!1);return W1.jsxDEV("div",{className:"copy-field",children:[Q?W1.jsxDEV("span",{className:"copy-label",children:Q},void 0,!1,void 0,this):null,W1.jsxDEV("div",{className:"copy-row",children:[W1.jsxDEV("input",{readOnly:!0,value:_,"aria-label":Q??"Value",onFocus:(Z)=>Z.currentTarget.select(),spellCheck:!1},void 0,!1,void 0,this),W1.jsxDEV("button",{type:"button",onClick:()=>{navigator.clipboard?.writeText(_).then(()=>{U(!0),setTimeout(()=>U(!1),1600),r1(J?"Copied. Keep it somewhere safe":"Copied")}).catch(()=>r1("Your browser would not copy it: select it and copy","error"))},children:q?"Copied":"Copy"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function p_({label:_,items:Q}){return W1.jsxDEV("details",{className:"menu row-menu",children:[W1.jsxDEV("summary",{className:"icon-button",role:"button","aria-haspopup":"menu","aria-label":_,title:_,children:"⋯"},void 0,!1,void 0,this),W1.jsxDEV("div",{className:"popover menu-list",role:"menu",children:Q.filter((J)=>Boolean(J)).map((J)=>J.href?W1.jsxDEV("a",{role:"menuitem",href:J.href,className:J.danger?"danger-item":void 0,onClick:D_,children:J.label},J.label,!1,void 0,this):W1.jsxDEV("button",{type:"button",role:"menuitem",disabled:J.disabled,className:J.danger?"danger-item":void 0,onClick:(q)=>{D_(q),J.onSelect?.()},children:J.label},J.label,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function H5({title:_,children:Q,action:J}){return W1.jsxDEV("div",{className:"empty-state",children:[W1.jsxDEV("p",{className:"empty-title",children:_},void 0,!1,void 0,this),Q?W1.jsxDEV("div",{className:"empty-body",children:Q},void 0,!1,void 0,this):null,J?W1.jsxDEV("div",{className:"empty-action",children:J},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}function c_(){return e1.useEffect(()=>{let _=(J)=>{let q=document.querySelector("main.app"),U=J.target;if(q?.hasAttribute("data-drawer")&&U&&!U.closest(".side")&&!U.closest(".drawer-button"))q.removeAttribute("data-drawer")},Q=(J)=>{if(J.key==="Escape")kZ()};return document.addEventListener("click",_),document.addEventListener("keydown",Q),()=>{document.removeEventListener("click",_),document.removeEventListener("keydown",Q)}},[]),W1.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 kZ=()=>{document.querySelector("main.app")?.removeAttribute("data-drawer")};function d4(_={}){let Q=(q,U)=>_.tools?`${U} (\`${q}\`)`:`\`${q}\``,J=["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.","",_.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, ${Q("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. ${_.tools?"Start it with world_up":"Start it: `volter world up`"}, then run the tests inside it: ${Q("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 (${Q("volter world log","world_log")}), and give me the dashboard link (${_.tools?"world_view":"`volter world view --no-open`, started in the background: it keeps running"}).`];if(_.platform){let q=_.world??"<org>/<world>";J.push(`5. Share it with my team on ${_.platform}: ${Q(`volter login ${_.platform}`,"platform_login")} gives a link and a code for me to approve in my browser. Once I have, link it with ${Q(`volter remote add origin ${q} --create`,"remote_link with create: true")}${_.world?"":" (ask me for <org>/<world>)"}, then send what the app did: ${Q('volter world changeset -m "<what and why>"',"world_changeset")} and ${Q("volter world push","world_push")}.`)}return J.push("","The guide: https://world.volter.ai/docs/guides/use-with-a-coding-agent.md"),J.join(`
35
+ `)}var l_={"git-commit-horizontal":[["rect",{x:"9",y:"9",width:"6",height:"6"}],["path",{d:"M3 12h6M15 12h6"}]],"arrow-down-to-line":[["path",{d:"M12 17V3"}],["path",{d:"m6 11 6 6 6-6"}],["path",{d:"M19 21H5"}]],"arrow-up-from-line":[["path",{d:"m18 9-6-6-6 6"}],["path",{d:"M12 3v14"}],["path",{d:"M5 21h14"}]],"git-branch":[["rect",{x:"4",y:"3",width:"4",height:"4"}],["rect",{x:"4",y:"17",width:"4",height:"4"}],["rect",{x:"16",y:"5",width:"4",height:"4"}],["path",{d:"M6 7v10M18 9v2a4 4 0 0 1-4 4H6"}]],monitor:[["rect",{x:"3",y:"4",width:"18",height:"13"}],["path",{d:"M8 21h8M12 17v4"}]],vault:[["rect",{width:"18",height:"18",x:"3",y:"3"}],["rect",{x:"6.3",y:"6.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}],["path",{d:"m7.9 7.9 2.7 2.7"}],["rect",{x:"15.3",y:"6.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}],["path",{d:"m13.4 10.6 2.7-2.7"}],["rect",{x:"6.3",y:"15.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}],["path",{d:"m7.9 16.1 2.7-2.7"}],["rect",{x:"15.3",y:"15.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}],["path",{d:"m13.4 13.4 2.7 2.7"}],["circle",{cx:"12",cy:"12",r:"2"}]],settings:[["circle",{cx:"12",cy:"12",r:"3"}],["circle",{cx:"12",cy:"12",r:"7"}],["path",{d:"M12 2v3M12 19v3M2 12h3M19 12h3M4.9 4.9L7 7M17 17l2.1 2.1M4.9 19.1L7 17M17 7l2.1-2.1"}]],history:[["path",{d:"M3 12a9 9 0 1 0 3-6.7"}],["path",{d:"M3 4v5h5"}],["path",{d:"M12 7v5l3 3"}]],activity:[["path",{d:"M2 12h4l3-8 6 16 3-8h4"}]],"file-diff":[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"}],["path",{d:"M9 10h6"}],["path",{d:"M12 13V7"}],["path",{d:"M9 17h6"}]],"square-plus":[["rect",{x:"4",y:"4",width:"16",height:"16"}],["path",{d:"M12 8v8M8 12h8"}]],"square-minus":[["rect",{width:"18",height:"18",x:"3",y:"3"}],["path",{d:"M8 12h8"}]],"square-dot":[["rect",{width:"18",height:"18",x:"3",y:"3"}],["rect",{x:"10.8",y:"10.8",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}]],cloud:[["path",{d:"M7 19a5 5 0 0 1-.5-10A6 6 0 0 1 18 8a4.5 4.5 0 0 1 .5 11z"}]],"refresh-cw":[["path",{d:"M20 12a8 8 0 0 1-14.3 4.9M4 12a8 8 0 0 1 14.3-4.9"}],["path",{d:"M19 3v5h-5M5 21v-5h5"}]],clock:[["circle",{cx:"12",cy:"12",r:"9"}],["path",{d:"M12 7v5l3 3"}]],"key-round":[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z"}],["rect",{x:"15.3",y:"6.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}]],plug:[["path",{d:"M9 3v5M15 3v5M6 8h12v4a6 6 0 0 1-12 0zM12 18v3"}]],"list-checks":[["path",{d:"M11 6h9M11 12h9M11 18h9"}],["path",{d:"M3 6l1.5 1.5L7 5M3 12l1.5 1.5L7 11M3 18l1.5 1.5L7 17"}]],palette:[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z"}],["rect",{x:"12.3",y:"5.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}],["rect",{x:"16.3",y:"9.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}],["rect",{x:"5.3",y:"11.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}],["rect",{x:"7.3",y:"6.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}]],check:[["path",{d:"M4 12l5 5L20 6"}]],plus:[["path",{d:"M12 4v16M4 12h16"}]],"chevron-down":[["path",{d:"M5 9l7 7 7-7"}]],"external-link":[["path",{d:"M14 4h6v6M20 4l-9 9"}],["path",{d:"M18 14v6H4V6h6"}]],"table-2":[["path",{d:"M3 9h18"}],["path",{d:"M9 3v18"}],["rect",{x:"3",y:"3",width:"18",height:"18"}]],"scroll-text":[["path",{d:"M15 12h-5"}],["path",{d:"M15 8h-5"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3"}]],"layout-grid":[["rect",{x:"4",y:"4",width:"7",height:"7"}],["rect",{x:"13",y:"4",width:"7",height:"7"}],["rect",{x:"4",y:"13",width:"7",height:"7"}],["rect",{x:"13",y:"13",width:"7",height:"7"}]],globe:[["circle",{cx:"12",cy:"12",r:"9"}],["path",{d:"M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18"}]],"arrow-left":[["path",{d:"M20 12H5M11 6l-6 6 6 6"}]],link:[["path",{d:"M9 15l6-6"}],["path",{d:"M11 6l2-2a4.2 4.2 0 0 1 6 6l-2 2M13 18l-2 2a4.2 4.2 0 0 1-6-6l2-2"}]],user:[["circle",{cx:"12",cy:"8",r:"4"}],["path",{d:"M4 21v-1a6 6 0 0 1 6-6h4a6 6 0 0 1 6 6v1"}]],"log-out":[["path",{d:"M10 4H4v16h6M9 12h11M16 8l4 4-4 4"}]]};var $=Q0(d5(),1),s4="volter.console.token",o5=document.getElementById("root"),T1=o5.dataset.base??"/-/console",k1=window.location.origin,l0=(o5.dataset.worlds??k1).replace(/\/+$/,""),_Q=(o5.dataset.names??"").split(",").filter((_)=>_!==""),J2=o5.dataset.worldOrigin==="1",c2=window.fetch.bind(window),W2="(session)",QQ="(pass)",s5=(_)=>{try{if(_&&!J2)sessionStorage.setItem(s4,_);else sessionStorage.removeItem(s4);localStorage.removeItem(s4)}catch{}},JQ="volter.console.portal",$Q=(_)=>{try{if(typeof _==="string"&&/^https?:$/.test(new URL(_).protocol))sessionStorage.setItem(JQ,new URL(_).origin)}catch{}},vZ=()=>{return l2.get("token")??""},G0=()=>{try{let _=sessionStorage.getItem(JQ)??"";return _&&/^https?:$/.test(new URL(_).protocol)?new URL(_).origin:""}catch{return""}},jZ=()=>{let _=vZ();if(J2){if(s5(""),l2.get("pass"))return QQ;let Q=new URLSearchParams(window.location.search).has("signin");if(Q)try{window.history.replaceState(null,"",window.location.pathname+window.location.hash)}catch{}return _||(Q?"":W2)}if(_)return s5(_),_;try{return sessionStorage.getItem(s4)??""}catch{return""}};function s1(_){let Q=_.trim();if(/not ready/i.test(Q)&&/(never verified|not verified|no approvals)/i.test(Q)){let G=[],Z=[];if(/(never verified|not verified)/i.test(Q))G.push("it is not verified yet"),Z.push("verify");if(/no approvals/i.test(Q))G.push("no one has approved it"),Z.push("approve");return{text:`Not ready to deploy: ${E2(G)}.`,acts:Z}}let J=/no credential (?:is )?sealed for ([a-z0-9_-]+)/i.exec(Q);if(J)return{text:`No credential is sealed for ${B1(J[1])}: seal one in Settings › Vault.`,acts:["vault"]};if(/has no origin/i.test(Q))return{text:"This World has no remote: name one in Settings › Remote.",acts:["remote"]};let q=/the ([a-z0-9_-]+) twin has no root/i.exec(Q)??/:\s*([a-z0-9_, -]+?) (?:has|have) no root/i.exec(Q);if(q){let G=q[1].split(/,\s*/).filter(Boolean).map(B1);return{text:`${E2(G)} ${G.length===1?"is":"are"} not connected to ${G.length===1?"its":"their"} real service: Settings › Real services.`,acts:["settings"]}}if(/opening a seal is/i.test(Q))return{text:"A key cannot seal a credential: open the World as yourself.",acts:[]};if(/a key manages no keys/i.test(Q))return{text:"A key cannot manage keys: open the World as yourself.",acts:[]};if(/^PUT origin:/i.test(Q))return{text:"That is not a World's address: https://<host>/<org>/<world>",acts:[]};if(/^clock: \{/i.test(Q))return{text:"Pick a date and time.",acts:[]};if(/^advance: \{/i.test(Q))return{text:"Advance by a number and a unit: 90m, 12h, 3d.",acts:[]};if(/^branches: \{/i.test(Q))return{text:"That branch could not be made: pick now, or an instant before it.",acts:[]};if(/^approve: \{/i.test(Q))return{text:"Name who approves.",acts:[]};if(/a browser deploys only what it names/i.test(Q))return{text:"A deploy is confirmed by its name: use Deploy again.",acts:[]};if(/^no such door/i.test(Q))return{text:"This World does not answer that here.",acts:[]};return{text:Q.replace(/\s*[—–-]+\s*(?:run\s+)?`[^`]*`/g,"").replace(/\s*[—–-]+\s*(?:PUT|POST|GET|DELETE)\s+\/-\/\S+(?:\s*\{[^}]*\})?/g,"").replace(/\s*\(\s*`[^`]*`\s*\)/g,"").replace(/`(?:volter|printf|curl|npm|bun)[^`]*`/g,"").replace(/:\s*\{[^}]*\}/g,"").replace(/\(\s*\)/g,"").replace(/\s*;\s*(?=[;.]|$)/g,"").replace(/\s+([,.;:])/g,"$1").trim()||_,acts:[]}}var Y0=async(_)=>s1(await _2(_)).text,VZ={vault:["vault","Open Vault"],remote:["remote","Open Remote"],settings:["settings/services","Open Real services"]};function qQ({name:_,acts:Q}){let J=Q.map((q)=>VZ[q]).filter((q)=>Boolean(q));if(J.length===0)return null;return $.jsxDEV($.Fragment,{children:J.map(([q,U])=>$.jsxDEV(r.default.Fragment,{children:[" ",$.jsxDEV("a",{href:`${T1}/${_}/~/${q}`,onClick:(G)=>{G.preventDefault(),j1([..._.split("/"),"~",...q.split("/")])},children:U},void 0,!1,void 0,this)]},q,!0,void 0,this))},void 0,!1,void 0,this)}async function y1(_,Q,J={}){return c2(`${k1}${Q}`,{...J,headers:{...J.headers??{},..._===W2?{}:{"x-volter-token":_},...J.body&&!J.headers?.["content-type"]?{"content-type":"application/json"}:{}}})}function V1(_,Q,J=0){let q=b_((U)=>y1(_,U),Q,J,_);return q.state==="error"?{...q,error:s1(q.error).text}:q}var Y5=(_)=>{let Q=new Date(_),J=(q)=>String(q).padStart(2,"0");return`${Q.getFullYear()}-${J(Q.getMonth()+1)}-${J(Q.getDate())}T${J(Q.getHours())}:${J(Q.getMinutes())}`},r_=(_)=>new Date(Math.ceil(Date.parse(_)/60000)*60000).toISOString(),UQ=(_)=>_.operation==="observed"?`observed${_.provenance==="placeholder"?" (default data)":" (vendor)"}`:_.receipt?`${_.receipt.status??""} ${_.receipt.externalId??""} ${_.receipt.reason??""}`.trim():_.provenance==="placeholder"?"default data":"unpushed",uZ=(_)=>{let Q=/^[0-9a-f]{2}-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2}$/.exec(_??"");return Q?{trace:Q[1],span:Q[2]}:null},T8="volter.console.snapshots",$2=()=>{try{return JSON.parse(sessionStorage.getItem(T8)??"{}")}catch{return{}}},GQ=new Map,R8=(_)=>{if(J2){if(_.token||_.readToken)GQ.set(_.name,{token:_.token,readToken:_.readToken});_={..._,token:"",readToken:""}}try{sessionStorage.setItem(T8,JSON.stringify({...$2(),[_.name]:_}))}catch{}},O8=(_)=>GQ.get(_)?.readToken||$2()[_]?.readToken||"",t4=(_)=>{try{let Q=$2();delete Q[_],sessionStorage.setItem(T8,JSON.stringify(Q))}catch{}},l2=new URLSearchParams(window.location.hash.slice(1)),X5=l2.get("close")??"";function n5(_){if(typeof _!=="string")return null;let Q;try{Q=new URL(_)}catch{return null}return(Q.protocol==="http:"||Q.protocol==="https:")&&Q.origin===_.replace(/\/+$/,"")?Q:null}function I8(_){let Q=n5(_);if(!Q)return null;let J=new URL(k1);if(Q.protocol!==J.protocol||Q.port!==J.port)return null;if(Q.hostname===J.hostname)return Q.origin;let q=/^[a-z0-9](?:[a-z0-9]|-(?!-))*--[a-z0-9](?:[a-z0-9]|-(?!-))*\./;if(!q.test(Q.hostname))return null;let U=Q.hostname.replace(q,"");return U===J.hostname||q.test(J.hostname)&&U===J.hostname.replace(q,"")?Q.origin:null}function hZ(_){let Q;try{Q=JSON.parse(_)}catch{return null}let J=/^[a-z0-9][a-z0-9-]*\/[a-z0-9][a-z0-9-]*$/i;if(typeof Q.name!=="string"||!J.test(Q.name)||typeof Q.parent!=="string"||!J.test(Q.parent)||typeof Q.at!=="string")return null;let q=Q.parentOrigin===void 0?void 0:I8(Q.parentOrigin);return{name:Q.name,parent:Q.parent,token:typeof Q.token==="string"?Q.token:"",readToken:typeof Q.readToken==="string"?Q.readToken:"",at:Q.at,expiresAt:typeof Q.expiresAt==="string"?Q.expiresAt:null,...q?{parentOrigin:q}:{}}}{let _=l2.get("snapshot");if(_){let Q=hZ(_);if(Q&&!$2()[Q.name])R8(Q)}}var ZQ="volter.console.home",FQ=(_)=>{let Q=n5(_);if(!Q)return null;let J=new URL(k1).hostname,q=J.replace(/^[a-z0-9](?:[a-z0-9]|-(?!-))*--[a-z0-9](?:[a-z0-9]|-(?!-))*\./,"");return Q.hostname===J||Q.hostname===q?Q.origin:null};{let _=FQ(l2.get("home"));if(_)try{sessionStorage.setItem(ZQ,_)}catch{}}if(["token","pass","portal","snapshot","home","close"].some((_)=>l2.has(_)))try{window.history.replaceState(null,"",window.location.pathname+window.location.search)}catch{}var V0=()=>{try{return FQ(sessionStorage.getItem(ZQ))??""}catch{return""}};function P8(_,Q,J,q){let U=new URLSearchParams({token:Q,home:V0()||k1}),G=$2()[J];if(G)U.set("snapshot",JSON.stringify(G));window.location.replace(`${_}${q??`${window.location.pathname}${window.location.search}`}#${U.toString()}`)}var e4=o5.dataset.route==="memory"?"":null;function $M(_){e4=_,window.dispatchEvent(new PopStateEvent("popstate"))}function m2(){return(e4??window.location.pathname.slice(T1.length)).split("/").filter(Boolean).map((_)=>{try{return decodeURIComponent(_)}catch{return""}})}var i_=/^[a-z0-9](?:[a-z0-9]|-(?!-))*$/i,Q2=(_,Q)=>_&&Q&&i_.test(_)&&i_.test(Q)?`${_}/${Q}`:"";function j1(_){let Q=`/${_.map(encodeURIComponent).join("/")}`;if(e4!==null)e4=Q;else window.history.pushState(null,"",`${T1}${Q}`);window.dispatchEvent(new PopStateEvent("popstate"))}function HQ(_,Q){let J=I8($2()[_]?.origin);if(J&&J!==k1){P8(J,O8(_),_,`${T1}/${Q.map(encodeURIComponent).join("/")}`);return}j1(Q)}async function d_(){let[_,Q]=m2(),J=Q2(_,Q),q=J?[J]:_Q;if(q.length===0){let U=await c2(`${k1}/-/ping`).catch(()=>null);q=U?.ok?(await U.json().catch(()=>({}))).worlds??[]:[]}q=q.filter((U)=>{let[G,Z,...F]=U.split("/");return F.length===0&&Q2(G,Z)===U});for(let U of q){let G=await c2(`${k1}/-/${U}/session`,{method:"POST"}).catch(()=>null);if(!G)continue;let Z=await G.json().catch(()=>({})),F=n5(Z.origin)?.origin;if(G.status===409&&F&&F!==k1)return window.location.replace(`${F}${T1}/${U}`),"moved";if(G.ok&&Z.local)return{token:typeof Z.token==="string"&&Z.token?Z.token:W2}}return null}function DZ(){let[_,Q]=r.useState(L8),J=(q)=>()=>{try{if(q==="system")localStorage.removeItem("volter.theme");else localStorage.setItem("volter.theme",q)}catch{}E_(q),Q(q)};return $.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"menu-label",children:"Appearance"},void 0,!1,void 0,this),$.jsxDEV("div",{className:"theme-choice",role:"radiogroup","aria-label":"Appearance",children:["system","light","dark"].map((q)=>$.jsxDEV("button",{type:"button",role:"radio","aria-checked":_===q,onClick:J(q),children:q==="system"?"System":q==="light"?"Light":"Dark"},q,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function bZ(){let[_,Q]=r.useState(jZ()),[J,q]=r.useState(!1),[U,G]=r.useState(!1),[Z,F]=r.useState(""),[X,Y]=r.useState(null),[K,H]=r.useState(null),[L,z]=r.useState(m2());r.useEffect(()=>{let b=()=>z(m2());return window.addEventListener("popstate",b),()=>window.removeEventListener("popstate",b)},[]),r.useEffect(()=>{let[b,u]=m2(),t=Q2(b,u),[Q1,a]=t?t.split("/"):[],o=$2()[X5];if(!X5||!_||!Q1||!a||!o?.made||o.parent!==`${Q1}/${a}`||Q2(...X5.split("/"))!==X5)return;try{window.history.replaceState(null,"",window.location.pathname+window.location.search)}catch{}y1(_,`/-/${Q1}/${a}/branches/${X5}`,{method:"DELETE"}).catch(()=>null).then(()=>t4(X5))},[_]);let W=r.useCallback(async(b)=>{if(H(null),!b){let a=await d_();if(a==="moved")return;if(a){if(q(!0),a.token!==W2)s5(a.token);Q(a.token);return}Y(null),G(!0);return}if(J2&&b===W2){let a=await d_();if(a==="moved")return;if(a)q(!0)}if(J2&&b===QQ){let[a,o]=m2(),p=Q2(a,o),[n,J1]=p?p.split("/"):[],G1=n&&J1?await c2(`${k1}/-/${n}/${J1}/session`,{method:"POST",headers:{"x-volter-pass":l2.get("pass")??""}}).catch(()=>null):null;if(!G1){H(`${k1} did not answer: no session was opened`),Y(null);return}if(!G1.ok){H(`${await Y0(G1)}. Open it again from the platform.`),Y(null);return}$Q((await G1.json().catch(()=>({}))).issuer),Q(W2);return}if(J2&&b!==W2){let[a,o]=m2(),p=Q2(a,o),[n,J1]=p?p.split("/"):[],G1=n&&J1?await c2(`${k1}/-/${n}/${J1}/session`,{method:"POST",headers:{"x-volter-token":b}}).catch(()=>null):null;if(!G1){H(`${k1} did not answer: no session was opened`),Y(null);return}if(!G1.ok){let q1=await Y0(G1);H(G1.status===401||G1.status===403?`That token does not open ${n}/${J1}.`:G1.status===409?`${n}/${J1}'s session lives at another origin: ${q1}`:`The World could not open a session (${G1.status}): ${q1}`),Y(null);return}Q(W2);return}let u=J2?new Response(null,{status:404}):await y1(b,"/-/worlds");if(u.ok){let{worlds:a}=await u.json();Y({kind:"admin",worlds:a});return}if(u.status===429){H("You are asking faster than the platform allows — wait a moment and reload."),Y(null);return}if(u.status>=500){let a=await u.json().catch(()=>({}));H(`The platform could not list your worlds${a.error?`: ${a.error}`:""}. Reload; if it stays, the status page says what is wrong.`),Y(null);return}let t=_Q;if(t.length===0){let a=await c2(`${k1}/-/ping`);if(!a.ok){H(`${k1} does not answer as a host`),Y(null);return}if(t=(await a.json()).worlds??[],t.length===0){H(`${k1} does not list its Worlds: open a World at its own address, ${k1}${T1}/<org>/<world>`),Y(null);return}}let Q1=[];for(let a of t){let o=await y1(b,`/-/${a}/twins`);if(o.ok){let p=await o.json();Q1.push({name:a,base:`${l0}/${a}`,twins:(p.twins??[]).map((n)=>({vendor:n.twin,protocol:n.protocol??null,root:n.root??null}))})}}if(Q1.length===0){H("This link or key opens no World here: it was revoked, or it has ended."),Y(null);return}Y({kind:"world",worlds:Q1})},[]);r.useEffect(()=>{W(_)},[_,W]);let I=(b)=>X?.kind==="admin"?X.worlds.find((u)=>u.name===b)?.token??_:_,[O,A]=r.useState("");if(!_||!X&&!K)return $.jsxDEV("main",{className:"app gate",children:$.jsxDEV("div",{className:"gate-window",children:[$.jsxDEV(a5,{href:`${T1}/`},void 0,!1,void 0,this),_&&!X&&!K||!_&&!U?$.jsxDEV("p",{className:"mode",children:"Opening…"},void 0,!1,void 0,this):$.jsxDEV("form",{onSubmit:(b)=>{b.preventDefault(),s5(Z.trim()),Q(Z.trim())},className:"stack",children:[$.jsxDEV("h2",{children:"Open a World"},void 0,!1,void 0,this),$.jsxDEV("p",{className:"mode",children:"A World's token opens that World. A host's admin token opens every World it serves."},void 0,!1,void 0,this),$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"Token"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"token",type:"password",value:Z,onChange:(b)=>F(b.target.value),autoFocus:!0,autoComplete:"off"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"submit",className:"primary",children:"Open"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this);let w=()=>H("This link or key opens no World here: it was revoked, or it has ended."),B=()=>{if(J){window.location.reload();return}if(J2){let[b,u]=m2(),t=Q2(b,u),[Q1,a]=t?t.split("/"):[],o=()=>window.location.replace(G0()?`${G0()}/`:`${k1}${T1}/${Q1&&a?`${Q1}/${a}`:""}?signin`);if(setTimeout(o,2000),Q1&&a)c2(`${k1}/-/${Q1}/${a}/session/end`,{method:"POST"}).catch(()=>null).then(o);else o();return}if(X)for(let b of X.worlds)navigator.sendBeacon(`${b.base.replace(/\/[^/]+\/[^/]+$/,"")}/-/${b.name}/session/end`);s5(""),Q(""),F(""),Y(null),j1([])};if(K||!X)return $.jsxDEV("main",{className:"app gate",children:$.jsxDEV("div",{className:"gate-window",children:[$.jsxDEV(a5,{href:`${T1}/`},void 0,!1,void 0,this),$.jsxDEV("h2",{children:"Could not open it"},void 0,!1,void 0,this),$.jsxDEV("p",{role:"alert",children:K??"nothing answered"},void 0,!1,void 0,this),G0()?$.jsxDEV("a",{className:"button primary",href:`${G0()}/`,children:["Back to ",new URL(G0()).host]},void 0,!0,void 0,this):$.jsxDEV("button",{type:"button",className:"primary",onClick:B,children:J?"Try again":"Use another token"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this);let[T,R,C,f,y,N,k]=L,E=C==="~",c=/^[A-Za-z0-9_-]+$/,l=/^[^\u0000-\u001f\u007f]{1,200}$/,S=E||!C||!c.test(C)?void 0:C,j=y&&c.test(y)?N!==void 0&&f!=="changes"&&f!=="screens"?Q2(y,N)||void 0:y:void 0,D=f==="changes"&&y==="changesets"&&N&&c.test(N)?N:f==="screens"&&N&&k&&/^[A-Za-z0-9_.-]+$/.test(N)&&l.test(k)?`${N}:${k}`:void 0,x=Q2(T,R),v=x?$2()[x]??null:null,m=(b)=>O8(b)||I(b),P=v?X.kind==="admin"?X.worlds.find((b)=>b.name===v.parent)?.token??null:X.worlds.some((b)=>b.name===v.parent)?_:null:null,V=async(b)=>{let u=I8(b.parentOrigin);if(u&&u!==k1){t4(b.name),window.location.assign(`${u}${T1}/${b.parent}#close=${encodeURIComponent(b.name)}`);return}if(b.made)await y1(I(b.parent),`/-/${b.parent}/branches/${b.name}`,{method:"DELETE"}).catch(()=>null),t4(b.name);j1(b.parent.split("/"))};return $.jsxDEV("main",{className:x?"app workspace":"app home",children:[x?null:$.jsxDEV("header",{children:[x?$.jsxDEV(c_,{},void 0,!1,void 0,this):null,$.jsxDEV(a5,{href:`${V0()&&V0()!==k1?V0():""}${T1}/`,onClick:(b)=>{if(V0()&&V0()!==k1)return;b.preventDefault(),j1([])}},void 0,!1,void 0,this),$.jsxDEV("nav",{"aria-label":"breadcrumb",className:"crumbs",children:[x?$.jsxDEV($.Fragment,{children:[$.jsxDEV("span",{className:"crumb-sep","aria-hidden":"true",children:"/"},void 0,!1,void 0,this),$.jsxDEV("span",{children:x.split("/")[0]},void 0,!1,void 0,this),$.jsxDEV("span",{className:"crumb-sep","aria-hidden":"true",children:"/"},void 0,!1,void 0,this),$.jsxDEV("a",{href:`${T1}/${x}`,className:"crumb-world",onClick:(b)=>{b.preventDefault(),j1(x.split("/"))},children:x.split("/")[1]},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,S?$.jsxDEV("span",{children:[" / ",S]},void 0,!0,void 0,this):null,E&&f==="trace"?$.jsxDEV("span",{children:" / trace"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),G0()?$.jsxDEV("a",{href:`${G0()}/${x?encodeURIComponent(x.split("/")[0]):""}`,title:`Back to the platform at ${new URL(G0()).host}`,className:"back-link",children:["← ",$.jsxDEV("span",{className:"back-text",children:x?`${x.split("/")[0]}'s Worlds`:new URL(G0()).host},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,x?null:$.jsxDEV("span",{className:"mode",children:J?"on this machine":O?`signed in as ${O}`:X.kind==="admin"?"host: admin":"opened with a link or key"},void 0,!1,void 0,this),x||J?null:$.jsxDEV("button",{onClick:B,children:"Sign out"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),x?$.jsxDEV(gZ,{name:x,token:m(x),twin:S,tab:E?f??"overview":"overview",arg:E?j:void 0,...E&&D?{sub:D}:{},admin:v?null:X.kind==="admin"?_:null,snapshot:v,parentToken:P,who:{local:J,person:O||null,admin:X.kind==="admin"},onSignOut:B,onReturn:V,opens:(b)=>!!$2()[b]||X.kind==="admin"&&X.worlds.some((u)=>u.name===b),onRemoved:()=>{W(_),j1([])},onWho:A,onEnded:w,worlds:X.worlds.map((b)=>b.name)},x,!1,void 0,this):$.jsxDEV(EZ,{mode:X,admin:X.kind==="admin"?_:null,reload:()=>W(_)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function EZ({mode:_,admin:Q,reload:J}){let[q,U]=r.useState(""),[G,Z]=r.useState(""),[F,X]=r.useState(""),[Y,K]=r.useState(null),H=async(f)=>{if(!await p0({title:`Rotate the tokens of ${f}?`,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 y=await y1(Q,`/-/worlds/${f}/rotate`,{method:"POST"}),N=await y.json().catch(()=>({}));K(y.ok?`rotated ${f}: the new tokens are shown once — token ${N.token} · read token ${N.readToken}`:N.error?s1(N.error).text:`answered ${y.status}`),await J()},L=async(f)=>{let y=await y1(Q,`/-/worlds/${f}`,{method:"DELETE"}),N=await y.json().catch(()=>({}));K(y.ok?`removed ${f}`:N.error?s1(N.error).text:`answered ${y.status}`),await J()},[z,W]=r.useState(!1),[I,O]=r.useState(!1),[A,w]=r.useState(""),B=async(f)=>{f.preventDefault(),K(null),W(!0);try{let y=await y1(Q,"/-/worlds",{method:"POST",body:JSON.stringify({org:q,world:G,vendors:F.split(",").map((k)=>k.trim()).filter(Boolean)})}),N=await y.json();if(!y.ok){K(N.error?s1(N.error).text:`the host answered ${y.status}`);return}K(`provisioned ${N.name}`),Z(""),X(""),O(!1),await J()}finally{W(!1)}},T=A.trim().toLowerCase(),R=_.worlds.filter((f)=>!T||f.name.toLowerCase().includes(T)||f.twins.some((y)=>y.vendor.includes(T))),C=[...new Set(R.map((f)=>f.name.split("/")[0]))];return $.jsxDEV("section",{className:"home-window","aria-labelledby":"worlds",children:[$.jsxDEV("div",{className:"home-head",children:[$.jsxDEV("h2",{id:"worlds",children:"Worlds"},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:[m1(_.worlds.length,"World")," ",Q?"this host serves":"this key opens"]},void 0,!0,void 0,this),Q?$.jsxDEV("button",{type:"button",className:"primary",onClick:()=>{K(null),O(!0)},children:[$.jsxDEV(N1,{name:"plus",size:16},void 0,!1,void 0,this),"New World"]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"home-find",children:$.jsxDEV("input",{type:"search",placeholder:"Filter by World or vendor","aria-label":"Filter Worlds",value:A,onChange:(f)=>w(f.target.value)},void 0,!1,void 0,this)},void 0,!1,void 0,this),Y&&!I?$.jsxDEV("p",{role:"status",className:"home-note",children:Y},void 0,!1,void 0,this):null,C.map((f)=>$.jsxDEV(r.default.Fragment,{children:[$.jsxDEV("p",{className:"menu-label home-org",children:f},void 0,!1,void 0,this),$.jsxDEV("ul",{className:"home-list",children:R.filter((y)=>y.name.split("/")[0]===f).map((y)=>$.jsxDEV("li",{children:[$.jsxDEV("a",{href:`${T1}/${y.name}`,onClick:(N)=>{N.preventDefault(),j1(y.name.split("/"))},children:[$.jsxDEV(N1,{name:"globe",size:20},void 0,!1,void 0,this),$.jsxDEV("span",{className:"ws-row-text",children:[$.jsxDEV("b",{children:y.name.split("/")[1]},void 0,!1,void 0,this),$.jsxDEV("small",{children:$.jsxDEV("code",{children:y.base},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("span",{className:"home-vendors",children:y.twins.map((N)=>$.jsxDEV("span",{title:B1(N.vendor),children:$.jsxDEV(d1,{vendor:N.vendor},void 0,!1,void 0,this)},N.vendor,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Q?$.jsxDEV("details",{className:"menu home-more",children:[$.jsxDEV("summary",{"aria-label":`More for ${y.name}`,children:"⋯"},void 0,!1,void 0,this),$.jsxDEV("div",{className:"popover menu-list",children:[$.jsxDEV("button",{type:"button",onClick:(N)=>{N.currentTarget.closest("details")?.removeAttribute("open"),H(y.name)},children:"Rotate tokens…"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",className:"danger-item",onClick:(N)=>{N.currentTarget.closest("details")?.removeAttribute("open"),p0({title:`Remove ${y.name}?`,body:"The host stops serving it and its whole history goes with it. This cannot be undone.",action:"Remove World",danger:!0,typed:y.name}).then((k)=>{if(k)L(y.name)})},children:"Remove World…"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null]},y.name,!0,void 0,this))},void 0,!1,void 0,this)]},f,!0,void 0,this)),R.length===0?$.jsxDEV("p",{className:"mode home-note",children:T?`No World matches ${A}.`:"No Worlds here yet."},void 0,!1,void 0,this):null,$.jsxDEV(M0,{open:I,onClose:()=>{if(!z)O(!1)},title:"New World",footer:$.jsxDEV($.Fragment,{children:[$.jsxDEV("button",{type:"button",onClick:()=>O(!1),disabled:z,children:"Cancel"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"submit",form:"provision",className:"primary",disabled:z,children:z?"Making… (ten seconds or so)":"Make World"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:$.jsxDEV("form",{id:"provision",onSubmit:B,className:"stack",children:[$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"Org"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"org",value:q,onChange:(f)=>U(f.target.value),required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"World"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"world",value:G,onChange:(f)=>Z(f.target.value),required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"Vendors"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"vendors",value:F,onChange:(f)=>X(f.target.value),placeholder:"stripe, slack",required:!0},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:"A twin of each, with its default data."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y?$.jsxDEV("p",{role:"status",children:Y},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)}var xZ=["changes","events","trace","vendors","screens","canvas","branches","settings","remote","vault"],mZ=(_,Q)=>{let J=Q?.screens?.find((q)=>q.path.replace(/\/+$/,"")==="")??Q?.screens?.find((q)=>!/[{<]/.test(q.path));return Q&&J?`${l0}/${_}/${Q.twin}${J.path.startsWith("/")?J.path:`/${J.path}`}`:null},a_={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 f0(_){let Q=_.operation??_.op,J=(Q.includes(".")?Q.slice(Q.lastIndexOf(".")+1):Q).toLowerCase(),q=_.subject.type.replace(/[_-]+/g," ").trim(),U=`${q.charAt(0).toUpperCase()}${q.slice(1)}`,G=/(^|\.)twin\./.test(Q)||/^seed_/.test(J),Z=Q.replace(/[._]+/g," ").trim(),F=G?`${U} seeded`:a_[J]?`${U} ${a_[J]}`:`${Z.charAt(0).toUpperCase()}${Z.slice(1)}`,X=_.fields??{},Y=["title","name","email","text","subject","summary","description"].map((H)=>X[H]).find((H)=>typeof H==="string"&&H.trim()!=="")??null,K=Y===null?null:Y.replace(/<([@#!])[^|>]*\|([^>]+)>/g,(H,L,z)=>`${L==="!"?"@":L}${z}`).replace(/<(?:https?:[^|>]+)\|([^>]+)>/g,"$1").replace(/<(https?:[^>]+)>/g,"$1");return{what:F,label:K===null?null:K.length>80?`${K.slice(0,79)}…`:K}}var q2=(_)=>/token|password|secret|key|credential/i.test(_.subject.type)&&_.subject.id.length>6?`••••${_.subject.id.slice(-4)}`:_.subject.id;function gZ({name:_,token:Q,twin:J,tab:q,arg:U,sub:G,admin:Z,snapshot:F,parentToken:X,who:Y,onSignOut:K,onReturn:H,opens:L,onRemoved:z,onWho:W,onEnded:I,worlds:O=[]}){let[A,w]=r.useState("pending"),[B,T]=r.useState(null),[R,C]=r.useState(0),[f,y]=r.useState(null);r.useEffect(()=>{let p=!0;return T(null),y1(Q,`/-/${_}/session`,{method:"POST"}).then(async(n)=>{let J1=await n.json().catch(()=>({}));if($Q(J1.issuer),J1.who)W?.(J1.who);y(typeof J1.signsAs==="string"?J1.signsAs:null);let G1=n5(J1.origin)?.origin;if(n.status===409&&G1&&G1!==k1){P8(G1,Q,_);return}if(!p)return;if(w(!n.ok?"unknown":J1.scope==="read"?"read":J1.scope==="write"?"write":"unknown"),!n.ok)T(J1.error?s1(J1.error).text:`answered ${n.status}`)}).catch((n)=>{if(p)w("unknown"),T(`the World did not answer: ${n instanceof Error?n.message:String(n)}`)}),()=>{p=!1}},[_,Q,R]);let N=B?{state:"error",error:B}:A==="pending"?{state:"pending"}:{state:"ok",scope:A},k=A==="write",E=(p)=>{if(p.status!==403)return;p.clone().json().then((n)=>{if(/read token|opens only reads|write access|reads only/i.test(n?.error??""))w("read")},()=>null)},[c,l]=r.useState(0);r.useEffect(()=>{let p=setInterval(()=>{if(!document.hidden)l((n)=>n+1)},5000);return()=>clearInterval(p)},[]);let[S,j]=r.useState(0),D=V1(Q,`/-/${_}/clock`,c+S);r.useEffect(()=>{if(J2&&!F&&D.state==="error"&&D.status===401)I?.()},[D,F,I]);let x=V1(Q,`/-/${_}/twins`),v=V1(Q,`/-/${_}/branches`,S),m=V1(Q,`/-/${_}/map`,Math.floor(c/2)),P=!(v.state==="error"&&(v.status===404||v.status===405)),V=xZ.includes(q)?q:"overview",b=x.state==="ok"?x.data.twins.map((p)=>p.twin):[];if(J&&x.state==="ok"&&!b.includes(J))return $.jsxDEV("main",{className:"center",children:$.jsxDEV(H5,{title:`${_} has no ${J}`,action:$.jsxDEV("a",{href:`${T1}/${_}`,onClick:(p)=>{p.preventDefault(),j1(_.split("/"))},children:["Open ",_]},void 0,!0,void 0,this),children:$.jsxDEV("p",{children:["No vendor of this World is called ",J,". Its changesets are under Changes › History."]},void 0,!0,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this);let u=V==="vendors"&&U?U:void 0,t=()=>{w("pending"),C((p)=>p+1)};if(V==="canvas"||V==="vendors"&&!u||q==="screens"&&!U)return $.jsxDEV(WF,{name:_,token:Q,twins:x,session:N,retry:t,snapshot:F,back:()=>j1(_.split("/")),canWrite:k&&!F},void 0,!1,void 0,this);let a=q==="settings"?{kind:"settings",tab:((p)=>XQ.find(([n])=>n===p)?.[0]??"account")(U)}:q==="remote"?{kind:"settings",tab:"remote"}:q==="vault"?{kind:"settings",tab:"vault"}:q==="branches"?{kind:"branches",...U?{open:U}:{}}:null,o=J?"vendor":q==="screens"&&U?"screen":V==="vendors"&&u?"vendor":q==="trace"?"trace":q==="events"?"events":q==="changes"&&U==="changesets"?"history":"changes";return $.jsxDEV(oZ,{name:_,token:Q,view:o,win:a,who:Y,snapshot:F,onReturn:H,onSignOut:K,worlds:O,session:N,retry:t,...o==="vendor"?{arg:J??u}:o==="events"||o==="trace"||o==="screen"?U?{arg:U}:{}:{},...G?{sub:G}:{},twins:x,map:m,branches:P?v:null,clock:D,canWrite:k&&!F,refused:E,signsAs:f,opens:L,tick:c,admin:Z,onRemoved:z,onClock:()=>j((p)=>p+1),scope:F?"read":A},void 0,!1,void 0,this)}function N1({name:_,size:Q=20}){return $.jsxDEV("svg",{className:"icon",viewBox:"0 0 24 24",width:Q,height:Q,fill:"none",stroke:"currentColor",strokeWidth:Q<=16?1.75:1.5,strokeLinecap:"square",strokeLinejoin:"miter","aria-hidden":"true",children:(l_[_]??[]).map(([J,q],U)=>r.default.createElement(J,{key:U,...q}))},void 0,!1,void 0,this)}function _3(_){let Q=(J)=>{let q=(J.operation??J.op).toLowerCase();return q.includes(".")?q.slice(q.lastIndexOf(".")+1):q};if(_.some((J)=>/^(delete|remove|archive|revoke)/.test(Q(J))||J.fields?.deleted===!0))return{icon:"square-minus",word:"removed",tone:"removed"};if(/^(create|add|insert|issue|send|post|upload|invite|record|seed)/.test(Q(_[0])))return{icon:"square-plus",word:"made",tone:"added"};return{icon:"square-dot",word:"changed",tone:"changed"}}var XQ=[["account","Account","user"],["changesets","Changesets","git-commit-horizontal"],["remote","Remote","cloud"],["access","Access","key-round"],["services","Real services","plug"],["vault","Vault","vault"],["checks","Checks","list-checks"],["clock","Clock","clock"],["appearance","Appearance","palette"]],pZ=(_,Q)=>{let J=Q.split("/").pop()??Q,q=_.split("/").pop()??"";return J.startsWith(`${q}-`)?J.slice(q.length+1):J},g2=(_)=>_.replace(/^_+/,"").replace(/[_-]+/g," ");function KQ({record:_,history:Q}){let J=_.writes[_.writes.length-1],q=f0(J),U=_3(_.writes),G=new Set(_.writes.map((H)=>H.id)),Z=_.writes[0].occurredAt,F={};if(Q){for(let H of Q)if(!G.has(H.id)&&!H.landsId&&!H.aliasOf&&H.subject.type===J.subject.type&&H.subject.id===J.subject.id&&H.occurredAt<=Z)Object.assign(F,H.fields??{})}let X={...F};for(let H of _.writes)Object.assign(X,H.fields??{});let Y=U.tone==="added"&&Object.keys(F).length===0,K=[...new Set([...Object.keys(F),...Object.keys(X)])].filter((H)=>!NQ(F[H],X[H]));return $.jsxDEV("div",{className:"ws-diff","aria-label":`${q.label??q2(J)}: its changes`,children:[$.jsxDEV("div",{className:"ws-diff-head",children:[$.jsxDEV("span",{className:`ws-kind ${U.tone}`,title:U.word,children:$.jsxDEV(N1,{name:U.icon,size:16},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV(d1,{vendor:_.twin},void 0,!1,void 0,this),$.jsxDEV("div",{className:"cell-label",children:[$.jsxDEV("b",{children:q.label??q2(J)},void 0,!1,void 0,this),$.jsxDEV("small",{children:[B1(_.twin)," · ",J.subject.type.replace(/^_+/,"").replace(/[_-]+/g," ")," ",$.jsxDEV("code",{children:q2(J)},void 0,!1,void 0,this)," · ",U.word," here"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("ol",{className:"ws-writes",children:_.writes.map((H)=>$.jsxDEV("li",{children:[$.jsxDEV("b",{children:f0(H).what},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:[$.jsxDEV(u1,{iso:H.occurredAt},void 0,!1,void 0,this)," · ",t5(H)]},void 0,!0,void 0,this)]},H.id,!0,void 0,this))},void 0,!1,void 0,this),Q===null?$.jsxDEV("p",{className:"mode pad",children:"Reading its history…"},void 0,!1,void 0,this):K.length===0?$.jsxDEV("p",{className:"mode pad",children:"No field holds a new value."},void 0,!1,void 0,this):$.jsxDEV("table",{className:"ws-fields","aria-label":"Fields before and after",children:[$.jsxDEV("thead",{children:$.jsxDEV("tr",{children:[$.jsxDEV("th",{children:"Field"},void 0,!1,void 0,this),Y?null:$.jsxDEV("th",{children:"Before"},void 0,!1,void 0,this),$.jsxDEV("th",{children:U.tone==="removed"?"After":"Now"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("tbody",{children:K.map((H)=>$.jsxDEV("tr",{children:[$.jsxDEV("th",{scope:"row",children:$.jsxDEV("code",{children:H},void 0,!1,void 0,this)},void 0,!1,void 0,this),Y?null:$.jsxDEV("td",{className:H in F?"was":"none",children:H in F?$.jsxDEV(U2,{v:F[H]},void 0,!1,void 0,this):$.jsxDEV("span",{className:"mode",children:"—"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{className:H in X?"now":"none",children:H in X?$.jsxDEV(U2,{v:X[H]},void 0,!1,void 0,this):$.jsxDEV("span",{className:"mode",children:"—"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},H,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function YQ({records:_,selected:Q,onPick:J,label:q}){let[U,G]=r.useState(()=>{try{return localStorage.getItem("volter.console.records")==="tree"}catch{return!1}}),Z=(Y)=>{G(Y);try{localStorage.setItem("volter.console.records",Y?"tree":"path")}catch{}},F=(Y,K)=>{let H=Y.writes[Y.writes.length-1],L=f0(H),z=_3(Y.writes);return $.jsxDEV("li",{children:$.jsxDEV("button",{type:"button",className:[Q===Y.key?"on":"",K?"nested":""].join(" ").trim()||void 0,"aria-pressed":Q===Y.key,onClick:()=>J(Y.key),children:[K?null:$.jsxDEV(d1,{vendor:Y.twin},void 0,!1,void 0,this),$.jsxDEV("span",{className:"ws-row-text",children:[$.jsxDEV("b",{children:L.label??q2(H)},void 0,!1,void 0,this),$.jsxDEV("small",{children:[g2(H.subject.type)," · ",L.what.split(" ").slice(-1)[0],Y.writes.length>1?` · ${m1(Y.writes.length,"write")}`:""]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("span",{className:`ws-kind ${z.tone}`,title:z.word,"aria-label":z.word,children:$.jsxDEV(N1,{name:z.icon,size:16},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},Y.key,!1,void 0,this)},X=[...new Set(_.map((Y)=>Y.twin))];return $.jsxDEV($.Fragment,{children:[$.jsxDEV("div",{className:"ws-view-switch",role:"group","aria-label":"List the records by",children:[$.jsxDEV("button",{type:"button","aria-pressed":!U,className:U?void 0:"on",onClick:()=>Z(!1),children:"Path"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button","aria-pressed":U,className:U?"on":void 0,onClick:()=>Z(!0),children:"Tree"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("ul",{className:"ws-list","aria-label":q,children:U?X.map((Y)=>{let K=_.filter((H)=>H.twin===Y);return $.jsxDEV("li",{className:"ws-group",children:[$.jsxDEV("p",{className:"ws-group-head",children:[$.jsxDEV(d1,{vendor:Y},void 0,!1,void 0,this),$.jsxDEV("b",{children:B1(Y)},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:K.length},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("ul",{children:K.map((H)=>F(H,!0))},void 0,!1,void 0,this)]},Y,!0,void 0,this)}):_.map((Y)=>F(Y,!1))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function cZ({name:_,token:Q,branches:J,opens:q,refused:U,onChanged:G}){let[Z,F]=r.useState(""),[X,Y]=r.useState(!1),K=J?.state==="ok"&&J.data.checkedOut||_.split("/")[1],H=J?.state==="ok"&&J.data.named?.length?J.data.named:[{name:K,running:!0}],L=J?.state==="ok"?J.data.branches:[],z=Z.trim().toLowerCase(),W=(O)=>!z||O.toLowerCase().includes(z),I=(O)=>{O.currentTarget.closest("details")?.removeAttribute("open")};return $.jsxDEV("details",{className:"menu ws-pick",children:[$.jsxDEV("summary",{title:"The branch served here",children:[$.jsxDEV(N1,{name:"git-branch",size:16},void 0,!1,void 0,this),$.jsxDEV("span",{className:"ws-pick-label",children:[$.jsxDEV("small",{children:"Branch"},void 0,!1,void 0,this),$.jsxDEV("b",{children:K},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(N1,{name:"chevron-down",size:16},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"popover ws-branch-menu",children:[$.jsxDEV("div",{className:"ws-branch-find",children:[$.jsxDEV("input",{type:"search",placeholder:"Filter","aria-label":"Filter branches",value:Z,onChange:(O)=>F(O.target.value)},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",onClick:(O)=>{I(O),Y(!0)},disabled:!J,children:"New branch"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("p",{className:"menu-label",children:"This World"},void 0,!1,void 0,this),$.jsxDEV("ul",{className:"ws-branch-list",children:H.filter((O)=>W(O.name)).map((O)=>$.jsxDEV("li",{className:O.name===K?"current":void 0,children:[$.jsxDEV("span",{className:"tick",children:O.name===K?$.jsxDEV(N1,{name:"check",size:16},void 0,!1,void 0,this):$.jsxDEV(N1,{name:"git-branch",size:16},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("span",{className:"name",children:O.name},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:O.name===K?"served here":O.running?"running":"stopped"},void 0,!1,void 0,this)]},O.name,!0,void 0,this))},void 0,!1,void 0,this),$.jsxDEV("p",{className:"menu-label",children:"Branches of it"},void 0,!1,void 0,this),L.length===0?$.jsxDEV("p",{className:"mode ws-branch-none",children:"None yet. New branch makes one, from now or as the World was."},void 0,!1,void 0,this):$.jsxDEV("ul",{className:"ws-branch-list",children:L.filter((O)=>W(O.name)).map((O)=>{let A=$.jsxDEV($.Fragment,{children:[$.jsxDEV("span",{className:"tick",children:$.jsxDEV(N1,{name:"git-branch",size:16},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("span",{className:"name",children:pZ(_,O.name)},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:O.at?.instant?$.jsxDEV($.Fragment,{children:["as of ",$.jsxDEV(u1,{iso:O.at.instant,time:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this):"live"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),w=O.expiresAt?`Goes away ${new Date(O.expiresAt).toLocaleString()}`:"Kept";return $.jsxDEV("li",{children:q(O.name)?$.jsxDEV("a",{href:`${T1}/${O.name}`,title:w,onClick:(B)=>{B.preventDefault(),I(B),HQ(O.name,O.name.split("/"))},children:A},void 0,!1,void 0,this):$.jsxDEV("span",{title:`${w}. Its tokens went to whoever made it; it opens from their page.`,children:A},void 0,!1,void 0,this)},O.name,!1,void 0,this)})},void 0,!1,void 0,this),$.jsxDEV("div",{className:"ws-branch-foot",children:$.jsxDEV("a",{href:`${T1}/${_}/~/branches`,onClick:(O)=>{O.preventDefault(),I(O),j1([..._.split("/"),"~","branches"])},children:"Manage branches…"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(WQ,{name:_,token:Q,open:X,onClose:()=>Y(!1),onMade:G,refused:U},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function LQ({name:_,view:Q,changes:J,changesets:q}){let U=(G)=>(Z)=>{Z.preventDefault(),j1([..._.split("/"),"~",...G])};return $.jsxDEV("nav",{className:"tabs ws-pane-tabs","aria-label":"Changes and history",children:[$.jsxDEV("a",{href:`${T1}/${_}/~/changes`,className:Q==="changes"?"on":void 0,"aria-current":Q==="changes"?"page":void 0,onClick:U(["changes"]),children:["Changes",J?$.jsxDEV("span",{className:"count",children:J},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("a",{href:`${T1}/${_}/~/changes/changesets`,className:Q==="history"?"on":void 0,"aria-current":Q==="history"?"page":void 0,onClick:U(["changes","changesets"]),children:["History",q?$.jsxDEV("span",{className:"count",children:q},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function lZ({name:_,token:Q,sets:J,sub:q,signsAs:U,canWrite:G,rooted:Z,refused:F,onChanged:X,changes:Y,withScreens:K,required:H}){let[L,z]=r.useState(null),[W,I]=r.useState(!1),O=J.state==="ok"?[...J.data.changesets].sort((y,N)=>N.createdAt.localeCompare(y.createdAt)):[],A=O.find((y)=>y.name===q)??O[0],w=r.useMemo(()=>{let y=new Map;for(let N of A?IQ(A):[]){let k=`${N.twin}:${N.entry.subject.type}:${N.entry.subject.id}`,E=y.get(k)??{key:k,twin:N.twin,writes:[]};E.writes.push(N.entry),y.set(k,E)}return[...y.values()]},[A]),B=w.find((y)=>y.key===L)??w[0],T=V1(Q,B?`/-/${_}/log/${B.twin}`:null),R={added:0,removed:0,changed:0};for(let y of w)R[_3(y.writes).tone]=(R[_3(y.writes).tone]??0)+1;let C=A?J3(A):null,f=A?PQ(A,H):null;return $.jsxDEV("div",{className:"ws-two",children:[$.jsxDEV("div",{className:"ws-files",children:[$.jsxDEV(LQ,{name:_,view:"history",changes:Y,changesets:O.length},void 0,!1,void 0,this),$.jsxDEV(U0,{load:J,what:"the changesets",lines:4},void 0,!1,void 0,this),$.jsxDEV("ul",{className:"ws-list ws-commits","aria-label":"Changesets",children:O.map((y)=>{let N=A?.name===y.name,k=J3(y).label==="Not sent";return $.jsxDEV("li",{children:$.jsxDEV("a",{href:`${T1}/${_}/~/changes/changesets/${y.name}`,className:N?"on":void 0,"aria-current":N?"true":void 0,onClick:(E)=>{E.preventDefault(),z(null),j1([..._.split("/"),"~","changes","changesets",y.name])},children:[$.jsxDEV("span",{className:"ws-row-text",children:[$.jsxDEV("b",{children:B8(y)},void 0,!1,void 0,this),$.jsxDEV("small",{children:[y.owner??(y.cutBy?o4(y.cutBy):"unrecorded")," • ",$.jsxDEV(u1,{iso:y.createdAt},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),k?$.jsxDEV("span",{className:"ws-unpushed",title:"Not pushed to the remote yet",children:$.jsxDEV(N1,{name:"arrow-up-from-line",size:16},void 0,!1,void 0,this)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},y.name,!1,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-pane-right",children:[J.state==="ok"&&!A?$.jsxDEV(H5,{title:"No changesets yet",children:$.jsxDEV("p",{children:"Cut one from Changes: the cut box is at its foot."},void 0,!1,void 0,this)},void 0,!1,void 0,this):null,A&&C&&f?$.jsxDEV($.Fragment,{children:[$.jsxDEV("div",{className:"ws-commit-head",children:[$.jsxDEV("div",{className:"ws-commit-title",children:[$.jsxDEV("h3",{children:B8(A)},void 0,!1,void 0,this),$.jsxDEV("p",{className:"ws-commit-stat",children:[$.jsxDEV(N1,{name:"file-diff",size:16},void 0,!1,void 0,this)," ",m1(w.length,"changed record"),R.added?$.jsxDEV("span",{className:"plus",children:[" +",R.added]},void 0,!0,void 0,this):null,R.removed?$.jsxDEV("span",{className:"minus",children:[" −",R.removed]},void 0,!0,void 0,this):null,R.changed?$.jsxDEV("span",{className:"dot",children:[" •",R.changed]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("p",{className:"mode ws-commit-meta",children:[$.jsxDEV("code",{children:A.name},void 0,!1,void 0,this)," · ",$.jsxDEV(u1,{iso:A.createdAt},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("p",{className:"ws-commit-who",children:[["Owner",A.owner??(A.cutBy&&/^(token|token:read)$|^key:(?!.* for:)/.test(A.cutBy)?"no person: a service’s":"unrecorded")],["Cut by",A.cutBy?A.pushedBy&&A.applied===null&&A.cutBy==="machine"?"the machine it was cut on":o4(A.cutBy):"unrecorded"],...A.pushedBy?[["Pushed by",o4(A.pushedBy)]]:[]].map(([y,N])=>$.jsxDEV("span",{children:[$.jsxDEV("span",{className:"mode",children:y},void 0,!1,void 0,this)," ",N]},y,!0,void 0,this))},void 0,!1,void 0,this),A.pushedBy?$.jsxDEV("p",{className:"mode ws-commit-meta",children:A.applied===null?"Owner and cut by are as the World it was cut in recorded them; pushed by is this World's own record.":"Owner and cut by are this World’s record; pushed by is as the remote recorded it."},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"button",onClick:()=>I(!0),title:"Where it went, the checks, the approvals; Verify, Approve and Deploy",children:[$.jsxDEV("span",{className:`badge cs-${C.tone}`,children:C.label},void 0,!1,void 0,this),$.jsxDEV("span",{className:`badge cs-${f.tone}`,children:f.label},void 0,!1,void 0,this),"Review…"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-two inner",children:[$.jsxDEV("div",{className:"ws-files",children:$.jsxDEV(YQ,{records:w,...B?{selected:B.key}:{},onPick:z,label:"Records it changed"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("div",{className:"ws-detail",children:B?$.jsxDEV(KQ,{record:B,history:T.state==="ok"?T.data.entries:T.state==="error"?[]:null},void 0,!1,void 0,this):$.jsxDEV("p",{className:"mode pad",children:"It changes nothing."},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(M0,{open:W,onClose:()=>I(!1),title:`Review: ${B8(A)}`,wide:!0,children:[$.jsxDEV(e_,{name:_,token:Q,signsAs:U,c:A,canWrite:G,rooted:Z,refused:F,onChanged:X,part:"head",required:H},`h:${A.name}`,!1,void 0,this),$.jsxDEV(e_,{name:_,token:Q,signsAs:U,c:A,canWrite:G,rooted:Z,refused:F,onChanged:X,part:"review",required:H},`r:${A.name}`,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function rZ({name:_,token:Q,vendors:J,vendor:q,tick:U}){let[G,Z]=r.useState(s_*4),[F,X]=r.useState(""),[Y,K]=r.useState(null),H=V1(Q,`/-/${_}/timeline?limit=${G}${q?`&twin=${encodeURIComponent(q)}`:""}`,Math.floor(U/2)),L=H.state==="ok"?HF(H.data.entries):[],z=[...new Set(L.map((R)=>f0(R.entry).what))].sort(),W=L.filter((R)=>!F||f0(R.entry).what===F),I=W.find((R)=>K5(R)===Y)??W[0],O=(R)=>(C)=>{C.preventDefault(),K(null),j1([..._.split("/"),"~","events",...R?[R]:[]])},A=I?.entry.input&&typeof I.entry.input==="object"?I.entry.input.body:void 0,w=I?uZ(I.entry.traceparent):null,B=I?t_(I):null,T=I?UF(I.entry):[];return $.jsxDEV("div",{className:"ws-events",children:[$.jsxDEV("div",{className:"ws-filterbar",children:[$.jsxDEV("nav",{className:"ws-seg","aria-label":"Vendor",children:[$.jsxDEV("a",{href:`${T1}/${_}/~/events`,className:!q?"on":void 0,"aria-current":!q?"page":void 0,onClick:O(),children:"All"},void 0,!1,void 0,this),J.map((R)=>$.jsxDEV("a",{href:`${T1}/${_}/~/events/${R}`,className:q===R?"on":void 0,"aria-current":q===R?"page":void 0,onClick:O(R),children:[$.jsxDEV(d1,{vendor:R},void 0,!1,void 0,this),B1(R)]},R,!0,void 0,this))]},void 0,!0,void 0,this),$.jsxDEV("select",{"aria-label":"Operation",value:F,onChange:(R)=>{X(R.target.value),K(null)},children:[$.jsxDEV("option",{value:"",children:"Every operation"},void 0,!1,void 0,this),z.map((R)=>$.jsxDEV("option",{value:R,children:R},R,!1,void 0,this))]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-grid-wrap",children:[$.jsxDEV(U0,{load:H,what:"the events",lines:6},void 0,!1,void 0,this),$.jsxDEV("table",{className:"ws-grid","aria-label":"Events",children:[$.jsxDEV("thead",{children:$.jsxDEV("tr",{children:[$.jsxDEV("th",{children:"Time"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Vendor"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"What"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Record"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"By"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Receipt"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("tbody",{children:W.map((R)=>{let C=f0(R.entry),f=t_(R),y=I&&K5(R)===K5(I);return $.jsxDEV("tr",{className:y?"on":void 0,"aria-selected":y,onClick:()=>K(K5(R)),children:[$.jsxDEV("td",{className:"mono",children:$.jsxDEV(u1,{iso:R.entry.occurredAt,time:!0},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:$.jsxDEV("span",{className:"vendor-cell",children:[$.jsxDEV(d1,{vendor:R.twin},void 0,!1,void 0,this),B1(R.twin)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:$.jsxDEV("b",{children:C.what},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{className:"ws-cell-clip",children:C.label?`“${C.label}”`:$.jsxDEV("code",{children:q2(R.entry)},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{className:"mode",children:t5(R.entry,R.caller)},void 0,!1,void 0,this),$.jsxDEV("td",{children:f?$.jsxDEV("span",{className:f.bad?"badge cs-bad":f.status==="deployed"?"badge cs-done":"badge",children:f.status},void 0,!1,void 0,this):$.jsxDEV("span",{className:"mode",children:UQ(R.entry)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},K5(R),!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-event-detail",children:I?$.jsxDEV($.Fragment,{children:[$.jsxDEV("div",{className:"ws-event-line",children:[$.jsxDEV("span",{className:"badge",children:BQ(I.entry)},void 0,!1,void 0,this),B?$.jsxDEV("span",{className:B.bad?"badge cs-bad":"badge cs-good",children:B.status},void 0,!1,void 0,this):null,$.jsxDEV("code",{children:[I.entry.subject.type,":",q2(I.entry)]},void 0,!0,void 0,this),$.jsxDEV("span",{className:"mode",children:[$.jsxDEV(u1,{iso:I.entry.occurredAt},void 0,!1,void 0,this)," · ",t5(I.entry,I.caller)]},void 0,!0,void 0,this),w?$.jsxDEV("a",{href:`${T1}/${_}/~/trace/${w.trace}`,onClick:(R)=>{R.preventDefault(),j1([..._.split("/"),"~","trace",w.trace])},children:"Its trace →"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-event-panes",children:[$.jsxDEV("div",{role:"region","aria-label":"The request",children:[$.jsxDEV("h4",{children:"Request"},void 0,!1,void 0,this),A!==void 0?$.jsxDEV(ZF,{body:A},void 0,!1,void 0,this):$.jsxDEV("p",{className:"mode",children:"No request body: the World or the vendor wrote it."},void 0,!1,void 0,this),T.length?$.jsxDEV($.Fragment,{children:[$.jsxDEV("h4",{children:"Usage"},void 0,!1,void 0,this),$.jsxDEV("dl",{className:"fields",children:T.map(([R,C])=>$.jsxDEV(r.default.Fragment,{children:[$.jsxDEV("dt",{children:R},void 0,!1,void 0,this),$.jsxDEV("dd",{children:C},void 0,!1,void 0,this)]},R,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("div",{role:"region","aria-label":"What it wrote",children:[$.jsxDEV("h4",{children:"Written"},void 0,!1,void 0,this),$.jsxDEV(TQ,{fields:I.entry.fields},void 0,!1,void 0,this),$.jsxDEV("h4",{children:I.copies.length?"Receipts":"Receipt"},void 0,!1,void 0,this),$.jsxDEV("p",{className:"mode",children:I.copies.length?I.copies.map((R)=>R.entry.receipt?.status??"landed copy").join(" · "):FF(I.entry)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):$.jsxDEV("p",{className:"mode pad",children:"Nothing written here yet."},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("div",{className:"ws-foot mode",children:[$.jsxDEV("span",{children:[I?`${W.indexOf(I)+1} of ${W.length}`:W.length," events",q?` at ${B1(q)}`:""]},void 0,!0,void 0,this),H.state==="ok"&&H.data.next?$.jsxDEV("button",{type:"button",onClick:()=>Z((R)=>R+s_*4),children:"Load older"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function iZ({name:_,token:Q,id:J}){let q=/^[0-9a-f]{32}$/.test(J),U=V1(Q,q?`/-/${_}/timeline?trace=${J}&limit=500`:null),G=U.state==="ok"?[...U.data.entries].sort((H,L)=>-AQ(H,L)):[],[Z,F]=r.useState(null),X=G[0]?Date.parse(G[0].entry.occurredAt):0,Y=G.length?Math.max(1,Date.parse(G[G.length-1].entry.occurredAt)-X):1,K=[...new Set(G.map((H)=>H.twin))];return $.jsxDEV("div",{className:"ws-sheet ws-trace",children:[$.jsxDEV("p",{className:"crumbs-line",children:$.jsxDEV("a",{href:`${T1}/${_}/~/events`,onClick:(H)=>{H.preventDefault(),j1([..._.split("/"),"~","events"])},children:[$.jsxDEV(N1,{name:"arrow-left",size:16},void 0,!1,void 0,this)," Events"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("h2",{children:[G[0]?`${f0(G[0].entry).what} …`:"Trace"," ",$.jsxDEV("code",{className:"mode",children:J.slice(0,12)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),!q?$.jsxDEV("p",{role:"alert",children:[J?`${J} is not a trace id`:"No trace named",": a W3C trace id is 32 hex characters."]},void 0,!0,void 0,this):$.jsxDEV(U0,{load:U,what:"the trace"},void 0,!1,void 0,this),G.length?$.jsxDEV("p",{className:"ws-trace-meta",children:["Started ",$.jsxDEV("b",{children:$.jsxDEV(u1,{iso:G[0].entry.occurredAt},void 0,!1,void 0,this)},void 0,!1,void 0,this)," · Took ",$.jsxDEV("b",{children:[Y," ms"]},void 0,!0,void 0,this)," · Vendors ",$.jsxDEV("b",{children:K.map(B1).join(", ")},void 0,!1,void 0,this)," · Writes ",$.jsxDEV("b",{children:G.length},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,U.state==="ok"&&G.length===0?$.jsxDEV(H5,{title:"Nothing in this World carries this trace",children:$.jsxDEV("p",{children:["An app instrumented with OpenTelemetry sends a ",$.jsxDEV("code",{children:"traceparent"},void 0,!1,void 0,this)," with each call, and every write that call makes keeps it, so one click reads across every vendor."]},void 0,!0,void 0,this)},void 0,!1,void 0,this):null,G.length?$.jsxDEV("div",{className:"ws-spans",role:"table","aria-label":"The trace's writes",children:[$.jsxDEV("div",{className:"ws-span head",role:"row",children:[$.jsxDEV("span",{role:"columnheader",children:"Vendor and what"},void 0,!1,void 0,this),$.jsxDEV("span",{role:"columnheader",className:"ws-ticks",children:[$.jsxDEV("span",{children:"0 ms"},void 0,!1,void 0,this),$.jsxDEV("span",{children:[Math.round(Y/2)," ms"]},void 0,!0,void 0,this),$.jsxDEV("span",{children:[Y," ms"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),G.map((H)=>{let L=Date.parse(H.entry.occurredAt)-X,z=K5(H),W=f0(H.entry);return $.jsxDEV(r.default.Fragment,{children:[$.jsxDEV("div",{className:Z===z?"ws-span on":"ws-span",role:"row",onClick:()=>F(Z===z?null:z),children:[$.jsxDEV("span",{role:"cell",className:"ws-span-name",children:[$.jsxDEV(d1,{vendor:H.twin},void 0,!1,void 0,this),$.jsxDEV("b",{children:B1(H.twin)},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:[W.what,W.label?` “${W.label}”`:""]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("span",{role:"cell",className:"ws-span-track",children:[$.jsxDEV("span",{className:"ws-span-dot",style:{left:`${L/Y*100}%`}},void 0,!1,void 0,this),$.jsxDEV("span",{className:"ws-span-at mode",style:{left:`${L/Y*100}%`},children:["+",L," ms"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z===z?$.jsxDEV("div",{className:"ws-span-detail",children:[$.jsxDEV("p",{className:"mode",children:[$.jsxDEV("code",{children:BQ(H.entry)},void 0,!1,void 0,this)," on ",$.jsxDEV("code",{children:[H.entry.subject.type,":",q2(H.entry)]},void 0,!0,void 0,this)," · ",t5(H.entry,H.caller)," · ",UQ(H.entry)]},void 0,!0,void 0,this),$.jsxDEV(TQ,{fields:H.entry.fields},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},z,!0,void 0,this)})]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)}function dZ({name:_,token:Q,vendor:J,withScreens:q,tick:U}){let G=V1(Q,`/-/${_}/checkpoint/${J}`,Math.floor(U/6)),Z=G.state==="ok"?G.data.tree.filter((T)=>T.deleted!==!0):[],F=[...new Set(Z.map((T)=>T.type))].map((T)=>({type:T,count:Z.filter((R)=>R.type===T).length})).sort((T,R)=>Number(T.type.startsWith("_"))-Number(R.type.startsWith("_"))||g2(T.type).localeCompare(g2(R.type))),[X,Y]=r.useState(null),[K,H]=r.useState(null),L=F.some((T)=>T.type===X)?X:F[0]?.type,z=Z.filter((T)=>T.type===L),W=z.find((T)=>T.id===K)??z[0],I=["name","email","title","text","description","subject","amount","percent_off","unit_amount","currency","status","channel","customer","product"],O=new Set(["id","type","object","livemode","created","updated","updatedAt","deleted"]),A=(T)=>!O.has(T)&&z.some((R)=>R[T]!==void 0&&R[T]!==null&&typeof R[T]!=="object"),w=[...new Set(z.flatMap((T)=>Object.keys(T)))],B=[...I.filter(A),...w.filter((T)=>!I.includes(T)&&A(T))].slice(0,4);return $.jsxDEV("div",{className:"ws-table-app",children:[$.jsxDEV("nav",{className:"ws-tables","aria-label":`${B1(J)}'s records`,children:[$.jsxDEV("div",{className:"ws-list-head",children:$.jsxDEV("span",{className:"vendor-cell",children:[$.jsxDEV(d1,{vendor:J},void 0,!1,void 0,this),B1(J)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV(U0,{load:G,what:"what it stores",lines:4},void 0,!1,void 0,this),$.jsxDEV("p",{className:"menu-label",children:"Stores"},void 0,!1,void 0,this),F.map((T)=>$.jsxDEV("a",{href:`#${T.type}`,className:L===T.type?"on":void 0,"aria-current":L===T.type?"true":void 0,onClick:(R)=>{R.preventDefault(),Y(T.type),H(null)},children:[$.jsxDEV(N1,{name:"table-2",size:16},void 0,!1,void 0,this),$.jsxDEV("span",{children:g2(T.type)},void 0,!1,void 0,this),$.jsxDEV("span",{className:"count",children:T.count},void 0,!1,void 0,this)]},T.type,!0,void 0,this)),$.jsxDEV("p",{className:"menu-label",children:"Also"},void 0,!1,void 0,this),$.jsxDEV("a",{href:`${T1}/${_}/~/events/${J}`,onClick:(T)=>{T.preventDefault(),j1([..._.split("/"),"~","events",J])},children:[$.jsxDEV(N1,{name:"activity",size:16},void 0,!1,void 0,this),$.jsxDEV("span",{children:"Its events"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q?$.jsxDEV("a",{href:`${T1}/${_}/~/screens/${J}`,onClick:(T)=>{T.preventDefault(),j1([..._.split("/"),"~","screens",J])},children:[$.jsxDEV(N1,{name:"monitor",size:16},void 0,!1,void 0,this),$.jsxDEV("span",{children:"Its screens"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-grid-wrap",children:[G.state==="ok"&&F.length===0?$.jsxDEV(H5,{title:`${B1(J)} stores nothing yet`,children:$.jsxDEV("p",{children:"What your app makes there shows here, by type."},void 0,!1,void 0,this)},void 0,!1,void 0,this):null,z.length?$.jsxDEV("table",{className:"ws-grid","aria-label":`${g2(L??"")} records`,children:[$.jsxDEV("thead",{children:$.jsxDEV("tr",{children:[$.jsxDEV("th",{children:"id"},void 0,!1,void 0,this),B.map((T)=>$.jsxDEV("th",{children:T},T,!1,void 0,this)),$.jsxDEV("th",{children:"updated"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("tbody",{children:z.map((T)=>$.jsxDEV("tr",{className:W?.id===T.id?"on":void 0,"aria-selected":W?.id===T.id,onClick:()=>H(T.id),children:[$.jsxDEV("td",{children:$.jsxDEV("code",{children:T.id},void 0,!1,void 0,this)},void 0,!1,void 0,this),B.map((R)=>$.jsxDEV("td",{className:"ws-cell-clip",children:T[R]===void 0||T[R]===null?$.jsxDEV("span",{className:"mode",children:"—"},void 0,!1,void 0,this):String(T[R])},R,!1,void 0,this)),$.jsxDEV("td",{className:"mode",children:typeof T.updatedAt==="string"?$.jsxDEV(u1,{iso:T.updatedAt},void 0,!1,void 0,this):"—"},void 0,!1,void 0,this)]},T.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("aside",{className:"ws-record","aria-label":"The selected record",children:W?$.jsxDEV($.Fragment,{children:[$.jsxDEV("div",{className:"ws-list-head",children:[$.jsxDEV("span",{children:g2(W.type)},void 0,!1,void 0,this),$.jsxDEV("code",{children:W.id},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("dl",{className:"ws-record-fields",children:Object.entries(W).filter(([T])=>T!=="type"&&T!=="id").map(([T,R])=>$.jsxDEV(r.default.Fragment,{children:[$.jsxDEV("dt",{children:T},void 0,!1,void 0,this),$.jsxDEV("dd",{children:$.jsxDEV(U2,{v:R},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},T,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null},void 0,!1,void 0,this),$.jsxDEV("div",{className:"ws-foot mode",children:W?`${z.indexOf(W)+1} of ${m1(z.length,g2(L??"record"))}`:""},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function aZ({name:_,vendor:Q,url:J,mapError:q,holding:U,session:G,retry:Z}){return $.jsxDEV("div",{className:"ws-screen",children:[$.jsxDEV("div",{className:"ws-screen-bar",children:[$.jsxDEV("span",{className:"vendor-cell",children:[$.jsxDEV(d1,{vendor:Q},void 0,!1,void 0,this),$.jsxDEV("b",{children:B1(Q)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("span",{className:"mode",children:U},void 0,!1,void 0,this),$.jsxDEV("a",{href:`${T1}/${_}/~/vendors/${Q}`,onClick:(F)=>{F.preventDefault(),j1([..._.split("/"),"~","vendors",Q])},children:[$.jsxDEV(N1,{name:"table-2",size:16},void 0,!1,void 0,this),"Its records"]},void 0,!0,void 0,this),J?$.jsxDEV("a",{href:J,target:"_blank",rel:"noopener noreferrer",children:[$.jsxDEV(N1,{name:"external-link",size:16},void 0,!1,void 0,this),"New tab"]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),G.state==="ok"&&G.scope==="read"?$.jsxDEV("p",{className:"mode ws-screens-note",children:"You are looking read only: the screens browse, and refuse changes."},void 0,!1,void 0,this):null,q?$.jsxDEV("p",{role:"alert",className:"ws-screens-note",children:["The World did not say where its screens are: ",q]},void 0,!0,void 0,this):G.state==="pending"||J===void 0?$.jsxDEV("p",{className:"mode ws-screens-note",role:"status",children:"Opening…"},void 0,!1,void 0,this):null,G.state==="error"?$.jsxDEV("p",{role:"alert",className:"ws-screens-note",children:["The World did not open its screens: ",G.error," ",$.jsxDEV("button",{type:"button",onClick:Z,children:"Try again"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,G.state==="ok"&&J===null?$.jsxDEV("p",{className:"mode ws-screens-note",children:[B1(Q),"'s pack lists no screens."]},void 0,!0,void 0,this):null,G.state==="ok"&&J?$.jsxDEV("iframe",{title:`${B1(Q)}, as this World shows it`,src:J},Q,!1,void 0,this):null]},void 0,!0,void 0,this)}function sZ({name:_,token:Q,who:J,scope:q}){let[U,G]=r.useState(0),Z=V1(Q,`/-/${_}/twins`),F=V1(Q,`/-/${_}/rules`,U),X=F.state==="ok"?F.data.changesets:null,[Y,K]=r.useState(null),[H,L]=r.useState(null),[z,W]=r.useState(!1),[I,O]=r.useState([]),A=Y??X?.approvals??1,w=H??X?.summary??"required",B=X!==null&&(A!==(X.approvals??1)||w!==(X.summary??"required")),T=(k,E)=>{if(O((c)=>[{ok:k,text:E,at:new Date().toISOString(),n:++e5},...c].slice(0,3)),!k)r1(E,"error")},R=async(k)=>{k.preventDefault(),W(!0);try{let E=await y1(Q,`/-/${_}/rules`,{method:"PUT",body:JSON.stringify({changesets:{approvals:A,summary:w}})});if(!E.ok){T(!1,`Save: ${await Y0(E)}`);return}T(!0,`Saved: ${A===0?"no approval":m1(A,"approval")} before a deploy; a summary ${w==="required"?"required":"generated when none is given"}.`),K(null),L(null),G((c)=>c+1)}finally{W(!1)}},C={gated:"a person deploys an approved changeset",auto:"a push deploys at once",hold:"nothing deploys"},f=J.person?$.jsxDEV($.Fragment,{children:[$.jsxDEV("b",{children:J.person},void 0,!1,void 0,this),J.local?", signed in on this machine":""]},void 0,!0,void 0,this):J.local?$.jsxDEV($.Fragment,{children:[$.jsxDEV("b",{children:"this machine"},void 0,!1,void 0,this),": no one is signed in here, so no person owns them until they are pushed by one"]},void 0,!0,void 0,this):J.admin?$.jsxDEV($.Fragment,{children:$.jsxDEV("b",{children:"the host's admin"},void 0,!1,void 0,this)},void 0,!1,void 0,this):$.jsxDEV($.Fragment,{children:[$.jsxDEV("b",{children:"this token"},void 0,!1,void 0,this),", a service"]},void 0,!0,void 0,this),y=Z.state==="ok"?Z.data.twins.filter((k)=>k.root?.url):[],N=q!=="write"?"This session reads the World; it changes no rules":null;return $.jsxDEV($.Fragment,{children:[$.jsxDEV("h3",{className:"settings-head",children:"Changesets"},void 0,!1,void 0,this),$.jsxDEV("p",{className:"mode",children:"This World's rules, kept with it and shared by everyone who works in it. A person or the World's token changes them; a key never does, so an agent cannot relax the review its own changes go through."},void 0,!1,void 0,this),$.jsxDEV(U0,{load:F,what:"the rules",lines:2},void 0,!1,void 0,this),$.jsxDEV("form",{className:"ws-rules",onSubmit:(k)=>void R(k),"aria-label":"Changeset rules",children:[$.jsxDEV("div",{className:"ws-rule",children:[$.jsxDEV("h4",{children:"Recorded as"},void 0,!1,void 0,this),$.jsxDEV("p",{children:["What you cut here is recorded as ",f,". An agent's or an app's key cuts as itself, for the person it was made for; a World's token cuts as a service."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-rule",children:[$.jsxDEV("h4",{children:"A cut's summary"},void 0,!1,void 0,this),$.jsxDEV("fieldset",{className:"choice",disabled:Boolean(N)||X===null,children:[$.jsxDEV("label",{className:"check",children:[$.jsxDEV("input",{type:"radio",name:"summary",checked:w==="required",onChange:()=>L("required")},void 0,!1,void 0,this)," ",$.jsxDEV("span",{children:"Required: whoever cuts says what it does and why"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("label",{className:"check",children:[$.jsxDEV("input",{type:"radio",name:"summary",checked:w==="generated",onChange:()=>L("generated")},void 0,!1,void 0,this)," ",$.jsxDEV("span",{children:"Generated from its changes when none is given"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("p",{className:"mode",children:"Either way a cut takes every change not yet in a changeset: there is no staging."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-rule",children:[$.jsxDEV("h4",{children:"Ready to deploy"},void 0,!1,void 0,this),$.jsxDEV("ul",{className:"ws-rule-list",children:$.jsxDEV("li",{children:[$.jsxDEV(N1,{name:"check",size:16},void 0,!1,void 0,this),"Verified: replayed in a throwaway World, the World's checks passing"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("label",{className:"ws-rule-row",children:[$.jsxDEV("span",{children:"Approved by"},void 0,!1,void 0,this),$.jsxDEV("select",{value:A,onChange:(k)=>K(Number(k.target.value)),disabled:Boolean(N)||X===null,"aria-label":"Approvals required",children:[0,1,2,3,4,5].map((k)=>$.jsxDEV("option",{value:k,children:k===0?"no one: verified is enough":k===1?"1 person":`${k} different people`},k,!1,void 0,this))},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:"for its contents as they stand"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-rule",children:[$.jsxDEV("h4",{children:"Deploys to"},void 0,!1,void 0,this),Z.state==="ok"&&y.length===0?$.jsxDEV("p",{className:"mode",children:"No vendor here is connected to its real service, so nothing deploys from this World."},void 0,!1,void 0,this):null,y.length?$.jsxDEV("ul",{className:"ws-rule-list",children:y.map((k)=>$.jsxDEV("li",{children:[$.jsxDEV(d1,{vendor:k.twin},void 0,!1,void 0,this),B1(k.twin),": ",C[k.root.deploy??"gated"]??"gated"]},k.twin,!0,void 0,this))},void 0,!1,void 0,this):null,$.jsxDEV("p",{className:"mode",children:[$.jsxDEV("a",{href:`${T1}/${_}/~/settings/services`,onClick:(k)=>{k.preventDefault(),j1([..._.split("/"),"~","settings","services"])},children:"Real services"},void 0,!1,void 0,this)," sets each vendor's deploy policy."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(A2,{log:I,name:_},void 0,!1,void 0,this),$.jsxDEV("div",{className:"row-actions",children:[$.jsxDEV("button",{type:"submit",className:"primary",disabled:Boolean(N)||z||!B,title:N??void 0,children:z?"Saving…":"Save"},void 0,!1,void 0,this),B?$.jsxDEV("button",{type:"button",onClick:()=>{K(null),L(null)},children:"Cancel"},void 0,!1,void 0,this):null,N?$.jsxDEV("span",{className:"mode",children:[N,"."]},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)}function tZ({who:_,scope:Q,snapshot:J,portal:q,onSignOut:U}){let G=Q==="write"?"Reads and changes this World":Q==="read"?"Reads this World; changes nothing":"…",[Z,F]=J?["A snapshot",`of ${J.parent}, read only`]:_.local&&_.person?[_.person,"Signed in on this machine: this World is served here, and acts as you"]:_.local?["This machine","Served here, with no one signed in: what you do is recorded as this machine"]:_.person?[_.person,q?`Signed in through ${new URL(q).host}`:"Signed in"]:_.admin?["The host's admin","Opened with the host admin token: every World it serves"]:["A link or key","Opened with a token for this World"];return $.jsxDEV($.Fragment,{children:[$.jsxDEV("h3",{className:"settings-head",children:"Account"},void 0,!1,void 0,this),$.jsxDEV("div",{className:"ws-account",children:[$.jsxDEV("span",{className:"ws-account-face","aria-hidden":"true",children:$.jsxDEV(N1,{name:_.person?"user":_.local?"monitor":J?"clock":"key-round",size:20},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("div",{className:"cell-label",children:[$.jsxDEV("b",{children:Z},void 0,!1,void 0,this),$.jsxDEV("small",{children:F},void 0,!1,void 0,this),$.jsxDEV("small",{children:G},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),_.local||J?null:$.jsxDEV("p",{children:$.jsxDEV("button",{type:"button",onClick:U,children:[$.jsxDEV(N1,{name:"log-out",size:16},void 0,!1,void 0,this),_.person?"Sign out":_.admin?"Sign out of the host":"Use another token"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),q&&_.person?$.jsxDEV("p",{className:"mode",children:["Your profile, orgs and keys are on ",$.jsxDEV("a",{href:`${q}/`,children:new URL(q).host},void 0,!1,void 0,this),"."]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)}function oZ({name:_,token:Q,view:J,sub:q,arg:U,win:G,who:Z,snapshot:F,onReturn:X,onSignOut:Y,worlds:K,session:H,retry:L,twins:z,map:W,branches:I,clock:O,canWrite:A,refused:w,signsAs:B,opens:T,tick:R,admin:C,onRemoved:f,onClock:y,scope:N}){let k=wQ(_,Q,R,w),[E,c]=r.useState(0),l=E*1e5+Math.floor(R/2),S=V1(Q,`/-/${_}/diff`,l),j=V1(Q,`/-/${_}/changesets`,l),D=V1(Q,`/-/${_}/rules`,l),[x,v]=r.useState(null),m=(e)=>(O1)=>{O1?.preventDefault(),j1([..._.split("/"),"~",...e])},P=z.state==="ok"?z.data.twins.map((e)=>e.twin):[],V=new Map((W.state==="ok"?W.data.twins:[]).flatMap((e)=>{let O1=mZ(_,e);return O1?[[e.twin,O1]]:[]})),b=[...V.keys()],u=W.state==="ok"?W.data.twins.filter((e)=>e.root).map((e)=>e.twin):[],t=(e)=>W.state==="ok"?(W.data.twins.find((O1)=>O1.twin===e)?.resources??[]).reduce((O1,X1)=>O1+X1.count,0):0,Q1=I?.state==="ok"&&I.data.checkedOut||_.split("/")[1],a=r.useMemo(()=>{if(S.state!=="ok")return[];let e=new Map;for(let O1 of S.data.changes){let X1=`${O1.twin}:${O1.entry.subject.type}:${O1.entry.subject.id}`,D1=e.get(X1)??{key:X1,twin:O1.twin,writes:[]};D1.writes.push(O1.entry),e.set(X1,D1)}return[...e.values()]},[S]),o=a.find((e)=>e.key===x)??a[0],p=V1(Q,J==="changes"&&o?`/-/${_}/log/${o.twin}`:null,l),n=S.state==="ok"?S.data.changes.length:0,J1=k.waiting.length,G1=k.there,q1=k.origin.state==="ok"?k.origin.data.origin:null,Y1=!A?"This session reads the World; it changes nothing":!G1?"No remote: name one in Settings › Remote":null,M1=(e,O1,X1,D1,a1,_0)=>$.jsxDEV("a",{href:`${T1}/${_}/~/${D1}`,className:e?"on":void 0,"aria-current":e?"page":void 0,onClick:a1,children:[O1,$.jsxDEV("span",{children:X1},void 0,!1,void 0,this),_0?$.jsxDEV("span",{className:"count",children:_0},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),L1=(e)=>{e.currentTarget.closest("details")?.removeAttribute("open")};return $.jsxDEV("div",{className:"ws",children:[$.jsxDEV("div",{className:"ws-bar",role:"toolbar","aria-label":`${_} toolbar`,children:[$.jsxDEV("div",{className:"ws-left",children:[$.jsxDEV(a5,{href:`${T1}/${_}`,onClick:(e)=>{e.preventDefault(),m(["changes"])()}},void 0,!1,void 0,this),$.jsxDEV("details",{className:"menu ws-pick",children:[$.jsxDEV("summary",{title:"This World",children:[$.jsxDEV(N1,{name:"globe",size:16},void 0,!1,void 0,this),$.jsxDEV("span",{className:"ws-pick-label",children:[$.jsxDEV("small",{children:"World"},void 0,!1,void 0,this),$.jsxDEV("b",{children:_},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(N1,{name:"chevron-down",size:16},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"popover menu-list ws-world-menu",children:[Z.local?null:$.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"menu-label",children:"Worlds"},void 0,!1,void 0,this),K.map((e)=>$.jsxDEV("a",{href:`${T1}/${e}`,className:e===_?"on":void 0,onClick:(O1)=>{O1.preventDefault(),L1(O1),j1(e.split("/"))},children:[e===_?$.jsxDEV(N1,{name:"check",size:16},void 0,!1,void 0,this):$.jsxDEV(N1,{name:"globe",size:16},void 0,!1,void 0,this),e]},e,!0,void 0,this)),$.jsxDEV("a",{href:`${V0()&&V0()!==k1?V0():""}${T1}/`,onClick:(e)=>{if(V0()&&V0()!==k1)return;e.preventDefault(),L1(e),j1([])},children:[$.jsxDEV(N1,{name:"layout-grid",size:16},void 0,!1,void 0,this),"All Worlds",G0()?` on ${new URL(G0()).host}`:""]},void 0,!0,void 0,this),$.jsxDEV("hr",{},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("p",{className:"menu-label",children:"Connect an app"},void 0,!1,void 0,this),G0()?$.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"ws-menu-text",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),$.jsxDEV("pre",{children:[l0,"/",_,"/<vendor>"]},void 0,!0,void 0,this),$.jsxDEV(W8,{text:d4({platform:G0(),world:_})},void 0,!1,void 0,this)]},void 0,!0,void 0,this):!Z.local?$.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"ws-menu-text",children:"Point your app's SDKs here with a key from Settings › Access; its calls to these vendors land in this World:"},void 0,!1,void 0,this),$.jsxDEV("pre",{children:[l0,"/",_,"/<vendor>"]},void 0,!0,void 0,this),$.jsxDEV(W8,{text:d4()},void 0,!1,void 0,this)]},void 0,!0,void 0,this):$.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"ws-menu-text",children:"Run it in this World; its calls to these vendors land here:"},void 0,!1,void 0,this),$.jsxDEV("pre",{children:"volter world run -- npm start"},void 0,!1,void 0,this),$.jsxDEV("p",{className:"ws-menu-text mode",children:["Or point an SDK at ",$.jsxDEV("code",{children:[l0,"/",_,"/<vendor>"]},void 0,!0,void 0,this)," with the token in ",$.jsxDEV("code",{children:".volter/token"},void 0,!1,void 0,this),"."]},void 0,!0,void 0,this),$.jsxDEV(W8,{text:d4()},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("hr",{},void 0,!1,void 0,this),$.jsxDEV("a",{href:`${T1}/${_}/~/settings`,onClick:(e)=>{L1(e),m(["settings"])(e)},children:[$.jsxDEV(N1,{name:"settings",size:16},void 0,!1,void 0,this),"Settings…"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(cZ,{name:_,token:Q,branches:I,opens:T,refused:w,onChanged:y},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-where",title:"Where this is",children:[$.jsxDEV("span",{children:_},void 0,!1,void 0,this),$.jsxDEV("span",{className:"sep",children:":"},void 0,!1,void 0,this),$.jsxDEV("span",{children:Q1},void 0,!1,void 0,this),$.jsxDEV("span",{className:"sep",children:":"},void 0,!1,void 0,this),q1?$.jsxDEV("a",{href:`${T1}/${_}/~/remote`,onClick:m(["remote"]),children:["origin ",q1.namespace,J1?$.jsxDEV("b",{children:[" ↑",J1]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this):$.jsxDEV("a",{href:`${T1}/${_}/~/remote`,onClick:m(["remote"]),children:"no remote"},void 0,!1,void 0,this),$.jsxDEV("span",{className:"sep",children:":"},void 0,!1,void 0,this),$.jsxDEV("a",{href:`${T1}/${_}/~/settings/clock`,onClick:m(["settings","clock"]),children:O.state==="ok"?$.jsxDEV($.Fragment,{children:[O.data.frozen?"stopped at ":"",$.jsxDEV(u1,{iso:O.data.at,time:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this):"…"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-right",children:[$.jsxDEV("button",{type:"button",className:"ws-btn",onClick:()=>void k.pull(),disabled:Boolean(Y1)||k.busy!==null,title:Y1??`Fetch what ${G1} has and move this branch onto it`,children:[$.jsxDEV(N1,{name:"arrow-down-to-line",size:16},void 0,!1,void 0,this),k.busy==="Pull"?"Pulling…":"Pull"]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"button",className:"ws-btn",onClick:()=>void k.push(),disabled:Boolean(Y1)||k.busy!==null||J1===0,title:Y1??(J1?`Push ${m1(J1,"changeset")} to ${G1}`:`Every changeset is at ${G1}`),children:[$.jsxDEV(N1,{name:"arrow-up-from-line",size:16},void 0,!1,void 0,this),k.busy==="Push"?"Pushing…":"Push",J1?$.jsxDEV("span",{className:"ws-btn-count",children:J1},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"button",className:"ws-btn icon-only","aria-label":"Settings",title:"Settings",onClick:()=>m(["settings"])(),children:$.jsxDEV(N1,{name:"settings",size:16},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),F?$.jsxDEV("div",{className:"ws-banner",role:"region","aria-label":"Snapshot",children:[$.jsxDEV(N1,{name:"clock",size:16},void 0,!1,void 0,this),$.jsxDEV("span",{children:["You are looking at ",$.jsxDEV("b",{children:F.parent},void 0,!1,void 0,this)," as it was at ",$.jsxDEV(u1,{iso:F.at},void 0,!1,void 0,this),": a read-only snapshot",F.expiresAt?$.jsxDEV($.Fragment,{children:[", gone ",$.jsxDEV(u1,{iso:F.expiresAt},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,"."]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"button",onClick:()=>void X(F),children:"Return to live"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,k.log.length?$.jsxDEV("div",{className:"ws-said",children:$.jsxDEV(A2,{log:k.log.slice(0,1),name:_},void 0,!1,void 0,this)},void 0,!1,void 0,this):null,$.jsxDEV("div",{className:"ws-body",children:[$.jsxDEV("nav",{className:"ws-side","aria-label":`${_} places`,children:[P.length?$.jsxDEV("a",{href:`${T1}/${_}/~/screens`,className:J==="screen"?"ws-screens-entry on":"ws-screens-entry",onClick:m(["screens"]),title:`The board: ${E2(P.map(B1))}`,children:[$.jsxDEV(N1,{name:"layout-grid",size:16},void 0,!1,void 0,this),$.jsxDEV("span",{children:"Board"},void 0,!1,void 0,this),$.jsxDEV("span",{className:"ws-screens-marks",children:[P.slice(0,3).map((e)=>$.jsxDEV(d1,{vendor:e},e,!1,void 0,this)),P.length>3?$.jsxDEV("span",{className:"more",children:["+",P.length-3]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null,$.jsxDEV("p",{className:"side-group",children:"Workspace"},void 0,!1,void 0,this),M1(J==="changes"||J==="history",$.jsxDEV(N1,{name:"file-diff",size:16},void 0,!1,void 0,this),"Changes","changes",m(["changes"]),a.length?String(a.length):void 0),M1(J==="events"&&!U||J==="trace",$.jsxDEV(N1,{name:"activity",size:16},void 0,!1,void 0,this),"Events","events",m(["events"])),$.jsxDEV("p",{className:"side-group",children:"Records"},void 0,!1,void 0,this),P.map((e)=>$.jsxDEV(r.default.Fragment,{children:M1(J==="vendor"&&U===e,$.jsxDEV(d1,{vendor:e},void 0,!1,void 0,this),B1(e),`vendors/${e}`,m(["vendors",e]),t(e)?String(t(e)):void 0)},e,!1,void 0,this)),$.jsxDEV("p",{className:"side-group",children:"Remote"},void 0,!1,void 0,this),M1(!1,$.jsxDEV(N1,{name:"cloud",size:16},void 0,!1,void 0,this),G1?"origin":"Name a remote…","remote",m(["remote"]),J1?`↑${J1}`:void 0)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-main",role:"main",children:[J==="changes"?$.jsxDEV("div",{className:"ws-status",children:[$.jsxDEV("div",{className:"ws-files",children:[$.jsxDEV(LQ,{name:_,view:"changes",changes:a.length,changesets:j.state==="ok"?j.data.changesets.length:0},void 0,!1,void 0,this),$.jsxDEV("div",{className:"ws-list-head",children:[$.jsxDEV("span",{children:"Not in a changeset"},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:S.state==="ok"?`${m1(a.length,"record")} · ${m1(n,"write")}`:""},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(U0,{load:S,what:"the changes",lines:4},void 0,!1,void 0,this),$.jsxDEV(YQ,{records:a,...o?{selected:o.key}:{},onPick:v,label:"Changed records"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-detail",children:[S.state==="ok"&&!o?$.jsxDEV(H5,{title:"No changes on this branch",action:J1>0&&G1?$.jsxDEV("button",{type:"button",className:"primary",disabled:Boolean(Y1)||k.busy!==null,onClick:()=>void k.push(),children:["Push ",m1(J1,"changeset")," to origin"]},void 0,!0,void 0,this):void 0,children:$.jsxDEV("p",{children:["What your app writes to this World lands here, record by record, to cut into a changeset. Everything since ",S.data.base.at?$.jsxDEV(u1,{iso:S.data.base.at},void 0,!1,void 0,this):$.jsxDEV("code",{children:S.data.base.id},void 0,!1,void 0,this)," is in one already."]},void 0,!0,void 0,this)},void 0,!1,void 0,this):null,o?$.jsxDEV(KQ,{record:o,history:p.state==="ok"?p.data.entries:p.state==="error"?[]:null},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV(TF,{pinned:!0,generated:D.state==="ok"&&D.data.changesets.summary==="generated",author:{face:$.jsxDEV(N1,{name:Z.person?"user":Z.local?"monitor":"key-round",size:18},void 0,!1,void 0,this),who:Z.person??(Z.local?"This machine":Z.admin?"The host's admin":"A token"),account:`${T1}/${_}/~/settings/account`,branch:Q1},name:_,token:Q,changes:n,canWrite:A,refused:w,onCut:()=>{c((e)=>e+1),v(null)}},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,J==="history"?$.jsxDEV(lZ,{name:_,token:Q,sets:j,changes:a.length,withScreens:b,required:D.state==="ok"?D.data.changesets.approvals??1:1,...q?{sub:q}:{},signsAs:B,canWrite:A,rooted:u,refused:w,onChanged:()=>c((e)=>e+1)},void 0,!1,void 0,this):null,J==="events"?$.jsxDEV(rZ,{name:_,token:Q,vendors:P,...U&&P.includes(U)?{vendor:U}:{},tick:R},U??"",!1,void 0,this):null,J==="trace"?$.jsxDEV(iZ,{name:_,token:Q,id:U??""},void 0,!1,void 0,this):null,J==="vendor"&&U?$.jsxDEV(dZ,{name:_,token:Q,vendor:U,withScreens:b.includes(U),tick:R},U,!1,void 0,this):null,J==="screen"&&U?$.jsxDEV(aZ,{name:_,vendor:U,url:W.state==="ok"?V.get(U)??null:void 0,...W.state==="error"?{mapError:W.error}:{},holding:eZ(W.state==="ok"?W.data.twins.find((e)=>e.twin===U)?.resources??[]:[]),session:H,retry:L},U,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(M0,{open:G?.kind==="settings",onClose:()=>m(["changes"])(),title:"Settings",wide:"window",children:G?.kind==="settings"?$.jsxDEV("div",{className:"ws-settings",children:[$.jsxDEV("nav",{"aria-label":"Settings",children:XQ.map(([e,O1,X1])=>$.jsxDEV("a",{href:`${T1}/${_}/~/settings/${e}`,className:G.tab===e?"on":void 0,"aria-current":G.tab===e?"page":void 0,onClick:m(["settings",e]),children:[$.jsxDEV(N1,{name:X1,size:16},void 0,!1,void 0,this),O1]},e,!0,void 0,this))},void 0,!1,void 0,this),$.jsxDEV("div",{className:"ws-settings-pane",children:[N==="read"?$.jsxDEV("p",{className:"mode",children:[$.jsxDEV("span",{className:"badge read-only",children:"Read only"},void 0,!1,void 0,this)," This session reads the World; it changes nothing."]},void 0,!0,void 0,this):null,G.tab==="account"?$.jsxDEV(tZ,{who:Z,scope:N,snapshot:F,portal:G0(),onSignOut:Y},void 0,!1,void 0,this):null,G.tab==="changesets"?$.jsxDEV(sZ,{name:_,token:Q,who:Z,scope:N},void 0,!1,void 0,this):null,G.tab==="remote"?$.jsxDEV(OF,{name:_,token:Q,canWrite:A,tick:R,refused:w},void 0,!1,void 0,this):null,G.tab==="access"||G.tab==="services"||G.tab==="checks"||G.tab==="clock"?$.jsxDEV(PF,{name:_,token:Q,admin:C,canWrite:A,refused:w,onRemoved:f,only:G.tab},void 0,!1,void 0,this):null,G.tab==="vault"?$.jsxDEV(IF,{name:_,token:Q,canWrite:A,refused:w},void 0,!1,void 0,this):null,G.tab==="appearance"?$.jsxDEV($.Fragment,{children:[$.jsxDEV("h3",{className:"settings-head",children:"Appearance"},void 0,!1,void 0,this),$.jsxDEV(DZ,{},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):null},void 0,!1,void 0,this),$.jsxDEV(M0,{open:G?.kind==="branches",onClose:()=>m(["changes"])(),title:"Branches",wide:!0,children:G?.kind==="branches"?$.jsxDEV(JF,{name:_,token:Q,canWrite:A,branches:I,opens:T,...G.open?{open:G.open}:{},onChanged:y,refused:w},void 0,!1,void 0,this):null},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function W8({text:_}){return $.jsxDEV("button",{type:"button",className:"agent-prompt-button",onClick:()=>{navigator.clipboard?.writeText(_).then(()=>r1("Copied the prompt: paste it into your coding agent"),()=>r1("Could not copy the prompt","error"))},children:"Copy a prompt for your coding agent"},void 0,!1,void 0,this)}var N8=(_)=>`${_.url.replace(/\/+$/,"")}/${_.namespace}`,nZ=(_)=>_.filter((Q)=>Q.applied===null||Q.applied.outcome==="refused"),eZ=(_,Q=4)=>{let J=[..._].filter((q)=>q.count>0).sort((q,U)=>U.count-q.count);return J.length?J.slice(0,Q).map((q)=>m1(q.count,q.type.replace(/^_+/,""))).join(" · ")+(J.length>Q?` · +${J.length-Q} more`:""):"nothing yet"},zQ=$.jsxDEV("svg",{className:"branch-glyph",viewBox:"0 0 16 16",width:"14",height:"14","aria-hidden":"true",children:$.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);function _F({name:_,token:Q,clock:J,canWrite:q,onChanged:U,refused:G,open:Z}){let[F,X]=r.useState(!1),[Y,K]=r.useState(""),[H,L]=r.useState(""),[z,W]=r.useState(null),[I,O]=r.useState(!1),A=J.state==="ok"?J.data:null,w=async(C,f,y)=>{O(!0),W(null);try{let N=await y1(Q,`/-/${_}/${f}`,{method:f==="clock"?"PUT":"POST",body:JSON.stringify(y)});if(!N.ok){G(N),W({ok:!1,text:await Y0(N)});return}let k=await N.json();W({ok:!0,text:`${C} — the World is at ${new Date(k.at).toLocaleString()}`}),X(!1),U()}catch(N){W({ok:!1,text:`the World did not answer: ${N instanceof Error?N.message:String(N)}`})}finally{O(!1)}},B=(C)=>{C.preventDefault();let f=new Date(Y);if(Number.isNaN(f.getTime())){W({ok:!1,text:"Pick a date and time."});return}if(A&&f.getTime()<Date.parse(A.at)){W({ok:!1,text:`The World's clock only moves forward: pick a time after ${new Date(A.at).toLocaleString()}.`});return}w("Clock set","clock",{at:f.toISOString()})},T=(C,f)=>{w(`Advanced ${f}`,"clock/advance",{by:C})},R=[["1h","1 hour"],["1d","1 day"],["7d","1 week"],["30d","30 days"]];return $.jsxDEV("div",{className:`clock${A?.frozen?" frozen":""}`,role:"region","aria-label":"World clock",children:[$.jsxDEV("p",{className:"clock-now",children:J.state==="loading"?$.jsxDEV("span",{className:"mode",children:"clock…"},void 0,!1,void 0,this):J.state==="error"?$.jsxDEV("span",{className:"mode",children:["Clock: ",J.error]},void 0,!0,void 0,this):A.frozen?$.jsxDEV($.Fragment,{children:[$.jsxDEV("span",{className:"badge",children:"Simulation"},void 0,!1,void 0,this)," World time ",$.jsxDEV("strong",{children:$.jsxDEV(u1,{iso:A.at},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):$.jsxDEV($.Fragment,{children:["World time ",$.jsxDEV("strong",{children:$.jsxDEV(u1,{iso:A.at},void 0,!1,void 0,this)},void 0,!1,void 0,this)," ",$.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),q&&A?$.jsxDEV("details",{className:Z?"clock-more inline":"clock-more",open:Z||void 0,children:[$.jsxDEV("summary",{children:"Simulate time…"},void 0,!1,void 0,this),$.jsxDEV("div",{className:Z?void 0:"popover",children:[$.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, the branch picker’s Manage branches… views an earlier moment."},void 0,!1,void 0,this),$.jsxDEV("div",{className:"clock-controls",children:[$.jsxDEV("button",{type:"button","aria-expanded":F,onClick:()=>{X(!F),K(Y5(r_(A.at))),W(null)},children:"Set time…"},void 0,!1,void 0,this),$.jsxDEV("div",{role:"group","aria-label":"Advance the clock",className:"advance",children:[$.jsxDEV("span",{className:"mode",children:"Advance"},void 0,!1,void 0,this),R.map(([C,f])=>$.jsxDEV("button",{type:"button","aria-label":`Advance ${f}`,disabled:I||!A.frozen,title:A.frozen?void 0:"Set the time first: advancing moves a set clock",onClick:()=>T(C,f),children:f},C,!1,void 0,this)),$.jsxDEV("form",{className:"inline",onSubmit:(C)=>{if(C.preventDefault(),!/^\d+[smhd]$/.test(H.trim())){W({ok:!1,text:"Advance by a number and a unit: 90m, 12h, 3d."});return}T(H.trim(),`by ${H.trim()}`)},children:[$.jsxDEV("label",{className:"sr",children:["Advance by ",$.jsxDEV("input",{name:"advanceBy",value:H,onChange:(C)=>L(C.target.value),placeholder:"90m, 12h, 3d",size:9,disabled:!A.frozen},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"submit",disabled:I||!A.frozen,children:"Advance"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),!A.frozen?$.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,F?$.jsxDEV("form",{className:"inline","aria-label":"Set the World time",onSubmit:B,noValidate:!0,children:[$.jsxDEV("label",{children:["World time ",$.jsxDEV("input",{name:"worldTime",type:"datetime-local",value:Y,min:Y5(r_(A.at)),onChange:(C)=>K(C.target.value),required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("span",{className:"mode",children:Intl.DateTimeFormat().resolvedOptions().timeZone},void 0,!1,void 0,this),$.jsxDEV("button",{type:"submit",disabled:I,children:"Set time"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",onClick:()=>X(!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,z?$.jsxDEV("p",{role:z.ok?"status":"alert",children:z.text},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}function QF({name:_,token:Q,clock:J,refused:q}){let[U,G]=r.useState(!1),[Z,F]=r.useState(""),[X,Y]=r.useState(null),[K,H]=r.useState(!1),L=J.state==="ok"?J.data.at:new Date().toISOString(),z=r.useRef(null);return r.useEffect(()=>{if(!U)return;let I=(A)=>{if(A.key==="Escape"&&!document.querySelector("dialog[open]"))G(!1),z.current?.querySelector("button")?.focus()},O=(A)=>{if(!z.current?.contains(A.target))G(!1)};return document.addEventListener("keydown",I),document.addEventListener("click",O),()=>{document.removeEventListener("keydown",I),document.removeEventListener("click",O)}},[U]),$.jsxDEV("div",{className:"as-of",ref:z,children:[$.jsxDEV("button",{type:"button","aria-expanded":U,title:"Open a read-only copy of this World as it was at a moment you pick",onClick:()=>{G(!U),F(Y5(L)),Y(null)},children:"View an earlier moment…"},void 0,!1,void 0,this),U?$.jsxDEV("form",{className:"inline","aria-label":"View the World as of a past moment",onSubmit:async(I)=>{I.preventDefault(),Y(null);let O=new Date(Z);if(Number.isNaN(O.getTime())){Y("Pick a date and time.");return}if(O.getTime()>Date.parse(L)){Y(`That is after the World's present (${new Date(L).toLocaleString()}); a snapshot looks back.`);return}H(!0);try{let A=await y1(Q,`/-/${_}/branches`,{method:"POST",body:JSON.stringify({at:{instant:O.toISOString()},ttl:3600})});if(!A.ok){q(A),Y(await Y0(A));return}let w=await A.json();R8({name:w.name,parent:_,token:w.token,readToken:w.readToken,at:O.toISOString(),expiresAt:w.expiresAt??null,parentOrigin:k1,made:!0});let B=n5(w.origin)?.origin;if(B&&B!==k1){P8(B,w.readToken,w.name,`${T1}/${w.name}`);return}j1(w.name.split("/"))}catch(A){Y(`the World did not answer: ${A instanceof Error?A.message:String(A)}`)}finally{H(!1)}},noValidate:!0,children:[$.jsxDEV("label",{children:["As of ",$.jsxDEV("input",{name:"asOf",type:"datetime-local",value:Z,max:Y5(L),onChange:(I)=>F(I.target.value),required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"submit",disabled:K,children:K?"Opening…":"Open snapshot"},void 0,!1,void 0,this),$.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,X?$.jsxDEV("p",{role:"alert",children:X},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}function WQ({name:_,token:Q,open:J,onClose:q,onMade:U,refused:G}){let Z=(f)=>f.split("/").pop()??f,[F,X]=r.useState(!1),[Y,K]=r.useState(null),[H,L]=r.useState(""),[z,W]=r.useState("now"),[I,O]=r.useState(""),[A,w]=r.useState("24"),[B,T]=r.useState(!0);r.useEffect(()=>{if(J)K(null),O(Y5(new Date().toISOString()))},[J]);let R=async(f)=>{f.preventDefault(),K(null);let y=z==="at"?new Date(I):null;if(y&&Number.isNaN(y.getTime())){K("Pick a date and time, or make it as of now.");return}if(y&&y.getTime()>Date.now()){K("A branch is made as of now or a moment before it.");return}X(!0);let N=await y1(Q,`/-/${_}/branches`,{method:"POST",body:JSON.stringify({ttl:Math.round(Number(A)*3600),...y?{at:{instant:y.toISOString()}}:B?{live:!0}:{},...H.trim()?{label:H.trim()}:{}})}).catch(()=>null);if(X(!1),!N){K(`${k1} did not answer`);return}if(!N.ok){G(N),K(await Y0(N));return}let k=await N.json();R8({name:k.name,parent:_,token:k.token??"",readToken:k.readToken,at:(y??new Date).toISOString(),expiresAt:k.expiresAt??null,parentOrigin:k1,...k.origin?{origin:k.origin}:{}}),q(),L(""),r1(`Made ${Z(k.name)}`),U()};return $.jsxDEV(M0,{open:J,onClose:()=>{if(!F)q()},title:`New branch of ${Z(_)}`,footer:$.jsxDEV($.Fragment,{children:[$.jsxDEV("button",{type:"button",onClick:()=>q(),disabled:F,children:"Cancel"},void 0,!1,void 0,this),$.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:$.jsxDEV("form",{id:"new-branch",onSubmit:(f)=>void R(f),className:"stack",children:[$.jsxDEV("label",{children:[$.jsxDEV("span",{children:["Label ",$.jsxDEV("span",{className:"mode",children:"(optional)"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("input",{name:"branchLabel",value:H,onChange:(f)=>L(f.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),$.jsxDEV("fieldset",{className:"choice",children:[$.jsxDEV("legend",{children:"From"},void 0,!1,void 0,this),$.jsxDEV("label",{className:"check",children:[$.jsxDEV("input",{type:"radio",name:"branchWhen",checked:z==="now",onChange:()=>W("now")},void 0,!1,void 0,this)," ",$.jsxDEV("span",{children:"Now: the World as it is"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z==="now"?$.jsxDEV("label",{className:"check sub",children:[$.jsxDEV("input",{type:"checkbox",name:"branchLive",checked:B,onChange:(f)=>T(f.target.checked)},void 0,!1,void 0,this)," ",$.jsxDEV("span",{children:"Live: its clock keeps this World's time, as a pull request's preview does (else it stops now)"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,$.jsxDEV("label",{className:"check",children:[$.jsxDEV("input",{type:"radio",name:"branchWhen",checked:z==="at",onChange:()=>W("at")},void 0,!1,void 0,this)," ",$.jsxDEV("span",{children:"An instant before now: the World as it was then, its clock stopped there"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z==="at"?$.jsxDEV("input",{type:"datetime-local","aria-label":"As of",value:I,max:Y5(new Date().toISOString()),onChange:(f)=>O(f.target.value)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"Goes away after"},void 0,!1,void 0,this),$.jsxDEV("select",{name:"branchLife",value:A,onChange:(f)=>w(f.target.value),children:[$.jsxDEV("option",{value:"1",children:"1 hour"},void 0,!1,void 0,this),$.jsxDEV("option",{value:"24",children:"1 day"},void 0,!1,void 0,this),$.jsxDEV("option",{value:"72",children:"3 days"},void 0,!1,void 0,this),$.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),Y?$.jsxDEV("p",{role:"alert",children:Y},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function JF({name:_,token:Q,canWrite:J,branches:q,opens:U,open:G,onChanged:Z,refused:F,snapshotOf:X}){let Y=V1(Q,`/-/${_}/clock`),K=(w)=>w.split("/").pop()??w,[H,L]=r.useState(!1),z=(w)=>(B)=>{B.preventDefault(),j1([..._.split("/"),"~","branches",...w?w.split("/"):[]])};if(!q)return $.jsxDEV("p",{className:"mode",children:"This host makes no branches of a World."},void 0,!1,void 0,this);let W=q.state==="ok"?q.data.branches:[],I=q.state==="ok"&&(q.data.named?.length??0)>0?q.data.named:[{name:K(_),running:!0}],O=q.state==="ok"?q.data.checkedOut??K(_):K(_),A=async(w)=>{if(!await p0({title:`Remove the branch ${K(w)}?`,body:"Whoever holds its tokens loses it, and its history goes with it.",action:"Remove branch",danger:!0}))return;let B=await y1(Q,`/-/${_}/branches/${w}`,{method:"DELETE"}).catch((T)=>T);if(B instanceof Error){r1(`Remove ${K(w)}: the World did not answer (${B.message})`,"error");return}if(!B.ok){F(B),r1(`Remove ${K(w)}: ${await Y0(B)}`,"error");return}t4(w),r1(`Removed ${K(w)}`),Z(),j1([..._.split("/"),"~","branches"])};if(G){let w=G.includes("/")?W.find((T)=>T.name===G):void 0,B=G.includes("/")?void 0:I.find((T)=>T.name===G);return $.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"crumbs-line",children:$.jsxDEV("a",{href:`${T1}/${_}/~/branches`,onClick:z(),children:"← Branches"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV(U0,{load:q,what:"the branches"},void 0,!1,void 0,this),q.state==="ok"&&!w&&!B?$.jsxDEV("p",{className:"mode",children:["This World has no branch named ",G,"."]},void 0,!0,void 0,this):null,w?$.jsxDEV($F,{name:_,b:w,canWrite:J,opens:U(w.name),remove:()=>void A(w.name)},void 0,!1,void 0,this):null,B&&!w?$.jsxDEV(qF,{name:_,token:Q,b:B,served:B.name===O,canWrite:J,canServe:q.state==="ok"&&Boolean(q.data.canServe)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}return $.jsxDEV("div",{"aria-labelledby":"branches",children:[$.jsxDEV("div",{className:"branches-head",children:[$.jsxDEV("p",{className:"lede",children:["Branch this World to look at it as it was, or to change it without touching ",$.jsxDEV("b",{children:O},void 0,!1,void 0,this),". Each branch's name opens its page."]},void 0,!0,void 0,this),J?$.jsxDEV("div",{className:"head-actions",children:[X?null:$.jsxDEV(QF,{name:_,token:Q,clock:Y,refused:F},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",className:"primary",onClick:()=>L(!0),children:"New branch"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV(U0,{load:q,what:"the branches"},void 0,!1,void 0,this),q.state==="ok"?$.jsxDEV("div",{className:"block",children:$.jsxDEV("table",{className:"dense","aria-label":"Branches",children:[$.jsxDEV("thead",{children:$.jsxDEV("tr",{children:[$.jsxDEV("th",{id:"branches",children:"Branch"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Parent"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"As of"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Made"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Goes away"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("tbody",{children:[I.map((w)=>$.jsxDEV("tr",{children:[$.jsxDEV("td",{children:[$.jsxDEV("a",{href:`${T1}/${_}/~/branches/${w.name}`,onClick:z(w.name),children:$.jsxDEV("b",{children:w.name},void 0,!1,void 0,this)},void 0,!1,void 0,this),w.name===O?$.jsxDEV($.Fragment,{children:[" ",$.jsxDEV("span",{className:"badge live",children:"served here"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):w.running?null:$.jsxDEV($.Fragment,{children:[" ",$.jsxDEV("span",{className:"badge",children:"stopped"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("td",{className:"mode",children:"—"},void 0,!1,void 0,this),$.jsxDEV("td",{className:"mode",children:"live"},void 0,!1,void 0,this),$.jsxDEV("td",{className:"mode",children:"—"},void 0,!1,void 0,this),$.jsxDEV("td",{className:"mode",children:"kept"},void 0,!1,void 0,this)]},`own:${w.name}`,!0,void 0,this)),W.map((w)=>$.jsxDEV("tr",{children:[$.jsxDEV("td",{children:$.jsxDEV("a",{href:`${T1}/${_}/~/branches/${w.name}`,onClick:z(w.name),children:$.jsxDEV("b",{children:K(w.name)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:K(w.from??_)},void 0,!1,void 0,this),$.jsxDEV("td",{children:w.at?.instant?$.jsxDEV(u1,{iso:w.at.instant},void 0,!1,void 0,this):$.jsxDEV("span",{className:"mode",children:"live"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:$.jsxDEV(u1,{iso:w.createdAt},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:w.expiresAt?$.jsxDEV(u1,{iso:w.expiresAt},void 0,!1,void 0,this):"kept"},void 0,!1,void 0,this)]},w.name,!0,void 0,this))]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this):null,$.jsxDEV(WQ,{name:_,token:Q,open:H,onClose:()=>L(!1),onMade:Z,refused:F},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function $F({name:_,b:Q,canWrite:J,opens:q,remove:U}){let G=(X)=>X.split("/").pop()??X,Z=O8(Q.name),F=V1(Z,Z?`/-/${Q.name}/diff`:null);return $.jsxDEV("div",{className:"branch-page",children:[$.jsxDEV("div",{className:"changeset-head",children:[$.jsxDEV("h3",{children:[zQ," ",G(Q.name)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"changeset-actions",children:[q?$.jsxDEV("button",{type:"button",className:"primary",onClick:()=>HQ(Q.name,Q.name.split("/")),children:"Open"},void 0,!1,void 0,this):null,J?$.jsxDEV("button",{type:"button",className:"danger-button",onClick:U,children:"Remove…"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"block",children:$.jsxDEV("dl",{className:"fields pad",children:[$.jsxDEV("dt",{children:"Name"},void 0,!1,void 0,this),$.jsxDEV("dd",{children:$.jsxDEV("code",{children:Q.name},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("dt",{children:"Parent"},void 0,!1,void 0,this),$.jsxDEV("dd",{children:G(Q.from??_)},void 0,!1,void 0,this),$.jsxDEV("dt",{children:"As of"},void 0,!1,void 0,this),$.jsxDEV("dd",{children:Q.at?.instant?$.jsxDEV(u1,{iso:Q.at.instant},void 0,!1,void 0,this):"live: it keeps its parent's time"},void 0,!1,void 0,this),$.jsxDEV("dt",{children:"Made"},void 0,!1,void 0,this),$.jsxDEV("dd",{children:$.jsxDEV(u1,{iso:Q.createdAt},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("dt",{children:"Goes away"},void 0,!1,void 0,this),$.jsxDEV("dd",{children:Q.expiresAt?$.jsxDEV(u1,{iso:Q.expiresAt},void 0,!1,void 0,this):"kept"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),!q?$.jsxDEV("p",{className:"mode",children:"Its tokens were handed to whoever made it: it opens, and shows its own changes, in their tab."},void 0,!1,void 0,this):null,F.state==="ok"?$.jsxDEV($.Fragment,{children:[$.jsxDEV("h4",{children:"Its changes"},void 0,!1,void 0,this),F.data.changes.length===0?$.jsxDEV("p",{className:"mode",children:"Nothing written on it since it branched."},void 0,!1,void 0,this):$.jsxDEV(MF,{changes:F.data.changes,idPrefix:`branch-${G(Q.name)}`},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)}function qF({name:_,token:Q,b:J,served:q,canWrite:U,canServe:G}){let[Z,F]=r.useState(!1),[X,Y]=r.useState(null),K=async()=>{F(!0),Y(null);let H=await y1(Q,`/-/${_}/branches/${encodeURIComponent(J.name)}/serve`,{method:"POST"}).catch(()=>null);if(H?.ok){location.reload();return}F(!1),Y(H?await Y0(H):`${k1} did not answer`)};return $.jsxDEV("div",{className:"branch-page",children:[$.jsxDEV("div",{className:"changeset-head",children:[$.jsxDEV("h3",{children:[zQ," ",J.name," ",q?$.jsxDEV("span",{className:"badge live",children:"served here"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"changeset-actions",children:U&&G&&!q?$.jsxDEV("button",{type:"button",className:"primary",disabled:Z,onClick:()=>void K(),children:Z?"Switching…":"Serve here"},void 0,!1,void 0,this):null},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"block",children:$.jsxDEV("dl",{className:"fields pad",children:[$.jsxDEV("dt",{children:"Name"},void 0,!1,void 0,this),$.jsxDEV("dd",{children:$.jsxDEV("code",{children:J.name},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("dt",{children:"Kind"},void 0,!1,void 0,this),$.jsxDEV("dd",{children:"one of this World's own branches"},void 0,!1,void 0,this),$.jsxDEV("dt",{children:"State"},void 0,!1,void 0,this),$.jsxDEV("dd",{children:J.running?"running":"stopped"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),q?$.jsxDEV("p",{className:"mode",children:["This is the branch these pages show: its changes are on ",$.jsxDEV("a",{href:`${T1}/${_}/~/changes`,onClick:(H)=>{H.preventDefault(),j1([..._.split("/"),"~","changes"])},children:"Changes"},void 0,!1,void 0,this),"."]},void 0,!0,void 0,this):G?$.jsxDEV("p",{className:"mode",children:["“Serve here” stops this one's twins and serves ",J.name," in its place."]},void 0,!0,void 0,this):$.jsxDEV("p",{className:"mode",children:"This host serves one of the World's own branches at a time, and does not switch them from this page."},void 0,!1,void 0,this),X?$.jsxDEV("p",{role:"alert",children:X},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}var s_=50,K5=(_)=>`${_.twin}:${_.position}`,AQ=(_,Q)=>Date.parse(Q.entry.occurredAt)-Date.parse(_.entry.occurredAt)||_.twin.localeCompare(Q.twin)||Q.position-_.position,o4=(_)=>{if(!_)return"someone";if(_.startsWith("key:")){let[Q,J]=_.slice(4).split(" for:");return J?`${Q}, for ${J}`:Q||"a key"}if(_.startsWith("person:"))return _.slice(7);return _==="machine"?"this machine":_==="person"?"a session with no name":_==="token:read"?"the read-only token":_==="token"?"the World's token":_},t5=(_,Q)=>{let J=typeof Q==="string"?Q:typeof _.caller==="string"?_.caller:"";if(J.startsWith("key:")&&J.length>4)return`by ${o4(J)}`;if(J.startsWith("person:")&&J.length>7)return`by ${J.slice(7)}`;if(J==="machine")return"by this machine";if(J==="person")return"by a session with no name";if(J==="key")return"by a key";if(J==="token:read")return"by the read-only token";if(J==="token")return"by the World's token";return _.actor?.kind==="system"?"by the vendor":_.actor?.id?`by ${_.actor.id}`:"by an app"},BQ=(_)=>_.operation??_.op;function UF(_){let Q=_.fields??{},J=Q.usage!==null&&typeof Q.usage==="object"?Q.usage:Q,q=(...Y)=>Y.map((K)=>J[K]??Q[K]).find((K)=>typeof K==="number"),U=[],G=q("prompt_tokens","input_tokens"),Z=q("completion_tokens","output_tokens"),F=q("total_tokens");if(G!==void 0)U.push(["tokens in",G.toLocaleString()]);if(Z!==void 0)U.push(["tokens out",Z.toLocaleString()]);if(F!==void 0)U.push(["tokens in all",F.toLocaleString()]);let X=q("cost_usd","cost");if(X!==void 0)U.push(["cost",`$${X<0.01?X.toPrecision(2):X.toFixed(2)}`]);return U}function MQ({text:_,at:Q=280}){if(_.length<=Q)return $.jsxDEV("span",{className:"text",children:_},void 0,!1,void 0,this);return $.jsxDEV("details",{className:"folded",children:[$.jsxDEV("summary",{children:[$.jsxDEV("span",{className:"text",children:[_.slice(0,Q),"…"]},void 0,!0,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:["show all ",_.length.toLocaleString()," characters"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("span",{className:"text",children:_},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function U2({v:_}){if(typeof _==="string")return $.jsxDEV(MQ,{text:_},void 0,!1,void 0,this);if(_===null||typeof _!=="object")return $.jsxDEV("code",{children:String(_)},void 0,!1,void 0,this);let Q=JSON.stringify(_,null,2);return Q.length<=160?$.jsxDEV("code",{children:JSON.stringify(_)},void 0,!1,void 0,this):$.jsxDEV("details",{className:"folded",children:[$.jsxDEV("summary",{children:$.jsxDEV("code",{children:[JSON.stringify(_).slice(0,120),"…"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("pre",{children:Q},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var GF=(_)=>typeof _==="string"?_:Array.isArray(_)?_.map((Q)=>Q&&typeof Q==="object"&&typeof Q.text==="string"?Q.text:"").filter(Boolean).join(`
36
+ `):JSON.stringify(_??"");function ZF({body:_}){if(_===null||typeof _!=="object"||Array.isArray(_))return $.jsxDEV(U2,{v:_},void 0,!1,void 0,this);let Q=_,J=Array.isArray(Q.messages)?Q.messages:null,q=Object.entries(Q).filter(([U])=>!(J&&U==="messages"));return $.jsxDEV($.Fragment,{children:[q.length?$.jsxDEV("dl",{className:"fields",children:q.map(([U,G])=>$.jsxDEV(r.default.Fragment,{children:[$.jsxDEV("dt",{children:U},void 0,!1,void 0,this),$.jsxDEV("dd",{children:$.jsxDEV(U2,{v:G},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},U,!0,void 0,this))},void 0,!1,void 0,this):null,J?$.jsxDEV("ol",{className:"messages",children:J.map((U,G)=>$.jsxDEV("li",{children:[$.jsxDEV("span",{className:"role",children:typeof U.role==="string"?U.role:"message"},void 0,!1,void 0,this),$.jsxDEV(MQ,{text:GF(U.content)},void 0,!1,void 0,this)]},G,!0,void 0,this))},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}function TQ({fields:_}){let Q=Object.entries(_??{});if(Q.length===0)return $.jsxDEV("p",{className:"mode",children:"No fields."},void 0,!1,void 0,this);return $.jsxDEV("dl",{className:"fields",children:Q.map(([J,q])=>$.jsxDEV(r.default.Fragment,{children:[$.jsxDEV("dt",{children:J},void 0,!1,void 0,this),$.jsxDEV("dd",{children:$.jsxDEV(U2,{v:q},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},J,!0,void 0,this))},void 0,!1,void 0,this)}var FF=(_)=>_.receipt?`${_.receipt.status??""}${_.receipt.externalId?` · ${_.receipt.externalId}`:""}${_.receipt.reason?` · ${_.receipt.reason}`:""}`:_.operation==="observed"?"observed from the vendor":_.provenance==="placeholder"?"default data":"none: it has not left this World";function HF(_){let Q=new Map,J=[],q=[],U=new Map;for(let G of _){if(G.entry.landsId||G.entry.aliasOf){q.push(G);continue}let Z={...G,copies:[]};if(J.push(Z),!Q.has(`${G.twin}:${G.entry.id}`))Q.set(`${G.twin}:${G.entry.id}`,Z);if(!U.has(`${G.twin}:${G.entry.subject.type}:${G.entry.subject.id}`))U.set(`${G.twin}:${G.entry.subject.type}:${G.entry.subject.id}`,Z)}for(let G of q){let Z=G.entry.landsId?Q.get(`${G.twin}:${G.entry.landsId}`):G.entry.aliasOf?U.get(`${G.twin}:${G.entry.subject.type}:${G.entry.aliasOf}`):void 0;if(Z)Z.copies.push(G);else J.push({...G,copies:[]})}return J.sort(AQ)}var A8={deployed:5,confirmed:4,landed:3,replayed:2,skipped:1};function t_(_){let Q=[_.entry.receipt,..._.copies.map((U)=>U.entry.receipt)].filter((U)=>Boolean(U?.status));if(Q.length===0)return null;let J=Q.find((U)=>U.status==="failed"||U.status==="refused"),q=[...Q].sort((U,G)=>(A8[G.status]??0)-(A8[U.status]??0))[0];return J&&!(A8[q.status]>=5)?{status:J.status,bad:!0}:{status:q.status,bad:!1}}var j0=1280,c0=820,a4=160,w0=72,M8=120,XF=72,n4="This World shows its branches' sites only on this machine.",g1=(_)=>`${_.vendor}:${_.id}`,x2=(_)=>`${_.vendor}:section:${_.section.id}`,p2=(_)=>[_.section.id,..._.section.aka??[]].map((Q)=>`${_.vendor}:section:${Q}`),Q3=(_,Q)=>Q.at&&("site"in Q.at)?Q.at.site:Q.at?`${l0}/${_}/${Q.vendor}${Q.at.screen}`:null,RQ=(_,Q,J)=>J.at&&("screen"in J.at)?`${l0}/-/${_}/branches/${Q}/pages?${new URLSearchParams({land:`/${Q}/${J.vendor}${J.at.screen}`}).toString()}`:Q3(Q,J),o_=(_,Q)=>_.include?Q.filter((J)=>_.include.includes(g1(J))||p2(J).some((q)=>_.include.includes(q))):Q.filter((J)=>!(_.hidden??[]).includes(g1(J)));function KF({data:_}){let{frame:Q,url:J,active:q,picked:U,boards:G,addTo:Z,remove:F,compare:X,grab:Y,branch:K}=_,H=g1(Q),L=G.filter((W)=>W.include&&!W.include.includes(H)&&!p2(Q).some((I)=>W.include.includes(I))),z=S1((W)=>W.transform[2]*(w0+M8)>=XF);return $.jsxDEV($.Fragment,{children:[$.jsxDEV(H8,{isVisible:z||U||q,position:H1.Top,align:"start",className:"frame-label",children:[$.jsxDEV("span",{className:"frame-name",onPointerDown:Y,children:[$.jsxDEV(d1,{vendor:Q.vendor},void 0,!1,void 0,this),$.jsxDEV("span",{children:Q.title},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Q.changes?$.jsxDEV("button",{type:"button",className:"frame-changed nodrag",onClick:()=>X(H),title:`${m1(Q.changes,"change")} ${K?"on this branch":"here, not in a changeset"}: compare`,children:[$.jsxDEV(N1,{name:"square-dot",size:14},void 0,!1,void 0,this),Q.changes]},void 0,!0,void 0,this):U?$.jsxDEV("button",{type:"button",className:"ghost nodrag",onClick:()=>X(H),title:"Compare with a branch of this World","aria-label":`Compare ${Q.title} with a branch`,children:$.jsxDEV(N1,{name:"file-diff",size:14},void 0,!1,void 0,this)},void 0,!1,void 0,this):null,U&&L.length?$.jsxDEV("select",{className:"nodrag frame-add",value:"","aria-label":`Add ${Q.title} to a board`,onChange:(W)=>{if(W.target.value)Z(W.target.value,H)},children:[$.jsxDEV("option",{value:"",children:"Add to board…"},void 0,!1,void 0,this),L.map((W)=>$.jsxDEV("option",{value:W.id,children:W.name},W.id,!1,void 0,this))]},void 0,!0,void 0,this):null,U&&F?$.jsxDEV("button",{type:"button",className:"ghost nodrag",onClick:()=>F.act(H),title:F.label,"aria-label":F.label,children:"✕"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("div",{className:q?"frame on":U?"frame picked":"frame",style:{width:j0,height:c0},children:[$.jsxDEV("div",{className:"frame-bar",children:[$.jsxDEV(d1,{vendor:Q.vendor},void 0,!1,void 0,this),$.jsxDEV("strong",{children:[B1(Q.vendor)," · ",Q.kind]},void 0,!0,void 0,this),$.jsxDEV("span",{className:"frame-url",children:Q.url.replace(/^https?:\/\//,"")},void 0,!1,void 0,this),J?$.jsxDEV("a",{className:"nodrag",href:J,target:"_blank",rel:"noopener noreferrer","aria-label":`Open ${Q.title} in a new tab`,children:"↗"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("div",{className:q?"frame-body nodrag nopan nowheel":"frame-body",children:J?$.jsxDEV("iframe",{title:Q.title,src:J,loading:"lazy",style:{pointerEvents:q?"auto":"none"}},void 0,!1,void 0,this):$.jsxDEV("div",{className:"frame-none",children:[$.jsxDEV("p",{children:$.jsxDEV("strong",{children:Q.unseen==="branch-sites"?n4:Q.unseen==="sites-not-routed"?`This World shows ${Q.title} only at its own local address.`:`${B1(Q.vendor)}'s twin draws no page for this ${Q.kind} yet.`},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("p",{className:"mode",children:Q.url},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function OQ({name:_,label:Q,done:J}){let q=r.useRef(!1),U=(G)=>{if(q.current)return;q.current=!0,J(G?.trim()&&G.trim()!==_?G.trim().slice(0,80):null)};return $.jsxDEV("input",{className:"nodrag nopan name-field","aria-label":Q,defaultValue:_,size:Math.max(8,_.length+2),autoFocus:!0,onFocus:(G)=>G.currentTarget.select(),onKeyDown:(G)=>{if(G.key==="Enter")U(G.currentTarget.value);else if(G.key==="Escape")U(null)},onBlur:(G)=>U(G.currentTarget.value)},void 0,!1,void 0,this)}function YF({data:_}){return $.jsxDEV($.Fragment,{children:[$.jsxDEV(u_,{isVisible:_.picked&&_.editable,minWidth:480,minHeight:360,color:"var(--accent)",onResizeEnd:_.resized},void 0,!1,void 0,this),$.jsxDEV(H8,{isVisible:!0,position:H1.Top,align:"start",offset:-30,className:"section-tag",children:[_.renaming?$.jsxDEV(OQ,{name:_.name,label:"Name this section",done:(Q)=>_.renamed(_.key,Q)},void 0,!1,void 0,this):$.jsxDEV("button",{type:"button",className:_.picked?"nodrag on":"nodrag",onPointerDown:_.grab,onClick:()=>_.pick(_.key),onDoubleClick:()=>{if(_.editable)_.rename(_.key)},title:_.editable?"Double-click to rename":void 0,children:[_.vendor?$.jsxDEV(d1,{vendor:_.vendor},void 0,!1,void 0,this):null,$.jsxDEV("span",{children:_.name},void 0,!1,void 0,this)]},void 0,!0,void 0,this),_.picked&&_.editable&&!_.renaming?$.jsxDEV("button",{type:"button",className:"ghost nodrag",onClick:()=>_.remove(_.key),"aria-label":`Remove the section ${_.name}`,title:"Remove the section (its frames stay)",children:"✕"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("div",{className:_.picked?"section-box on":"section-box"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function n_({url:_,title:Q}){return $.jsxDEV("div",{className:"compare-thumb",style:{width:420,height:420*c0/j0},children:$.jsxDEV("iframe",{title:Q,src:_,loading:"lazy",style:{width:j0,height:c0,transform:`scale(${420/j0})`}},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function LF({name:_,token:Q,frame:J,onClose:q,reads:U,viewing:G=""}){let[Z,F]=r.useState(G?"world":J.since?"before":""),[X,Y]=r.useState({state:"opening"}),[K,H]=r.useState(null),L=r.useRef(new Set),z=V1(Q,`/-/${_}/branches`,U),W=z.state==="ok"?z.data.branches.filter((R)=>R.name!==G&&R.name!==K&&!L.current.has(R.name)):[],I=V1(Q,G?`/-/${_}/board`:null,U),O=I.state==="ok"?I.data.frames.find((R)=>g1(R)===g1(J)):void 0,A=V1(Q,`/-/${_}/${G?`branches/${G}/`:""}board/changes?frame=${encodeURIComponent(g1(J))}`,U),w=async(R,C,f)=>{let y=J.at;if("site"in y){let E=new URL(J.url),c=C&&/^https?:\/\/\{host\}\./.test(C)?C.replace("{host}",E.hostname.toLowerCase()):null;return c?{url:`${c}${E.pathname}${E.search}`}:{why:n4}}let N=`${l0}/-/${_}/branches/${R}/pages?${new URLSearchParams({land:`/${R}/${J.vendor}${y.screen}`}).toString()}`,k=await fetch(N,{credentials:"same-origin",redirect:"manual"}).catch(()=>null);if(f())return{why:""};return k?.type==="opaqueredirect"?{url:N}:{why:`This World does not show its branches' pages${k?`: ${await Y0(k)}`:""}.`}};r.useEffect(()=>{if(Z==="world"){if(I.state==="loading"){Y({state:"opening"});return}let E=O?Q3(_,O):null;Y(E?{state:"ok",url:E}:{state:"none",why:I.state==="error"?I.error:"The World has no page here to show."});return}if(!J.at){Y({state:"none",why:J.unseen==="branch-sites"?n4:`${B1(J.vendor)}'s twin draws no page for this ${J.kind} yet; its changes are listed below.`});return}if(Z===""){Y({state:"none",why:"Choose a branch of this World to set beside it."});return}let R=!1;if(Z!=="before"){Y({state:"opening"});let E=z.state==="ok"?z.data.branches.find((l)=>l.name===Z):void 0,c=setTimeout(()=>void w(Z,E?.sites??null,()=>R).then((l)=>{if(!R)Y("url"in l?{state:"ok",url:l.url}:{state:"none",why:l.why})}),300);return()=>{R=!0,clearTimeout(c)}}if(!J.since){Y({state:"none",why:"Nothing here has changed since the World was last cut."});return}Y({state:"opening"});let C=new Date(Date.parse(J.since)-1).toISOString(),f=null,y=setTimeout(()=>void(async()=>{let E=await y1(Q,`/-/${_}/branches`,{method:"POST",body:JSON.stringify({at:{instant:C},ttl:3600}),signal:AbortSignal.timeout(60000)}).catch(()=>null);if(!E?.ok){Y({state:"none",why:`The World made no copy of itself as it was then${E?`: ${await Y0(E)}`:""}.`});return}let c=await E.json();if(f=c.name,H(c.name),L.current.add(c.name),R){y1(Q,`/-/${_}/branches/${c.name}`,{method:"DELETE"}).catch(()=>null);return}let l=await w(c.name,c.sites??null,()=>R);if(!R)Y("url"in l?{state:"ok",url:l.url,at:C}:{state:"none",why:l.why})})(),500),N=()=>{if(f)y1(Q,`/-/${_}/branches/${f}`,{method:"DELETE",keepalive:!0}).catch(()=>null);f=null},k=(E)=>{if(!E.persisted)N()};return window.addEventListener("pagehide",k),()=>{R=!0,clearTimeout(y),window.removeEventListener("pagehide",k),N(),H(null)}},[_,Q,J.vendor,J.id,J.since,Z,I.state,JSON.stringify(O?.at)]);let B=G?RQ(_,G,J):Q3(_,J),T=!J.at||Z!==""?null:z.state==="ok"&&W.length===0?"This World has no branches to set beside it: make one under Branches.":z.state==="error"?`The World's branches could not be read: ${z.error}`:null;return $.jsxDEV("div",{className:"compare",role:"dialog","aria-label":`Changes to ${J.title}`,children:[$.jsxDEV("div",{className:"compare-head",children:[$.jsxDEV(d1,{vendor:J.vendor},void 0,!1,void 0,this),$.jsxDEV("strong",{children:J.title},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:J.changes?`${m1(J.changes,"change")} ${G?"on this branch":"not yet cut"}${J.since?`, since ${b2(J.since)}`:""}`:G?"No changes here on this branch":"No changes here not yet cut"},void 0,!1,void 0,this),J.at?$.jsxDEV("label",{className:"compare-base",children:["Compare with"," ",$.jsxDEV("select",{value:Z,onChange:(R)=>F(R.target.value),children:[Z===""?$.jsxDEV("option",{value:"",children:"Choose a branch…"},void 0,!1,void 0,this):null,G?$.jsxDEV("option",{value:"world",children:"The World"},void 0,!1,void 0,this):null,!G&&(J.since||Z==="before")?$.jsxDEV("option",{value:"before",children:"Before these changes"},void 0,!1,void 0,this):null,Z&&Z!=="before"&&Z!=="world"&&!W.some((R)=>R.name===Z)?$.jsxDEV("option",{value:Z,children:Z.split("/")[1]},void 0,!1,void 0,this):null,W.map((R)=>$.jsxDEV("option",{value:R.name,children:[R.name.split("/")[1],R.at?.label?` (${R.at.label})`:R.at?.instant?` (as of ${b2(R.at.instant)})`:R.at?.live?" (live)":""]},R.name,!0,void 0,this))]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null,$.jsxDEV("button",{type:"button",className:"ghost",onClick:q,"aria-label":"Close the comparison",children:"✕"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"compare-sides",children:[$.jsxDEV("figure",{children:[$.jsxDEV("figcaption",{children:Z==="before"?`Before${X.state==="ok"&&X.at?` · as of ${b2(X.at)}`:""}`:Z==="world"?"The World":Z?Z.split("/")[1]:"A branch"},void 0,!1,void 0,this),T?$.jsxDEV("p",{className:"mode compare-note",children:T},void 0,!1,void 0,this):X.state==="ok"?$.jsxDEV(n_,{url:X.url,title:`${J.title} before`},void 0,!1,void 0,this):X.state==="opening"?$.jsxDEV("p",{className:"mode compare-note",role:"status",children:"Opening the World as it was…"},void 0,!1,void 0,this):$.jsxDEV("p",{className:"mode compare-note",children:X.why},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("figure",{children:[$.jsxDEV("figcaption",{children:G?`${G.split("/")[1]} · branch`:"Now"},void 0,!1,void 0,this),B?$.jsxDEV(n_,{url:B,title:`${J.title} now`},void 0,!1,void 0,this):$.jsxDEV("p",{className:"mode compare-note",children:J.unseen==="branch-sites"?n4:`${B1(J.vendor)}'s twin draws no page for this ${J.kind} yet.`},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),A.state==="error"?$.jsxDEV("p",{role:"alert",className:"mode",children:["Its changes could not be read: ",A.error]},void 0,!0,void 0,this):null,Z!=="before"&&Z&&A.state==="ok"&&A.data.acts.length?$.jsxDEV("p",{className:"mode compare-acts-head",children:G?"This branch’s changes here:":"This World's own changes here, not yet cut:"},void 0,!1,void 0,this):null,$.jsxDEV("ol",{className:"compare-acts",children:(A.state==="ok"?A.data.acts:[]).map((R)=>{let C=R.entries[0],f=f0({...C,service:J.vendor,id:"",occurredAt:R.at});return $.jsxDEV("li",{children:[$.jsxDEV("span",{className:"mode",children:b2(R.at)},void 0,!1,void 0,this),$.jsxDEV("details",{children:[$.jsxDEV("summary",{children:[$.jsxDEV("strong",{children:f.what},void 0,!1,void 0,this),f.label?` · ${f.label}`:"",R.writes>1?$.jsxDEV("span",{className:"mode",children:[" and ",m1(R.writes-1,"more write")]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("ul",{children:[R.entries.map((y,N)=>$.jsxDEV("li",{children:[$.jsxDEV("code",{children:y.operation??y.op},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:[y.subject.type," ",q2(y)]},void 0,!0,void 0,this)]},N,!0,void 0,this)),R.writes>R.entries.length?$.jsxDEV("li",{className:"mode",children:["and ",m1(R.writes-R.entries.length,"more write")]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},`${R.at}:${C.subject.type}:${C.subject.id}`,!0,void 0,this)})},void 0,!1,void 0,this),A.state==="ok"&&A.data.total>A.data.acts.length?$.jsxDEV("p",{className:"mode",children:["and ",m1(A.data.total-A.data.acts.length,"earlier change"),", in Changes"]},void 0,!0,void 0,this):null,!G?$.jsxDEV("a",{className:"compare-all",href:`${T1}/${_}/~/changes`,onClick:(R)=>{R.preventDefault(),j1([..._.split("/"),"~","changes"])},children:"Every change in the World →"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}var zF={screen:KF,section:YF};function WF(_){let[Q,J]=r.useState(()=>new URLSearchParams(window.location.search).get("viewing")??"");return r.useEffect(()=>{let U=()=>J(new URLSearchParams(window.location.search).get("viewing")??"");return window.addEventListener("popstate",U),()=>window.removeEventListener("popstate",U)},[]),$.jsxDEV(F8,{children:$.jsxDEV(AF,{..._,viewing:Q,view:(U)=>{let G=new URL(window.location.href);if(U)G.searchParams.set("viewing",U);else G.searchParams.delete("viewing");window.history.pushState(null,"",G),window.dispatchEvent(new PopStateEvent("popstate"))}},void 0,!1,void 0,this)},`${_.name}:${Q}`,!1,void 0,this)}function AF({name:_,token:Q,session:J,retry:q,snapshot:U,back:G,canWrite:Z,viewing:F,view:X}){let Y=r.useRef(null),K=r.useRef(0),H=r.useRef(Promise.resolve()),L=r.useRef(0),[,z]=r.useState(0),[W,I]=r.useState({state:"loading"}),[O,A]=r.useState(null),[w,B]=r.useState(0),T=V1(Q,`/-/${_}/branches`,w),R=T.state==="ok"?T.data.branches.find((h)=>h.name===F):void 0,C=r.useRef(0),f=r.useRef(0),y=r.useCallback(async()=>{let h=L.current,s=++C.current,U1=F?`branches/${F.split("/").map(encodeURIComponent).join("/")}/board`:"board",[Z1,C1]=await Promise.all([y1(Q,`/-/${_}/${U1}`,{signal:AbortSignal.timeout(15000)}).catch(()=>null),F?y1(Q,`/-/${_}/board`,{signal:AbortSignal.timeout(15000)}).catch(()=>null):Promise.resolve(null)]),F1=Z1?.ok?await Z1.json().catch(()=>null):null,z1=F?C1?.ok?await C1.json().catch(()=>null):null:F1;if(F1&&z1)F1.boards=z1.boards,F1.version=z1.version;if(s<f.current)return;if(f.current=s,!F1?.frames||!z1?.boards||!z1.version){let A1=!Z1?.ok?Z1:C1,f1=A1?`the World answered ${A1.status}`:"the World did not answer";I((p1)=>p1.state==="ok"?p1:{state:"error",status:A1?.status??0,error:f1}),A(f1);return}if(A(null),B((A1)=>A1+1),h===L.current&&K.current===0)Y.current={boards:F1.boards,version:F1.version};I({state:"ok",data:F1})},[Q,_,F]);r.useEffect(()=>{y();let h=setInterval(()=>{if(!document.hidden)y()},1e4);return()=>clearInterval(h)},[y]);let N=W.state==="ok"?W.data.frames.map((h)=>F&&h.at&&("site"in h.at)&&!/^https?:\/\/\{host\}\./.test(R?.sites??"")?{...h,at:null,unseen:"branch-sites"}:h):[],k=Y.current?.boards??[{id:"everything",name:"Everything"}],[E,c]=r.useState(null),l=N.some((h)=>h.changes),S=E??(l?"changes":"everything"),j=(S==="changes"?k[0]:k.find((h)=>h.id===S))??k[0],[D,x]=r.useState(new Set),v=Z&&!U&&!F,m=r.useCallback((h)=>{if(!v)return Promise.resolve();if(!Y.current)return r1("The board is being read again: make that change once it shows","error"),Promise.resolve();Y.current={...Y.current,boards:h(Y.current.boards)},K.current+=1,L.current+=1,z((U1)=>U1+1);let s=H.current.then(async()=>{let U1=Y.current;if(!U1)return;try{let Z1=await y1(Q,`/-/${_}/board`,{method:"PUT",body:JSON.stringify({boards:U1.boards,version:U1.version}),signal:AbortSignal.timeout(15000)}),C1=await Z1.json().catch(()=>null);if(Z1.ok&&C1?.boards&&C1.version)Y.current={boards:K.current>1&&Y.current?Y.current.boards:C1.boards,version:C1.version};else if(Z1.status===409&&C1?.boards&&C1.version)Y.current={boards:C1.boards,version:C1.version},r1("Someone else changed the board first: it is shown as they left it","error");else throw Error(C1?.error??`the World answered ${Z1.status}`)}catch(Z1){r1(`The board was not kept: ${Z1 instanceof Error?Z1.message:String(Z1)}`,"error"),Y.current=null;let C1=await y1(Q,`/-/${_}/board`,{signal:AbortSignal.timeout(15000)}).catch(()=>null),F1=C1?.ok?await C1.json().catch(()=>null):null;if(F1?.boards&&F1.version)Y.current={boards:F1.boards,version:F1.version}}}).finally(()=>{if(K.current-=1,L.current+=1,z((U1)=>U1+1),K.current===0&&!Y.current)y()});return H.current=s,s},[Q,_,y,v]),P=(h,s)=>{m((U1)=>U1.map((Z1)=>Z1.id===h?s(Z1):Z1))},V=(h)=>h.parent?`${h.vendor}:${h.parent}`:null,b=new Set(N.map(g1)),u=(h)=>{let s=V(h);return!s||!b.has(s)},t=S==="changes"?N.filter((h)=>h.changes):j.include?o_(j,N):o_(j,N).filter((h)=>u(h)||D.has(V(h))),Q1=N.filter((h)=>h.changes&&!t.includes(h)).reduce((h,s)=>h+s.changes,0),[a,o]=r.useState(null),[p,n]=r.useState(null),[J1,G1]=r.useState(null),q1=i5(),Y1=k.filter((h)=>h.include),M1=(h,s)=>P(h,(U1)=>({...U1,include:[...U1.include??[],s]})),L1={label:j.include?"Take it off this board":"Hide it",act:(h)=>{n(null),P(j.id,(s)=>s.include?{...s,include:s.include.filter((U1)=>U1!==h)}:{...s,hidden:[...s.hidden??[],h]})}},e=(h)=>({x:h.position.x,y:h.position.y,w:h.width??h.measured?.width??j0,h:h.height??h.measured?.height??c0}),O1=(h,s)=>{let U1=e(h),Z1=U1.x+U1.w/2,C1=U1.y+U1.h/2;return s.filter((F1)=>F1.type==="section").map((F1,z1)=>({s:F1,i:z1})).filter(({s:F1})=>{let z1=e(F1);return Z1>=z1.x&&Z1<=z1.x+z1.w&&C1>=z1.y&&C1<=z1.y+z1.h}).sort((F1,z1)=>e(F1.s).w*e(F1.s).h-e(z1.s).w*e(z1.s).h||z1.i-F1.i)[0]?.s},X1=r.useCallback(()=>{let h=new Map;for(let A1 of t){let f1=j.placed?.[g1(A1)];if(f1)h.set(g1(A1),f1)}let s=Math.max(-a4,...[...h.values()].map((A1)=>A1.y+c0)),U1=[...new Set(t.map(x2))];for(let A1 of U1){let f1=t.filter((h1)=>x2(h1)===A1),p1=f1.filter((h1)=>h.has(g1(h1))).map((h1)=>h.get(g1(h1))),P1=p1.length?Math.max(...p1.map((h1)=>h1.x))+j0+a4:0,c1=p1.length?Math.min(...p1.map((h1)=>h1.y)):s+a4+w0*2+M8;for(let h1 of f1)if(!h.has(g1(h1)))h.set(g1(h1),{x:P1,y:c1}),P1+=j0+a4;s=Math.max(s,c1+c0)}let Z1=j.sections??{},C1=(A1,f1,p1,P1,c1)=>({id:`sec:${A1}`,type:"section",position:{x:f1.x,y:f1.y},width:f1.w,height:f1.h,zIndex:0,draggable:v,data:{key:A1,name:p1,vendor:P1,named:c1}}),F1=[];for(let A1 of U1){let f1=t.find((b1)=>x2(b1)===A1),p1=p2(f1).find((b1)=>Z1[b1])??A1,P1=Z1[p1];if(P1?.gone)continue;let c1=t.filter((b1)=>x2(b1)===A1).map((b1)=>h.get(g1(b1))),h1={x:Math.min(...c1.map((b1)=>b1.x))-w0,y:Math.min(...c1.map((b1)=>b1.y))-w0-M8,w:0,h:0};h1.w=Math.max(...c1.map((b1)=>b1.x))+j0+w0-h1.x,h1.h=Math.max(...c1.map((b1)=>b1.y))+c0+w0-h1.y;let L5=t.filter((b1)=>x2(b1)===A1&&!j.placed?.[g1(b1)]).map((b1)=>h.get(g1(b1))),A0=P1?{...P1}:h1;if(P1)for(let b1 of L5)A0.w=Math.max(A0.w,b1.x+j0+w0-A0.x),A0.h=Math.max(A0.h,b1.y+c0+w0-A0.y);F1.push(C1(p1,A0,P1?.name??`${B1(f1.vendor)} · ${f1.section.title}`,f1.vendor,Boolean(P1?.name)))}for(let[A1,f1]of Object.entries(Z1))if(A1.startsWith("user:")&&!f1.gone)F1.push(C1(A1,f1,f1.name??"Section",null,!0));let z1=t.map((A1)=>({id:g1(A1),type:"screen",zIndex:1,width:j0,height:c0,draggable:v,position:h.get(g1(A1)),data:{world:_,branch:Boolean(F),frame:A1,url:F?RQ(_,F,A1):Q3(_,A1)}}));return[...F1,...z1]},[JSON.stringify(t),JSON.stringify(j),_,v,F]),[D1,a1,_0]=C_([]),T0=S1((h)=>h.transform[2]),L0=r.useRef("");r.useEffect(()=>{let h=X1();if(a1(h),h.length&&L0.current!==S)L0.current=S,requestAnimationFrame(()=>{q1.fitView({padding:{top:"72px",left:"272px",right:"40px",bottom:"72px"},duration:0})})},[X1,a1]);let z0=(h,s=[],U1={})=>{let Z1=Object.fromEntries(s.map((F1)=>{let z1=q1.getNode(`sec:${F1}`);if(!z1)return[F1,void 0];let A1=e(z1),f1=z1.data,p1=U1[F1]??(f1.named?f1.name:void 0);return[F1,{x:Math.round(A1.x),y:Math.round(A1.y),w:Math.round(A1.w),h:Math.round(A1.h),...p1?{name:p1.slice(0,80)}:{}}]}).filter(([,F1])=>F1!==void 0)),C1=Object.fromEntries(Object.entries(h).map(([F1,z1])=>[F1,{x:Math.round(z1.x),y:Math.round(z1.y)}]));P(j.id,(F1)=>({...F1,placed:{...F1.placed??{},...C1},sections:{...F1.sections??{},...Z1}}))},t1=r.useRef(null),Z0=(h,s)=>{if(s.type!=="section"){t1.current=null;return}let U1=q1.getNodes(),Z1=e(s),C1=(F1)=>{let z1=e(F1);if(F1.type==="screen"){let A1=z1.x+z1.w/2,f1=z1.y+z1.h/2;return A1>=Z1.x&&A1<=Z1.x+Z1.w&&f1>=Z1.y&&f1<=Z1.y+Z1.h}return F1.id!==s.id&&z1.x>=Z1.x&&z1.y>=Z1.y&&z1.x+z1.w<=Z1.x+Z1.w&&z1.y+z1.h<=Z1.y+Z1.h};t1.current={id:s.id,from:{...s.position},members:U1.filter(C1).map((F1)=>({id:F1.id,x:F1.position.x,y:F1.position.y}))}},F0=(h,s)=>{let U1=t1.current;if(!U1||U1.id!==s.id)return;let Z1=s.position.x-U1.from.x,C1=s.position.y-U1.from.y,F1=new Map(U1.members.map((z1)=>[z1.id,z1]));a1((z1)=>z1.map((A1)=>{let f1=F1.get(A1.id);return f1?{...A1,position:{x:f1.x+Z1,y:f1.y+C1}}:A1}))},W0=(h,s)=>{let U1=t1.current;t1.current=null;let Z1=s.position.x-(U1?.from.x??s.position.x),C1=s.position.y-(U1?.from.y??s.position.y),F1=s.type==="screen"?[{id:s.id,x:s.position.x,y:s.position.y}]:(U1?.members??[]).map((z1)=>({...z1,x:z1.x+Z1,y:z1.y+C1}));requestAnimationFrame(()=>{let z1=q1.getNodes(),A1=new Map(F1.filter((P1)=>!P1.id.startsWith("sec:")).map((P1)=>[P1.id,{x:P1.x,y:P1.y}])),f1=new Set([...s.type==="section"?[s.data.key]:[],...F1.filter((P1)=>P1.id.startsWith("sec:")).map((P1)=>P1.id.slice(4))]),p1=new Set(z1.filter((P1)=>A1.has(P1.id)).flatMap((P1)=>p2(P1.data.frame)));for(let P1 of z1){if(P1.type==="screen"&&p2(P1.data.frame).some((c1)=>p1.has(c1))&&!A1.has(P1.id))A1.set(P1.id,{x:P1.position.x,y:P1.position.y});if(P1.type==="section"&&p1.has(P1.data.key))f1.add(P1.data.key)}z0(Object.fromEntries(A1),[...f1])})},r0=(h)=>Object.fromEntries(q1.getNodes().filter((s)=>s.type==="screen"&&p2(s.data.frame).includes(h)).map((s)=>[s.id,{x:s.position.x,y:s.position.y}])),[C0,S0]=r.useState(null),i0=(h)=>{n(`sec:${h}`),S0(h)},B2=(h,s)=>{if(S0(null),!s)return;a1((U1)=>U1.map((Z1)=>Z1.id===`sec:${h}`?{...Z1,data:{...Z1.data,name:s,named:!0}}:Z1)),requestAnimationFrame(()=>z0(r0(h),[h],{[h]:s}))},M2=(h)=>{n(null);let s=q1.getNode(`sec:${h}`);P(j.id,(U1)=>{let Z1=Object.fromEntries(Object.entries(U1.sections??{}).filter(([C1])=>C1!==h));return{...U1,sections:h.startsWith("user:")?Z1:{...Z1,[h]:{...s?{x:Math.round(s.position.x),y:Math.round(s.position.y),w:Math.round(e(s).w),h:Math.round(e(s).h)}:{x:0,y:0,w:0,h:0},gone:!0}}}})},u0=()=>{let h=p?q1.getNode(p):void 0,s=q1.screenToFlowPosition({x:window.innerWidth/2,y:window.innerHeight/2}),U1=h?.type==="screen"?{x:h.position.x-w0,y:h.position.y-w0,w:j0+w0*2,h:c0+w0*2}:{x:s.x-900,y:s.y-600,w:1800,h:1200},Z1=`user:${Date.now().toString(36)}`,C1=Object.keys(j.sections??{}).filter((F1)=>F1.startsWith("user:")).length+1;n(`sec:${Z1}`),P(j.id,(F1)=>({...F1,sections:{...F1.sections??{},[Z1]:{x:Math.round(U1.x),y:Math.round(U1.y),w:Math.round(U1.w),h:Math.round(U1.h),name:`Section ${C1}`}}}))},M=(h)=>(s)=>{if(!v||s.button!==0)return;let U1=q1.getNode(h);if(!U1)return;let Z1=s.currentTarget;Z1.setPointerCapture(s.pointerId);let{clientX:C1,clientY:F1}=s,z1={...U1.position},A1=!1,f1=(c1)=>{let h1=q1.getZoom();return{...U1,position:{x:z1.x+(c1.clientX-C1)/h1,y:z1.y+(c1.clientY-F1)/h1}}},p1=(c1)=>{if(!A1&&Math.hypot(c1.clientX-C1,c1.clientY-F1)<4)return;if(!A1)A1=!0,Z0(null,U1);let h1=f1(c1);a1((L5)=>L5.map((A0)=>A0.id===h?{...A0,position:h1.position}:A0)),F0(null,h1)},P1=(c1)=>{if(Z1.removeEventListener("pointermove",p1),Z1.removeEventListener("pointerup",P1),Z1.removeEventListener("pointercancel",P1),A1)W0(null,f1(c1)),Z1.addEventListener("click",(h1)=>{h1.stopPropagation(),h1.preventDefault()},{capture:!0,once:!0});else if(U1.type==="screen")n(h)};Z1.addEventListener("pointermove",p1),Z1.addEventListener("pointerup",P1),Z1.addEventListener("pointercancel",P1)},g=D1.map((h)=>h.type==="section"?{...h,data:{...h.data,grab:M(h.id),picked:p===h.id,editable:v,renaming:v&&C0===h.data.key,pick:(s)=>n(`sec:${s}`),rename:i0,renamed:B2,remove:M2,resized:()=>requestAnimationFrame(()=>{let s=h.data.key;z0(r0(s),[s])})}}:{...h,data:{...h.data,grab:M(h.id),active:a===h.id,picked:p===h.id,boards:v?Y1:[],addTo:M1,remove:!v||j.include&&!j.include.includes(h.id)?null:L1,compare:(s)=>{n(s),G1(s)}}});r.useEffect(()=>{let h=(s)=>{if(s.target?.closest("input, textarea, select, [contenteditable]"))return;if(s.key==="Escape"){if(a)o(null);else n(null);return}if(!v||a)return;if((s.key==="Delete"||s.key==="Backspace")&&p){if(s.preventDefault(),p.startsWith("sec:"))M2(p.slice(4));else if(!j.include||j.include.includes(p))L1.act(p);else r1("It is on this board with its whole group: take the group off in the list to remove it","error");return}if(s.key==="S"&&s.shiftKey&&!s.metaKey&&!s.ctrlKey)s.preventDefault(),u0()};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)});let _1=(h)=>{n(h);let s=q1.getNode(h);if(!s)return;let U1=e(s);q1.fitBounds({x:U1.x,y:U1.y,width:U1.w,height:U1.h},{padding:0.15,duration:400})},$1=()=>{let h=`board-${Date.now().toString(36)}`;c(h),m((s)=>[...s,{id:h,name:`Board ${s.length}`,include:[]}])},K1=()=>S0(`board:${j.id}`),w1=()=>{let h=j.id;c(null),m((s)=>s.filter((U1)=>U1.id!==h))},R1=[...new Map(N.map((h)=>[x2(h),h])).values()],v1=j.include?[...R1.filter((h)=>!p2(h).some((s)=>j.include.includes(s))).map((h)=>({key:x2(h),label:`${B1(h.vendor)} · ${h.section.title} (all)`})),...N.filter((h)=>!t.includes(h)).map((h)=>({key:g1(h),label:h.title}))]:[],I1=j.include?[]:N.filter((h)=>(j.hidden??[]).includes(g1(h))),R0=D1.filter((h)=>h.type==="section"),O0=D1.filter((h)=>h.type==="screen"),r2=new Map(O0.map((h)=>[h.id,O1(h,D1)?.id??null])),G2=new Map;for(let h of N){let s=V(h);if(s&&b.has(s))G2.set(s,(G2.get(s)??0)+1)}let _4=(h)=>{let s=h.data.frame;return $.jsxDEV("li",{children:[$.jsxDEV("button",{type:"button",className:p===h.id?"on":void 0,onClick:()=>_1(h.id),onDoubleClick:()=>o(h.id),children:[$.jsxDEV(d1,{vendor:s.vendor},void 0,!1,void 0,this),$.jsxDEV("span",{children:s.title},void 0,!1,void 0,this),s.changes?$.jsxDEV("span",{className:"layer-changed",title:`${m1(s.changes,"change")} ${F?"on this branch":"not in a changeset"}: its mark on the board opens a comparison`,children:[$.jsxDEV(N1,{name:"square-dot",size:14},void 0,!1,void 0,this),s.changes]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),G2.get(h.id)&&S!=="changes"&&!j.include?$.jsxDEV("button",{type:"button",className:"ghost layer-open","aria-expanded":D.has(h.id),onClick:()=>x((U1)=>{let Z1=new Set(U1);if(Z1.has(h.id))Z1.delete(h.id);else Z1.add(h.id);return Z1}),title:D.has(h.id)?"Close the pages under it":"Open the pages under it",children:[D.has(h.id)?"−":"+",G2.get(h.id)]},void 0,!0,void 0,this):null]},h.id,!0,void 0,this)},$3=typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches,q3=J.state==="ok"&&W.state==="ok";return $.jsxDEV("div",{className:"canvas full",role:"region","aria-label":"The World's board",style:{"--zoom":T0},children:$.jsxDEV(f_,{nodes:q3?g:[],onNodesChange:_0,nodeTypes:zF,onNodeDragStart:Z0,onNodeDrag:F0,onNodeDragStop:W0,onNodeClick:(h,s)=>{if(s.id!==a)n(s.id)},onNodeDoubleClick:(h,s)=>{if(s.type==="screen")n(s.id),o(s.id)},onPaneClick:()=>{o(null),n(null)},minZoom:0.03,maxZoom:1.5,nodesConnectable:!1,elementsSelectable:!1,panOnScroll:!0,zoomOnPinch:!0,zoomOnScroll:!1,zoomOnDoubleClick:!1,colorMode:$3?"dark":"light",proOptions:{hideAttribution:!0},children:[$.jsxDEV(y_,{variant:m0.Dots,gap:28*2**Math.max(0,Math.ceil(Math.log2(16/(28*T0)))),size:2/T0},void 0,!1,void 0,this),$.jsxDEV(g0,{position:"top-left",className:"float layers",children:[$.jsxDEV("div",{className:"float-head",children:[$.jsxDEV("button",{type:"button",className:"back",onClick:G,"aria-label":`Back to ${_}`,children:"←"},void 0,!1,void 0,this),$.jsxDEV("span",{className:"float-title",children:[$.jsxDEV("strong",{children:(F||_).split("/")[1]},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:[_.split("/")[0],F?" · branch":U?" · snapshot":""]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("label",{className:"compare-base board-viewing",children:["Viewing",$.jsxDEV("select",{value:F,disabled:K.current>0,onChange:(h)=>X(h.target.value),children:[$.jsxDEV("option",{value:"",children:"The World"},void 0,!1,void 0,this),F&&!R?$.jsxDEV("option",{value:F,children:[F," · branch"]},void 0,!0,void 0,this):null,(T.state==="ok"?T.data.branches:[]).map((h)=>$.jsxDEV("option",{value:h.name,children:[h.name.split("/")[1]," · branch"]},h.name,!0,void 0,this))]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),T.state==="error"&&T.status!==404?$.jsxDEV("p",{className:"mode",role:"alert",children:["Branches could not be read: ",T.error]},void 0,!0,void 0,this):null,$.jsxDEV("div",{className:"board-tabs",role:"tablist","aria-label":"Boards",children:[$.jsxDEV("button",{type:"button",role:"tab","aria-selected":S==="changes",className:S==="changes"?"on":void 0,onClick:()=>{n(null),o(null),c("changes")},title:F?"The pages whose records changed on this branch":"The pages whose records changed and are not yet in a changeset",children:["Changes",l?` (${N.filter((h)=>h.changes).length})`:""]},void 0,!0,void 0,this),k.map((h)=>C0===`board:${h.id}`?$.jsxDEV(OQ,{name:h.name,label:"Name this board",done:(s)=>{if(S0(null),s)P(h.id,(U1)=>({...U1,name:s}))}},h.id,!1,void 0,this):$.jsxDEV("button",{type:"button",role:"tab","aria-selected":S!=="changes"&&h.id===j.id,className:S!=="changes"&&h.id===j.id?"on":void 0,onClick:()=>{n(null),o(null),c(h.id)},onDoubleClick:v&&h.id===j.id&&h.include?K1:void 0,children:h.name},h.id,!1,void 0,this)),v?$.jsxDEV("button",{type:"button",className:"ghost",onClick:$1,"aria-label":"A new board",children:"+"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),j.include&&v?$.jsxDEV("div",{className:"board-acts",children:[$.jsxDEV("button",{type:"button",className:"ghost",onClick:K1,children:"Rename"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",className:"ghost",onClick:w1,children:"Delete board"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,$.jsxDEV("ul",{className:"layer-list","aria-label":"Layers",children:[R0.map((h)=>{let s=h.data;return $.jsxDEV("li",{children:[$.jsxDEV("button",{type:"button",className:p===h.id?"layer-section on":"layer-section",onClick:()=>_1(h.id),onDoubleClick:()=>{if(v)_1(h.id),i0(s.key)},children:[s.vendor?$.jsxDEV(d1,{vendor:s.vendor},void 0,!1,void 0,this):$.jsxDEV(N1,{name:"layout-grid",size:14},void 0,!1,void 0,this),$.jsxDEV("span",{children:s.name},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("ul",{className:"layer-list inner",children:O0.filter((U1)=>r2.get(U1.id)===h.id).map(_4)},void 0,!1,void 0,this)]},h.id,!0,void 0,this)}),O0.filter((h)=>!r2.get(h.id)).map(_4)]},void 0,!0,void 0,this),j.include&&!t.length?$.jsxDEV("p",{className:"mode pad-s",children:"An empty board: add frames from Everything, or below."},void 0,!1,void 0,this):null,v1.length&&v?$.jsxDEV("select",{className:"board-add",value:"","aria-label":"Add to this board",onChange:(h)=>{let s=h.target.value;if(s)P(j.id,(U1)=>({...U1,include:[...U1.include??[],s]}))},children:[$.jsxDEV("option",{value:"",children:"Add to this board…"},void 0,!1,void 0,this),v1.map((h)=>$.jsxDEV("option",{value:h.key,children:h.label},h.key,!1,void 0,this))]},void 0,!0,void 0,this):null,I1.length?$.jsxDEV("details",{className:"board-hidden",children:[$.jsxDEV("summary",{children:["Hidden (",I1.length,")"]},void 0,!0,void 0,this),$.jsxDEV("ul",{className:"layer-list",children:I1.map((h)=>$.jsxDEV("li",{children:v?$.jsxDEV("button",{type:"button",onClick:()=>P(j.id,(s)=>({...s,hidden:(s.hidden??[]).filter((U1)=>U1!==g1(h))})),children:[$.jsxDEV("span",{children:h.title},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:"Show"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):$.jsxDEV("span",{className:"pad-s",children:h.title},void 0,!1,void 0,this)},g1(h),!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,Q1?$.jsxDEV("button",{type:"button",className:"board-elsewhere",onClick:()=>c("changes"),children:[$.jsxDEV(N1,{name:"square-dot",size:14},void 0,!1,void 0,this),m1(Q1,"change")," not on this board"]},void 0,!0,void 0,this):null,$.jsxDEV(U0,{load:W,what:"the board"},void 0,!1,void 0,this),O&&W.state==="ok"?$.jsxDEV("p",{role:"alert",className:"pad-s",children:["The board could not be read again (",O,"): it shows what was last read."]},void 0,!0,void 0,this):null,J.state==="pending"?$.jsxDEV("p",{className:"mode",role:"status",children:"Opening…"},void 0,!1,void 0,this):null,J.state==="error"?$.jsxDEV("p",{role:"alert",children:["The World did not open its screens: ",J.error," ",$.jsxDEV("button",{type:"button",onClick:q,children:"Try again"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),a?$.jsxDEV(g0,{position:"top-center",className:"float hint using",children:[$.jsxDEV("span",{className:"mode",children:["Using ",t.find((h)=>g1(h)===a)?.title??a]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"button",onClick:()=>o(null),children:["Done ",$.jsxDEV("kbd",{children:"Esc"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):$.jsxDEV(g0,{position:"top-center",className:"float hint mode",children:"Scroll to pan · pinch or ⌘ scroll to zoom · double-click a frame to use it"},void 0,!1,void 0,this),v?$.jsxDEV(g0,{position:"bottom-center",className:"float board-tools",children:$.jsxDEV("button",{type:"button",className:"ghost",onClick:u0,title:"Section (⇧S): around the selected frame, else in the middle",children:[$.jsxDEV(N1,{name:"layout-grid",size:16},void 0,!1,void 0,this),$.jsxDEV("span",{children:"Section"},void 0,!1,void 0,this),$.jsxDEV("kbd",{children:"⇧S"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this):null,J1&&t.some((h)=>g1(h)===J1)?$.jsxDEV(g0,{position:"top-right",className:"float compare-panel",children:$.jsxDEV(LF,{viewing:F,name:_,token:Q,frame:t.find((h)=>g1(h)===J1),onClose:()=>G1(null),reads:w},J1,!1,void 0,this)},void 0,!1,void 0,this):null,$.jsxDEV(v_,{showInteractive:!1,position:"bottom-left"},void 0,!1,void 0,this),$.jsxDEV(V_,{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 IQ=(_)=>_.actions.map((Q)=>({twin:Q.service,entry:{...Q.action,service:Q.service,op:Q.action.op??Q.action.operation??""}})),BF=(_)=>{let Q=_.action.input??{};return!(typeof Q.operationId==="string"||Q.graphql!==void 0&&Q.graphql!==null)};function J3(_){let Q=_.actions.filter(BF).length,J=_.actions.length-Q,q=_.applied?.receipts??[],U=_.deployed??[],G=new Set([...U.filter((X)=>X.status==="deployed"),...q.filter((X)=>X.status==="confirmed")].map((X)=>X.actionId)).size,Z=new Set([...U.filter((X)=>X.status==="refused"||X.status==="failed"),...q.filter((X)=>X.status==="failed")].map((X)=>X.actionId)).size,F={performed:G,failed:Z,total:J,own:Q};if(J>0&&G>=J)return{label:"Deployed",tone:"done",...F};if(G>0)return{label:`Partly deployed: ${G} of ${J}`,tone:"warn",...F};if(Z>0)return{label:`${Z} refused or failed`,tone:"bad",...F};if(q.some((X)=>X.status==="replayed")&&q.every((X)=>X.status==="replayed"||X.status==="skipped"))return{label:"Pushed",tone:"good",...F};return{label:"Not sent",tone:"plain",...F}}var B8=(_)=>_.message??_.narration?.split(`
37
+ `)[0]?.replace(/ setting .*$/,"")??_.name;function PQ(_,Q=1){let J=_.currentHash??_.contentHash,q=_.readiness?.approvers??new Set(_.approvals.filter((G)=>G.contentHash===J).map((G)=>G.principal)).size,U=_.verification&&_.verification.contentHash===J?_.verification:null;if(U&&!U.passed)return{label:"Checks failed",tone:"bad"};if(q>0&&q<Q)return{label:`Approved by ${q} of ${Q}`,tone:"plain"};if(q>0)return{label:`Approved by ${q}`,tone:"good"};if(U)return{label:"Verified",tone:"good"};return{label:"Not verified",tone:"plain"}}function e_({name:_,token:Q,signsAs:J,c:q,canWrite:U,rooted:G,refused:Z,onChanged:F,part:X,required:Y}){let K=X==="head",H=X==="review",[L,z]=r.useState(null),[W,I]=r.useState(!1),[O,A]=r.useState(""),[w,B]=r.useState(""),[T,R]=r.useState(null),C=V1(Q,`/-/${_}/origin`),f=J3(q),y=PQ(q,Y),N=IQ(q),k=[...new Set(N.map((u)=>u.twin))],E=k.some((u)=>G.includes(u)),c=(u)=>u===(q.currentHash??q.contentHash),l=q.applied?.receipts??[],S=(q.deployed??[]).filter((u)=>u.status!=="landed"),j=l.filter((u)=>u.status==="confirmed").length,D=S.filter((u)=>u.status==="deployed"),x=async(u,t,Q1,a)=>{z(u),R(null);try{let o=await y1(Q,t,{method:"POST",...Q1===void 0?{}:{body:JSON.stringify(Q1)}});if(!o.ok)return Z(o),R({what:u,...s1(await _2(o))}),!1;if(a)r1(a);return F(),!0}catch(o){return R({what:u,text:`the World did not answer (${o instanceof Error?o.message:String(o)})`,acts:[]}),!1}finally{z(null)}},v=()=>{x("Verify",`/-/${_}/changesets/${q.name}/verify`,void 0,"Verified: the checks ran over it")},m=async(u)=>{if(u.preventDefault(),await x("Approve",`/-/${_}/changesets/${q.name}/approve`,{...O.trim()?{note:O.trim()}:{},...J===null&&w.trim()?{as:w.trim()}:{}},"Approved"))I(!1),A("")},P=async()=>{let u=k.filter((t)=>G.includes(t));if(!await p0({title:`Deploy ${q.name} to the real vendors?`,body:$.jsxDEV($.Fragment,{children:["It performs its ",q.actions.length," change",q.actions.length===1?"":"s"," against the real account",u.length===1?"":"s"," behind ",E2(u.map(B1)),". This cannot be taken back here."]},void 0,!0,void 0,this),action:"Deploy",danger:!0,typed:q.name}))return;z("Deploy"),R(null);try{let t=await y1(Q,`/-/${_}/deploy/${q.name}`,{method:"POST",body:JSON.stringify({confirm:q.name})});if(!t.ok){Z(t),R({what:"Deploy",...s1(await _2(t))});return}let Q1=await y1(Q,`/-/${_}/changesets/${q.name}`),a=Q1.ok?await Q1.json():null;if(!a){r1("Deploy: sent; reading its receipts failed","info"),F();return}let o=J3(a);r1(`Deploy: ${o.performed} of ${o.total} change${o.total===1?"":"s"} performed at the vendor${o.failed?`; ${o.failed} refused or failed`:""}`,o.failed?"error":o.performed?"ok":"info"),F()}catch(t){R({what:"Deploy",text:`the World did not answer (${t instanceof Error?t.message:String(t)})`,acts:[]})}finally{z(null)}},V=!U?"This session reads the World; it changes nothing":f.label==="Deployed"?"Already deployed: every change was performed at the vendor":null,b=C.state==="ok"&&C.data.origin?N8(C.data.origin):null;return $.jsxDEV("div",{className:"changeset","aria-labelledby":"changeset-title",children:[K?$.jsxDEV($.Fragment,{children:[$.jsxDEV("div",{className:"changeset-head",children:[$.jsxDEV("div",{children:[$.jsxDEV("h3",{id:"changeset-title",children:[q.message??q.name," ",$.jsxDEV("span",{className:`badge cs-${f.tone}`,children:f.label},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:`badge cs-${y.tone}`,children:y.label},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("p",{className:"mode",children:[$.jsxDEV("code",{children:q.name},void 0,!1,void 0,this)," · made ",$.jsxDEV(u1,{iso:q.createdAt},void 0,!1,void 0,this)," · ",q.actions.length," change",q.actions.length===1?"":"s"," at ",E2(k.map(B1))||"no vendor"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"changeset-actions",children:[$.jsxDEV("button",{type:"button",onClick:v,disabled:Boolean(V)||L!==null,title:V??"Replay it in a throwaway World and run the World's checks",children:L==="Verify"?"Verifying…":"Verify"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",onClick:()=>I(!0),disabled:Boolean(V)||L!==null,title:V??"Sign its current contents as yourself",children:"Approve…"},void 0,!1,void 0,this),E?$.jsxDEV("button",{type:"button",className:"primary",onClick:()=>void P(),disabled:Boolean(V)||L!==null,title:V??"Perform it against the real accounts behind this World",children:L==="Deploy"?"Deploying…":"Deploy…"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),V&&f.label!=="Deployed"?$.jsxDEV("p",{className:"mode",children:[V,"."]},void 0,!0,void 0,this):null,T?$.jsxDEV("div",{role:"alert",className:"refusal",children:[$.jsxDEV("span",{children:[$.jsxDEV("b",{children:T.what},void 0,!1,void 0,this),": ",T.text]},void 0,!0,void 0,this),T.acts.includes("verify")&&U?$.jsxDEV("button",{type:"button",onClick:v,disabled:L!==null,children:"Verify"},void 0,!1,void 0,this):null,T.acts.includes("approve")&&U?$.jsxDEV("button",{type:"button",onClick:()=>I(!0),disabled:L!==null,children:"Approve…"},void 0,!1,void 0,this):null,$.jsxDEV(qQ,{name:_,acts:T.acts},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this):null,H?$.jsxDEV($.Fragment,{children:[q.narration?$.jsxDEV("p",{className:"narration",children:q.narration},void 0,!1,void 0,this):null,$.jsxDEV("h4",{children:"Where it went"},void 0,!1,void 0,this),$.jsxDEV("div",{className:"block where",children:[f.performed>0?$.jsxDEV("p",{className:"pad",children:[f.performed>=f.total?"Deployed":"Partly deployed",": ",f.performed," of ",f.total," change",f.total===1?"":"s",f.own?` (and ${f.own} of the World's own, which stay in it)`:""," performed at ",E2([...new Set([...D.map((u)=>u.service),...l.filter((u)=>u.status==="confirmed").map((u)=>u.service)].map(B1))]),D.length?` (${D.length} from here`:" (",D.length&&j?", ":"",j?`${j} by the remote`:"",")."]},void 0,!0,void 0,this):f.label==="Pushed"?$.jsxDEV("p",{className:"pad",children:["Pushed to the remote",b?$.jsxDEV($.Fragment,{children:[" ",$.jsxDEV("code",{children:b},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,q.applied?$.jsxDEV($.Fragment,{children:[" · ",$.jsxDEV(u1,{iso:q.applied.at},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,": every change was replayed there. No vendor has performed any of it."]},void 0,!0,void 0,this):f.failed===0?$.jsxDEV("p",{className:"pad",children:["Not sent: it is only in this World.",q.applied?.outcome==="refused"?" A push was refused (below); Push sends it again.":$.jsxDEV($.Fragment,{children:[" Push sends it to the remote World",E?"; Deploy, to the real vendors behind it":"","."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null,f.failed>0?$.jsxDEV("p",{className:"pad failed",role:"alert",children:[f.failed," change",f.failed===1?" was":"s were"," refused or failed at the vendor",[...S.filter((u)=>u.reason&&(u.status==="refused"||u.status==="failed")).map((u)=>u.reason),...l.filter((u)=>u.status==="failed"&&u.error).map((u)=>u.error)].slice(0,3).map((u)=>`: ${s1(u).text}`).join(""),"."]},void 0,!0,void 0,this):null,q.applied?.refusal?.length?$.jsxDEV("ul",{className:"checks pad",children:q.applied.refusal.map((u,t)=>$.jsxDEV("li",{className:"mode",children:s1(u).text},t,!1,void 0,this))},void 0,!1,void 0,this):null,S.length?$.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"pad where-sub mode",children:"At the vendor"},void 0,!1,void 0,this),$.jsxDEV("ul",{className:"receipts pad",children:S.map((u)=>$.jsxDEV("li",{children:[$.jsxDEV("span",{className:u.status==="refused"||u.status==="failed"?"badge cs-bad":u.status==="deployed"?"badge cs-done":"badge",children:u.status},void 0,!1,void 0,this)," ",B1(u.service)," ",u.status==="deployed"?u.url?$.jsxDEV("a",{href:u.url,target:"_blank",rel:"noopener noreferrer",children:u.externalId??u.url},void 0,!1,void 0,this):u.externalId?$.jsxDEV("code",{children:u.externalId},void 0,!1,void 0,this):null:null,u.reason?$.jsxDEV("span",{className:"mode",children:[" · ",s1(u.reason).text]},void 0,!0,void 0,this):null," ",$.jsxDEV("span",{className:"mode",children:["· ",$.jsxDEV(u1,{iso:u.at},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},`v:${u.actionId}`,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,l.length?$.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"pad where-sub mode",children:"At the remote"},void 0,!1,void 0,this),$.jsxDEV("ul",{className:"receipts pad",children:l.map((u)=>$.jsxDEV("li",{children:[$.jsxDEV("span",{className:u.status==="failed"?"badge cs-bad":u.status==="confirmed"?"badge cs-done":"badge",children:u.status},void 0,!1,void 0,this)," ",B1(u.service)," ",$.jsxDEV("span",{className:"mode",children:u.status==="replayed"?"replayed at the remote World":u.status==="confirmed"?"performed at the vendor by the remote":""},void 0,!1,void 0,this),u.status==="confirmed"&&u.externalId?$.jsxDEV($.Fragment,{children:[" ",$.jsxDEV("code",{children:u.externalId},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,u.error?$.jsxDEV("span",{className:"mode",children:[" · ",s1(u.error).text]},void 0,!0,void 0,this):null]},`r:${u.actionId}`,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),!E&&f.label!=="Deployed"?$.jsxDEV("p",{className:"mode",children:["No vendor it changes is connected to its real service here, so it does not deploy from this World. ",$.jsxDEV("a",{href:`${T1}/${_}/~/settings/services`,onClick:(u)=>{u.preventDefault(),j1([..._.split("/"),"~","settings","services"])},children:"Connect a vendor in Settings › Real services"},void 0,!1,void 0,this)," to deploy."]},void 0,!0,void 0,this):null,$.jsxDEV("h4",{children:"Checks"},void 0,!1,void 0,this),!q.verification?$.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):$.jsxDEV("div",{className:c(q.verification.contentHash)?"":"stale",children:[$.jsxDEV("p",{children:[q.verification.passed?"✓ Passed":"✗ Failed"," · ",$.jsxDEV(u1,{iso:q.verification.at},void 0,!1,void 0,this),c(q.verification.contentHash)?null:$.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),q.verification.results.length?$.jsxDEV("ul",{className:"checks",children:q.verification.results.map((u)=>$.jsxDEV("li",{children:[u.passed?"✓":"✗"," ",$.jsxDEV("code",{children:u.id},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:B1(u.service)},void 0,!1,void 0,this)]},u.id,!0,void 0,this))},void 0,!1,void 0,this):null,q.verification.refusals?.length?$.jsxDEV("ul",{className:"checks",children:q.verification.refusals.map((u,t)=>$.jsxDEV("li",{children:["✗ ",$.jsxDEV("code",{children:u.check},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:[B1(u.service),": ",u.reason]},void 0,!0,void 0,this)]},t,!0,void 0,this))},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("h4",{children:"Approvals"},void 0,!1,void 0,this),q.approvals.length===0?$.jsxDEV("p",{className:"mode",children:"No one has approved it."},void 0,!1,void 0,this):$.jsxDEV("ul",{className:"approvals",children:q.approvals.map((u,t)=>$.jsxDEV("li",{children:[$.jsxDEV("b",{children:u.principal},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:[$.jsxDEV(u1,{iso:u.at},void 0,!1,void 0,this),c(u.contentHash)?"":" · signed an earlier version"]},void 0,!0,void 0,this),u.note?$.jsxDEV("div",{className:"mode",children:["“",u.note,"”"]},void 0,!0,void 0,this):null]},t,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,$.jsxDEV(M0,{open:W,onClose:()=>{if(!L)I(!1)},title:`Approve ${q.name}`,footer:$.jsxDEV($.Fragment,{children:[$.jsxDEV("button",{type:"button",onClick:()=>I(!1),disabled:L!==null,children:"Cancel"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"submit",form:"approve-changeset",className:"primary",disabled:L!==null,children:L==="Approve"?"Approving…":"Approve"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:$.jsxDEV("form",{id:"approve-changeset",onSubmit:(u)=>void m(u),className:"stack",children:[$.jsxDEV("p",{className:"mode",children:["You sign its contents as they stand now",J?$.jsxDEV($.Fragment,{children:[", recorded as ",$.jsxDEV("b",{children:J},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),J===null?$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"Approving as"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"approveAs",value:w,onChange:(u)=>B(u.target.value),maxLength:80,required:!0,placeholder:"your name or email",autoComplete:"off"},void 0,!1,void 0,this),$.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,$.jsxDEV("label",{children:[$.jsxDEV("span",{children:["Note ",$.jsxDEV("span",{className:"mode",children:"(optional)"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("textarea",{name:"approveNote",value:O,onChange:(u)=>A(u.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)}var NQ=(_,Q)=>JSON.stringify(_)===JSON.stringify(Q);function MF({changes:_,idPrefix:Q}){let J=[...new Set(_.map((q)=>q.twin))];return $.jsxDEV($.Fragment,{children:J.map((q)=>{let U=_.filter((Z)=>Z.twin===q).map((Z)=>Z.entry),G=[...new Set(U.map((Z)=>`${Z.subject.type}:${Z.subject.id}`))];return $.jsxDEV("div",{className:"compare",role:"group","aria-labelledby":`${Q}-${q}`,children:[$.jsxDEV("h3",{id:`${Q}-${q}`,className:"vendor-cell",children:[$.jsxDEV(d1,{vendor:q},void 0,!1,void 0,this),B1(q)," ",$.jsxDEV("span",{className:"mode",children:["· ",m1(G.length,"record"),", ",m1(U.length,"write")]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("ul",{children:G.map((Z)=>{let F=U.filter((H)=>`${H.subject.type}:${H.subject.id}`===Z),X=F[F.length-1],Y=f0(X),K={};return $.jsxDEV("li",{className:"record",children:[$.jsxDEV("p",{className:"record-head",children:[$.jsxDEV("span",{className:"kind",children:X.subject.type.replace(/^_+/,"").replace(/[_-]+/g," ")},void 0,!1,void 0,this)," ",Y.label?$.jsxDEV("span",{className:"label",children:["“",Y.label,"”"]},void 0,!0,void 0,this):null," ",$.jsxDEV("code",{children:q2(X)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.map((H)=>{let L=H.fields??{},z=Object.entries(L).filter(([I,O])=>!(I in K)||!NQ(K[I],O)),W=K;return K={...K,...L},$.jsxDEV("div",{className:"write",children:[$.jsxDEV("p",{className:"mode",children:[$.jsxDEV("span",{className:"op",children:f0(H).what},void 0,!1,void 0,this)," · ",$.jsxDEV(u1,{iso:H.occurredAt},void 0,!1,void 0,this)," · ",t5(H)]},void 0,!0,void 0,this),z.length===0?$.jsxDEV("p",{className:"mode",children:"It set no field to a new value."},void 0,!1,void 0,this):$.jsxDEV("dl",{className:"fields field-diff","aria-label":`Fields ${f0(H).what} set`,children:z.map(([I,O])=>$.jsxDEV(r.default.Fragment,{children:[$.jsxDEV("dt",{children:I},void 0,!1,void 0,this),$.jsxDEV("dd",{children:I in W?$.jsxDEV("span",{className:"changed",children:[$.jsxDEV("del",{children:$.jsxDEV(U2,{v:W[I]},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("span",{className:"arrow","aria-label":"becomes",children:"→"},void 0,!1,void 0,this),$.jsxDEV("ins",{children:$.jsxDEV(U2,{v:O},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):$.jsxDEV(U2,{v:O},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},I,!0,void 0,this))},void 0,!1,void 0,this)]},H.id,!0,void 0,this)})]},Z,!0,void 0,this)})},void 0,!1,void 0,this)]},q,!0,void 0,this)})},void 0,!1,void 0,this)}function TF({name:_,token:Q,changes:J,canWrite:q,refused:U,onCut:G,pinned:Z,generated:F,inputRef:X,author:Y}){let[K,H]=r.useState(""),[L,z]=r.useState(!1),[W,I]=r.useState([]),O=(w,B,T)=>{I((R)=>[{ok:w,text:B,at:new Date().toISOString(),n:++e5,...T?.length?{acts:T}:{}},...R].slice(0,4))},A=async(w)=>{w.preventDefault(),z(!0);try{let B=await y1(Q,`/-/${_}/changesets`,{method:"POST",body:JSON.stringify(K.trim()?{message:K.trim()}:{})});if(!B.ok){U(B);let R=s1(await _2(B));O(!1,`Cut a changeset: ${R.text}`,R.acts);return}let T=await B.json();O(!0,`Cut ${T.name??"a changeset"}: ${m1(T.actions?.length??0,"change")}, ready to review in History and push.`),H(""),G()}catch(B){O(!1,`Cut a changeset: the World did not answer (${B instanceof Error?B.message:String(B)})`)}finally{z(!1)}};if(Z){let w=!q?"This session reads the World; it changes nothing":J===0?"Nothing to cut: no change is outside a changeset":null;return $.jsxDEV("div",{className:"ws-cut",children:[$.jsxDEV(A2,{log:W,name:_},void 0,!1,void 0,this),$.jsxDEV("form",{onSubmit:(B)=>void A(B),"aria-label":"Cut a changeset",children:[Y?$.jsxDEV("a",{className:"ws-author",href:Y.account,title:`${Y.who}: your account`,onClick:(B)=>{B.preventDefault(),j1(Y.account.slice(T1.length+1).split("/"))},children:Y.face},void 0,!1,void 0,this):null,$.jsxDEV("input",{ref:X,name:"changesetMessage","aria-label":"Summary",value:K,onChange:(B)=>H(B.target.value),placeholder:J===0?"Nothing to cut":F?"Summary (optional)":"Summary (required)",required:!F,maxLength:200,disabled:Boolean(w),title:w??void 0},void 0,!1,void 0,this),$.jsxDEV("button",{type:"submit",className:"primary",disabled:Boolean(w)||L,title:w??void 0,children:L?"Cutting…":J===0?"Cut a changeset":$.jsxDEV($.Fragment,{children:["Cut ",m1(J,"change"),Y?$.jsxDEV($.Fragment,{children:[" on ",$.jsxDEV("b",{children:Y.branch},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)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}if(!q||J===0)return $.jsxDEV(A2,{log:W,name:_},void 0,!1,void 0,this);return $.jsxDEV($.Fragment,{children:[$.jsxDEV("form",{className:"block cut pad",onSubmit:(w)=>void A(w),"aria-label":"Cut a changeset",children:[$.jsxDEV("label",{children:[$.jsxDEV("span",{children:["Cut ",J===1?"this change":`these ${J} changes`," into a changeset: what it does and why"]},void 0,!0,void 0,this),$.jsxDEV("input",{name:"changesetMessage",value:K,onChange:(w)=>H(w.target.value),placeholder:"Welcome email for new sign-ups",required:!0,maxLength:200,disabled:J===0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"submit",className:"primary",disabled:L||J===0,children:L?"Cutting…":"Cut a changeset"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(A2,{log:W,name:_},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function RF({name:_,token:Q}){let[J,q]=r.useState(0),U=V1(Q,`/-/${_}/keys`,J),[G,Z]=r.useState(!1),[F,X]=r.useState(""),[Y,K]=r.useState("write"),[H,L]=r.useState(!1),[z,W]=r.useState(null),[I,O]=r.useState(null),[A,w]=r.useState(null),B=async()=>{let C=`Read-only link · ${new Date().toLocaleDateString(void 0,{month:"short",day:"numeric"})}`,f=await y1(Q,`/-/${_}/keys`,{method:"POST",body:JSON.stringify({name:C,scope:"read"})}).catch(()=>null),y=f?await f.json().catch(()=>({})):{error:`${k1} did not answer`};if(!f?.ok||!y.key){r1(y.error?s1(y.error).text:"refused","error");return}w(`${window.location.origin}${T1}/${_}#${new URLSearchParams({token:y.key}).toString()}`),q((N)=>N+1)},T=async(C)=>{C.preventDefault(),L(!0),W(null);let f=await y1(Q,`/-/${_}/keys`,{method:"POST",body:JSON.stringify({name:F.trim(),scope:Y})}).catch(()=>null);L(!1);let y=f?await f.json().catch(()=>({})):{error:`${k1} did not answer`};if(!f?.ok||!y.key){W(y.error?s1(y.error).text:"refused");return}Z(!1),O({key:y.key,name:F.trim()}),X(""),q((N)=>N+1)},R=async(C)=>{if(!await p0({title:`Revoke ${C.name}?`,body:"Whatever holds it loses this World at once.",action:"Revoke key",danger:!0}))return;let f=await y1(Q,`/-/${_}/keys/${C.id}`,{method:"DELETE"});if(f.ok)r1(`Revoked ${C.name}`);else r1(await Y0(f),"error");q((y)=>y+1)};return $.jsxDEV("section",{"aria-labelledby":"keys-head",className:"keys",children:[$.jsxDEV("div",{className:"keys-head",children:[$.jsxDEV("div",{children:[$.jsxDEV("h3",{id:"keys-head",children:"Keys"},void 0,!1,void 0,this),$.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),G0()?$.jsxDEV("a",{className:"button primary",href:`${G0()}/${encodeURIComponent(_.split("/")[0]??"")}`,children:"Make a key on the platform"},void 0,!1,void 0,this):$.jsxDEV("div",{className:"head-actions",children:[$.jsxDEV("button",{type:"button",onClick:()=>void B(),children:"Share a read-only link"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",className:"primary",onClick:()=>{W(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),$.jsxDEV(U0,{load:U,what:"the keys",retry:()=>q((C)=>C+1)},void 0,!1,void 0,this),U.state==="ok"?U.data.keys.length===0?$.jsxDEV("p",{className:"mode",children:"No keys yet. The World's own token opens it too."},void 0,!1,void 0,this):$.jsxDEV("table",{className:"dense","aria-label":"Keys",children:[$.jsxDEV("thead",{children:$.jsxDEV("tr",{children:[$.jsxDEV("th",{children:"Name"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"For"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Access"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Made"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Last used"},void 0,!1,void 0,this),$.jsxDEV("th",{className:"num",children:$.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),$.jsxDEV("tbody",{children:U.data.keys.map((C)=>$.jsxDEV("tr",{children:[$.jsxDEV("td",{children:C.name},void 0,!1,void 0,this),$.jsxDEV("td",{children:C.person??$.jsxDEV("span",{className:"mode",title:"It acts as itself: a service",children:"no one: a service"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:C.scope==="write"?"Read and write":"Read only"},void 0,!1,void 0,this),$.jsxDEV("td",{className:"mode",children:$.jsxDEV("span",{title:b2(C.createdAt),children:Y8(C.createdAt)},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{className:"mode",children:C.lastUsedAt?Y8(C.lastUsedAt):"never"},void 0,!1,void 0,this),$.jsxDEV("td",{className:"num",children:$.jsxDEV(p_,{label:`More for ${C.name}`,items:[{label:"Revoke…",danger:!0,onSelect:()=>void R(C)}]},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},C.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,$.jsxDEV(M0,{open:G,onClose:()=>{if(!H)Z(!1)},title:"Make a key",footer:$.jsxDEV($.Fragment,{children:[$.jsxDEV("button",{type:"button",onClick:()=>Z(!1),disabled:H,children:"Cancel"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"submit",form:"make-key",disabled:H||!F.trim(),children:H?"Making…":"Make key"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:$.jsxDEV("form",{id:"make-key",onSubmit:T,"aria-label":"Make a key",children:[$.jsxDEV("label",{children:["Name ",$.jsxDEV("input",{autoFocus:!0,name:"keyName",value:F,onChange:(C)=>X(C.target.value),placeholder:"ci, staging app…",maxLength:80,required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("label",{children:["Access ",$.jsxDEV("select",{value:Y,onChange:(C)=>K(C.target.value==="read"?"read":"write"),children:[$.jsxDEV("option",{value:"write",children:"Read and write"},void 0,!1,void 0,this),$.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),z?$.jsxDEV("p",{role:"alert",children:z},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV(M0,{open:Boolean(I),onClose:()=>O(null),title:`${I?.name??"The key"} is ready`,footer:$.jsxDEV("button",{type:"button",className:"primary",onClick:()=>O(null),children:"Done"},void 0,!1,void 0,this),children:[$.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),I?$.jsxDEV(z8,{label:"Key",value:I.key,secret:!0},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV(M0,{open:Boolean(A),onClose:()=>w(null),title:"A read-only link",footer:$.jsxDEV("button",{type:"button",className:"primary",onClick:()=>w(null),children:"Done"},void 0,!1,void 0,this),children:[$.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),A?$.jsxDEV(z8,{label:"Link",value:A,secret:!0},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var e5=0;function A2({log:_,name:Q}){if(_.length===0)return null;return $.jsxDEV("ul",{className:"narration-log",role:"status","aria-live":"polite",children:_.map((J)=>$.jsxDEV("li",{className:J.ok?"ok":"bad",children:[$.jsxDEV("span",{className:"mode",children:$.jsxDEV(u1,{iso:J.at,time:!0},void 0,!1,void 0,this)},void 0,!1,void 0,this)," ",J.text,J.acts?$.jsxDEV(qQ,{name:Q,acts:J.acts},void 0,!1,void 0,this):null]},J.n,!0,void 0,this))},void 0,!1,void 0,this)}function wQ(_,Q,J,q){let[U,G]=r.useState(0),Z=U*1e5+Math.floor(J/2),F=V1(Q,`/-/${_}/origin`,Z),X=V1(Q,`/-/${_}/diff`,Z),Y=V1(Q,`/-/${_}/changesets`,Z),[K,H]=r.useState([]),[L,z]=r.useState(null),W=(R,C,f)=>{if(H((y)=>[{ok:R,text:C,at:new Date().toISOString(),n:++e5,...f?.length?{acts:f}:{}},...y].slice(0,8)),!R)r1(C,"error")},I=async(R,C,f)=>{z(R);try{let y=await y1(Q,`/-/${_}/${C}`,f);if(!y.ok){q(y);let N=s1(await _2(y));return W(!1,`${R}: ${N.text}`,N.acts),null}return await y.json()}catch(y){return W(!1,`${R}: the World did not answer (${y instanceof Error?y.message:String(y)})`),null}finally{z(null),G((y)=>y+1)}},O=F.state==="ok"&&F.data.origin?N8(F.data.origin):null,A=X.state==="ok"?X.data.changes.length:null,w=Y.state==="ok"&&O?nZ(Y.data.changesets.filter((R)=>!R.pushedBy)).sort((R,C)=>R.createdAt.localeCompare(C.createdAt)):[];return{origin:F,diff:X,sets:Y,there:O,changes:A,waiting:w,log:K,busy:L,say:W,send:I,push:async()=>{let R=await I("Push","origin/push",{method:"POST"});if(!R)return;if(R.pushed.length===0){W(!0,"Nothing to push: every changeset is already at the remote.");return}for(let C of R.pushed){let f=C.receipts??[],y=f.filter((l)=>l.status==="replayed").length,N=f.filter((l)=>l.status==="confirmed").length,k=f.filter((l)=>l.status==="failed").length,E=C.outcome==="applied"&&k===0;if(C.outcome==="refused"){W(!1,`Push of ${C.changeset} was refused${C.refusal?.length?`: ${C.refusal.map((l)=>s1(l).text).join("; ")}`:""}.`);continue}let c=[`${y} of ${m1(f.length,"change")} replayed there`,...N?[`${N} performed at the vendor by the remote`]:[],...k?[`${k} failed`]:[]];W(E,`${C.outcome==="partial"?"Partly pushed":"Pushed"} ${C.changeset} to ${O??"the remote"}: ${c.join("; ")}${C.refusal?.length?` (${C.refusal.map((l)=>s1(l).text).join("; ")})`:""}.`)}},pull:async()=>{let R=await I("Pull","origin/pull",{method:"POST"});if(!R)return;let C=Object.entries(R.appended).filter(([,y])=>y>0),f=R.rebased.flatMap((y)=>y.conflicts.map((N)=>`${B1(y.twin)} ${N.subject.type}:${N.subject.id} ${N.field}`));W(f.length===0,`Pulled from ${O??"the remote"}: ${C.length?C.map(([y,N])=>`${m1(N,"entry")} at ${B1(y)}`).join(", "):"nothing new"}${f.length?`; conflicts at ${f.join(", ")}`:""}.`)}}}function OF({name:_,token:Q,canWrite:J,tick:q,refused:U}){let{origin:G,there:Z,changes:F,log:X,busy:Y,say:K,send:H,push:L,pull:z}=wQ(_,Q,q,U),[W,I]=r.useState(""),[O,A]=r.useState(""),[w,B]=r.useState(!1),T=async(C)=>{C.preventDefault();let f=await H("Name the remote","origin",{method:"PUT",body:JSON.stringify({url:W.trim(),token:O.trim()})});if(f){let y=Object.values(f.appended??{}).reduce((N,k)=>N+k,0);K(!0,`The remote is ${N8(f.origin)}: its history came in (${m1(y,"entry")}).`),A(""),B(!1)}},R=!J?"This session reads the World; it changes nothing":null;return $.jsxDEV($.Fragment,{children:[$.jsxDEV("div",{className:"block remote",children:[$.jsxDEV("div",{className:"block-head",children:[$.jsxDEV("h3",{children:"Origin"},void 0,!1,void 0,this),J?$.jsxDEV("button",{type:"button",onClick:()=>{I(Z??""),B(!w)},"aria-expanded":w,children:Z?"Change the remote…":"Name a remote…"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"pad",children:[G.state==="ok"?Z?$.jsxDEV("p",{children:[$.jsxDEV("code",{className:"big",children:Z},void 0,!1,void 0,this),G.data.origin?.fetchedAt?$.jsxDEV("span",{className:"mode",children:[" · last fetched ",$.jsxDEV(u1,{iso:G.data.origin.fetchedAt},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this):$.jsxDEV("p",{children:"No remote — this World keeps its default data. Name one to push its changesets to a shared World and pull what others pushed there."},void 0,!1,void 0,this):$.jsxDEV(U0,{load:G,what:"the remote",lines:1},void 0,!1,void 0,this),w?$.jsxDEV("form",{className:"stack origin-form",onSubmit:(C)=>void T(C),"aria-label":"Name the remote",children:[$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"The World's address"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"originUrl",value:W,onChange:(C)=>I(C.target.value),placeholder:"https://worlds.example.com/acme/team",required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"A key or token that opens it"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"originToken",type:"password",value:O,onChange:(C)=>A(C.target.value),required:!0,autoComplete:"off"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("p",{className:"mode",children:"Naming it brings its history in. Your pushes are recorded there as whoever this key was made for, or as the key itself."},void 0,!1,void 0,this),$.jsxDEV("div",{className:"row-actions",children:[$.jsxDEV("button",{type:"submit",className:"primary",disabled:Y!==null,children:Y==="Name the remote"?"Bringing its history in…":"Save the remote"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",onClick:()=>B(!1),children:"Cancel"},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)]},void 0,!0,void 0,this),$.jsxDEV(A2,{log:X,name:_},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function IF({name:_,token:Q,canWrite:J,refused:q}){let[U,G]=r.useState(0),Z=V1(Q,`/-/${_}/twins`,U),F=V1(Q,`/-/${_}/links`,U),X=V1(Q,`/-/${_}/requests?hours=24`,U),[Y,K]=r.useState({}),[H,L]=r.useState(null),[z,W]=r.useState(""),[I,O]=r.useState(!1),[A,w]=r.useState([]),B=(N,k,E)=>{if(w((c)=>[{ok:N,text:k,at:new Date().toISOString(),n:++e5,...E?.length?{acts:E}:{}},...c].slice(0,6)),!N)r1(k,"error")},T=F.state==="ok"?Object.keys(F.data.links).sort():[];r.useEffect(()=>{let N=!0;return Promise.all(T.map(async(k)=>{let E=await y1(Q,`/-/${_}/twins/${k}/credential`).catch(()=>null),c=E?.ok?await E.json():null;return[k,c?.credential??null]})).then((k)=>{if(N)K(Object.fromEntries(k))}),()=>{N=!1}},[_,Q,T.join(","),U]);let R=async(N)=>{if(N.preventDefault(),!H||!z)return;O(!0);let k=await y1(Q,`/-/${_}/twins/${H.vendor}/credential`,{method:"PUT",body:z,headers:{"content-type":"text/plain"}}).catch(()=>null);if(O(!1),!k){B(!1,`Seal ${H.vendor}: ${k1} did not answer`);return}if(!k.ok){q(k);let c=s1(await _2(k));B(!1,`Seal ${B1(H.vendor)}: ${c.text}`,c.acts);return}let E=await k.json().catch(()=>({}));B(!0,`Sealed a credential for ${B1(H.vendor)}${E.fingerprint?` (${E.fingerprint})`:""}: it opens for ${E.boundTo??H.to} only, and is never shown again.`),W(""),L(null),G((c)=>c+1)},C=async(N)=>{if(!await p0({title:`Remove the link ${N}?`,body:`Requests to ${l0}/${_}/${N}/… stop being forwarded to ${F.state==="ok"?F.data.links[N]?.origin:"its origin"}.`,action:"Remove link",danger:!0}))return;let k=await y1(Q,`/-/${_}/links/${N}`,{method:"DELETE"}).catch(()=>null);if(!k?.ok){if(k)q(k);B(!1,`Remove ${N}: ${k?await Y0(k):"the World did not answer"}`);return}B(!0,`Removed the link ${N}.`),G((E)=>E+1)},f=(N)=>N?$.jsxDEV($.Fragment,{children:[$.jsxDEV("span",{className:"badge rooted",children:"sealed"},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:[N.fingerprint?$.jsxDEV("code",{children:N.fingerprint},void 0,!1,void 0,this):null," · ",$.jsxDEV(u1,{iso:N.placedAt},void 0,!1,void 0,this),N.sealedBy?` · by ${N.sealedBy==="vault"?"the vault":"the host's key"}`:""]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):$.jsxDEV("span",{className:"mode",children:"none"},void 0,!1,void 0,this),y=Z.state==="ok"?Z.data.twins:[];return $.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"lede",children:"A real vendor's credential lives in one place, sealed: beside this World, bound to where it goes. It is never readable back; this page says only that one is sealed, when, by what, and for where."},void 0,!1,void 0,this),$.jsxDEV(A2,{log:A,name:_},void 0,!1,void 0,this),$.jsxDEV("section",{className:"block","aria-labelledby":"creds-head",children:[$.jsxDEV("div",{className:"block-head",children:$.jsxDEV("h3",{id:"creds-head",children:"Vendors"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV(U0,{load:Z,what:"the vendors"},void 0,!1,void 0,this),Z.state==="ok"?$.jsxDEV("table",{className:"dense","aria-label":"Credentials by vendor",children:[$.jsxDEV("thead",{children:$.jsxDEV("tr",{children:[$.jsxDEV("th",{children:"Vendor"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Credential"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Bound to"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Real service"},void 0,!1,void 0,this),J?$.jsxDEV("th",{className:"num",children:$.jsxDEV("span",{className:"sr",children:"Actions"},void 0,!1,void 0,this)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("tbody",{children:y.map((N)=>$.jsxDEV("tr",{children:[$.jsxDEV("td",{children:$.jsxDEV("span",{className:"vendor-cell",children:[$.jsxDEV(d1,{vendor:N.twin},void 0,!1,void 0,this),B1(N.twin)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:f(N.credential)},void 0,!1,void 0,this),$.jsxDEV("td",{children:N.credential?.boundTo?$.jsxDEV("code",{children:N.credential.boundTo},void 0,!1,void 0,this):$.jsxDEV("span",{className:"mode",children:"—"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:N.root?.url?$.jsxDEV("code",{children:N.root.url},void 0,!1,void 0,this):$.jsxDEV("span",{className:"mode",children:"none: a stand-in"},void 0,!1,void 0,this)},void 0,!1,void 0,this),J?$.jsxDEV("td",{className:"num",children:$.jsxDEV("button",{type:"button",disabled:!N.root?.url,title:N.root?.url?`Seal ${B1(N.twin)}'s real credential for ${N.root.url}`:"Connect it to its real service first (Settings › Real services): a credential is sealed for where it goes",onClick:()=>{W(""),L({vendor:N.twin,to:N.root.url})},children:N.credential?"Replace…":"Seal a credential…"},void 0,!1,void 0,this)},void 0,!1,void 0,this):null]},N.twin,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,Z.state==="ok"&&y.every((N)=>!N.root?.url)?$.jsxDEV("p",{className:"mode pad",children:"No vendor here has a real service behind it, so none holds a credential. Connect one in Settings › Real services; its credential is sealed here."},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("section",{className:"block","aria-labelledby":"links-head",children:[$.jsxDEV("div",{className:"block-head",children:[$.jsxDEV("h3",{id:"links-head",children:"Links"},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:"a vendor with no twin, forwarded with its sealed credential"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(U0,{load:F,what:"the links"},void 0,!1,void 0,this),X.state==="ok"&&(X.data.journalFailures??0)>0?$.jsxDEV("p",{className:"mode pad",role:"alert",children:[X.data.journalFailures," request ",X.data.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 from what this page counts."]},void 0,!0,void 0,this):null,F.state==="ok"&&T.length===0?$.jsxDEV("p",{className:"mode pad",children:["No links. A link forwards requests for a vendor with no twin here, at ",$.jsxDEV("code",{children:[l0,"/",_,"/<link>/…"]},void 0,!0,void 0,this),", to that vendor's real API with the credential sealed for it."]},void 0,!0,void 0,this):null,T.length?$.jsxDEV("table",{className:"dense","aria-label":"Links",children:[$.jsxDEV("thead",{children:$.jsxDEV("tr",{children:[$.jsxDEV("th",{children:"Link"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Origin"},void 0,!1,void 0,this),$.jsxDEV("th",{className:"num",children:"Requests, 24h"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Credential"},void 0,!1,void 0,this),J?$.jsxDEV("th",{className:"num",children:$.jsxDEV("span",{className:"sr",children:"Actions"},void 0,!1,void 0,this)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("tbody",{children:T.map((N)=>{let k=F.state==="ok"?F.data.links[N].origin:"",E=X.state==="ok"?X.data.twins.find((c)=>c.twin===N):void 0;return $.jsxDEV("tr",{children:[$.jsxDEV("td",{children:$.jsxDEV("b",{children:N},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:$.jsxDEV("code",{children:k},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{className:"num",children:E?$.jsxDEV("span",{title:Object.entries(E.byStatus).map(([c,l])=>`${c}: ${l}`).join(" · "),children:E.requests},void 0,!1,void 0,this):$.jsxDEV("span",{className:"mode",children:"—"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:[f(Y[N]??null),Y[N]?.boundTo?$.jsxDEV("div",{className:"mode",children:["bound to ",$.jsxDEV("code",{children:Y[N].boundTo},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),J?$.jsxDEV("td",{className:"num row-actions",children:[$.jsxDEV("button",{type:"button",onClick:()=>{W(""),L({vendor:N,to:k})},children:Y[N]?"Replace…":"Seal a credential…"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",onClick:()=>void C(N),children:"Remove…"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},N,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV(M0,{open:Boolean(H),onClose:()=>{if(!I)L(null)},title:`Seal ${H?B1(H.vendor):""}'s credential`,footer:$.jsxDEV($.Fragment,{children:[$.jsxDEV("button",{type:"button",onClick:()=>L(null),disabled:I,children:"Cancel"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"submit",form:"seal-credential",className:"primary",disabled:I||!z,children:I?"Sealing…":"Seal it"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:$.jsxDEV("form",{id:"seal-credential",className:"stack",onSubmit:(N)=>void R(N),children:[$.jsxDEV("p",{className:"mode",children:["It is sealed for ",$.jsxDEV("code",{children:H?.to},void 0,!1,void 0,this)," and opens there only. It is never shown again, here or anywhere."]},void 0,!0,void 0,this),$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"The real key"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"credential",type:"password",value:z,onChange:(N)=>W(N.target.value),autoComplete:"off",required:!0,autoFocus:!0},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 PF({name:_,token:Q,admin:J,canWrite:q,refused:U,onRemoved:G,only:Z}){let F=(v)=>!Z||Z===v,[X,Y]=r.useState(0),K=V1(Q,`/-/${_}/twins`,X),H=V1(Q,`/-/${_}/checks`,X),[L,z]=r.useState(0),W=V1(Q,`/-/${_}/clock`,L),[I,O]=r.useState([]),[A,w]=r.useState(null),[B,T]=r.useState(null),[R,C]=r.useState(""),[f,y]=r.useState("gated"),[N,k]=r.useState(!1),E=(v,m,P)=>{if(O((V)=>[{ok:v,text:m,at:new Date().toISOString(),n:++e5,...P?.length?{acts:P}:{}},...V].slice(0,6)),!v)r1(m,"error")},c=async(v,m,P)=>{let V=await y1(Q,m,P).catch(()=>null);if(!V)return E(!1,`${v}: the World did not answer`),!1;if(!V.ok){U(V);let b=s1(await _2(V));return E(!1,`${v}: ${b.text}`,b.acts),!1}return E(!0,`${v}: done.`),Y((b)=>b+1),!0},l=async(v)=>{if(v.preventDefault(),!B)return;k(!0);let m=B.root??{},P=await c(R.trim()?`Connect ${B1(B.twin)} to ${R.trim()}`:`Disconnect ${B1(B.twin)}`,`/-/${_}/twins/${B.twin}/root`,{method:"PUT",body:JSON.stringify(R.trim()?{...m,url:R.trim(),deploy:f}:null)});if(k(!1),P)T(null)},S=async()=>{if(!await p0({title:`Rotate the tokens of ${_}?`,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 v=await y1(J,`/-/worlds/${_}/rotate`,{method:"POST"});if(v.ok)w(await v.json()),E(!0,"Rotated: the new tokens are shown once, below.");else E(!1,`Rotate: ${await Y0(v)}`)},j=async()=>{if(!await p0({title:`Remove ${_}?`,body:"The host stops serving it and its whole history goes with it. This cannot be undone.",action:"Remove World",danger:!0,typed:_}))return;let v=await y1(J,`/-/worlds/${_}`,{method:"DELETE"}).catch((m)=>m);if(v instanceof Error){E(!1,`Remove: the host did not answer (${v.message})`);return}if(v.ok)G();else E(!1,`Remove: ${await Y0(v)}`)},D=K.state==="ok"?K.data.twins:[],x={gated:"gated: a person deploys an approved changeset",auto:"auto: a push deploys at once",hold:"hold: nothing deploys"};return $.jsxDEV($.Fragment,{children:[$.jsxDEV(A2,{log:I,name:_},void 0,!1,void 0,this),F("access")?$.jsxDEV($.Fragment,{children:[$.jsxDEV("h3",{className:"settings-head",children:"Access"},void 0,!1,void 0,this),q?$.jsxDEV(RF,{name:_,token:Q},void 0,!1,void 0,this):$.jsxDEV("p",{className:"mode",children:"This session reads the World: its keys are managed by whoever holds its token."},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,F("services")?$.jsxDEV($.Fragment,{children:[$.jsxDEV("h3",{className:"settings-head",children:"Real services"},void 0,!1,void 0,this),$.jsxDEV("p",{className:"mode",children:[D.some((v)=>v.root?.url)?null:"Every vendor here is a stand-in. ","Connect a vendor to its real service to read the real state into this World; its real credential is sealed in the Vault, and an approved changeset deploys there by its policy."]},void 0,!0,void 0,this),$.jsxDEV(U0,{load:K,what:"the vendors"},void 0,!1,void 0,this),K.state==="ok"?$.jsxDEV("div",{className:"block",children:$.jsxDEV("table",{className:"dense","aria-label":"Real services",children:[$.jsxDEV("thead",{children:$.jsxDEV("tr",{children:[$.jsxDEV("th",{children:"Vendor"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Real service"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Deploy policy"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Last read from it"},void 0,!1,void 0,this),q?$.jsxDEV("th",{className:"num",children:$.jsxDEV("span",{className:"sr",children:"Actions"},void 0,!1,void 0,this)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("tbody",{children:D.map((v)=>{let m=v.root;return $.jsxDEV("tr",{children:[$.jsxDEV("td",{children:$.jsxDEV("span",{className:"vendor-cell",children:[$.jsxDEV(d1,{vendor:v.twin},void 0,!1,void 0,this),$.jsxDEV("a",{href:`${T1}/${_}/${v.twin}`,title:`Its log and stored state · ${v.position??0} entries`,onClick:(P)=>{P.preventDefault(),j1([..._.split("/"),v.twin])},children:B1(v.twin)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:m?.url?$.jsxDEV("code",{children:m.url},void 0,!1,void 0,this):$.jsxDEV("span",{className:"mode",children:"not connected"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{className:"mode",children:m?.url?x[m.deploy??""]??m.deploy??"—":"—"},void 0,!1,void 0,this),$.jsxDEV("td",{children:v.refresh?.failed?$.jsxDEV("span",{role:"alert",children:["failed ×",v.refresh.failed.count??1,": ",v.refresh.failed.reason??""]},void 0,!0,void 0,this):m?.url?b2(v.refresh?.observedAt??v.refresh?.at):$.jsxDEV("span",{className:"mode",children:"—"},void 0,!1,void 0,this)},void 0,!1,void 0,this),q?$.jsxDEV("td",{className:"num row-actions",children:[$.jsxDEV("button",{type:"button",onClick:()=>{C(m?.url??""),y(m?.deploy==="auto"||m?.deploy==="hold"?m.deploy:"gated"),T(v)},children:m?.url?"Change…":"Connect…"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",disabled:!m?.url,title:m?.url?"Read the real service's current state into this World":"Connect it first",onClick:()=>void p0({title:`Read ${B1(v.twin)} now?`,body:`The real ${B1(v.twin)}'s current state is read into this World. Nothing is written to ${B1(v.twin)}.`,action:"Read from it"}).then((P)=>{if(P)c(`Read from ${B1(v.twin)}`,`/-/${_}/twins/${v.twin}/refresh`,{method:"POST"})}),children:"Read from it"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},v.twin,!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):null,F("clock")?$.jsxDEV($.Fragment,{children:[$.jsxDEV("h3",{className:"settings-head",children:"Clock"},void 0,!1,void 0,this),$.jsxDEV("p",{className:"mode",children:"The instant every vendor here stamps from. Set it and move it forward to see what happens later: renewals, expiries, scheduled sends."},void 0,!1,void 0,this),$.jsxDEV(_F,{name:_,token:Q,clock:W,canWrite:q,onChanged:()=>z((v)=>v+1),refused:U,open:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,F("checks")?$.jsxDEV($.Fragment,{children:[$.jsxDEV("h3",{className:"settings-head",children:"Checks"},void 0,!1,void 0,this),$.jsxDEV("p",{className:"mode",children:"JavaScript the World runs over every change before it is performed (a changeset's Verify runs them too)."},void 0,!1,void 0,this),$.jsxDEV(U0,{load:H,what:"the checks"},void 0,!1,void 0,this),H.state==="ok"?H.data.checks.length===0?$.jsxDEV("p",{className:"mode",children:"No checks: every change is performed as it comes."},void 0,!1,void 0,this):$.jsxDEV("div",{className:"block",children:$.jsxDEV("table",{className:"dense","aria-label":"Checks",children:$.jsxDEV("tbody",{children:H.data.checks.map((v)=>$.jsxDEV("tr",{children:$.jsxDEV("td",{children:$.jsxDEV("code",{children:v},void 0,!1,void 0,this)},void 0,!1,void 0,this)},v,!1,void 0,this))},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this):null,J&&!Z?$.jsxDEV("div",{className:"danger",role:"region","aria-label":"Danger zone",children:[$.jsxDEV("h3",{children:"Danger zone"},void 0,!1,void 0,this),A?$.jsxDEV("p",{role:"status",children:["token ",$.jsxDEV("code",{children:A.token},void 0,!1,void 0,this)," · read token ",$.jsxDEV("code",{children:A.readToken},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,$.jsxDEV("p",{children:[$.jsxDEV("button",{type:"button",onClick:()=>void S(),children:"Rotate tokens"},void 0,!1,void 0,this)," ",$.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),$.jsxDEV("p",{children:[$.jsxDEV("button",{type:"button",onClick:()=>void j(),children:"Remove world"},void 0,!1,void 0,this)," ",$.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,$.jsxDEV(M0,{open:Boolean(B),onClose:()=>{if(!N)T(null)},title:`Connect ${B?B1(B.twin):""} to its real service`,footer:$.jsxDEV($.Fragment,{children:[$.jsxDEV("button",{type:"button",onClick:()=>T(null),disabled:N,children:"Cancel"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"submit",form:"connect-root",className:"primary",disabled:N,children:N?"Saving…":R.trim()?"Connect":"Disconnect"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:$.jsxDEV("form",{id:"connect-root",className:"stack",onSubmit:(v)=>void l(v),children:[$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"The real service's API address"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"rootUrl",value:R,onChange:(v)=>C(v.target.value),placeholder:"https://api.openai.com",autoFocus:!0},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:"Empty disconnects it."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"Deploy policy"},void 0,!1,void 0,this),$.jsxDEV("select",{name:"rootDeploy",value:f,onChange:(v)=>y(v.target.value==="auto"?"auto":v.target.value==="hold"?"hold":"gated"),children:["gated","auto","hold"].map((v)=>$.jsxDEV("option",{value:v,children:x[v]},v,!1,void 0,this))},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 qM(){return $.jsxDEV($.Fragment,{children:[$.jsxDEV(bZ,{},void 0,!1,void 0,this),$.jsxDEV(g_,{},void 0,!1,void 0,this),$.jsxDEV(m_,{},void 0,!1,void 0,this),$.jsxDEV(x_,{},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}export{$M as openAt,o5 as ROOT,qM as ConsolePage};