@volter/world-console 3.0.17 → 3.0.18
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 ZN=Object.create;var{getPrototypeOf:FN,defineProperty:VA,getOwnPropertyNames:XN}=Object;var KN=Object.prototype.hasOwnProperty;function HN(Q){return this[Q]}var YN,zN,s0=(Q,U,Z)=>{var K=Q!=null&&typeof Q==="object";if(K){var H=U?YN??=new WeakMap:zN??=new WeakMap,Y=H.get(Q);if(Y)return Y}Z=Q!=null?ZN(FN(Q)):{};let W=U||!Q||!Q.__esModule?VA(Z,"default",{value:Q,enumerable:!0}):Z;for(let L of XN(Q))if(!KN.call(W,L))VA(W,L,{get:HN.bind(Q,L),enumerable:!0});if(K)H.set(Q,W);return W};var o4=(Q,U)=>()=>(U||Q((U={exports:{}}).exports,U),U.exports);var yA=o4((WN)=>{(function(){function Q(){if(v=!1,u){var g=WN.unstable_now();s=g;var p=!0;try{_:{y=!1,N&&(N=!1,x(b),b=-1),C=!0;var c=S;try{J:{Y(g);for(V=Z(R);V!==null&&!(V.expirationTime>g&&L());){var l=V.callback;if(typeof l==="function"){V.callback=null,S=V.priorityLevel;var o=l(V.expirationTime<=g);if(g=WN.unstable_now(),typeof o==="function"){V.callback=o,Y(g),p=!0;break J}V===Z(R)&&K(R),Y(g)}else K(R);V=Z(R)}if(V!==null)p=!0;else{var k=Z(w);k!==null&&M(W,k.startTime-g),p=!1}}break _}finally{V=null,S=c,C=!1}p=void 0}}finally{p?U1():u=!1}}}function U(g,p){var c=g.length;g.push(p);_:for(;0<c;){var l=c-1>>>1,o=g[l];if(0<H(o,p))g[l]=p,g[c]=o,c=l;else break _}}function Z(g){return g.length===0?null:g[0]}function K(g){if(g.length===0)return null;var p=g[0],c=g.pop();if(c!==p){g[0]=c;_:for(var l=0,o=g.length,k=o>>>1;l<k;){var t=2*(l+1)-1,_1=g[t],a=t+1,H1=g[a];if(0>H(_1,c))a<o&&0>H(H1,_1)?(g[l]=H1,g[a]=c,l=a):(g[l]=_1,g[t]=c,l=t);else if(a<o&&0>H(H1,c))g[l]=H1,g[a]=c,l=a;else break _}}return p}function H(g,p){var c=g.sortIndex-p.sortIndex;return c!==0?c:g.id-p.id}function Y(g){for(var p=Z(w);p!==null;){if(p.callback===null)K(w);else if(p.startTime<=g)K(w),p.sortIndex=p.expirationTime,U(R,p);else break;p=Z(w)}}function W(g){if(N=!1,Y(g),!y)if(Z(R)!==null)y=!0,u||(u=!0,U1());else{var p=Z(w);p!==null&&M(W,p.startTime-g)}}function L(){return v?!0:WN.unstable_now()-s<m?!1:!0}function M(g,p){b=D(function(){g(WN.unstable_now())},p)}if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()),WN.unstable_now=void 0,typeof performance==="object"&&typeof performance.now==="function"){var O=performance;WN.unstable_now=function(){return O.now()}}else{var T=Date,A=T.now();WN.unstable_now=function(){return T.now()-A}}var R=[],w=[],P=1,V=null,S=3,C=!1,y=!1,N=!1,v=!1,D=typeof setTimeout==="function"?setTimeout:null,x=typeof clearTimeout==="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null,u=!1,b=-1,m=5,s=-1;if(typeof E==="function")var U1=function(){E(Q)};else if(typeof MessageChannel<"u"){var Q1=new MessageChannel,h=Q1.port2;Q1.port1.onmessage=Q,U1=function(){h.postMessage(null)}}else U1=function(){D(Q,0)};WN.unstable_IdlePriority=5,WN.unstable_ImmediatePriority=1,WN.unstable_LowPriority=4,WN.unstable_NormalPriority=3,WN.unstable_Profiling=null,WN.unstable_UserBlockingPriority=2,WN.unstable_cancelCallback=function(g){g.callback=null},WN.unstable_forceFrameRate=function(g){0>g||125<g?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):m=0<g?Math.floor(1000/g):5},WN.unstable_getCurrentPriorityLevel=function(){return S},WN.unstable_next=function(g){switch(S){case 1:case 2:case 3:var p=3;break;default:p=S}var c=S;S=p;try{return g()}finally{S=c}},WN.unstable_requestPaint=function(){v=!0},WN.unstable_runWithPriority=function(g,p){switch(g){case 1:case 2:case 3:case 4:case 5:break;default:g=3}var c=S;S=g;try{return p()}finally{S=c}},WN.unstable_scheduleCallback=function(g,p,c){var l=WN.unstable_now();switch(typeof c==="object"&&c!==null?(c=c.delay,c=typeof c==="number"&&0<c?l+c:l):c=l,g){case 1:var o=-1;break;case 2:o=250;break;case 5:o=1073741823;break;case 4:o=1e4;break;default:o=5000}return o=c+o,g={id:P++,callback:p,priorityLevel:g,startTime:c,expirationTime:o,sortIndex:-1},c>l?(g.sortIndex=c,U(w,g),Z(R)===null&&g===Z(w)&&(N?(x(b),b=-1):N=!0,M(W,c-l))):(g.sortIndex=o,U(R,g),y||C||(y=!0,u||(u=!0,U1()))),g},WN.unstable_shouldYield=L,WN.unstable_wrapCallback=function(g){var p=S;return function(){var c=S;S=p;try{return g.apply(this,arguments)}finally{S=c}}},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var B4=o4((LN,Bq)=>{(function(){function Q(j,q1){Object.defineProperty(K.prototype,j,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",q1[0],q1[1])}})}function U(j){if(j===null||typeof j!=="object")return null;return j=f1&&j[f1]||j["@@iterator"],typeof j==="function"?j:null}function Z(j,q1){j=(j=j.constructor)&&(j.displayName||j.name)||"ReactClass";var I1=j+"."+q1;z1[I1]||(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.",q1,j),z1[I1]=!0)}function K(j,q1,I1){this.props=j,this.context=q1,this.refs=c1,this.updater=I1||C1}function H(){}function Y(j,q1,I1){this.props=j,this.context=q1,this.refs=c1,this.updater=I1||C1}function W(){}function L(j){return""+j}function M(j){try{L(j);var q1=!1}catch(y1){q1=!0}if(q1){q1=console;var I1=q1.error,P1=typeof Symbol==="function"&&Symbol.toStringTag&&j[Symbol.toStringTag]||j.constructor.name||"Object";return I1.call(q1,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",P1),L(j)}}function O(j){if(j==null)return null;if(typeof j==="function")return j.$$typeof===e1?null:j.displayName||j.name||null;if(typeof j==="string")return j;switch(j){case o:return"Fragment";case t:return"Profiler";case k:return"StrictMode";case O1:return"Suspense";case L1:return"SuspenseList";case R1:return"Activity"}if(typeof j==="object")switch(typeof j.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),j.$$typeof){case l:return"Portal";case a:return j.displayName||"Context";case _1:return(j._context.displayName||"Context")+".Consumer";case H1:var q1=j.render;return j=j.displayName,j||(j=q1.displayName||q1.name||"",j=j!==""?"ForwardRef("+j+")":"ForwardRef"),j;case T1:return q1=j.displayName||null,q1!==null?q1:O(j.type)||"Memo";case G1:q1=j._payload,j=j._init;try{return O(j(q1))}catch(I1){}}return null}function T(j){if(j===o)return"<>";if(typeof j==="object"&&j!==null&&j.$$typeof===G1)return"<...>";try{var q1=O(j);return q1?"<"+q1+">":"<...>"}catch(I1){return"<...>"}}function A(){var j=D1.A;return j===null?null:j.getOwner()}function R(){return Error("react-stack-top-frame")}function w(j){if(g0.call(j,"key")){var q1=Object.getOwnPropertyDescriptor(j,"key").get;if(q1&&q1.isReactWarning)return!1}return j.key!==void 0}function P(j,q1){function I1(){t0||(t0=!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)",q1))}I1.isReactWarning=!0,Object.defineProperty(j,"key",{get:I1,configurable:!0})}function V(){var j=O(this.type);return u2[j]||(u2[j]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),j=this.props.ref,j!==void 0?j:null}function S(j,q1,I1,P1,y1,i1){var r1=I1.ref;return j={$$typeof:c,type:j,key:q1,props:I1,_owner:P1},(r1!==void 0?r1:null)!==null?Object.defineProperty(j,"ref",{enumerable:!1,get:V}):Object.defineProperty(j,"ref",{enumerable:!1,value:null}),j._store={},Object.defineProperty(j._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(j,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(j,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:y1}),Object.defineProperty(j,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:i1}),Object.freeze&&(Object.freeze(j.props),Object.freeze(j)),j}function C(j,q1){return q1=S(j.type,q1,j.props,j._owner,j._debugStack,j._debugTask),j._store&&(q1._store.validated=j._store.validated),q1}function y(j){N(j)?j._store&&(j._store.validated=1):typeof j==="object"&&j!==null&&j.$$typeof===G1&&(j._payload.status==="fulfilled"?N(j._payload.value)&&j._payload.value._store&&(j._payload.value._store.validated=1):j._store&&(j._store.validated=1))}function N(j){return typeof j==="object"&&j!==null&&j.$$typeof===c}function v(j){var q1={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(I1){return q1[I1]})}function D(j,q1){return typeof j==="object"&&j!==null&&j.key!=null?(M(j.key),v(""+j.key)):q1.toString(36)}function x(j){switch(j.status){case"fulfilled":return j.value;case"rejected":throw j.reason;default:switch(typeof j.status==="string"?j.then(W,W):(j.status="pending",j.then(function(q1){j.status==="pending"&&(j.status="fulfilled",j.value=q1)},function(q1){j.status==="pending"&&(j.status="rejected",j.reason=q1)})),j.status){case"fulfilled":return j.value;case"rejected":throw j.reason}}throw j}function E(j,q1,I1,P1,y1){var i1=typeof j;if(i1==="undefined"||i1==="boolean")j=null;var r1=!1;if(j===null)r1=!0;else switch(i1){case"bigint":case"string":case"number":r1=!0;break;case"object":switch(j.$$typeof){case c:case l:r1=!0;break;case G1:return r1=j._init,E(r1(j._payload),q1,I1,P1,y1)}}if(r1){r1=j,y1=y1(r1);var F0=P1===""?"."+D(r1,0):P1;return A1(y1)?(I1="",F0!=null&&(I1=F0.replace(G2,"$&/")+"/"),E(y1,q1,I1,"",function(K2){return K2})):y1!=null&&(N(y1)&&(y1.key!=null&&(r1&&r1.key===y1.key||M(y1.key)),I1=C(y1,I1+(y1.key==null||r1&&r1.key===y1.key?"":(""+y1.key).replace(G2,"$&/")+"/")+F0),P1!==""&&r1!=null&&N(r1)&&r1.key==null&&r1._store&&!r1._store.validated&&(I1._store.validated=2),y1=I1),q1.push(y1)),1}if(r1=0,F0=P1===""?".":P1+":",A1(j))for(var x1=0;x1<j.length;x1++)P1=j[x1],i1=F0+D(P1,x1),r1+=E(P1,q1,I1,i1,y1);else if(x1=U(j),typeof x1==="function")for(x1===j.entries&&(T2||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),T2=!0),j=x1.call(j),x1=0;!(P1=j.next()).done;)P1=P1.value,i1=F0+D(P1,x1++),r1+=E(P1,q1,I1,i1,y1);else if(i1==="object"){if(typeof j.then==="function")return E(x(j),q1,I1,P1,y1);throw q1=String(j),Error("Objects are not valid as a React child (found: "+(q1==="[object Object]"?"object with keys {"+Object.keys(j).join(", ")+"}":q1)+"). If you meant to render a collection of children, use an array instead.")}return r1}function u(j,q1,I1){if(j==null)return j;var P1=[],y1=0;return E(j,P1,"","",function(i1){return q1.call(I1,i1,y1++)}),P1}function b(j){if(j._status===-1){var q1=j._ioInfo;q1!=null&&(q1.start=q1.end=performance.now()),q1=j._result;var I1=q1();if(I1.then(function(y1){if(j._status===0||j._status===-1){j._status=1,j._result=y1;var i1=j._ioInfo;i1!=null&&(i1.end=performance.now()),I1.status===void 0&&(I1.status="fulfilled",I1.value=y1)}},function(y1){if(j._status===0||j._status===-1){j._status=2,j._result=y1;var i1=j._ioInfo;i1!=null&&(i1.end=performance.now()),I1.status===void 0&&(I1.status="rejected",I1.reason=y1)}}),q1=j._ioInfo,q1!=null){q1.value=I1;var P1=I1.displayName;typeof P1==="string"&&(q1.name=P1)}j._status===-1&&(j._status=0,j._result=I1)}if(j._status===1)return q1=j._result,q1===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
1
|
+
var ZN=Object.create;var{getPrototypeOf:FN,defineProperty:VA,getOwnPropertyNames:XN}=Object;var KN=Object.prototype.hasOwnProperty;function HN(Q){return this[Q]}var YN,zN,s0=(Q,U,Z)=>{var K=Q!=null&&typeof Q==="object";if(K){var H=U?YN??=new WeakMap:zN??=new WeakMap,Y=H.get(Q);if(Y)return Y}Z=Q!=null?ZN(FN(Q)):{};let W=U||!Q||!Q.__esModule?VA(Z,"default",{value:Q,enumerable:!0}):Z;for(let L of XN(Q))if(!KN.call(W,L))VA(W,L,{get:HN.bind(Q,L),enumerable:!0});if(K)H.set(Q,W);return W};var o4=(Q,U)=>()=>(U||Q((U={exports:{}}).exports,U),U.exports);var yA=o4((WN)=>{(function(){function Q(){if(v=!1,u){var g=WN.unstable_now();s=g;var p=!0;try{_:{y=!1,N&&(N=!1,x(b),b=-1),C=!0;var c=S;try{J:{Y(g);for(V=Z(R);V!==null&&!(V.expirationTime>g&&L());){var l=V.callback;if(typeof l==="function"){V.callback=null,S=V.priorityLevel;var o=l(V.expirationTime<=g);if(g=WN.unstable_now(),typeof o==="function"){V.callback=o,Y(g),p=!0;break J}V===Z(R)&&K(R),Y(g)}else K(R);V=Z(R)}if(V!==null)p=!0;else{var k=Z(w);k!==null&&M(W,k.startTime-g),p=!1}}break _}finally{V=null,S=c,C=!1}p=void 0}}finally{p?U1():u=!1}}}function U(g,p){var c=g.length;g.push(p);_:for(;0<c;){var l=c-1>>>1,o=g[l];if(0<H(o,p))g[l]=p,g[c]=o,c=l;else break _}}function Z(g){return g.length===0?null:g[0]}function K(g){if(g.length===0)return null;var p=g[0],c=g.pop();if(c!==p){g[0]=c;_:for(var l=0,o=g.length,k=o>>>1;l<k;){var t=2*(l+1)-1,_1=g[t],a=t+1,H1=g[a];if(0>H(_1,c))a<o&&0>H(H1,_1)?(g[l]=H1,g[a]=c,l=a):(g[l]=_1,g[t]=c,l=t);else if(a<o&&0>H(H1,c))g[l]=H1,g[a]=c,l=a;else break _}}return p}function H(g,p){var c=g.sortIndex-p.sortIndex;return c!==0?c:g.id-p.id}function Y(g){for(var p=Z(w);p!==null;){if(p.callback===null)K(w);else if(p.startTime<=g)K(w),p.sortIndex=p.expirationTime,U(R,p);else break;p=Z(w)}}function W(g){if(N=!1,Y(g),!y)if(Z(R)!==null)y=!0,u||(u=!0,U1());else{var p=Z(w);p!==null&&M(W,p.startTime-g)}}function L(){return v?!0:WN.unstable_now()-s<m?!1:!0}function M(g,p){b=D(function(){g(WN.unstable_now())},p)}if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()),WN.unstable_now=void 0,typeof performance==="object"&&typeof performance.now==="function"){var O=performance;WN.unstable_now=function(){return O.now()}}else{var T=Date,A=T.now();WN.unstable_now=function(){return T.now()-A}}var R=[],w=[],P=1,V=null,S=3,C=!1,y=!1,N=!1,v=!1,D=typeof setTimeout==="function"?setTimeout:null,x=typeof clearTimeout==="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null,u=!1,b=-1,m=5,s=-1;if(typeof E==="function")var U1=function(){E(Q)};else if(typeof MessageChannel<"u"){var Q1=new MessageChannel,h=Q1.port2;Q1.port1.onmessage=Q,U1=function(){h.postMessage(null)}}else U1=function(){D(Q,0)};WN.unstable_IdlePriority=5,WN.unstable_ImmediatePriority=1,WN.unstable_LowPriority=4,WN.unstable_NormalPriority=3,WN.unstable_Profiling=null,WN.unstable_UserBlockingPriority=2,WN.unstable_cancelCallback=function(g){g.callback=null},WN.unstable_forceFrameRate=function(g){0>g||125<g?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):m=0<g?Math.floor(1000/g):5},WN.unstable_getCurrentPriorityLevel=function(){return S},WN.unstable_next=function(g){switch(S){case 1:case 2:case 3:var p=3;break;default:p=S}var c=S;S=p;try{return g()}finally{S=c}},WN.unstable_requestPaint=function(){v=!0},WN.unstable_runWithPriority=function(g,p){switch(g){case 1:case 2:case 3:case 4:case 5:break;default:g=3}var c=S;S=g;try{return p()}finally{S=c}},WN.unstable_scheduleCallback=function(g,p,c){var l=WN.unstable_now();switch(typeof c==="object"&&c!==null?(c=c.delay,c=typeof c==="number"&&0<c?l+c:l):c=l,g){case 1:var o=-1;break;case 2:o=250;break;case 5:o=1073741823;break;case 4:o=1e4;break;default:o=5000}return o=c+o,g={id:P++,callback:p,priorityLevel:g,startTime:c,expirationTime:o,sortIndex:-1},c>l?(g.sortIndex=c,U(w,g),Z(R)===null&&g===Z(w)&&(N?(x(b),b=-1):N=!0,M(W,c-l))):(g.sortIndex=o,U(R,g),y||C||(y=!0,u||(u=!0,U1()))),g},WN.unstable_shouldYield=L,WN.unstable_wrapCallback=function(g){var p=S;return function(){var c=S;S=p;try{return g.apply(this,arguments)}finally{S=c}}},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var B4=o4((LN,Bq)=>{(function(){function Q(j,q1){Object.defineProperty(K.prototype,j,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",q1[0],q1[1])}})}function U(j){if(j===null||typeof j!=="object")return null;return j=f1&&j[f1]||j["@@iterator"],typeof j==="function"?j:null}function Z(j,q1){j=(j=j.constructor)&&(j.displayName||j.name)||"ReactClass";var I1=j+"."+q1;z1[I1]||(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.",q1,j),z1[I1]=!0)}function K(j,q1,I1){this.props=j,this.context=q1,this.refs=c1,this.updater=I1||C1}function H(){}function Y(j,q1,I1){this.props=j,this.context=q1,this.refs=c1,this.updater=I1||C1}function W(){}function L(j){return""+j}function M(j){try{L(j);var q1=!1}catch(y1){q1=!0}if(q1){q1=console;var I1=q1.error,P1=typeof Symbol==="function"&&Symbol.toStringTag&&j[Symbol.toStringTag]||j.constructor.name||"Object";return I1.call(q1,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",P1),L(j)}}function O(j){if(j==null)return null;if(typeof j==="function")return j.$$typeof===e1?null:j.displayName||j.name||null;if(typeof j==="string")return j;switch(j){case o:return"Fragment";case t:return"Profiler";case k:return"StrictMode";case O1:return"Suspense";case L1:return"SuspenseList";case R1:return"Activity"}if(typeof j==="object")switch(typeof j.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),j.$$typeof){case l:return"Portal";case a:return j.displayName||"Context";case _1:return(j._context.displayName||"Context")+".Consumer";case H1:var q1=j.render;return j=j.displayName,j||(j=q1.displayName||q1.name||"",j=j!==""?"ForwardRef("+j+")":"ForwardRef"),j;case T1:return q1=j.displayName||null,q1!==null?q1:O(j.type)||"Memo";case G1:q1=j._payload,j=j._init;try{return O(j(q1))}catch(I1){}}return null}function T(j){if(j===o)return"<>";if(typeof j==="object"&&j!==null&&j.$$typeof===G1)return"<...>";try{var q1=O(j);return q1?"<"+q1+">":"<...>"}catch(I1){return"<...>"}}function A(){var j=k1.A;return j===null?null:j.getOwner()}function R(){return Error("react-stack-top-frame")}function w(j){if(g0.call(j,"key")){var q1=Object.getOwnPropertyDescriptor(j,"key").get;if(q1&&q1.isReactWarning)return!1}return j.key!==void 0}function P(j,q1){function I1(){t0||(t0=!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)",q1))}I1.isReactWarning=!0,Object.defineProperty(j,"key",{get:I1,configurable:!0})}function V(){var j=O(this.type);return u2[j]||(u2[j]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),j=this.props.ref,j!==void 0?j:null}function S(j,q1,I1,P1,y1,i1){var r1=I1.ref;return j={$$typeof:c,type:j,key:q1,props:I1,_owner:P1},(r1!==void 0?r1:null)!==null?Object.defineProperty(j,"ref",{enumerable:!1,get:V}):Object.defineProperty(j,"ref",{enumerable:!1,value:null}),j._store={},Object.defineProperty(j._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(j,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(j,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:y1}),Object.defineProperty(j,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:i1}),Object.freeze&&(Object.freeze(j.props),Object.freeze(j)),j}function C(j,q1){return q1=S(j.type,q1,j.props,j._owner,j._debugStack,j._debugTask),j._store&&(q1._store.validated=j._store.validated),q1}function y(j){N(j)?j._store&&(j._store.validated=1):typeof j==="object"&&j!==null&&j.$$typeof===G1&&(j._payload.status==="fulfilled"?N(j._payload.value)&&j._payload.value._store&&(j._payload.value._store.validated=1):j._store&&(j._store.validated=1))}function N(j){return typeof j==="object"&&j!==null&&j.$$typeof===c}function v(j){var q1={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(I1){return q1[I1]})}function D(j,q1){return typeof j==="object"&&j!==null&&j.key!=null?(M(j.key),v(""+j.key)):q1.toString(36)}function x(j){switch(j.status){case"fulfilled":return j.value;case"rejected":throw j.reason;default:switch(typeof j.status==="string"?j.then(W,W):(j.status="pending",j.then(function(q1){j.status==="pending"&&(j.status="fulfilled",j.value=q1)},function(q1){j.status==="pending"&&(j.status="rejected",j.reason=q1)})),j.status){case"fulfilled":return j.value;case"rejected":throw j.reason}}throw j}function E(j,q1,I1,P1,y1){var i1=typeof j;if(i1==="undefined"||i1==="boolean")j=null;var r1=!1;if(j===null)r1=!0;else switch(i1){case"bigint":case"string":case"number":r1=!0;break;case"object":switch(j.$$typeof){case c:case l:r1=!0;break;case G1:return r1=j._init,E(r1(j._payload),q1,I1,P1,y1)}}if(r1){r1=j,y1=y1(r1);var F0=P1===""?"."+D(r1,0):P1;return A1(y1)?(I1="",F0!=null&&(I1=F0.replace(G2,"$&/")+"/"),E(y1,q1,I1,"",function(K2){return K2})):y1!=null&&(N(y1)&&(y1.key!=null&&(r1&&r1.key===y1.key||M(y1.key)),I1=C(y1,I1+(y1.key==null||r1&&r1.key===y1.key?"":(""+y1.key).replace(G2,"$&/")+"/")+F0),P1!==""&&r1!=null&&N(r1)&&r1.key==null&&r1._store&&!r1._store.validated&&(I1._store.validated=2),y1=I1),q1.push(y1)),1}if(r1=0,F0=P1===""?".":P1+":",A1(j))for(var x1=0;x1<j.length;x1++)P1=j[x1],i1=F0+D(P1,x1),r1+=E(P1,q1,I1,i1,y1);else if(x1=U(j),typeof x1==="function")for(x1===j.entries&&(T2||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),T2=!0),j=x1.call(j),x1=0;!(P1=j.next()).done;)P1=P1.value,i1=F0+D(P1,x1++),r1+=E(P1,q1,I1,i1,y1);else if(i1==="object"){if(typeof j.then==="function")return E(x(j),q1,I1,P1,y1);throw q1=String(j),Error("Objects are not valid as a React child (found: "+(q1==="[object Object]"?"object with keys {"+Object.keys(j).join(", ")+"}":q1)+"). If you meant to render a collection of children, use an array instead.")}return r1}function u(j,q1,I1){if(j==null)return j;var P1=[],y1=0;return E(j,P1,"","",function(i1){return q1.call(I1,i1,y1++)}),P1}function b(j){if(j._status===-1){var q1=j._ioInfo;q1!=null&&(q1.start=q1.end=performance.now()),q1=j._result;var I1=q1();if(I1.then(function(y1){if(j._status===0||j._status===-1){j._status=1,j._result=y1;var i1=j._ioInfo;i1!=null&&(i1.end=performance.now()),I1.status===void 0&&(I1.status="fulfilled",I1.value=y1)}},function(y1){if(j._status===0||j._status===-1){j._status=2,j._result=y1;var i1=j._ioInfo;i1!=null&&(i1.end=performance.now()),I1.status===void 0&&(I1.status="rejected",I1.reason=y1)}}),q1=j._ioInfo,q1!=null){q1.value=I1;var P1=I1.displayName;typeof P1==="string"&&(q1.name=P1)}j._status===-1&&(j._status=0,j._result=I1)}if(j._status===1)return q1=j._result,q1===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,11 +6,11 @@ Your code should look like:
|
|
|
6
6
|
Did you accidentally put curly braces around the import?`,q1),"default"in q1||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'))`,q1),q1.default;throw j._result}function m(){var j=
|
|
9
|
+
const MyComponent = lazy(() => import('./MyComponent'))`,q1),q1.default;throw j._result}function m(){var j=k1.H;return j===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.`),j}function s(){D1.asyncTransitions--}function U1(j){if(X5===null)try{var q1=("require"+Math.random()).slice(0,7);X5=(Bq&&Bq[q1]).call(Bq,"timers").setImmediate}catch(I1){X5=function(P1){I4===!1&&(I4=!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 y1=new MessageChannel;y1.port1.onmessage=P1,y1.port2.postMessage(void 0)}}return X5(j)}function Q1(j){return 1<j.length&&typeof AggregateError==="function"?AggregateError(j):j[0]}function h(j,q1){q1!==x5-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. "),x5=q1}function g(j,q1,I1){var P1=D1.actQueue;if(P1!==null)if(P1.length!==0)try{p(P1),U1(function(){return g(j,q1,I1)});return}catch(y1){D1.thrownErrors.push(y1)}else D1.actQueue=null;0<D1.thrownErrors.length?(P1=Q1(D1.thrownErrors),D1.thrownErrors.length=0,I1(P1)):q1(j)}function p(j){if(!R5){R5=!0;var q1=0;try{for(;q1<j.length;q1++){var I1=j[q1];do{D1.didUsePromise=!1;var P1=I1(!1);if(P1!==null){if(D1.didUsePromise){j[q1]=I1,j.splice(0,q1);return}I1=P1}else break}while(1)}j.length=0}catch(y1){j.splice(0,q1+1),D1.thrownErrors.push(y1)}finally{R5=!1}}}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var c=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),t=Symbol.for("react.profiler"),_1=Symbol.for("react.consumer"),a=Symbol.for("react.context"),H1=Symbol.for("react.forward_ref"),O1=Symbol.for("react.suspense"),L1=Symbol.for("react.suspense_list"),T1=Symbol.for("react.memo"),G1=Symbol.for("react.lazy"),R1=Symbol.for("react.activity"),f1=Symbol.iterator,z1={},C1={isMounted:function(){return!1},enqueueForceUpdate:function(j){Z(j,"forceUpdate")},enqueueReplaceState:function(j){Z(j,"replaceState")},enqueueSetState:function(j){Z(j,"setState")}},b1=Object.assign,c1={};Object.freeze(c1),K.prototype.isReactComponent={},K.prototype.setState=function(j,q1){if(typeof j!=="object"&&typeof j!=="function"&&j!=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,j,q1,"setState")},K.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};var k1={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(O5 in k1)k1.hasOwnProperty(O5)&&Q(O5,k1[O5]);H.prototype=K.prototype,k1=Y.prototype=new H,k1.constructor=Y,b1(k1,K.prototype),k1.isPureReactComponent=!0;var A1=Array.isArray,e1=Symbol.for("react.client.reference"),D1={H:null,A:null,T:null,S:null,actQueue:null,asyncTransitions:0,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1,didUsePromise:!1,thrownErrors:[],getCurrentStack:null,recentlyCreatedOwnerStacks:0},g0=Object.prototype.hasOwnProperty,_0=console.createTask?console.createTask:function(){return null};k1={react_stack_bottom_frame:function(j){return j()}};var t0,C2,u2={},b2=k1.react_stack_bottom_frame.bind(k1,R)(),f2=_0(T(R)),T2=!1,G2=/\/+/g,R2=typeof reportError==="function"?reportError:function(j){if(typeof window==="object"&&typeof window.ErrorEvent==="function"){var q1=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof j==="object"&&j!==null&&typeof j.message==="string"?String(j.message):String(j),error:j});if(!window.dispatchEvent(q1))return}else if(typeof process==="object"&&typeof process.emit==="function"){process.emit("uncaughtException",j);return}console.error(j)},I4=!1,X5=null,x5=0,q4=!1,R5=!1,G3=typeof queueMicrotask==="function"?function(j){queueMicrotask(function(){return queueMicrotask(j)})}:U1;k1=Object.freeze({__proto__:null,c:function(j){return m().useMemoCache(j)}});var O5={map:u,forEach:function(j,q1,I1){u(j,function(){q1.apply(this,arguments)},I1)},count:function(j){var q1=0;return u(j,function(){q1++}),q1},toArray:function(j){return u(j,function(q1){return q1})||[]},only:function(j){if(!N(j))throw Error("React.Children.only expected to receive a single React element child.");return j}};LN.Activity=R1,LN.Children=O5,LN.Component=K,LN.Fragment=o,LN.Profiler=t,LN.PureComponent=Y,LN.StrictMode=k,LN.Suspense=O1,LN.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D1,LN.__COMPILER_RUNTIME=k1,LN.act=function(j){var q1=D1.actQueue,I1=x5;x5++;var P1=D1.actQueue=q1!==null?q1:[],y1=!1;try{var i1=j()}catch(x1){D1.thrownErrors.push(x1)}if(0<D1.thrownErrors.length)throw h(q1,I1),j=Q1(D1.thrownErrors),D1.thrownErrors.length=0,j;if(i1!==null&&typeof i1==="object"&&typeof i1.then==="function"){var r1=i1;return G3(function(){y1||q4||(q4=!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(x1,K2){y1=!0,r1.then(function(E2){if(h(q1,I1),I1===0){try{p(P1),U1(function(){return g(E2,x1,K2)})}catch(B1){D1.thrownErrors.push(B1)}if(0<D1.thrownErrors.length){var $1=Q1(D1.thrownErrors);D1.thrownErrors.length=0,K2($1)}}else x1(E2)},function(E2){h(q1,I1),0<D1.thrownErrors.length?(E2=Q1(D1.thrownErrors),D1.thrownErrors.length=0,K2(E2)):K2(E2)})}}}var F0=i1;if(h(q1,I1),I1===0&&(p(P1),P1.length!==0&&G3(function(){y1||q4||(q4=!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(() => ...)"))}),D1.actQueue=null),0<D1.thrownErrors.length)throw j=Q1(D1.thrownErrors),D1.thrownErrors.length=0,j;return{then:function(x1,K2){y1=!0,I1===0?(D1.actQueue=P1,U1(function(){return g(F0,x1,K2)})):x1(F0)}}},LN.cache=function(j){return function(){return j.apply(null,arguments)}},LN.cacheSignal=function(){return null},LN.captureOwnerStack=function(){var j=D1.getCurrentStack;return j===null?null:j()},LN.cloneElement=function(j,q1,I1){if(j===null||j===void 0)throw Error("The argument must be a React element, but you passed "+j+".");var P1=b1({},j.props),y1=j.key,i1=j._owner;if(q1!=null){var r1;_:{if(g0.call(q1,"ref")&&(r1=Object.getOwnPropertyDescriptor(q1,"ref").get)&&r1.isReactWarning){r1=!1;break _}r1=q1.ref!==void 0}r1&&(i1=A()),w(q1)&&(M(q1.key),y1=""+q1.key);for(F0 in q1)!g0.call(q1,F0)||F0==="key"||F0==="__self"||F0==="__source"||F0==="ref"&&q1.ref===void 0||(P1[F0]=q1[F0])}var F0=arguments.length-2;if(F0===1)P1.children=I1;else if(1<F0){r1=Array(F0);for(var x1=0;x1<F0;x1++)r1[x1]=arguments[x1+2];P1.children=r1}P1=S(j.type,y1,P1,i1,j._debugStack,j._debugTask);for(y1=2;y1<arguments.length;y1++)y(arguments[y1]);return P1},LN.createContext=function(j){return j={$$typeof:a,_currentValue:j,_currentValue2:j,_threadCount:0,Provider:null,Consumer:null},j.Provider=j,j.Consumer={$$typeof:_1,_context:j},j._currentRenderer=null,j._currentRenderer2=null,j},LN.createElement=function(j,q1,I1){for(var P1=2;P1<arguments.length;P1++)y(arguments[P1]);P1={};var y1=null;if(q1!=null)for(x1 in C2||!("__self"in q1)||"key"in q1||(C2=!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")),w(q1)&&(M(q1.key),y1=""+q1.key),q1)g0.call(q1,x1)&&x1!=="key"&&x1!=="__self"&&x1!=="__source"&&(P1[x1]=q1[x1]);var i1=arguments.length-2;if(i1===1)P1.children=I1;else if(1<i1){for(var r1=Array(i1),F0=0;F0<i1;F0++)r1[F0]=arguments[F0+2];Object.freeze&&Object.freeze(r1),P1.children=r1}if(j&&j.defaultProps)for(x1 in i1=j.defaultProps,i1)P1[x1]===void 0&&(P1[x1]=i1[x1]);y1&&P(P1,typeof j==="function"?j.displayName||j.name||"Unknown":j);var x1=1e4>D1.recentlyCreatedOwnerStacks++;return S(j,y1,P1,A(),x1?Error("react-stack-top-frame"):b2,x1?_0(T(j)):f2)},LN.createRef=function(){var j={current:null};return Object.seal(j),j},LN.forwardRef=function(j){j!=null&&j.$$typeof===T1?console.error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof j!=="function"?console.error("forwardRef requires a render function but was given %s.",j===null?"null":typeof j):j.length!==0&&j.length!==2&&console.error("forwardRef render functions accept exactly two parameters: props and ref. %s",j.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),j!=null&&j.defaultProps!=null&&console.error("forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?");var q1={$$typeof:H1,render:j},I1;return Object.defineProperty(q1,"displayName",{enumerable:!1,configurable:!0,get:function(){return I1},set:function(P1){I1=P1,j.name||j.displayName||(Object.defineProperty(j,"name",{value:P1}),j.displayName=P1)}}),q1},LN.isValidElement=N,LN.lazy=function(j){j={_status:-1,_result:j};var q1={$$typeof:G1,_payload:j,_init:b},I1={name:"lazy",start:-1,end:-1,value:null,owner:null,debugStack:Error("react-stack-top-frame"),debugTask:console.createTask?console.createTask("lazy()"):null};return j._ioInfo=I1,q1._debugInfo=[{awaited:I1}],q1},LN.memo=function(j,q1){j==null&&console.error("memo: The first argument must be a component. Instead received: %s",j===null?"null":typeof j),q1={$$typeof:T1,type:j,compare:q1===void 0?null:q1};var I1;return Object.defineProperty(q1,"displayName",{enumerable:!1,configurable:!0,get:function(){return I1},set:function(P1){I1=P1,j.name||j.displayName||(Object.defineProperty(j,"name",{value:P1}),j.displayName=P1)}}),q1},LN.startTransition=function(j){var q1=D1.T,I1={};I1._updatedFibers=new Set,D1.T=I1;try{var P1=j(),y1=D1.S;y1!==null&&y1(I1,P1),typeof P1==="object"&&P1!==null&&typeof P1.then==="function"&&(D1.asyncTransitions++,P1.then(s,s),P1.then(W,R2))}catch(i1){R2(i1)}finally{q1===null&&I1._updatedFibers&&(j=I1._updatedFibers.size,I1._updatedFibers.clear(),10<j&&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.")),q1!==null&&I1.types!==null&&(q1.types!==null&&q1.types!==I1.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."),q1.types=I1.types),D1.T=q1}},LN.unstable_useCacheRefresh=function(){return m().useCacheRefresh()},LN.use=function(j){return m().use(j)},LN.useActionState=function(j,q1,I1){return m().useActionState(j,q1,I1)},LN.useCallback=function(j,q1){return m().useCallback(j,q1)},LN.useContext=function(j){var q1=m();return j.$$typeof===_1&&console.error("Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"),q1.useContext(j)},LN.useDebugValue=function(j,q1){return m().useDebugValue(j,q1)},LN.useDeferredValue=function(j,q1){return m().useDeferredValue(j,q1)},LN.useEffect=function(j,q1){return j==null&&console.warn("React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"),m().useEffect(j,q1)},LN.useEffectEvent=function(j){return m().useEffectEvent(j)},LN.useId=function(){return m().useId()},LN.useImperativeHandle=function(j,q1,I1){return m().useImperativeHandle(j,q1,I1)},LN.useInsertionEffect=function(j,q1){return j==null&&console.warn("React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"),m().useInsertionEffect(j,q1)},LN.useLayoutEffect=function(j,q1){return j==null&&console.warn("React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"),m().useLayoutEffect(j,q1)},LN.useMemo=function(j,q1){return m().useMemo(j,q1)},LN.useOptimistic=function(j,q1){return m().useOptimistic(j,q1)},LN.useReducer=function(j,q1,I1){return m().useReducer(j,q1,I1)},LN.useRef=function(j){return m().useRef(j)},LN.useState=function(j){return m().useState(j)},LN.useSyncExternalStore=function(j,q1,I1){return m().useSyncExternalStore(j,q1,I1)},LN.useTransition=function(){return m().useTransition()},LN.version="19.2.7",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var kA=o4((BN)=>{var lF=s0(B4());(function(){function Q(){}function U(T){return""+T}function Z(T,A,R){var w=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;try{U(w);var P=!1}catch(V){P=!0}return P&&(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&&w[Symbol.toStringTag]||w.constructor.name||"Object"),U(w)),{$$typeof:M,key:w==null?null:""+w,children:T,containerInfo:A,implementation:R}}function K(T,A){if(T==="font")return"";if(typeof A==="string")return A==="use-credentials"?A:""}function H(T){return T===null?"`null`":T===void 0?"`undefined`":T===""?"an empty string":'something with type "'+typeof T+'"'}function Y(T){return T===null?"`null`":T===void 0?"`undefined`":T===""?"an empty string":typeof T==="string"?JSON.stringify(T):typeof T==="number"?"`"+T+"`":'something with type "'+typeof T+'"'}function W(){var T=O.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:
|
|
13
|
+
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),j}function s(){k1.asyncTransitions--}function U1(j){if(X5===null)try{var q1=("require"+Math.random()).slice(0,7);X5=(Bq&&Bq[q1]).call(Bq,"timers").setImmediate}catch(I1){X5=function(P1){I4===!1&&(I4=!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 y1=new MessageChannel;y1.port1.onmessage=P1,y1.port2.postMessage(void 0)}}return X5(j)}function Q1(j){return 1<j.length&&typeof AggregateError==="function"?AggregateError(j):j[0]}function h(j,q1){q1!==x5-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. "),x5=q1}function g(j,q1,I1){var P1=k1.actQueue;if(P1!==null)if(P1.length!==0)try{p(P1),U1(function(){return g(j,q1,I1)});return}catch(y1){k1.thrownErrors.push(y1)}else k1.actQueue=null;0<k1.thrownErrors.length?(P1=Q1(k1.thrownErrors),k1.thrownErrors.length=0,I1(P1)):q1(j)}function p(j){if(!R5){R5=!0;var q1=0;try{for(;q1<j.length;q1++){var I1=j[q1];do{k1.didUsePromise=!1;var P1=I1(!1);if(P1!==null){if(k1.didUsePromise){j[q1]=I1,j.splice(0,q1);return}I1=P1}else break}while(1)}j.length=0}catch(y1){j.splice(0,q1+1),k1.thrownErrors.push(y1)}finally{R5=!1}}}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var c=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),t=Symbol.for("react.profiler"),_1=Symbol.for("react.consumer"),a=Symbol.for("react.context"),H1=Symbol.for("react.forward_ref"),O1=Symbol.for("react.suspense"),L1=Symbol.for("react.suspense_list"),T1=Symbol.for("react.memo"),G1=Symbol.for("react.lazy"),R1=Symbol.for("react.activity"),f1=Symbol.iterator,z1={},C1={isMounted:function(){return!1},enqueueForceUpdate:function(j){Z(j,"forceUpdate")},enqueueReplaceState:function(j){Z(j,"replaceState")},enqueueSetState:function(j){Z(j,"setState")}},b1=Object.assign,c1={};Object.freeze(c1),K.prototype.isReactComponent={},K.prototype.setState=function(j,q1){if(typeof j!=="object"&&typeof j!=="function"&&j!=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,j,q1,"setState")},K.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};var D1={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(O5 in D1)D1.hasOwnProperty(O5)&&Q(O5,D1[O5]);H.prototype=K.prototype,D1=Y.prototype=new H,D1.constructor=Y,b1(D1,K.prototype),D1.isPureReactComponent=!0;var A1=Array.isArray,e1=Symbol.for("react.client.reference"),k1={H:null,A:null,T:null,S:null,actQueue:null,asyncTransitions:0,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1,didUsePromise:!1,thrownErrors:[],getCurrentStack:null,recentlyCreatedOwnerStacks:0},g0=Object.prototype.hasOwnProperty,_0=console.createTask?console.createTask:function(){return null};D1={react_stack_bottom_frame:function(j){return j()}};var t0,C2,u2={},b2=D1.react_stack_bottom_frame.bind(D1,R)(),f2=_0(T(R)),T2=!1,G2=/\/+/g,R2=typeof reportError==="function"?reportError:function(j){if(typeof window==="object"&&typeof window.ErrorEvent==="function"){var q1=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof j==="object"&&j!==null&&typeof j.message==="string"?String(j.message):String(j),error:j});if(!window.dispatchEvent(q1))return}else if(typeof process==="object"&&typeof process.emit==="function"){process.emit("uncaughtException",j);return}console.error(j)},I4=!1,X5=null,x5=0,q4=!1,R5=!1,G3=typeof queueMicrotask==="function"?function(j){queueMicrotask(function(){return queueMicrotask(j)})}:U1;D1=Object.freeze({__proto__:null,c:function(j){return m().useMemoCache(j)}});var O5={map:u,forEach:function(j,q1,I1){u(j,function(){q1.apply(this,arguments)},I1)},count:function(j){var q1=0;return u(j,function(){q1++}),q1},toArray:function(j){return u(j,function(q1){return q1})||[]},only:function(j){if(!N(j))throw Error("React.Children.only expected to receive a single React element child.");return j}};LN.Activity=R1,LN.Children=O5,LN.Component=K,LN.Fragment=o,LN.Profiler=t,LN.PureComponent=Y,LN.StrictMode=k,LN.Suspense=O1,LN.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=k1,LN.__COMPILER_RUNTIME=D1,LN.act=function(j){var q1=k1.actQueue,I1=x5;x5++;var P1=k1.actQueue=q1!==null?q1:[],y1=!1;try{var i1=j()}catch(x1){k1.thrownErrors.push(x1)}if(0<k1.thrownErrors.length)throw h(q1,I1),j=Q1(k1.thrownErrors),k1.thrownErrors.length=0,j;if(i1!==null&&typeof i1==="object"&&typeof i1.then==="function"){var r1=i1;return G3(function(){y1||q4||(q4=!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(x1,K2){y1=!0,r1.then(function(E2){if(h(q1,I1),I1===0){try{p(P1),U1(function(){return g(E2,x1,K2)})}catch(B1){k1.thrownErrors.push(B1)}if(0<k1.thrownErrors.length){var $1=Q1(k1.thrownErrors);k1.thrownErrors.length=0,K2($1)}}else x1(E2)},function(E2){h(q1,I1),0<k1.thrownErrors.length?(E2=Q1(k1.thrownErrors),k1.thrownErrors.length=0,K2(E2)):K2(E2)})}}}var F0=i1;if(h(q1,I1),I1===0&&(p(P1),P1.length!==0&&G3(function(){y1||q4||(q4=!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(() => ...)"))}),k1.actQueue=null),0<k1.thrownErrors.length)throw j=Q1(k1.thrownErrors),k1.thrownErrors.length=0,j;return{then:function(x1,K2){y1=!0,I1===0?(k1.actQueue=P1,U1(function(){return g(F0,x1,K2)})):x1(F0)}}},LN.cache=function(j){return function(){return j.apply(null,arguments)}},LN.cacheSignal=function(){return null},LN.captureOwnerStack=function(){var j=k1.getCurrentStack;return j===null?null:j()},LN.cloneElement=function(j,q1,I1){if(j===null||j===void 0)throw Error("The argument must be a React element, but you passed "+j+".");var P1=b1({},j.props),y1=j.key,i1=j._owner;if(q1!=null){var r1;_:{if(g0.call(q1,"ref")&&(r1=Object.getOwnPropertyDescriptor(q1,"ref").get)&&r1.isReactWarning){r1=!1;break _}r1=q1.ref!==void 0}r1&&(i1=A()),w(q1)&&(M(q1.key),y1=""+q1.key);for(F0 in q1)!g0.call(q1,F0)||F0==="key"||F0==="__self"||F0==="__source"||F0==="ref"&&q1.ref===void 0||(P1[F0]=q1[F0])}var F0=arguments.length-2;if(F0===1)P1.children=I1;else if(1<F0){r1=Array(F0);for(var x1=0;x1<F0;x1++)r1[x1]=arguments[x1+2];P1.children=r1}P1=S(j.type,y1,P1,i1,j._debugStack,j._debugTask);for(y1=2;y1<arguments.length;y1++)y(arguments[y1]);return P1},LN.createContext=function(j){return j={$$typeof:a,_currentValue:j,_currentValue2:j,_threadCount:0,Provider:null,Consumer:null},j.Provider=j,j.Consumer={$$typeof:_1,_context:j},j._currentRenderer=null,j._currentRenderer2=null,j},LN.createElement=function(j,q1,I1){for(var P1=2;P1<arguments.length;P1++)y(arguments[P1]);P1={};var y1=null;if(q1!=null)for(x1 in C2||!("__self"in q1)||"key"in q1||(C2=!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")),w(q1)&&(M(q1.key),y1=""+q1.key),q1)g0.call(q1,x1)&&x1!=="key"&&x1!=="__self"&&x1!=="__source"&&(P1[x1]=q1[x1]);var i1=arguments.length-2;if(i1===1)P1.children=I1;else if(1<i1){for(var r1=Array(i1),F0=0;F0<i1;F0++)r1[F0]=arguments[F0+2];Object.freeze&&Object.freeze(r1),P1.children=r1}if(j&&j.defaultProps)for(x1 in i1=j.defaultProps,i1)P1[x1]===void 0&&(P1[x1]=i1[x1]);y1&&P(P1,typeof j==="function"?j.displayName||j.name||"Unknown":j);var x1=1e4>k1.recentlyCreatedOwnerStacks++;return S(j,y1,P1,A(),x1?Error("react-stack-top-frame"):b2,x1?_0(T(j)):f2)},LN.createRef=function(){var j={current:null};return Object.seal(j),j},LN.forwardRef=function(j){j!=null&&j.$$typeof===T1?console.error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof j!=="function"?console.error("forwardRef requires a render function but was given %s.",j===null?"null":typeof j):j.length!==0&&j.length!==2&&console.error("forwardRef render functions accept exactly two parameters: props and ref. %s",j.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),j!=null&&j.defaultProps!=null&&console.error("forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?");var q1={$$typeof:H1,render:j},I1;return Object.defineProperty(q1,"displayName",{enumerable:!1,configurable:!0,get:function(){return I1},set:function(P1){I1=P1,j.name||j.displayName||(Object.defineProperty(j,"name",{value:P1}),j.displayName=P1)}}),q1},LN.isValidElement=N,LN.lazy=function(j){j={_status:-1,_result:j};var q1={$$typeof:G1,_payload:j,_init:b},I1={name:"lazy",start:-1,end:-1,value:null,owner:null,debugStack:Error("react-stack-top-frame"),debugTask:console.createTask?console.createTask("lazy()"):null};return j._ioInfo=I1,q1._debugInfo=[{awaited:I1}],q1},LN.memo=function(j,q1){j==null&&console.error("memo: The first argument must be a component. Instead received: %s",j===null?"null":typeof j),q1={$$typeof:T1,type:j,compare:q1===void 0?null:q1};var I1;return Object.defineProperty(q1,"displayName",{enumerable:!1,configurable:!0,get:function(){return I1},set:function(P1){I1=P1,j.name||j.displayName||(Object.defineProperty(j,"name",{value:P1}),j.displayName=P1)}}),q1},LN.startTransition=function(j){var q1=k1.T,I1={};I1._updatedFibers=new Set,k1.T=I1;try{var P1=j(),y1=k1.S;y1!==null&&y1(I1,P1),typeof P1==="object"&&P1!==null&&typeof P1.then==="function"&&(k1.asyncTransitions++,P1.then(s,s),P1.then(W,R2))}catch(i1){R2(i1)}finally{q1===null&&I1._updatedFibers&&(j=I1._updatedFibers.size,I1._updatedFibers.clear(),10<j&&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.")),q1!==null&&I1.types!==null&&(q1.types!==null&&q1.types!==I1.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."),q1.types=I1.types),k1.T=q1}},LN.unstable_useCacheRefresh=function(){return m().useCacheRefresh()},LN.use=function(j){return m().use(j)},LN.useActionState=function(j,q1,I1){return m().useActionState(j,q1,I1)},LN.useCallback=function(j,q1){return m().useCallback(j,q1)},LN.useContext=function(j){var q1=m();return j.$$typeof===_1&&console.error("Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"),q1.useContext(j)},LN.useDebugValue=function(j,q1){return m().useDebugValue(j,q1)},LN.useDeferredValue=function(j,q1){return m().useDeferredValue(j,q1)},LN.useEffect=function(j,q1){return j==null&&console.warn("React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"),m().useEffect(j,q1)},LN.useEffectEvent=function(j){return m().useEffectEvent(j)},LN.useId=function(){return m().useId()},LN.useImperativeHandle=function(j,q1,I1){return m().useImperativeHandle(j,q1,I1)},LN.useInsertionEffect=function(j,q1){return j==null&&console.warn("React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"),m().useInsertionEffect(j,q1)},LN.useLayoutEffect=function(j,q1){return j==null&&console.warn("React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"),m().useLayoutEffect(j,q1)},LN.useMemo=function(j,q1){return m().useMemo(j,q1)},LN.useOptimistic=function(j,q1){return m().useOptimistic(j,q1)},LN.useReducer=function(j,q1,I1){return m().useReducer(j,q1,I1)},LN.useRef=function(j){return m().useRef(j)},LN.useState=function(j){return m().useState(j)},LN.useSyncExternalStore=function(j,q1,I1){return m().useSyncExternalStore(j,q1,I1)},LN.useTransition=function(){return m().useTransition()},LN.version="19.2.7",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var kA=o4((BN)=>{var lF=s0(B4());(function(){function Q(){}function U(T){return""+T}function Z(T,A,R){var w=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;try{U(w);var P=!1}catch(V){P=!0}return P&&(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&&w[Symbol.toStringTag]||w.constructor.name||"Object"),U(w)),{$$typeof:M,key:w==null?null:""+w,children:T,containerInfo:A,implementation:R}}function K(T,A){if(T==="font")return"";if(typeof A==="string")return A==="use-credentials"?A:""}function H(T){return T===null?"`null`":T===void 0?"`undefined`":T===""?"an empty string":'something with type "'+typeof T+'"'}function Y(T){return T===null?"`null`":T===void 0?"`undefined`":T===""?"an empty string":typeof T==="string"?JSON.stringify(T):typeof T==="number"?"`"+T+"`":'something with type "'+typeof T+'"'}function W(){var T=O.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:
|
|
14
14
|
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
15
15
|
2. You might be breaking the Rules of Hooks
|
|
16
16
|
3. You might have more than one copy of React in the same app
|
|
@@ -30,7 +30,7 @@ Error generating stack: `+N1.message+`
|
|
|
30
30
|
`+G)}}else if(_.debugStack!=null){var X=_.debugStack;(_=_.owner)&&X&&(J+=`
|
|
31
31
|
`+a(X))}else break;var z=J}catch(B){z=`
|
|
32
32
|
Error generating stack: `+B.message+`
|
|
33
|
-
`+B.stack}return z}function z1(_,J,$,q,G,X,z){var B=j5;C1(_);try{return _!==null&&_._debugTask?_._debugTask.run(J.bind(null,$,q,G,X,z)):J($,q,G,X,z)}finally{C1(B)}throw Error("runWithFiberInDEV should never be called in production. This is a bug in React.")}function C1(_){Y1.getCurrentStack=_===null?null:f1,g4=!1,j5=_}function b1(_){return typeof Symbol==="function"&&Symbol.toStringTag&&_[Symbol.toStringTag]||_.constructor.name||"Object"}function c1(_){try{return k1(_),!1}catch(J){return!0}}function k1(_){return""+_}function A1(_,J){if(c1(_))return console.error("The provided `%s` attribute is an unsupported type %s. This value must be coerced to a string before using it here.",J,b1(_)),k1(_)}function e1(_,J){if(c1(_))return console.error("The provided `%s` CSS property is an unsupported type %s. This value must be coerced to a string before using it here.",J,b1(_)),k1(_)}function D1(_){if(c1(_))return console.error("Form field values (value, checked, defaultValue, or defaultChecked props) must be strings, not %s. This value must be coerced to a string before using it here.",b1(_)),k1(_)}function g0(_){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")return!1;var J=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(J.isDisabled)return!0;if(!J.supportsFiber)return console.error("The installed version of React DevTools is too old and will not work with the current version of React. Please update React DevTools. https://react.dev/link/react-devtools"),!0;try{S7=J.inject(_),i2=J}catch($){console.error("React instrumentation encountered an error: %o.",$)}return J.checkDCE?!0:!1}function _0(_){if(typeof Pw==="function"&&Nw(_),i2&&typeof i2.setStrictMode==="function")try{i2.setStrictMode(S7,_)}catch(J){p4||(p4=!0,console.error("React instrumentation encountered an error: %o",J))}}function t0(_){return _>>>=0,_===0?32:31-(Cw(_)/fw|0)|0}function C2(_){var J=_&42;if(J!==0)return J;switch(_&-_){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return _&261888;case 262144:case 524288:case 1048576:case 2097152:return _&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return _&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return console.error("Should have found matching lanes. This is a bug in React."),_}}function u2(_,J,$){var q=_.pendingLanes;if(q===0)return 0;var G=0,X=_.suspendedLanes,z=_.pingedLanes;_=_.warmLanes;var B=q&134217727;return B!==0?(q=B&~X,q!==0?G=C2(q):(z&=B,z!==0?G=C2(z):$||($=B&~_,$!==0&&(G=C2($))))):(B=q&~X,B!==0?G=C2(B):z!==0?G=C2(z):$||($=q&~_,$!==0&&(G=C2($)))),G===0?0:J!==0&&J!==G&&(J&X)===0&&(X=G&-G,$=J&-J,X>=$||X===32&&($&4194048)!==0)?J:G}function b2(_,J){return(_.pendingLanes&~(_.suspendedLanes&~_.pingedLanes)&J)===0}function f2(_,J){switch(_){case 1:case 2:case 4:case 8:case 64:return J+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return J+5000;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return console.error("Should have found matching lanes. This is a bug in React."),-1}}function T2(){var _=LQ;return LQ<<=1,(LQ&62914560)===0&&(LQ=4194304),_}function G2(_){for(var J=[],$=0;31>$;$++)J.push(_);return J}function R2(_,J){_.pendingLanes|=J,J!==268435456&&(_.suspendedLanes=0,_.pingedLanes=0,_.warmLanes=0)}function I4(_,J,$,q,G,X){var z=_.pendingLanes;_.pendingLanes=$,_.suspendedLanes=0,_.pingedLanes=0,_.warmLanes=0,_.expiredLanes&=$,_.entangledLanes&=$,_.errorRecoveryDisabledLanes&=$,_.shellSuspendCounter=0;var{entanglements:B,expirationTimes:I,hiddenUpdates:f}=_;for($=z&~$;0<$;){var e=31-e2($),J1=1<<e;B[e]=0,I[e]=-1;var d=f[e];if(d!==null)for(f[e]=null,e=0;e<d.length;e++){var Z1=d[e];Z1!==null&&(Z1.lane&=-536870913)}$&=~J1}q!==0&&X5(_,q,0),X!==0&&G===0&&_.tag!==0&&(_.suspendedLanes|=X&~(z&~J))}function X5(_,J,$){_.pendingLanes|=J,_.suspendedLanes&=~J;var q=31-e2(J);_.entangledLanes|=J,_.entanglements[q]=_.entanglements[q]|1073741824|$&261930}function x5(_,J){var $=_.entangledLanes|=J;for(_=_.entanglements;$;){var q=31-e2($),G=1<<q;G&J|_[q]&J&&(_[q]|=J),$&=~G}}function q4(_,J){var $=J&-J;return $=($&42)!==0?1:R5($),($&(_.suspendedLanes|J))!==0?0:$}function R5(_){switch(_){case 2:_=1;break;case 8:_=4;break;case 32:_=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:_=128;break;case 268435456:_=134217728;break;default:_=0}return _}function G3(_,J,$){if(c4)for(_=_.pendingUpdatersLaneMap;0<$;){var q=31-e2($),G=1<<q;_[q].add(J),$&=~G}}function O5(_,J){if(c4)for(var{pendingUpdatersLaneMap:$,memoizedUpdaters:q}=_;0<J;){var G=31-e2(J);_=1<<G,G=$[G],0<G.size&&(G.forEach(function(X){var z=X.alternate;z!==null&&q.has(z)||q.add(X)}),G.clear()),J&=~_}}function j(_){return _&=-_,V5!==0&&V5<_?X4!==0&&X4<_?(_&134217727)!==0?l4:BQ:X4:V5}function q1(){var _=C0.p;if(_!==0)return _;return _=window.event,_===void 0?l4:EW(_.type)}function I1(_,J){var $=C0.p;try{return C0.p=_,J()}finally{C0.p=$}}function P1(_){delete _[g2],delete _[_5],delete _[jZ],delete _[Sw],delete _[vw]}function y1(_){var J=_[g2];if(J)return J;for(var $=_.parentNode;$;){if(J=$[z6]||$[g2]){if($=J.alternate,J.child!==null||$!==null&&$.child!==null)for(_=wW(_);_!==null;){if($=_[g2])return $;_=wW(_)}return J}_=$,$=_.parentNode}return null}function i1(_){if(_=_[g2]||_[z6]){var J=_.tag;if(J===5||J===6||J===13||J===31||J===26||J===27||J===3)return _}return null}function r1(_){var J=_.tag;if(J===5||J===26||J===27||J===6)return _.stateNode;throw Error("getNodeFromInstance: Invalid argument.")}function F0(_){var J=_[eW];return J||(J=_[eW]={hoistableStyles:new Map,hoistableScripts:new Map}),J}function x1(_){_[T_]=!0}function K2(_,J){E2(_,J),E2(_+"Capture",J)}function E2(_,J){K8[_]&&console.error("EventRegistry: More than one plugin attempted to publish the same registration name, `%s`.",_),K8[_]=J;var $=_.toLowerCase();VZ[$]=_,_==="onDoubleClick"&&(VZ.ondblclick=_);for(_=0;_<J.length;_++)_L.add(J[_])}function $1(_,J){jw[J.type]||J.onChange||J.onInput||J.readOnly||J.disabled||J.value==null||(_==="select"?console.error("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set `onChange`."):console.error("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`.")),J.onChange||J.readOnly||J.disabled||J.checked==null||console.error("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.")}function B1(_){if(F4.call($L,_))return!0;if(F4.call(JL,_))return!1;if(Vw.test(_))return $L[_]=!0;return JL[_]=!0,console.error("Invalid attribute name: `%s`",_),!1}function v1(_,J,$){if(B1(J)){if(!_.hasAttribute(J)){switch(typeof $){case"symbol":case"object":return $;case"function":return $;case"boolean":if($===!1)return $}return $===void 0?void 0:null}if(_=_.getAttribute(J),_===""&&$===!0)return!0;return A1($,J),_===""+$?$:_}}function V1(_,J,$){if(B1(J))if($===null)_.removeAttribute(J);else{switch(typeof $){case"undefined":case"function":case"symbol":_.removeAttribute(J);return;case"boolean":var q=J.toLowerCase().slice(0,5);if(q!=="data-"&&q!=="aria-"){_.removeAttribute(J);return}}A1($,J),_.setAttribute(J,""+$)}}function Q0(_,J,$){if($===null)_.removeAttribute(J);else{switch(typeof $){case"undefined":case"function":case"symbol":case"boolean":_.removeAttribute(J);return}A1($,J),_.setAttribute(J,""+$)}}function u1(_,J,$,q){if(q===null)_.removeAttribute($);else{switch(typeof q){case"undefined":case"function":case"symbol":case"boolean":_.removeAttribute($);return}A1(q,$),_.setAttributeNS(J,$,""+q)}}function m1(_){switch(typeof _){case"bigint":case"boolean":case"number":case"string":case"undefined":return _;case"object":return D1(_),_;default:return""}}function J0(_){var J=_.type;return(_=_.nodeName)&&_.toLowerCase()==="input"&&(J==="checkbox"||J==="radio")}function T0(_,J,$){var q=Object.getOwnPropertyDescriptor(_.constructor.prototype,J);if(!_.hasOwnProperty(J)&&typeof q<"u"&&typeof q.get==="function"&&typeof q.set==="function"){var{get:G,set:X}=q;return Object.defineProperty(_,J,{configurable:!0,get:function(){return G.call(this)},set:function(z){D1(z),$=""+z,X.call(this,z)}}),Object.defineProperty(_,J,{enumerable:q.enumerable}),{getValue:function(){return $},setValue:function(z){D1(z),$=""+z},stopTracking:function(){_._valueTracker=null,delete _[J]}}}}function Z2(_){if(!_._valueTracker){var J=J0(_)?"checked":"value";_._valueTracker=T0(_,J,""+_[J])}}function K0(_){if(!_)return!1;var J=_._valueTracker;if(!J)return!0;var $=J.getValue(),q="";return _&&(q=J0(_)?_.checked?"true":"false":_.value),_=q,_!==$?(J.setValue(_),!0):!1}function S2(_){if(_=_||(typeof document<"u"?document:void 0),typeof _>"u")return null;try{return _.activeElement||_.body}catch(J){return _.body}}function w0(_){return _.replace(yw,function(J){return"\\"+J.charCodeAt(0).toString(16)+" "})}function Z7(_,J){J.checked===void 0||J.defaultChecked===void 0||qL||(console.error("%s contains an input of type %s with both checked and defaultChecked props. Input elements must be either controlled or uncontrolled (specify either the checked prop, or the defaultChecked prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://react.dev/link/controlled-components",R1()||"A component",J.type),qL=!0),J.value===void 0||J.defaultValue===void 0||QL||(console.error("%s contains an input of type %s with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://react.dev/link/controlled-components",R1()||"A component",J.type),QL=!0)}function K5(_,J,$,q,G,X,z,B){if(_.name="",z!=null&&typeof z!=="function"&&typeof z!=="symbol"&&typeof z!=="boolean"?(A1(z,"type"),_.type=z):_.removeAttribute("type"),J!=null)if(z==="number"){if(J===0&&_.value===""||_.value!=J)_.value=""+m1(J)}else _.value!==""+m1(J)&&(_.value=""+m1(J));else z!=="submit"&&z!=="reset"||_.removeAttribute("value");J!=null?F7(_,z,m1(J)):$!=null?F7(_,z,m1($)):q!=null&&_.removeAttribute("value"),G==null&&X!=null&&(_.defaultChecked=!!X),G!=null&&(_.checked=G&&typeof G!=="function"&&typeof G!=="symbol"),B!=null&&typeof B!=="function"&&typeof B!=="symbol"&&typeof B!=="boolean"?(A1(B,"name"),_.name=""+m1(B)):_.removeAttribute("name")}function V0(_,J,$,q,G,X,z,B){if(X!=null&&typeof X!=="function"&&typeof X!=="symbol"&&typeof X!=="boolean"&&(A1(X,"type"),_.type=X),J!=null||$!=null){if(!(X!=="submit"&&X!=="reset"||J!==void 0&&J!==null)){Z2(_);return}$=$!=null?""+m1($):"",J=J!=null?""+m1(J):$,B||J===_.value||(_.value=J),_.defaultValue=J}q=q!=null?q:G,q=typeof q!=="function"&&typeof q!=="symbol"&&!!q,_.checked=B?_.checked:!!q,_.defaultChecked=!!q,z!=null&&typeof z!=="function"&&typeof z!=="symbol"&&typeof z!=="boolean"&&(A1(z,"name"),_.name=z),Z2(_)}function F7(_,J,$){J==="number"&&S2(_.ownerDocument)===_||_.defaultValue===""+$||(_.defaultValue=""+$)}function sJ(_,J){J.value==null&&(typeof J.children==="object"&&J.children!==null?F9.Children.forEach(J.children,function($){$==null||typeof $==="string"||typeof $==="number"||typeof $==="bigint"||GL||(GL=!0,console.error("Cannot infer the option value of complex children. Pass a `value` prop or use a plain string as children to <option>."))}):J.dangerouslySetInnerHTML==null||ZL||(ZL=!0,console.error("Pass a `value` prop if you set dangerouslyInnerHTML so React knows which value should be selected."))),J.selected==null||UL||(console.error("Use the `defaultValue` or `value` props on <select> instead of setting `selected` on <option>."),UL=!0)}function tJ(){var _=R1();return _?`
|
|
33
|
+
`+B.stack}return z}function z1(_,J,$,q,G,X,z){var B=j5;C1(_);try{return _!==null&&_._debugTask?_._debugTask.run(J.bind(null,$,q,G,X,z)):J($,q,G,X,z)}finally{C1(B)}throw Error("runWithFiberInDEV should never be called in production. This is a bug in React.")}function C1(_){Y1.getCurrentStack=_===null?null:f1,g4=!1,j5=_}function b1(_){return typeof Symbol==="function"&&Symbol.toStringTag&&_[Symbol.toStringTag]||_.constructor.name||"Object"}function c1(_){try{return D1(_),!1}catch(J){return!0}}function D1(_){return""+_}function A1(_,J){if(c1(_))return console.error("The provided `%s` attribute is an unsupported type %s. This value must be coerced to a string before using it here.",J,b1(_)),D1(_)}function e1(_,J){if(c1(_))return console.error("The provided `%s` CSS property is an unsupported type %s. This value must be coerced to a string before using it here.",J,b1(_)),D1(_)}function k1(_){if(c1(_))return console.error("Form field values (value, checked, defaultValue, or defaultChecked props) must be strings, not %s. This value must be coerced to a string before using it here.",b1(_)),D1(_)}function g0(_){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")return!1;var J=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(J.isDisabled)return!0;if(!J.supportsFiber)return console.error("The installed version of React DevTools is too old and will not work with the current version of React. Please update React DevTools. https://react.dev/link/react-devtools"),!0;try{S7=J.inject(_),i2=J}catch($){console.error("React instrumentation encountered an error: %o.",$)}return J.checkDCE?!0:!1}function _0(_){if(typeof Pw==="function"&&Nw(_),i2&&typeof i2.setStrictMode==="function")try{i2.setStrictMode(S7,_)}catch(J){p4||(p4=!0,console.error("React instrumentation encountered an error: %o",J))}}function t0(_){return _>>>=0,_===0?32:31-(Cw(_)/fw|0)|0}function C2(_){var J=_&42;if(J!==0)return J;switch(_&-_){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return _&261888;case 262144:case 524288:case 1048576:case 2097152:return _&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return _&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return console.error("Should have found matching lanes. This is a bug in React."),_}}function u2(_,J,$){var q=_.pendingLanes;if(q===0)return 0;var G=0,X=_.suspendedLanes,z=_.pingedLanes;_=_.warmLanes;var B=q&134217727;return B!==0?(q=B&~X,q!==0?G=C2(q):(z&=B,z!==0?G=C2(z):$||($=B&~_,$!==0&&(G=C2($))))):(B=q&~X,B!==0?G=C2(B):z!==0?G=C2(z):$||($=q&~_,$!==0&&(G=C2($)))),G===0?0:J!==0&&J!==G&&(J&X)===0&&(X=G&-G,$=J&-J,X>=$||X===32&&($&4194048)!==0)?J:G}function b2(_,J){return(_.pendingLanes&~(_.suspendedLanes&~_.pingedLanes)&J)===0}function f2(_,J){switch(_){case 1:case 2:case 4:case 8:case 64:return J+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return J+5000;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return console.error("Should have found matching lanes. This is a bug in React."),-1}}function T2(){var _=LQ;return LQ<<=1,(LQ&62914560)===0&&(LQ=4194304),_}function G2(_){for(var J=[],$=0;31>$;$++)J.push(_);return J}function R2(_,J){_.pendingLanes|=J,J!==268435456&&(_.suspendedLanes=0,_.pingedLanes=0,_.warmLanes=0)}function I4(_,J,$,q,G,X){var z=_.pendingLanes;_.pendingLanes=$,_.suspendedLanes=0,_.pingedLanes=0,_.warmLanes=0,_.expiredLanes&=$,_.entangledLanes&=$,_.errorRecoveryDisabledLanes&=$,_.shellSuspendCounter=0;var{entanglements:B,expirationTimes:I,hiddenUpdates:f}=_;for($=z&~$;0<$;){var e=31-e2($),J1=1<<e;B[e]=0,I[e]=-1;var d=f[e];if(d!==null)for(f[e]=null,e=0;e<d.length;e++){var Z1=d[e];Z1!==null&&(Z1.lane&=-536870913)}$&=~J1}q!==0&&X5(_,q,0),X!==0&&G===0&&_.tag!==0&&(_.suspendedLanes|=X&~(z&~J))}function X5(_,J,$){_.pendingLanes|=J,_.suspendedLanes&=~J;var q=31-e2(J);_.entangledLanes|=J,_.entanglements[q]=_.entanglements[q]|1073741824|$&261930}function x5(_,J){var $=_.entangledLanes|=J;for(_=_.entanglements;$;){var q=31-e2($),G=1<<q;G&J|_[q]&J&&(_[q]|=J),$&=~G}}function q4(_,J){var $=J&-J;return $=($&42)!==0?1:R5($),($&(_.suspendedLanes|J))!==0?0:$}function R5(_){switch(_){case 2:_=1;break;case 8:_=4;break;case 32:_=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:_=128;break;case 268435456:_=134217728;break;default:_=0}return _}function G3(_,J,$){if(c4)for(_=_.pendingUpdatersLaneMap;0<$;){var q=31-e2($),G=1<<q;_[q].add(J),$&=~G}}function O5(_,J){if(c4)for(var{pendingUpdatersLaneMap:$,memoizedUpdaters:q}=_;0<J;){var G=31-e2(J);_=1<<G,G=$[G],0<G.size&&(G.forEach(function(X){var z=X.alternate;z!==null&&q.has(z)||q.add(X)}),G.clear()),J&=~_}}function j(_){return _&=-_,V5!==0&&V5<_?X4!==0&&X4<_?(_&134217727)!==0?l4:BQ:X4:V5}function q1(){var _=C0.p;if(_!==0)return _;return _=window.event,_===void 0?l4:EW(_.type)}function I1(_,J){var $=C0.p;try{return C0.p=_,J()}finally{C0.p=$}}function P1(_){delete _[g2],delete _[_5],delete _[jZ],delete _[Sw],delete _[vw]}function y1(_){var J=_[g2];if(J)return J;for(var $=_.parentNode;$;){if(J=$[z6]||$[g2]){if($=J.alternate,J.child!==null||$!==null&&$.child!==null)for(_=wW(_);_!==null;){if($=_[g2])return $;_=wW(_)}return J}_=$,$=_.parentNode}return null}function i1(_){if(_=_[g2]||_[z6]){var J=_.tag;if(J===5||J===6||J===13||J===31||J===26||J===27||J===3)return _}return null}function r1(_){var J=_.tag;if(J===5||J===26||J===27||J===6)return _.stateNode;throw Error("getNodeFromInstance: Invalid argument.")}function F0(_){var J=_[eW];return J||(J=_[eW]={hoistableStyles:new Map,hoistableScripts:new Map}),J}function x1(_){_[T_]=!0}function K2(_,J){E2(_,J),E2(_+"Capture",J)}function E2(_,J){K8[_]&&console.error("EventRegistry: More than one plugin attempted to publish the same registration name, `%s`.",_),K8[_]=J;var $=_.toLowerCase();VZ[$]=_,_==="onDoubleClick"&&(VZ.ondblclick=_);for(_=0;_<J.length;_++)_L.add(J[_])}function $1(_,J){jw[J.type]||J.onChange||J.onInput||J.readOnly||J.disabled||J.value==null||(_==="select"?console.error("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set `onChange`."):console.error("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`.")),J.onChange||J.readOnly||J.disabled||J.checked==null||console.error("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.")}function B1(_){if(F4.call($L,_))return!0;if(F4.call(JL,_))return!1;if(Vw.test(_))return $L[_]=!0;return JL[_]=!0,console.error("Invalid attribute name: `%s`",_),!1}function v1(_,J,$){if(B1(J)){if(!_.hasAttribute(J)){switch(typeof $){case"symbol":case"object":return $;case"function":return $;case"boolean":if($===!1)return $}return $===void 0?void 0:null}if(_=_.getAttribute(J),_===""&&$===!0)return!0;return A1($,J),_===""+$?$:_}}function V1(_,J,$){if(B1(J))if($===null)_.removeAttribute(J);else{switch(typeof $){case"undefined":case"function":case"symbol":_.removeAttribute(J);return;case"boolean":var q=J.toLowerCase().slice(0,5);if(q!=="data-"&&q!=="aria-"){_.removeAttribute(J);return}}A1($,J),_.setAttribute(J,""+$)}}function Q0(_,J,$){if($===null)_.removeAttribute(J);else{switch(typeof $){case"undefined":case"function":case"symbol":case"boolean":_.removeAttribute(J);return}A1($,J),_.setAttribute(J,""+$)}}function u1(_,J,$,q){if(q===null)_.removeAttribute($);else{switch(typeof q){case"undefined":case"function":case"symbol":case"boolean":_.removeAttribute($);return}A1(q,$),_.setAttributeNS(J,$,""+q)}}function m1(_){switch(typeof _){case"bigint":case"boolean":case"number":case"string":case"undefined":return _;case"object":return k1(_),_;default:return""}}function J0(_){var J=_.type;return(_=_.nodeName)&&_.toLowerCase()==="input"&&(J==="checkbox"||J==="radio")}function T0(_,J,$){var q=Object.getOwnPropertyDescriptor(_.constructor.prototype,J);if(!_.hasOwnProperty(J)&&typeof q<"u"&&typeof q.get==="function"&&typeof q.set==="function"){var{get:G,set:X}=q;return Object.defineProperty(_,J,{configurable:!0,get:function(){return G.call(this)},set:function(z){k1(z),$=""+z,X.call(this,z)}}),Object.defineProperty(_,J,{enumerable:q.enumerable}),{getValue:function(){return $},setValue:function(z){k1(z),$=""+z},stopTracking:function(){_._valueTracker=null,delete _[J]}}}}function Z2(_){if(!_._valueTracker){var J=J0(_)?"checked":"value";_._valueTracker=T0(_,J,""+_[J])}}function K0(_){if(!_)return!1;var J=_._valueTracker;if(!J)return!0;var $=J.getValue(),q="";return _&&(q=J0(_)?_.checked?"true":"false":_.value),_=q,_!==$?(J.setValue(_),!0):!1}function S2(_){if(_=_||(typeof document<"u"?document:void 0),typeof _>"u")return null;try{return _.activeElement||_.body}catch(J){return _.body}}function w0(_){return _.replace(yw,function(J){return"\\"+J.charCodeAt(0).toString(16)+" "})}function Z7(_,J){J.checked===void 0||J.defaultChecked===void 0||qL||(console.error("%s contains an input of type %s with both checked and defaultChecked props. Input elements must be either controlled or uncontrolled (specify either the checked prop, or the defaultChecked prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://react.dev/link/controlled-components",R1()||"A component",J.type),qL=!0),J.value===void 0||J.defaultValue===void 0||QL||(console.error("%s contains an input of type %s with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://react.dev/link/controlled-components",R1()||"A component",J.type),QL=!0)}function K5(_,J,$,q,G,X,z,B){if(_.name="",z!=null&&typeof z!=="function"&&typeof z!=="symbol"&&typeof z!=="boolean"?(A1(z,"type"),_.type=z):_.removeAttribute("type"),J!=null)if(z==="number"){if(J===0&&_.value===""||_.value!=J)_.value=""+m1(J)}else _.value!==""+m1(J)&&(_.value=""+m1(J));else z!=="submit"&&z!=="reset"||_.removeAttribute("value");J!=null?F7(_,z,m1(J)):$!=null?F7(_,z,m1($)):q!=null&&_.removeAttribute("value"),G==null&&X!=null&&(_.defaultChecked=!!X),G!=null&&(_.checked=G&&typeof G!=="function"&&typeof G!=="symbol"),B!=null&&typeof B!=="function"&&typeof B!=="symbol"&&typeof B!=="boolean"?(A1(B,"name"),_.name=""+m1(B)):_.removeAttribute("name")}function V0(_,J,$,q,G,X,z,B){if(X!=null&&typeof X!=="function"&&typeof X!=="symbol"&&typeof X!=="boolean"&&(A1(X,"type"),_.type=X),J!=null||$!=null){if(!(X!=="submit"&&X!=="reset"||J!==void 0&&J!==null)){Z2(_);return}$=$!=null?""+m1($):"",J=J!=null?""+m1(J):$,B||J===_.value||(_.value=J),_.defaultValue=J}q=q!=null?q:G,q=typeof q!=="function"&&typeof q!=="symbol"&&!!q,_.checked=B?_.checked:!!q,_.defaultChecked=!!q,z!=null&&typeof z!=="function"&&typeof z!=="symbol"&&typeof z!=="boolean"&&(A1(z,"name"),_.name=z),Z2(_)}function F7(_,J,$){J==="number"&&S2(_.ownerDocument)===_||_.defaultValue===""+$||(_.defaultValue=""+$)}function sJ(_,J){J.value==null&&(typeof J.children==="object"&&J.children!==null?F9.Children.forEach(J.children,function($){$==null||typeof $==="string"||typeof $==="number"||typeof $==="bigint"||GL||(GL=!0,console.error("Cannot infer the option value of complex children. Pass a `value` prop or use a plain string as children to <option>."))}):J.dangerouslySetInnerHTML==null||ZL||(ZL=!0,console.error("Pass a `value` prop if you set dangerouslyInnerHTML so React knows which value should be selected."))),J.selected==null||UL||(console.error("Use the `defaultValue` or `value` props on <select> instead of setting `selected` on <option>."),UL=!0)}function tJ(){var _=R1();return _?`
|
|
34
34
|
|
|
35
35
|
Check the render method of \``+_+"`.":""}function r3(_,J,$,q){if(_=_.options,J){J={};for(var G=0;G<$.length;G++)J["$"+$[G]]=!0;for($=0;$<_.length;$++)G=J.hasOwnProperty("$"+_[$].value),_[$].selected!==G&&(_[$].selected=G),G&&q&&(_[$].defaultSelected=!0)}else{$=""+m1($),J=null;for(G=0;G<_.length;G++){if(_[G].value===$){_[G].selected=!0,q&&(_[G].defaultSelected=!0);return}J!==null||_[G].disabled||(J=_[G])}J!==null&&(J.selected=!0)}}function oJ(_,J){for(_=0;_<XL.length;_++){var $=XL[_];if(J[$]!=null){var q=O2(J[$]);J.multiple&&!q?console.error("The `%s` prop supplied to <select> must be an array if `multiple` is true.%s",$,tJ()):!J.multiple&&q&&console.error("The `%s` prop supplied to <select> must be a scalar value if `multiple` is false.%s",$,tJ())}}J.value===void 0||J.defaultValue===void 0||FL||(console.error("Select elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled select element and remove one of these props. More info: https://react.dev/link/controlled-components"),FL=!0)}function nJ(_,J){J.value===void 0||J.defaultValue===void 0||KL||(console.error("%s contains a textarea with both value and defaultValue props. Textarea elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled textarea and remove one of these props. More info: https://react.dev/link/controlled-components",R1()||"A component"),KL=!0),J.children!=null&&J.value==null&&console.error("Use the `defaultValue` or `value` props instead of setting children on <textarea>.")}function eJ(_,J,$){if(J!=null&&(J=""+m1(J),J!==_.value&&(_.value=J),$==null)){_.defaultValue!==J&&(_.defaultValue=J);return}_.defaultValue=$!=null?""+m1($):""}function j9(_,J,$,q){if(J==null){if(q!=null){if($!=null)throw Error("If you supply `defaultValue` on a <textarea>, do not pass children.");if(O2(q)){if(1<q.length)throw Error("<textarea> can only have at most one child.");q=q[0]}$=q}$==null&&($=""),J=$}$=m1(J),_.defaultValue=$,q=_.textContent,q===$&&q!==""&&q!==null&&(_.value=q),Z2(_)}function _$(_,J){return _.serverProps===void 0&&_.serverTail.length===0&&_.children.length===1&&3<_.distanceFromLeaf&&_.distanceFromLeaf>15-J?_$(_.children[0],J):_}function o2(_){return" "+" ".repeat(_)}function a3(_){return"+ "+" ".repeat(_)}function Z3(_){return"- "+" ".repeat(_)}function J$(_){switch(_.tag){case 26:case 27:case 5:return _.type;case 16:return"Lazy";case 31:return"Activity";case 13:return"Suspense";case 19:return"SuspenseList";case 0:case 15:return _=_.type,_.displayName||_.name||null;case 11:return _=_.type.render,_.displayName||_.name||null;case 1:return _=_.type,_.displayName||_.name||null;default:return null}}function a6(_,J){return HL.test(_)?(_=JSON.stringify(_),_.length>J-2?8>J?'{"..."}':"{"+_.slice(0,J-7)+'..."}':"{"+_+"}"):_.length>J?5>J?'{"..."}':_.slice(0,J-3)+"...":_}function X7(_,J,$){var q=120-2*$;if(J===null)return a3($)+a6(_,q)+`
|
|
36
36
|
`;if(typeof J==="string"){for(var G=0;G<J.length&&G<_.length&&J.charCodeAt(G)===_.charCodeAt(G);G++);return G>q-8&&10<G&&(_="..."+_.slice(G-8),J="..."+J.slice(G-8)),a3($)+a6(_,q)+`
|
|
@@ -172,7 +172,7 @@ act(() => {
|
|
|
172
172
|
});
|
|
173
173
|
/* assert on the output */
|
|
174
174
|
|
|
175
|
-
This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act`,m(_))})}function E4(_){_!==q9&&_.next===null&&(q9===null?Jq=q9=_:q9=q9.next=_),$q=!0,Y1.actQueue!==null?VF||(VF=!0,_W()):jF||(jF=!0,_W())}function F_(_,J){if(!yF&&$q){yF=!0;do{var $=!1;for(var q=Jq;q!==null;){if(!J)if(_!==0){var G=q.pendingLanes;if(G===0)var X=0;else{var{suspendedLanes:z,pingedLanes:B}=q;X=(1<<31-e2(42|_)+1)-1,X&=G&~(z&~B),X=X&201326741?X&201326741|1:X?X|2:0}X!==0&&($=!0,ez(q,X))}else X=G0,X=u2(q,q===u0?X:0,q.cancelPendingCommit!==null||q.timeoutHandle!==j8),(X&3)===0||b2(q,X)||($=!0,ez(q,X));q=q.next}}while($);yF=!1}}function jI(){GJ=window.event,dG()}function dG(){$q=VF=jF=!1;var _=0;y6!==0&&EI()&&(_=y6);for(var J=j2(),$=null,q=Jq;q!==null;){var G=q.next,X=oz(q,J);if(X===0)q.next=null,$===null?Jq=G:$.next=G,G===null&&(q9=$);else if($=q,_!==0||(X&3)!==0)$q=!0;q=G}A2!==j6&&A2!==nQ||F_(_,!1),y6!==0&&(y6=0)}function oz(_,J){for(var{suspendedLanes:$,pingedLanes:q,expirationTimes:G}=_,X=_.pendingLanes&-62914561;0<X;){var z=31-e2(X),B=1<<z,I=G[z];if(I===-1){if((B&$)===0||(B&q)!==0)G[z]=f2(B,J)}else I<=J&&(_.expiredLanes|=B);X&=~B}if(J=u0,$=G0,$=u2(_,_===J?$:0,_.cancelPendingCommit!==null||_.timeoutHandle!==j8),q=_.callbackNode,$===0||_===J&&(v0===w8||v0===P8)||_.cancelPendingCommit!==null)return q!==null&&rG(q),_.callbackNode=null,_.callbackPriority=0;if(($&3)===0||b2(_,$)){if(J=$&-$,J!==_.callbackPriority||Y1.actQueue!==null&&q!==kF)rG(q);else return J;switch(j($)){case V5:case X4:$=SZ;break;case l4:$=f7;break;case BQ:$=vZ;break;default:$=f7}return q=nz.bind(null,_),Y1.actQueue!==null?(Y1.actQueue.push(q),$=kF):$=CZ($,q),_.callbackPriority=J,_.callbackNode=$,J}return q!==null&&rG(q),_.callbackPriority=2,_.callbackNode=null,2}function nz(_,J){if(DQ=kQ=!1,GJ=window.event,A2!==j6&&A2!==nQ)return _.callbackNode=null,_.callbackPriority=0,null;var $=_.callbackNode;if(L4===oQ&&(L4=PF),G_()&&_.callbackNode!==$)return null;var q=G0;if(q=u2(_,_===u0?q:0,_.cancelPendingCommit!==null||_.timeoutHandle!==j8),q===0)return null;return Vz(_,q,J),oz(_,j2()),_.callbackNode!=null&&_.callbackNode===$?nz.bind(null,_):null}function ez(_,J){if(G_())return null;kQ=DQ,DQ=!1,Vz(_,J,!0)}function rG(_){_!==kF&&_!==null&&Tw(_)}function _W(){Y1.actQueue!==null&&Y1.actQueue.push(function(){return dG(),null}),_N(function(){(R0&(w2|u5))!==k2?CZ(fZ,jI):dG()})}function aG(){if(y6===0){var _=B8;_===0&&(_=zQ,zQ<<=1,(zQ&261888)===0&&(zQ=256)),y6=_}return y6}function JW(_){if(_==null||typeof _==="symbol"||typeof _==="boolean")return null;if(typeof _==="function")return _;return A1(_,"action"),x9(""+_)}function $W(_,J){var $=J.ownerDocument.createElement("input");return $.name=J.name,$.value=J.value,_.id&&$.setAttribute("form",_.id),J.parentNode.insertBefore($,J),_=new FormData(_),$.parentNode.removeChild($),_}function VI(_,J,$,q,G){if(J==="submit"&&$&&$.stateNode===G){var X=JW((G[_5]||null).action),z=q.submitter;z&&(J=(J=z[_5]||null)?JW(J.formAction):z.getAttribute("formAction"),J!==null&&(X=J,z=null));var B=new OQ("action","action",null,q,G);_.push({event:B,listeners:[{instance:null,listener:function(){if(q.defaultPrevented){if(y6!==0){var I=z?$W(G,z):new FormData(G),f={pending:!0,data:I,method:G.method,action:X};Object.freeze(f),WG($,f,null,I)}}else typeof X==="function"&&(B.preventDefault(),I=z?$W(G,z):new FormData(G),f={pending:!0,data:I,method:G.method,action:X},Object.freeze(f),WG($,f,X,I))},currentTarget:G}]})}}function e$(_,J,$){_.currentTarget=$;try{J(_)}catch(q){iZ(q)}_.currentTarget=null}function QW(_,J){J=(J&4)!==0;for(var $=0;$<_.length;$++){var q=_[$];_:{var G=void 0,X=q.event;if(q=q.listeners,J)for(var z=q.length-1;0<=z;z--){var B=q[z],I=B.instance,f=B.currentTarget;if(B=B.listener,I!==G&&X.isPropagationStopped())break _;I!==null?z1(I,e$,X,B,f):e$(X,B,f),G=I}else for(z=0;z<q.length;z++){if(B=q[z],I=B.instance,f=B.currentTarget,B=B.listener,I!==G&&X.isPropagationStopped())break _;I!==null?z1(I,e$,X,B,f):e$(X,B,f),G=I}}}}function A0(_,J){DF.has(_)||console.error('Did not expect a listenToNonDelegatedEvent() call for "%s". This is a bug in React. Please file an issue.',_);var $=J[jZ];$===void 0&&($=J[jZ]=new Set);var q=_+"__bubble";$.has(q)||(qW(J,_,2,!1),$.add(q))}function sG(_,J,$){DF.has(_)&&!J&&console.error('Did not expect a listenToNativeEvent() call for "%s" in the bubble phase. This is a bug in React. Please file an issue.',_);var q=0;J&&(q|=4),qW($,_,q,J)}function tG(_){if(!_[Qq]){_[Qq]=!0,_L.forEach(function($){$!=="selectionchange"&&(DF.has($)||sG($,!1,_),sG($,!0,_))});var J=_.nodeType===9?_:_.ownerDocument;J===null||J[Qq]||(J[Qq]=!0,sG("selectionchange",!1,J))}}function qW(_,J,$,q){switch(EW(J)){case V5:var G=Hw;break;case X4:G=Yw;break;default:G=YZ}$=G.bind(null,J,$,_),G=void 0,!uZ||J!=="touchstart"&&J!=="touchmove"&&J!=="wheel"||(G=!0),q?G!==void 0?_.addEventListener(J,$,{capture:!0,passive:G}):_.addEventListener(J,$,!0):G!==void 0?_.addEventListener(J,$,{passive:G}):_.addEventListener(J,$,!1)}function oG(_,J,$,q,G){var X=q;if((J&1)===0&&(J&2)===0&&q!==null)_:for(;;){if(q===null)return;var z=q.tag;if(z===3||z===4){var B=q.stateNode.containerInfo;if(B===G)break;if(z===4)for(z=q.return;z!==null;){var I=z.tag;if((I===3||I===4)&&z.stateNode.containerInfo===G)return;z=z.return}for(;B!==null;){if(z=y1(B),z===null)return;if(I=z.tag,I===5||I===6||I===26||I===27){q=X=z;continue _}B=B.parentNode}}q=q.return}LH(function(){var f=X,e=TU($),J1=[];_:{var d=EL.get(_);if(d!==void 0){var Z1=OQ,N1=_;switch(_){case"keypress":if(Z$($)===0)break _;case"keydown":case"keyup":Z1=GP;break;case"focusin":N1="focus",Z1=xZ;break;case"focusout":N1="blur",Z1=xZ;break;case"beforeblur":case"afterblur":Z1=xZ;break;case"click":if($.button===2)break _;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Z1=wL;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Z1=aw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Z1=XP;break;case kL:case DL:case uL:Z1=ow;break;case bL:Z1=HP;break;case"scroll":case"scrollend":Z1=dw;break;case"wheel":Z1=zP;break;case"copy":case"cut":case"paste":Z1=ew;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Z1=NL;break;case"toggle":case"beforetoggle":Z1=LP}var j1=(J&4)!==0,E0=!j1&&(_==="scroll"||_==="scrollend"),M0=j1?d!==null?d+"Capture":null:d;j1=[];for(var i=f,r;i!==null;){var n=i;if(r=n.stateNode,n=n.tag,n!==5&&n!==26&&n!==27||r===null||M0===null||(n=m9(i,M0),n!=null&&j1.push(X_(i,n,r))),E0)break;i=i.return}0<j1.length&&(d=new Z1(d,N1,null,$,e),J1.push({event:d,listeners:j1}))}}if((J&7)===0){_:{if(d=_==="mouseover"||_==="pointerover",Z1=_==="mouseout"||_==="pointerout",d&&$!==R_&&(N1=$.relatedTarget||$.fromElement)&&(y1(N1)||N1[z6]))break _;if(Z1||d){if(d=e.window===e?e:(d=e.ownerDocument)?d.defaultView||d.parentWindow:window,Z1){if(N1=$.relatedTarget||$.toElement,Z1=f,N1=N1?y1(N1):null,N1!==null&&(E0=C(N1),j1=N1.tag,N1!==E0||j1!==5&&j1!==27&&j1!==6))N1=null}else Z1=null,N1=f;if(Z1!==N1){if(j1=wL,n="onMouseLeave",M0="onMouseEnter",i="mouse",_==="pointerout"||_==="pointerover")j1=NL,n="onPointerLeave",M0="onPointerEnter",i="pointer";if(E0=Z1==null?d:r1(Z1),r=N1==null?d:r1(N1),d=new j1(n,i+"leave",Z1,$,e),d.target=E0,d.relatedTarget=r,n=null,y1(e)===f&&(j1=new j1(M0,i+"enter",N1,$,e),j1.target=r,j1.relatedTarget=E0,n=j1),E0=n,Z1&&N1)J:{j1=yI,M0=Z1,i=N1,r=0;for(n=M0;n;n=j1(n))r++;n=0;for(var M1=i;M1;M1=j1(M1))n++;for(;0<r-n;)M0=j1(M0),r--;for(;0<n-r;)i=j1(i),n--;for(;r--;){if(M0===i||i!==null&&M0===i.alternate){j1=M0;break J}M0=j1(M0),i=j1(i)}j1=null}else j1=null;Z1!==null&&UW(J1,d,Z1,j1,!1),N1!==null&&E0!==null&&UW(J1,E0,N1,j1,!0)}}}_:{if(d=f?r1(f):window,Z1=d.nodeName&&d.nodeName.toLowerCase(),Z1==="select"||Z1==="input"&&d.type==="file")var S1=IH;else if(RH(d))if(VL)S1=lO;else{S1=pO;var o1=gO}else Z1=d.nodeName,!Z1||Z1.toLowerCase()!=="input"||d.type!=="checkbox"&&d.type!=="radio"?f&&h9(f.elementType)&&(S1=IH):S1=cO;if(S1&&(S1=S1(_,f))){OH(J1,S1,$,e);break _}o1&&o1(_,d,f),_==="focusout"&&f&&d.type==="number"&&f.memoizedProps.value!=null&&F7(d,"number",d.value)}switch(o1=f?r1(f):window,_){case"focusin":if(RH(o1)||o1.contentEditable==="true")u7=o1,gZ=f,f_=null;break;case"focusout":f_=gZ=u7=null;break;case"mousedown":pZ=!0;break;case"contextmenu":case"mouseup":case"dragend":pZ=!1,vH(J1,$,e);break;case"selectionchange":if(TP)break;case"keydown":case"keyup":vH(J1,$,e)}var g1;if(mZ)_:{switch(_){case"compositionstart":var h1="onCompositionStart";break _;case"compositionend":h1="onCompositionEnd";break _;case"compositionupdate":h1="onCompositionUpdate";break _}h1=void 0}else D7?MH(_,$)&&(h1="onCompositionEnd"):_==="keydown"&&$.keyCode===CL&&(h1="onCompositionStart");if(h1&&(fL&&$.locale!=="ko"&&(D7||h1!=="onCompositionStart"?h1==="onCompositionEnd"&&D7&&(g1=BH()):(W6=e,bZ=("value"in W6)?W6.value:W6.textContent,D7=!0)),o1=_Q(f,h1),0<o1.length&&(h1=new PL(h1,_,null,$,e),J1.push({event:h1,listeners:o1}),g1?h1.data=g1:(g1=TH($),g1!==null&&(h1.data=g1)))),g1=AP?EO(_,$):hO(_,$))h1=_Q(f,"onBeforeInput"),0<h1.length&&(o1=new JP("onBeforeInput","beforeinput",null,$,e),J1.push({event:o1,listeners:h1}),o1.data=g1);VI(J1,_,f,$,e)}QW(J1,J)})}function X_(_,J,$){return{instance:_,listener:J,currentTarget:$}}function _Q(_,J){for(var $=J+"Capture",q=[];_!==null;){var G=_,X=G.stateNode;if(G=G.tag,G!==5&&G!==26&&G!==27||X===null||(G=m9(_,$),G!=null&&q.unshift(X_(_,G,X)),G=m9(_,J),G!=null&&q.push(X_(_,G,X))),_.tag===3)return q;_=_.return}return[]}function yI(_){if(_===null)return null;do _=_.return;while(_&&_.tag!==5&&_.tag!==27);return _?_:null}function UW(_,J,$,q,G){for(var X=J._reactName,z=[];$!==null&&$!==q;){var B=$,I=B.alternate,f=B.stateNode;if(B=B.tag,I!==null&&I===q)break;B!==5&&B!==26&&B!==27||f===null||(I=f,G?(f=m9($,X),f!=null&&z.unshift(X_($,f,I))):G||(f=m9($,X),f!=null&&z.push(X_($,f,I)))),$=$.return}z.length!==0&&_.push({event:J,listeners:z})}function nG(_,J){kO(_,J),_!=="input"&&_!=="textarea"&&_!=="select"||J==null||J.value!==null||OL||(OL=!0,_==="select"&&J.multiple?console.error("`value` prop on `%s` should not be null. Consider using an empty array when `multiple` is set to `true` to clear the component or `undefined` for uncontrolled components.",_):console.error("`value` prop on `%s` should not be null. Consider using an empty string to clear the component or `undefined` for uncontrolled components.",_));var $={registrationNameDependencies:K8,possibleRegistrationNames:VZ};h9(_)||typeof J.is==="string"||uO(_,J,$),J.contentEditable&&!J.suppressContentEditableWarning&&J.children!=null&&console.error("A component is `contentEditable` and contains `children` managed by React. It is now your responsibility to guarantee that none of those nodes are unexpectedly modified or duplicated. This is probably not intentional.")}function v2(_,J,$,q){J!==$&&($=F6($),F6(J)!==$&&(q[_]=J))}function kI(_,J,$){J.forEach(function(q){$[FW(q)]=q==="style"?_Z(_):_.getAttribute(q)})}function h4(_,J){J===!1?console.error("Expected `%s` listener to be a function, instead got `false`.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.",_,_,_):console.error("Expected `%s` listener to be a function, instead got a value of `%s` type.",_,typeof J)}function GW(_,J){return _=_.namespaceURI===MQ||_.namespaceURI===j7?_.ownerDocument.createElementNS(_.namespaceURI,_.tagName):_.ownerDocument.createElement(_.tagName),_.innerHTML=J,_.innerHTML}function F6(_){return c1(_)&&(console.error("The provided HTML markup uses a value of unsupported type %s. This value must be coerced to a string before using it here.",b1(_)),k1(_)),(typeof _==="string"?_:""+_).replace(iP,`
|
|
175
|
+
This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act`,m(_))})}function E4(_){_!==q9&&_.next===null&&(q9===null?Jq=q9=_:q9=q9.next=_),$q=!0,Y1.actQueue!==null?VF||(VF=!0,_W()):jF||(jF=!0,_W())}function F_(_,J){if(!yF&&$q){yF=!0;do{var $=!1;for(var q=Jq;q!==null;){if(!J)if(_!==0){var G=q.pendingLanes;if(G===0)var X=0;else{var{suspendedLanes:z,pingedLanes:B}=q;X=(1<<31-e2(42|_)+1)-1,X&=G&~(z&~B),X=X&201326741?X&201326741|1:X?X|2:0}X!==0&&($=!0,ez(q,X))}else X=G0,X=u2(q,q===u0?X:0,q.cancelPendingCommit!==null||q.timeoutHandle!==j8),(X&3)===0||b2(q,X)||($=!0,ez(q,X));q=q.next}}while($);yF=!1}}function jI(){GJ=window.event,dG()}function dG(){$q=VF=jF=!1;var _=0;y6!==0&&EI()&&(_=y6);for(var J=j2(),$=null,q=Jq;q!==null;){var G=q.next,X=oz(q,J);if(X===0)q.next=null,$===null?Jq=G:$.next=G,G===null&&(q9=$);else if($=q,_!==0||(X&3)!==0)$q=!0;q=G}A2!==j6&&A2!==nQ||F_(_,!1),y6!==0&&(y6=0)}function oz(_,J){for(var{suspendedLanes:$,pingedLanes:q,expirationTimes:G}=_,X=_.pendingLanes&-62914561;0<X;){var z=31-e2(X),B=1<<z,I=G[z];if(I===-1){if((B&$)===0||(B&q)!==0)G[z]=f2(B,J)}else I<=J&&(_.expiredLanes|=B);X&=~B}if(J=u0,$=G0,$=u2(_,_===J?$:0,_.cancelPendingCommit!==null||_.timeoutHandle!==j8),q=_.callbackNode,$===0||_===J&&(v0===w8||v0===P8)||_.cancelPendingCommit!==null)return q!==null&&rG(q),_.callbackNode=null,_.callbackPriority=0;if(($&3)===0||b2(_,$)){if(J=$&-$,J!==_.callbackPriority||Y1.actQueue!==null&&q!==kF)rG(q);else return J;switch(j($)){case V5:case X4:$=SZ;break;case l4:$=f7;break;case BQ:$=vZ;break;default:$=f7}return q=nz.bind(null,_),Y1.actQueue!==null?(Y1.actQueue.push(q),$=kF):$=CZ($,q),_.callbackPriority=J,_.callbackNode=$,J}return q!==null&&rG(q),_.callbackPriority=2,_.callbackNode=null,2}function nz(_,J){if(DQ=kQ=!1,GJ=window.event,A2!==j6&&A2!==nQ)return _.callbackNode=null,_.callbackPriority=0,null;var $=_.callbackNode;if(L4===oQ&&(L4=PF),G_()&&_.callbackNode!==$)return null;var q=G0;if(q=u2(_,_===u0?q:0,_.cancelPendingCommit!==null||_.timeoutHandle!==j8),q===0)return null;return Vz(_,q,J),oz(_,j2()),_.callbackNode!=null&&_.callbackNode===$?nz.bind(null,_):null}function ez(_,J){if(G_())return null;kQ=DQ,DQ=!1,Vz(_,J,!0)}function rG(_){_!==kF&&_!==null&&Tw(_)}function _W(){Y1.actQueue!==null&&Y1.actQueue.push(function(){return dG(),null}),_N(function(){(R0&(w2|u5))!==k2?CZ(fZ,jI):dG()})}function aG(){if(y6===0){var _=B8;_===0&&(_=zQ,zQ<<=1,(zQ&261888)===0&&(zQ=256)),y6=_}return y6}function JW(_){if(_==null||typeof _==="symbol"||typeof _==="boolean")return null;if(typeof _==="function")return _;return A1(_,"action"),x9(""+_)}function $W(_,J){var $=J.ownerDocument.createElement("input");return $.name=J.name,$.value=J.value,_.id&&$.setAttribute("form",_.id),J.parentNode.insertBefore($,J),_=new FormData(_),$.parentNode.removeChild($),_}function VI(_,J,$,q,G){if(J==="submit"&&$&&$.stateNode===G){var X=JW((G[_5]||null).action),z=q.submitter;z&&(J=(J=z[_5]||null)?JW(J.formAction):z.getAttribute("formAction"),J!==null&&(X=J,z=null));var B=new OQ("action","action",null,q,G);_.push({event:B,listeners:[{instance:null,listener:function(){if(q.defaultPrevented){if(y6!==0){var I=z?$W(G,z):new FormData(G),f={pending:!0,data:I,method:G.method,action:X};Object.freeze(f),WG($,f,null,I)}}else typeof X==="function"&&(B.preventDefault(),I=z?$W(G,z):new FormData(G),f={pending:!0,data:I,method:G.method,action:X},Object.freeze(f),WG($,f,X,I))},currentTarget:G}]})}}function e$(_,J,$){_.currentTarget=$;try{J(_)}catch(q){iZ(q)}_.currentTarget=null}function QW(_,J){J=(J&4)!==0;for(var $=0;$<_.length;$++){var q=_[$];_:{var G=void 0,X=q.event;if(q=q.listeners,J)for(var z=q.length-1;0<=z;z--){var B=q[z],I=B.instance,f=B.currentTarget;if(B=B.listener,I!==G&&X.isPropagationStopped())break _;I!==null?z1(I,e$,X,B,f):e$(X,B,f),G=I}else for(z=0;z<q.length;z++){if(B=q[z],I=B.instance,f=B.currentTarget,B=B.listener,I!==G&&X.isPropagationStopped())break _;I!==null?z1(I,e$,X,B,f):e$(X,B,f),G=I}}}}function A0(_,J){DF.has(_)||console.error('Did not expect a listenToNonDelegatedEvent() call for "%s". This is a bug in React. Please file an issue.',_);var $=J[jZ];$===void 0&&($=J[jZ]=new Set);var q=_+"__bubble";$.has(q)||(qW(J,_,2,!1),$.add(q))}function sG(_,J,$){DF.has(_)&&!J&&console.error('Did not expect a listenToNativeEvent() call for "%s" in the bubble phase. This is a bug in React. Please file an issue.',_);var q=0;J&&(q|=4),qW($,_,q,J)}function tG(_){if(!_[Qq]){_[Qq]=!0,_L.forEach(function($){$!=="selectionchange"&&(DF.has($)||sG($,!1,_),sG($,!0,_))});var J=_.nodeType===9?_:_.ownerDocument;J===null||J[Qq]||(J[Qq]=!0,sG("selectionchange",!1,J))}}function qW(_,J,$,q){switch(EW(J)){case V5:var G=Hw;break;case X4:G=Yw;break;default:G=YZ}$=G.bind(null,J,$,_),G=void 0,!uZ||J!=="touchstart"&&J!=="touchmove"&&J!=="wheel"||(G=!0),q?G!==void 0?_.addEventListener(J,$,{capture:!0,passive:G}):_.addEventListener(J,$,!0):G!==void 0?_.addEventListener(J,$,{passive:G}):_.addEventListener(J,$,!1)}function oG(_,J,$,q,G){var X=q;if((J&1)===0&&(J&2)===0&&q!==null)_:for(;;){if(q===null)return;var z=q.tag;if(z===3||z===4){var B=q.stateNode.containerInfo;if(B===G)break;if(z===4)for(z=q.return;z!==null;){var I=z.tag;if((I===3||I===4)&&z.stateNode.containerInfo===G)return;z=z.return}for(;B!==null;){if(z=y1(B),z===null)return;if(I=z.tag,I===5||I===6||I===26||I===27){q=X=z;continue _}B=B.parentNode}}q=q.return}LH(function(){var f=X,e=TU($),J1=[];_:{var d=EL.get(_);if(d!==void 0){var Z1=OQ,N1=_;switch(_){case"keypress":if(Z$($)===0)break _;case"keydown":case"keyup":Z1=GP;break;case"focusin":N1="focus",Z1=xZ;break;case"focusout":N1="blur",Z1=xZ;break;case"beforeblur":case"afterblur":Z1=xZ;break;case"click":if($.button===2)break _;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Z1=wL;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Z1=aw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Z1=XP;break;case kL:case DL:case uL:Z1=ow;break;case bL:Z1=HP;break;case"scroll":case"scrollend":Z1=dw;break;case"wheel":Z1=zP;break;case"copy":case"cut":case"paste":Z1=ew;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Z1=NL;break;case"toggle":case"beforetoggle":Z1=LP}var j1=(J&4)!==0,E0=!j1&&(_==="scroll"||_==="scrollend"),M0=j1?d!==null?d+"Capture":null:d;j1=[];for(var i=f,r;i!==null;){var n=i;if(r=n.stateNode,n=n.tag,n!==5&&n!==26&&n!==27||r===null||M0===null||(n=m9(i,M0),n!=null&&j1.push(X_(i,n,r))),E0)break;i=i.return}0<j1.length&&(d=new Z1(d,N1,null,$,e),J1.push({event:d,listeners:j1}))}}if((J&7)===0){_:{if(d=_==="mouseover"||_==="pointerover",Z1=_==="mouseout"||_==="pointerout",d&&$!==R_&&(N1=$.relatedTarget||$.fromElement)&&(y1(N1)||N1[z6]))break _;if(Z1||d){if(d=e.window===e?e:(d=e.ownerDocument)?d.defaultView||d.parentWindow:window,Z1){if(N1=$.relatedTarget||$.toElement,Z1=f,N1=N1?y1(N1):null,N1!==null&&(E0=C(N1),j1=N1.tag,N1!==E0||j1!==5&&j1!==27&&j1!==6))N1=null}else Z1=null,N1=f;if(Z1!==N1){if(j1=wL,n="onMouseLeave",M0="onMouseEnter",i="mouse",_==="pointerout"||_==="pointerover")j1=NL,n="onPointerLeave",M0="onPointerEnter",i="pointer";if(E0=Z1==null?d:r1(Z1),r=N1==null?d:r1(N1),d=new j1(n,i+"leave",Z1,$,e),d.target=E0,d.relatedTarget=r,n=null,y1(e)===f&&(j1=new j1(M0,i+"enter",N1,$,e),j1.target=r,j1.relatedTarget=E0,n=j1),E0=n,Z1&&N1)J:{j1=yI,M0=Z1,i=N1,r=0;for(n=M0;n;n=j1(n))r++;n=0;for(var M1=i;M1;M1=j1(M1))n++;for(;0<r-n;)M0=j1(M0),r--;for(;0<n-r;)i=j1(i),n--;for(;r--;){if(M0===i||i!==null&&M0===i.alternate){j1=M0;break J}M0=j1(M0),i=j1(i)}j1=null}else j1=null;Z1!==null&&UW(J1,d,Z1,j1,!1),N1!==null&&E0!==null&&UW(J1,E0,N1,j1,!0)}}}_:{if(d=f?r1(f):window,Z1=d.nodeName&&d.nodeName.toLowerCase(),Z1==="select"||Z1==="input"&&d.type==="file")var S1=IH;else if(RH(d))if(VL)S1=lO;else{S1=pO;var o1=gO}else Z1=d.nodeName,!Z1||Z1.toLowerCase()!=="input"||d.type!=="checkbox"&&d.type!=="radio"?f&&h9(f.elementType)&&(S1=IH):S1=cO;if(S1&&(S1=S1(_,f))){OH(J1,S1,$,e);break _}o1&&o1(_,d,f),_==="focusout"&&f&&d.type==="number"&&f.memoizedProps.value!=null&&F7(d,"number",d.value)}switch(o1=f?r1(f):window,_){case"focusin":if(RH(o1)||o1.contentEditable==="true")u7=o1,gZ=f,f_=null;break;case"focusout":f_=gZ=u7=null;break;case"mousedown":pZ=!0;break;case"contextmenu":case"mouseup":case"dragend":pZ=!1,vH(J1,$,e);break;case"selectionchange":if(TP)break;case"keydown":case"keyup":vH(J1,$,e)}var g1;if(mZ)_:{switch(_){case"compositionstart":var h1="onCompositionStart";break _;case"compositionend":h1="onCompositionEnd";break _;case"compositionupdate":h1="onCompositionUpdate";break _}h1=void 0}else D7?MH(_,$)&&(h1="onCompositionEnd"):_==="keydown"&&$.keyCode===CL&&(h1="onCompositionStart");if(h1&&(fL&&$.locale!=="ko"&&(D7||h1!=="onCompositionStart"?h1==="onCompositionEnd"&&D7&&(g1=BH()):(W6=e,bZ=("value"in W6)?W6.value:W6.textContent,D7=!0)),o1=_Q(f,h1),0<o1.length&&(h1=new PL(h1,_,null,$,e),J1.push({event:h1,listeners:o1}),g1?h1.data=g1:(g1=TH($),g1!==null&&(h1.data=g1)))),g1=AP?EO(_,$):hO(_,$))h1=_Q(f,"onBeforeInput"),0<h1.length&&(o1=new JP("onBeforeInput","beforeinput",null,$,e),J1.push({event:o1,listeners:h1}),o1.data=g1);VI(J1,_,f,$,e)}QW(J1,J)})}function X_(_,J,$){return{instance:_,listener:J,currentTarget:$}}function _Q(_,J){for(var $=J+"Capture",q=[];_!==null;){var G=_,X=G.stateNode;if(G=G.tag,G!==5&&G!==26&&G!==27||X===null||(G=m9(_,$),G!=null&&q.unshift(X_(_,G,X)),G=m9(_,J),G!=null&&q.push(X_(_,G,X))),_.tag===3)return q;_=_.return}return[]}function yI(_){if(_===null)return null;do _=_.return;while(_&&_.tag!==5&&_.tag!==27);return _?_:null}function UW(_,J,$,q,G){for(var X=J._reactName,z=[];$!==null&&$!==q;){var B=$,I=B.alternate,f=B.stateNode;if(B=B.tag,I!==null&&I===q)break;B!==5&&B!==26&&B!==27||f===null||(I=f,G?(f=m9($,X),f!=null&&z.unshift(X_($,f,I))):G||(f=m9($,X),f!=null&&z.push(X_($,f,I)))),$=$.return}z.length!==0&&_.push({event:J,listeners:z})}function nG(_,J){kO(_,J),_!=="input"&&_!=="textarea"&&_!=="select"||J==null||J.value!==null||OL||(OL=!0,_==="select"&&J.multiple?console.error("`value` prop on `%s` should not be null. Consider using an empty array when `multiple` is set to `true` to clear the component or `undefined` for uncontrolled components.",_):console.error("`value` prop on `%s` should not be null. Consider using an empty string to clear the component or `undefined` for uncontrolled components.",_));var $={registrationNameDependencies:K8,possibleRegistrationNames:VZ};h9(_)||typeof J.is==="string"||uO(_,J,$),J.contentEditable&&!J.suppressContentEditableWarning&&J.children!=null&&console.error("A component is `contentEditable` and contains `children` managed by React. It is now your responsibility to guarantee that none of those nodes are unexpectedly modified or duplicated. This is probably not intentional.")}function v2(_,J,$,q){J!==$&&($=F6($),F6(J)!==$&&(q[_]=J))}function kI(_,J,$){J.forEach(function(q){$[FW(q)]=q==="style"?_Z(_):_.getAttribute(q)})}function h4(_,J){J===!1?console.error("Expected `%s` listener to be a function, instead got `false`.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.",_,_,_):console.error("Expected `%s` listener to be a function, instead got a value of `%s` type.",_,typeof J)}function GW(_,J){return _=_.namespaceURI===MQ||_.namespaceURI===j7?_.ownerDocument.createElementNS(_.namespaceURI,_.tagName):_.ownerDocument.createElement(_.tagName),_.innerHTML=J,_.innerHTML}function F6(_){return c1(_)&&(console.error("The provided HTML markup uses a value of unsupported type %s. This value must be coerced to a string before using it here.",b1(_)),D1(_)),(typeof _==="string"?_:""+_).replace(iP,`
|
|
176
176
|
`).replace(dP,"")}function ZW(_,J){return J=F6(J),F6(_)===J?!0:!1}function k0(_,J,$,q,G,X){switch($){case"children":if(typeof q==="string")o3(q,J,!1),J==="body"||J==="textarea"&&q===""||s6(_,q);else if(typeof q==="number"||typeof q==="bigint")o3(""+q,J,!1),J!=="body"&&s6(_,""+q);break;case"className":Q0(_,"class",q);break;case"tabIndex":Q0(_,"tabindex",q);break;case"dir":case"role":case"viewBox":case"width":case"height":Q0(_,$,q);break;case"style":YH(_,q,X);break;case"data":if(J!=="object"){Q0(_,"data",q);break}case"src":case"href":if(q===""&&(J!=="a"||$!=="href")){$==="src"?console.error('An empty string ("") was passed to the %s attribute. This may cause the browser to download the whole page again over the network. To fix this, either do not render the element at all or pass null to %s instead of an empty string.',$,$):console.error('An empty string ("") was passed to the %s attribute. To fix this, either do not render the element at all or pass null to %s instead of an empty string.',$,$),_.removeAttribute($);break}if(q==null||typeof q==="function"||typeof q==="symbol"||typeof q==="boolean"){_.removeAttribute($);break}A1(q,$),q=x9(""+q),_.setAttribute($,q);break;case"action":case"formAction":if(q!=null&&(J==="form"?$==="formAction"?console.error("You can only pass the formAction prop to <input> or <button>. Use the action prop on <form>."):typeof q==="function"&&(G.encType==null&&G.method==null||Gq||(Gq=!0,console.error("Cannot specify a encType or method for a form that specifies a function as the action. React provides those automatically. They will get overridden.")),G.target==null||Uq||(Uq=!0,console.error("Cannot specify a target for a form that specifies a function as the action. The function will always be executed in the same window."))):J==="input"||J==="button"?$==="action"?console.error("You can only pass the action prop to <form>. Use the formAction prop on <input> or <button>."):J!=="input"||G.type==="submit"||G.type==="image"||qq?J!=="button"||G.type==null||G.type==="submit"||qq?typeof q==="function"&&(G.name==null||GA||(GA=!0,console.error('Cannot specify a "name" prop for a button that specifies a function as a formAction. React needs it to encode which action should be invoked. It will get overridden.')),G.formEncType==null&&G.formMethod==null||Gq||(Gq=!0,console.error("Cannot specify a formEncType or formMethod for a button that specifies a function as a formAction. React provides those automatically. They will get overridden.")),G.formTarget==null||Uq||(Uq=!0,console.error("Cannot specify a formTarget for a button that specifies a function as a formAction. The function will always be executed in the same window."))):(qq=!0,console.error('A button can only specify a formAction along with type="submit" or no type.')):(qq=!0,console.error('An input can only specify a formAction along with type="submit" or type="image".')):$==="action"?console.error("You can only pass the action prop to <form>."):console.error("You can only pass the formAction prop to <input> or <button>.")),typeof q==="function"){_.setAttribute($,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof X==="function"&&($==="formAction"?(J!=="input"&&k0(_,J,"name",G.name,G,null),k0(_,J,"formEncType",G.formEncType,G,null),k0(_,J,"formMethod",G.formMethod,G,null),k0(_,J,"formTarget",G.formTarget,G,null)):(k0(_,J,"encType",G.encType,G,null),k0(_,J,"method",G.method,G,null),k0(_,J,"target",G.target,G,null)));if(q==null||typeof q==="symbol"||typeof q==="boolean"){_.removeAttribute($);break}A1(q,$),q=x9(""+q),_.setAttribute($,q);break;case"onClick":q!=null&&(typeof q!=="function"&&h4($,q),_.onclick=F3);break;case"onScroll":q!=null&&(typeof q!=="function"&&h4($,q),A0("scroll",_));break;case"onScrollEnd":q!=null&&(typeof q!=="function"&&h4($,q),A0("scrollend",_));break;case"dangerouslySetInnerHTML":if(q!=null){if(typeof q!=="object"||!("__html"in q))throw Error("`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://react.dev/link/dangerously-set-inner-html for more information.");if($=q.__html,$!=null){if(G.children!=null)throw Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`.");_.innerHTML=$}}break;case"multiple":_.multiple=q&&typeof q!=="function"&&typeof q!=="symbol";break;case"muted":_.muted=q&&typeof q!=="function"&&typeof q!=="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(q==null||typeof q==="function"||typeof q==="boolean"||typeof q==="symbol"){_.removeAttribute("xlink:href");break}A1(q,$),$=x9(""+q),_.setAttributeNS(f8,"xlink:href",$);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":q!=null&&typeof q!=="function"&&typeof q!=="symbol"?(A1(q,$),_.setAttribute($,""+q)):_.removeAttribute($);break;case"inert":q!==""||Zq[$]||(Zq[$]=!0,console.error("Received an empty string for a boolean attribute `%s`. This will treat the attribute as if it were false. Either pass `false` to silence this warning, or pass `true` if you used an empty string in earlier versions of React to indicate this attribute is true.",$));case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":q&&typeof q!=="function"&&typeof q!=="symbol"?_.setAttribute($,""):_.removeAttribute($);break;case"capture":case"download":q===!0?_.setAttribute($,""):q!==!1&&q!=null&&typeof q!=="function"&&typeof q!=="symbol"?(A1(q,$),_.setAttribute($,q)):_.removeAttribute($);break;case"cols":case"rows":case"size":case"span":q!=null&&typeof q!=="function"&&typeof q!=="symbol"&&!isNaN(q)&&1<=q?(A1(q,$),_.setAttribute($,q)):_.removeAttribute($);break;case"rowSpan":case"start":q==null||typeof q==="function"||typeof q==="symbol"||isNaN(q)?_.removeAttribute($):(A1(q,$),_.setAttribute($,q));break;case"popover":A0("beforetoggle",_),A0("toggle",_),V1(_,"popover",q);break;case"xlinkActuate":u1(_,f8,"xlink:actuate",q);break;case"xlinkArcrole":u1(_,f8,"xlink:arcrole",q);break;case"xlinkRole":u1(_,f8,"xlink:role",q);break;case"xlinkShow":u1(_,f8,"xlink:show",q);break;case"xlinkTitle":u1(_,f8,"xlink:title",q);break;case"xlinkType":u1(_,f8,"xlink:type",q);break;case"xmlBase":u1(_,uF,"xml:base",q);break;case"xmlLang":u1(_,uF,"xml:lang",q);break;case"xmlSpace":u1(_,uF,"xml:space",q);break;case"is":X!=null&&console.error('Cannot update the "is" prop after it has been initialized.'),V1(_,"is",q);break;case"innerText":case"textContent":break;case"popoverTarget":ZA||q==null||typeof q!=="object"||(ZA=!0,console.error("The `popoverTarget` prop expects the ID of an Element as a string. Received %s instead.",q));default:!(2<$.length)||$[0]!=="o"&&$[0]!=="O"||$[1]!=="n"&&$[1]!=="N"?($=zH($),V1(_,$,q)):K8.hasOwnProperty($)&&q!=null&&typeof q!=="function"&&h4($,q)}}function eG(_,J,$,q,G,X){switch($){case"style":YH(_,q,X);break;case"dangerouslySetInnerHTML":if(q!=null){if(typeof q!=="object"||!("__html"in q))throw Error("`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://react.dev/link/dangerously-set-inner-html for more information.");if($=q.__html,$!=null){if(G.children!=null)throw Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`.");_.innerHTML=$}}break;case"children":typeof q==="string"?s6(_,q):(typeof q==="number"||typeof q==="bigint")&&s6(_,""+q);break;case"onScroll":q!=null&&(typeof q!=="function"&&h4($,q),A0("scroll",_));break;case"onScrollEnd":q!=null&&(typeof q!=="function"&&h4($,q),A0("scrollend",_));break;case"onClick":q!=null&&(typeof q!=="function"&&h4($,q),_.onclick=F3);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(K8.hasOwnProperty($))q!=null&&typeof q!=="function"&&h4($,q);else _:{if($[0]==="o"&&$[1]==="n"&&(G=$.endsWith("Capture"),J=$.slice(2,G?$.length-7:void 0),X=_[_5]||null,X=X!=null?X[$]:null,typeof X==="function"&&_.removeEventListener(J,X,G),typeof q==="function")){typeof X!=="function"&&X!==null&&($ in _?_[$]=null:_.hasAttribute($)&&_.removeAttribute($)),_.addEventListener(J,q,G);break _}$ in _?_[$]=q:q===!0?_.setAttribute($,""):V1(_,$,q)}}}function m2(_,J,$){switch(nG(J,$),J){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":A0("error",_),A0("load",_);var q=!1,G=!1,X;for(X in $)if($.hasOwnProperty(X)){var z=$[X];if(z!=null)switch(X){case"src":q=!0;break;case"srcSet":G=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(J+" is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");default:k0(_,J,X,z,$,null)}}G&&k0(_,J,"srcSet",$.srcSet,$,null),q&&k0(_,J,"src",$.src,$,null);return;case"input":$1("input",$),A0("invalid",_);var B=X=z=G=null,I=null,f=null;for(q in $)if($.hasOwnProperty(q)){var e=$[q];if(e!=null)switch(q){case"name":G=e;break;case"type":z=e;break;case"checked":I=e;break;case"defaultChecked":f=e;break;case"value":X=e;break;case"defaultValue":B=e;break;case"children":case"dangerouslySetInnerHTML":if(e!=null)throw Error(J+" is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");break;default:k0(_,J,q,e,$,null)}}Z7(_,$),V0(_,X,B,I,f,z,G,!1);return;case"select":$1("select",$),A0("invalid",_),q=z=X=null;for(G in $)if($.hasOwnProperty(G)&&(B=$[G],B!=null))switch(G){case"value":X=B;break;case"defaultValue":z=B;break;case"multiple":q=B;default:k0(_,J,G,B,$,null)}oJ(_,$),J=X,$=z,_.multiple=!!q,J!=null?r3(_,!!q,J,!1):$!=null&&r3(_,!!q,$,!0);return;case"textarea":$1("textarea",$),A0("invalid",_),X=G=q=null;for(z in $)if($.hasOwnProperty(z)&&(B=$[z],B!=null))switch(z){case"value":q=B;break;case"defaultValue":G=B;break;case"children":X=B;break;case"dangerouslySetInnerHTML":if(B!=null)throw Error("`dangerouslySetInnerHTML` does not make sense on <textarea>.");break;default:k0(_,J,z,B,$,null)}nJ(_,$),j9(_,q,G,X);return;case"option":sJ(_,$);for(I in $)if($.hasOwnProperty(I)&&(q=$[I],q!=null))switch(I){case"selected":_.selected=q&&typeof q!=="function"&&typeof q!=="symbol";break;default:k0(_,J,I,q,$,null)}return;case"dialog":A0("beforetoggle",_),A0("toggle",_),A0("cancel",_),A0("close",_);break;case"iframe":case"object":A0("load",_);break;case"video":case"audio":for(q=0;q<QJ.length;q++)A0(QJ[q],_);break;case"image":A0("error",_),A0("load",_);break;case"details":A0("toggle",_);break;case"embed":case"source":case"link":A0("error",_),A0("load",_);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(f in $)if($.hasOwnProperty(f)&&(q=$[f],q!=null))switch(f){case"children":case"dangerouslySetInnerHTML":throw Error(J+" is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");default:k0(_,J,f,q,$,null)}return;default:if(h9(J)){for(e in $)$.hasOwnProperty(e)&&(q=$[e],q!==void 0&&eG(_,J,e,q,$,void 0));return}}for(B in $)$.hasOwnProperty(B)&&(q=$[B],q!=null&&k0(_,J,B,q,$,null))}function DI(_,J,$,q){switch(nG(J,q),J){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var G=null,X=null,z=null,B=null,I=null,f=null,e=null;for(Z1 in $){var J1=$[Z1];if($.hasOwnProperty(Z1)&&J1!=null)switch(Z1){case"checked":break;case"value":break;case"defaultValue":I=J1;default:q.hasOwnProperty(Z1)||k0(_,J,Z1,null,q,J1)}}for(var d in q){var Z1=q[d];if(J1=$[d],q.hasOwnProperty(d)&&(Z1!=null||J1!=null))switch(d){case"type":X=Z1;break;case"name":G=Z1;break;case"checked":f=Z1;break;case"defaultChecked":e=Z1;break;case"value":z=Z1;break;case"defaultValue":B=Z1;break;case"children":case"dangerouslySetInnerHTML":if(Z1!=null)throw Error(J+" is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");break;default:Z1!==J1&&k0(_,J,d,Z1,q,J1)}}J=$.type==="checkbox"||$.type==="radio"?$.checked!=null:$.value!=null,q=q.type==="checkbox"||q.type==="radio"?q.checked!=null:q.value!=null,J||!q||UA||(console.error("A component is changing an uncontrolled input to be controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://react.dev/link/controlled-components"),UA=!0),!J||q||qA||(console.error("A component is changing a controlled input to be uncontrolled. This is likely caused by the value changing from a defined to undefined, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://react.dev/link/controlled-components"),qA=!0),K5(_,z,B,I,f,e,X,G);return;case"select":Z1=z=B=d=null;for(X in $)if(I=$[X],$.hasOwnProperty(X)&&I!=null)switch(X){case"value":break;case"multiple":Z1=I;default:q.hasOwnProperty(X)||k0(_,J,X,null,q,I)}for(G in q)if(X=q[G],I=$[G],q.hasOwnProperty(G)&&(X!=null||I!=null))switch(G){case"value":d=X;break;case"defaultValue":B=X;break;case"multiple":z=X;default:X!==I&&k0(_,J,G,X,q,I)}q=B,J=z,$=Z1,d!=null?r3(_,!!J,d,!1):!!$!==!!J&&(q!=null?r3(_,!!J,q,!0):r3(_,!!J,J?[]:"",!1));return;case"textarea":Z1=d=null;for(B in $)if(G=$[B],$.hasOwnProperty(B)&&G!=null&&!q.hasOwnProperty(B))switch(B){case"value":break;case"children":break;default:k0(_,J,B,null,q,G)}for(z in q)if(G=q[z],X=$[z],q.hasOwnProperty(z)&&(G!=null||X!=null))switch(z){case"value":d=G;break;case"defaultValue":Z1=G;break;case"children":break;case"dangerouslySetInnerHTML":if(G!=null)throw Error("`dangerouslySetInnerHTML` does not make sense on <textarea>.");break;default:G!==X&&k0(_,J,z,G,q,X)}eJ(_,d,Z1);return;case"option":for(var N1 in $)if(d=$[N1],$.hasOwnProperty(N1)&&d!=null&&!q.hasOwnProperty(N1))switch(N1){case"selected":_.selected=!1;break;default:k0(_,J,N1,null,q,d)}for(I in q)if(d=q[I],Z1=$[I],q.hasOwnProperty(I)&&d!==Z1&&(d!=null||Z1!=null))switch(I){case"selected":_.selected=d&&typeof d!=="function"&&typeof d!=="symbol";break;default:k0(_,J,I,d,q,Z1)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var j1 in $)d=$[j1],$.hasOwnProperty(j1)&&d!=null&&!q.hasOwnProperty(j1)&&k0(_,J,j1,null,q,d);for(f in q)if(d=q[f],Z1=$[f],q.hasOwnProperty(f)&&d!==Z1&&(d!=null||Z1!=null))switch(f){case"children":case"dangerouslySetInnerHTML":if(d!=null)throw Error(J+" is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");break;default:k0(_,J,f,d,q,Z1)}return;default:if(h9(J)){for(var E0 in $)d=$[E0],$.hasOwnProperty(E0)&&d!==void 0&&!q.hasOwnProperty(E0)&&eG(_,J,E0,void 0,q,d);for(e in q)d=q[e],Z1=$[e],!q.hasOwnProperty(e)||d===Z1||d===void 0&&Z1===void 0||eG(_,J,e,d,q,Z1);return}}for(var M0 in $)d=$[M0],$.hasOwnProperty(M0)&&d!=null&&!q.hasOwnProperty(M0)&&k0(_,J,M0,null,q,d);for(J1 in q)d=q[J1],Z1=$[J1],!q.hasOwnProperty(J1)||d===Z1||d==null&&Z1==null||k0(_,J,J1,d,q,Z1)}function FW(_){switch(_){case"class":return"className";case"for":return"htmlFor";default:return _}}function _Z(_){var J={};_=_.style;for(var $=0;$<_.length;$++){var q=_[$];J[q]=_.getPropertyValue(q)}return J}function XW(_,J,$){if(J!=null&&typeof J!=="object")console.error("The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.");else{var q,G=q="",X;for(X in J)if(J.hasOwnProperty(X)){var z=J[X];z!=null&&typeof z!=="boolean"&&z!==""&&(X.indexOf("--")===0?(e1(z,X),q+=G+X+":"+(""+z).trim()):typeof z!=="number"||z===0||TL.has(X)?(e1(z,X),q+=G+X.replace(WL,"-$1").toLowerCase().replace(LL,"-ms-")+":"+(""+z).trim()):q+=G+X.replace(WL,"-$1").toLowerCase().replace(LL,"-ms-")+":"+z+"px",G=";")}q=q||null,J=_.getAttribute("style"),J!==q&&(q=F6(q),F6(J)!==q&&($.style=_Z(_)))}}function m5(_,J,$,q,G,X){if(G.delete($),_=_.getAttribute($),_===null)switch(typeof q){case"undefined":case"function":case"symbol":case"boolean":return}else if(q!=null)switch(typeof q){case"function":case"symbol":case"boolean":break;default:if(A1(q,J),_===""+q)return}v2(J,_,q,X)}function KW(_,J,$,q,G,X){if(G.delete($),_=_.getAttribute($),_===null){switch(typeof q){case"function":case"symbol":return}if(!q)return}else switch(typeof q){case"function":case"symbol":break;default:if(q)return}v2(J,_,q,X)}function JZ(_,J,$,q,G,X){if(G.delete($),_=_.getAttribute($),_===null)switch(typeof q){case"undefined":case"function":case"symbol":return}else if(q!=null)switch(typeof q){case"function":case"symbol":break;default:if(A1(q,$),_===""+q)return}v2(J,_,q,X)}function HW(_,J,$,q,G,X){if(G.delete($),_=_.getAttribute($),_===null)switch(typeof q){case"undefined":case"function":case"symbol":case"boolean":return;default:if(isNaN(q))return}else if(q!=null)switch(typeof q){case"function":case"symbol":case"boolean":break;default:if(!isNaN(q)&&(A1(q,J),_===""+q))return}v2(J,_,q,X)}function $Z(_,J,$,q,G,X){if(G.delete($),_=_.getAttribute($),_===null)switch(typeof q){case"undefined":case"function":case"symbol":case"boolean":return}else if(q!=null)switch(typeof q){case"function":case"symbol":case"boolean":break;default:if(A1(q,J),$=x9(""+q),_===$)return}v2(J,_,q,X)}function YW(_,J,$,q){for(var G={},X=new Set,z=_.attributes,B=0;B<z.length;B++)switch(z[B].name.toLowerCase()){case"value":break;case"checked":break;case"selected":break;default:X.add(z[B].name)}if(h9(J)){for(var I in $)if($.hasOwnProperty(I)){var f=$[I];if(f!=null){if(K8.hasOwnProperty(I))typeof f!=="function"&&h4(I,f);else if($.suppressHydrationWarning!==!0)switch(I){case"children":typeof f!=="string"&&typeof f!=="number"||v2("children",_.textContent,f,G);continue;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":continue;case"dangerouslySetInnerHTML":z=_.innerHTML,f=f?f.__html:void 0,f!=null&&(f=GW(_,f),v2(I,z,f,G));continue;case"style":X.delete(I),XW(_,f,G);continue;case"offsetParent":case"offsetTop":case"offsetLeft":case"offsetWidth":case"offsetHeight":case"isContentEditable":case"outerText":case"outerHTML":X.delete(I.toLowerCase()),console.error("Assignment to read-only property will result in a no-op: `%s`",I);continue;case"className":X.delete("class"),z=v1(_,"class",f),v2("className",z,f,G);continue;default:q.context===j3&&J!=="svg"&&J!=="math"?X.delete(I.toLowerCase()):X.delete(I),z=v1(_,I,f),v2(I,z,f,G)}}}}else for(f in $)if($.hasOwnProperty(f)&&(I=$[f],I!=null)){if(K8.hasOwnProperty(f))typeof I!=="function"&&h4(f,I);else if($.suppressHydrationWarning!==!0)switch(f){case"children":typeof I!=="string"&&typeof I!=="number"||v2("children",_.textContent,I,G);continue;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"value":case"checked":case"selected":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":continue;case"dangerouslySetInnerHTML":z=_.innerHTML,I=I?I.__html:void 0,I!=null&&(I=GW(_,I),z!==I&&(G[f]={__html:z}));continue;case"className":m5(_,f,"class",I,X,G);continue;case"tabIndex":m5(_,f,"tabindex",I,X,G);continue;case"style":X.delete(f),XW(_,I,G);continue;case"multiple":X.delete(f),v2(f,_.multiple,I,G);continue;case"muted":X.delete(f),v2(f,_.muted,I,G);continue;case"autoFocus":X.delete("autofocus"),v2(f,_.autofocus,I,G);continue;case"data":if(J!=="object"){X.delete(f),z=_.getAttribute("data"),v2(f,z,I,G);continue}case"src":case"href":if(!(I!==""||J==="a"&&f==="href"||J==="object"&&f==="data")){f==="src"?console.error('An empty string ("") was passed to the %s attribute. This may cause the browser to download the whole page again over the network. To fix this, either do not render the element at all or pass null to %s instead of an empty string.',f,f):console.error('An empty string ("") was passed to the %s attribute. To fix this, either do not render the element at all or pass null to %s instead of an empty string.',f,f);continue}$Z(_,f,f,I,X,G);continue;case"action":case"formAction":if(z=_.getAttribute(f),typeof I==="function"){X.delete(f.toLowerCase()),f==="formAction"?(X.delete("name"),X.delete("formenctype"),X.delete("formmethod"),X.delete("formtarget")):(X.delete("enctype"),X.delete("method"),X.delete("target"));continue}else if(z===rP){X.delete(f.toLowerCase()),v2(f,"function",I,G);continue}$Z(_,f,f.toLowerCase(),I,X,G);continue;case"xlinkHref":$Z(_,f,"xlink:href",I,X,G);continue;case"contentEditable":JZ(_,f,"contenteditable",I,X,G);continue;case"spellCheck":JZ(_,f,"spellcheck",I,X,G);continue;case"draggable":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":JZ(_,f,f,I,X,G);continue;case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":KW(_,f,f.toLowerCase(),I,X,G);continue;case"capture":case"download":_:{B=_;var e=z=f,J1=G;if(X.delete(e),B=B.getAttribute(e),B===null)switch(typeof I){case"undefined":case"function":case"symbol":break _;default:if(I===!1)break _}else if(I!=null)switch(typeof I){case"function":case"symbol":break;case"boolean":if(I===!0&&B==="")break _;break;default:if(A1(I,z),B===""+I)break _}v2(z,B,I,J1)}continue;case"cols":case"rows":case"size":case"span":_:{if(B=_,e=z=f,J1=G,X.delete(e),B=B.getAttribute(e),B===null)switch(typeof I){case"undefined":case"function":case"symbol":case"boolean":break _;default:if(isNaN(I)||1>I)break _}else if(I!=null)switch(typeof I){case"function":case"symbol":case"boolean":break;default:if(!(isNaN(I)||1>I)&&(A1(I,z),B===""+I))break _}v2(z,B,I,J1)}continue;case"rowSpan":HW(_,f,"rowspan",I,X,G);continue;case"start":HW(_,f,f,I,X,G);continue;case"xHeight":m5(_,f,"x-height",I,X,G);continue;case"xlinkActuate":m5(_,f,"xlink:actuate",I,X,G);continue;case"xlinkArcrole":m5(_,f,"xlink:arcrole",I,X,G);continue;case"xlinkRole":m5(_,f,"xlink:role",I,X,G);continue;case"xlinkShow":m5(_,f,"xlink:show",I,X,G);continue;case"xlinkTitle":m5(_,f,"xlink:title",I,X,G);continue;case"xlinkType":m5(_,f,"xlink:type",I,X,G);continue;case"xmlBase":m5(_,f,"xml:base",I,X,G);continue;case"xmlLang":m5(_,f,"xml:lang",I,X,G);continue;case"xmlSpace":m5(_,f,"xml:space",I,X,G);continue;case"inert":I!==""||Zq[f]||(Zq[f]=!0,console.error("Received an empty string for a boolean attribute `%s`. This will treat the attribute as if it were false. Either pass `false` to silence this warning, or pass `true` if you used an empty string in earlier versions of React to indicate this attribute is true.",f)),KW(_,f,f,I,X,G);continue;default:if(!(2<f.length)||f[0]!=="o"&&f[0]!=="O"||f[1]!=="n"&&f[1]!=="N"){B=zH(f),z=!1,q.context===j3&&J!=="svg"&&J!=="math"?X.delete(B.toLowerCase()):(e=f.toLowerCase(),e=TQ.hasOwnProperty(e)?TQ[e]||null:null,e!==null&&e!==f&&(z=!0,X.delete(e)),X.delete(B));_:if(e=_,J1=B,B=I,B1(J1))if(e.hasAttribute(J1))e=e.getAttribute(J1),A1(B,J1),B=e===""+B?B:e;else{switch(typeof B){case"function":case"symbol":break _;case"boolean":if(e=J1.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-")break _}B=B===void 0?void 0:null}else B=void 0;z||v2(f,B,I,G)}}}return 0<X.size&&$.suppressHydrationWarning!==!0&&kI(_,X,G),Object.keys(G).length===0?null:G}function uI(_,J){switch(_.length){case 0:return"";case 1:return _[0];case 2:return _[0]+" "+J+" "+_[1];default:return _.slice(0,-1).join(", ")+", "+J+" "+_[_.length-1]}}function zW(_){switch(_){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function bI(){if(typeof performance.getEntriesByType==="function"){for(var _=0,J=0,$=performance.getEntriesByType("resource"),q=0;q<$.length;q++){var G=$[q],X=G.transferSize,z=G.initiatorType,B=G.duration;if(X&&B&&zW(z)){z=0,B=G.responseEnd;for(q+=1;q<$.length;q++){var I=$[q],f=I.startTime;if(f>B)break;var{transferSize:e,initiatorType:J1}=I;e&&zW(J1)&&(I=I.responseEnd,z+=e*(I<B?1:(B-f)/(I-f)))}if(--q,J+=8*(X+z)/(G.duration/1000),_++,10<_)break}}if(0<_)return J/_/1e6}return navigator.connection&&(_=navigator.connection.downlink,typeof _==="number")?_:5}function JQ(_){return _.nodeType===9?_:_.ownerDocument}function WW(_){switch(_){case j7:return G9;case MQ:return Xq;default:return j3}}function LW(_,J){if(_===j3)switch(J){case"svg":return G9;case"math":return Xq;default:return j3}return _===G9&&J==="foreignObject"?j3:_}function QZ(_,J){return _==="textarea"||_==="noscript"||typeof J.children==="string"||typeof J.children==="number"||typeof J.children==="bigint"||typeof J.dangerouslySetInnerHTML==="object"&&J.dangerouslySetInnerHTML!==null&&J.dangerouslySetInnerHTML.__html!=null}function EI(){var _=window.event;if(_&&_.type==="popstate"){if(_===xF)return!1;return xF=_,!0}return xF=null,!1}function K_(){var _=window.event;return _&&_!==GJ?_.type:null}function H_(){var _=window.event;return _&&_!==GJ?_.timeStamp:-1.1}function hI(_){setTimeout(function(){throw _})}function xI(_,J,$){switch(J){case"button":case"input":case"select":case"textarea":$.autoFocus&&_.focus();break;case"img":$.src?_.src=$.src:$.srcSet&&(_.srcset=$.srcSet)}}function mI(){}function gI(_,J,$,q){DI(_,J,$,q),_[_5]=q}function BW(_){s6(_,"")}function pI(_,J,$){_.nodeValue=$}function AW(_){if(!_.__reactWarnedAboutChildrenConflict){var J=_[_5]||null;if(J!==null){var $=i1(_);$!==null&&(typeof J.children==="string"||typeof J.children==="number"?(_.__reactWarnedAboutChildrenConflict=!0,z1($,function(){console.error('Cannot use a ref on a React element as a container to `createRoot` or `createPortal` if that element also sets "children" text content using React. It should be a leaf with no children. Otherwise it\'s ambiguous which children should be used.')})):J.dangerouslySetInnerHTML!=null&&(_.__reactWarnedAboutChildrenConflict=!0,z1($,function(){console.error('Cannot use a ref on a React element as a container to `createRoot` or `createPortal` if that element also sets "dangerouslySetInnerHTML" using React. It should be a leaf with no children. Otherwise it\'s ambiguous which children should be used.')})))}}}function X6(_){return _==="head"}function cI(_,J){_.removeChild(J)}function lI(_,J){(_.nodeType===9?_.body:_.nodeName==="HTML"?_.ownerDocument.body:_).removeChild(J)}function MW(_,J){var $=J,q=0;do{var G=$.nextSibling;if(_.removeChild($),G&&G.nodeType===8)if($=G.data,$===UJ||$===Fq){if(q===0){_.removeChild(G),P7(J);return}q--}else if($===qJ||$===k6||$===v8||$===U9||$===S8)q++;else if($===sP)Y_(_.ownerDocument.documentElement);else if($===oP){$=_.ownerDocument.head,Y_($);for(var X=$.firstChild;X;){var{nextSibling:z,nodeName:B}=X;X[T_]||B==="SCRIPT"||B==="STYLE"||B==="LINK"&&X.rel.toLowerCase()==="stylesheet"||$.removeChild(X),X=z}}else $===tP&&Y_(_.ownerDocument.body);$=G}while($);P7(J)}function TW(_,J){var $=_;_=0;do{var q=$.nextSibling;if($.nodeType===1?J?($._stashedDisplay=$.style.display,$.style.display="none"):($.style.display=$._stashedDisplay||"",$.getAttribute("style")===""&&$.removeAttribute("style")):$.nodeType===3&&(J?($._stashedText=$.nodeValue,$.nodeValue=""):$.nodeValue=$._stashedText||""),q&&q.nodeType===8)if($=q.data,$===UJ)if(_===0)break;else _--;else $!==qJ&&$!==k6&&$!==v8&&$!==U9||_++;$=q}while($)}function iI(_){TW(_,!0)}function dI(_){_=_.style,typeof _.setProperty==="function"?_.setProperty("display","none","important"):_.display="none"}function rI(_){_.nodeValue=""}function aI(_){TW(_,!1)}function sI(_,J){J=J[nP],J=J!==void 0&&J!==null&&J.hasOwnProperty("display")?J.display:null,_.style.display=J==null||typeof J==="boolean"?"":(""+J).trim()}function tI(_,J){_.nodeValue=J}function qZ(_){var J=_.firstChild;J&&J.nodeType===10&&(J=J.nextSibling);for(;J;){var $=J;switch(J=J.nextSibling,$.nodeName){case"HTML":case"HEAD":case"BODY":qZ($),P1($);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if($.rel.toLowerCase()==="stylesheet")continue}_.removeChild($)}}function oI(_,J,$,q){for(;_.nodeType===1;){var G=$;if(_.nodeName.toLowerCase()!==J.toLowerCase()){if(!q&&(_.nodeName!=="INPUT"||_.type!=="hidden"))break}else if(!q)if(J==="input"&&_.type==="hidden"){A1(G.name,"name");var X=G.name==null?null:""+G.name;if(G.type==="hidden"&&_.getAttribute("name")===X)return _}else return _;else if(!_[T_])switch(J){case"meta":if(!_.hasAttribute("itemprop"))break;return _;case"link":if(X=_.getAttribute("rel"),X==="stylesheet"&&_.hasAttribute("data-precedence"))break;else if(X!==G.rel||_.getAttribute("href")!==(G.href==null||G.href===""?null:G.href)||_.getAttribute("crossorigin")!==(G.crossOrigin==null?null:G.crossOrigin)||_.getAttribute("title")!==(G.title==null?null:G.title))break;return _;case"style":if(_.hasAttribute("data-precedence"))break;return _;case"script":if(X=_.getAttribute("src"),(X!==(G.src==null?null:G.src)||_.getAttribute("type")!==(G.type==null?null:G.type)||_.getAttribute("crossorigin")!==(G.crossOrigin==null?null:G.crossOrigin))&&X&&_.hasAttribute("async")&&!_.hasAttribute("itemprop"))break;return _;default:return _}if(_=S5(_.nextSibling),_===null)break}return null}function nI(_,J,$){if(J==="")return null;for(;_.nodeType!==3;){if((_.nodeType!==1||_.nodeName!=="INPUT"||_.type!=="hidden")&&!$)return null;if(_=S5(_.nextSibling),_===null)return null}return _}function RW(_,J){for(;_.nodeType!==8;){if((_.nodeType!==1||_.nodeName!=="INPUT"||_.type!=="hidden")&&!J)return null;if(_=S5(_.nextSibling),_===null)return null}return _}function UZ(_){return _.data===k6||_.data===v8}function GZ(_){return _.data===U9||_.data===k6&&_.ownerDocument.readyState!==XA}function eI(_,J){var $=_.ownerDocument;if(_.data===v8)_._reactRetry=J;else if(_.data!==k6||$.readyState!==XA)J();else{var q=function(){J(),$.removeEventListener("DOMContentLoaded",q)};$.addEventListener("DOMContentLoaded",q),_._reactRetry=q}}function S5(_){for(;_!=null;_=_.nextSibling){var J=_.nodeType;if(J===1||J===3)break;if(J===8){if(J=_.data,J===qJ||J===U9||J===k6||J===v8||J===S8||J===bF||J===FA)break;if(J===UJ||J===Fq)return null}}return _}function OW(_){if(_.nodeType===1){for(var J=_.nodeName.toLowerCase(),$={},q=_.attributes,G=0;G<q.length;G++){var X=q[G];$[FW(X.name)]=X.name.toLowerCase()==="style"?_Z(_):X.value}return{type:J,props:$}}return _.nodeType===8?_.data===S8?{type:"Activity",props:{}}:{type:"Suspense",props:{}}:_.nodeValue}function IW(_,J,$){return $===null||$[aP]!==!0?(_.nodeValue===J?_=null:(J=F6(J),_=F6(_.nodeValue)===J?null:_.nodeValue),_):null}function ZZ(_){_=_.nextSibling;for(var J=0;_;){if(_.nodeType===8){var $=_.data;if($===UJ||$===Fq){if(J===0)return S5(_.nextSibling);J--}else $!==qJ&&$!==U9&&$!==k6&&$!==v8&&$!==S8||J++}_=_.nextSibling}return null}function wW(_){_=_.previousSibling;for(var J=0;_;){if(_.nodeType===8){var $=_.data;if($===qJ||$===U9||$===k6||$===v8||$===S8){if(J===0)return _;J--}else $!==UJ&&$!==Fq||J++}_=_.previousSibling}return null}function _w(_){P7(_)}function Jw(_){P7(_)}function $w(_){P7(_)}function PW(_,J,$,q,G){switch(G&&b9(_,q.ancestorInfo),J=JQ($),_){case"html":if(_=J.documentElement,!_)throw Error("React expected an <html> element (document.documentElement) to exist in the Document but one was not found. React never removes the documentElement for any Document it renders into so the cause is likely in some other script running on this page.");return _;case"head":if(_=J.head,!_)throw Error("React expected a <head> element (document.head) to exist in the Document but one was not found. React never removes the head for any Document it renders into so the cause is likely in some other script running on this page.");return _;case"body":if(_=J.body,!_)throw Error("React expected a <body> element (document.body) to exist in the Document but one was not found. React never removes the body for any Document it renders into so the cause is likely in some other script running on this page.");return _;default:throw Error("resolveSingletonInstance was called with an element type that is not supported. This is a bug in React.")}}function Qw(_,J,$,q){if(!$[z6]&&i1($)){var G=$.tagName.toLowerCase();console.error("You are mounting a new %s component when a previous one has not first unmounted. It is an error to render more than one %s component at a time and attributes and children of these components will likely fail in unpredictable ways. Please only render a single instance of <%s> and if you need to mount a new one, ensure any previous ones have unmounted first.",G,G,G)}switch(_){case"html":case"head":case"body":break;default:console.error("acquireSingletonInstance was called with an element type that is not supported. This is a bug in React.")}for(G=$.attributes;G.length;)$.removeAttributeNode(G[0]);m2($,_,J),$[g2]=q,$[_5]=J}function Y_(_){for(var J=_.attributes;J.length;)_.removeAttributeNode(J[0]);P1(_)}function $Q(_){return typeof _.getRootNode==="function"?_.getRootNode():_.nodeType===9?_:_.ownerDocument}function NW(_,J,$){var q=Z9;if(q&&typeof J==="string"&&J){var G=w0(J);G='link[rel="'+_+'"][href="'+G+'"]',typeof $==="string"&&(G+='[crossorigin="'+$+'"]'),LA.has(G)||(LA.add(G),_={rel:_,crossOrigin:$,href:J},q.querySelector(G)===null&&(J=q.createElement("link"),m2(J,"link",_),x1(J),q.head.appendChild(J)))}}function CW(_,J,$,q){var G=(G=H6.current)?$Q(G):null;if(!G)throw Error('"resourceRoot" was expected to exist. This is a bug in React.');switch(_){case"meta":case"title":return null;case"style":return typeof $.precedence==="string"&&typeof $.href==="string"?($=I7($.href),J=F0(G).hoistableStyles,q=J.get($),q||(q={type:"style",instance:null,count:0,state:null},J.set($,q)),q):{type:"void",instance:null,count:0,state:null};case"link":if($.rel==="stylesheet"&&typeof $.href==="string"&&typeof $.precedence==="string"){_=I7($.href);var X=F0(G).hoistableStyles,z=X.get(_);if(!z&&(G=G.ownerDocument||G,z={type:"stylesheet",instance:null,count:0,state:{loading:V8,preload:null}},X.set(_,z),(X=G.querySelector(z_(_)))&&!X._p&&(z.instance=X,z.state.loading=ZJ|o5),!n5.has(_))){var B={rel:"preload",as:"style",href:$.href,crossOrigin:$.crossOrigin,integrity:$.integrity,media:$.media,hrefLang:$.hrefLang,referrerPolicy:$.referrerPolicy};n5.set(_,B),X||qw(G,_,B,z.state)}if(J&&q===null)throw $=`
|
|
177
177
|
|
|
178
178
|
- `+QQ(J)+`
|
|
@@ -238,13 +238,13 @@ React keys must be passed directly to JSX without using spread:
|
|
|
238
238
|
React keys must be passed directly to JSX without using spread:
|
|
239
239
|
let props = %s;
|
|
240
240
|
<%s key={someKey} {...props} />`,a,L1,T1,L1),o[L1+a]=!0)}if(L1=null,_1!==void 0&&(Z(_1),L1=""+_1),W(t)&&(Z(t.key),L1=""+t.key),"key"in t){_1={};for(var G1 in t)G1!=="key"&&(_1[G1]=t[G1])}else _1=t;return L1&&L(_1,typeof k==="function"?k.displayName||k.name||"Unknown":k),O(k,L1,_1,H(),H1,O1)}function A(k){R(k)?k._store&&(k._store.validated=1):typeof k==="object"&&k!==null&&k.$$typeof===u&&(k._payload.status==="fulfilled"?R(k._payload.value)&&k._payload.value._store&&(k._payload.value._store.validated=1):k._store&&(k._store.validated=1))}function R(k){return typeof k==="object"&&k!==null&&k.$$typeof===w}var w=Symbol.for("react.transitional.element"),P=Symbol.for("react.portal"),V=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),y=Symbol.for("react.consumer"),N=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),x=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),u=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),m=Symbol.for("react.client.reference"),s=h8.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U1=Object.prototype.hasOwnProperty,Q1=Array.isArray,h=console.createTask?console.createTask:function(){return null};h8={react_stack_bottom_frame:function(k){return k()}};var g,p={},c=h8.react_stack_bottom_frame.bind(h8,Y)(),l=h(K(Y)),o={};CN.Fragment=V,CN.jsx=function(k,t,_1){var a=1e4>s.recentlyCreatedOwnerStacks++;return T(k,t,_1,!1,a?Error("react-stack-top-frame"):c,a?h(K(k)):l)},CN.jsxs=function(k,t,_1){var a=1e4>s.recentlyCreatedOwnerStacks++;return T(k,t,_1,!0,a?Error("react-stack-top-frame"):c,a?h(K(k)):l)}})()});var NT=o4((IS)=>{var h5=s0(B4());(function(){function Q(R,w){return R===w&&(R!==0||1/R===1/w)||R!==R&&w!==w}function U(R,w){O||h5.startTransition===void 0||(O=!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 P=w();if(!T){var V=w();H(P,V)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),T=!0)}V=Y({inst:{value:P,getSnapshot:w}});var S=V[0].inst,C=V[1];return L(function(){S.value=P,S.getSnapshot=w,Z(S)&&C({inst:S})},[R,P,w]),W(function(){return Z(S)&&C({inst:S}),R(function(){Z(S)&&C({inst:S})})},[R]),M(P),P}function Z(R){var w=R.getSnapshot;R=R.value;try{var P=w();return!H(R,P)}catch(V){return!0}}function K(R,w){return w()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var H=typeof Object.is==="function"?Object.is:Q,Y=h5.useState,W=h5.useEffect,L=h5.useLayoutEffect,M=h5.useDebugValue,O=!1,T=!1,A=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?K:U;IS.useSyncExternalStore=h5.useSyncExternalStore!==void 0?h5.useSyncExternalStore:A,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var CT=o4((wS)=>{var m3=s0(B4());(function(){function Q(M,O){return M===O&&(M!==0||1/M===1/O)||M!==M&&O!==O}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var U=NT(),Z=typeof Object.is==="function"?Object.is:Q,K=U.useSyncExternalStore,H=m3.useRef,Y=m3.useEffect,W=m3.useMemo,L=m3.useDebugValue;wS.useSyncExternalStoreWithSelector=function(M,O,T,A,R){var w=H(null);if(w.current===null){var P={hasValue:!1,value:null};w.current=P}else P=w.current;w=W(function(){function S(D){if(!C){if(C=!0,y=D,D=A(D),R!==void 0&&P.hasValue){var x=P.value;if(R(x,D))return N=x}return N=D}if(x=N,Z(y,D))return x;var E=A(D);if(R!==void 0&&R(x,E))return y=D,x;return y=D,N=E}var C=!1,y,N,v=T===void 0?null:T;return[function(){return S(O())},v===null?void 0:function(){return S(v())}]},[O,T,A,R]);var V=K(M,w[0],w[1]);return Y(function(){P.hasValue=!0,P.value=V},[V]),L(V),V},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var jO=s0(EA(),1);var D2=s0(B4(),1);var hA={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 l1=s0(u8(),1),ON="https://brand.volter.ai/logo/twin-world/svg?size=64&variant=mono";function HJ({href:Q,onClick:U}){return l1.jsxDEV("h1",{children:l1.jsxDEV("a",{href:Q,onClick:U,children:[l1.jsxDEV("img",{src:ON,alt:"",width:24,height:24,style:{verticalAlign:"middle"}},void 0,!1,void 0,this),l1.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 k3(Q){return(await Q.json().catch(()=>({}))).error??`answered ${Q.status}`}function mA(Q,U,Z=0,K=""){let[H,Y]=D2.useState({state:"loading"});return D2.useEffect(()=>{Y({state:"loading"})},[K,U]),D2.useEffect(()=>{if(!U)return;let W=!0;return(async()=>{try{let L=await Q(U),M=L.ok?{state:"ok",data:await L.json()}:{state:"error",status:L.status,error:await k3(L)};if(W)Y(M)}catch(L){if(W)Y({state:"error",status:0,error:String(L)})}})(),()=>{W=!1}},[K,U,Z]),H}function r2({load:Q,what:U,retry:Z,lines:K=3}){if(Q.state==="loading")return l1.jsxDEV(IN,{lines:K,label:`Loading ${U}…`},void 0,!1,void 0,this);if(Q.state==="error")return l1.jsxDEV("div",{role:"alert",className:"error-state",children:[l1.jsxDEV("span",{children:["Could not read ",U,": ",Q.error]},void 0,!0,void 0,this),Z?l1.jsxDEV("button",{type:"button",onClick:Z,children:"Try again"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this);return null}function IN({lines:Q=3,label:U="Loading…"}){return l1.jsxDEV("div",{className:"skeleton",role:"status","aria-label":U,children:Array.from({length:Q},(Z,K)=>l1.jsxDEV("span",{style:{width:`${[92,76,84,64,88][K%5]}%`}},K,!1,void 0,this))},void 0,!1,void 0,this)}function j0({iso:Q,time:U}){if(!Q)return l1.jsxDEV("span",{children:"—"},void 0,!1,void 0,this);let Z=new Date(Q);return l1.jsxDEV("time",{dateTime:Q,title:Q,children:Number.isNaN(Z.getTime())?Q:U?Z.toLocaleTimeString():Z.toLocaleString()},void 0,!1,void 0,this)}var b8=(Q)=>Q?new Date(Q).toLocaleString():"—";function sF(Q){let U=Q?Date.parse(Q):Number.NaN;if(Number.isNaN(U))return"—";let Z=Math.max(0,Math.round((Date.now()-U)/1000));return Z<60?"just now":Z<3600?`${Math.round(Z/60)}m ago`:Z<86400?`${Math.round(Z/3600)}h ago`:`${Math.round(Z/86400)}d ago`}function l0(Q,U){let Z=U.replace(/[_-]+/g," "),K=Z.endsWith("s")?Z:/[^aeiou]y$/.test(Z)?`${Z.slice(0,-1)}ies`:/(ch|sh|x)$/.test(Z)?`${Z}es`:`${Z}s`;return`${Q} ${Q===1?Z:K}`}var E8=(Q)=>Q.length<=1?Q.join(""):`${Q.slice(0,-1).join(", ")} and ${Q[Q.length-1]}`,wN={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"},s1=(Q)=>wN[Q]??Q.charAt(0).toUpperCase()+Q.slice(1);function q2({vendor:Q}){let U=hA[Q];return l1.jsxDEV("span",{className:U?"mark logo":"mark","aria-hidden":"true",children:U?l1.jsxDEV("svg",{viewBox:"0 0 24 24",children:l1.jsxDEV("path",{d:U.d,fill:U.fill},void 0,!1,void 0,this)},void 0,!1,void 0,this):s1(Q).charAt(0)},void 0,!1,void 0,this)}var xA=(Q)=>{Q.currentTarget.closest("details")?.removeAttribute("open")},PN="volter.theme",tF=()=>{try{let Q=localStorage.getItem(PN);return Q==="light"||Q==="dark"?Q:"system"}catch{return"system"}};function Aq(Q=tF()){let U=document.documentElement;if(Q==="system")U.removeAttribute("data-theme");else U.setAttribute("data-theme",Q)}function gA(){return D2.useEffect(()=>{let Q=()=>[...document.querySelectorAll("details.menu[open], details.clock-more[open]")],U=(K)=>{if(K.key!=="Escape"||document.querySelector("dialog[open]"))return;let H=Q();if(!H.length)return;for(let Y of H)Y.removeAttribute("open");H[H.length-1].querySelector("summary")?.focus()},Z=(K)=>{let H=K.target;for(let Y of Q())if(!H||!Y.contains(H))Y.removeAttribute("open")};return document.addEventListener("keydown",U),document.addEventListener("click",Z),()=>{document.removeEventListener("keydown",U),document.removeEventListener("click",Z)}},[]),null}function E5({open:Q,onClose:U,title:Z,children:K,footer:H,wide:Y}){let W=D2.useRef(null),L=D2.useId();return D2.useEffect(()=>{let M=W.current;if(!M)return;if(Q&&!M.open){M.showModal();let O=M.querySelector(".dialog-body :is(input:not([type=hidden]):not([disabled]), select, textarea)");if(O?.focus(),O instanceof HTMLInputElement&&O.value&&/^(text|search|email|url)$/.test(O.type))O.select()}if(!Q&&M.open)M.close()},[Q]),l1.jsxDEV("dialog",{ref:W,className:Y==="window"?"dialog window":Y?"dialog wide":"dialog","aria-labelledby":L,onClose:U,onCancel:(M)=>{M.preventDefault(),U()},onMouseDown:(M)=>{if(M.target===W.current)U()},children:Q?l1.jsxDEV(l1.Fragment,{children:[l1.jsxDEV("div",{className:"dialog-head",children:[l1.jsxDEV("h2",{id:L,children:Z},void 0,!1,void 0,this),l1.jsxDEV("button",{type:"button",className:"icon-button","aria-label":"Close",onClick:U,children:"✕"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),l1.jsxDEV("div",{className:"dialog-body",children:K},void 0,!1,void 0,this),H?l1.jsxDEV("div",{className:"dialog-foot",children:H},void 0,!1,void 0,this):null]},void 0,!0,void 0,this):null},void 0,!1,void 0,this)}var rF="volter:confirm";function n4(Q){return new Promise((U)=>{window.dispatchEvent(new CustomEvent(rF,{detail:{ask:Q,resolve:U}}))})}function pA(){let[Q,U]=D2.useState(null),[Z,K]=D2.useState("");D2.useEffect(()=>{let L=(M)=>{K(""),U(M.detail)};return window.addEventListener(rF,L),()=>window.removeEventListener(rF,L)},[]);let H=(L)=>{Q?.resolve(L),U(null)},Y=Q?.ask,W=!Y?.typed||Z===Y.typed;return l1.jsxDEV(E5,{open:Boolean(Q),onClose:()=>H(!1),title:Y?.title??"",footer:l1.jsxDEV(l1.Fragment,{children:[l1.jsxDEV("button",{type:"button",onClick:()=>H(!1),children:"Cancel"},void 0,!1,void 0,this),l1.jsxDEV("button",{type:"button",className:Y?.danger?"danger-button":"primary",disabled:!W,onClick:()=>H(!0),children:Y?.action},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:[Y?.body?l1.jsxDEV("div",{className:"confirm-body",children:Y.body},void 0,!1,void 0,this):null,Y?.typed?l1.jsxDEV("div",{className:"typed-confirm",children:[l1.jsxDEV("p",{children:["Type ",l1.jsxDEV("code",{children:Y.typed},void 0,!1,void 0,this)," to confirm."]},void 0,!0,void 0,this),l1.jsxDEV("input",{autoFocus:!0,"aria-label":`Type ${Y.typed} to confirm`,value:Z,onChange:(L)=>K(L.target.value),onKeyDown:(L)=>{if(L.key==="Enter"&&W)H(!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 aF="volter:toast";function e0(Q,U="ok"){window.dispatchEvent(new CustomEvent(aF,{detail:{text:Q,kind:U}}))}function cA(){let[Q,U]=D2.useState([]);return D2.useEffect(()=>{let Z=0,K=(H)=>{let{text:Y,kind:W}=H.detail,L=++Z;if(U((M)=>[...M.slice(-3),{id:L,text:Y,kind:W}]),W!=="error")setTimeout(()=>U((M)=>M.filter((O)=>O.id!==L)),4500)};return window.addEventListener(aF,K),()=>window.removeEventListener(aF,K)},[]),l1.jsxDEV("div",{className:"toasts",role:"region","aria-label":"Notifications",children:Q.map((Z)=>l1.jsxDEV("div",{className:`toast ${Z.kind}`,role:Z.kind==="error"?"alert":"status",children:[l1.jsxDEV("span",{children:Z.text},void 0,!1,void 0,this),l1.jsxDEV("button",{type:"button",className:"icon-button","aria-label":"Dismiss",onClick:()=>U((K)=>K.filter((H)=>H.id!==Z.id)),children:"✕"},void 0,!1,void 0,this)]},Z.id,!0,void 0,this))},void 0,!1,void 0,this)}function oF({value:Q,label:U,secret:Z}){let[K,H]=D2.useState(!1);return l1.jsxDEV("div",{className:"copy-field",children:[U?l1.jsxDEV("span",{className:"copy-label",children:U},void 0,!1,void 0,this):null,l1.jsxDEV("div",{className:"copy-row",children:[l1.jsxDEV("input",{readOnly:!0,value:Q,"aria-label":U??"Value",onFocus:(W)=>W.currentTarget.select(),spellCheck:!1},void 0,!1,void 0,this),l1.jsxDEV("button",{type:"button",onClick:()=>{navigator.clipboard?.writeText(Q).then(()=>{H(!0),setTimeout(()=>H(!1),1600),e0(Z?"Copied. Keep it somewhere safe":"Copied")}).catch(()=>e0("Your browser would not copy it: select it and copy","error"))},children:K?"Copied":"Copy"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function lA({label:Q,items:U}){return l1.jsxDEV("details",{className:"menu row-menu",children:[l1.jsxDEV("summary",{className:"icon-button",role:"button","aria-haspopup":"menu","aria-label":Q,title:Q,children:"⋯"},void 0,!1,void 0,this),l1.jsxDEV("div",{className:"popover menu-list",role:"menu",children:U.filter((Z)=>Boolean(Z)).map((Z)=>Z.href?l1.jsxDEV("a",{role:"menuitem",href:Z.href,className:Z.danger?"danger-item":void 0,onClick:xA,children:Z.label},Z.label,!1,void 0,this):l1.jsxDEV("button",{type:"button",role:"menuitem",disabled:Z.disabled,className:Z.danger?"danger-item":void 0,onClick:(K)=>{xA(K),Z.onSelect?.()},children:Z.label},Z.label,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function X9({title:Q,children:U,action:Z}){return l1.jsxDEV("div",{className:"empty-state",children:[l1.jsxDEV("p",{className:"empty-title",children:Q},void 0,!1,void 0,this),U?l1.jsxDEV("div",{className:"empty-body",children:U},void 0,!1,void 0,this):null,Z?l1.jsxDEV("div",{className:"empty-action",children:Z},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}function iA(){return D2.useEffect(()=>{let Q=(Z)=>{let K=document.querySelector("main.app"),H=Z.target;if(K?.hasAttribute("data-drawer")&&H&&!H.closest(".side")&&!H.closest(".drawer-button"))K.removeAttribute("data-drawer")},U=(Z)=>{if(Z.key==="Escape")NN()};return document.addEventListener("click",Q),document.addEventListener("keydown",U),()=>{document.removeEventListener("click",Q),document.removeEventListener("keydown",U)}},[]),l1.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 NN=()=>{document.querySelector("main.app")?.removeAttribute("data-drawer")};var F1=s0(B4(),1);var K1=s0(dA(),1),W1=s0(B4(),1);function _2(Q){if(typeof Q==="string"||typeof Q==="number")return""+Q;let U="";if(Array.isArray(Q)){for(let Z=0,K;Z<Q.length;Z++)if((K=_2(Q[Z]))!=="")U+=(U&&" ")+K}else for(let Z in Q)if(Q[Z])U+=(U&&" ")+Z;return U}var fN={value:()=>{}};function aA(){for(var Q=0,U=arguments.length,Z={},K;Q<U;++Q){if(!(K=arguments[Q]+"")||K in Z||/[\s.]/.test(K))throw Error("illegal type: "+K);Z[K]=[]}return new Mq(Z)}function Mq(Q){this._=Q}function SN(Q,U){return Q.trim().split(/^|\s+/).map(function(Z){var K="",H=Z.indexOf(".");if(H>=0)K=Z.slice(H+1),Z=Z.slice(0,H);if(Z&&!U.hasOwnProperty(Z))throw Error("unknown type: "+Z);return{type:Z,name:K}})}Mq.prototype=aA.prototype={constructor:Mq,on:function(Q,U){var Z=this._,K=SN(Q+"",Z),H,Y=-1,W=K.length;if(arguments.length<2){while(++Y<W)if((H=(Q=K[Y]).type)&&(H=vN(Z[H],Q.name)))return H;return}if(U!=null&&typeof U!=="function")throw Error("invalid callback: "+U);while(++Y<W)if(H=(Q=K[Y]).type)Z[H]=rA(Z[H],Q.name,U);else if(U==null)for(H in Z)Z[H]=rA(Z[H],Q.name,null);return this},copy:function(){var Q={},U=this._;for(var Z in U)Q[Z]=U[Z].slice();return new Mq(Q)},call:function(Q,U){if((H=arguments.length-2)>0)for(var Z=Array(H),K=0,H,Y;K<H;++K)Z[K]=arguments[K+2];if(!this._.hasOwnProperty(Q))throw Error("unknown type: "+Q);for(Y=this._[Q],K=0,H=Y.length;K<H;++K)Y[K].value.apply(U,Z)},apply:function(Q,U,Z){if(!this._.hasOwnProperty(Q))throw Error("unknown type: "+Q);for(var K=this._[Q],H=0,Y=K.length;H<Y;++H)K[H].value.apply(U,Z)}};function vN(Q,U){for(var Z=0,K=Q.length,H;Z<K;++Z)if((H=Q[Z]).name===U)return H.value}function rA(Q,U,Z){for(var K=0,H=Q.length;K<H;++K)if(Q[K].name===U){Q[K]=fN,Q=Q.slice(0,K).concat(Q.slice(K+1));break}if(Z!=null)Q.push({name:U,value:Z});return Q}var x8=aA;function K9(Q){return function(){return this.matches(Q)}}function Tq(Q){return function(U){return U.matches(Q)}}var Rq="http://www.w3.org/1999/xhtml",nF={svg:"http://www.w3.org/2000/svg",xhtml:Rq,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function e4(Q){var U=Q+="",Z=U.indexOf(":");if(Z>=0&&(U=Q.slice(0,Z))!=="xmlns")Q=Q.slice(Z+1);return nF.hasOwnProperty(U)?{space:nF[U],local:Q}:Q}function eF(Q){let U;while(U=Q.sourceEvent)Q=U;return Q}function a2(Q,U){if(Q=eF(Q),U===void 0)U=Q.currentTarget;if(U){var Z=U.ownerSVGElement||U;if(Z.createSVGPoint){var K=Z.createSVGPoint();return K.x=Q.clientX,K.y=Q.clientY,K=K.matrixTransform(U.getScreenCTM().inverse()),[K.x,K.y]}if(U.getBoundingClientRect){var H=U.getBoundingClientRect();return[Q.clientX-H.left-U.clientLeft,Q.clientY-H.top-U.clientTop]}}return[Q.pageX,Q.pageY]}function jN(){}function h6(Q){return Q==null?jN:function(){return this.querySelector(Q)}}function _X(Q){if(typeof Q!=="function")Q=h6(Q);for(var U=this._groups,Z=U.length,K=Array(Z),H=0;H<Z;++H)for(var Y=U[H],W=Y.length,L=K[H]=Array(W),M,O,T=0;T<W;++T)if((M=Y[T])&&(O=Q.call(M,M.__data__,T,Y))){if("__data__"in M)O.__data__=M.__data__;L[T]=O}return new U2(K,this._parents)}function JX(Q){return Q==null?[]:Array.isArray(Q)?Q:Array.from(Q)}function VN(){return[]}function H9(Q){return Q==null?VN:function(){return this.querySelectorAll(Q)}}function yN(Q){return function(){return JX(Q.apply(this,arguments))}}function $X(Q){if(typeof Q==="function")Q=yN(Q);else Q=H9(Q);for(var U=this._groups,Z=U.length,K=[],H=[],Y=0;Y<Z;++Y)for(var W=U[Y],L=W.length,M,O=0;O<L;++O)if(M=W[O])K.push(Q.call(M,M.__data__,O,W)),H.push(M);return new U2(K,H)}var kN=Array.prototype.find;function DN(Q){return function(){return kN.call(this.children,Q)}}function uN(){return this.firstElementChild}function QX(Q){return this.select(Q==null?uN:DN(typeof Q==="function"?Q:Tq(Q)))}var bN=Array.prototype.filter;function EN(){return Array.from(this.children)}function hN(Q){return function(){return bN.call(this.children,Q)}}function qX(Q){return this.selectAll(Q==null?EN:hN(typeof Q==="function"?Q:Tq(Q)))}function UX(Q){if(typeof Q!=="function")Q=K9(Q);for(var U=this._groups,Z=U.length,K=Array(Z),H=0;H<Z;++H)for(var Y=U[H],W=Y.length,L=K[H]=[],M,O=0;O<W;++O)if((M=Y[O])&&Q.call(M,M.__data__,O,Y))L.push(M);return new U2(K,this._parents)}function YJ(Q){return Array(Q.length)}function GX(){return new U2(this._enter||this._groups.map(YJ),this._parents)}function zJ(Q,U){this.ownerDocument=Q.ownerDocument,this.namespaceURI=Q.namespaceURI,this._next=null,this._parent=Q,this.__data__=U}zJ.prototype={constructor:zJ,appendChild:function(Q){return this._parent.insertBefore(Q,this._next)},insertBefore:function(Q,U){return this._parent.insertBefore(Q,U)},querySelector:function(Q){return this._parent.querySelector(Q)},querySelectorAll:function(Q){return this._parent.querySelectorAll(Q)}};function ZX(Q){return function(){return Q}}function xN(Q,U,Z,K,H,Y){var W=0,L,M=U.length,O=Y.length;for(;W<O;++W)if(L=U[W])L.__data__=Y[W],K[W]=L;else Z[W]=new zJ(Q,Y[W]);for(;W<M;++W)if(L=U[W])H[W]=L}function mN(Q,U,Z,K,H,Y,W){var L,M,O=new Map,T=U.length,A=Y.length,R=Array(T),w;for(L=0;L<T;++L)if(M=U[L])if(R[L]=w=W.call(M,M.__data__,L,U)+"",O.has(w))H[L]=M;else O.set(w,M);for(L=0;L<A;++L)if(w=W.call(Q,Y[L],L,Y)+"",M=O.get(w))K[L]=M,M.__data__=Y[L],O.delete(w);else Z[L]=new zJ(Q,Y[L]);for(L=0;L<T;++L)if((M=U[L])&&O.get(R[L])===M)H[L]=M}function gN(Q){return Q.__data__}function FX(Q,U){if(!arguments.length)return Array.from(this,gN);var Z=U?mN:xN,K=this._parents,H=this._groups;if(typeof Q!=="function")Q=ZX(Q);for(var Y=H.length,W=Array(Y),L=Array(Y),M=Array(Y),O=0;O<Y;++O){var T=K[O],A=H[O],R=A.length,w=pN(Q.call(T,T&&T.__data__,O,K)),P=w.length,V=L[O]=Array(P),S=W[O]=Array(P),C=M[O]=Array(R);Z(T,A,V,S,C,w,U);for(var y=0,N=0,v,D;y<P;++y)if(v=V[y]){if(y>=N)N=y+1;while(!(D=S[N])&&++N<P);v._next=D||null}}return W=new U2(W,K),W._enter=L,W._exit=M,W}function pN(Q){return typeof Q==="object"&&"length"in Q?Q:Array.from(Q)}function XX(){return new U2(this._exit||this._groups.map(YJ),this._parents)}function KX(Q,U,Z){var K=this.enter(),H=this,Y=this.exit();if(typeof Q==="function"){if(K=Q(K),K)K=K.selection()}else K=K.append(Q+"");if(U!=null){if(H=U(H),H)H=H.selection()}if(Z==null)Y.remove();else Z(Y);return K&&H?K.merge(H).order():H}function HX(Q){var U=Q.selection?Q.selection():Q;for(var Z=this._groups,K=U._groups,H=Z.length,Y=K.length,W=Math.min(H,Y),L=Array(H),M=0;M<W;++M)for(var O=Z[M],T=K[M],A=O.length,R=L[M]=Array(A),w,P=0;P<A;++P)if(w=O[P]||T[P])R[P]=w;for(;M<H;++M)L[M]=Z[M];return new U2(L,this._parents)}function YX(){for(var Q=this._groups,U=-1,Z=Q.length;++U<Z;)for(var K=Q[U],H=K.length-1,Y=K[H],W;--H>=0;)if(W=K[H]){if(Y&&W.compareDocumentPosition(Y)^4)Y.parentNode.insertBefore(W,Y);Y=W}return this}function zX(Q){if(!Q)Q=cN;function U(A,R){return A&&R?Q(A.__data__,R.__data__):!A-!R}for(var Z=this._groups,K=Z.length,H=Array(K),Y=0;Y<K;++Y){for(var W=Z[Y],L=W.length,M=H[Y]=Array(L),O,T=0;T<L;++T)if(O=W[T])M[T]=O;M.sort(U)}return new U2(H,this._parents).order()}function cN(Q,U){return Q<U?-1:Q>U?1:Q>=U?0:NaN}function WX(){var Q=arguments[0];return arguments[0]=this,Q.apply(null,arguments),this}function LX(){return Array.from(this)}function BX(){for(var Q=this._groups,U=0,Z=Q.length;U<Z;++U)for(var K=Q[U],H=0,Y=K.length;H<Y;++H){var W=K[H];if(W)return W}return null}function AX(){let Q=0;for(let U of this)++Q;return Q}function MX(){return!this.node()}function TX(Q){for(var U=this._groups,Z=0,K=U.length;Z<K;++Z)for(var H=U[Z],Y=0,W=H.length,L;Y<W;++Y)if(L=H[Y])Q.call(L,L.__data__,Y,H);return this}function lN(Q){return function(){this.removeAttribute(Q)}}function iN(Q){return function(){this.removeAttributeNS(Q.space,Q.local)}}function dN(Q,U){return function(){this.setAttribute(Q,U)}}function rN(Q,U){return function(){this.setAttributeNS(Q.space,Q.local,U)}}function aN(Q,U){return function(){var Z=U.apply(this,arguments);if(Z==null)this.removeAttribute(Q);else this.setAttribute(Q,Z)}}function sN(Q,U){return function(){var Z=U.apply(this,arguments);if(Z==null)this.removeAttributeNS(Q.space,Q.local);else this.setAttributeNS(Q.space,Q.local,Z)}}function RX(Q,U){var Z=e4(Q);if(arguments.length<2){var K=this.node();return Z.local?K.getAttributeNS(Z.space,Z.local):K.getAttribute(Z)}return this.each((U==null?Z.local?iN:lN:typeof U==="function"?Z.local?sN:aN:Z.local?rN:dN)(Z,U))}function WJ(Q){return Q.ownerDocument&&Q.ownerDocument.defaultView||Q.document&&Q||Q.defaultView}function tN(Q){return function(){this.style.removeProperty(Q)}}function oN(Q,U,Z){return function(){this.style.setProperty(Q,U,Z)}}function nN(Q,U,Z){return function(){var K=U.apply(this,arguments);if(K==null)this.style.removeProperty(Q);else this.style.setProperty(Q,K,Z)}}function OX(Q,U,Z){return arguments.length>1?this.each((U==null?tN:typeof U==="function"?nN:oN)(Q,U,Z==null?"":Z)):x6(this.node(),Q)}function x6(Q,U){return Q.style.getPropertyValue(U)||WJ(Q).getComputedStyle(Q,null).getPropertyValue(U)}function eN(Q){return function(){delete this[Q]}}function _C(Q,U){return function(){this[Q]=U}}function JC(Q,U){return function(){var Z=U.apply(this,arguments);if(Z==null)delete this[Q];else this[Q]=Z}}function IX(Q,U){return arguments.length>1?this.each((U==null?eN:typeof U==="function"?JC:_C)(Q,U)):this.node()[Q]}function sA(Q){return Q.trim().split(/^|\s+/)}function wX(Q){return Q.classList||new tA(Q)}function tA(Q){this._node=Q,this._names=sA(Q.getAttribute("class")||"")}tA.prototype={add:function(Q){var U=this._names.indexOf(Q);if(U<0)this._names.push(Q),this._node.setAttribute("class",this._names.join(" "))},remove:function(Q){var U=this._names.indexOf(Q);if(U>=0)this._names.splice(U,1),this._node.setAttribute("class",this._names.join(" "))},contains:function(Q){return this._names.indexOf(Q)>=0}};function oA(Q,U){var Z=wX(Q),K=-1,H=U.length;while(++K<H)Z.add(U[K])}function nA(Q,U){var Z=wX(Q),K=-1,H=U.length;while(++K<H)Z.remove(U[K])}function $C(Q){return function(){oA(this,Q)}}function QC(Q){return function(){nA(this,Q)}}function qC(Q,U){return function(){(U.apply(this,arguments)?oA:nA)(this,Q)}}function PX(Q,U){var Z=sA(Q+"");if(arguments.length<2){var K=wX(this.node()),H=-1,Y=Z.length;while(++H<Y)if(!K.contains(Z[H]))return!1;return!0}return this.each((typeof U==="function"?qC:U?$C:QC)(Z,U))}function UC(){this.textContent=""}function GC(Q){return function(){this.textContent=Q}}function ZC(Q){return function(){var U=Q.apply(this,arguments);this.textContent=U==null?"":U}}function NX(Q){return arguments.length?this.each(Q==null?UC:(typeof Q==="function"?ZC:GC)(Q)):this.node().textContent}function FC(){this.innerHTML=""}function XC(Q){return function(){this.innerHTML=Q}}function KC(Q){return function(){var U=Q.apply(this,arguments);this.innerHTML=U==null?"":U}}function CX(Q){return arguments.length?this.each(Q==null?FC:(typeof Q==="function"?KC:XC)(Q)):this.node().innerHTML}function HC(){if(this.nextSibling)this.parentNode.appendChild(this)}function fX(){return this.each(HC)}function YC(){if(this.previousSibling)this.parentNode.insertBefore(this,this.parentNode.firstChild)}function SX(){return this.each(YC)}function zC(Q){return function(){var U=this.ownerDocument,Z=this.namespaceURI;return Z===Rq&&U.documentElement.namespaceURI===Rq?U.createElement(Q):U.createElementNS(Z,Q)}}function WC(Q){return function(){return this.ownerDocument.createElementNS(Q.space,Q.local)}}function LJ(Q){var U=e4(Q);return(U.local?WC:zC)(U)}function vX(Q){var U=typeof Q==="function"?Q:LJ(Q);return this.select(function(){return this.appendChild(U.apply(this,arguments))})}function LC(){return null}function jX(Q,U){var Z=typeof Q==="function"?Q:LJ(Q),K=U==null?LC:typeof U==="function"?U:h6(U);return this.select(function(){return this.insertBefore(Z.apply(this,arguments),K.apply(this,arguments)||null)})}function BC(){var Q=this.parentNode;if(Q)Q.removeChild(this)}function VX(){return this.each(BC)}function AC(){var Q=this.cloneNode(!1),U=this.parentNode;return U?U.insertBefore(Q,this.nextSibling):Q}function MC(){var Q=this.cloneNode(!0),U=this.parentNode;return U?U.insertBefore(Q,this.nextSibling):Q}function yX(Q){return this.select(Q?MC:AC)}function kX(Q){return arguments.length?this.property("__data__",Q):this.node().__data__}function TC(Q){return function(U){Q.call(this,U,this.__data__)}}function RC(Q){return Q.trim().split(/^|\s+/).map(function(U){var Z="",K=U.indexOf(".");if(K>=0)Z=U.slice(K+1),U=U.slice(0,K);return{type:U,name:Z}})}function OC(Q){return function(){var U=this.__on;if(!U)return;for(var Z=0,K=-1,H=U.length,Y;Z<H;++Z)if(Y=U[Z],(!Q.type||Y.type===Q.type)&&Y.name===Q.name)this.removeEventListener(Y.type,Y.listener,Y.options);else U[++K]=Y;if(++K)U.length=K;else delete this.__on}}function IC(Q,U,Z){return function(){var K=this.__on,H,Y=TC(U);if(K){for(var W=0,L=K.length;W<L;++W)if((H=K[W]).type===Q.type&&H.name===Q.name){this.removeEventListener(H.type,H.listener,H.options),this.addEventListener(H.type,H.listener=Y,H.options=Z),H.value=U;return}}if(this.addEventListener(Q.type,Y,Z),H={type:Q.type,name:Q.name,value:U,listener:Y,options:Z},!K)this.__on=[H];else K.push(H)}}function DX(Q,U,Z){var K=RC(Q+""),H,Y=K.length,W;if(arguments.length<2){var L=this.node().__on;if(L){for(var M=0,O=L.length,T;M<O;++M)for(H=0,T=L[M];H<Y;++H)if((W=K[H]).type===T.type&&W.name===T.name)return T.value}return}L=U?IC:OC;for(H=0;H<Y;++H)this.each(L(K[H],U,Z));return this}function eA(Q,U,Z){var K=WJ(Q),H=K.CustomEvent;if(typeof H==="function")H=new H(U,Z);else if(H=K.document.createEvent("Event"),Z)H.initEvent(U,Z.bubbles,Z.cancelable),H.detail=Z.detail;else H.initEvent(U,!1,!1);Q.dispatchEvent(H)}function wC(Q,U){return function(){return eA(this,Q,U)}}function PC(Q,U){return function(){return eA(this,Q,U.apply(this,arguments))}}function uX(Q,U){return this.each((typeof U==="function"?PC:wC)(Q,U))}function*bX(){for(var Q=this._groups,U=0,Z=Q.length;U<Z;++U)for(var K=Q[U],H=0,Y=K.length,W;H<Y;++H)if(W=K[H])yield W}var EX=[null];function U2(Q,U){this._groups=Q,this._parents=U}function _M(){return new U2([[document.documentElement]],EX)}function NC(){return this}U2.prototype=_M.prototype={constructor:U2,select:_X,selectAll:$X,selectChild:QX,selectChildren:qX,filter:UX,data:FX,enter:GX,exit:XX,join:KX,merge:HX,selection:NC,order:YX,sort:zX,call:WX,nodes:LX,node:BX,size:AX,empty:MX,each:TX,attr:RX,style:OX,property:IX,classed:PX,text:NX,html:CX,raise:fX,lower:SX,append:vX,insert:jX,remove:VX,clone:yX,datum:kX,on:DX,dispatch:uX,[Symbol.iterator]:bX};var D3=_M;function P2(Q){return typeof Q==="string"?new U2([[document.querySelector(Q)]],[document.documentElement]):new U2([[Q]],EX)}var JM={passive:!1},m8={capture:!0,passive:!1};function Oq(Q){Q.stopImmediatePropagation()}function u3(Q){Q.preventDefault(),Q.stopImmediatePropagation()}function Y9(Q){var U=Q.document.documentElement,Z=P2(Q).on("dragstart.drag",u3,m8);if("onselectstart"in U)Z.on("selectstart.drag",u3,m8);else U.__noselect=U.style.MozUserSelect,U.style.MozUserSelect="none"}function BJ(Q,U){var Z=Q.document.documentElement,K=P2(Q).on("dragstart.drag",null);if(U)K.on("click.drag",u3,m8),setTimeout(function(){K.on("click.drag",null)},0);if("onselectstart"in Z)K.on("selectstart.drag",null);else Z.style.MozUserSelect=Z.__noselect,delete Z.__noselect}var AJ=(Q)=>()=>Q;function MJ(Q,{sourceEvent:U,subject:Z,target:K,identifier:H,active:Y,x:W,y:L,dx:M,dy:O,dispatch:T}){Object.defineProperties(this,{type:{value:Q,enumerable:!0,configurable:!0},sourceEvent:{value:U,enumerable:!0,configurable:!0},subject:{value:Z,enumerable:!0,configurable:!0},target:{value:K,enumerable:!0,configurable:!0},identifier:{value:H,enumerable:!0,configurable:!0},active:{value:Y,enumerable:!0,configurable:!0},x:{value:W,enumerable:!0,configurable:!0},y:{value:L,enumerable:!0,configurable:!0},dx:{value:M,enumerable:!0,configurable:!0},dy:{value:O,enumerable:!0,configurable:!0},_:{value:T}})}MJ.prototype.on=function(){var Q=this._.on.apply(this._,arguments);return Q===this._?this:Q};function CC(Q){return!Q.ctrlKey&&!Q.button}function fC(){return this.parentNode}function SC(Q,U){return U==null?{x:Q.x,y:Q.y}:U}function vC(){return navigator.maxTouchPoints||"ontouchstart"in this}function TJ(){var Q=CC,U=fC,Z=SC,K=vC,H={},Y=x8("start","drag","end"),W=0,L,M,O,T,A=0;function R(v){v.on("mousedown.drag",w).filter(K).on("touchstart.drag",S).on("touchmove.drag",C,JM).on("touchend.drag touchcancel.drag",y).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function w(v,D){if(T||!Q.call(this,v,D))return;var x=N(this,U.call(this,v,D),v,D,"mouse");if(!x)return;P2(v.view).on("mousemove.drag",P,m8).on("mouseup.drag",V,m8),Y9(v.view),Oq(v),O=!1,L=v.clientX,M=v.clientY,x("start",v)}function P(v){if(u3(v),!O){var D=v.clientX-L,x=v.clientY-M;O=D*D+x*x>A}H.mouse("drag",v)}function V(v){P2(v.view).on("mousemove.drag mouseup.drag",null),BJ(v.view,O),u3(v),H.mouse("end",v)}function S(v,D){if(!Q.call(this,v,D))return;var x=v.changedTouches,E=U.call(this,v,D),u=x.length,b,m;for(b=0;b<u;++b)if(m=N(this,E,v,D,x[b].identifier,x[b]))Oq(v),m("start",v,x[b])}function C(v){var D=v.changedTouches,x=D.length,E,u;for(E=0;E<x;++E)if(u=H[D[E].identifier])u3(v),u("drag",v,D[E])}function y(v){var D=v.changedTouches,x=D.length,E,u;if(T)clearTimeout(T);T=setTimeout(function(){T=null},500);for(E=0;E<x;++E)if(u=H[D[E].identifier])Oq(v),u("end",v,D[E])}function N(v,D,x,E,u,b){var m=Y.copy(),s=a2(b||x,D),U1,Q1,h;if((h=Z.call(v,new MJ("beforestart",{sourceEvent:x,target:R,identifier:u,active:W,x:s[0],y:s[1],dx:0,dy:0,dispatch:m}),E))==null)return;return U1=h.x-s[0]||0,Q1=h.y-s[1]||0,function g(p,c,l){var o=s,k;switch(p){case"start":H[u]=g,k=W++;break;case"end":delete H[u],--W;case"drag":s=a2(l||c,D),k=W;break}m.call(p,v,new MJ(p,{sourceEvent:c,subject:h,target:R,identifier:u,active:k,x:s[0]+U1,y:s[1]+Q1,dx:s[0]-o[0],dy:s[1]-o[1],dispatch:m}),E)}}return R.filter=function(v){return arguments.length?(Q=typeof v==="function"?v:AJ(!!v),R):Q},R.container=function(v){return arguments.length?(U=typeof v==="function"?v:AJ(v),R):U},R.subject=function(v){return arguments.length?(Z=typeof v==="function"?v:AJ(v),R):Z},R.touchable=function(v){return arguments.length?(K=typeof v==="function"?v:AJ(!!v),R):K},R.on=function(){var v=Y.on.apply(Y,arguments);return v===Y?R:v},R.clickDistance=function(v){return arguments.length?(A=(v=+v)*v,R):Math.sqrt(A)},R}function RJ(Q,U,Z){Q.prototype=U.prototype=Z,Z.constructor=Q}function hX(Q,U){var Z=Object.create(Q.prototype);for(var K in U)Z[K]=U[K];return Z}function wJ(){}var OJ=0.7,Pq=1/OJ,z9="\\s*([+-]?\\d+)\\s*",IJ="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",_3="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",jC=/^#([0-9a-f]{3,8})$/,VC=new RegExp(`^rgb\\(${z9},${z9},${z9}\\)$`),yC=new RegExp(`^rgb\\(${_3},${_3},${_3}\\)$`),kC=new RegExp(`^rgba\\(${z9},${z9},${z9},${IJ}\\)$`),DC=new RegExp(`^rgba\\(${_3},${_3},${_3},${IJ}\\)$`),uC=new RegExp(`^hsl\\(${IJ},${_3},${_3}\\)$`),bC=new RegExp(`^hsla\\(${IJ},${_3},${_3},${IJ}\\)$`),$M={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};RJ(wJ,M4,{copy(Q){return Object.assign(new this.constructor,this,Q)},displayable(){return this.rgb().displayable()},hex:QM,formatHex:QM,formatHex8:EC,formatHsl:hC,formatRgb:qM,toString:qM});function QM(){return this.rgb().formatHex()}function EC(){return this.rgb().formatHex8()}function hC(){return KM(this).formatHsl()}function qM(){return this.rgb().formatRgb()}function M4(Q){var U,Z;return Q=(Q+"").trim().toLowerCase(),(U=jC.exec(Q))?(Z=U[1].length,U=parseInt(U[1],16),Z===6?UM(U):Z===3?new M5(U>>8&15|U>>4&240,U>>4&15|U&240,(U&15)<<4|U&15,1):Z===8?Iq(U>>24&255,U>>16&255,U>>8&255,(U&255)/255):Z===4?Iq(U>>12&15|U>>8&240,U>>8&15|U>>4&240,U>>4&15|U&240,((U&15)<<4|U&15)/255):null):(U=VC.exec(Q))?new M5(U[1],U[2],U[3],1):(U=yC.exec(Q))?new M5(U[1]*255/100,U[2]*255/100,U[3]*255/100,1):(U=kC.exec(Q))?Iq(U[1],U[2],U[3],U[4]):(U=DC.exec(Q))?Iq(U[1]*255/100,U[2]*255/100,U[3]*255/100,U[4]):(U=uC.exec(Q))?FM(U[1],U[2]/100,U[3]/100,1):(U=bC.exec(Q))?FM(U[1],U[2]/100,U[3]/100,U[4]):$M.hasOwnProperty(Q)?UM($M[Q]):Q==="transparent"?new M5(NaN,NaN,NaN,0):null}function UM(Q){return new M5(Q>>16&255,Q>>8&255,Q&255,1)}function Iq(Q,U,Z,K){if(K<=0)Q=U=Z=NaN;return new M5(Q,U,Z,K)}function xC(Q){if(!(Q instanceof wJ))Q=M4(Q);if(!Q)return new M5;return Q=Q.rgb(),new M5(Q.r,Q.g,Q.b,Q.opacity)}function W9(Q,U,Z,K){return arguments.length===1?xC(Q):new M5(Q,U,Z,K==null?1:K)}function M5(Q,U,Z,K){this.r=+Q,this.g=+U,this.b=+Z,this.opacity=+K}RJ(M5,W9,hX(wJ,{brighter(Q){return Q=Q==null?Pq:Math.pow(Pq,Q),new M5(this.r*Q,this.g*Q,this.b*Q,this.opacity)},darker(Q){return Q=Q==null?OJ:Math.pow(OJ,Q),new M5(this.r*Q,this.g*Q,this.b*Q,this.opacity)},rgb(){return this},clamp(){return new M5(p8(this.r),p8(this.g),p8(this.b),Nq(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:GM,formatHex:GM,formatHex8:mC,formatRgb:ZM,toString:ZM}));function GM(){return`#${g8(this.r)}${g8(this.g)}${g8(this.b)}`}function mC(){return`#${g8(this.r)}${g8(this.g)}${g8(this.b)}${g8((isNaN(this.opacity)?1:this.opacity)*255)}`}function ZM(){let Q=Nq(this.opacity);return`${Q===1?"rgb(":"rgba("}${p8(this.r)}, ${p8(this.g)}, ${p8(this.b)}${Q===1?")":`, ${Q})`}`}function Nq(Q){return isNaN(Q)?1:Math.max(0,Math.min(1,Q))}function p8(Q){return Math.max(0,Math.min(255,Math.round(Q)||0))}function g8(Q){return Q=p8(Q),(Q<16?"0":"")+Q.toString(16)}function FM(Q,U,Z,K){if(K<=0)Q=U=Z=NaN;else if(Z<=0||Z>=1)Q=U=NaN;else if(U<=0)Q=NaN;return new A4(Q,U,Z,K)}function KM(Q){if(Q instanceof A4)return new A4(Q.h,Q.s,Q.l,Q.opacity);if(!(Q instanceof wJ))Q=M4(Q);if(!Q)return new A4;if(Q instanceof A4)return Q;Q=Q.rgb();var U=Q.r/255,Z=Q.g/255,K=Q.b/255,H=Math.min(U,Z,K),Y=Math.max(U,Z,K),W=NaN,L=Y-H,M=(Y+H)/2;if(L){if(U===Y)W=(Z-K)/L+(Z<K)*6;else if(Z===Y)W=(K-U)/L+2;else W=(U-Z)/L+4;L/=M<0.5?Y+H:2-Y-H,W*=60}else L=M>0&&M<1?0:W;return new A4(W,L,M,Q.opacity)}function HM(Q,U,Z,K){return arguments.length===1?KM(Q):new A4(Q,U,Z,K==null?1:K)}function A4(Q,U,Z,K){this.h=+Q,this.s=+U,this.l=+Z,this.opacity=+K}RJ(A4,HM,hX(wJ,{brighter(Q){return Q=Q==null?Pq:Math.pow(Pq,Q),new A4(this.h,this.s,this.l*Q,this.opacity)},darker(Q){return Q=Q==null?OJ:Math.pow(OJ,Q),new A4(this.h,this.s,this.l*Q,this.opacity)},rgb(){var Q=this.h%360+(this.h<0)*360,U=isNaN(Q)||isNaN(this.s)?0:this.s,Z=this.l,K=Z+(Z<0.5?Z:1-Z)*U,H=2*Z-K;return new M5(xX(Q>=240?Q-240:Q+120,H,K),xX(Q,H,K),xX(Q<120?Q+240:Q-120,H,K),this.opacity)},clamp(){return new A4(XM(this.h),wq(this.s),wq(this.l),Nq(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&(0<=this.l&&this.l<=1)&&(0<=this.opacity&&this.opacity<=1)},formatHsl(){let Q=Nq(this.opacity);return`${Q===1?"hsl(":"hsla("}${XM(this.h)}, ${wq(this.s)*100}%, ${wq(this.l)*100}%${Q===1?")":`, ${Q})`}`}}));function XM(Q){return Q=(Q||0)%360,Q<0?Q+360:Q}function wq(Q){return Math.max(0,Math.min(1,Q||0))}function xX(Q,U,Z){return(Q<60?U+(Z-U)*Q/60:Q<180?Z:Q<240?U+(Z-U)*(240-Q)/60:U)*255}function mX(Q,U,Z,K,H){var Y=Q*Q,W=Y*Q;return((1-3*Q+3*Y-W)*U+(4-6*Y+3*W)*Z+(1+3*Q+3*Y-3*W)*K+W*H)/6}function gX(Q){var U=Q.length-1;return function(Z){var K=Z<=0?Z=0:Z>=1?(Z=1,U-1):Math.floor(Z*U),H=Q[K],Y=Q[K+1],W=K>0?Q[K-1]:2*H-Y,L=K<U-1?Q[K+2]:2*Y-H;return mX((Z-K/U)*U,W,H,Y,L)}}function pX(Q){var U=Q.length;return function(Z){var K=Math.floor(((Z%=1)<0?++Z:Z)*U),H=Q[(K+U-1)%U],Y=Q[K%U],W=Q[(K+1)%U],L=Q[(K+2)%U];return mX((Z-K/U)*U,H,Y,W,L)}}var PJ=(Q)=>()=>Q;function gC(Q,U){return function(Z){return Q+Z*U}}function pC(Q,U,Z){return Q=Math.pow(Q,Z),U=Math.pow(U,Z)-Q,Z=1/Z,function(K){return Math.pow(Q+K*U,Z)}}function YM(Q){return(Q=+Q)===1?Cq:function(U,Z){return Z-U?pC(U,Z,Q):PJ(isNaN(U)?Z:U)}}function Cq(Q,U){var Z=U-Q;return Z?gC(Q,Z):PJ(isNaN(Q)?U:Q)}var c8=function Q(U){var Z=YM(U);function K(H,Y){var W=Z((H=W9(H)).r,(Y=W9(Y)).r),L=Z(H.g,Y.g),M=Z(H.b,Y.b),O=Cq(H.opacity,Y.opacity);return function(T){return H.r=W(T),H.g=L(T),H.b=M(T),H.opacity=O(T),H+""}}return K.gamma=Q,K}(1);function zM(Q){return function(U){var Z=U.length,K=Array(Z),H=Array(Z),Y=Array(Z),W,L;for(W=0;W<Z;++W)L=W9(U[W]),K[W]=L.r||0,H[W]=L.g||0,Y[W]=L.b||0;return K=Q(K),H=Q(H),Y=Q(Y),L.opacity=1,function(M){return L.r=K(M),L.g=H(M),L.b=Y(M),L+""}}}var cC=zM(gX),lC=zM(pX);function cX(Q,U){if(!U)U=[];var Z=Q?Math.min(U.length,Q.length):0,K=U.slice(),H;return function(Y){for(H=0;H<Z;++H)K[H]=Q[H]*(1-Y)+U[H]*Y;return K}}function WM(Q){return ArrayBuffer.isView(Q)&&!(Q instanceof DataView)}function LM(Q,U){var Z=U?U.length:0,K=Q?Math.min(Z,Q.length):0,H=Array(K),Y=Array(Z),W;for(W=0;W<K;++W)H[W]=J3(Q[W],U[W]);for(;W<Z;++W)Y[W]=U[W];return function(L){for(W=0;W<K;++W)Y[W]=H[W](L);return Y}}function lX(Q,U){var Z=new Date;return Q=+Q,U=+U,function(K){return Z.setTime(Q*(1-K)+U*K),Z}}function s2(Q,U){return Q=+Q,U=+U,function(Z){return Q*(1-Z)+U*Z}}function iX(Q,U){var Z={},K={},H;if(Q===null||typeof Q!=="object")Q={};if(U===null||typeof U!=="object")U={};for(H in U)if(H in Q)Z[H]=J3(Q[H],U[H]);else K[H]=U[H];return function(Y){for(H in Z)K[H]=Z[H](Y);return K}}var rX=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,dX=new RegExp(rX.source,"g");function iC(Q){return function(){return Q}}function dC(Q){return function(U){return Q(U)+""}}function L9(Q,U){var Z=rX.lastIndex=dX.lastIndex=0,K,H,Y,W=-1,L=[],M=[];Q=Q+"",U=U+"";while((K=rX.exec(Q))&&(H=dX.exec(U))){if((Y=H.index)>Z)if(Y=U.slice(Z,Y),L[W])L[W]+=Y;else L[++W]=Y;if((K=K[0])===(H=H[0]))if(L[W])L[W]+=H;else L[++W]=H;else L[++W]=null,M.push({i:W,x:s2(K,H)});Z=dX.lastIndex}if(Z<U.length)if(Y=U.slice(Z),L[W])L[W]+=Y;else L[++W]=Y;return L.length<2?M[0]?dC(M[0].x):iC(U):(U=M.length,function(O){for(var T=0,A;T<U;++T)L[(A=M[T]).i]=A.x(O);return L.join("")})}function J3(Q,U){var Z=typeof U,K;return U==null||Z==="boolean"?PJ(U):(Z==="number"?s2:Z==="string"?(K=M4(U))?(U=K,c8):L9:U instanceof M4?c8:U instanceof Date?lX:WM(U)?cX:Array.isArray(U)?LM:typeof U.valueOf!=="function"&&typeof U.toString!=="function"||isNaN(U)?iX:s2)(Q,U)}var BM=180/Math.PI,fq={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Sq(Q,U,Z,K,H,Y){var W,L,M;if(W=Math.sqrt(Q*Q+U*U))Q/=W,U/=W;if(M=Q*Z+U*K)Z-=Q*M,K-=U*M;if(L=Math.sqrt(Z*Z+K*K))Z/=L,K/=L,M/=L;if(Q*K<U*Z)Q=-Q,U=-U,M=-M,W=-W;return{translateX:H,translateY:Y,rotate:Math.atan2(U,Q)*BM,skewX:Math.atan(M)*BM,scaleX:W,scaleY:L}}var vq;function AM(Q){let U=new(typeof DOMMatrix==="function"?DOMMatrix:WebKitCSSMatrix)(Q+"");return U.isIdentity?fq:Sq(U.a,U.b,U.c,U.d,U.e,U.f)}function MM(Q){if(Q==null)return fq;if(!vq)vq=document.createElementNS("http://www.w3.org/2000/svg","g");if(vq.setAttribute("transform",Q),!(Q=vq.transform.baseVal.consolidate()))return fq;return Q=Q.matrix,Sq(Q.a,Q.b,Q.c,Q.d,Q.e,Q.f)}function TM(Q,U,Z,K){function H(O){return O.length?O.pop()+" ":""}function Y(O,T,A,R,w,P){if(O!==A||T!==R){var V=w.push("translate(",null,U,null,Z);P.push({i:V-4,x:s2(O,A)},{i:V-2,x:s2(T,R)})}else if(A||R)w.push("translate("+A+U+R+Z)}function W(O,T,A,R){if(O!==T){if(O-T>180)T+=360;else if(T-O>180)O+=360;R.push({i:A.push(H(A)+"rotate(",null,K)-2,x:s2(O,T)})}else if(T)A.push(H(A)+"rotate("+T+K)}function L(O,T,A,R){if(O!==T)R.push({i:A.push(H(A)+"skewX(",null,K)-2,x:s2(O,T)});else if(T)A.push(H(A)+"skewX("+T+K)}function M(O,T,A,R,w,P){if(O!==A||T!==R){var V=w.push(H(w)+"scale(",null,",",null,")");P.push({i:V-4,x:s2(O,A)},{i:V-2,x:s2(T,R)})}else if(A!==1||R!==1)w.push(H(w)+"scale("+A+","+R+")")}return function(O,T){var A=[],R=[];return O=Q(O),T=Q(T),Y(O.translateX,O.translateY,T.translateX,T.translateY,A,R),W(O.rotate,T.rotate,A,R),L(O.skewX,T.skewX,A,R),M(O.scaleX,O.scaleY,T.scaleX,T.scaleY,A,R),O=T=null,function(w){var P=-1,V=R.length,S;while(++P<V)A[(S=R[P]).i]=S.x(w);return A.join("")}}}var aX=TM(AM,"px, ","px)","deg)"),sX=TM(MM,", ",")",")");var rC=0.000000000001;function RM(Q){return((Q=Math.exp(Q))+1/Q)/2}function aC(Q){return((Q=Math.exp(Q))-1/Q)/2}function sC(Q){return((Q=Math.exp(2*Q))-1)/(Q+1)}var l8=function Q(U,Z,K){function H(Y,W){var L=Y[0],M=Y[1],O=Y[2],T=W[0],A=W[1],R=W[2],w=T-L,P=A-M,V=w*w+P*P,S,C;if(V<rC)C=Math.log(R/O)/U,S=function(E){return[L+E*w,M+E*P,O*Math.exp(U*E*C)]};else{var y=Math.sqrt(V),N=(R*R-O*O+K*V)/(2*O*Z*y),v=(R*R-O*O-K*V)/(2*R*Z*y),D=Math.log(Math.sqrt(N*N+1)-N),x=Math.log(Math.sqrt(v*v+1)-v);C=(x-D)/U,S=function(E){var u=E*C,b=RM(D),m=O/(Z*y)*(b*sC(U*u+D)-aC(D));return[L+m*w,M+m*P,O*b/RM(U*u+D)]}}return S.duration=C*1000*U/Math.SQRT2,S}return H.rho=function(Y){var W=Math.max(0.001,+Y),L=W*W,M=L*L;return Q(W,L,M)},H}(Math.SQRT2,2,4);var B9=0,CJ=0,NJ=0,IM=1000,jq,fJ,Vq=0,i8=0,yq=0,SJ=typeof performance==="object"&&performance.now?performance:Date,wM=typeof window==="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(Q){setTimeout(Q,17)};function jJ(){return i8||(wM(tC),i8=SJ.now()+yq)}function tC(){i8=0}function vJ(){this._call=this._time=this._next=null}vJ.prototype=kq.prototype={constructor:vJ,restart:function(Q,U,Z){if(typeof Q!=="function")throw TypeError("callback is not a function");if(Z=(Z==null?jJ():+Z)+(U==null?0:+U),!this._next&&fJ!==this){if(fJ)fJ._next=this;else jq=this;fJ=this}this._call=Q,this._time=Z,tX()},stop:function(){if(this._call)this._call=null,this._time=1/0,tX()}};function kq(Q,U,Z){var K=new vJ;return K.restart(Q,U,Z),K}function PM(){jJ(),++B9;var Q=jq,U;while(Q){if((U=i8-Q._time)>=0)Q._call.call(void 0,U);Q=Q._next}--B9}function OM(){i8=(Vq=SJ.now())+yq,B9=CJ=0;try{PM()}finally{B9=0,nC(),i8=0}}function oC(){var Q=SJ.now(),U=Q-Vq;if(U>IM)yq-=U,Vq=Q}function nC(){var Q,U=jq,Z,K=1/0;while(U)if(U._call){if(K>U._time)K=U._time;Q=U,U=U._next}else Z=U._next,U._next=null,U=Q?Q._next=Z:jq=Z;fJ=Q,tX(K)}function tX(Q){if(B9)return;if(CJ)CJ=clearTimeout(CJ);var U=Q-i8;if(U>24){if(Q<1/0)CJ=setTimeout(OM,Q-SJ.now()-yq);if(NJ)NJ=clearInterval(NJ)}else{if(!NJ)Vq=SJ.now(),NJ=setInterval(oC,IM);B9=1,wM(OM)}}function VJ(Q,U,Z){var K=new vJ;return U=U==null?0:+U,K.restart((H)=>{K.stop(),Q(H+U)},U,Z),K}var eC=x8("start","end","cancel","interrupt"),_f=[],fM=0,NM=1,uq=2,Dq=3,CM=4,bq=5,yJ=6;function b3(Q,U,Z,K,H,Y){var W=Q.__transition;if(!W)Q.__transition={};else if(Z in W)return;Jf(Q,Z,{name:U,index:K,group:H,on:eC,tween:_f,time:Y.time,delay:Y.delay,duration:Y.duration,ease:Y.ease,timer:null,state:fM})}function kJ(Q,U){var Z=N2(Q,U);if(Z.state>fM)throw Error("too late; already scheduled");return Z}function c2(Q,U){var Z=N2(Q,U);if(Z.state>Dq)throw Error("too late; already running");return Z}function N2(Q,U){var Z=Q.__transition;if(!Z||!(Z=Z[U]))throw Error("transition not found");return Z}function Jf(Q,U,Z){var K=Q.__transition,H;K[U]=Z,Z.timer=kq(Y,0,Z.time);function Y(O){if(Z.state=NM,Z.timer.restart(W,Z.delay,Z.time),Z.delay<=O)W(O-Z.delay)}function W(O){var T,A,R,w;if(Z.state!==NM)return M();for(T in K){if(w=K[T],w.name!==Z.name)continue;if(w.state===Dq)return VJ(W);if(w.state===CM)w.state=yJ,w.timer.stop(),w.on.call("interrupt",Q,Q.__data__,w.index,w.group),delete K[T];else if(+T<U)w.state=yJ,w.timer.stop(),w.on.call("cancel",Q,Q.__data__,w.index,w.group),delete K[T]}if(VJ(function(){if(Z.state===Dq)Z.state=CM,Z.timer.restart(L,Z.delay,Z.time),L(O)}),Z.state=uq,Z.on.call("start",Q,Q.__data__,Z.index,Z.group),Z.state!==uq)return;Z.state=Dq,H=Array(R=Z.tween.length);for(T=0,A=-1;T<R;++T)if(w=Z.tween[T].value.call(Q,Q.__data__,Z.index,Z.group))H[++A]=w;H.length=A+1}function L(O){var T=O<Z.duration?Z.ease.call(null,O/Z.duration):(Z.timer.restart(M),Z.state=bq,1),A=-1,R=H.length;while(++A<R)H[A].call(Q,T);if(Z.state===bq)Z.on.call("end",Q,Q.__data__,Z.index,Z.group),M()}function M(){Z.state=yJ,Z.timer.stop(),delete K[U];for(var O in K)return;delete Q.__transition}}function m6(Q,U){var Z=Q.__transition,K,H,Y=!0,W;if(!Z)return;U=U==null?null:U+"";for(W in Z){if((K=Z[W]).name!==U){Y=!1;continue}H=K.state>uq&&K.state<bq,K.state=yJ,K.timer.stop(),K.on.call(H?"interrupt":"cancel",Q,Q.__data__,K.index,K.group),delete Z[W]}if(Y)delete Q.__transition}function oX(Q){return this.each(function(){m6(this,Q)})}function $f(Q,U){var Z,K;return function(){var H=c2(this,Q),Y=H.tween;if(Y!==Z){K=Z=Y;for(var W=0,L=K.length;W<L;++W)if(K[W].name===U){K=K.slice(),K.splice(W,1);break}}H.tween=K}}function Qf(Q,U,Z){var K,H;if(typeof Z!=="function")throw Error();return function(){var Y=c2(this,Q),W=Y.tween;if(W!==K){H=(K=W).slice();for(var L={name:U,value:Z},M=0,O=H.length;M<O;++M)if(H[M].name===U){H[M]=L;break}if(M===O)H.push(L)}Y.tween=H}}function nX(Q,U){var Z=this._id;if(Q+="",arguments.length<2){var K=N2(this.node(),Z).tween;for(var H=0,Y=K.length,W;H<Y;++H)if((W=K[H]).name===Q)return W.value;return null}return this.each((U==null?$f:Qf)(Z,Q,U))}function A9(Q,U,Z){var K=Q._id;return Q.each(function(){var H=c2(this,K);(H.value||(H.value={}))[U]=Z.apply(this,arguments)}),function(H){return N2(H,K).value[U]}}function DJ(Q,U){var Z;return(typeof U==="number"?s2:U instanceof M4?c8:(Z=M4(U))?(U=Z,c8):L9)(Q,U)}function qf(Q){return function(){this.removeAttribute(Q)}}function Uf(Q){return function(){this.removeAttributeNS(Q.space,Q.local)}}function Gf(Q,U,Z){var K,H=Z+"",Y;return function(){var W=this.getAttribute(Q);return W===H?null:W===K?Y:Y=U(K=W,Z)}}function Zf(Q,U,Z){var K,H=Z+"",Y;return function(){var W=this.getAttributeNS(Q.space,Q.local);return W===H?null:W===K?Y:Y=U(K=W,Z)}}function Ff(Q,U,Z){var K,H,Y;return function(){var W,L=Z(this),M;if(L==null)return void this.removeAttribute(Q);return W=this.getAttribute(Q),M=L+"",W===M?null:W===K&&M===H?Y:(H=M,Y=U(K=W,L))}}function Xf(Q,U,Z){var K,H,Y;return function(){var W,L=Z(this),M;if(L==null)return void this.removeAttributeNS(Q.space,Q.local);return W=this.getAttributeNS(Q.space,Q.local),M=L+"",W===M?null:W===K&&M===H?Y:(H=M,Y=U(K=W,L))}}function eX(Q,U){var Z=e4(Q),K=Z==="transform"?sX:DJ;return this.attrTween(Q,typeof U==="function"?(Z.local?Xf:Ff)(Z,K,A9(this,"attr."+Q,U)):U==null?(Z.local?Uf:qf)(Z):(Z.local?Zf:Gf)(Z,K,U))}function Kf(Q,U){return function(Z){this.setAttribute(Q,U.call(this,Z))}}function Hf(Q,U){return function(Z){this.setAttributeNS(Q.space,Q.local,U.call(this,Z))}}function Yf(Q,U){var Z,K;function H(){var Y=U.apply(this,arguments);if(Y!==K)Z=(K=Y)&&Hf(Q,Y);return Z}return H._value=U,H}function zf(Q,U){var Z,K;function H(){var Y=U.apply(this,arguments);if(Y!==K)Z=(K=Y)&&Kf(Q,Y);return Z}return H._value=U,H}function _K(Q,U){var Z="attr."+Q;if(arguments.length<2)return(Z=this.tween(Z))&&Z._value;if(U==null)return this.tween(Z,null);if(typeof U!=="function")throw Error();var K=e4(Q);return this.tween(Z,(K.local?Yf:zf)(K,U))}function Wf(Q,U){return function(){kJ(this,Q).delay=+U.apply(this,arguments)}}function Lf(Q,U){return U=+U,function(){kJ(this,Q).delay=U}}function JK(Q){var U=this._id;return arguments.length?this.each((typeof Q==="function"?Wf:Lf)(U,Q)):N2(this.node(),U).delay}function Bf(Q,U){return function(){c2(this,Q).duration=+U.apply(this,arguments)}}function Af(Q,U){return U=+U,function(){c2(this,Q).duration=U}}function $K(Q){var U=this._id;return arguments.length?this.each((typeof Q==="function"?Bf:Af)(U,Q)):N2(this.node(),U).duration}function Mf(Q,U){if(typeof U!=="function")throw Error();return function(){c2(this,Q).ease=U}}function QK(Q){var U=this._id;return arguments.length?this.each(Mf(U,Q)):N2(this.node(),U).ease}function Tf(Q,U){return function(){var Z=U.apply(this,arguments);if(typeof Z!=="function")throw Error();c2(this,Q).ease=Z}}function qK(Q){if(typeof Q!=="function")throw Error();return this.each(Tf(this._id,Q))}function UK(Q){if(typeof Q!=="function")Q=K9(Q);for(var U=this._groups,Z=U.length,K=Array(Z),H=0;H<Z;++H)for(var Y=U[H],W=Y.length,L=K[H]=[],M,O=0;O<W;++O)if((M=Y[O])&&Q.call(M,M.__data__,O,Y))L.push(M);return new Z5(K,this._parents,this._name,this._id)}function GK(Q){if(Q._id!==this._id)throw Error();for(var U=this._groups,Z=Q._groups,K=U.length,H=Z.length,Y=Math.min(K,H),W=Array(K),L=0;L<Y;++L)for(var M=U[L],O=Z[L],T=M.length,A=W[L]=Array(T),R,w=0;w<T;++w)if(R=M[w]||O[w])A[w]=R;for(;L<K;++L)W[L]=U[L];return new Z5(W,this._parents,this._name,this._id)}function Rf(Q){return(Q+"").trim().split(/^|\s+/).every(function(U){var Z=U.indexOf(".");if(Z>=0)U=U.slice(0,Z);return!U||U==="start"})}function Of(Q,U,Z){var K,H,Y=Rf(U)?kJ:c2;return function(){var W=Y(this,Q),L=W.on;if(L!==K)(H=(K=L).copy()).on(U,Z);W.on=H}}function ZK(Q,U){var Z=this._id;return arguments.length<2?N2(this.node(),Z).on.on(Q):this.each(Of(Z,Q,U))}function If(Q){return function(){var U=this.parentNode;for(var Z in this.__transition)if(+Z!==Q)return;if(U)U.removeChild(this)}}function FK(){return this.on("end.remove",If(this._id))}function XK(Q){var U=this._name,Z=this._id;if(typeof Q!=="function")Q=h6(Q);for(var K=this._groups,H=K.length,Y=Array(H),W=0;W<H;++W)for(var L=K[W],M=L.length,O=Y[W]=Array(M),T,A,R=0;R<M;++R)if((T=L[R])&&(A=Q.call(T,T.__data__,R,L))){if("__data__"in T)A.__data__=T.__data__;O[R]=A,b3(O[R],U,Z,R,O,N2(T,Z))}return new Z5(Y,this._parents,U,Z)}function KK(Q){var U=this._name,Z=this._id;if(typeof Q!=="function")Q=H9(Q);for(var K=this._groups,H=K.length,Y=[],W=[],L=0;L<H;++L)for(var M=K[L],O=M.length,T,A=0;A<O;++A)if(T=M[A]){for(var R=Q.call(T,T.__data__,A,M),w,P=N2(T,Z),V=0,S=R.length;V<S;++V)if(w=R[V])b3(w,U,Z,V,R,P);Y.push(R),W.push(T)}return new Z5(Y,W,U,Z)}var wf=D3.prototype.constructor;function HK(){return new wf(this._groups,this._parents)}function Pf(Q,U){var Z,K,H;return function(){var Y=x6(this,Q),W=(this.style.removeProperty(Q),x6(this,Q));return Y===W?null:Y===Z&&W===K?H:H=U(Z=Y,K=W)}}function SM(Q){return function(){this.style.removeProperty(Q)}}function Nf(Q,U,Z){var K,H=Z+"",Y;return function(){var W=x6(this,Q);return W===H?null:W===K?Y:Y=U(K=W,Z)}}function Cf(Q,U,Z){var K,H,Y;return function(){var W=x6(this,Q),L=Z(this),M=L+"";if(L==null)M=L=(this.style.removeProperty(Q),x6(this,Q));return W===M?null:W===K&&M===H?Y:(H=M,Y=U(K=W,L))}}function ff(Q,U){var Z,K,H,Y="style."+U,W="end."+Y,L;return function(){var M=c2(this,Q),O=M.on,T=M.value[Y]==null?L||(L=SM(U)):void 0;if(O!==Z||H!==T)(K=(Z=O).copy()).on(W,H=T);M.on=K}}function YK(Q,U,Z){var K=(Q+="")==="transform"?aX:DJ;return U==null?this.styleTween(Q,Pf(Q,K)).on("end.style."+Q,SM(Q)):typeof U==="function"?this.styleTween(Q,Cf(Q,K,A9(this,"style."+Q,U))).each(ff(this._id,Q)):this.styleTween(Q,Nf(Q,K,U),Z).on("end.style."+Q,null)}function Sf(Q,U,Z){return function(K){this.style.setProperty(Q,U.call(this,K),Z)}}function vf(Q,U,Z){var K,H;function Y(){var W=U.apply(this,arguments);if(W!==H)K=(H=W)&&Sf(Q,W,Z);return K}return Y._value=U,Y}function zK(Q,U,Z){var K="style."+(Q+="");if(arguments.length<2)return(K=this.tween(K))&&K._value;if(U==null)return this.tween(K,null);if(typeof U!=="function")throw Error();return this.tween(K,vf(Q,U,Z==null?"":Z))}function jf(Q){return function(){this.textContent=Q}}function Vf(Q){return function(){var U=Q(this);this.textContent=U==null?"":U}}function WK(Q){return this.tween("text",typeof Q==="function"?Vf(A9(this,"text",Q)):jf(Q==null?"":Q+""))}function yf(Q){return function(U){this.textContent=Q.call(this,U)}}function kf(Q){var U,Z;function K(){var H=Q.apply(this,arguments);if(H!==Z)U=(Z=H)&&yf(H);return U}return K._value=Q,K}function LK(Q){var U="text";if(arguments.length<1)return(U=this.tween(U))&&U._value;if(Q==null)return this.tween(U,null);if(typeof Q!=="function")throw Error();return this.tween(U,kf(Q))}function BK(){var Q=this._name,U=this._id,Z=Eq();for(var K=this._groups,H=K.length,Y=0;Y<H;++Y)for(var W=K[Y],L=W.length,M,O=0;O<L;++O)if(M=W[O]){var T=N2(M,U);b3(M,Q,Z,O,W,{time:T.time+T.delay+T.duration,delay:0,duration:T.duration,ease:T.ease})}return new Z5(K,this._parents,Q,Z)}function AK(){var Q,U,Z=this,K=Z._id,H=Z.size();return new Promise(function(Y,W){var L={value:W},M={value:function(){if(--H===0)Y()}};if(Z.each(function(){var O=c2(this,K),T=O.on;if(T!==Q)U=(Q=T).copy(),U._.cancel.push(L),U._.interrupt.push(L),U._.end.push(M);O.on=U}),H===0)Y()})}var Df=0;function Z5(Q,U,Z,K){this._groups=Q,this._parents=U,this._name=Z,this._id=K}function vM(Q){return D3().transition(Q)}function Eq(){return++Df}var E3=D3.prototype;Z5.prototype=vM.prototype={constructor:Z5,select:XK,selectAll:KK,selectChild:E3.selectChild,selectChildren:E3.selectChildren,filter:UK,merge:GK,selection:HK,transition:BK,call:E3.call,nodes:E3.nodes,node:E3.node,size:E3.size,empty:E3.empty,each:E3.each,on:ZK,attr:eX,attrTween:_K,style:YK,styleTween:zK,text:WK,textTween:LK,remove:FK,tween:nX,delay:JK,duration:$K,ease:QK,easeVarying:qK,end:AK,[Symbol.iterator]:E3[Symbol.iterator]};function hq(Q){return((Q*=2)<=1?Q*Q*Q:(Q-=2)*Q*Q+2)/2}var uf={time:null,delay:0,duration:250,ease:hq};function bf(Q,U){var Z;while(!(Z=Q.__transition)||!(Z=Z[U]))if(!(Q=Q.parentNode))throw Error(`transition ${U} not found`);return Z}function MK(Q){var U,Z;if(Q instanceof Z5)U=Q._id,Q=Q._name;else U=Eq(),(Z=uf).time=jJ(),Q=Q==null?null:Q+"";for(var K=this._groups,H=K.length,Y=0;Y<H;++Y)for(var W=K[Y],L=W.length,M,O=0;O<L;++O)if(M=W[O])b3(M,Q,U,O,W,Z||bf(M,U));return new Z5(K,this._parents,Q,U)}D3.prototype.interrupt=oX;D3.prototype.transition=MK;var uJ=(Q)=>()=>Q;function TK(Q,{sourceEvent:U,target:Z,transform:K,dispatch:H}){Object.defineProperties(this,{type:{value:Q,enumerable:!0,configurable:!0},sourceEvent:{value:U,enumerable:!0,configurable:!0},target:{value:Z,enumerable:!0,configurable:!0},transform:{value:K,enumerable:!0,configurable:!0},_:{value:H}})}function T4(Q,U,Z){this.k=Q,this.x=U,this.y=Z}T4.prototype={constructor:T4,scale:function(Q){return Q===1?this:new T4(this.k*Q,this.x,this.y)},translate:function(Q,U){return Q===0&U===0?this:new T4(this.k,this.x+this.k*Q,this.y+this.k*U)},apply:function(Q){return[Q[0]*this.k+this.x,Q[1]*this.k+this.y]},applyX:function(Q){return Q*this.k+this.x},applyY:function(Q){return Q*this.k+this.y},invert:function(Q){return[(Q[0]-this.x)/this.k,(Q[1]-this.y)/this.k]},invertX:function(Q){return(Q-this.x)/this.k},invertY:function(Q){return(Q-this.y)/this.k},rescaleX:function(Q){return Q.copy().domain(Q.range().map(this.invertX,this).map(Q.invert,Q))},rescaleY:function(Q){return Q.copy().domain(Q.range().map(this.invertY,this).map(Q.invert,Q))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var d8=new T4(1,0,0);bJ.prototype=T4.prototype;function bJ(Q){while(!Q.__zoom)if(!(Q=Q.parentNode))return d8;return Q.__zoom}function xq(Q){Q.stopImmediatePropagation()}function r8(Q){Q.preventDefault(),Q.stopImmediatePropagation()}function Ef(Q){return(!Q.ctrlKey||Q.type==="wheel")&&!Q.button}function hf(){var Q=this;if(Q instanceof SVGElement){if(Q=Q.ownerSVGElement||Q,Q.hasAttribute("viewBox"))return Q=Q.viewBox.baseVal,[[Q.x,Q.y],[Q.x+Q.width,Q.y+Q.height]];return[[0,0],[Q.width.baseVal.value,Q.height.baseVal.value]]}return[[0,0],[Q.clientWidth,Q.clientHeight]]}function jM(){return this.__zoom||d8}function xf(Q){return-Q.deltaY*(Q.deltaMode===1?0.05:Q.deltaMode?1:0.002)*(Q.ctrlKey?10:1)}function mf(){return navigator.maxTouchPoints||"ontouchstart"in this}function gf(Q,U,Z){var K=Q.invertX(U[0][0])-Z[0][0],H=Q.invertX(U[1][0])-Z[1][0],Y=Q.invertY(U[0][1])-Z[0][1],W=Q.invertY(U[1][1])-Z[1][1];return Q.translate(H>K?(K+H)/2:Math.min(0,K)||Math.max(0,H),W>Y?(Y+W)/2:Math.min(0,Y)||Math.max(0,W))}function EJ(){var Q=Ef,U=hf,Z=gf,K=xf,H=mf,Y=[0,1/0],W=[[-1/0,-1/0],[1/0,1/0]],L=250,M=l8,O=x8("start","zoom","end"),T,A,R,w=500,P=150,V=0,S=10;function C(h){h.property("__zoom",jM).on("wheel.zoom",u,{passive:!1}).on("mousedown.zoom",b).on("dblclick.zoom",m).filter(H).on("touchstart.zoom",s).on("touchmove.zoom",U1).on("touchend.zoom touchcancel.zoom",Q1).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}C.transform=function(h,g,p,c){var l=h.selection?h.selection():h;if(l.property("__zoom",jM),h!==l)D(h,g,p,c);else l.interrupt().each(function(){x(this,arguments).event(c).start().zoom(null,typeof g==="function"?g.apply(this,arguments):g).end()})},C.scaleBy=function(h,g,p,c){C.scaleTo(h,function(){var l=this.__zoom.k,o=typeof g==="function"?g.apply(this,arguments):g;return l*o},p,c)},C.scaleTo=function(h,g,p,c){C.transform(h,function(){var l=U.apply(this,arguments),o=this.__zoom,k=p==null?v(l):typeof p==="function"?p.apply(this,arguments):p,t=o.invert(k),_1=typeof g==="function"?g.apply(this,arguments):g;return Z(N(y(o,_1),k,t),l,W)},p,c)},C.translateBy=function(h,g,p,c){C.transform(h,function(){return Z(this.__zoom.translate(typeof g==="function"?g.apply(this,arguments):g,typeof p==="function"?p.apply(this,arguments):p),U.apply(this,arguments),W)},null,c)},C.translateTo=function(h,g,p,c,l){C.transform(h,function(){var o=U.apply(this,arguments),k=this.__zoom,t=c==null?v(o):typeof c==="function"?c.apply(this,arguments):c;return Z(d8.translate(t[0],t[1]).scale(k.k).translate(typeof g==="function"?-g.apply(this,arguments):-g,typeof p==="function"?-p.apply(this,arguments):-p),o,W)},c,l)};function y(h,g){return g=Math.max(Y[0],Math.min(Y[1],g)),g===h.k?h:new T4(g,h.x,h.y)}function N(h,g,p){var c=g[0]-p[0]*h.k,l=g[1]-p[1]*h.k;return c===h.x&&l===h.y?h:new T4(h.k,c,l)}function v(h){return[(+h[0][0]+ +h[1][0])/2,(+h[0][1]+ +h[1][1])/2]}function D(h,g,p,c){h.on("start.zoom",function(){x(this,arguments).event(c).start()}).on("interrupt.zoom end.zoom",function(){x(this,arguments).event(c).end()}).tween("zoom",function(){var l=this,o=arguments,k=x(l,o).event(c),t=U.apply(l,o),_1=p==null?v(t):typeof p==="function"?p.apply(l,o):p,a=Math.max(t[1][0]-t[0][0],t[1][1]-t[0][1]),H1=l.__zoom,O1=typeof g==="function"?g.apply(l,o):g,L1=M(H1.invert(_1).concat(a/H1.k),O1.invert(_1).concat(a/O1.k));return function(T1){if(T1===1)T1=O1;else{var G1=L1(T1),R1=a/G1[2];T1=new T4(R1,_1[0]-G1[0]*R1,_1[1]-G1[1]*R1)}k.zoom(null,T1)}})}function x(h,g,p){return!p&&h.__zooming||new E(h,g)}function E(h,g){this.that=h,this.args=g,this.active=0,this.sourceEvent=null,this.extent=U.apply(h,g),this.taps=0}E.prototype={event:function(h){if(h)this.sourceEvent=h;return this},start:function(){if(++this.active===1)this.that.__zooming=this,this.emit("start");return this},zoom:function(h,g){if(this.mouse&&h!=="mouse")this.mouse[1]=g.invert(this.mouse[0]);if(this.touch0&&h!=="touch")this.touch0[1]=g.invert(this.touch0[0]);if(this.touch1&&h!=="touch")this.touch1[1]=g.invert(this.touch1[0]);return this.that.__zoom=g,this.emit("zoom"),this},end:function(){if(--this.active===0)delete this.that.__zooming,this.emit("end");return this},emit:function(h){var g=P2(this.that).datum();O.call(h,this.that,new TK(h,{sourceEvent:this.sourceEvent,target:C,type:h,transform:this.that.__zoom,dispatch:O}),g)}};function u(h,...g){if(!Q.apply(this,arguments))return;var p=x(this,g).event(h),c=this.__zoom,l=Math.max(Y[0],Math.min(Y[1],c.k*Math.pow(2,K.apply(this,arguments)))),o=a2(h);if(p.wheel){if(p.mouse[0][0]!==o[0]||p.mouse[0][1]!==o[1])p.mouse[1]=c.invert(p.mouse[0]=o);clearTimeout(p.wheel)}else if(c.k===l)return;else p.mouse=[o,c.invert(o)],m6(this),p.start();r8(h),p.wheel=setTimeout(k,P),p.zoom("mouse",Z(N(y(c,l),p.mouse[0],p.mouse[1]),p.extent,W));function k(){p.wheel=null,p.end()}}function b(h,...g){if(R||!Q.apply(this,arguments))return;var p=h.currentTarget,c=x(this,g,!0).event(h),l=P2(h.view).on("mousemove.zoom",_1,!0).on("mouseup.zoom",a,!0),o=a2(h,p),k=h.clientX,t=h.clientY;Y9(h.view),xq(h),c.mouse=[o,this.__zoom.invert(o)],m6(this),c.start();function _1(H1){if(r8(H1),!c.moved){var O1=H1.clientX-k,L1=H1.clientY-t;c.moved=O1*O1+L1*L1>V}c.event(H1).zoom("mouse",Z(N(c.that.__zoom,c.mouse[0]=a2(H1,p),c.mouse[1]),c.extent,W))}function a(H1){l.on("mousemove.zoom mouseup.zoom",null),BJ(H1.view,c.moved),r8(H1),c.event(H1).end()}}function m(h,...g){if(!Q.apply(this,arguments))return;var p=this.__zoom,c=a2(h.changedTouches?h.changedTouches[0]:h,this),l=p.invert(c),o=p.k*(h.shiftKey?0.5:2),k=Z(N(y(p,o),c,l),U.apply(this,g),W);if(r8(h),L>0)P2(this).transition().duration(L).call(D,k,c,h);else P2(this).call(C.transform,k,c,h)}function s(h,...g){if(!Q.apply(this,arguments))return;var p=h.touches,c=p.length,l=x(this,g,h.changedTouches.length===c).event(h),o,k,t,_1;xq(h);for(k=0;k<c;++k)if(t=p[k],_1=a2(t,this),_1=[_1,this.__zoom.invert(_1),t.identifier],!l.touch0)l.touch0=_1,o=!0,l.taps=1+!!T;else if(!l.touch1&&l.touch0[2]!==_1[2])l.touch1=_1,l.taps=0;if(T)T=clearTimeout(T);if(o){if(l.taps<2)A=_1[0],T=setTimeout(function(){T=null},w);m6(this),l.start()}}function U1(h,...g){if(!this.__zooming)return;var p=x(this,g).event(h),c=h.changedTouches,l=c.length,o,k,t,_1;r8(h);for(o=0;o<l;++o)if(k=c[o],t=a2(k,this),p.touch0&&p.touch0[2]===k.identifier)p.touch0[0]=t;else if(p.touch1&&p.touch1[2]===k.identifier)p.touch1[0]=t;if(k=p.that.__zoom,p.touch1){var a=p.touch0[0],H1=p.touch0[1],O1=p.touch1[0],L1=p.touch1[1],T1=(T1=O1[0]-a[0])*T1+(T1=O1[1]-a[1])*T1,G1=(G1=L1[0]-H1[0])*G1+(G1=L1[1]-H1[1])*G1;k=y(k,Math.sqrt(T1/G1)),t=[(a[0]+O1[0])/2,(a[1]+O1[1])/2],_1=[(H1[0]+L1[0])/2,(H1[1]+L1[1])/2]}else if(p.touch0)t=p.touch0[0],_1=p.touch0[1];else return;p.zoom("touch",Z(N(k,t,_1),p.extent,W))}function Q1(h,...g){if(!this.__zooming)return;var p=x(this,g).event(h),c=h.changedTouches,l=c.length,o,k;if(xq(h),R)clearTimeout(R);R=setTimeout(function(){R=null},w);for(o=0;o<l;++o)if(k=c[o],p.touch0&&p.touch0[2]===k.identifier)delete p.touch0;else if(p.touch1&&p.touch1[2]===k.identifier)delete p.touch1;if(p.touch1&&!p.touch0)p.touch0=p.touch1,delete p.touch1;if(p.touch0)p.touch0[1]=this.__zoom.invert(p.touch0[0]);else if(p.end(),p.taps===2){if(k=a2(k,this),Math.hypot(A[0]-k[0],A[1]-k[1])<S){var t=P2(this).on("dblclick.zoom");if(t)t.apply(this,arguments)}}}return C.wheelDelta=function(h){return arguments.length?(K=typeof h==="function"?h:uJ(+h),C):K},C.filter=function(h){return arguments.length?(Q=typeof h==="function"?h:uJ(!!h),C):Q},C.touchable=function(h){return arguments.length?(H=typeof h==="function"?h:uJ(!!h),C):H},C.extent=function(h){return arguments.length?(U=typeof h==="function"?h:uJ([[+h[0][0],+h[0][1]],[+h[1][0],+h[1][1]]]),C):U},C.scaleExtent=function(h){return arguments.length?(Y[0]=+h[0],Y[1]=+h[1],C):[Y[0],Y[1]]},C.translateExtent=function(h){return arguments.length?(W[0][0]=+h[0][0],W[1][0]=+h[1][0],W[0][1]=+h[0][1],W[1][1]=+h[1][1],C):[[W[0][0],W[0][1]],[W[1][0],W[1][1]]]},C.constrain=function(h){return arguments.length?(Z=h,C):Z},C.duration=function(h){return arguments.length?(L=+h,C):L},C.interpolate=function(h){return arguments.length?(M=h,C):M},C.on=function(){var h=O.on.apply(O,arguments);return h===O?C:h},C.clickDistance=function(h){return arguments.length?(V=(h=+h)*h,C):Math.sqrt(V)},C.tapDistance=function(h){return arguments.length?(S=+h,C):S},C}var F5={error001:(Q="react")=>`Seems like you have not used ${Q==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${Q}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:(Q)=>`Node type "${Q}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:(Q)=>`The old edge with id=${Q} does not exist.`,error009:(Q)=>`Marker type "${Q}" doesn't exist.`,error008:(Q,{id:U,sourceHandle:Z,targetHandle:K})=>`Couldn't create edge for ${Q} handle id: "${Q==="source"?Z:K}", edge id: ${U}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:(Q)=>`Edge type "${Q}" not found. Using fallback type "default".`,error012:(Q)=>`Node with id "${Q}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(Q="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${Q}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:(Q)=>`Edge with id "${Q}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},O9=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],PK=["Enter"," ","Escape"],NK={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:Q,x:U,y:Z})=>`Moved selected node ${Q}. New position, x: ${U}, y: ${Z}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"},l6;(function(Q){Q.Strict="strict",Q.Loose="loose"})(l6||(l6={}));var h3;(function(Q){Q.Free="free",Q.Vertical="vertical",Q.Horizontal="horizontal"})(h3||(h3={}));var a8;(function(Q){Q.Partial="partial",Q.Full="full"})(a8||(a8={}));var CK={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},$3;(function(Q){Q.Bezier="default",Q.Straight="straight",Q.Step="step",Q.SmoothStep="smoothstep",Q.SimpleBezier="simplebezier"})($3||($3={}));var T9;(function(Q){Q.Arrow="arrow",Q.ArrowClosed="arrowclosed"})(T9||(T9={}));var E1;(function(Q){Q.Left="left",Q.Top="top",Q.Right="right",Q.Bottom="bottom"})(E1||(E1={}));var VM={[E1.Left]:E1.Right,[E1.Right]:E1.Left,[E1.Top]:E1.Bottom,[E1.Bottom]:E1.Top},fK=(Q)=>!!Q&&typeof Q==="object"&&("id"in Q)&&("source"in Q)&&("target"in Q),iM=(Q)=>!!Q&&typeof Q==="object"&&("id"in Q)&&("position"in Q)&&!("source"in Q)&&!("target"in Q),SK=(Q)=>!!Q&&typeof Q==="object"&&("id"in Q)&&("internals"in Q)&&!("source"in Q)&&!("target"in Q);var xJ=(Q,U=[0,0])=>{let{width:Z,height:K}=J4(Q),H=Q.origin??U,Y=Z*H[0],W=K*H[1];return{x:Q.position.x-Y,y:Q.position.y-W}},vK=(Q,U={nodeOrigin:[0,0]})=>{if(!U.nodeLookup)console.warn("Please use `getNodesBounds` from `useReactFlow`/`useSvelteFlow` hook to ensure correct values for sub flows. If not possible, you have to provide a nodeLookup to support sub flows.");if(Q.length===0)return{x:0,y:0,width:0,height:0};let Z=!1,K=Q.reduce((H,Y)=>{let W=typeof Y==="string",L=!U.nodeLookup&&!W?Y:void 0;if(U.nodeLookup)L=W?U.nodeLookup.get(Y):!SK(Y)?U.nodeLookup.get(Y.id):Y;if(!L)return H;return Z=!0,iq(H,pq(L,U.nodeOrigin))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Z?dq(K):{x:0,y:0,width:0,height:0}},n8=(Q,U={})=>{let Z={x:1/0,y:1/0,x2:-1/0,y2:-1/0},K=!1;return Q.forEach((H)=>{if(U.filter===void 0||U.filter(H))Z=iq(Z,pq(H)),K=!0}),K?dq(Z):{x:0,y:0,width:0,height:0}},cq=(Q,U,[Z,K,H]=[0,0,1],Y=!1,W=!1)=>{let L=(U.x-Z)/H,M=(U.y-K)/H,O=U.width/H,T=U.height/H,A=[];for(let R of Q.values()){let{measured:w,selectable:P=!0,hidden:V=!1}=R;if(W&&!P||V)continue;let S=w.width??R.width??R.initialWidth??0,C=w.height??R.height??R.initialHeight??0,{x:y,y:N}=R.internals.positionAbsolute,v=tM(L,M,O,T,y,N,S,C),D=S*C,x=Y&&v>0;if(!R.internals.handleBounds||x||v>=D||R.dragging)A.push(R)}return A},dM=(Q,U)=>{let Z=new Set;return Q.forEach((K)=>{Z.add(K.id)}),U.filter((K)=>Z.has(K.source)||Z.has(K.target))};function pf(Q,U){let Z=new Map,K=U?.nodes?new Set(U.nodes.map((H)=>H.id)):null;return Q.forEach((H)=>{let Y;if(U?.includeHiddenNodes){let{width:W,height:L}=J4(H);Y=W>0&&L>0}else Y=Boolean(H.measured.width&&H.measured.height&&!H.hidden);if(Y&&(!K||K.has(H.id)))Z.set(H.id,H)}),Z}async function rM({nodes:Q,width:U,height:Z,panZoom:K,minZoom:H,maxZoom:Y},W){if(Q.size===0)return!0;let L=pf(Q,W),M=n8(L),O=gJ(M,U,Z,W?.minZoom??H,W?.maxZoom??Y,W?.padding??0.1);return await K.setViewport(O,{duration:W?.duration,ease:W?.ease,interpolate:W?.interpolate}),!0}function jK({nodeId:Q,nextPosition:U,nodeLookup:Z,nodeOrigin:K=[0,0],nodeExtent:H,onError:Y}){let W=Z.get(Q),L=W.parentId?Z.get(W.parentId):void 0,{x:M,y:O}=L?L.internals.positionAbsolute:{x:0,y:0},T=W.origin??K,A=W.extent||H;if(W.extent==="parent"&&!W.expandParent)if(!L)Y?.("005",F5.error005());else{let{width:w,height:P}=J4(L);if(w&&P)A=[[M,O],[M+w,O+P]]}else if(L&&o8(W.extent))A=[[W.extent[0][0]+M,W.extent[0][1]+O],[W.extent[1][0]+M,W.extent[1][1]+O]];let R=o8(A)?s8(U,A,W.measured):U;if(W.measured.width===void 0||W.measured.height===void 0)Y?.("015",F5.error015());return{position:{x:R.x-M+(W.measured.width??0)*T[0],y:R.y-O+(W.measured.height??0)*T[1]},positionAbsolute:R}}async function aM({nodesToRemove:Q=[],edgesToRemove:U=[],nodes:Z,edges:K,onBeforeDelete:H}){let Y=new Set(Q.map((R)=>R.id)),W=[];for(let R of Z){if(R.deletable===!1)continue;let w=Y.has(R.id),P=!w&&R.parentId&&W.find((V)=>V.id===R.parentId);if(w||P)W.push(R)}let L=new Set(U.map((R)=>R.id)),M=K.filter((R)=>R.deletable!==!1),T=dM(W,M);for(let R of M)if(L.has(R.id)&&!T.find((P)=>P.id===R.id))T.push(R);if(!H)return{edges:T,nodes:W};let A=await H({nodes:W,edges:T});if(typeof A==="boolean")return A?{edges:T,nodes:W}:{edges:[],nodes:[]};return A}var R9=(Q,U=0,Z=1)=>Math.min(Math.max(Q,U),Z),s8=(Q={x:0,y:0},U,Z)=>({x:R9(Q.x,U[0][0],U[1][0]-(Z?.width??0)),y:R9(Q.y,U[0][1],U[1][1]-(Z?.height??0))});function sM(Q,U,Z){let{width:K,height:H}=J4(Z),{x:Y,y:W}=Z.internals.positionAbsolute;return s8(Q,[[Y,W],[Y+K,W+H]],U)}var yM=(Q,U,Z)=>{if(Q<U)return R9(Math.abs(Q-U),1,U)/U;else if(Q>Z)return-R9(Math.abs(Q-Z),1,U)/U;return 0},lq=(Q,U,Z=15,K=40)=>{let H=yM(Q.x,K,U.width-K)*Z,Y=yM(Q.y,K,U.height-K)*Z;return[H,Y]},iq=(Q,U)=>({x:Math.min(Q.x,U.x),y:Math.min(Q.y,U.y),x2:Math.max(Q.x2,U.x2),y2:Math.max(Q.y2,U.y2)}),wK=({x:Q,y:U,width:Z,height:K})=>({x:Q,y:U,x2:Q+Z,y2:U+K}),dq=({x:Q,y:U,x2:Z,y2:K})=>({x:Q,y:U,width:Z-Q,height:K-U}),I9=(Q,U=[0,0])=>{let{x:Z,y:K}=SK(Q)?Q.internals.positionAbsolute:xJ(Q,U);return{x:Z,y:K,width:Q.measured?.width??Q.width??Q.initialWidth??0,height:Q.measured?.height??Q.height??Q.initialHeight??0}},pq=(Q,U=[0,0])=>{let{x:Z,y:K}=SK(Q)?Q.internals.positionAbsolute:xJ(Q,U);return{x:Z,y:K,x2:Z+(Q.measured?.width??Q.width??Q.initialWidth??0),y2:K+(Q.measured?.height??Q.height??Q.initialHeight??0)}},VK=(Q,U)=>dq(iq(wK(Q),wK(U))),tM=(Q,U,Z,K,H,Y,W,L)=>{let M=Math.max(0,Math.min(Q+Z,H+W)-Math.max(Q,H)),O=Math.max(0,Math.min(U+K,Y+L)-Math.max(U,Y));return Math.ceil(M*O)},mJ=(Q,U)=>tM(Q.x,Q.y,Q.width,Q.height,U.x,U.y,U.width,U.height),yK=(Q)=>e5(Q.width)&&e5(Q.height)&&e5(Q.x)&&e5(Q.y),e5=(Q)=>!isNaN(Q)&&isFinite(Q),kK=(Q,U)=>(Z,K)=>{console.warn(`[${Q}]: ${K} Help: ${U}error#${Z}`)},w9=(Q,U=[1,1])=>{return{x:U[0]*Math.round(Q.x/U[0]),y:U[1]*Math.round(Q.y/U[1])}},P9=({x:Q,y:U},[Z,K,H],Y=!1,W=[1,1])=>{let L={x:(Q-Z)/H,y:(U-K)/H};return Y?w9(L,W):L},t8=({x:Q,y:U},[Z,K,H])=>{return{x:Q*H+Z,y:U*H+K}};function M9(Q,U){if(typeof Q==="number")return Math.floor((U-U/(1+Q))*0.5);if(typeof Q==="string"&&Q.endsWith("px")){let Z=parseFloat(Q);if(!Number.isNaN(Z))return Math.floor(Z)}if(typeof Q==="string"&&Q.endsWith("%")){let Z=parseFloat(Q);if(!Number.isNaN(Z))return Math.floor(U*Z*0.01)}return console.error(`The padding value "${Q}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function cf(Q,U,Z){if(typeof Q==="string"||typeof Q==="number"){let K=M9(Q,Z),H=M9(Q,U);return{top:K,right:H,bottom:K,left:H,x:H*2,y:K*2}}if(typeof Q==="object"){let K=M9(Q.top??Q.y??0,Z),H=M9(Q.bottom??Q.y??0,Z),Y=M9(Q.left??Q.x??0,U),W=M9(Q.right??Q.x??0,U);return{top:K,right:W,bottom:H,left:Y,x:Y+W,y:K+H}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function lf(Q,U,Z,K,H,Y){let{x:W,y:L}=t8(Q,[U,Z,K]),{x:M,y:O}=t8({x:Q.x+Q.width,y:Q.y+Q.height},[U,Z,K]),T=H-M,A=Y-O;return{left:Math.floor(W),top:Math.floor(L),right:Math.floor(T),bottom:Math.floor(A)}}var gJ=(Q,U,Z,K,H,Y)=>{let W=cf(Y,U,Z),L=(U-W.x)/Q.width,M=(Z-W.y)/Q.height,O=Math.min(L,M),T=R9(O,K,H),A=Q.x+Q.width/2,R=Q.y+Q.height/2,w=U/2-A*T,P=Z/2-R*T,V=lf(Q,w,P,T,U,Z),S={left:Math.min(V.left-W.left,0),top:Math.min(V.top-W.top,0),right:Math.min(V.right-W.right,0),bottom:Math.min(V.bottom-W.bottom,0)};return{x:w-S.left+S.right,y:P-S.top+S.bottom,zoom:T}},N9=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function o8(Q){return Q!==void 0&&Q!==null&&Q!=="parent"}function J4(Q){return{width:Q.measured?.width??Q.width??Q.initialWidth??0,height:Q.measured?.height??Q.height??Q.initialHeight??0}}function DK(Q){return(Q.measured?.width??Q.width??Q.initialWidth)!==void 0&&(Q.measured?.height??Q.height??Q.initialHeight)!==void 0}function uK(Q,U={width:0,height:0},Z,K,H){let Y={...Q},W=K.get(Z);if(W){let L=W.origin||H;Y.x+=W.internals.positionAbsolute.x-(U.width??0)*L[0],Y.y+=W.internals.positionAbsolute.y-(U.height??0)*L[1]}return Y}function bK(Q,U){if(Q.size!==U.size)return!1;for(let Z of Q)if(!U.has(Z))return!1;return!0}function oM(){let Q,U;return{promise:new Promise((K,H)=>{Q=K,U=H}),resolve:Q,reject:U}}function nM(Q){return{...NK,...Q||{}}}function df(Q){if(typeof document>"u")return!0;let U=document.querySelector(`.${Q}-flow__pane`);if(!U||!U.isConnected)return!0;let Z=getComputedStyle(U);if(Z.display==="none")return!0;if(Z.visibility==="hidden"||Z.visibility==="collapse")return!0;if(Z.opacity==="0")return!0;if(Z.width==="0"&&Z.height==="0")return!0;let K=U.getBoundingClientRect();if(K.width===0&&K.height===0)return!0;let H=document.querySelector(`.${Q}-flow__attribution`);if(!H||!H.isConnected)return!1;let Y=getComputedStyle(H);if(Y.display==="none")return!1;if(Y.visibility==="hidden"||Y.visibility==="collapse")return!1;if(Y.opacity==="0")return!1;let W=H.getBoundingClientRect();if(W.width===0&&W.height===0)return!1;return!0}var kM=!1;function eM(Q){if(kM)return;kM=!0;let U=`${Q.charAt(0).toUpperCase()+Q.slice(1)} Flow`;setTimeout(()=>{if(!df(Q))console.warn(`${U}: It seems like you are hiding the attribution. Please only do this when you are subscribed to ${U} Pro: https://${Q}flow.dev/remove-attr
|
|
241
|
-
%cYou can ignore this warning if you are subscribed.`,"font-style: italic;")},1000)}function EK(Q){return Q===null?null:Q?"valid":"invalid"}function hJ(Q,{snapGrid:U=[0,0],snapToGrid:Z=!1,transform:K,containerBounds:H}){let{x:Y,y:W}=_4(Q),L=P9({x:Y-(H?.left??0),y:W-(H?.top??0)},K),{x:M,y:O}=Z?w9(L,U):L;return{xSnapped:M,ySnapped:O,...L}}var rq=(Q)=>({width:Q.offsetWidth,height:Q.offsetHeight}),hK=(Q)=>Q?.getRootNode?.()||window?.document,rf=["INPUT","SELECT","TEXTAREA"];function xK(Q){let U=Q.composedPath?.()?.[0]||Q.target;if(U?.nodeType!==1)return!1;return rf.includes(U.nodeName)||U.hasAttribute("contenteditable")||!!U.closest(".nokey")}var mK=(Q)=>("clientX"in Q),_4=(Q,U)=>{let Z=mK(Q),K=Z?Q.clientX:Q.touches?.[0].clientX,H=Z?Q.clientY:Q.touches?.[0].clientY;return{x:K-(U?.left??0),y:H-(U?.top??0)}},DM=(Q,U,Z,K,H)=>{let Y=U.querySelectorAll(`.${Q}`);if(!Y||!Y.length)return null;return Array.from(Y).map((W)=>{let L=W.getBoundingClientRect();return{id:W.getAttribute("data-handleid"),type:Q,nodeId:H,position:W.getAttribute("data-handlepos"),x:(L.left-Z.left)/K,y:(L.top-Z.top)/K,...rq(W)}})};function aq({sourceX:Q,sourceY:U,targetX:Z,targetY:K,sourceControlX:H,sourceControlY:Y,targetControlX:W,targetControlY:L}){let M=Q*0.125+H*0.375+W*0.375+Z*0.125,O=U*0.125+Y*0.375+L*0.375+K*0.125,T=Math.abs(M-Q),A=Math.abs(O-U);return[M,O,T,A]}function mq(Q,U){if(Q>=0)return 0.5*Q;return U*25*Math.sqrt(-Q)}function uM({pos:Q,x1:U,y1:Z,x2:K,y2:H,c:Y}){switch(Q){case E1.Left:return[U-mq(U-K,Y),Z];case E1.Right:return[U+mq(K-U,Y),Z];case E1.Top:return[U,Z-mq(Z-H,Y)];case E1.Bottom:return[U,Z+mq(H-Z,Y)]}}function sq({sourceX:Q,sourceY:U,sourcePosition:Z=E1.Bottom,targetX:K,targetY:H,targetPosition:Y=E1.Top,curvature:W=0.25}){let[L,M]=uM({pos:Z,x1:Q,y1:U,x2:K,y2:H,c:W}),[O,T]=uM({pos:Y,x1:K,y1:H,x2:Q,y2:U,c:W}),[A,R,w,P]=aq({sourceX:Q,sourceY:U,targetX:K,targetY:H,sourceControlX:L,sourceControlY:M,targetControlX:O,targetControlY:T});return[`M${Q},${U} C${L},${M} ${O},${T} ${K},${H}`,A,R,w,P]}function gK({sourceX:Q,sourceY:U,targetX:Z,targetY:K}){let H=Math.abs(Z-Q)/2,Y=Z<Q?Z+H:Z-H,W=Math.abs(K-U)/2,L=K<U?K+W:K-W;return[Y,L,H,W]}function _T({sourceNode:Q,targetNode:U,selected:Z=!1,zIndex:K=0,elevateOnSelect:H=!1,zIndexMode:Y="basic"}){if(Y==="manual")return K;let W=H&&Z?K+1000:K,L=Math.max(Q.parentId||H&&Q.selected?Q.internals.z:0,U.parentId||H&&U.selected?U.internals.z:0);return W+L}function JT({sourceNode:Q,targetNode:U,width:Z,height:K,transform:H}){let Y=iq(pq(Q),pq(U));if(Y.x===Y.x2)Y.x2+=1;if(Y.y===Y.y2)Y.y2+=1;let W={x:-H[0]/H[2],y:-H[1]/H[2],width:Z/H[2],height:K/H[2]};return mJ(W,dq(Y))>0}var af=({source:Q,sourceHandle:U,target:Z,targetHandle:K})=>`xy-edge__${Q}${U||""}-${Z}${K||""}`,sf=(Q,U)=>{return U.some((Z)=>Z.source===Q.source&&Z.target===Q.target&&(Z.sourceHandle===Q.sourceHandle||!Z.sourceHandle&&!Q.sourceHandle)&&(Z.targetHandle===Q.targetHandle||!Z.targetHandle&&!Q.targetHandle))},$T=(Q,U,Z={})=>{if(!Q.source||!Q.target)return Z.onError?.("006",F5.error006()),U;let K=Z.getEdgeId||af,H;if(fK(Q))H={...Q};else H={...Q,id:K(Q)};if(sf(H,U))return U;if(H.sourceHandle===null)delete H.sourceHandle;if(H.targetHandle===null)delete H.targetHandle;return U.concat(H)};function tq({sourceX:Q,sourceY:U,targetX:Z,targetY:K}){let[H,Y,W,L]=gK({sourceX:Q,sourceY:U,targetX:Z,targetY:K});return[`M ${Q},${U}L ${Z},${K}`,H,Y,W,L]}var bM={[E1.Left]:{x:-1,y:0},[E1.Right]:{x:1,y:0},[E1.Top]:{x:0,y:-1},[E1.Bottom]:{x:0,y:1}},tf=({source:Q,sourcePosition:U=E1.Bottom,target:Z})=>{if(U===E1.Left||U===E1.Right)return Q.x<Z.x?{x:1,y:0}:{x:-1,y:0};return Q.y<Z.y?{x:0,y:1}:{x:0,y:-1}},EM=(Q,U)=>Math.sqrt(Math.pow(U.x-Q.x,2)+Math.pow(U.y-Q.y,2));function of({source:Q,sourcePosition:U=E1.Bottom,target:Z,targetPosition:K=E1.Top,center:H,offset:Y,stepPosition:W}){let L=bM[U],M=bM[K],O={x:Q.x+L.x*Y,y:Q.y+L.y*Y},T={x:Z.x+M.x*Y,y:Z.y+M.y*Y},A=tf({source:O,sourcePosition:U,target:T}),R=A.x!==0?"x":"y",w=A[R],P=[],V,S,C={x:0,y:0},y={x:0,y:0},[,,N,v]=gK({sourceX:Q.x,sourceY:Q.y,targetX:Z.x,targetY:Z.y});if(L[R]*M[R]===-1){if(R==="x")V=H.x??O.x+(T.x-O.x)*W,S=H.y??(O.y+T.y)/2;else V=H.x??(O.x+T.x)/2,S=H.y??O.y+(T.y-O.y)*W;let u=[{x:V,y:O.y},{x:V,y:T.y}],b=[{x:O.x,y:S},{x:T.x,y:S}];if(L[R]===w)P=R==="x"?u:b;else P=R==="x"?b:u}else{let u=[{x:O.x,y:T.y}],b=[{x:T.x,y:O.y}];if(R==="x")P=L.x===w?b:u;else P=L.y===w?u:b;if(U===K){let h=Math.abs(Q[R]-Z[R]);if(h<=Y){let g=Math.min(Y-1,Y-h);if(L[R]===w)C[R]=(O[R]>Q[R]?-1:1)*g;else y[R]=(T[R]>Z[R]?-1:1)*g}}if(U!==K){let h=R==="x"?"y":"x",g=L[R]===M[h],p=O[h]>T[h],c=O[h]<T[h];if(L[R]===1&&(!g&&p||g&&c)||L[R]!==1&&(!g&&c||g&&p))P=R==="x"?u:b}let m={x:O.x+C.x,y:O.y+C.y},s={x:T.x+y.x,y:T.y+y.y},U1=Math.max(Math.abs(m.x-P[0].x),Math.abs(s.x-P[0].x)),Q1=Math.max(Math.abs(m.y-P[0].y),Math.abs(s.y-P[0].y));if(U1>=Q1)V=(m.x+s.x)/2,S=P[0].y;else V=P[0].x,S=(m.y+s.y)/2}let D={x:O.x+C.x,y:O.y+C.y},x={x:T.x+y.x,y:T.y+y.y};return[[Q,...D.x!==P[0].x||D.y!==P[0].y?[D]:[],...P,...x.x!==P[P.length-1].x||x.y!==P[P.length-1].y?[x]:[],Z],V,S,N,v]}function nf(Q,U,Z,K){let H=Math.min(EM(Q,U)/2,EM(U,Z)/2,K),{x:Y,y:W}=U;if(Q.x===Y&&Y===Z.x||Q.y===W&&W===Z.y)return`L${Y} ${W}`;if(Q.y===W){let O=Q.x<Z.x?-1:1,T=Q.y<Z.y?1:-1;return`L ${Y+H*O},${W}Q ${Y},${W} ${Y},${W+H*T}`}let L=Q.x<Z.x?1:-1,M=Q.y<Z.y?-1:1;return`L ${Y},${W+H*M}Q ${Y},${W} ${Y+H*L},${W}`}function pJ({sourceX:Q,sourceY:U,sourcePosition:Z=E1.Bottom,targetX:K,targetY:H,targetPosition:Y=E1.Top,borderRadius:W=5,centerX:L,centerY:M,offset:O=20,stepPosition:T=0.5}){let[A,R,w,P,V]=of({source:{x:Q,y:U},sourcePosition:Z,target:{x:K,y:H},targetPosition:Y,center:{x:L,y:M},offset:O,stepPosition:T}),S=`M${A[0].x} ${A[0].y}`;for(let C=1;C<A.length-1;C++)S+=nf(A[C-1],A[C],A[C+1],W);return S+=`L${A[A.length-1].x} ${A[A.length-1].y}`,[S,R,w,P,V]}function hM(Q){return Q&&!!(Q.internals.handleBounds||Q.handles?.length)&&!!(Q.measured.width||Q.width||Q.initialWidth)}function QT(Q){let{sourceNode:U,targetNode:Z}=Q;if(!hM(U)||!hM(Z))return null;let K=U.internals.handleBounds||xM(U.handles),H=Z.internals.handleBounds||xM(Z.handles),Y=mM(K?.source??[],Q.sourceHandle),W=mM(Q.connectionMode===l6.Strict?H?.target??[]:(H?.target??[]).concat(H?.source??[]),Q.targetHandle);if(!Y||!W)return Q.onError?.("008",F5.error008(!Y?"source":"target",{id:Q.id,sourceHandle:Q.sourceHandle,targetHandle:Q.targetHandle})),null;let L=Y?.position||E1.Bottom,M=W?.position||E1.Top,O=i6(U,Y,L),T=i6(Z,W,M);return{sourceX:O.x,sourceY:O.y,targetX:T.x,targetY:T.y,sourcePosition:L,targetPosition:M}}function xM(Q){if(!Q)return null;let U=[],Z=[];for(let K of Q)if(K.width=K.width??1,K.height=K.height??1,K.type==="source")U.push(K);else if(K.type==="target")Z.push(K);return{source:U,target:Z}}function i6(Q,U,Z=E1.Left,K=!1){let H=(U?.x??0)+Q.internals.positionAbsolute.x,Y=(U?.y??0)+Q.internals.positionAbsolute.y,{width:W,height:L}=U??J4(Q);if(K)return{x:H+W/2,y:Y+L/2};switch(U?.position??Z){case E1.Top:return{x:H+W/2,y:Y};case E1.Right:return{x:H+W,y:Y+L/2};case E1.Bottom:return{x:H+W/2,y:Y+L};case E1.Left:return{x:H,y:Y+L/2}}}function mM(Q,U){if(!Q)return null;return(!U?Q[0]:Q.find((Z)=>Z.id===U))||null}function oq(Q,U){if(!Q)return"";if(typeof Q==="string")return Q;return`${U?`${U}__`:""}${Object.keys(Q).sort().map((K)=>`${K}=${Q[K]}`).join("&")}`}function qT(Q,{id:U,defaultColor:Z,defaultMarkerStart:K,defaultMarkerEnd:H}){let Y=new Set;return Q.reduce((W,L)=>{return[L.markerStart||K,L.markerEnd||H].forEach((M)=>{if(M&&typeof M==="object"){let O=oq(M,U);if(!Y.has(O))W.push({id:O,color:M.color||Z,...M}),Y.add(O)}}),W},[]).sort((W,L)=>W.id.localeCompare(L.id))}function UT(Q,U,Z,K,H){let Y=0.5;if(H==="start")Y=0;else if(H==="end")Y=1;let W=[(Q.x+Q.width*Y)*U.zoom+U.x,Q.y*U.zoom+U.y-K],L=[-100*Y,-100];switch(Z){case E1.Right:W=[(Q.x+Q.width)*U.zoom+U.x+K,(Q.y+Q.height*Y)*U.zoom+U.y],L=[0,-100*Y];break;case E1.Bottom:W[1]=(Q.y+Q.height)*U.zoom+U.y+K,L[1]=0;break;case E1.Left:W=[Q.x*U.zoom+U.x-K,(Q.y+Q.height*Y)*U.zoom+U.y],L=[-100,-100*Y];break}return`translate(${W[0]}px, ${W[1]}px) translate(${L[0]}%, ${L[1]}%)`}var GT=1000,ef=10,pK={nodeOrigin:[0,0],nodeExtent:O9,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},_S={...pK,checkEquality:!0};function cK(Q,U){let Z={...Q};for(let K in U)if(U[K]!==void 0)Z[K]=U[K];return Z}function ZT(Q,U,Z){let K=cK(pK,Z);for(let H of Q.values())if(H.parentId)iK(H,Q,U,K);else{let Y=xJ(H,K.nodeOrigin),W=o8(H.extent)?H.extent:K.nodeExtent,L=s8(Y,W,J4(H));H.internals.positionAbsolute=L}}function JS(Q,U){if(!Q.handles)return!Q.measured?void 0:U?.internals.handleBounds;let Z=[],K=[];for(let H of Q.handles){let Y={id:H.id,width:H.width??1,height:H.height??1,nodeId:Q.id,x:H.x,y:H.y,position:H.position,type:H.type};if(H.type==="source")Z.push(Y);else if(H.type==="target")K.push(Y)}return{source:Z,target:K}}function lK(Q){return Q==="manual"}function nq(Q,U,Z,K={}){let H=cK(_S,K),Y={i:0},W=new Map(U),L=H?.elevateNodesOnSelect&&!lK(H.zIndexMode)?GT:0,M=Q.length>0,O=!1;U.clear(),Z.clear();for(let T of Q){let A=W.get(T.id);if(H.checkEquality&&T===A?.internals.userNode)U.set(T.id,A);else{let R=xJ(T,H.nodeOrigin),w=o8(T.extent)?T.extent:H.nodeExtent,P=s8(R,w,J4(T));A={...H.defaults,...T,measured:{width:T.measured?.width,height:T.measured?.height},internals:{positionAbsolute:P,handleBounds:JS(T,A),z:FT(T,L,H.zIndexMode),userNode:T}},U.set(T.id,A)}if((A.measured===void 0||A.measured.width===void 0||A.measured.height===void 0)&&!A.hidden)M=!1;if(T.parentId)iK(A,U,Z,K,Y);O||=T.selected??!1}return{nodesInitialized:M,hasSelectedNodes:O}}function $S(Q,U){if(!Q.parentId)return;let Z=U.get(Q.parentId);if(Z)Z.set(Q.id,Q);else U.set(Q.parentId,new Map([[Q.id,Q]]))}function iK(Q,U,Z,K,H){let{elevateNodesOnSelect:Y,nodeOrigin:W,nodeExtent:L,zIndexMode:M}=cK(pK,K),O=Q.parentId,T=U.get(O);if(!T){console.warn(`Parent node ${O} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}if($S(Q,Z),H&&!T.parentId&&T.internals.rootParentIndex===void 0&&M==="auto")T.internals.rootParentIndex=++H.i,T.internals.z=T.internals.z+H.i*ef;if(H&&T.internals.rootParentIndex!==void 0)H.i=T.internals.rootParentIndex;let A=Y&&!lK(M)?GT:0,{x:R,y:w,z:P}=QS(Q,T,W,L,A,M),{positionAbsolute:V}=Q.internals,S=R!==V.x||w!==V.y;if(S||P!==Q.internals.z)U.set(Q.id,{...Q,internals:{...Q.internals,positionAbsolute:S?{x:R,y:w}:V,z:P}})}function FT(Q,U,Z){let K=e5(Q.zIndex)?Q.zIndex:0;if(lK(Z))return K;return K+(Q.selected?U:0)}function QS(Q,U,Z,K,H,Y){let{x:W,y:L}=U.internals.positionAbsolute,M=J4(Q),O=xJ(Q,Z),T=o8(Q.extent)?s8(O,Q.extent,M):O,A=s8({x:W+T.x,y:L+T.y},K,M);if(Q.extent==="parent")A=sM(A,M,U);let R=FT(Q,H,Y),w=U.internals.z??0;return{x:A.x,y:A.y,z:w>=R?w+1:R}}function eq(Q,U,Z,K=[0,0]){let H=[],Y=new Map;for(let W of Q){let L=U.get(W.parentId);if(!L)continue;let M=Y.get(W.parentId)?.expandedRect??I9(L),O=VK(M,W.rect);Y.set(W.parentId,{expandedRect:O,parent:L})}if(Y.size>0)Y.forEach(({expandedRect:W,parent:L},M)=>{let O=L.internals.positionAbsolute,T=J4(L),A=L.origin??K,R=W.x<O.x?Math.round(Math.abs(O.x-W.x)):0,w=W.y<O.y?Math.round(Math.abs(O.y-W.y)):0,P=Math.max(T.width,Math.round(W.width)),V=Math.max(T.height,Math.round(W.height)),S=(P-T.width)*A[0],C=(V-T.height)*A[1];if(R>0||w>0||S||C)H.push({id:M,type:"position",position:{x:L.position.x-R+S,y:L.position.y-w+C}}),Z.get(M)?.forEach((y)=>{if(!Q.some((N)=>N.id===y.id))H.push({id:y.id,type:"position",position:{x:y.position.x+R,y:y.position.y+w}})});if(T.width<W.width||T.height<W.height||R||w)H.push({id:M,type:"dimensions",setAttributes:!0,dimensions:{width:P+(R?A[0]*R-S:0),height:V+(w?A[1]*w-C:0)}})});return H}function XT(Q,U,Z,K,H,Y,W){let L=K?.querySelector(".xyflow__viewport"),M=!1;if(!L)return{changes:[],updatedInternals:M};let O=[],T=window.getComputedStyle(L),{m22:A}=new window.DOMMatrixReadOnly(T.transform),R=[];for(let w of Q.values()){let P=U.get(w.id);if(!P)continue;if(P.hidden){U.set(P.id,{...P,internals:{...P.internals,handleBounds:void 0}}),M=!0;continue}let V=rq(w.nodeElement),S=P.measured.width!==V.width||P.measured.height!==V.height;if(!!(V.width&&V.height&&(S||!P.internals.handleBounds||w.force))){let y=w.nodeElement.getBoundingClientRect(),N=o8(P.extent)?P.extent:Y,{positionAbsolute:v}=P.internals;if(P.parentId&&P.extent==="parent"){let x=U.get(P.parentId);if(x)v=sM(v,V,x)}else if(N)v=s8(v,N,V);let D={...P,measured:V,internals:{...P.internals,positionAbsolute:v,handleBounds:{source:DM("source",w.nodeElement,y,A,P.id),target:DM("target",w.nodeElement,y,A,P.id)}}};if(U.set(P.id,D),P.parentId)iK(D,U,Z,{nodeOrigin:H,zIndexMode:W});if(M=!0,S){if(O.push({id:P.id,type:"dimensions",dimensions:V}),P.expandParent&&P.parentId)R.push({id:P.id,parentId:P.parentId,rect:I9(D,H)})}}}if(R.length>0){let w=eq(R,U,Z,H);O.push(...w)}return{changes:O,updatedInternals:M}}async function KT({delta:Q,panZoom:U,transform:Z,translateExtent:K,width:H,height:Y}){if(!U||!Q.x&&!Q.y)return!1;let W=await U.setViewportConstrained({x:Z[0]+Q.x,y:Z[1]+Q.y,zoom:Z[2]},[[0,0],[H,Y]],K);return!!W&&(W.x!==Z[0]||W.y!==Z[1]||W.k!==Z[2])}function gM(Q,U,Z,K,H,Y){let W=H,L=K.get(W)||new Map;K.set(W,L.set(Z,U)),W=`${H}-${Q}`;let M=K.get(W)||new Map;if(K.set(W,M.set(Z,U)),Y){W=`${H}-${Q}-${Y}`;let O=K.get(W)||new Map;K.set(W,O.set(Z,U))}}function dK(Q,U,Z){Q.clear(),U.clear();for(let K of Z){let{source:H,target:Y,sourceHandle:W=null,targetHandle:L=null}=K,M={edgeId:K.id,source:H,target:Y,sourceHandle:W,targetHandle:L},O=`${H}-${W}--${Y}-${L}`,T=`${Y}-${L}--${H}-${W}`;gM("source",M,T,Q,H,W),gM("target",M,O,Q,Y,L),U.set(K.id,K)}}function HT(Q,U){if(!Q.parentId)return!1;let Z=U.get(Q.parentId);if(!Z)return!1;if(Z.selected)return!0;return HT(Z,U)}function pM(Q,U,Z){let K=Q;do{if(K?.matches?.(U))return!0;if(K===Z)return!1;K=K?.parentElement}while(K);return!1}function qS(Q,U,Z,K){let H=new Map;for(let[Y,W]of Q)if((W.selected||W.id===K)&&(!W.parentId||!HT(W,Q))&&(W.draggable||U&&typeof W.draggable>"u")){let L=Q.get(Y);if(L)H.set(Y,{id:Y,position:L.position||{x:0,y:0},distance:{x:Z.x-L.internals.positionAbsolute.x,y:Z.y-L.internals.positionAbsolute.y},extent:L.extent,parentId:L.parentId,origin:L.origin,expandParent:L.expandParent,internals:{positionAbsolute:L.internals.positionAbsolute||{x:0,y:0}},measured:{width:L.measured.width??0,height:L.measured.height??0}})}return H}function RK({nodeId:Q,dragItems:U,nodeLookup:Z,dragging:K=!0}){let H=[];for(let[W,L]of U){let M=Z.get(W)?.internals.userNode;if(M)H.push({...M,position:L.position,dragging:K})}if(!Q)return[H[0],H];let Y=Z.get(Q)?.internals.userNode;return[!Y?H[0]:{...Y,position:U.get(Q)?.position||Y.position,dragging:K},H]}function US({dragItems:Q,snapGrid:U,x:Z,y:K}){let H=Q.values().next().value;if(!H)return null;let Y={x:Z-H.distance.x,y:K-H.distance.y},W=w9(Y,U);return{x:W.x-Y.x,y:W.y-Y.y}}function YT({onNodeMouseDown:Q,getStoreItems:U,onDragStart:Z,onDrag:K,onDragStop:H}){let Y={x:null,y:null},W=0,L=new Map,M=!1,O={x:0,y:0},T=null,A=!1,R=null,w=!1,P=!1,V=null;function S({noDragClassName:y,handleSelector:N,domNode:v,isSelectable:D,nodeId:x,nodeClickDistance:E=0}){R=P2(v);function u({x:U1,y:Q1}){let{nodeLookup:h,nodeExtent:g,snapGrid:p,snapToGrid:c,nodeOrigin:l,onNodeDrag:o,onSelectionDrag:k,onError:t,updateNodePositions:_1}=U();Y={x:U1,y:Q1};let a=!1,H1=L.size>1,O1=H1&&g?wK(n8(L)):null,L1=H1&&c?US({dragItems:L,snapGrid:p,x:U1,y:Q1}):null;for(let[T1,G1]of L){if(!h.has(T1))continue;let R1={x:U1-G1.distance.x,y:Q1-G1.distance.y};if(c)R1=L1?{x:Math.round(R1.x+L1.x),y:Math.round(R1.y+L1.y)}:w9(R1,p);let f1=null;if(H1&&g&&!G1.extent&&O1){let{positionAbsolute:b1}=G1.internals,c1=b1.x-O1.x+g[0][0],k1=b1.x+G1.measured.width-O1.x2+g[1][0],A1=b1.y-O1.y+g[0][1],e1=b1.y+G1.measured.height-O1.y2+g[1][1];f1=[[c1,A1],[k1,e1]]}let{position:z1,positionAbsolute:C1}=jK({nodeId:T1,nextPosition:R1,nodeLookup:h,nodeExtent:f1?f1:g,nodeOrigin:l,onError:t});a=a||G1.position.x!==z1.x||G1.position.y!==z1.y,G1.position=z1,G1.internals.positionAbsolute=C1}if(P=P||a,!a)return;if(_1(L,!0),V&&(K||o||!x&&k)){let[T1,G1]=RK({nodeId:x,dragItems:L,nodeLookup:h});if(K?.(V,L,T1,G1),o?.(V,T1,G1),!x)k?.(V,G1)}}async function b(){if(!T)return;let{transform:U1,panBy:Q1,autoPanSpeed:h,autoPanOnNodeDrag:g}=U();if(!g){M=!1,cancelAnimationFrame(W);return}let[p,c]=lq(O,T,h);if(p!==0||c!==0){if(Y.x=(Y.x??0)-p/U1[2],Y.y=(Y.y??0)-c/U1[2],await Q1({x:p,y:c}))u(Y)}W=requestAnimationFrame(b)}function m(U1){let{nodeLookup:Q1,multiSelectionActive:h,nodesDraggable:g,transform:p,snapGrid:c,snapToGrid:l,selectNodesOnDrag:o,onNodeDragStart:k,onSelectionDragStart:t,unselectNodesAndEdges:_1}=U();if(A=!0,(!o||!D)&&!h&&x){if(!Q1.get(x)?.selected)_1()}if(D&&o&&x)Q?.(x);let a=hJ(U1.sourceEvent,{transform:p,snapGrid:c,snapToGrid:l,containerBounds:T});if(Y=a,L=qS(Q1,g,a,x),L.size>0&&(Z||k||!x&&t)){let[H1,O1]=RK({nodeId:x,dragItems:L,nodeLookup:Q1});if(Z?.(U1.sourceEvent,L,H1,O1),k?.(U1.sourceEvent,H1,O1),!x)t?.(U1.sourceEvent,O1)}}let s=TJ().clickDistance(E).on("start",(U1)=>{let{domNode:Q1,nodeDragThreshold:h,transform:g,snapGrid:p,snapToGrid:c}=U();if(T=Q1?.getBoundingClientRect()||null,w=!1,P=!1,V=U1.sourceEvent,h===0)m(U1);Y=hJ(U1.sourceEvent,{transform:g,snapGrid:p,snapToGrid:c,containerBounds:T}),O=_4(U1.sourceEvent,T)}).on("drag",(U1)=>{let{autoPanOnNodeDrag:Q1,transform:h,snapGrid:g,snapToGrid:p,nodeDragThreshold:c,nodeLookup:l}=U(),o=hJ(U1.sourceEvent,{transform:h,snapGrid:g,snapToGrid:p,containerBounds:T});if(V=U1.sourceEvent,U1.sourceEvent.type==="touchmove"&&U1.sourceEvent.touches.length>1||x&&!l.has(x))w=!0;if(w)return;if(!M&&Q1&&A)M=!0,b();if(!A){let k=_4(U1.sourceEvent,T),t=k.x-O.x,_1=k.y-O.y;if(Math.sqrt(t*t+_1*_1)>c)m(U1)}if((Y.x!==o.xSnapped||Y.y!==o.ySnapped)&&L&&A)O=_4(U1.sourceEvent,T),u(o)}).on("end",(U1)=>{if(!A||w){if(w&&L.size>0)U().updateNodePositions(L,!1);return}if(M=!1,A=!1,cancelAnimationFrame(W),L.size>0){let{nodeLookup:Q1,updateNodePositions:h,onNodeDragStop:g,onSelectionDragStop:p}=U();if(P)h(L,!1),P=!1;if(H||g||!x&&p){let[c,l]=RK({nodeId:x,dragItems:L,nodeLookup:Q1,dragging:!1});if(H?.(U1.sourceEvent,L,c,l),g?.(U1.sourceEvent,c,l),!x)p?.(U1.sourceEvent,l)}}}).filter((U1)=>{let Q1=U1.target;return!U1.button&&(!y||!pM(Q1,`.${y}`,v))&&(!N||pM(Q1,N,v))});R.call(s)}function C(){R?.on(".drag",null)}return{update:S,destroy:C}}function GS(Q,U,Z){let K=[],H={x:Q.x-Z,y:Q.y-Z,width:Z*2,height:Z*2};for(let Y of U.values())if(mJ(H,I9(Y))>0)K.push(Y);return K}var ZS=250;function FS(Q,U,Z,K){let H=[],Y=1/0,W=GS(Q,Z,U+ZS);for(let L of W){let M=[...L.internals.handleBounds?.source??[],...L.internals.handleBounds?.target??[]];for(let O of M){if(K.nodeId===O.nodeId&&K.type===O.type&&K.id===O.id)continue;let{x:T,y:A}=i6(L,O,O.position,!0),R=Math.sqrt(Math.pow(T-Q.x,2)+Math.pow(A-Q.y,2));if(R>U)continue;if(R<Y)H=[{...O,x:T,y:A}],Y=R;else if(R===Y)H.push({...O,x:T,y:A})}}if(!H.length)return null;if(H.length>1){let L=K.type==="source"?"target":"source";return H.find((M)=>M.type===L)??H[0]}return H[0]}function zT(Q,U,Z,K,H,Y=!1){let W=K.get(Q);if(!W)return null;let L=H==="strict"?W.internals.handleBounds?.[U]:[...W.internals.handleBounds?.source??[],...W.internals.handleBounds?.target??[]],M=(Z?L?.find((O)=>O.id===Z):L?.[0])??null;return M&&Y?{...M,...i6(W,M,M.position,!0)}:M}function WT(Q,U){if(Q)return Q;else if(U?.classList.contains("target"))return"target";else if(U?.classList.contains("source"))return"source";return null}function XS(Q,U){let Z=null;if(U)Z=!0;else if(Q&&!U)Z=!1;return Z}var LT=()=>!0;function KS(Q,{connectionMode:U,connectionRadius:Z,handleId:K,nodeId:H,edgeUpdaterType:Y,isTarget:W,domNode:L,nodeLookup:M,lib:O,autoPanOnConnect:T,flowId:A,panBy:R,cancelConnection:w,onConnectStart:P,onConnect:V,onConnectEnd:S,isValidConnection:C=LT,onReconnectEnd:y,updateConnection:N,getTransform:v,getFromHandle:D,autoPanSpeed:x,dragThreshold:E=1,handleDomNode:u}){let b=hK(Q.target),m=0,s,{x:U1,y:Q1}=_4(Q),h=WT(Y,u),g=L?.getBoundingClientRect(),p=!1;if(!g||!h)return;let c=zT(H,h,K,M,U);if(!c)return;let l=_4(Q,g),o=!1,k=null,t=!1,_1=null;function a(){if(!T||!g)return;let[z1,C1]=lq(l,g,x);R({x:z1,y:C1}),m=requestAnimationFrame(a)}let H1={...c,nodeId:H,type:h,position:c.position},O1=M.get(H),T1={inProgress:!0,isValid:null,from:i6(O1,H1,E1.Left,!0),fromHandle:H1,fromPosition:H1.position,fromNode:O1,to:l,toHandle:null,toPosition:VM[H1.position],toNode:null,pointer:l};function G1(){p=!0,N(T1),P?.(Q,{nodeId:H,handleId:K,handleType:h})}if(E===0)G1();function R1(z1){if(!p){let{x:e1,y:D1}=_4(z1),g0=e1-U1,_0=D1-Q1;if(!(g0*g0+_0*_0>E*E))return;G1()}if(!D()||!H1){f1(z1);return}let C1=v();if(l=_4(z1,g),s=FS(P9(l,C1,!1,[1,1]),Z,M,H1),!o)a(),o=!0;let b1=BT(z1,{handle:s,connectionMode:U,fromNodeId:H,fromHandleId:K,fromType:W?"target":"source",isValidConnection:C,doc:b,lib:O,flowId:A,nodeLookup:M});_1=b1.handleDomNode,k=b1.connection,t=XS(!!s,b1.isValid);let c1=M.get(H),k1=c1?i6(c1,H1,E1.Left,!0):T1.from,A1={...T1,from:k1,isValid:t,to:b1.toHandle&&t?t8({x:b1.toHandle.x,y:b1.toHandle.y},C1):l,toHandle:b1.toHandle,toPosition:t&&b1.toHandle?b1.toHandle.position:VM[H1.position],toNode:b1.toHandle?M.get(b1.toHandle.nodeId):null,pointer:l};N(A1),T1=A1}function f1(z1){if("touches"in z1&&z1.touches.length>0)return;if(p){if((s||_1)&&k&&t)V?.(k);let{inProgress:C1,...b1}=T1,c1={...b1,toPosition:T1.toHandle?T1.toPosition:null};if(S?.(z1,c1),Y)y?.(z1,c1)}w(),cancelAnimationFrame(m),o=!1,t=!1,k=null,_1=null,b.removeEventListener("mousemove",R1),b.removeEventListener("mouseup",f1),b.removeEventListener("touchmove",R1),b.removeEventListener("touchend",f1)}b.addEventListener("mousemove",R1),b.addEventListener("mouseup",f1),b.addEventListener("touchmove",R1),b.addEventListener("touchend",f1)}function BT(Q,{handle:U,connectionMode:Z,fromNodeId:K,fromHandleId:H,fromType:Y,doc:W,lib:L,flowId:M,isValidConnection:O=LT,nodeLookup:T}){let A=Y==="target",R=U?W.querySelector(`.${L}-flow__handle[data-id="${M}-${U?.nodeId}-${U?.id}-${U?.type}"]`):null,{x:w,y:P}=_4(Q),V=W.elementFromPoint(w,P),S=V?.classList.contains(`${L}-flow__handle`)?V:R,C={handleDomNode:S,isValid:!1,connection:null,toHandle:null};if(S){let y=WT(void 0,S),N=S.getAttribute("data-nodeid"),v=S.getAttribute("data-handleid"),D=S.classList.contains("connectable"),x=S.classList.contains("connectableend");if(!N||!y)return C;let E={source:A?N:K,sourceHandle:A?v:H,target:A?K:N,targetHandle:A?H:v};C.connection=E;let b=D&&x&&(Z===l6.Strict?A&&y==="source"||!A&&y==="target":N!==K||v!==H);C.isValid=b&&O(E),C.toHandle=zT(N,y,v,T,Z,!0)}return C}var _U={onPointerDown:KS,isValid:BT};function AT({domNode:Q,panZoom:U,getTransform:Z,getViewScale:K}){let H=P2(Q);function Y({translateExtent:L,width:M,height:O,zoomStep:T=1,pannable:A=!0,zoomable:R=!0,inversePan:w=!1}){let P=(N)=>{if(N.sourceEvent.type!=="wheel"||!U)return;let v=Z(),D=N.sourceEvent.ctrlKey&&N9()?10:1,x=-N.sourceEvent.deltaY*(N.sourceEvent.deltaMode===1?0.05:N.sourceEvent.deltaMode?1:0.002)*T,E=v[2]*Math.pow(2,x*D);U.scaleTo(E)},V=[0,0],S=(N)=>{if(N.sourceEvent.type==="mousedown"||N.sourceEvent.type==="touchstart")V=[N.sourceEvent.clientX??N.sourceEvent.touches[0].clientX,N.sourceEvent.clientY??N.sourceEvent.touches[0].clientY]},C=(N)=>{let v=Z();if(N.sourceEvent.type!=="mousemove"&&N.sourceEvent.type!=="touchmove"||!U)return;let D=[N.sourceEvent.clientX??N.sourceEvent.touches[0].clientX,N.sourceEvent.clientY??N.sourceEvent.touches[0].clientY],x=[D[0]-V[0],D[1]-V[1]];V=D;let E=K()*Math.max(v[2],Math.log(v[2]))*(w?-1:1),u={x:v[0]-x[0]*E,y:v[1]-x[1]*E},b=[[0,0],[M,O]];U.setViewportConstrained({x:u.x,y:u.y,zoom:v[2]},b,L)},y=EJ().on("start",S).on("zoom",A?C:null).on("zoom.wheel",R?P:null);H.call(y,{})}function W(){H.on("zoom",null)}return{update:Y,destroy:W,pointer:a2}}var JU=(Q)=>({x:Q.x,y:Q.y,zoom:Q.k}),OK=({x:Q,y:U,zoom:Z})=>d8.translate(Q,U).scale(Z),c6=(Q,U)=>Q.target.closest(`.${U}`),MT=(Q,U)=>U===2&&Array.isArray(Q)&&Q.includes(2),HS=(Q)=>((Q*=2)<=1?Q*Q*Q:(Q-=2)*Q*Q+2)/2,IK=(Q,U=0,Z=HS,K=()=>{})=>{let H=typeof U==="number"&&U>0;if(!H)K();return H?Q.transition().duration(U).ease(Z).on("end",K):Q},TT=(Q)=>{let U=Q.ctrlKey&&N9()?10:1;return-Q.deltaY*(Q.deltaMode===1?0.05:Q.deltaMode?1:0.002)*U};function YS({zoomPanValues:Q,noWheelClassName:U,d3Selection:Z,d3Zoom:K,panOnScrollMode:H,panOnScrollSpeed:Y,zoomOnPinch:W,onPanZoomStart:L,onPanZoom:M,onPanZoomEnd:O}){return(T)=>{if(c6(T,U)){if(T.ctrlKey)T.preventDefault();return!1}T.preventDefault(),T.stopImmediatePropagation();let A=Z.property("__zoom").k||1;if(T.ctrlKey&&W){let S=a2(T),C=TT(T),y=A*Math.pow(2,C);K.scaleTo(Z,y,S,T);return}let R=T.deltaMode===1?20:1,w=H===h3.Vertical?0:T.deltaX*R,P=H===h3.Horizontal?0:T.deltaY*R;if(!N9()&&T.shiftKey&&H!==h3.Vertical)w=T.deltaY*R,P=0;K.translateBy(Z,-(w/A)*Y,-(P/A)*Y,{internal:!0});let V=JU(Z.property("__zoom"));if(clearTimeout(Q.panScrollTimeout),!Q.isPanScrolling)Q.isPanScrolling=!0,L?.(T,V);else M?.(T,V);Q.panScrollTimeout=setTimeout(()=>{O?.(T,V),Q.isPanScrolling=!1},150)}}function zS({noWheelClassName:Q,preventScrolling:U,d3ZoomHandler:Z}){return function(K,H){let Y=K.type==="wheel",W=!U&&Y&&!K.ctrlKey,L=c6(K,Q);if(K.ctrlKey&&Y&&L)K.preventDefault();if(W||L)return null;K.preventDefault(),Z.call(this,K,H)}}function WS({zoomPanValues:Q,onDraggingChange:U,onPanZoomStart:Z}){return(K)=>{if(K.sourceEvent?.internal)return;let H=JU(K.transform);if(Q.mouseButton=K.sourceEvent?.button||0,Q.isZoomingOrPanning=!0,Q.prevViewport=H,K.sourceEvent?.type==="mousedown")U(!0);if(Z)Z?.(K.sourceEvent,H)}}function LS({zoomPanValues:Q,panOnDrag:U,onPaneContextMenu:Z,onTransformChange:K,onPanZoom:H}){return(Y)=>{if(Q.usedRightMouseButton=!!(Z&&MT(U,Q.mouseButton??0)),!Y.sourceEvent?.sync)K([Y.transform.x,Y.transform.y,Y.transform.k]);if(H&&!Y.sourceEvent?.internal)H?.(Y.sourceEvent,JU(Y.transform))}}function BS({zoomPanValues:Q,panOnDrag:U,panOnScroll:Z,onDraggingChange:K,onPanZoomEnd:H,onPaneContextMenu:Y}){return(W)=>{if(W.sourceEvent?.internal)return;if(Q.isZoomingOrPanning=!1,Y&&MT(U,Q.mouseButton??0)&&!Q.usedRightMouseButton&&W.sourceEvent)Y(W.sourceEvent);if(Q.usedRightMouseButton=!1,K(!1),H){let L=JU(W.transform);Q.prevViewport=L,clearTimeout(Q.timerId),Q.timerId=setTimeout(()=>{H?.(W.sourceEvent,L)},Z?150:0)}}}function AS({panActivationKeyPressed:Q,zoomActivationKeyPressed:U,zoomOnScroll:Z,zoomOnPinch:K,panOnDrag:H,panOnScroll:Y,zoomOnDoubleClick:W,userSelectionActive:L,noWheelClassName:M,noPanClassName:O,lib:T,connectionInProgress:A}){return(R)=>{let w=U||Z,P=K&&R.ctrlKey,V=R.type==="wheel";if(R.button===1&&R.type==="mousedown"&&(c6(R,`${T}-flow__node`)||c6(R,`${T}-flow__edge`)||c6(R,`${T}-flow__selection`)||c6(R,`${T}-flow__nodesselection`)))return!0;if(!H&&!w&&!Y&&!W&&!K)return!1;if(L)return!1;if(A&&!V)return!1;if(c6(R,M)&&V)return!1;if(c6(R,O)&&(!V||Y&&V&&!U))return!1;if(!K&&R.ctrlKey&&V)return!1;if(!K&&R.type==="touchstart"&&R.touches?.length>1)return R.preventDefault(),!1;if(!w&&!Y&&!P&&V)return!1;if(!H&&(R.type==="mousedown"||R.type==="touchstart"))return!1;if(Array.isArray(H)&&!H.includes(R.button)&&R.type==="mousedown")return!1;let S=Array.isArray(H)&&H.includes(R.button)||!R.button||R.button<=1;return(!R.ctrlKey||V||Q)&&S}}function RT({domNode:Q,minZoom:U,maxZoom:Z,translateExtent:K,viewport:H,onPanZoom:Y,onPanZoomStart:W,onPanZoomEnd:L,onDraggingChange:M}){let O={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},T=Q.getBoundingClientRect(),A=[[0,0],[T.width,T.height]];(typeof ResizeObserver<"u"?new ResizeObserver((Q1)=>{let h=Q1[0];if(h)A=[[0,0],[h.contentRect.width,h.contentRect.height]]}):null)?.observe(Q);let w=EJ().extent(()=>A).scaleExtent([U,Z]).translateExtent(K),P=P2(Q).call(w);v({x:H.x,y:H.y,zoom:R9(H.zoom,U,Z)},[[0,0],[T.width,T.height]],K);let V=P.on("wheel.zoom"),S=P.on("dblclick.zoom");w.wheelDelta(TT);async function C(Q1,h){if(P)return new Promise((g)=>{w?.interpolate(h?.interpolate==="linear"?J3:l8).transform(IK(P,h?.duration,h?.ease,()=>g(!0)),Q1)});return!1}function y({noWheelClassName:Q1,noPanClassName:h,onPaneContextMenu:g,userSelectionActive:p,panOnScroll:c,panOnDrag:l,panOnScrollMode:o,panOnScrollSpeed:k,preventScrolling:t,zoomOnPinch:_1,zoomOnScroll:a,zoomOnDoubleClick:H1,panActivationKeyPressed:O1=!1,zoomActivationKeyPressed:L1,lib:T1,onTransformChange:G1,connectionInProgress:R1,paneClickDistance:f1,selectionOnDrag:z1}){if(p&&!O.isZoomingOrPanning)N();let C1=c&&!L1&&!p;w.clickDistance(z1?1/0:!e5(f1)||f1<0?0:f1);let b1=C1?YS({zoomPanValues:O,noWheelClassName:Q1,d3Selection:P,d3Zoom:w,panOnScrollMode:o,panOnScrollSpeed:k,zoomOnPinch:_1,onPanZoomStart:W,onPanZoom:Y,onPanZoomEnd:L}):zS({noWheelClassName:Q1,preventScrolling:t,d3ZoomHandler:V});P.on("wheel.zoom",b1,{passive:!1});let c1=WS({zoomPanValues:O,onDraggingChange:M,onPanZoomStart:W});w.on("start",c1);let k1=LS({zoomPanValues:O,panOnDrag:l,onPaneContextMenu:!!g,onPanZoom:Y,onTransformChange:G1});w.on("zoom",k1);let A1=BS({zoomPanValues:O,panOnDrag:l,panOnScroll:c,onPaneContextMenu:g,onPanZoomEnd:L,onDraggingChange:M});w.on("end",A1);let e1=AS({panActivationKeyPressed:O1,zoomActivationKeyPressed:L1,panOnDrag:l,zoomOnScroll:a,panOnScroll:c,zoomOnDoubleClick:H1,zoomOnPinch:_1,userSelectionActive:p,noPanClassName:h,noWheelClassName:Q1,lib:T1,connectionInProgress:R1});if(w.filter(e1),H1)P.on("dblclick.zoom",S);else P.on("dblclick.zoom",null)}function N(){w.on("zoom",null)}async function v(Q1,h,g){let p=OK(Q1),c=w?.constrain()(p,h,g);if(c)await C(c);return c}async function D(Q1,h){let g=OK(Q1);return await C(g,h),g}function x(Q1){if(P){let h=OK(Q1),g=P.property("__zoom");if(g.k!==Q1.zoom||g.x!==Q1.x||g.y!==Q1.y)w?.transform(P,h,null,{sync:!0})}}function E(){let Q1=P?bJ(P.node()):{x:0,y:0,k:1};return{x:Q1.x,y:Q1.y,zoom:Q1.k}}async function u(Q1,h){if(P)return new Promise((g)=>{w?.interpolate(h?.interpolate==="linear"?J3:l8).scaleTo(IK(P,h?.duration,h?.ease,()=>g(!0)),Q1)});return!1}async function b(Q1,h){if(P)return new Promise((g)=>{w?.interpolate(h?.interpolate==="linear"?J3:l8).scaleBy(IK(P,h?.duration,h?.ease,()=>g(!0)),Q1)});return!1}function m(Q1){w?.scaleExtent(Q1)}function s(Q1){w?.translateExtent(Q1)}function U1(Q1){let h=!e5(Q1)||Q1<0?0:Q1;w?.clickDistance(h)}return{update:y,destroy:N,setViewport:D,setViewportConstrained:v,getViewport:E,scaleTo:u,scaleBy:b,setScaleExtent:m,setTranslateExtent:s,syncViewport:x,setClickDistance:U1}}var x3;(function(Q){Q.Line="line",Q.Handle="handle"})(x3||(x3={}));var OT=["top-left","top-right","bottom-left","bottom-right"],IT=["top","right","bottom","left"];function MS({width:Q,prevWidth:U,height:Z,prevHeight:K,affectsX:H,affectsY:Y}){let W=Q-U,L=Z-K,M=[W>0?1:W<0?-1:0,L>0?1:L<0?-1:0];if(W&&H)M[0]=M[0]*-1;if(L&&Y)M[1]=M[1]*-1;return M}function cM(Q){let U=Q.includes("right")||Q.includes("left"),Z=Q.includes("bottom")||Q.includes("top"),K=Q.includes("left"),H=Q.includes("top");return{isHorizontal:U,isVertical:Z,affectsX:K,affectsY:H}}function g6(Q,U){return Math.max(0,U-Q)}function p6(Q,U){return Math.max(0,Q-U)}function gq(Q,U,Z){return Math.max(0,U-Q,Q-Z)}function lM(Q,U){return Q?!U:U}function TS(Q,U,Z,K,H,Y,W,L){let{affectsX:M,affectsY:O}=U,{isHorizontal:T,isVertical:A}=U,R=T&&A,{xSnapped:w,ySnapped:P}=Z,{minWidth:V,maxWidth:S,minHeight:C,maxHeight:y}=K,{x:N,y:v,width:D,height:x,aspectRatio:E}=Q,u=Math.floor(T?w-Q.pointerX:0),b=Math.floor(A?P-Q.pointerY:0),m=D+(M?-u:u),s=x+(O?-b:b),U1=-Y[0]*D,Q1=-Y[1]*x,h=gq(m,V,S),g=gq(s,C,y);if(W){let l=0,o=0;if(M&&u<0)l=g6(N+u+U1,W[0][0]);else if(!M&&u>0)l=p6(N+m+U1,W[1][0]);if(O&&b<0)o=g6(v+b+Q1,W[0][1]);else if(!O&&b>0)o=p6(v+s+Q1,W[1][1]);h=Math.max(h,l),g=Math.max(g,o)}if(L){let l=0,o=0;if(M&&u>0)l=p6(N+u,L[0][0]);else if(!M&&u<0)l=g6(N+m,L[1][0]);if(O&&b>0)o=p6(v+b,L[0][1]);else if(!O&&b<0)o=g6(v+s,L[1][1]);h=Math.max(h,l),g=Math.max(g,o)}if(H){if(T){let l=gq(m/E,C,y)*E;if(h=Math.max(h,l),W){let o=0;if(!M&&!O||M&&!O&&R)o=p6(v+Q1+m/E,W[1][1])*E;else o=g6(v+Q1+(M?u:-u)/E,W[0][1])*E;h=Math.max(h,o)}if(L){let o=0;if(!M&&!O||M&&!O&&R)o=g6(v+m/E,L[1][1])*E;else o=p6(v+(M?u:-u)/E,L[0][1])*E;h=Math.max(h,o)}}if(A){let l=gq(s*E,V,S)/E;if(g=Math.max(g,l),W){let o=0;if(!M&&!O||O&&!M&&R)o=p6(N+s*E+U1,W[1][0])/E;else o=g6(N+(O?b:-b)*E+U1,W[0][0])/E;g=Math.max(g,o)}if(L){let o=0;if(!M&&!O||O&&!M&&R)o=g6(N+s*E,L[1][0])/E;else o=p6(N+(O?b:-b)*E,L[0][0])/E;g=Math.max(g,o)}}}if(b=b+(b<0?g:-g),u=u+(u<0?h:-h),H)if(R)if(m>s*E)b=(lM(M,O)?-u:u)/E;else u=(lM(M,O)?-b:b)*E;else if(T)b=u/E,O=M;else u=b*E,M=O;let p=M?N+u:N,c=O?v+b:v;return{width:D+(M?-u:u),height:x+(O?-b:b),x:Y[0]*u*(!M?1:-1)+p,y:Y[1]*b*(!O?1:-1)+c}}var wT={width:0,height:0,x:0,y:0},RS={...wT,pointerX:0,pointerY:0,aspectRatio:1};function OS(Q,U,Z){let K=U.position.x+Q.position.x,H=U.position.y+Q.position.y,Y=Q.measured.width??0,W=Q.measured.height??0,L=Z[0]*Y,M=Z[1]*W;return[[K-L,H-M],[K+Y-L,H+W-M]]}function PT({domNode:Q,nodeId:U,getStoreItems:Z,onChange:K,onEnd:H}){let Y=P2(Q),W={controlDirection:cM("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function L({controlPosition:O,boundaries:T,keepAspectRatio:A,resizeDirection:R,onResizeStart:w,onResize:P,onResizeEnd:V,shouldResize:S}){let C={...wT},y={...RS};W={boundaries:T,resizeDirection:R,keepAspectRatio:A,controlDirection:cM(O)};let N=void 0,v=null,D=[],x=void 0,E=void 0,u=void 0,b=TJ().on("start",(m)=>{let{nodeLookup:s,transform:U1,snapGrid:Q1,snapToGrid:h,nodeOrigin:g,paneDomNode:p}=Z();if(N=s.get(U),!N)return;v=p?.getBoundingClientRect()??null;let{xSnapped:c,ySnapped:l}=hJ(m.sourceEvent,{transform:U1,snapGrid:Q1,snapToGrid:h,containerBounds:v});if(C={width:N.measured.width??0,height:N.measured.height??0,x:N.position.x??0,y:N.position.y??0},y={...C,pointerX:c,pointerY:l,aspectRatio:C.width/C.height},x=void 0,E=o8(N.extent)?N.extent:void 0,N.parentId&&(N.extent==="parent"||N.expandParent))x=s.get(N.parentId);if(x&&N.extent==="parent")E=[[0,0],[x.measured.width,x.measured.height]];D=[],u=void 0;for(let[o,k]of s)if(k.parentId===U){if(D.push({id:o,position:{...k.position},extent:k.extent}),k.extent==="parent"||k.expandParent){let t=OS(k,N,k.origin??g);if(u)u=[[Math.min(t[0][0],u[0][0]),Math.min(t[0][1],u[0][1])],[Math.max(t[1][0],u[1][0]),Math.max(t[1][1],u[1][1])]];else u=t}}w?.(m,{...C})}).on("drag",(m)=>{let{transform:s,snapGrid:U1,snapToGrid:Q1,nodeOrigin:h}=Z(),g=hJ(m.sourceEvent,{transform:s,snapGrid:U1,snapToGrid:Q1,containerBounds:v}),p=[];if(!N)return;let{x:c,y:l,width:o,height:k}=C,t={},_1=N.origin??h,{width:a,height:H1,x:O1,y:L1}=TS(y,W.controlDirection,g,W.boundaries,W.keepAspectRatio,_1,E,u),T1=a!==o,G1=H1!==k,R1=O1!==c&&T1,f1=L1!==l&&G1;if(!R1&&!f1&&!T1&&!G1)return;let z1={prevValues:{...C},startX:y.x,startY:y.y,childNodes:D.map((k1)=>({...k1,position:{...k1.position}}))};if(R1||f1||_1[0]===1||_1[1]===1){if(t.x=R1?O1:C.x,t.y=f1?L1:C.y,C.x=t.x,C.y=t.y,D.length>0){let k1=O1-c,A1=L1-l;for(let e1 of D)e1.position={x:e1.position.x-k1+_1[0]*(a-o),y:e1.position.y-A1+_1[1]*(H1-k)},p.push(e1)}}if(T1||G1)t.width=T1&&(!W.resizeDirection||W.resizeDirection==="horizontal")?a:C.width,t.height=G1&&(!W.resizeDirection||W.resizeDirection==="vertical")?H1:C.height,C.width=t.width,C.height=t.height;if(x&&N.expandParent){let k1=_1[0]*(t.width??0);if(t.x&&t.x<k1)C.x=k1,y.x=y.x-(t.x-k1);let A1=_1[1]*(t.height??0);if(t.y&&t.y<A1)C.y=A1,y.y=y.y-(t.y-A1)}let C1=MS({width:C.width,prevWidth:o,height:C.height,prevHeight:k,affectsX:W.controlDirection.affectsX,affectsY:W.controlDirection.affectsY}),b1={...C,direction:C1};if(S?.(m,b1)===!1){C=z1.prevValues,y.x=z1.startX,y.y=z1.startY,D.forEach((k1,A1)=>{k1.position=z1.childNodes[A1].position});return}P?.(m,b1),K(t,p)}).on("end",(m)=>{V?.(m,{...C}),H?.({...C})});Y.call(b)}function M(){Y.on(".drag",null)}return{update:L,destroy:M}}var jT=s0(B4(),1),VT=s0(CT(),1);var fT=(Q)=>{let U,Z=new Set,K=(T,A)=>{let R=typeof T==="function"?T(U):T;if(!Object.is(R,U)){let w=U;U=(A!=null?A:typeof R!=="object"||R===null)?R:Object.assign({},U,R),Z.forEach((P)=>P(U,w))}},H=()=>U,M={setState:K,getState:H,getInitialState:()=>O,subscribe:(T)=>{return Z.add(T),()=>Z.delete(T)},destroy:()=>{if((import.meta.env?import.meta.env.MODE:void 0)!=="production")console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected.");Z.clear()}},O=U=Q(K,H,M);return M},ST=(Q)=>Q?fT(Q):fT;var{useDebugValue:PS}=jT.default,{useSyncExternalStoreWithSelector:NS}=VT.default,CS=(Q)=>Q;function rK(Q,U=CS,Z){let K=NS(Q.subscribe,Q.getState,Q.getServerState||Q.getInitialState,U,Z);return PS(K),K}var vT=(Q,U)=>{let Z=ST(Q),K=(H,Y=U)=>rK(Z,H,Y);return Object.assign(K,Z),K},yT=(Q,U)=>Q?vT(Q,U):vT;function i0(Q,U){if(Object.is(Q,U))return!0;if(typeof Q!=="object"||Q===null||typeof U!=="object"||U===null)return!1;if(Q instanceof Map&&U instanceof Map){if(Q.size!==U.size)return!1;for(let[K,H]of Q)if(!Object.is(H,U.get(K)))return!1;return!0}if(Q instanceof Set&&U instanceof Set){if(Q.size!==U.size)return!1;for(let K of Q)if(!U.has(K))return!1;return!0}let Z=Object.keys(Q);if(Z.length!==Object.keys(U).length)return!1;for(let K of Z)if(!Object.prototype.hasOwnProperty.call(U,K)||!Object.is(Q[K],U[K]))return!1;return!0}var GR=s0(iF(),1),GU=W1.createContext(null),fS=GU.Provider,ZR=F5.error001("react");function L0(Q,U){let Z=W1.useContext(GU);if(Z===null)throw Error(ZR);return rK(Z,Q,U)}function d0(){let Q=W1.useContext(GU);if(Q===null)throw Error(ZR);return W1.useMemo(()=>({getState:Q.getState,setState:Q.setState,subscribe:Q.subscribe}),[Q])}var kT={display:"none"},SS={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},FR="react-flow__node-desc",XR="react-flow__edge-desc",vS="react-flow__aria-live",jS=(Q)=>Q.ariaLiveMessage,VS=(Q)=>Q.ariaLabelConfig;function yS({rfId:Q}){let U=L0(jS);return K1.jsx("div",{id:`${vS}-${Q}`,"aria-live":"assertive","aria-atomic":"true",style:SS,children:U})}function kS({rfId:Q,disableKeyboardA11y:U}){let Z=L0(VS);return K1.jsxs(K1.Fragment,{children:[K1.jsx("div",{id:`${FR}-${Q}`,style:kT,children:U?Z["node.a11yDescription.default"]:Z["node.a11yDescription.keyboardDisabled"]}),K1.jsx("div",{id:`${XR}-${Q}`,style:kT,children:Z["edge.a11yDescription.default"]}),!U&&K1.jsx(yS,{rfId:Q})]})}var q3=W1.forwardRef(({position:Q="top-left",children:U,className:Z,style:K,...H},Y)=>{let W=`${Q}`.split("-");return K1.jsx("div",{className:_2(["react-flow__panel",Z,...W]),style:K,ref:Y,...H,children:U})});q3.displayName="Panel";var DT="https://reactflow.dev/attribution";function DS({proOptions:Q,position:U="bottom-right"}){if(W1.useEffect(()=>{eM("react")},[]),Q?.hideAttribution)return null;return K1.jsx(q3,{position:U,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${DT}`,children:K1.jsx("a",{href:DT,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}var uS=(Q)=>{let U=[],Z=[];for(let[,K]of Q.nodeLookup)if(K.selected)U.push(K.internals.userNode);for(let[,K]of Q.edgeLookup)if(K.selected)Z.push(K);return{selectedNodes:U,selectedEdges:Z}},$U=(Q)=>Q.id;function bS(Q,U){return i0(Q.selectedNodes.map($U),U.selectedNodes.map($U))&&i0(Q.selectedEdges.map($U),U.selectedEdges.map($U))}function ES({onSelectionChange:Q}){let U=d0(),{selectedNodes:Z,selectedEdges:K}=L0(uS,bS);return W1.useEffect(()=>{let H={nodes:Z,edges:K};Q?.(H),U.getState().onSelectionChangeHandlers.forEach((Y)=>Y(H))},[Z,K,Q]),null}var hS=(Q)=>!!Q.onSelectionChangeHandlers;function xS({onSelectionChange:Q}){let U=L0(hS);if(Q||U)return K1.jsx(ES,{onSelectionChange:Q});return null}var KR=[0,0],mS={x:0,y:0,zoom:1},gS=["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"],uT=[...gS,"rfId"],pS=(Q)=>({setNodes:Q.setNodes,setEdges:Q.setEdges,setMinZoom:Q.setMinZoom,setMaxZoom:Q.setMaxZoom,setTranslateExtent:Q.setTranslateExtent,setNodeExtent:Q.setNodeExtent,reset:Q.reset,setDefaultNodesAndEdges:Q.setDefaultNodesAndEdges}),bT={translateExtent:O9,nodeOrigin:KR,minZoom:0.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function cS(Q){let{setNodes:U,setEdges:Z,setMinZoom:K,setMaxZoom:H,setTranslateExtent:Y,setNodeExtent:W,reset:L,setDefaultNodesAndEdges:M}=L0(pS,i0),O=d0();W1.useEffect(()=>{return M(Q.defaultNodes,Q.defaultEdges),()=>{T.current=bT,L()}},[]);let T=W1.useRef(bT);return W1.useEffect(()=>{for(let A of uT){let R=Q[A],w=T.current[A];if(R===w)continue;if(typeof Q[A]>"u")continue;if(A==="nodes")U(R);else if(A==="edges")Z(R);else if(A==="minZoom")K(R);else if(A==="maxZoom")H(R);else if(A==="translateExtent")Y(R);else if(A==="nodeExtent")W(R);else if(A==="ariaLabelConfig")O.setState({ariaLabelConfig:nM(R)});else if(A==="fitView")O.setState({fitViewQueued:R});else if(A==="fitViewOptions")O.setState({fitViewOptions:R});else O.setState({[A]:R})}T.current=Q},uT.map((A)=>Q[A])),null}function ET(){if(typeof window>"u"||!window.matchMedia)return null;return window.matchMedia("(prefers-color-scheme: dark)")}function lS(Q){let[U,Z]=W1.useState(Q==="system"?null:Q);return W1.useEffect(()=>{if(Q!=="system"){Z(Q);return}let K=ET(),H=()=>Z(K?.matches?"dark":"light");return H(),K?.addEventListener("change",H),()=>{K?.removeEventListener("change",H)}},[Q]),U!==null?U:ET()?.matches?"dark":"light"}var hT=typeof document<"u"?document:null;function cJ(Q=null,U={target:hT,actInsideInputWithModifier:!0}){let[Z,K]=W1.useState(!1),H=W1.useRef(!1),Y=W1.useRef(new Set([])),[W,L]=W1.useMemo(()=>{if(Q!==null){let O=(Array.isArray(Q)?Q:[Q]).filter((A)=>typeof A==="string").map((A)=>A.replace(/\+/g,`
|
|
241
|
+
%cYou can ignore this warning if you are subscribed.`,"font-style: italic;")},1000)}function EK(Q){return Q===null?null:Q?"valid":"invalid"}function hJ(Q,{snapGrid:U=[0,0],snapToGrid:Z=!1,transform:K,containerBounds:H}){let{x:Y,y:W}=_4(Q),L=P9({x:Y-(H?.left??0),y:W-(H?.top??0)},K),{x:M,y:O}=Z?w9(L,U):L;return{xSnapped:M,ySnapped:O,...L}}var rq=(Q)=>({width:Q.offsetWidth,height:Q.offsetHeight}),hK=(Q)=>Q?.getRootNode?.()||window?.document,rf=["INPUT","SELECT","TEXTAREA"];function xK(Q){let U=Q.composedPath?.()?.[0]||Q.target;if(U?.nodeType!==1)return!1;return rf.includes(U.nodeName)||U.hasAttribute("contenteditable")||!!U.closest(".nokey")}var mK=(Q)=>("clientX"in Q),_4=(Q,U)=>{let Z=mK(Q),K=Z?Q.clientX:Q.touches?.[0].clientX,H=Z?Q.clientY:Q.touches?.[0].clientY;return{x:K-(U?.left??0),y:H-(U?.top??0)}},DM=(Q,U,Z,K,H)=>{let Y=U.querySelectorAll(`.${Q}`);if(!Y||!Y.length)return null;return Array.from(Y).map((W)=>{let L=W.getBoundingClientRect();return{id:W.getAttribute("data-handleid"),type:Q,nodeId:H,position:W.getAttribute("data-handlepos"),x:(L.left-Z.left)/K,y:(L.top-Z.top)/K,...rq(W)}})};function aq({sourceX:Q,sourceY:U,targetX:Z,targetY:K,sourceControlX:H,sourceControlY:Y,targetControlX:W,targetControlY:L}){let M=Q*0.125+H*0.375+W*0.375+Z*0.125,O=U*0.125+Y*0.375+L*0.375+K*0.125,T=Math.abs(M-Q),A=Math.abs(O-U);return[M,O,T,A]}function mq(Q,U){if(Q>=0)return 0.5*Q;return U*25*Math.sqrt(-Q)}function uM({pos:Q,x1:U,y1:Z,x2:K,y2:H,c:Y}){switch(Q){case E1.Left:return[U-mq(U-K,Y),Z];case E1.Right:return[U+mq(K-U,Y),Z];case E1.Top:return[U,Z-mq(Z-H,Y)];case E1.Bottom:return[U,Z+mq(H-Z,Y)]}}function sq({sourceX:Q,sourceY:U,sourcePosition:Z=E1.Bottom,targetX:K,targetY:H,targetPosition:Y=E1.Top,curvature:W=0.25}){let[L,M]=uM({pos:Z,x1:Q,y1:U,x2:K,y2:H,c:W}),[O,T]=uM({pos:Y,x1:K,y1:H,x2:Q,y2:U,c:W}),[A,R,w,P]=aq({sourceX:Q,sourceY:U,targetX:K,targetY:H,sourceControlX:L,sourceControlY:M,targetControlX:O,targetControlY:T});return[`M${Q},${U} C${L},${M} ${O},${T} ${K},${H}`,A,R,w,P]}function gK({sourceX:Q,sourceY:U,targetX:Z,targetY:K}){let H=Math.abs(Z-Q)/2,Y=Z<Q?Z+H:Z-H,W=Math.abs(K-U)/2,L=K<U?K+W:K-W;return[Y,L,H,W]}function _T({sourceNode:Q,targetNode:U,selected:Z=!1,zIndex:K=0,elevateOnSelect:H=!1,zIndexMode:Y="basic"}){if(Y==="manual")return K;let W=H&&Z?K+1000:K,L=Math.max(Q.parentId||H&&Q.selected?Q.internals.z:0,U.parentId||H&&U.selected?U.internals.z:0);return W+L}function JT({sourceNode:Q,targetNode:U,width:Z,height:K,transform:H}){let Y=iq(pq(Q),pq(U));if(Y.x===Y.x2)Y.x2+=1;if(Y.y===Y.y2)Y.y2+=1;let W={x:-H[0]/H[2],y:-H[1]/H[2],width:Z/H[2],height:K/H[2]};return mJ(W,dq(Y))>0}var af=({source:Q,sourceHandle:U,target:Z,targetHandle:K})=>`xy-edge__${Q}${U||""}-${Z}${K||""}`,sf=(Q,U)=>{return U.some((Z)=>Z.source===Q.source&&Z.target===Q.target&&(Z.sourceHandle===Q.sourceHandle||!Z.sourceHandle&&!Q.sourceHandle)&&(Z.targetHandle===Q.targetHandle||!Z.targetHandle&&!Q.targetHandle))},$T=(Q,U,Z={})=>{if(!Q.source||!Q.target)return Z.onError?.("006",F5.error006()),U;let K=Z.getEdgeId||af,H;if(fK(Q))H={...Q};else H={...Q,id:K(Q)};if(sf(H,U))return U;if(H.sourceHandle===null)delete H.sourceHandle;if(H.targetHandle===null)delete H.targetHandle;return U.concat(H)};function tq({sourceX:Q,sourceY:U,targetX:Z,targetY:K}){let[H,Y,W,L]=gK({sourceX:Q,sourceY:U,targetX:Z,targetY:K});return[`M ${Q},${U}L ${Z},${K}`,H,Y,W,L]}var bM={[E1.Left]:{x:-1,y:0},[E1.Right]:{x:1,y:0},[E1.Top]:{x:0,y:-1},[E1.Bottom]:{x:0,y:1}},tf=({source:Q,sourcePosition:U=E1.Bottom,target:Z})=>{if(U===E1.Left||U===E1.Right)return Q.x<Z.x?{x:1,y:0}:{x:-1,y:0};return Q.y<Z.y?{x:0,y:1}:{x:0,y:-1}},EM=(Q,U)=>Math.sqrt(Math.pow(U.x-Q.x,2)+Math.pow(U.y-Q.y,2));function of({source:Q,sourcePosition:U=E1.Bottom,target:Z,targetPosition:K=E1.Top,center:H,offset:Y,stepPosition:W}){let L=bM[U],M=bM[K],O={x:Q.x+L.x*Y,y:Q.y+L.y*Y},T={x:Z.x+M.x*Y,y:Z.y+M.y*Y},A=tf({source:O,sourcePosition:U,target:T}),R=A.x!==0?"x":"y",w=A[R],P=[],V,S,C={x:0,y:0},y={x:0,y:0},[,,N,v]=gK({sourceX:Q.x,sourceY:Q.y,targetX:Z.x,targetY:Z.y});if(L[R]*M[R]===-1){if(R==="x")V=H.x??O.x+(T.x-O.x)*W,S=H.y??(O.y+T.y)/2;else V=H.x??(O.x+T.x)/2,S=H.y??O.y+(T.y-O.y)*W;let u=[{x:V,y:O.y},{x:V,y:T.y}],b=[{x:O.x,y:S},{x:T.x,y:S}];if(L[R]===w)P=R==="x"?u:b;else P=R==="x"?b:u}else{let u=[{x:O.x,y:T.y}],b=[{x:T.x,y:O.y}];if(R==="x")P=L.x===w?b:u;else P=L.y===w?u:b;if(U===K){let h=Math.abs(Q[R]-Z[R]);if(h<=Y){let g=Math.min(Y-1,Y-h);if(L[R]===w)C[R]=(O[R]>Q[R]?-1:1)*g;else y[R]=(T[R]>Z[R]?-1:1)*g}}if(U!==K){let h=R==="x"?"y":"x",g=L[R]===M[h],p=O[h]>T[h],c=O[h]<T[h];if(L[R]===1&&(!g&&p||g&&c)||L[R]!==1&&(!g&&c||g&&p))P=R==="x"?u:b}let m={x:O.x+C.x,y:O.y+C.y},s={x:T.x+y.x,y:T.y+y.y},U1=Math.max(Math.abs(m.x-P[0].x),Math.abs(s.x-P[0].x)),Q1=Math.max(Math.abs(m.y-P[0].y),Math.abs(s.y-P[0].y));if(U1>=Q1)V=(m.x+s.x)/2,S=P[0].y;else V=P[0].x,S=(m.y+s.y)/2}let D={x:O.x+C.x,y:O.y+C.y},x={x:T.x+y.x,y:T.y+y.y};return[[Q,...D.x!==P[0].x||D.y!==P[0].y?[D]:[],...P,...x.x!==P[P.length-1].x||x.y!==P[P.length-1].y?[x]:[],Z],V,S,N,v]}function nf(Q,U,Z,K){let H=Math.min(EM(Q,U)/2,EM(U,Z)/2,K),{x:Y,y:W}=U;if(Q.x===Y&&Y===Z.x||Q.y===W&&W===Z.y)return`L${Y} ${W}`;if(Q.y===W){let O=Q.x<Z.x?-1:1,T=Q.y<Z.y?1:-1;return`L ${Y+H*O},${W}Q ${Y},${W} ${Y},${W+H*T}`}let L=Q.x<Z.x?1:-1,M=Q.y<Z.y?-1:1;return`L ${Y},${W+H*M}Q ${Y},${W} ${Y+H*L},${W}`}function pJ({sourceX:Q,sourceY:U,sourcePosition:Z=E1.Bottom,targetX:K,targetY:H,targetPosition:Y=E1.Top,borderRadius:W=5,centerX:L,centerY:M,offset:O=20,stepPosition:T=0.5}){let[A,R,w,P,V]=of({source:{x:Q,y:U},sourcePosition:Z,target:{x:K,y:H},targetPosition:Y,center:{x:L,y:M},offset:O,stepPosition:T}),S=`M${A[0].x} ${A[0].y}`;for(let C=1;C<A.length-1;C++)S+=nf(A[C-1],A[C],A[C+1],W);return S+=`L${A[A.length-1].x} ${A[A.length-1].y}`,[S,R,w,P,V]}function hM(Q){return Q&&!!(Q.internals.handleBounds||Q.handles?.length)&&!!(Q.measured.width||Q.width||Q.initialWidth)}function QT(Q){let{sourceNode:U,targetNode:Z}=Q;if(!hM(U)||!hM(Z))return null;let K=U.internals.handleBounds||xM(U.handles),H=Z.internals.handleBounds||xM(Z.handles),Y=mM(K?.source??[],Q.sourceHandle),W=mM(Q.connectionMode===l6.Strict?H?.target??[]:(H?.target??[]).concat(H?.source??[]),Q.targetHandle);if(!Y||!W)return Q.onError?.("008",F5.error008(!Y?"source":"target",{id:Q.id,sourceHandle:Q.sourceHandle,targetHandle:Q.targetHandle})),null;let L=Y?.position||E1.Bottom,M=W?.position||E1.Top,O=i6(U,Y,L),T=i6(Z,W,M);return{sourceX:O.x,sourceY:O.y,targetX:T.x,targetY:T.y,sourcePosition:L,targetPosition:M}}function xM(Q){if(!Q)return null;let U=[],Z=[];for(let K of Q)if(K.width=K.width??1,K.height=K.height??1,K.type==="source")U.push(K);else if(K.type==="target")Z.push(K);return{source:U,target:Z}}function i6(Q,U,Z=E1.Left,K=!1){let H=(U?.x??0)+Q.internals.positionAbsolute.x,Y=(U?.y??0)+Q.internals.positionAbsolute.y,{width:W,height:L}=U??J4(Q);if(K)return{x:H+W/2,y:Y+L/2};switch(U?.position??Z){case E1.Top:return{x:H+W/2,y:Y};case E1.Right:return{x:H+W,y:Y+L/2};case E1.Bottom:return{x:H+W/2,y:Y+L};case E1.Left:return{x:H,y:Y+L/2}}}function mM(Q,U){if(!Q)return null;return(!U?Q[0]:Q.find((Z)=>Z.id===U))||null}function oq(Q,U){if(!Q)return"";if(typeof Q==="string")return Q;return`${U?`${U}__`:""}${Object.keys(Q).sort().map((K)=>`${K}=${Q[K]}`).join("&")}`}function qT(Q,{id:U,defaultColor:Z,defaultMarkerStart:K,defaultMarkerEnd:H}){let Y=new Set;return Q.reduce((W,L)=>{return[L.markerStart||K,L.markerEnd||H].forEach((M)=>{if(M&&typeof M==="object"){let O=oq(M,U);if(!Y.has(O))W.push({id:O,color:M.color||Z,...M}),Y.add(O)}}),W},[]).sort((W,L)=>W.id.localeCompare(L.id))}function UT(Q,U,Z,K,H){let Y=0.5;if(H==="start")Y=0;else if(H==="end")Y=1;let W=[(Q.x+Q.width*Y)*U.zoom+U.x,Q.y*U.zoom+U.y-K],L=[-100*Y,-100];switch(Z){case E1.Right:W=[(Q.x+Q.width)*U.zoom+U.x+K,(Q.y+Q.height*Y)*U.zoom+U.y],L=[0,-100*Y];break;case E1.Bottom:W[1]=(Q.y+Q.height)*U.zoom+U.y+K,L[1]=0;break;case E1.Left:W=[Q.x*U.zoom+U.x-K,(Q.y+Q.height*Y)*U.zoom+U.y],L=[-100,-100*Y];break}return`translate(${W[0]}px, ${W[1]}px) translate(${L[0]}%, ${L[1]}%)`}var GT=1000,ef=10,pK={nodeOrigin:[0,0],nodeExtent:O9,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},_S={...pK,checkEquality:!0};function cK(Q,U){let Z={...Q};for(let K in U)if(U[K]!==void 0)Z[K]=U[K];return Z}function ZT(Q,U,Z){let K=cK(pK,Z);for(let H of Q.values())if(H.parentId)iK(H,Q,U,K);else{let Y=xJ(H,K.nodeOrigin),W=o8(H.extent)?H.extent:K.nodeExtent,L=s8(Y,W,J4(H));H.internals.positionAbsolute=L}}function JS(Q,U){if(!Q.handles)return!Q.measured?void 0:U?.internals.handleBounds;let Z=[],K=[];for(let H of Q.handles){let Y={id:H.id,width:H.width??1,height:H.height??1,nodeId:Q.id,x:H.x,y:H.y,position:H.position,type:H.type};if(H.type==="source")Z.push(Y);else if(H.type==="target")K.push(Y)}return{source:Z,target:K}}function lK(Q){return Q==="manual"}function nq(Q,U,Z,K={}){let H=cK(_S,K),Y={i:0},W=new Map(U),L=H?.elevateNodesOnSelect&&!lK(H.zIndexMode)?GT:0,M=Q.length>0,O=!1;U.clear(),Z.clear();for(let T of Q){let A=W.get(T.id);if(H.checkEquality&&T===A?.internals.userNode)U.set(T.id,A);else{let R=xJ(T,H.nodeOrigin),w=o8(T.extent)?T.extent:H.nodeExtent,P=s8(R,w,J4(T));A={...H.defaults,...T,measured:{width:T.measured?.width,height:T.measured?.height},internals:{positionAbsolute:P,handleBounds:JS(T,A),z:FT(T,L,H.zIndexMode),userNode:T}},U.set(T.id,A)}if((A.measured===void 0||A.measured.width===void 0||A.measured.height===void 0)&&!A.hidden)M=!1;if(T.parentId)iK(A,U,Z,K,Y);O||=T.selected??!1}return{nodesInitialized:M,hasSelectedNodes:O}}function $S(Q,U){if(!Q.parentId)return;let Z=U.get(Q.parentId);if(Z)Z.set(Q.id,Q);else U.set(Q.parentId,new Map([[Q.id,Q]]))}function iK(Q,U,Z,K,H){let{elevateNodesOnSelect:Y,nodeOrigin:W,nodeExtent:L,zIndexMode:M}=cK(pK,K),O=Q.parentId,T=U.get(O);if(!T){console.warn(`Parent node ${O} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}if($S(Q,Z),H&&!T.parentId&&T.internals.rootParentIndex===void 0&&M==="auto")T.internals.rootParentIndex=++H.i,T.internals.z=T.internals.z+H.i*ef;if(H&&T.internals.rootParentIndex!==void 0)H.i=T.internals.rootParentIndex;let A=Y&&!lK(M)?GT:0,{x:R,y:w,z:P}=QS(Q,T,W,L,A,M),{positionAbsolute:V}=Q.internals,S=R!==V.x||w!==V.y;if(S||P!==Q.internals.z)U.set(Q.id,{...Q,internals:{...Q.internals,positionAbsolute:S?{x:R,y:w}:V,z:P}})}function FT(Q,U,Z){let K=e5(Q.zIndex)?Q.zIndex:0;if(lK(Z))return K;return K+(Q.selected?U:0)}function QS(Q,U,Z,K,H,Y){let{x:W,y:L}=U.internals.positionAbsolute,M=J4(Q),O=xJ(Q,Z),T=o8(Q.extent)?s8(O,Q.extent,M):O,A=s8({x:W+T.x,y:L+T.y},K,M);if(Q.extent==="parent")A=sM(A,M,U);let R=FT(Q,H,Y),w=U.internals.z??0;return{x:A.x,y:A.y,z:w>=R?w+1:R}}function eq(Q,U,Z,K=[0,0]){let H=[],Y=new Map;for(let W of Q){let L=U.get(W.parentId);if(!L)continue;let M=Y.get(W.parentId)?.expandedRect??I9(L),O=VK(M,W.rect);Y.set(W.parentId,{expandedRect:O,parent:L})}if(Y.size>0)Y.forEach(({expandedRect:W,parent:L},M)=>{let O=L.internals.positionAbsolute,T=J4(L),A=L.origin??K,R=W.x<O.x?Math.round(Math.abs(O.x-W.x)):0,w=W.y<O.y?Math.round(Math.abs(O.y-W.y)):0,P=Math.max(T.width,Math.round(W.width)),V=Math.max(T.height,Math.round(W.height)),S=(P-T.width)*A[0],C=(V-T.height)*A[1];if(R>0||w>0||S||C)H.push({id:M,type:"position",position:{x:L.position.x-R+S,y:L.position.y-w+C}}),Z.get(M)?.forEach((y)=>{if(!Q.some((N)=>N.id===y.id))H.push({id:y.id,type:"position",position:{x:y.position.x+R,y:y.position.y+w}})});if(T.width<W.width||T.height<W.height||R||w)H.push({id:M,type:"dimensions",setAttributes:!0,dimensions:{width:P+(R?A[0]*R-S:0),height:V+(w?A[1]*w-C:0)}})});return H}function XT(Q,U,Z,K,H,Y,W){let L=K?.querySelector(".xyflow__viewport"),M=!1;if(!L)return{changes:[],updatedInternals:M};let O=[],T=window.getComputedStyle(L),{m22:A}=new window.DOMMatrixReadOnly(T.transform),R=[];for(let w of Q.values()){let P=U.get(w.id);if(!P)continue;if(P.hidden){U.set(P.id,{...P,internals:{...P.internals,handleBounds:void 0}}),M=!0;continue}let V=rq(w.nodeElement),S=P.measured.width!==V.width||P.measured.height!==V.height;if(!!(V.width&&V.height&&(S||!P.internals.handleBounds||w.force))){let y=w.nodeElement.getBoundingClientRect(),N=o8(P.extent)?P.extent:Y,{positionAbsolute:v}=P.internals;if(P.parentId&&P.extent==="parent"){let x=U.get(P.parentId);if(x)v=sM(v,V,x)}else if(N)v=s8(v,N,V);let D={...P,measured:V,internals:{...P.internals,positionAbsolute:v,handleBounds:{source:DM("source",w.nodeElement,y,A,P.id),target:DM("target",w.nodeElement,y,A,P.id)}}};if(U.set(P.id,D),P.parentId)iK(D,U,Z,{nodeOrigin:H,zIndexMode:W});if(M=!0,S){if(O.push({id:P.id,type:"dimensions",dimensions:V}),P.expandParent&&P.parentId)R.push({id:P.id,parentId:P.parentId,rect:I9(D,H)})}}}if(R.length>0){let w=eq(R,U,Z,H);O.push(...w)}return{changes:O,updatedInternals:M}}async function KT({delta:Q,panZoom:U,transform:Z,translateExtent:K,width:H,height:Y}){if(!U||!Q.x&&!Q.y)return!1;let W=await U.setViewportConstrained({x:Z[0]+Q.x,y:Z[1]+Q.y,zoom:Z[2]},[[0,0],[H,Y]],K);return!!W&&(W.x!==Z[0]||W.y!==Z[1]||W.k!==Z[2])}function gM(Q,U,Z,K,H,Y){let W=H,L=K.get(W)||new Map;K.set(W,L.set(Z,U)),W=`${H}-${Q}`;let M=K.get(W)||new Map;if(K.set(W,M.set(Z,U)),Y){W=`${H}-${Q}-${Y}`;let O=K.get(W)||new Map;K.set(W,O.set(Z,U))}}function dK(Q,U,Z){Q.clear(),U.clear();for(let K of Z){let{source:H,target:Y,sourceHandle:W=null,targetHandle:L=null}=K,M={edgeId:K.id,source:H,target:Y,sourceHandle:W,targetHandle:L},O=`${H}-${W}--${Y}-${L}`,T=`${Y}-${L}--${H}-${W}`;gM("source",M,T,Q,H,W),gM("target",M,O,Q,Y,L),U.set(K.id,K)}}function HT(Q,U){if(!Q.parentId)return!1;let Z=U.get(Q.parentId);if(!Z)return!1;if(Z.selected)return!0;return HT(Z,U)}function pM(Q,U,Z){let K=Q;do{if(K?.matches?.(U))return!0;if(K===Z)return!1;K=K?.parentElement}while(K);return!1}function qS(Q,U,Z,K){let H=new Map;for(let[Y,W]of Q)if((W.selected||W.id===K)&&(!W.parentId||!HT(W,Q))&&(W.draggable||U&&typeof W.draggable>"u")){let L=Q.get(Y);if(L)H.set(Y,{id:Y,position:L.position||{x:0,y:0},distance:{x:Z.x-L.internals.positionAbsolute.x,y:Z.y-L.internals.positionAbsolute.y},extent:L.extent,parentId:L.parentId,origin:L.origin,expandParent:L.expandParent,internals:{positionAbsolute:L.internals.positionAbsolute||{x:0,y:0}},measured:{width:L.measured.width??0,height:L.measured.height??0}})}return H}function RK({nodeId:Q,dragItems:U,nodeLookup:Z,dragging:K=!0}){let H=[];for(let[W,L]of U){let M=Z.get(W)?.internals.userNode;if(M)H.push({...M,position:L.position,dragging:K})}if(!Q)return[H[0],H];let Y=Z.get(Q)?.internals.userNode;return[!Y?H[0]:{...Y,position:U.get(Q)?.position||Y.position,dragging:K},H]}function US({dragItems:Q,snapGrid:U,x:Z,y:K}){let H=Q.values().next().value;if(!H)return null;let Y={x:Z-H.distance.x,y:K-H.distance.y},W=w9(Y,U);return{x:W.x-Y.x,y:W.y-Y.y}}function YT({onNodeMouseDown:Q,getStoreItems:U,onDragStart:Z,onDrag:K,onDragStop:H}){let Y={x:null,y:null},W=0,L=new Map,M=!1,O={x:0,y:0},T=null,A=!1,R=null,w=!1,P=!1,V=null;function S({noDragClassName:y,handleSelector:N,domNode:v,isSelectable:D,nodeId:x,nodeClickDistance:E=0}){R=P2(v);function u({x:U1,y:Q1}){let{nodeLookup:h,nodeExtent:g,snapGrid:p,snapToGrid:c,nodeOrigin:l,onNodeDrag:o,onSelectionDrag:k,onError:t,updateNodePositions:_1}=U();Y={x:U1,y:Q1};let a=!1,H1=L.size>1,O1=H1&&g?wK(n8(L)):null,L1=H1&&c?US({dragItems:L,snapGrid:p,x:U1,y:Q1}):null;for(let[T1,G1]of L){if(!h.has(T1))continue;let R1={x:U1-G1.distance.x,y:Q1-G1.distance.y};if(c)R1=L1?{x:Math.round(R1.x+L1.x),y:Math.round(R1.y+L1.y)}:w9(R1,p);let f1=null;if(H1&&g&&!G1.extent&&O1){let{positionAbsolute:b1}=G1.internals,c1=b1.x-O1.x+g[0][0],D1=b1.x+G1.measured.width-O1.x2+g[1][0],A1=b1.y-O1.y+g[0][1],e1=b1.y+G1.measured.height-O1.y2+g[1][1];f1=[[c1,A1],[D1,e1]]}let{position:z1,positionAbsolute:C1}=jK({nodeId:T1,nextPosition:R1,nodeLookup:h,nodeExtent:f1?f1:g,nodeOrigin:l,onError:t});a=a||G1.position.x!==z1.x||G1.position.y!==z1.y,G1.position=z1,G1.internals.positionAbsolute=C1}if(P=P||a,!a)return;if(_1(L,!0),V&&(K||o||!x&&k)){let[T1,G1]=RK({nodeId:x,dragItems:L,nodeLookup:h});if(K?.(V,L,T1,G1),o?.(V,T1,G1),!x)k?.(V,G1)}}async function b(){if(!T)return;let{transform:U1,panBy:Q1,autoPanSpeed:h,autoPanOnNodeDrag:g}=U();if(!g){M=!1,cancelAnimationFrame(W);return}let[p,c]=lq(O,T,h);if(p!==0||c!==0){if(Y.x=(Y.x??0)-p/U1[2],Y.y=(Y.y??0)-c/U1[2],await Q1({x:p,y:c}))u(Y)}W=requestAnimationFrame(b)}function m(U1){let{nodeLookup:Q1,multiSelectionActive:h,nodesDraggable:g,transform:p,snapGrid:c,snapToGrid:l,selectNodesOnDrag:o,onNodeDragStart:k,onSelectionDragStart:t,unselectNodesAndEdges:_1}=U();if(A=!0,(!o||!D)&&!h&&x){if(!Q1.get(x)?.selected)_1()}if(D&&o&&x)Q?.(x);let a=hJ(U1.sourceEvent,{transform:p,snapGrid:c,snapToGrid:l,containerBounds:T});if(Y=a,L=qS(Q1,g,a,x),L.size>0&&(Z||k||!x&&t)){let[H1,O1]=RK({nodeId:x,dragItems:L,nodeLookup:Q1});if(Z?.(U1.sourceEvent,L,H1,O1),k?.(U1.sourceEvent,H1,O1),!x)t?.(U1.sourceEvent,O1)}}let s=TJ().clickDistance(E).on("start",(U1)=>{let{domNode:Q1,nodeDragThreshold:h,transform:g,snapGrid:p,snapToGrid:c}=U();if(T=Q1?.getBoundingClientRect()||null,w=!1,P=!1,V=U1.sourceEvent,h===0)m(U1);Y=hJ(U1.sourceEvent,{transform:g,snapGrid:p,snapToGrid:c,containerBounds:T}),O=_4(U1.sourceEvent,T)}).on("drag",(U1)=>{let{autoPanOnNodeDrag:Q1,transform:h,snapGrid:g,snapToGrid:p,nodeDragThreshold:c,nodeLookup:l}=U(),o=hJ(U1.sourceEvent,{transform:h,snapGrid:g,snapToGrid:p,containerBounds:T});if(V=U1.sourceEvent,U1.sourceEvent.type==="touchmove"&&U1.sourceEvent.touches.length>1||x&&!l.has(x))w=!0;if(w)return;if(!M&&Q1&&A)M=!0,b();if(!A){let k=_4(U1.sourceEvent,T),t=k.x-O.x,_1=k.y-O.y;if(Math.sqrt(t*t+_1*_1)>c)m(U1)}if((Y.x!==o.xSnapped||Y.y!==o.ySnapped)&&L&&A)O=_4(U1.sourceEvent,T),u(o)}).on("end",(U1)=>{if(!A||w){if(w&&L.size>0)U().updateNodePositions(L,!1);return}if(M=!1,A=!1,cancelAnimationFrame(W),L.size>0){let{nodeLookup:Q1,updateNodePositions:h,onNodeDragStop:g,onSelectionDragStop:p}=U();if(P)h(L,!1),P=!1;if(H||g||!x&&p){let[c,l]=RK({nodeId:x,dragItems:L,nodeLookup:Q1,dragging:!1});if(H?.(U1.sourceEvent,L,c,l),g?.(U1.sourceEvent,c,l),!x)p?.(U1.sourceEvent,l)}}}).filter((U1)=>{let Q1=U1.target;return!U1.button&&(!y||!pM(Q1,`.${y}`,v))&&(!N||pM(Q1,N,v))});R.call(s)}function C(){R?.on(".drag",null)}return{update:S,destroy:C}}function GS(Q,U,Z){let K=[],H={x:Q.x-Z,y:Q.y-Z,width:Z*2,height:Z*2};for(let Y of U.values())if(mJ(H,I9(Y))>0)K.push(Y);return K}var ZS=250;function FS(Q,U,Z,K){let H=[],Y=1/0,W=GS(Q,Z,U+ZS);for(let L of W){let M=[...L.internals.handleBounds?.source??[],...L.internals.handleBounds?.target??[]];for(let O of M){if(K.nodeId===O.nodeId&&K.type===O.type&&K.id===O.id)continue;let{x:T,y:A}=i6(L,O,O.position,!0),R=Math.sqrt(Math.pow(T-Q.x,2)+Math.pow(A-Q.y,2));if(R>U)continue;if(R<Y)H=[{...O,x:T,y:A}],Y=R;else if(R===Y)H.push({...O,x:T,y:A})}}if(!H.length)return null;if(H.length>1){let L=K.type==="source"?"target":"source";return H.find((M)=>M.type===L)??H[0]}return H[0]}function zT(Q,U,Z,K,H,Y=!1){let W=K.get(Q);if(!W)return null;let L=H==="strict"?W.internals.handleBounds?.[U]:[...W.internals.handleBounds?.source??[],...W.internals.handleBounds?.target??[]],M=(Z?L?.find((O)=>O.id===Z):L?.[0])??null;return M&&Y?{...M,...i6(W,M,M.position,!0)}:M}function WT(Q,U){if(Q)return Q;else if(U?.classList.contains("target"))return"target";else if(U?.classList.contains("source"))return"source";return null}function XS(Q,U){let Z=null;if(U)Z=!0;else if(Q&&!U)Z=!1;return Z}var LT=()=>!0;function KS(Q,{connectionMode:U,connectionRadius:Z,handleId:K,nodeId:H,edgeUpdaterType:Y,isTarget:W,domNode:L,nodeLookup:M,lib:O,autoPanOnConnect:T,flowId:A,panBy:R,cancelConnection:w,onConnectStart:P,onConnect:V,onConnectEnd:S,isValidConnection:C=LT,onReconnectEnd:y,updateConnection:N,getTransform:v,getFromHandle:D,autoPanSpeed:x,dragThreshold:E=1,handleDomNode:u}){let b=hK(Q.target),m=0,s,{x:U1,y:Q1}=_4(Q),h=WT(Y,u),g=L?.getBoundingClientRect(),p=!1;if(!g||!h)return;let c=zT(H,h,K,M,U);if(!c)return;let l=_4(Q,g),o=!1,k=null,t=!1,_1=null;function a(){if(!T||!g)return;let[z1,C1]=lq(l,g,x);R({x:z1,y:C1}),m=requestAnimationFrame(a)}let H1={...c,nodeId:H,type:h,position:c.position},O1=M.get(H),T1={inProgress:!0,isValid:null,from:i6(O1,H1,E1.Left,!0),fromHandle:H1,fromPosition:H1.position,fromNode:O1,to:l,toHandle:null,toPosition:VM[H1.position],toNode:null,pointer:l};function G1(){p=!0,N(T1),P?.(Q,{nodeId:H,handleId:K,handleType:h})}if(E===0)G1();function R1(z1){if(!p){let{x:e1,y:k1}=_4(z1),g0=e1-U1,_0=k1-Q1;if(!(g0*g0+_0*_0>E*E))return;G1()}if(!D()||!H1){f1(z1);return}let C1=v();if(l=_4(z1,g),s=FS(P9(l,C1,!1,[1,1]),Z,M,H1),!o)a(),o=!0;let b1=BT(z1,{handle:s,connectionMode:U,fromNodeId:H,fromHandleId:K,fromType:W?"target":"source",isValidConnection:C,doc:b,lib:O,flowId:A,nodeLookup:M});_1=b1.handleDomNode,k=b1.connection,t=XS(!!s,b1.isValid);let c1=M.get(H),D1=c1?i6(c1,H1,E1.Left,!0):T1.from,A1={...T1,from:D1,isValid:t,to:b1.toHandle&&t?t8({x:b1.toHandle.x,y:b1.toHandle.y},C1):l,toHandle:b1.toHandle,toPosition:t&&b1.toHandle?b1.toHandle.position:VM[H1.position],toNode:b1.toHandle?M.get(b1.toHandle.nodeId):null,pointer:l};N(A1),T1=A1}function f1(z1){if("touches"in z1&&z1.touches.length>0)return;if(p){if((s||_1)&&k&&t)V?.(k);let{inProgress:C1,...b1}=T1,c1={...b1,toPosition:T1.toHandle?T1.toPosition:null};if(S?.(z1,c1),Y)y?.(z1,c1)}w(),cancelAnimationFrame(m),o=!1,t=!1,k=null,_1=null,b.removeEventListener("mousemove",R1),b.removeEventListener("mouseup",f1),b.removeEventListener("touchmove",R1),b.removeEventListener("touchend",f1)}b.addEventListener("mousemove",R1),b.addEventListener("mouseup",f1),b.addEventListener("touchmove",R1),b.addEventListener("touchend",f1)}function BT(Q,{handle:U,connectionMode:Z,fromNodeId:K,fromHandleId:H,fromType:Y,doc:W,lib:L,flowId:M,isValidConnection:O=LT,nodeLookup:T}){let A=Y==="target",R=U?W.querySelector(`.${L}-flow__handle[data-id="${M}-${U?.nodeId}-${U?.id}-${U?.type}"]`):null,{x:w,y:P}=_4(Q),V=W.elementFromPoint(w,P),S=V?.classList.contains(`${L}-flow__handle`)?V:R,C={handleDomNode:S,isValid:!1,connection:null,toHandle:null};if(S){let y=WT(void 0,S),N=S.getAttribute("data-nodeid"),v=S.getAttribute("data-handleid"),D=S.classList.contains("connectable"),x=S.classList.contains("connectableend");if(!N||!y)return C;let E={source:A?N:K,sourceHandle:A?v:H,target:A?K:N,targetHandle:A?H:v};C.connection=E;let b=D&&x&&(Z===l6.Strict?A&&y==="source"||!A&&y==="target":N!==K||v!==H);C.isValid=b&&O(E),C.toHandle=zT(N,y,v,T,Z,!0)}return C}var _U={onPointerDown:KS,isValid:BT};function AT({domNode:Q,panZoom:U,getTransform:Z,getViewScale:K}){let H=P2(Q);function Y({translateExtent:L,width:M,height:O,zoomStep:T=1,pannable:A=!0,zoomable:R=!0,inversePan:w=!1}){let P=(N)=>{if(N.sourceEvent.type!=="wheel"||!U)return;let v=Z(),D=N.sourceEvent.ctrlKey&&N9()?10:1,x=-N.sourceEvent.deltaY*(N.sourceEvent.deltaMode===1?0.05:N.sourceEvent.deltaMode?1:0.002)*T,E=v[2]*Math.pow(2,x*D);U.scaleTo(E)},V=[0,0],S=(N)=>{if(N.sourceEvent.type==="mousedown"||N.sourceEvent.type==="touchstart")V=[N.sourceEvent.clientX??N.sourceEvent.touches[0].clientX,N.sourceEvent.clientY??N.sourceEvent.touches[0].clientY]},C=(N)=>{let v=Z();if(N.sourceEvent.type!=="mousemove"&&N.sourceEvent.type!=="touchmove"||!U)return;let D=[N.sourceEvent.clientX??N.sourceEvent.touches[0].clientX,N.sourceEvent.clientY??N.sourceEvent.touches[0].clientY],x=[D[0]-V[0],D[1]-V[1]];V=D;let E=K()*Math.max(v[2],Math.log(v[2]))*(w?-1:1),u={x:v[0]-x[0]*E,y:v[1]-x[1]*E},b=[[0,0],[M,O]];U.setViewportConstrained({x:u.x,y:u.y,zoom:v[2]},b,L)},y=EJ().on("start",S).on("zoom",A?C:null).on("zoom.wheel",R?P:null);H.call(y,{})}function W(){H.on("zoom",null)}return{update:Y,destroy:W,pointer:a2}}var JU=(Q)=>({x:Q.x,y:Q.y,zoom:Q.k}),OK=({x:Q,y:U,zoom:Z})=>d8.translate(Q,U).scale(Z),c6=(Q,U)=>Q.target.closest(`.${U}`),MT=(Q,U)=>U===2&&Array.isArray(Q)&&Q.includes(2),HS=(Q)=>((Q*=2)<=1?Q*Q*Q:(Q-=2)*Q*Q+2)/2,IK=(Q,U=0,Z=HS,K=()=>{})=>{let H=typeof U==="number"&&U>0;if(!H)K();return H?Q.transition().duration(U).ease(Z).on("end",K):Q},TT=(Q)=>{let U=Q.ctrlKey&&N9()?10:1;return-Q.deltaY*(Q.deltaMode===1?0.05:Q.deltaMode?1:0.002)*U};function YS({zoomPanValues:Q,noWheelClassName:U,d3Selection:Z,d3Zoom:K,panOnScrollMode:H,panOnScrollSpeed:Y,zoomOnPinch:W,onPanZoomStart:L,onPanZoom:M,onPanZoomEnd:O}){return(T)=>{if(c6(T,U)){if(T.ctrlKey)T.preventDefault();return!1}T.preventDefault(),T.stopImmediatePropagation();let A=Z.property("__zoom").k||1;if(T.ctrlKey&&W){let S=a2(T),C=TT(T),y=A*Math.pow(2,C);K.scaleTo(Z,y,S,T);return}let R=T.deltaMode===1?20:1,w=H===h3.Vertical?0:T.deltaX*R,P=H===h3.Horizontal?0:T.deltaY*R;if(!N9()&&T.shiftKey&&H!==h3.Vertical)w=T.deltaY*R,P=0;K.translateBy(Z,-(w/A)*Y,-(P/A)*Y,{internal:!0});let V=JU(Z.property("__zoom"));if(clearTimeout(Q.panScrollTimeout),!Q.isPanScrolling)Q.isPanScrolling=!0,L?.(T,V);else M?.(T,V);Q.panScrollTimeout=setTimeout(()=>{O?.(T,V),Q.isPanScrolling=!1},150)}}function zS({noWheelClassName:Q,preventScrolling:U,d3ZoomHandler:Z}){return function(K,H){let Y=K.type==="wheel",W=!U&&Y&&!K.ctrlKey,L=c6(K,Q);if(K.ctrlKey&&Y&&L)K.preventDefault();if(W||L)return null;K.preventDefault(),Z.call(this,K,H)}}function WS({zoomPanValues:Q,onDraggingChange:U,onPanZoomStart:Z}){return(K)=>{if(K.sourceEvent?.internal)return;let H=JU(K.transform);if(Q.mouseButton=K.sourceEvent?.button||0,Q.isZoomingOrPanning=!0,Q.prevViewport=H,K.sourceEvent?.type==="mousedown")U(!0);if(Z)Z?.(K.sourceEvent,H)}}function LS({zoomPanValues:Q,panOnDrag:U,onPaneContextMenu:Z,onTransformChange:K,onPanZoom:H}){return(Y)=>{if(Q.usedRightMouseButton=!!(Z&&MT(U,Q.mouseButton??0)),!Y.sourceEvent?.sync)K([Y.transform.x,Y.transform.y,Y.transform.k]);if(H&&!Y.sourceEvent?.internal)H?.(Y.sourceEvent,JU(Y.transform))}}function BS({zoomPanValues:Q,panOnDrag:U,panOnScroll:Z,onDraggingChange:K,onPanZoomEnd:H,onPaneContextMenu:Y}){return(W)=>{if(W.sourceEvent?.internal)return;if(Q.isZoomingOrPanning=!1,Y&&MT(U,Q.mouseButton??0)&&!Q.usedRightMouseButton&&W.sourceEvent)Y(W.sourceEvent);if(Q.usedRightMouseButton=!1,K(!1),H){let L=JU(W.transform);Q.prevViewport=L,clearTimeout(Q.timerId),Q.timerId=setTimeout(()=>{H?.(W.sourceEvent,L)},Z?150:0)}}}function AS({panActivationKeyPressed:Q,zoomActivationKeyPressed:U,zoomOnScroll:Z,zoomOnPinch:K,panOnDrag:H,panOnScroll:Y,zoomOnDoubleClick:W,userSelectionActive:L,noWheelClassName:M,noPanClassName:O,lib:T,connectionInProgress:A}){return(R)=>{let w=U||Z,P=K&&R.ctrlKey,V=R.type==="wheel";if(R.button===1&&R.type==="mousedown"&&(c6(R,`${T}-flow__node`)||c6(R,`${T}-flow__edge`)||c6(R,`${T}-flow__selection`)||c6(R,`${T}-flow__nodesselection`)))return!0;if(!H&&!w&&!Y&&!W&&!K)return!1;if(L)return!1;if(A&&!V)return!1;if(c6(R,M)&&V)return!1;if(c6(R,O)&&(!V||Y&&V&&!U))return!1;if(!K&&R.ctrlKey&&V)return!1;if(!K&&R.type==="touchstart"&&R.touches?.length>1)return R.preventDefault(),!1;if(!w&&!Y&&!P&&V)return!1;if(!H&&(R.type==="mousedown"||R.type==="touchstart"))return!1;if(Array.isArray(H)&&!H.includes(R.button)&&R.type==="mousedown")return!1;let S=Array.isArray(H)&&H.includes(R.button)||!R.button||R.button<=1;return(!R.ctrlKey||V||Q)&&S}}function RT({domNode:Q,minZoom:U,maxZoom:Z,translateExtent:K,viewport:H,onPanZoom:Y,onPanZoomStart:W,onPanZoomEnd:L,onDraggingChange:M}){let O={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},T=Q.getBoundingClientRect(),A=[[0,0],[T.width,T.height]];(typeof ResizeObserver<"u"?new ResizeObserver((Q1)=>{let h=Q1[0];if(h)A=[[0,0],[h.contentRect.width,h.contentRect.height]]}):null)?.observe(Q);let w=EJ().extent(()=>A).scaleExtent([U,Z]).translateExtent(K),P=P2(Q).call(w);v({x:H.x,y:H.y,zoom:R9(H.zoom,U,Z)},[[0,0],[T.width,T.height]],K);let V=P.on("wheel.zoom"),S=P.on("dblclick.zoom");w.wheelDelta(TT);async function C(Q1,h){if(P)return new Promise((g)=>{w?.interpolate(h?.interpolate==="linear"?J3:l8).transform(IK(P,h?.duration,h?.ease,()=>g(!0)),Q1)});return!1}function y({noWheelClassName:Q1,noPanClassName:h,onPaneContextMenu:g,userSelectionActive:p,panOnScroll:c,panOnDrag:l,panOnScrollMode:o,panOnScrollSpeed:k,preventScrolling:t,zoomOnPinch:_1,zoomOnScroll:a,zoomOnDoubleClick:H1,panActivationKeyPressed:O1=!1,zoomActivationKeyPressed:L1,lib:T1,onTransformChange:G1,connectionInProgress:R1,paneClickDistance:f1,selectionOnDrag:z1}){if(p&&!O.isZoomingOrPanning)N();let C1=c&&!L1&&!p;w.clickDistance(z1?1/0:!e5(f1)||f1<0?0:f1);let b1=C1?YS({zoomPanValues:O,noWheelClassName:Q1,d3Selection:P,d3Zoom:w,panOnScrollMode:o,panOnScrollSpeed:k,zoomOnPinch:_1,onPanZoomStart:W,onPanZoom:Y,onPanZoomEnd:L}):zS({noWheelClassName:Q1,preventScrolling:t,d3ZoomHandler:V});P.on("wheel.zoom",b1,{passive:!1});let c1=WS({zoomPanValues:O,onDraggingChange:M,onPanZoomStart:W});w.on("start",c1);let D1=LS({zoomPanValues:O,panOnDrag:l,onPaneContextMenu:!!g,onPanZoom:Y,onTransformChange:G1});w.on("zoom",D1);let A1=BS({zoomPanValues:O,panOnDrag:l,panOnScroll:c,onPaneContextMenu:g,onPanZoomEnd:L,onDraggingChange:M});w.on("end",A1);let e1=AS({panActivationKeyPressed:O1,zoomActivationKeyPressed:L1,panOnDrag:l,zoomOnScroll:a,panOnScroll:c,zoomOnDoubleClick:H1,zoomOnPinch:_1,userSelectionActive:p,noPanClassName:h,noWheelClassName:Q1,lib:T1,connectionInProgress:R1});if(w.filter(e1),H1)P.on("dblclick.zoom",S);else P.on("dblclick.zoom",null)}function N(){w.on("zoom",null)}async function v(Q1,h,g){let p=OK(Q1),c=w?.constrain()(p,h,g);if(c)await C(c);return c}async function D(Q1,h){let g=OK(Q1);return await C(g,h),g}function x(Q1){if(P){let h=OK(Q1),g=P.property("__zoom");if(g.k!==Q1.zoom||g.x!==Q1.x||g.y!==Q1.y)w?.transform(P,h,null,{sync:!0})}}function E(){let Q1=P?bJ(P.node()):{x:0,y:0,k:1};return{x:Q1.x,y:Q1.y,zoom:Q1.k}}async function u(Q1,h){if(P)return new Promise((g)=>{w?.interpolate(h?.interpolate==="linear"?J3:l8).scaleTo(IK(P,h?.duration,h?.ease,()=>g(!0)),Q1)});return!1}async function b(Q1,h){if(P)return new Promise((g)=>{w?.interpolate(h?.interpolate==="linear"?J3:l8).scaleBy(IK(P,h?.duration,h?.ease,()=>g(!0)),Q1)});return!1}function m(Q1){w?.scaleExtent(Q1)}function s(Q1){w?.translateExtent(Q1)}function U1(Q1){let h=!e5(Q1)||Q1<0?0:Q1;w?.clickDistance(h)}return{update:y,destroy:N,setViewport:D,setViewportConstrained:v,getViewport:E,scaleTo:u,scaleBy:b,setScaleExtent:m,setTranslateExtent:s,syncViewport:x,setClickDistance:U1}}var x3;(function(Q){Q.Line="line",Q.Handle="handle"})(x3||(x3={}));var OT=["top-left","top-right","bottom-left","bottom-right"],IT=["top","right","bottom","left"];function MS({width:Q,prevWidth:U,height:Z,prevHeight:K,affectsX:H,affectsY:Y}){let W=Q-U,L=Z-K,M=[W>0?1:W<0?-1:0,L>0?1:L<0?-1:0];if(W&&H)M[0]=M[0]*-1;if(L&&Y)M[1]=M[1]*-1;return M}function cM(Q){let U=Q.includes("right")||Q.includes("left"),Z=Q.includes("bottom")||Q.includes("top"),K=Q.includes("left"),H=Q.includes("top");return{isHorizontal:U,isVertical:Z,affectsX:K,affectsY:H}}function g6(Q,U){return Math.max(0,U-Q)}function p6(Q,U){return Math.max(0,Q-U)}function gq(Q,U,Z){return Math.max(0,U-Q,Q-Z)}function lM(Q,U){return Q?!U:U}function TS(Q,U,Z,K,H,Y,W,L){let{affectsX:M,affectsY:O}=U,{isHorizontal:T,isVertical:A}=U,R=T&&A,{xSnapped:w,ySnapped:P}=Z,{minWidth:V,maxWidth:S,minHeight:C,maxHeight:y}=K,{x:N,y:v,width:D,height:x,aspectRatio:E}=Q,u=Math.floor(T?w-Q.pointerX:0),b=Math.floor(A?P-Q.pointerY:0),m=D+(M?-u:u),s=x+(O?-b:b),U1=-Y[0]*D,Q1=-Y[1]*x,h=gq(m,V,S),g=gq(s,C,y);if(W){let l=0,o=0;if(M&&u<0)l=g6(N+u+U1,W[0][0]);else if(!M&&u>0)l=p6(N+m+U1,W[1][0]);if(O&&b<0)o=g6(v+b+Q1,W[0][1]);else if(!O&&b>0)o=p6(v+s+Q1,W[1][1]);h=Math.max(h,l),g=Math.max(g,o)}if(L){let l=0,o=0;if(M&&u>0)l=p6(N+u,L[0][0]);else if(!M&&u<0)l=g6(N+m,L[1][0]);if(O&&b>0)o=p6(v+b,L[0][1]);else if(!O&&b<0)o=g6(v+s,L[1][1]);h=Math.max(h,l),g=Math.max(g,o)}if(H){if(T){let l=gq(m/E,C,y)*E;if(h=Math.max(h,l),W){let o=0;if(!M&&!O||M&&!O&&R)o=p6(v+Q1+m/E,W[1][1])*E;else o=g6(v+Q1+(M?u:-u)/E,W[0][1])*E;h=Math.max(h,o)}if(L){let o=0;if(!M&&!O||M&&!O&&R)o=g6(v+m/E,L[1][1])*E;else o=p6(v+(M?u:-u)/E,L[0][1])*E;h=Math.max(h,o)}}if(A){let l=gq(s*E,V,S)/E;if(g=Math.max(g,l),W){let o=0;if(!M&&!O||O&&!M&&R)o=p6(N+s*E+U1,W[1][0])/E;else o=g6(N+(O?b:-b)*E+U1,W[0][0])/E;g=Math.max(g,o)}if(L){let o=0;if(!M&&!O||O&&!M&&R)o=g6(N+s*E,L[1][0])/E;else o=p6(N+(O?b:-b)*E,L[0][0])/E;g=Math.max(g,o)}}}if(b=b+(b<0?g:-g),u=u+(u<0?h:-h),H)if(R)if(m>s*E)b=(lM(M,O)?-u:u)/E;else u=(lM(M,O)?-b:b)*E;else if(T)b=u/E,O=M;else u=b*E,M=O;let p=M?N+u:N,c=O?v+b:v;return{width:D+(M?-u:u),height:x+(O?-b:b),x:Y[0]*u*(!M?1:-1)+p,y:Y[1]*b*(!O?1:-1)+c}}var wT={width:0,height:0,x:0,y:0},RS={...wT,pointerX:0,pointerY:0,aspectRatio:1};function OS(Q,U,Z){let K=U.position.x+Q.position.x,H=U.position.y+Q.position.y,Y=Q.measured.width??0,W=Q.measured.height??0,L=Z[0]*Y,M=Z[1]*W;return[[K-L,H-M],[K+Y-L,H+W-M]]}function PT({domNode:Q,nodeId:U,getStoreItems:Z,onChange:K,onEnd:H}){let Y=P2(Q),W={controlDirection:cM("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function L({controlPosition:O,boundaries:T,keepAspectRatio:A,resizeDirection:R,onResizeStart:w,onResize:P,onResizeEnd:V,shouldResize:S}){let C={...wT},y={...RS};W={boundaries:T,resizeDirection:R,keepAspectRatio:A,controlDirection:cM(O)};let N=void 0,v=null,D=[],x=void 0,E=void 0,u=void 0,b=TJ().on("start",(m)=>{let{nodeLookup:s,transform:U1,snapGrid:Q1,snapToGrid:h,nodeOrigin:g,paneDomNode:p}=Z();if(N=s.get(U),!N)return;v=p?.getBoundingClientRect()??null;let{xSnapped:c,ySnapped:l}=hJ(m.sourceEvent,{transform:U1,snapGrid:Q1,snapToGrid:h,containerBounds:v});if(C={width:N.measured.width??0,height:N.measured.height??0,x:N.position.x??0,y:N.position.y??0},y={...C,pointerX:c,pointerY:l,aspectRatio:C.width/C.height},x=void 0,E=o8(N.extent)?N.extent:void 0,N.parentId&&(N.extent==="parent"||N.expandParent))x=s.get(N.parentId);if(x&&N.extent==="parent")E=[[0,0],[x.measured.width,x.measured.height]];D=[],u=void 0;for(let[o,k]of s)if(k.parentId===U){if(D.push({id:o,position:{...k.position},extent:k.extent}),k.extent==="parent"||k.expandParent){let t=OS(k,N,k.origin??g);if(u)u=[[Math.min(t[0][0],u[0][0]),Math.min(t[0][1],u[0][1])],[Math.max(t[1][0],u[1][0]),Math.max(t[1][1],u[1][1])]];else u=t}}w?.(m,{...C})}).on("drag",(m)=>{let{transform:s,snapGrid:U1,snapToGrid:Q1,nodeOrigin:h}=Z(),g=hJ(m.sourceEvent,{transform:s,snapGrid:U1,snapToGrid:Q1,containerBounds:v}),p=[];if(!N)return;let{x:c,y:l,width:o,height:k}=C,t={},_1=N.origin??h,{width:a,height:H1,x:O1,y:L1}=TS(y,W.controlDirection,g,W.boundaries,W.keepAspectRatio,_1,E,u),T1=a!==o,G1=H1!==k,R1=O1!==c&&T1,f1=L1!==l&&G1;if(!R1&&!f1&&!T1&&!G1)return;let z1={prevValues:{...C},startX:y.x,startY:y.y,childNodes:D.map((D1)=>({...D1,position:{...D1.position}}))};if(R1||f1||_1[0]===1||_1[1]===1){if(t.x=R1?O1:C.x,t.y=f1?L1:C.y,C.x=t.x,C.y=t.y,D.length>0){let D1=O1-c,A1=L1-l;for(let e1 of D)e1.position={x:e1.position.x-D1+_1[0]*(a-o),y:e1.position.y-A1+_1[1]*(H1-k)},p.push(e1)}}if(T1||G1)t.width=T1&&(!W.resizeDirection||W.resizeDirection==="horizontal")?a:C.width,t.height=G1&&(!W.resizeDirection||W.resizeDirection==="vertical")?H1:C.height,C.width=t.width,C.height=t.height;if(x&&N.expandParent){let D1=_1[0]*(t.width??0);if(t.x&&t.x<D1)C.x=D1,y.x=y.x-(t.x-D1);let A1=_1[1]*(t.height??0);if(t.y&&t.y<A1)C.y=A1,y.y=y.y-(t.y-A1)}let C1=MS({width:C.width,prevWidth:o,height:C.height,prevHeight:k,affectsX:W.controlDirection.affectsX,affectsY:W.controlDirection.affectsY}),b1={...C,direction:C1};if(S?.(m,b1)===!1){C=z1.prevValues,y.x=z1.startX,y.y=z1.startY,D.forEach((D1,A1)=>{D1.position=z1.childNodes[A1].position});return}P?.(m,b1),K(t,p)}).on("end",(m)=>{V?.(m,{...C}),H?.({...C})});Y.call(b)}function M(){Y.on(".drag",null)}return{update:L,destroy:M}}var jT=s0(B4(),1),VT=s0(CT(),1);var fT=(Q)=>{let U,Z=new Set,K=(T,A)=>{let R=typeof T==="function"?T(U):T;if(!Object.is(R,U)){let w=U;U=(A!=null?A:typeof R!=="object"||R===null)?R:Object.assign({},U,R),Z.forEach((P)=>P(U,w))}},H=()=>U,M={setState:K,getState:H,getInitialState:()=>O,subscribe:(T)=>{return Z.add(T),()=>Z.delete(T)},destroy:()=>{if((import.meta.env?import.meta.env.MODE:void 0)!=="production")console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected.");Z.clear()}},O=U=Q(K,H,M);return M},ST=(Q)=>Q?fT(Q):fT;var{useDebugValue:PS}=jT.default,{useSyncExternalStoreWithSelector:NS}=VT.default,CS=(Q)=>Q;function rK(Q,U=CS,Z){let K=NS(Q.subscribe,Q.getState,Q.getServerState||Q.getInitialState,U,Z);return PS(K),K}var vT=(Q,U)=>{let Z=ST(Q),K=(H,Y=U)=>rK(Z,H,Y);return Object.assign(K,Z),K},yT=(Q,U)=>Q?vT(Q,U):vT;function i0(Q,U){if(Object.is(Q,U))return!0;if(typeof Q!=="object"||Q===null||typeof U!=="object"||U===null)return!1;if(Q instanceof Map&&U instanceof Map){if(Q.size!==U.size)return!1;for(let[K,H]of Q)if(!Object.is(H,U.get(K)))return!1;return!0}if(Q instanceof Set&&U instanceof Set){if(Q.size!==U.size)return!1;for(let K of Q)if(!U.has(K))return!1;return!0}let Z=Object.keys(Q);if(Z.length!==Object.keys(U).length)return!1;for(let K of Z)if(!Object.prototype.hasOwnProperty.call(U,K)||!Object.is(Q[K],U[K]))return!1;return!0}var GR=s0(iF(),1),GU=W1.createContext(null),fS=GU.Provider,ZR=F5.error001("react");function L0(Q,U){let Z=W1.useContext(GU);if(Z===null)throw Error(ZR);return rK(Z,Q,U)}function d0(){let Q=W1.useContext(GU);if(Q===null)throw Error(ZR);return W1.useMemo(()=>({getState:Q.getState,setState:Q.setState,subscribe:Q.subscribe}),[Q])}var kT={display:"none"},SS={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},FR="react-flow__node-desc",XR="react-flow__edge-desc",vS="react-flow__aria-live",jS=(Q)=>Q.ariaLiveMessage,VS=(Q)=>Q.ariaLabelConfig;function yS({rfId:Q}){let U=L0(jS);return K1.jsx("div",{id:`${vS}-${Q}`,"aria-live":"assertive","aria-atomic":"true",style:SS,children:U})}function kS({rfId:Q,disableKeyboardA11y:U}){let Z=L0(VS);return K1.jsxs(K1.Fragment,{children:[K1.jsx("div",{id:`${FR}-${Q}`,style:kT,children:U?Z["node.a11yDescription.default"]:Z["node.a11yDescription.keyboardDisabled"]}),K1.jsx("div",{id:`${XR}-${Q}`,style:kT,children:Z["edge.a11yDescription.default"]}),!U&&K1.jsx(yS,{rfId:Q})]})}var q3=W1.forwardRef(({position:Q="top-left",children:U,className:Z,style:K,...H},Y)=>{let W=`${Q}`.split("-");return K1.jsx("div",{className:_2(["react-flow__panel",Z,...W]),style:K,ref:Y,...H,children:U})});q3.displayName="Panel";var DT="https://reactflow.dev/attribution";function DS({proOptions:Q,position:U="bottom-right"}){if(W1.useEffect(()=>{eM("react")},[]),Q?.hideAttribution)return null;return K1.jsx(q3,{position:U,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${DT}`,children:K1.jsx("a",{href:DT,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}var uS=(Q)=>{let U=[],Z=[];for(let[,K]of Q.nodeLookup)if(K.selected)U.push(K.internals.userNode);for(let[,K]of Q.edgeLookup)if(K.selected)Z.push(K);return{selectedNodes:U,selectedEdges:Z}},$U=(Q)=>Q.id;function bS(Q,U){return i0(Q.selectedNodes.map($U),U.selectedNodes.map($U))&&i0(Q.selectedEdges.map($U),U.selectedEdges.map($U))}function ES({onSelectionChange:Q}){let U=d0(),{selectedNodes:Z,selectedEdges:K}=L0(uS,bS);return W1.useEffect(()=>{let H={nodes:Z,edges:K};Q?.(H),U.getState().onSelectionChangeHandlers.forEach((Y)=>Y(H))},[Z,K,Q]),null}var hS=(Q)=>!!Q.onSelectionChangeHandlers;function xS({onSelectionChange:Q}){let U=L0(hS);if(Q||U)return K1.jsx(ES,{onSelectionChange:Q});return null}var KR=[0,0],mS={x:0,y:0,zoom:1},gS=["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"],uT=[...gS,"rfId"],pS=(Q)=>({setNodes:Q.setNodes,setEdges:Q.setEdges,setMinZoom:Q.setMinZoom,setMaxZoom:Q.setMaxZoom,setTranslateExtent:Q.setTranslateExtent,setNodeExtent:Q.setNodeExtent,reset:Q.reset,setDefaultNodesAndEdges:Q.setDefaultNodesAndEdges}),bT={translateExtent:O9,nodeOrigin:KR,minZoom:0.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function cS(Q){let{setNodes:U,setEdges:Z,setMinZoom:K,setMaxZoom:H,setTranslateExtent:Y,setNodeExtent:W,reset:L,setDefaultNodesAndEdges:M}=L0(pS,i0),O=d0();W1.useEffect(()=>{return M(Q.defaultNodes,Q.defaultEdges),()=>{T.current=bT,L()}},[]);let T=W1.useRef(bT);return W1.useEffect(()=>{for(let A of uT){let R=Q[A],w=T.current[A];if(R===w)continue;if(typeof Q[A]>"u")continue;if(A==="nodes")U(R);else if(A==="edges")Z(R);else if(A==="minZoom")K(R);else if(A==="maxZoom")H(R);else if(A==="translateExtent")Y(R);else if(A==="nodeExtent")W(R);else if(A==="ariaLabelConfig")O.setState({ariaLabelConfig:nM(R)});else if(A==="fitView")O.setState({fitViewQueued:R});else if(A==="fitViewOptions")O.setState({fitViewOptions:R});else O.setState({[A]:R})}T.current=Q},uT.map((A)=>Q[A])),null}function ET(){if(typeof window>"u"||!window.matchMedia)return null;return window.matchMedia("(prefers-color-scheme: dark)")}function lS(Q){let[U,Z]=W1.useState(Q==="system"?null:Q);return W1.useEffect(()=>{if(Q!=="system"){Z(Q);return}let K=ET(),H=()=>Z(K?.matches?"dark":"light");return H(),K?.addEventListener("change",H),()=>{K?.removeEventListener("change",H)}},[Q]),U!==null?U:ET()?.matches?"dark":"light"}var hT=typeof document<"u"?document:null;function cJ(Q=null,U={target:hT,actInsideInputWithModifier:!0}){let[Z,K]=W1.useState(!1),H=W1.useRef(!1),Y=W1.useRef(new Set([])),[W,L]=W1.useMemo(()=>{if(Q!==null){let O=(Array.isArray(Q)?Q:[Q]).filter((A)=>typeof A==="string").map((A)=>A.replace(/\+/g,`
|
|
242
242
|
`).replace(`
|
|
243
243
|
|
|
244
244
|
`,`
|
|
245
245
|
+`).split(`
|
|
246
|
-
`)),T=O.reduce((A,R)=>A.concat(...R),[]);return[O,T]}return[[],[]]},[Q]);return W1.useEffect(()=>{let M=U?.target??hT,O=U?.actInsideInputWithModifier??!0;if(Q!==null){let T=(w)=>{if(H.current=w.ctrlKey||w.metaKey||w.shiftKey||w.altKey,(!H.current||H.current&&!O)&&xK(w))return!1;let V=mT(w.code,L);if(Y.current.add(w[V]),xT(W,Y.current,!1)){let S=w.composedPath?.()?.[0]||w.target,C=S?.nodeName==="BUTTON"||S?.nodeName==="A";if(U.preventDefault!==!1&&(H.current||!C))w.preventDefault();K(!0)}},A=(w)=>{let P=mT(w.code,L);if(xT(W,Y.current,!0))K(!1),Y.current.clear();else Y.current.delete(w[P]);if(w.key==="Meta")Y.current.clear();H.current=!1},R=()=>{Y.current.clear(),K(!1)};return M?.addEventListener("keydown",T),M?.addEventListener("keyup",A),window.addEventListener("blur",R),window.addEventListener("contextmenu",R),()=>{M?.removeEventListener("keydown",T),M?.removeEventListener("keyup",A),window.removeEventListener("blur",R),window.removeEventListener("contextmenu",R)}}},[Q,K]),Z}function xT(Q,U,Z){return Q.filter((K)=>Z||K.length===U.size).some((K)=>K.every((H)=>U.has(H)))}function mT(Q,U){return U.includes(Q)?"code":"key"}var iS=()=>{let Q=d0();return W1.useMemo(()=>{return{zoomIn:async(U)=>{let{panZoom:Z}=Q.getState();return Z?Z.scaleBy(1.2,U):!1},zoomOut:async(U)=>{let{panZoom:Z}=Q.getState();return Z?Z.scaleBy(0.8333333333333334,U):!1},zoomTo:async(U,Z)=>{let{panZoom:K}=Q.getState();return K?K.scaleTo(U,Z):!1},getZoom:()=>Q.getState().transform[2],setViewport:async(U,Z)=>{let{transform:[K,H,Y],panZoom:W}=Q.getState();if(!W)return!1;return await W.setViewport({x:U.x??K,y:U.y??H,zoom:U.zoom??Y},Z),!0},getViewport:()=>{let[U,Z,K]=Q.getState().transform;return{x:U,y:Z,zoom:K}},setCenter:async(U,Z,K)=>{return Q.getState().setCenter(U,Z,K)},fitBounds:async(U,Z)=>{let{width:K,height:H,minZoom:Y,maxZoom:W,panZoom:L}=Q.getState(),M=gJ(U,K,H,Y,W,Z?.padding??0.1);if(!L)return!1;return await L.setViewport(M,{duration:Z?.duration,ease:Z?.ease,interpolate:Z?.interpolate}),!0},screenToFlowPosition:(U,Z={})=>{let{transform:K,snapGrid:H,snapToGrid:Y,domNode:W}=Q.getState();if(!W)return U;let{x:L,y:M}=W.getBoundingClientRect(),O={x:U.x-L,y:U.y-M},T=Z.snapGrid??H,A=Z.snapToGrid??Y;return P9(O,K,A,T)},flowToScreenPosition:(U)=>{let{transform:Z,domNode:K}=Q.getState();if(!K)return U;let{x:H,y:Y}=K.getBoundingClientRect(),W=t8(U,Z);return{x:W.x+H,y:W.y+Y}}}},[])};function HR(Q,U){let Z=[],K=new Map,H=[];for(let Y of Q)if(Y.type==="add"){H.push(Y);continue}else if(Y.type==="remove"||Y.type==="replace")K.set(Y.id,[Y]);else{let W=K.get(Y.id);if(W)W.push(Y);else K.set(Y.id,[Y])}for(let Y of U){let W=K.get(Y.id);if(!W){Z.push(Y);continue}if(W[0].type==="remove")continue;if(W[0].type==="replace"){Z.push({...W[0].item});continue}let L={...Y};for(let M of W)dS(M,L);Z.push(L)}if(H.length)H.forEach((Y)=>{if(Y.index!==void 0)Z.splice(Y.index,0,{...Y.item});else Z.push({...Y.item})});return Z}function dS(Q,U){switch(Q.type){case"select":{U.selected=Q.selected;break}case"position":{if(typeof Q.position<"u")U.position=Q.position;if(typeof Q.dragging<"u")U.dragging=Q.dragging;break}case"dimensions":{if(typeof Q.dimensions<"u"){if(U.measured={...Q.dimensions},Q.setAttributes){if(Q.setAttributes===!0||Q.setAttributes==="width")U.width=Q.dimensions.width;if(Q.setAttributes===!0||Q.setAttributes==="height")U.height=Q.dimensions.height}}if(typeof Q.resizing==="boolean")U.resizing=Q.resizing;break}}}function YR(Q,U){return HR(Q,U)}function rS(Q,U){return HR(Q,U)}function e8(Q,U){return{id:Q,type:"select",selected:U}}function C9(Q,U=new Set,Z=!1){let K=[];for(let[H,Y]of Q){let W=U.has(H);if(!(Y.selected===void 0&&!W)&&Y.selected!==W){if(Z)Y.selected=W;K.push(e8(Y.id,W))}}return K}function gT({items:Q=[],lookup:U}){let Z=[],K=new Map(Q.map((H)=>[H.id,H]));for(let[H,Y]of Q.entries()){let W=U.get(Y.id),L=W?.internals?.userNode??W;if(L!==void 0&&L!==Y)Z.push({id:Y.id,item:Y,type:"replace"});if(L===void 0)Z.push({item:Y,type:"add",index:H})}for(let[H]of U)if(K.get(H)===void 0)Z.push({id:H,type:"remove"});return Z}function pT(Q){return{id:Q.id,type:"remove"}}var aS=kK("React Flow","https://reactflow.dev/");function sS(Q,U,Z={}){return $T(Q,U,{...Z,onError:Z.onError??aS})}var cT=(Q)=>iM(Q),tS=(Q)=>fK(Q);function zR(Q){return W1.forwardRef(Q)}var WR=typeof window<"u"?W1.useLayoutEffect:W1.useEffect;function lT(Q){let[U,Z]=W1.useState(BigInt(0)),[K]=W1.useState(()=>oS(()=>Z((H)=>H+BigInt(1))));return WR(()=>{let H=K.get();if(H.length)Q(H),K.reset()},[U]),K}function oS(Q){let U=[];return{get:()=>U,reset:()=>{U=[]},push:(Z)=>{U.push(Z),Q()}}}var LR=W1.createContext(null);function nS({children:Q}){let U=d0(),Z=W1.useCallback((L)=>{let{nodes:M=[],setNodes:O,hasDefaultNodes:T,onNodesChange:A,nodeLookup:R,fitViewQueued:w,onNodesChangeMiddlewareMap:P}=U.getState(),V=M;for(let C of L)V=typeof C==="function"?C(V):C;let S=gT({items:V,lookup:R});for(let C of P.values())S=C(S);if(T)O(V);if(S.length>0)A?.(S);else if(w)window.requestAnimationFrame(()=>{let{fitViewQueued:C,nodes:y,setNodes:N}=U.getState();if(C)N(y)})},[]),K=lT(Z),H=W1.useCallback((L)=>{let{edges:M=[],setEdges:O,hasDefaultEdges:T,onEdgesChange:A,edgeLookup:R}=U.getState(),w=M;for(let P of L)w=typeof P==="function"?P(w):P;if(T)O(w);else if(A)A(gT({items:w,lookup:R}))},[]),Y=lT(H),W=W1.useMemo(()=>({nodeQueue:K,edgeQueue:Y}),[]);return K1.jsx(LR.Provider,{value:W,children:Q})}function eS(){let Q=W1.useContext(LR);if(!Q)throw Error("useBatchContext must be used within a BatchProvider");return Q}var _v=(Q)=>!!Q.panZoom;function lJ(){let Q=iS(),U=d0(),Z=eS(),K=L0(_v),H=W1.useMemo(()=>{let Y=(A)=>U.getState().nodeLookup.get(A),W=(A)=>{Z.nodeQueue.push(A)},L=(A)=>{Z.edgeQueue.push(A)},M=(A)=>{let{nodeLookup:R,nodeOrigin:w}=U.getState(),P=cT(A)?A:R.get(A.id),V=P.parentId?uK(P.position,P.measured,P.parentId,R,w):P.position,S={...P,position:V,width:P.measured?.width??P.width,height:P.measured?.height??P.height};return I9(S)},O=(A,R,w={replace:!1})=>{W((P)=>P.map((V)=>{if(V.id===A){let S=typeof R==="function"?R(V):R;return w.replace&&cT(S)?S:{...V,...S}}return V}))},T=(A,R,w={replace:!1})=>{L((P)=>P.map((V)=>{if(V.id===A){let S=typeof R==="function"?R(V):R;return w.replace&&tS(S)?S:{...V,...S}}return V}))};return{getNodes:()=>U.getState().nodes.map((A)=>({...A})),getNode:(A)=>Y(A)?.internals.userNode,getInternalNode:Y,getEdges:()=>{let{edges:A=[]}=U.getState();return A.map((R)=>({...R}))},getEdge:(A)=>U.getState().edgeLookup.get(A),setNodes:W,setEdges:L,addNodes:(A)=>{let R=Array.isArray(A)?A:[A];Z.nodeQueue.push((w)=>[...w,...R])},addEdges:(A)=>{let R=Array.isArray(A)?A:[A];Z.edgeQueue.push((w)=>[...w,...R])},toObject:()=>{let{nodes:A=[],edges:R=[],transform:w}=U.getState(),[P,V,S]=w;return{nodes:A.map((C)=>({...C})),edges:R.map((C)=>({...C})),viewport:{x:P,y:V,zoom:S}}},deleteElements:async({nodes:A=[],edges:R=[]})=>{let{nodes:w,edges:P,onNodesDelete:V,onEdgesDelete:S,triggerNodeChanges:C,triggerEdgeChanges:y,onDelete:N,onBeforeDelete:v}=U.getState(),{nodes:D,edges:x}=await aM({nodesToRemove:A,edgesToRemove:R,nodes:w,edges:P,onBeforeDelete:v}),E=x.length>0,u=D.length>0;if(E){let b=x.map(pT);S?.(x),y(b)}if(u){let b=D.map(pT);V?.(D),C(b)}if(u||E)N?.({nodes:D,edges:x});return{deletedNodes:D,deletedEdges:x}},getIntersectingNodes:(A,R=!0,w)=>{let P=yK(A),V=P?A:M(A),S=w!==void 0;if(!V)return[];return(w||U.getState().nodes).filter((C)=>{let y=U.getState().nodeLookup.get(C.id);if(y&&!P&&(C.id===A.id||!y.internals.positionAbsolute))return!1;let N=I9(S?C:y),v=mJ(N,V);return R&&v>0||v>=N.width*N.height||v>=V.width*V.height})},isNodeIntersecting:(A,R,w=!0)=>{let V=yK(A)?A:M(A);if(!V)return!1;let S=mJ(V,R);return w&&S>0||S>=R.width*R.height||S>=V.width*V.height},updateNode:O,updateNodeData:(A,R,w={replace:!1})=>{O(A,(P)=>{let V=typeof R==="function"?R(P):R;return w.replace?{...P,data:V}:{...P,data:{...P.data,...V}}},w)},updateEdge:T,updateEdgeData:(A,R,w={replace:!1})=>{T(A,(P)=>{let V=typeof R==="function"?R(P):R;return w.replace?{...P,data:V}:{...P,data:{...P.data,...V}}},w)},getNodesBounds:(A)=>{let{nodeLookup:R,nodeOrigin:w}=U.getState();return vK(A,{nodeLookup:R,nodeOrigin:w})},getHandleConnections:({type:A,id:R,nodeId:w})=>Array.from(U.getState().connectionLookup.get(`${w}-${A}${R?`-${R}`:""}`)?.values()??[]),getNodeConnections:({type:A,handleId:R,nodeId:w})=>Array.from(U.getState().connectionLookup.get(`${w}${A?R?`-${A}-${R}`:`-${A}`:""}`)?.values()??[]),fitView:async(A)=>{let R=U.getState().fitViewResolver??oM();return U.setState({fitViewQueued:!0,fitViewOptions:A,fitViewResolver:R}),Z.nodeQueue.push((w)=>[...w]),R.promise}}},[]);return W1.useMemo(()=>{return{...H,...Q,viewportInitialized:K}},[K])}var iT=(Q)=>Q.selected,Jv=typeof window<"u"?window:void 0;function $v({deleteKeyCode:Q,multiSelectionKeyCode:U}){let Z=d0(),{deleteElements:K}=lJ(),H=cJ(Q,{actInsideInputWithModifier:!1}),Y=cJ(U,{target:Jv});W1.useEffect(()=>{if(H){let{edges:W,nodes:L}=Z.getState();K({nodes:L.filter(iT),edges:W.filter(iT)}),Z.setState({nodesSelectionActive:!1})}},[H]),W1.useEffect(()=>{Z.setState({multiSelectionActive:Y})},[Y])}function Qv(Q){let U=d0();W1.useEffect(()=>{let Z=()=>{if(!Q.current||!(Q.current.checkVisibility?.()??!0))return!1;let K=rq(Q.current);if(K.height===0||K.width===0)U.getState().onError?.("004",F5.error004());U.setState({width:K.width||500,height:K.height||500})};if(Q.current){Z(),window.addEventListener("resize",Z);let K=new ResizeObserver(()=>Z());return K.observe(Q.current),()=>{if(window.removeEventListener("resize",Z),K&&Q.current)K.unobserve(Q.current)}}},[])}var ZU={position:"absolute",width:"100%",height:"100%",top:0,left:0},qv=(Q)=>({userSelectionActive:Q.userSelectionActive,lib:Q.lib,connectionInProgress:Q.connection.inProgress});function Uv({onPaneContextMenu:Q,zoomOnScroll:U=!0,zoomOnPinch:Z=!0,panOnScroll:K=!1,panActivationKeyPressed:H,panOnScrollSpeed:Y=0.5,panOnScrollMode:W=h3.Free,zoomOnDoubleClick:L=!0,panOnDrag:M=!0,defaultViewport:O,translateExtent:T,minZoom:A,maxZoom:R,zoomActivationKeyCode:w,preventScrolling:P=!0,children:V,noWheelClassName:S,noPanClassName:C,onViewportChange:y,isControlledViewport:N,paneClickDistance:v,selectionOnDrag:D}){let x=d0(),E=W1.useRef(null),{userSelectionActive:u,lib:b,connectionInProgress:m}=L0(qv,i0),s=cJ(w),U1=W1.useRef();Qv(E);let Q1=W1.useCallback((h)=>{if(y?.({x:h[0],y:h[1],zoom:h[2]}),!N)x.setState({transform:h})},[y,N]);return W1.useEffect(()=>{if(E.current){U1.current=RT({domNode:E.current,minZoom:A,maxZoom:R,translateExtent:T,viewport:O,onDraggingChange:(c)=>x.setState((l)=>l.paneDragging===c?l:{paneDragging:c}),onPanZoomStart:(c,l)=>{let{onViewportChangeStart:o,onMoveStart:k}=x.getState();k?.(c,l),o?.(l)},onPanZoom:(c,l)=>{let{onViewportChange:o,onMove:k}=x.getState();k?.(c,l),o?.(l)},onPanZoomEnd:(c,l)=>{let{onViewportChangeEnd:o,onMoveEnd:k}=x.getState();k?.(c,l),o?.(l)}});let{x:h,y:g,zoom:p}=U1.current.getViewport();return x.setState({panZoom:U1.current,transform:[h,g,p],domNode:E.current.closest(".react-flow")}),()=>{U1.current?.destroy()}}},[]),W1.useEffect(()=>{U1.current?.update({onPaneContextMenu:Q,zoomOnScroll:U,zoomOnPinch:Z,panOnScroll:K,panActivationKeyPressed:H,panOnScrollSpeed:Y,panOnScrollMode:W,zoomOnDoubleClick:L,panOnDrag:M,zoomActivationKeyPressed:s,preventScrolling:P,noPanClassName:C,userSelectionActive:u,noWheelClassName:S,lib:b,onTransformChange:Q1,connectionInProgress:m,selectionOnDrag:D,paneClickDistance:v})},[Q,U,Z,K,H,Y,W,L,M,s,P,C,u,S,b,Q1,m,D,v]),K1.jsx("div",{className:"react-flow__renderer",ref:E,style:ZU,children:V})}var Gv=(Q)=>({userSelectionActive:Q.userSelectionActive,userSelectionRect:Q.userSelectionRect});function Zv(){let{userSelectionActive:Q,userSelectionRect:U}=L0(Gv,i0);if(!(Q&&U))return null;return K1.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:U.width,height:U.height,transform:`translate(${U.x}px, ${U.y}px)`}})}var aK=(Q,U)=>{return(Z)=>{if(Z.target!==U.current)return;Q?.(Z)}},Fv=(Q)=>({userSelectionActive:Q.userSelectionActive,elementsSelectable:Q.elementsSelectable,dragging:Q.paneDragging,panBy:Q.panBy,autoPanSpeed:Q.autoPanSpeed});function Xv({isSelecting:Q,selectionKeyPressed:U,selectionMode:Z=a8.Full,panOnDrag:K,autoPanOnSelection:H,paneClickDistance:Y,selectionOnDrag:W,onSelectionStart:L,onSelectionEnd:M,onPaneClick:O,onPaneContextMenu:T,onPaneScroll:A,onPaneMouseEnter:R,onPaneMouseMove:w,onPaneMouseLeave:P,children:V}){let S=W1.useRef(0),C=d0(),{userSelectionActive:y,elementsSelectable:N,dragging:v,panBy:D,autoPanSpeed:x}=L0(Fv,i0),E=N&&(Q||y),u=W1.useRef(null),b=W1.useRef(),m=W1.useRef(new Set),s=W1.useRef(new Set),U1=W1.useRef(!1),Q1=W1.useRef(!1),h=W1.useRef({x:0,y:0}),g=W1.useRef(!1),p=(G1)=>{if(Q1.current||U1.current||C.getState().connection.inProgress){Q1.current=!1,U1.current=!1;return}O?.(G1),C.getState().resetSelectedElements(),C.setState({nodesSelectionActive:!1})},c=(G1)=>{if(Array.isArray(K)&&K?.includes(2)){G1.preventDefault();return}T?.(G1)},l=A?(G1)=>A(G1):void 0,o=(G1)=>{if(Q1.current)G1.stopPropagation(),Q1.current=!1},k=(G1)=>{if(G1.pointerType==="touch"&&K!==!1&&!U)return;let{domNode:R1,transform:f1}=C.getState();if(b.current=R1?.getBoundingClientRect(),!b.current)return;let z1=G1.target===u.current;if(!z1&&!!G1.target.closest(".nokey")||!Q||!(W&&z1||U)||G1.button!==0||!G1.isPrimary)return;G1.target?.setPointerCapture?.(G1.pointerId),Q1.current=!1;let{x:c1,y:k1}=_4(G1.nativeEvent,b.current),A1=P9({x:c1,y:k1},f1);if(C.setState({userSelectionRect:{width:0,height:0,startX:A1.x,startY:A1.y,x:c1,y:k1}}),!z1)G1.stopPropagation(),G1.preventDefault()};function t(G1,R1){let{userSelectionRect:f1}=C.getState();if(!f1)return;let{transform:z1,nodeLookup:C1,edgeLookup:b1,connectionLookup:c1,triggerNodeChanges:k1,triggerEdgeChanges:A1,defaultEdgeOptions:e1}=C.getState(),D1={x:f1.startX,y:f1.startY},{x:g0,y:_0}=t8(D1,z1),t0={startX:D1.x,startY:D1.y,x:G1<g0?G1:g0,y:R1<_0?R1:_0,width:Math.abs(G1-g0),height:Math.abs(R1-_0)},C2=m.current,u2=s.current;m.current=new Set(cq(C1,t0,z1,Z===a8.Partial,!0).map((f2)=>f2.id)),s.current=new Set;let b2=e1?.selectable??!0;for(let f2 of m.current){let T2=c1.get(f2);if(!T2)continue;for(let{edgeId:G2}of T2.values()){let R2=b1.get(G2);if(R2&&(R2.selectable??b2))s.current.add(G2)}}if(!bK(C2,m.current)){let f2=C9(C1,m.current,!0);k1(f2)}if(!bK(u2,s.current)){let f2=C9(b1,s.current);A1(f2)}C.setState({userSelectionRect:t0,userSelectionActive:!0,nodesSelectionActive:!1})}function _1(){if(!H||!b.current)return;let[G1,R1]=lq(h.current,b.current,x);D({x:G1,y:R1}).then((f1)=>{if(!Q1.current||!f1){S.current=requestAnimationFrame(_1);return}let{x:z1,y:C1}=h.current;t(z1,C1),S.current=requestAnimationFrame(_1)})}let a=()=>{cancelAnimationFrame(S.current),S.current=0,g.current=!1};W1.useEffect(()=>{return()=>a()},[]);let H1=(G1)=>{let{userSelectionRect:R1,transform:f1,resetSelectedElements:z1}=C.getState();if(!b.current||!R1)return;let{x:C1,y:b1}=_4(G1.nativeEvent,b.current);h.current={x:C1,y:b1};let c1=t8({x:R1.startX,y:R1.startY},f1);if(!Q1.current){let k1=U?0:Y;if(Math.hypot(C1-c1.x,b1-c1.y)<=k1)return;z1(),L?.(G1)}if(Q1.current=!0,!g.current)_1(),g.current=!0;t(C1,b1)},O1=(G1)=>{if(!E){if(G1.target===u.current&&C.getState().connection.inProgress)U1.current=!0;return}if(G1.button!==0)return;if(G1.target?.releasePointerCapture?.(G1.pointerId),!y&&G1.target===u.current&&C.getState().userSelectionRect)p?.(G1);if(C.setState({userSelectionActive:!1,userSelectionRect:null}),Q1.current)M?.(G1),C.setState({nodesSelectionActive:m.current.size>0});a()},L1=(G1)=>{G1.target?.releasePointerCapture?.(G1.pointerId),a()},T1=K===!0||Array.isArray(K)&&K.includes(0);return K1.jsxs("div",{className:_2(["react-flow__pane",{draggable:T1,dragging:v,selection:Q}]),onClick:E?void 0:aK(p,u),onContextMenu:aK(c,u),onWheel:aK(l,u),onPointerEnter:E?void 0:R,onPointerMove:E?H1:w,onPointerUp:O1,onPointerCancel:E?L1:void 0,onPointerDownCapture:E?k:void 0,onClickCapture:E?o:void 0,onPointerLeave:P,ref:u,style:ZU,children:[V,K1.jsx(Zv,{})]})}function tK({id:Q,store:U,unselect:Z=!1,nodeRef:K}){let{addSelectedNodes:H,unselectNodesAndEdges:Y,multiSelectionActive:W,nodeLookup:L,onError:M}=U.getState(),O=L.get(Q);if(!O){M?.("012",F5.error012(Q));return}if(U.setState({nodesSelectionActive:!1}),!O.selected)H([Q]);else if(Z||O.selected&&W)Y({nodes:[O],edges:[]}),requestAnimationFrame(()=>K?.current?.blur())}function BR({nodeRef:Q,disabled:U=!1,noDragClassName:Z,handleSelector:K,nodeId:H,isSelectable:Y,nodeClickDistance:W}){let L=d0(),[M,O]=W1.useState(!1),T=W1.useRef();return W1.useEffect(()=>{if(U)return;return T.current=YT({getStoreItems:()=>L.getState(),onNodeMouseDown:(A)=>{tK({id:A,store:L,nodeRef:Q})},onDragStart:()=>{O(!0)},onDragStop:()=>{O(!1)}}),()=>{T.current?.destroy(),T.current=void 0}},[U,L,Q]),W1.useEffect(()=>{if(U||!Q.current||!T.current)return;T.current.update({noDragClassName:Z,handleSelector:K,domNode:Q.current,isSelectable:Y,nodeId:H,nodeClickDistance:W})},[Z,K,U,Y,Q,H,W]),M}var Kv=(Q)=>(U)=>U.selected&&(U.draggable||Q&&typeof U.draggable>"u");function AR(){let Q=d0();return W1.useCallback((Z)=>{let{nodeExtent:K,snapToGrid:H,snapGrid:Y,nodesDraggable:W,onError:L,updateNodePositions:M,nodeLookup:O,nodeOrigin:T}=Q.getState(),A=new Map,R=Kv(W),w=H?Y[0]:5,P=H?Y[1]:5,V=Z.direction.x*w*Z.factor,S=Z.direction.y*P*Z.factor;for(let[,C]of O){if(!R(C))continue;let y={x:C.internals.positionAbsolute.x+V,y:C.internals.positionAbsolute.y+S};if(H)y=w9(y,Y);let{position:N,positionAbsolute:v}=jK({nodeId:C.id,nextPosition:y,nodeLookup:O,nodeExtent:K,nodeOrigin:T,onError:L});C.position=N,C.internals.positionAbsolute=v,A.set(C.id,C)}M(A)},[])}var oK=W1.createContext(null),Hv=oK.Provider;oK.Consumer;var nK=()=>{return W1.useContext(oK)},Yv=(Q)=>({connectOnClick:Q.connectOnClick,noPanClassName:Q.noPanClassName,rfId:Q.rfId}),MR=W1.createContext(null);function zv({children:Q}){let U=L0(Yv,i0);return K1.jsx(MR.Provider,{value:U,children:Q})}function Wv(){let Q=W1.useContext(MR);if(!Q)throw Error("useHandleConfig must be used within a HandleConfigProvider");return Q}var Lv={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},Bv=(Q,U,Z)=>(K)=>{let{connectionClickStartHandle:H,connectionMode:Y,connection:W}=K,{fromHandle:L,toHandle:M,isValid:O}=W;if(!L&&!H)return Lv;let T=M?.nodeId===Q&&M?.id===U&&M?.type===Z;return{connectingFrom:L?.nodeId===Q&&L?.id===U&&L?.type===Z,connectingTo:T,clickConnecting:H?.nodeId===Q&&H?.id===U&&H?.type===Z,isPossibleEndHandle:Y===l6.Strict?L?.type!==Z:Q!==L?.nodeId||U!==L?.id,connectionInProcess:!!L,clickConnectionInProcess:!!H,valid:T&&O}};function Av({type:Q="source",position:U=E1.Top,isValidConnection:Z,isConnectable:K=!0,isConnectableStart:H=!0,isConnectableEnd:Y=!0,id:W,onConnect:L,children:M,className:O,onMouseDown:T,onTouchStart:A,...R},w){let P=W||null,V=Q==="target",S=d0(),C=nK(),{connectOnClick:y,noPanClassName:N,rfId:v}=Wv(),{connectingFrom:D,connectingTo:x,clickConnecting:E,isPossibleEndHandle:u,connectionInProcess:b,clickConnectionInProcess:m,valid:s}=L0(Bv(C,P,Q),i0);if(!C)S.getState().onError?.("010",F5.error010());let U1=(g)=>{let{defaultEdgeOptions:p,onConnect:c,hasDefaultEdges:l}=S.getState(),o={...p,...g};if(l){let{edges:k,setEdges:t,onError:_1}=S.getState();t(sS(o,k,{onError:_1}))}c?.(o),L?.(o)},Q1=(g)=>{if(!C)return;let p=mK(g.nativeEvent);if(H&&(p&&g.button===0||!p)){let c=S.getState();_U.onPointerDown(g.nativeEvent,{handleDomNode:g.currentTarget,autoPanOnConnect:c.autoPanOnConnect,connectionMode:c.connectionMode,connectionRadius:c.connectionRadius,domNode:c.domNode,nodeLookup:c.nodeLookup,lib:c.lib,isTarget:V,handleId:P,nodeId:C,flowId:c.rfId,panBy:c.panBy,cancelConnection:c.cancelConnection,onConnectStart:c.onConnectStart,onConnectEnd:(...l)=>S.getState().onConnectEnd?.(...l),updateConnection:c.updateConnection,onConnect:U1,isValidConnection:Z||((...l)=>S.getState().isValidConnection?.(...l)??!0),getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,autoPanSpeed:c.autoPanSpeed,dragThreshold:c.connectionDragThreshold})}if(p)T?.(g);else A?.(g)},h=(g)=>{let{onClickConnectStart:p,onClickConnectEnd:c,connectionClickStartHandle:l,connectionMode:o,isValidConnection:k,lib:t,rfId:_1,nodeLookup:a,connection:H1}=S.getState();if(!C||!l&&!H)return;if(!l){p?.(g.nativeEvent,{nodeId:C,handleId:P,handleType:Q}),S.setState({connectionClickStartHandle:{nodeId:C,type:Q,id:P}});return}let O1=hK(g.target),L1=Z||k,{connection:T1,isValid:G1}=_U.isValid(g.nativeEvent,{handle:{nodeId:C,id:P,type:Q},connectionMode:o,fromNodeId:l.nodeId,fromHandleId:l.id||null,fromType:l.type,isValidConnection:L1,flowId:_1,doc:O1,lib:t,nodeLookup:a});if(G1&&T1)U1(T1);let R1=structuredClone(H1);delete R1.inProgress,R1.toPosition=R1.toHandle?R1.toHandle.position:null,c?.(g,R1),S.setState({connectionClickStartHandle:null})};return K1.jsx("div",{"data-handleid":P,"data-nodeid":C,"data-handlepos":U,"data-id":`${v}-${C}-${P}-${Q}`,className:_2(["react-flow__handle",`react-flow__handle-${U}`,"nodrag",N,O,{source:!V,target:V,connectable:K,connectablestart:H,connectableend:Y,clickconnecting:E,connectingfrom:D,connectingto:x,valid:s,connectionindicator:K&&(!b||u)&&(b||m?Y:H)}]),onMouseDown:Q1,onTouchStart:Q1,onClick:y?h:void 0,ref:w,...R,children:M})}var qU=W1.memo(zR(Av));function Mv({data:Q,isConnectable:U,sourcePosition:Z=E1.Bottom}){return K1.jsxs(K1.Fragment,{children:[Q?.label,K1.jsx(qU,{type:"source",position:Z,isConnectable:U})]})}function Tv({data:Q,isConnectable:U,targetPosition:Z=E1.Top,sourcePosition:K=E1.Bottom}){return K1.jsxs(K1.Fragment,{children:[K1.jsx(qU,{type:"target",position:Z,isConnectable:U}),Q?.label,K1.jsx(qU,{type:"source",position:K,isConnectable:U})]})}function Rv(){return null}function Ov({data:Q,isConnectable:U,targetPosition:Z=E1.Top}){return K1.jsxs(K1.Fragment,{children:[K1.jsx(qU,{type:"target",position:Z,isConnectable:U}),Q?.label]})}var UU={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},dT={input:Mv,default:Tv,output:Ov,group:Rv};function Iv(Q){if(Q.internals.handleBounds===void 0)return{width:Q.width??Q.initialWidth??Q.style?.width,height:Q.height??Q.initialHeight??Q.style?.height};return{width:Q.width??Q.style?.width,height:Q.height??Q.style?.height}}var wv=(Q)=>{let{width:U,height:Z,x:K,y:H}=n8(Q.nodeLookup,{filter:(Y)=>!!Y.selected});return{width:e5(U)?U:null,height:e5(Z)?Z:null,userSelectionActive:Q.userSelectionActive,transformString:`translate(${Q.transform[0]}px,${Q.transform[1]}px) scale(${Q.transform[2]}) translate(${K}px,${H}px)`}};function Pv({onSelectionContextMenu:Q,noPanClassName:U,disableKeyboardA11y:Z}){let K=d0(),{width:H,height:Y,transformString:W,userSelectionActive:L}=L0(wv,i0),M=AR(),O=W1.useRef(null);W1.useEffect(()=>{if(!Z)O.current?.focus({preventScroll:!0})},[Z]);let T=!L&&H!==null&&Y!==null;if(BR({nodeRef:O,disabled:!T}),!T)return null;let A=Q?(w)=>{let P=K.getState().nodes.filter((V)=>V.selected);Q(w,P)}:void 0,R=(w)=>{if(Object.prototype.hasOwnProperty.call(UU,w.key))w.preventDefault(),M({direction:UU[w.key],factor:w.shiftKey?4:1})};return K1.jsx("div",{className:_2(["react-flow__nodesselection","react-flow__container",U]),style:{transform:W},children:K1.jsx("div",{ref:O,className:"react-flow__nodesselection-rect",onContextMenu:A,tabIndex:Z?void 0:-1,onKeyDown:Z?void 0:R,style:{width:H,height:Y}})})}var rT=typeof window<"u"?window:void 0,Nv=(Q)=>{return{nodesSelectionActive:Q.nodesSelectionActive,userSelectionActive:Q.userSelectionActive}};function TR({children:Q,onPaneClick:U,onPaneMouseEnter:Z,onPaneMouseMove:K,onPaneMouseLeave:H,onPaneContextMenu:Y,onPaneScroll:W,paneClickDistance:L,deleteKeyCode:M,selectionKeyCode:O,selectionOnDrag:T,selectionMode:A,onSelectionStart:R,onSelectionEnd:w,multiSelectionKeyCode:P,panActivationKeyCode:V,zoomActivationKeyCode:S,elementsSelectable:C,zoomOnScroll:y,zoomOnPinch:N,panOnScroll:v,panOnScrollSpeed:D,panOnScrollMode:x,zoomOnDoubleClick:E,panOnDrag:u,autoPanOnSelection:b,defaultViewport:m,translateExtent:s,minZoom:U1,maxZoom:Q1,preventScrolling:h,onSelectionContextMenu:g,noWheelClassName:p,noPanClassName:c,disableKeyboardA11y:l,onViewportChange:o,isControlledViewport:k}){let{nodesSelectionActive:t,userSelectionActive:_1}=L0(Nv,i0),a=cJ(O,{target:rT}),H1=cJ(V,{target:rT}),O1=H1||u,L1=H1||v,T1=T&&O1!==!0,G1=a||_1||T1;return $v({deleteKeyCode:M,multiSelectionKeyCode:P}),K1.jsx(Uv,{onPaneContextMenu:Y,elementsSelectable:C,zoomOnScroll:y,zoomOnPinch:N,panOnScroll:L1,panActivationKeyPressed:H1,panOnScrollSpeed:D,panOnScrollMode:x,zoomOnDoubleClick:E,panOnDrag:!a&&O1,defaultViewport:m,translateExtent:s,minZoom:U1,maxZoom:Q1,zoomActivationKeyCode:S,preventScrolling:h,noWheelClassName:p,noPanClassName:c,onViewportChange:o,isControlledViewport:k,paneClickDistance:L,selectionOnDrag:T1,children:K1.jsxs(Xv,{onSelectionStart:R,onSelectionEnd:w,onPaneClick:U,onPaneMouseEnter:Z,onPaneMouseMove:K,onPaneMouseLeave:H,onPaneContextMenu:Y,onPaneScroll:W,panOnDrag:O1,autoPanOnSelection:b,isSelecting:!!G1,selectionMode:A,selectionKeyPressed:a,paneClickDistance:L,selectionOnDrag:T1,children:[Q,t&&K1.jsx(Pv,{onSelectionContextMenu:g,noPanClassName:c,disableKeyboardA11y:l})]})})}TR.displayName="FlowRenderer";var Cv=W1.memo(TR),fv=(Q)=>(U)=>{return Q?cq(U.nodeLookup,{x:0,y:0,width:U.width,height:U.height},U.transform,!0).map((Z)=>Z.id):Array.from(U.nodeLookup.keys())};function Sv(Q){return L0(W1.useCallback(fv(Q),[Q]),i0)}var vv=(Q)=>Q.updateNodeInternals;function jv(){let Q=L0(vv),[U]=W1.useState(()=>{if(typeof ResizeObserver>"u")return null;return new ResizeObserver((Z)=>{let K=new Map;Z.forEach((H)=>{let Y=H.target.getAttribute("data-id");K.set(Y,{id:Y,nodeElement:H.target,force:!0})}),Q(K)})});return W1.useEffect(()=>{return()=>{U?.disconnect()}},[U]),U}function Vv({node:Q,nodeType:U,hasDimensions:Z,resizeObserver:K}){let H=d0(),Y=W1.useRef(null),W=W1.useRef(null),L=W1.useRef(Q.sourcePosition),M=W1.useRef(Q.targetPosition),O=W1.useRef(U),T=Z&&!!Q.internals.handleBounds;return W1.useEffect(()=>{if(Y.current&&!Q.hidden&&(!T||W.current!==Y.current)){if(W.current)K?.unobserve(W.current);K?.observe(Y.current),W.current=Y.current}},[T,Q.hidden]),W1.useEffect(()=>{return()=>{if(W.current)K?.unobserve(W.current),W.current=null}},[]),W1.useEffect(()=>{if(Y.current){let A=O.current!==U,R=L.current!==Q.sourcePosition,w=M.current!==Q.targetPosition;if(A||R||w)O.current=U,L.current=Q.sourcePosition,M.current=Q.targetPosition,H.getState().updateNodeInternals(new Map([[Q.id,{id:Q.id,nodeElement:Y.current,force:!0}]]))}},[Q.id,U,Q.sourcePosition,Q.targetPosition]),Y}function yv({id:Q,onClick:U,onMouseEnter:Z,onMouseMove:K,onMouseLeave:H,onContextMenu:Y,onDoubleClick:W,nodesDraggable:L,elementsSelectable:M,nodesConnectable:O,nodesFocusable:T,resizeObserver:A,noDragClassName:R,noPanClassName:w,disableKeyboardA11y:P,rfId:V,nodeTypes:S,nodeClickDistance:C,onError:y}){let{node:N,internals:v,isParent:D}=L0((G1)=>{let R1=G1.nodeLookup.get(Q),f1=G1.parentLookup.has(Q);return{node:R1,internals:R1.internals,isParent:f1}},i0),x=N.type||"default",E=S?.[x]||dT[x];if(E===void 0)y?.("003",F5.error003(x)),x="default",E=S?.default||dT.default;let u=!!(N.draggable||L&&typeof N.draggable>"u"),b=!!(N.selectable||M&&typeof N.selectable>"u"),m=!!(N.connectable||O&&typeof N.connectable>"u"),s=!!(N.focusable||T&&typeof N.focusable>"u"),U1=d0(),Q1=DK(N),h=Vv({node:N,nodeType:x,hasDimensions:Q1,resizeObserver:A}),g=BR({nodeRef:h,disabled:N.hidden||!u,noDragClassName:R,handleSelector:N.dragHandle,nodeId:Q,isSelectable:b,nodeClickDistance:C}),p=AR();if(N.hidden)return null;let c=J4(N),l=Iv(N),o=b||u||U||Z||K||H,k=Z?(G1)=>Z(G1,{...v.userNode}):void 0,t=K?(G1)=>K(G1,{...v.userNode}):void 0,_1=H?(G1)=>H(G1,{...v.userNode}):void 0,a=Y?(G1)=>Y(G1,{...v.userNode}):void 0,H1=W?(G1)=>W(G1,{...v.userNode}):void 0,O1=(G1)=>{let{selectNodesOnDrag:R1,nodeDragThreshold:f1}=U1.getState();if(b&&(!R1||!u||f1>0))tK({id:Q,store:U1,nodeRef:h});if(U)U(G1,{...v.userNode})},L1=(G1)=>{if(xK(G1.nativeEvent)||P)return;if(PK.includes(G1.key)&&b){let R1=G1.key==="Escape";tK({id:Q,store:U1,unselect:R1,nodeRef:h})}else if(u&&N.selected&&Object.prototype.hasOwnProperty.call(UU,G1.key)){G1.preventDefault();let{ariaLabelConfig:R1}=U1.getState();U1.setState({ariaLiveMessage:R1["node.a11yDescription.ariaLiveMessage"]({direction:G1.key.replace("Arrow","").toLowerCase(),x:~~v.positionAbsolute.x,y:~~v.positionAbsolute.y})}),p({direction:UU[G1.key],factor:G1.shiftKey?4:1})}},T1=()=>{if(P||!h.current?.matches(":focus-visible"))return;let{transform:G1,width:R1,height:f1,autoPanOnNodeFocus:z1,setCenter:C1}=U1.getState();if(!z1)return;if(!(cq(new Map([[Q,N]]),{x:0,y:0,width:R1,height:f1},G1,!0).length>0))C1(N.position.x+c.width/2,N.position.y+c.height/2,{zoom:G1[2]})};return K1.jsx("div",{className:_2(["react-flow__node",`react-flow__node-${x}`,{[w]:u},N.className,{selected:N.selected,selectable:b,parent:D,draggable:u,dragging:g}]),ref:h,style:{zIndex:v.z,transform:`translate(${v.positionAbsolute.x}px,${v.positionAbsolute.y}px)`,pointerEvents:o?"all":"none",visibility:Q1?"visible":"hidden",...N.style,...l},"data-id":Q,"data-testid":`rf__node-${Q}`,onMouseEnter:k,onMouseMove:t,onMouseLeave:_1,onContextMenu:a,onClick:O1,onDoubleClick:H1,onKeyDown:s?L1:void 0,tabIndex:s?0:void 0,onFocus:s?T1:void 0,role:N.ariaRole??(s?"group":void 0),"aria-roledescription":"node","aria-describedby":P?void 0:`${FR}-${V}`,"aria-label":N.ariaLabel,...N.domAttributes,children:K1.jsx(Hv,{value:Q,children:K1.jsx(E,{id:Q,data:N.data,type:x,positionAbsoluteX:v.positionAbsolute.x,positionAbsoluteY:v.positionAbsolute.y,selected:N.selected??!1,selectable:b,draggable:u,deletable:N.deletable??!0,isConnectable:m,sourcePosition:N.sourcePosition,targetPosition:N.targetPosition,dragging:g,dragHandle:N.dragHandle,zIndex:v.z,parentId:N.parentId,...c})})})}var kv=W1.memo(yv),Dv=(Q)=>({nodesConnectable:Q.nodesConnectable,nodesFocusable:Q.nodesFocusable,elementsSelectable:Q.elementsSelectable,onError:Q.onError});function RR(Q){let{nodesConnectable:U,nodesFocusable:Z,elementsSelectable:K,onError:H}=L0(Dv,i0),Y=Sv(Q.onlyRenderVisibleElements),W=jv();return K1.jsx("div",{className:"react-flow__nodes",style:ZU,children:Y.map((L)=>{return K1.jsx(kv,{id:L,nodeTypes:Q.nodeTypes,nodeExtent:Q.nodeExtent,onClick:Q.onNodeClick,onMouseEnter:Q.onNodeMouseEnter,onMouseMove:Q.onNodeMouseMove,onMouseLeave:Q.onNodeMouseLeave,onContextMenu:Q.onNodeContextMenu,onDoubleClick:Q.onNodeDoubleClick,noDragClassName:Q.noDragClassName,noPanClassName:Q.noPanClassName,rfId:Q.rfId,disableKeyboardA11y:Q.disableKeyboardA11y,resizeObserver:W,nodesDraggable:Q.nodesDraggable??!0,nodesConnectable:U,nodesFocusable:Z,elementsSelectable:K,nodeClickDistance:Q.nodeClickDistance,onError:H},L)})})}RR.displayName="NodeRenderer";var uv=W1.memo(RR);function bv(Q){return L0(W1.useCallback((Z)=>{if(!Q)return Z.edges.map((H)=>H.id);let K=[];if(Z.width&&Z.height)for(let H of Z.edges){let Y=Z.nodeLookup.get(H.source),W=Z.nodeLookup.get(H.target);if(Y&&W&&JT({sourceNode:Y,targetNode:W,width:Z.width,height:Z.height,transform:Z.transform}))K.push(H.id)}return K},[Q]),i0)}var Ev=({color:Q="none",strokeWidth:U=1})=>{let Z={strokeWidth:U,...Q&&{stroke:Q}};return K1.jsx("polyline",{className:"arrow",style:Z,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},hv=({color:Q="none",strokeWidth:U=1})=>{let Z={strokeWidth:U,...Q&&{stroke:Q,fill:Q}};return K1.jsx("polyline",{className:"arrowclosed",style:Z,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},aT={[T9.Arrow]:Ev,[T9.ArrowClosed]:hv};function xv(Q){let U=d0();return W1.useMemo(()=>{if(!Object.prototype.hasOwnProperty.call(aT,Q))return U.getState().onError?.("009",F5.error009(Q)),null;return aT[Q]},[Q])}var mv=({id:Q,type:U,color:Z,width:K=12.5,height:H=12.5,markerUnits:Y="strokeWidth",strokeWidth:W,orient:L="auto-start-reverse"})=>{let M=xv(U);if(!M)return null;return K1.jsx("marker",{className:"react-flow__arrowhead",id:Q,markerWidth:`${K}`,markerHeight:`${H}`,viewBox:"-10 -10 20 20",markerUnits:Y,orient:L,refX:"0",refY:"0",children:K1.jsx(M,{color:Z,strokeWidth:W})})},OR=({defaultColor:Q,rfId:U})=>{let Z=L0((Y)=>Y.edges),K=L0((Y)=>Y.defaultEdgeOptions),H=W1.useMemo(()=>{return qT(Z,{id:U,defaultColor:Q,defaultMarkerStart:K?.markerStart,defaultMarkerEnd:K?.markerEnd})},[Z,K,U,Q]);if(!H.length)return null;return K1.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:K1.jsx("defs",{children:H.map((Y)=>K1.jsx(mv,{id:Y.id,type:Y.type,color:Y.color,width:Y.width,height:Y.height,markerUnits:Y.markerUnits,strokeWidth:Y.strokeWidth,orient:Y.orient},Y.id))})})};OR.displayName="MarkerDefinitions";var gv=W1.memo(OR);function IR({x:Q,y:U,label:Z,labelStyle:K,labelShowBg:H=!0,labelBgStyle:Y,labelBgPadding:W=[2,4],labelBgBorderRadius:L=2,children:M,className:O,...T}){let[A,R]=W1.useState({x:1,y:0,width:0,height:0}),w=_2(["react-flow__edge-textwrapper",O]),P=W1.useRef(null);if(W1.useEffect(()=>{if(P.current){let V=P.current.getBBox();R({x:V.x,y:V.y,width:V.width,height:V.height})}},[Z]),!Z)return null;return K1.jsxs("g",{transform:`translate(${Q-A.width/2} ${U-A.height/2})`,className:w,visibility:A.width?"visible":"hidden",...T,children:[H&&K1.jsx("rect",{width:A.width+2*W[0],x:-W[0],y:-W[1],height:A.height+2*W[1],className:"react-flow__edge-textbg",style:Y,rx:L,ry:L}),K1.jsx("text",{className:"react-flow__edge-text",y:A.height/2,dy:"0.3em",ref:P,style:K,children:Z}),M]})}IR.displayName="EdgeText";var pv=W1.memo(IR);function FU({path:Q,labelX:U,labelY:Z,label:K,labelStyle:H,labelShowBg:Y,labelBgStyle:W,labelBgPadding:L,labelBgBorderRadius:M,interactionWidth:O=20,...T}){return K1.jsxs(K1.Fragment,{children:[K1.jsx("path",{...T,d:Q,fill:"none",className:_2(["react-flow__edge-path",T.className])}),O?K1.jsx("path",{d:Q,fill:"none",strokeOpacity:0,strokeWidth:O,className:"react-flow__edge-interaction"}):null,K&&e5(U)&&e5(Z)?K1.jsx(pv,{x:U,y:Z,label:K,labelStyle:H,labelShowBg:Y,labelBgStyle:W,labelBgPadding:L,labelBgBorderRadius:M}):null]})}function sT({pos:Q,x1:U,y1:Z,x2:K,y2:H}){if(Q===E1.Left||Q===E1.Right)return[0.5*(U+K),Z];return[U,0.5*(Z+H)]}function wR({sourceX:Q,sourceY:U,sourcePosition:Z=E1.Bottom,targetX:K,targetY:H,targetPosition:Y=E1.Top}){let[W,L]=sT({pos:Z,x1:Q,y1:U,x2:K,y2:H}),[M,O]=sT({pos:Y,x1:K,y1:H,x2:Q,y2:U}),[T,A,R,w]=aq({sourceX:Q,sourceY:U,targetX:K,targetY:H,sourceControlX:W,sourceControlY:L,targetControlX:M,targetControlY:O});return[`M${Q},${U} C${W},${L} ${M},${O} ${K},${H}`,T,A,R,w]}function PR(Q){return W1.memo(({id:U,sourceX:Z,sourceY:K,targetX:H,targetY:Y,sourcePosition:W,targetPosition:L,label:M,labelStyle:O,labelShowBg:T,labelBgStyle:A,labelBgPadding:R,labelBgBorderRadius:w,style:P,markerEnd:V,markerStart:S,interactionWidth:C})=>{let[y,N,v]=wR({sourceX:Z,sourceY:K,sourcePosition:W,targetX:H,targetY:Y,targetPosition:L}),D=Q.isInternal?void 0:U;return K1.jsx(FU,{id:D,path:y,labelX:N,labelY:v,label:M,labelStyle:O,labelShowBg:T,labelBgStyle:A,labelBgPadding:R,labelBgBorderRadius:w,style:P,markerEnd:V,markerStart:S,interactionWidth:C})})}var cv=PR({isInternal:!1}),NR=PR({isInternal:!0});cv.displayName="SimpleBezierEdge";NR.displayName="SimpleBezierEdgeInternal";function CR(Q){return W1.memo(({id:U,sourceX:Z,sourceY:K,targetX:H,targetY:Y,label:W,labelStyle:L,labelShowBg:M,labelBgStyle:O,labelBgPadding:T,labelBgBorderRadius:A,style:R,sourcePosition:w=E1.Bottom,targetPosition:P=E1.Top,markerEnd:V,markerStart:S,pathOptions:C,interactionWidth:y})=>{let[N,v,D]=pJ({sourceX:Z,sourceY:K,sourcePosition:w,targetX:H,targetY:Y,targetPosition:P,borderRadius:C?.borderRadius,offset:C?.offset,stepPosition:C?.stepPosition}),x=Q.isInternal?void 0:U;return K1.jsx(FU,{id:x,path:N,labelX:v,labelY:D,label:W,labelStyle:L,labelShowBg:M,labelBgStyle:O,labelBgPadding:T,labelBgBorderRadius:A,style:R,markerEnd:V,markerStart:S,interactionWidth:y})})}var fR=CR({isInternal:!1}),SR=CR({isInternal:!0});fR.displayName="SmoothStepEdge";SR.displayName="SmoothStepEdgeInternal";function vR(Q){return W1.memo(({id:U,...Z})=>{let K=Q.isInternal?void 0:U;return K1.jsx(fR,{...Z,id:K,pathOptions:W1.useMemo(()=>({borderRadius:0,offset:Z.pathOptions?.offset}),[Z.pathOptions?.offset])})})}var lv=vR({isInternal:!1}),jR=vR({isInternal:!0});lv.displayName="StepEdge";jR.displayName="StepEdgeInternal";function VR(Q){return W1.memo(({id:U,sourceX:Z,sourceY:K,targetX:H,targetY:Y,label:W,labelStyle:L,labelShowBg:M,labelBgStyle:O,labelBgPadding:T,labelBgBorderRadius:A,style:R,markerEnd:w,markerStart:P,interactionWidth:V})=>{let[S,C,y]=tq({sourceX:Z,sourceY:K,targetX:H,targetY:Y}),N=Q.isInternal?void 0:U;return K1.jsx(FU,{id:N,path:S,labelX:C,labelY:y,label:W,labelStyle:L,labelShowBg:M,labelBgStyle:O,labelBgPadding:T,labelBgBorderRadius:A,style:R,markerEnd:w,markerStart:P,interactionWidth:V})})}var iv=VR({isInternal:!1}),yR=VR({isInternal:!0});iv.displayName="StraightEdge";yR.displayName="StraightEdgeInternal";function kR(Q){return W1.memo(({id:U,sourceX:Z,sourceY:K,targetX:H,targetY:Y,sourcePosition:W=E1.Bottom,targetPosition:L=E1.Top,label:M,labelStyle:O,labelShowBg:T,labelBgStyle:A,labelBgPadding:R,labelBgBorderRadius:w,style:P,markerEnd:V,markerStart:S,pathOptions:C,interactionWidth:y})=>{let[N,v,D]=sq({sourceX:Z,sourceY:K,sourcePosition:W,targetX:H,targetY:Y,targetPosition:L,curvature:C?.curvature}),x=Q.isInternal?void 0:U;return K1.jsx(FU,{id:x,path:N,labelX:v,labelY:D,label:M,labelStyle:O,labelShowBg:T,labelBgStyle:A,labelBgPadding:R,labelBgBorderRadius:w,style:P,markerEnd:V,markerStart:S,interactionWidth:y})})}var dv=kR({isInternal:!1}),DR=kR({isInternal:!0});dv.displayName="BezierEdge";DR.displayName="BezierEdgeInternal";var tT={default:DR,straight:yR,step:jR,smoothstep:SR,simplebezier:NR},oT={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},rv=(Q,U,Z)=>{if(Z===E1.Left)return Q-U;if(Z===E1.Right)return Q+U;return Q},av=(Q,U,Z)=>{if(Z===E1.Top)return Q-U;if(Z===E1.Bottom)return Q+U;return Q},nT="react-flow__edgeupdater";function eT({position:Q,centerX:U,centerY:Z,radius:K=10,onMouseDown:H,onMouseEnter:Y,onMouseOut:W,type:L}){return K1.jsx("circle",{onMouseDown:H,onMouseEnter:Y,onMouseOut:W,className:_2([nT,`${nT}-${L}`]),cx:rv(U,K,Q),cy:av(Z,K,Q),r:K,stroke:"transparent",fill:"transparent"})}function sv({isReconnectable:Q,reconnectRadius:U,edge:Z,sourceX:K,sourceY:H,targetX:Y,targetY:W,sourcePosition:L,targetPosition:M,onReconnect:O,onReconnectStart:T,onReconnectEnd:A,setReconnecting:R,setUpdateHover:w}){let P=d0(),V=(v,D)=>{if(v.button!==0)return;let{autoPanOnConnect:x,domNode:E,connectionMode:u,connectionRadius:b,lib:m,onConnectStart:s,cancelConnection:U1,nodeLookup:Q1,rfId:h,panBy:g,updateConnection:p}=P.getState(),c=D.type==="target",l=(t,_1)=>{R(!1),A?.(t,Z,D.type,_1)},o=(t)=>O?.(Z,t),k=(t,_1)=>{R(!0),T?.(v,Z,D.type),s?.(t,_1)};_U.onPointerDown(v.nativeEvent,{autoPanOnConnect:x,connectionMode:u,connectionRadius:b,domNode:E,handleId:D.id,nodeId:D.nodeId,nodeLookup:Q1,isTarget:c,edgeUpdaterType:D.type,lib:m,flowId:h,cancelConnection:U1,panBy:g,isValidConnection:(...t)=>P.getState().isValidConnection?.(...t)??!0,onConnect:o,onConnectStart:k,onConnectEnd:(...t)=>P.getState().onConnectEnd?.(...t),onReconnectEnd:l,updateConnection:p,getTransform:()=>P.getState().transform,getFromHandle:()=>P.getState().connection.fromHandle,dragThreshold:P.getState().connectionDragThreshold,handleDomNode:v.currentTarget})},S=(v)=>V(v,{nodeId:Z.target,id:Z.targetHandle??null,type:"target"}),C=(v)=>V(v,{nodeId:Z.source,id:Z.sourceHandle??null,type:"source"}),y=()=>w(!0),N=()=>w(!1);return K1.jsxs(K1.Fragment,{children:[(Q===!0||Q==="source")&&K1.jsx(eT,{position:L,centerX:K,centerY:H,radius:U,onMouseDown:S,onMouseEnter:y,onMouseOut:N,type:"source"}),(Q===!0||Q==="target")&&K1.jsx(eT,{position:M,centerX:Y,centerY:W,radius:U,onMouseDown:C,onMouseEnter:y,onMouseOut:N,type:"target"})]})}function tv({id:Q,edgesFocusable:U,edgesReconnectable:Z,elementsSelectable:K,onClick:H,onDoubleClick:Y,onContextMenu:W,onMouseEnter:L,onMouseMove:M,onMouseLeave:O,reconnectRadius:T,onReconnect:A,onReconnectStart:R,onReconnectEnd:w,rfId:P,edgeTypes:V,noPanClassName:S,onError:C,disableKeyboardA11y:y}){let N=L0((C1)=>C1.edgeLookup.get(Q)),v=L0((C1)=>C1.defaultEdgeOptions);N=v?{...v,...N}:N;let D=N.type||"default",x=V?.[D]||tT[D];if(x===void 0)C?.("011",F5.error011(D)),D="default",x=V?.default||tT.default;let E=!!(N.focusable||U&&typeof N.focusable>"u"),u=typeof A<"u"&&(N.reconnectable||Z&&typeof N.reconnectable>"u"),b=!!(N.selectable||K&&typeof N.selectable>"u"),m=W1.useRef(null),[s,U1]=W1.useState(!1),[Q1,h]=W1.useState(!1),g=d0(),{zIndex:p=N.zIndex,sourceX:c,sourceY:l,targetX:o,targetY:k,sourcePosition:t,targetPosition:_1}=L0(W1.useCallback((C1)=>{let b1=C1.nodeLookup.get(N.source),c1=C1.nodeLookup.get(N.target);if(!b1||!c1)return oT;let k1=QT({id:Q,sourceNode:b1,targetNode:c1,sourceHandle:N.sourceHandle||null,targetHandle:N.targetHandle||null,connectionMode:C1.connectionMode,onError:C}),A1=_T({selected:N.selected,zIndex:N.zIndex,sourceNode:b1,targetNode:c1,elevateOnSelect:C1.elevateEdgesOnSelect,zIndexMode:C1.zIndexMode});return{...k1||oT,zIndex:A1}},[N.source,N.target,N.sourceHandle,N.targetHandle,N.selected,N.zIndex,C]),i0),a=W1.useMemo(()=>N.markerStart?`url('#${oq(N.markerStart,P)}')`:void 0,[N.markerStart,P]),H1=W1.useMemo(()=>N.markerEnd?`url('#${oq(N.markerEnd,P)}')`:void 0,[N.markerEnd,P]);if(N.hidden||c===null||l===null||o===null||k===null)return null;let O1=(C1)=>{let{addSelectedEdges:b1,unselectNodesAndEdges:c1,multiSelectionActive:k1}=g.getState();if(b)if(g.setState({nodesSelectionActive:!1}),N.selected&&k1)c1({nodes:[],edges:[N]}),m.current?.blur();else b1([Q]);if(H)H(C1,N)},L1=Y?(C1)=>{Y(C1,{...N})}:void 0,T1=W?(C1)=>{W(C1,{...N})}:void 0,G1=L?(C1)=>{L(C1,{...N})}:void 0,R1=M?(C1)=>{M(C1,{...N})}:void 0,f1=O?(C1)=>{O(C1,{...N})}:void 0,z1=(C1)=>{if(!y&&PK.includes(C1.key)&&b){let{unselectNodesAndEdges:b1,addSelectedEdges:c1}=g.getState();if(C1.key==="Escape")m.current?.blur(),b1({edges:[N]});else c1([Q])}};return K1.jsx("svg",{style:{zIndex:p},children:K1.jsxs("g",{className:_2(["react-flow__edge",`react-flow__edge-${D}`,N.className,S,{selected:N.selected,animated:N.animated,inactive:!b&&!H,updating:s,selectable:b}]),onClick:O1,onDoubleClick:L1,onContextMenu:T1,onMouseEnter:G1,onMouseMove:R1,onMouseLeave:f1,onKeyDown:E?z1:void 0,tabIndex:E?0:void 0,role:N.ariaRole??(E?"group":"img"),"aria-roledescription":"edge","data-id":Q,"data-testid":`rf__edge-${Q}`,"aria-label":N.ariaLabel===null?void 0:N.ariaLabel||`Edge from ${N.source} to ${N.target}`,"aria-describedby":E?`${XR}-${P}`:void 0,ref:m,...N.domAttributes,children:[!Q1&&K1.jsx(x,{id:Q,source:N.source,target:N.target,type:N.type,selected:N.selected,animated:N.animated,selectable:b,deletable:N.deletable??!0,label:N.label,labelStyle:N.labelStyle,labelShowBg:N.labelShowBg,labelBgStyle:N.labelBgStyle,labelBgPadding:N.labelBgPadding,labelBgBorderRadius:N.labelBgBorderRadius,sourceX:c,sourceY:l,targetX:o,targetY:k,sourcePosition:t,targetPosition:_1,data:N.data,style:N.style,sourceHandleId:N.sourceHandle,targetHandleId:N.targetHandle,markerStart:a,markerEnd:H1,pathOptions:"pathOptions"in N?N.pathOptions:void 0,interactionWidth:N.interactionWidth}),u&&K1.jsx(sv,{edge:N,isReconnectable:u,reconnectRadius:T,onReconnect:A,onReconnectStart:R,onReconnectEnd:w,sourceX:c,sourceY:l,targetX:o,targetY:k,sourcePosition:t,targetPosition:_1,setUpdateHover:U1,setReconnecting:h})]})})}var ov=W1.memo(tv),nv=(Q)=>({edgesFocusable:Q.edgesFocusable,edgesReconnectable:Q.edgesReconnectable,elementsSelectable:Q.elementsSelectable,connectionMode:Q.connectionMode,onError:Q.onError});function uR({defaultMarkerColor:Q,onlyRenderVisibleElements:U,rfId:Z,edgeTypes:K,noPanClassName:H,onReconnect:Y,onEdgeContextMenu:W,onEdgeMouseEnter:L,onEdgeMouseMove:M,onEdgeMouseLeave:O,onEdgeClick:T,reconnectRadius:A,onEdgeDoubleClick:R,onReconnectStart:w,onReconnectEnd:P,disableKeyboardA11y:V}){let{edgesFocusable:S,edgesReconnectable:C,elementsSelectable:y,onError:N}=L0(nv,i0),v=bv(U);return K1.jsxs("div",{className:"react-flow__edges",children:[K1.jsx(gv,{defaultColor:Q,rfId:Z}),v.map((D)=>{return K1.jsx(ov,{id:D,edgesFocusable:S,edgesReconnectable:C,elementsSelectable:y,noPanClassName:H,onReconnect:Y,onContextMenu:W,onMouseEnter:L,onMouseMove:M,onMouseLeave:O,onClick:T,reconnectRadius:A,onDoubleClick:R,onReconnectStart:w,onReconnectEnd:P,rfId:Z,onError:N,edgeTypes:K,disableKeyboardA11y:V},D)})]})}uR.displayName="EdgeRenderer";var ev=W1.memo(uR),_R=(Q)=>`translate(${Q[0]}px,${Q[1]}px) scale(${Q[2]})`;function _j({children:Q}){let U=d0(),Z=W1.useRef(null),[K]=W1.useState(()=>U.getState().transform);return WR(()=>{let H=null,Y=()=>{let W=U.getState().transform;if(H&&W[0]===H[0]&&W[1]===H[1]&&W[2]===H[2])return;if(H=W,Z.current)Z.current.style.transform=_R(W)};return Y(),U.subscribe(Y)},[U]),K1.jsx("div",{ref:Z,className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:_R(K)},children:Q})}function Jj(Q){let U=lJ(),Z=W1.useRef(!1);W1.useEffect(()=>{if(!Z.current&&U.viewportInitialized&&Q)setTimeout(()=>Q(U),1),Z.current=!0},[Q,U.viewportInitialized])}var $j=(Q)=>Q.panZoom?.syncViewport;function Qj(Q){let U=L0($j),Z=d0();return W1.useEffect(()=>{if(Q)U?.(Q),Z.setState({transform:[Q.x,Q.y,Q.zoom]})},[Q,U]),null}function JR(Q){return Q.connection.inProgress?{...Q.connection,to:P9(Q.connection.to,Q.transform)}:{...Q.connection}}function qj(Q){if(Q)return(Z)=>{let K=JR(Z);return Q(K)};return JR}function Uj(Q){let U=qj(Q);return L0(U,i0)}var Gj=(Q)=>({nodesConnectable:Q.nodesConnectable,isValid:Q.connection.isValid,inProgress:Q.connection.inProgress,width:Q.width,height:Q.height});function Zj({containerStyle:Q,style:U,type:Z,component:K}){let{nodesConnectable:H,width:Y,height:W,isValid:L,inProgress:M}=L0(Gj,i0);if(!(Y&&H&&M))return null;return K1.jsx("svg",{style:Q,width:Y,height:W,className:"react-flow__connectionline react-flow__container",children:K1.jsx("g",{className:_2(["react-flow__connection",EK(L)]),children:K1.jsx(bR,{style:U,type:Z,CustomComponent:K,isValid:L})})})}var bR=({style:Q,type:U=$3.Bezier,CustomComponent:Z,isValid:K})=>{let{inProgress:H,from:Y,fromNode:W,fromHandle:L,fromPosition:M,to:O,toNode:T,toHandle:A,toPosition:R,pointer:w}=Uj();if(!H)return;if(Z)return K1.jsx(Z,{connectionLineType:U,connectionLineStyle:Q,fromNode:W,fromHandle:L,fromX:Y.x,fromY:Y.y,toX:O.x,toY:O.y,fromPosition:M,toPosition:R,connectionStatus:EK(K),toNode:T,toHandle:A,pointer:w});let P="",V={sourceX:Y.x,sourceY:Y.y,sourcePosition:M,targetX:O.x,targetY:O.y,targetPosition:R};switch(U){case $3.Bezier:[P]=sq(V);break;case $3.SimpleBezier:[P]=wR(V);break;case $3.Step:[P]=pJ({...V,borderRadius:0});break;case $3.SmoothStep:[P]=pJ(V);break;default:[P]=tq(V)}return K1.jsx("path",{d:P,fill:"none",className:"react-flow__connection-path",style:Q})};bR.displayName="ConnectionLine";var Fj={};function $R(Q=Fj){let U=W1.useRef(Q),Z=d0();W1.useEffect(()=>{{let K=new Set([...Object.keys(U.current),...Object.keys(Q)]);for(let H of K)if(U.current[H]!==Q[H]){Z.getState().onError?.("002",F5.error002());break}U.current=Q}},[Q])}function Xj(){let Q=d0(),U=W1.useRef(!1);W1.useEffect(()=>{if(!U.current){let Z=document.querySelector(".react-flow__pane");if(Z&&window.getComputedStyle(Z).zIndex!=="1")Q.getState().onError?.("013",F5.error013("react"));U.current=!0}},[])}function ER({nodeTypes:Q,edgeTypes:U,onInit:Z,onNodeClick:K,onEdgeClick:H,onNodeDoubleClick:Y,onEdgeDoubleClick:W,onNodeMouseEnter:L,onNodeMouseMove:M,onNodeMouseLeave:O,onNodeContextMenu:T,onSelectionContextMenu:A,onSelectionStart:R,onSelectionEnd:w,connectionLineType:P,connectionLineStyle:V,connectionLineComponent:S,connectionLineContainerStyle:C,selectionKeyCode:y,selectionOnDrag:N,selectionMode:v,multiSelectionKeyCode:D,panActivationKeyCode:x,zoomActivationKeyCode:E,deleteKeyCode:u,onlyRenderVisibleElements:b,elementsSelectable:m,defaultViewport:s,translateExtent:U1,minZoom:Q1,maxZoom:h,preventScrolling:g,defaultMarkerColor:p,zoomOnScroll:c,zoomOnPinch:l,panOnScroll:o,panOnScrollSpeed:k,panOnScrollMode:t,zoomOnDoubleClick:_1,panOnDrag:a,autoPanOnSelection:H1,onPaneClick:O1,onPaneMouseEnter:L1,onPaneMouseMove:T1,onPaneMouseLeave:G1,onPaneScroll:R1,onPaneContextMenu:f1,paneClickDistance:z1,nodeClickDistance:C1,onEdgeContextMenu:b1,onEdgeMouseEnter:c1,onEdgeMouseMove:k1,onEdgeMouseLeave:A1,reconnectRadius:e1,onReconnect:D1,onReconnectStart:g0,onReconnectEnd:_0,noDragClassName:t0,noWheelClassName:C2,noPanClassName:u2,disableKeyboardA11y:b2,nodeExtent:f2,rfId:T2,viewport:G2,onViewportChange:R2,nodesDraggable:I4}){return $R(Q),$R(U),Xj(),Jj(Z),Qj(G2),K1.jsx(Cv,{onPaneClick:O1,onPaneMouseEnter:L1,onPaneMouseMove:T1,onPaneMouseLeave:G1,onPaneContextMenu:f1,onPaneScroll:R1,paneClickDistance:z1,deleteKeyCode:u,selectionKeyCode:y,selectionOnDrag:N,selectionMode:v,onSelectionStart:R,onSelectionEnd:w,multiSelectionKeyCode:D,panActivationKeyCode:x,zoomActivationKeyCode:E,elementsSelectable:m,zoomOnScroll:c,zoomOnPinch:l,zoomOnDoubleClick:_1,panOnScroll:o,panOnScrollSpeed:k,panOnScrollMode:t,panOnDrag:a,autoPanOnSelection:H1,defaultViewport:s,translateExtent:U1,minZoom:Q1,maxZoom:h,onSelectionContextMenu:A,preventScrolling:g,noDragClassName:t0,noWheelClassName:C2,noPanClassName:u2,disableKeyboardA11y:b2,onViewportChange:R2,isControlledViewport:!!G2,children:K1.jsxs(_j,{children:[K1.jsx(ev,{edgeTypes:U,onEdgeClick:H,onEdgeDoubleClick:W,onReconnect:D1,onReconnectStart:g0,onReconnectEnd:_0,onlyRenderVisibleElements:b,onEdgeContextMenu:b1,onEdgeMouseEnter:c1,onEdgeMouseMove:k1,onEdgeMouseLeave:A1,reconnectRadius:e1,defaultMarkerColor:p,noPanClassName:u2,disableKeyboardA11y:b2,rfId:T2}),K1.jsx(Zj,{style:V,type:P,component:S,containerStyle:C}),K1.jsx("div",{className:"react-flow__edgelabel-renderer"}),K1.jsx(uv,{nodeTypes:Q,onNodeClick:K,onNodeDoubleClick:Y,onNodeMouseEnter:L,onNodeMouseMove:M,onNodeMouseLeave:O,onNodeContextMenu:T,nodeClickDistance:C1,onlyRenderVisibleElements:b,noPanClassName:u2,noDragClassName:t0,disableKeyboardA11y:b2,nodeExtent:f2,rfId:T2,nodesDraggable:I4}),K1.jsx("div",{className:"react-flow__viewport-portal"})]})})}ER.displayName="GraphView";var Kj=W1.memo(ER),Hj=kK("React Flow","https://reactflow.dev/"),QR=({nodes:Q,edges:U,defaultNodes:Z,defaultEdges:K,width:H,height:Y,fitView:W,fitViewOptions:L,minZoom:M=0.5,maxZoom:O=2,nodeOrigin:T,nodeExtent:A,zIndexMode:R="basic"}={})=>{let w=new Map,P=new Map,V=new Map,S=new Map,C=K??U??[],y=Z??Q??[],N=T??[0,0],v=A??O9;dK(V,S,C);let{nodesInitialized:D}=nq(y,w,P,{nodeOrigin:N,nodeExtent:v,zIndexMode:R}),x=[0,0,1];if(W&&H&&Y){let E=n8(w,{filter:(s)=>!!((s.width||s.initialWidth)&&(s.height||s.initialHeight))}),{x:u,y:b,zoom:m}=gJ(E,H,Y,M,O,L?.padding??0.1);x=[u,b,m]}return{rfId:"1",width:H??0,height:Y??0,transform:x,nodes:y,nodesInitialized:D,nodeLookup:w,parentLookup:P,edges:C,edgeLookup:S,connectionLookup:V,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:Z!==void 0,hasDefaultEdges:K!==void 0,panZoom:null,minZoom:M,maxZoom:O,translateExtent:O9,nodeExtent:v,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:l6.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:N,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:W??!1,fitViewOptions:L,fitViewResolver:null,connection:{...CK},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Hj,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:NK,zIndexMode:R,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}},Yj=({nodes:Q,edges:U,defaultNodes:Z,defaultEdges:K,width:H,height:Y,fitView:W,fitViewOptions:L,minZoom:M,maxZoom:O,nodeOrigin:T,nodeExtent:A,zIndexMode:R})=>yT((w,P)=>{async function V(){let{nodeLookup:S,panZoom:C,fitViewOptions:y,fitViewResolver:N,width:v,height:D,minZoom:x,maxZoom:E}=P();if(!C)return;await rM({nodes:S,width:v,height:D,panZoom:C,minZoom:x,maxZoom:E},y),N?.resolve(!0),w({fitViewResolver:null})}return{...QR({nodes:Q,edges:U,width:H,height:Y,fitView:W,fitViewOptions:L,minZoom:M,maxZoom:O,nodeOrigin:T,nodeExtent:A,defaultNodes:Z,defaultEdges:K,zIndexMode:R}),setNodes:(S)=>{let{nodeLookup:C,parentLookup:y,nodeOrigin:N,nodeExtent:v,elevateNodesOnSelect:D,fitViewQueued:x,zIndexMode:E,nodesSelectionActive:u}=P(),{nodesInitialized:b,hasSelectedNodes:m}=nq(S,C,y,{nodeOrigin:N,nodeExtent:v,elevateNodesOnSelect:D,checkEquality:!0,zIndexMode:E}),s=u&&m;if(x&&b)V(),w({nodes:S,nodesInitialized:b,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:s});else w({nodes:S,nodesInitialized:b,nodesSelectionActive:s})},setEdges:(S)=>{let{connectionLookup:C,edgeLookup:y}=P();dK(C,y,S),w({edges:S})},setDefaultNodesAndEdges:(S,C)=>{if(S){let{setNodes:y}=P();y(S),w({hasDefaultNodes:!0})}if(C){let{setEdges:y}=P();y(C),w({hasDefaultEdges:!0})}},updateNodeInternals:(S)=>{let{triggerNodeChanges:C,nodeLookup:y,parentLookup:N,domNode:v,nodeOrigin:D,nodeExtent:x,debug:E,fitViewQueued:u,zIndexMode:b}=P(),{changes:m,updatedInternals:s}=XT(S,y,N,v,D,x,b);if(!s)return;if(ZT(y,N,{nodeOrigin:D,nodeExtent:x,zIndexMode:b}),u)V(),w({fitViewQueued:!1,fitViewOptions:void 0});else w({});if(m?.length>0){if(E)console.log("React Flow: trigger node changes",m);C?.(m)}},updateNodePositions:(S,C=!1)=>{let y=[],N=[],{nodeLookup:v,triggerNodeChanges:D,connection:x,updateConnection:E,onNodesChangeMiddlewareMap:u}=P();for(let[b,m]of S){let s=v.get(b),U1=!!(s?.expandParent&&s?.parentId&&m?.position),Q1={id:b,type:"position",position:U1?{x:Math.max(0,m.position.x),y:Math.max(0,m.position.y)}:m.position,dragging:C};if(s&&x.inProgress&&x.fromNode.id===s.id){let h=i6(s,x.fromHandle,E1.Left,!0);E({...x,from:h})}if(U1&&s.parentId)y.push({id:b,parentId:s.parentId,rect:{...m.internals.positionAbsolute,width:m.measured.width??0,height:m.measured.height??0}});N.push(Q1)}if(y.length>0){let{parentLookup:b,nodeOrigin:m}=P(),s=eq(y,v,b,m);N.push(...s)}for(let b of u.values())N=b(N);D(N)},triggerNodeChanges:(S)=>{let{onNodesChange:C,setNodes:y,nodes:N,hasDefaultNodes:v,debug:D}=P();if(S?.length){if(v){let x=YR(S,N);y(x)}if(D)console.log("React Flow: trigger node changes",S);C?.(S)}},triggerEdgeChanges:(S)=>{let{onEdgesChange:C,setEdges:y,edges:N,hasDefaultEdges:v,debug:D}=P();if(S?.length){if(v){let x=rS(S,N);y(x)}if(D)console.log("React Flow: trigger edge changes",S);C?.(S)}},addSelectedNodes:(S)=>{let{multiSelectionActive:C,edgeLookup:y,nodeLookup:N,triggerNodeChanges:v,triggerEdgeChanges:D}=P();if(C){let x=S.map((E)=>e8(E,!0));v(x);return}v(C9(N,new Set([...S]),!0)),D(C9(y))},addSelectedEdges:(S)=>{let{multiSelectionActive:C,edgeLookup:y,nodeLookup:N,triggerNodeChanges:v,triggerEdgeChanges:D}=P();if(C){let x=S.map((E)=>e8(E,!0));D(x);return}D(C9(y,new Set([...S]))),v(C9(N,new Set,!0))},unselectNodesAndEdges:({nodes:S,edges:C}={})=>{let{edges:y,nodes:N,nodeLookup:v,triggerNodeChanges:D,triggerEdgeChanges:x}=P(),E=S?S:N,u=C?C:y,b=[];for(let s of E){if(!s.selected)continue;let U1=v.get(s.id);if(U1)U1.selected=!1;b.push(e8(s.id,!1))}let m=[];for(let s of u){if(!s.selected)continue;m.push(e8(s.id,!1))}D(b),x(m)},setMinZoom:(S)=>{let{panZoom:C,maxZoom:y}=P();C?.setScaleExtent([S,y]),w({minZoom:S})},setMaxZoom:(S)=>{let{panZoom:C,minZoom:y}=P();C?.setScaleExtent([y,S]),w({maxZoom:S})},setTranslateExtent:(S)=>{P().panZoom?.setTranslateExtent(S),w({translateExtent:S})},resetSelectedElements:()=>{let{edges:S,nodes:C,triggerNodeChanges:y,triggerEdgeChanges:N,elementsSelectable:v}=P();if(!v)return;let D=C.reduce((E,u)=>u.selected?[...E,e8(u.id,!1)]:E,[]),x=S.reduce((E,u)=>u.selected?[...E,e8(u.id,!1)]:E,[]);y(D),N(x)},setNodeExtent:(S)=>{let{nodes:C,nodeLookup:y,parentLookup:N,nodeOrigin:v,elevateNodesOnSelect:D,nodeExtent:x,zIndexMode:E}=P();if(S[0][0]===x[0][0]&&S[0][1]===x[0][1]&&S[1][0]===x[1][0]&&S[1][1]===x[1][1])return;nq(C,y,N,{nodeOrigin:v,nodeExtent:S,elevateNodesOnSelect:D,checkEquality:!1,zIndexMode:E}),w({nodeExtent:S})},panBy:(S)=>{let{transform:C,width:y,height:N,panZoom:v,translateExtent:D}=P();return KT({delta:S,panZoom:v,transform:C,translateExtent:D,width:y,height:N})},setCenter:async(S,C,y)=>{let{width:N,height:v,maxZoom:D,panZoom:x}=P();if(!x)return!1;let E=typeof y?.zoom<"u"?y.zoom:D;return await x.setViewport({x:N/2-S*E,y:v/2-C*E,zoom:E},{duration:y?.duration,ease:y?.ease,interpolate:y?.interpolate}),!0},cancelConnection:()=>{w({connection:{...CK}})},updateConnection:(S)=>{w({connection:S})},reset:()=>w({...QR()})}},Object.is);function eK({initialNodes:Q,initialEdges:U,defaultNodes:Z,defaultEdges:K,initialWidth:H,initialHeight:Y,initialMinZoom:W,initialMaxZoom:L,initialFitViewOptions:M,fitView:O,nodeOrigin:T,nodeExtent:A,zIndexMode:R,children:w}){let[P]=W1.useState(()=>Yj({nodes:Q,edges:U,defaultNodes:Z,defaultEdges:K,width:H,height:Y,fitView:O,minZoom:W,maxZoom:L,fitViewOptions:M,nodeOrigin:T,nodeExtent:A,zIndexMode:R}));return K1.jsx(fS,{value:P,children:K1.jsx(nS,{children:K1.jsx(zv,{children:w})})})}function zj({children:Q,nodes:U,edges:Z,defaultNodes:K,defaultEdges:H,width:Y,height:W,fitView:L,fitViewOptions:M,minZoom:O,maxZoom:T,nodeOrigin:A,nodeExtent:R,zIndexMode:w}){if(W1.useContext(GU))return K1.jsx(K1.Fragment,{children:Q});return K1.jsx(eK,{initialNodes:U,initialEdges:Z,defaultNodes:K,defaultEdges:H,initialWidth:Y,initialHeight:W,fitView:L,initialFitViewOptions:M,initialMinZoom:O,initialMaxZoom:T,nodeOrigin:A,nodeExtent:R,zIndexMode:w,children:Q})}var Wj={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function Lj({nodes:Q,edges:U,defaultNodes:Z,defaultEdges:K,className:H,nodeTypes:Y,edgeTypes:W,onNodeClick:L,onEdgeClick:M,onInit:O,onMove:T,onMoveStart:A,onMoveEnd:R,onConnect:w,onConnectStart:P,onConnectEnd:V,onClickConnectStart:S,onClickConnectEnd:C,onNodeMouseEnter:y,onNodeMouseMove:N,onNodeMouseLeave:v,onNodeContextMenu:D,onNodeDoubleClick:x,onNodeDragStart:E,onNodeDrag:u,onNodeDragStop:b,onNodesDelete:m,onEdgesDelete:s,onDelete:U1,onSelectionChange:Q1,onSelectionDragStart:h,onSelectionDrag:g,onSelectionDragStop:p,onSelectionContextMenu:c,onSelectionStart:l,onSelectionEnd:o,onBeforeDelete:k,connectionMode:t,connectionLineType:_1=$3.Bezier,connectionLineStyle:a,connectionLineComponent:H1,connectionLineContainerStyle:O1,deleteKeyCode:L1="Backspace",selectionKeyCode:T1="Shift",selectionOnDrag:G1=!1,selectionMode:R1=a8.Full,panActivationKeyCode:f1="Space",multiSelectionKeyCode:z1=N9()?"Meta":"Control",zoomActivationKeyCode:C1=N9()?"Meta":"Control",snapToGrid:b1,snapGrid:c1,onlyRenderVisibleElements:k1=!1,selectNodesOnDrag:A1,nodesDraggable:e1,autoPanOnNodeFocus:D1,nodesConnectable:g0,nodesFocusable:_0,nodeOrigin:t0=KR,edgesFocusable:C2,edgesReconnectable:u2,elementsSelectable:b2=!0,defaultViewport:f2=mS,minZoom:T2=0.5,maxZoom:G2=2,translateExtent:R2=O9,preventScrolling:I4=!0,nodeExtent:X5,defaultMarkerColor:x5="#b1b1b7",zoomOnScroll:q4=!0,zoomOnPinch:R5=!0,panOnScroll:G3=!1,panOnScrollSpeed:O5=0.5,panOnScrollMode:j=h3.Free,zoomOnDoubleClick:q1=!0,panOnDrag:I1=!0,onPaneClick:P1,onPaneMouseEnter:y1,onPaneMouseMove:i1,onPaneMouseLeave:r1,onPaneScroll:F0,onPaneContextMenu:x1,paneClickDistance:K2=1,nodeClickDistance:E2=0,children:$1,onReconnect:B1,onReconnectStart:v1,onReconnectEnd:V1,onEdgeContextMenu:Q0,onEdgeDoubleClick:u1,onEdgeMouseEnter:m1,onEdgeMouseMove:J0,onEdgeMouseLeave:T0,reconnectRadius:Z2=10,onNodesChange:K0,onEdgesChange:S2,noDragClassName:w0="nodrag",noWheelClassName:Z7="nowheel",noPanClassName:K5="nopan",fitView:V0,fitViewOptions:F7,connectOnClick:sJ,attributionPosition:tJ,proOptions:r3,defaultEdgeOptions:oJ,elevateNodesOnSelect:nJ=!0,elevateEdgesOnSelect:eJ=!1,disableKeyboardA11y:j9=!1,autoPanOnConnect:_$,autoPanOnNodeDrag:o2,autoPanOnSelection:a3=!0,autoPanSpeed:Z3,connectionRadius:J$,isValidConnection:a6,onError:X7,style:V9,id:s3,nodeDragThreshold:t3,connectionDragThreshold:y9,viewport:BU,onViewportChange:AU,width:$$,height:k9,colorMode:D9="light",debug:Q$,onScroll:u9,ariaLabelConfig:q$,zIndexMode:U$="basic",...G$},b9){let o3=s3||"1",s6=lS(D9),MU=W1.useCallback((E9)=>{E9.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),u9?.(E9)},[u9]);return K1.jsx("div",{"data-testid":"rf__wrapper",...G$,onScroll:MU,style:{...V9,...Wj},ref:b9,className:_2(["react-flow",H,s6]),id:s3,role:"application",children:K1.jsxs(zj,{nodes:Q,edges:U,width:$$,height:k9,fitView:V0,fitViewOptions:F7,minZoom:T2,maxZoom:G2,nodeOrigin:t0,nodeExtent:X5,zIndexMode:U$,children:[K1.jsx(cS,{nodes:Q,edges:U,defaultNodes:Z,defaultEdges:K,onConnect:w,onConnectStart:P,onConnectEnd:V,onClickConnectStart:S,onClickConnectEnd:C,nodesDraggable:e1,autoPanOnNodeFocus:D1,nodesConnectable:g0,nodesFocusable:_0,edgesFocusable:C2,edgesReconnectable:u2,elementsSelectable:b2,elevateNodesOnSelect:nJ,elevateEdgesOnSelect:eJ,minZoom:T2,maxZoom:G2,nodeExtent:X5,onNodesChange:K0,onEdgesChange:S2,snapToGrid:b1,snapGrid:c1,connectionMode:t,translateExtent:R2,connectOnClick:sJ,defaultEdgeOptions:oJ,fitView:V0,fitViewOptions:F7,onNodesDelete:m,onEdgesDelete:s,onDelete:U1,onNodeDragStart:E,onNodeDrag:u,onNodeDragStop:b,onSelectionDrag:g,onSelectionDragStart:h,onSelectionDragStop:p,onMove:T,onMoveStart:A,onMoveEnd:R,noPanClassName:K5,nodeOrigin:t0,rfId:o3,autoPanOnConnect:_$,autoPanOnNodeDrag:o2,autoPanSpeed:Z3,onError:X7,connectionRadius:J$,isValidConnection:a6,selectNodesOnDrag:A1,nodeDragThreshold:t3,connectionDragThreshold:y9,onBeforeDelete:k,debug:Q$,ariaLabelConfig:q$,zIndexMode:U$}),K1.jsx(Kj,{onInit:O,onNodeClick:L,onEdgeClick:M,onNodeMouseEnter:y,onNodeMouseMove:N,onNodeMouseLeave:v,onNodeContextMenu:D,onNodeDoubleClick:x,nodeTypes:Y,edgeTypes:W,connectionLineType:_1,connectionLineStyle:a,connectionLineComponent:H1,connectionLineContainerStyle:O1,selectionKeyCode:T1,selectionOnDrag:G1,selectionMode:R1,deleteKeyCode:L1,multiSelectionKeyCode:z1,panActivationKeyCode:f1,zoomActivationKeyCode:C1,onlyRenderVisibleElements:k1,defaultViewport:f2,translateExtent:R2,minZoom:T2,maxZoom:G2,preventScrolling:I4,zoomOnScroll:q4,zoomOnPinch:R5,zoomOnDoubleClick:q1,panOnScroll:G3,panOnScrollSpeed:O5,panOnScrollMode:j,panOnDrag:I1,autoPanOnSelection:a3,onPaneClick:P1,onPaneMouseEnter:y1,onPaneMouseMove:i1,onPaneMouseLeave:r1,onPaneScroll:F0,onPaneContextMenu:x1,paneClickDistance:K2,nodeClickDistance:E2,onSelectionContextMenu:c,onSelectionStart:l,onSelectionEnd:o,onReconnect:B1,onReconnectStart:v1,onReconnectEnd:V1,onEdgeContextMenu:Q0,onEdgeDoubleClick:u1,onEdgeMouseEnter:m1,onEdgeMouseMove:J0,onEdgeMouseLeave:T0,reconnectRadius:Z2,defaultMarkerColor:x5,noDragClassName:w0,noWheelClassName:Z7,noPanClassName:K5,rfId:o3,disableKeyboardA11y:j9,nodeExtent:X5,viewport:BU,onViewportChange:AU,nodesDraggable:e1}),K1.jsx(xS,{onSelectionChange:Q1}),$1,K1.jsx(DS,{proOptions:r3,position:tJ}),K1.jsx(kS,{rfId:o3,disableKeyboardA11y:j9})]})})}var hR=zR(Lj);function xR(Q){let[U,Z]=W1.useState(Q),K=W1.useCallback((H)=>Z((Y)=>YR(H,Y)),[]);return[U,Z,K]}var kg=F5.error014();function Bj({dimensions:Q,lineWidth:U,variant:Z,className:K}){return K1.jsx("path",{strokeWidth:U,d:`M${Q[0]/2} 0 V${Q[1]} M0 ${Q[1]/2} H${Q[0]}`,className:_2(["react-flow__background-pattern",Z,K])})}function Aj({radius:Q,className:U}){return K1.jsx("circle",{cx:Q,cy:Q,r:Q,className:_2(["react-flow__background-pattern","dots",U])})}var Q3;(function(Q){Q.Lines="lines",Q.Dots="dots",Q.Cross="cross"})(Q3||(Q3={}));var Mj={[Q3.Dots]:1,[Q3.Lines]:1,[Q3.Cross]:6},Tj=(Q)=>({transform:Q.transform,patternId:`pattern-${Q.rfId}`});function mR({id:Q,variant:U=Q3.Dots,gap:Z=20,size:K,lineWidth:H=1,offset:Y=0,color:W,bgColor:L,style:M,className:O,patternClassName:T}){let A=W1.useRef(null),{transform:R,patternId:w}=L0(Tj,i0),P=K||Mj[U],V=U===Q3.Dots,S=U===Q3.Cross,C=Array.isArray(Z)?Z:[Z,Z],y=[C[0]*R[2]||1,C[1]*R[2]||1],N=P*R[2],v=Array.isArray(Y)?Y:[Y,Y],D=S?[N,N]:y,x=[v[0]*R[2]+D[0]/2,v[1]*R[2]+D[1]/2],E=`${w}${Q?Q:""}`;return K1.jsxs("svg",{className:_2(["react-flow__background",O]),style:{...M,...ZU,"--xy-background-color-props":L,"--xy-background-pattern-color-props":W},ref:A,"data-testid":"rf__background",children:[K1.jsx("pattern",{id:E,x:R[0]%y[0],y:R[1]%y[1],width:y[0],height:y[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${x[0]},-${x[1]})`,children:V?K1.jsx(Aj,{radius:N/2,className:T}):K1.jsx(Bj,{dimensions:D,lineWidth:H,variant:U,className:T})}),K1.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${E})`})]})}mR.displayName="Background";var gR=W1.memo(mR);function Rj(){return K1.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:K1.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function Oj(){return K1.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:K1.jsx("path",{d:"M0 0h32v4.2H0z"})})}function Ij(){return K1.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:K1.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 wj(){return K1.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:K1.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 Pj(){return K1.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:K1.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 QU({children:Q,className:U,...Z}){return K1.jsx("button",{type:"button",className:_2(["react-flow__controls-button",U]),...Z,children:Q})}var Nj=(Q)=>({isInteractive:Q.nodesDraggable||Q.nodesConnectable||Q.elementsSelectable,minZoomReached:Q.transform[2]<=Q.minZoom,maxZoomReached:Q.transform[2]>=Q.maxZoom,ariaLabelConfig:Q.ariaLabelConfig});function pR({style:Q,showZoom:U=!0,showFitView:Z=!0,showInteractive:K=!0,fitViewOptions:H,onZoomIn:Y,onZoomOut:W,onFitView:L,onInteractiveChange:M,className:O,children:T,position:A="bottom-left",orientation:R="vertical","aria-label":w}){let P=d0(),{isInteractive:V,minZoomReached:S,maxZoomReached:C,ariaLabelConfig:y}=L0(Nj,i0),{zoomIn:N,zoomOut:v,fitView:D}=lJ(),x=()=>{N(),Y?.()},E=()=>{v(),W?.()},u=()=>{D(H),L?.()},b=()=>{P.setState({nodesDraggable:!V,nodesConnectable:!V,elementsSelectable:!V}),M?.(!V)};return K1.jsxs(q3,{className:_2(["react-flow__controls",R==="horizontal"?"horizontal":"vertical",O]),position:A,style:Q,"data-testid":"rf__controls","aria-label":w??y["controls.ariaLabel"],children:[U&&K1.jsxs(K1.Fragment,{children:[K1.jsx(QU,{onClick:x,className:"react-flow__controls-zoomin",title:y["controls.zoomIn.ariaLabel"],"aria-label":y["controls.zoomIn.ariaLabel"],disabled:C,children:K1.jsx(Rj,{})}),K1.jsx(QU,{onClick:E,className:"react-flow__controls-zoomout",title:y["controls.zoomOut.ariaLabel"],"aria-label":y["controls.zoomOut.ariaLabel"],disabled:S,children:K1.jsx(Oj,{})})]}),Z&&K1.jsx(QU,{className:"react-flow__controls-fitview",onClick:u,title:y["controls.fitView.ariaLabel"],"aria-label":y["controls.fitView.ariaLabel"],children:K1.jsx(Ij,{})}),K&&K1.jsx(QU,{className:"react-flow__controls-interactive",onClick:b,title:y["controls.interactive.ariaLabel"],"aria-label":y["controls.interactive.ariaLabel"],children:V?K1.jsx(Pj,{}):K1.jsx(wj,{})}),T]})}pR.displayName="Controls";var cR=W1.memo(pR);function Cj({id:Q,x:U,y:Z,width:K,height:H,style:Y,color:W,strokeColor:L,strokeWidth:M,className:O,borderRadius:T,shapeRendering:A,selected:R,onClick:w}){let{background:P,backgroundColor:V}=Y||{},S=W||P||V;return K1.jsx("rect",{className:_2(["react-flow__minimap-node",{selected:R},O]),x:U,y:Z,rx:T,ry:T,width:K,height:H,style:{fill:S,stroke:L,strokeWidth:M},shapeRendering:A,onClick:w?(C)=>w(C,Q):void 0})}var fj=W1.memo(Cj),Sj=(Q)=>Q.nodes.map((U)=>U.id),sK=(Q)=>Q instanceof Function?Q:()=>Q;function vj({nodeStrokeColor:Q,nodeColor:U,nodeClassName:Z="",nodeBorderRadius:K=5,nodeStrokeWidth:H,nodeComponent:Y=fj,onClick:W}){let L=L0(Sj,i0),M=sK(U),O=sK(Q),T=sK(Z),A=typeof window>"u"||!!window.chrome?"crispEdges":"geometricPrecision";return K1.jsx(K1.Fragment,{children:L.map((R)=>K1.jsx(Vj,{id:R,nodeColorFunc:M,nodeStrokeColorFunc:O,nodeClassNameFunc:T,nodeBorderRadius:K,nodeStrokeWidth:H,NodeComponent:Y,onClick:W,shapeRendering:A},R))})}function jj({id:Q,nodeColorFunc:U,nodeStrokeColorFunc:Z,nodeClassNameFunc:K,nodeBorderRadius:H,nodeStrokeWidth:Y,shapeRendering:W,NodeComponent:L,onClick:M}){let{node:O,x:T,y:A,width:R,height:w}=L0((P)=>{let V=P.nodeLookup.get(Q);if(!V)return{node:void 0,x:0,y:0,width:0,height:0};let S=V.internals.userNode,{x:C,y}=V.internals.positionAbsolute,{width:N,height:v}=J4(S);return{node:S,x:C,y,width:N,height:v}},i0);if(!O||O.hidden||!DK(O))return null;return K1.jsx(L,{x:T,y:A,width:R,height:w,style:O.style,selected:!!O.selected,className:K(O),color:U(O),borderRadius:H,strokeColor:Z(O),strokeWidth:Y,shapeRendering:W,onClick:M,id:O.id})}var Vj=W1.memo(jj),yj=W1.memo(vj),kj=200,Dj=150,uj=(Q)=>!Q.hidden,bj=(Q)=>{let U={x:-Q.transform[0]/Q.transform[2],y:-Q.transform[1]/Q.transform[2],width:Q.width/Q.transform[2],height:Q.height/Q.transform[2]},Z=!1;for(let K of Q.nodeLookup.values())if(!K.hidden){Z=!0;break}return{viewBB:U,boundingRect:Z?VK(n8(Q.nodeLookup,{filter:uj}),U):U,rfId:Q.rfId,panZoom:Q.panZoom,translateExtent:Q.translateExtent,flowWidth:Q.width,flowHeight:Q.height,ariaLabelConfig:Q.ariaLabelConfig}},qR=(Q,U)=>Q.x===U.x&&Q.y===U.y&&Q.width===U.width&&Q.height===U.height,Ej=(Q,U)=>qR(Q.viewBB,U.viewBB)&&qR(Q.boundingRect,U.boundingRect)&&Q.rfId===U.rfId&&Q.panZoom===U.panZoom&&Q.translateExtent===U.translateExtent&&Q.flowWidth===U.flowWidth&&Q.flowHeight===U.flowHeight&&Q.ariaLabelConfig===U.ariaLabelConfig,hj="react-flow__minimap-desc";function lR({style:Q,className:U,nodeStrokeColor:Z,nodeColor:K,nodeClassName:H="",nodeBorderRadius:Y=5,nodeStrokeWidth:W,nodeComponent:L,bgColor:M,maskColor:O,maskStrokeColor:T,maskStrokeWidth:A,position:R="bottom-right",onClick:w,onNodeClick:P,pannable:V=!1,zoomable:S=!1,ariaLabel:C,inversePan:y,zoomStep:N=1,offsetScale:v=5}){let D=d0(),x=W1.useRef(null),{boundingRect:E,panZoom:u,viewBB:b,rfId:m,translateExtent:s,flowWidth:U1,flowHeight:Q1,ariaLabelConfig:h}=L0(bj,Ej),g=Q?.width??kj,p=Q?.height??Dj,c=E.width/g,l=E.height/p,o=Math.max(c,l),k=o*g,t=o*p,_1=v*o,a=E.x-(k-E.width)/2-_1,H1=E.y-(t-E.height)/2-_1,O1=k+_1*2,L1=t+_1*2,T1=`${hj}-${m}`,G1=W1.useRef(0),R1=W1.useRef();G1.current=o,W1.useEffect(()=>{let c1=D.getState().panZoom;if(x.current&&c1)return R1.current=AT({domNode:x.current,panZoom:c1,getTransform:()=>D.getState().transform,getViewScale:()=>G1.current}),()=>{R1.current?.destroy()}},[u]),W1.useEffect(()=>{R1.current?.update({translateExtent:s,width:U1,height:Q1,inversePan:y,pannable:V,zoomStep:N,zoomable:S})},[V,S,y,N,s,U1,Q1]);let f1=w?(c1)=>{let[k1,A1]=R1.current?.pointer(c1)||[0,0];w(c1,{x:k1,y:A1})}:void 0,z1=W1.useCallback((c1,k1)=>{let A1=D.getState().nodeLookup.get(k1).internals.userNode;P?.(c1,A1)},[P]),C1=P?z1:void 0,b1=C??h["minimap.ariaLabel"];return K1.jsx(q3,{position:R,style:{...Q,"--xy-minimap-background-color-props":typeof M==="string"?M:void 0,"--xy-minimap-mask-background-color-props":typeof O==="string"?O:void 0,"--xy-minimap-mask-stroke-color-props":typeof T==="string"?T:void 0,"--xy-minimap-mask-stroke-width-props":typeof A==="number"?A*o:void 0,"--xy-minimap-node-background-color-props":typeof K==="string"?K:void 0,"--xy-minimap-node-stroke-color-props":typeof Z==="string"?Z:void 0,"--xy-minimap-node-stroke-width-props":typeof W==="number"?W:void 0},className:_2(["react-flow__minimap",U]),"data-testid":"rf__minimap",children:K1.jsxs("svg",{width:g,height:p,viewBox:`${a} ${H1} ${O1} ${L1}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":T1,ref:x,onClick:f1,children:[b1&&K1.jsx("title",{id:T1,children:b1}),K1.jsx(yj,{onClick:C1,nodeColor:K,nodeStrokeColor:Z,nodeBorderRadius:Y,nodeClassName:H,nodeStrokeWidth:W,nodeComponent:L}),K1.jsx("path",{className:"react-flow__minimap-mask",d:`M${a-_1},${H1-_1}h${O1+_1*2}v${L1+_1*2}h${-O1-_1*2}z
|
|
246
|
+
`)),T=O.reduce((A,R)=>A.concat(...R),[]);return[O,T]}return[[],[]]},[Q]);return W1.useEffect(()=>{let M=U?.target??hT,O=U?.actInsideInputWithModifier??!0;if(Q!==null){let T=(w)=>{if(H.current=w.ctrlKey||w.metaKey||w.shiftKey||w.altKey,(!H.current||H.current&&!O)&&xK(w))return!1;let V=mT(w.code,L);if(Y.current.add(w[V]),xT(W,Y.current,!1)){let S=w.composedPath?.()?.[0]||w.target,C=S?.nodeName==="BUTTON"||S?.nodeName==="A";if(U.preventDefault!==!1&&(H.current||!C))w.preventDefault();K(!0)}},A=(w)=>{let P=mT(w.code,L);if(xT(W,Y.current,!0))K(!1),Y.current.clear();else Y.current.delete(w[P]);if(w.key==="Meta")Y.current.clear();H.current=!1},R=()=>{Y.current.clear(),K(!1)};return M?.addEventListener("keydown",T),M?.addEventListener("keyup",A),window.addEventListener("blur",R),window.addEventListener("contextmenu",R),()=>{M?.removeEventListener("keydown",T),M?.removeEventListener("keyup",A),window.removeEventListener("blur",R),window.removeEventListener("contextmenu",R)}}},[Q,K]),Z}function xT(Q,U,Z){return Q.filter((K)=>Z||K.length===U.size).some((K)=>K.every((H)=>U.has(H)))}function mT(Q,U){return U.includes(Q)?"code":"key"}var iS=()=>{let Q=d0();return W1.useMemo(()=>{return{zoomIn:async(U)=>{let{panZoom:Z}=Q.getState();return Z?Z.scaleBy(1.2,U):!1},zoomOut:async(U)=>{let{panZoom:Z}=Q.getState();return Z?Z.scaleBy(0.8333333333333334,U):!1},zoomTo:async(U,Z)=>{let{panZoom:K}=Q.getState();return K?K.scaleTo(U,Z):!1},getZoom:()=>Q.getState().transform[2],setViewport:async(U,Z)=>{let{transform:[K,H,Y],panZoom:W}=Q.getState();if(!W)return!1;return await W.setViewport({x:U.x??K,y:U.y??H,zoom:U.zoom??Y},Z),!0},getViewport:()=>{let[U,Z,K]=Q.getState().transform;return{x:U,y:Z,zoom:K}},setCenter:async(U,Z,K)=>{return Q.getState().setCenter(U,Z,K)},fitBounds:async(U,Z)=>{let{width:K,height:H,minZoom:Y,maxZoom:W,panZoom:L}=Q.getState(),M=gJ(U,K,H,Y,W,Z?.padding??0.1);if(!L)return!1;return await L.setViewport(M,{duration:Z?.duration,ease:Z?.ease,interpolate:Z?.interpolate}),!0},screenToFlowPosition:(U,Z={})=>{let{transform:K,snapGrid:H,snapToGrid:Y,domNode:W}=Q.getState();if(!W)return U;let{x:L,y:M}=W.getBoundingClientRect(),O={x:U.x-L,y:U.y-M},T=Z.snapGrid??H,A=Z.snapToGrid??Y;return P9(O,K,A,T)},flowToScreenPosition:(U)=>{let{transform:Z,domNode:K}=Q.getState();if(!K)return U;let{x:H,y:Y}=K.getBoundingClientRect(),W=t8(U,Z);return{x:W.x+H,y:W.y+Y}}}},[])};function HR(Q,U){let Z=[],K=new Map,H=[];for(let Y of Q)if(Y.type==="add"){H.push(Y);continue}else if(Y.type==="remove"||Y.type==="replace")K.set(Y.id,[Y]);else{let W=K.get(Y.id);if(W)W.push(Y);else K.set(Y.id,[Y])}for(let Y of U){let W=K.get(Y.id);if(!W){Z.push(Y);continue}if(W[0].type==="remove")continue;if(W[0].type==="replace"){Z.push({...W[0].item});continue}let L={...Y};for(let M of W)dS(M,L);Z.push(L)}if(H.length)H.forEach((Y)=>{if(Y.index!==void 0)Z.splice(Y.index,0,{...Y.item});else Z.push({...Y.item})});return Z}function dS(Q,U){switch(Q.type){case"select":{U.selected=Q.selected;break}case"position":{if(typeof Q.position<"u")U.position=Q.position;if(typeof Q.dragging<"u")U.dragging=Q.dragging;break}case"dimensions":{if(typeof Q.dimensions<"u"){if(U.measured={...Q.dimensions},Q.setAttributes){if(Q.setAttributes===!0||Q.setAttributes==="width")U.width=Q.dimensions.width;if(Q.setAttributes===!0||Q.setAttributes==="height")U.height=Q.dimensions.height}}if(typeof Q.resizing==="boolean")U.resizing=Q.resizing;break}}}function YR(Q,U){return HR(Q,U)}function rS(Q,U){return HR(Q,U)}function e8(Q,U){return{id:Q,type:"select",selected:U}}function C9(Q,U=new Set,Z=!1){let K=[];for(let[H,Y]of Q){let W=U.has(H);if(!(Y.selected===void 0&&!W)&&Y.selected!==W){if(Z)Y.selected=W;K.push(e8(Y.id,W))}}return K}function gT({items:Q=[],lookup:U}){let Z=[],K=new Map(Q.map((H)=>[H.id,H]));for(let[H,Y]of Q.entries()){let W=U.get(Y.id),L=W?.internals?.userNode??W;if(L!==void 0&&L!==Y)Z.push({id:Y.id,item:Y,type:"replace"});if(L===void 0)Z.push({item:Y,type:"add",index:H})}for(let[H]of U)if(K.get(H)===void 0)Z.push({id:H,type:"remove"});return Z}function pT(Q){return{id:Q.id,type:"remove"}}var aS=kK("React Flow","https://reactflow.dev/");function sS(Q,U,Z={}){return $T(Q,U,{...Z,onError:Z.onError??aS})}var cT=(Q)=>iM(Q),tS=(Q)=>fK(Q);function zR(Q){return W1.forwardRef(Q)}var WR=typeof window<"u"?W1.useLayoutEffect:W1.useEffect;function lT(Q){let[U,Z]=W1.useState(BigInt(0)),[K]=W1.useState(()=>oS(()=>Z((H)=>H+BigInt(1))));return WR(()=>{let H=K.get();if(H.length)Q(H),K.reset()},[U]),K}function oS(Q){let U=[];return{get:()=>U,reset:()=>{U=[]},push:(Z)=>{U.push(Z),Q()}}}var LR=W1.createContext(null);function nS({children:Q}){let U=d0(),Z=W1.useCallback((L)=>{let{nodes:M=[],setNodes:O,hasDefaultNodes:T,onNodesChange:A,nodeLookup:R,fitViewQueued:w,onNodesChangeMiddlewareMap:P}=U.getState(),V=M;for(let C of L)V=typeof C==="function"?C(V):C;let S=gT({items:V,lookup:R});for(let C of P.values())S=C(S);if(T)O(V);if(S.length>0)A?.(S);else if(w)window.requestAnimationFrame(()=>{let{fitViewQueued:C,nodes:y,setNodes:N}=U.getState();if(C)N(y)})},[]),K=lT(Z),H=W1.useCallback((L)=>{let{edges:M=[],setEdges:O,hasDefaultEdges:T,onEdgesChange:A,edgeLookup:R}=U.getState(),w=M;for(let P of L)w=typeof P==="function"?P(w):P;if(T)O(w);else if(A)A(gT({items:w,lookup:R}))},[]),Y=lT(H),W=W1.useMemo(()=>({nodeQueue:K,edgeQueue:Y}),[]);return K1.jsx(LR.Provider,{value:W,children:Q})}function eS(){let Q=W1.useContext(LR);if(!Q)throw Error("useBatchContext must be used within a BatchProvider");return Q}var _v=(Q)=>!!Q.panZoom;function lJ(){let Q=iS(),U=d0(),Z=eS(),K=L0(_v),H=W1.useMemo(()=>{let Y=(A)=>U.getState().nodeLookup.get(A),W=(A)=>{Z.nodeQueue.push(A)},L=(A)=>{Z.edgeQueue.push(A)},M=(A)=>{let{nodeLookup:R,nodeOrigin:w}=U.getState(),P=cT(A)?A:R.get(A.id),V=P.parentId?uK(P.position,P.measured,P.parentId,R,w):P.position,S={...P,position:V,width:P.measured?.width??P.width,height:P.measured?.height??P.height};return I9(S)},O=(A,R,w={replace:!1})=>{W((P)=>P.map((V)=>{if(V.id===A){let S=typeof R==="function"?R(V):R;return w.replace&&cT(S)?S:{...V,...S}}return V}))},T=(A,R,w={replace:!1})=>{L((P)=>P.map((V)=>{if(V.id===A){let S=typeof R==="function"?R(V):R;return w.replace&&tS(S)?S:{...V,...S}}return V}))};return{getNodes:()=>U.getState().nodes.map((A)=>({...A})),getNode:(A)=>Y(A)?.internals.userNode,getInternalNode:Y,getEdges:()=>{let{edges:A=[]}=U.getState();return A.map((R)=>({...R}))},getEdge:(A)=>U.getState().edgeLookup.get(A),setNodes:W,setEdges:L,addNodes:(A)=>{let R=Array.isArray(A)?A:[A];Z.nodeQueue.push((w)=>[...w,...R])},addEdges:(A)=>{let R=Array.isArray(A)?A:[A];Z.edgeQueue.push((w)=>[...w,...R])},toObject:()=>{let{nodes:A=[],edges:R=[],transform:w}=U.getState(),[P,V,S]=w;return{nodes:A.map((C)=>({...C})),edges:R.map((C)=>({...C})),viewport:{x:P,y:V,zoom:S}}},deleteElements:async({nodes:A=[],edges:R=[]})=>{let{nodes:w,edges:P,onNodesDelete:V,onEdgesDelete:S,triggerNodeChanges:C,triggerEdgeChanges:y,onDelete:N,onBeforeDelete:v}=U.getState(),{nodes:D,edges:x}=await aM({nodesToRemove:A,edgesToRemove:R,nodes:w,edges:P,onBeforeDelete:v}),E=x.length>0,u=D.length>0;if(E){let b=x.map(pT);S?.(x),y(b)}if(u){let b=D.map(pT);V?.(D),C(b)}if(u||E)N?.({nodes:D,edges:x});return{deletedNodes:D,deletedEdges:x}},getIntersectingNodes:(A,R=!0,w)=>{let P=yK(A),V=P?A:M(A),S=w!==void 0;if(!V)return[];return(w||U.getState().nodes).filter((C)=>{let y=U.getState().nodeLookup.get(C.id);if(y&&!P&&(C.id===A.id||!y.internals.positionAbsolute))return!1;let N=I9(S?C:y),v=mJ(N,V);return R&&v>0||v>=N.width*N.height||v>=V.width*V.height})},isNodeIntersecting:(A,R,w=!0)=>{let V=yK(A)?A:M(A);if(!V)return!1;let S=mJ(V,R);return w&&S>0||S>=R.width*R.height||S>=V.width*V.height},updateNode:O,updateNodeData:(A,R,w={replace:!1})=>{O(A,(P)=>{let V=typeof R==="function"?R(P):R;return w.replace?{...P,data:V}:{...P,data:{...P.data,...V}}},w)},updateEdge:T,updateEdgeData:(A,R,w={replace:!1})=>{T(A,(P)=>{let V=typeof R==="function"?R(P):R;return w.replace?{...P,data:V}:{...P,data:{...P.data,...V}}},w)},getNodesBounds:(A)=>{let{nodeLookup:R,nodeOrigin:w}=U.getState();return vK(A,{nodeLookup:R,nodeOrigin:w})},getHandleConnections:({type:A,id:R,nodeId:w})=>Array.from(U.getState().connectionLookup.get(`${w}-${A}${R?`-${R}`:""}`)?.values()??[]),getNodeConnections:({type:A,handleId:R,nodeId:w})=>Array.from(U.getState().connectionLookup.get(`${w}${A?R?`-${A}-${R}`:`-${A}`:""}`)?.values()??[]),fitView:async(A)=>{let R=U.getState().fitViewResolver??oM();return U.setState({fitViewQueued:!0,fitViewOptions:A,fitViewResolver:R}),Z.nodeQueue.push((w)=>[...w]),R.promise}}},[]);return W1.useMemo(()=>{return{...H,...Q,viewportInitialized:K}},[K])}var iT=(Q)=>Q.selected,Jv=typeof window<"u"?window:void 0;function $v({deleteKeyCode:Q,multiSelectionKeyCode:U}){let Z=d0(),{deleteElements:K}=lJ(),H=cJ(Q,{actInsideInputWithModifier:!1}),Y=cJ(U,{target:Jv});W1.useEffect(()=>{if(H){let{edges:W,nodes:L}=Z.getState();K({nodes:L.filter(iT),edges:W.filter(iT)}),Z.setState({nodesSelectionActive:!1})}},[H]),W1.useEffect(()=>{Z.setState({multiSelectionActive:Y})},[Y])}function Qv(Q){let U=d0();W1.useEffect(()=>{let Z=()=>{if(!Q.current||!(Q.current.checkVisibility?.()??!0))return!1;let K=rq(Q.current);if(K.height===0||K.width===0)U.getState().onError?.("004",F5.error004());U.setState({width:K.width||500,height:K.height||500})};if(Q.current){Z(),window.addEventListener("resize",Z);let K=new ResizeObserver(()=>Z());return K.observe(Q.current),()=>{if(window.removeEventListener("resize",Z),K&&Q.current)K.unobserve(Q.current)}}},[])}var ZU={position:"absolute",width:"100%",height:"100%",top:0,left:0},qv=(Q)=>({userSelectionActive:Q.userSelectionActive,lib:Q.lib,connectionInProgress:Q.connection.inProgress});function Uv({onPaneContextMenu:Q,zoomOnScroll:U=!0,zoomOnPinch:Z=!0,panOnScroll:K=!1,panActivationKeyPressed:H,panOnScrollSpeed:Y=0.5,panOnScrollMode:W=h3.Free,zoomOnDoubleClick:L=!0,panOnDrag:M=!0,defaultViewport:O,translateExtent:T,minZoom:A,maxZoom:R,zoomActivationKeyCode:w,preventScrolling:P=!0,children:V,noWheelClassName:S,noPanClassName:C,onViewportChange:y,isControlledViewport:N,paneClickDistance:v,selectionOnDrag:D}){let x=d0(),E=W1.useRef(null),{userSelectionActive:u,lib:b,connectionInProgress:m}=L0(qv,i0),s=cJ(w),U1=W1.useRef();Qv(E);let Q1=W1.useCallback((h)=>{if(y?.({x:h[0],y:h[1],zoom:h[2]}),!N)x.setState({transform:h})},[y,N]);return W1.useEffect(()=>{if(E.current){U1.current=RT({domNode:E.current,minZoom:A,maxZoom:R,translateExtent:T,viewport:O,onDraggingChange:(c)=>x.setState((l)=>l.paneDragging===c?l:{paneDragging:c}),onPanZoomStart:(c,l)=>{let{onViewportChangeStart:o,onMoveStart:k}=x.getState();k?.(c,l),o?.(l)},onPanZoom:(c,l)=>{let{onViewportChange:o,onMove:k}=x.getState();k?.(c,l),o?.(l)},onPanZoomEnd:(c,l)=>{let{onViewportChangeEnd:o,onMoveEnd:k}=x.getState();k?.(c,l),o?.(l)}});let{x:h,y:g,zoom:p}=U1.current.getViewport();return x.setState({panZoom:U1.current,transform:[h,g,p],domNode:E.current.closest(".react-flow")}),()=>{U1.current?.destroy()}}},[]),W1.useEffect(()=>{U1.current?.update({onPaneContextMenu:Q,zoomOnScroll:U,zoomOnPinch:Z,panOnScroll:K,panActivationKeyPressed:H,panOnScrollSpeed:Y,panOnScrollMode:W,zoomOnDoubleClick:L,panOnDrag:M,zoomActivationKeyPressed:s,preventScrolling:P,noPanClassName:C,userSelectionActive:u,noWheelClassName:S,lib:b,onTransformChange:Q1,connectionInProgress:m,selectionOnDrag:D,paneClickDistance:v})},[Q,U,Z,K,H,Y,W,L,M,s,P,C,u,S,b,Q1,m,D,v]),K1.jsx("div",{className:"react-flow__renderer",ref:E,style:ZU,children:V})}var Gv=(Q)=>({userSelectionActive:Q.userSelectionActive,userSelectionRect:Q.userSelectionRect});function Zv(){let{userSelectionActive:Q,userSelectionRect:U}=L0(Gv,i0);if(!(Q&&U))return null;return K1.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:U.width,height:U.height,transform:`translate(${U.x}px, ${U.y}px)`}})}var aK=(Q,U)=>{return(Z)=>{if(Z.target!==U.current)return;Q?.(Z)}},Fv=(Q)=>({userSelectionActive:Q.userSelectionActive,elementsSelectable:Q.elementsSelectable,dragging:Q.paneDragging,panBy:Q.panBy,autoPanSpeed:Q.autoPanSpeed});function Xv({isSelecting:Q,selectionKeyPressed:U,selectionMode:Z=a8.Full,panOnDrag:K,autoPanOnSelection:H,paneClickDistance:Y,selectionOnDrag:W,onSelectionStart:L,onSelectionEnd:M,onPaneClick:O,onPaneContextMenu:T,onPaneScroll:A,onPaneMouseEnter:R,onPaneMouseMove:w,onPaneMouseLeave:P,children:V}){let S=W1.useRef(0),C=d0(),{userSelectionActive:y,elementsSelectable:N,dragging:v,panBy:D,autoPanSpeed:x}=L0(Fv,i0),E=N&&(Q||y),u=W1.useRef(null),b=W1.useRef(),m=W1.useRef(new Set),s=W1.useRef(new Set),U1=W1.useRef(!1),Q1=W1.useRef(!1),h=W1.useRef({x:0,y:0}),g=W1.useRef(!1),p=(G1)=>{if(Q1.current||U1.current||C.getState().connection.inProgress){Q1.current=!1,U1.current=!1;return}O?.(G1),C.getState().resetSelectedElements(),C.setState({nodesSelectionActive:!1})},c=(G1)=>{if(Array.isArray(K)&&K?.includes(2)){G1.preventDefault();return}T?.(G1)},l=A?(G1)=>A(G1):void 0,o=(G1)=>{if(Q1.current)G1.stopPropagation(),Q1.current=!1},k=(G1)=>{if(G1.pointerType==="touch"&&K!==!1&&!U)return;let{domNode:R1,transform:f1}=C.getState();if(b.current=R1?.getBoundingClientRect(),!b.current)return;let z1=G1.target===u.current;if(!z1&&!!G1.target.closest(".nokey")||!Q||!(W&&z1||U)||G1.button!==0||!G1.isPrimary)return;G1.target?.setPointerCapture?.(G1.pointerId),Q1.current=!1;let{x:c1,y:D1}=_4(G1.nativeEvent,b.current),A1=P9({x:c1,y:D1},f1);if(C.setState({userSelectionRect:{width:0,height:0,startX:A1.x,startY:A1.y,x:c1,y:D1}}),!z1)G1.stopPropagation(),G1.preventDefault()};function t(G1,R1){let{userSelectionRect:f1}=C.getState();if(!f1)return;let{transform:z1,nodeLookup:C1,edgeLookup:b1,connectionLookup:c1,triggerNodeChanges:D1,triggerEdgeChanges:A1,defaultEdgeOptions:e1}=C.getState(),k1={x:f1.startX,y:f1.startY},{x:g0,y:_0}=t8(k1,z1),t0={startX:k1.x,startY:k1.y,x:G1<g0?G1:g0,y:R1<_0?R1:_0,width:Math.abs(G1-g0),height:Math.abs(R1-_0)},C2=m.current,u2=s.current;m.current=new Set(cq(C1,t0,z1,Z===a8.Partial,!0).map((f2)=>f2.id)),s.current=new Set;let b2=e1?.selectable??!0;for(let f2 of m.current){let T2=c1.get(f2);if(!T2)continue;for(let{edgeId:G2}of T2.values()){let R2=b1.get(G2);if(R2&&(R2.selectable??b2))s.current.add(G2)}}if(!bK(C2,m.current)){let f2=C9(C1,m.current,!0);D1(f2)}if(!bK(u2,s.current)){let f2=C9(b1,s.current);A1(f2)}C.setState({userSelectionRect:t0,userSelectionActive:!0,nodesSelectionActive:!1})}function _1(){if(!H||!b.current)return;let[G1,R1]=lq(h.current,b.current,x);D({x:G1,y:R1}).then((f1)=>{if(!Q1.current||!f1){S.current=requestAnimationFrame(_1);return}let{x:z1,y:C1}=h.current;t(z1,C1),S.current=requestAnimationFrame(_1)})}let a=()=>{cancelAnimationFrame(S.current),S.current=0,g.current=!1};W1.useEffect(()=>{return()=>a()},[]);let H1=(G1)=>{let{userSelectionRect:R1,transform:f1,resetSelectedElements:z1}=C.getState();if(!b.current||!R1)return;let{x:C1,y:b1}=_4(G1.nativeEvent,b.current);h.current={x:C1,y:b1};let c1=t8({x:R1.startX,y:R1.startY},f1);if(!Q1.current){let D1=U?0:Y;if(Math.hypot(C1-c1.x,b1-c1.y)<=D1)return;z1(),L?.(G1)}if(Q1.current=!0,!g.current)_1(),g.current=!0;t(C1,b1)},O1=(G1)=>{if(!E){if(G1.target===u.current&&C.getState().connection.inProgress)U1.current=!0;return}if(G1.button!==0)return;if(G1.target?.releasePointerCapture?.(G1.pointerId),!y&&G1.target===u.current&&C.getState().userSelectionRect)p?.(G1);if(C.setState({userSelectionActive:!1,userSelectionRect:null}),Q1.current)M?.(G1),C.setState({nodesSelectionActive:m.current.size>0});a()},L1=(G1)=>{G1.target?.releasePointerCapture?.(G1.pointerId),a()},T1=K===!0||Array.isArray(K)&&K.includes(0);return K1.jsxs("div",{className:_2(["react-flow__pane",{draggable:T1,dragging:v,selection:Q}]),onClick:E?void 0:aK(p,u),onContextMenu:aK(c,u),onWheel:aK(l,u),onPointerEnter:E?void 0:R,onPointerMove:E?H1:w,onPointerUp:O1,onPointerCancel:E?L1:void 0,onPointerDownCapture:E?k:void 0,onClickCapture:E?o:void 0,onPointerLeave:P,ref:u,style:ZU,children:[V,K1.jsx(Zv,{})]})}function tK({id:Q,store:U,unselect:Z=!1,nodeRef:K}){let{addSelectedNodes:H,unselectNodesAndEdges:Y,multiSelectionActive:W,nodeLookup:L,onError:M}=U.getState(),O=L.get(Q);if(!O){M?.("012",F5.error012(Q));return}if(U.setState({nodesSelectionActive:!1}),!O.selected)H([Q]);else if(Z||O.selected&&W)Y({nodes:[O],edges:[]}),requestAnimationFrame(()=>K?.current?.blur())}function BR({nodeRef:Q,disabled:U=!1,noDragClassName:Z,handleSelector:K,nodeId:H,isSelectable:Y,nodeClickDistance:W}){let L=d0(),[M,O]=W1.useState(!1),T=W1.useRef();return W1.useEffect(()=>{if(U)return;return T.current=YT({getStoreItems:()=>L.getState(),onNodeMouseDown:(A)=>{tK({id:A,store:L,nodeRef:Q})},onDragStart:()=>{O(!0)},onDragStop:()=>{O(!1)}}),()=>{T.current?.destroy(),T.current=void 0}},[U,L,Q]),W1.useEffect(()=>{if(U||!Q.current||!T.current)return;T.current.update({noDragClassName:Z,handleSelector:K,domNode:Q.current,isSelectable:Y,nodeId:H,nodeClickDistance:W})},[Z,K,U,Y,Q,H,W]),M}var Kv=(Q)=>(U)=>U.selected&&(U.draggable||Q&&typeof U.draggable>"u");function AR(){let Q=d0();return W1.useCallback((Z)=>{let{nodeExtent:K,snapToGrid:H,snapGrid:Y,nodesDraggable:W,onError:L,updateNodePositions:M,nodeLookup:O,nodeOrigin:T}=Q.getState(),A=new Map,R=Kv(W),w=H?Y[0]:5,P=H?Y[1]:5,V=Z.direction.x*w*Z.factor,S=Z.direction.y*P*Z.factor;for(let[,C]of O){if(!R(C))continue;let y={x:C.internals.positionAbsolute.x+V,y:C.internals.positionAbsolute.y+S};if(H)y=w9(y,Y);let{position:N,positionAbsolute:v}=jK({nodeId:C.id,nextPosition:y,nodeLookup:O,nodeExtent:K,nodeOrigin:T,onError:L});C.position=N,C.internals.positionAbsolute=v,A.set(C.id,C)}M(A)},[])}var oK=W1.createContext(null),Hv=oK.Provider;oK.Consumer;var nK=()=>{return W1.useContext(oK)},Yv=(Q)=>({connectOnClick:Q.connectOnClick,noPanClassName:Q.noPanClassName,rfId:Q.rfId}),MR=W1.createContext(null);function zv({children:Q}){let U=L0(Yv,i0);return K1.jsx(MR.Provider,{value:U,children:Q})}function Wv(){let Q=W1.useContext(MR);if(!Q)throw Error("useHandleConfig must be used within a HandleConfigProvider");return Q}var Lv={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},Bv=(Q,U,Z)=>(K)=>{let{connectionClickStartHandle:H,connectionMode:Y,connection:W}=K,{fromHandle:L,toHandle:M,isValid:O}=W;if(!L&&!H)return Lv;let T=M?.nodeId===Q&&M?.id===U&&M?.type===Z;return{connectingFrom:L?.nodeId===Q&&L?.id===U&&L?.type===Z,connectingTo:T,clickConnecting:H?.nodeId===Q&&H?.id===U&&H?.type===Z,isPossibleEndHandle:Y===l6.Strict?L?.type!==Z:Q!==L?.nodeId||U!==L?.id,connectionInProcess:!!L,clickConnectionInProcess:!!H,valid:T&&O}};function Av({type:Q="source",position:U=E1.Top,isValidConnection:Z,isConnectable:K=!0,isConnectableStart:H=!0,isConnectableEnd:Y=!0,id:W,onConnect:L,children:M,className:O,onMouseDown:T,onTouchStart:A,...R},w){let P=W||null,V=Q==="target",S=d0(),C=nK(),{connectOnClick:y,noPanClassName:N,rfId:v}=Wv(),{connectingFrom:D,connectingTo:x,clickConnecting:E,isPossibleEndHandle:u,connectionInProcess:b,clickConnectionInProcess:m,valid:s}=L0(Bv(C,P,Q),i0);if(!C)S.getState().onError?.("010",F5.error010());let U1=(g)=>{let{defaultEdgeOptions:p,onConnect:c,hasDefaultEdges:l}=S.getState(),o={...p,...g};if(l){let{edges:k,setEdges:t,onError:_1}=S.getState();t(sS(o,k,{onError:_1}))}c?.(o),L?.(o)},Q1=(g)=>{if(!C)return;let p=mK(g.nativeEvent);if(H&&(p&&g.button===0||!p)){let c=S.getState();_U.onPointerDown(g.nativeEvent,{handleDomNode:g.currentTarget,autoPanOnConnect:c.autoPanOnConnect,connectionMode:c.connectionMode,connectionRadius:c.connectionRadius,domNode:c.domNode,nodeLookup:c.nodeLookup,lib:c.lib,isTarget:V,handleId:P,nodeId:C,flowId:c.rfId,panBy:c.panBy,cancelConnection:c.cancelConnection,onConnectStart:c.onConnectStart,onConnectEnd:(...l)=>S.getState().onConnectEnd?.(...l),updateConnection:c.updateConnection,onConnect:U1,isValidConnection:Z||((...l)=>S.getState().isValidConnection?.(...l)??!0),getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,autoPanSpeed:c.autoPanSpeed,dragThreshold:c.connectionDragThreshold})}if(p)T?.(g);else A?.(g)},h=(g)=>{let{onClickConnectStart:p,onClickConnectEnd:c,connectionClickStartHandle:l,connectionMode:o,isValidConnection:k,lib:t,rfId:_1,nodeLookup:a,connection:H1}=S.getState();if(!C||!l&&!H)return;if(!l){p?.(g.nativeEvent,{nodeId:C,handleId:P,handleType:Q}),S.setState({connectionClickStartHandle:{nodeId:C,type:Q,id:P}});return}let O1=hK(g.target),L1=Z||k,{connection:T1,isValid:G1}=_U.isValid(g.nativeEvent,{handle:{nodeId:C,id:P,type:Q},connectionMode:o,fromNodeId:l.nodeId,fromHandleId:l.id||null,fromType:l.type,isValidConnection:L1,flowId:_1,doc:O1,lib:t,nodeLookup:a});if(G1&&T1)U1(T1);let R1=structuredClone(H1);delete R1.inProgress,R1.toPosition=R1.toHandle?R1.toHandle.position:null,c?.(g,R1),S.setState({connectionClickStartHandle:null})};return K1.jsx("div",{"data-handleid":P,"data-nodeid":C,"data-handlepos":U,"data-id":`${v}-${C}-${P}-${Q}`,className:_2(["react-flow__handle",`react-flow__handle-${U}`,"nodrag",N,O,{source:!V,target:V,connectable:K,connectablestart:H,connectableend:Y,clickconnecting:E,connectingfrom:D,connectingto:x,valid:s,connectionindicator:K&&(!b||u)&&(b||m?Y:H)}]),onMouseDown:Q1,onTouchStart:Q1,onClick:y?h:void 0,ref:w,...R,children:M})}var qU=W1.memo(zR(Av));function Mv({data:Q,isConnectable:U,sourcePosition:Z=E1.Bottom}){return K1.jsxs(K1.Fragment,{children:[Q?.label,K1.jsx(qU,{type:"source",position:Z,isConnectable:U})]})}function Tv({data:Q,isConnectable:U,targetPosition:Z=E1.Top,sourcePosition:K=E1.Bottom}){return K1.jsxs(K1.Fragment,{children:[K1.jsx(qU,{type:"target",position:Z,isConnectable:U}),Q?.label,K1.jsx(qU,{type:"source",position:K,isConnectable:U})]})}function Rv(){return null}function Ov({data:Q,isConnectable:U,targetPosition:Z=E1.Top}){return K1.jsxs(K1.Fragment,{children:[K1.jsx(qU,{type:"target",position:Z,isConnectable:U}),Q?.label]})}var UU={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},dT={input:Mv,default:Tv,output:Ov,group:Rv};function Iv(Q){if(Q.internals.handleBounds===void 0)return{width:Q.width??Q.initialWidth??Q.style?.width,height:Q.height??Q.initialHeight??Q.style?.height};return{width:Q.width??Q.style?.width,height:Q.height??Q.style?.height}}var wv=(Q)=>{let{width:U,height:Z,x:K,y:H}=n8(Q.nodeLookup,{filter:(Y)=>!!Y.selected});return{width:e5(U)?U:null,height:e5(Z)?Z:null,userSelectionActive:Q.userSelectionActive,transformString:`translate(${Q.transform[0]}px,${Q.transform[1]}px) scale(${Q.transform[2]}) translate(${K}px,${H}px)`}};function Pv({onSelectionContextMenu:Q,noPanClassName:U,disableKeyboardA11y:Z}){let K=d0(),{width:H,height:Y,transformString:W,userSelectionActive:L}=L0(wv,i0),M=AR(),O=W1.useRef(null);W1.useEffect(()=>{if(!Z)O.current?.focus({preventScroll:!0})},[Z]);let T=!L&&H!==null&&Y!==null;if(BR({nodeRef:O,disabled:!T}),!T)return null;let A=Q?(w)=>{let P=K.getState().nodes.filter((V)=>V.selected);Q(w,P)}:void 0,R=(w)=>{if(Object.prototype.hasOwnProperty.call(UU,w.key))w.preventDefault(),M({direction:UU[w.key],factor:w.shiftKey?4:1})};return K1.jsx("div",{className:_2(["react-flow__nodesselection","react-flow__container",U]),style:{transform:W},children:K1.jsx("div",{ref:O,className:"react-flow__nodesselection-rect",onContextMenu:A,tabIndex:Z?void 0:-1,onKeyDown:Z?void 0:R,style:{width:H,height:Y}})})}var rT=typeof window<"u"?window:void 0,Nv=(Q)=>{return{nodesSelectionActive:Q.nodesSelectionActive,userSelectionActive:Q.userSelectionActive}};function TR({children:Q,onPaneClick:U,onPaneMouseEnter:Z,onPaneMouseMove:K,onPaneMouseLeave:H,onPaneContextMenu:Y,onPaneScroll:W,paneClickDistance:L,deleteKeyCode:M,selectionKeyCode:O,selectionOnDrag:T,selectionMode:A,onSelectionStart:R,onSelectionEnd:w,multiSelectionKeyCode:P,panActivationKeyCode:V,zoomActivationKeyCode:S,elementsSelectable:C,zoomOnScroll:y,zoomOnPinch:N,panOnScroll:v,panOnScrollSpeed:D,panOnScrollMode:x,zoomOnDoubleClick:E,panOnDrag:u,autoPanOnSelection:b,defaultViewport:m,translateExtent:s,minZoom:U1,maxZoom:Q1,preventScrolling:h,onSelectionContextMenu:g,noWheelClassName:p,noPanClassName:c,disableKeyboardA11y:l,onViewportChange:o,isControlledViewport:k}){let{nodesSelectionActive:t,userSelectionActive:_1}=L0(Nv,i0),a=cJ(O,{target:rT}),H1=cJ(V,{target:rT}),O1=H1||u,L1=H1||v,T1=T&&O1!==!0,G1=a||_1||T1;return $v({deleteKeyCode:M,multiSelectionKeyCode:P}),K1.jsx(Uv,{onPaneContextMenu:Y,elementsSelectable:C,zoomOnScroll:y,zoomOnPinch:N,panOnScroll:L1,panActivationKeyPressed:H1,panOnScrollSpeed:D,panOnScrollMode:x,zoomOnDoubleClick:E,panOnDrag:!a&&O1,defaultViewport:m,translateExtent:s,minZoom:U1,maxZoom:Q1,zoomActivationKeyCode:S,preventScrolling:h,noWheelClassName:p,noPanClassName:c,onViewportChange:o,isControlledViewport:k,paneClickDistance:L,selectionOnDrag:T1,children:K1.jsxs(Xv,{onSelectionStart:R,onSelectionEnd:w,onPaneClick:U,onPaneMouseEnter:Z,onPaneMouseMove:K,onPaneMouseLeave:H,onPaneContextMenu:Y,onPaneScroll:W,panOnDrag:O1,autoPanOnSelection:b,isSelecting:!!G1,selectionMode:A,selectionKeyPressed:a,paneClickDistance:L,selectionOnDrag:T1,children:[Q,t&&K1.jsx(Pv,{onSelectionContextMenu:g,noPanClassName:c,disableKeyboardA11y:l})]})})}TR.displayName="FlowRenderer";var Cv=W1.memo(TR),fv=(Q)=>(U)=>{return Q?cq(U.nodeLookup,{x:0,y:0,width:U.width,height:U.height},U.transform,!0).map((Z)=>Z.id):Array.from(U.nodeLookup.keys())};function Sv(Q){return L0(W1.useCallback(fv(Q),[Q]),i0)}var vv=(Q)=>Q.updateNodeInternals;function jv(){let Q=L0(vv),[U]=W1.useState(()=>{if(typeof ResizeObserver>"u")return null;return new ResizeObserver((Z)=>{let K=new Map;Z.forEach((H)=>{let Y=H.target.getAttribute("data-id");K.set(Y,{id:Y,nodeElement:H.target,force:!0})}),Q(K)})});return W1.useEffect(()=>{return()=>{U?.disconnect()}},[U]),U}function Vv({node:Q,nodeType:U,hasDimensions:Z,resizeObserver:K}){let H=d0(),Y=W1.useRef(null),W=W1.useRef(null),L=W1.useRef(Q.sourcePosition),M=W1.useRef(Q.targetPosition),O=W1.useRef(U),T=Z&&!!Q.internals.handleBounds;return W1.useEffect(()=>{if(Y.current&&!Q.hidden&&(!T||W.current!==Y.current)){if(W.current)K?.unobserve(W.current);K?.observe(Y.current),W.current=Y.current}},[T,Q.hidden]),W1.useEffect(()=>{return()=>{if(W.current)K?.unobserve(W.current),W.current=null}},[]),W1.useEffect(()=>{if(Y.current){let A=O.current!==U,R=L.current!==Q.sourcePosition,w=M.current!==Q.targetPosition;if(A||R||w)O.current=U,L.current=Q.sourcePosition,M.current=Q.targetPosition,H.getState().updateNodeInternals(new Map([[Q.id,{id:Q.id,nodeElement:Y.current,force:!0}]]))}},[Q.id,U,Q.sourcePosition,Q.targetPosition]),Y}function yv({id:Q,onClick:U,onMouseEnter:Z,onMouseMove:K,onMouseLeave:H,onContextMenu:Y,onDoubleClick:W,nodesDraggable:L,elementsSelectable:M,nodesConnectable:O,nodesFocusable:T,resizeObserver:A,noDragClassName:R,noPanClassName:w,disableKeyboardA11y:P,rfId:V,nodeTypes:S,nodeClickDistance:C,onError:y}){let{node:N,internals:v,isParent:D}=L0((G1)=>{let R1=G1.nodeLookup.get(Q),f1=G1.parentLookup.has(Q);return{node:R1,internals:R1.internals,isParent:f1}},i0),x=N.type||"default",E=S?.[x]||dT[x];if(E===void 0)y?.("003",F5.error003(x)),x="default",E=S?.default||dT.default;let u=!!(N.draggable||L&&typeof N.draggable>"u"),b=!!(N.selectable||M&&typeof N.selectable>"u"),m=!!(N.connectable||O&&typeof N.connectable>"u"),s=!!(N.focusable||T&&typeof N.focusable>"u"),U1=d0(),Q1=DK(N),h=Vv({node:N,nodeType:x,hasDimensions:Q1,resizeObserver:A}),g=BR({nodeRef:h,disabled:N.hidden||!u,noDragClassName:R,handleSelector:N.dragHandle,nodeId:Q,isSelectable:b,nodeClickDistance:C}),p=AR();if(N.hidden)return null;let c=J4(N),l=Iv(N),o=b||u||U||Z||K||H,k=Z?(G1)=>Z(G1,{...v.userNode}):void 0,t=K?(G1)=>K(G1,{...v.userNode}):void 0,_1=H?(G1)=>H(G1,{...v.userNode}):void 0,a=Y?(G1)=>Y(G1,{...v.userNode}):void 0,H1=W?(G1)=>W(G1,{...v.userNode}):void 0,O1=(G1)=>{let{selectNodesOnDrag:R1,nodeDragThreshold:f1}=U1.getState();if(b&&(!R1||!u||f1>0))tK({id:Q,store:U1,nodeRef:h});if(U)U(G1,{...v.userNode})},L1=(G1)=>{if(xK(G1.nativeEvent)||P)return;if(PK.includes(G1.key)&&b){let R1=G1.key==="Escape";tK({id:Q,store:U1,unselect:R1,nodeRef:h})}else if(u&&N.selected&&Object.prototype.hasOwnProperty.call(UU,G1.key)){G1.preventDefault();let{ariaLabelConfig:R1}=U1.getState();U1.setState({ariaLiveMessage:R1["node.a11yDescription.ariaLiveMessage"]({direction:G1.key.replace("Arrow","").toLowerCase(),x:~~v.positionAbsolute.x,y:~~v.positionAbsolute.y})}),p({direction:UU[G1.key],factor:G1.shiftKey?4:1})}},T1=()=>{if(P||!h.current?.matches(":focus-visible"))return;let{transform:G1,width:R1,height:f1,autoPanOnNodeFocus:z1,setCenter:C1}=U1.getState();if(!z1)return;if(!(cq(new Map([[Q,N]]),{x:0,y:0,width:R1,height:f1},G1,!0).length>0))C1(N.position.x+c.width/2,N.position.y+c.height/2,{zoom:G1[2]})};return K1.jsx("div",{className:_2(["react-flow__node",`react-flow__node-${x}`,{[w]:u},N.className,{selected:N.selected,selectable:b,parent:D,draggable:u,dragging:g}]),ref:h,style:{zIndex:v.z,transform:`translate(${v.positionAbsolute.x}px,${v.positionAbsolute.y}px)`,pointerEvents:o?"all":"none",visibility:Q1?"visible":"hidden",...N.style,...l},"data-id":Q,"data-testid":`rf__node-${Q}`,onMouseEnter:k,onMouseMove:t,onMouseLeave:_1,onContextMenu:a,onClick:O1,onDoubleClick:H1,onKeyDown:s?L1:void 0,tabIndex:s?0:void 0,onFocus:s?T1:void 0,role:N.ariaRole??(s?"group":void 0),"aria-roledescription":"node","aria-describedby":P?void 0:`${FR}-${V}`,"aria-label":N.ariaLabel,...N.domAttributes,children:K1.jsx(Hv,{value:Q,children:K1.jsx(E,{id:Q,data:N.data,type:x,positionAbsoluteX:v.positionAbsolute.x,positionAbsoluteY:v.positionAbsolute.y,selected:N.selected??!1,selectable:b,draggable:u,deletable:N.deletable??!0,isConnectable:m,sourcePosition:N.sourcePosition,targetPosition:N.targetPosition,dragging:g,dragHandle:N.dragHandle,zIndex:v.z,parentId:N.parentId,...c})})})}var kv=W1.memo(yv),Dv=(Q)=>({nodesConnectable:Q.nodesConnectable,nodesFocusable:Q.nodesFocusable,elementsSelectable:Q.elementsSelectable,onError:Q.onError});function RR(Q){let{nodesConnectable:U,nodesFocusable:Z,elementsSelectable:K,onError:H}=L0(Dv,i0),Y=Sv(Q.onlyRenderVisibleElements),W=jv();return K1.jsx("div",{className:"react-flow__nodes",style:ZU,children:Y.map((L)=>{return K1.jsx(kv,{id:L,nodeTypes:Q.nodeTypes,nodeExtent:Q.nodeExtent,onClick:Q.onNodeClick,onMouseEnter:Q.onNodeMouseEnter,onMouseMove:Q.onNodeMouseMove,onMouseLeave:Q.onNodeMouseLeave,onContextMenu:Q.onNodeContextMenu,onDoubleClick:Q.onNodeDoubleClick,noDragClassName:Q.noDragClassName,noPanClassName:Q.noPanClassName,rfId:Q.rfId,disableKeyboardA11y:Q.disableKeyboardA11y,resizeObserver:W,nodesDraggable:Q.nodesDraggable??!0,nodesConnectable:U,nodesFocusable:Z,elementsSelectable:K,nodeClickDistance:Q.nodeClickDistance,onError:H},L)})})}RR.displayName="NodeRenderer";var uv=W1.memo(RR);function bv(Q){return L0(W1.useCallback((Z)=>{if(!Q)return Z.edges.map((H)=>H.id);let K=[];if(Z.width&&Z.height)for(let H of Z.edges){let Y=Z.nodeLookup.get(H.source),W=Z.nodeLookup.get(H.target);if(Y&&W&&JT({sourceNode:Y,targetNode:W,width:Z.width,height:Z.height,transform:Z.transform}))K.push(H.id)}return K},[Q]),i0)}var Ev=({color:Q="none",strokeWidth:U=1})=>{let Z={strokeWidth:U,...Q&&{stroke:Q}};return K1.jsx("polyline",{className:"arrow",style:Z,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},hv=({color:Q="none",strokeWidth:U=1})=>{let Z={strokeWidth:U,...Q&&{stroke:Q,fill:Q}};return K1.jsx("polyline",{className:"arrowclosed",style:Z,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},aT={[T9.Arrow]:Ev,[T9.ArrowClosed]:hv};function xv(Q){let U=d0();return W1.useMemo(()=>{if(!Object.prototype.hasOwnProperty.call(aT,Q))return U.getState().onError?.("009",F5.error009(Q)),null;return aT[Q]},[Q])}var mv=({id:Q,type:U,color:Z,width:K=12.5,height:H=12.5,markerUnits:Y="strokeWidth",strokeWidth:W,orient:L="auto-start-reverse"})=>{let M=xv(U);if(!M)return null;return K1.jsx("marker",{className:"react-flow__arrowhead",id:Q,markerWidth:`${K}`,markerHeight:`${H}`,viewBox:"-10 -10 20 20",markerUnits:Y,orient:L,refX:"0",refY:"0",children:K1.jsx(M,{color:Z,strokeWidth:W})})},OR=({defaultColor:Q,rfId:U})=>{let Z=L0((Y)=>Y.edges),K=L0((Y)=>Y.defaultEdgeOptions),H=W1.useMemo(()=>{return qT(Z,{id:U,defaultColor:Q,defaultMarkerStart:K?.markerStart,defaultMarkerEnd:K?.markerEnd})},[Z,K,U,Q]);if(!H.length)return null;return K1.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:K1.jsx("defs",{children:H.map((Y)=>K1.jsx(mv,{id:Y.id,type:Y.type,color:Y.color,width:Y.width,height:Y.height,markerUnits:Y.markerUnits,strokeWidth:Y.strokeWidth,orient:Y.orient},Y.id))})})};OR.displayName="MarkerDefinitions";var gv=W1.memo(OR);function IR({x:Q,y:U,label:Z,labelStyle:K,labelShowBg:H=!0,labelBgStyle:Y,labelBgPadding:W=[2,4],labelBgBorderRadius:L=2,children:M,className:O,...T}){let[A,R]=W1.useState({x:1,y:0,width:0,height:0}),w=_2(["react-flow__edge-textwrapper",O]),P=W1.useRef(null);if(W1.useEffect(()=>{if(P.current){let V=P.current.getBBox();R({x:V.x,y:V.y,width:V.width,height:V.height})}},[Z]),!Z)return null;return K1.jsxs("g",{transform:`translate(${Q-A.width/2} ${U-A.height/2})`,className:w,visibility:A.width?"visible":"hidden",...T,children:[H&&K1.jsx("rect",{width:A.width+2*W[0],x:-W[0],y:-W[1],height:A.height+2*W[1],className:"react-flow__edge-textbg",style:Y,rx:L,ry:L}),K1.jsx("text",{className:"react-flow__edge-text",y:A.height/2,dy:"0.3em",ref:P,style:K,children:Z}),M]})}IR.displayName="EdgeText";var pv=W1.memo(IR);function FU({path:Q,labelX:U,labelY:Z,label:K,labelStyle:H,labelShowBg:Y,labelBgStyle:W,labelBgPadding:L,labelBgBorderRadius:M,interactionWidth:O=20,...T}){return K1.jsxs(K1.Fragment,{children:[K1.jsx("path",{...T,d:Q,fill:"none",className:_2(["react-flow__edge-path",T.className])}),O?K1.jsx("path",{d:Q,fill:"none",strokeOpacity:0,strokeWidth:O,className:"react-flow__edge-interaction"}):null,K&&e5(U)&&e5(Z)?K1.jsx(pv,{x:U,y:Z,label:K,labelStyle:H,labelShowBg:Y,labelBgStyle:W,labelBgPadding:L,labelBgBorderRadius:M}):null]})}function sT({pos:Q,x1:U,y1:Z,x2:K,y2:H}){if(Q===E1.Left||Q===E1.Right)return[0.5*(U+K),Z];return[U,0.5*(Z+H)]}function wR({sourceX:Q,sourceY:U,sourcePosition:Z=E1.Bottom,targetX:K,targetY:H,targetPosition:Y=E1.Top}){let[W,L]=sT({pos:Z,x1:Q,y1:U,x2:K,y2:H}),[M,O]=sT({pos:Y,x1:K,y1:H,x2:Q,y2:U}),[T,A,R,w]=aq({sourceX:Q,sourceY:U,targetX:K,targetY:H,sourceControlX:W,sourceControlY:L,targetControlX:M,targetControlY:O});return[`M${Q},${U} C${W},${L} ${M},${O} ${K},${H}`,T,A,R,w]}function PR(Q){return W1.memo(({id:U,sourceX:Z,sourceY:K,targetX:H,targetY:Y,sourcePosition:W,targetPosition:L,label:M,labelStyle:O,labelShowBg:T,labelBgStyle:A,labelBgPadding:R,labelBgBorderRadius:w,style:P,markerEnd:V,markerStart:S,interactionWidth:C})=>{let[y,N,v]=wR({sourceX:Z,sourceY:K,sourcePosition:W,targetX:H,targetY:Y,targetPosition:L}),D=Q.isInternal?void 0:U;return K1.jsx(FU,{id:D,path:y,labelX:N,labelY:v,label:M,labelStyle:O,labelShowBg:T,labelBgStyle:A,labelBgPadding:R,labelBgBorderRadius:w,style:P,markerEnd:V,markerStart:S,interactionWidth:C})})}var cv=PR({isInternal:!1}),NR=PR({isInternal:!0});cv.displayName="SimpleBezierEdge";NR.displayName="SimpleBezierEdgeInternal";function CR(Q){return W1.memo(({id:U,sourceX:Z,sourceY:K,targetX:H,targetY:Y,label:W,labelStyle:L,labelShowBg:M,labelBgStyle:O,labelBgPadding:T,labelBgBorderRadius:A,style:R,sourcePosition:w=E1.Bottom,targetPosition:P=E1.Top,markerEnd:V,markerStart:S,pathOptions:C,interactionWidth:y})=>{let[N,v,D]=pJ({sourceX:Z,sourceY:K,sourcePosition:w,targetX:H,targetY:Y,targetPosition:P,borderRadius:C?.borderRadius,offset:C?.offset,stepPosition:C?.stepPosition}),x=Q.isInternal?void 0:U;return K1.jsx(FU,{id:x,path:N,labelX:v,labelY:D,label:W,labelStyle:L,labelShowBg:M,labelBgStyle:O,labelBgPadding:T,labelBgBorderRadius:A,style:R,markerEnd:V,markerStart:S,interactionWidth:y})})}var fR=CR({isInternal:!1}),SR=CR({isInternal:!0});fR.displayName="SmoothStepEdge";SR.displayName="SmoothStepEdgeInternal";function vR(Q){return W1.memo(({id:U,...Z})=>{let K=Q.isInternal?void 0:U;return K1.jsx(fR,{...Z,id:K,pathOptions:W1.useMemo(()=>({borderRadius:0,offset:Z.pathOptions?.offset}),[Z.pathOptions?.offset])})})}var lv=vR({isInternal:!1}),jR=vR({isInternal:!0});lv.displayName="StepEdge";jR.displayName="StepEdgeInternal";function VR(Q){return W1.memo(({id:U,sourceX:Z,sourceY:K,targetX:H,targetY:Y,label:W,labelStyle:L,labelShowBg:M,labelBgStyle:O,labelBgPadding:T,labelBgBorderRadius:A,style:R,markerEnd:w,markerStart:P,interactionWidth:V})=>{let[S,C,y]=tq({sourceX:Z,sourceY:K,targetX:H,targetY:Y}),N=Q.isInternal?void 0:U;return K1.jsx(FU,{id:N,path:S,labelX:C,labelY:y,label:W,labelStyle:L,labelShowBg:M,labelBgStyle:O,labelBgPadding:T,labelBgBorderRadius:A,style:R,markerEnd:w,markerStart:P,interactionWidth:V})})}var iv=VR({isInternal:!1}),yR=VR({isInternal:!0});iv.displayName="StraightEdge";yR.displayName="StraightEdgeInternal";function kR(Q){return W1.memo(({id:U,sourceX:Z,sourceY:K,targetX:H,targetY:Y,sourcePosition:W=E1.Bottom,targetPosition:L=E1.Top,label:M,labelStyle:O,labelShowBg:T,labelBgStyle:A,labelBgPadding:R,labelBgBorderRadius:w,style:P,markerEnd:V,markerStart:S,pathOptions:C,interactionWidth:y})=>{let[N,v,D]=sq({sourceX:Z,sourceY:K,sourcePosition:W,targetX:H,targetY:Y,targetPosition:L,curvature:C?.curvature}),x=Q.isInternal?void 0:U;return K1.jsx(FU,{id:x,path:N,labelX:v,labelY:D,label:M,labelStyle:O,labelShowBg:T,labelBgStyle:A,labelBgPadding:R,labelBgBorderRadius:w,style:P,markerEnd:V,markerStart:S,interactionWidth:y})})}var dv=kR({isInternal:!1}),DR=kR({isInternal:!0});dv.displayName="BezierEdge";DR.displayName="BezierEdgeInternal";var tT={default:DR,straight:yR,step:jR,smoothstep:SR,simplebezier:NR},oT={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},rv=(Q,U,Z)=>{if(Z===E1.Left)return Q-U;if(Z===E1.Right)return Q+U;return Q},av=(Q,U,Z)=>{if(Z===E1.Top)return Q-U;if(Z===E1.Bottom)return Q+U;return Q},nT="react-flow__edgeupdater";function eT({position:Q,centerX:U,centerY:Z,radius:K=10,onMouseDown:H,onMouseEnter:Y,onMouseOut:W,type:L}){return K1.jsx("circle",{onMouseDown:H,onMouseEnter:Y,onMouseOut:W,className:_2([nT,`${nT}-${L}`]),cx:rv(U,K,Q),cy:av(Z,K,Q),r:K,stroke:"transparent",fill:"transparent"})}function sv({isReconnectable:Q,reconnectRadius:U,edge:Z,sourceX:K,sourceY:H,targetX:Y,targetY:W,sourcePosition:L,targetPosition:M,onReconnect:O,onReconnectStart:T,onReconnectEnd:A,setReconnecting:R,setUpdateHover:w}){let P=d0(),V=(v,D)=>{if(v.button!==0)return;let{autoPanOnConnect:x,domNode:E,connectionMode:u,connectionRadius:b,lib:m,onConnectStart:s,cancelConnection:U1,nodeLookup:Q1,rfId:h,panBy:g,updateConnection:p}=P.getState(),c=D.type==="target",l=(t,_1)=>{R(!1),A?.(t,Z,D.type,_1)},o=(t)=>O?.(Z,t),k=(t,_1)=>{R(!0),T?.(v,Z,D.type),s?.(t,_1)};_U.onPointerDown(v.nativeEvent,{autoPanOnConnect:x,connectionMode:u,connectionRadius:b,domNode:E,handleId:D.id,nodeId:D.nodeId,nodeLookup:Q1,isTarget:c,edgeUpdaterType:D.type,lib:m,flowId:h,cancelConnection:U1,panBy:g,isValidConnection:(...t)=>P.getState().isValidConnection?.(...t)??!0,onConnect:o,onConnectStart:k,onConnectEnd:(...t)=>P.getState().onConnectEnd?.(...t),onReconnectEnd:l,updateConnection:p,getTransform:()=>P.getState().transform,getFromHandle:()=>P.getState().connection.fromHandle,dragThreshold:P.getState().connectionDragThreshold,handleDomNode:v.currentTarget})},S=(v)=>V(v,{nodeId:Z.target,id:Z.targetHandle??null,type:"target"}),C=(v)=>V(v,{nodeId:Z.source,id:Z.sourceHandle??null,type:"source"}),y=()=>w(!0),N=()=>w(!1);return K1.jsxs(K1.Fragment,{children:[(Q===!0||Q==="source")&&K1.jsx(eT,{position:L,centerX:K,centerY:H,radius:U,onMouseDown:S,onMouseEnter:y,onMouseOut:N,type:"source"}),(Q===!0||Q==="target")&&K1.jsx(eT,{position:M,centerX:Y,centerY:W,radius:U,onMouseDown:C,onMouseEnter:y,onMouseOut:N,type:"target"})]})}function tv({id:Q,edgesFocusable:U,edgesReconnectable:Z,elementsSelectable:K,onClick:H,onDoubleClick:Y,onContextMenu:W,onMouseEnter:L,onMouseMove:M,onMouseLeave:O,reconnectRadius:T,onReconnect:A,onReconnectStart:R,onReconnectEnd:w,rfId:P,edgeTypes:V,noPanClassName:S,onError:C,disableKeyboardA11y:y}){let N=L0((C1)=>C1.edgeLookup.get(Q)),v=L0((C1)=>C1.defaultEdgeOptions);N=v?{...v,...N}:N;let D=N.type||"default",x=V?.[D]||tT[D];if(x===void 0)C?.("011",F5.error011(D)),D="default",x=V?.default||tT.default;let E=!!(N.focusable||U&&typeof N.focusable>"u"),u=typeof A<"u"&&(N.reconnectable||Z&&typeof N.reconnectable>"u"),b=!!(N.selectable||K&&typeof N.selectable>"u"),m=W1.useRef(null),[s,U1]=W1.useState(!1),[Q1,h]=W1.useState(!1),g=d0(),{zIndex:p=N.zIndex,sourceX:c,sourceY:l,targetX:o,targetY:k,sourcePosition:t,targetPosition:_1}=L0(W1.useCallback((C1)=>{let b1=C1.nodeLookup.get(N.source),c1=C1.nodeLookup.get(N.target);if(!b1||!c1)return oT;let D1=QT({id:Q,sourceNode:b1,targetNode:c1,sourceHandle:N.sourceHandle||null,targetHandle:N.targetHandle||null,connectionMode:C1.connectionMode,onError:C}),A1=_T({selected:N.selected,zIndex:N.zIndex,sourceNode:b1,targetNode:c1,elevateOnSelect:C1.elevateEdgesOnSelect,zIndexMode:C1.zIndexMode});return{...D1||oT,zIndex:A1}},[N.source,N.target,N.sourceHandle,N.targetHandle,N.selected,N.zIndex,C]),i0),a=W1.useMemo(()=>N.markerStart?`url('#${oq(N.markerStart,P)}')`:void 0,[N.markerStart,P]),H1=W1.useMemo(()=>N.markerEnd?`url('#${oq(N.markerEnd,P)}')`:void 0,[N.markerEnd,P]);if(N.hidden||c===null||l===null||o===null||k===null)return null;let O1=(C1)=>{let{addSelectedEdges:b1,unselectNodesAndEdges:c1,multiSelectionActive:D1}=g.getState();if(b)if(g.setState({nodesSelectionActive:!1}),N.selected&&D1)c1({nodes:[],edges:[N]}),m.current?.blur();else b1([Q]);if(H)H(C1,N)},L1=Y?(C1)=>{Y(C1,{...N})}:void 0,T1=W?(C1)=>{W(C1,{...N})}:void 0,G1=L?(C1)=>{L(C1,{...N})}:void 0,R1=M?(C1)=>{M(C1,{...N})}:void 0,f1=O?(C1)=>{O(C1,{...N})}:void 0,z1=(C1)=>{if(!y&&PK.includes(C1.key)&&b){let{unselectNodesAndEdges:b1,addSelectedEdges:c1}=g.getState();if(C1.key==="Escape")m.current?.blur(),b1({edges:[N]});else c1([Q])}};return K1.jsx("svg",{style:{zIndex:p},children:K1.jsxs("g",{className:_2(["react-flow__edge",`react-flow__edge-${D}`,N.className,S,{selected:N.selected,animated:N.animated,inactive:!b&&!H,updating:s,selectable:b}]),onClick:O1,onDoubleClick:L1,onContextMenu:T1,onMouseEnter:G1,onMouseMove:R1,onMouseLeave:f1,onKeyDown:E?z1:void 0,tabIndex:E?0:void 0,role:N.ariaRole??(E?"group":"img"),"aria-roledescription":"edge","data-id":Q,"data-testid":`rf__edge-${Q}`,"aria-label":N.ariaLabel===null?void 0:N.ariaLabel||`Edge from ${N.source} to ${N.target}`,"aria-describedby":E?`${XR}-${P}`:void 0,ref:m,...N.domAttributes,children:[!Q1&&K1.jsx(x,{id:Q,source:N.source,target:N.target,type:N.type,selected:N.selected,animated:N.animated,selectable:b,deletable:N.deletable??!0,label:N.label,labelStyle:N.labelStyle,labelShowBg:N.labelShowBg,labelBgStyle:N.labelBgStyle,labelBgPadding:N.labelBgPadding,labelBgBorderRadius:N.labelBgBorderRadius,sourceX:c,sourceY:l,targetX:o,targetY:k,sourcePosition:t,targetPosition:_1,data:N.data,style:N.style,sourceHandleId:N.sourceHandle,targetHandleId:N.targetHandle,markerStart:a,markerEnd:H1,pathOptions:"pathOptions"in N?N.pathOptions:void 0,interactionWidth:N.interactionWidth}),u&&K1.jsx(sv,{edge:N,isReconnectable:u,reconnectRadius:T,onReconnect:A,onReconnectStart:R,onReconnectEnd:w,sourceX:c,sourceY:l,targetX:o,targetY:k,sourcePosition:t,targetPosition:_1,setUpdateHover:U1,setReconnecting:h})]})})}var ov=W1.memo(tv),nv=(Q)=>({edgesFocusable:Q.edgesFocusable,edgesReconnectable:Q.edgesReconnectable,elementsSelectable:Q.elementsSelectable,connectionMode:Q.connectionMode,onError:Q.onError});function uR({defaultMarkerColor:Q,onlyRenderVisibleElements:U,rfId:Z,edgeTypes:K,noPanClassName:H,onReconnect:Y,onEdgeContextMenu:W,onEdgeMouseEnter:L,onEdgeMouseMove:M,onEdgeMouseLeave:O,onEdgeClick:T,reconnectRadius:A,onEdgeDoubleClick:R,onReconnectStart:w,onReconnectEnd:P,disableKeyboardA11y:V}){let{edgesFocusable:S,edgesReconnectable:C,elementsSelectable:y,onError:N}=L0(nv,i0),v=bv(U);return K1.jsxs("div",{className:"react-flow__edges",children:[K1.jsx(gv,{defaultColor:Q,rfId:Z}),v.map((D)=>{return K1.jsx(ov,{id:D,edgesFocusable:S,edgesReconnectable:C,elementsSelectable:y,noPanClassName:H,onReconnect:Y,onContextMenu:W,onMouseEnter:L,onMouseMove:M,onMouseLeave:O,onClick:T,reconnectRadius:A,onDoubleClick:R,onReconnectStart:w,onReconnectEnd:P,rfId:Z,onError:N,edgeTypes:K,disableKeyboardA11y:V},D)})]})}uR.displayName="EdgeRenderer";var ev=W1.memo(uR),_R=(Q)=>`translate(${Q[0]}px,${Q[1]}px) scale(${Q[2]})`;function _j({children:Q}){let U=d0(),Z=W1.useRef(null),[K]=W1.useState(()=>U.getState().transform);return WR(()=>{let H=null,Y=()=>{let W=U.getState().transform;if(H&&W[0]===H[0]&&W[1]===H[1]&&W[2]===H[2])return;if(H=W,Z.current)Z.current.style.transform=_R(W)};return Y(),U.subscribe(Y)},[U]),K1.jsx("div",{ref:Z,className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:_R(K)},children:Q})}function Jj(Q){let U=lJ(),Z=W1.useRef(!1);W1.useEffect(()=>{if(!Z.current&&U.viewportInitialized&&Q)setTimeout(()=>Q(U),1),Z.current=!0},[Q,U.viewportInitialized])}var $j=(Q)=>Q.panZoom?.syncViewport;function Qj(Q){let U=L0($j),Z=d0();return W1.useEffect(()=>{if(Q)U?.(Q),Z.setState({transform:[Q.x,Q.y,Q.zoom]})},[Q,U]),null}function JR(Q){return Q.connection.inProgress?{...Q.connection,to:P9(Q.connection.to,Q.transform)}:{...Q.connection}}function qj(Q){if(Q)return(Z)=>{let K=JR(Z);return Q(K)};return JR}function Uj(Q){let U=qj(Q);return L0(U,i0)}var Gj=(Q)=>({nodesConnectable:Q.nodesConnectable,isValid:Q.connection.isValid,inProgress:Q.connection.inProgress,width:Q.width,height:Q.height});function Zj({containerStyle:Q,style:U,type:Z,component:K}){let{nodesConnectable:H,width:Y,height:W,isValid:L,inProgress:M}=L0(Gj,i0);if(!(Y&&H&&M))return null;return K1.jsx("svg",{style:Q,width:Y,height:W,className:"react-flow__connectionline react-flow__container",children:K1.jsx("g",{className:_2(["react-flow__connection",EK(L)]),children:K1.jsx(bR,{style:U,type:Z,CustomComponent:K,isValid:L})})})}var bR=({style:Q,type:U=$3.Bezier,CustomComponent:Z,isValid:K})=>{let{inProgress:H,from:Y,fromNode:W,fromHandle:L,fromPosition:M,to:O,toNode:T,toHandle:A,toPosition:R,pointer:w}=Uj();if(!H)return;if(Z)return K1.jsx(Z,{connectionLineType:U,connectionLineStyle:Q,fromNode:W,fromHandle:L,fromX:Y.x,fromY:Y.y,toX:O.x,toY:O.y,fromPosition:M,toPosition:R,connectionStatus:EK(K),toNode:T,toHandle:A,pointer:w});let P="",V={sourceX:Y.x,sourceY:Y.y,sourcePosition:M,targetX:O.x,targetY:O.y,targetPosition:R};switch(U){case $3.Bezier:[P]=sq(V);break;case $3.SimpleBezier:[P]=wR(V);break;case $3.Step:[P]=pJ({...V,borderRadius:0});break;case $3.SmoothStep:[P]=pJ(V);break;default:[P]=tq(V)}return K1.jsx("path",{d:P,fill:"none",className:"react-flow__connection-path",style:Q})};bR.displayName="ConnectionLine";var Fj={};function $R(Q=Fj){let U=W1.useRef(Q),Z=d0();W1.useEffect(()=>{{let K=new Set([...Object.keys(U.current),...Object.keys(Q)]);for(let H of K)if(U.current[H]!==Q[H]){Z.getState().onError?.("002",F5.error002());break}U.current=Q}},[Q])}function Xj(){let Q=d0(),U=W1.useRef(!1);W1.useEffect(()=>{if(!U.current){let Z=document.querySelector(".react-flow__pane");if(Z&&window.getComputedStyle(Z).zIndex!=="1")Q.getState().onError?.("013",F5.error013("react"));U.current=!0}},[])}function ER({nodeTypes:Q,edgeTypes:U,onInit:Z,onNodeClick:K,onEdgeClick:H,onNodeDoubleClick:Y,onEdgeDoubleClick:W,onNodeMouseEnter:L,onNodeMouseMove:M,onNodeMouseLeave:O,onNodeContextMenu:T,onSelectionContextMenu:A,onSelectionStart:R,onSelectionEnd:w,connectionLineType:P,connectionLineStyle:V,connectionLineComponent:S,connectionLineContainerStyle:C,selectionKeyCode:y,selectionOnDrag:N,selectionMode:v,multiSelectionKeyCode:D,panActivationKeyCode:x,zoomActivationKeyCode:E,deleteKeyCode:u,onlyRenderVisibleElements:b,elementsSelectable:m,defaultViewport:s,translateExtent:U1,minZoom:Q1,maxZoom:h,preventScrolling:g,defaultMarkerColor:p,zoomOnScroll:c,zoomOnPinch:l,panOnScroll:o,panOnScrollSpeed:k,panOnScrollMode:t,zoomOnDoubleClick:_1,panOnDrag:a,autoPanOnSelection:H1,onPaneClick:O1,onPaneMouseEnter:L1,onPaneMouseMove:T1,onPaneMouseLeave:G1,onPaneScroll:R1,onPaneContextMenu:f1,paneClickDistance:z1,nodeClickDistance:C1,onEdgeContextMenu:b1,onEdgeMouseEnter:c1,onEdgeMouseMove:D1,onEdgeMouseLeave:A1,reconnectRadius:e1,onReconnect:k1,onReconnectStart:g0,onReconnectEnd:_0,noDragClassName:t0,noWheelClassName:C2,noPanClassName:u2,disableKeyboardA11y:b2,nodeExtent:f2,rfId:T2,viewport:G2,onViewportChange:R2,nodesDraggable:I4}){return $R(Q),$R(U),Xj(),Jj(Z),Qj(G2),K1.jsx(Cv,{onPaneClick:O1,onPaneMouseEnter:L1,onPaneMouseMove:T1,onPaneMouseLeave:G1,onPaneContextMenu:f1,onPaneScroll:R1,paneClickDistance:z1,deleteKeyCode:u,selectionKeyCode:y,selectionOnDrag:N,selectionMode:v,onSelectionStart:R,onSelectionEnd:w,multiSelectionKeyCode:D,panActivationKeyCode:x,zoomActivationKeyCode:E,elementsSelectable:m,zoomOnScroll:c,zoomOnPinch:l,zoomOnDoubleClick:_1,panOnScroll:o,panOnScrollSpeed:k,panOnScrollMode:t,panOnDrag:a,autoPanOnSelection:H1,defaultViewport:s,translateExtent:U1,minZoom:Q1,maxZoom:h,onSelectionContextMenu:A,preventScrolling:g,noDragClassName:t0,noWheelClassName:C2,noPanClassName:u2,disableKeyboardA11y:b2,onViewportChange:R2,isControlledViewport:!!G2,children:K1.jsxs(_j,{children:[K1.jsx(ev,{edgeTypes:U,onEdgeClick:H,onEdgeDoubleClick:W,onReconnect:k1,onReconnectStart:g0,onReconnectEnd:_0,onlyRenderVisibleElements:b,onEdgeContextMenu:b1,onEdgeMouseEnter:c1,onEdgeMouseMove:D1,onEdgeMouseLeave:A1,reconnectRadius:e1,defaultMarkerColor:p,noPanClassName:u2,disableKeyboardA11y:b2,rfId:T2}),K1.jsx(Zj,{style:V,type:P,component:S,containerStyle:C}),K1.jsx("div",{className:"react-flow__edgelabel-renderer"}),K1.jsx(uv,{nodeTypes:Q,onNodeClick:K,onNodeDoubleClick:Y,onNodeMouseEnter:L,onNodeMouseMove:M,onNodeMouseLeave:O,onNodeContextMenu:T,nodeClickDistance:C1,onlyRenderVisibleElements:b,noPanClassName:u2,noDragClassName:t0,disableKeyboardA11y:b2,nodeExtent:f2,rfId:T2,nodesDraggable:I4}),K1.jsx("div",{className:"react-flow__viewport-portal"})]})})}ER.displayName="GraphView";var Kj=W1.memo(ER),Hj=kK("React Flow","https://reactflow.dev/"),QR=({nodes:Q,edges:U,defaultNodes:Z,defaultEdges:K,width:H,height:Y,fitView:W,fitViewOptions:L,minZoom:M=0.5,maxZoom:O=2,nodeOrigin:T,nodeExtent:A,zIndexMode:R="basic"}={})=>{let w=new Map,P=new Map,V=new Map,S=new Map,C=K??U??[],y=Z??Q??[],N=T??[0,0],v=A??O9;dK(V,S,C);let{nodesInitialized:D}=nq(y,w,P,{nodeOrigin:N,nodeExtent:v,zIndexMode:R}),x=[0,0,1];if(W&&H&&Y){let E=n8(w,{filter:(s)=>!!((s.width||s.initialWidth)&&(s.height||s.initialHeight))}),{x:u,y:b,zoom:m}=gJ(E,H,Y,M,O,L?.padding??0.1);x=[u,b,m]}return{rfId:"1",width:H??0,height:Y??0,transform:x,nodes:y,nodesInitialized:D,nodeLookup:w,parentLookup:P,edges:C,edgeLookup:S,connectionLookup:V,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:Z!==void 0,hasDefaultEdges:K!==void 0,panZoom:null,minZoom:M,maxZoom:O,translateExtent:O9,nodeExtent:v,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:l6.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:N,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:W??!1,fitViewOptions:L,fitViewResolver:null,connection:{...CK},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Hj,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:NK,zIndexMode:R,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}},Yj=({nodes:Q,edges:U,defaultNodes:Z,defaultEdges:K,width:H,height:Y,fitView:W,fitViewOptions:L,minZoom:M,maxZoom:O,nodeOrigin:T,nodeExtent:A,zIndexMode:R})=>yT((w,P)=>{async function V(){let{nodeLookup:S,panZoom:C,fitViewOptions:y,fitViewResolver:N,width:v,height:D,minZoom:x,maxZoom:E}=P();if(!C)return;await rM({nodes:S,width:v,height:D,panZoom:C,minZoom:x,maxZoom:E},y),N?.resolve(!0),w({fitViewResolver:null})}return{...QR({nodes:Q,edges:U,width:H,height:Y,fitView:W,fitViewOptions:L,minZoom:M,maxZoom:O,nodeOrigin:T,nodeExtent:A,defaultNodes:Z,defaultEdges:K,zIndexMode:R}),setNodes:(S)=>{let{nodeLookup:C,parentLookup:y,nodeOrigin:N,nodeExtent:v,elevateNodesOnSelect:D,fitViewQueued:x,zIndexMode:E,nodesSelectionActive:u}=P(),{nodesInitialized:b,hasSelectedNodes:m}=nq(S,C,y,{nodeOrigin:N,nodeExtent:v,elevateNodesOnSelect:D,checkEquality:!0,zIndexMode:E}),s=u&&m;if(x&&b)V(),w({nodes:S,nodesInitialized:b,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:s});else w({nodes:S,nodesInitialized:b,nodesSelectionActive:s})},setEdges:(S)=>{let{connectionLookup:C,edgeLookup:y}=P();dK(C,y,S),w({edges:S})},setDefaultNodesAndEdges:(S,C)=>{if(S){let{setNodes:y}=P();y(S),w({hasDefaultNodes:!0})}if(C){let{setEdges:y}=P();y(C),w({hasDefaultEdges:!0})}},updateNodeInternals:(S)=>{let{triggerNodeChanges:C,nodeLookup:y,parentLookup:N,domNode:v,nodeOrigin:D,nodeExtent:x,debug:E,fitViewQueued:u,zIndexMode:b}=P(),{changes:m,updatedInternals:s}=XT(S,y,N,v,D,x,b);if(!s)return;if(ZT(y,N,{nodeOrigin:D,nodeExtent:x,zIndexMode:b}),u)V(),w({fitViewQueued:!1,fitViewOptions:void 0});else w({});if(m?.length>0){if(E)console.log("React Flow: trigger node changes",m);C?.(m)}},updateNodePositions:(S,C=!1)=>{let y=[],N=[],{nodeLookup:v,triggerNodeChanges:D,connection:x,updateConnection:E,onNodesChangeMiddlewareMap:u}=P();for(let[b,m]of S){let s=v.get(b),U1=!!(s?.expandParent&&s?.parentId&&m?.position),Q1={id:b,type:"position",position:U1?{x:Math.max(0,m.position.x),y:Math.max(0,m.position.y)}:m.position,dragging:C};if(s&&x.inProgress&&x.fromNode.id===s.id){let h=i6(s,x.fromHandle,E1.Left,!0);E({...x,from:h})}if(U1&&s.parentId)y.push({id:b,parentId:s.parentId,rect:{...m.internals.positionAbsolute,width:m.measured.width??0,height:m.measured.height??0}});N.push(Q1)}if(y.length>0){let{parentLookup:b,nodeOrigin:m}=P(),s=eq(y,v,b,m);N.push(...s)}for(let b of u.values())N=b(N);D(N)},triggerNodeChanges:(S)=>{let{onNodesChange:C,setNodes:y,nodes:N,hasDefaultNodes:v,debug:D}=P();if(S?.length){if(v){let x=YR(S,N);y(x)}if(D)console.log("React Flow: trigger node changes",S);C?.(S)}},triggerEdgeChanges:(S)=>{let{onEdgesChange:C,setEdges:y,edges:N,hasDefaultEdges:v,debug:D}=P();if(S?.length){if(v){let x=rS(S,N);y(x)}if(D)console.log("React Flow: trigger edge changes",S);C?.(S)}},addSelectedNodes:(S)=>{let{multiSelectionActive:C,edgeLookup:y,nodeLookup:N,triggerNodeChanges:v,triggerEdgeChanges:D}=P();if(C){let x=S.map((E)=>e8(E,!0));v(x);return}v(C9(N,new Set([...S]),!0)),D(C9(y))},addSelectedEdges:(S)=>{let{multiSelectionActive:C,edgeLookup:y,nodeLookup:N,triggerNodeChanges:v,triggerEdgeChanges:D}=P();if(C){let x=S.map((E)=>e8(E,!0));D(x);return}D(C9(y,new Set([...S]))),v(C9(N,new Set,!0))},unselectNodesAndEdges:({nodes:S,edges:C}={})=>{let{edges:y,nodes:N,nodeLookup:v,triggerNodeChanges:D,triggerEdgeChanges:x}=P(),E=S?S:N,u=C?C:y,b=[];for(let s of E){if(!s.selected)continue;let U1=v.get(s.id);if(U1)U1.selected=!1;b.push(e8(s.id,!1))}let m=[];for(let s of u){if(!s.selected)continue;m.push(e8(s.id,!1))}D(b),x(m)},setMinZoom:(S)=>{let{panZoom:C,maxZoom:y}=P();C?.setScaleExtent([S,y]),w({minZoom:S})},setMaxZoom:(S)=>{let{panZoom:C,minZoom:y}=P();C?.setScaleExtent([y,S]),w({maxZoom:S})},setTranslateExtent:(S)=>{P().panZoom?.setTranslateExtent(S),w({translateExtent:S})},resetSelectedElements:()=>{let{edges:S,nodes:C,triggerNodeChanges:y,triggerEdgeChanges:N,elementsSelectable:v}=P();if(!v)return;let D=C.reduce((E,u)=>u.selected?[...E,e8(u.id,!1)]:E,[]),x=S.reduce((E,u)=>u.selected?[...E,e8(u.id,!1)]:E,[]);y(D),N(x)},setNodeExtent:(S)=>{let{nodes:C,nodeLookup:y,parentLookup:N,nodeOrigin:v,elevateNodesOnSelect:D,nodeExtent:x,zIndexMode:E}=P();if(S[0][0]===x[0][0]&&S[0][1]===x[0][1]&&S[1][0]===x[1][0]&&S[1][1]===x[1][1])return;nq(C,y,N,{nodeOrigin:v,nodeExtent:S,elevateNodesOnSelect:D,checkEquality:!1,zIndexMode:E}),w({nodeExtent:S})},panBy:(S)=>{let{transform:C,width:y,height:N,panZoom:v,translateExtent:D}=P();return KT({delta:S,panZoom:v,transform:C,translateExtent:D,width:y,height:N})},setCenter:async(S,C,y)=>{let{width:N,height:v,maxZoom:D,panZoom:x}=P();if(!x)return!1;let E=typeof y?.zoom<"u"?y.zoom:D;return await x.setViewport({x:N/2-S*E,y:v/2-C*E,zoom:E},{duration:y?.duration,ease:y?.ease,interpolate:y?.interpolate}),!0},cancelConnection:()=>{w({connection:{...CK}})},updateConnection:(S)=>{w({connection:S})},reset:()=>w({...QR()})}},Object.is);function eK({initialNodes:Q,initialEdges:U,defaultNodes:Z,defaultEdges:K,initialWidth:H,initialHeight:Y,initialMinZoom:W,initialMaxZoom:L,initialFitViewOptions:M,fitView:O,nodeOrigin:T,nodeExtent:A,zIndexMode:R,children:w}){let[P]=W1.useState(()=>Yj({nodes:Q,edges:U,defaultNodes:Z,defaultEdges:K,width:H,height:Y,fitView:O,minZoom:W,maxZoom:L,fitViewOptions:M,nodeOrigin:T,nodeExtent:A,zIndexMode:R}));return K1.jsx(fS,{value:P,children:K1.jsx(nS,{children:K1.jsx(zv,{children:w})})})}function zj({children:Q,nodes:U,edges:Z,defaultNodes:K,defaultEdges:H,width:Y,height:W,fitView:L,fitViewOptions:M,minZoom:O,maxZoom:T,nodeOrigin:A,nodeExtent:R,zIndexMode:w}){if(W1.useContext(GU))return K1.jsx(K1.Fragment,{children:Q});return K1.jsx(eK,{initialNodes:U,initialEdges:Z,defaultNodes:K,defaultEdges:H,initialWidth:Y,initialHeight:W,fitView:L,initialFitViewOptions:M,initialMinZoom:O,initialMaxZoom:T,nodeOrigin:A,nodeExtent:R,zIndexMode:w,children:Q})}var Wj={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function Lj({nodes:Q,edges:U,defaultNodes:Z,defaultEdges:K,className:H,nodeTypes:Y,edgeTypes:W,onNodeClick:L,onEdgeClick:M,onInit:O,onMove:T,onMoveStart:A,onMoveEnd:R,onConnect:w,onConnectStart:P,onConnectEnd:V,onClickConnectStart:S,onClickConnectEnd:C,onNodeMouseEnter:y,onNodeMouseMove:N,onNodeMouseLeave:v,onNodeContextMenu:D,onNodeDoubleClick:x,onNodeDragStart:E,onNodeDrag:u,onNodeDragStop:b,onNodesDelete:m,onEdgesDelete:s,onDelete:U1,onSelectionChange:Q1,onSelectionDragStart:h,onSelectionDrag:g,onSelectionDragStop:p,onSelectionContextMenu:c,onSelectionStart:l,onSelectionEnd:o,onBeforeDelete:k,connectionMode:t,connectionLineType:_1=$3.Bezier,connectionLineStyle:a,connectionLineComponent:H1,connectionLineContainerStyle:O1,deleteKeyCode:L1="Backspace",selectionKeyCode:T1="Shift",selectionOnDrag:G1=!1,selectionMode:R1=a8.Full,panActivationKeyCode:f1="Space",multiSelectionKeyCode:z1=N9()?"Meta":"Control",zoomActivationKeyCode:C1=N9()?"Meta":"Control",snapToGrid:b1,snapGrid:c1,onlyRenderVisibleElements:D1=!1,selectNodesOnDrag:A1,nodesDraggable:e1,autoPanOnNodeFocus:k1,nodesConnectable:g0,nodesFocusable:_0,nodeOrigin:t0=KR,edgesFocusable:C2,edgesReconnectable:u2,elementsSelectable:b2=!0,defaultViewport:f2=mS,minZoom:T2=0.5,maxZoom:G2=2,translateExtent:R2=O9,preventScrolling:I4=!0,nodeExtent:X5,defaultMarkerColor:x5="#b1b1b7",zoomOnScroll:q4=!0,zoomOnPinch:R5=!0,panOnScroll:G3=!1,panOnScrollSpeed:O5=0.5,panOnScrollMode:j=h3.Free,zoomOnDoubleClick:q1=!0,panOnDrag:I1=!0,onPaneClick:P1,onPaneMouseEnter:y1,onPaneMouseMove:i1,onPaneMouseLeave:r1,onPaneScroll:F0,onPaneContextMenu:x1,paneClickDistance:K2=1,nodeClickDistance:E2=0,children:$1,onReconnect:B1,onReconnectStart:v1,onReconnectEnd:V1,onEdgeContextMenu:Q0,onEdgeDoubleClick:u1,onEdgeMouseEnter:m1,onEdgeMouseMove:J0,onEdgeMouseLeave:T0,reconnectRadius:Z2=10,onNodesChange:K0,onEdgesChange:S2,noDragClassName:w0="nodrag",noWheelClassName:Z7="nowheel",noPanClassName:K5="nopan",fitView:V0,fitViewOptions:F7,connectOnClick:sJ,attributionPosition:tJ,proOptions:r3,defaultEdgeOptions:oJ,elevateNodesOnSelect:nJ=!0,elevateEdgesOnSelect:eJ=!1,disableKeyboardA11y:j9=!1,autoPanOnConnect:_$,autoPanOnNodeDrag:o2,autoPanOnSelection:a3=!0,autoPanSpeed:Z3,connectionRadius:J$,isValidConnection:a6,onError:X7,style:V9,id:s3,nodeDragThreshold:t3,connectionDragThreshold:y9,viewport:BU,onViewportChange:AU,width:$$,height:k9,colorMode:D9="light",debug:Q$,onScroll:u9,ariaLabelConfig:q$,zIndexMode:U$="basic",...G$},b9){let o3=s3||"1",s6=lS(D9),MU=W1.useCallback((E9)=>{E9.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),u9?.(E9)},[u9]);return K1.jsx("div",{"data-testid":"rf__wrapper",...G$,onScroll:MU,style:{...V9,...Wj},ref:b9,className:_2(["react-flow",H,s6]),id:s3,role:"application",children:K1.jsxs(zj,{nodes:Q,edges:U,width:$$,height:k9,fitView:V0,fitViewOptions:F7,minZoom:T2,maxZoom:G2,nodeOrigin:t0,nodeExtent:X5,zIndexMode:U$,children:[K1.jsx(cS,{nodes:Q,edges:U,defaultNodes:Z,defaultEdges:K,onConnect:w,onConnectStart:P,onConnectEnd:V,onClickConnectStart:S,onClickConnectEnd:C,nodesDraggable:e1,autoPanOnNodeFocus:k1,nodesConnectable:g0,nodesFocusable:_0,edgesFocusable:C2,edgesReconnectable:u2,elementsSelectable:b2,elevateNodesOnSelect:nJ,elevateEdgesOnSelect:eJ,minZoom:T2,maxZoom:G2,nodeExtent:X5,onNodesChange:K0,onEdgesChange:S2,snapToGrid:b1,snapGrid:c1,connectionMode:t,translateExtent:R2,connectOnClick:sJ,defaultEdgeOptions:oJ,fitView:V0,fitViewOptions:F7,onNodesDelete:m,onEdgesDelete:s,onDelete:U1,onNodeDragStart:E,onNodeDrag:u,onNodeDragStop:b,onSelectionDrag:g,onSelectionDragStart:h,onSelectionDragStop:p,onMove:T,onMoveStart:A,onMoveEnd:R,noPanClassName:K5,nodeOrigin:t0,rfId:o3,autoPanOnConnect:_$,autoPanOnNodeDrag:o2,autoPanSpeed:Z3,onError:X7,connectionRadius:J$,isValidConnection:a6,selectNodesOnDrag:A1,nodeDragThreshold:t3,connectionDragThreshold:y9,onBeforeDelete:k,debug:Q$,ariaLabelConfig:q$,zIndexMode:U$}),K1.jsx(Kj,{onInit:O,onNodeClick:L,onEdgeClick:M,onNodeMouseEnter:y,onNodeMouseMove:N,onNodeMouseLeave:v,onNodeContextMenu:D,onNodeDoubleClick:x,nodeTypes:Y,edgeTypes:W,connectionLineType:_1,connectionLineStyle:a,connectionLineComponent:H1,connectionLineContainerStyle:O1,selectionKeyCode:T1,selectionOnDrag:G1,selectionMode:R1,deleteKeyCode:L1,multiSelectionKeyCode:z1,panActivationKeyCode:f1,zoomActivationKeyCode:C1,onlyRenderVisibleElements:D1,defaultViewport:f2,translateExtent:R2,minZoom:T2,maxZoom:G2,preventScrolling:I4,zoomOnScroll:q4,zoomOnPinch:R5,zoomOnDoubleClick:q1,panOnScroll:G3,panOnScrollSpeed:O5,panOnScrollMode:j,panOnDrag:I1,autoPanOnSelection:a3,onPaneClick:P1,onPaneMouseEnter:y1,onPaneMouseMove:i1,onPaneMouseLeave:r1,onPaneScroll:F0,onPaneContextMenu:x1,paneClickDistance:K2,nodeClickDistance:E2,onSelectionContextMenu:c,onSelectionStart:l,onSelectionEnd:o,onReconnect:B1,onReconnectStart:v1,onReconnectEnd:V1,onEdgeContextMenu:Q0,onEdgeDoubleClick:u1,onEdgeMouseEnter:m1,onEdgeMouseMove:J0,onEdgeMouseLeave:T0,reconnectRadius:Z2,defaultMarkerColor:x5,noDragClassName:w0,noWheelClassName:Z7,noPanClassName:K5,rfId:o3,disableKeyboardA11y:j9,nodeExtent:X5,viewport:BU,onViewportChange:AU,nodesDraggable:e1}),K1.jsx(xS,{onSelectionChange:Q1}),$1,K1.jsx(DS,{proOptions:r3,position:tJ}),K1.jsx(kS,{rfId:o3,disableKeyboardA11y:j9})]})})}var hR=zR(Lj);function xR(Q){let[U,Z]=W1.useState(Q),K=W1.useCallback((H)=>Z((Y)=>YR(H,Y)),[]);return[U,Z,K]}var kg=F5.error014();function Bj({dimensions:Q,lineWidth:U,variant:Z,className:K}){return K1.jsx("path",{strokeWidth:U,d:`M${Q[0]/2} 0 V${Q[1]} M0 ${Q[1]/2} H${Q[0]}`,className:_2(["react-flow__background-pattern",Z,K])})}function Aj({radius:Q,className:U}){return K1.jsx("circle",{cx:Q,cy:Q,r:Q,className:_2(["react-flow__background-pattern","dots",U])})}var Q3;(function(Q){Q.Lines="lines",Q.Dots="dots",Q.Cross="cross"})(Q3||(Q3={}));var Mj={[Q3.Dots]:1,[Q3.Lines]:1,[Q3.Cross]:6},Tj=(Q)=>({transform:Q.transform,patternId:`pattern-${Q.rfId}`});function mR({id:Q,variant:U=Q3.Dots,gap:Z=20,size:K,lineWidth:H=1,offset:Y=0,color:W,bgColor:L,style:M,className:O,patternClassName:T}){let A=W1.useRef(null),{transform:R,patternId:w}=L0(Tj,i0),P=K||Mj[U],V=U===Q3.Dots,S=U===Q3.Cross,C=Array.isArray(Z)?Z:[Z,Z],y=[C[0]*R[2]||1,C[1]*R[2]||1],N=P*R[2],v=Array.isArray(Y)?Y:[Y,Y],D=S?[N,N]:y,x=[v[0]*R[2]+D[0]/2,v[1]*R[2]+D[1]/2],E=`${w}${Q?Q:""}`;return K1.jsxs("svg",{className:_2(["react-flow__background",O]),style:{...M,...ZU,"--xy-background-color-props":L,"--xy-background-pattern-color-props":W},ref:A,"data-testid":"rf__background",children:[K1.jsx("pattern",{id:E,x:R[0]%y[0],y:R[1]%y[1],width:y[0],height:y[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${x[0]},-${x[1]})`,children:V?K1.jsx(Aj,{radius:N/2,className:T}):K1.jsx(Bj,{dimensions:D,lineWidth:H,variant:U,className:T})}),K1.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${E})`})]})}mR.displayName="Background";var gR=W1.memo(mR);function Rj(){return K1.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:K1.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function Oj(){return K1.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:K1.jsx("path",{d:"M0 0h32v4.2H0z"})})}function Ij(){return K1.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:K1.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 wj(){return K1.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:K1.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 Pj(){return K1.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:K1.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 QU({children:Q,className:U,...Z}){return K1.jsx("button",{type:"button",className:_2(["react-flow__controls-button",U]),...Z,children:Q})}var Nj=(Q)=>({isInteractive:Q.nodesDraggable||Q.nodesConnectable||Q.elementsSelectable,minZoomReached:Q.transform[2]<=Q.minZoom,maxZoomReached:Q.transform[2]>=Q.maxZoom,ariaLabelConfig:Q.ariaLabelConfig});function pR({style:Q,showZoom:U=!0,showFitView:Z=!0,showInteractive:K=!0,fitViewOptions:H,onZoomIn:Y,onZoomOut:W,onFitView:L,onInteractiveChange:M,className:O,children:T,position:A="bottom-left",orientation:R="vertical","aria-label":w}){let P=d0(),{isInteractive:V,minZoomReached:S,maxZoomReached:C,ariaLabelConfig:y}=L0(Nj,i0),{zoomIn:N,zoomOut:v,fitView:D}=lJ(),x=()=>{N(),Y?.()},E=()=>{v(),W?.()},u=()=>{D(H),L?.()},b=()=>{P.setState({nodesDraggable:!V,nodesConnectable:!V,elementsSelectable:!V}),M?.(!V)};return K1.jsxs(q3,{className:_2(["react-flow__controls",R==="horizontal"?"horizontal":"vertical",O]),position:A,style:Q,"data-testid":"rf__controls","aria-label":w??y["controls.ariaLabel"],children:[U&&K1.jsxs(K1.Fragment,{children:[K1.jsx(QU,{onClick:x,className:"react-flow__controls-zoomin",title:y["controls.zoomIn.ariaLabel"],"aria-label":y["controls.zoomIn.ariaLabel"],disabled:C,children:K1.jsx(Rj,{})}),K1.jsx(QU,{onClick:E,className:"react-flow__controls-zoomout",title:y["controls.zoomOut.ariaLabel"],"aria-label":y["controls.zoomOut.ariaLabel"],disabled:S,children:K1.jsx(Oj,{})})]}),Z&&K1.jsx(QU,{className:"react-flow__controls-fitview",onClick:u,title:y["controls.fitView.ariaLabel"],"aria-label":y["controls.fitView.ariaLabel"],children:K1.jsx(Ij,{})}),K&&K1.jsx(QU,{className:"react-flow__controls-interactive",onClick:b,title:y["controls.interactive.ariaLabel"],"aria-label":y["controls.interactive.ariaLabel"],children:V?K1.jsx(Pj,{}):K1.jsx(wj,{})}),T]})}pR.displayName="Controls";var cR=W1.memo(pR);function Cj({id:Q,x:U,y:Z,width:K,height:H,style:Y,color:W,strokeColor:L,strokeWidth:M,className:O,borderRadius:T,shapeRendering:A,selected:R,onClick:w}){let{background:P,backgroundColor:V}=Y||{},S=W||P||V;return K1.jsx("rect",{className:_2(["react-flow__minimap-node",{selected:R},O]),x:U,y:Z,rx:T,ry:T,width:K,height:H,style:{fill:S,stroke:L,strokeWidth:M},shapeRendering:A,onClick:w?(C)=>w(C,Q):void 0})}var fj=W1.memo(Cj),Sj=(Q)=>Q.nodes.map((U)=>U.id),sK=(Q)=>Q instanceof Function?Q:()=>Q;function vj({nodeStrokeColor:Q,nodeColor:U,nodeClassName:Z="",nodeBorderRadius:K=5,nodeStrokeWidth:H,nodeComponent:Y=fj,onClick:W}){let L=L0(Sj,i0),M=sK(U),O=sK(Q),T=sK(Z),A=typeof window>"u"||!!window.chrome?"crispEdges":"geometricPrecision";return K1.jsx(K1.Fragment,{children:L.map((R)=>K1.jsx(Vj,{id:R,nodeColorFunc:M,nodeStrokeColorFunc:O,nodeClassNameFunc:T,nodeBorderRadius:K,nodeStrokeWidth:H,NodeComponent:Y,onClick:W,shapeRendering:A},R))})}function jj({id:Q,nodeColorFunc:U,nodeStrokeColorFunc:Z,nodeClassNameFunc:K,nodeBorderRadius:H,nodeStrokeWidth:Y,shapeRendering:W,NodeComponent:L,onClick:M}){let{node:O,x:T,y:A,width:R,height:w}=L0((P)=>{let V=P.nodeLookup.get(Q);if(!V)return{node:void 0,x:0,y:0,width:0,height:0};let S=V.internals.userNode,{x:C,y}=V.internals.positionAbsolute,{width:N,height:v}=J4(S);return{node:S,x:C,y,width:N,height:v}},i0);if(!O||O.hidden||!DK(O))return null;return K1.jsx(L,{x:T,y:A,width:R,height:w,style:O.style,selected:!!O.selected,className:K(O),color:U(O),borderRadius:H,strokeColor:Z(O),strokeWidth:Y,shapeRendering:W,onClick:M,id:O.id})}var Vj=W1.memo(jj),yj=W1.memo(vj),kj=200,Dj=150,uj=(Q)=>!Q.hidden,bj=(Q)=>{let U={x:-Q.transform[0]/Q.transform[2],y:-Q.transform[1]/Q.transform[2],width:Q.width/Q.transform[2],height:Q.height/Q.transform[2]},Z=!1;for(let K of Q.nodeLookup.values())if(!K.hidden){Z=!0;break}return{viewBB:U,boundingRect:Z?VK(n8(Q.nodeLookup,{filter:uj}),U):U,rfId:Q.rfId,panZoom:Q.panZoom,translateExtent:Q.translateExtent,flowWidth:Q.width,flowHeight:Q.height,ariaLabelConfig:Q.ariaLabelConfig}},qR=(Q,U)=>Q.x===U.x&&Q.y===U.y&&Q.width===U.width&&Q.height===U.height,Ej=(Q,U)=>qR(Q.viewBB,U.viewBB)&&qR(Q.boundingRect,U.boundingRect)&&Q.rfId===U.rfId&&Q.panZoom===U.panZoom&&Q.translateExtent===U.translateExtent&&Q.flowWidth===U.flowWidth&&Q.flowHeight===U.flowHeight&&Q.ariaLabelConfig===U.ariaLabelConfig,hj="react-flow__minimap-desc";function lR({style:Q,className:U,nodeStrokeColor:Z,nodeColor:K,nodeClassName:H="",nodeBorderRadius:Y=5,nodeStrokeWidth:W,nodeComponent:L,bgColor:M,maskColor:O,maskStrokeColor:T,maskStrokeWidth:A,position:R="bottom-right",onClick:w,onNodeClick:P,pannable:V=!1,zoomable:S=!1,ariaLabel:C,inversePan:y,zoomStep:N=1,offsetScale:v=5}){let D=d0(),x=W1.useRef(null),{boundingRect:E,panZoom:u,viewBB:b,rfId:m,translateExtent:s,flowWidth:U1,flowHeight:Q1,ariaLabelConfig:h}=L0(bj,Ej),g=Q?.width??kj,p=Q?.height??Dj,c=E.width/g,l=E.height/p,o=Math.max(c,l),k=o*g,t=o*p,_1=v*o,a=E.x-(k-E.width)/2-_1,H1=E.y-(t-E.height)/2-_1,O1=k+_1*2,L1=t+_1*2,T1=`${hj}-${m}`,G1=W1.useRef(0),R1=W1.useRef();G1.current=o,W1.useEffect(()=>{let c1=D.getState().panZoom;if(x.current&&c1)return R1.current=AT({domNode:x.current,panZoom:c1,getTransform:()=>D.getState().transform,getViewScale:()=>G1.current}),()=>{R1.current?.destroy()}},[u]),W1.useEffect(()=>{R1.current?.update({translateExtent:s,width:U1,height:Q1,inversePan:y,pannable:V,zoomStep:N,zoomable:S})},[V,S,y,N,s,U1,Q1]);let f1=w?(c1)=>{let[D1,A1]=R1.current?.pointer(c1)||[0,0];w(c1,{x:D1,y:A1})}:void 0,z1=W1.useCallback((c1,D1)=>{let A1=D.getState().nodeLookup.get(D1).internals.userNode;P?.(c1,A1)},[P]),C1=P?z1:void 0,b1=C??h["minimap.ariaLabel"];return K1.jsx(q3,{position:R,style:{...Q,"--xy-minimap-background-color-props":typeof M==="string"?M:void 0,"--xy-minimap-mask-background-color-props":typeof O==="string"?O:void 0,"--xy-minimap-mask-stroke-color-props":typeof T==="string"?T:void 0,"--xy-minimap-mask-stroke-width-props":typeof A==="number"?A*o:void 0,"--xy-minimap-node-background-color-props":typeof K==="string"?K:void 0,"--xy-minimap-node-stroke-color-props":typeof Z==="string"?Z:void 0,"--xy-minimap-node-stroke-width-props":typeof W==="number"?W:void 0},className:_2(["react-flow__minimap",U]),"data-testid":"rf__minimap",children:K1.jsxs("svg",{width:g,height:p,viewBox:`${a} ${H1} ${O1} ${L1}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":T1,ref:x,onClick:f1,children:[b1&&K1.jsx("title",{id:T1,children:b1}),K1.jsx(yj,{onClick:C1,nodeColor:K,nodeStrokeColor:Z,nodeBorderRadius:Y,nodeClassName:H,nodeStrokeWidth:W,nodeComponent:L}),K1.jsx("path",{className:"react-flow__minimap-mask",d:`M${a-_1},${H1-_1}h${O1+_1*2}v${L1+_1*2}h${-O1-_1*2}z
|
|
247
247
|
M${b.x},${b.y}h${b.width}v${b.height}h${-b.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}lR.displayName="MiniMap";var iR=W1.memo(lR),xj=(Q)=>(U)=>Q?`${Math.max(1/U.transform[2],1)}`:void 0,mj={[x3.Line]:"right",[x3.Handle]:"bottom-right"};function gj({nodeId:Q,position:U,variant:Z=x3.Handle,className:K,style:H=void 0,children:Y,color:W,minWidth:L=10,minHeight:M=10,maxWidth:O=Number.MAX_VALUE,maxHeight:T=Number.MAX_VALUE,keepAspectRatio:A=!1,resizeDirection:R,autoScale:w=!0,shouldResize:P,onResizeStart:V,onResize:S,onResizeEnd:C}){let y=nK(),N=typeof Q==="string"?Q:y,v=d0(),D=W1.useRef(null),x=Z===x3.Handle,E=L0(W1.useCallback(xj(x&&w),[x,w]),i0),u=W1.useRef(null),b=U??mj[Z];W1.useEffect(()=>{if(!D.current||!N)return;if(!u.current)u.current=PT({domNode:D.current,nodeId:N,getStoreItems:()=>{let{nodeLookup:s,transform:U1,snapGrid:Q1,snapToGrid:h,nodeOrigin:g,domNode:p}=v.getState();return{nodeLookup:s,transform:U1,snapGrid:Q1,snapToGrid:h,nodeOrigin:g,paneDomNode:p}},onChange:(s,U1)=>{let{triggerNodeChanges:Q1,nodeLookup:h,parentLookup:g,nodeOrigin:p}=v.getState(),c=[],l={x:s.x,y:s.y},o=h.get(N);if(o&&o.expandParent&&o.parentId){let k=o.origin??p,t=s.width??o.measured.width??0,_1=s.height??o.measured.height??0,a={id:o.id,parentId:o.parentId,rect:{width:t,height:_1,...uK({x:s.x??o.position.x,y:s.y??o.position.y},{width:t,height:_1},o.parentId,h,k)}},H1=eq([a],h,g,p);c.push(...H1),l.x=s.x?Math.max(k[0]*t,s.x):void 0,l.y=s.y?Math.max(k[1]*_1,s.y):void 0}if(l.x!==void 0&&l.y!==void 0){let k={id:N,type:"position",position:{...l}};c.push(k)}if(s.width!==void 0&&s.height!==void 0){let t={id:N,type:"dimensions",resizing:!0,setAttributes:!R?!0:R==="horizontal"?"width":"height",dimensions:{width:s.width,height:s.height}};c.push(t)}for(let k of U1){let t={...k,type:"position"};c.push(t)}Q1(c)},onEnd:({width:s,height:U1})=>{let Q1={id:N,type:"dimensions",resizing:!1,dimensions:{width:s,height:U1}};v.getState().triggerNodeChanges([Q1])}});return u.current.update({controlPosition:b,boundaries:{minWidth:L,minHeight:M,maxWidth:O,maxHeight:T},keepAspectRatio:A,resizeDirection:R,onResizeStart:V,onResize:S,onResizeEnd:C,shouldResize:P}),()=>{u.current?.destroy()}},[b,L,M,O,T,A,V,S,C,P]);let m=b.split("-");return K1.jsx("div",{className:_2(["react-flow__resize-control","nodrag",...m,Z,K]),ref:D,style:{...H,scale:E,...W&&{[x?"backgroundColor":"borderColor"]:W}},children:Y})}var UR=W1.memo(gj);function dR({nodeId:Q,isVisible:U=!0,handleClassName:Z,handleStyle:K,lineClassName:H,lineStyle:Y,color:W,minWidth:L=10,minHeight:M=10,maxWidth:O=Number.MAX_VALUE,maxHeight:T=Number.MAX_VALUE,keepAspectRatio:A=!1,autoScale:R=!0,shouldResize:w,onResizeStart:P,onResize:V,onResizeEnd:S}){if(!U)return null;return K1.jsxs(K1.Fragment,{children:[IT.map((C)=>K1.jsx(UR,{className:H,style:Y,nodeId:Q,position:C,variant:x3.Line,color:W,minWidth:L,minHeight:M,maxWidth:O,maxHeight:T,onResizeStart:P,keepAspectRatio:A,autoScale:R,shouldResize:w,onResize:V,onResizeEnd:S},C)),OT.map((C)=>K1.jsx(UR,{className:Z,style:K,nodeId:Q,position:C,color:W,minWidth:L,minHeight:M,maxWidth:O,maxHeight:T,onResizeStart:P,keepAspectRatio:A,autoScale:R,shouldResize:w,onResize:V,onResizeEnd:S},C))]})}var pj=(Q)=>Q.domNode?.querySelector(".react-flow__renderer");function cj({children:Q}){let U=L0(pj);if(!U)return null;return GR.createPortal(Q,U)}var lj=(Q,U)=>Q?.internals.positionAbsolute.x!==U?.internals.positionAbsolute.x||Q?.internals.positionAbsolute.y!==U?.internals.positionAbsolute.y||Q?.measured.width!==U?.measured.width||Q?.measured.height!==U?.measured.height||Q?.selected!==U?.selected||Q?.internals.z!==U?.internals.z,ij=(Q,U)=>{if(Q.size!==U.size)return!1;for(let[Z,K]of Q)if(lj(K,U.get(Z)))return!1;return!0},dj=(Q)=>({x:Q.transform[0],y:Q.transform[1],zoom:Q.transform[2],selectedNodesCount:Q.nodes.filter((U)=>U.selected).length});function _H({nodeId:Q,children:U,className:Z,style:K,isVisible:H,position:Y=E1.Top,offset:W=10,align:L="center",...M}){let O=nK(),T=W1.useCallback((D)=>{return(Array.isArray(Q)?Q:[Q||O||""]).reduce((u,b)=>{let m=D.nodeLookup.get(b);if(m)u.set(m.id,m);return u},new Map)},[Q,O]),A=L0(T,ij),{x:R,y:w,zoom:P,selectedNodesCount:V}=L0(dj,i0);if(!(typeof H==="boolean"?H:A.size===1&&A.values().next().value?.selected&&V===1)||!A.size)return null;let C=n8(A),y=Array.from(A.values()),N=Math.max(...y.map((D)=>D.internals.z+1)),v={position:"absolute",transform:UT(C,{x:R,y:w,zoom:P},Y,W,L),zIndex:N,...K};return K1.jsx(cj,{children:K1.jsx("div",{style:v,className:_2(["react-flow__node-toolbar",Z]),...M,"data-id":y.reduce((D,x)=>`${D}${x.id} `,"").trim(),children:U})})}function XU(Q={}){let U=(K,H)=>Q.tools?`${H} (\`${K}\`)`:`\`${K}\``,Z=["Set up Volter World for this app, so its calls to Stripe, Slack, GitHub, OpenAI and the other services it uses go to local twins instead of the real APIs. The app keeps its real SDKs and code.","",Q.tools?"1. You have the Volter World tools (volter mcp). If the `volter` command is missing, install it: `npm install -g @volter/world`.":"1. Install the command and your agent tooling: `npm install -g @volter/world`, then `volter agents install --yes`.",`2. In the app's folder, ${U("volter world init --install","world_init")}: it detects the vendors the app calls and installs their twins. Show me the vendors it detected and why, before keeping them.`,`3. ${Q.tools?"Start it with world_up":"Start it: `volter world up`"}, then run the tests inside it: ${U("volter world run -- <the test command>","world_run")}. Fix anything that fails because a call went to the real service.`,`4. Tell me what the app did at each vendor (${U("volter world log","world_log")}), and give me the dashboard link (${Q.tools?"world_view":"`volter world view --no-open`, started in the background: it keeps running"}).`];if(Q.platform){let K=Q.world??"<org>/<world>";Z.push(`5. Share it with my team on ${Q.platform}: ${U(`volter login ${Q.platform}`,"platform_login")} gives a link and a code for me to approve in my browser. Once I have, link it with ${U(`volter remote add origin ${K} --create`,"remote_link with create: true")}${Q.world?"":" (ask me for <org>/<world>)"}, then send what the app did: ${U('volter world changeset -m "<what and why>"',"world_changeset")} and ${U("volter world push","world_push")}.`)}return Z.push("","The guide: https://world.volter.ai/docs/guides/use-with-a-coding-agent.md"),Z.join(`
|
|
248
|
-
`)}var rR={"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 F=s0(u8(),1),HU="volter.console.token",U7=document.getElementById("root"),n1=U7.dataset.base??"/-/console",P0=window.location.origin,c3=(U7.dataset.worlds??P0).replace(/\/+$/,""),QO=(U7.dataset.names??"").split(",").filter((Q)=>Q!==""),p3=U7.dataset.worldOrigin==="1",q7=window.fetch.bind(window),d6="(session)",qO="(pass)",iJ=(Q)=>{try{if(Q&&!p3)sessionStorage.setItem(HU,Q);else sessionStorage.removeItem(HU);localStorage.removeItem(HU)}catch{}},UO="volter.console.portal",GO=(Q)=>{try{if(typeof Q==="string"&&/^https?:$/.test(new URL(Q).protocol))sessionStorage.setItem(UO,new URL(Q).origin)}catch{}},rj=()=>{return G7.get("token")??""},t2=()=>{try{let Q=sessionStorage.getItem(UO)??"";return Q&&/^https?:$/.test(new URL(Q).protocol)?new URL(Q).origin:""}catch{return""}},aj=()=>{let Q=rj();if(p3){if(iJ(""),G7.get("pass"))return qO;let U=new URLSearchParams(window.location.search).has("signin");if(U)try{window.history.replaceState(null,"",window.location.pathname+window.location.hash)}catch{}return Q||(U?"":d6)}if(Q)return iJ(Q),Q;try{return sessionStorage.getItem(HU)??""}catch{return""}};function M2(Q){let U=Q.trim();if(/not ready/i.test(U)&&/(never verified|not verified|no approvals)/i.test(U)){let Y=[],W=[];if(/(never verified|not verified)/i.test(U))Y.push("it is not verified yet"),W.push("verify");if(/no approvals/i.test(U))Y.push("no one has approved it"),W.push("approve");return{text:`Not ready to deploy: ${E8(Y)}.`,acts:W}}let Z=/no credential (?:is )?sealed for ([a-z0-9_-]+)/i.exec(U);if(Z)return{text:`No credential is sealed for ${s1(Z[1])}: seal one in Settings › Vault.`,acts:["vault"]};if(/has no origin/i.test(U))return{text:"This World has no remote: name one in Settings › Remote.",acts:["remote"]};let K=/the ([a-z0-9_-]+) twin has no root/i.exec(U)??/:\s*([a-z0-9_, -]+?) (?:has|have) no root/i.exec(U);if(K){let Y=K[1].split(/,\s*/).filter(Boolean).map(s1);return{text:`${E8(Y)} ${Y.length===1?"is":"are"} not connected to ${Y.length===1?"its":"their"} real service: Settings › Real services.`,acts:["settings"]}}if(/opening a seal is/i.test(U))return{text:"A key cannot seal a credential: open the World as yourself.",acts:[]};if(/a key manages no keys/i.test(U))return{text:"A key cannot manage keys: open the World as yourself.",acts:[]};if(/^PUT origin:/i.test(U))return{text:"That is not a World's address: https://<host>/<org>/<world>",acts:[]};if(/^clock: \{/i.test(U))return{text:"Pick a date and time.",acts:[]};if(/^advance: \{/i.test(U))return{text:"Advance by a number and a unit: 90m, 12h, 3d.",acts:[]};if(/^branches: \{/i.test(U))return{text:"That branch could not be made: pick now, or an instant before it.",acts:[]};if(/^approve: \{/i.test(U))return{text:"Name who approves.",acts:[]};if(/a browser deploys only what it names/i.test(U))return{text:"A deploy is confirmed by its name: use Deploy again.",acts:[]};if(/^no such door/i.test(U))return{text:"This World does not answer that here.",acts:[]};return{text:U.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()||Q,acts:[]}}var T5=async(Q)=>M2(await k3(Q)).text,sj={vault:["vault","Open Vault"],remote:["remote","Open Remote"],settings:["settings/services","Open Real services"]};function ZO({name:Q,acts:U}){let Z=U.map((K)=>sj[K]).filter((K)=>Boolean(K));if(Z.length===0)return null;return F.jsxDEV(F.Fragment,{children:Z.map(([K,H])=>F.jsxDEV(F1.default.Fragment,{children:[" ",F.jsxDEV("a",{href:`${n1}/${Q}/~/${K}`,onClick:(Y)=>{Y.preventDefault(),f0([...Q.split("/"),"~",...K.split("/")])},children:H},void 0,!1,void 0,this)]},K,!0,void 0,this))},void 0,!1,void 0,this)}async function O0(Q,U,Z={}){return q7(`${P0}${U}`,{...Z,headers:{...Z.headers??{},...Q===d6?{}:{"x-volter-token":Q},...Z.body&&!Z.headers?.["content-type"]?{"content-type":"application/json"}:{}}})}function y0(Q,U,Z=0){let K=mA((H)=>O0(Q,H),U,Z,Q);return K.state==="error"?{...K,error:M2(K.error).text}:K}var v9=(Q)=>{let U=new Date(Q),Z=(K)=>String(K).padStart(2,"0");return`${U.getFullYear()}-${Z(U.getMonth()+1)}-${Z(U.getDate())}T${Z(U.getHours())}:${Z(U.getMinutes())}`},aR=(Q)=>new Date(Math.ceil(Date.parse(Q)/60000)*60000).toISOString(),FO=(Q)=>Q.operation==="observed"?`observed${Q.provenance==="placeholder"?" (default data)":" (vendor)"}`:Q.receipt?`${Q.receipt.status??""} ${Q.receipt.externalId??""} ${Q.receipt.reason??""}`.trim():Q.provenance==="placeholder"?"default data":"unpushed",tj=(Q)=>{let U=/^[0-9a-f]{2}-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2}$/.exec(Q??"");return U?{trace:U[1],span:U[2]}:null},GH="volter.console.snapshots",l3=()=>{try{return JSON.parse(sessionStorage.getItem(GH)??"{}")}catch{return{}}},XO=new Map,ZH=(Q)=>{if(p3){if(Q.token||Q.readToken)XO.set(Q.name,{token:Q.token,readToken:Q.readToken});Q={...Q,token:"",readToken:""}}try{sessionStorage.setItem(GH,JSON.stringify({...l3(),[Q.name]:Q}))}catch{}},FH=(Q)=>XO.get(Q)?.readToken||l3()[Q]?.readToken||"",YU=(Q)=>{try{let U=l3();delete U[Q],sessionStorage.setItem(GH,JSON.stringify(U))}catch{}},G7=new URLSearchParams(window.location.hash.slice(1)),f9=G7.get("close")??"";function rJ(Q){if(typeof Q!=="string")return null;let U;try{U=new URL(Q)}catch{return null}return(U.protocol==="http:"||U.protocol==="https:")&&U.origin===Q.replace(/\/+$/,"")?U:null}function XH(Q){let U=rJ(Q);if(!U)return null;let Z=new URL(P0);if(U.protocol!==Z.protocol||U.port!==Z.port)return null;if(U.hostname===Z.hostname)return U.origin;let K=/^[a-z0-9](?:[a-z0-9]|-(?!-))*--[a-z0-9](?:[a-z0-9]|-(?!-))*\./;if(!K.test(U.hostname))return null;let H=U.hostname.replace(K,"");return H===Z.hostname||K.test(Z.hostname)&&H===Z.hostname.replace(K,"")?U.origin:null}function oj(Q){let U;try{U=JSON.parse(Q)}catch{return null}let Z=/^[a-z0-9][a-z0-9-]*\/[a-z0-9][a-z0-9-]*$/i;if(typeof U.name!=="string"||!Z.test(U.name)||typeof U.parent!=="string"||!Z.test(U.parent)||typeof U.at!=="string")return null;let K=U.parentOrigin===void 0?void 0:XH(U.parentOrigin);return{name:U.name,parent:U.parent,token:typeof U.token==="string"?U.token:"",readToken:typeof U.readToken==="string"?U.readToken:"",at:U.at,expiresAt:typeof U.expiresAt==="string"?U.expiresAt:null,...K?{parentOrigin:K}:{}}}{let Q=G7.get("snapshot");if(Q){let U=oj(Q);if(U&&!l3()[U.name])ZH(U)}}var KO="volter.console.home",HO=(Q)=>{let U=rJ(Q);if(!U)return null;let Z=new URL(P0).hostname,K=Z.replace(/^[a-z0-9](?:[a-z0-9]|-(?!-))*--[a-z0-9](?:[a-z0-9]|-(?!-))*\./,"");return U.hostname===Z||U.hostname===K?U.origin:null};{let Q=HO(G7.get("home"));if(Q)try{sessionStorage.setItem(KO,Q)}catch{}}if(["token","pass","portal","snapshot","home","close"].some((Q)=>G7.has(Q)))try{window.history.replaceState(null,"",window.location.pathname+window.location.search)}catch{}var O4=()=>{try{return HO(sessionStorage.getItem(KO))??""}catch{return""}};function KH(Q,U,Z,K){let H=new URLSearchParams({token:U,home:O4()||P0}),Y=l3()[Z];if(Y)H.set("snapshot",JSON.stringify(Y));window.location.replace(`${Q}${K??`${window.location.pathname}${window.location.search}`}#${H.toString()}`)}var qH=U7.dataset.route==="memory"?"":null;function J7(){return(qH??window.location.pathname.slice(n1.length)).split("/").filter(Boolean).map((Q)=>{try{return decodeURIComponent(Q)}catch{return""}})}var sR=/^[a-z0-9](?:[a-z0-9]|-(?!-))*$/i,g3=(Q,U)=>Q&&U&&sR.test(Q)&&sR.test(U)?`${Q}/${U}`:"";function f0(Q){let U=`/${Q.map(encodeURIComponent).join("/")}`;if(qH!==null)qH=U;else window.history.pushState(null,"",`${n1}${U}`);window.dispatchEvent(new PopStateEvent("popstate"))}function YO(Q,U){let Z=XH(l3()[Q]?.origin);if(Z&&Z!==P0){KH(Z,FH(Q),Q,`${n1}/${U.map(encodeURIComponent).join("/")}`);return}f0(U)}async function tR(){let[Q,U]=J7(),Z=g3(Q,U),K=Z?[Z]:QO;if(K.length===0){let H=await q7(`${P0}/-/ping`).catch(()=>null);K=H?.ok?(await H.json().catch(()=>({}))).worlds??[]:[]}K=K.filter((H)=>{let[Y,W,...L]=H.split("/");return L.length===0&&g3(Y,W)===H});for(let H of K){let Y=await q7(`${P0}/-/${H}/session`,{method:"POST"}).catch(()=>null);if(!Y)continue;let W=await Y.json().catch(()=>({})),L=rJ(W.origin)?.origin;if(Y.status===409&&L&&L!==P0)return window.location.replace(`${L}${n1}/${H}`),"moved";if(Y.ok&&W.local)return{token:typeof W.token==="string"&&W.token?W.token:d6}}return null}function nj(){let[Q,U]=F1.useState(tF),Z=(K)=>()=>{try{if(K==="system")localStorage.removeItem("volter.theme");else localStorage.setItem("volter.theme",K)}catch{}Aq(K),U(K)};return F.jsxDEV(F.Fragment,{children:[F.jsxDEV("p",{className:"menu-label",children:"Appearance"},void 0,!1,void 0,this),F.jsxDEV("div",{className:"theme-choice",role:"radiogroup","aria-label":"Appearance",children:["system","light","dark"].map((K)=>F.jsxDEV("button",{type:"button",role:"radio","aria-checked":Q===K,onClick:Z(K),children:K==="system"?"System":K==="light"?"Light":"Dark"},K,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function ej(){let[Q,U]=F1.useState(aj()),[Z,K]=F1.useState(!1),[H,Y]=F1.useState(!1),[W,L]=F1.useState(""),[M,O]=F1.useState(null),[T,A]=F1.useState(null),[R,w]=F1.useState(J7());F1.useEffect(()=>{let _1=()=>w(J7());return window.addEventListener("popstate",_1),()=>window.removeEventListener("popstate",_1)},[]),F1.useEffect(()=>{let[_1,a]=J7(),H1=g3(_1,a),[O1,L1]=H1?H1.split("/"):[],T1=l3()[f9];if(!f9||!Q||!O1||!L1||!T1?.made||T1.parent!==`${O1}/${L1}`||g3(...f9.split("/"))!==f9)return;try{window.history.replaceState(null,"",window.location.pathname+window.location.search)}catch{}O0(Q,`/-/${O1}/${L1}/branches/${f9}`,{method:"DELETE"}).catch(()=>null).then(()=>YU(f9))},[Q]);let P=F1.useCallback(async(_1)=>{if(A(null),!_1){let L1=await tR();if(L1==="moved")return;if(L1){if(K(!0),L1.token!==d6)iJ(L1.token);U(L1.token);return}O(null),Y(!0);return}if(p3&&_1===d6){let L1=await tR();if(L1==="moved")return;if(L1)K(!0)}if(p3&&_1===qO){let[L1,T1]=J7(),G1=g3(L1,T1),[R1,f1]=G1?G1.split("/"):[],z1=R1&&f1?await q7(`${P0}/-/${R1}/${f1}/session`,{method:"POST",headers:{"x-volter-pass":G7.get("pass")??""}}).catch(()=>null):null;if(!z1){A(`${P0} did not answer: no session was opened`),O(null);return}if(!z1.ok){A(`${await T5(z1)}. Open it again from the platform.`),O(null);return}GO((await z1.json().catch(()=>({}))).issuer),U(d6);return}if(p3&&_1!==d6){let[L1,T1]=J7(),G1=g3(L1,T1),[R1,f1]=G1?G1.split("/"):[],z1=R1&&f1?await q7(`${P0}/-/${R1}/${f1}/session`,{method:"POST",headers:{"x-volter-token":_1}}).catch(()=>null):null;if(!z1){A(`${P0} did not answer: no session was opened`),O(null);return}if(!z1.ok){let C1=await T5(z1);A(z1.status===401||z1.status===403?`That token does not open ${R1}/${f1}.`:z1.status===409?`${R1}/${f1}'s session lives at another origin: ${C1}`:`The World could not open a session (${z1.status}): ${C1}`),O(null);return}U(d6);return}let a=p3?new Response(null,{status:404}):await O0(_1,"/-/worlds");if(a.ok){let{worlds:L1}=await a.json();O({kind:"admin",worlds:L1});return}if(a.status===429){A("You are asking faster than the platform allows — wait a moment and reload."),O(null);return}if(a.status>=500){let L1=await a.json().catch(()=>({}));A(`The platform could not list your worlds${L1.error?`: ${L1.error}`:""}. Reload; if it stays, the status page says what is wrong.`),O(null);return}let H1=QO;if(H1.length===0){let L1=await q7(`${P0}/-/ping`);if(!L1.ok){A(`${P0} does not answer as a host`),O(null);return}if(H1=(await L1.json()).worlds??[],H1.length===0){A(`${P0} does not list its Worlds: open a World at its own address, ${P0}${n1}/<org>/<world>`),O(null);return}}let O1=[];for(let L1 of H1){let T1=await O0(_1,`/-/${L1}/twins`);if(T1.ok){let G1=await T1.json();O1.push({name:L1,base:`${c3}/${L1}`,twins:(G1.twins??[]).map((R1)=>({vendor:R1.twin,protocol:R1.protocol??null,root:R1.root??null}))})}}if(O1.length===0){A("This link or key opens no World here: it was revoked, or it has ended."),O(null);return}O({kind:"world",worlds:O1})},[]);F1.useEffect(()=>{P(Q)},[Q,P]);let V=(_1)=>M?.kind==="admin"?M.worlds.find((a)=>a.name===_1)?.token??Q:Q,[S,C]=F1.useState("");if(!Q||!M&&!T)return F.jsxDEV("main",{className:"app gate",children:F.jsxDEV("div",{className:"gate-window",children:[F.jsxDEV(HJ,{href:`${n1}/`},void 0,!1,void 0,this),Q&&!M&&!T||!Q&&!H?F.jsxDEV("p",{className:"mode",children:"Opening…"},void 0,!1,void 0,this):F.jsxDEV("form",{onSubmit:(_1)=>{_1.preventDefault(),iJ(W.trim()),U(W.trim())},className:"stack",children:[F.jsxDEV("h2",{children:"Open a World"},void 0,!1,void 0,this),F.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),F.jsxDEV("label",{children:[F.jsxDEV("span",{children:"Token"},void 0,!1,void 0,this),F.jsxDEV("input",{name:"token",type:"password",value:W,onChange:(_1)=>L(_1.target.value),autoFocus:!0,autoComplete:"off"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.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 y=()=>A("This link or key opens no World here: it was revoked, or it has ended."),N=()=>{if(Z){window.location.reload();return}if(p3){let[_1,a]=J7(),H1=g3(_1,a),[O1,L1]=H1?H1.split("/"):[],T1=()=>window.location.replace(t2()?`${t2()}/`:`${P0}${n1}/${O1&&L1?`${O1}/${L1}`:""}?signin`);if(setTimeout(T1,2000),O1&&L1)q7(`${P0}/-/${O1}/${L1}/session/end`,{method:"POST"}).catch(()=>null).then(T1);else T1();return}if(M)for(let _1 of M.worlds)navigator.sendBeacon(`${_1.base.replace(/\/[^/]+\/[^/]+$/,"")}/-/${_1.name}/session/end`);iJ(""),U(""),L(""),O(null),f0([])};if(T||!M)return F.jsxDEV("main",{className:"app gate",children:F.jsxDEV("div",{className:"gate-window",children:[F.jsxDEV(HJ,{href:`${n1}/`},void 0,!1,void 0,this),F.jsxDEV("h2",{children:"Could not open it"},void 0,!1,void 0,this),F.jsxDEV("p",{role:"alert",children:T??"nothing answered"},void 0,!1,void 0,this),t2()?F.jsxDEV("a",{className:"button primary",href:`${t2()}/`,children:["Back to ",new URL(t2()).host]},void 0,!0,void 0,this):F.jsxDEV("button",{type:"button",className:"primary",onClick:N,children:Z?"Try again":"Use another token"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this);let[v,D,x,E,u,b,m]=R,s=x==="~",U1=/^[A-Za-z0-9_-]+$/,Q1=/^[^\u0000-\u001f\u007f]{1,200}$/,h=s||!x||!U1.test(x)?void 0:x,g=u&&U1.test(u)?b!==void 0&&E!=="changes"&&E!=="screens"?g3(u,b)||void 0:u:void 0,p=E==="changes"&&u==="changesets"&&b&&U1.test(b)?b:E==="screens"&&b&&m&&/^[A-Za-z0-9_.-]+$/.test(b)&&Q1.test(m)?`${b}:${m}`:void 0,c=g3(v,D),l=c?l3()[c]??null:null,o=(_1)=>FH(_1)||V(_1),k=l?M.kind==="admin"?M.worlds.find((_1)=>_1.name===l.parent)?.token??null:M.worlds.some((_1)=>_1.name===l.parent)?Q:null:null,t=async(_1)=>{let a=XH(_1.parentOrigin);if(a&&a!==P0){YU(_1.name),window.location.assign(`${a}${n1}/${_1.parent}#close=${encodeURIComponent(_1.name)}`);return}if(_1.made)await O0(V(_1.parent),`/-/${_1.parent}/branches/${_1.name}`,{method:"DELETE"}).catch(()=>null),YU(_1.name);f0(_1.parent.split("/"))};return F.jsxDEV("main",{className:c?"app workspace":"app home",children:[c?null:F.jsxDEV("header",{children:[c?F.jsxDEV(iA,{},void 0,!1,void 0,this):null,F.jsxDEV(HJ,{href:`${O4()&&O4()!==P0?O4():""}${n1}/`,onClick:(_1)=>{if(O4()&&O4()!==P0)return;_1.preventDefault(),f0([])}},void 0,!1,void 0,this),F.jsxDEV("nav",{"aria-label":"breadcrumb",className:"crumbs",children:[c?F.jsxDEV(F.Fragment,{children:[F.jsxDEV("span",{className:"crumb-sep","aria-hidden":"true",children:"/"},void 0,!1,void 0,this),F.jsxDEV("span",{children:c.split("/")[0]},void 0,!1,void 0,this),F.jsxDEV("span",{className:"crumb-sep","aria-hidden":"true",children:"/"},void 0,!1,void 0,this),F.jsxDEV("a",{href:`${n1}/${c}`,className:"crumb-world",onClick:(_1)=>{_1.preventDefault(),f0(c.split("/"))},children:c.split("/")[1]},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,h?F.jsxDEV("span",{children:[" / ",h]},void 0,!0,void 0,this):null,s&&E==="trace"?F.jsxDEV("span",{children:" / trace"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),t2()?F.jsxDEV("a",{href:`${t2()}/${c?encodeURIComponent(c.split("/")[0]):""}`,title:`Back to the platform at ${new URL(t2()).host}`,className:"back-link",children:["← ",F.jsxDEV("span",{className:"back-text",children:c?`${c.split("/")[0]}'s Worlds`:new URL(t2()).host},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,c?null:F.jsxDEV("span",{className:"mode",children:Z?"on this machine":S?`signed in as ${S}`:M.kind==="admin"?"host: admin":"opened with a link or key"},void 0,!1,void 0,this),c||Z?null:F.jsxDEV("button",{onClick:N,children:"Sign out"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),c?F.jsxDEV(QV,{name:c,token:o(c),twin:h,tab:s?E??"overview":"overview",arg:s?g:void 0,...s&&p?{sub:p}:{},admin:l?null:M.kind==="admin"?Q:null,snapshot:l,parentToken:k,who:{local:Z,person:S||null,admin:M.kind==="admin"},onSignOut:N,onReturn:t,opens:(_1)=>!!l3()[_1]||M.kind==="admin"&&M.worlds.some((a)=>a.name===_1),onRemoved:()=>{P(Q),f0([])},onWho:C,onEnded:y,worlds:M.worlds.map((_1)=>_1.name)},c,!1,void 0,this):F.jsxDEV(_V,{mode:M,admin:M.kind==="admin"?Q:null,reload:()=>P(Q)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function _V({mode:Q,admin:U,reload:Z}){let[K,H]=F1.useState(""),[Y,W]=F1.useState(""),[L,M]=F1.useState(""),[O,T]=F1.useState(null),A=async(E)=>{if(!await n4({title:`Rotate the tokens of ${E}?`,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 u=await O0(U,`/-/worlds/${E}/rotate`,{method:"POST"}),b=await u.json().catch(()=>({}));T(u.ok?`rotated ${E}: the new tokens are shown once — token ${b.token} · read token ${b.readToken}`:b.error?M2(b.error).text:`answered ${u.status}`),await Z()},R=async(E)=>{let u=await O0(U,`/-/worlds/${E}`,{method:"DELETE"}),b=await u.json().catch(()=>({}));T(u.ok?`removed ${E}`:b.error?M2(b.error).text:`answered ${u.status}`),await Z()},[w,P]=F1.useState(!1),[V,S]=F1.useState(!1),[C,y]=F1.useState(""),N=async(E)=>{E.preventDefault(),T(null),P(!0);try{let u=await O0(U,"/-/worlds",{method:"POST",body:JSON.stringify({org:K,world:Y,vendors:L.split(",").map((m)=>m.trim()).filter(Boolean)})}),b=await u.json();if(!u.ok){T(b.error?M2(b.error).text:`the host answered ${u.status}`);return}T(`provisioned ${b.name}`),W(""),M(""),S(!1),await Z()}finally{P(!1)}},v=C.trim().toLowerCase(),D=Q.worlds.filter((E)=>!v||E.name.toLowerCase().includes(v)||E.twins.some((u)=>u.vendor.includes(v))),x=[...new Set(D.map((E)=>E.name.split("/")[0]))];return F.jsxDEV("section",{className:"home-window","aria-labelledby":"worlds",children:[F.jsxDEV("div",{className:"home-head",children:[F.jsxDEV("h2",{id:"worlds",children:"Worlds"},void 0,!1,void 0,this),F.jsxDEV("span",{className:"mode",children:[l0(Q.worlds.length,"World")," ",U?"this host serves":"this key opens"]},void 0,!0,void 0,this),U?F.jsxDEV("button",{type:"button",className:"primary",onClick:()=>{T(null),S(!0)},children:[F.jsxDEV(Z0,{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),F.jsxDEV("div",{className:"home-find",children:F.jsxDEV("input",{type:"search",placeholder:"Filter by World or vendor","aria-label":"Filter Worlds",value:C,onChange:(E)=>y(E.target.value)},void 0,!1,void 0,this)},void 0,!1,void 0,this),O&&!V?F.jsxDEV("p",{role:"status",className:"home-note",children:O},void 0,!1,void 0,this):null,x.map((E)=>F.jsxDEV(F1.default.Fragment,{children:[F.jsxDEV("p",{className:"menu-label home-org",children:E},void 0,!1,void 0,this),F.jsxDEV("ul",{className:"home-list",children:D.filter((u)=>u.name.split("/")[0]===E).map((u)=>F.jsxDEV("li",{children:[F.jsxDEV("a",{href:`${n1}/${u.name}`,onClick:(b)=>{b.preventDefault(),f0(u.name.split("/"))},children:[F.jsxDEV(Z0,{name:"globe",size:20},void 0,!1,void 0,this),F.jsxDEV("span",{className:"ws-row-text",children:[F.jsxDEV("b",{children:u.name.split("/")[1]},void 0,!1,void 0,this),F.jsxDEV("small",{children:F.jsxDEV("code",{children:u.base},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("span",{className:"home-vendors",children:u.twins.map((b)=>F.jsxDEV("span",{title:s1(b.vendor),children:F.jsxDEV(q2,{vendor:b.vendor},void 0,!1,void 0,this)},b.vendor,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),U?F.jsxDEV("details",{className:"menu home-more",children:[F.jsxDEV("summary",{"aria-label":`More for ${u.name}`,children:"⋯"},void 0,!1,void 0,this),F.jsxDEV("div",{className:"popover menu-list",children:[F.jsxDEV("button",{type:"button",onClick:(b)=>{b.currentTarget.closest("details")?.removeAttribute("open"),A(u.name)},children:"Rotate tokens…"},void 0,!1,void 0,this),F.jsxDEV("button",{type:"button",className:"danger-item",onClick:(b)=>{b.currentTarget.closest("details")?.removeAttribute("open"),n4({title:`Remove ${u.name}?`,body:"The host stops serving it and its whole history goes with it. This cannot be undone.",action:"Remove World",danger:!0,typed:u.name}).then((m)=>{if(m)R(u.name)})},children:"Remove World…"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null]},u.name,!0,void 0,this))},void 0,!1,void 0,this)]},E,!0,void 0,this)),D.length===0?F.jsxDEV("p",{className:"mode home-note",children:v?`No World matches ${C}.`:"No Worlds here yet."},void 0,!1,void 0,this):null,F.jsxDEV(E5,{open:V,onClose:()=>{if(!w)S(!1)},title:"New World",footer:F.jsxDEV(F.Fragment,{children:[F.jsxDEV("button",{type:"button",onClick:()=>S(!1),disabled:w,children:"Cancel"},void 0,!1,void 0,this),F.jsxDEV("button",{type:"submit",form:"provision",className:"primary",disabled:w,children:w?"Making… (ten seconds or so)":"Make World"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:F.jsxDEV("form",{id:"provision",onSubmit:N,className:"stack",children:[F.jsxDEV("label",{children:[F.jsxDEV("span",{children:"Org"},void 0,!1,void 0,this),F.jsxDEV("input",{name:"org",value:K,onChange:(E)=>H(E.target.value),required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("label",{children:[F.jsxDEV("span",{children:"World"},void 0,!1,void 0,this),F.jsxDEV("input",{name:"world",value:Y,onChange:(E)=>W(E.target.value),required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("label",{children:[F.jsxDEV("span",{children:"Vendors"},void 0,!1,void 0,this),F.jsxDEV("input",{name:"vendors",value:L,onChange:(E)=>M(E.target.value),placeholder:"stripe, slack",required:!0},void 0,!1,void 0,this),F.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),O?F.jsxDEV("p",{role:"status",children:O},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 JV=["changes","events","trace","vendors","screens","canvas","branches","settings","remote","vault"],$V=(Q,U)=>{let Z=U?.screens?.find((K)=>K.path.replace(/\/+$/,"")==="")??U?.screens?.find((K)=>!/[{<]/.test(K.path));return U&&Z?`${c3}/${Q}/${U.twin}${Z.path.startsWith("/")?Z.path:`/${Z.path}`}`:null},oR={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 Q4(Q){let U=Q.operation??Q.op,Z=(U.includes(".")?U.slice(U.lastIndexOf(".")+1):U).toLowerCase(),K=Q.subject.type.replace(/[_-]+/g," ").trim(),H=`${K.charAt(0).toUpperCase()}${K.slice(1)}`,Y=/(^|\.)twin\./.test(U)||/^seed_/.test(Z),W=U.replace(/[._]+/g," ").trim(),L=Y?`${H} seeded`:oR[Z]?`${H} ${oR[Z]}`:`${W.charAt(0).toUpperCase()}${W.slice(1)}`,M=Q.fields??{},O=["title","name","email","text","subject","summary","description"].map((A)=>M[A]).find((A)=>typeof A==="string"&&A.trim()!=="")??null,T=O===null?null:O.replace(/<([@#!])[^|>]*\|([^>]+)>/g,(A,R,w)=>`${R==="!"?"@":R}${w}`).replace(/<(?:https?:[^|>]+)\|([^>]+)>/g,"$1").replace(/<(https?:[^>]+)>/g,"$1");return{what:L,label:T===null?null:T.length>80?`${T.slice(0,79)}…`:T}}var i3=(Q)=>/token|password|secret|key|credential/i.test(Q.subject.type)&&Q.subject.id.length>6?`••••${Q.subject.id.slice(-4)}`:Q.subject.id;function QV({name:Q,token:U,twin:Z,tab:K,arg:H,sub:Y,admin:W,snapshot:L,parentToken:M,who:O,onSignOut:T,onReturn:A,opens:R,onRemoved:w,onWho:P,onEnded:V,worlds:S=[]}){let[C,y]=F1.useState("pending"),[N,v]=F1.useState(null),[D,x]=F1.useState(0),[E,u]=F1.useState(null);F1.useEffect(()=>{let G1=!0;return v(null),O0(U,`/-/${Q}/session`,{method:"POST"}).then(async(R1)=>{let f1=await R1.json().catch(()=>({}));if(GO(f1.issuer),f1.who)P?.(f1.who);u(typeof f1.signsAs==="string"?f1.signsAs:null);let z1=rJ(f1.origin)?.origin;if(R1.status===409&&z1&&z1!==P0){KH(z1,U,Q);return}if(!G1)return;if(y(!R1.ok?"unknown":f1.scope==="read"?"read":f1.scope==="write"?"write":"unknown"),!R1.ok)v(f1.error?M2(f1.error).text:`answered ${R1.status}`)}).catch((R1)=>{if(G1)y("unknown"),v(`the World did not answer: ${R1 instanceof Error?R1.message:String(R1)}`)}),()=>{G1=!1}},[Q,U,D]);let b=N?{state:"error",error:N}:C==="pending"?{state:"pending"}:{state:"ok",scope:C},m=C==="write",s=(G1)=>{if(G1.status!==403)return;G1.clone().json().then((R1)=>{if(/read token|opens only reads|write access|reads only/i.test(R1?.error??""))y("read")},()=>null)},[U1,Q1]=F1.useState(0);F1.useEffect(()=>{let G1=setInterval(()=>{if(!document.hidden)Q1((R1)=>R1+1)},5000);return()=>clearInterval(G1)},[]);let[h,g]=F1.useState(0),p=y0(U,`/-/${Q}/clock`,U1+h);F1.useEffect(()=>{if(p3&&!L&&p.state==="error"&&p.status===401)V?.()},[p,L,V]);let c=y0(U,`/-/${Q}/twins`),l=y0(U,`/-/${Q}/branches`,h),o=y0(U,`/-/${Q}/map`,Math.floor(U1/2)),k=!(l.state==="error"&&(l.status===404||l.status===405)),t=JV.includes(K)?K:"overview",_1=c.state==="ok"?c.data.twins.map((G1)=>G1.twin):[];if(Z&&c.state==="ok"&&!_1.includes(Z))return F.jsxDEV("main",{className:"center",children:F.jsxDEV(X9,{title:`${Q} has no ${Z}`,action:F.jsxDEV("a",{href:`${n1}/${Q}`,onClick:(G1)=>{G1.preventDefault(),f0(Q.split("/"))},children:["Open ",Q]},void 0,!0,void 0,this),children:F.jsxDEV("p",{children:["No vendor of this World is called ",Z,". 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 a=t==="vendors"&&H?H:void 0,H1=()=>{y("pending"),x((G1)=>G1+1)};if(t==="canvas"||t==="vendors"&&!a||K==="screens"&&!H)return F.jsxDEV(VV,{name:Q,token:U,twins:c,session:b,retry:H1,snapshot:L,back:()=>f0(Q.split("/")),canWrite:m&&!L},void 0,!1,void 0,this);let L1=K==="settings"?{kind:"settings",tab:((G1)=>zO.find(([R1])=>R1===G1)?.[0]??"account")(H)}:K==="remote"?{kind:"settings",tab:"remote"}:K==="vault"?{kind:"settings",tab:"vault"}:K==="branches"?{kind:"branches",...H?{open:H}:{}}:null,T1=Z?"vendor":K==="screens"&&H?"screen":t==="vendors"&&a?"vendor":K==="trace"?"trace":K==="events"?"events":K==="changes"&&H==="changesets"?"history":"changes";return F.jsxDEV(zV,{name:Q,token:U,view:T1,win:L1,who:O,snapshot:L,onReturn:A,onSignOut:T,worlds:S,session:b,retry:H1,...T1==="vendor"?{arg:Z??a}:T1==="events"||T1==="trace"||T1==="screen"?H?{arg:H}:{}:{},...Y?{sub:Y}:{},twins:c,map:o,branches:k?l:null,clock:p,canWrite:m&&!L,refused:s,signsAs:E,opens:R,tick:U1,admin:W,onRemoved:w,onClock:()=>g((G1)=>G1+1),scope:L?"read":C},void 0,!1,void 0,this)}function Z0({name:Q,size:U=20}){return F.jsxDEV("svg",{className:"icon",viewBox:"0 0 24 24",width:U,height:U,fill:"none",stroke:"currentColor",strokeWidth:U<=16?1.75:1.5,strokeLinecap:"square",strokeLinejoin:"miter","aria-hidden":"true",children:(rR[Q]??[]).map(([Z,K],H)=>F1.default.createElement(Z,{key:H,...K}))},void 0,!1,void 0,this)}function WU(Q){let U=(Z)=>{let K=(Z.operation??Z.op).toLowerCase();return K.includes(".")?K.slice(K.lastIndexOf(".")+1):K};if(Q.some((Z)=>/^(delete|remove|archive|revoke)/.test(U(Z))||Z.fields?.deleted===!0))return{icon:"square-minus",word:"removed",tone:"removed"};if(/^(create|add|insert|issue|send|post|upload|invite|record|seed)/.test(U(Q[0])))return{icon:"square-plus",word:"made",tone:"added"};return{icon:"square-dot",word:"changed",tone:"changed"}}var zO=[["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"]],qV=(Q,U)=>{let Z=U.split("/").pop()??U,K=Q.split("/").pop()??"";return Z.startsWith(`${K}-`)?Z.slice(K.length+1):Z},$7=(Q)=>Q.replace(/^_+/,"").replace(/[_-]+/g," ");function WO({record:Q,history:U}){let Z=Q.writes[Q.writes.length-1],K=Q4(Z),H=WU(Q.writes),Y=new Set(Q.writes.map((A)=>A.id)),W=Q.writes[0].occurredAt,L={};if(U){for(let A of U)if(!Y.has(A.id)&&!A.landsId&&!A.aliasOf&&A.subject.type===Z.subject.type&&A.subject.id===Z.subject.id&&A.occurredAt<=W)Object.assign(L,A.fields??{})}let M={...L};for(let A of Q.writes)Object.assign(M,A.fields??{});let O=H.tone==="added"&&Object.keys(L).length===0,T=[...new Set([...Object.keys(L),...Object.keys(M)])].filter((A)=>!fO(L[A],M[A]));return F.jsxDEV("div",{className:"ws-diff","aria-label":`${K.label??i3(Z)}: its changes`,children:[F.jsxDEV("div",{className:"ws-diff-head",children:[F.jsxDEV("span",{className:`ws-kind ${H.tone}`,title:H.word,children:F.jsxDEV(Z0,{name:H.icon,size:16},void 0,!1,void 0,this)},void 0,!1,void 0,this),F.jsxDEV(q2,{vendor:Q.twin},void 0,!1,void 0,this),F.jsxDEV("div",{className:"cell-label",children:[F.jsxDEV("b",{children:K.label??i3(Z)},void 0,!1,void 0,this),F.jsxDEV("small",{children:[s1(Q.twin)," · ",Z.subject.type.replace(/^_+/,"").replace(/[_-]+/g," ")," ",F.jsxDEV("code",{children:i3(Z)},void 0,!1,void 0,this)," · ",H.word," here"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("ol",{className:"ws-writes",children:Q.writes.map((A)=>F.jsxDEV("li",{children:[F.jsxDEV("b",{children:Q4(A).what},void 0,!1,void 0,this)," ",F.jsxDEV("span",{className:"mode",children:[F.jsxDEV(j0,{iso:A.occurredAt},void 0,!1,void 0,this)," · ",dJ(A)]},void 0,!0,void 0,this)]},A.id,!0,void 0,this))},void 0,!1,void 0,this),U===null?F.jsxDEV("p",{className:"mode pad",children:"Reading its history…"},void 0,!1,void 0,this):T.length===0?F.jsxDEV("p",{className:"mode pad",children:"No field holds a new value."},void 0,!1,void 0,this):F.jsxDEV("table",{className:"ws-fields","aria-label":"Fields before and after",children:[F.jsxDEV("thead",{children:F.jsxDEV("tr",{children:[F.jsxDEV("th",{children:"Field"},void 0,!1,void 0,this),O?null:F.jsxDEV("th",{children:"Before"},void 0,!1,void 0,this),F.jsxDEV("th",{children:H.tone==="removed"?"After":"Now"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("tbody",{children:T.map((A)=>F.jsxDEV("tr",{children:[F.jsxDEV("th",{scope:"row",children:F.jsxDEV("code",{children:A},void 0,!1,void 0,this)},void 0,!1,void 0,this),O?null:F.jsxDEV("td",{className:A in L?"was":"none",children:A in L?F.jsxDEV(d3,{v:L[A]},void 0,!1,void 0,this):F.jsxDEV("span",{className:"mode",children:"—"},void 0,!1,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("td",{className:A in M?"now":"none",children:A in M?F.jsxDEV(d3,{v:M[A]},void 0,!1,void 0,this):F.jsxDEV("span",{className:"mode",children:"—"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},A,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function LO({records:Q,selected:U,onPick:Z,label:K}){let[H,Y]=F1.useState(()=>{try{return localStorage.getItem("volter.console.records")==="tree"}catch{return!1}}),W=(O)=>{Y(O);try{localStorage.setItem("volter.console.records",O?"tree":"path")}catch{}},L=(O,T)=>{let A=O.writes[O.writes.length-1],R=Q4(A),w=WU(O.writes);return F.jsxDEV("li",{children:F.jsxDEV("button",{type:"button",className:[U===O.key?"on":"",T?"nested":""].join(" ").trim()||void 0,"aria-pressed":U===O.key,onClick:()=>Z(O.key),children:[T?null:F.jsxDEV(q2,{vendor:O.twin},void 0,!1,void 0,this),F.jsxDEV("span",{className:"ws-row-text",children:[F.jsxDEV("b",{children:R.label??i3(A)},void 0,!1,void 0,this),F.jsxDEV("small",{children:[$7(A.subject.type)," · ",R.what.split(" ").slice(-1)[0],O.writes.length>1?` · ${l0(O.writes.length,"write")}`:""]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("span",{className:`ws-kind ${w.tone}`,title:w.word,"aria-label":w.word,children:F.jsxDEV(Z0,{name:w.icon,size:16},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},O.key,!1,void 0,this)},M=[...new Set(Q.map((O)=>O.twin))];return F.jsxDEV(F.Fragment,{children:[F.jsxDEV("div",{className:"ws-view-switch",role:"group","aria-label":"List the records by",children:[F.jsxDEV("button",{type:"button","aria-pressed":!H,className:H?void 0:"on",onClick:()=>W(!1),children:"Path"},void 0,!1,void 0,this),F.jsxDEV("button",{type:"button","aria-pressed":H,className:H?"on":void 0,onClick:()=>W(!0),children:"Tree"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("ul",{className:"ws-list","aria-label":K,children:H?M.map((O)=>{let T=Q.filter((A)=>A.twin===O);return F.jsxDEV("li",{className:"ws-group",children:[F.jsxDEV("p",{className:"ws-group-head",children:[F.jsxDEV(q2,{vendor:O},void 0,!1,void 0,this),F.jsxDEV("b",{children:s1(O)},void 0,!1,void 0,this),F.jsxDEV("span",{className:"mode",children:T.length},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("ul",{children:T.map((A)=>L(A,!0))},void 0,!1,void 0,this)]},O,!0,void 0,this)}):Q.map((O)=>L(O,!1))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function UV({name:Q,token:U,branches:Z,opens:K,refused:H,onChanged:Y}){let[W,L]=F1.useState(""),[M,O]=F1.useState(!1),T=Z?.state==="ok"&&Z.data.checkedOut||Q.split("/")[1],A=Z?.state==="ok"&&Z.data.named?.length?Z.data.named:[{name:T,running:!0}],R=Z?.state==="ok"?Z.data.branches:[],w=W.trim().toLowerCase(),P=(S)=>!w||S.toLowerCase().includes(w),V=(S)=>{S.currentTarget.closest("details")?.removeAttribute("open")};return F.jsxDEV("details",{className:"menu ws-pick",children:[F.jsxDEV("summary",{title:"The branch served here",children:[F.jsxDEV(Z0,{name:"git-branch",size:16},void 0,!1,void 0,this),F.jsxDEV("span",{className:"ws-pick-label",children:[F.jsxDEV("small",{children:"Branch"},void 0,!1,void 0,this),F.jsxDEV("b",{children:T},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV(Z0,{name:"chevron-down",size:16},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("div",{className:"popover ws-branch-menu",children:[F.jsxDEV("div",{className:"ws-branch-find",children:[F.jsxDEV("input",{type:"search",placeholder:"Filter","aria-label":"Filter branches",value:W,onChange:(S)=>L(S.target.value)},void 0,!1,void 0,this),F.jsxDEV("button",{type:"button",onClick:(S)=>{V(S),O(!0)},disabled:!Z,children:"New branch"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("p",{className:"menu-label",children:"This World"},void 0,!1,void 0,this),F.jsxDEV("ul",{className:"ws-branch-list",children:A.filter((S)=>P(S.name)).map((S)=>F.jsxDEV("li",{className:S.name===T?"current":void 0,children:[F.jsxDEV("span",{className:"tick",children:S.name===T?F.jsxDEV(Z0,{name:"check",size:16},void 0,!1,void 0,this):F.jsxDEV(Z0,{name:"git-branch",size:16},void 0,!1,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("span",{className:"name",children:S.name},void 0,!1,void 0,this),F.jsxDEV("span",{className:"mode",children:S.name===T?"served here":S.running?"running":"stopped"},void 0,!1,void 0,this)]},S.name,!0,void 0,this))},void 0,!1,void 0,this),F.jsxDEV("p",{className:"menu-label",children:"Branches of it"},void 0,!1,void 0,this),R.length===0?F.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):F.jsxDEV("ul",{className:"ws-branch-list",children:R.filter((S)=>P(S.name)).map((S)=>{let C=F.jsxDEV(F.Fragment,{children:[F.jsxDEV("span",{className:"tick",children:F.jsxDEV(Z0,{name:"git-branch",size:16},void 0,!1,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("span",{className:"name",children:qV(Q,S.name)},void 0,!1,void 0,this),F.jsxDEV("span",{className:"mode",children:S.at?.instant?F.jsxDEV(F.Fragment,{children:["as of ",F.jsxDEV(j0,{iso:S.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),y=S.expiresAt?`Goes away ${new Date(S.expiresAt).toLocaleString()}`:"Kept";return F.jsxDEV("li",{children:K(S.name)?F.jsxDEV("a",{href:`${n1}/${S.name}`,title:y,onClick:(N)=>{N.preventDefault(),V(N),YO(S.name,S.name.split("/"))},children:C},void 0,!1,void 0,this):F.jsxDEV("span",{title:`${y}. Its tokens went to whoever made it; it opens from their page.`,children:C},void 0,!1,void 0,this)},S.name,!1,void 0,this)})},void 0,!1,void 0,this),F.jsxDEV("div",{className:"ws-branch-foot",children:F.jsxDEV("a",{href:`${n1}/${Q}/~/branches`,onClick:(S)=>{S.preventDefault(),V(S),f0([...Q.split("/"),"~","branches"])},children:"Manage branches…"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV(MO,{name:Q,token:U,open:M,onClose:()=>O(!1),onMade:Y,refused:H},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function BO({name:Q,view:U,changes:Z,changesets:K}){let H=(Y)=>(W)=>{W.preventDefault(),f0([...Q.split("/"),"~",...Y])};return F.jsxDEV("nav",{className:"tabs ws-pane-tabs","aria-label":"Changes and history",children:[F.jsxDEV("a",{href:`${n1}/${Q}/~/changes`,className:U==="changes"?"on":void 0,"aria-current":U==="changes"?"page":void 0,onClick:H(["changes"]),children:["Changes",Z?F.jsxDEV("span",{className:"count",children:Z},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),F.jsxDEV("a",{href:`${n1}/${Q}/~/changes/changesets`,className:U==="history"?"on":void 0,"aria-current":U==="history"?"page":void 0,onClick:H(["changes","changesets"]),children:["History",K?F.jsxDEV("span",{className:"count",children:K},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function GV({name:Q,token:U,sets:Z,sub:K,signsAs:H,canWrite:Y,rooted:W,refused:L,onChanged:M,changes:O,withScreens:T,required:A}){let[R,w]=F1.useState(null),[P,V]=F1.useState(!1),S=Z.state==="ok"?[...Z.data.changesets].sort((u,b)=>b.createdAt.localeCompare(u.createdAt)):[],C=S.find((u)=>u.name===K)??S[0],y=F1.useMemo(()=>{let u=new Map;for(let b of C?NO(C):[]){let m=`${b.twin}:${b.entry.subject.type}:${b.entry.subject.id}`,s=u.get(m)??{key:m,twin:b.twin,writes:[]};s.writes.push(b.entry),u.set(m,s)}return[...u.values()]},[C]),N=y.find((u)=>u.key===R)??y[0],v=y0(U,N?`/-/${Q}/log/${N.twin}`:null),D={added:0,removed:0,changed:0};for(let u of y)D[WU(u.writes).tone]=(D[WU(u.writes).tone]??0)+1;let x=C?LU(C):null,E=C?CO(C,A):null;return F.jsxDEV("div",{className:"ws-two",children:[F.jsxDEV("div",{className:"ws-files",children:[F.jsxDEV(BO,{name:Q,view:"history",changes:O,changesets:S.length},void 0,!1,void 0,this),F.jsxDEV(r2,{load:Z,what:"the changesets",lines:4},void 0,!1,void 0,this),F.jsxDEV("ul",{className:"ws-list ws-commits","aria-label":"Changesets",children:S.map((u)=>{let b=C?.name===u.name,m=LU(u).label==="Not sent";return F.jsxDEV("li",{children:F.jsxDEV("a",{href:`${n1}/${Q}/~/changes/changesets/${u.name}`,className:b?"on":void 0,"aria-current":b?"true":void 0,onClick:(s)=>{s.preventDefault(),w(null),f0([...Q.split("/"),"~","changes","changesets",u.name])},children:[F.jsxDEV("span",{className:"ws-row-text",children:[F.jsxDEV("b",{children:QH(u)},void 0,!1,void 0,this),F.jsxDEV("small",{children:[u.owner??(u.cutBy?zU(u.cutBy):"unrecorded")," • ",F.jsxDEV(j0,{iso:u.createdAt},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),m?F.jsxDEV("span",{className:"ws-unpushed",title:"Not pushed to the remote yet",children:F.jsxDEV(Z0,{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)},u.name,!1,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("div",{className:"ws-pane-right",children:[Z.state==="ok"&&!C?F.jsxDEV(X9,{title:"No changesets yet",children:F.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,C&&x&&E?F.jsxDEV(F.Fragment,{children:[F.jsxDEV("div",{className:"ws-commit-head",children:[F.jsxDEV("div",{className:"ws-commit-title",children:[F.jsxDEV("h3",{children:QH(C)},void 0,!1,void 0,this),F.jsxDEV("p",{className:"ws-commit-stat",children:[F.jsxDEV(Z0,{name:"file-diff",size:16},void 0,!1,void 0,this)," ",l0(y.length,"changed record"),D.added?F.jsxDEV("span",{className:"plus",children:[" +",D.added]},void 0,!0,void 0,this):null,D.removed?F.jsxDEV("span",{className:"minus",children:[" −",D.removed]},void 0,!0,void 0,this):null,D.changed?F.jsxDEV("span",{className:"dot",children:[" •",D.changed]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),F.jsxDEV("p",{className:"mode ws-commit-meta",children:[F.jsxDEV("code",{children:C.name},void 0,!1,void 0,this)," · ",F.jsxDEV(j0,{iso:C.createdAt},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("p",{className:"ws-commit-who",children:[["Owner",C.owner??(C.cutBy&&/^(token|token:read)$|^key:(?!.* for:)/.test(C.cutBy)?"no person: a service’s":"unrecorded")],["Cut by",C.cutBy?C.pushedBy&&C.applied===null&&C.cutBy==="machine"?"the machine it was cut on":zU(C.cutBy):"unrecorded"],...C.pushedBy?[["Pushed by",zU(C.pushedBy)]]:[]].map(([u,b])=>F.jsxDEV("span",{children:[F.jsxDEV("span",{className:"mode",children:u},void 0,!1,void 0,this)," ",b]},u,!0,void 0,this))},void 0,!1,void 0,this),C.pushedBy?F.jsxDEV("p",{className:"mode ws-commit-meta",children:C.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),F.jsxDEV("button",{type:"button",onClick:()=>V(!0),title:"Where it went, the checks, the approvals; Verify, Approve and Deploy",children:[F.jsxDEV("span",{className:`badge cs-${x.tone}`,children:x.label},void 0,!1,void 0,this),F.jsxDEV("span",{className:`badge cs-${E.tone}`,children:E.label},void 0,!1,void 0,this),"Review…"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("div",{className:"ws-two inner",children:[F.jsxDEV("div",{className:"ws-files",children:F.jsxDEV(LO,{records:y,...N?{selected:N.key}:{},onPick:w,label:"Records it changed"},void 0,!1,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("div",{className:"ws-detail",children:N?F.jsxDEV(WO,{record:N,history:v.state==="ok"?v.data.entries:v.state==="error"?[]:null},void 0,!1,void 0,this):F.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),F.jsxDEV(E5,{open:P,onClose:()=>V(!1),title:`Review: ${QH(C)}`,wide:!0,children:[F.jsxDEV($O,{name:Q,token:U,signsAs:H,c:C,canWrite:Y,rooted:W,refused:L,onChanged:M,part:"head",required:A},`h:${C.name}`,!1,void 0,this),F.jsxDEV($O,{name:Q,token:U,signsAs:H,c:C,canWrite:Y,rooted:W,refused:L,onChanged:M,part:"review",required:A},`r:${C.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 ZV({name:Q,token:U,vendors:Z,vendor:K,tick:H}){let[Y,W]=F1.useState(nR*4),[L,M]=F1.useState(""),[O,T]=F1.useState(null),A=y0(U,`/-/${Q}/timeline?limit=${Y}${K?`&twin=${encodeURIComponent(K)}`:""}`,Math.floor(H/2)),R=A.state==="ok"?NV(A.data.entries):[],w=[...new Set(R.map((D)=>Q4(D.entry).what))].sort(),P=R.filter((D)=>!L||Q4(D.entry).what===L),V=P.find((D)=>S9(D)===O)??P[0],S=(D)=>(x)=>{x.preventDefault(),T(null),f0([...Q.split("/"),"~","events",...D?[D]:[]])},C=V?.entry.input&&typeof V.entry.input==="object"?V.entry.input.body:void 0,y=V?tj(V.entry.traceparent):null,N=V?eR(V):null,v=V?OV(V.entry):[];return F.jsxDEV("div",{className:"ws-events",children:[F.jsxDEV("div",{className:"ws-filterbar",children:[F.jsxDEV("nav",{className:"ws-seg","aria-label":"Vendor",children:[F.jsxDEV("a",{href:`${n1}/${Q}/~/events`,className:!K?"on":void 0,"aria-current":!K?"page":void 0,onClick:S(),children:"All"},void 0,!1,void 0,this),Z.map((D)=>F.jsxDEV("a",{href:`${n1}/${Q}/~/events/${D}`,className:K===D?"on":void 0,"aria-current":K===D?"page":void 0,onClick:S(D),children:[F.jsxDEV(q2,{vendor:D},void 0,!1,void 0,this),s1(D)]},D,!0,void 0,this))]},void 0,!0,void 0,this),F.jsxDEV("select",{"aria-label":"Operation",value:L,onChange:(D)=>{M(D.target.value),T(null)},children:[F.jsxDEV("option",{value:"",children:"Every operation"},void 0,!1,void 0,this),w.map((D)=>F.jsxDEV("option",{value:D,children:D},D,!1,void 0,this))]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("div",{className:"ws-grid-wrap",children:[F.jsxDEV(r2,{load:A,what:"the events",lines:6},void 0,!1,void 0,this),F.jsxDEV("table",{className:"ws-grid","aria-label":"Events",children:[F.jsxDEV("thead",{children:F.jsxDEV("tr",{children:[F.jsxDEV("th",{children:"Time"},void 0,!1,void 0,this),F.jsxDEV("th",{children:"Vendor"},void 0,!1,void 0,this),F.jsxDEV("th",{children:"What"},void 0,!1,void 0,this),F.jsxDEV("th",{children:"Record"},void 0,!1,void 0,this),F.jsxDEV("th",{children:"By"},void 0,!1,void 0,this),F.jsxDEV("th",{children:"Receipt"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("tbody",{children:P.map((D)=>{let x=Q4(D.entry),E=eR(D),u=V&&S9(D)===S9(V);return F.jsxDEV("tr",{className:u?"on":void 0,"aria-selected":u,onClick:()=>T(S9(D)),children:[F.jsxDEV("td",{className:"mono",children:F.jsxDEV(j0,{iso:D.entry.occurredAt,time:!0},void 0,!1,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("td",{children:F.jsxDEV("span",{className:"vendor-cell",children:[F.jsxDEV(q2,{vendor:D.twin},void 0,!1,void 0,this),s1(D.twin)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("td",{children:F.jsxDEV("b",{children:x.what},void 0,!1,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("td",{className:"ws-cell-clip",children:x.label?`“${x.label}”`:F.jsxDEV("code",{children:i3(D.entry)},void 0,!1,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("td",{className:"mode",children:dJ(D.entry,D.caller)},void 0,!1,void 0,this),F.jsxDEV("td",{children:E?F.jsxDEV("span",{className:E.bad?"badge cs-bad":E.status==="deployed"?"badge cs-done":"badge",children:E.status},void 0,!1,void 0,this):F.jsxDEV("span",{className:"mode",children:FO(D.entry)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},S9(D),!0,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-event-detail",children:V?F.jsxDEV(F.Fragment,{children:[F.jsxDEV("div",{className:"ws-event-line",children:[F.jsxDEV("span",{className:"badge",children:RO(V.entry)},void 0,!1,void 0,this),N?F.jsxDEV("span",{className:N.bad?"badge cs-bad":"badge cs-good",children:N.status},void 0,!1,void 0,this):null,F.jsxDEV("code",{children:[V.entry.subject.type,":",i3(V.entry)]},void 0,!0,void 0,this),F.jsxDEV("span",{className:"mode",children:[F.jsxDEV(j0,{iso:V.entry.occurredAt},void 0,!1,void 0,this)," · ",dJ(V.entry,V.caller)]},void 0,!0,void 0,this),y?F.jsxDEV("a",{href:`${n1}/${Q}/~/trace/${y.trace}`,onClick:(D)=>{D.preventDefault(),f0([...Q.split("/"),"~","trace",y.trace])},children:"Its trace →"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),F.jsxDEV("div",{className:"ws-event-panes",children:[F.jsxDEV("div",{role:"region","aria-label":"The request",children:[F.jsxDEV("h4",{children:"Request"},void 0,!1,void 0,this),C!==void 0?F.jsxDEV(wV,{body:C},void 0,!1,void 0,this):F.jsxDEV("p",{className:"mode",children:"No request body: the World or the vendor wrote it."},void 0,!1,void 0,this),v.length?F.jsxDEV(F.Fragment,{children:[F.jsxDEV("h4",{children:"Usage"},void 0,!1,void 0,this),F.jsxDEV("dl",{className:"fields",children:v.map(([D,x])=>F.jsxDEV(F1.default.Fragment,{children:[F.jsxDEV("dt",{children:D},void 0,!1,void 0,this),F.jsxDEV("dd",{children:x},void 0,!1,void 0,this)]},D,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),F.jsxDEV("div",{role:"region","aria-label":"What it wrote",children:[F.jsxDEV("h4",{children:"Written"},void 0,!1,void 0,this),F.jsxDEV(IO,{fields:V.entry.fields},void 0,!1,void 0,this),F.jsxDEV("h4",{children:V.copies.length?"Receipts":"Receipt"},void 0,!1,void 0,this),F.jsxDEV("p",{className:"mode",children:V.copies.length?V.copies.map((D)=>D.entry.receipt?.status??"landed copy").join(" · "):PV(V.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):F.jsxDEV("p",{className:"mode pad",children:"Nothing written here yet."},void 0,!1,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("div",{className:"ws-foot mode",children:[F.jsxDEV("span",{children:[V?`${P.indexOf(V)+1} of ${P.length}`:P.length," events",K?` at ${s1(K)}`:""]},void 0,!0,void 0,this),A.state==="ok"&&A.data.next?F.jsxDEV("button",{type:"button",onClick:()=>W((D)=>D+nR*4),children:"Load older"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function FV({name:Q,token:U,id:Z}){let K=/^[0-9a-f]{32}$/.test(Z),H=y0(U,K?`/-/${Q}/timeline?trace=${Z}&limit=500`:null),Y=H.state==="ok"?[...H.data.entries].sort((A,R)=>-TO(A,R)):[],[W,L]=F1.useState(null),M=Y[0]?Date.parse(Y[0].entry.occurredAt):0,O=Y.length?Math.max(1,Date.parse(Y[Y.length-1].entry.occurredAt)-M):1,T=[...new Set(Y.map((A)=>A.twin))];return F.jsxDEV("div",{className:"ws-sheet ws-trace",children:[F.jsxDEV("p",{className:"crumbs-line",children:F.jsxDEV("a",{href:`${n1}/${Q}/~/events`,onClick:(A)=>{A.preventDefault(),f0([...Q.split("/"),"~","events"])},children:[F.jsxDEV(Z0,{name:"arrow-left",size:16},void 0,!1,void 0,this)," Events"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("h2",{children:[Y[0]?`${Q4(Y[0].entry).what} …`:"Trace"," ",F.jsxDEV("code",{className:"mode",children:Z.slice(0,12)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),!K?F.jsxDEV("p",{role:"alert",children:[Z?`${Z} is not a trace id`:"No trace named",": a W3C trace id is 32 hex characters."]},void 0,!0,void 0,this):F.jsxDEV(r2,{load:H,what:"the trace"},void 0,!1,void 0,this),Y.length?F.jsxDEV("p",{className:"ws-trace-meta",children:["Started ",F.jsxDEV("b",{children:F.jsxDEV(j0,{iso:Y[0].entry.occurredAt},void 0,!1,void 0,this)},void 0,!1,void 0,this)," · Took ",F.jsxDEV("b",{children:[O," ms"]},void 0,!0,void 0,this)," · Vendors ",F.jsxDEV("b",{children:T.map(s1).join(", ")},void 0,!1,void 0,this)," · Writes ",F.jsxDEV("b",{children:Y.length},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,H.state==="ok"&&Y.length===0?F.jsxDEV(X9,{title:"Nothing in this World carries this trace",children:F.jsxDEV("p",{children:["An app instrumented with OpenTelemetry sends a ",F.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,Y.length?F.jsxDEV("div",{className:"ws-spans",role:"table","aria-label":"The trace's writes",children:[F.jsxDEV("div",{className:"ws-span head",role:"row",children:[F.jsxDEV("span",{role:"columnheader",children:"Vendor and what"},void 0,!1,void 0,this),F.jsxDEV("span",{role:"columnheader",className:"ws-ticks",children:[F.jsxDEV("span",{children:"0 ms"},void 0,!1,void 0,this),F.jsxDEV("span",{children:[Math.round(O/2)," ms"]},void 0,!0,void 0,this),F.jsxDEV("span",{children:[O," ms"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Y.map((A)=>{let R=Date.parse(A.entry.occurredAt)-M,w=S9(A),P=Q4(A.entry);return F.jsxDEV(F1.default.Fragment,{children:[F.jsxDEV("div",{className:W===w?"ws-span on":"ws-span",role:"row",onClick:()=>L(W===w?null:w),children:[F.jsxDEV("span",{role:"cell",className:"ws-span-name",children:[F.jsxDEV(q2,{vendor:A.twin},void 0,!1,void 0,this),F.jsxDEV("b",{children:s1(A.twin)},void 0,!1,void 0,this)," ",F.jsxDEV("span",{className:"mode",children:[P.what,P.label?` “${P.label}”`:""]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("span",{role:"cell",className:"ws-span-track",children:[F.jsxDEV("span",{className:"ws-span-dot",style:{left:`${R/O*100}%`}},void 0,!1,void 0,this),F.jsxDEV("span",{className:"ws-span-at mode",style:{left:`${R/O*100}%`},children:["+",R," ms"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),W===w?F.jsxDEV("div",{className:"ws-span-detail",children:[F.jsxDEV("p",{className:"mode",children:[F.jsxDEV("code",{children:RO(A.entry)},void 0,!1,void 0,this)," on ",F.jsxDEV("code",{children:[A.entry.subject.type,":",i3(A.entry)]},void 0,!0,void 0,this)," · ",dJ(A.entry,A.caller)," · ",FO(A.entry)]},void 0,!0,void 0,this),F.jsxDEV(IO,{fields:A.entry.fields},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},w,!0,void 0,this)})]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)}function XV({name:Q,token:U,vendor:Z,withScreens:K,tick:H}){let Y=y0(U,`/-/${Q}/checkpoint/${Z}`,Math.floor(H/6)),W=Y.state==="ok"?Y.data.tree.filter((v)=>v.deleted!==!0):[],L=[...new Set(W.map((v)=>v.type))].map((v)=>({type:v,count:W.filter((D)=>D.type===v).length})).sort((v,D)=>Number(v.type.startsWith("_"))-Number(D.type.startsWith("_"))||$7(v.type).localeCompare($7(D.type))),[M,O]=F1.useState(null),[T,A]=F1.useState(null),R=L.some((v)=>v.type===M)?M:L[0]?.type,w=W.filter((v)=>v.type===R),P=w.find((v)=>v.id===T)??w[0],V=["name","email","title","text","description","subject","amount","percent_off","unit_amount","currency","status","channel","customer","product"],S=new Set(["id","type","object","livemode","created","updated","updatedAt","deleted"]),C=(v)=>!S.has(v)&&w.some((D)=>D[v]!==void 0&&D[v]!==null&&typeof D[v]!=="object"),y=[...new Set(w.flatMap((v)=>Object.keys(v)))],N=[...V.filter(C),...y.filter((v)=>!V.includes(v)&&C(v))].slice(0,4);return F.jsxDEV("div",{className:"ws-table-app",children:[F.jsxDEV("nav",{className:"ws-tables","aria-label":`${s1(Z)}'s records`,children:[F.jsxDEV("div",{className:"ws-list-head",children:F.jsxDEV("span",{className:"vendor-cell",children:[F.jsxDEV(q2,{vendor:Z},void 0,!1,void 0,this),s1(Z)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),F.jsxDEV(r2,{load:Y,what:"what it stores",lines:4},void 0,!1,void 0,this),F.jsxDEV("p",{className:"menu-label",children:"Stores"},void 0,!1,void 0,this),L.map((v)=>F.jsxDEV("a",{href:`#${v.type}`,className:R===v.type?"on":void 0,"aria-current":R===v.type?"true":void 0,onClick:(D)=>{D.preventDefault(),O(v.type),A(null)},children:[F.jsxDEV(Z0,{name:"table-2",size:16},void 0,!1,void 0,this),F.jsxDEV("span",{children:$7(v.type)},void 0,!1,void 0,this),F.jsxDEV("span",{className:"count",children:v.count},void 0,!1,void 0,this)]},v.type,!0,void 0,this)),F.jsxDEV("p",{className:"menu-label",children:"Also"},void 0,!1,void 0,this),F.jsxDEV("a",{href:`${n1}/${Q}/~/events/${Z}`,onClick:(v)=>{v.preventDefault(),f0([...Q.split("/"),"~","events",Z])},children:[F.jsxDEV(Z0,{name:"activity",size:16},void 0,!1,void 0,this),F.jsxDEV("span",{children:"Its events"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),K?F.jsxDEV("a",{href:`${n1}/${Q}/~/screens/${Z}`,onClick:(v)=>{v.preventDefault(),f0([...Q.split("/"),"~","screens",Z])},children:[F.jsxDEV(Z0,{name:"monitor",size:16},void 0,!1,void 0,this),F.jsxDEV("span",{children:"Its screens"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),F.jsxDEV("div",{className:"ws-grid-wrap",children:[Y.state==="ok"&&L.length===0?F.jsxDEV(X9,{title:`${s1(Z)} stores nothing yet`,children:F.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,w.length?F.jsxDEV("table",{className:"ws-grid","aria-label":`${$7(R??"")} records`,children:[F.jsxDEV("thead",{children:F.jsxDEV("tr",{children:[F.jsxDEV("th",{children:"id"},void 0,!1,void 0,this),N.map((v)=>F.jsxDEV("th",{children:v},v,!1,void 0,this)),F.jsxDEV("th",{children:"updated"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("tbody",{children:w.map((v)=>F.jsxDEV("tr",{className:P?.id===v.id?"on":void 0,"aria-selected":P?.id===v.id,onClick:()=>A(v.id),children:[F.jsxDEV("td",{children:F.jsxDEV("code",{children:v.id},void 0,!1,void 0,this)},void 0,!1,void 0,this),N.map((D)=>F.jsxDEV("td",{className:"ws-cell-clip",children:v[D]===void 0||v[D]===null?F.jsxDEV("span",{className:"mode",children:"—"},void 0,!1,void 0,this):String(v[D])},D,!1,void 0,this)),F.jsxDEV("td",{className:"mode",children:typeof v.updatedAt==="string"?F.jsxDEV(j0,{iso:v.updatedAt},void 0,!1,void 0,this):"—"},void 0,!1,void 0,this)]},v.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),F.jsxDEV("aside",{className:"ws-record","aria-label":"The selected record",children:P?F.jsxDEV(F.Fragment,{children:[F.jsxDEV("div",{className:"ws-list-head",children:[F.jsxDEV("span",{children:$7(P.type)},void 0,!1,void 0,this),F.jsxDEV("code",{children:P.id},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("dl",{className:"ws-record-fields",children:Object.entries(P).filter(([v])=>v!=="type"&&v!=="id").map(([v,D])=>F.jsxDEV(F1.default.Fragment,{children:[F.jsxDEV("dt",{children:v},void 0,!1,void 0,this),F.jsxDEV("dd",{children:F.jsxDEV(d3,{v:D},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},v,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null},void 0,!1,void 0,this),F.jsxDEV("div",{className:"ws-foot mode",children:P?`${w.indexOf(P)+1} of ${l0(w.length,$7(R??"record"))}`:""},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function KV({name:Q,vendor:U,url:Z,mapError:K,holding:H,session:Y,retry:W}){return F.jsxDEV("div",{className:"ws-screen",children:[F.jsxDEV("div",{className:"ws-screen-bar",children:[F.jsxDEV("span",{className:"vendor-cell",children:[F.jsxDEV(q2,{vendor:U},void 0,!1,void 0,this),F.jsxDEV("b",{children:s1(U)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("span",{className:"mode",children:H},void 0,!1,void 0,this),F.jsxDEV("a",{href:`${n1}/${Q}/~/vendors/${U}`,onClick:(L)=>{L.preventDefault(),f0([...Q.split("/"),"~","vendors",U])},children:[F.jsxDEV(Z0,{name:"table-2",size:16},void 0,!1,void 0,this),"Its records"]},void 0,!0,void 0,this),Z?F.jsxDEV("a",{href:Z,target:"_blank",rel:"noopener noreferrer",children:[F.jsxDEV(Z0,{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),Y.state==="ok"&&Y.scope==="read"?F.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,K?F.jsxDEV("p",{role:"alert",className:"ws-screens-note",children:["The World did not say where its screens are: ",K]},void 0,!0,void 0,this):Y.state==="pending"||Z===void 0?F.jsxDEV("p",{className:"mode ws-screens-note",role:"status",children:"Opening…"},void 0,!1,void 0,this):null,Y.state==="error"?F.jsxDEV("p",{role:"alert",className:"ws-screens-note",children:["The World did not open its screens: ",Y.error," ",F.jsxDEV("button",{type:"button",onClick:W,children:"Try again"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,Y.state==="ok"&&Z===null?F.jsxDEV("p",{className:"mode ws-screens-note",children:[s1(U),"'s pack lists no screens."]},void 0,!0,void 0,this):null,Y.state==="ok"&&Z?F.jsxDEV("iframe",{title:`${s1(U)}, as this World shows it`,src:Z},U,!1,void 0,this):null]},void 0,!0,void 0,this)}function HV({name:Q,token:U,who:Z,scope:K}){let[H,Y]=F1.useState(0),W=y0(U,`/-/${Q}/twins`),L=y0(U,`/-/${Q}/rules`,H),M=L.state==="ok"?L.data.changesets:null,[O,T]=F1.useState(null),[A,R]=F1.useState(null),[w,P]=F1.useState(!1),[V,S]=F1.useState([]),C=O??M?.approvals??1,y=A??M?.summary??"required",N=M!==null&&(C!==(M.approvals??1)||y!==(M.summary??"required")),v=(m,s)=>{if(S((U1)=>[{ok:m,text:s,at:new Date().toISOString(),n:++aJ},...U1].slice(0,3)),!m)e0(s,"error")},D=async(m)=>{m.preventDefault(),P(!0);try{let s=await O0(U,`/-/${Q}/rules`,{method:"PUT",body:JSON.stringify({changesets:{approvals:C,summary:y}})});if(!s.ok){v(!1,`Save: ${await T5(s)}`);return}v(!0,`Saved: ${C===0?"no approval":l0(C,"approval")} before a deploy; a summary ${y==="required"?"required":"generated when none is given"}.`),T(null),R(null),Y((U1)=>U1+1)}finally{P(!1)}},x={gated:"a person deploys an approved changeset",auto:"a push deploys at once",hold:"nothing deploys"},E=Z.person?F.jsxDEV(F.Fragment,{children:[F.jsxDEV("b",{children:Z.person},void 0,!1,void 0,this),Z.local?", signed in on this machine":""]},void 0,!0,void 0,this):Z.local?F.jsxDEV(F.Fragment,{children:[F.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):Z.admin?F.jsxDEV(F.Fragment,{children:F.jsxDEV("b",{children:"the host's admin"},void 0,!1,void 0,this)},void 0,!1,void 0,this):F.jsxDEV(F.Fragment,{children:[F.jsxDEV("b",{children:"this token"},void 0,!1,void 0,this),", a service"]},void 0,!0,void 0,this),u=W.state==="ok"?W.data.twins.filter((m)=>m.root?.url):[],b=K!=="write"?"This session reads the World; it changes no rules":null;return F.jsxDEV(F.Fragment,{children:[F.jsxDEV("h3",{className:"settings-head",children:"Changesets"},void 0,!1,void 0,this),F.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),F.jsxDEV(r2,{load:L,what:"the rules",lines:2},void 0,!1,void 0,this),F.jsxDEV("form",{className:"ws-rules",onSubmit:(m)=>void D(m),"aria-label":"Changeset rules",children:[F.jsxDEV("div",{className:"ws-rule",children:[F.jsxDEV("h4",{children:"Recorded as"},void 0,!1,void 0,this),F.jsxDEV("p",{children:["What you cut here is recorded as ",E,". 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),F.jsxDEV("div",{className:"ws-rule",children:[F.jsxDEV("h4",{children:"A cut's summary"},void 0,!1,void 0,this),F.jsxDEV("fieldset",{className:"choice",disabled:Boolean(b)||M===null,children:[F.jsxDEV("label",{className:"check",children:[F.jsxDEV("input",{type:"radio",name:"summary",checked:y==="required",onChange:()=>R("required")},void 0,!1,void 0,this)," ",F.jsxDEV("span",{children:"Required: whoever cuts says what it does and why"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("label",{className:"check",children:[F.jsxDEV("input",{type:"radio",name:"summary",checked:y==="generated",onChange:()=>R("generated")},void 0,!1,void 0,this)," ",F.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),F.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),F.jsxDEV("div",{className:"ws-rule",children:[F.jsxDEV("h4",{children:"Ready to deploy"},void 0,!1,void 0,this),F.jsxDEV("ul",{className:"ws-rule-list",children:F.jsxDEV("li",{children:[F.jsxDEV(Z0,{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),F.jsxDEV("label",{className:"ws-rule-row",children:[F.jsxDEV("span",{children:"Approved by"},void 0,!1,void 0,this),F.jsxDEV("select",{value:C,onChange:(m)=>T(Number(m.target.value)),disabled:Boolean(b)||M===null,"aria-label":"Approvals required",children:[0,1,2,3,4,5].map((m)=>F.jsxDEV("option",{value:m,children:m===0?"no one: verified is enough":m===1?"1 person":`${m} different people`},m,!1,void 0,this))},void 0,!1,void 0,this),F.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),F.jsxDEV("div",{className:"ws-rule",children:[F.jsxDEV("h4",{children:"Deploys to"},void 0,!1,void 0,this),W.state==="ok"&&u.length===0?F.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,u.length?F.jsxDEV("ul",{className:"ws-rule-list",children:u.map((m)=>F.jsxDEV("li",{children:[F.jsxDEV(q2,{vendor:m.twin},void 0,!1,void 0,this),s1(m.twin),": ",x[m.root.deploy??"gated"]??"gated"]},m.twin,!0,void 0,this))},void 0,!1,void 0,this):null,F.jsxDEV("p",{className:"mode",children:[F.jsxDEV("a",{href:`${n1}/${Q}/~/settings/services`,onClick:(m)=>{m.preventDefault(),f0([...Q.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),F.jsxDEV(r6,{log:V,name:Q},void 0,!1,void 0,this),F.jsxDEV("div",{className:"row-actions",children:[F.jsxDEV("button",{type:"submit",className:"primary",disabled:Boolean(b)||w||!N,title:b??void 0,children:w?"Saving…":"Save"},void 0,!1,void 0,this),N?F.jsxDEV("button",{type:"button",onClick:()=>{T(null),R(null)},children:"Cancel"},void 0,!1,void 0,this):null,b?F.jsxDEV("span",{className:"mode",children:[b,"."]},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 YV({who:Q,scope:U,snapshot:Z,portal:K,onSignOut:H}){let Y=U==="write"?"Reads and changes this World":U==="read"?"Reads this World; changes nothing":"…",[W,L]=Z?["A snapshot",`of ${Z.parent}, read only`]:Q.local&&Q.person?[Q.person,"Signed in on this machine: this World is served here, and acts as you"]:Q.local?["This machine","Served here, with no one signed in: what you do is recorded as this machine"]:Q.person?[Q.person,K?`Signed in through ${new URL(K).host}`:"Signed in"]:Q.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 F.jsxDEV(F.Fragment,{children:[F.jsxDEV("h3",{className:"settings-head",children:"Account"},void 0,!1,void 0,this),F.jsxDEV("div",{className:"ws-account",children:[F.jsxDEV("span",{className:"ws-account-face","aria-hidden":"true",children:F.jsxDEV(Z0,{name:Q.person?"user":Q.local?"monitor":Z?"clock":"key-round",size:20},void 0,!1,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("div",{className:"cell-label",children:[F.jsxDEV("b",{children:W},void 0,!1,void 0,this),F.jsxDEV("small",{children:L},void 0,!1,void 0,this),F.jsxDEV("small",{children:Y},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Q.local||Z?null:F.jsxDEV("p",{children:F.jsxDEV("button",{type:"button",onClick:H,children:[F.jsxDEV(Z0,{name:"log-out",size:16},void 0,!1,void 0,this),Q.person?"Sign out":Q.admin?"Sign out of the host":"Use another token"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),K&&Q.person?F.jsxDEV("p",{className:"mode",children:["Your profile, orgs and keys are on ",F.jsxDEV("a",{href:`${K}/`,children:new URL(K).host},void 0,!1,void 0,this),"."]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)}function zV({name:Q,token:U,view:Z,sub:K,arg:H,win:Y,who:W,snapshot:L,onReturn:M,onSignOut:O,worlds:T,session:A,retry:R,twins:w,map:P,branches:V,clock:S,canWrite:C,refused:y,signsAs:N,opens:v,tick:D,admin:x,onRemoved:E,onClock:u,scope:b}){let m=SO(Q,U,D,y),[s,U1]=F1.useState(0),Q1=s*1e5+Math.floor(D/2),h=y0(U,`/-/${Q}/diff`,Q1),g=y0(U,`/-/${Q}/changesets`,Q1),p=y0(U,`/-/${Q}/rules`,Q1),[c,l]=F1.useState(null),o=(A1)=>(e1)=>{e1?.preventDefault(),f0([...Q.split("/"),"~",...A1])},k=w.state==="ok"?w.data.twins.map((A1)=>A1.twin):[],t=new Map((P.state==="ok"?P.data.twins:[]).flatMap((A1)=>{let e1=$V(Q,A1);return e1?[[A1.twin,e1]]:[]})),_1=[...t.keys()],a=P.state==="ok"?P.data.twins.filter((A1)=>A1.root).map((A1)=>A1.twin):[],H1=(A1)=>P.state==="ok"?(P.data.twins.find((e1)=>e1.twin===A1)?.resources??[]).reduce((e1,D1)=>e1+D1.count,0):0,O1=V?.state==="ok"&&V.data.checkedOut||Q.split("/")[1],L1=F1.useMemo(()=>{if(h.state!=="ok")return[];let A1=new Map;for(let e1 of h.data.changes){let D1=`${e1.twin}:${e1.entry.subject.type}:${e1.entry.subject.id}`,g0=A1.get(D1)??{key:D1,twin:e1.twin,writes:[]};g0.writes.push(e1.entry),A1.set(D1,g0)}return[...A1.values()]},[h]),T1=L1.find((A1)=>A1.key===c)??L1[0],G1=y0(U,Z==="changes"&&T1?`/-/${Q}/log/${T1.twin}`:null,Q1),R1=h.state==="ok"?h.data.changes.length:0,f1=m.waiting.length,z1=m.there,C1=m.origin.state==="ok"?m.origin.data.origin:null,b1=!C?"This session reads the World; it changes nothing":!z1?"No remote: name one in Settings › Remote":null,c1=(A1,e1,D1,g0,_0,t0)=>F.jsxDEV("a",{href:`${n1}/${Q}/~/${g0}`,className:A1?"on":void 0,"aria-current":A1?"page":void 0,onClick:_0,children:[e1,F.jsxDEV("span",{children:D1},void 0,!1,void 0,this),t0?F.jsxDEV("span",{className:"count",children:t0},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),k1=(A1)=>{A1.currentTarget.closest("details")?.removeAttribute("open")};return F.jsxDEV("div",{className:"ws",children:[F.jsxDEV("div",{className:"ws-bar",role:"toolbar","aria-label":`${Q} toolbar`,children:[F.jsxDEV("div",{className:"ws-left",children:[F.jsxDEV(HJ,{href:`${n1}/${Q}`,onClick:(A1)=>{A1.preventDefault(),o(["changes"])()}},void 0,!1,void 0,this),F.jsxDEV("details",{className:"menu ws-pick",children:[F.jsxDEV("summary",{title:"This World",children:[F.jsxDEV(Z0,{name:"globe",size:16},void 0,!1,void 0,this),F.jsxDEV("span",{className:"ws-pick-label",children:[F.jsxDEV("small",{children:"World"},void 0,!1,void 0,this),F.jsxDEV("b",{children:Q},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV(Z0,{name:"chevron-down",size:16},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("div",{className:"popover menu-list ws-world-menu",children:[W.local?null:F.jsxDEV(F.Fragment,{children:[F.jsxDEV("p",{className:"menu-label",children:"Worlds"},void 0,!1,void 0,this),T.map((A1)=>F.jsxDEV("a",{href:`${n1}/${A1}`,className:A1===Q?"on":void 0,onClick:(e1)=>{e1.preventDefault(),k1(e1),f0(A1.split("/"))},children:[A1===Q?F.jsxDEV(Z0,{name:"check",size:16},void 0,!1,void 0,this):F.jsxDEV(Z0,{name:"globe",size:16},void 0,!1,void 0,this),A1]},A1,!0,void 0,this)),F.jsxDEV("a",{href:`${O4()&&O4()!==P0?O4():""}${n1}/`,onClick:(A1)=>{if(O4()&&O4()!==P0)return;A1.preventDefault(),k1(A1),f0([])},children:[F.jsxDEV(Z0,{name:"layout-grid",size:16},void 0,!1,void 0,this),"All Worlds",t2()?` on ${new URL(t2()).host}`:""]},void 0,!0,void 0,this),F.jsxDEV("hr",{},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("p",{className:"menu-label",children:"Connect an app"},void 0,!1,void 0,this),t2()?F.jsxDEV(F.Fragment,{children:[F.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),F.jsxDEV("pre",{children:[c3,"/",Q,"/<vendor>"]},void 0,!0,void 0,this),F.jsxDEV(JH,{text:XU({platform:t2(),world:Q})},void 0,!1,void 0,this)]},void 0,!0,void 0,this):!W.local?F.jsxDEV(F.Fragment,{children:[F.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),F.jsxDEV("pre",{children:[c3,"/",Q,"/<vendor>"]},void 0,!0,void 0,this),F.jsxDEV(JH,{text:XU()},void 0,!1,void 0,this)]},void 0,!0,void 0,this):F.jsxDEV(F.Fragment,{children:[F.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),F.jsxDEV("pre",{children:"volter world run -- npm start"},void 0,!1,void 0,this),F.jsxDEV("p",{className:"ws-menu-text mode",children:["Or point an SDK at ",F.jsxDEV("code",{children:[c3,"/",Q,"/<vendor>"]},void 0,!0,void 0,this)," with the token in ",F.jsxDEV("code",{children:".volter/token"},void 0,!1,void 0,this),"."]},void 0,!0,void 0,this),F.jsxDEV(JH,{text:XU()},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("hr",{},void 0,!1,void 0,this),F.jsxDEV("a",{href:`${n1}/${Q}/~/settings`,onClick:(A1)=>{k1(A1),o(["settings"])(A1)},children:[F.jsxDEV(Z0,{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),F.jsxDEV(UV,{name:Q,token:U,branches:V,opens:v,refused:y,onChanged:u},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("div",{className:"ws-where",title:"Where this is",children:[F.jsxDEV("span",{children:Q},void 0,!1,void 0,this),F.jsxDEV("span",{className:"sep",children:":"},void 0,!1,void 0,this),F.jsxDEV("span",{children:O1},void 0,!1,void 0,this),F.jsxDEV("span",{className:"sep",children:":"},void 0,!1,void 0,this),C1?F.jsxDEV("a",{href:`${n1}/${Q}/~/remote`,onClick:o(["remote"]),children:["origin ",C1.namespace,f1?F.jsxDEV("b",{children:[" ↑",f1]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this):F.jsxDEV("a",{href:`${n1}/${Q}/~/remote`,onClick:o(["remote"]),children:"no remote"},void 0,!1,void 0,this),F.jsxDEV("span",{className:"sep",children:":"},void 0,!1,void 0,this),F.jsxDEV("a",{href:`${n1}/${Q}/~/settings/clock`,onClick:o(["settings","clock"]),children:S.state==="ok"?F.jsxDEV(F.Fragment,{children:[S.data.frozen?"stopped at ":"",F.jsxDEV(j0,{iso:S.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),F.jsxDEV("div",{className:"ws-right",children:[F.jsxDEV("button",{type:"button",className:"ws-btn",onClick:()=>void m.pull(),disabled:Boolean(b1)||m.busy!==null,title:b1??`Fetch what ${z1} has and move this branch onto it`,children:[F.jsxDEV(Z0,{name:"arrow-down-to-line",size:16},void 0,!1,void 0,this),m.busy==="Pull"?"Pulling…":"Pull"]},void 0,!0,void 0,this),F.jsxDEV("button",{type:"button",className:"ws-btn",onClick:()=>void m.push(),disabled:Boolean(b1)||m.busy!==null||f1===0,title:b1??(f1?`Push ${l0(f1,"changeset")} to ${z1}`:`Every changeset is at ${z1}`),children:[F.jsxDEV(Z0,{name:"arrow-up-from-line",size:16},void 0,!1,void 0,this),m.busy==="Push"?"Pushing…":"Push",f1?F.jsxDEV("span",{className:"ws-btn-count",children:f1},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),F.jsxDEV("button",{type:"button",className:"ws-btn icon-only","aria-label":"Settings",title:"Settings",onClick:()=>o(["settings"])(),children:F.jsxDEV(Z0,{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),L?F.jsxDEV("div",{className:"ws-banner",role:"region","aria-label":"Snapshot",children:[F.jsxDEV(Z0,{name:"clock",size:16},void 0,!1,void 0,this),F.jsxDEV("span",{children:["You are looking at ",F.jsxDEV("b",{children:L.parent},void 0,!1,void 0,this)," as it was at ",F.jsxDEV(j0,{iso:L.at},void 0,!1,void 0,this),": a read-only snapshot",L.expiresAt?F.jsxDEV(F.Fragment,{children:[", gone ",F.jsxDEV(j0,{iso:L.expiresAt},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,"."]},void 0,!0,void 0,this),F.jsxDEV("button",{type:"button",onClick:()=>void M(L),children:"Return to live"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,m.log.length?F.jsxDEV("div",{className:"ws-said",children:F.jsxDEV(r6,{log:m.log.slice(0,1),name:Q},void 0,!1,void 0,this)},void 0,!1,void 0,this):null,F.jsxDEV("div",{className:"ws-body",children:[F.jsxDEV("nav",{className:"ws-side","aria-label":`${Q} places`,children:[k.length?F.jsxDEV("a",{href:`${n1}/${Q}/~/screens`,className:Z==="screen"?"ws-screens-entry on":"ws-screens-entry",onClick:o(["screens"]),title:`The board: ${E8(k.map(s1))}`,children:[F.jsxDEV(Z0,{name:"layout-grid",size:16},void 0,!1,void 0,this),F.jsxDEV("span",{children:"Board"},void 0,!1,void 0,this),F.jsxDEV("span",{className:"ws-screens-marks",children:[k.slice(0,3).map((A1)=>F.jsxDEV(q2,{vendor:A1},A1,!1,void 0,this)),k.length>3?F.jsxDEV("span",{className:"more",children:["+",k.length-3]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null,F.jsxDEV("p",{className:"side-group",children:"Workspace"},void 0,!1,void 0,this),c1(Z==="changes"||Z==="history",F.jsxDEV(Z0,{name:"file-diff",size:16},void 0,!1,void 0,this),"Changes","changes",o(["changes"]),L1.length?String(L1.length):void 0),c1(Z==="events"&&!H||Z==="trace",F.jsxDEV(Z0,{name:"activity",size:16},void 0,!1,void 0,this),"Events","events",o(["events"])),F.jsxDEV("p",{className:"side-group",children:"Records"},void 0,!1,void 0,this),k.map((A1)=>F.jsxDEV(F1.default.Fragment,{children:c1(Z==="vendor"&&H===A1,F.jsxDEV(q2,{vendor:A1},void 0,!1,void 0,this),s1(A1),`vendors/${A1}`,o(["vendors",A1]),H1(A1)?String(H1(A1)):void 0)},A1,!1,void 0,this)),F.jsxDEV("p",{className:"side-group",children:"Remote"},void 0,!1,void 0,this),c1(!1,F.jsxDEV(Z0,{name:"cloud",size:16},void 0,!1,void 0,this),z1?"origin":"Name a remote…","remote",o(["remote"]),f1?`↑${f1}`:void 0)]},void 0,!0,void 0,this),F.jsxDEV("div",{className:"ws-main",role:"main",children:[Z==="changes"?F.jsxDEV("div",{className:"ws-status",children:[F.jsxDEV("div",{className:"ws-files",children:[F.jsxDEV(BO,{name:Q,view:"changes",changes:L1.length,changesets:g.state==="ok"?g.data.changesets.length:0},void 0,!1,void 0,this),F.jsxDEV("div",{className:"ws-list-head",children:[F.jsxDEV("span",{children:"Not in a changeset"},void 0,!1,void 0,this),F.jsxDEV("span",{className:"mode",children:h.state==="ok"?`${l0(L1.length,"record")} · ${l0(R1,"write")}`:""},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV(r2,{load:h,what:"the changes",lines:4},void 0,!1,void 0,this),F.jsxDEV(LO,{records:L1,...T1?{selected:T1.key}:{},onPick:l,label:"Changed records"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("div",{className:"ws-detail",children:[h.state==="ok"&&!T1?F.jsxDEV(X9,{title:"No changes on this branch",action:f1>0&&z1?F.jsxDEV("button",{type:"button",className:"primary",disabled:Boolean(b1)||m.busy!==null,onClick:()=>void m.push(),children:["Push ",l0(f1,"changeset")," to origin"]},void 0,!0,void 0,this):void 0,children:F.jsxDEV("p",{children:["What your app writes to this World lands here, record by record, to cut into a changeset. Everything since ",h.data.base.at?F.jsxDEV(j0,{iso:h.data.base.at},void 0,!1,void 0,this):F.jsxDEV("code",{children:h.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,T1?F.jsxDEV(WO,{record:T1,history:G1.state==="ok"?G1.data.entries:G1.state==="error"?[]:null},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),F.jsxDEV(uV,{pinned:!0,generated:p.state==="ok"&&p.data.changesets.summary==="generated",author:{face:F.jsxDEV(Z0,{name:W.person?"user":W.local?"monitor":"key-round",size:18},void 0,!1,void 0,this),who:W.person??(W.local?"This machine":W.admin?"The host's admin":"A token"),account:`${n1}/${Q}/~/settings/account`,branch:O1},name:Q,token:U,changes:R1,canWrite:C,refused:y,onCut:()=>{U1((A1)=>A1+1),l(null)}},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,Z==="history"?F.jsxDEV(GV,{name:Q,token:U,sets:g,changes:L1.length,withScreens:_1,required:p.state==="ok"?p.data.changesets.approvals??1:1,...K?{sub:K}:{},signsAs:N,canWrite:C,rooted:a,refused:y,onChanged:()=>U1((A1)=>A1+1)},void 0,!1,void 0,this):null,Z==="events"?F.jsxDEV(ZV,{name:Q,token:U,vendors:k,...H&&k.includes(H)?{vendor:H}:{},tick:D},H??"",!1,void 0,this):null,Z==="trace"?F.jsxDEV(FV,{name:Q,token:U,id:H??""},void 0,!1,void 0,this):null,Z==="vendor"&&H?F.jsxDEV(XV,{name:Q,token:U,vendor:H,withScreens:_1.includes(H),tick:D},H,!1,void 0,this):null,Z==="screen"&&H?F.jsxDEV(KV,{name:Q,vendor:H,url:P.state==="ok"?t.get(H)??null:void 0,...P.state==="error"?{mapError:P.error}:{},holding:LV(P.state==="ok"?P.data.twins.find((A1)=>A1.twin===H)?.resources??[]:[]),session:A,retry:R},H,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV(E5,{open:Y?.kind==="settings",onClose:()=>o(["changes"])(),title:"Settings",wide:"window",children:Y?.kind==="settings"?F.jsxDEV("div",{className:"ws-settings",children:[F.jsxDEV("nav",{"aria-label":"Settings",children:zO.map(([A1,e1,D1])=>F.jsxDEV("a",{href:`${n1}/${Q}/~/settings/${A1}`,className:Y.tab===A1?"on":void 0,"aria-current":Y.tab===A1?"page":void 0,onClick:o(["settings",A1]),children:[F.jsxDEV(Z0,{name:D1,size:16},void 0,!1,void 0,this),e1]},A1,!0,void 0,this))},void 0,!1,void 0,this),F.jsxDEV("div",{className:"ws-settings-pane",children:[b==="read"?F.jsxDEV("p",{className:"mode",children:[F.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,Y.tab==="account"?F.jsxDEV(YV,{who:W,scope:b,snapshot:L,portal:t2(),onSignOut:O},void 0,!1,void 0,this):null,Y.tab==="changesets"?F.jsxDEV(HV,{name:Q,token:U,who:W,scope:b},void 0,!1,void 0,this):null,Y.tab==="remote"?F.jsxDEV(EV,{name:Q,token:U,canWrite:C,tick:D,refused:y},void 0,!1,void 0,this):null,Y.tab==="access"||Y.tab==="services"||Y.tab==="checks"||Y.tab==="clock"?F.jsxDEV(xV,{name:Q,token:U,admin:x,canWrite:C,refused:y,onRemoved:E,only:Y.tab},void 0,!1,void 0,this):null,Y.tab==="vault"?F.jsxDEV(hV,{name:Q,token:U,canWrite:C,refused:y},void 0,!1,void 0,this):null,Y.tab==="appearance"?F.jsxDEV(F.Fragment,{children:[F.jsxDEV("h3",{className:"settings-head",children:"Appearance"},void 0,!1,void 0,this),F.jsxDEV(nj,{},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),F.jsxDEV(E5,{open:Y?.kind==="branches",onClose:()=>o(["changes"])(),title:"Branches",wide:!0,children:Y?.kind==="branches"?F.jsxDEV(MV,{name:Q,token:U,canWrite:C,branches:V,opens:v,...Y.open?{open:Y.open}:{},onChanged:u,refused:y},void 0,!1,void 0,this):null},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function JH({text:Q}){return F.jsxDEV("button",{type:"button",className:"agent-prompt-button",onClick:()=>{navigator.clipboard?.writeText(Q).then(()=>e0("Copied the prompt: paste it into your coding agent"),()=>e0("Could not copy the prompt","error"))},children:"Copy a prompt for your coding agent"},void 0,!1,void 0,this)}var HH=(Q)=>`${Q.url.replace(/\/+$/,"")}/${Q.namespace}`,WV=(Q)=>Q.filter((U)=>U.applied===null||U.applied.outcome==="refused"),LV=(Q,U=4)=>{let Z=[...Q].filter((K)=>K.count>0).sort((K,H)=>H.count-K.count);return Z.length?Z.slice(0,U).map((K)=>l0(K.count,K.type.replace(/^_+/,""))).join(" · ")+(Z.length>U?` · +${Z.length-U} more`:""):"nothing yet"},AO=F.jsxDEV("svg",{className:"branch-glyph",viewBox:"0 0 16 16",width:"14",height:"14","aria-hidden":"true",children:F.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 BV({name:Q,token:U,clock:Z,canWrite:K,onChanged:H,refused:Y,open:W}){let[L,M]=F1.useState(!1),[O,T]=F1.useState(""),[A,R]=F1.useState(""),[w,P]=F1.useState(null),[V,S]=F1.useState(!1),C=Z.state==="ok"?Z.data:null,y=async(x,E,u)=>{S(!0),P(null);try{let b=await O0(U,`/-/${Q}/${E}`,{method:E==="clock"?"PUT":"POST",body:JSON.stringify(u)});if(!b.ok){Y(b),P({ok:!1,text:await T5(b)});return}let m=await b.json();P({ok:!0,text:`${x} — the World is at ${new Date(m.at).toLocaleString()}`}),M(!1),H()}catch(b){P({ok:!1,text:`the World did not answer: ${b instanceof Error?b.message:String(b)}`})}finally{S(!1)}},N=(x)=>{x.preventDefault();let E=new Date(O);if(Number.isNaN(E.getTime())){P({ok:!1,text:"Pick a date and time."});return}if(C&&E.getTime()<Date.parse(C.at)){P({ok:!1,text:`The World's clock only moves forward: pick a time after ${new Date(C.at).toLocaleString()}.`});return}y("Clock set","clock",{at:E.toISOString()})},v=(x,E)=>{y(`Advanced ${E}`,"clock/advance",{by:x})},D=[["1h","1 hour"],["1d","1 day"],["7d","1 week"],["30d","30 days"]];return F.jsxDEV("div",{className:`clock${C?.frozen?" frozen":""}`,role:"region","aria-label":"World clock",children:[F.jsxDEV("p",{className:"clock-now",children:Z.state==="loading"?F.jsxDEV("span",{className:"mode",children:"clock…"},void 0,!1,void 0,this):Z.state==="error"?F.jsxDEV("span",{className:"mode",children:["Clock: ",Z.error]},void 0,!0,void 0,this):C.frozen?F.jsxDEV(F.Fragment,{children:[F.jsxDEV("span",{className:"badge",children:"Simulation"},void 0,!1,void 0,this)," World time ",F.jsxDEV("strong",{children:F.jsxDEV(j0,{iso:C.at},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):F.jsxDEV(F.Fragment,{children:["World time ",F.jsxDEV("strong",{children:F.jsxDEV(j0,{iso:C.at},void 0,!1,void 0,this)},void 0,!1,void 0,this)," ",F.jsxDEV("span",{className:"mode",children:"· real time"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),K&&C?F.jsxDEV("details",{className:W?"clock-more inline":"clock-more",open:W||void 0,children:[F.jsxDEV("summary",{children:"Simulate time…"},void 0,!1,void 0,this),F.jsxDEV("div",{className:W?void 0:"popover",children:[F.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),F.jsxDEV("div",{className:"clock-controls",children:[F.jsxDEV("button",{type:"button","aria-expanded":L,onClick:()=>{M(!L),T(v9(aR(C.at))),P(null)},children:"Set time…"},void 0,!1,void 0,this),F.jsxDEV("div",{role:"group","aria-label":"Advance the clock",className:"advance",children:[F.jsxDEV("span",{className:"mode",children:"Advance"},void 0,!1,void 0,this),D.map(([x,E])=>F.jsxDEV("button",{type:"button","aria-label":`Advance ${E}`,disabled:V||!C.frozen,title:C.frozen?void 0:"Set the time first: advancing moves a set clock",onClick:()=>v(x,E),children:E},x,!1,void 0,this)),F.jsxDEV("form",{className:"inline",onSubmit:(x)=>{if(x.preventDefault(),!/^\d+[smhd]$/.test(A.trim())){P({ok:!1,text:"Advance by a number and a unit: 90m, 12h, 3d."});return}v(A.trim(),`by ${A.trim()}`)},children:[F.jsxDEV("label",{className:"sr",children:["Advance by ",F.jsxDEV("input",{name:"advanceBy",value:A,onChange:(x)=>R(x.target.value),placeholder:"90m, 12h, 3d",size:9,disabled:!C.frozen},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("button",{type:"submit",disabled:V||!C.frozen,children:"Advance"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),!C.frozen?F.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,L?F.jsxDEV("form",{className:"inline","aria-label":"Set the World time",onSubmit:N,noValidate:!0,children:[F.jsxDEV("label",{children:["World time ",F.jsxDEV("input",{name:"worldTime",type:"datetime-local",value:O,min:v9(aR(C.at)),onChange:(x)=>T(x.target.value),required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("span",{className:"mode",children:Intl.DateTimeFormat().resolvedOptions().timeZone},void 0,!1,void 0,this),F.jsxDEV("button",{type:"submit",disabled:V,children:"Set time"},void 0,!1,void 0,this),F.jsxDEV("button",{type:"button",onClick:()=>M(!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,w?F.jsxDEV("p",{role:w.ok?"status":"alert",children:w.text},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}function AV({name:Q,token:U,clock:Z,refused:K}){let[H,Y]=F1.useState(!1),[W,L]=F1.useState(""),[M,O]=F1.useState(null),[T,A]=F1.useState(!1),R=Z.state==="ok"?Z.data.at:new Date().toISOString(),w=F1.useRef(null);return F1.useEffect(()=>{if(!H)return;let V=(C)=>{if(C.key==="Escape"&&!document.querySelector("dialog[open]"))Y(!1),w.current?.querySelector("button")?.focus()},S=(C)=>{if(!w.current?.contains(C.target))Y(!1)};return document.addEventListener("keydown",V),document.addEventListener("click",S),()=>{document.removeEventListener("keydown",V),document.removeEventListener("click",S)}},[H]),F.jsxDEV("div",{className:"as-of",ref:w,children:[F.jsxDEV("button",{type:"button","aria-expanded":H,title:"Open a read-only copy of this World as it was at a moment you pick",onClick:()=>{Y(!H),L(v9(R)),O(null)},children:"View an earlier moment…"},void 0,!1,void 0,this),H?F.jsxDEV("form",{className:"inline","aria-label":"View the World as of a past moment",onSubmit:async(V)=>{V.preventDefault(),O(null);let S=new Date(W);if(Number.isNaN(S.getTime())){O("Pick a date and time.");return}if(S.getTime()>Date.parse(R)){O(`That is after the World's present (${new Date(R).toLocaleString()}); a snapshot looks back.`);return}A(!0);try{let C=await O0(U,`/-/${Q}/branches`,{method:"POST",body:JSON.stringify({at:{instant:S.toISOString()},ttl:3600})});if(!C.ok){K(C),O(await T5(C));return}let y=await C.json();ZH({name:y.name,parent:Q,token:y.token,readToken:y.readToken,at:S.toISOString(),expiresAt:y.expiresAt??null,parentOrigin:P0,made:!0});let N=rJ(y.origin)?.origin;if(N&&N!==P0){KH(N,y.readToken,y.name,`${n1}/${y.name}`);return}f0(y.name.split("/"))}catch(C){O(`the World did not answer: ${C instanceof Error?C.message:String(C)}`)}finally{A(!1)}},noValidate:!0,children:[F.jsxDEV("label",{children:["As of ",F.jsxDEV("input",{name:"asOf",type:"datetime-local",value:W,max:v9(R),onChange:(V)=>L(V.target.value),required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("button",{type:"submit",disabled:T,children:T?"Opening…":"Open snapshot"},void 0,!1,void 0,this),F.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,M?F.jsxDEV("p",{role:"alert",children:M},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}function MO({name:Q,token:U,open:Z,onClose:K,onMade:H,refused:Y}){let W=(E)=>E.split("/").pop()??E,[L,M]=F1.useState(!1),[O,T]=F1.useState(null),[A,R]=F1.useState(""),[w,P]=F1.useState("now"),[V,S]=F1.useState(""),[C,y]=F1.useState("24"),[N,v]=F1.useState(!0);F1.useEffect(()=>{if(Z)T(null),S(v9(new Date().toISOString()))},[Z]);let D=async(E)=>{E.preventDefault(),T(null);let u=w==="at"?new Date(V):null;if(u&&Number.isNaN(u.getTime())){T("Pick a date and time, or make it as of now.");return}if(u&&u.getTime()>Date.now()){T("A branch is made as of now or a moment before it.");return}M(!0);let b=await O0(U,`/-/${Q}/branches`,{method:"POST",body:JSON.stringify({ttl:Math.round(Number(C)*3600),...u?{at:{instant:u.toISOString()}}:N?{live:!0}:{},...A.trim()?{label:A.trim()}:{}})}).catch(()=>null);if(M(!1),!b){T(`${P0} did not answer`);return}if(!b.ok){Y(b),T(await T5(b));return}let m=await b.json();ZH({name:m.name,parent:Q,token:m.token??"",readToken:m.readToken,at:(u??new Date).toISOString(),expiresAt:m.expiresAt??null,parentOrigin:P0,...m.origin?{origin:m.origin}:{}}),K(),R(""),e0(`Made ${W(m.name)}`),H()};return F.jsxDEV(E5,{open:Z,onClose:()=>{if(!L)K()},title:`New branch of ${W(Q)}`,footer:F.jsxDEV(F.Fragment,{children:[F.jsxDEV("button",{type:"button",onClick:()=>K(),disabled:L,children:"Cancel"},void 0,!1,void 0,this),F.jsxDEV("button",{type:"submit",form:"new-branch",className:"primary",disabled:L,children:L?"Making…":"Make branch"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:F.jsxDEV("form",{id:"new-branch",onSubmit:(E)=>void D(E),className:"stack",children:[F.jsxDEV("label",{children:[F.jsxDEV("span",{children:["Label ",F.jsxDEV("span",{className:"mode",children:"(optional)"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("input",{name:"branchLabel",value:A,onChange:(E)=>R(E.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),F.jsxDEV("fieldset",{className:"choice",children:[F.jsxDEV("legend",{children:"From"},void 0,!1,void 0,this),F.jsxDEV("label",{className:"check",children:[F.jsxDEV("input",{type:"radio",name:"branchWhen",checked:w==="now",onChange:()=>P("now")},void 0,!1,void 0,this)," ",F.jsxDEV("span",{children:"Now: the World as it is"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),w==="now"?F.jsxDEV("label",{className:"check sub",children:[F.jsxDEV("input",{type:"checkbox",name:"branchLive",checked:N,onChange:(E)=>v(E.target.checked)},void 0,!1,void 0,this)," ",F.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,F.jsxDEV("label",{className:"check",children:[F.jsxDEV("input",{type:"radio",name:"branchWhen",checked:w==="at",onChange:()=>P("at")},void 0,!1,void 0,this)," ",F.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),w==="at"?F.jsxDEV("input",{type:"datetime-local","aria-label":"As of",value:V,max:v9(new Date().toISOString()),onChange:(E)=>S(E.target.value)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),F.jsxDEV("label",{children:[F.jsxDEV("span",{children:"Goes away after"},void 0,!1,void 0,this),F.jsxDEV("select",{name:"branchLife",value:C,onChange:(E)=>y(E.target.value),children:[F.jsxDEV("option",{value:"1",children:"1 hour"},void 0,!1,void 0,this),F.jsxDEV("option",{value:"24",children:"1 day"},void 0,!1,void 0,this),F.jsxDEV("option",{value:"72",children:"3 days"},void 0,!1,void 0,this),F.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),O?F.jsxDEV("p",{role:"alert",children:O},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function MV({name:Q,token:U,canWrite:Z,branches:K,opens:H,open:Y,onChanged:W,refused:L,snapshotOf:M}){let O=y0(U,`/-/${Q}/clock`),T=(y)=>y.split("/").pop()??y,[A,R]=F1.useState(!1),w=(y)=>(N)=>{N.preventDefault(),f0([...Q.split("/"),"~","branches",...y?y.split("/"):[]])};if(!K)return F.jsxDEV("p",{className:"mode",children:"This host makes no branches of a World."},void 0,!1,void 0,this);let P=K.state==="ok"?K.data.branches:[],V=K.state==="ok"&&(K.data.named?.length??0)>0?K.data.named:[{name:T(Q),running:!0}],S=K.state==="ok"?K.data.checkedOut??T(Q):T(Q),C=async(y)=>{if(!await n4({title:`Remove the branch ${T(y)}?`,body:"Whoever holds its tokens loses it, and its history goes with it.",action:"Remove branch",danger:!0}))return;let N=await O0(U,`/-/${Q}/branches/${y}`,{method:"DELETE"}).catch((v)=>v);if(N instanceof Error){e0(`Remove ${T(y)}: the World did not answer (${N.message})`,"error");return}if(!N.ok){L(N),e0(`Remove ${T(y)}: ${await T5(N)}`,"error");return}YU(y),e0(`Removed ${T(y)}`),W(),f0([...Q.split("/"),"~","branches"])};if(Y){let y=Y.includes("/")?P.find((v)=>v.name===Y):void 0,N=Y.includes("/")?void 0:V.find((v)=>v.name===Y);return F.jsxDEV(F.Fragment,{children:[F.jsxDEV("p",{className:"crumbs-line",children:F.jsxDEV("a",{href:`${n1}/${Q}/~/branches`,onClick:w(),children:"← Branches"},void 0,!1,void 0,this)},void 0,!1,void 0,this),F.jsxDEV(r2,{load:K,what:"the branches"},void 0,!1,void 0,this),K.state==="ok"&&!y&&!N?F.jsxDEV("p",{className:"mode",children:["This World has no branch named ",Y,"."]},void 0,!0,void 0,this):null,y?F.jsxDEV(TV,{name:Q,b:y,canWrite:Z,opens:H(y.name),remove:()=>void C(y.name)},void 0,!1,void 0,this):null,N&&!y?F.jsxDEV(RV,{name:Q,token:U,b:N,served:N.name===S,canWrite:Z,canServe:K.state==="ok"&&Boolean(K.data.canServe)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}return F.jsxDEV("div",{"aria-labelledby":"branches",children:[F.jsxDEV("div",{className:"branches-head",children:[F.jsxDEV("p",{className:"lede",children:["Branch this World to look at it as it was, or to change it without touching ",F.jsxDEV("b",{children:S},void 0,!1,void 0,this),". Each branch's name opens its page."]},void 0,!0,void 0,this),Z?F.jsxDEV("div",{className:"head-actions",children:[M?null:F.jsxDEV(AV,{name:Q,token:U,clock:O,refused:L},void 0,!1,void 0,this),F.jsxDEV("button",{type:"button",className:"primary",onClick:()=>R(!0),children:"New branch"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),F.jsxDEV(r2,{load:K,what:"the branches"},void 0,!1,void 0,this),K.state==="ok"?F.jsxDEV("div",{className:"block",children:F.jsxDEV("table",{className:"dense","aria-label":"Branches",children:[F.jsxDEV("thead",{children:F.jsxDEV("tr",{children:[F.jsxDEV("th",{id:"branches",children:"Branch"},void 0,!1,void 0,this),F.jsxDEV("th",{children:"Parent"},void 0,!1,void 0,this),F.jsxDEV("th",{children:"As of"},void 0,!1,void 0,this),F.jsxDEV("th",{children:"Made"},void 0,!1,void 0,this),F.jsxDEV("th",{children:"Goes away"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("tbody",{children:[V.map((y)=>F.jsxDEV("tr",{children:[F.jsxDEV("td",{children:[F.jsxDEV("a",{href:`${n1}/${Q}/~/branches/${y.name}`,onClick:w(y.name),children:F.jsxDEV("b",{children:y.name},void 0,!1,void 0,this)},void 0,!1,void 0,this),y.name===S?F.jsxDEV(F.Fragment,{children:[" ",F.jsxDEV("span",{className:"badge live",children:"served here"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):y.running?null:F.jsxDEV(F.Fragment,{children:[" ",F.jsxDEV("span",{className:"badge",children:"stopped"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("td",{className:"mode",children:"—"},void 0,!1,void 0,this),F.jsxDEV("td",{className:"mode",children:"live"},void 0,!1,void 0,this),F.jsxDEV("td",{className:"mode",children:"—"},void 0,!1,void 0,this),F.jsxDEV("td",{className:"mode",children:"kept"},void 0,!1,void 0,this)]},`own:${y.name}`,!0,void 0,this)),P.map((y)=>F.jsxDEV("tr",{children:[F.jsxDEV("td",{children:F.jsxDEV("a",{href:`${n1}/${Q}/~/branches/${y.name}`,onClick:w(y.name),children:F.jsxDEV("b",{children:T(y.name)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("td",{children:T(y.from??Q)},void 0,!1,void 0,this),F.jsxDEV("td",{children:y.at?.instant?F.jsxDEV(j0,{iso:y.at.instant},void 0,!1,void 0,this):F.jsxDEV("span",{className:"mode",children:"live"},void 0,!1,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("td",{children:F.jsxDEV(j0,{iso:y.createdAt},void 0,!1,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("td",{children:y.expiresAt?F.jsxDEV(j0,{iso:y.expiresAt},void 0,!1,void 0,this):"kept"},void 0,!1,void 0,this)]},y.name,!0,void 0,this))]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this):null,F.jsxDEV(MO,{name:Q,token:U,open:A,onClose:()=>R(!1),onMade:W,refused:L},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function TV({name:Q,b:U,canWrite:Z,opens:K,remove:H}){let Y=(M)=>M.split("/").pop()??M,W=FH(U.name),L=y0(W,W?`/-/${U.name}/diff`:null);return F.jsxDEV("div",{className:"branch-page",children:[F.jsxDEV("div",{className:"changeset-head",children:[F.jsxDEV("h3",{children:[AO," ",Y(U.name)]},void 0,!0,void 0,this),F.jsxDEV("div",{className:"changeset-actions",children:[K?F.jsxDEV("button",{type:"button",className:"primary",onClick:()=>YO(U.name,U.name.split("/")),children:"Open"},void 0,!1,void 0,this):null,Z?F.jsxDEV("button",{type:"button",className:"danger-button",onClick:H,children:"Remove…"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("div",{className:"block",children:F.jsxDEV("dl",{className:"fields pad",children:[F.jsxDEV("dt",{children:"Name"},void 0,!1,void 0,this),F.jsxDEV("dd",{children:F.jsxDEV("code",{children:U.name},void 0,!1,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("dt",{children:"Parent"},void 0,!1,void 0,this),F.jsxDEV("dd",{children:Y(U.from??Q)},void 0,!1,void 0,this),F.jsxDEV("dt",{children:"As of"},void 0,!1,void 0,this),F.jsxDEV("dd",{children:U.at?.instant?F.jsxDEV(j0,{iso:U.at.instant},void 0,!1,void 0,this):"live: it keeps its parent's time"},void 0,!1,void 0,this),F.jsxDEV("dt",{children:"Made"},void 0,!1,void 0,this),F.jsxDEV("dd",{children:F.jsxDEV(j0,{iso:U.createdAt},void 0,!1,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("dt",{children:"Goes away"},void 0,!1,void 0,this),F.jsxDEV("dd",{children:U.expiresAt?F.jsxDEV(j0,{iso:U.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),!K?F.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,L.state==="ok"?F.jsxDEV(F.Fragment,{children:[F.jsxDEV("h4",{children:"Its changes"},void 0,!1,void 0,this),L.data.changes.length===0?F.jsxDEV("p",{className:"mode",children:"Nothing written on it since it branched."},void 0,!1,void 0,this):F.jsxDEV(DV,{changes:L.data.changes,idPrefix:`branch-${Y(U.name)}`},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)}function RV({name:Q,token:U,b:Z,served:K,canWrite:H,canServe:Y}){let[W,L]=F1.useState(!1),[M,O]=F1.useState(null),T=async()=>{L(!0),O(null);let A=await O0(U,`/-/${Q}/branches/${encodeURIComponent(Z.name)}/serve`,{method:"POST"}).catch(()=>null);if(A?.ok){location.reload();return}L(!1),O(A?await T5(A):`${P0} did not answer`)};return F.jsxDEV("div",{className:"branch-page",children:[F.jsxDEV("div",{className:"changeset-head",children:[F.jsxDEV("h3",{children:[AO," ",Z.name," ",K?F.jsxDEV("span",{className:"badge live",children:"served here"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),F.jsxDEV("div",{className:"changeset-actions",children:H&&Y&&!K?F.jsxDEV("button",{type:"button",className:"primary",disabled:W,onClick:()=>void T(),children:W?"Switching…":"Serve here"},void 0,!1,void 0,this):null},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("div",{className:"block",children:F.jsxDEV("dl",{className:"fields pad",children:[F.jsxDEV("dt",{children:"Name"},void 0,!1,void 0,this),F.jsxDEV("dd",{children:F.jsxDEV("code",{children:Z.name},void 0,!1,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("dt",{children:"Kind"},void 0,!1,void 0,this),F.jsxDEV("dd",{children:"one of this World's own branches"},void 0,!1,void 0,this),F.jsxDEV("dt",{children:"State"},void 0,!1,void 0,this),F.jsxDEV("dd",{children:Z.running?"running":"stopped"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),K?F.jsxDEV("p",{className:"mode",children:["This is the branch these pages show: its changes are on ",F.jsxDEV("a",{href:`${n1}/${Q}/~/changes`,onClick:(A)=>{A.preventDefault(),f0([...Q.split("/"),"~","changes"])},children:"Changes"},void 0,!1,void 0,this),"."]},void 0,!0,void 0,this):Y?F.jsxDEV("p",{className:"mode",children:["“Serve here” stops this one's twins and serves ",Z.name," in its place."]},void 0,!0,void 0,this):F.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),M?F.jsxDEV("p",{role:"alert",children:M},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}var nR=50,S9=(Q)=>`${Q.twin}:${Q.position}`,TO=(Q,U)=>Date.parse(U.entry.occurredAt)-Date.parse(Q.entry.occurredAt)||Q.twin.localeCompare(U.twin)||U.position-Q.position,zU=(Q)=>{if(!Q)return"someone";if(Q.startsWith("key:")){let[U,Z]=Q.slice(4).split(" for:");return Z?`${U}, for ${Z}`:U||"a key"}if(Q.startsWith("person:"))return Q.slice(7);return Q==="machine"?"this machine":Q==="person"?"a session with no name":Q==="token:read"?"the read-only token":Q==="token"?"the World's token":Q},dJ=(Q,U)=>{let Z=typeof U==="string"?U:typeof Q.caller==="string"?Q.caller:"";if(Z.startsWith("key:")&&Z.length>4)return`by ${zU(Z)}`;if(Z.startsWith("person:")&&Z.length>7)return`by ${Z.slice(7)}`;if(Z==="machine")return"by this machine";if(Z==="person")return"by a session with no name";if(Z==="key")return"by a key";if(Z==="token:read")return"by the read-only token";if(Z==="token")return"by the World's token";return Q.actor?.kind==="system"?"by the vendor":Q.actor?.id?`by ${Q.actor.id}`:"by an app"},RO=(Q)=>Q.operation??Q.op;function OV(Q){let U=Q.fields??{},Z=U.usage!==null&&typeof U.usage==="object"?U.usage:U,K=(...O)=>O.map((T)=>Z[T]??U[T]).find((T)=>typeof T==="number"),H=[],Y=K("prompt_tokens","input_tokens"),W=K("completion_tokens","output_tokens"),L=K("total_tokens");if(Y!==void 0)H.push(["tokens in",Y.toLocaleString()]);if(W!==void 0)H.push(["tokens out",W.toLocaleString()]);if(L!==void 0)H.push(["tokens in all",L.toLocaleString()]);let M=K("cost_usd","cost");if(M!==void 0)H.push(["cost",`$${M<0.01?M.toPrecision(2):M.toFixed(2)}`]);return H}function OO({text:Q,at:U=280}){if(Q.length<=U)return F.jsxDEV("span",{className:"text",children:Q},void 0,!1,void 0,this);return F.jsxDEV("details",{className:"folded",children:[F.jsxDEV("summary",{children:[F.jsxDEV("span",{className:"text",children:[Q.slice(0,U),"…"]},void 0,!0,void 0,this)," ",F.jsxDEV("span",{className:"mode",children:["show all ",Q.length.toLocaleString()," characters"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("span",{className:"text",children:Q},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function d3({v:Q}){if(typeof Q==="string")return F.jsxDEV(OO,{text:Q},void 0,!1,void 0,this);if(Q===null||typeof Q!=="object")return F.jsxDEV("code",{children:String(Q)},void 0,!1,void 0,this);let U=JSON.stringify(Q,null,2);return U.length<=160?F.jsxDEV("code",{children:JSON.stringify(Q)},void 0,!1,void 0,this):F.jsxDEV("details",{className:"folded",children:[F.jsxDEV("summary",{children:F.jsxDEV("code",{children:[JSON.stringify(Q).slice(0,120),"…"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("pre",{children:U},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var IV=(Q)=>typeof Q==="string"?Q:Array.isArray(Q)?Q.map((U)=>U&&typeof U==="object"&&typeof U.text==="string"?U.text:"").filter(Boolean).join(`
|
|
249
|
-
`):JSON.stringify(Q??"");function wV({body:Q}){if(Q===null||typeof Q!=="object"||Array.isArray(Q))return F.jsxDEV(d3,{v:Q},void 0,!1,void 0,this);let U=Q,Z=Array.isArray(U.messages)?U.messages:null,K=Object.entries(U).filter(([H])=>!(Z&&H==="messages"));return F.jsxDEV(F.Fragment,{children:[K.length?F.jsxDEV("dl",{className:"fields",children:K.map(([H,Y])=>F.jsxDEV(F1.default.Fragment,{children:[F.jsxDEV("dt",{children:H},void 0,!1,void 0,this),F.jsxDEV("dd",{children:F.jsxDEV(d3,{v:Y},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},H,!0,void 0,this))},void 0,!1,void 0,this):null,Z?F.jsxDEV("ol",{className:"messages",children:Z.map((H,Y)=>F.jsxDEV("li",{children:[F.jsxDEV("span",{className:"role",children:typeof H.role==="string"?H.role:"message"},void 0,!1,void 0,this),F.jsxDEV(OO,{text:IV(H.content)},void 0,!1,void 0,this)]},Y,!0,void 0,this))},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}function IO({fields:Q}){let U=Object.entries(Q??{});if(U.length===0)return F.jsxDEV("p",{className:"mode",children:"No fields."},void 0,!1,void 0,this);return F.jsxDEV("dl",{className:"fields",children:U.map(([Z,K])=>F.jsxDEV(F1.default.Fragment,{children:[F.jsxDEV("dt",{children:Z},void 0,!1,void 0,this),F.jsxDEV("dd",{children:F.jsxDEV(d3,{v:K},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},Z,!0,void 0,this))},void 0,!1,void 0,this)}var PV=(Q)=>Q.receipt?`${Q.receipt.status??""}${Q.receipt.externalId?` · ${Q.receipt.externalId}`:""}${Q.receipt.reason?` · ${Q.receipt.reason}`:""}`:Q.operation==="observed"?"observed from the vendor":Q.provenance==="placeholder"?"default data":"none: it has not left this World";function NV(Q){let U=new Map,Z=[],K=[],H=new Map;for(let Y of Q){if(Y.entry.landsId||Y.entry.aliasOf){K.push(Y);continue}let W={...Y,copies:[]};if(Z.push(W),!U.has(`${Y.twin}:${Y.entry.id}`))U.set(`${Y.twin}:${Y.entry.id}`,W);if(!H.has(`${Y.twin}:${Y.entry.subject.type}:${Y.entry.subject.id}`))H.set(`${Y.twin}:${Y.entry.subject.type}:${Y.entry.subject.id}`,W)}for(let Y of K){let W=Y.entry.landsId?U.get(`${Y.twin}:${Y.entry.landsId}`):Y.entry.aliasOf?H.get(`${Y.twin}:${Y.entry.subject.type}:${Y.entry.aliasOf}`):void 0;if(W)W.copies.push(Y);else Z.push({...Y,copies:[]})}return Z.sort(TO)}var $H={deployed:5,confirmed:4,landed:3,replayed:2,skipped:1};function eR(Q){let U=[Q.entry.receipt,...Q.copies.map((H)=>H.entry.receipt)].filter((H)=>Boolean(H?.status));if(U.length===0)return null;let Z=U.find((H)=>H.status==="failed"||H.status==="refused"),K=[...U].sort((H,Y)=>($H[Y.status]??0)-($H[H.status]??0))[0];return Z&&!($H[K.status]>=5)?{status:Z.status,bad:!0}:{status:K.status,bad:!1}}var R4=1280,U3=820,KU=160,$4=72,UH=120,CV=72,J2=(Q)=>`${Q.vendor}:${Q.id}`,_7=(Q)=>`${Q.vendor}:section:${Q.section.id}`,Q7=(Q)=>[Q.section.id,...Q.section.aka??[]].map((U)=>`${Q.vendor}:section:${U}`),wO=(Q,U)=>U.at&&("site"in U.at)?U.at.site:U.at?`${c3}/${Q}/${U.vendor}${U.at.screen}`:null,_O=(Q,U)=>Q.include?U.filter((Z)=>Q.include.includes(J2(Z))||Q7(Z).some((K)=>Q.include.includes(K))):U.filter((Z)=>!(Q.hidden??[]).includes(J2(Z)));function fV({data:Q}){let{frame:U,url:Z,active:K,picked:H,boards:Y,addTo:W,remove:L,compare:M}=Q,O=J2(U),T=Y.filter((R)=>R.include&&!R.include.includes(O)&&!Q7(U).some((w)=>R.include.includes(w))),A=L0((R)=>R.transform[2]*($4+UH)>=CV);return F.jsxDEV(F.Fragment,{children:[F.jsxDEV(_H,{isVisible:A||H||K,position:E1.Top,align:"start",className:"frame-label",children:[F.jsxDEV(q2,{vendor:U.vendor},void 0,!1,void 0,this),F.jsxDEV("span",{children:U.title},void 0,!1,void 0,this),U.changes?F.jsxDEV("button",{type:"button",className:"frame-changed nodrag",onClick:()=>M(O),title:`${l0(U.changes,"change")} here, not in a changeset: compare before and now`,children:[F.jsxDEV(Z0,{name:"square-dot",size:14},void 0,!1,void 0,this),U.changes]},void 0,!0,void 0,this):H?F.jsxDEV("button",{type:"button",className:"ghost nodrag",onClick:()=>M(O),title:"Compare with a branch of this World","aria-label":`Compare ${U.title} with a branch`,children:F.jsxDEV(Z0,{name:"file-diff",size:14},void 0,!1,void 0,this)},void 0,!1,void 0,this):null,H&&T.length?F.jsxDEV("select",{className:"nodrag frame-add",value:"","aria-label":`Add ${U.title} to a board`,onChange:(R)=>{if(R.target.value)W(R.target.value,O)},children:[F.jsxDEV("option",{value:"",children:"Add to board…"},void 0,!1,void 0,this),T.map((R)=>F.jsxDEV("option",{value:R.id,children:R.name},R.id,!1,void 0,this))]},void 0,!0,void 0,this):null,H&&L?F.jsxDEV("button",{type:"button",className:"ghost nodrag",onClick:()=>L.act(O),title:L.label,"aria-label":L.label,children:"✕"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),F.jsxDEV("div",{className:K?"frame on":H?"frame picked":"frame",style:{width:R4,height:U3},children:[F.jsxDEV("div",{className:"frame-bar",children:[F.jsxDEV(q2,{vendor:U.vendor},void 0,!1,void 0,this),F.jsxDEV("strong",{children:[s1(U.vendor)," · ",U.kind]},void 0,!0,void 0,this),F.jsxDEV("span",{className:"frame-url",children:U.url.replace(/^https?:\/\//,"")},void 0,!1,void 0,this),Z?F.jsxDEV("a",{className:"nodrag",href:Z,target:"_blank",rel:"noopener noreferrer","aria-label":`Open ${U.title} in a new tab`,children:"↗"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),F.jsxDEV("div",{className:K?"frame-body nodrag nopan nowheel":"frame-body",children:Z?F.jsxDEV("iframe",{title:U.title,src:Z,loading:"lazy",style:{pointerEvents:K?"auto":"none"}},void 0,!1,void 0,this):F.jsxDEV("div",{className:"frame-none",children:[F.jsxDEV("p",{children:F.jsxDEV("strong",{children:U.unseen==="sites-not-routed"?`This World shows ${U.title} only at its own local address.`:`${s1(U.vendor)}'s twin draws no page for this ${U.kind} yet.`},void 0,!1,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("p",{className:"mode",children:U.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 PO({name:Q,label:U,done:Z}){let K=F1.useRef(!1),H=(Y)=>{if(K.current)return;K.current=!0,Z(Y?.trim()&&Y.trim()!==Q?Y.trim().slice(0,80):null)};return F.jsxDEV("input",{className:"nodrag nopan name-field","aria-label":U,defaultValue:Q,size:Math.max(8,Q.length+2),autoFocus:!0,onFocus:(Y)=>Y.currentTarget.select(),onKeyDown:(Y)=>{if(Y.key==="Enter")H(Y.currentTarget.value);else if(Y.key==="Escape")H(null)},onBlur:(Y)=>H(Y.currentTarget.value)},void 0,!1,void 0,this)}function SV({data:Q}){return F.jsxDEV(F.Fragment,{children:[F.jsxDEV(dR,{isVisible:Q.picked&&Q.editable,minWidth:480,minHeight:360,color:"var(--accent)",onResizeEnd:Q.resized},void 0,!1,void 0,this),F.jsxDEV(_H,{isVisible:!0,position:E1.Top,align:"start",offset:-30,className:"section-tag",children:[Q.renaming?F.jsxDEV(PO,{name:Q.name,label:"Name this section",done:(U)=>Q.renamed(Q.key,U)},void 0,!1,void 0,this):F.jsxDEV("button",{type:"button",className:Q.picked?"nodrag on":"nodrag",onClick:()=>Q.pick(Q.key),onDoubleClick:()=>{if(Q.editable)Q.rename(Q.key)},title:Q.editable?"Double-click to rename":void 0,children:[Q.vendor?F.jsxDEV(q2,{vendor:Q.vendor},void 0,!1,void 0,this):null,F.jsxDEV("span",{children:Q.name},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Q.picked&&Q.editable&&!Q.renaming?F.jsxDEV("button",{type:"button",className:"ghost nodrag",onClick:()=>Q.remove(Q.key),"aria-label":`Remove the section ${Q.name}`,title:"Remove the section (its frames stay)",children:"✕"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),F.jsxDEV("div",{className:Q.picked?"section-box on":"section-box"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function JO({url:Q,title:U}){return F.jsxDEV("div",{className:"compare-thumb",style:{width:420,height:420*U3/R4},children:F.jsxDEV("iframe",{title:U,src:Q,loading:"lazy",style:{width:R4,height:U3,transform:`scale(${420/R4})`}},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function vV({name:Q,token:U,frame:Z,onClose:K,reads:H}){let[Y,W]=F1.useState(Z.since?"before":""),[L,M]=F1.useState({state:"opening"}),[O,T]=F1.useState(null),A=F1.useRef(new Set),R=y0(U,`/-/${Q}/branches`,H),w=R.state==="ok"?R.data.branches.filter((y)=>y.name!==O&&!A.current.has(y.name)):[],P=y0(U,`/-/${Q}/board/changes?frame=${encodeURIComponent(J2(Z))}`,H),V=async(y,N,v)=>{let D=Z.at;if("site"in D){let u=new URL(Z.url),b=N&&/^https?:\/\/\{host\}\./.test(N)?N.replace("{host}",u.hostname.toLowerCase()):null;return b?{url:`${b}${u.pathname}${u.search}`}:{why:"This World shows its branches' sites only on this machine."}}let x=`${c3}/-/${Q}/branches/${y}/pages?${new URLSearchParams({land:`/${y}/${Z.vendor}${D.screen}`}).toString()}`,E=await fetch(x,{credentials:"same-origin",redirect:"manual"}).catch(()=>null);if(v())return{why:""};return E?.type==="opaqueredirect"?{url:x}:{why:`This World does not show its branches' pages${E?`: ${await T5(E)}`:""}.`}};F1.useEffect(()=>{if(!Z.at){M({state:"none",why:`${s1(Z.vendor)}'s twin draws no page for this ${Z.kind} yet; its changes are listed below.`});return}if(Y===""){M({state:"none",why:"Choose a branch of this World to set beside it."});return}let y=!1;if(Y!=="before"){M({state:"opening"});let u=R.state==="ok"?R.data.branches.find((m)=>m.name===Y):void 0,b=setTimeout(()=>void V(Y,u?.sites??null,()=>y).then((m)=>{if(!y)M("url"in m?{state:"ok",url:m.url}:{state:"none",why:m.why})}),300);return()=>{y=!0,clearTimeout(b)}}if(!Z.since){M({state:"none",why:"Nothing here has changed since the World was last cut."});return}M({state:"opening"});let N=new Date(Date.parse(Z.since)-1).toISOString(),v=null,D=setTimeout(()=>void(async()=>{let u=await O0(U,`/-/${Q}/branches`,{method:"POST",body:JSON.stringify({at:{instant:N},ttl:3600}),signal:AbortSignal.timeout(60000)}).catch(()=>null);if(!u?.ok){M({state:"none",why:`The World made no copy of itself as it was then${u?`: ${await T5(u)}`:""}.`});return}let b=await u.json();if(v=b.name,T(b.name),A.current.add(b.name),y){O0(U,`/-/${Q}/branches/${b.name}`,{method:"DELETE"}).catch(()=>null);return}let m=await V(b.name,b.sites??null,()=>y);if(!y)M("url"in m?{state:"ok",url:m.url,at:N}:{state:"none",why:m.why})})(),500),x=()=>{if(v)O0(U,`/-/${Q}/branches/${v}`,{method:"DELETE",keepalive:!0}).catch(()=>null);v=null},E=(u)=>{if(!u.persisted)x()};return window.addEventListener("pagehide",E),()=>{y=!0,clearTimeout(D),window.removeEventListener("pagehide",E),x(),T(null)}},[Q,U,Z.vendor,Z.id,Z.since,Y]);let S=wO(Q,Z),C=!Z.at||Y!==""?null:R.state==="ok"&&w.length===0?"This World has no branches to set beside it: make one under Branches.":R.state==="error"?`The World's branches could not be read: ${R.error}`:null;return F.jsxDEV("div",{className:"compare",role:"dialog","aria-label":`Changes to ${Z.title}`,children:[F.jsxDEV("div",{className:"compare-head",children:[F.jsxDEV(q2,{vendor:Z.vendor},void 0,!1,void 0,this),F.jsxDEV("strong",{children:Z.title},void 0,!1,void 0,this),F.jsxDEV("span",{className:"mode",children:Z.changes?`${l0(Z.changes,"change")} not yet cut${Z.since?`, since ${b8(Z.since)}`:""}`:"No changes here not yet cut"},void 0,!1,void 0,this),Z.at?F.jsxDEV("label",{className:"compare-base",children:["Compare with"," ",F.jsxDEV("select",{value:Y,onChange:(y)=>W(y.target.value),children:[Y===""?F.jsxDEV("option",{value:"",children:"Choose a branch…"},void 0,!1,void 0,this):null,Z.since||Y==="before"?F.jsxDEV("option",{value:"before",children:"Before these changes"},void 0,!1,void 0,this):null,Y&&Y!=="before"&&!w.some((y)=>y.name===Y)?F.jsxDEV("option",{value:Y,children:Y.split("/")[1]},void 0,!1,void 0,this):null,w.map((y)=>F.jsxDEV("option",{value:y.name,children:[y.name.split("/")[1],y.at?.label?` (${y.at.label})`:y.at?.instant?` (as of ${b8(y.at.instant)})`:y.at?.live?" (live)":""]},y.name,!0,void 0,this))]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null,F.jsxDEV("button",{type:"button",className:"ghost",onClick:K,"aria-label":"Close the comparison",children:"✕"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("div",{className:"compare-sides",children:[F.jsxDEV("figure",{children:[F.jsxDEV("figcaption",{children:Y==="before"?`Before${L.state==="ok"&&L.at?` · as of ${b8(L.at)}`:""}`:Y?Y.split("/")[1]:"A branch"},void 0,!1,void 0,this),C?F.jsxDEV("p",{className:"mode compare-note",children:C},void 0,!1,void 0,this):L.state==="ok"?F.jsxDEV(JO,{url:L.url,title:`${Z.title} before`},void 0,!1,void 0,this):L.state==="opening"?F.jsxDEV("p",{className:"mode compare-note",role:"status",children:"Opening the World as it was…"},void 0,!1,void 0,this):F.jsxDEV("p",{className:"mode compare-note",children:L.why},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("figure",{children:[F.jsxDEV("figcaption",{children:"Now"},void 0,!1,void 0,this),S?F.jsxDEV(JO,{url:S,title:`${Z.title} now`},void 0,!1,void 0,this):F.jsxDEV("p",{className:"mode compare-note",children:[s1(Z.vendor),"'s twin draws no page for this ",Z.kind," yet."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),P.state==="error"?F.jsxDEV("p",{role:"alert",className:"mode",children:["Its changes could not be read: ",P.error]},void 0,!0,void 0,this):null,Y!=="before"&&Y&&P.state==="ok"&&P.data.acts.length?F.jsxDEV("p",{className:"mode compare-acts-head",children:"This World's own changes here, not yet cut:"},void 0,!1,void 0,this):null,F.jsxDEV("ol",{className:"compare-acts",children:(P.state==="ok"?P.data.acts:[]).map((y)=>{let N=y.entries[0],v=Q4({...N,service:Z.vendor,id:"",occurredAt:y.at});return F.jsxDEV("li",{children:[F.jsxDEV("span",{className:"mode",children:b8(y.at)},void 0,!1,void 0,this),F.jsxDEV("details",{children:[F.jsxDEV("summary",{children:[F.jsxDEV("strong",{children:v.what},void 0,!1,void 0,this),v.label?` · ${v.label}`:"",y.writes>1?F.jsxDEV("span",{className:"mode",children:[" and ",l0(y.writes-1,"more write")]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),F.jsxDEV("ul",{children:[y.entries.map((D,x)=>F.jsxDEV("li",{children:[F.jsxDEV("code",{children:D.operation??D.op},void 0,!1,void 0,this)," ",F.jsxDEV("span",{className:"mode",children:[D.subject.type," ",i3(D)]},void 0,!0,void 0,this)]},x,!0,void 0,this)),y.writes>y.entries.length?F.jsxDEV("li",{className:"mode",children:["and ",l0(y.writes-y.entries.length,"more write")]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},`${y.at}:${N.subject.type}:${N.subject.id}`,!0,void 0,this)})},void 0,!1,void 0,this),P.state==="ok"&&P.data.total>P.data.acts.length?F.jsxDEV("p",{className:"mode",children:["and ",l0(P.data.total-P.data.acts.length,"earlier change"),", in Changes"]},void 0,!0,void 0,this):null,F.jsxDEV("a",{className:"compare-all",href:`${n1}/${Q}/~/changes`,onClick:(y)=>{y.preventDefault(),f0([...Q.split("/"),"~","changes"])},children:"Every change in the World →"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var jV={screen:fV,section:SV};function VV(Q){return F.jsxDEV(eK,{children:F.jsxDEV(yV,{...Q},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function yV({name:Q,token:U,session:Z,retry:K,snapshot:H,back:Y,canWrite:W}){let L=F1.useRef(null),M=F1.useRef(0),O=F1.useRef(Promise.resolve()),T=F1.useRef(0),[,A]=F1.useState(0),[R,w]=F1.useState({state:"loading"}),[P,V]=F1.useState(null),[S,C]=F1.useState(0),y=F1.useRef(0),N=F1.useRef(0),v=F1.useCallback(async()=>{let $1=T.current,B1=++y.current,v1=await O0(U,`/-/${Q}/board`,{signal:AbortSignal.timeout(15000)}).catch(()=>null),V1=v1?.ok?await v1.json().catch(()=>null):null;if(B1<N.current)return;if(N.current=B1,!V1?.frames||!V1.boards||!V1.version){let Q0=v1?`the World answered ${v1.status}`:"the World did not answer";w((u1)=>u1.state==="ok"?u1:{state:"error",status:v1?.status??0,error:Q0}),V(Q0);return}if(V(null),C((Q0)=>Q0+1),$1===T.current&&M.current===0)L.current={boards:V1.boards,version:V1.version};w({state:"ok",data:V1})},[U,Q]);F1.useEffect(()=>{v();let $1=setInterval(()=>{if(!document.hidden)v()},1e4);return()=>clearInterval($1)},[v]);let D=R.state==="ok"?R.data.frames:[],x=L.current?.boards??[{id:"everything",name:"Everything"}],[E,u]=F1.useState(null),b=D.some(($1)=>$1.changes),m=E??(b?"changes":"everything"),s=(m==="changes"?x[0]:x.find(($1)=>$1.id===m))??x[0],[U1,Q1]=F1.useState(new Set),h=W&&!H,g=F1.useCallback(($1)=>{if(!L.current)return e0("The board is being read again: make that change once it shows","error"),Promise.resolve();L.current={...L.current,boards:$1(L.current.boards)},M.current+=1,T.current+=1,A((v1)=>v1+1);let B1=O.current.then(async()=>{let v1=L.current;if(!v1)return;try{let V1=await O0(U,`/-/${Q}/board`,{method:"PUT",body:JSON.stringify({boards:v1.boards,version:v1.version}),signal:AbortSignal.timeout(15000)}),Q0=await V1.json().catch(()=>null);if(V1.ok&&Q0?.boards&&Q0.version)L.current={boards:M.current>1&&L.current?L.current.boards:Q0.boards,version:Q0.version};else if(V1.status===409&&Q0?.boards&&Q0.version)L.current={boards:Q0.boards,version:Q0.version},e0("Someone else changed the board first: it is shown as they left it","error");else throw Error(Q0?.error??`the World answered ${V1.status}`)}catch(V1){e0(`The board was not kept: ${V1 instanceof Error?V1.message:String(V1)}`,"error"),L.current=null;let Q0=await O0(U,`/-/${Q}/board`,{signal:AbortSignal.timeout(15000)}).catch(()=>null),u1=Q0?.ok?await Q0.json().catch(()=>null):null;if(u1?.boards&&u1.version)L.current={boards:u1.boards,version:u1.version}}}).finally(()=>{if(M.current-=1,T.current+=1,A((v1)=>v1+1),M.current===0&&!L.current)v()});return O.current=B1,B1},[U,Q,v]),p=($1,B1)=>{g((v1)=>v1.map((V1)=>V1.id===$1?B1(V1):V1))},c=($1)=>$1.parent?`${$1.vendor}:${$1.parent}`:null,l=new Set(D.map(J2)),o=($1)=>{let B1=c($1);return!B1||!l.has(B1)},k=m==="changes"?D.filter(($1)=>$1.changes):s.include?_O(s,D):_O(s,D).filter(($1)=>o($1)||U1.has(c($1))),t=D.filter(($1)=>$1.changes&&!k.includes($1)).reduce(($1,B1)=>$1+B1.changes,0),[_1,a]=F1.useState(null),[H1,O1]=F1.useState(null),[L1,T1]=F1.useState(null),G1=lJ(),R1=x.filter(($1)=>$1.include),f1=($1,B1)=>p($1,(v1)=>({...v1,include:[...v1.include??[],B1]})),z1={label:s.include?"Take it off this board":"Hide it",act:($1)=>{O1(null),p(s.id,(B1)=>B1.include?{...B1,include:B1.include.filter((v1)=>v1!==$1)}:{...B1,hidden:[...B1.hidden??[],$1]})}},C1=($1)=>({x:$1.position.x,y:$1.position.y,w:$1.width??$1.measured?.width??R4,h:$1.height??$1.measured?.height??U3}),b1=($1,B1)=>{let v1=C1($1),V1=v1.x+v1.w/2,Q0=v1.y+v1.h/2;return B1.filter((u1)=>u1.type==="section").map((u1,m1)=>({s:u1,i:m1})).filter(({s:u1})=>{let m1=C1(u1);return V1>=m1.x&&V1<=m1.x+m1.w&&Q0>=m1.y&&Q0<=m1.y+m1.h}).sort((u1,m1)=>C1(u1.s).w*C1(u1.s).h-C1(m1.s).w*C1(m1.s).h||m1.i-u1.i)[0]?.s},c1=F1.useCallback(()=>{let $1=new Map;for(let J0 of k){let T0=s.placed?.[J2(J0)];if(T0)$1.set(J2(J0),T0)}let B1=Math.max(-KU,...[...$1.values()].map((J0)=>J0.y+U3)),v1=[...new Set(k.map(_7))];for(let J0 of v1){let T0=k.filter((w0)=>_7(w0)===J0),Z2=T0.filter((w0)=>$1.has(J2(w0))).map((w0)=>$1.get(J2(w0))),K0=Z2.length?Math.max(...Z2.map((w0)=>w0.x))+R4+KU:0,S2=Z2.length?Math.min(...Z2.map((w0)=>w0.y)):B1+KU+$4*2+UH;for(let w0 of T0)if(!$1.has(J2(w0)))$1.set(J2(w0),{x:K0,y:S2}),K0+=R4+KU;B1=Math.max(B1,S2+U3)}let V1=s.sections??{},Q0=(J0,T0,Z2,K0,S2)=>({id:`sec:${J0}`,type:"section",position:{x:T0.x,y:T0.y},width:T0.w,height:T0.h,zIndex:0,draggable:h,data:{key:J0,name:Z2,vendor:K0,named:S2}}),u1=[];for(let J0 of v1){let T0=k.find((V0)=>_7(V0)===J0),Z2=Q7(T0).find((V0)=>V1[V0])??J0,K0=V1[Z2];if(K0?.gone)continue;let S2=k.filter((V0)=>_7(V0)===J0).map((V0)=>$1.get(J2(V0))),w0={x:Math.min(...S2.map((V0)=>V0.x))-$4,y:Math.min(...S2.map((V0)=>V0.y))-$4-UH,w:0,h:0};w0.w=Math.max(...S2.map((V0)=>V0.x))+R4+$4-w0.x,w0.h=Math.max(...S2.map((V0)=>V0.y))+U3+$4-w0.y;let Z7=k.filter((V0)=>_7(V0)===J0&&!s.placed?.[J2(V0)]).map((V0)=>$1.get(J2(V0))),K5=K0?{...K0}:w0;if(K0)for(let V0 of Z7)K5.w=Math.max(K5.w,V0.x+R4+$4-K5.x),K5.h=Math.max(K5.h,V0.y+U3+$4-K5.y);u1.push(Q0(Z2,K5,K0?.name??`${s1(T0.vendor)} · ${T0.section.title}`,T0.vendor,Boolean(K0?.name)))}for(let[J0,T0]of Object.entries(V1))if(J0.startsWith("user:")&&!T0.gone)u1.push(Q0(J0,T0,T0.name??"Section",null,!0));let m1=k.map((J0)=>({id:J2(J0),type:"screen",zIndex:1,width:R4,height:U3,draggable:h,position:$1.get(J2(J0)),data:{world:Q,frame:J0,url:wO(Q,J0)}}));return[...u1,...m1]},[JSON.stringify(k),JSON.stringify(s),Q,h]),[k1,A1,e1]=xR([]),D1=L0(($1)=>$1.transform[2]),g0=F1.useRef("");F1.useEffect(()=>{let $1=c1();if(A1($1),$1.length&&g0.current!==m)g0.current=m,requestAnimationFrame(()=>{G1.fitView({padding:{top:"72px",left:"272px",right:"40px",bottom:"72px"},duration:0})})},[c1,A1]);let _0=($1,B1=[],v1={})=>{let V1=Object.fromEntries(B1.map((u1)=>{let m1=G1.getNode(`sec:${u1}`);if(!m1)return[u1,void 0];let J0=C1(m1),T0=m1.data,Z2=v1[u1]??(T0.named?T0.name:void 0);return[u1,{x:Math.round(J0.x),y:Math.round(J0.y),w:Math.round(J0.w),h:Math.round(J0.h),...Z2?{name:Z2.slice(0,80)}:{}}]}).filter(([,u1])=>u1!==void 0)),Q0=Object.fromEntries(Object.entries($1).map(([u1,m1])=>[u1,{x:Math.round(m1.x),y:Math.round(m1.y)}]));p(s.id,(u1)=>({...u1,placed:{...u1.placed??{},...Q0},sections:{...u1.sections??{},...V1}}))},t0=F1.useRef(null),C2=($1,B1)=>{if(B1.type!=="section"){t0.current=null;return}let v1=G1.getNodes(),V1=C1(B1),Q0=(u1)=>{let m1=C1(u1);if(u1.type==="screen"){let J0=m1.x+m1.w/2,T0=m1.y+m1.h/2;return J0>=V1.x&&J0<=V1.x+V1.w&&T0>=V1.y&&T0<=V1.y+V1.h}return u1.id!==B1.id&&m1.x>=V1.x&&m1.y>=V1.y&&m1.x+m1.w<=V1.x+V1.w&&m1.y+m1.h<=V1.y+V1.h};t0.current={id:B1.id,from:{...B1.position},members:v1.filter(Q0).map((u1)=>({id:u1.id,x:u1.position.x,y:u1.position.y}))}},u2=($1,B1)=>{let v1=t0.current;if(!v1||v1.id!==B1.id)return;let V1=B1.position.x-v1.from.x,Q0=B1.position.y-v1.from.y,u1=new Map(v1.members.map((m1)=>[m1.id,m1]));A1((m1)=>m1.map((J0)=>{let T0=u1.get(J0.id);return T0?{...J0,position:{x:T0.x+V1,y:T0.y+Q0}}:J0}))},b2=($1,B1)=>{let v1=t0.current;t0.current=null;let V1=B1.position.x-(v1?.from.x??B1.position.x),Q0=B1.position.y-(v1?.from.y??B1.position.y),u1=B1.type==="screen"?[{id:B1.id,x:B1.position.x,y:B1.position.y}]:(v1?.members??[]).map((m1)=>({...m1,x:m1.x+V1,y:m1.y+Q0}));requestAnimationFrame(()=>{let m1=G1.getNodes(),J0=new Map(u1.filter((K0)=>!K0.id.startsWith("sec:")).map((K0)=>[K0.id,{x:K0.x,y:K0.y}])),T0=new Set([...B1.type==="section"?[B1.data.key]:[],...u1.filter((K0)=>K0.id.startsWith("sec:")).map((K0)=>K0.id.slice(4))]),Z2=new Set(m1.filter((K0)=>J0.has(K0.id)).flatMap((K0)=>Q7(K0.data.frame)));for(let K0 of m1){if(K0.type==="screen"&&Q7(K0.data.frame).some((S2)=>Z2.has(S2))&&!J0.has(K0.id))J0.set(K0.id,{x:K0.position.x,y:K0.position.y});if(K0.type==="section"&&Z2.has(K0.data.key))T0.add(K0.data.key)}_0(Object.fromEntries(J0),[...T0])})},f2=($1)=>Object.fromEntries(G1.getNodes().filter((B1)=>B1.type==="screen"&&Q7(B1.data.frame).includes($1)).map((B1)=>[B1.id,{x:B1.position.x,y:B1.position.y}])),[T2,G2]=F1.useState(null),R2=($1)=>{O1(`sec:${$1}`),G2($1)},I4=($1,B1)=>{if(G2(null),!B1)return;A1((v1)=>v1.map((V1)=>V1.id===`sec:${$1}`?{...V1,data:{...V1.data,name:B1,named:!0}}:V1)),requestAnimationFrame(()=>_0(f2($1),[$1],{[$1]:B1}))},X5=($1)=>{O1(null);let B1=G1.getNode(`sec:${$1}`);p(s.id,(v1)=>{let V1=Object.fromEntries(Object.entries(v1.sections??{}).filter(([Q0])=>Q0!==$1));return{...v1,sections:$1.startsWith("user:")?V1:{...V1,[$1]:{...B1?{x:Math.round(B1.position.x),y:Math.round(B1.position.y),w:Math.round(C1(B1).w),h:Math.round(C1(B1).h)}:{x:0,y:0,w:0,h:0},gone:!0}}}})},x5=()=>{let $1=H1?G1.getNode(H1):void 0,B1=G1.screenToFlowPosition({x:window.innerWidth/2,y:window.innerHeight/2}),v1=$1?.type==="screen"?{x:$1.position.x-$4,y:$1.position.y-$4,w:R4+$4*2,h:U3+$4*2}:{x:B1.x-900,y:B1.y-600,w:1800,h:1200},V1=`user:${Date.now().toString(36)}`,Q0=Object.keys(s.sections??{}).filter((u1)=>u1.startsWith("user:")).length+1;O1(`sec:${V1}`),p(s.id,(u1)=>({...u1,sections:{...u1.sections??{},[V1]:{x:Math.round(v1.x),y:Math.round(v1.y),w:Math.round(v1.w),h:Math.round(v1.h),name:`Section ${Q0}`}}}))},q4=k1.map(($1)=>$1.type==="section"?{...$1,data:{...$1.data,picked:H1===$1.id,editable:h,renaming:h&&T2===$1.data.key,pick:(B1)=>O1(`sec:${B1}`),rename:R2,renamed:I4,remove:X5,resized:()=>requestAnimationFrame(()=>{let B1=$1.data.key;_0(f2(B1),[B1])})}}:{...$1,data:{...$1.data,active:_1===$1.id,picked:H1===$1.id,boards:h?R1:[],addTo:f1,remove:!h||s.include&&!s.include.includes($1.id)?null:z1,compare:(B1)=>{O1(B1),T1(B1)}}});F1.useEffect(()=>{let $1=(B1)=>{if(B1.target?.closest("input, textarea, select, [contenteditable]"))return;if(B1.key==="Escape"){if(_1)a(null);else O1(null);return}if(!h||_1)return;if((B1.key==="Delete"||B1.key==="Backspace")&&H1){if(B1.preventDefault(),H1.startsWith("sec:"))X5(H1.slice(4));else if(!s.include||s.include.includes(H1))z1.act(H1);else e0("It is on this board with its whole group: take the group off in the list to remove it","error");return}if(B1.key==="S"&&B1.shiftKey&&!B1.metaKey&&!B1.ctrlKey)B1.preventDefault(),x5()};return document.addEventListener("keydown",$1),()=>document.removeEventListener("keydown",$1)});let R5=($1)=>{O1($1);let B1=G1.getNode($1);if(!B1)return;let v1=C1(B1);G1.fitBounds({x:v1.x,y:v1.y,width:v1.w,height:v1.h},{padding:0.15,duration:400})},G3=()=>{let $1=`board-${Date.now().toString(36)}`;u($1),g((B1)=>[...B1,{id:$1,name:`Board ${B1.length}`,include:[]}])},O5=()=>G2(`board:${s.id}`),j=()=>{let $1=s.id;u(null),g((B1)=>B1.filter((v1)=>v1.id!==$1))},q1=[...new Map(D.map(($1)=>[_7($1),$1])).values()],I1=s.include?[...q1.filter(($1)=>!Q7($1).some((B1)=>s.include.includes(B1))).map(($1)=>({key:_7($1),label:`${s1($1.vendor)} · ${$1.section.title} (all)`})),...D.filter(($1)=>!k.includes($1)).map(($1)=>({key:J2($1),label:$1.title}))]:[],P1=s.include?[]:D.filter(($1)=>(s.hidden??[]).includes(J2($1))),y1=k1.filter(($1)=>$1.type==="section"),i1=k1.filter(($1)=>$1.type==="screen"),r1=new Map(i1.map(($1)=>[$1.id,b1($1,k1)?.id??null])),F0=new Map;for(let $1 of D){let B1=c($1);if(B1&&l.has(B1))F0.set(B1,(F0.get(B1)??0)+1)}let x1=($1)=>{let B1=$1.data.frame;return F.jsxDEV("li",{children:[F.jsxDEV("button",{type:"button",className:H1===$1.id?"on":void 0,onClick:()=>R5($1.id),onDoubleClick:()=>a($1.id),children:[F.jsxDEV(q2,{vendor:B1.vendor},void 0,!1,void 0,this),F.jsxDEV("span",{children:B1.title},void 0,!1,void 0,this),B1.changes?F.jsxDEV("span",{className:"layer-changed",title:`${l0(B1.changes,"change")}, not in a changeset: its mark on the board compares before and now`,children:[F.jsxDEV(Z0,{name:"square-dot",size:14},void 0,!1,void 0,this),B1.changes]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),F0.get($1.id)&&m!=="changes"&&!s.include?F.jsxDEV("button",{type:"button",className:"ghost layer-open","aria-expanded":U1.has($1.id),onClick:()=>Q1((v1)=>{let V1=new Set(v1);if(V1.has($1.id))V1.delete($1.id);else V1.add($1.id);return V1}),title:U1.has($1.id)?"Close the pages under it":"Open the pages under it",children:[U1.has($1.id)?"−":"+",F0.get($1.id)]},void 0,!0,void 0,this):null]},$1.id,!0,void 0,this)},K2=typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches,E2=Z.state==="ok"&&R.state==="ok";return F.jsxDEV("div",{className:"canvas full",role:"region","aria-label":"The World's board",style:{"--zoom":D1},children:F.jsxDEV(hR,{nodes:E2?q4:[],onNodesChange:e1,nodeTypes:jV,onNodeDragStart:C2,onNodeDrag:u2,onNodeDragStop:b2,onNodeClick:($1,B1)=>{if(B1.id!==_1)O1(B1.id)},onNodeDoubleClick:($1,B1)=>{if(B1.type==="screen")O1(B1.id),a(B1.id)},onPaneClick:()=>{a(null),O1(null)},minZoom:0.03,maxZoom:1.5,nodesConnectable:!1,elementsSelectable:!1,panOnScroll:!0,zoomOnPinch:!0,zoomOnScroll:!1,zoomOnDoubleClick:!1,colorMode:K2?"dark":"light",proOptions:{hideAttribution:!0},children:[F.jsxDEV(gR,{variant:Q3.Dots,gap:28,size:1.4},void 0,!1,void 0,this),F.jsxDEV(q3,{position:"top-left",className:"float layers",children:[F.jsxDEV("div",{className:"float-head",children:[F.jsxDEV("button",{type:"button",className:"back",onClick:Y,"aria-label":`Back to ${Q}`,children:"←"},void 0,!1,void 0,this),F.jsxDEV("span",{className:"float-title",children:[F.jsxDEV("strong",{children:Q.split("/")[1]},void 0,!1,void 0,this),F.jsxDEV("span",{className:"mode",children:[Q.split("/")[0],H?" · snapshot":""]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("div",{className:"board-tabs",role:"tablist","aria-label":"Boards",children:[F.jsxDEV("button",{type:"button",role:"tab","aria-selected":m==="changes",className:m==="changes"?"on":void 0,onClick:()=>{O1(null),a(null),u("changes")},title:"The pages whose records changed and are not yet in a changeset",children:["Changes",b?` (${D.filter(($1)=>$1.changes).length})`:""]},void 0,!0,void 0,this),x.map(($1)=>T2===`board:${$1.id}`?F.jsxDEV(PO,{name:$1.name,label:"Name this board",done:(B1)=>{if(G2(null),B1)p($1.id,(v1)=>({...v1,name:B1}))}},$1.id,!1,void 0,this):F.jsxDEV("button",{type:"button",role:"tab","aria-selected":m!=="changes"&&$1.id===s.id,className:m!=="changes"&&$1.id===s.id?"on":void 0,onClick:()=>{O1(null),a(null),u($1.id)},onDoubleClick:h&&$1.id===s.id&&$1.include?O5:void 0,children:$1.name},$1.id,!1,void 0,this)),h?F.jsxDEV("button",{type:"button",className:"ghost",onClick:G3,"aria-label":"A new board",children:"+"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),s.include&&h?F.jsxDEV("div",{className:"board-acts",children:[F.jsxDEV("button",{type:"button",className:"ghost",onClick:O5,children:"Rename"},void 0,!1,void 0,this),F.jsxDEV("button",{type:"button",className:"ghost",onClick:j,children:"Delete board"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,F.jsxDEV("ul",{className:"layer-list","aria-label":"Layers",children:[y1.map(($1)=>{let B1=$1.data;return F.jsxDEV("li",{children:[F.jsxDEV("button",{type:"button",className:H1===$1.id?"layer-section on":"layer-section",onClick:()=>R5($1.id),onDoubleClick:()=>{if(h)R5($1.id),R2(B1.key)},children:[B1.vendor?F.jsxDEV(q2,{vendor:B1.vendor},void 0,!1,void 0,this):F.jsxDEV(Z0,{name:"layout-grid",size:14},void 0,!1,void 0,this),F.jsxDEV("span",{children:B1.name},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("ul",{className:"layer-list inner",children:i1.filter((v1)=>r1.get(v1.id)===$1.id).map(x1)},void 0,!1,void 0,this)]},$1.id,!0,void 0,this)}),i1.filter(($1)=>!r1.get($1.id)).map(x1)]},void 0,!0,void 0,this),s.include&&!k.length?F.jsxDEV("p",{className:"mode pad-s",children:"An empty board: add frames from Everything, or below."},void 0,!1,void 0,this):null,I1.length&&h?F.jsxDEV("select",{className:"board-add",value:"","aria-label":"Add to this board",onChange:($1)=>{let B1=$1.target.value;if(B1)p(s.id,(v1)=>({...v1,include:[...v1.include??[],B1]}))},children:[F.jsxDEV("option",{value:"",children:"Add to this board…"},void 0,!1,void 0,this),I1.map(($1)=>F.jsxDEV("option",{value:$1.key,children:$1.label},$1.key,!1,void 0,this))]},void 0,!0,void 0,this):null,P1.length?F.jsxDEV("details",{className:"board-hidden",children:[F.jsxDEV("summary",{children:["Hidden (",P1.length,")"]},void 0,!0,void 0,this),F.jsxDEV("ul",{className:"layer-list",children:P1.map(($1)=>F.jsxDEV("li",{children:h?F.jsxDEV("button",{type:"button",onClick:()=>p(s.id,(B1)=>({...B1,hidden:(B1.hidden??[]).filter((v1)=>v1!==J2($1))})),children:[F.jsxDEV("span",{children:$1.title},void 0,!1,void 0,this),F.jsxDEV("span",{className:"mode",children:"Show"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):F.jsxDEV("span",{className:"pad-s",children:$1.title},void 0,!1,void 0,this)},J2($1),!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,t?F.jsxDEV("button",{type:"button",className:"board-elsewhere",onClick:()=>u("changes"),children:[F.jsxDEV(Z0,{name:"square-dot",size:14},void 0,!1,void 0,this),l0(t,"change")," not on this board"]},void 0,!0,void 0,this):null,F.jsxDEV(r2,{load:R,what:"the board"},void 0,!1,void 0,this),P&&R.state==="ok"?F.jsxDEV("p",{role:"alert",className:"pad-s",children:["The board could not be read again (",P,"): it shows what was last read."]},void 0,!0,void 0,this):null,Z.state==="pending"?F.jsxDEV("p",{className:"mode",role:"status",children:"Opening…"},void 0,!1,void 0,this):null,Z.state==="error"?F.jsxDEV("p",{role:"alert",children:["The World did not open its screens: ",Z.error," ",F.jsxDEV("button",{type:"button",onClick:K,children:"Try again"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),_1?F.jsxDEV(q3,{position:"top-center",className:"float hint using",children:[F.jsxDEV("span",{className:"mode",children:["Using ",k.find(($1)=>J2($1)===_1)?.title??_1]},void 0,!0,void 0,this),F.jsxDEV("button",{type:"button",onClick:()=>a(null),children:["Done ",F.jsxDEV("kbd",{children:"Esc"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):F.jsxDEV(q3,{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),h?F.jsxDEV(q3,{position:"bottom-center",className:"float board-tools",children:F.jsxDEV("button",{type:"button",className:"ghost",onClick:x5,title:"Section (⇧S): around the selected frame, else in the middle",children:[F.jsxDEV(Z0,{name:"layout-grid",size:16},void 0,!1,void 0,this),F.jsxDEV("span",{children:"Section"},void 0,!1,void 0,this),F.jsxDEV("kbd",{children:"⇧S"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this):null,L1&&k.some(($1)=>J2($1)===L1)?F.jsxDEV(q3,{position:"top-right",className:"float compare-panel",children:F.jsxDEV(vV,{name:Q,token:U,frame:k.find(($1)=>J2($1)===L1),onClose:()=>T1(null),reads:S},L1,!1,void 0,this)},void 0,!1,void 0,this):null,F.jsxDEV(cR,{showInteractive:!1,position:"bottom-left"},void 0,!1,void 0,this),F.jsxDEV(iR,{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 NO=(Q)=>Q.actions.map((U)=>({twin:U.service,entry:{...U.action,service:U.service,op:U.action.op??U.action.operation??""}})),kV=(Q)=>{let U=Q.action.input??{};return!(typeof U.operationId==="string"||U.graphql!==void 0&&U.graphql!==null)};function LU(Q){let U=Q.actions.filter(kV).length,Z=Q.actions.length-U,K=Q.applied?.receipts??[],H=Q.deployed??[],Y=new Set([...H.filter((M)=>M.status==="deployed"),...K.filter((M)=>M.status==="confirmed")].map((M)=>M.actionId)).size,W=new Set([...H.filter((M)=>M.status==="refused"||M.status==="failed"),...K.filter((M)=>M.status==="failed")].map((M)=>M.actionId)).size,L={performed:Y,failed:W,total:Z,own:U};if(Z>0&&Y>=Z)return{label:"Deployed",tone:"done",...L};if(Y>0)return{label:`Partly deployed: ${Y} of ${Z}`,tone:"warn",...L};if(W>0)return{label:`${W} refused or failed`,tone:"bad",...L};if(K.some((M)=>M.status==="replayed")&&K.every((M)=>M.status==="replayed"||M.status==="skipped"))return{label:"Pushed",tone:"good",...L};return{label:"Not sent",tone:"plain",...L}}var QH=(Q)=>Q.message??Q.narration?.split(`
|
|
248
|
+
`)}var rR={"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 F=s0(u8(),1),HU="volter.console.token",U7=document.getElementById("root"),n1=U7.dataset.base??"/-/console",P0=window.location.origin,c3=(U7.dataset.worlds??P0).replace(/\/+$/,""),QO=(U7.dataset.names??"").split(",").filter((Q)=>Q!==""),p3=U7.dataset.worldOrigin==="1",q7=window.fetch.bind(window),d6="(session)",qO="(pass)",iJ=(Q)=>{try{if(Q&&!p3)sessionStorage.setItem(HU,Q);else sessionStorage.removeItem(HU);localStorage.removeItem(HU)}catch{}},UO="volter.console.portal",GO=(Q)=>{try{if(typeof Q==="string"&&/^https?:$/.test(new URL(Q).protocol))sessionStorage.setItem(UO,new URL(Q).origin)}catch{}},rj=()=>{return G7.get("token")??""},t2=()=>{try{let Q=sessionStorage.getItem(UO)??"";return Q&&/^https?:$/.test(new URL(Q).protocol)?new URL(Q).origin:""}catch{return""}},aj=()=>{let Q=rj();if(p3){if(iJ(""),G7.get("pass"))return qO;let U=new URLSearchParams(window.location.search).has("signin");if(U)try{window.history.replaceState(null,"",window.location.pathname+window.location.hash)}catch{}return Q||(U?"":d6)}if(Q)return iJ(Q),Q;try{return sessionStorage.getItem(HU)??""}catch{return""}};function M2(Q){let U=Q.trim();if(/not ready/i.test(U)&&/(never verified|not verified|no approvals)/i.test(U)){let Y=[],W=[];if(/(never verified|not verified)/i.test(U))Y.push("it is not verified yet"),W.push("verify");if(/no approvals/i.test(U))Y.push("no one has approved it"),W.push("approve");return{text:`Not ready to deploy: ${E8(Y)}.`,acts:W}}let Z=/no credential (?:is )?sealed for ([a-z0-9_-]+)/i.exec(U);if(Z)return{text:`No credential is sealed for ${s1(Z[1])}: seal one in Settings › Vault.`,acts:["vault"]};if(/has no origin/i.test(U))return{text:"This World has no remote: name one in Settings › Remote.",acts:["remote"]};let K=/the ([a-z0-9_-]+) twin has no root/i.exec(U)??/:\s*([a-z0-9_, -]+?) (?:has|have) no root/i.exec(U);if(K){let Y=K[1].split(/,\s*/).filter(Boolean).map(s1);return{text:`${E8(Y)} ${Y.length===1?"is":"are"} not connected to ${Y.length===1?"its":"their"} real service: Settings › Real services.`,acts:["settings"]}}if(/opening a seal is/i.test(U))return{text:"A key cannot seal a credential: open the World as yourself.",acts:[]};if(/a key manages no keys/i.test(U))return{text:"A key cannot manage keys: open the World as yourself.",acts:[]};if(/^PUT origin:/i.test(U))return{text:"That is not a World's address: https://<host>/<org>/<world>",acts:[]};if(/^clock: \{/i.test(U))return{text:"Pick a date and time.",acts:[]};if(/^advance: \{/i.test(U))return{text:"Advance by a number and a unit: 90m, 12h, 3d.",acts:[]};if(/^branches: \{/i.test(U))return{text:"That branch could not be made: pick now, or an instant before it.",acts:[]};if(/^approve: \{/i.test(U))return{text:"Name who approves.",acts:[]};if(/a browser deploys only what it names/i.test(U))return{text:"A deploy is confirmed by its name: use Deploy again.",acts:[]};if(/^no such door/i.test(U))return{text:"This World does not answer that here.",acts:[]};return{text:U.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()||Q,acts:[]}}var T5=async(Q)=>M2(await k3(Q)).text,sj={vault:["vault","Open Vault"],remote:["remote","Open Remote"],settings:["settings/services","Open Real services"]};function ZO({name:Q,acts:U}){let Z=U.map((K)=>sj[K]).filter((K)=>Boolean(K));if(Z.length===0)return null;return F.jsxDEV(F.Fragment,{children:Z.map(([K,H])=>F.jsxDEV(F1.default.Fragment,{children:[" ",F.jsxDEV("a",{href:`${n1}/${Q}/~/${K}`,onClick:(Y)=>{Y.preventDefault(),f0([...Q.split("/"),"~",...K.split("/")])},children:H},void 0,!1,void 0,this)]},K,!0,void 0,this))},void 0,!1,void 0,this)}async function O0(Q,U,Z={}){return q7(`${P0}${U}`,{...Z,headers:{...Z.headers??{},...Q===d6?{}:{"x-volter-token":Q},...Z.body&&!Z.headers?.["content-type"]?{"content-type":"application/json"}:{}}})}function y0(Q,U,Z=0){let K=mA((H)=>O0(Q,H),U,Z,Q);return K.state==="error"?{...K,error:M2(K.error).text}:K}var v9=(Q)=>{let U=new Date(Q),Z=(K)=>String(K).padStart(2,"0");return`${U.getFullYear()}-${Z(U.getMonth()+1)}-${Z(U.getDate())}T${Z(U.getHours())}:${Z(U.getMinutes())}`},aR=(Q)=>new Date(Math.ceil(Date.parse(Q)/60000)*60000).toISOString(),FO=(Q)=>Q.operation==="observed"?`observed${Q.provenance==="placeholder"?" (default data)":" (vendor)"}`:Q.receipt?`${Q.receipt.status??""} ${Q.receipt.externalId??""} ${Q.receipt.reason??""}`.trim():Q.provenance==="placeholder"?"default data":"unpushed",tj=(Q)=>{let U=/^[0-9a-f]{2}-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2}$/.exec(Q??"");return U?{trace:U[1],span:U[2]}:null},GH="volter.console.snapshots",l3=()=>{try{return JSON.parse(sessionStorage.getItem(GH)??"{}")}catch{return{}}},XO=new Map,ZH=(Q)=>{if(p3){if(Q.token||Q.readToken)XO.set(Q.name,{token:Q.token,readToken:Q.readToken});Q={...Q,token:"",readToken:""}}try{sessionStorage.setItem(GH,JSON.stringify({...l3(),[Q.name]:Q}))}catch{}},FH=(Q)=>XO.get(Q)?.readToken||l3()[Q]?.readToken||"",YU=(Q)=>{try{let U=l3();delete U[Q],sessionStorage.setItem(GH,JSON.stringify(U))}catch{}},G7=new URLSearchParams(window.location.hash.slice(1)),f9=G7.get("close")??"";function rJ(Q){if(typeof Q!=="string")return null;let U;try{U=new URL(Q)}catch{return null}return(U.protocol==="http:"||U.protocol==="https:")&&U.origin===Q.replace(/\/+$/,"")?U:null}function XH(Q){let U=rJ(Q);if(!U)return null;let Z=new URL(P0);if(U.protocol!==Z.protocol||U.port!==Z.port)return null;if(U.hostname===Z.hostname)return U.origin;let K=/^[a-z0-9](?:[a-z0-9]|-(?!-))*--[a-z0-9](?:[a-z0-9]|-(?!-))*\./;if(!K.test(U.hostname))return null;let H=U.hostname.replace(K,"");return H===Z.hostname||K.test(Z.hostname)&&H===Z.hostname.replace(K,"")?U.origin:null}function oj(Q){let U;try{U=JSON.parse(Q)}catch{return null}let Z=/^[a-z0-9][a-z0-9-]*\/[a-z0-9][a-z0-9-]*$/i;if(typeof U.name!=="string"||!Z.test(U.name)||typeof U.parent!=="string"||!Z.test(U.parent)||typeof U.at!=="string")return null;let K=U.parentOrigin===void 0?void 0:XH(U.parentOrigin);return{name:U.name,parent:U.parent,token:typeof U.token==="string"?U.token:"",readToken:typeof U.readToken==="string"?U.readToken:"",at:U.at,expiresAt:typeof U.expiresAt==="string"?U.expiresAt:null,...K?{parentOrigin:K}:{}}}{let Q=G7.get("snapshot");if(Q){let U=oj(Q);if(U&&!l3()[U.name])ZH(U)}}var KO="volter.console.home",HO=(Q)=>{let U=rJ(Q);if(!U)return null;let Z=new URL(P0).hostname,K=Z.replace(/^[a-z0-9](?:[a-z0-9]|-(?!-))*--[a-z0-9](?:[a-z0-9]|-(?!-))*\./,"");return U.hostname===Z||U.hostname===K?U.origin:null};{let Q=HO(G7.get("home"));if(Q)try{sessionStorage.setItem(KO,Q)}catch{}}if(["token","pass","portal","snapshot","home","close"].some((Q)=>G7.has(Q)))try{window.history.replaceState(null,"",window.location.pathname+window.location.search)}catch{}var O4=()=>{try{return HO(sessionStorage.getItem(KO))??""}catch{return""}};function KH(Q,U,Z,K){let H=new URLSearchParams({token:U,home:O4()||P0}),Y=l3()[Z];if(Y)H.set("snapshot",JSON.stringify(Y));window.location.replace(`${Q}${K??`${window.location.pathname}${window.location.search}`}#${H.toString()}`)}var qH=U7.dataset.route==="memory"?"":null;function J7(){return(qH??window.location.pathname.slice(n1.length)).split("/").filter(Boolean).map((Q)=>{try{return decodeURIComponent(Q)}catch{return""}})}var sR=/^[a-z0-9](?:[a-z0-9]|-(?!-))*$/i,g3=(Q,U)=>Q&&U&&sR.test(Q)&&sR.test(U)?`${Q}/${U}`:"";function f0(Q){let U=`/${Q.map(encodeURIComponent).join("/")}`;if(qH!==null)qH=U;else window.history.pushState(null,"",`${n1}${U}`);window.dispatchEvent(new PopStateEvent("popstate"))}function YO(Q,U){let Z=XH(l3()[Q]?.origin);if(Z&&Z!==P0){KH(Z,FH(Q),Q,`${n1}/${U.map(encodeURIComponent).join("/")}`);return}f0(U)}async function tR(){let[Q,U]=J7(),Z=g3(Q,U),K=Z?[Z]:QO;if(K.length===0){let H=await q7(`${P0}/-/ping`).catch(()=>null);K=H?.ok?(await H.json().catch(()=>({}))).worlds??[]:[]}K=K.filter((H)=>{let[Y,W,...L]=H.split("/");return L.length===0&&g3(Y,W)===H});for(let H of K){let Y=await q7(`${P0}/-/${H}/session`,{method:"POST"}).catch(()=>null);if(!Y)continue;let W=await Y.json().catch(()=>({})),L=rJ(W.origin)?.origin;if(Y.status===409&&L&&L!==P0)return window.location.replace(`${L}${n1}/${H}`),"moved";if(Y.ok&&W.local)return{token:typeof W.token==="string"&&W.token?W.token:d6}}return null}function nj(){let[Q,U]=F1.useState(tF),Z=(K)=>()=>{try{if(K==="system")localStorage.removeItem("volter.theme");else localStorage.setItem("volter.theme",K)}catch{}Aq(K),U(K)};return F.jsxDEV(F.Fragment,{children:[F.jsxDEV("p",{className:"menu-label",children:"Appearance"},void 0,!1,void 0,this),F.jsxDEV("div",{className:"theme-choice",role:"radiogroup","aria-label":"Appearance",children:["system","light","dark"].map((K)=>F.jsxDEV("button",{type:"button",role:"radio","aria-checked":Q===K,onClick:Z(K),children:K==="system"?"System":K==="light"?"Light":"Dark"},K,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function ej(){let[Q,U]=F1.useState(aj()),[Z,K]=F1.useState(!1),[H,Y]=F1.useState(!1),[W,L]=F1.useState(""),[M,O]=F1.useState(null),[T,A]=F1.useState(null),[R,w]=F1.useState(J7());F1.useEffect(()=>{let _1=()=>w(J7());return window.addEventListener("popstate",_1),()=>window.removeEventListener("popstate",_1)},[]),F1.useEffect(()=>{let[_1,a]=J7(),H1=g3(_1,a),[O1,L1]=H1?H1.split("/"):[],T1=l3()[f9];if(!f9||!Q||!O1||!L1||!T1?.made||T1.parent!==`${O1}/${L1}`||g3(...f9.split("/"))!==f9)return;try{window.history.replaceState(null,"",window.location.pathname+window.location.search)}catch{}O0(Q,`/-/${O1}/${L1}/branches/${f9}`,{method:"DELETE"}).catch(()=>null).then(()=>YU(f9))},[Q]);let P=F1.useCallback(async(_1)=>{if(A(null),!_1){let L1=await tR();if(L1==="moved")return;if(L1){if(K(!0),L1.token!==d6)iJ(L1.token);U(L1.token);return}O(null),Y(!0);return}if(p3&&_1===d6){let L1=await tR();if(L1==="moved")return;if(L1)K(!0)}if(p3&&_1===qO){let[L1,T1]=J7(),G1=g3(L1,T1),[R1,f1]=G1?G1.split("/"):[],z1=R1&&f1?await q7(`${P0}/-/${R1}/${f1}/session`,{method:"POST",headers:{"x-volter-pass":G7.get("pass")??""}}).catch(()=>null):null;if(!z1){A(`${P0} did not answer: no session was opened`),O(null);return}if(!z1.ok){A(`${await T5(z1)}. Open it again from the platform.`),O(null);return}GO((await z1.json().catch(()=>({}))).issuer),U(d6);return}if(p3&&_1!==d6){let[L1,T1]=J7(),G1=g3(L1,T1),[R1,f1]=G1?G1.split("/"):[],z1=R1&&f1?await q7(`${P0}/-/${R1}/${f1}/session`,{method:"POST",headers:{"x-volter-token":_1}}).catch(()=>null):null;if(!z1){A(`${P0} did not answer: no session was opened`),O(null);return}if(!z1.ok){let C1=await T5(z1);A(z1.status===401||z1.status===403?`That token does not open ${R1}/${f1}.`:z1.status===409?`${R1}/${f1}'s session lives at another origin: ${C1}`:`The World could not open a session (${z1.status}): ${C1}`),O(null);return}U(d6);return}let a=p3?new Response(null,{status:404}):await O0(_1,"/-/worlds");if(a.ok){let{worlds:L1}=await a.json();O({kind:"admin",worlds:L1});return}if(a.status===429){A("You are asking faster than the platform allows — wait a moment and reload."),O(null);return}if(a.status>=500){let L1=await a.json().catch(()=>({}));A(`The platform could not list your worlds${L1.error?`: ${L1.error}`:""}. Reload; if it stays, the status page says what is wrong.`),O(null);return}let H1=QO;if(H1.length===0){let L1=await q7(`${P0}/-/ping`);if(!L1.ok){A(`${P0} does not answer as a host`),O(null);return}if(H1=(await L1.json()).worlds??[],H1.length===0){A(`${P0} does not list its Worlds: open a World at its own address, ${P0}${n1}/<org>/<world>`),O(null);return}}let O1=[];for(let L1 of H1){let T1=await O0(_1,`/-/${L1}/twins`);if(T1.ok){let G1=await T1.json();O1.push({name:L1,base:`${c3}/${L1}`,twins:(G1.twins??[]).map((R1)=>({vendor:R1.twin,protocol:R1.protocol??null,root:R1.root??null}))})}}if(O1.length===0){A("This link or key opens no World here: it was revoked, or it has ended."),O(null);return}O({kind:"world",worlds:O1})},[]);F1.useEffect(()=>{P(Q)},[Q,P]);let V=(_1)=>M?.kind==="admin"?M.worlds.find((a)=>a.name===_1)?.token??Q:Q,[S,C]=F1.useState("");if(!Q||!M&&!T)return F.jsxDEV("main",{className:"app gate",children:F.jsxDEV("div",{className:"gate-window",children:[F.jsxDEV(HJ,{href:`${n1}/`},void 0,!1,void 0,this),Q&&!M&&!T||!Q&&!H?F.jsxDEV("p",{className:"mode",children:"Opening…"},void 0,!1,void 0,this):F.jsxDEV("form",{onSubmit:(_1)=>{_1.preventDefault(),iJ(W.trim()),U(W.trim())},className:"stack",children:[F.jsxDEV("h2",{children:"Open a World"},void 0,!1,void 0,this),F.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),F.jsxDEV("label",{children:[F.jsxDEV("span",{children:"Token"},void 0,!1,void 0,this),F.jsxDEV("input",{name:"token",type:"password",value:W,onChange:(_1)=>L(_1.target.value),autoFocus:!0,autoComplete:"off"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.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 y=()=>A("This link or key opens no World here: it was revoked, or it has ended."),N=()=>{if(Z){window.location.reload();return}if(p3){let[_1,a]=J7(),H1=g3(_1,a),[O1,L1]=H1?H1.split("/"):[],T1=()=>window.location.replace(t2()?`${t2()}/`:`${P0}${n1}/${O1&&L1?`${O1}/${L1}`:""}?signin`);if(setTimeout(T1,2000),O1&&L1)q7(`${P0}/-/${O1}/${L1}/session/end`,{method:"POST"}).catch(()=>null).then(T1);else T1();return}if(M)for(let _1 of M.worlds)navigator.sendBeacon(`${_1.base.replace(/\/[^/]+\/[^/]+$/,"")}/-/${_1.name}/session/end`);iJ(""),U(""),L(""),O(null),f0([])};if(T||!M)return F.jsxDEV("main",{className:"app gate",children:F.jsxDEV("div",{className:"gate-window",children:[F.jsxDEV(HJ,{href:`${n1}/`},void 0,!1,void 0,this),F.jsxDEV("h2",{children:"Could not open it"},void 0,!1,void 0,this),F.jsxDEV("p",{role:"alert",children:T??"nothing answered"},void 0,!1,void 0,this),t2()?F.jsxDEV("a",{className:"button primary",href:`${t2()}/`,children:["Back to ",new URL(t2()).host]},void 0,!0,void 0,this):F.jsxDEV("button",{type:"button",className:"primary",onClick:N,children:Z?"Try again":"Use another token"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this);let[v,D,x,E,u,b,m]=R,s=x==="~",U1=/^[A-Za-z0-9_-]+$/,Q1=/^[^\u0000-\u001f\u007f]{1,200}$/,h=s||!x||!U1.test(x)?void 0:x,g=u&&U1.test(u)?b!==void 0&&E!=="changes"&&E!=="screens"?g3(u,b)||void 0:u:void 0,p=E==="changes"&&u==="changesets"&&b&&U1.test(b)?b:E==="screens"&&b&&m&&/^[A-Za-z0-9_.-]+$/.test(b)&&Q1.test(m)?`${b}:${m}`:void 0,c=g3(v,D),l=c?l3()[c]??null:null,o=(_1)=>FH(_1)||V(_1),k=l?M.kind==="admin"?M.worlds.find((_1)=>_1.name===l.parent)?.token??null:M.worlds.some((_1)=>_1.name===l.parent)?Q:null:null,t=async(_1)=>{let a=XH(_1.parentOrigin);if(a&&a!==P0){YU(_1.name),window.location.assign(`${a}${n1}/${_1.parent}#close=${encodeURIComponent(_1.name)}`);return}if(_1.made)await O0(V(_1.parent),`/-/${_1.parent}/branches/${_1.name}`,{method:"DELETE"}).catch(()=>null),YU(_1.name);f0(_1.parent.split("/"))};return F.jsxDEV("main",{className:c?"app workspace":"app home",children:[c?null:F.jsxDEV("header",{children:[c?F.jsxDEV(iA,{},void 0,!1,void 0,this):null,F.jsxDEV(HJ,{href:`${O4()&&O4()!==P0?O4():""}${n1}/`,onClick:(_1)=>{if(O4()&&O4()!==P0)return;_1.preventDefault(),f0([])}},void 0,!1,void 0,this),F.jsxDEV("nav",{"aria-label":"breadcrumb",className:"crumbs",children:[c?F.jsxDEV(F.Fragment,{children:[F.jsxDEV("span",{className:"crumb-sep","aria-hidden":"true",children:"/"},void 0,!1,void 0,this),F.jsxDEV("span",{children:c.split("/")[0]},void 0,!1,void 0,this),F.jsxDEV("span",{className:"crumb-sep","aria-hidden":"true",children:"/"},void 0,!1,void 0,this),F.jsxDEV("a",{href:`${n1}/${c}`,className:"crumb-world",onClick:(_1)=>{_1.preventDefault(),f0(c.split("/"))},children:c.split("/")[1]},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,h?F.jsxDEV("span",{children:[" / ",h]},void 0,!0,void 0,this):null,s&&E==="trace"?F.jsxDEV("span",{children:" / trace"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),t2()?F.jsxDEV("a",{href:`${t2()}/${c?encodeURIComponent(c.split("/")[0]):""}`,title:`Back to the platform at ${new URL(t2()).host}`,className:"back-link",children:["← ",F.jsxDEV("span",{className:"back-text",children:c?`${c.split("/")[0]}'s Worlds`:new URL(t2()).host},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,c?null:F.jsxDEV("span",{className:"mode",children:Z?"on this machine":S?`signed in as ${S}`:M.kind==="admin"?"host: admin":"opened with a link or key"},void 0,!1,void 0,this),c||Z?null:F.jsxDEV("button",{onClick:N,children:"Sign out"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),c?F.jsxDEV(QV,{name:c,token:o(c),twin:h,tab:s?E??"overview":"overview",arg:s?g:void 0,...s&&p?{sub:p}:{},admin:l?null:M.kind==="admin"?Q:null,snapshot:l,parentToken:k,who:{local:Z,person:S||null,admin:M.kind==="admin"},onSignOut:N,onReturn:t,opens:(_1)=>!!l3()[_1]||M.kind==="admin"&&M.worlds.some((a)=>a.name===_1),onRemoved:()=>{P(Q),f0([])},onWho:C,onEnded:y,worlds:M.worlds.map((_1)=>_1.name)},c,!1,void 0,this):F.jsxDEV(_V,{mode:M,admin:M.kind==="admin"?Q:null,reload:()=>P(Q)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function _V({mode:Q,admin:U,reload:Z}){let[K,H]=F1.useState(""),[Y,W]=F1.useState(""),[L,M]=F1.useState(""),[O,T]=F1.useState(null),A=async(E)=>{if(!await n4({title:`Rotate the tokens of ${E}?`,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 u=await O0(U,`/-/worlds/${E}/rotate`,{method:"POST"}),b=await u.json().catch(()=>({}));T(u.ok?`rotated ${E}: the new tokens are shown once — token ${b.token} · read token ${b.readToken}`:b.error?M2(b.error).text:`answered ${u.status}`),await Z()},R=async(E)=>{let u=await O0(U,`/-/worlds/${E}`,{method:"DELETE"}),b=await u.json().catch(()=>({}));T(u.ok?`removed ${E}`:b.error?M2(b.error).text:`answered ${u.status}`),await Z()},[w,P]=F1.useState(!1),[V,S]=F1.useState(!1),[C,y]=F1.useState(""),N=async(E)=>{E.preventDefault(),T(null),P(!0);try{let u=await O0(U,"/-/worlds",{method:"POST",body:JSON.stringify({org:K,world:Y,vendors:L.split(",").map((m)=>m.trim()).filter(Boolean)})}),b=await u.json();if(!u.ok){T(b.error?M2(b.error).text:`the host answered ${u.status}`);return}T(`provisioned ${b.name}`),W(""),M(""),S(!1),await Z()}finally{P(!1)}},v=C.trim().toLowerCase(),D=Q.worlds.filter((E)=>!v||E.name.toLowerCase().includes(v)||E.twins.some((u)=>u.vendor.includes(v))),x=[...new Set(D.map((E)=>E.name.split("/")[0]))];return F.jsxDEV("section",{className:"home-window","aria-labelledby":"worlds",children:[F.jsxDEV("div",{className:"home-head",children:[F.jsxDEV("h2",{id:"worlds",children:"Worlds"},void 0,!1,void 0,this),F.jsxDEV("span",{className:"mode",children:[l0(Q.worlds.length,"World")," ",U?"this host serves":"this key opens"]},void 0,!0,void 0,this),U?F.jsxDEV("button",{type:"button",className:"primary",onClick:()=>{T(null),S(!0)},children:[F.jsxDEV(Z0,{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),F.jsxDEV("div",{className:"home-find",children:F.jsxDEV("input",{type:"search",placeholder:"Filter by World or vendor","aria-label":"Filter Worlds",value:C,onChange:(E)=>y(E.target.value)},void 0,!1,void 0,this)},void 0,!1,void 0,this),O&&!V?F.jsxDEV("p",{role:"status",className:"home-note",children:O},void 0,!1,void 0,this):null,x.map((E)=>F.jsxDEV(F1.default.Fragment,{children:[F.jsxDEV("p",{className:"menu-label home-org",children:E},void 0,!1,void 0,this),F.jsxDEV("ul",{className:"home-list",children:D.filter((u)=>u.name.split("/")[0]===E).map((u)=>F.jsxDEV("li",{children:[F.jsxDEV("a",{href:`${n1}/${u.name}`,onClick:(b)=>{b.preventDefault(),f0(u.name.split("/"))},children:[F.jsxDEV(Z0,{name:"globe",size:20},void 0,!1,void 0,this),F.jsxDEV("span",{className:"ws-row-text",children:[F.jsxDEV("b",{children:u.name.split("/")[1]},void 0,!1,void 0,this),F.jsxDEV("small",{children:F.jsxDEV("code",{children:u.base},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("span",{className:"home-vendors",children:u.twins.map((b)=>F.jsxDEV("span",{title:s1(b.vendor),children:F.jsxDEV(q2,{vendor:b.vendor},void 0,!1,void 0,this)},b.vendor,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),U?F.jsxDEV("details",{className:"menu home-more",children:[F.jsxDEV("summary",{"aria-label":`More for ${u.name}`,children:"⋯"},void 0,!1,void 0,this),F.jsxDEV("div",{className:"popover menu-list",children:[F.jsxDEV("button",{type:"button",onClick:(b)=>{b.currentTarget.closest("details")?.removeAttribute("open"),A(u.name)},children:"Rotate tokens…"},void 0,!1,void 0,this),F.jsxDEV("button",{type:"button",className:"danger-item",onClick:(b)=>{b.currentTarget.closest("details")?.removeAttribute("open"),n4({title:`Remove ${u.name}?`,body:"The host stops serving it and its whole history goes with it. This cannot be undone.",action:"Remove World",danger:!0,typed:u.name}).then((m)=>{if(m)R(u.name)})},children:"Remove World…"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null]},u.name,!0,void 0,this))},void 0,!1,void 0,this)]},E,!0,void 0,this)),D.length===0?F.jsxDEV("p",{className:"mode home-note",children:v?`No World matches ${C}.`:"No Worlds here yet."},void 0,!1,void 0,this):null,F.jsxDEV(E5,{open:V,onClose:()=>{if(!w)S(!1)},title:"New World",footer:F.jsxDEV(F.Fragment,{children:[F.jsxDEV("button",{type:"button",onClick:()=>S(!1),disabled:w,children:"Cancel"},void 0,!1,void 0,this),F.jsxDEV("button",{type:"submit",form:"provision",className:"primary",disabled:w,children:w?"Making… (ten seconds or so)":"Make World"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:F.jsxDEV("form",{id:"provision",onSubmit:N,className:"stack",children:[F.jsxDEV("label",{children:[F.jsxDEV("span",{children:"Org"},void 0,!1,void 0,this),F.jsxDEV("input",{name:"org",value:K,onChange:(E)=>H(E.target.value),required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("label",{children:[F.jsxDEV("span",{children:"World"},void 0,!1,void 0,this),F.jsxDEV("input",{name:"world",value:Y,onChange:(E)=>W(E.target.value),required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("label",{children:[F.jsxDEV("span",{children:"Vendors"},void 0,!1,void 0,this),F.jsxDEV("input",{name:"vendors",value:L,onChange:(E)=>M(E.target.value),placeholder:"stripe, slack",required:!0},void 0,!1,void 0,this),F.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),O?F.jsxDEV("p",{role:"status",children:O},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 JV=["changes","events","trace","vendors","screens","canvas","branches","settings","remote","vault"],$V=(Q,U)=>{let Z=U?.screens?.find((K)=>K.path.replace(/\/+$/,"")==="")??U?.screens?.find((K)=>!/[{<]/.test(K.path));return U&&Z?`${c3}/${Q}/${U.twin}${Z.path.startsWith("/")?Z.path:`/${Z.path}`}`:null},oR={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 Q4(Q){let U=Q.operation??Q.op,Z=(U.includes(".")?U.slice(U.lastIndexOf(".")+1):U).toLowerCase(),K=Q.subject.type.replace(/[_-]+/g," ").trim(),H=`${K.charAt(0).toUpperCase()}${K.slice(1)}`,Y=/(^|\.)twin\./.test(U)||/^seed_/.test(Z),W=U.replace(/[._]+/g," ").trim(),L=Y?`${H} seeded`:oR[Z]?`${H} ${oR[Z]}`:`${W.charAt(0).toUpperCase()}${W.slice(1)}`,M=Q.fields??{},O=["title","name","email","text","subject","summary","description"].map((A)=>M[A]).find((A)=>typeof A==="string"&&A.trim()!=="")??null,T=O===null?null:O.replace(/<([@#!])[^|>]*\|([^>]+)>/g,(A,R,w)=>`${R==="!"?"@":R}${w}`).replace(/<(?:https?:[^|>]+)\|([^>]+)>/g,"$1").replace(/<(https?:[^>]+)>/g,"$1");return{what:L,label:T===null?null:T.length>80?`${T.slice(0,79)}…`:T}}var i3=(Q)=>/token|password|secret|key|credential/i.test(Q.subject.type)&&Q.subject.id.length>6?`••••${Q.subject.id.slice(-4)}`:Q.subject.id;function QV({name:Q,token:U,twin:Z,tab:K,arg:H,sub:Y,admin:W,snapshot:L,parentToken:M,who:O,onSignOut:T,onReturn:A,opens:R,onRemoved:w,onWho:P,onEnded:V,worlds:S=[]}){let[C,y]=F1.useState("pending"),[N,v]=F1.useState(null),[D,x]=F1.useState(0),[E,u]=F1.useState(null);F1.useEffect(()=>{let G1=!0;return v(null),O0(U,`/-/${Q}/session`,{method:"POST"}).then(async(R1)=>{let f1=await R1.json().catch(()=>({}));if(GO(f1.issuer),f1.who)P?.(f1.who);u(typeof f1.signsAs==="string"?f1.signsAs:null);let z1=rJ(f1.origin)?.origin;if(R1.status===409&&z1&&z1!==P0){KH(z1,U,Q);return}if(!G1)return;if(y(!R1.ok?"unknown":f1.scope==="read"?"read":f1.scope==="write"?"write":"unknown"),!R1.ok)v(f1.error?M2(f1.error).text:`answered ${R1.status}`)}).catch((R1)=>{if(G1)y("unknown"),v(`the World did not answer: ${R1 instanceof Error?R1.message:String(R1)}`)}),()=>{G1=!1}},[Q,U,D]);let b=N?{state:"error",error:N}:C==="pending"?{state:"pending"}:{state:"ok",scope:C},m=C==="write",s=(G1)=>{if(G1.status!==403)return;G1.clone().json().then((R1)=>{if(/read token|opens only reads|write access|reads only/i.test(R1?.error??""))y("read")},()=>null)},[U1,Q1]=F1.useState(0);F1.useEffect(()=>{let G1=setInterval(()=>{if(!document.hidden)Q1((R1)=>R1+1)},5000);return()=>clearInterval(G1)},[]);let[h,g]=F1.useState(0),p=y0(U,`/-/${Q}/clock`,U1+h);F1.useEffect(()=>{if(p3&&!L&&p.state==="error"&&p.status===401)V?.()},[p,L,V]);let c=y0(U,`/-/${Q}/twins`),l=y0(U,`/-/${Q}/branches`,h),o=y0(U,`/-/${Q}/map`,Math.floor(U1/2)),k=!(l.state==="error"&&(l.status===404||l.status===405)),t=JV.includes(K)?K:"overview",_1=c.state==="ok"?c.data.twins.map((G1)=>G1.twin):[];if(Z&&c.state==="ok"&&!_1.includes(Z))return F.jsxDEV("main",{className:"center",children:F.jsxDEV(X9,{title:`${Q} has no ${Z}`,action:F.jsxDEV("a",{href:`${n1}/${Q}`,onClick:(G1)=>{G1.preventDefault(),f0(Q.split("/"))},children:["Open ",Q]},void 0,!0,void 0,this),children:F.jsxDEV("p",{children:["No vendor of this World is called ",Z,". 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 a=t==="vendors"&&H?H:void 0,H1=()=>{y("pending"),x((G1)=>G1+1)};if(t==="canvas"||t==="vendors"&&!a||K==="screens"&&!H)return F.jsxDEV(VV,{name:Q,token:U,twins:c,session:b,retry:H1,snapshot:L,back:()=>f0(Q.split("/")),canWrite:m&&!L},void 0,!1,void 0,this);let L1=K==="settings"?{kind:"settings",tab:((G1)=>zO.find(([R1])=>R1===G1)?.[0]??"account")(H)}:K==="remote"?{kind:"settings",tab:"remote"}:K==="vault"?{kind:"settings",tab:"vault"}:K==="branches"?{kind:"branches",...H?{open:H}:{}}:null,T1=Z?"vendor":K==="screens"&&H?"screen":t==="vendors"&&a?"vendor":K==="trace"?"trace":K==="events"?"events":K==="changes"&&H==="changesets"?"history":"changes";return F.jsxDEV(zV,{name:Q,token:U,view:T1,win:L1,who:O,snapshot:L,onReturn:A,onSignOut:T,worlds:S,session:b,retry:H1,...T1==="vendor"?{arg:Z??a}:T1==="events"||T1==="trace"||T1==="screen"?H?{arg:H}:{}:{},...Y?{sub:Y}:{},twins:c,map:o,branches:k?l:null,clock:p,canWrite:m&&!L,refused:s,signsAs:E,opens:R,tick:U1,admin:W,onRemoved:w,onClock:()=>g((G1)=>G1+1),scope:L?"read":C},void 0,!1,void 0,this)}function Z0({name:Q,size:U=20}){return F.jsxDEV("svg",{className:"icon",viewBox:"0 0 24 24",width:U,height:U,fill:"none",stroke:"currentColor",strokeWidth:U<=16?1.75:1.5,strokeLinecap:"square",strokeLinejoin:"miter","aria-hidden":"true",children:(rR[Q]??[]).map(([Z,K],H)=>F1.default.createElement(Z,{key:H,...K}))},void 0,!1,void 0,this)}function WU(Q){let U=(Z)=>{let K=(Z.operation??Z.op).toLowerCase();return K.includes(".")?K.slice(K.lastIndexOf(".")+1):K};if(Q.some((Z)=>/^(delete|remove|archive|revoke)/.test(U(Z))||Z.fields?.deleted===!0))return{icon:"square-minus",word:"removed",tone:"removed"};if(/^(create|add|insert|issue|send|post|upload|invite|record|seed)/.test(U(Q[0])))return{icon:"square-plus",word:"made",tone:"added"};return{icon:"square-dot",word:"changed",tone:"changed"}}var zO=[["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"]],qV=(Q,U)=>{let Z=U.split("/").pop()??U,K=Q.split("/").pop()??"";return Z.startsWith(`${K}-`)?Z.slice(K.length+1):Z},$7=(Q)=>Q.replace(/^_+/,"").replace(/[_-]+/g," ");function WO({record:Q,history:U}){let Z=Q.writes[Q.writes.length-1],K=Q4(Z),H=WU(Q.writes),Y=new Set(Q.writes.map((A)=>A.id)),W=Q.writes[0].occurredAt,L={};if(U){for(let A of U)if(!Y.has(A.id)&&!A.landsId&&!A.aliasOf&&A.subject.type===Z.subject.type&&A.subject.id===Z.subject.id&&A.occurredAt<=W)Object.assign(L,A.fields??{})}let M={...L};for(let A of Q.writes)Object.assign(M,A.fields??{});let O=H.tone==="added"&&Object.keys(L).length===0,T=[...new Set([...Object.keys(L),...Object.keys(M)])].filter((A)=>!fO(L[A],M[A]));return F.jsxDEV("div",{className:"ws-diff","aria-label":`${K.label??i3(Z)}: its changes`,children:[F.jsxDEV("div",{className:"ws-diff-head",children:[F.jsxDEV("span",{className:`ws-kind ${H.tone}`,title:H.word,children:F.jsxDEV(Z0,{name:H.icon,size:16},void 0,!1,void 0,this)},void 0,!1,void 0,this),F.jsxDEV(q2,{vendor:Q.twin},void 0,!1,void 0,this),F.jsxDEV("div",{className:"cell-label",children:[F.jsxDEV("b",{children:K.label??i3(Z)},void 0,!1,void 0,this),F.jsxDEV("small",{children:[s1(Q.twin)," · ",Z.subject.type.replace(/^_+/,"").replace(/[_-]+/g," ")," ",F.jsxDEV("code",{children:i3(Z)},void 0,!1,void 0,this)," · ",H.word," here"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("ol",{className:"ws-writes",children:Q.writes.map((A)=>F.jsxDEV("li",{children:[F.jsxDEV("b",{children:Q4(A).what},void 0,!1,void 0,this)," ",F.jsxDEV("span",{className:"mode",children:[F.jsxDEV(j0,{iso:A.occurredAt},void 0,!1,void 0,this)," · ",dJ(A)]},void 0,!0,void 0,this)]},A.id,!0,void 0,this))},void 0,!1,void 0,this),U===null?F.jsxDEV("p",{className:"mode pad",children:"Reading its history…"},void 0,!1,void 0,this):T.length===0?F.jsxDEV("p",{className:"mode pad",children:"No field holds a new value."},void 0,!1,void 0,this):F.jsxDEV("table",{className:"ws-fields","aria-label":"Fields before and after",children:[F.jsxDEV("thead",{children:F.jsxDEV("tr",{children:[F.jsxDEV("th",{children:"Field"},void 0,!1,void 0,this),O?null:F.jsxDEV("th",{children:"Before"},void 0,!1,void 0,this),F.jsxDEV("th",{children:H.tone==="removed"?"After":"Now"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("tbody",{children:T.map((A)=>F.jsxDEV("tr",{children:[F.jsxDEV("th",{scope:"row",children:F.jsxDEV("code",{children:A},void 0,!1,void 0,this)},void 0,!1,void 0,this),O?null:F.jsxDEV("td",{className:A in L?"was":"none",children:A in L?F.jsxDEV(d3,{v:L[A]},void 0,!1,void 0,this):F.jsxDEV("span",{className:"mode",children:"—"},void 0,!1,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("td",{className:A in M?"now":"none",children:A in M?F.jsxDEV(d3,{v:M[A]},void 0,!1,void 0,this):F.jsxDEV("span",{className:"mode",children:"—"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},A,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function LO({records:Q,selected:U,onPick:Z,label:K}){let[H,Y]=F1.useState(()=>{try{return localStorage.getItem("volter.console.records")==="tree"}catch{return!1}}),W=(O)=>{Y(O);try{localStorage.setItem("volter.console.records",O?"tree":"path")}catch{}},L=(O,T)=>{let A=O.writes[O.writes.length-1],R=Q4(A),w=WU(O.writes);return F.jsxDEV("li",{children:F.jsxDEV("button",{type:"button",className:[U===O.key?"on":"",T?"nested":""].join(" ").trim()||void 0,"aria-pressed":U===O.key,onClick:()=>Z(O.key),children:[T?null:F.jsxDEV(q2,{vendor:O.twin},void 0,!1,void 0,this),F.jsxDEV("span",{className:"ws-row-text",children:[F.jsxDEV("b",{children:R.label??i3(A)},void 0,!1,void 0,this),F.jsxDEV("small",{children:[$7(A.subject.type)," · ",R.what.split(" ").slice(-1)[0],O.writes.length>1?` · ${l0(O.writes.length,"write")}`:""]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("span",{className:`ws-kind ${w.tone}`,title:w.word,"aria-label":w.word,children:F.jsxDEV(Z0,{name:w.icon,size:16},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},O.key,!1,void 0,this)},M=[...new Set(Q.map((O)=>O.twin))];return F.jsxDEV(F.Fragment,{children:[F.jsxDEV("div",{className:"ws-view-switch",role:"group","aria-label":"List the records by",children:[F.jsxDEV("button",{type:"button","aria-pressed":!H,className:H?void 0:"on",onClick:()=>W(!1),children:"Path"},void 0,!1,void 0,this),F.jsxDEV("button",{type:"button","aria-pressed":H,className:H?"on":void 0,onClick:()=>W(!0),children:"Tree"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("ul",{className:"ws-list","aria-label":K,children:H?M.map((O)=>{let T=Q.filter((A)=>A.twin===O);return F.jsxDEV("li",{className:"ws-group",children:[F.jsxDEV("p",{className:"ws-group-head",children:[F.jsxDEV(q2,{vendor:O},void 0,!1,void 0,this),F.jsxDEV("b",{children:s1(O)},void 0,!1,void 0,this),F.jsxDEV("span",{className:"mode",children:T.length},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("ul",{children:T.map((A)=>L(A,!0))},void 0,!1,void 0,this)]},O,!0,void 0,this)}):Q.map((O)=>L(O,!1))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function UV({name:Q,token:U,branches:Z,opens:K,refused:H,onChanged:Y}){let[W,L]=F1.useState(""),[M,O]=F1.useState(!1),T=Z?.state==="ok"&&Z.data.checkedOut||Q.split("/")[1],A=Z?.state==="ok"&&Z.data.named?.length?Z.data.named:[{name:T,running:!0}],R=Z?.state==="ok"?Z.data.branches:[],w=W.trim().toLowerCase(),P=(S)=>!w||S.toLowerCase().includes(w),V=(S)=>{S.currentTarget.closest("details")?.removeAttribute("open")};return F.jsxDEV("details",{className:"menu ws-pick",children:[F.jsxDEV("summary",{title:"The branch served here",children:[F.jsxDEV(Z0,{name:"git-branch",size:16},void 0,!1,void 0,this),F.jsxDEV("span",{className:"ws-pick-label",children:[F.jsxDEV("small",{children:"Branch"},void 0,!1,void 0,this),F.jsxDEV("b",{children:T},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV(Z0,{name:"chevron-down",size:16},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("div",{className:"popover ws-branch-menu",children:[F.jsxDEV("div",{className:"ws-branch-find",children:[F.jsxDEV("input",{type:"search",placeholder:"Filter","aria-label":"Filter branches",value:W,onChange:(S)=>L(S.target.value)},void 0,!1,void 0,this),F.jsxDEV("button",{type:"button",onClick:(S)=>{V(S),O(!0)},disabled:!Z,children:"New branch"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("p",{className:"menu-label",children:"This World"},void 0,!1,void 0,this),F.jsxDEV("ul",{className:"ws-branch-list",children:A.filter((S)=>P(S.name)).map((S)=>F.jsxDEV("li",{className:S.name===T?"current":void 0,children:[F.jsxDEV("span",{className:"tick",children:S.name===T?F.jsxDEV(Z0,{name:"check",size:16},void 0,!1,void 0,this):F.jsxDEV(Z0,{name:"git-branch",size:16},void 0,!1,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("span",{className:"name",children:S.name},void 0,!1,void 0,this),F.jsxDEV("span",{className:"mode",children:S.name===T?"served here":S.running?"running":"stopped"},void 0,!1,void 0,this)]},S.name,!0,void 0,this))},void 0,!1,void 0,this),F.jsxDEV("p",{className:"menu-label",children:"Branches of it"},void 0,!1,void 0,this),R.length===0?F.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):F.jsxDEV("ul",{className:"ws-branch-list",children:R.filter((S)=>P(S.name)).map((S)=>{let C=F.jsxDEV(F.Fragment,{children:[F.jsxDEV("span",{className:"tick",children:F.jsxDEV(Z0,{name:"git-branch",size:16},void 0,!1,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("span",{className:"name",children:qV(Q,S.name)},void 0,!1,void 0,this),F.jsxDEV("span",{className:"mode",children:S.at?.instant?F.jsxDEV(F.Fragment,{children:["as of ",F.jsxDEV(j0,{iso:S.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),y=S.expiresAt?`Goes away ${new Date(S.expiresAt).toLocaleString()}`:"Kept";return F.jsxDEV("li",{children:K(S.name)?F.jsxDEV("a",{href:`${n1}/${S.name}`,title:y,onClick:(N)=>{N.preventDefault(),V(N),YO(S.name,S.name.split("/"))},children:C},void 0,!1,void 0,this):F.jsxDEV("span",{title:`${y}. Its tokens went to whoever made it; it opens from their page.`,children:C},void 0,!1,void 0,this)},S.name,!1,void 0,this)})},void 0,!1,void 0,this),F.jsxDEV("div",{className:"ws-branch-foot",children:F.jsxDEV("a",{href:`${n1}/${Q}/~/branches`,onClick:(S)=>{S.preventDefault(),V(S),f0([...Q.split("/"),"~","branches"])},children:"Manage branches…"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV(MO,{name:Q,token:U,open:M,onClose:()=>O(!1),onMade:Y,refused:H},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function BO({name:Q,view:U,changes:Z,changesets:K}){let H=(Y)=>(W)=>{W.preventDefault(),f0([...Q.split("/"),"~",...Y])};return F.jsxDEV("nav",{className:"tabs ws-pane-tabs","aria-label":"Changes and history",children:[F.jsxDEV("a",{href:`${n1}/${Q}/~/changes`,className:U==="changes"?"on":void 0,"aria-current":U==="changes"?"page":void 0,onClick:H(["changes"]),children:["Changes",Z?F.jsxDEV("span",{className:"count",children:Z},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),F.jsxDEV("a",{href:`${n1}/${Q}/~/changes/changesets`,className:U==="history"?"on":void 0,"aria-current":U==="history"?"page":void 0,onClick:H(["changes","changesets"]),children:["History",K?F.jsxDEV("span",{className:"count",children:K},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function GV({name:Q,token:U,sets:Z,sub:K,signsAs:H,canWrite:Y,rooted:W,refused:L,onChanged:M,changes:O,withScreens:T,required:A}){let[R,w]=F1.useState(null),[P,V]=F1.useState(!1),S=Z.state==="ok"?[...Z.data.changesets].sort((u,b)=>b.createdAt.localeCompare(u.createdAt)):[],C=S.find((u)=>u.name===K)??S[0],y=F1.useMemo(()=>{let u=new Map;for(let b of C?NO(C):[]){let m=`${b.twin}:${b.entry.subject.type}:${b.entry.subject.id}`,s=u.get(m)??{key:m,twin:b.twin,writes:[]};s.writes.push(b.entry),u.set(m,s)}return[...u.values()]},[C]),N=y.find((u)=>u.key===R)??y[0],v=y0(U,N?`/-/${Q}/log/${N.twin}`:null),D={added:0,removed:0,changed:0};for(let u of y)D[WU(u.writes).tone]=(D[WU(u.writes).tone]??0)+1;let x=C?LU(C):null,E=C?CO(C,A):null;return F.jsxDEV("div",{className:"ws-two",children:[F.jsxDEV("div",{className:"ws-files",children:[F.jsxDEV(BO,{name:Q,view:"history",changes:O,changesets:S.length},void 0,!1,void 0,this),F.jsxDEV(r2,{load:Z,what:"the changesets",lines:4},void 0,!1,void 0,this),F.jsxDEV("ul",{className:"ws-list ws-commits","aria-label":"Changesets",children:S.map((u)=>{let b=C?.name===u.name,m=LU(u).label==="Not sent";return F.jsxDEV("li",{children:F.jsxDEV("a",{href:`${n1}/${Q}/~/changes/changesets/${u.name}`,className:b?"on":void 0,"aria-current":b?"true":void 0,onClick:(s)=>{s.preventDefault(),w(null),f0([...Q.split("/"),"~","changes","changesets",u.name])},children:[F.jsxDEV("span",{className:"ws-row-text",children:[F.jsxDEV("b",{children:QH(u)},void 0,!1,void 0,this),F.jsxDEV("small",{children:[u.owner??(u.cutBy?zU(u.cutBy):"unrecorded")," • ",F.jsxDEV(j0,{iso:u.createdAt},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),m?F.jsxDEV("span",{className:"ws-unpushed",title:"Not pushed to the remote yet",children:F.jsxDEV(Z0,{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)},u.name,!1,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("div",{className:"ws-pane-right",children:[Z.state==="ok"&&!C?F.jsxDEV(X9,{title:"No changesets yet",children:F.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,C&&x&&E?F.jsxDEV(F.Fragment,{children:[F.jsxDEV("div",{className:"ws-commit-head",children:[F.jsxDEV("div",{className:"ws-commit-title",children:[F.jsxDEV("h3",{children:QH(C)},void 0,!1,void 0,this),F.jsxDEV("p",{className:"ws-commit-stat",children:[F.jsxDEV(Z0,{name:"file-diff",size:16},void 0,!1,void 0,this)," ",l0(y.length,"changed record"),D.added?F.jsxDEV("span",{className:"plus",children:[" +",D.added]},void 0,!0,void 0,this):null,D.removed?F.jsxDEV("span",{className:"minus",children:[" −",D.removed]},void 0,!0,void 0,this):null,D.changed?F.jsxDEV("span",{className:"dot",children:[" •",D.changed]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),F.jsxDEV("p",{className:"mode ws-commit-meta",children:[F.jsxDEV("code",{children:C.name},void 0,!1,void 0,this)," · ",F.jsxDEV(j0,{iso:C.createdAt},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("p",{className:"ws-commit-who",children:[["Owner",C.owner??(C.cutBy&&/^(token|token:read)$|^key:(?!.* for:)/.test(C.cutBy)?"no person: a service’s":"unrecorded")],["Cut by",C.cutBy?C.pushedBy&&C.applied===null&&C.cutBy==="machine"?"the machine it was cut on":zU(C.cutBy):"unrecorded"],...C.pushedBy?[["Pushed by",zU(C.pushedBy)]]:[]].map(([u,b])=>F.jsxDEV("span",{children:[F.jsxDEV("span",{className:"mode",children:u},void 0,!1,void 0,this)," ",b]},u,!0,void 0,this))},void 0,!1,void 0,this),C.pushedBy?F.jsxDEV("p",{className:"mode ws-commit-meta",children:C.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),F.jsxDEV("button",{type:"button",onClick:()=>V(!0),title:"Where it went, the checks, the approvals; Verify, Approve and Deploy",children:[F.jsxDEV("span",{className:`badge cs-${x.tone}`,children:x.label},void 0,!1,void 0,this),F.jsxDEV("span",{className:`badge cs-${E.tone}`,children:E.label},void 0,!1,void 0,this),"Review…"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("div",{className:"ws-two inner",children:[F.jsxDEV("div",{className:"ws-files",children:F.jsxDEV(LO,{records:y,...N?{selected:N.key}:{},onPick:w,label:"Records it changed"},void 0,!1,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("div",{className:"ws-detail",children:N?F.jsxDEV(WO,{record:N,history:v.state==="ok"?v.data.entries:v.state==="error"?[]:null},void 0,!1,void 0,this):F.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),F.jsxDEV(E5,{open:P,onClose:()=>V(!1),title:`Review: ${QH(C)}`,wide:!0,children:[F.jsxDEV($O,{name:Q,token:U,signsAs:H,c:C,canWrite:Y,rooted:W,refused:L,onChanged:M,part:"head",required:A},`h:${C.name}`,!1,void 0,this),F.jsxDEV($O,{name:Q,token:U,signsAs:H,c:C,canWrite:Y,rooted:W,refused:L,onChanged:M,part:"review",required:A},`r:${C.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 ZV({name:Q,token:U,vendors:Z,vendor:K,tick:H}){let[Y,W]=F1.useState(nR*4),[L,M]=F1.useState(""),[O,T]=F1.useState(null),A=y0(U,`/-/${Q}/timeline?limit=${Y}${K?`&twin=${encodeURIComponent(K)}`:""}`,Math.floor(H/2)),R=A.state==="ok"?NV(A.data.entries):[],w=[...new Set(R.map((D)=>Q4(D.entry).what))].sort(),P=R.filter((D)=>!L||Q4(D.entry).what===L),V=P.find((D)=>S9(D)===O)??P[0],S=(D)=>(x)=>{x.preventDefault(),T(null),f0([...Q.split("/"),"~","events",...D?[D]:[]])},C=V?.entry.input&&typeof V.entry.input==="object"?V.entry.input.body:void 0,y=V?tj(V.entry.traceparent):null,N=V?eR(V):null,v=V?OV(V.entry):[];return F.jsxDEV("div",{className:"ws-events",children:[F.jsxDEV("div",{className:"ws-filterbar",children:[F.jsxDEV("nav",{className:"ws-seg","aria-label":"Vendor",children:[F.jsxDEV("a",{href:`${n1}/${Q}/~/events`,className:!K?"on":void 0,"aria-current":!K?"page":void 0,onClick:S(),children:"All"},void 0,!1,void 0,this),Z.map((D)=>F.jsxDEV("a",{href:`${n1}/${Q}/~/events/${D}`,className:K===D?"on":void 0,"aria-current":K===D?"page":void 0,onClick:S(D),children:[F.jsxDEV(q2,{vendor:D},void 0,!1,void 0,this),s1(D)]},D,!0,void 0,this))]},void 0,!0,void 0,this),F.jsxDEV("select",{"aria-label":"Operation",value:L,onChange:(D)=>{M(D.target.value),T(null)},children:[F.jsxDEV("option",{value:"",children:"Every operation"},void 0,!1,void 0,this),w.map((D)=>F.jsxDEV("option",{value:D,children:D},D,!1,void 0,this))]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("div",{className:"ws-grid-wrap",children:[F.jsxDEV(r2,{load:A,what:"the events",lines:6},void 0,!1,void 0,this),F.jsxDEV("table",{className:"ws-grid","aria-label":"Events",children:[F.jsxDEV("thead",{children:F.jsxDEV("tr",{children:[F.jsxDEV("th",{children:"Time"},void 0,!1,void 0,this),F.jsxDEV("th",{children:"Vendor"},void 0,!1,void 0,this),F.jsxDEV("th",{children:"What"},void 0,!1,void 0,this),F.jsxDEV("th",{children:"Record"},void 0,!1,void 0,this),F.jsxDEV("th",{children:"By"},void 0,!1,void 0,this),F.jsxDEV("th",{children:"Receipt"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("tbody",{children:P.map((D)=>{let x=Q4(D.entry),E=eR(D),u=V&&S9(D)===S9(V);return F.jsxDEV("tr",{className:u?"on":void 0,"aria-selected":u,onClick:()=>T(S9(D)),children:[F.jsxDEV("td",{className:"mono",children:F.jsxDEV(j0,{iso:D.entry.occurredAt,time:!0},void 0,!1,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("td",{children:F.jsxDEV("span",{className:"vendor-cell",children:[F.jsxDEV(q2,{vendor:D.twin},void 0,!1,void 0,this),s1(D.twin)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("td",{children:F.jsxDEV("b",{children:x.what},void 0,!1,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("td",{className:"ws-cell-clip",children:x.label?`“${x.label}”`:F.jsxDEV("code",{children:i3(D.entry)},void 0,!1,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("td",{className:"mode",children:dJ(D.entry,D.caller)},void 0,!1,void 0,this),F.jsxDEV("td",{children:E?F.jsxDEV("span",{className:E.bad?"badge cs-bad":E.status==="deployed"?"badge cs-done":"badge",children:E.status},void 0,!1,void 0,this):F.jsxDEV("span",{className:"mode",children:FO(D.entry)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},S9(D),!0,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-event-detail",children:V?F.jsxDEV(F.Fragment,{children:[F.jsxDEV("div",{className:"ws-event-line",children:[F.jsxDEV("span",{className:"badge",children:RO(V.entry)},void 0,!1,void 0,this),N?F.jsxDEV("span",{className:N.bad?"badge cs-bad":"badge cs-good",children:N.status},void 0,!1,void 0,this):null,F.jsxDEV("code",{children:[V.entry.subject.type,":",i3(V.entry)]},void 0,!0,void 0,this),F.jsxDEV("span",{className:"mode",children:[F.jsxDEV(j0,{iso:V.entry.occurredAt},void 0,!1,void 0,this)," · ",dJ(V.entry,V.caller)]},void 0,!0,void 0,this),y?F.jsxDEV("a",{href:`${n1}/${Q}/~/trace/${y.trace}`,onClick:(D)=>{D.preventDefault(),f0([...Q.split("/"),"~","trace",y.trace])},children:"Its trace →"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),F.jsxDEV("div",{className:"ws-event-panes",children:[F.jsxDEV("div",{role:"region","aria-label":"The request",children:[F.jsxDEV("h4",{children:"Request"},void 0,!1,void 0,this),C!==void 0?F.jsxDEV(wV,{body:C},void 0,!1,void 0,this):F.jsxDEV("p",{className:"mode",children:"No request body: the World or the vendor wrote it."},void 0,!1,void 0,this),v.length?F.jsxDEV(F.Fragment,{children:[F.jsxDEV("h4",{children:"Usage"},void 0,!1,void 0,this),F.jsxDEV("dl",{className:"fields",children:v.map(([D,x])=>F.jsxDEV(F1.default.Fragment,{children:[F.jsxDEV("dt",{children:D},void 0,!1,void 0,this),F.jsxDEV("dd",{children:x},void 0,!1,void 0,this)]},D,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),F.jsxDEV("div",{role:"region","aria-label":"What it wrote",children:[F.jsxDEV("h4",{children:"Written"},void 0,!1,void 0,this),F.jsxDEV(IO,{fields:V.entry.fields},void 0,!1,void 0,this),F.jsxDEV("h4",{children:V.copies.length?"Receipts":"Receipt"},void 0,!1,void 0,this),F.jsxDEV("p",{className:"mode",children:V.copies.length?V.copies.map((D)=>D.entry.receipt?.status??"landed copy").join(" · "):PV(V.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):F.jsxDEV("p",{className:"mode pad",children:"Nothing written here yet."},void 0,!1,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("div",{className:"ws-foot mode",children:[F.jsxDEV("span",{children:[V?`${P.indexOf(V)+1} of ${P.length}`:P.length," events",K?` at ${s1(K)}`:""]},void 0,!0,void 0,this),A.state==="ok"&&A.data.next?F.jsxDEV("button",{type:"button",onClick:()=>W((D)=>D+nR*4),children:"Load older"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function FV({name:Q,token:U,id:Z}){let K=/^[0-9a-f]{32}$/.test(Z),H=y0(U,K?`/-/${Q}/timeline?trace=${Z}&limit=500`:null),Y=H.state==="ok"?[...H.data.entries].sort((A,R)=>-TO(A,R)):[],[W,L]=F1.useState(null),M=Y[0]?Date.parse(Y[0].entry.occurredAt):0,O=Y.length?Math.max(1,Date.parse(Y[Y.length-1].entry.occurredAt)-M):1,T=[...new Set(Y.map((A)=>A.twin))];return F.jsxDEV("div",{className:"ws-sheet ws-trace",children:[F.jsxDEV("p",{className:"crumbs-line",children:F.jsxDEV("a",{href:`${n1}/${Q}/~/events`,onClick:(A)=>{A.preventDefault(),f0([...Q.split("/"),"~","events"])},children:[F.jsxDEV(Z0,{name:"arrow-left",size:16},void 0,!1,void 0,this)," Events"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("h2",{children:[Y[0]?`${Q4(Y[0].entry).what} …`:"Trace"," ",F.jsxDEV("code",{className:"mode",children:Z.slice(0,12)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),!K?F.jsxDEV("p",{role:"alert",children:[Z?`${Z} is not a trace id`:"No trace named",": a W3C trace id is 32 hex characters."]},void 0,!0,void 0,this):F.jsxDEV(r2,{load:H,what:"the trace"},void 0,!1,void 0,this),Y.length?F.jsxDEV("p",{className:"ws-trace-meta",children:["Started ",F.jsxDEV("b",{children:F.jsxDEV(j0,{iso:Y[0].entry.occurredAt},void 0,!1,void 0,this)},void 0,!1,void 0,this)," · Took ",F.jsxDEV("b",{children:[O," ms"]},void 0,!0,void 0,this)," · Vendors ",F.jsxDEV("b",{children:T.map(s1).join(", ")},void 0,!1,void 0,this)," · Writes ",F.jsxDEV("b",{children:Y.length},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,H.state==="ok"&&Y.length===0?F.jsxDEV(X9,{title:"Nothing in this World carries this trace",children:F.jsxDEV("p",{children:["An app instrumented with OpenTelemetry sends a ",F.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,Y.length?F.jsxDEV("div",{className:"ws-spans",role:"table","aria-label":"The trace's writes",children:[F.jsxDEV("div",{className:"ws-span head",role:"row",children:[F.jsxDEV("span",{role:"columnheader",children:"Vendor and what"},void 0,!1,void 0,this),F.jsxDEV("span",{role:"columnheader",className:"ws-ticks",children:[F.jsxDEV("span",{children:"0 ms"},void 0,!1,void 0,this),F.jsxDEV("span",{children:[Math.round(O/2)," ms"]},void 0,!0,void 0,this),F.jsxDEV("span",{children:[O," ms"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Y.map((A)=>{let R=Date.parse(A.entry.occurredAt)-M,w=S9(A),P=Q4(A.entry);return F.jsxDEV(F1.default.Fragment,{children:[F.jsxDEV("div",{className:W===w?"ws-span on":"ws-span",role:"row",onClick:()=>L(W===w?null:w),children:[F.jsxDEV("span",{role:"cell",className:"ws-span-name",children:[F.jsxDEV(q2,{vendor:A.twin},void 0,!1,void 0,this),F.jsxDEV("b",{children:s1(A.twin)},void 0,!1,void 0,this)," ",F.jsxDEV("span",{className:"mode",children:[P.what,P.label?` “${P.label}”`:""]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("span",{role:"cell",className:"ws-span-track",children:[F.jsxDEV("span",{className:"ws-span-dot",style:{left:`${R/O*100}%`}},void 0,!1,void 0,this),F.jsxDEV("span",{className:"ws-span-at mode",style:{left:`${R/O*100}%`},children:["+",R," ms"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),W===w?F.jsxDEV("div",{className:"ws-span-detail",children:[F.jsxDEV("p",{className:"mode",children:[F.jsxDEV("code",{children:RO(A.entry)},void 0,!1,void 0,this)," on ",F.jsxDEV("code",{children:[A.entry.subject.type,":",i3(A.entry)]},void 0,!0,void 0,this)," · ",dJ(A.entry,A.caller)," · ",FO(A.entry)]},void 0,!0,void 0,this),F.jsxDEV(IO,{fields:A.entry.fields},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},w,!0,void 0,this)})]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)}function XV({name:Q,token:U,vendor:Z,withScreens:K,tick:H}){let Y=y0(U,`/-/${Q}/checkpoint/${Z}`,Math.floor(H/6)),W=Y.state==="ok"?Y.data.tree.filter((v)=>v.deleted!==!0):[],L=[...new Set(W.map((v)=>v.type))].map((v)=>({type:v,count:W.filter((D)=>D.type===v).length})).sort((v,D)=>Number(v.type.startsWith("_"))-Number(D.type.startsWith("_"))||$7(v.type).localeCompare($7(D.type))),[M,O]=F1.useState(null),[T,A]=F1.useState(null),R=L.some((v)=>v.type===M)?M:L[0]?.type,w=W.filter((v)=>v.type===R),P=w.find((v)=>v.id===T)??w[0],V=["name","email","title","text","description","subject","amount","percent_off","unit_amount","currency","status","channel","customer","product"],S=new Set(["id","type","object","livemode","created","updated","updatedAt","deleted"]),C=(v)=>!S.has(v)&&w.some((D)=>D[v]!==void 0&&D[v]!==null&&typeof D[v]!=="object"),y=[...new Set(w.flatMap((v)=>Object.keys(v)))],N=[...V.filter(C),...y.filter((v)=>!V.includes(v)&&C(v))].slice(0,4);return F.jsxDEV("div",{className:"ws-table-app",children:[F.jsxDEV("nav",{className:"ws-tables","aria-label":`${s1(Z)}'s records`,children:[F.jsxDEV("div",{className:"ws-list-head",children:F.jsxDEV("span",{className:"vendor-cell",children:[F.jsxDEV(q2,{vendor:Z},void 0,!1,void 0,this),s1(Z)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),F.jsxDEV(r2,{load:Y,what:"what it stores",lines:4},void 0,!1,void 0,this),F.jsxDEV("p",{className:"menu-label",children:"Stores"},void 0,!1,void 0,this),L.map((v)=>F.jsxDEV("a",{href:`#${v.type}`,className:R===v.type?"on":void 0,"aria-current":R===v.type?"true":void 0,onClick:(D)=>{D.preventDefault(),O(v.type),A(null)},children:[F.jsxDEV(Z0,{name:"table-2",size:16},void 0,!1,void 0,this),F.jsxDEV("span",{children:$7(v.type)},void 0,!1,void 0,this),F.jsxDEV("span",{className:"count",children:v.count},void 0,!1,void 0,this)]},v.type,!0,void 0,this)),F.jsxDEV("p",{className:"menu-label",children:"Also"},void 0,!1,void 0,this),F.jsxDEV("a",{href:`${n1}/${Q}/~/events/${Z}`,onClick:(v)=>{v.preventDefault(),f0([...Q.split("/"),"~","events",Z])},children:[F.jsxDEV(Z0,{name:"activity",size:16},void 0,!1,void 0,this),F.jsxDEV("span",{children:"Its events"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),K?F.jsxDEV("a",{href:`${n1}/${Q}/~/screens/${Z}`,onClick:(v)=>{v.preventDefault(),f0([...Q.split("/"),"~","screens",Z])},children:[F.jsxDEV(Z0,{name:"monitor",size:16},void 0,!1,void 0,this),F.jsxDEV("span",{children:"Its screens"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),F.jsxDEV("div",{className:"ws-grid-wrap",children:[Y.state==="ok"&&L.length===0?F.jsxDEV(X9,{title:`${s1(Z)} stores nothing yet`,children:F.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,w.length?F.jsxDEV("table",{className:"ws-grid","aria-label":`${$7(R??"")} records`,children:[F.jsxDEV("thead",{children:F.jsxDEV("tr",{children:[F.jsxDEV("th",{children:"id"},void 0,!1,void 0,this),N.map((v)=>F.jsxDEV("th",{children:v},v,!1,void 0,this)),F.jsxDEV("th",{children:"updated"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("tbody",{children:w.map((v)=>F.jsxDEV("tr",{className:P?.id===v.id?"on":void 0,"aria-selected":P?.id===v.id,onClick:()=>A(v.id),children:[F.jsxDEV("td",{children:F.jsxDEV("code",{children:v.id},void 0,!1,void 0,this)},void 0,!1,void 0,this),N.map((D)=>F.jsxDEV("td",{className:"ws-cell-clip",children:v[D]===void 0||v[D]===null?F.jsxDEV("span",{className:"mode",children:"—"},void 0,!1,void 0,this):String(v[D])},D,!1,void 0,this)),F.jsxDEV("td",{className:"mode",children:typeof v.updatedAt==="string"?F.jsxDEV(j0,{iso:v.updatedAt},void 0,!1,void 0,this):"—"},void 0,!1,void 0,this)]},v.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),F.jsxDEV("aside",{className:"ws-record","aria-label":"The selected record",children:P?F.jsxDEV(F.Fragment,{children:[F.jsxDEV("div",{className:"ws-list-head",children:[F.jsxDEV("span",{children:$7(P.type)},void 0,!1,void 0,this),F.jsxDEV("code",{children:P.id},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("dl",{className:"ws-record-fields",children:Object.entries(P).filter(([v])=>v!=="type"&&v!=="id").map(([v,D])=>F.jsxDEV(F1.default.Fragment,{children:[F.jsxDEV("dt",{children:v},void 0,!1,void 0,this),F.jsxDEV("dd",{children:F.jsxDEV(d3,{v:D},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},v,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null},void 0,!1,void 0,this),F.jsxDEV("div",{className:"ws-foot mode",children:P?`${w.indexOf(P)+1} of ${l0(w.length,$7(R??"record"))}`:""},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function KV({name:Q,vendor:U,url:Z,mapError:K,holding:H,session:Y,retry:W}){return F.jsxDEV("div",{className:"ws-screen",children:[F.jsxDEV("div",{className:"ws-screen-bar",children:[F.jsxDEV("span",{className:"vendor-cell",children:[F.jsxDEV(q2,{vendor:U},void 0,!1,void 0,this),F.jsxDEV("b",{children:s1(U)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("span",{className:"mode",children:H},void 0,!1,void 0,this),F.jsxDEV("a",{href:`${n1}/${Q}/~/vendors/${U}`,onClick:(L)=>{L.preventDefault(),f0([...Q.split("/"),"~","vendors",U])},children:[F.jsxDEV(Z0,{name:"table-2",size:16},void 0,!1,void 0,this),"Its records"]},void 0,!0,void 0,this),Z?F.jsxDEV("a",{href:Z,target:"_blank",rel:"noopener noreferrer",children:[F.jsxDEV(Z0,{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),Y.state==="ok"&&Y.scope==="read"?F.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,K?F.jsxDEV("p",{role:"alert",className:"ws-screens-note",children:["The World did not say where its screens are: ",K]},void 0,!0,void 0,this):Y.state==="pending"||Z===void 0?F.jsxDEV("p",{className:"mode ws-screens-note",role:"status",children:"Opening…"},void 0,!1,void 0,this):null,Y.state==="error"?F.jsxDEV("p",{role:"alert",className:"ws-screens-note",children:["The World did not open its screens: ",Y.error," ",F.jsxDEV("button",{type:"button",onClick:W,children:"Try again"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,Y.state==="ok"&&Z===null?F.jsxDEV("p",{className:"mode ws-screens-note",children:[s1(U),"'s pack lists no screens."]},void 0,!0,void 0,this):null,Y.state==="ok"&&Z?F.jsxDEV("iframe",{title:`${s1(U)}, as this World shows it`,src:Z},U,!1,void 0,this):null]},void 0,!0,void 0,this)}function HV({name:Q,token:U,who:Z,scope:K}){let[H,Y]=F1.useState(0),W=y0(U,`/-/${Q}/twins`),L=y0(U,`/-/${Q}/rules`,H),M=L.state==="ok"?L.data.changesets:null,[O,T]=F1.useState(null),[A,R]=F1.useState(null),[w,P]=F1.useState(!1),[V,S]=F1.useState([]),C=O??M?.approvals??1,y=A??M?.summary??"required",N=M!==null&&(C!==(M.approvals??1)||y!==(M.summary??"required")),v=(m,s)=>{if(S((U1)=>[{ok:m,text:s,at:new Date().toISOString(),n:++aJ},...U1].slice(0,3)),!m)e0(s,"error")},D=async(m)=>{m.preventDefault(),P(!0);try{let s=await O0(U,`/-/${Q}/rules`,{method:"PUT",body:JSON.stringify({changesets:{approvals:C,summary:y}})});if(!s.ok){v(!1,`Save: ${await T5(s)}`);return}v(!0,`Saved: ${C===0?"no approval":l0(C,"approval")} before a deploy; a summary ${y==="required"?"required":"generated when none is given"}.`),T(null),R(null),Y((U1)=>U1+1)}finally{P(!1)}},x={gated:"a person deploys an approved changeset",auto:"a push deploys at once",hold:"nothing deploys"},E=Z.person?F.jsxDEV(F.Fragment,{children:[F.jsxDEV("b",{children:Z.person},void 0,!1,void 0,this),Z.local?", signed in on this machine":""]},void 0,!0,void 0,this):Z.local?F.jsxDEV(F.Fragment,{children:[F.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):Z.admin?F.jsxDEV(F.Fragment,{children:F.jsxDEV("b",{children:"the host's admin"},void 0,!1,void 0,this)},void 0,!1,void 0,this):F.jsxDEV(F.Fragment,{children:[F.jsxDEV("b",{children:"this token"},void 0,!1,void 0,this),", a service"]},void 0,!0,void 0,this),u=W.state==="ok"?W.data.twins.filter((m)=>m.root?.url):[],b=K!=="write"?"This session reads the World; it changes no rules":null;return F.jsxDEV(F.Fragment,{children:[F.jsxDEV("h3",{className:"settings-head",children:"Changesets"},void 0,!1,void 0,this),F.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),F.jsxDEV(r2,{load:L,what:"the rules",lines:2},void 0,!1,void 0,this),F.jsxDEV("form",{className:"ws-rules",onSubmit:(m)=>void D(m),"aria-label":"Changeset rules",children:[F.jsxDEV("div",{className:"ws-rule",children:[F.jsxDEV("h4",{children:"Recorded as"},void 0,!1,void 0,this),F.jsxDEV("p",{children:["What you cut here is recorded as ",E,". 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),F.jsxDEV("div",{className:"ws-rule",children:[F.jsxDEV("h4",{children:"A cut's summary"},void 0,!1,void 0,this),F.jsxDEV("fieldset",{className:"choice",disabled:Boolean(b)||M===null,children:[F.jsxDEV("label",{className:"check",children:[F.jsxDEV("input",{type:"radio",name:"summary",checked:y==="required",onChange:()=>R("required")},void 0,!1,void 0,this)," ",F.jsxDEV("span",{children:"Required: whoever cuts says what it does and why"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("label",{className:"check",children:[F.jsxDEV("input",{type:"radio",name:"summary",checked:y==="generated",onChange:()=>R("generated")},void 0,!1,void 0,this)," ",F.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),F.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),F.jsxDEV("div",{className:"ws-rule",children:[F.jsxDEV("h4",{children:"Ready to deploy"},void 0,!1,void 0,this),F.jsxDEV("ul",{className:"ws-rule-list",children:F.jsxDEV("li",{children:[F.jsxDEV(Z0,{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),F.jsxDEV("label",{className:"ws-rule-row",children:[F.jsxDEV("span",{children:"Approved by"},void 0,!1,void 0,this),F.jsxDEV("select",{value:C,onChange:(m)=>T(Number(m.target.value)),disabled:Boolean(b)||M===null,"aria-label":"Approvals required",children:[0,1,2,3,4,5].map((m)=>F.jsxDEV("option",{value:m,children:m===0?"no one: verified is enough":m===1?"1 person":`${m} different people`},m,!1,void 0,this))},void 0,!1,void 0,this),F.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),F.jsxDEV("div",{className:"ws-rule",children:[F.jsxDEV("h4",{children:"Deploys to"},void 0,!1,void 0,this),W.state==="ok"&&u.length===0?F.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,u.length?F.jsxDEV("ul",{className:"ws-rule-list",children:u.map((m)=>F.jsxDEV("li",{children:[F.jsxDEV(q2,{vendor:m.twin},void 0,!1,void 0,this),s1(m.twin),": ",x[m.root.deploy??"gated"]??"gated"]},m.twin,!0,void 0,this))},void 0,!1,void 0,this):null,F.jsxDEV("p",{className:"mode",children:[F.jsxDEV("a",{href:`${n1}/${Q}/~/settings/services`,onClick:(m)=>{m.preventDefault(),f0([...Q.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),F.jsxDEV(r6,{log:V,name:Q},void 0,!1,void 0,this),F.jsxDEV("div",{className:"row-actions",children:[F.jsxDEV("button",{type:"submit",className:"primary",disabled:Boolean(b)||w||!N,title:b??void 0,children:w?"Saving…":"Save"},void 0,!1,void 0,this),N?F.jsxDEV("button",{type:"button",onClick:()=>{T(null),R(null)},children:"Cancel"},void 0,!1,void 0,this):null,b?F.jsxDEV("span",{className:"mode",children:[b,"."]},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 YV({who:Q,scope:U,snapshot:Z,portal:K,onSignOut:H}){let Y=U==="write"?"Reads and changes this World":U==="read"?"Reads this World; changes nothing":"…",[W,L]=Z?["A snapshot",`of ${Z.parent}, read only`]:Q.local&&Q.person?[Q.person,"Signed in on this machine: this World is served here, and acts as you"]:Q.local?["This machine","Served here, with no one signed in: what you do is recorded as this machine"]:Q.person?[Q.person,K?`Signed in through ${new URL(K).host}`:"Signed in"]:Q.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 F.jsxDEV(F.Fragment,{children:[F.jsxDEV("h3",{className:"settings-head",children:"Account"},void 0,!1,void 0,this),F.jsxDEV("div",{className:"ws-account",children:[F.jsxDEV("span",{className:"ws-account-face","aria-hidden":"true",children:F.jsxDEV(Z0,{name:Q.person?"user":Q.local?"monitor":Z?"clock":"key-round",size:20},void 0,!1,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("div",{className:"cell-label",children:[F.jsxDEV("b",{children:W},void 0,!1,void 0,this),F.jsxDEV("small",{children:L},void 0,!1,void 0,this),F.jsxDEV("small",{children:Y},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Q.local||Z?null:F.jsxDEV("p",{children:F.jsxDEV("button",{type:"button",onClick:H,children:[F.jsxDEV(Z0,{name:"log-out",size:16},void 0,!1,void 0,this),Q.person?"Sign out":Q.admin?"Sign out of the host":"Use another token"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),K&&Q.person?F.jsxDEV("p",{className:"mode",children:["Your profile, orgs and keys are on ",F.jsxDEV("a",{href:`${K}/`,children:new URL(K).host},void 0,!1,void 0,this),"."]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)}function zV({name:Q,token:U,view:Z,sub:K,arg:H,win:Y,who:W,snapshot:L,onReturn:M,onSignOut:O,worlds:T,session:A,retry:R,twins:w,map:P,branches:V,clock:S,canWrite:C,refused:y,signsAs:N,opens:v,tick:D,admin:x,onRemoved:E,onClock:u,scope:b}){let m=SO(Q,U,D,y),[s,U1]=F1.useState(0),Q1=s*1e5+Math.floor(D/2),h=y0(U,`/-/${Q}/diff`,Q1),g=y0(U,`/-/${Q}/changesets`,Q1),p=y0(U,`/-/${Q}/rules`,Q1),[c,l]=F1.useState(null),o=(A1)=>(e1)=>{e1?.preventDefault(),f0([...Q.split("/"),"~",...A1])},k=w.state==="ok"?w.data.twins.map((A1)=>A1.twin):[],t=new Map((P.state==="ok"?P.data.twins:[]).flatMap((A1)=>{let e1=$V(Q,A1);return e1?[[A1.twin,e1]]:[]})),_1=[...t.keys()],a=P.state==="ok"?P.data.twins.filter((A1)=>A1.root).map((A1)=>A1.twin):[],H1=(A1)=>P.state==="ok"?(P.data.twins.find((e1)=>e1.twin===A1)?.resources??[]).reduce((e1,k1)=>e1+k1.count,0):0,O1=V?.state==="ok"&&V.data.checkedOut||Q.split("/")[1],L1=F1.useMemo(()=>{if(h.state!=="ok")return[];let A1=new Map;for(let e1 of h.data.changes){let k1=`${e1.twin}:${e1.entry.subject.type}:${e1.entry.subject.id}`,g0=A1.get(k1)??{key:k1,twin:e1.twin,writes:[]};g0.writes.push(e1.entry),A1.set(k1,g0)}return[...A1.values()]},[h]),T1=L1.find((A1)=>A1.key===c)??L1[0],G1=y0(U,Z==="changes"&&T1?`/-/${Q}/log/${T1.twin}`:null,Q1),R1=h.state==="ok"?h.data.changes.length:0,f1=m.waiting.length,z1=m.there,C1=m.origin.state==="ok"?m.origin.data.origin:null,b1=!C?"This session reads the World; it changes nothing":!z1?"No remote: name one in Settings › Remote":null,c1=(A1,e1,k1,g0,_0,t0)=>F.jsxDEV("a",{href:`${n1}/${Q}/~/${g0}`,className:A1?"on":void 0,"aria-current":A1?"page":void 0,onClick:_0,children:[e1,F.jsxDEV("span",{children:k1},void 0,!1,void 0,this),t0?F.jsxDEV("span",{className:"count",children:t0},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),D1=(A1)=>{A1.currentTarget.closest("details")?.removeAttribute("open")};return F.jsxDEV("div",{className:"ws",children:[F.jsxDEV("div",{className:"ws-bar",role:"toolbar","aria-label":`${Q} toolbar`,children:[F.jsxDEV("div",{className:"ws-left",children:[F.jsxDEV(HJ,{href:`${n1}/${Q}`,onClick:(A1)=>{A1.preventDefault(),o(["changes"])()}},void 0,!1,void 0,this),F.jsxDEV("details",{className:"menu ws-pick",children:[F.jsxDEV("summary",{title:"This World",children:[F.jsxDEV(Z0,{name:"globe",size:16},void 0,!1,void 0,this),F.jsxDEV("span",{className:"ws-pick-label",children:[F.jsxDEV("small",{children:"World"},void 0,!1,void 0,this),F.jsxDEV("b",{children:Q},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV(Z0,{name:"chevron-down",size:16},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("div",{className:"popover menu-list ws-world-menu",children:[W.local?null:F.jsxDEV(F.Fragment,{children:[F.jsxDEV("p",{className:"menu-label",children:"Worlds"},void 0,!1,void 0,this),T.map((A1)=>F.jsxDEV("a",{href:`${n1}/${A1}`,className:A1===Q?"on":void 0,onClick:(e1)=>{e1.preventDefault(),D1(e1),f0(A1.split("/"))},children:[A1===Q?F.jsxDEV(Z0,{name:"check",size:16},void 0,!1,void 0,this):F.jsxDEV(Z0,{name:"globe",size:16},void 0,!1,void 0,this),A1]},A1,!0,void 0,this)),F.jsxDEV("a",{href:`${O4()&&O4()!==P0?O4():""}${n1}/`,onClick:(A1)=>{if(O4()&&O4()!==P0)return;A1.preventDefault(),D1(A1),f0([])},children:[F.jsxDEV(Z0,{name:"layout-grid",size:16},void 0,!1,void 0,this),"All Worlds",t2()?` on ${new URL(t2()).host}`:""]},void 0,!0,void 0,this),F.jsxDEV("hr",{},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("p",{className:"menu-label",children:"Connect an app"},void 0,!1,void 0,this),t2()?F.jsxDEV(F.Fragment,{children:[F.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),F.jsxDEV("pre",{children:[c3,"/",Q,"/<vendor>"]},void 0,!0,void 0,this),F.jsxDEV(JH,{text:XU({platform:t2(),world:Q})},void 0,!1,void 0,this)]},void 0,!0,void 0,this):!W.local?F.jsxDEV(F.Fragment,{children:[F.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),F.jsxDEV("pre",{children:[c3,"/",Q,"/<vendor>"]},void 0,!0,void 0,this),F.jsxDEV(JH,{text:XU()},void 0,!1,void 0,this)]},void 0,!0,void 0,this):F.jsxDEV(F.Fragment,{children:[F.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),F.jsxDEV("pre",{children:"volter world run -- npm start"},void 0,!1,void 0,this),F.jsxDEV("p",{className:"ws-menu-text mode",children:["Or point an SDK at ",F.jsxDEV("code",{children:[c3,"/",Q,"/<vendor>"]},void 0,!0,void 0,this)," with the token in ",F.jsxDEV("code",{children:".volter/token"},void 0,!1,void 0,this),"."]},void 0,!0,void 0,this),F.jsxDEV(JH,{text:XU()},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("hr",{},void 0,!1,void 0,this),F.jsxDEV("a",{href:`${n1}/${Q}/~/settings`,onClick:(A1)=>{D1(A1),o(["settings"])(A1)},children:[F.jsxDEV(Z0,{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),F.jsxDEV(UV,{name:Q,token:U,branches:V,opens:v,refused:y,onChanged:u},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("div",{className:"ws-where",title:"Where this is",children:[F.jsxDEV("span",{children:Q},void 0,!1,void 0,this),F.jsxDEV("span",{className:"sep",children:":"},void 0,!1,void 0,this),F.jsxDEV("span",{children:O1},void 0,!1,void 0,this),F.jsxDEV("span",{className:"sep",children:":"},void 0,!1,void 0,this),C1?F.jsxDEV("a",{href:`${n1}/${Q}/~/remote`,onClick:o(["remote"]),children:["origin ",C1.namespace,f1?F.jsxDEV("b",{children:[" ↑",f1]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this):F.jsxDEV("a",{href:`${n1}/${Q}/~/remote`,onClick:o(["remote"]),children:"no remote"},void 0,!1,void 0,this),F.jsxDEV("span",{className:"sep",children:":"},void 0,!1,void 0,this),F.jsxDEV("a",{href:`${n1}/${Q}/~/settings/clock`,onClick:o(["settings","clock"]),children:S.state==="ok"?F.jsxDEV(F.Fragment,{children:[S.data.frozen?"stopped at ":"",F.jsxDEV(j0,{iso:S.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),F.jsxDEV("div",{className:"ws-right",children:[F.jsxDEV("button",{type:"button",className:"ws-btn",onClick:()=>void m.pull(),disabled:Boolean(b1)||m.busy!==null,title:b1??`Fetch what ${z1} has and move this branch onto it`,children:[F.jsxDEV(Z0,{name:"arrow-down-to-line",size:16},void 0,!1,void 0,this),m.busy==="Pull"?"Pulling…":"Pull"]},void 0,!0,void 0,this),F.jsxDEV("button",{type:"button",className:"ws-btn",onClick:()=>void m.push(),disabled:Boolean(b1)||m.busy!==null||f1===0,title:b1??(f1?`Push ${l0(f1,"changeset")} to ${z1}`:`Every changeset is at ${z1}`),children:[F.jsxDEV(Z0,{name:"arrow-up-from-line",size:16},void 0,!1,void 0,this),m.busy==="Push"?"Pushing…":"Push",f1?F.jsxDEV("span",{className:"ws-btn-count",children:f1},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),F.jsxDEV("button",{type:"button",className:"ws-btn icon-only","aria-label":"Settings",title:"Settings",onClick:()=>o(["settings"])(),children:F.jsxDEV(Z0,{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),L?F.jsxDEV("div",{className:"ws-banner",role:"region","aria-label":"Snapshot",children:[F.jsxDEV(Z0,{name:"clock",size:16},void 0,!1,void 0,this),F.jsxDEV("span",{children:["You are looking at ",F.jsxDEV("b",{children:L.parent},void 0,!1,void 0,this)," as it was at ",F.jsxDEV(j0,{iso:L.at},void 0,!1,void 0,this),": a read-only snapshot",L.expiresAt?F.jsxDEV(F.Fragment,{children:[", gone ",F.jsxDEV(j0,{iso:L.expiresAt},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,"."]},void 0,!0,void 0,this),F.jsxDEV("button",{type:"button",onClick:()=>void M(L),children:"Return to live"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,m.log.length?F.jsxDEV("div",{className:"ws-said",children:F.jsxDEV(r6,{log:m.log.slice(0,1),name:Q},void 0,!1,void 0,this)},void 0,!1,void 0,this):null,F.jsxDEV("div",{className:"ws-body",children:[F.jsxDEV("nav",{className:"ws-side","aria-label":`${Q} places`,children:[k.length?F.jsxDEV("a",{href:`${n1}/${Q}/~/screens`,className:Z==="screen"?"ws-screens-entry on":"ws-screens-entry",onClick:o(["screens"]),title:`The board: ${E8(k.map(s1))}`,children:[F.jsxDEV(Z0,{name:"layout-grid",size:16},void 0,!1,void 0,this),F.jsxDEV("span",{children:"Board"},void 0,!1,void 0,this),F.jsxDEV("span",{className:"ws-screens-marks",children:[k.slice(0,3).map((A1)=>F.jsxDEV(q2,{vendor:A1},A1,!1,void 0,this)),k.length>3?F.jsxDEV("span",{className:"more",children:["+",k.length-3]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null,F.jsxDEV("p",{className:"side-group",children:"Workspace"},void 0,!1,void 0,this),c1(Z==="changes"||Z==="history",F.jsxDEV(Z0,{name:"file-diff",size:16},void 0,!1,void 0,this),"Changes","changes",o(["changes"]),L1.length?String(L1.length):void 0),c1(Z==="events"&&!H||Z==="trace",F.jsxDEV(Z0,{name:"activity",size:16},void 0,!1,void 0,this),"Events","events",o(["events"])),F.jsxDEV("p",{className:"side-group",children:"Records"},void 0,!1,void 0,this),k.map((A1)=>F.jsxDEV(F1.default.Fragment,{children:c1(Z==="vendor"&&H===A1,F.jsxDEV(q2,{vendor:A1},void 0,!1,void 0,this),s1(A1),`vendors/${A1}`,o(["vendors",A1]),H1(A1)?String(H1(A1)):void 0)},A1,!1,void 0,this)),F.jsxDEV("p",{className:"side-group",children:"Remote"},void 0,!1,void 0,this),c1(!1,F.jsxDEV(Z0,{name:"cloud",size:16},void 0,!1,void 0,this),z1?"origin":"Name a remote…","remote",o(["remote"]),f1?`↑${f1}`:void 0)]},void 0,!0,void 0,this),F.jsxDEV("div",{className:"ws-main",role:"main",children:[Z==="changes"?F.jsxDEV("div",{className:"ws-status",children:[F.jsxDEV("div",{className:"ws-files",children:[F.jsxDEV(BO,{name:Q,view:"changes",changes:L1.length,changesets:g.state==="ok"?g.data.changesets.length:0},void 0,!1,void 0,this),F.jsxDEV("div",{className:"ws-list-head",children:[F.jsxDEV("span",{children:"Not in a changeset"},void 0,!1,void 0,this),F.jsxDEV("span",{className:"mode",children:h.state==="ok"?`${l0(L1.length,"record")} · ${l0(R1,"write")}`:""},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV(r2,{load:h,what:"the changes",lines:4},void 0,!1,void 0,this),F.jsxDEV(LO,{records:L1,...T1?{selected:T1.key}:{},onPick:l,label:"Changed records"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("div",{className:"ws-detail",children:[h.state==="ok"&&!T1?F.jsxDEV(X9,{title:"No changes on this branch",action:f1>0&&z1?F.jsxDEV("button",{type:"button",className:"primary",disabled:Boolean(b1)||m.busy!==null,onClick:()=>void m.push(),children:["Push ",l0(f1,"changeset")," to origin"]},void 0,!0,void 0,this):void 0,children:F.jsxDEV("p",{children:["What your app writes to this World lands here, record by record, to cut into a changeset. Everything since ",h.data.base.at?F.jsxDEV(j0,{iso:h.data.base.at},void 0,!1,void 0,this):F.jsxDEV("code",{children:h.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,T1?F.jsxDEV(WO,{record:T1,history:G1.state==="ok"?G1.data.entries:G1.state==="error"?[]:null},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),F.jsxDEV(uV,{pinned:!0,generated:p.state==="ok"&&p.data.changesets.summary==="generated",author:{face:F.jsxDEV(Z0,{name:W.person?"user":W.local?"monitor":"key-round",size:18},void 0,!1,void 0,this),who:W.person??(W.local?"This machine":W.admin?"The host's admin":"A token"),account:`${n1}/${Q}/~/settings/account`,branch:O1},name:Q,token:U,changes:R1,canWrite:C,refused:y,onCut:()=>{U1((A1)=>A1+1),l(null)}},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,Z==="history"?F.jsxDEV(GV,{name:Q,token:U,sets:g,changes:L1.length,withScreens:_1,required:p.state==="ok"?p.data.changesets.approvals??1:1,...K?{sub:K}:{},signsAs:N,canWrite:C,rooted:a,refused:y,onChanged:()=>U1((A1)=>A1+1)},void 0,!1,void 0,this):null,Z==="events"?F.jsxDEV(ZV,{name:Q,token:U,vendors:k,...H&&k.includes(H)?{vendor:H}:{},tick:D},H??"",!1,void 0,this):null,Z==="trace"?F.jsxDEV(FV,{name:Q,token:U,id:H??""},void 0,!1,void 0,this):null,Z==="vendor"&&H?F.jsxDEV(XV,{name:Q,token:U,vendor:H,withScreens:_1.includes(H),tick:D},H,!1,void 0,this):null,Z==="screen"&&H?F.jsxDEV(KV,{name:Q,vendor:H,url:P.state==="ok"?t.get(H)??null:void 0,...P.state==="error"?{mapError:P.error}:{},holding:LV(P.state==="ok"?P.data.twins.find((A1)=>A1.twin===H)?.resources??[]:[]),session:A,retry:R},H,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV(E5,{open:Y?.kind==="settings",onClose:()=>o(["changes"])(),title:"Settings",wide:"window",children:Y?.kind==="settings"?F.jsxDEV("div",{className:"ws-settings",children:[F.jsxDEV("nav",{"aria-label":"Settings",children:zO.map(([A1,e1,k1])=>F.jsxDEV("a",{href:`${n1}/${Q}/~/settings/${A1}`,className:Y.tab===A1?"on":void 0,"aria-current":Y.tab===A1?"page":void 0,onClick:o(["settings",A1]),children:[F.jsxDEV(Z0,{name:k1,size:16},void 0,!1,void 0,this),e1]},A1,!0,void 0,this))},void 0,!1,void 0,this),F.jsxDEV("div",{className:"ws-settings-pane",children:[b==="read"?F.jsxDEV("p",{className:"mode",children:[F.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,Y.tab==="account"?F.jsxDEV(YV,{who:W,scope:b,snapshot:L,portal:t2(),onSignOut:O},void 0,!1,void 0,this):null,Y.tab==="changesets"?F.jsxDEV(HV,{name:Q,token:U,who:W,scope:b},void 0,!1,void 0,this):null,Y.tab==="remote"?F.jsxDEV(EV,{name:Q,token:U,canWrite:C,tick:D,refused:y},void 0,!1,void 0,this):null,Y.tab==="access"||Y.tab==="services"||Y.tab==="checks"||Y.tab==="clock"?F.jsxDEV(xV,{name:Q,token:U,admin:x,canWrite:C,refused:y,onRemoved:E,only:Y.tab},void 0,!1,void 0,this):null,Y.tab==="vault"?F.jsxDEV(hV,{name:Q,token:U,canWrite:C,refused:y},void 0,!1,void 0,this):null,Y.tab==="appearance"?F.jsxDEV(F.Fragment,{children:[F.jsxDEV("h3",{className:"settings-head",children:"Appearance"},void 0,!1,void 0,this),F.jsxDEV(nj,{},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),F.jsxDEV(E5,{open:Y?.kind==="branches",onClose:()=>o(["changes"])(),title:"Branches",wide:!0,children:Y?.kind==="branches"?F.jsxDEV(MV,{name:Q,token:U,canWrite:C,branches:V,opens:v,...Y.open?{open:Y.open}:{},onChanged:u,refused:y},void 0,!1,void 0,this):null},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function JH({text:Q}){return F.jsxDEV("button",{type:"button",className:"agent-prompt-button",onClick:()=>{navigator.clipboard?.writeText(Q).then(()=>e0("Copied the prompt: paste it into your coding agent"),()=>e0("Could not copy the prompt","error"))},children:"Copy a prompt for your coding agent"},void 0,!1,void 0,this)}var HH=(Q)=>`${Q.url.replace(/\/+$/,"")}/${Q.namespace}`,WV=(Q)=>Q.filter((U)=>U.applied===null||U.applied.outcome==="refused"),LV=(Q,U=4)=>{let Z=[...Q].filter((K)=>K.count>0).sort((K,H)=>H.count-K.count);return Z.length?Z.slice(0,U).map((K)=>l0(K.count,K.type.replace(/^_+/,""))).join(" · ")+(Z.length>U?` · +${Z.length-U} more`:""):"nothing yet"},AO=F.jsxDEV("svg",{className:"branch-glyph",viewBox:"0 0 16 16",width:"14",height:"14","aria-hidden":"true",children:F.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 BV({name:Q,token:U,clock:Z,canWrite:K,onChanged:H,refused:Y,open:W}){let[L,M]=F1.useState(!1),[O,T]=F1.useState(""),[A,R]=F1.useState(""),[w,P]=F1.useState(null),[V,S]=F1.useState(!1),C=Z.state==="ok"?Z.data:null,y=async(x,E,u)=>{S(!0),P(null);try{let b=await O0(U,`/-/${Q}/${E}`,{method:E==="clock"?"PUT":"POST",body:JSON.stringify(u)});if(!b.ok){Y(b),P({ok:!1,text:await T5(b)});return}let m=await b.json();P({ok:!0,text:`${x} — the World is at ${new Date(m.at).toLocaleString()}`}),M(!1),H()}catch(b){P({ok:!1,text:`the World did not answer: ${b instanceof Error?b.message:String(b)}`})}finally{S(!1)}},N=(x)=>{x.preventDefault();let E=new Date(O);if(Number.isNaN(E.getTime())){P({ok:!1,text:"Pick a date and time."});return}if(C&&E.getTime()<Date.parse(C.at)){P({ok:!1,text:`The World's clock only moves forward: pick a time after ${new Date(C.at).toLocaleString()}.`});return}y("Clock set","clock",{at:E.toISOString()})},v=(x,E)=>{y(`Advanced ${E}`,"clock/advance",{by:x})},D=[["1h","1 hour"],["1d","1 day"],["7d","1 week"],["30d","30 days"]];return F.jsxDEV("div",{className:`clock${C?.frozen?" frozen":""}`,role:"region","aria-label":"World clock",children:[F.jsxDEV("p",{className:"clock-now",children:Z.state==="loading"?F.jsxDEV("span",{className:"mode",children:"clock…"},void 0,!1,void 0,this):Z.state==="error"?F.jsxDEV("span",{className:"mode",children:["Clock: ",Z.error]},void 0,!0,void 0,this):C.frozen?F.jsxDEV(F.Fragment,{children:[F.jsxDEV("span",{className:"badge",children:"Simulation"},void 0,!1,void 0,this)," World time ",F.jsxDEV("strong",{children:F.jsxDEV(j0,{iso:C.at},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):F.jsxDEV(F.Fragment,{children:["World time ",F.jsxDEV("strong",{children:F.jsxDEV(j0,{iso:C.at},void 0,!1,void 0,this)},void 0,!1,void 0,this)," ",F.jsxDEV("span",{className:"mode",children:"· real time"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),K&&C?F.jsxDEV("details",{className:W?"clock-more inline":"clock-more",open:W||void 0,children:[F.jsxDEV("summary",{children:"Simulate time…"},void 0,!1,void 0,this),F.jsxDEV("div",{className:W?void 0:"popover",children:[F.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),F.jsxDEV("div",{className:"clock-controls",children:[F.jsxDEV("button",{type:"button","aria-expanded":L,onClick:()=>{M(!L),T(v9(aR(C.at))),P(null)},children:"Set time…"},void 0,!1,void 0,this),F.jsxDEV("div",{role:"group","aria-label":"Advance the clock",className:"advance",children:[F.jsxDEV("span",{className:"mode",children:"Advance"},void 0,!1,void 0,this),D.map(([x,E])=>F.jsxDEV("button",{type:"button","aria-label":`Advance ${E}`,disabled:V||!C.frozen,title:C.frozen?void 0:"Set the time first: advancing moves a set clock",onClick:()=>v(x,E),children:E},x,!1,void 0,this)),F.jsxDEV("form",{className:"inline",onSubmit:(x)=>{if(x.preventDefault(),!/^\d+[smhd]$/.test(A.trim())){P({ok:!1,text:"Advance by a number and a unit: 90m, 12h, 3d."});return}v(A.trim(),`by ${A.trim()}`)},children:[F.jsxDEV("label",{className:"sr",children:["Advance by ",F.jsxDEV("input",{name:"advanceBy",value:A,onChange:(x)=>R(x.target.value),placeholder:"90m, 12h, 3d",size:9,disabled:!C.frozen},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("button",{type:"submit",disabled:V||!C.frozen,children:"Advance"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),!C.frozen?F.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,L?F.jsxDEV("form",{className:"inline","aria-label":"Set the World time",onSubmit:N,noValidate:!0,children:[F.jsxDEV("label",{children:["World time ",F.jsxDEV("input",{name:"worldTime",type:"datetime-local",value:O,min:v9(aR(C.at)),onChange:(x)=>T(x.target.value),required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("span",{className:"mode",children:Intl.DateTimeFormat().resolvedOptions().timeZone},void 0,!1,void 0,this),F.jsxDEV("button",{type:"submit",disabled:V,children:"Set time"},void 0,!1,void 0,this),F.jsxDEV("button",{type:"button",onClick:()=>M(!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,w?F.jsxDEV("p",{role:w.ok?"status":"alert",children:w.text},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}function AV({name:Q,token:U,clock:Z,refused:K}){let[H,Y]=F1.useState(!1),[W,L]=F1.useState(""),[M,O]=F1.useState(null),[T,A]=F1.useState(!1),R=Z.state==="ok"?Z.data.at:new Date().toISOString(),w=F1.useRef(null);return F1.useEffect(()=>{if(!H)return;let V=(C)=>{if(C.key==="Escape"&&!document.querySelector("dialog[open]"))Y(!1),w.current?.querySelector("button")?.focus()},S=(C)=>{if(!w.current?.contains(C.target))Y(!1)};return document.addEventListener("keydown",V),document.addEventListener("click",S),()=>{document.removeEventListener("keydown",V),document.removeEventListener("click",S)}},[H]),F.jsxDEV("div",{className:"as-of",ref:w,children:[F.jsxDEV("button",{type:"button","aria-expanded":H,title:"Open a read-only copy of this World as it was at a moment you pick",onClick:()=>{Y(!H),L(v9(R)),O(null)},children:"View an earlier moment…"},void 0,!1,void 0,this),H?F.jsxDEV("form",{className:"inline","aria-label":"View the World as of a past moment",onSubmit:async(V)=>{V.preventDefault(),O(null);let S=new Date(W);if(Number.isNaN(S.getTime())){O("Pick a date and time.");return}if(S.getTime()>Date.parse(R)){O(`That is after the World's present (${new Date(R).toLocaleString()}); a snapshot looks back.`);return}A(!0);try{let C=await O0(U,`/-/${Q}/branches`,{method:"POST",body:JSON.stringify({at:{instant:S.toISOString()},ttl:3600})});if(!C.ok){K(C),O(await T5(C));return}let y=await C.json();ZH({name:y.name,parent:Q,token:y.token,readToken:y.readToken,at:S.toISOString(),expiresAt:y.expiresAt??null,parentOrigin:P0,made:!0});let N=rJ(y.origin)?.origin;if(N&&N!==P0){KH(N,y.readToken,y.name,`${n1}/${y.name}`);return}f0(y.name.split("/"))}catch(C){O(`the World did not answer: ${C instanceof Error?C.message:String(C)}`)}finally{A(!1)}},noValidate:!0,children:[F.jsxDEV("label",{children:["As of ",F.jsxDEV("input",{name:"asOf",type:"datetime-local",value:W,max:v9(R),onChange:(V)=>L(V.target.value),required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("button",{type:"submit",disabled:T,children:T?"Opening…":"Open snapshot"},void 0,!1,void 0,this),F.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,M?F.jsxDEV("p",{role:"alert",children:M},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}function MO({name:Q,token:U,open:Z,onClose:K,onMade:H,refused:Y}){let W=(E)=>E.split("/").pop()??E,[L,M]=F1.useState(!1),[O,T]=F1.useState(null),[A,R]=F1.useState(""),[w,P]=F1.useState("now"),[V,S]=F1.useState(""),[C,y]=F1.useState("24"),[N,v]=F1.useState(!0);F1.useEffect(()=>{if(Z)T(null),S(v9(new Date().toISOString()))},[Z]);let D=async(E)=>{E.preventDefault(),T(null);let u=w==="at"?new Date(V):null;if(u&&Number.isNaN(u.getTime())){T("Pick a date and time, or make it as of now.");return}if(u&&u.getTime()>Date.now()){T("A branch is made as of now or a moment before it.");return}M(!0);let b=await O0(U,`/-/${Q}/branches`,{method:"POST",body:JSON.stringify({ttl:Math.round(Number(C)*3600),...u?{at:{instant:u.toISOString()}}:N?{live:!0}:{},...A.trim()?{label:A.trim()}:{}})}).catch(()=>null);if(M(!1),!b){T(`${P0} did not answer`);return}if(!b.ok){Y(b),T(await T5(b));return}let m=await b.json();ZH({name:m.name,parent:Q,token:m.token??"",readToken:m.readToken,at:(u??new Date).toISOString(),expiresAt:m.expiresAt??null,parentOrigin:P0,...m.origin?{origin:m.origin}:{}}),K(),R(""),e0(`Made ${W(m.name)}`),H()};return F.jsxDEV(E5,{open:Z,onClose:()=>{if(!L)K()},title:`New branch of ${W(Q)}`,footer:F.jsxDEV(F.Fragment,{children:[F.jsxDEV("button",{type:"button",onClick:()=>K(),disabled:L,children:"Cancel"},void 0,!1,void 0,this),F.jsxDEV("button",{type:"submit",form:"new-branch",className:"primary",disabled:L,children:L?"Making…":"Make branch"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:F.jsxDEV("form",{id:"new-branch",onSubmit:(E)=>void D(E),className:"stack",children:[F.jsxDEV("label",{children:[F.jsxDEV("span",{children:["Label ",F.jsxDEV("span",{className:"mode",children:"(optional)"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("input",{name:"branchLabel",value:A,onChange:(E)=>R(E.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),F.jsxDEV("fieldset",{className:"choice",children:[F.jsxDEV("legend",{children:"From"},void 0,!1,void 0,this),F.jsxDEV("label",{className:"check",children:[F.jsxDEV("input",{type:"radio",name:"branchWhen",checked:w==="now",onChange:()=>P("now")},void 0,!1,void 0,this)," ",F.jsxDEV("span",{children:"Now: the World as it is"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),w==="now"?F.jsxDEV("label",{className:"check sub",children:[F.jsxDEV("input",{type:"checkbox",name:"branchLive",checked:N,onChange:(E)=>v(E.target.checked)},void 0,!1,void 0,this)," ",F.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,F.jsxDEV("label",{className:"check",children:[F.jsxDEV("input",{type:"radio",name:"branchWhen",checked:w==="at",onChange:()=>P("at")},void 0,!1,void 0,this)," ",F.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),w==="at"?F.jsxDEV("input",{type:"datetime-local","aria-label":"As of",value:V,max:v9(new Date().toISOString()),onChange:(E)=>S(E.target.value)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),F.jsxDEV("label",{children:[F.jsxDEV("span",{children:"Goes away after"},void 0,!1,void 0,this),F.jsxDEV("select",{name:"branchLife",value:C,onChange:(E)=>y(E.target.value),children:[F.jsxDEV("option",{value:"1",children:"1 hour"},void 0,!1,void 0,this),F.jsxDEV("option",{value:"24",children:"1 day"},void 0,!1,void 0,this),F.jsxDEV("option",{value:"72",children:"3 days"},void 0,!1,void 0,this),F.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),O?F.jsxDEV("p",{role:"alert",children:O},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function MV({name:Q,token:U,canWrite:Z,branches:K,opens:H,open:Y,onChanged:W,refused:L,snapshotOf:M}){let O=y0(U,`/-/${Q}/clock`),T=(y)=>y.split("/").pop()??y,[A,R]=F1.useState(!1),w=(y)=>(N)=>{N.preventDefault(),f0([...Q.split("/"),"~","branches",...y?y.split("/"):[]])};if(!K)return F.jsxDEV("p",{className:"mode",children:"This host makes no branches of a World."},void 0,!1,void 0,this);let P=K.state==="ok"?K.data.branches:[],V=K.state==="ok"&&(K.data.named?.length??0)>0?K.data.named:[{name:T(Q),running:!0}],S=K.state==="ok"?K.data.checkedOut??T(Q):T(Q),C=async(y)=>{if(!await n4({title:`Remove the branch ${T(y)}?`,body:"Whoever holds its tokens loses it, and its history goes with it.",action:"Remove branch",danger:!0}))return;let N=await O0(U,`/-/${Q}/branches/${y}`,{method:"DELETE"}).catch((v)=>v);if(N instanceof Error){e0(`Remove ${T(y)}: the World did not answer (${N.message})`,"error");return}if(!N.ok){L(N),e0(`Remove ${T(y)}: ${await T5(N)}`,"error");return}YU(y),e0(`Removed ${T(y)}`),W(),f0([...Q.split("/"),"~","branches"])};if(Y){let y=Y.includes("/")?P.find((v)=>v.name===Y):void 0,N=Y.includes("/")?void 0:V.find((v)=>v.name===Y);return F.jsxDEV(F.Fragment,{children:[F.jsxDEV("p",{className:"crumbs-line",children:F.jsxDEV("a",{href:`${n1}/${Q}/~/branches`,onClick:w(),children:"← Branches"},void 0,!1,void 0,this)},void 0,!1,void 0,this),F.jsxDEV(r2,{load:K,what:"the branches"},void 0,!1,void 0,this),K.state==="ok"&&!y&&!N?F.jsxDEV("p",{className:"mode",children:["This World has no branch named ",Y,"."]},void 0,!0,void 0,this):null,y?F.jsxDEV(TV,{name:Q,b:y,canWrite:Z,opens:H(y.name),remove:()=>void C(y.name)},void 0,!1,void 0,this):null,N&&!y?F.jsxDEV(RV,{name:Q,token:U,b:N,served:N.name===S,canWrite:Z,canServe:K.state==="ok"&&Boolean(K.data.canServe)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}return F.jsxDEV("div",{"aria-labelledby":"branches",children:[F.jsxDEV("div",{className:"branches-head",children:[F.jsxDEV("p",{className:"lede",children:["Branch this World to look at it as it was, or to change it without touching ",F.jsxDEV("b",{children:S},void 0,!1,void 0,this),". Each branch's name opens its page."]},void 0,!0,void 0,this),Z?F.jsxDEV("div",{className:"head-actions",children:[M?null:F.jsxDEV(AV,{name:Q,token:U,clock:O,refused:L},void 0,!1,void 0,this),F.jsxDEV("button",{type:"button",className:"primary",onClick:()=>R(!0),children:"New branch"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),F.jsxDEV(r2,{load:K,what:"the branches"},void 0,!1,void 0,this),K.state==="ok"?F.jsxDEV("div",{className:"block",children:F.jsxDEV("table",{className:"dense","aria-label":"Branches",children:[F.jsxDEV("thead",{children:F.jsxDEV("tr",{children:[F.jsxDEV("th",{id:"branches",children:"Branch"},void 0,!1,void 0,this),F.jsxDEV("th",{children:"Parent"},void 0,!1,void 0,this),F.jsxDEV("th",{children:"As of"},void 0,!1,void 0,this),F.jsxDEV("th",{children:"Made"},void 0,!1,void 0,this),F.jsxDEV("th",{children:"Goes away"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("tbody",{children:[V.map((y)=>F.jsxDEV("tr",{children:[F.jsxDEV("td",{children:[F.jsxDEV("a",{href:`${n1}/${Q}/~/branches/${y.name}`,onClick:w(y.name),children:F.jsxDEV("b",{children:y.name},void 0,!1,void 0,this)},void 0,!1,void 0,this),y.name===S?F.jsxDEV(F.Fragment,{children:[" ",F.jsxDEV("span",{className:"badge live",children:"served here"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):y.running?null:F.jsxDEV(F.Fragment,{children:[" ",F.jsxDEV("span",{className:"badge",children:"stopped"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("td",{className:"mode",children:"—"},void 0,!1,void 0,this),F.jsxDEV("td",{className:"mode",children:"live"},void 0,!1,void 0,this),F.jsxDEV("td",{className:"mode",children:"—"},void 0,!1,void 0,this),F.jsxDEV("td",{className:"mode",children:"kept"},void 0,!1,void 0,this)]},`own:${y.name}`,!0,void 0,this)),P.map((y)=>F.jsxDEV("tr",{children:[F.jsxDEV("td",{children:F.jsxDEV("a",{href:`${n1}/${Q}/~/branches/${y.name}`,onClick:w(y.name),children:F.jsxDEV("b",{children:T(y.name)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("td",{children:T(y.from??Q)},void 0,!1,void 0,this),F.jsxDEV("td",{children:y.at?.instant?F.jsxDEV(j0,{iso:y.at.instant},void 0,!1,void 0,this):F.jsxDEV("span",{className:"mode",children:"live"},void 0,!1,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("td",{children:F.jsxDEV(j0,{iso:y.createdAt},void 0,!1,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("td",{children:y.expiresAt?F.jsxDEV(j0,{iso:y.expiresAt},void 0,!1,void 0,this):"kept"},void 0,!1,void 0,this)]},y.name,!0,void 0,this))]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this):null,F.jsxDEV(MO,{name:Q,token:U,open:A,onClose:()=>R(!1),onMade:W,refused:L},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function TV({name:Q,b:U,canWrite:Z,opens:K,remove:H}){let Y=(M)=>M.split("/").pop()??M,W=FH(U.name),L=y0(W,W?`/-/${U.name}/diff`:null);return F.jsxDEV("div",{className:"branch-page",children:[F.jsxDEV("div",{className:"changeset-head",children:[F.jsxDEV("h3",{children:[AO," ",Y(U.name)]},void 0,!0,void 0,this),F.jsxDEV("div",{className:"changeset-actions",children:[K?F.jsxDEV("button",{type:"button",className:"primary",onClick:()=>YO(U.name,U.name.split("/")),children:"Open"},void 0,!1,void 0,this):null,Z?F.jsxDEV("button",{type:"button",className:"danger-button",onClick:H,children:"Remove…"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("div",{className:"block",children:F.jsxDEV("dl",{className:"fields pad",children:[F.jsxDEV("dt",{children:"Name"},void 0,!1,void 0,this),F.jsxDEV("dd",{children:F.jsxDEV("code",{children:U.name},void 0,!1,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("dt",{children:"Parent"},void 0,!1,void 0,this),F.jsxDEV("dd",{children:Y(U.from??Q)},void 0,!1,void 0,this),F.jsxDEV("dt",{children:"As of"},void 0,!1,void 0,this),F.jsxDEV("dd",{children:U.at?.instant?F.jsxDEV(j0,{iso:U.at.instant},void 0,!1,void 0,this):"live: it keeps its parent's time"},void 0,!1,void 0,this),F.jsxDEV("dt",{children:"Made"},void 0,!1,void 0,this),F.jsxDEV("dd",{children:F.jsxDEV(j0,{iso:U.createdAt},void 0,!1,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("dt",{children:"Goes away"},void 0,!1,void 0,this),F.jsxDEV("dd",{children:U.expiresAt?F.jsxDEV(j0,{iso:U.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),!K?F.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,L.state==="ok"?F.jsxDEV(F.Fragment,{children:[F.jsxDEV("h4",{children:"Its changes"},void 0,!1,void 0,this),L.data.changes.length===0?F.jsxDEV("p",{className:"mode",children:"Nothing written on it since it branched."},void 0,!1,void 0,this):F.jsxDEV(DV,{changes:L.data.changes,idPrefix:`branch-${Y(U.name)}`},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)}function RV({name:Q,token:U,b:Z,served:K,canWrite:H,canServe:Y}){let[W,L]=F1.useState(!1),[M,O]=F1.useState(null),T=async()=>{L(!0),O(null);let A=await O0(U,`/-/${Q}/branches/${encodeURIComponent(Z.name)}/serve`,{method:"POST"}).catch(()=>null);if(A?.ok){location.reload();return}L(!1),O(A?await T5(A):`${P0} did not answer`)};return F.jsxDEV("div",{className:"branch-page",children:[F.jsxDEV("div",{className:"changeset-head",children:[F.jsxDEV("h3",{children:[AO," ",Z.name," ",K?F.jsxDEV("span",{className:"badge live",children:"served here"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),F.jsxDEV("div",{className:"changeset-actions",children:H&&Y&&!K?F.jsxDEV("button",{type:"button",className:"primary",disabled:W,onClick:()=>void T(),children:W?"Switching…":"Serve here"},void 0,!1,void 0,this):null},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("div",{className:"block",children:F.jsxDEV("dl",{className:"fields pad",children:[F.jsxDEV("dt",{children:"Name"},void 0,!1,void 0,this),F.jsxDEV("dd",{children:F.jsxDEV("code",{children:Z.name},void 0,!1,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("dt",{children:"Kind"},void 0,!1,void 0,this),F.jsxDEV("dd",{children:"one of this World's own branches"},void 0,!1,void 0,this),F.jsxDEV("dt",{children:"State"},void 0,!1,void 0,this),F.jsxDEV("dd",{children:Z.running?"running":"stopped"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),K?F.jsxDEV("p",{className:"mode",children:["This is the branch these pages show: its changes are on ",F.jsxDEV("a",{href:`${n1}/${Q}/~/changes`,onClick:(A)=>{A.preventDefault(),f0([...Q.split("/"),"~","changes"])},children:"Changes"},void 0,!1,void 0,this),"."]},void 0,!0,void 0,this):Y?F.jsxDEV("p",{className:"mode",children:["“Serve here” stops this one's twins and serves ",Z.name," in its place."]},void 0,!0,void 0,this):F.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),M?F.jsxDEV("p",{role:"alert",children:M},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}var nR=50,S9=(Q)=>`${Q.twin}:${Q.position}`,TO=(Q,U)=>Date.parse(U.entry.occurredAt)-Date.parse(Q.entry.occurredAt)||Q.twin.localeCompare(U.twin)||U.position-Q.position,zU=(Q)=>{if(!Q)return"someone";if(Q.startsWith("key:")){let[U,Z]=Q.slice(4).split(" for:");return Z?`${U}, for ${Z}`:U||"a key"}if(Q.startsWith("person:"))return Q.slice(7);return Q==="machine"?"this machine":Q==="person"?"a session with no name":Q==="token:read"?"the read-only token":Q==="token"?"the World's token":Q},dJ=(Q,U)=>{let Z=typeof U==="string"?U:typeof Q.caller==="string"?Q.caller:"";if(Z.startsWith("key:")&&Z.length>4)return`by ${zU(Z)}`;if(Z.startsWith("person:")&&Z.length>7)return`by ${Z.slice(7)}`;if(Z==="machine")return"by this machine";if(Z==="person")return"by a session with no name";if(Z==="key")return"by a key";if(Z==="token:read")return"by the read-only token";if(Z==="token")return"by the World's token";return Q.actor?.kind==="system"?"by the vendor":Q.actor?.id?`by ${Q.actor.id}`:"by an app"},RO=(Q)=>Q.operation??Q.op;function OV(Q){let U=Q.fields??{},Z=U.usage!==null&&typeof U.usage==="object"?U.usage:U,K=(...O)=>O.map((T)=>Z[T]??U[T]).find((T)=>typeof T==="number"),H=[],Y=K("prompt_tokens","input_tokens"),W=K("completion_tokens","output_tokens"),L=K("total_tokens");if(Y!==void 0)H.push(["tokens in",Y.toLocaleString()]);if(W!==void 0)H.push(["tokens out",W.toLocaleString()]);if(L!==void 0)H.push(["tokens in all",L.toLocaleString()]);let M=K("cost_usd","cost");if(M!==void 0)H.push(["cost",`$${M<0.01?M.toPrecision(2):M.toFixed(2)}`]);return H}function OO({text:Q,at:U=280}){if(Q.length<=U)return F.jsxDEV("span",{className:"text",children:Q},void 0,!1,void 0,this);return F.jsxDEV("details",{className:"folded",children:[F.jsxDEV("summary",{children:[F.jsxDEV("span",{className:"text",children:[Q.slice(0,U),"…"]},void 0,!0,void 0,this)," ",F.jsxDEV("span",{className:"mode",children:["show all ",Q.length.toLocaleString()," characters"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("span",{className:"text",children:Q},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function d3({v:Q}){if(typeof Q==="string")return F.jsxDEV(OO,{text:Q},void 0,!1,void 0,this);if(Q===null||typeof Q!=="object")return F.jsxDEV("code",{children:String(Q)},void 0,!1,void 0,this);let U=JSON.stringify(Q,null,2);return U.length<=160?F.jsxDEV("code",{children:JSON.stringify(Q)},void 0,!1,void 0,this):F.jsxDEV("details",{className:"folded",children:[F.jsxDEV("summary",{children:F.jsxDEV("code",{children:[JSON.stringify(Q).slice(0,120),"…"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("pre",{children:U},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var IV=(Q)=>typeof Q==="string"?Q:Array.isArray(Q)?Q.map((U)=>U&&typeof U==="object"&&typeof U.text==="string"?U.text:"").filter(Boolean).join(`
|
|
249
|
+
`):JSON.stringify(Q??"");function wV({body:Q}){if(Q===null||typeof Q!=="object"||Array.isArray(Q))return F.jsxDEV(d3,{v:Q},void 0,!1,void 0,this);let U=Q,Z=Array.isArray(U.messages)?U.messages:null,K=Object.entries(U).filter(([H])=>!(Z&&H==="messages"));return F.jsxDEV(F.Fragment,{children:[K.length?F.jsxDEV("dl",{className:"fields",children:K.map(([H,Y])=>F.jsxDEV(F1.default.Fragment,{children:[F.jsxDEV("dt",{children:H},void 0,!1,void 0,this),F.jsxDEV("dd",{children:F.jsxDEV(d3,{v:Y},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},H,!0,void 0,this))},void 0,!1,void 0,this):null,Z?F.jsxDEV("ol",{className:"messages",children:Z.map((H,Y)=>F.jsxDEV("li",{children:[F.jsxDEV("span",{className:"role",children:typeof H.role==="string"?H.role:"message"},void 0,!1,void 0,this),F.jsxDEV(OO,{text:IV(H.content)},void 0,!1,void 0,this)]},Y,!0,void 0,this))},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}function IO({fields:Q}){let U=Object.entries(Q??{});if(U.length===0)return F.jsxDEV("p",{className:"mode",children:"No fields."},void 0,!1,void 0,this);return F.jsxDEV("dl",{className:"fields",children:U.map(([Z,K])=>F.jsxDEV(F1.default.Fragment,{children:[F.jsxDEV("dt",{children:Z},void 0,!1,void 0,this),F.jsxDEV("dd",{children:F.jsxDEV(d3,{v:K},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},Z,!0,void 0,this))},void 0,!1,void 0,this)}var PV=(Q)=>Q.receipt?`${Q.receipt.status??""}${Q.receipt.externalId?` · ${Q.receipt.externalId}`:""}${Q.receipt.reason?` · ${Q.receipt.reason}`:""}`:Q.operation==="observed"?"observed from the vendor":Q.provenance==="placeholder"?"default data":"none: it has not left this World";function NV(Q){let U=new Map,Z=[],K=[],H=new Map;for(let Y of Q){if(Y.entry.landsId||Y.entry.aliasOf){K.push(Y);continue}let W={...Y,copies:[]};if(Z.push(W),!U.has(`${Y.twin}:${Y.entry.id}`))U.set(`${Y.twin}:${Y.entry.id}`,W);if(!H.has(`${Y.twin}:${Y.entry.subject.type}:${Y.entry.subject.id}`))H.set(`${Y.twin}:${Y.entry.subject.type}:${Y.entry.subject.id}`,W)}for(let Y of K){let W=Y.entry.landsId?U.get(`${Y.twin}:${Y.entry.landsId}`):Y.entry.aliasOf?H.get(`${Y.twin}:${Y.entry.subject.type}:${Y.entry.aliasOf}`):void 0;if(W)W.copies.push(Y);else Z.push({...Y,copies:[]})}return Z.sort(TO)}var $H={deployed:5,confirmed:4,landed:3,replayed:2,skipped:1};function eR(Q){let U=[Q.entry.receipt,...Q.copies.map((H)=>H.entry.receipt)].filter((H)=>Boolean(H?.status));if(U.length===0)return null;let Z=U.find((H)=>H.status==="failed"||H.status==="refused"),K=[...U].sort((H,Y)=>($H[Y.status]??0)-($H[H.status]??0))[0];return Z&&!($H[K.status]>=5)?{status:Z.status,bad:!0}:{status:K.status,bad:!1}}var R4=1280,U3=820,KU=160,$4=72,UH=120,CV=72,J2=(Q)=>`${Q.vendor}:${Q.id}`,_7=(Q)=>`${Q.vendor}:section:${Q.section.id}`,Q7=(Q)=>[Q.section.id,...Q.section.aka??[]].map((U)=>`${Q.vendor}:section:${U}`),wO=(Q,U)=>U.at&&("site"in U.at)?U.at.site:U.at?`${c3}/${Q}/${U.vendor}${U.at.screen}`:null,_O=(Q,U)=>Q.include?U.filter((Z)=>Q.include.includes(J2(Z))||Q7(Z).some((K)=>Q.include.includes(K))):U.filter((Z)=>!(Q.hidden??[]).includes(J2(Z)));function fV({data:Q}){let{frame:U,url:Z,active:K,picked:H,boards:Y,addTo:W,remove:L,compare:M}=Q,O=J2(U),T=Y.filter((R)=>R.include&&!R.include.includes(O)&&!Q7(U).some((w)=>R.include.includes(w))),A=L0((R)=>R.transform[2]*($4+UH)>=CV);return F.jsxDEV(F.Fragment,{children:[F.jsxDEV(_H,{isVisible:A||H||K,position:E1.Top,align:"start",className:"frame-label",children:[F.jsxDEV(q2,{vendor:U.vendor},void 0,!1,void 0,this),F.jsxDEV("span",{children:U.title},void 0,!1,void 0,this),U.changes?F.jsxDEV("button",{type:"button",className:"frame-changed nodrag",onClick:()=>M(O),title:`${l0(U.changes,"change")} here, not in a changeset: compare before and now`,children:[F.jsxDEV(Z0,{name:"square-dot",size:14},void 0,!1,void 0,this),U.changes]},void 0,!0,void 0,this):H?F.jsxDEV("button",{type:"button",className:"ghost nodrag",onClick:()=>M(O),title:"Compare with a branch of this World","aria-label":`Compare ${U.title} with a branch`,children:F.jsxDEV(Z0,{name:"file-diff",size:14},void 0,!1,void 0,this)},void 0,!1,void 0,this):null,H&&T.length?F.jsxDEV("select",{className:"nodrag frame-add",value:"","aria-label":`Add ${U.title} to a board`,onChange:(R)=>{if(R.target.value)W(R.target.value,O)},children:[F.jsxDEV("option",{value:"",children:"Add to board…"},void 0,!1,void 0,this),T.map((R)=>F.jsxDEV("option",{value:R.id,children:R.name},R.id,!1,void 0,this))]},void 0,!0,void 0,this):null,H&&L?F.jsxDEV("button",{type:"button",className:"ghost nodrag",onClick:()=>L.act(O),title:L.label,"aria-label":L.label,children:"✕"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),F.jsxDEV("div",{className:K?"frame on":H?"frame picked":"frame",style:{width:R4,height:U3},children:[F.jsxDEV("div",{className:"frame-bar",children:[F.jsxDEV(q2,{vendor:U.vendor},void 0,!1,void 0,this),F.jsxDEV("strong",{children:[s1(U.vendor)," · ",U.kind]},void 0,!0,void 0,this),F.jsxDEV("span",{className:"frame-url",children:U.url.replace(/^https?:\/\//,"")},void 0,!1,void 0,this),Z?F.jsxDEV("a",{className:"nodrag",href:Z,target:"_blank",rel:"noopener noreferrer","aria-label":`Open ${U.title} in a new tab`,children:"↗"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),F.jsxDEV("div",{className:K?"frame-body nodrag nopan nowheel":"frame-body",children:Z?F.jsxDEV("iframe",{title:U.title,src:Z,loading:"lazy",style:{pointerEvents:K?"auto":"none"}},void 0,!1,void 0,this):F.jsxDEV("div",{className:"frame-none",children:[F.jsxDEV("p",{children:F.jsxDEV("strong",{children:U.unseen==="sites-not-routed"?`This World shows ${U.title} only at its own local address.`:`${s1(U.vendor)}'s twin draws no page for this ${U.kind} yet.`},void 0,!1,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("p",{className:"mode",children:U.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 PO({name:Q,label:U,done:Z}){let K=F1.useRef(!1),H=(Y)=>{if(K.current)return;K.current=!0,Z(Y?.trim()&&Y.trim()!==Q?Y.trim().slice(0,80):null)};return F.jsxDEV("input",{className:"nodrag nopan name-field","aria-label":U,defaultValue:Q,size:Math.max(8,Q.length+2),autoFocus:!0,onFocus:(Y)=>Y.currentTarget.select(),onKeyDown:(Y)=>{if(Y.key==="Enter")H(Y.currentTarget.value);else if(Y.key==="Escape")H(null)},onBlur:(Y)=>H(Y.currentTarget.value)},void 0,!1,void 0,this)}function SV({data:Q}){return F.jsxDEV(F.Fragment,{children:[F.jsxDEV(dR,{isVisible:Q.picked&&Q.editable,minWidth:480,minHeight:360,color:"var(--accent)",onResizeEnd:Q.resized},void 0,!1,void 0,this),F.jsxDEV(_H,{isVisible:!0,position:E1.Top,align:"start",offset:-30,className:"section-tag",children:[Q.renaming?F.jsxDEV(PO,{name:Q.name,label:"Name this section",done:(U)=>Q.renamed(Q.key,U)},void 0,!1,void 0,this):F.jsxDEV("button",{type:"button",className:Q.picked?"nodrag on":"nodrag",onClick:()=>Q.pick(Q.key),onDoubleClick:()=>{if(Q.editable)Q.rename(Q.key)},title:Q.editable?"Double-click to rename":void 0,children:[Q.vendor?F.jsxDEV(q2,{vendor:Q.vendor},void 0,!1,void 0,this):null,F.jsxDEV("span",{children:Q.name},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Q.picked&&Q.editable&&!Q.renaming?F.jsxDEV("button",{type:"button",className:"ghost nodrag",onClick:()=>Q.remove(Q.key),"aria-label":`Remove the section ${Q.name}`,title:"Remove the section (its frames stay)",children:"✕"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),F.jsxDEV("div",{className:Q.picked?"section-box on":"section-box"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function JO({url:Q,title:U}){return F.jsxDEV("div",{className:"compare-thumb",style:{width:420,height:420*U3/R4},children:F.jsxDEV("iframe",{title:U,src:Q,loading:"lazy",style:{width:R4,height:U3,transform:`scale(${420/R4})`}},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function vV({name:Q,token:U,frame:Z,onClose:K,reads:H}){let[Y,W]=F1.useState(Z.since?"before":""),[L,M]=F1.useState({state:"opening"}),[O,T]=F1.useState(null),A=F1.useRef(new Set),R=y0(U,`/-/${Q}/branches`,H),w=R.state==="ok"?R.data.branches.filter((y)=>y.name!==O&&!A.current.has(y.name)):[],P=y0(U,`/-/${Q}/board/changes?frame=${encodeURIComponent(J2(Z))}`,H),V=async(y,N,v)=>{let D=Z.at;if("site"in D){let u=new URL(Z.url),b=N&&/^https?:\/\/\{host\}\./.test(N)?N.replace("{host}",u.hostname.toLowerCase()):null;return b?{url:`${b}${u.pathname}${u.search}`}:{why:"This World shows its branches' sites only on this machine."}}let x=`${c3}/-/${Q}/branches/${y}/pages?${new URLSearchParams({land:`/${y}/${Z.vendor}${D.screen}`}).toString()}`,E=await fetch(x,{credentials:"same-origin",redirect:"manual"}).catch(()=>null);if(v())return{why:""};return E?.type==="opaqueredirect"?{url:x}:{why:`This World does not show its branches' pages${E?`: ${await T5(E)}`:""}.`}};F1.useEffect(()=>{if(!Z.at){M({state:"none",why:`${s1(Z.vendor)}'s twin draws no page for this ${Z.kind} yet; its changes are listed below.`});return}if(Y===""){M({state:"none",why:"Choose a branch of this World to set beside it."});return}let y=!1;if(Y!=="before"){M({state:"opening"});let u=R.state==="ok"?R.data.branches.find((m)=>m.name===Y):void 0,b=setTimeout(()=>void V(Y,u?.sites??null,()=>y).then((m)=>{if(!y)M("url"in m?{state:"ok",url:m.url}:{state:"none",why:m.why})}),300);return()=>{y=!0,clearTimeout(b)}}if(!Z.since){M({state:"none",why:"Nothing here has changed since the World was last cut."});return}M({state:"opening"});let N=new Date(Date.parse(Z.since)-1).toISOString(),v=null,D=setTimeout(()=>void(async()=>{let u=await O0(U,`/-/${Q}/branches`,{method:"POST",body:JSON.stringify({at:{instant:N},ttl:3600}),signal:AbortSignal.timeout(60000)}).catch(()=>null);if(!u?.ok){M({state:"none",why:`The World made no copy of itself as it was then${u?`: ${await T5(u)}`:""}.`});return}let b=await u.json();if(v=b.name,T(b.name),A.current.add(b.name),y){O0(U,`/-/${Q}/branches/${b.name}`,{method:"DELETE"}).catch(()=>null);return}let m=await V(b.name,b.sites??null,()=>y);if(!y)M("url"in m?{state:"ok",url:m.url,at:N}:{state:"none",why:m.why})})(),500),x=()=>{if(v)O0(U,`/-/${Q}/branches/${v}`,{method:"DELETE",keepalive:!0}).catch(()=>null);v=null},E=(u)=>{if(!u.persisted)x()};return window.addEventListener("pagehide",E),()=>{y=!0,clearTimeout(D),window.removeEventListener("pagehide",E),x(),T(null)}},[Q,U,Z.vendor,Z.id,Z.since,Y]);let S=wO(Q,Z),C=!Z.at||Y!==""?null:R.state==="ok"&&w.length===0?"This World has no branches to set beside it: make one under Branches.":R.state==="error"?`The World's branches could not be read: ${R.error}`:null;return F.jsxDEV("div",{className:"compare",role:"dialog","aria-label":`Changes to ${Z.title}`,children:[F.jsxDEV("div",{className:"compare-head",children:[F.jsxDEV(q2,{vendor:Z.vendor},void 0,!1,void 0,this),F.jsxDEV("strong",{children:Z.title},void 0,!1,void 0,this),F.jsxDEV("span",{className:"mode",children:Z.changes?`${l0(Z.changes,"change")} not yet cut${Z.since?`, since ${b8(Z.since)}`:""}`:"No changes here not yet cut"},void 0,!1,void 0,this),Z.at?F.jsxDEV("label",{className:"compare-base",children:["Compare with"," ",F.jsxDEV("select",{value:Y,onChange:(y)=>W(y.target.value),children:[Y===""?F.jsxDEV("option",{value:"",children:"Choose a branch…"},void 0,!1,void 0,this):null,Z.since||Y==="before"?F.jsxDEV("option",{value:"before",children:"Before these changes"},void 0,!1,void 0,this):null,Y&&Y!=="before"&&!w.some((y)=>y.name===Y)?F.jsxDEV("option",{value:Y,children:Y.split("/")[1]},void 0,!1,void 0,this):null,w.map((y)=>F.jsxDEV("option",{value:y.name,children:[y.name.split("/")[1],y.at?.label?` (${y.at.label})`:y.at?.instant?` (as of ${b8(y.at.instant)})`:y.at?.live?" (live)":""]},y.name,!0,void 0,this))]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null,F.jsxDEV("button",{type:"button",className:"ghost",onClick:K,"aria-label":"Close the comparison",children:"✕"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("div",{className:"compare-sides",children:[F.jsxDEV("figure",{children:[F.jsxDEV("figcaption",{children:Y==="before"?`Before${L.state==="ok"&&L.at?` · as of ${b8(L.at)}`:""}`:Y?Y.split("/")[1]:"A branch"},void 0,!1,void 0,this),C?F.jsxDEV("p",{className:"mode compare-note",children:C},void 0,!1,void 0,this):L.state==="ok"?F.jsxDEV(JO,{url:L.url,title:`${Z.title} before`},void 0,!1,void 0,this):L.state==="opening"?F.jsxDEV("p",{className:"mode compare-note",role:"status",children:"Opening the World as it was…"},void 0,!1,void 0,this):F.jsxDEV("p",{className:"mode compare-note",children:L.why},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("figure",{children:[F.jsxDEV("figcaption",{children:"Now"},void 0,!1,void 0,this),S?F.jsxDEV(JO,{url:S,title:`${Z.title} now`},void 0,!1,void 0,this):F.jsxDEV("p",{className:"mode compare-note",children:[s1(Z.vendor),"'s twin draws no page for this ",Z.kind," yet."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),P.state==="error"?F.jsxDEV("p",{role:"alert",className:"mode",children:["Its changes could not be read: ",P.error]},void 0,!0,void 0,this):null,Y!=="before"&&Y&&P.state==="ok"&&P.data.acts.length?F.jsxDEV("p",{className:"mode compare-acts-head",children:"This World's own changes here, not yet cut:"},void 0,!1,void 0,this):null,F.jsxDEV("ol",{className:"compare-acts",children:(P.state==="ok"?P.data.acts:[]).map((y)=>{let N=y.entries[0],v=Q4({...N,service:Z.vendor,id:"",occurredAt:y.at});return F.jsxDEV("li",{children:[F.jsxDEV("span",{className:"mode",children:b8(y.at)},void 0,!1,void 0,this),F.jsxDEV("details",{children:[F.jsxDEV("summary",{children:[F.jsxDEV("strong",{children:v.what},void 0,!1,void 0,this),v.label?` · ${v.label}`:"",y.writes>1?F.jsxDEV("span",{className:"mode",children:[" and ",l0(y.writes-1,"more write")]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),F.jsxDEV("ul",{children:[y.entries.map((D,x)=>F.jsxDEV("li",{children:[F.jsxDEV("code",{children:D.operation??D.op},void 0,!1,void 0,this)," ",F.jsxDEV("span",{className:"mode",children:[D.subject.type," ",i3(D)]},void 0,!0,void 0,this)]},x,!0,void 0,this)),y.writes>y.entries.length?F.jsxDEV("li",{className:"mode",children:["and ",l0(y.writes-y.entries.length,"more write")]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},`${y.at}:${N.subject.type}:${N.subject.id}`,!0,void 0,this)})},void 0,!1,void 0,this),P.state==="ok"&&P.data.total>P.data.acts.length?F.jsxDEV("p",{className:"mode",children:["and ",l0(P.data.total-P.data.acts.length,"earlier change"),", in Changes"]},void 0,!0,void 0,this):null,F.jsxDEV("a",{className:"compare-all",href:`${n1}/${Q}/~/changes`,onClick:(y)=>{y.preventDefault(),f0([...Q.split("/"),"~","changes"])},children:"Every change in the World →"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var jV={screen:fV,section:SV};function VV(Q){return F.jsxDEV(eK,{children:F.jsxDEV(yV,{...Q},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function yV({name:Q,token:U,session:Z,retry:K,snapshot:H,back:Y,canWrite:W}){let L=F1.useRef(null),M=F1.useRef(0),O=F1.useRef(Promise.resolve()),T=F1.useRef(0),[,A]=F1.useState(0),[R,w]=F1.useState({state:"loading"}),[P,V]=F1.useState(null),[S,C]=F1.useState(0),y=F1.useRef(0),N=F1.useRef(0),v=F1.useCallback(async()=>{let $1=T.current,B1=++y.current,v1=await O0(U,`/-/${Q}/board`,{signal:AbortSignal.timeout(15000)}).catch(()=>null),V1=v1?.ok?await v1.json().catch(()=>null):null;if(B1<N.current)return;if(N.current=B1,!V1?.frames||!V1.boards||!V1.version){let Q0=v1?`the World answered ${v1.status}`:"the World did not answer";w((u1)=>u1.state==="ok"?u1:{state:"error",status:v1?.status??0,error:Q0}),V(Q0);return}if(V(null),C((Q0)=>Q0+1),$1===T.current&&M.current===0)L.current={boards:V1.boards,version:V1.version};w({state:"ok",data:V1})},[U,Q]);F1.useEffect(()=>{v();let $1=setInterval(()=>{if(!document.hidden)v()},1e4);return()=>clearInterval($1)},[v]);let D=R.state==="ok"?R.data.frames:[],x=L.current?.boards??[{id:"everything",name:"Everything"}],[E,u]=F1.useState(null),b=D.some(($1)=>$1.changes),m=E??(b?"changes":"everything"),s=(m==="changes"?x[0]:x.find(($1)=>$1.id===m))??x[0],[U1,Q1]=F1.useState(new Set),h=W&&!H,g=F1.useCallback(($1)=>{if(!L.current)return e0("The board is being read again: make that change once it shows","error"),Promise.resolve();L.current={...L.current,boards:$1(L.current.boards)},M.current+=1,T.current+=1,A((v1)=>v1+1);let B1=O.current.then(async()=>{let v1=L.current;if(!v1)return;try{let V1=await O0(U,`/-/${Q}/board`,{method:"PUT",body:JSON.stringify({boards:v1.boards,version:v1.version}),signal:AbortSignal.timeout(15000)}),Q0=await V1.json().catch(()=>null);if(V1.ok&&Q0?.boards&&Q0.version)L.current={boards:M.current>1&&L.current?L.current.boards:Q0.boards,version:Q0.version};else if(V1.status===409&&Q0?.boards&&Q0.version)L.current={boards:Q0.boards,version:Q0.version},e0("Someone else changed the board first: it is shown as they left it","error");else throw Error(Q0?.error??`the World answered ${V1.status}`)}catch(V1){e0(`The board was not kept: ${V1 instanceof Error?V1.message:String(V1)}`,"error"),L.current=null;let Q0=await O0(U,`/-/${Q}/board`,{signal:AbortSignal.timeout(15000)}).catch(()=>null),u1=Q0?.ok?await Q0.json().catch(()=>null):null;if(u1?.boards&&u1.version)L.current={boards:u1.boards,version:u1.version}}}).finally(()=>{if(M.current-=1,T.current+=1,A((v1)=>v1+1),M.current===0&&!L.current)v()});return O.current=B1,B1},[U,Q,v]),p=($1,B1)=>{g((v1)=>v1.map((V1)=>V1.id===$1?B1(V1):V1))},c=($1)=>$1.parent?`${$1.vendor}:${$1.parent}`:null,l=new Set(D.map(J2)),o=($1)=>{let B1=c($1);return!B1||!l.has(B1)},k=m==="changes"?D.filter(($1)=>$1.changes):s.include?_O(s,D):_O(s,D).filter(($1)=>o($1)||U1.has(c($1))),t=D.filter(($1)=>$1.changes&&!k.includes($1)).reduce(($1,B1)=>$1+B1.changes,0),[_1,a]=F1.useState(null),[H1,O1]=F1.useState(null),[L1,T1]=F1.useState(null),G1=lJ(),R1=x.filter(($1)=>$1.include),f1=($1,B1)=>p($1,(v1)=>({...v1,include:[...v1.include??[],B1]})),z1={label:s.include?"Take it off this board":"Hide it",act:($1)=>{O1(null),p(s.id,(B1)=>B1.include?{...B1,include:B1.include.filter((v1)=>v1!==$1)}:{...B1,hidden:[...B1.hidden??[],$1]})}},C1=($1)=>({x:$1.position.x,y:$1.position.y,w:$1.width??$1.measured?.width??R4,h:$1.height??$1.measured?.height??U3}),b1=($1,B1)=>{let v1=C1($1),V1=v1.x+v1.w/2,Q0=v1.y+v1.h/2;return B1.filter((u1)=>u1.type==="section").map((u1,m1)=>({s:u1,i:m1})).filter(({s:u1})=>{let m1=C1(u1);return V1>=m1.x&&V1<=m1.x+m1.w&&Q0>=m1.y&&Q0<=m1.y+m1.h}).sort((u1,m1)=>C1(u1.s).w*C1(u1.s).h-C1(m1.s).w*C1(m1.s).h||m1.i-u1.i)[0]?.s},c1=F1.useCallback(()=>{let $1=new Map;for(let J0 of k){let T0=s.placed?.[J2(J0)];if(T0)$1.set(J2(J0),T0)}let B1=Math.max(-KU,...[...$1.values()].map((J0)=>J0.y+U3)),v1=[...new Set(k.map(_7))];for(let J0 of v1){let T0=k.filter((w0)=>_7(w0)===J0),Z2=T0.filter((w0)=>$1.has(J2(w0))).map((w0)=>$1.get(J2(w0))),K0=Z2.length?Math.max(...Z2.map((w0)=>w0.x))+R4+KU:0,S2=Z2.length?Math.min(...Z2.map((w0)=>w0.y)):B1+KU+$4*2+UH;for(let w0 of T0)if(!$1.has(J2(w0)))$1.set(J2(w0),{x:K0,y:S2}),K0+=R4+KU;B1=Math.max(B1,S2+U3)}let V1=s.sections??{},Q0=(J0,T0,Z2,K0,S2)=>({id:`sec:${J0}`,type:"section",position:{x:T0.x,y:T0.y},width:T0.w,height:T0.h,zIndex:0,draggable:h,data:{key:J0,name:Z2,vendor:K0,named:S2}}),u1=[];for(let J0 of v1){let T0=k.find((V0)=>_7(V0)===J0),Z2=Q7(T0).find((V0)=>V1[V0])??J0,K0=V1[Z2];if(K0?.gone)continue;let S2=k.filter((V0)=>_7(V0)===J0).map((V0)=>$1.get(J2(V0))),w0={x:Math.min(...S2.map((V0)=>V0.x))-$4,y:Math.min(...S2.map((V0)=>V0.y))-$4-UH,w:0,h:0};w0.w=Math.max(...S2.map((V0)=>V0.x))+R4+$4-w0.x,w0.h=Math.max(...S2.map((V0)=>V0.y))+U3+$4-w0.y;let Z7=k.filter((V0)=>_7(V0)===J0&&!s.placed?.[J2(V0)]).map((V0)=>$1.get(J2(V0))),K5=K0?{...K0}:w0;if(K0)for(let V0 of Z7)K5.w=Math.max(K5.w,V0.x+R4+$4-K5.x),K5.h=Math.max(K5.h,V0.y+U3+$4-K5.y);u1.push(Q0(Z2,K5,K0?.name??`${s1(T0.vendor)} · ${T0.section.title}`,T0.vendor,Boolean(K0?.name)))}for(let[J0,T0]of Object.entries(V1))if(J0.startsWith("user:")&&!T0.gone)u1.push(Q0(J0,T0,T0.name??"Section",null,!0));let m1=k.map((J0)=>({id:J2(J0),type:"screen",zIndex:1,width:R4,height:U3,draggable:h,position:$1.get(J2(J0)),data:{world:Q,frame:J0,url:wO(Q,J0)}}));return[...u1,...m1]},[JSON.stringify(k),JSON.stringify(s),Q,h]),[D1,A1,e1]=xR([]),k1=L0(($1)=>$1.transform[2]),g0=F1.useRef("");F1.useEffect(()=>{let $1=c1();if(A1($1),$1.length&&g0.current!==m)g0.current=m,requestAnimationFrame(()=>{G1.fitView({padding:{top:"72px",left:"272px",right:"40px",bottom:"72px"},duration:0})})},[c1,A1]);let _0=($1,B1=[],v1={})=>{let V1=Object.fromEntries(B1.map((u1)=>{let m1=G1.getNode(`sec:${u1}`);if(!m1)return[u1,void 0];let J0=C1(m1),T0=m1.data,Z2=v1[u1]??(T0.named?T0.name:void 0);return[u1,{x:Math.round(J0.x),y:Math.round(J0.y),w:Math.round(J0.w),h:Math.round(J0.h),...Z2?{name:Z2.slice(0,80)}:{}}]}).filter(([,u1])=>u1!==void 0)),Q0=Object.fromEntries(Object.entries($1).map(([u1,m1])=>[u1,{x:Math.round(m1.x),y:Math.round(m1.y)}]));p(s.id,(u1)=>({...u1,placed:{...u1.placed??{},...Q0},sections:{...u1.sections??{},...V1}}))},t0=F1.useRef(null),C2=($1,B1)=>{if(B1.type!=="section"){t0.current=null;return}let v1=G1.getNodes(),V1=C1(B1),Q0=(u1)=>{let m1=C1(u1);if(u1.type==="screen"){let J0=m1.x+m1.w/2,T0=m1.y+m1.h/2;return J0>=V1.x&&J0<=V1.x+V1.w&&T0>=V1.y&&T0<=V1.y+V1.h}return u1.id!==B1.id&&m1.x>=V1.x&&m1.y>=V1.y&&m1.x+m1.w<=V1.x+V1.w&&m1.y+m1.h<=V1.y+V1.h};t0.current={id:B1.id,from:{...B1.position},members:v1.filter(Q0).map((u1)=>({id:u1.id,x:u1.position.x,y:u1.position.y}))}},u2=($1,B1)=>{let v1=t0.current;if(!v1||v1.id!==B1.id)return;let V1=B1.position.x-v1.from.x,Q0=B1.position.y-v1.from.y,u1=new Map(v1.members.map((m1)=>[m1.id,m1]));A1((m1)=>m1.map((J0)=>{let T0=u1.get(J0.id);return T0?{...J0,position:{x:T0.x+V1,y:T0.y+Q0}}:J0}))},b2=($1,B1)=>{let v1=t0.current;t0.current=null;let V1=B1.position.x-(v1?.from.x??B1.position.x),Q0=B1.position.y-(v1?.from.y??B1.position.y),u1=B1.type==="screen"?[{id:B1.id,x:B1.position.x,y:B1.position.y}]:(v1?.members??[]).map((m1)=>({...m1,x:m1.x+V1,y:m1.y+Q0}));requestAnimationFrame(()=>{let m1=G1.getNodes(),J0=new Map(u1.filter((K0)=>!K0.id.startsWith("sec:")).map((K0)=>[K0.id,{x:K0.x,y:K0.y}])),T0=new Set([...B1.type==="section"?[B1.data.key]:[],...u1.filter((K0)=>K0.id.startsWith("sec:")).map((K0)=>K0.id.slice(4))]),Z2=new Set(m1.filter((K0)=>J0.has(K0.id)).flatMap((K0)=>Q7(K0.data.frame)));for(let K0 of m1){if(K0.type==="screen"&&Q7(K0.data.frame).some((S2)=>Z2.has(S2))&&!J0.has(K0.id))J0.set(K0.id,{x:K0.position.x,y:K0.position.y});if(K0.type==="section"&&Z2.has(K0.data.key))T0.add(K0.data.key)}_0(Object.fromEntries(J0),[...T0])})},f2=($1)=>Object.fromEntries(G1.getNodes().filter((B1)=>B1.type==="screen"&&Q7(B1.data.frame).includes($1)).map((B1)=>[B1.id,{x:B1.position.x,y:B1.position.y}])),[T2,G2]=F1.useState(null),R2=($1)=>{O1(`sec:${$1}`),G2($1)},I4=($1,B1)=>{if(G2(null),!B1)return;A1((v1)=>v1.map((V1)=>V1.id===`sec:${$1}`?{...V1,data:{...V1.data,name:B1,named:!0}}:V1)),requestAnimationFrame(()=>_0(f2($1),[$1],{[$1]:B1}))},X5=($1)=>{O1(null);let B1=G1.getNode(`sec:${$1}`);p(s.id,(v1)=>{let V1=Object.fromEntries(Object.entries(v1.sections??{}).filter(([Q0])=>Q0!==$1));return{...v1,sections:$1.startsWith("user:")?V1:{...V1,[$1]:{...B1?{x:Math.round(B1.position.x),y:Math.round(B1.position.y),w:Math.round(C1(B1).w),h:Math.round(C1(B1).h)}:{x:0,y:0,w:0,h:0},gone:!0}}}})},x5=()=>{let $1=H1?G1.getNode(H1):void 0,B1=G1.screenToFlowPosition({x:window.innerWidth/2,y:window.innerHeight/2}),v1=$1?.type==="screen"?{x:$1.position.x-$4,y:$1.position.y-$4,w:R4+$4*2,h:U3+$4*2}:{x:B1.x-900,y:B1.y-600,w:1800,h:1200},V1=`user:${Date.now().toString(36)}`,Q0=Object.keys(s.sections??{}).filter((u1)=>u1.startsWith("user:")).length+1;O1(`sec:${V1}`),p(s.id,(u1)=>({...u1,sections:{...u1.sections??{},[V1]:{x:Math.round(v1.x),y:Math.round(v1.y),w:Math.round(v1.w),h:Math.round(v1.h),name:`Section ${Q0}`}}}))},q4=D1.map(($1)=>$1.type==="section"?{...$1,data:{...$1.data,picked:H1===$1.id,editable:h,renaming:h&&T2===$1.data.key,pick:(B1)=>O1(`sec:${B1}`),rename:R2,renamed:I4,remove:X5,resized:()=>requestAnimationFrame(()=>{let B1=$1.data.key;_0(f2(B1),[B1])})}}:{...$1,data:{...$1.data,active:_1===$1.id,picked:H1===$1.id,boards:h?R1:[],addTo:f1,remove:!h||s.include&&!s.include.includes($1.id)?null:z1,compare:(B1)=>{O1(B1),T1(B1)}}});F1.useEffect(()=>{let $1=(B1)=>{if(B1.target?.closest("input, textarea, select, [contenteditable]"))return;if(B1.key==="Escape"){if(_1)a(null);else O1(null);return}if(!h||_1)return;if((B1.key==="Delete"||B1.key==="Backspace")&&H1){if(B1.preventDefault(),H1.startsWith("sec:"))X5(H1.slice(4));else if(!s.include||s.include.includes(H1))z1.act(H1);else e0("It is on this board with its whole group: take the group off in the list to remove it","error");return}if(B1.key==="S"&&B1.shiftKey&&!B1.metaKey&&!B1.ctrlKey)B1.preventDefault(),x5()};return document.addEventListener("keydown",$1),()=>document.removeEventListener("keydown",$1)});let R5=($1)=>{O1($1);let B1=G1.getNode($1);if(!B1)return;let v1=C1(B1);G1.fitBounds({x:v1.x,y:v1.y,width:v1.w,height:v1.h},{padding:0.15,duration:400})},G3=()=>{let $1=`board-${Date.now().toString(36)}`;u($1),g((B1)=>[...B1,{id:$1,name:`Board ${B1.length}`,include:[]}])},O5=()=>G2(`board:${s.id}`),j=()=>{let $1=s.id;u(null),g((B1)=>B1.filter((v1)=>v1.id!==$1))},q1=[...new Map(D.map(($1)=>[_7($1),$1])).values()],I1=s.include?[...q1.filter(($1)=>!Q7($1).some((B1)=>s.include.includes(B1))).map(($1)=>({key:_7($1),label:`${s1($1.vendor)} · ${$1.section.title} (all)`})),...D.filter(($1)=>!k.includes($1)).map(($1)=>({key:J2($1),label:$1.title}))]:[],P1=s.include?[]:D.filter(($1)=>(s.hidden??[]).includes(J2($1))),y1=D1.filter(($1)=>$1.type==="section"),i1=D1.filter(($1)=>$1.type==="screen"),r1=new Map(i1.map(($1)=>[$1.id,b1($1,D1)?.id??null])),F0=new Map;for(let $1 of D){let B1=c($1);if(B1&&l.has(B1))F0.set(B1,(F0.get(B1)??0)+1)}let x1=($1)=>{let B1=$1.data.frame;return F.jsxDEV("li",{children:[F.jsxDEV("button",{type:"button",className:H1===$1.id?"on":void 0,onClick:()=>R5($1.id),onDoubleClick:()=>a($1.id),children:[F.jsxDEV(q2,{vendor:B1.vendor},void 0,!1,void 0,this),F.jsxDEV("span",{children:B1.title},void 0,!1,void 0,this),B1.changes?F.jsxDEV("span",{className:"layer-changed",title:`${l0(B1.changes,"change")}, not in a changeset: its mark on the board compares before and now`,children:[F.jsxDEV(Z0,{name:"square-dot",size:14},void 0,!1,void 0,this),B1.changes]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),F0.get($1.id)&&m!=="changes"&&!s.include?F.jsxDEV("button",{type:"button",className:"ghost layer-open","aria-expanded":U1.has($1.id),onClick:()=>Q1((v1)=>{let V1=new Set(v1);if(V1.has($1.id))V1.delete($1.id);else V1.add($1.id);return V1}),title:U1.has($1.id)?"Close the pages under it":"Open the pages under it",children:[U1.has($1.id)?"−":"+",F0.get($1.id)]},void 0,!0,void 0,this):null]},$1.id,!0,void 0,this)},K2=typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches,E2=Z.state==="ok"&&R.state==="ok";return F.jsxDEV("div",{className:"canvas full",role:"region","aria-label":"The World's board",style:{"--zoom":k1},children:F.jsxDEV(hR,{nodes:E2?q4:[],onNodesChange:e1,nodeTypes:jV,onNodeDragStart:C2,onNodeDrag:u2,onNodeDragStop:b2,onNodeClick:($1,B1)=>{if(B1.id!==_1)O1(B1.id)},onNodeDoubleClick:($1,B1)=>{if(B1.type==="screen")O1(B1.id),a(B1.id)},onPaneClick:()=>{a(null),O1(null)},minZoom:0.03,maxZoom:1.5,nodesConnectable:!1,elementsSelectable:!1,panOnScroll:!0,zoomOnPinch:!0,zoomOnScroll:!1,zoomOnDoubleClick:!1,colorMode:K2?"dark":"light",proOptions:{hideAttribution:!0},children:[F.jsxDEV(gR,{variant:Q3.Dots,gap:28*2**Math.max(0,Math.ceil(Math.log2(16/(28*k1)))),size:2/k1},void 0,!1,void 0,this),F.jsxDEV(q3,{position:"top-left",className:"float layers",children:[F.jsxDEV("div",{className:"float-head",children:[F.jsxDEV("button",{type:"button",className:"back",onClick:Y,"aria-label":`Back to ${Q}`,children:"←"},void 0,!1,void 0,this),F.jsxDEV("span",{className:"float-title",children:[F.jsxDEV("strong",{children:Q.split("/")[1]},void 0,!1,void 0,this),F.jsxDEV("span",{className:"mode",children:[Q.split("/")[0],H?" · snapshot":""]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("div",{className:"board-tabs",role:"tablist","aria-label":"Boards",children:[F.jsxDEV("button",{type:"button",role:"tab","aria-selected":m==="changes",className:m==="changes"?"on":void 0,onClick:()=>{O1(null),a(null),u("changes")},title:"The pages whose records changed and are not yet in a changeset",children:["Changes",b?` (${D.filter(($1)=>$1.changes).length})`:""]},void 0,!0,void 0,this),x.map(($1)=>T2===`board:${$1.id}`?F.jsxDEV(PO,{name:$1.name,label:"Name this board",done:(B1)=>{if(G2(null),B1)p($1.id,(v1)=>({...v1,name:B1}))}},$1.id,!1,void 0,this):F.jsxDEV("button",{type:"button",role:"tab","aria-selected":m!=="changes"&&$1.id===s.id,className:m!=="changes"&&$1.id===s.id?"on":void 0,onClick:()=>{O1(null),a(null),u($1.id)},onDoubleClick:h&&$1.id===s.id&&$1.include?O5:void 0,children:$1.name},$1.id,!1,void 0,this)),h?F.jsxDEV("button",{type:"button",className:"ghost",onClick:G3,"aria-label":"A new board",children:"+"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),s.include&&h?F.jsxDEV("div",{className:"board-acts",children:[F.jsxDEV("button",{type:"button",className:"ghost",onClick:O5,children:"Rename"},void 0,!1,void 0,this),F.jsxDEV("button",{type:"button",className:"ghost",onClick:j,children:"Delete board"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,F.jsxDEV("ul",{className:"layer-list","aria-label":"Layers",children:[y1.map(($1)=>{let B1=$1.data;return F.jsxDEV("li",{children:[F.jsxDEV("button",{type:"button",className:H1===$1.id?"layer-section on":"layer-section",onClick:()=>R5($1.id),onDoubleClick:()=>{if(h)R5($1.id),R2(B1.key)},children:[B1.vendor?F.jsxDEV(q2,{vendor:B1.vendor},void 0,!1,void 0,this):F.jsxDEV(Z0,{name:"layout-grid",size:14},void 0,!1,void 0,this),F.jsxDEV("span",{children:B1.name},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("ul",{className:"layer-list inner",children:i1.filter((v1)=>r1.get(v1.id)===$1.id).map(x1)},void 0,!1,void 0,this)]},$1.id,!0,void 0,this)}),i1.filter(($1)=>!r1.get($1.id)).map(x1)]},void 0,!0,void 0,this),s.include&&!k.length?F.jsxDEV("p",{className:"mode pad-s",children:"An empty board: add frames from Everything, or below."},void 0,!1,void 0,this):null,I1.length&&h?F.jsxDEV("select",{className:"board-add",value:"","aria-label":"Add to this board",onChange:($1)=>{let B1=$1.target.value;if(B1)p(s.id,(v1)=>({...v1,include:[...v1.include??[],B1]}))},children:[F.jsxDEV("option",{value:"",children:"Add to this board…"},void 0,!1,void 0,this),I1.map(($1)=>F.jsxDEV("option",{value:$1.key,children:$1.label},$1.key,!1,void 0,this))]},void 0,!0,void 0,this):null,P1.length?F.jsxDEV("details",{className:"board-hidden",children:[F.jsxDEV("summary",{children:["Hidden (",P1.length,")"]},void 0,!0,void 0,this),F.jsxDEV("ul",{className:"layer-list",children:P1.map(($1)=>F.jsxDEV("li",{children:h?F.jsxDEV("button",{type:"button",onClick:()=>p(s.id,(B1)=>({...B1,hidden:(B1.hidden??[]).filter((v1)=>v1!==J2($1))})),children:[F.jsxDEV("span",{children:$1.title},void 0,!1,void 0,this),F.jsxDEV("span",{className:"mode",children:"Show"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):F.jsxDEV("span",{className:"pad-s",children:$1.title},void 0,!1,void 0,this)},J2($1),!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,t?F.jsxDEV("button",{type:"button",className:"board-elsewhere",onClick:()=>u("changes"),children:[F.jsxDEV(Z0,{name:"square-dot",size:14},void 0,!1,void 0,this),l0(t,"change")," not on this board"]},void 0,!0,void 0,this):null,F.jsxDEV(r2,{load:R,what:"the board"},void 0,!1,void 0,this),P&&R.state==="ok"?F.jsxDEV("p",{role:"alert",className:"pad-s",children:["The board could not be read again (",P,"): it shows what was last read."]},void 0,!0,void 0,this):null,Z.state==="pending"?F.jsxDEV("p",{className:"mode",role:"status",children:"Opening…"},void 0,!1,void 0,this):null,Z.state==="error"?F.jsxDEV("p",{role:"alert",children:["The World did not open its screens: ",Z.error," ",F.jsxDEV("button",{type:"button",onClick:K,children:"Try again"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),_1?F.jsxDEV(q3,{position:"top-center",className:"float hint using",children:[F.jsxDEV("span",{className:"mode",children:["Using ",k.find(($1)=>J2($1)===_1)?.title??_1]},void 0,!0,void 0,this),F.jsxDEV("button",{type:"button",onClick:()=>a(null),children:["Done ",F.jsxDEV("kbd",{children:"Esc"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):F.jsxDEV(q3,{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),h?F.jsxDEV(q3,{position:"bottom-center",className:"float board-tools",children:F.jsxDEV("button",{type:"button",className:"ghost",onClick:x5,title:"Section (⇧S): around the selected frame, else in the middle",children:[F.jsxDEV(Z0,{name:"layout-grid",size:16},void 0,!1,void 0,this),F.jsxDEV("span",{children:"Section"},void 0,!1,void 0,this),F.jsxDEV("kbd",{children:"⇧S"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this):null,L1&&k.some(($1)=>J2($1)===L1)?F.jsxDEV(q3,{position:"top-right",className:"float compare-panel",children:F.jsxDEV(vV,{name:Q,token:U,frame:k.find(($1)=>J2($1)===L1),onClose:()=>T1(null),reads:S},L1,!1,void 0,this)},void 0,!1,void 0,this):null,F.jsxDEV(cR,{showInteractive:!1,position:"bottom-left"},void 0,!1,void 0,this),F.jsxDEV(iR,{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 NO=(Q)=>Q.actions.map((U)=>({twin:U.service,entry:{...U.action,service:U.service,op:U.action.op??U.action.operation??""}})),kV=(Q)=>{let U=Q.action.input??{};return!(typeof U.operationId==="string"||U.graphql!==void 0&&U.graphql!==null)};function LU(Q){let U=Q.actions.filter(kV).length,Z=Q.actions.length-U,K=Q.applied?.receipts??[],H=Q.deployed??[],Y=new Set([...H.filter((M)=>M.status==="deployed"),...K.filter((M)=>M.status==="confirmed")].map((M)=>M.actionId)).size,W=new Set([...H.filter((M)=>M.status==="refused"||M.status==="failed"),...K.filter((M)=>M.status==="failed")].map((M)=>M.actionId)).size,L={performed:Y,failed:W,total:Z,own:U};if(Z>0&&Y>=Z)return{label:"Deployed",tone:"done",...L};if(Y>0)return{label:`Partly deployed: ${Y} of ${Z}`,tone:"warn",...L};if(W>0)return{label:`${W} refused or failed`,tone:"bad",...L};if(K.some((M)=>M.status==="replayed")&&K.every((M)=>M.status==="replayed"||M.status==="skipped"))return{label:"Pushed",tone:"good",...L};return{label:"Not sent",tone:"plain",...L}}var QH=(Q)=>Q.message??Q.narration?.split(`
|
|
250
250
|
`)[0]?.replace(/ setting .*$/,"")??Q.name;function CO(Q,U=1){let Z=Q.currentHash??Q.contentHash,K=Q.readiness?.approvers??new Set(Q.approvals.filter((Y)=>Y.contentHash===Z).map((Y)=>Y.principal)).size,H=Q.verification&&Q.verification.contentHash===Z?Q.verification:null;if(H&&!H.passed)return{label:"Checks failed",tone:"bad"};if(K>0&&K<U)return{label:`Approved by ${K} of ${U}`,tone:"plain"};if(K>0)return{label:`Approved by ${K}`,tone:"good"};if(H)return{label:"Verified",tone:"good"};return{label:"Not verified",tone:"plain"}}function $O({name:Q,token:U,signsAs:Z,c:K,canWrite:H,rooted:Y,refused:W,onChanged:L,part:M,required:O}){let T=M==="head",A=M==="review",[R,w]=F1.useState(null),[P,V]=F1.useState(!1),[S,C]=F1.useState(""),[y,N]=F1.useState(""),[v,D]=F1.useState(null),x=y0(U,`/-/${Q}/origin`),E=LU(K),u=CO(K,O),b=NO(K),m=[...new Set(b.map((a)=>a.twin))],s=m.some((a)=>Y.includes(a)),U1=(a)=>a===(K.currentHash??K.contentHash),Q1=K.applied?.receipts??[],h=(K.deployed??[]).filter((a)=>a.status!=="landed"),g=Q1.filter((a)=>a.status==="confirmed").length,p=h.filter((a)=>a.status==="deployed"),c=async(a,H1,O1,L1)=>{w(a),D(null);try{let T1=await O0(U,H1,{method:"POST",...O1===void 0?{}:{body:JSON.stringify(O1)}});if(!T1.ok)return W(T1),D({what:a,...M2(await k3(T1))}),!1;if(L1)e0(L1);return L(),!0}catch(T1){return D({what:a,text:`the World did not answer (${T1 instanceof Error?T1.message:String(T1)})`,acts:[]}),!1}finally{w(null)}},l=()=>{c("Verify",`/-/${Q}/changesets/${K.name}/verify`,void 0,"Verified: the checks ran over it")},o=async(a)=>{if(a.preventDefault(),await c("Approve",`/-/${Q}/changesets/${K.name}/approve`,{...S.trim()?{note:S.trim()}:{},...Z===null&&y.trim()?{as:y.trim()}:{}},"Approved"))V(!1),C("")},k=async()=>{let a=m.filter((H1)=>Y.includes(H1));if(!await n4({title:`Deploy ${K.name} to the real vendors?`,body:F.jsxDEV(F.Fragment,{children:["It performs its ",K.actions.length," change",K.actions.length===1?"":"s"," against the real account",a.length===1?"":"s"," behind ",E8(a.map(s1)),". This cannot be taken back here."]},void 0,!0,void 0,this),action:"Deploy",danger:!0,typed:K.name}))return;w("Deploy"),D(null);try{let H1=await O0(U,`/-/${Q}/deploy/${K.name}`,{method:"POST",body:JSON.stringify({confirm:K.name})});if(!H1.ok){W(H1),D({what:"Deploy",...M2(await k3(H1))});return}let O1=await O0(U,`/-/${Q}/changesets/${K.name}`),L1=O1.ok?await O1.json():null;if(!L1){e0("Deploy: sent; reading its receipts failed","info"),L();return}let T1=LU(L1);e0(`Deploy: ${T1.performed} of ${T1.total} change${T1.total===1?"":"s"} performed at the vendor${T1.failed?`; ${T1.failed} refused or failed`:""}`,T1.failed?"error":T1.performed?"ok":"info"),L()}catch(H1){D({what:"Deploy",text:`the World did not answer (${H1 instanceof Error?H1.message:String(H1)})`,acts:[]})}finally{w(null)}},t=!H?"This session reads the World; it changes nothing":E.label==="Deployed"?"Already deployed: every change was performed at the vendor":null,_1=x.state==="ok"&&x.data.origin?HH(x.data.origin):null;return F.jsxDEV("div",{className:"changeset","aria-labelledby":"changeset-title",children:[T?F.jsxDEV(F.Fragment,{children:[F.jsxDEV("div",{className:"changeset-head",children:[F.jsxDEV("div",{children:[F.jsxDEV("h3",{id:"changeset-title",children:[K.message??K.name," ",F.jsxDEV("span",{className:`badge cs-${E.tone}`,children:E.label},void 0,!1,void 0,this)," ",F.jsxDEV("span",{className:`badge cs-${u.tone}`,children:u.label},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("p",{className:"mode",children:[F.jsxDEV("code",{children:K.name},void 0,!1,void 0,this)," · made ",F.jsxDEV(j0,{iso:K.createdAt},void 0,!1,void 0,this)," · ",K.actions.length," change",K.actions.length===1?"":"s"," at ",E8(m.map(s1))||"no vendor"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("div",{className:"changeset-actions",children:[F.jsxDEV("button",{type:"button",onClick:l,disabled:Boolean(t)||R!==null,title:t??"Replay it in a throwaway World and run the World's checks",children:R==="Verify"?"Verifying…":"Verify"},void 0,!1,void 0,this),F.jsxDEV("button",{type:"button",onClick:()=>V(!0),disabled:Boolean(t)||R!==null,title:t??"Sign its current contents as yourself",children:"Approve…"},void 0,!1,void 0,this),s?F.jsxDEV("button",{type:"button",className:"primary",onClick:()=>void k(),disabled:Boolean(t)||R!==null,title:t??"Perform it against the real accounts behind this World",children:R==="Deploy"?"Deploying…":"Deploy…"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),t&&E.label!=="Deployed"?F.jsxDEV("p",{className:"mode",children:[t,"."]},void 0,!0,void 0,this):null,v?F.jsxDEV("div",{role:"alert",className:"refusal",children:[F.jsxDEV("span",{children:[F.jsxDEV("b",{children:v.what},void 0,!1,void 0,this),": ",v.text]},void 0,!0,void 0,this),v.acts.includes("verify")&&H?F.jsxDEV("button",{type:"button",onClick:l,disabled:R!==null,children:"Verify"},void 0,!1,void 0,this):null,v.acts.includes("approve")&&H?F.jsxDEV("button",{type:"button",onClick:()=>V(!0),disabled:R!==null,children:"Approve…"},void 0,!1,void 0,this):null,F.jsxDEV(ZO,{name:Q,acts:v.acts},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this):null,A?F.jsxDEV(F.Fragment,{children:[K.narration?F.jsxDEV("p",{className:"narration",children:K.narration},void 0,!1,void 0,this):null,F.jsxDEV("h4",{children:"Where it went"},void 0,!1,void 0,this),F.jsxDEV("div",{className:"block where",children:[E.performed>0?F.jsxDEV("p",{className:"pad",children:[E.performed>=E.total?"Deployed":"Partly deployed",": ",E.performed," of ",E.total," change",E.total===1?"":"s",E.own?` (and ${E.own} of the World's own, which stay in it)`:""," performed at ",E8([...new Set([...p.map((a)=>a.service),...Q1.filter((a)=>a.status==="confirmed").map((a)=>a.service)].map(s1))]),p.length?` (${p.length} from here`:" (",p.length&&g?", ":"",g?`${g} by the remote`:"",")."]},void 0,!0,void 0,this):E.label==="Pushed"?F.jsxDEV("p",{className:"pad",children:["Pushed to the remote",_1?F.jsxDEV(F.Fragment,{children:[" ",F.jsxDEV("code",{children:_1},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,K.applied?F.jsxDEV(F.Fragment,{children:[" · ",F.jsxDEV(j0,{iso:K.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):E.failed===0?F.jsxDEV("p",{className:"pad",children:["Not sent: it is only in this World.",K.applied?.outcome==="refused"?" A push was refused (below); Push sends it again.":F.jsxDEV(F.Fragment,{children:[" Push sends it to the remote World",s?"; Deploy, to the real vendors behind it":"","."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null,E.failed>0?F.jsxDEV("p",{className:"pad failed",role:"alert",children:[E.failed," change",E.failed===1?" was":"s were"," refused or failed at the vendor",[...h.filter((a)=>a.reason&&(a.status==="refused"||a.status==="failed")).map((a)=>a.reason),...Q1.filter((a)=>a.status==="failed"&&a.error).map((a)=>a.error)].slice(0,3).map((a)=>`: ${M2(a).text}`).join(""),"."]},void 0,!0,void 0,this):null,K.applied?.refusal?.length?F.jsxDEV("ul",{className:"checks pad",children:K.applied.refusal.map((a,H1)=>F.jsxDEV("li",{className:"mode",children:M2(a).text},H1,!1,void 0,this))},void 0,!1,void 0,this):null,h.length?F.jsxDEV(F.Fragment,{children:[F.jsxDEV("p",{className:"pad where-sub mode",children:"At the vendor"},void 0,!1,void 0,this),F.jsxDEV("ul",{className:"receipts pad",children:h.map((a)=>F.jsxDEV("li",{children:[F.jsxDEV("span",{className:a.status==="refused"||a.status==="failed"?"badge cs-bad":a.status==="deployed"?"badge cs-done":"badge",children:a.status},void 0,!1,void 0,this)," ",s1(a.service)," ",a.status==="deployed"?a.url?F.jsxDEV("a",{href:a.url,target:"_blank",rel:"noopener noreferrer",children:a.externalId??a.url},void 0,!1,void 0,this):a.externalId?F.jsxDEV("code",{children:a.externalId},void 0,!1,void 0,this):null:null,a.reason?F.jsxDEV("span",{className:"mode",children:[" · ",M2(a.reason).text]},void 0,!0,void 0,this):null," ",F.jsxDEV("span",{className:"mode",children:["· ",F.jsxDEV(j0,{iso:a.at},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},`v:${a.actionId}`,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,Q1.length?F.jsxDEV(F.Fragment,{children:[F.jsxDEV("p",{className:"pad where-sub mode",children:"At the remote"},void 0,!1,void 0,this),F.jsxDEV("ul",{className:"receipts pad",children:Q1.map((a)=>F.jsxDEV("li",{children:[F.jsxDEV("span",{className:a.status==="failed"?"badge cs-bad":a.status==="confirmed"?"badge cs-done":"badge",children:a.status},void 0,!1,void 0,this)," ",s1(a.service)," ",F.jsxDEV("span",{className:"mode",children:a.status==="replayed"?"replayed at the remote World":a.status==="confirmed"?"performed at the vendor by the remote":""},void 0,!1,void 0,this),a.status==="confirmed"&&a.externalId?F.jsxDEV(F.Fragment,{children:[" ",F.jsxDEV("code",{children:a.externalId},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,a.error?F.jsxDEV("span",{className:"mode",children:[" · ",M2(a.error).text]},void 0,!0,void 0,this):null]},`r:${a.actionId}`,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),!s&&E.label!=="Deployed"?F.jsxDEV("p",{className:"mode",children:["No vendor it changes is connected to its real service here, so it does not deploy from this World. ",F.jsxDEV("a",{href:`${n1}/${Q}/~/settings/services`,onClick:(a)=>{a.preventDefault(),f0([...Q.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,F.jsxDEV("h4",{children:"Checks"},void 0,!1,void 0,this),!K.verification?F.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):F.jsxDEV("div",{className:U1(K.verification.contentHash)?"":"stale",children:[F.jsxDEV("p",{children:[K.verification.passed?"✓ Passed":"✗ Failed"," · ",F.jsxDEV(j0,{iso:K.verification.at},void 0,!1,void 0,this),U1(K.verification.contentHash)?null:F.jsxDEV("span",{className:"mode",children:" · on an earlier version of it: verify again"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),K.verification.results.length?F.jsxDEV("ul",{className:"checks",children:K.verification.results.map((a)=>F.jsxDEV("li",{children:[a.passed?"✓":"✗"," ",F.jsxDEV("code",{children:a.id},void 0,!1,void 0,this)," ",F.jsxDEV("span",{className:"mode",children:s1(a.service)},void 0,!1,void 0,this)]},a.id,!0,void 0,this))},void 0,!1,void 0,this):null,K.verification.refusals?.length?F.jsxDEV("ul",{className:"checks",children:K.verification.refusals.map((a,H1)=>F.jsxDEV("li",{children:["✗ ",F.jsxDEV("code",{children:a.check},void 0,!1,void 0,this)," ",F.jsxDEV("span",{className:"mode",children:[s1(a.service),": ",a.reason]},void 0,!0,void 0,this)]},H1,!0,void 0,this))},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),F.jsxDEV("h4",{children:"Approvals"},void 0,!1,void 0,this),K.approvals.length===0?F.jsxDEV("p",{className:"mode",children:"No one has approved it."},void 0,!1,void 0,this):F.jsxDEV("ul",{className:"approvals",children:K.approvals.map((a,H1)=>F.jsxDEV("li",{children:[F.jsxDEV("b",{children:a.principal},void 0,!1,void 0,this)," ",F.jsxDEV("span",{className:"mode",children:[F.jsxDEV(j0,{iso:a.at},void 0,!1,void 0,this),U1(a.contentHash)?"":" · signed an earlier version"]},void 0,!0,void 0,this),a.note?F.jsxDEV("div",{className:"mode",children:["“",a.note,"”"]},void 0,!0,void 0,this):null]},H1,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,F.jsxDEV(E5,{open:P,onClose:()=>{if(!R)V(!1)},title:`Approve ${K.name}`,footer:F.jsxDEV(F.Fragment,{children:[F.jsxDEV("button",{type:"button",onClick:()=>V(!1),disabled:R!==null,children:"Cancel"},void 0,!1,void 0,this),F.jsxDEV("button",{type:"submit",form:"approve-changeset",className:"primary",disabled:R!==null,children:R==="Approve"?"Approving…":"Approve"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:F.jsxDEV("form",{id:"approve-changeset",onSubmit:(a)=>void o(a),className:"stack",children:[F.jsxDEV("p",{className:"mode",children:["You sign its contents as they stand now",Z?F.jsxDEV(F.Fragment,{children:[", recorded as ",F.jsxDEV("b",{children:Z},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,". A later change to it shows your approval as for an earlier version."]},void 0,!0,void 0,this),Z===null?F.jsxDEV("label",{children:[F.jsxDEV("span",{children:"Approving as"},void 0,!1,void 0,this),F.jsxDEV("input",{name:"approveAs",value:y,onChange:(a)=>N(a.target.value),maxLength:80,required:!0,placeholder:"your name or email",autoComplete:"off"},void 0,!1,void 0,this),F.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,F.jsxDEV("label",{children:[F.jsxDEV("span",{children:["Note ",F.jsxDEV("span",{className:"mode",children:"(optional)"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("textarea",{name:"approveNote",value:S,onChange:(a)=>C(a.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 fO=(Q,U)=>JSON.stringify(Q)===JSON.stringify(U);function DV({changes:Q,idPrefix:U}){let Z=[...new Set(Q.map((K)=>K.twin))];return F.jsxDEV(F.Fragment,{children:Z.map((K)=>{let H=Q.filter((W)=>W.twin===K).map((W)=>W.entry),Y=[...new Set(H.map((W)=>`${W.subject.type}:${W.subject.id}`))];return F.jsxDEV("div",{className:"compare",role:"group","aria-labelledby":`${U}-${K}`,children:[F.jsxDEV("h3",{id:`${U}-${K}`,className:"vendor-cell",children:[F.jsxDEV(q2,{vendor:K},void 0,!1,void 0,this),s1(K)," ",F.jsxDEV("span",{className:"mode",children:["· ",l0(Y.length,"record"),", ",l0(H.length,"write")]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("ul",{children:Y.map((W)=>{let L=H.filter((A)=>`${A.subject.type}:${A.subject.id}`===W),M=L[L.length-1],O=Q4(M),T={};return F.jsxDEV("li",{className:"record",children:[F.jsxDEV("p",{className:"record-head",children:[F.jsxDEV("span",{className:"kind",children:M.subject.type.replace(/^_+/,"").replace(/[_-]+/g," ")},void 0,!1,void 0,this)," ",O.label?F.jsxDEV("span",{className:"label",children:["“",O.label,"”"]},void 0,!0,void 0,this):null," ",F.jsxDEV("code",{children:i3(M)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),L.map((A)=>{let R=A.fields??{},w=Object.entries(R).filter(([V,S])=>!(V in T)||!fO(T[V],S)),P=T;return T={...T,...R},F.jsxDEV("div",{className:"write",children:[F.jsxDEV("p",{className:"mode",children:[F.jsxDEV("span",{className:"op",children:Q4(A).what},void 0,!1,void 0,this)," · ",F.jsxDEV(j0,{iso:A.occurredAt},void 0,!1,void 0,this)," · ",dJ(A)]},void 0,!0,void 0,this),w.length===0?F.jsxDEV("p",{className:"mode",children:"It set no field to a new value."},void 0,!1,void 0,this):F.jsxDEV("dl",{className:"fields field-diff","aria-label":`Fields ${Q4(A).what} set`,children:w.map(([V,S])=>F.jsxDEV(F1.default.Fragment,{children:[F.jsxDEV("dt",{children:V},void 0,!1,void 0,this),F.jsxDEV("dd",{children:V in P?F.jsxDEV("span",{className:"changed",children:[F.jsxDEV("del",{children:F.jsxDEV(d3,{v:P[V]},void 0,!1,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("span",{className:"arrow","aria-label":"becomes",children:"→"},void 0,!1,void 0,this),F.jsxDEV("ins",{children:F.jsxDEV(d3,{v:S},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):F.jsxDEV(d3,{v:S},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},V,!0,void 0,this))},void 0,!1,void 0,this)]},A.id,!0,void 0,this)})]},W,!0,void 0,this)})},void 0,!1,void 0,this)]},K,!0,void 0,this)})},void 0,!1,void 0,this)}function uV({name:Q,token:U,changes:Z,canWrite:K,refused:H,onCut:Y,pinned:W,generated:L,inputRef:M,author:O}){let[T,A]=F1.useState(""),[R,w]=F1.useState(!1),[P,V]=F1.useState([]),S=(y,N,v)=>{V((D)=>[{ok:y,text:N,at:new Date().toISOString(),n:++aJ,...v?.length?{acts:v}:{}},...D].slice(0,4))},C=async(y)=>{y.preventDefault(),w(!0);try{let N=await O0(U,`/-/${Q}/changesets`,{method:"POST",body:JSON.stringify(T.trim()?{message:T.trim()}:{})});if(!N.ok){H(N);let D=M2(await k3(N));S(!1,`Cut a changeset: ${D.text}`,D.acts);return}let v=await N.json();S(!0,`Cut ${v.name??"a changeset"}: ${l0(v.actions?.length??0,"change")}, ready to review in History and push.`),A(""),Y()}catch(N){S(!1,`Cut a changeset: the World did not answer (${N instanceof Error?N.message:String(N)})`)}finally{w(!1)}};if(W){let y=!K?"This session reads the World; it changes nothing":Z===0?"Nothing to cut: no change is outside a changeset":null;return F.jsxDEV("div",{className:"ws-cut",children:[F.jsxDEV(r6,{log:P,name:Q},void 0,!1,void 0,this),F.jsxDEV("form",{onSubmit:(N)=>void C(N),"aria-label":"Cut a changeset",children:[O?F.jsxDEV("a",{className:"ws-author",href:O.account,title:`${O.who}: your account`,onClick:(N)=>{N.preventDefault(),f0(O.account.slice(n1.length+1).split("/"))},children:O.face},void 0,!1,void 0,this):null,F.jsxDEV("input",{ref:M,name:"changesetMessage","aria-label":"Summary",value:T,onChange:(N)=>A(N.target.value),placeholder:Z===0?"Nothing to cut":L?"Summary (optional)":"Summary (required)",required:!L,maxLength:200,disabled:Boolean(y),title:y??void 0},void 0,!1,void 0,this),F.jsxDEV("button",{type:"submit",className:"primary",disabled:Boolean(y)||R,title:y??void 0,children:R?"Cutting…":Z===0?"Cut a changeset":F.jsxDEV(F.Fragment,{children:["Cut ",l0(Z,"change"),O?F.jsxDEV(F.Fragment,{children:[" on ",F.jsxDEV("b",{children:O.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(!K||Z===0)return F.jsxDEV(r6,{log:P,name:Q},void 0,!1,void 0,this);return F.jsxDEV(F.Fragment,{children:[F.jsxDEV("form",{className:"block cut pad",onSubmit:(y)=>void C(y),"aria-label":"Cut a changeset",children:[F.jsxDEV("label",{children:[F.jsxDEV("span",{children:["Cut ",Z===1?"this change":`these ${Z} changes`," into a changeset: what it does and why"]},void 0,!0,void 0,this),F.jsxDEV("input",{name:"changesetMessage",value:T,onChange:(y)=>A(y.target.value),placeholder:"Welcome email for new sign-ups",required:!0,maxLength:200,disabled:Z===0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("button",{type:"submit",className:"primary",disabled:R||Z===0,children:R?"Cutting…":"Cut a changeset"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV(r6,{log:P,name:Q},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function bV({name:Q,token:U}){let[Z,K]=F1.useState(0),H=y0(U,`/-/${Q}/keys`,Z),[Y,W]=F1.useState(!1),[L,M]=F1.useState(""),[O,T]=F1.useState("write"),[A,R]=F1.useState(!1),[w,P]=F1.useState(null),[V,S]=F1.useState(null),[C,y]=F1.useState(null),N=async()=>{let x=`Read-only link · ${new Date().toLocaleDateString(void 0,{month:"short",day:"numeric"})}`,E=await O0(U,`/-/${Q}/keys`,{method:"POST",body:JSON.stringify({name:x,scope:"read"})}).catch(()=>null),u=E?await E.json().catch(()=>({})):{error:`${P0} did not answer`};if(!E?.ok||!u.key){e0(u.error?M2(u.error).text:"refused","error");return}y(`${window.location.origin}${n1}/${Q}#${new URLSearchParams({token:u.key}).toString()}`),K((b)=>b+1)},v=async(x)=>{x.preventDefault(),R(!0),P(null);let E=await O0(U,`/-/${Q}/keys`,{method:"POST",body:JSON.stringify({name:L.trim(),scope:O})}).catch(()=>null);R(!1);let u=E?await E.json().catch(()=>({})):{error:`${P0} did not answer`};if(!E?.ok||!u.key){P(u.error?M2(u.error).text:"refused");return}W(!1),S({key:u.key,name:L.trim()}),M(""),K((b)=>b+1)},D=async(x)=>{if(!await n4({title:`Revoke ${x.name}?`,body:"Whatever holds it loses this World at once.",action:"Revoke key",danger:!0}))return;let E=await O0(U,`/-/${Q}/keys/${x.id}`,{method:"DELETE"});if(E.ok)e0(`Revoked ${x.name}`);else e0(await T5(E),"error");K((u)=>u+1)};return F.jsxDEV("section",{"aria-labelledby":"keys-head",className:"keys",children:[F.jsxDEV("div",{className:"keys-head",children:[F.jsxDEV("div",{children:[F.jsxDEV("h3",{id:"keys-head",children:"Keys"},void 0,!1,void 0,this),F.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),t2()?F.jsxDEV("a",{className:"button primary",href:`${t2()}/${encodeURIComponent(Q.split("/")[0]??"")}`,children:"Make a key on the platform"},void 0,!1,void 0,this):F.jsxDEV("div",{className:"head-actions",children:[F.jsxDEV("button",{type:"button",onClick:()=>void N(),children:"Share a read-only link"},void 0,!1,void 0,this),F.jsxDEV("button",{type:"button",className:"primary",onClick:()=>{P(null),W(!0)},children:"Make a key"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV(r2,{load:H,what:"the keys",retry:()=>K((x)=>x+1)},void 0,!1,void 0,this),H.state==="ok"?H.data.keys.length===0?F.jsxDEV("p",{className:"mode",children:"No keys yet. The World's own token opens it too."},void 0,!1,void 0,this):F.jsxDEV("table",{className:"dense","aria-label":"Keys",children:[F.jsxDEV("thead",{children:F.jsxDEV("tr",{children:[F.jsxDEV("th",{children:"Name"},void 0,!1,void 0,this),F.jsxDEV("th",{children:"For"},void 0,!1,void 0,this),F.jsxDEV("th",{children:"Access"},void 0,!1,void 0,this),F.jsxDEV("th",{children:"Made"},void 0,!1,void 0,this),F.jsxDEV("th",{children:"Last used"},void 0,!1,void 0,this),F.jsxDEV("th",{className:"num",children:F.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),F.jsxDEV("tbody",{children:H.data.keys.map((x)=>F.jsxDEV("tr",{children:[F.jsxDEV("td",{children:x.name},void 0,!1,void 0,this),F.jsxDEV("td",{children:x.person??F.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),F.jsxDEV("td",{children:x.scope==="write"?"Read and write":"Read only"},void 0,!1,void 0,this),F.jsxDEV("td",{className:"mode",children:F.jsxDEV("span",{title:b8(x.createdAt),children:sF(x.createdAt)},void 0,!1,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("td",{className:"mode",children:x.lastUsedAt?sF(x.lastUsedAt):"never"},void 0,!1,void 0,this),F.jsxDEV("td",{className:"num",children:F.jsxDEV(lA,{label:`More for ${x.name}`,items:[{label:"Revoke…",danger:!0,onSelect:()=>void D(x)}]},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},x.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,F.jsxDEV(E5,{open:Y,onClose:()=>{if(!A)W(!1)},title:"Make a key",footer:F.jsxDEV(F.Fragment,{children:[F.jsxDEV("button",{type:"button",onClick:()=>W(!1),disabled:A,children:"Cancel"},void 0,!1,void 0,this),F.jsxDEV("button",{type:"submit",form:"make-key",disabled:A||!L.trim(),children:A?"Making…":"Make key"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:F.jsxDEV("form",{id:"make-key",onSubmit:v,"aria-label":"Make a key",children:[F.jsxDEV("label",{children:["Name ",F.jsxDEV("input",{autoFocus:!0,name:"keyName",value:L,onChange:(x)=>M(x.target.value),placeholder:"ci, staging app…",maxLength:80,required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("label",{children:["Access ",F.jsxDEV("select",{value:O,onChange:(x)=>T(x.target.value==="read"?"read":"write"),children:[F.jsxDEV("option",{value:"write",children:"Read and write"},void 0,!1,void 0,this),F.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),w?F.jsxDEV("p",{role:"alert",children:w},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this),F.jsxDEV(E5,{open:Boolean(V),onClose:()=>S(null),title:`${V?.name??"The key"} is ready`,footer:F.jsxDEV("button",{type:"button",className:"primary",onClick:()=>S(null),children:"Done"},void 0,!1,void 0,this),children:[F.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),V?F.jsxDEV(oF,{label:"Key",value:V.key,secret:!0},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),F.jsxDEV(E5,{open:Boolean(C),onClose:()=>y(null),title:"A read-only link",footer:F.jsxDEV("button",{type:"button",className:"primary",onClick:()=>y(null),children:"Done"},void 0,!1,void 0,this),children:[F.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),C?F.jsxDEV(oF,{label:"Link",value:C,secret:!0},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var aJ=0;function r6({log:Q,name:U}){if(Q.length===0)return null;return F.jsxDEV("ul",{className:"narration-log",role:"status","aria-live":"polite",children:Q.map((Z)=>F.jsxDEV("li",{className:Z.ok?"ok":"bad",children:[F.jsxDEV("span",{className:"mode",children:F.jsxDEV(j0,{iso:Z.at,time:!0},void 0,!1,void 0,this)},void 0,!1,void 0,this)," ",Z.text,Z.acts?F.jsxDEV(ZO,{name:U,acts:Z.acts},void 0,!1,void 0,this):null]},Z.n,!0,void 0,this))},void 0,!1,void 0,this)}function SO(Q,U,Z,K){let[H,Y]=F1.useState(0),W=H*1e5+Math.floor(Z/2),L=y0(U,`/-/${Q}/origin`,W),M=y0(U,`/-/${Q}/diff`,W),O=y0(U,`/-/${Q}/changesets`,W),[T,A]=F1.useState([]),[R,w]=F1.useState(null),P=(D,x,E)=>{if(A((u)=>[{ok:D,text:x,at:new Date().toISOString(),n:++aJ,...E?.length?{acts:E}:{}},...u].slice(0,8)),!D)e0(x,"error")},V=async(D,x,E)=>{w(D);try{let u=await O0(U,`/-/${Q}/${x}`,E);if(!u.ok){K(u);let b=M2(await k3(u));return P(!1,`${D}: ${b.text}`,b.acts),null}return await u.json()}catch(u){return P(!1,`${D}: the World did not answer (${u instanceof Error?u.message:String(u)})`),null}finally{w(null),Y((u)=>u+1)}},S=L.state==="ok"&&L.data.origin?HH(L.data.origin):null,C=M.state==="ok"?M.data.changes.length:null,y=O.state==="ok"&&S?WV(O.data.changesets.filter((D)=>!D.pushedBy)).sort((D,x)=>D.createdAt.localeCompare(x.createdAt)):[];return{origin:L,diff:M,sets:O,there:S,changes:C,waiting:y,log:T,busy:R,say:P,send:V,push:async()=>{let D=await V("Push","origin/push",{method:"POST"});if(!D)return;if(D.pushed.length===0){P(!0,"Nothing to push: every changeset is already at the remote.");return}for(let x of D.pushed){let E=x.receipts??[],u=E.filter((Q1)=>Q1.status==="replayed").length,b=E.filter((Q1)=>Q1.status==="confirmed").length,m=E.filter((Q1)=>Q1.status==="failed").length,s=x.outcome==="applied"&&m===0;if(x.outcome==="refused"){P(!1,`Push of ${x.changeset} was refused${x.refusal?.length?`: ${x.refusal.map((Q1)=>M2(Q1).text).join("; ")}`:""}.`);continue}let U1=[`${u} of ${l0(E.length,"change")} replayed there`,...b?[`${b} performed at the vendor by the remote`]:[],...m?[`${m} failed`]:[]];P(s,`${x.outcome==="partial"?"Partly pushed":"Pushed"} ${x.changeset} to ${S??"the remote"}: ${U1.join("; ")}${x.refusal?.length?` (${x.refusal.map((Q1)=>M2(Q1).text).join("; ")})`:""}.`)}},pull:async()=>{let D=await V("Pull","origin/pull",{method:"POST"});if(!D)return;let x=Object.entries(D.appended).filter(([,u])=>u>0),E=D.rebased.flatMap((u)=>u.conflicts.map((b)=>`${s1(u.twin)} ${b.subject.type}:${b.subject.id} ${b.field}`));P(E.length===0,`Pulled from ${S??"the remote"}: ${x.length?x.map(([u,b])=>`${l0(b,"entry")} at ${s1(u)}`).join(", "):"nothing new"}${E.length?`; conflicts at ${E.join(", ")}`:""}.`)}}}function EV({name:Q,token:U,canWrite:Z,tick:K,refused:H}){let{origin:Y,there:W,changes:L,log:M,busy:O,say:T,send:A,push:R,pull:w}=SO(Q,U,K,H),[P,V]=F1.useState(""),[S,C]=F1.useState(""),[y,N]=F1.useState(!1),v=async(x)=>{x.preventDefault();let E=await A("Name the remote","origin",{method:"PUT",body:JSON.stringify({url:P.trim(),token:S.trim()})});if(E){let u=Object.values(E.appended??{}).reduce((b,m)=>b+m,0);T(!0,`The remote is ${HH(E.origin)}: its history came in (${l0(u,"entry")}).`),C(""),N(!1)}},D=!Z?"This session reads the World; it changes nothing":null;return F.jsxDEV(F.Fragment,{children:[F.jsxDEV("div",{className:"block remote",children:[F.jsxDEV("div",{className:"block-head",children:[F.jsxDEV("h3",{children:"Origin"},void 0,!1,void 0,this),Z?F.jsxDEV("button",{type:"button",onClick:()=>{V(W??""),N(!y)},"aria-expanded":y,children:W?"Change the remote…":"Name a remote…"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),F.jsxDEV("div",{className:"pad",children:[Y.state==="ok"?W?F.jsxDEV("p",{children:[F.jsxDEV("code",{className:"big",children:W},void 0,!1,void 0,this),Y.data.origin?.fetchedAt?F.jsxDEV("span",{className:"mode",children:[" · last fetched ",F.jsxDEV(j0,{iso:Y.data.origin.fetchedAt},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this):F.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):F.jsxDEV(r2,{load:Y,what:"the remote",lines:1},void 0,!1,void 0,this),y?F.jsxDEV("form",{className:"stack origin-form",onSubmit:(x)=>void v(x),"aria-label":"Name the remote",children:[F.jsxDEV("label",{children:[F.jsxDEV("span",{children:"The World's address"},void 0,!1,void 0,this),F.jsxDEV("input",{name:"originUrl",value:P,onChange:(x)=>V(x.target.value),placeholder:"https://worlds.example.com/acme/team",required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("label",{children:[F.jsxDEV("span",{children:"A key or token that opens it"},void 0,!1,void 0,this),F.jsxDEV("input",{name:"originToken",type:"password",value:S,onChange:(x)=>C(x.target.value),required:!0,autoComplete:"off"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.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),F.jsxDEV("div",{className:"row-actions",children:[F.jsxDEV("button",{type:"submit",className:"primary",disabled:O!==null,children:O==="Name the remote"?"Bringing its history in…":"Save the remote"},void 0,!1,void 0,this),F.jsxDEV("button",{type:"button",onClick:()=>N(!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),F.jsxDEV(r6,{log:M,name:Q},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function hV({name:Q,token:U,canWrite:Z,refused:K}){let[H,Y]=F1.useState(0),W=y0(U,`/-/${Q}/twins`,H),L=y0(U,`/-/${Q}/links`,H),M=y0(U,`/-/${Q}/requests?hours=24`,H),[O,T]=F1.useState({}),[A,R]=F1.useState(null),[w,P]=F1.useState(""),[V,S]=F1.useState(!1),[C,y]=F1.useState([]),N=(b,m,s)=>{if(y((U1)=>[{ok:b,text:m,at:new Date().toISOString(),n:++aJ,...s?.length?{acts:s}:{}},...U1].slice(0,6)),!b)e0(m,"error")},v=L.state==="ok"?Object.keys(L.data.links).sort():[];F1.useEffect(()=>{let b=!0;return Promise.all(v.map(async(m)=>{let s=await O0(U,`/-/${Q}/twins/${m}/credential`).catch(()=>null),U1=s?.ok?await s.json():null;return[m,U1?.credential??null]})).then((m)=>{if(b)T(Object.fromEntries(m))}),()=>{b=!1}},[Q,U,v.join(","),H]);let D=async(b)=>{if(b.preventDefault(),!A||!w)return;S(!0);let m=await O0(U,`/-/${Q}/twins/${A.vendor}/credential`,{method:"PUT",body:w,headers:{"content-type":"text/plain"}}).catch(()=>null);if(S(!1),!m){N(!1,`Seal ${A.vendor}: ${P0} did not answer`);return}if(!m.ok){K(m);let U1=M2(await k3(m));N(!1,`Seal ${s1(A.vendor)}: ${U1.text}`,U1.acts);return}let s=await m.json().catch(()=>({}));N(!0,`Sealed a credential for ${s1(A.vendor)}${s.fingerprint?` (${s.fingerprint})`:""}: it opens for ${s.boundTo??A.to} only, and is never shown again.`),P(""),R(null),Y((U1)=>U1+1)},x=async(b)=>{if(!await n4({title:`Remove the link ${b}?`,body:`Requests to ${c3}/${Q}/${b}/… stop being forwarded to ${L.state==="ok"?L.data.links[b]?.origin:"its origin"}.`,action:"Remove link",danger:!0}))return;let m=await O0(U,`/-/${Q}/links/${b}`,{method:"DELETE"}).catch(()=>null);if(!m?.ok){if(m)K(m);N(!1,`Remove ${b}: ${m?await T5(m):"the World did not answer"}`);return}N(!0,`Removed the link ${b}.`),Y((s)=>s+1)},E=(b)=>b?F.jsxDEV(F.Fragment,{children:[F.jsxDEV("span",{className:"badge rooted",children:"sealed"},void 0,!1,void 0,this)," ",F.jsxDEV("span",{className:"mode",children:[b.fingerprint?F.jsxDEV("code",{children:b.fingerprint},void 0,!1,void 0,this):null," · ",F.jsxDEV(j0,{iso:b.placedAt},void 0,!1,void 0,this),b.sealedBy?` · by ${b.sealedBy==="vault"?"the vault":"the host's key"}`:""]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):F.jsxDEV("span",{className:"mode",children:"none"},void 0,!1,void 0,this),u=W.state==="ok"?W.data.twins:[];return F.jsxDEV(F.Fragment,{children:[F.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),F.jsxDEV(r6,{log:C,name:Q},void 0,!1,void 0,this),F.jsxDEV("section",{className:"block","aria-labelledby":"creds-head",children:[F.jsxDEV("div",{className:"block-head",children:F.jsxDEV("h3",{id:"creds-head",children:"Vendors"},void 0,!1,void 0,this)},void 0,!1,void 0,this),F.jsxDEV(r2,{load:W,what:"the vendors"},void 0,!1,void 0,this),W.state==="ok"?F.jsxDEV("table",{className:"dense","aria-label":"Credentials by vendor",children:[F.jsxDEV("thead",{children:F.jsxDEV("tr",{children:[F.jsxDEV("th",{children:"Vendor"},void 0,!1,void 0,this),F.jsxDEV("th",{children:"Credential"},void 0,!1,void 0,this),F.jsxDEV("th",{children:"Bound to"},void 0,!1,void 0,this),F.jsxDEV("th",{children:"Real service"},void 0,!1,void 0,this),Z?F.jsxDEV("th",{className:"num",children:F.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),F.jsxDEV("tbody",{children:u.map((b)=>F.jsxDEV("tr",{children:[F.jsxDEV("td",{children:F.jsxDEV("span",{className:"vendor-cell",children:[F.jsxDEV(q2,{vendor:b.twin},void 0,!1,void 0,this),s1(b.twin)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("td",{children:E(b.credential)},void 0,!1,void 0,this),F.jsxDEV("td",{children:b.credential?.boundTo?F.jsxDEV("code",{children:b.credential.boundTo},void 0,!1,void 0,this):F.jsxDEV("span",{className:"mode",children:"—"},void 0,!1,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("td",{children:b.root?.url?F.jsxDEV("code",{children:b.root.url},void 0,!1,void 0,this):F.jsxDEV("span",{className:"mode",children:"none: a stand-in"},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z?F.jsxDEV("td",{className:"num",children:F.jsxDEV("button",{type:"button",disabled:!b.root?.url,title:b.root?.url?`Seal ${s1(b.twin)}'s real credential for ${b.root.url}`:"Connect it to its real service first (Settings › Real services): a credential is sealed for where it goes",onClick:()=>{P(""),R({vendor:b.twin,to:b.root.url})},children:b.credential?"Replace…":"Seal a credential…"},void 0,!1,void 0,this)},void 0,!1,void 0,this):null]},b.twin,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,W.state==="ok"&&u.every((b)=>!b.root?.url)?F.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),F.jsxDEV("section",{className:"block","aria-labelledby":"links-head",children:[F.jsxDEV("div",{className:"block-head",children:[F.jsxDEV("h3",{id:"links-head",children:"Links"},void 0,!1,void 0,this),F.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),F.jsxDEV(r2,{load:L,what:"the links"},void 0,!1,void 0,this),M.state==="ok"&&(M.data.journalFailures??0)>0?F.jsxDEV("p",{className:"mode pad",role:"alert",children:[M.data.journalFailures," request ",M.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,L.state==="ok"&&v.length===0?F.jsxDEV("p",{className:"mode pad",children:["No links. A link forwards requests for a vendor with no twin here, at ",F.jsxDEV("code",{children:[c3,"/",Q,"/<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,v.length?F.jsxDEV("table",{className:"dense","aria-label":"Links",children:[F.jsxDEV("thead",{children:F.jsxDEV("tr",{children:[F.jsxDEV("th",{children:"Link"},void 0,!1,void 0,this),F.jsxDEV("th",{children:"Origin"},void 0,!1,void 0,this),F.jsxDEV("th",{className:"num",children:"Requests, 24h"},void 0,!1,void 0,this),F.jsxDEV("th",{children:"Credential"},void 0,!1,void 0,this),Z?F.jsxDEV("th",{className:"num",children:F.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),F.jsxDEV("tbody",{children:v.map((b)=>{let m=L.state==="ok"?L.data.links[b].origin:"",s=M.state==="ok"?M.data.twins.find((U1)=>U1.twin===b):void 0;return F.jsxDEV("tr",{children:[F.jsxDEV("td",{children:F.jsxDEV("b",{children:b},void 0,!1,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("td",{children:F.jsxDEV("code",{children:m},void 0,!1,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("td",{className:"num",children:s?F.jsxDEV("span",{title:Object.entries(s.byStatus).map(([U1,Q1])=>`${U1}: ${Q1}`).join(" · "),children:s.requests},void 0,!1,void 0,this):F.jsxDEV("span",{className:"mode",children:"—"},void 0,!1,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("td",{children:[E(O[b]??null),O[b]?.boundTo?F.jsxDEV("div",{className:"mode",children:["bound to ",F.jsxDEV("code",{children:O[b].boundTo},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),Z?F.jsxDEV("td",{className:"num row-actions",children:[F.jsxDEV("button",{type:"button",onClick:()=>{P(""),R({vendor:b,to:m})},children:O[b]?"Replace…":"Seal a credential…"},void 0,!1,void 0,this),F.jsxDEV("button",{type:"button",onClick:()=>void x(b),children:"Remove…"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},b,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),F.jsxDEV(E5,{open:Boolean(A),onClose:()=>{if(!V)R(null)},title:`Seal ${A?s1(A.vendor):""}'s credential`,footer:F.jsxDEV(F.Fragment,{children:[F.jsxDEV("button",{type:"button",onClick:()=>R(null),disabled:V,children:"Cancel"},void 0,!1,void 0,this),F.jsxDEV("button",{type:"submit",form:"seal-credential",className:"primary",disabled:V||!w,children:V?"Sealing…":"Seal it"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:F.jsxDEV("form",{id:"seal-credential",className:"stack",onSubmit:(b)=>void D(b),children:[F.jsxDEV("p",{className:"mode",children:["It is sealed for ",F.jsxDEV("code",{children:A?.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),F.jsxDEV("label",{children:[F.jsxDEV("span",{children:"The real key"},void 0,!1,void 0,this),F.jsxDEV("input",{name:"credential",type:"password",value:w,onChange:(b)=>P(b.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 xV({name:Q,token:U,admin:Z,canWrite:K,refused:H,onRemoved:Y,only:W}){let L=(l)=>!W||W===l,[M,O]=F1.useState(0),T=y0(U,`/-/${Q}/twins`,M),A=y0(U,`/-/${Q}/checks`,M),[R,w]=F1.useState(0),P=y0(U,`/-/${Q}/clock`,R),[V,S]=F1.useState([]),[C,y]=F1.useState(null),[N,v]=F1.useState(null),[D,x]=F1.useState(""),[E,u]=F1.useState("gated"),[b,m]=F1.useState(!1),s=(l,o,k)=>{if(S((t)=>[{ok:l,text:o,at:new Date().toISOString(),n:++aJ,...k?.length?{acts:k}:{}},...t].slice(0,6)),!l)e0(o,"error")},U1=async(l,o,k)=>{let t=await O0(U,o,k).catch(()=>null);if(!t)return s(!1,`${l}: the World did not answer`),!1;if(!t.ok){H(t);let _1=M2(await k3(t));return s(!1,`${l}: ${_1.text}`,_1.acts),!1}return s(!0,`${l}: done.`),O((_1)=>_1+1),!0},Q1=async(l)=>{if(l.preventDefault(),!N)return;m(!0);let o=N.root??{},k=await U1(D.trim()?`Connect ${s1(N.twin)} to ${D.trim()}`:`Disconnect ${s1(N.twin)}`,`/-/${Q}/twins/${N.twin}/root`,{method:"PUT",body:JSON.stringify(D.trim()?{...o,url:D.trim(),deploy:E}:null)});if(m(!1),k)v(null)},h=async()=>{if(!await n4({title:`Rotate the tokens of ${Q}?`,body:"Every app, script and person holding the current tokens loses access at once. The new ones are shown once.",action:"Rotate tokens",danger:!0}))return;let l=await O0(Z,`/-/worlds/${Q}/rotate`,{method:"POST"});if(l.ok)y(await l.json()),s(!0,"Rotated: the new tokens are shown once, below.");else s(!1,`Rotate: ${await T5(l)}`)},g=async()=>{if(!await n4({title:`Remove ${Q}?`,body:"The host stops serving it and its whole history goes with it. This cannot be undone.",action:"Remove World",danger:!0,typed:Q}))return;let l=await O0(Z,`/-/worlds/${Q}`,{method:"DELETE"}).catch((o)=>o);if(l instanceof Error){s(!1,`Remove: the host did not answer (${l.message})`);return}if(l.ok)Y();else s(!1,`Remove: ${await T5(l)}`)},p=T.state==="ok"?T.data.twins:[],c={gated:"gated: a person deploys an approved changeset",auto:"auto: a push deploys at once",hold:"hold: nothing deploys"};return F.jsxDEV(F.Fragment,{children:[F.jsxDEV(r6,{log:V,name:Q},void 0,!1,void 0,this),L("access")?F.jsxDEV(F.Fragment,{children:[F.jsxDEV("h3",{className:"settings-head",children:"Access"},void 0,!1,void 0,this),K?F.jsxDEV(bV,{name:Q,token:U},void 0,!1,void 0,this):F.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,L("services")?F.jsxDEV(F.Fragment,{children:[F.jsxDEV("h3",{className:"settings-head",children:"Real services"},void 0,!1,void 0,this),F.jsxDEV("p",{className:"mode",children:[p.some((l)=>l.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),F.jsxDEV(r2,{load:T,what:"the vendors"},void 0,!1,void 0,this),T.state==="ok"?F.jsxDEV("div",{className:"block",children:F.jsxDEV("table",{className:"dense","aria-label":"Real services",children:[F.jsxDEV("thead",{children:F.jsxDEV("tr",{children:[F.jsxDEV("th",{children:"Vendor"},void 0,!1,void 0,this),F.jsxDEV("th",{children:"Real service"},void 0,!1,void 0,this),F.jsxDEV("th",{children:"Deploy policy"},void 0,!1,void 0,this),F.jsxDEV("th",{children:"Last read from it"},void 0,!1,void 0,this),K?F.jsxDEV("th",{className:"num",children:F.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),F.jsxDEV("tbody",{children:p.map((l)=>{let o=l.root;return F.jsxDEV("tr",{children:[F.jsxDEV("td",{children:F.jsxDEV("span",{className:"vendor-cell",children:[F.jsxDEV(q2,{vendor:l.twin},void 0,!1,void 0,this),F.jsxDEV("a",{href:`${n1}/${Q}/${l.twin}`,title:`Its log and stored state · ${l.position??0} entries`,onClick:(k)=>{k.preventDefault(),f0([...Q.split("/"),l.twin])},children:s1(l.twin)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("td",{children:o?.url?F.jsxDEV("code",{children:o.url},void 0,!1,void 0,this):F.jsxDEV("span",{className:"mode",children:"not connected"},void 0,!1,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("td",{className:"mode",children:o?.url?c[o.deploy??""]??o.deploy??"—":"—"},void 0,!1,void 0,this),F.jsxDEV("td",{children:l.refresh?.failed?F.jsxDEV("span",{role:"alert",children:["failed ×",l.refresh.failed.count??1,": ",l.refresh.failed.reason??""]},void 0,!0,void 0,this):o?.url?b8(l.refresh?.observedAt??l.refresh?.at):F.jsxDEV("span",{className:"mode",children:"—"},void 0,!1,void 0,this)},void 0,!1,void 0,this),K?F.jsxDEV("td",{className:"num row-actions",children:[F.jsxDEV("button",{type:"button",onClick:()=>{x(o?.url??""),u(o?.deploy==="auto"||o?.deploy==="hold"?o.deploy:"gated"),v(l)},children:o?.url?"Change…":"Connect…"},void 0,!1,void 0,this),F.jsxDEV("button",{type:"button",disabled:!o?.url,title:o?.url?"Read the real service's current state into this World":"Connect it first",onClick:()=>void n4({title:`Read ${s1(l.twin)} now?`,body:`The real ${s1(l.twin)}'s current state is read into this World. Nothing is written to ${s1(l.twin)}.`,action:"Read from it"}).then((k)=>{if(k)U1(`Read from ${s1(l.twin)}`,`/-/${Q}/twins/${l.twin}/refresh`,{method:"POST"})}),children:"Read from it"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},l.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,L("clock")?F.jsxDEV(F.Fragment,{children:[F.jsxDEV("h3",{className:"settings-head",children:"Clock"},void 0,!1,void 0,this),F.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),F.jsxDEV(BV,{name:Q,token:U,clock:P,canWrite:K,onChanged:()=>w((l)=>l+1),refused:H,open:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,L("checks")?F.jsxDEV(F.Fragment,{children:[F.jsxDEV("h3",{className:"settings-head",children:"Checks"},void 0,!1,void 0,this),F.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),F.jsxDEV(r2,{load:A,what:"the checks"},void 0,!1,void 0,this),A.state==="ok"?A.data.checks.length===0?F.jsxDEV("p",{className:"mode",children:"No checks: every change is performed as it comes."},void 0,!1,void 0,this):F.jsxDEV("div",{className:"block",children:F.jsxDEV("table",{className:"dense","aria-label":"Checks",children:F.jsxDEV("tbody",{children:A.data.checks.map((l)=>F.jsxDEV("tr",{children:F.jsxDEV("td",{children:F.jsxDEV("code",{children:l},void 0,!1,void 0,this)},void 0,!1,void 0,this)},l,!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,Z&&!W?F.jsxDEV("div",{className:"danger",role:"region","aria-label":"Danger zone",children:[F.jsxDEV("h3",{children:"Danger zone"},void 0,!1,void 0,this),C?F.jsxDEV("p",{role:"status",children:["token ",F.jsxDEV("code",{children:C.token},void 0,!1,void 0,this)," · read token ",F.jsxDEV("code",{children:C.readToken},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,F.jsxDEV("p",{children:[F.jsxDEV("button",{type:"button",onClick:()=>void h(),children:"Rotate tokens"},void 0,!1,void 0,this)," ",F.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),F.jsxDEV("p",{children:[F.jsxDEV("button",{type:"button",onClick:()=>void g(),children:"Remove world"},void 0,!1,void 0,this)," ",F.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,F.jsxDEV(E5,{open:Boolean(N),onClose:()=>{if(!b)v(null)},title:`Connect ${N?s1(N.twin):""} to its real service`,footer:F.jsxDEV(F.Fragment,{children:[F.jsxDEV("button",{type:"button",onClick:()=>v(null),disabled:b,children:"Cancel"},void 0,!1,void 0,this),F.jsxDEV("button",{type:"submit",form:"connect-root",className:"primary",disabled:b,children:b?"Saving…":D.trim()?"Connect":"Disconnect"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:F.jsxDEV("form",{id:"connect-root",className:"stack",onSubmit:(l)=>void Q1(l),children:[F.jsxDEV("label",{children:[F.jsxDEV("span",{children:"The real service's API address"},void 0,!1,void 0,this),F.jsxDEV("input",{name:"rootUrl",value:D,onChange:(l)=>x(l.target.value),placeholder:"https://api.openai.com",autoFocus:!0},void 0,!1,void 0,this),F.jsxDEV("span",{className:"mode",children:"Empty disconnects it."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("label",{children:[F.jsxDEV("span",{children:"Deploy policy"},void 0,!1,void 0,this),F.jsxDEV("select",{name:"rootDeploy",value:E,onChange:(l)=>u(l.target.value==="auto"?"auto":l.target.value==="hold"?"hold":"gated"),children:["gated","auto","hold"].map((l)=>F.jsxDEV("option",{value:l,children:c[l]},l,!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 vO(){return F.jsxDEV(F.Fragment,{children:[F.jsxDEV(ej,{},void 0,!1,void 0,this),F.jsxDEV(cA,{},void 0,!1,void 0,this),F.jsxDEV(pA,{},void 0,!1,void 0,this),F.jsxDEV(gA,{},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var VO=s0(u8(),1);Aq();jO.createRoot(U7).render(VO.jsxDEV(vO,{},void 0,!1,void 0,this));
|