(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const c of l.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&i(c)}).observe(document,{childList:!0,subtree:!0});function a(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerPolicy&&(l.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?l.credentials="include":o.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(o){if(o.ep)return;o.ep=!0;const l=a(o);fetch(o.href,l)}})();var xc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ls(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function g3(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var n=e.default;if(typeof n=="function"){var a=function i(){var o=!1;try{o=this instanceof i}catch{}return o?Reflect.construct(n,arguments,this.constructor):n.apply(this,arguments)};a.prototype=n.prototype}else a={};return Object.defineProperty(a,"__esModule",{value:!0}),Object.keys(e).forEach(function(i){var o=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(a,i,o.get?o:{enumerable:!0,get:function(){return e[i]}})}),a}var Xf={exports:{}},ds={};/**
 * @license React
 * react-jsx-runtime.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var k1;function v3(){if(k1)return ds;k1=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function a(i,o,l){var c=null;if(l!==void 0&&(c=""+l),o.key!==void 0&&(c=""+o.key),"key"in o){l={};for(var d in o)d!=="key"&&(l[d]=o[d])}else l=o;return o=l.ref,{$$typeof:e,type:i,key:c,ref:o!==void 0?o:null,props:l}}return ds.Fragment=n,ds.jsx=a,ds.jsxs=a,ds}var O1;function m3(){return O1||(O1=1,Xf.exports=v3()),Xf.exports}var g=m3(),Kf={exports:{}},fs={},Zf={exports:{}},Qf={};/**
 * @license React
 * scheduler.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var q1;function y3(){return q1||(q1=1,(function(e){function n(O,F){var J=O.length;O.push(F);e:for(;0<J;){var G=J-1>>>1,re=O[G];if(0<o(re,F))O[G]=F,O[J]=re,J=G;else break e}}function a(O){return O.length===0?null:O[0]}function i(O){if(O.length===0)return null;var F=O[0],J=O.pop();if(J!==F){O[0]=J;e:for(var G=0,re=O.length,B=re>>>1;G<B;){var Y=2*(G+1)-1,ae=O[Y],U=Y+1,Z=O[U];if(0>o(ae,J))U<re&&0>o(Z,ae)?(O[G]=Z,O[U]=J,G=U):(O[G]=ae,O[Y]=J,G=Y);else if(U<re&&0>o(Z,J))O[G]=Z,O[U]=J,G=U;else break e}}return F}function o(O,F){var J=O.sortIndex-F.sortIndex;return J!==0?J:O.id-F.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var c=Date,d=c.now();e.unstable_now=function(){return c.now()-d}}var f=[],h=[],p=1,v=null,m=3,b=!1,_=!1,S=!1,w=!1,C=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;function N(O){for(var F=a(h);F!==null;){if(F.callback===null)i(h);else if(F.startTime<=O)i(h),F.sortIndex=F.expirationTime,n(f,F);else break;F=a(h)}}function R(O){if(S=!1,N(O),!_)if(a(f)!==null)_=!0,z||(z=!0,V());else{var F=a(h);F!==null&&H(R,F.startTime-O)}}var z=!1,j=-1,A=5,D=-1;function I(){return w?!0:!(e.unstable_now()-D<A)}function P(){if(w=!1,z){var O=e.unstable_now();D=O;var F=!0;try{e:{_=!1,S&&(S=!1,T(j),j=-1),b=!0;var J=m;try{t:{for(N(O),v=a(f);v!==null&&!(v.expirationTime>O&&I());){var G=v.callback;if(typeof G=="function"){v.callback=null,m=v.priorityLevel;var re=G(v.expirationTime<=O);if(O=e.unstable_now(),typeof re=="function"){v.callback=re,N(O),F=!0;break t}v===a(f)&&i(f),N(O)}else i(f);v=a(f)}if(v!==null)F=!0;else{var B=a(h);B!==null&&H(R,B.startTime-O),F=!1}}break e}finally{v=null,m=J,b=!1}F=void 0}}finally{F?V():z=!1}}}var V;if(typeof E=="function")V=function(){E(P)};else if(typeof MessageChannel<"u"){var $=new MessageChannel,L=$.port2;$.port1.onmessage=P,V=function(){L.postMessage(null)}}else V=function(){C(P,0)};function H(O,F){j=C(function(){O(e.unstable_now())},F)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(O){O.callback=null},e.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<O?Math.floor(1e3/O):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_next=function(O){switch(m){case 1:case 2:case 3:var F=3;break;default:F=m}var J=m;m=F;try{return O()}finally{m=J}},e.unstable_requestPaint=function(){w=!0},e.unstable_runWithPriority=function(O,F){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var J=m;m=O;try{return F()}finally{m=J}},e.unstable_scheduleCallback=function(O,F,J){var G=e.unstable_now();switch(typeof J=="object"&&J!==null?(J=J.delay,J=typeof J=="number"&&0<J?G+J:G):J=G,O){case 1:var re=-1;break;case 2:re=250;break;case 5:re=1073741823;break;case 4:re=1e4;break;default:re=5e3}return re=J+re,O={id:p++,callback:F,priorityLevel:O,startTime:J,expirationTime:re,sortIndex:-1},J>G?(O.sortIndex=J,n(h,O),a(f)===null&&O===a(h)&&(S?(T(j),j=-1):S=!0,H(R,J-G))):(O.sortIndex=re,n(f,O),_||b||(_=!0,z||(z=!0,V()))),O},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(O){var F=m;return function(){var J=m;m=F;try{return O.apply(this,arguments)}finally{m=J}}}})(Qf)),Qf}var B1;function b3(){return B1||(B1=1,Zf.exports=y3()),Zf.exports}var Jf={exports:{}},Ae={};/**
 * @license React
 * react.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var L1;function x3(){if(L1)return Ae;L1=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),m=Symbol.iterator;function b(B){return B===null||typeof B!="object"?null:(B=m&&B[m]||B["@@iterator"],typeof B=="function"?B:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,w={};function C(B,Y,ae){this.props=B,this.context=Y,this.refs=w,this.updater=ae||_}C.prototype.isReactComponent={},C.prototype.setState=function(B,Y){if(typeof B!="object"&&typeof B!="function"&&B!=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,B,Y,"setState")},C.prototype.forceUpdate=function(B){this.updater.enqueueForceUpdate(this,B,"forceUpdate")};function T(){}T.prototype=C.prototype;function E(B,Y,ae){this.props=B,this.context=Y,this.refs=w,this.updater=ae||_}var N=E.prototype=new T;N.constructor=E,S(N,C.prototype),N.isPureReactComponent=!0;var R=Array.isArray;function z(){}var j={H:null,A:null,T:null,S:null},A=Object.prototype.hasOwnProperty;function D(B,Y,ae){var U=ae.ref;return{$$typeof:e,type:B,key:Y,ref:U!==void 0?U:null,props:ae}}function I(B,Y){return D(B.type,Y,B.props)}function P(B){return typeof B=="object"&&B!==null&&B.$$typeof===e}function V(B){var Y={"=":"=0",":":"=2"};return"$"+B.replace(/[=:]/g,function(ae){return Y[ae]})}var $=/\/+/g;function L(B,Y){return typeof B=="object"&&B!==null&&B.key!=null?V(""+B.key):Y.toString(36)}function H(B){switch(B.status){case"fulfilled":return B.value;case"rejected":throw B.reason;default:switch(typeof B.status=="string"?B.then(z,z):(B.status="pending",B.then(function(Y){B.status==="pending"&&(B.status="fulfilled",B.value=Y)},function(Y){B.status==="pending"&&(B.status="rejected",B.reason=Y)})),B.status){case"fulfilled":return B.value;case"rejected":throw B.reason}}throw B}function O(B,Y,ae,U,Z){var ne=typeof B;(ne==="undefined"||ne==="boolean")&&(B=null);var le=!1;if(B===null)le=!0;else switch(ne){case"bigint":case"string":case"number":le=!0;break;case"object":switch(B.$$typeof){case e:case n:le=!0;break;case p:return le=B._init,O(le(B._payload),Y,ae,U,Z)}}if(le)return Z=Z(B),le=U===""?"."+L(B,0):U,R(Z)?(ae="",le!=null&&(ae=le.replace($,"$&/")+"/"),O(Z,Y,ae,"",function(ye){return ye})):Z!=null&&(P(Z)&&(Z=I(Z,ae+(Z.key==null||B&&B.key===Z.key?"":(""+Z.key).replace($,"$&/")+"/")+le)),Y.push(Z)),1;le=0;var K=U===""?".":U+":";if(R(B))for(var de=0;de<B.length;de++)U=B[de],ne=K+L(U,de),le+=O(U,Y,ae,ne,Z);else if(de=b(B),typeof de=="function")for(B=de.call(B),de=0;!(U=B.next()).done;)U=U.value,ne=K+L(U,de++),le+=O(U,Y,ae,ne,Z);else if(ne==="object"){if(typeof B.then=="function")return O(H(B),Y,ae,U,Z);throw Y=String(B),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(B).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.")}return le}function F(B,Y,ae){if(B==null)return B;var U=[],Z=0;return O(B,U,"","",function(ne){return Y.call(ae,ne,Z++)}),U}function J(B){if(B._status===-1){var Y=B._result;Y=Y(),Y.then(function(ae){(B._status===0||B._status===-1)&&(B._status=1,B._result=ae)},function(ae){(B._status===0||B._status===-1)&&(B._status=2,B._result=ae)}),B._status===-1&&(B._status=0,B._result=Y)}if(B._status===1)return B._result.default;throw B._result}var G=typeof reportError=="function"?reportError:function(B){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Y=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof B=="object"&&B!==null&&typeof B.message=="string"?String(B.message):String(B),error:B});if(!window.dispatchEvent(Y))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",B);return}console.error(B)},re={map:F,forEach:function(B,Y,ae){F(B,function(){Y.apply(this,arguments)},ae)},count:function(B){var Y=0;return F(B,function(){Y++}),Y},toArray:function(B){return F(B,function(Y){return Y})||[]},only:function(B){if(!P(B))throw Error("React.Children.only expected to receive a single React element child.");return B}};return Ae.Activity=v,Ae.Children=re,Ae.Component=C,Ae.Fragment=a,Ae.Profiler=o,Ae.PureComponent=E,Ae.StrictMode=i,Ae.Suspense=f,Ae.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,Ae.__COMPILER_RUNTIME={__proto__:null,c:function(B){return j.H.useMemoCache(B)}},Ae.cache=function(B){return function(){return B.apply(null,arguments)}},Ae.cacheSignal=function(){return null},Ae.cloneElement=function(B,Y,ae){if(B==null)throw Error("The argument must be a React element, but you passed "+B+".");var U=S({},B.props),Z=B.key;if(Y!=null)for(ne in Y.key!==void 0&&(Z=""+Y.key),Y)!A.call(Y,ne)||ne==="key"||ne==="__self"||ne==="__source"||ne==="ref"&&Y.ref===void 0||(U[ne]=Y[ne]);var ne=arguments.length-2;if(ne===1)U.children=ae;else if(1<ne){for(var le=Array(ne),K=0;K<ne;K++)le[K]=arguments[K+2];U.children=le}return D(B.type,Z,U)},Ae.createContext=function(B){return B={$$typeof:c,_currentValue:B,_currentValue2:B,_threadCount:0,Provider:null,Consumer:null},B.Provider=B,B.Consumer={$$typeof:l,_context:B},B},Ae.createElement=function(B,Y,ae){var U,Z={},ne=null;if(Y!=null)for(U in Y.key!==void 0&&(ne=""+Y.key),Y)A.call(Y,U)&&U!=="key"&&U!=="__self"&&U!=="__source"&&(Z[U]=Y[U]);var le=arguments.length-2;if(le===1)Z.children=ae;else if(1<le){for(var K=Array(le),de=0;de<le;de++)K[de]=arguments[de+2];Z.children=K}if(B&&B.defaultProps)for(U in le=B.defaultProps,le)Z[U]===void 0&&(Z[U]=le[U]);return D(B,ne,Z)},Ae.createRef=function(){return{current:null}},Ae.forwardRef=function(B){return{$$typeof:d,render:B}},Ae.isValidElement=P,Ae.lazy=function(B){return{$$typeof:p,_payload:{_status:-1,_result:B},_init:J}},Ae.memo=function(B,Y){return{$$typeof:h,type:B,compare:Y===void 0?null:Y}},Ae.startTransition=function(B){var Y=j.T,ae={};j.T=ae;try{var U=B(),Z=j.S;Z!==null&&Z(ae,U),typeof U=="object"&&U!==null&&typeof U.then=="function"&&U.then(z,G)}catch(ne){G(ne)}finally{Y!==null&&ae.types!==null&&(Y.types=ae.types),j.T=Y}},Ae.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},Ae.use=function(B){return j.H.use(B)},Ae.useActionState=function(B,Y,ae){return j.H.useActionState(B,Y,ae)},Ae.useCallback=function(B,Y){return j.H.useCallback(B,Y)},Ae.useContext=function(B){return j.H.useContext(B)},Ae.useDebugValue=function(){},Ae.useDeferredValue=function(B,Y){return j.H.useDeferredValue(B,Y)},Ae.useEffect=function(B,Y){return j.H.useEffect(B,Y)},Ae.useEffectEvent=function(B){return j.H.useEffectEvent(B)},Ae.useId=function(){return j.H.useId()},Ae.useImperativeHandle=function(B,Y,ae){return j.H.useImperativeHandle(B,Y,ae)},Ae.useInsertionEffect=function(B,Y){return j.H.useInsertionEffect(B,Y)},Ae.useLayoutEffect=function(B,Y){return j.H.useLayoutEffect(B,Y)},Ae.useMemo=function(B,Y){return j.H.useMemo(B,Y)},Ae.useOptimistic=function(B,Y){return j.H.useOptimistic(B,Y)},Ae.useReducer=function(B,Y,ae){return j.H.useReducer(B,Y,ae)},Ae.useRef=function(B){return j.H.useRef(B)},Ae.useState=function(B){return j.H.useState(B)},Ae.useSyncExternalStore=function(B,Y,ae){return j.H.useSyncExternalStore(B,Y,ae)},Ae.useTransition=function(){return j.H.useTransition()},Ae.version="19.2.0",Ae}var H1;function $a(){return H1||(H1=1,Jf.exports=x3()),Jf.exports}var eh={exports:{}},Vt={};/**
 * @license React
 * react-dom.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var I1;function _3(){if(I1)return Vt;I1=1;var e=$a();function n(f){var h="https://react.dev/errors/"+f;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)h+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+f+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var i={d:{f:a,r:function(){throw Error(n(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},o=Symbol.for("react.portal");function l(f,h,p){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:v==null?null:""+v,children:f,containerInfo:h,implementation:p}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(f,h){if(f==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Vt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,Vt.createPortal=function(f,h){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(n(299));return l(f,h,null,p)},Vt.flushSync=function(f){var h=c.T,p=i.p;try{if(c.T=null,i.p=2,f)return f()}finally{c.T=h,i.p=p,i.d.f()}},Vt.preconnect=function(f,h){typeof f=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,i.d.C(f,h))},Vt.prefetchDNS=function(f){typeof f=="string"&&i.d.D(f)},Vt.preinit=function(f,h){if(typeof f=="string"&&h&&typeof h.as=="string"){var p=h.as,v=d(p,h.crossOrigin),m=typeof h.integrity=="string"?h.integrity:void 0,b=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;p==="style"?i.d.S(f,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:v,integrity:m,fetchPriority:b}):p==="script"&&i.d.X(f,{crossOrigin:v,integrity:m,fetchPriority:b,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Vt.preinitModule=function(f,h){if(typeof f=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var p=d(h.as,h.crossOrigin);i.d.M(f,{crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&i.d.M(f)},Vt.preload=function(f,h){if(typeof f=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var p=h.as,v=d(p,h.crossOrigin);i.d.L(f,p,{crossOrigin:v,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Vt.preloadModule=function(f,h){if(typeof f=="string")if(h){var p=d(h.as,h.crossOrigin);i.d.m(f,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else i.d.m(f)},Vt.requestFormReset=function(f){i.d.r(f)},Vt.unstable_batchedUpdates=function(f,h){return f(h)},Vt.useFormState=function(f,h,p){return c.H.useFormState(f,h,p)},Vt.useFormStatus=function(){return c.H.useHostTransitionStatus()},Vt.version="19.2.0",Vt}var U1;function Jc(){if(U1)return eh.exports;U1=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),eh.exports=_3(),eh.exports}/**
 * @license React
 * react-dom-client.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var V1;function S3(){if(V1)return fs;V1=1;var e=b3(),n=$a(),a=Jc();function i(t){var r="https://react.dev/errors/"+t;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)r+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+t+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function l(t){var r=t,s=t;if(t.alternate)for(;r.return;)r=r.return;else{t=r;do r=t,(r.flags&4098)!==0&&(s=r.return),t=r.return;while(t)}return r.tag===3?s:null}function c(t){if(t.tag===13){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function d(t){if(t.tag===31){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function f(t){if(l(t)!==t)throw Error(i(188))}function h(t){var r=t.alternate;if(!r){if(r=l(t),r===null)throw Error(i(188));return r!==t?null:t}for(var s=t,u=r;;){var y=s.return;if(y===null)break;var x=y.alternate;if(x===null){if(u=y.return,u!==null){s=u;continue}break}if(y.child===x.child){for(x=y.child;x;){if(x===s)return f(y),t;if(x===u)return f(y),r;x=x.sibling}throw Error(i(188))}if(s.return!==u.return)s=y,u=x;else{for(var M=!1,k=y.child;k;){if(k===s){M=!0,s=y,u=x;break}if(k===u){M=!0,u=y,s=x;break}k=k.sibling}if(!M){for(k=x.child;k;){if(k===s){M=!0,s=x,u=y;break}if(k===u){M=!0,u=x,s=y;break}k=k.sibling}if(!M)throw Error(i(189))}}if(s.alternate!==u)throw Error(i(190))}if(s.tag!==3)throw Error(i(188));return s.stateNode.current===s?t:r}function p(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t;for(t=t.child;t!==null;){if(r=p(t),r!==null)return r;t=t.sibling}return null}var v=Object.assign,m=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),E=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),D=Symbol.for("react.activity"),I=Symbol.for("react.memo_cache_sentinel"),P=Symbol.iterator;function V(t){return t===null||typeof t!="object"?null:(t=P&&t[P]||t["@@iterator"],typeof t=="function"?t:null)}var $=Symbol.for("react.client.reference");function L(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===$?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case S:return"Fragment";case C:return"Profiler";case w:return"StrictMode";case R:return"Suspense";case z:return"SuspenseList";case D:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case _:return"Portal";case E:return t.displayName||"Context";case T:return(t._context.displayName||"Context")+".Consumer";case N:var r=t.render;return t=t.displayName,t||(t=r.displayName||r.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case j:return r=t.displayName||null,r!==null?r:L(t.type)||"Memo";case A:r=t._payload,t=t._init;try{return L(t(r))}catch{}}return null}var H=Array.isArray,O=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J={pending:!1,data:null,method:null,action:null},G=[],re=-1;function B(t){return{current:t}}function Y(t){0>re||(t.current=G[re],G[re]=null,re--)}function ae(t,r){re++,G[re]=t.current,t.current=r}var U=B(null),Z=B(null),ne=B(null),le=B(null);function K(t,r){switch(ae(ne,r),ae(Z,t),ae(U,null),r.nodeType){case 9:case 11:t=(t=r.documentElement)&&(t=t.namespaceURI)?r1(t):0;break;default:if(t=r.tagName,r=r.namespaceURI)r=r1(r),t=a1(r,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}Y(U),ae(U,t)}function de(){Y(U),Y(Z),Y(ne)}function ye(t){t.memoizedState!==null&&ae(le,t);var r=U.current,s=a1(r,t.type);r!==s&&(ae(Z,t),ae(U,s))}function xe(t){Z.current===t&&(Y(U),Y(Z)),le.current===t&&(Y(le),ss._currentValue=J)}var be,W;function se(t){if(be===void 0)try{throw Error()}catch(s){var r=s.stack.trim().match(/\n( *(at )?)/);be=r&&r[1]||"",W=-1<s.stack.indexOf(`
    at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
`+be+t+W}var te=!1;function me(t,r){if(!t||te)return"";te=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(r){var ge=function(){throw Error()};if(Object.defineProperty(ge.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ge,[])}catch(ue){var ce=ue}Reflect.construct(t,[],ge)}else{try{ge.call()}catch(ue){ce=ue}t.call(ge.prototype)}}else{try{throw Error()}catch(ue){ce=ue}(ge=t())&&typeof ge.catch=="function"&&ge.catch(function(){})}}catch(ue){if(ue&&ce&&typeof ue.stack=="string")return[ue.stack,ce.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=u.DetermineComponentFrameRoot(),M=x[0],k=x[1];if(M&&k){var X=M.split(`
`),oe=k.split(`
`);for(y=u=0;u<X.length&&!X[u].includes("DetermineComponentFrameRoot");)u++;for(;y<oe.length&&!oe[y].includes("DetermineComponentFrameRoot");)y++;if(u===X.length||y===oe.length)for(u=X.length-1,y=oe.length-1;1<=u&&0<=y&&X[u]!==oe[y];)y--;for(;1<=u&&0<=y;u--,y--)if(X[u]!==oe[y]){if(u!==1||y!==1)do if(u--,y--,0>y||X[u]!==oe[y]){var he=`
`+X[u].replace(" at new "," at ");return t.displayName&&he.includes("<anonymous>")&&(he=he.replace("<anonymous>",t.displayName)),he}while(1<=u&&0<=y);break}}}finally{te=!1,Error.prepareStackTrace=s}return(s=t?t.displayName||t.name:"")?se(s):""}function ve(t,r){switch(t.tag){case 26:case 27:case 5:return se(t.type);case 16:return se("Lazy");case 13:return t.child!==r&&r!==null?se("Suspense Fallback"):se("Suspense");case 19:return se("SuspenseList");case 0:case 15:return me(t.type,!1);case 11:return me(t.type.render,!1);case 1:return me(t.type,!0);case 31:return se("Activity");default:return""}}function Se(t){try{var r="",s=null;do r+=ve(t,s),s=t,t=t.return;while(t);return r}catch(u){return`
Error generating stack: `+u.message+`
`+u.stack}}var Ee=Object.prototype.hasOwnProperty,Ve=e.unstable_scheduleCallback,qe=e.unstable_cancelCallback,lt=e.unstable_shouldYield,tt=e.unstable_requestPaint,nt=e.unstable_now,Ft=e.unstable_getCurrentPriorityLevel,$t=e.unstable_ImmediatePriority,At=e.unstable_UserBlockingPriority,Lt=e.unstable_NormalPriority,Ja=e.unstable_LowPriority,rr=e.unstable_IdlePriority,mo=e.log,ei=e.unstable_setDisableYieldValue,Ht=null,ht=null;function Un(t){if(typeof mo=="function"&&ei(t),ht&&typeof ht.setStrictMode=="function")try{ht.setStrictMode(Ht,t)}catch{}}var Pt=Math.clz32?Math.clz32:qu,ku=Math.log,Ou=Math.LN2;function qu(t){return t>>>=0,t===0?32:31-(ku(t)/Ou|0)|0}var ti=256,ni=262144,ri=4194304;function ar(t){var r=t&42;if(r!==0)return r;switch(t&-t){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 t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function ai(t,r,s){var u=t.pendingLanes;if(u===0)return 0;var y=0,x=t.suspendedLanes,M=t.pingedLanes;t=t.warmLanes;var k=u&134217727;return k!==0?(u=k&~x,u!==0?y=ar(u):(M&=k,M!==0?y=ar(M):s||(s=k&~t,s!==0&&(y=ar(s))))):(k=u&~x,k!==0?y=ar(k):M!==0?y=ar(M):s||(s=u&~t,s!==0&&(y=ar(s)))),y===0?0:r!==0&&r!==y&&(r&x)===0&&(x=y&-y,s=r&-r,x>=s||x===32&&(s&4194048)!==0)?r:y}function zr(t,r){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&r)===0}function Bu(t,r){switch(t){case 1:case 2:case 4:case 8:case 64:return r+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 r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Zs(){var t=ri;return ri<<=1,(ri&62914560)===0&&(ri=4194304),t}function yo(t){for(var r=[],s=0;31>s;s++)r.push(t);return r}function ya(t,r){t.pendingLanes|=r,r!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Lu(t,r,s,u,y,x){var M=t.pendingLanes;t.pendingLanes=s,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=s,t.entangledLanes&=s,t.errorRecoveryDisabledLanes&=s,t.shellSuspendCounter=0;var k=t.entanglements,X=t.expirationTimes,oe=t.hiddenUpdates;for(s=M&~s;0<s;){var he=31-Pt(s),ge=1<<he;k[he]=0,X[he]=-1;var ce=oe[he];if(ce!==null)for(oe[he]=null,he=0;he<ce.length;he++){var ue=ce[he];ue!==null&&(ue.lane&=-536870913)}s&=~ge}u!==0&&Qs(t,u,0),x!==0&&y===0&&t.tag!==0&&(t.suspendedLanes|=x&~(M&~r))}function Qs(t,r,s){t.pendingLanes|=r,t.suspendedLanes&=~r;var u=31-Pt(r);t.entangledLanes|=r,t.entanglements[u]=t.entanglements[u]|1073741824|s&261930}function Js(t,r){var s=t.entangledLanes|=r;for(t=t.entanglements;s;){var u=31-Pt(s),y=1<<u;y&r|t[u]&r&&(t[u]|=r),s&=~y}}function el(t,r){var s=r&-r;return s=(s&42)!==0?1:bo(s),(s&(t.suspendedLanes|r))!==0?0:s}function bo(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function xo(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function tl(){var t=F.p;return t!==0?t:(t=window.event,t===void 0?32:j1(t.type))}function nl(t,r){var s=F.p;try{return F.p=t,r()}finally{F.p=s}}var Vn=Math.random().toString(36).slice(2),Nt="__reactFiber$"+Vn,It="__reactProps$"+Vn,ir="__reactContainer$"+Vn,ii="__reactEvents$"+Vn,rl="__reactListeners$"+Vn,Hu="__reactHandles$"+Vn,al="__reactResources$"+Vn,ba="__reactMarker$"+Vn;function _o(t){delete t[Nt],delete t[It],delete t[ii],delete t[rl],delete t[Hu]}function Dr(t){var r=t[Nt];if(r)return r;for(var s=t.parentNode;s;){if(r=s[ir]||s[Nt]){if(s=r.alternate,r.child!==null||s!==null&&s.child!==null)for(t=d1(t);t!==null;){if(s=t[Nt])return s;t=d1(t)}return r}t=s,s=t.parentNode}return null}function kr(t){if(t=t[Nt]||t[ir]){var r=t.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return t}return null}function Or(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t.stateNode;throw Error(i(33))}function qr(t){var r=t[al];return r||(r=t[al]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function xt(t){t[ba]=!0}var il=new Set,ol={};function or(t,r){Br(t,r),Br(t+"Capture",r)}function Br(t,r){for(ol[t]=r,t=0;t<r.length;t++)il.add(r[t])}var Iu=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),So={},sl={};function Uu(t){return Ee.call(sl,t)?!0:Ee.call(So,t)?!1:Iu.test(t)?sl[t]=!0:(So[t]=!0,!1)}function oi(t,r,s){if(Uu(r))if(s===null)t.removeAttribute(r);else{switch(typeof s){case"undefined":case"function":case"symbol":t.removeAttribute(r);return;case"boolean":var u=r.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){t.removeAttribute(r);return}}t.setAttribute(r,""+s)}}function si(t,r,s){if(s===null)t.removeAttribute(r);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(r);return}t.setAttribute(r,""+s)}}function Rn(t,r,s,u){if(u===null)t.removeAttribute(s);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(s);return}t.setAttributeNS(r,s,""+u)}}function Yt(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function ll(t){var r=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function Vu(t,r,s){var u=Object.getOwnPropertyDescriptor(t.constructor.prototype,r);if(!t.hasOwnProperty(r)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var y=u.get,x=u.set;return Object.defineProperty(t,r,{configurable:!0,get:function(){return y.call(this)},set:function(M){s=""+M,x.call(this,M)}}),Object.defineProperty(t,r,{enumerable:u.enumerable}),{getValue:function(){return s},setValue:function(M){s=""+M},stopTracking:function(){t._valueTracker=null,delete t[r]}}}}function li(t){if(!t._valueTracker){var r=ll(t)?"checked":"value";t._valueTracker=Vu(t,r,""+t[r])}}function cl(t){if(!t)return!1;var r=t._valueTracker;if(!r)return!0;var s=r.getValue(),u="";return t&&(u=ll(t)?t.checked?"true":"false":t.value),t=u,t!==s?(r.setValue(t),!0):!1}function ci(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var Fu=/[\n"\\]/g;function Ut(t){return t.replace(Fu,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function wo(t,r,s,u,y,x,M,k){t.name="",M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?t.type=M:t.removeAttribute("type"),r!=null?M==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+Yt(r)):t.value!==""+Yt(r)&&(t.value=""+Yt(r)):M!=="submit"&&M!=="reset"||t.removeAttribute("value"),r!=null?ui(t,M,Yt(r)):s!=null?ui(t,M,Yt(s)):u!=null&&t.removeAttribute("value"),y==null&&x!=null&&(t.defaultChecked=!!x),y!=null&&(t.checked=y&&typeof y!="function"&&typeof y!="symbol"),k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?t.name=""+Yt(k):t.removeAttribute("name")}function ul(t,r,s,u,y,x,M,k){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(t.type=x),r!=null||s!=null){if(!(x!=="submit"&&x!=="reset"||r!=null)){li(t);return}s=s!=null?""+Yt(s):"",r=r!=null?""+Yt(r):s,k||r===t.value||(t.value=r),t.defaultValue=r}u=u??y,u=typeof u!="function"&&typeof u!="symbol"&&!!u,t.checked=k?t.checked:!!u,t.defaultChecked=!!u,M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"&&(t.name=M),li(t)}function ui(t,r,s){r==="number"&&ci(t.ownerDocument)===t||t.defaultValue===""+s||(t.defaultValue=""+s)}function di(t,r,s,u){if(t=t.options,r){r={};for(var y=0;y<s.length;y++)r["$"+s[y]]=!0;for(s=0;s<t.length;s++)y=r.hasOwnProperty("$"+t[s].value),t[s].selected!==y&&(t[s].selected=y),y&&u&&(t[s].defaultSelected=!0)}else{for(s=""+Yt(s),r=null,y=0;y<t.length;y++){if(t[y].value===s){t[y].selected=!0,u&&(t[y].defaultSelected=!0);return}r!==null||t[y].disabled||(r=t[y])}r!==null&&(r.selected=!0)}}function Qb(t,r,s){if(r!=null&&(r=""+Yt(r),r!==t.value&&(t.value=r),s==null)){t.defaultValue!==r&&(t.defaultValue=r);return}t.defaultValue=s!=null?""+Yt(s):""}function Jb(t,r,s,u){if(r==null){if(u!=null){if(s!=null)throw Error(i(92));if(H(u)){if(1<u.length)throw Error(i(93));u=u[0]}s=u}s==null&&(s=""),r=s}s=Yt(r),t.defaultValue=s,u=t.textContent,u===s&&u!==""&&u!==null&&(t.value=u),li(t)}function fi(t,r){if(r){var s=t.firstChild;if(s&&s===t.lastChild&&s.nodeType===3){s.nodeValue=r;return}}t.textContent=r}var uz=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function e0(t,r,s){var u=r.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?u?t.setProperty(r,""):r==="float"?t.cssFloat="":t[r]="":u?t.setProperty(r,s):typeof s!="number"||s===0||uz.has(r)?r==="float"?t.cssFloat=s:t[r]=(""+s).trim():t[r]=s+"px"}function t0(t,r,s){if(r!=null&&typeof r!="object")throw Error(i(62));if(t=t.style,s!=null){for(var u in s)!s.hasOwnProperty(u)||r!=null&&r.hasOwnProperty(u)||(u.indexOf("--")===0?t.setProperty(u,""):u==="float"?t.cssFloat="":t[u]="");for(var y in r)u=r[y],r.hasOwnProperty(y)&&s[y]!==u&&e0(t,y,u)}else for(var x in r)r.hasOwnProperty(x)&&e0(t,x,r[x])}function Pu(t){if(t.indexOf("-")===-1)return!1;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var dz=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),fz=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function dl(t){return fz.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function sr(){}var Gu=null;function $u(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var hi=null,pi=null;function n0(t){var r=kr(t);if(r&&(t=r.stateNode)){var s=t[It]||null;e:switch(t=r.stateNode,r.type){case"input":if(wo(t,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),r=s.name,s.type==="radio"&&r!=null){for(s=t;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+Ut(""+r)+'"][type="radio"]'),r=0;r<s.length;r++){var u=s[r];if(u!==t&&u.form===t.form){var y=u[It]||null;if(!y)throw Error(i(90));wo(u,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(r=0;r<s.length;r++)u=s[r],u.form===t.form&&cl(u)}break e;case"textarea":Qb(t,s.value,s.defaultValue);break e;case"select":r=s.value,r!=null&&di(t,!!s.multiple,r,!1)}}}var Yu=!1;function r0(t,r,s){if(Yu)return t(r,s);Yu=!0;try{var u=t(r);return u}finally{if(Yu=!1,(hi!==null||pi!==null)&&(Ql(),hi&&(r=hi,t=pi,pi=hi=null,n0(r),t)))for(r=0;r<t.length;r++)n0(t[r])}}function Eo(t,r){var s=t.stateNode;if(s===null)return null;var u=s[It]||null;if(u===null)return null;s=u[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(t=t.type,u=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!u;break e;default:t=!1}if(t)return null;if(s&&typeof s!="function")throw Error(i(231,r,typeof s));return s}var lr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Wu=!1;if(lr)try{var Co={};Object.defineProperty(Co,"passive",{get:function(){Wu=!0}}),window.addEventListener("test",Co,Co),window.removeEventListener("test",Co,Co)}catch{Wu=!1}var Lr=null,Xu=null,fl=null;function a0(){if(fl)return fl;var t,r=Xu,s=r.length,u,y="value"in Lr?Lr.value:Lr.textContent,x=y.length;for(t=0;t<s&&r[t]===y[t];t++);var M=s-t;for(u=1;u<=M&&r[s-u]===y[x-u];u++);return fl=y.slice(t,1<u?1-u:void 0)}function hl(t){var r=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&r===13&&(t=13)):t=r,t===10&&(t=13),32<=t||t===13?t:0}function pl(){return!0}function i0(){return!1}function Wt(t){function r(s,u,y,x,M){this._reactName=s,this._targetInst=y,this.type=u,this.nativeEvent=x,this.target=M,this.currentTarget=null;for(var k in t)t.hasOwnProperty(k)&&(s=t[k],this[k]=s?s(x):x[k]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?pl:i0,this.isPropagationStopped=i0,this}return v(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=pl)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=pl)},persist:function(){},isPersistent:pl}),r}var xa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},gl=Wt(xa),To=v({},xa,{view:0,detail:0}),hz=Wt(To),Ku,Zu,jo,vl=v({},To,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ju,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==jo&&(jo&&t.type==="mousemove"?(Ku=t.screenX-jo.screenX,Zu=t.screenY-jo.screenY):Zu=Ku=0,jo=t),Ku)},movementY:function(t){return"movementY"in t?t.movementY:Zu}}),o0=Wt(vl),pz=v({},vl,{dataTransfer:0}),gz=Wt(pz),vz=v({},To,{relatedTarget:0}),Qu=Wt(vz),mz=v({},xa,{animationName:0,elapsedTime:0,pseudoElement:0}),yz=Wt(mz),bz=v({},xa,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),xz=Wt(bz),_z=v({},xa,{data:0}),s0=Wt(_z),Sz={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},wz={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Ez={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Cz(t){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(t):(t=Ez[t])?!!r[t]:!1}function Ju(){return Cz}var Tz=v({},To,{key:function(t){if(t.key){var r=Sz[t.key]||t.key;if(r!=="Unidentified")return r}return t.type==="keypress"?(t=hl(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?wz[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ju,charCode:function(t){return t.type==="keypress"?hl(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?hl(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),jz=Wt(Tz),Nz=v({},vl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),l0=Wt(Nz),Rz=v({},To,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ju}),Mz=Wt(Rz),Az=v({},xa,{propertyName:0,elapsedTime:0,pseudoElement:0}),zz=Wt(Az),Dz=v({},vl,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),kz=Wt(Dz),Oz=v({},xa,{newState:0,oldState:0}),qz=Wt(Oz),Bz=[9,13,27,32],ed=lr&&"CompositionEvent"in window,No=null;lr&&"documentMode"in document&&(No=document.documentMode);var Lz=lr&&"TextEvent"in window&&!No,c0=lr&&(!ed||No&&8<No&&11>=No),u0=" ",d0=!1;function f0(t,r){switch(t){case"keyup":return Bz.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function h0(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var gi=!1;function Hz(t,r){switch(t){case"compositionend":return h0(r);case"keypress":return r.which!==32?null:(d0=!0,u0);case"textInput":return t=r.data,t===u0&&d0?null:t;default:return null}}function Iz(t,r){if(gi)return t==="compositionend"||!ed&&f0(t,r)?(t=a0(),fl=Xu=Lr=null,gi=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return c0&&r.locale!=="ko"?null:r.data;default:return null}}var Uz={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function p0(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r==="input"?!!Uz[t.type]:r==="textarea"}function g0(t,r,s,u){hi?pi?pi.push(u):pi=[u]:hi=u,r=ic(r,"onChange"),0<r.length&&(s=new gl("onChange","change",null,s,u),t.push({event:s,listeners:r}))}var Ro=null,Mo=null;function Vz(t){Z_(t,0)}function ml(t){var r=Or(t);if(cl(r))return t}function v0(t,r){if(t==="change")return r}var m0=!1;if(lr){var td;if(lr){var nd="oninput"in document;if(!nd){var y0=document.createElement("div");y0.setAttribute("oninput","return;"),nd=typeof y0.oninput=="function"}td=nd}else td=!1;m0=td&&(!document.documentMode||9<document.documentMode)}function b0(){Ro&&(Ro.detachEvent("onpropertychange",x0),Mo=Ro=null)}function x0(t){if(t.propertyName==="value"&&ml(Mo)){var r=[];g0(r,Mo,t,$u(t)),r0(Vz,r)}}function Fz(t,r,s){t==="focusin"?(b0(),Ro=r,Mo=s,Ro.attachEvent("onpropertychange",x0)):t==="focusout"&&b0()}function Pz(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return ml(Mo)}function Gz(t,r){if(t==="click")return ml(r)}function $z(t,r){if(t==="input"||t==="change")return ml(r)}function Yz(t,r){return t===r&&(t!==0||1/t===1/r)||t!==t&&r!==r}var rn=typeof Object.is=="function"?Object.is:Yz;function Ao(t,r){if(rn(t,r))return!0;if(typeof t!="object"||t===null||typeof r!="object"||r===null)return!1;var s=Object.keys(t),u=Object.keys(r);if(s.length!==u.length)return!1;for(u=0;u<s.length;u++){var y=s[u];if(!Ee.call(r,y)||!rn(t[y],r[y]))return!1}return!0}function _0(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function S0(t,r){var s=_0(t);t=0;for(var u;s;){if(s.nodeType===3){if(u=t+s.textContent.length,t<=r&&u>=r)return{node:s,offset:r-t};t=u}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=_0(s)}}function w0(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?w0(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function E0(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var r=ci(t.document);r instanceof t.HTMLIFrameElement;){try{var s=typeof r.contentWindow.location.href=="string"}catch{s=!1}if(s)t=r.contentWindow;else break;r=ci(t.document)}return r}function rd(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r&&(r==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||r==="textarea"||t.contentEditable==="true")}var Wz=lr&&"documentMode"in document&&11>=document.documentMode,vi=null,ad=null,zo=null,id=!1;function C0(t,r,s){var u=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;id||vi==null||vi!==ci(u)||(u=vi,"selectionStart"in u&&rd(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),zo&&Ao(zo,u)||(zo=u,u=ic(ad,"onSelect"),0<u.length&&(r=new gl("onSelect","select",null,r,s),t.push({event:r,listeners:u}),r.target=vi)))}function _a(t,r){var s={};return s[t.toLowerCase()]=r.toLowerCase(),s["Webkit"+t]="webkit"+r,s["Moz"+t]="moz"+r,s}var mi={animationend:_a("Animation","AnimationEnd"),animationiteration:_a("Animation","AnimationIteration"),animationstart:_a("Animation","AnimationStart"),transitionrun:_a("Transition","TransitionRun"),transitionstart:_a("Transition","TransitionStart"),transitioncancel:_a("Transition","TransitionCancel"),transitionend:_a("Transition","TransitionEnd")},od={},T0={};lr&&(T0=document.createElement("div").style,"AnimationEvent"in window||(delete mi.animationend.animation,delete mi.animationiteration.animation,delete mi.animationstart.animation),"TransitionEvent"in window||delete mi.transitionend.transition);function Sa(t){if(od[t])return od[t];if(!mi[t])return t;var r=mi[t],s;for(s in r)if(r.hasOwnProperty(s)&&s in T0)return od[t]=r[s];return t}var j0=Sa("animationend"),N0=Sa("animationiteration"),R0=Sa("animationstart"),Xz=Sa("transitionrun"),Kz=Sa("transitionstart"),Zz=Sa("transitioncancel"),M0=Sa("transitionend"),A0=new Map,sd="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");sd.push("scrollEnd");function Mn(t,r){A0.set(t,r),or(r,[t])}var yl=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},gn=[],yi=0,ld=0;function bl(){for(var t=yi,r=ld=yi=0;r<t;){var s=gn[r];gn[r++]=null;var u=gn[r];gn[r++]=null;var y=gn[r];gn[r++]=null;var x=gn[r];if(gn[r++]=null,u!==null&&y!==null){var M=u.pending;M===null?y.next=y:(y.next=M.next,M.next=y),u.pending=y}x!==0&&z0(s,y,x)}}function xl(t,r,s,u){gn[yi++]=t,gn[yi++]=r,gn[yi++]=s,gn[yi++]=u,ld|=u,t.lanes|=u,t=t.alternate,t!==null&&(t.lanes|=u)}function cd(t,r,s,u){return xl(t,r,s,u),_l(t)}function wa(t,r){return xl(t,null,null,r),_l(t)}function z0(t,r,s){t.lanes|=s;var u=t.alternate;u!==null&&(u.lanes|=s);for(var y=!1,x=t.return;x!==null;)x.childLanes|=s,u=x.alternate,u!==null&&(u.childLanes|=s),x.tag===22&&(t=x.stateNode,t===null||t._visibility&1||(y=!0)),t=x,x=x.return;return t.tag===3?(x=t.stateNode,y&&r!==null&&(y=31-Pt(s),t=x.hiddenUpdates,u=t[y],u===null?t[y]=[r]:u.push(r),r.lane=s|536870912),x):null}function _l(t){if(50<es)throw es=0,bf=null,Error(i(185));for(var r=t.return;r!==null;)t=r,r=t.return;return t.tag===3?t.stateNode:null}var bi={};function Qz(t,r,s,u){this.tag=t,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function an(t,r,s,u){return new Qz(t,r,s,u)}function ud(t){return t=t.prototype,!(!t||!t.isReactComponent)}function cr(t,r){var s=t.alternate;return s===null?(s=an(t.tag,r,t.key,t.mode),s.elementType=t.elementType,s.type=t.type,s.stateNode=t.stateNode,s.alternate=t,t.alternate=s):(s.pendingProps=r,s.type=t.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=t.flags&65011712,s.childLanes=t.childLanes,s.lanes=t.lanes,s.child=t.child,s.memoizedProps=t.memoizedProps,s.memoizedState=t.memoizedState,s.updateQueue=t.updateQueue,r=t.dependencies,s.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},s.sibling=t.sibling,s.index=t.index,s.ref=t.ref,s.refCleanup=t.refCleanup,s}function D0(t,r){t.flags&=65011714;var s=t.alternate;return s===null?(t.childLanes=0,t.lanes=r,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=s.childLanes,t.lanes=s.lanes,t.child=s.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=s.memoizedProps,t.memoizedState=s.memoizedState,t.updateQueue=s.updateQueue,t.type=s.type,r=s.dependencies,t.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),t}function Sl(t,r,s,u,y,x){var M=0;if(u=t,typeof t=="function")ud(t)&&(M=1);else if(typeof t=="string")M=r3(t,s,U.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case D:return t=an(31,s,r,y),t.elementType=D,t.lanes=x,t;case S:return Ea(s.children,y,x,r);case w:M=8,y|=24;break;case C:return t=an(12,s,r,y|2),t.elementType=C,t.lanes=x,t;case R:return t=an(13,s,r,y),t.elementType=R,t.lanes=x,t;case z:return t=an(19,s,r,y),t.elementType=z,t.lanes=x,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case E:M=10;break e;case T:M=9;break e;case N:M=11;break e;case j:M=14;break e;case A:M=16,u=null;break e}M=29,s=Error(i(130,t===null?"null":typeof t,"")),u=null}return r=an(M,s,r,y),r.elementType=t,r.type=u,r.lanes=x,r}function Ea(t,r,s,u){return t=an(7,t,u,r),t.lanes=s,t}function dd(t,r,s){return t=an(6,t,null,r),t.lanes=s,t}function k0(t){var r=an(18,null,null,0);return r.stateNode=t,r}function fd(t,r,s){return r=an(4,t.children!==null?t.children:[],t.key,r),r.lanes=s,r.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},r}var O0=new WeakMap;function vn(t,r){if(typeof t=="object"&&t!==null){var s=O0.get(t);return s!==void 0?s:(r={value:t,source:r,stack:Se(r)},O0.set(t,r),r)}return{value:t,source:r,stack:Se(r)}}var xi=[],_i=0,wl=null,Do=0,mn=[],yn=0,Hr=null,Fn=1,Pn="";function ur(t,r){xi[_i++]=Do,xi[_i++]=wl,wl=t,Do=r}function q0(t,r,s){mn[yn++]=Fn,mn[yn++]=Pn,mn[yn++]=Hr,Hr=t;var u=Fn;t=Pn;var y=32-Pt(u)-1;u&=~(1<<y),s+=1;var x=32-Pt(r)+y;if(30<x){var M=y-y%5;x=(u&(1<<M)-1).toString(32),u>>=M,y-=M,Fn=1<<32-Pt(r)+y|s<<y|u,Pn=x+t}else Fn=1<<x|s<<y|u,Pn=t}function hd(t){t.return!==null&&(ur(t,1),q0(t,1,0))}function pd(t){for(;t===wl;)wl=xi[--_i],xi[_i]=null,Do=xi[--_i],xi[_i]=null;for(;t===Hr;)Hr=mn[--yn],mn[yn]=null,Pn=mn[--yn],mn[yn]=null,Fn=mn[--yn],mn[yn]=null}function B0(t,r){mn[yn++]=Fn,mn[yn++]=Pn,mn[yn++]=Hr,Fn=r.id,Pn=r.overflow,Hr=t}var Dt=null,ot=null,He=!1,Ir=null,bn=!1,gd=Error(i(519));function Ur(t){var r=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ko(vn(r,t)),gd}function L0(t){var r=t.stateNode,s=t.type,u=t.memoizedProps;switch(r[Nt]=t,r[It]=u,s){case"dialog":Oe("cancel",r),Oe("close",r);break;case"iframe":case"object":case"embed":Oe("load",r);break;case"video":case"audio":for(s=0;s<ns.length;s++)Oe(ns[s],r);break;case"source":Oe("error",r);break;case"img":case"image":case"link":Oe("error",r),Oe("load",r);break;case"details":Oe("toggle",r);break;case"input":Oe("invalid",r),ul(r,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":Oe("invalid",r);break;case"textarea":Oe("invalid",r),Jb(r,u.value,u.defaultValue,u.children)}s=u.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||r.textContent===""+s||u.suppressHydrationWarning===!0||t1(r.textContent,s)?(u.popover!=null&&(Oe("beforetoggle",r),Oe("toggle",r)),u.onScroll!=null&&Oe("scroll",r),u.onScrollEnd!=null&&Oe("scrollend",r),u.onClick!=null&&(r.onclick=sr),r=!0):r=!1,r||Ur(t,!0)}function H0(t){for(Dt=t.return;Dt;)switch(Dt.tag){case 5:case 31:case 13:bn=!1;return;case 27:case 3:bn=!0;return;default:Dt=Dt.return}}function Si(t){if(t!==Dt)return!1;if(!He)return H0(t),He=!0,!1;var r=t.tag,s;if((s=r!==3&&r!==27)&&((s=r===5)&&(s=t.type,s=!(s!=="form"&&s!=="button")||kf(t.type,t.memoizedProps)),s=!s),s&&ot&&Ur(t),H0(t),r===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(i(317));ot=u1(t)}else if(r===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(i(317));ot=u1(t)}else r===27?(r=ot,ta(t.type)?(t=Hf,Hf=null,ot=t):ot=r):ot=Dt?_n(t.stateNode.nextSibling):null;return!0}function Ca(){ot=Dt=null,He=!1}function vd(){var t=Ir;return t!==null&&(Qt===null?Qt=t:Qt.push.apply(Qt,t),Ir=null),t}function ko(t){Ir===null?Ir=[t]:Ir.push(t)}var md=B(null),Ta=null,dr=null;function Vr(t,r,s){ae(md,r._currentValue),r._currentValue=s}function fr(t){t._currentValue=md.current,Y(md)}function yd(t,r,s){for(;t!==null;){var u=t.alternate;if((t.childLanes&r)!==r?(t.childLanes|=r,u!==null&&(u.childLanes|=r)):u!==null&&(u.childLanes&r)!==r&&(u.childLanes|=r),t===s)break;t=t.return}}function bd(t,r,s,u){var y=t.child;for(y!==null&&(y.return=t);y!==null;){var x=y.dependencies;if(x!==null){var M=y.child;x=x.firstContext;e:for(;x!==null;){var k=x;x=y;for(var X=0;X<r.length;X++)if(k.context===r[X]){x.lanes|=s,k=x.alternate,k!==null&&(k.lanes|=s),yd(x.return,s,t),u||(M=null);break e}x=k.next}}else if(y.tag===18){if(M=y.return,M===null)throw Error(i(341));M.lanes|=s,x=M.alternate,x!==null&&(x.lanes|=s),yd(M,s,t),M=null}else M=y.child;if(M!==null)M.return=y;else for(M=y;M!==null;){if(M===t){M=null;break}if(y=M.sibling,y!==null){y.return=M.return,M=y;break}M=M.return}y=M}}function wi(t,r,s,u){t=null;for(var y=r,x=!1;y!==null;){if(!x){if((y.flags&524288)!==0)x=!0;else if((y.flags&262144)!==0)break}if(y.tag===10){var M=y.alternate;if(M===null)throw Error(i(387));if(M=M.memoizedProps,M!==null){var k=y.type;rn(y.pendingProps.value,M.value)||(t!==null?t.push(k):t=[k])}}else if(y===le.current){if(M=y.alternate,M===null)throw Error(i(387));M.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(t!==null?t.push(ss):t=[ss])}y=y.return}t!==null&&bd(r,t,s,u),r.flags|=262144}function El(t){for(t=t.firstContext;t!==null;){if(!rn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function ja(t){Ta=t,dr=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function kt(t){return I0(Ta,t)}function Cl(t,r){return Ta===null&&ja(t),I0(t,r)}function I0(t,r){var s=r._currentValue;if(r={context:r,memoizedValue:s,next:null},dr===null){if(t===null)throw Error(i(308));dr=r,t.dependencies={lanes:0,firstContext:r},t.flags|=524288}else dr=dr.next=r;return s}var Jz=typeof AbortController<"u"?AbortController:function(){var t=[],r=this.signal={aborted:!1,addEventListener:function(s,u){t.push(u)}};this.abort=function(){r.aborted=!0,t.forEach(function(s){return s()})}},eD=e.unstable_scheduleCallback,tD=e.unstable_NormalPriority,_t={$$typeof:E,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function xd(){return{controller:new Jz,data:new Map,refCount:0}}function Oo(t){t.refCount--,t.refCount===0&&eD(tD,function(){t.controller.abort()})}var qo=null,_d=0,Ei=0,Ci=null;function nD(t,r){if(qo===null){var s=qo=[];_d=0,Ei=Cf(),Ci={status:"pending",value:void 0,then:function(u){s.push(u)}}}return _d++,r.then(U0,U0),r}function U0(){if(--_d===0&&qo!==null){Ci!==null&&(Ci.status="fulfilled");var t=qo;qo=null,Ei=0,Ci=null;for(var r=0;r<t.length;r++)(0,t[r])()}}function rD(t,r){var s=[],u={status:"pending",value:null,reason:null,then:function(y){s.push(y)}};return t.then(function(){u.status="fulfilled",u.value=r;for(var y=0;y<s.length;y++)(0,s[y])(r)},function(y){for(u.status="rejected",u.reason=y,y=0;y<s.length;y++)(0,s[y])(void 0)}),u}var V0=O.S;O.S=function(t,r){C_=nt(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&nD(t,r),V0!==null&&V0(t,r)};var Na=B(null);function Sd(){var t=Na.current;return t!==null?t:et.pooledCache}function Tl(t,r){r===null?ae(Na,Na.current):ae(Na,r.pool)}function F0(){var t=Sd();return t===null?null:{parent:_t._currentValue,pool:t}}var Ti=Error(i(460)),wd=Error(i(474)),jl=Error(i(542)),Nl={then:function(){}};function P0(t){return t=t.status,t==="fulfilled"||t==="rejected"}function G0(t,r,s){switch(s=t[s],s===void 0?t.push(r):s!==r&&(r.then(sr,sr),r=s),r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,Y0(t),t;default:if(typeof r.status=="string")r.then(sr,sr);else{if(t=et,t!==null&&100<t.shellSuspendCounter)throw Error(i(482));t=r,t.status="pending",t.then(function(u){if(r.status==="pending"){var y=r;y.status="fulfilled",y.value=u}},function(u){if(r.status==="pending"){var y=r;y.status="rejected",y.reason=u}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,Y0(t),t}throw Ma=r,Ti}}function Ra(t){try{var r=t._init;return r(t._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Ma=s,Ti):s}}var Ma=null;function $0(){if(Ma===null)throw Error(i(459));var t=Ma;return Ma=null,t}function Y0(t){if(t===Ti||t===jl)throw Error(i(483))}var ji=null,Bo=0;function Rl(t){var r=Bo;return Bo+=1,ji===null&&(ji=[]),G0(ji,t,r)}function Lo(t,r){r=r.props.ref,t.ref=r!==void 0?r:null}function Ml(t,r){throw r.$$typeof===m?Error(i(525)):(t=Object.prototype.toString.call(r),Error(i(31,t==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":t)))}function W0(t){function r(ee,Q){if(t){var ie=ee.deletions;ie===null?(ee.deletions=[Q],ee.flags|=16):ie.push(Q)}}function s(ee,Q){if(!t)return null;for(;Q!==null;)r(ee,Q),Q=Q.sibling;return null}function u(ee){for(var Q=new Map;ee!==null;)ee.key!==null?Q.set(ee.key,ee):Q.set(ee.index,ee),ee=ee.sibling;return Q}function y(ee,Q){return ee=cr(ee,Q),ee.index=0,ee.sibling=null,ee}function x(ee,Q,ie){return ee.index=ie,t?(ie=ee.alternate,ie!==null?(ie=ie.index,ie<Q?(ee.flags|=67108866,Q):ie):(ee.flags|=67108866,Q)):(ee.flags|=1048576,Q)}function M(ee){return t&&ee.alternate===null&&(ee.flags|=67108866),ee}function k(ee,Q,ie,pe){return Q===null||Q.tag!==6?(Q=dd(ie,ee.mode,pe),Q.return=ee,Q):(Q=y(Q,ie),Q.return=ee,Q)}function X(ee,Q,ie,pe){var Ne=ie.type;return Ne===S?he(ee,Q,ie.props.children,pe,ie.key):Q!==null&&(Q.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===A&&Ra(Ne)===Q.type)?(Q=y(Q,ie.props),Lo(Q,ie),Q.return=ee,Q):(Q=Sl(ie.type,ie.key,ie.props,null,ee.mode,pe),Lo(Q,ie),Q.return=ee,Q)}function oe(ee,Q,ie,pe){return Q===null||Q.tag!==4||Q.stateNode.containerInfo!==ie.containerInfo||Q.stateNode.implementation!==ie.implementation?(Q=fd(ie,ee.mode,pe),Q.return=ee,Q):(Q=y(Q,ie.children||[]),Q.return=ee,Q)}function he(ee,Q,ie,pe,Ne){return Q===null||Q.tag!==7?(Q=Ea(ie,ee.mode,pe,Ne),Q.return=ee,Q):(Q=y(Q,ie),Q.return=ee,Q)}function ge(ee,Q,ie){if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Q=dd(""+Q,ee.mode,ie),Q.return=ee,Q;if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case b:return ie=Sl(Q.type,Q.key,Q.props,null,ee.mode,ie),Lo(ie,Q),ie.return=ee,ie;case _:return Q=fd(Q,ee.mode,ie),Q.return=ee,Q;case A:return Q=Ra(Q),ge(ee,Q,ie)}if(H(Q)||V(Q))return Q=Ea(Q,ee.mode,ie,null),Q.return=ee,Q;if(typeof Q.then=="function")return ge(ee,Rl(Q),ie);if(Q.$$typeof===E)return ge(ee,Cl(ee,Q),ie);Ml(ee,Q)}return null}function ce(ee,Q,ie,pe){var Ne=Q!==null?Q.key:null;if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return Ne!==null?null:k(ee,Q,""+ie,pe);if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case b:return ie.key===Ne?X(ee,Q,ie,pe):null;case _:return ie.key===Ne?oe(ee,Q,ie,pe):null;case A:return ie=Ra(ie),ce(ee,Q,ie,pe)}if(H(ie)||V(ie))return Ne!==null?null:he(ee,Q,ie,pe,null);if(typeof ie.then=="function")return ce(ee,Q,Rl(ie),pe);if(ie.$$typeof===E)return ce(ee,Q,Cl(ee,ie),pe);Ml(ee,ie)}return null}function ue(ee,Q,ie,pe,Ne){if(typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint")return ee=ee.get(ie)||null,k(Q,ee,""+pe,Ne);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case b:return ee=ee.get(pe.key===null?ie:pe.key)||null,X(Q,ee,pe,Ne);case _:return ee=ee.get(pe.key===null?ie:pe.key)||null,oe(Q,ee,pe,Ne);case A:return pe=Ra(pe),ue(ee,Q,ie,pe,Ne)}if(H(pe)||V(pe))return ee=ee.get(ie)||null,he(Q,ee,pe,Ne,null);if(typeof pe.then=="function")return ue(ee,Q,ie,Rl(pe),Ne);if(pe.$$typeof===E)return ue(ee,Q,ie,Cl(Q,pe),Ne);Ml(Q,pe)}return null}function we(ee,Q,ie,pe){for(var Ne=null,Fe=null,Ce=Q,De=Q=0,Le=null;Ce!==null&&De<ie.length;De++){Ce.index>De?(Le=Ce,Ce=null):Le=Ce.sibling;var Pe=ce(ee,Ce,ie[De],pe);if(Pe===null){Ce===null&&(Ce=Le);break}t&&Ce&&Pe.alternate===null&&r(ee,Ce),Q=x(Pe,Q,De),Fe===null?Ne=Pe:Fe.sibling=Pe,Fe=Pe,Ce=Le}if(De===ie.length)return s(ee,Ce),He&&ur(ee,De),Ne;if(Ce===null){for(;De<ie.length;De++)Ce=ge(ee,ie[De],pe),Ce!==null&&(Q=x(Ce,Q,De),Fe===null?Ne=Ce:Fe.sibling=Ce,Fe=Ce);return He&&ur(ee,De),Ne}for(Ce=u(Ce);De<ie.length;De++)Le=ue(Ce,ee,De,ie[De],pe),Le!==null&&(t&&Le.alternate!==null&&Ce.delete(Le.key===null?De:Le.key),Q=x(Le,Q,De),Fe===null?Ne=Le:Fe.sibling=Le,Fe=Le);return t&&Ce.forEach(function(oa){return r(ee,oa)}),He&&ur(ee,De),Ne}function Re(ee,Q,ie,pe){if(ie==null)throw Error(i(151));for(var Ne=null,Fe=null,Ce=Q,De=Q=0,Le=null,Pe=ie.next();Ce!==null&&!Pe.done;De++,Pe=ie.next()){Ce.index>De?(Le=Ce,Ce=null):Le=Ce.sibling;var oa=ce(ee,Ce,Pe.value,pe);if(oa===null){Ce===null&&(Ce=Le);break}t&&Ce&&oa.alternate===null&&r(ee,Ce),Q=x(oa,Q,De),Fe===null?Ne=oa:Fe.sibling=oa,Fe=oa,Ce=Le}if(Pe.done)return s(ee,Ce),He&&ur(ee,De),Ne;if(Ce===null){for(;!Pe.done;De++,Pe=ie.next())Pe=ge(ee,Pe.value,pe),Pe!==null&&(Q=x(Pe,Q,De),Fe===null?Ne=Pe:Fe.sibling=Pe,Fe=Pe);return He&&ur(ee,De),Ne}for(Ce=u(Ce);!Pe.done;De++,Pe=ie.next())Pe=ue(Ce,ee,De,Pe.value,pe),Pe!==null&&(t&&Pe.alternate!==null&&Ce.delete(Pe.key===null?De:Pe.key),Q=x(Pe,Q,De),Fe===null?Ne=Pe:Fe.sibling=Pe,Fe=Pe);return t&&Ce.forEach(function(p3){return r(ee,p3)}),He&&ur(ee,De),Ne}function Je(ee,Q,ie,pe){if(typeof ie=="object"&&ie!==null&&ie.type===S&&ie.key===null&&(ie=ie.props.children),typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case b:e:{for(var Ne=ie.key;Q!==null;){if(Q.key===Ne){if(Ne=ie.type,Ne===S){if(Q.tag===7){s(ee,Q.sibling),pe=y(Q,ie.props.children),pe.return=ee,ee=pe;break e}}else if(Q.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===A&&Ra(Ne)===Q.type){s(ee,Q.sibling),pe=y(Q,ie.props),Lo(pe,ie),pe.return=ee,ee=pe;break e}s(ee,Q);break}else r(ee,Q);Q=Q.sibling}ie.type===S?(pe=Ea(ie.props.children,ee.mode,pe,ie.key),pe.return=ee,ee=pe):(pe=Sl(ie.type,ie.key,ie.props,null,ee.mode,pe),Lo(pe,ie),pe.return=ee,ee=pe)}return M(ee);case _:e:{for(Ne=ie.key;Q!==null;){if(Q.key===Ne)if(Q.tag===4&&Q.stateNode.containerInfo===ie.containerInfo&&Q.stateNode.implementation===ie.implementation){s(ee,Q.sibling),pe=y(Q,ie.children||[]),pe.return=ee,ee=pe;break e}else{s(ee,Q);break}else r(ee,Q);Q=Q.sibling}pe=fd(ie,ee.mode,pe),pe.return=ee,ee=pe}return M(ee);case A:return ie=Ra(ie),Je(ee,Q,ie,pe)}if(H(ie))return we(ee,Q,ie,pe);if(V(ie)){if(Ne=V(ie),typeof Ne!="function")throw Error(i(150));return ie=Ne.call(ie),Re(ee,Q,ie,pe)}if(typeof ie.then=="function")return Je(ee,Q,Rl(ie),pe);if(ie.$$typeof===E)return Je(ee,Q,Cl(ee,ie),pe);Ml(ee,ie)}return typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint"?(ie=""+ie,Q!==null&&Q.tag===6?(s(ee,Q.sibling),pe=y(Q,ie),pe.return=ee,ee=pe):(s(ee,Q),pe=dd(ie,ee.mode,pe),pe.return=ee,ee=pe),M(ee)):s(ee,Q)}return function(ee,Q,ie,pe){try{Bo=0;var Ne=Je(ee,Q,ie,pe);return ji=null,Ne}catch(Ce){if(Ce===Ti||Ce===jl)throw Ce;var Fe=an(29,Ce,null,ee.mode);return Fe.lanes=pe,Fe.return=ee,Fe}finally{}}}var Aa=W0(!0),X0=W0(!1),Fr=!1;function Ed(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Cd(t,r){t=t.updateQueue,r.updateQueue===t&&(r.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Pr(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Gr(t,r,s){var u=t.updateQueue;if(u===null)return null;if(u=u.shared,($e&2)!==0){var y=u.pending;return y===null?r.next=r:(r.next=y.next,y.next=r),u.pending=r,r=_l(t),z0(t,null,s),r}return xl(t,u,r,s),_l(t)}function Ho(t,r,s){if(r=r.updateQueue,r!==null&&(r=r.shared,(s&4194048)!==0)){var u=r.lanes;u&=t.pendingLanes,s|=u,r.lanes=s,Js(t,s)}}function Td(t,r){var s=t.updateQueue,u=t.alternate;if(u!==null&&(u=u.updateQueue,s===u)){var y=null,x=null;if(s=s.firstBaseUpdate,s!==null){do{var M={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};x===null?y=x=M:x=x.next=M,s=s.next}while(s!==null);x===null?y=x=r:x=x.next=r}else y=x=r;s={baseState:u.baseState,firstBaseUpdate:y,lastBaseUpdate:x,shared:u.shared,callbacks:u.callbacks},t.updateQueue=s;return}t=s.lastBaseUpdate,t===null?s.firstBaseUpdate=r:t.next=r,s.lastBaseUpdate=r}var jd=!1;function Io(){if(jd){var t=Ci;if(t!==null)throw t}}function Uo(t,r,s,u){jd=!1;var y=t.updateQueue;Fr=!1;var x=y.firstBaseUpdate,M=y.lastBaseUpdate,k=y.shared.pending;if(k!==null){y.shared.pending=null;var X=k,oe=X.next;X.next=null,M===null?x=oe:M.next=oe,M=X;var he=t.alternate;he!==null&&(he=he.updateQueue,k=he.lastBaseUpdate,k!==M&&(k===null?he.firstBaseUpdate=oe:k.next=oe,he.lastBaseUpdate=X))}if(x!==null){var ge=y.baseState;M=0,he=oe=X=null,k=x;do{var ce=k.lane&-536870913,ue=ce!==k.lane;if(ue?(Be&ce)===ce:(u&ce)===ce){ce!==0&&ce===Ei&&(jd=!0),he!==null&&(he=he.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});e:{var we=t,Re=k;ce=r;var Je=s;switch(Re.tag){case 1:if(we=Re.payload,typeof we=="function"){ge=we.call(Je,ge,ce);break e}ge=we;break e;case 3:we.flags=we.flags&-65537|128;case 0:if(we=Re.payload,ce=typeof we=="function"?we.call(Je,ge,ce):we,ce==null)break e;ge=v({},ge,ce);break e;case 2:Fr=!0}}ce=k.callback,ce!==null&&(t.flags|=64,ue&&(t.flags|=8192),ue=y.callbacks,ue===null?y.callbacks=[ce]:ue.push(ce))}else ue={lane:ce,tag:k.tag,payload:k.payload,callback:k.callback,next:null},he===null?(oe=he=ue,X=ge):he=he.next=ue,M|=ce;if(k=k.next,k===null){if(k=y.shared.pending,k===null)break;ue=k,k=ue.next,ue.next=null,y.lastBaseUpdate=ue,y.shared.pending=null}}while(!0);he===null&&(X=ge),y.baseState=X,y.firstBaseUpdate=oe,y.lastBaseUpdate=he,x===null&&(y.shared.lanes=0),Kr|=M,t.lanes=M,t.memoizedState=ge}}function K0(t,r){if(typeof t!="function")throw Error(i(191,t));t.call(r)}function Z0(t,r){var s=t.callbacks;if(s!==null)for(t.callbacks=null,t=0;t<s.length;t++)K0(s[t],r)}var Ni=B(null),Al=B(0);function Q0(t,r){t=_r,ae(Al,t),ae(Ni,r),_r=t|r.baseLanes}function Nd(){ae(Al,_r),ae(Ni,Ni.current)}function Rd(){_r=Al.current,Y(Ni),Y(Al)}var on=B(null),xn=null;function $r(t){var r=t.alternate;ae(mt,mt.current&1),ae(on,t),xn===null&&(r===null||Ni.current!==null||r.memoizedState!==null)&&(xn=t)}function Md(t){ae(mt,mt.current),ae(on,t),xn===null&&(xn=t)}function J0(t){t.tag===22?(ae(mt,mt.current),ae(on,t),xn===null&&(xn=t)):Yr()}function Yr(){ae(mt,mt.current),ae(on,on.current)}function sn(t){Y(on),xn===t&&(xn=null),Y(mt)}var mt=B(0);function zl(t){for(var r=t;r!==null;){if(r.tag===13){var s=r.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Bf(s)||Lf(s)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var hr=0,ze=null,Ze=null,St=null,Dl=!1,Ri=!1,za=!1,kl=0,Vo=0,Mi=null,aD=0;function gt(){throw Error(i(321))}function Ad(t,r){if(r===null)return!1;for(var s=0;s<r.length&&s<t.length;s++)if(!rn(t[s],r[s]))return!1;return!0}function zd(t,r,s,u,y,x){return hr=x,ze=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,O.H=t===null||t.memoizedState===null?qx:Yd,za=!1,x=s(u,y),za=!1,Ri&&(x=tx(r,s,u,y)),ex(t),x}function ex(t){O.H=Go;var r=Ze!==null&&Ze.next!==null;if(hr=0,St=Ze=ze=null,Dl=!1,Vo=0,Mi=null,r)throw Error(i(300));t===null||wt||(t=t.dependencies,t!==null&&El(t)&&(wt=!0))}function tx(t,r,s,u){ze=t;var y=0;do{if(Ri&&(Mi=null),Vo=0,Ri=!1,25<=y)throw Error(i(301));if(y+=1,St=Ze=null,t.updateQueue!=null){var x=t.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}O.H=Bx,x=r(s,u)}while(Ri);return x}function iD(){var t=O.H,r=t.useState()[0];return r=typeof r.then=="function"?Fo(r):r,t=t.useState()[0],(Ze!==null?Ze.memoizedState:null)!==t&&(ze.flags|=1024),r}function Dd(){var t=kl!==0;return kl=0,t}function kd(t,r,s){r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~s}function Od(t){if(Dl){for(t=t.memoizedState;t!==null;){var r=t.queue;r!==null&&(r.pending=null),t=t.next}Dl=!1}hr=0,St=Ze=ze=null,Ri=!1,Vo=kl=0,Mi=null}function Gt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return St===null?ze.memoizedState=St=t:St=St.next=t,St}function yt(){if(Ze===null){var t=ze.alternate;t=t!==null?t.memoizedState:null}else t=Ze.next;var r=St===null?ze.memoizedState:St.next;if(r!==null)St=r,Ze=t;else{if(t===null)throw ze.alternate===null?Error(i(467)):Error(i(310));Ze=t,t={memoizedState:Ze.memoizedState,baseState:Ze.baseState,baseQueue:Ze.baseQueue,queue:Ze.queue,next:null},St===null?ze.memoizedState=St=t:St=St.next=t}return St}function Ol(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Fo(t){var r=Vo;return Vo+=1,Mi===null&&(Mi=[]),t=G0(Mi,t,r),r=ze,(St===null?r.memoizedState:St.next)===null&&(r=r.alternate,O.H=r===null||r.memoizedState===null?qx:Yd),t}function ql(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Fo(t);if(t.$$typeof===E)return kt(t)}throw Error(i(438,String(t)))}function qd(t){var r=null,s=ze.updateQueue;if(s!==null&&(r=s.memoCache),r==null){var u=ze.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(r={data:u.data.map(function(y){return y.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),s===null&&(s=Ol(),ze.updateQueue=s),s.memoCache=r,s=r.data[r.index],s===void 0)for(s=r.data[r.index]=Array(t),u=0;u<t;u++)s[u]=I;return r.index++,s}function pr(t,r){return typeof r=="function"?r(t):r}function Bl(t){var r=yt();return Bd(r,Ze,t)}function Bd(t,r,s){var u=t.queue;if(u===null)throw Error(i(311));u.lastRenderedReducer=s;var y=t.baseQueue,x=u.pending;if(x!==null){if(y!==null){var M=y.next;y.next=x.next,x.next=M}r.baseQueue=y=x,u.pending=null}if(x=t.baseState,y===null)t.memoizedState=x;else{r=y.next;var k=M=null,X=null,oe=r,he=!1;do{var ge=oe.lane&-536870913;if(ge!==oe.lane?(Be&ge)===ge:(hr&ge)===ge){var ce=oe.revertLane;if(ce===0)X!==null&&(X=X.next={lane:0,revertLane:0,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null}),ge===Ei&&(he=!0);else if((hr&ce)===ce){oe=oe.next,ce===Ei&&(he=!0);continue}else ge={lane:0,revertLane:oe.revertLane,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},X===null?(k=X=ge,M=x):X=X.next=ge,ze.lanes|=ce,Kr|=ce;ge=oe.action,za&&s(x,ge),x=oe.hasEagerState?oe.eagerState:s(x,ge)}else ce={lane:ge,revertLane:oe.revertLane,gesture:oe.gesture,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},X===null?(k=X=ce,M=x):X=X.next=ce,ze.lanes|=ge,Kr|=ge;oe=oe.next}while(oe!==null&&oe!==r);if(X===null?M=x:X.next=k,!rn(x,t.memoizedState)&&(wt=!0,he&&(s=Ci,s!==null)))throw s;t.memoizedState=x,t.baseState=M,t.baseQueue=X,u.lastRenderedState=x}return y===null&&(u.lanes=0),[t.memoizedState,u.dispatch]}function Ld(t){var r=yt(),s=r.queue;if(s===null)throw Error(i(311));s.lastRenderedReducer=t;var u=s.dispatch,y=s.pending,x=r.memoizedState;if(y!==null){s.pending=null;var M=y=y.next;do x=t(x,M.action),M=M.next;while(M!==y);rn(x,r.memoizedState)||(wt=!0),r.memoizedState=x,r.baseQueue===null&&(r.baseState=x),s.lastRenderedState=x}return[x,u]}function nx(t,r,s){var u=ze,y=yt(),x=He;if(x){if(s===void 0)throw Error(i(407));s=s()}else s=r();var M=!rn((Ze||y).memoizedState,s);if(M&&(y.memoizedState=s,wt=!0),y=y.queue,Ud(ix.bind(null,u,y,t),[t]),y.getSnapshot!==r||M||St!==null&&St.memoizedState.tag&1){if(u.flags|=2048,Ai(9,{destroy:void 0},ax.bind(null,u,y,s,r),null),et===null)throw Error(i(349));x||(hr&127)!==0||rx(u,r,s)}return s}function rx(t,r,s){t.flags|=16384,t={getSnapshot:r,value:s},r=ze.updateQueue,r===null?(r=Ol(),ze.updateQueue=r,r.stores=[t]):(s=r.stores,s===null?r.stores=[t]:s.push(t))}function ax(t,r,s,u){r.value=s,r.getSnapshot=u,ox(r)&&sx(t)}function ix(t,r,s){return s(function(){ox(r)&&sx(t)})}function ox(t){var r=t.getSnapshot;t=t.value;try{var s=r();return!rn(t,s)}catch{return!0}}function sx(t){var r=wa(t,2);r!==null&&Jt(r,t,2)}function Hd(t){var r=Gt();if(typeof t=="function"){var s=t;if(t=s(),za){Un(!0);try{s()}finally{Un(!1)}}}return r.memoizedState=r.baseState=t,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:pr,lastRenderedState:t},r}function lx(t,r,s,u){return t.baseState=s,Bd(t,Ze,typeof u=="function"?u:pr)}function oD(t,r,s,u,y){if(Il(t))throw Error(i(485));if(t=r.action,t!==null){var x={payload:y,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(M){x.listeners.push(M)}};O.T!==null?s(!0):x.isTransition=!1,u(x),s=r.pending,s===null?(x.next=r.pending=x,cx(r,x)):(x.next=s.next,r.pending=s.next=x)}}function cx(t,r){var s=r.action,u=r.payload,y=t.state;if(r.isTransition){var x=O.T,M={};O.T=M;try{var k=s(y,u),X=O.S;X!==null&&X(M,k),ux(t,r,k)}catch(oe){Id(t,r,oe)}finally{x!==null&&M.types!==null&&(x.types=M.types),O.T=x}}else try{x=s(y,u),ux(t,r,x)}catch(oe){Id(t,r,oe)}}function ux(t,r,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(u){dx(t,r,u)},function(u){return Id(t,r,u)}):dx(t,r,s)}function dx(t,r,s){r.status="fulfilled",r.value=s,fx(r),t.state=s,r=t.pending,r!==null&&(s=r.next,s===r?t.pending=null:(s=s.next,r.next=s,cx(t,s)))}function Id(t,r,s){var u=t.pending;if(t.pending=null,u!==null){u=u.next;do r.status="rejected",r.reason=s,fx(r),r=r.next;while(r!==u)}t.action=null}function fx(t){t=t.listeners;for(var r=0;r<t.length;r++)(0,t[r])()}function hx(t,r){return r}function px(t,r){if(He){var s=et.formState;if(s!==null){e:{var u=ze;if(He){if(ot){t:{for(var y=ot,x=bn;y.nodeType!==8;){if(!x){y=null;break t}if(y=_n(y.nextSibling),y===null){y=null;break t}}x=y.data,y=x==="F!"||x==="F"?y:null}if(y){ot=_n(y.nextSibling),u=y.data==="F!";break e}}Ur(u)}u=!1}u&&(r=s[0])}}return s=Gt(),s.memoizedState=s.baseState=r,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:hx,lastRenderedState:r},s.queue=u,s=Dx.bind(null,ze,u),u.dispatch=s,u=Hd(!1),x=$d.bind(null,ze,!1,u.queue),u=Gt(),y={state:r,dispatch:null,action:t,pending:null},u.queue=y,s=oD.bind(null,ze,y,x,s),y.dispatch=s,u.memoizedState=t,[r,s,!1]}function gx(t){var r=yt();return vx(r,Ze,t)}function vx(t,r,s){if(r=Bd(t,r,hx)[0],t=Bl(pr)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var u=Fo(r)}catch(M){throw M===Ti?jl:M}else u=r;r=yt();var y=r.queue,x=y.dispatch;return s!==r.memoizedState&&(ze.flags|=2048,Ai(9,{destroy:void 0},sD.bind(null,y,s),null)),[u,x,t]}function sD(t,r){t.action=r}function mx(t){var r=yt(),s=Ze;if(s!==null)return vx(r,s,t);yt(),r=r.memoizedState,s=yt();var u=s.queue.dispatch;return s.memoizedState=t,[r,u,!1]}function Ai(t,r,s,u){return t={tag:t,create:s,deps:u,inst:r,next:null},r=ze.updateQueue,r===null&&(r=Ol(),ze.updateQueue=r),s=r.lastEffect,s===null?r.lastEffect=t.next=t:(u=s.next,s.next=t,t.next=u,r.lastEffect=t),t}function yx(){return yt().memoizedState}function Ll(t,r,s,u){var y=Gt();ze.flags|=t,y.memoizedState=Ai(1|r,{destroy:void 0},s,u===void 0?null:u)}function Hl(t,r,s,u){var y=yt();u=u===void 0?null:u;var x=y.memoizedState.inst;Ze!==null&&u!==null&&Ad(u,Ze.memoizedState.deps)?y.memoizedState=Ai(r,x,s,u):(ze.flags|=t,y.memoizedState=Ai(1|r,x,s,u))}function bx(t,r){Ll(8390656,8,t,r)}function Ud(t,r){Hl(2048,8,t,r)}function lD(t){ze.flags|=4;var r=ze.updateQueue;if(r===null)r=Ol(),ze.updateQueue=r,r.events=[t];else{var s=r.events;s===null?r.events=[t]:s.push(t)}}function xx(t){var r=yt().memoizedState;return lD({ref:r,nextImpl:t}),function(){if(($e&2)!==0)throw Error(i(440));return r.impl.apply(void 0,arguments)}}function _x(t,r){return Hl(4,2,t,r)}function Sx(t,r){return Hl(4,4,t,r)}function wx(t,r){if(typeof r=="function"){t=t();var s=r(t);return function(){typeof s=="function"?s():r(null)}}if(r!=null)return t=t(),r.current=t,function(){r.current=null}}function Ex(t,r,s){s=s!=null?s.concat([t]):null,Hl(4,4,wx.bind(null,r,t),s)}function Vd(){}function Cx(t,r){var s=yt();r=r===void 0?null:r;var u=s.memoizedState;return r!==null&&Ad(r,u[1])?u[0]:(s.memoizedState=[t,r],t)}function Tx(t,r){var s=yt();r=r===void 0?null:r;var u=s.memoizedState;if(r!==null&&Ad(r,u[1]))return u[0];if(u=t(),za){Un(!0);try{t()}finally{Un(!1)}}return s.memoizedState=[u,r],u}function Fd(t,r,s){return s===void 0||(hr&1073741824)!==0&&(Be&261930)===0?t.memoizedState=r:(t.memoizedState=s,t=j_(),ze.lanes|=t,Kr|=t,s)}function jx(t,r,s,u){return rn(s,r)?s:Ni.current!==null?(t=Fd(t,s,u),rn(t,r)||(wt=!0),t):(hr&42)===0||(hr&1073741824)!==0&&(Be&261930)===0?(wt=!0,t.memoizedState=s):(t=j_(),ze.lanes|=t,Kr|=t,r)}function Nx(t,r,s,u,y){var x=F.p;F.p=x!==0&&8>x?x:8;var M=O.T,k={};O.T=k,$d(t,!1,r,s);try{var X=y(),oe=O.S;if(oe!==null&&oe(k,X),X!==null&&typeof X=="object"&&typeof X.then=="function"){var he=rD(X,u);Po(t,r,he,un(t))}else Po(t,r,u,un(t))}catch(ge){Po(t,r,{then:function(){},status:"rejected",reason:ge},un())}finally{F.p=x,M!==null&&k.types!==null&&(M.types=k.types),O.T=M}}function cD(){}function Pd(t,r,s,u){if(t.tag!==5)throw Error(i(476));var y=Rx(t).queue;Nx(t,y,r,J,s===null?cD:function(){return Mx(t),s(u)})}function Rx(t){var r=t.memoizedState;if(r!==null)return r;r={memoizedState:J,baseState:J,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:pr,lastRenderedState:J},next:null};var s={};return r.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:pr,lastRenderedState:s},next:null},t.memoizedState=r,t=t.alternate,t!==null&&(t.memoizedState=r),r}function Mx(t){var r=Rx(t);r.next===null&&(r=t.alternate.memoizedState),Po(t,r.next.queue,{},un())}function Gd(){return kt(ss)}function Ax(){return yt().memoizedState}function zx(){return yt().memoizedState}function uD(t){for(var r=t.return;r!==null;){switch(r.tag){case 24:case 3:var s=un();t=Pr(s);var u=Gr(r,t,s);u!==null&&(Jt(u,r,s),Ho(u,r,s)),r={cache:xd()},t.payload=r;return}r=r.return}}function dD(t,r,s){var u=un();s={lane:u,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Il(t)?kx(r,s):(s=cd(t,r,s,u),s!==null&&(Jt(s,t,u),Ox(s,r,u)))}function Dx(t,r,s){var u=un();Po(t,r,s,u)}function Po(t,r,s,u){var y={lane:u,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(Il(t))kx(r,y);else{var x=t.alternate;if(t.lanes===0&&(x===null||x.lanes===0)&&(x=r.lastRenderedReducer,x!==null))try{var M=r.lastRenderedState,k=x(M,s);if(y.hasEagerState=!0,y.eagerState=k,rn(k,M))return xl(t,r,y,0),et===null&&bl(),!1}catch{}finally{}if(s=cd(t,r,y,u),s!==null)return Jt(s,t,u),Ox(s,r,u),!0}return!1}function $d(t,r,s,u){if(u={lane:2,revertLane:Cf(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Il(t)){if(r)throw Error(i(479))}else r=cd(t,s,u,2),r!==null&&Jt(r,t,2)}function Il(t){var r=t.alternate;return t===ze||r!==null&&r===ze}function kx(t,r){Ri=Dl=!0;var s=t.pending;s===null?r.next=r:(r.next=s.next,s.next=r),t.pending=r}function Ox(t,r,s){if((s&4194048)!==0){var u=r.lanes;u&=t.pendingLanes,s|=u,r.lanes=s,Js(t,s)}}var Go={readContext:kt,use:ql,useCallback:gt,useContext:gt,useEffect:gt,useImperativeHandle:gt,useLayoutEffect:gt,useInsertionEffect:gt,useMemo:gt,useReducer:gt,useRef:gt,useState:gt,useDebugValue:gt,useDeferredValue:gt,useTransition:gt,useSyncExternalStore:gt,useId:gt,useHostTransitionStatus:gt,useFormState:gt,useActionState:gt,useOptimistic:gt,useMemoCache:gt,useCacheRefresh:gt};Go.useEffectEvent=gt;var qx={readContext:kt,use:ql,useCallback:function(t,r){return Gt().memoizedState=[t,r===void 0?null:r],t},useContext:kt,useEffect:bx,useImperativeHandle:function(t,r,s){s=s!=null?s.concat([t]):null,Ll(4194308,4,wx.bind(null,r,t),s)},useLayoutEffect:function(t,r){return Ll(4194308,4,t,r)},useInsertionEffect:function(t,r){Ll(4,2,t,r)},useMemo:function(t,r){var s=Gt();r=r===void 0?null:r;var u=t();if(za){Un(!0);try{t()}finally{Un(!1)}}return s.memoizedState=[u,r],u},useReducer:function(t,r,s){var u=Gt();if(s!==void 0){var y=s(r);if(za){Un(!0);try{s(r)}finally{Un(!1)}}}else y=r;return u.memoizedState=u.baseState=y,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:y},u.queue=t,t=t.dispatch=dD.bind(null,ze,t),[u.memoizedState,t]},useRef:function(t){var r=Gt();return t={current:t},r.memoizedState=t},useState:function(t){t=Hd(t);var r=t.queue,s=Dx.bind(null,ze,r);return r.dispatch=s,[t.memoizedState,s]},useDebugValue:Vd,useDeferredValue:function(t,r){var s=Gt();return Fd(s,t,r)},useTransition:function(){var t=Hd(!1);return t=Nx.bind(null,ze,t.queue,!0,!1),Gt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,r,s){var u=ze,y=Gt();if(He){if(s===void 0)throw Error(i(407));s=s()}else{if(s=r(),et===null)throw Error(i(349));(Be&127)!==0||rx(u,r,s)}y.memoizedState=s;var x={value:s,getSnapshot:r};return y.queue=x,bx(ix.bind(null,u,x,t),[t]),u.flags|=2048,Ai(9,{destroy:void 0},ax.bind(null,u,x,s,r),null),s},useId:function(){var t=Gt(),r=et.identifierPrefix;if(He){var s=Pn,u=Fn;s=(u&~(1<<32-Pt(u)-1)).toString(32)+s,r="_"+r+"R_"+s,s=kl++,0<s&&(r+="H"+s.toString(32)),r+="_"}else s=aD++,r="_"+r+"r_"+s.toString(32)+"_";return t.memoizedState=r},useHostTransitionStatus:Gd,useFormState:px,useActionState:px,useOptimistic:function(t){var r=Gt();r.memoizedState=r.baseState=t;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=s,r=$d.bind(null,ze,!0,s),s.dispatch=r,[t,r]},useMemoCache:qd,useCacheRefresh:function(){return Gt().memoizedState=uD.bind(null,ze)},useEffectEvent:function(t){var r=Gt(),s={impl:t};return r.memoizedState=s,function(){if(($e&2)!==0)throw Error(i(440));return s.impl.apply(void 0,arguments)}}},Yd={readContext:kt,use:ql,useCallback:Cx,useContext:kt,useEffect:Ud,useImperativeHandle:Ex,useInsertionEffect:_x,useLayoutEffect:Sx,useMemo:Tx,useReducer:Bl,useRef:yx,useState:function(){return Bl(pr)},useDebugValue:Vd,useDeferredValue:function(t,r){var s=yt();return jx(s,Ze.memoizedState,t,r)},useTransition:function(){var t=Bl(pr)[0],r=yt().memoizedState;return[typeof t=="boolean"?t:Fo(t),r]},useSyncExternalStore:nx,useId:Ax,useHostTransitionStatus:Gd,useFormState:gx,useActionState:gx,useOptimistic:function(t,r){var s=yt();return lx(s,Ze,t,r)},useMemoCache:qd,useCacheRefresh:zx};Yd.useEffectEvent=xx;var Bx={readContext:kt,use:ql,useCallback:Cx,useContext:kt,useEffect:Ud,useImperativeHandle:Ex,useInsertionEffect:_x,useLayoutEffect:Sx,useMemo:Tx,useReducer:Ld,useRef:yx,useState:function(){return Ld(pr)},useDebugValue:Vd,useDeferredValue:function(t,r){var s=yt();return Ze===null?Fd(s,t,r):jx(s,Ze.memoizedState,t,r)},useTransition:function(){var t=Ld(pr)[0],r=yt().memoizedState;return[typeof t=="boolean"?t:Fo(t),r]},useSyncExternalStore:nx,useId:Ax,useHostTransitionStatus:Gd,useFormState:mx,useActionState:mx,useOptimistic:function(t,r){var s=yt();return Ze!==null?lx(s,Ze,t,r):(s.baseState=t,[t,s.queue.dispatch])},useMemoCache:qd,useCacheRefresh:zx};Bx.useEffectEvent=xx;function Wd(t,r,s,u){r=t.memoizedState,s=s(u,r),s=s==null?r:v({},r,s),t.memoizedState=s,t.lanes===0&&(t.updateQueue.baseState=s)}var Xd={enqueueSetState:function(t,r,s){t=t._reactInternals;var u=un(),y=Pr(u);y.payload=r,s!=null&&(y.callback=s),r=Gr(t,y,u),r!==null&&(Jt(r,t,u),Ho(r,t,u))},enqueueReplaceState:function(t,r,s){t=t._reactInternals;var u=un(),y=Pr(u);y.tag=1,y.payload=r,s!=null&&(y.callback=s),r=Gr(t,y,u),r!==null&&(Jt(r,t,u),Ho(r,t,u))},enqueueForceUpdate:function(t,r){t=t._reactInternals;var s=un(),u=Pr(s);u.tag=2,r!=null&&(u.callback=r),r=Gr(t,u,s),r!==null&&(Jt(r,t,s),Ho(r,t,s))}};function Lx(t,r,s,u,y,x,M){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(u,x,M):r.prototype&&r.prototype.isPureReactComponent?!Ao(s,u)||!Ao(y,x):!0}function Hx(t,r,s,u){t=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(s,u),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(s,u),r.state!==t&&Xd.enqueueReplaceState(r,r.state,null)}function Da(t,r){var s=r;if("ref"in r){s={};for(var u in r)u!=="ref"&&(s[u]=r[u])}if(t=t.defaultProps){s===r&&(s=v({},s));for(var y in t)s[y]===void 0&&(s[y]=t[y])}return s}function Ix(t){yl(t)}function Ux(t){console.error(t)}function Vx(t){yl(t)}function Ul(t,r){try{var s=t.onUncaughtError;s(r.value,{componentStack:r.stack})}catch(u){setTimeout(function(){throw u})}}function Fx(t,r,s){try{var u=t.onCaughtError;u(s.value,{componentStack:s.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function Kd(t,r,s){return s=Pr(s),s.tag=3,s.payload={element:null},s.callback=function(){Ul(t,r)},s}function Px(t){return t=Pr(t),t.tag=3,t}function Gx(t,r,s,u){var y=s.type.getDerivedStateFromError;if(typeof y=="function"){var x=u.value;t.payload=function(){return y(x)},t.callback=function(){Fx(r,s,u)}}var M=s.stateNode;M!==null&&typeof M.componentDidCatch=="function"&&(t.callback=function(){Fx(r,s,u),typeof y!="function"&&(Zr===null?Zr=new Set([this]):Zr.add(this));var k=u.stack;this.componentDidCatch(u.value,{componentStack:k!==null?k:""})})}function fD(t,r,s,u,y){if(s.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(r=s.alternate,r!==null&&wi(r,s,y,!0),s=on.current,s!==null){switch(s.tag){case 31:case 13:return xn===null?Jl():s.alternate===null&&vt===0&&(vt=3),s.flags&=-257,s.flags|=65536,s.lanes=y,u===Nl?s.flags|=16384:(r=s.updateQueue,r===null?s.updateQueue=new Set([u]):r.add(u),Sf(t,u,y)),!1;case 22:return s.flags|=65536,u===Nl?s.flags|=16384:(r=s.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([u])},s.updateQueue=r):(s=r.retryQueue,s===null?r.retryQueue=new Set([u]):s.add(u)),Sf(t,u,y)),!1}throw Error(i(435,s.tag))}return Sf(t,u,y),Jl(),!1}if(He)return r=on.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=y,u!==gd&&(t=Error(i(422),{cause:u}),ko(vn(t,s)))):(u!==gd&&(r=Error(i(423),{cause:u}),ko(vn(r,s))),t=t.current.alternate,t.flags|=65536,y&=-y,t.lanes|=y,u=vn(u,s),y=Kd(t.stateNode,u,y),Td(t,y),vt!==4&&(vt=2)),!1;var x=Error(i(520),{cause:u});if(x=vn(x,s),Jo===null?Jo=[x]:Jo.push(x),vt!==4&&(vt=2),r===null)return!0;u=vn(u,s),s=r;do{switch(s.tag){case 3:return s.flags|=65536,t=y&-y,s.lanes|=t,t=Kd(s.stateNode,u,t),Td(s,t),!1;case 1:if(r=s.type,x=s.stateNode,(s.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(Zr===null||!Zr.has(x))))return s.flags|=65536,y&=-y,s.lanes|=y,y=Px(y),Gx(y,t,s,u),Td(s,y),!1}s=s.return}while(s!==null);return!1}var Zd=Error(i(461)),wt=!1;function Ot(t,r,s,u){r.child=t===null?X0(r,null,s,u):Aa(r,t.child,s,u)}function $x(t,r,s,u,y){s=s.render;var x=r.ref;if("ref"in u){var M={};for(var k in u)k!=="ref"&&(M[k]=u[k])}else M=u;return ja(r),u=zd(t,r,s,M,x,y),k=Dd(),t!==null&&!wt?(kd(t,r,y),gr(t,r,y)):(He&&k&&hd(r),r.flags|=1,Ot(t,r,u,y),r.child)}function Yx(t,r,s,u,y){if(t===null){var x=s.type;return typeof x=="function"&&!ud(x)&&x.defaultProps===void 0&&s.compare===null?(r.tag=15,r.type=x,Wx(t,r,x,u,y)):(t=Sl(s.type,null,u,r,r.mode,y),t.ref=r.ref,t.return=r,r.child=t)}if(x=t.child,!of(t,y)){var M=x.memoizedProps;if(s=s.compare,s=s!==null?s:Ao,s(M,u)&&t.ref===r.ref)return gr(t,r,y)}return r.flags|=1,t=cr(x,u),t.ref=r.ref,t.return=r,r.child=t}function Wx(t,r,s,u,y){if(t!==null){var x=t.memoizedProps;if(Ao(x,u)&&t.ref===r.ref)if(wt=!1,r.pendingProps=u=x,of(t,y))(t.flags&131072)!==0&&(wt=!0);else return r.lanes=t.lanes,gr(t,r,y)}return Qd(t,r,s,u,y)}function Xx(t,r,s,u){var y=u.children,x=t!==null?t.memoizedState:null;if(t===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.mode==="hidden"){if((r.flags&128)!==0){if(x=x!==null?x.baseLanes|s:s,t!==null){for(u=r.child=t.child,y=0;u!==null;)y=y|u.lanes|u.childLanes,u=u.sibling;u=y&~x}else u=0,r.child=null;return Kx(t,r,x,s,u)}if((s&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},t!==null&&Tl(r,x!==null?x.cachePool:null),x!==null?Q0(r,x):Nd(),J0(r);else return u=r.lanes=536870912,Kx(t,r,x!==null?x.baseLanes|s:s,s,u)}else x!==null?(Tl(r,x.cachePool),Q0(r,x),Yr(),r.memoizedState=null):(t!==null&&Tl(r,null),Nd(),Yr());return Ot(t,r,y,s),r.child}function $o(t,r){return t!==null&&t.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function Kx(t,r,s,u,y){var x=Sd();return x=x===null?null:{parent:_t._currentValue,pool:x},r.memoizedState={baseLanes:s,cachePool:x},t!==null&&Tl(r,null),Nd(),J0(r),t!==null&&wi(t,r,u,!0),r.childLanes=y,null}function Vl(t,r){return r=Pl({mode:r.mode,children:r.children},t.mode),r.ref=t.ref,t.child=r,r.return=t,r}function Zx(t,r,s){return Aa(r,t.child,null,s),t=Vl(r,r.pendingProps),t.flags|=2,sn(r),r.memoizedState=null,t}function hD(t,r,s){var u=r.pendingProps,y=(r.flags&128)!==0;if(r.flags&=-129,t===null){if(He){if(u.mode==="hidden")return t=Vl(r,u),r.lanes=536870912,$o(null,t);if(Md(r),(t=ot)?(t=c1(t,bn),t=t!==null&&t.data==="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:Hr!==null?{id:Fn,overflow:Pn}:null,retryLane:536870912,hydrationErrors:null},s=k0(t),s.return=r,r.child=s,Dt=r,ot=null)):t=null,t===null)throw Ur(r);return r.lanes=536870912,null}return Vl(r,u)}var x=t.memoizedState;if(x!==null){var M=x.dehydrated;if(Md(r),y)if(r.flags&256)r.flags&=-257,r=Zx(t,r,s);else if(r.memoizedState!==null)r.child=t.child,r.flags|=128,r=null;else throw Error(i(558));else if(wt||wi(t,r,s,!1),y=(s&t.childLanes)!==0,wt||y){if(u=et,u!==null&&(M=el(u,s),M!==0&&M!==x.retryLane))throw x.retryLane=M,wa(t,M),Jt(u,t,M),Zd;Jl(),r=Zx(t,r,s)}else t=x.treeContext,ot=_n(M.nextSibling),Dt=r,He=!0,Ir=null,bn=!1,t!==null&&B0(r,t),r=Vl(r,u),r.flags|=4096;return r}return t=cr(t.child,{mode:u.mode,children:u.children}),t.ref=r.ref,r.child=t,t.return=r,t}function Fl(t,r){var s=r.ref;if(s===null)t!==null&&t.ref!==null&&(r.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(i(284));(t===null||t.ref!==s)&&(r.flags|=4194816)}}function Qd(t,r,s,u,y){return ja(r),s=zd(t,r,s,u,void 0,y),u=Dd(),t!==null&&!wt?(kd(t,r,y),gr(t,r,y)):(He&&u&&hd(r),r.flags|=1,Ot(t,r,s,y),r.child)}function Qx(t,r,s,u,y,x){return ja(r),r.updateQueue=null,s=tx(r,u,s,y),ex(t),u=Dd(),t!==null&&!wt?(kd(t,r,x),gr(t,r,x)):(He&&u&&hd(r),r.flags|=1,Ot(t,r,s,x),r.child)}function Jx(t,r,s,u,y){if(ja(r),r.stateNode===null){var x=bi,M=s.contextType;typeof M=="object"&&M!==null&&(x=kt(M)),x=new s(u,x),r.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=Xd,r.stateNode=x,x._reactInternals=r,x=r.stateNode,x.props=u,x.state=r.memoizedState,x.refs={},Ed(r),M=s.contextType,x.context=typeof M=="object"&&M!==null?kt(M):bi,x.state=r.memoizedState,M=s.getDerivedStateFromProps,typeof M=="function"&&(Wd(r,s,M,u),x.state=r.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(M=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),M!==x.state&&Xd.enqueueReplaceState(x,x.state,null),Uo(r,u,x,y),Io(),x.state=r.memoizedState),typeof x.componentDidMount=="function"&&(r.flags|=4194308),u=!0}else if(t===null){x=r.stateNode;var k=r.memoizedProps,X=Da(s,k);x.props=X;var oe=x.context,he=s.contextType;M=bi,typeof he=="object"&&he!==null&&(M=kt(he));var ge=s.getDerivedStateFromProps;he=typeof ge=="function"||typeof x.getSnapshotBeforeUpdate=="function",k=r.pendingProps!==k,he||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(k||oe!==M)&&Hx(r,x,u,M),Fr=!1;var ce=r.memoizedState;x.state=ce,Uo(r,u,x,y),Io(),oe=r.memoizedState,k||ce!==oe||Fr?(typeof ge=="function"&&(Wd(r,s,ge,u),oe=r.memoizedState),(X=Fr||Lx(r,s,X,u,ce,oe,M))?(he||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(r.flags|=4194308)):(typeof x.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=u,r.memoizedState=oe),x.props=u,x.state=oe,x.context=M,u=X):(typeof x.componentDidMount=="function"&&(r.flags|=4194308),u=!1)}else{x=r.stateNode,Cd(t,r),M=r.memoizedProps,he=Da(s,M),x.props=he,ge=r.pendingProps,ce=x.context,oe=s.contextType,X=bi,typeof oe=="object"&&oe!==null&&(X=kt(oe)),k=s.getDerivedStateFromProps,(oe=typeof k=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(M!==ge||ce!==X)&&Hx(r,x,u,X),Fr=!1,ce=r.memoizedState,x.state=ce,Uo(r,u,x,y),Io();var ue=r.memoizedState;M!==ge||ce!==ue||Fr||t!==null&&t.dependencies!==null&&El(t.dependencies)?(typeof k=="function"&&(Wd(r,s,k,u),ue=r.memoizedState),(he=Fr||Lx(r,s,he,u,ce,ue,X)||t!==null&&t.dependencies!==null&&El(t.dependencies))?(oe||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(u,ue,X),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(u,ue,X)),typeof x.componentDidUpdate=="function"&&(r.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof x.componentDidUpdate!="function"||M===t.memoizedProps&&ce===t.memoizedState||(r.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||M===t.memoizedProps&&ce===t.memoizedState||(r.flags|=1024),r.memoizedProps=u,r.memoizedState=ue),x.props=u,x.state=ue,x.context=X,u=he):(typeof x.componentDidUpdate!="function"||M===t.memoizedProps&&ce===t.memoizedState||(r.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||M===t.memoizedProps&&ce===t.memoizedState||(r.flags|=1024),u=!1)}return x=u,Fl(t,r),u=(r.flags&128)!==0,x||u?(x=r.stateNode,s=u&&typeof s.getDerivedStateFromError!="function"?null:x.render(),r.flags|=1,t!==null&&u?(r.child=Aa(r,t.child,null,y),r.child=Aa(r,null,s,y)):Ot(t,r,s,y),r.memoizedState=x.state,t=r.child):t=gr(t,r,y),t}function e_(t,r,s,u){return Ca(),r.flags|=256,Ot(t,r,s,u),r.child}var Jd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ef(t){return{baseLanes:t,cachePool:F0()}}function tf(t,r,s){return t=t!==null?t.childLanes&~s:0,r&&(t|=cn),t}function t_(t,r,s){var u=r.pendingProps,y=!1,x=(r.flags&128)!==0,M;if((M=x)||(M=t!==null&&t.memoizedState===null?!1:(mt.current&2)!==0),M&&(y=!0,r.flags&=-129),M=(r.flags&32)!==0,r.flags&=-33,t===null){if(He){if(y?$r(r):Yr(),(t=ot)?(t=c1(t,bn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:Hr!==null?{id:Fn,overflow:Pn}:null,retryLane:536870912,hydrationErrors:null},s=k0(t),s.return=r,r.child=s,Dt=r,ot=null)):t=null,t===null)throw Ur(r);return Lf(t)?r.lanes=32:r.lanes=536870912,null}var k=u.children;return u=u.fallback,y?(Yr(),y=r.mode,k=Pl({mode:"hidden",children:k},y),u=Ea(u,y,s,null),k.return=r,u.return=r,k.sibling=u,r.child=k,u=r.child,u.memoizedState=ef(s),u.childLanes=tf(t,M,s),r.memoizedState=Jd,$o(null,u)):($r(r),nf(r,k))}var X=t.memoizedState;if(X!==null&&(k=X.dehydrated,k!==null)){if(x)r.flags&256?($r(r),r.flags&=-257,r=rf(t,r,s)):r.memoizedState!==null?(Yr(),r.child=t.child,r.flags|=128,r=null):(Yr(),k=u.fallback,y=r.mode,u=Pl({mode:"visible",children:u.children},y),k=Ea(k,y,s,null),k.flags|=2,u.return=r,k.return=r,u.sibling=k,r.child=u,Aa(r,t.child,null,s),u=r.child,u.memoizedState=ef(s),u.childLanes=tf(t,M,s),r.memoizedState=Jd,r=$o(null,u));else if($r(r),Lf(k)){if(M=k.nextSibling&&k.nextSibling.dataset,M)var oe=M.dgst;M=oe,u=Error(i(419)),u.stack="",u.digest=M,ko({value:u,source:null,stack:null}),r=rf(t,r,s)}else if(wt||wi(t,r,s,!1),M=(s&t.childLanes)!==0,wt||M){if(M=et,M!==null&&(u=el(M,s),u!==0&&u!==X.retryLane))throw X.retryLane=u,wa(t,u),Jt(M,t,u),Zd;Bf(k)||Jl(),r=rf(t,r,s)}else Bf(k)?(r.flags|=192,r.child=t.child,r=null):(t=X.treeContext,ot=_n(k.nextSibling),Dt=r,He=!0,Ir=null,bn=!1,t!==null&&B0(r,t),r=nf(r,u.children),r.flags|=4096);return r}return y?(Yr(),k=u.fallback,y=r.mode,X=t.child,oe=X.sibling,u=cr(X,{mode:"hidden",children:u.children}),u.subtreeFlags=X.subtreeFlags&65011712,oe!==null?k=cr(oe,k):(k=Ea(k,y,s,null),k.flags|=2),k.return=r,u.return=r,u.sibling=k,r.child=u,$o(null,u),u=r.child,k=t.child.memoizedState,k===null?k=ef(s):(y=k.cachePool,y!==null?(X=_t._currentValue,y=y.parent!==X?{parent:X,pool:X}:y):y=F0(),k={baseLanes:k.baseLanes|s,cachePool:y}),u.memoizedState=k,u.childLanes=tf(t,M,s),r.memoizedState=Jd,$o(t.child,u)):($r(r),s=t.child,t=s.sibling,s=cr(s,{mode:"visible",children:u.children}),s.return=r,s.sibling=null,t!==null&&(M=r.deletions,M===null?(r.deletions=[t],r.flags|=16):M.push(t)),r.child=s,r.memoizedState=null,s)}function nf(t,r){return r=Pl({mode:"visible",children:r},t.mode),r.return=t,t.child=r}function Pl(t,r){return t=an(22,t,null,r),t.lanes=0,t}function rf(t,r,s){return Aa(r,t.child,null,s),t=nf(r,r.pendingProps.children),t.flags|=2,r.memoizedState=null,t}function n_(t,r,s){t.lanes|=r;var u=t.alternate;u!==null&&(u.lanes|=r),yd(t.return,r,s)}function af(t,r,s,u,y,x){var M=t.memoizedState;M===null?t.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:u,tail:s,tailMode:y,treeForkCount:x}:(M.isBackwards=r,M.rendering=null,M.renderingStartTime=0,M.last=u,M.tail=s,M.tailMode=y,M.treeForkCount=x)}function r_(t,r,s){var u=r.pendingProps,y=u.revealOrder,x=u.tail;u=u.children;var M=mt.current,k=(M&2)!==0;if(k?(M=M&1|2,r.flags|=128):M&=1,ae(mt,M),Ot(t,r,u,s),u=He?Do:0,!k&&t!==null&&(t.flags&128)!==0)e:for(t=r.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&n_(t,s,r);else if(t.tag===19)n_(t,s,r);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===r)break e;for(;t.sibling===null;){if(t.return===null||t.return===r)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(y){case"forwards":for(s=r.child,y=null;s!==null;)t=s.alternate,t!==null&&zl(t)===null&&(y=s),s=s.sibling;s=y,s===null?(y=r.child,r.child=null):(y=s.sibling,s.sibling=null),af(r,!1,y,s,x,u);break;case"backwards":case"unstable_legacy-backwards":for(s=null,y=r.child,r.child=null;y!==null;){if(t=y.alternate,t!==null&&zl(t)===null){r.child=y;break}t=y.sibling,y.sibling=s,s=y,y=t}af(r,!0,s,null,x,u);break;case"together":af(r,!1,null,null,void 0,u);break;default:r.memoizedState=null}return r.child}function gr(t,r,s){if(t!==null&&(r.dependencies=t.dependencies),Kr|=r.lanes,(s&r.childLanes)===0)if(t!==null){if(wi(t,r,s,!1),(s&r.childLanes)===0)return null}else return null;if(t!==null&&r.child!==t.child)throw Error(i(153));if(r.child!==null){for(t=r.child,s=cr(t,t.pendingProps),r.child=s,s.return=r;t.sibling!==null;)t=t.sibling,s=s.sibling=cr(t,t.pendingProps),s.return=r;s.sibling=null}return r.child}function of(t,r){return(t.lanes&r)!==0?!0:(t=t.dependencies,!!(t!==null&&El(t)))}function pD(t,r,s){switch(r.tag){case 3:K(r,r.stateNode.containerInfo),Vr(r,_t,t.memoizedState.cache),Ca();break;case 27:case 5:ye(r);break;case 4:K(r,r.stateNode.containerInfo);break;case 10:Vr(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,Md(r),null;break;case 13:var u=r.memoizedState;if(u!==null)return u.dehydrated!==null?($r(r),r.flags|=128,null):(s&r.child.childLanes)!==0?t_(t,r,s):($r(r),t=gr(t,r,s),t!==null?t.sibling:null);$r(r);break;case 19:var y=(t.flags&128)!==0;if(u=(s&r.childLanes)!==0,u||(wi(t,r,s,!1),u=(s&r.childLanes)!==0),y){if(u)return r_(t,r,s);r.flags|=128}if(y=r.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),ae(mt,mt.current),u)break;return null;case 22:return r.lanes=0,Xx(t,r,s,r.pendingProps);case 24:Vr(r,_t,t.memoizedState.cache)}return gr(t,r,s)}function a_(t,r,s){if(t!==null)if(t.memoizedProps!==r.pendingProps)wt=!0;else{if(!of(t,s)&&(r.flags&128)===0)return wt=!1,pD(t,r,s);wt=(t.flags&131072)!==0}else wt=!1,He&&(r.flags&1048576)!==0&&q0(r,Do,r.index);switch(r.lanes=0,r.tag){case 16:e:{var u=r.pendingProps;if(t=Ra(r.elementType),r.type=t,typeof t=="function")ud(t)?(u=Da(t,u),r.tag=1,r=Jx(null,r,t,u,s)):(r.tag=0,r=Qd(null,r,t,u,s));else{if(t!=null){var y=t.$$typeof;if(y===N){r.tag=11,r=$x(null,r,t,u,s);break e}else if(y===j){r.tag=14,r=Yx(null,r,t,u,s);break e}}throw r=L(t)||t,Error(i(306,r,""))}}return r;case 0:return Qd(t,r,r.type,r.pendingProps,s);case 1:return u=r.type,y=Da(u,r.pendingProps),Jx(t,r,u,y,s);case 3:e:{if(K(r,r.stateNode.containerInfo),t===null)throw Error(i(387));u=r.pendingProps;var x=r.memoizedState;y=x.element,Cd(t,r),Uo(r,u,null,s);var M=r.memoizedState;if(u=M.cache,Vr(r,_t,u),u!==x.cache&&bd(r,[_t],s,!0),Io(),u=M.element,x.isDehydrated)if(x={element:u,isDehydrated:!1,cache:M.cache},r.updateQueue.baseState=x,r.memoizedState=x,r.flags&256){r=e_(t,r,u,s);break e}else if(u!==y){y=vn(Error(i(424)),r),ko(y),r=e_(t,r,u,s);break e}else{switch(t=r.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(ot=_n(t.firstChild),Dt=r,He=!0,Ir=null,bn=!0,s=X0(r,null,u,s),r.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(Ca(),u===y){r=gr(t,r,s);break e}Ot(t,r,u,s)}r=r.child}return r;case 26:return Fl(t,r),t===null?(s=g1(r.type,null,r.pendingProps,null))?r.memoizedState=s:He||(s=r.type,t=r.pendingProps,u=oc(ne.current).createElement(s),u[Nt]=r,u[It]=t,qt(u,s,t),xt(u),r.stateNode=u):r.memoizedState=g1(r.type,t.memoizedProps,r.pendingProps,t.memoizedState),null;case 27:return ye(r),t===null&&He&&(u=r.stateNode=f1(r.type,r.pendingProps,ne.current),Dt=r,bn=!0,y=ot,ta(r.type)?(Hf=y,ot=_n(u.firstChild)):ot=y),Ot(t,r,r.pendingProps.children,s),Fl(t,r),t===null&&(r.flags|=4194304),r.child;case 5:return t===null&&He&&((y=u=ot)&&(u=PD(u,r.type,r.pendingProps,bn),u!==null?(r.stateNode=u,Dt=r,ot=_n(u.firstChild),bn=!1,y=!0):y=!1),y||Ur(r)),ye(r),y=r.type,x=r.pendingProps,M=t!==null?t.memoizedProps:null,u=x.children,kf(y,x)?u=null:M!==null&&kf(y,M)&&(r.flags|=32),r.memoizedState!==null&&(y=zd(t,r,iD,null,null,s),ss._currentValue=y),Fl(t,r),Ot(t,r,u,s),r.child;case 6:return t===null&&He&&((t=s=ot)&&(s=GD(s,r.pendingProps,bn),s!==null?(r.stateNode=s,Dt=r,ot=null,t=!0):t=!1),t||Ur(r)),null;case 13:return t_(t,r,s);case 4:return K(r,r.stateNode.containerInfo),u=r.pendingProps,t===null?r.child=Aa(r,null,u,s):Ot(t,r,u,s),r.child;case 11:return $x(t,r,r.type,r.pendingProps,s);case 7:return Ot(t,r,r.pendingProps,s),r.child;case 8:return Ot(t,r,r.pendingProps.children,s),r.child;case 12:return Ot(t,r,r.pendingProps.children,s),r.child;case 10:return u=r.pendingProps,Vr(r,r.type,u.value),Ot(t,r,u.children,s),r.child;case 9:return y=r.type._context,u=r.pendingProps.children,ja(r),y=kt(y),u=u(y),r.flags|=1,Ot(t,r,u,s),r.child;case 14:return Yx(t,r,r.type,r.pendingProps,s);case 15:return Wx(t,r,r.type,r.pendingProps,s);case 19:return r_(t,r,s);case 31:return hD(t,r,s);case 22:return Xx(t,r,s,r.pendingProps);case 24:return ja(r),u=kt(_t),t===null?(y=Sd(),y===null&&(y=et,x=xd(),y.pooledCache=x,x.refCount++,x!==null&&(y.pooledCacheLanes|=s),y=x),r.memoizedState={parent:u,cache:y},Ed(r),Vr(r,_t,y)):((t.lanes&s)!==0&&(Cd(t,r),Uo(r,null,null,s),Io()),y=t.memoizedState,x=r.memoizedState,y.parent!==u?(y={parent:u,cache:u},r.memoizedState=y,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=y),Vr(r,_t,u)):(u=x.cache,Vr(r,_t,u),u!==y.cache&&bd(r,[_t],s,!0))),Ot(t,r,r.pendingProps.children,s),r.child;case 29:throw r.pendingProps}throw Error(i(156,r.tag))}function vr(t){t.flags|=4}function sf(t,r,s,u,y){if((r=(t.mode&32)!==0)&&(r=!1),r){if(t.flags|=16777216,(y&335544128)===y)if(t.stateNode.complete)t.flags|=8192;else if(A_())t.flags|=8192;else throw Ma=Nl,wd}else t.flags&=-16777217}function i_(t,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!x1(r))if(A_())t.flags|=8192;else throw Ma=Nl,wd}function Gl(t,r){r!==null&&(t.flags|=4),t.flags&16384&&(r=t.tag!==22?Zs():536870912,t.lanes|=r,Oi|=r)}function Yo(t,r){if(!He)switch(t.tailMode){case"hidden":r=t.tail;for(var s=null;r!==null;)r.alternate!==null&&(s=r),r=r.sibling;s===null?t.tail=null:s.sibling=null;break;case"collapsed":s=t.tail;for(var u=null;s!==null;)s.alternate!==null&&(u=s),s=s.sibling;u===null?r||t.tail===null?t.tail=null:t.tail.sibling=null:u.sibling=null}}function st(t){var r=t.alternate!==null&&t.alternate.child===t.child,s=0,u=0;if(r)for(var y=t.child;y!==null;)s|=y.lanes|y.childLanes,u|=y.subtreeFlags&65011712,u|=y.flags&65011712,y.return=t,y=y.sibling;else for(y=t.child;y!==null;)s|=y.lanes|y.childLanes,u|=y.subtreeFlags,u|=y.flags,y.return=t,y=y.sibling;return t.subtreeFlags|=u,t.childLanes=s,r}function gD(t,r,s){var u=r.pendingProps;switch(pd(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return st(r),null;case 1:return st(r),null;case 3:return s=r.stateNode,u=null,t!==null&&(u=t.memoizedState.cache),r.memoizedState.cache!==u&&(r.flags|=2048),fr(_t),de(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(t===null||t.child===null)&&(Si(r)?vr(r):t===null||t.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,vd())),st(r),null;case 26:var y=r.type,x=r.memoizedState;return t===null?(vr(r),x!==null?(st(r),i_(r,x)):(st(r),sf(r,y,null,u,s))):x?x!==t.memoizedState?(vr(r),st(r),i_(r,x)):(st(r),r.flags&=-16777217):(t=t.memoizedProps,t!==u&&vr(r),st(r),sf(r,y,t,u,s)),null;case 27:if(xe(r),s=ne.current,y=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==u&&vr(r);else{if(!u){if(r.stateNode===null)throw Error(i(166));return st(r),null}t=U.current,Si(r)?L0(r):(t=f1(y,u,s),r.stateNode=t,vr(r))}return st(r),null;case 5:if(xe(r),y=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==u&&vr(r);else{if(!u){if(r.stateNode===null)throw Error(i(166));return st(r),null}if(x=U.current,Si(r))L0(r);else{var M=oc(ne.current);switch(x){case 1:x=M.createElementNS("http://www.w3.org/2000/svg",y);break;case 2:x=M.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;default:switch(y){case"svg":x=M.createElementNS("http://www.w3.org/2000/svg",y);break;case"math":x=M.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;case"script":x=M.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof u.is=="string"?M.createElement("select",{is:u.is}):M.createElement("select"),u.multiple?x.multiple=!0:u.size&&(x.size=u.size);break;default:x=typeof u.is=="string"?M.createElement(y,{is:u.is}):M.createElement(y)}}x[Nt]=r,x[It]=u;e:for(M=r.child;M!==null;){if(M.tag===5||M.tag===6)x.appendChild(M.stateNode);else if(M.tag!==4&&M.tag!==27&&M.child!==null){M.child.return=M,M=M.child;continue}if(M===r)break e;for(;M.sibling===null;){if(M.return===null||M.return===r)break e;M=M.return}M.sibling.return=M.return,M=M.sibling}r.stateNode=x;e:switch(qt(x,y,u),y){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&vr(r)}}return st(r),sf(r,r.type,t===null?null:t.memoizedProps,r.pendingProps,s),null;case 6:if(t&&r.stateNode!=null)t.memoizedProps!==u&&vr(r);else{if(typeof u!="string"&&r.stateNode===null)throw Error(i(166));if(t=ne.current,Si(r)){if(t=r.stateNode,s=r.memoizedProps,u=null,y=Dt,y!==null)switch(y.tag){case 27:case 5:u=y.memoizedProps}t[Nt]=r,t=!!(t.nodeValue===s||u!==null&&u.suppressHydrationWarning===!0||t1(t.nodeValue,s)),t||Ur(r,!0)}else t=oc(t).createTextNode(u),t[Nt]=r,r.stateNode=t}return st(r),null;case 31:if(s=r.memoizedState,t===null||t.memoizedState!==null){if(u=Si(r),s!==null){if(t===null){if(!u)throw Error(i(318));if(t=r.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(i(557));t[Nt]=r}else Ca(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;st(r),t=!1}else s=vd(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=s),t=!0;if(!t)return r.flags&256?(sn(r),r):(sn(r),null);if((r.flags&128)!==0)throw Error(i(558))}return st(r),null;case 13:if(u=r.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(y=Si(r),u!==null&&u.dehydrated!==null){if(t===null){if(!y)throw Error(i(318));if(y=r.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(i(317));y[Nt]=r}else Ca(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;st(r),y=!1}else y=vd(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=y),y=!0;if(!y)return r.flags&256?(sn(r),r):(sn(r),null)}return sn(r),(r.flags&128)!==0?(r.lanes=s,r):(s=u!==null,t=t!==null&&t.memoizedState!==null,s&&(u=r.child,y=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(y=u.alternate.memoizedState.cachePool.pool),x=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(x=u.memoizedState.cachePool.pool),x!==y&&(u.flags|=2048)),s!==t&&s&&(r.child.flags|=8192),Gl(r,r.updateQueue),st(r),null);case 4:return de(),t===null&&Rf(r.stateNode.containerInfo),st(r),null;case 10:return fr(r.type),st(r),null;case 19:if(Y(mt),u=r.memoizedState,u===null)return st(r),null;if(y=(r.flags&128)!==0,x=u.rendering,x===null)if(y)Yo(u,!1);else{if(vt!==0||t!==null&&(t.flags&128)!==0)for(t=r.child;t!==null;){if(x=zl(t),x!==null){for(r.flags|=128,Yo(u,!1),t=x.updateQueue,r.updateQueue=t,Gl(r,t),r.subtreeFlags=0,t=s,s=r.child;s!==null;)D0(s,t),s=s.sibling;return ae(mt,mt.current&1|2),He&&ur(r,u.treeForkCount),r.child}t=t.sibling}u.tail!==null&&nt()>Kl&&(r.flags|=128,y=!0,Yo(u,!1),r.lanes=4194304)}else{if(!y)if(t=zl(x),t!==null){if(r.flags|=128,y=!0,t=t.updateQueue,r.updateQueue=t,Gl(r,t),Yo(u,!0),u.tail===null&&u.tailMode==="hidden"&&!x.alternate&&!He)return st(r),null}else 2*nt()-u.renderingStartTime>Kl&&s!==536870912&&(r.flags|=128,y=!0,Yo(u,!1),r.lanes=4194304);u.isBackwards?(x.sibling=r.child,r.child=x):(t=u.last,t!==null?t.sibling=x:r.child=x,u.last=x)}return u.tail!==null?(t=u.tail,u.rendering=t,u.tail=t.sibling,u.renderingStartTime=nt(),t.sibling=null,s=mt.current,ae(mt,y?s&1|2:s&1),He&&ur(r,u.treeForkCount),t):(st(r),null);case 22:case 23:return sn(r),Rd(),u=r.memoizedState!==null,t!==null?t.memoizedState!==null!==u&&(r.flags|=8192):u&&(r.flags|=8192),u?(s&536870912)!==0&&(r.flags&128)===0&&(st(r),r.subtreeFlags&6&&(r.flags|=8192)):st(r),s=r.updateQueue,s!==null&&Gl(r,s.retryQueue),s=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),u=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(u=r.memoizedState.cachePool.pool),u!==s&&(r.flags|=2048),t!==null&&Y(Na),null;case 24:return s=null,t!==null&&(s=t.memoizedState.cache),r.memoizedState.cache!==s&&(r.flags|=2048),fr(_t),st(r),null;case 25:return null;case 30:return null}throw Error(i(156,r.tag))}function vD(t,r){switch(pd(r),r.tag){case 1:return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return fr(_t),de(),t=r.flags,(t&65536)!==0&&(t&128)===0?(r.flags=t&-65537|128,r):null;case 26:case 27:case 5:return xe(r),null;case 31:if(r.memoizedState!==null){if(sn(r),r.alternate===null)throw Error(i(340));Ca()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 13:if(sn(r),t=r.memoizedState,t!==null&&t.dehydrated!==null){if(r.alternate===null)throw Error(i(340));Ca()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 19:return Y(mt),null;case 4:return de(),null;case 10:return fr(r.type),null;case 22:case 23:return sn(r),Rd(),t!==null&&Y(Na),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 24:return fr(_t),null;case 25:return null;default:return null}}function o_(t,r){switch(pd(r),r.tag){case 3:fr(_t),de();break;case 26:case 27:case 5:xe(r);break;case 4:de();break;case 31:r.memoizedState!==null&&sn(r);break;case 13:sn(r);break;case 19:Y(mt);break;case 10:fr(r.type);break;case 22:case 23:sn(r),Rd(),t!==null&&Y(Na);break;case 24:fr(_t)}}function Wo(t,r){try{var s=r.updateQueue,u=s!==null?s.lastEffect:null;if(u!==null){var y=u.next;s=y;do{if((s.tag&t)===t){u=void 0;var x=s.create,M=s.inst;u=x(),M.destroy=u}s=s.next}while(s!==y)}}catch(k){Xe(r,r.return,k)}}function Wr(t,r,s){try{var u=r.updateQueue,y=u!==null?u.lastEffect:null;if(y!==null){var x=y.next;u=x;do{if((u.tag&t)===t){var M=u.inst,k=M.destroy;if(k!==void 0){M.destroy=void 0,y=r;var X=s,oe=k;try{oe()}catch(he){Xe(y,X,he)}}}u=u.next}while(u!==x)}}catch(he){Xe(r,r.return,he)}}function s_(t){var r=t.updateQueue;if(r!==null){var s=t.stateNode;try{Z0(r,s)}catch(u){Xe(t,t.return,u)}}}function l_(t,r,s){s.props=Da(t.type,t.memoizedProps),s.state=t.memoizedState;try{s.componentWillUnmount()}catch(u){Xe(t,r,u)}}function Xo(t,r){try{var s=t.ref;if(s!==null){switch(t.tag){case 26:case 27:case 5:var u=t.stateNode;break;case 30:u=t.stateNode;break;default:u=t.stateNode}typeof s=="function"?t.refCleanup=s(u):s.current=u}}catch(y){Xe(t,r,y)}}function Gn(t,r){var s=t.ref,u=t.refCleanup;if(s!==null)if(typeof u=="function")try{u()}catch(y){Xe(t,r,y)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(y){Xe(t,r,y)}else s.current=null}function c_(t){var r=t.type,s=t.memoizedProps,u=t.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":s.autoFocus&&u.focus();break e;case"img":s.src?u.src=s.src:s.srcSet&&(u.srcset=s.srcSet)}}catch(y){Xe(t,t.return,y)}}function lf(t,r,s){try{var u=t.stateNode;LD(u,t.type,s,r),u[It]=r}catch(y){Xe(t,t.return,y)}}function u_(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&ta(t.type)||t.tag===4}function cf(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||u_(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&ta(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function uf(t,r,s){var u=t.tag;if(u===5||u===6)t=t.stateNode,r?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(t,r):(r=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,r.appendChild(t),s=s._reactRootContainer,s!=null||r.onclick!==null||(r.onclick=sr));else if(u!==4&&(u===27&&ta(t.type)&&(s=t.stateNode,r=null),t=t.child,t!==null))for(uf(t,r,s),t=t.sibling;t!==null;)uf(t,r,s),t=t.sibling}function $l(t,r,s){var u=t.tag;if(u===5||u===6)t=t.stateNode,r?s.insertBefore(t,r):s.appendChild(t);else if(u!==4&&(u===27&&ta(t.type)&&(s=t.stateNode),t=t.child,t!==null))for($l(t,r,s),t=t.sibling;t!==null;)$l(t,r,s),t=t.sibling}function d_(t){var r=t.stateNode,s=t.memoizedProps;try{for(var u=t.type,y=r.attributes;y.length;)r.removeAttributeNode(y[0]);qt(r,u,s),r[Nt]=t,r[It]=s}catch(x){Xe(t,t.return,x)}}var mr=!1,Et=!1,df=!1,f_=typeof WeakSet=="function"?WeakSet:Set,zt=null;function mD(t,r){if(t=t.containerInfo,zf=hc,t=E0(t),rd(t)){if("selectionStart"in t)var s={start:t.selectionStart,end:t.selectionEnd};else e:{s=(s=t.ownerDocument)&&s.defaultView||window;var u=s.getSelection&&s.getSelection();if(u&&u.rangeCount!==0){s=u.anchorNode;var y=u.anchorOffset,x=u.focusNode;u=u.focusOffset;try{s.nodeType,x.nodeType}catch{s=null;break e}var M=0,k=-1,X=-1,oe=0,he=0,ge=t,ce=null;t:for(;;){for(var ue;ge!==s||y!==0&&ge.nodeType!==3||(k=M+y),ge!==x||u!==0&&ge.nodeType!==3||(X=M+u),ge.nodeType===3&&(M+=ge.nodeValue.length),(ue=ge.firstChild)!==null;)ce=ge,ge=ue;for(;;){if(ge===t)break t;if(ce===s&&++oe===y&&(k=M),ce===x&&++he===u&&(X=M),(ue=ge.nextSibling)!==null)break;ge=ce,ce=ge.parentNode}ge=ue}s=k===-1||X===-1?null:{start:k,end:X}}else s=null}s=s||{start:0,end:0}}else s=null;for(Df={focusedElem:t,selectionRange:s},hc=!1,zt=r;zt!==null;)if(r=zt,t=r.child,(r.subtreeFlags&1028)!==0&&t!==null)t.return=r,zt=t;else for(;zt!==null;){switch(r=zt,x=r.alternate,t=r.flags,r.tag){case 0:if((t&4)!==0&&(t=r.updateQueue,t=t!==null?t.events:null,t!==null))for(s=0;s<t.length;s++)y=t[s],y.ref.impl=y.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&x!==null){t=void 0,s=r,y=x.memoizedProps,x=x.memoizedState,u=s.stateNode;try{var we=Da(s.type,y);t=u.getSnapshotBeforeUpdate(we,x),u.__reactInternalSnapshotBeforeUpdate=t}catch(Re){Xe(s,s.return,Re)}}break;case 3:if((t&1024)!==0){if(t=r.stateNode.containerInfo,s=t.nodeType,s===9)qf(t);else if(s===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":qf(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(i(163))}if(t=r.sibling,t!==null){t.return=r.return,zt=t;break}zt=r.return}}function h_(t,r,s){var u=s.flags;switch(s.tag){case 0:case 11:case 15:br(t,s),u&4&&Wo(5,s);break;case 1:if(br(t,s),u&4)if(t=s.stateNode,r===null)try{t.componentDidMount()}catch(M){Xe(s,s.return,M)}else{var y=Da(s.type,r.memoizedProps);r=r.memoizedState;try{t.componentDidUpdate(y,r,t.__reactInternalSnapshotBeforeUpdate)}catch(M){Xe(s,s.return,M)}}u&64&&s_(s),u&512&&Xo(s,s.return);break;case 3:if(br(t,s),u&64&&(t=s.updateQueue,t!==null)){if(r=null,s.child!==null)switch(s.child.tag){case 27:case 5:r=s.child.stateNode;break;case 1:r=s.child.stateNode}try{Z0(t,r)}catch(M){Xe(s,s.return,M)}}break;case 27:r===null&&u&4&&d_(s);case 26:case 5:br(t,s),r===null&&u&4&&c_(s),u&512&&Xo(s,s.return);break;case 12:br(t,s);break;case 31:br(t,s),u&4&&v_(t,s);break;case 13:br(t,s),u&4&&m_(t,s),u&64&&(t=s.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(s=TD.bind(null,s),$D(t,s))));break;case 22:if(u=s.memoizedState!==null||mr,!u){r=r!==null&&r.memoizedState!==null||Et,y=mr;var x=Et;mr=u,(Et=r)&&!x?xr(t,s,(s.subtreeFlags&8772)!==0):br(t,s),mr=y,Et=x}break;case 30:break;default:br(t,s)}}function p_(t){var r=t.alternate;r!==null&&(t.alternate=null,p_(r)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(r=t.stateNode,r!==null&&_o(r)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var ct=null,Xt=!1;function yr(t,r,s){for(s=s.child;s!==null;)g_(t,r,s),s=s.sibling}function g_(t,r,s){if(ht&&typeof ht.onCommitFiberUnmount=="function")try{ht.onCommitFiberUnmount(Ht,s)}catch{}switch(s.tag){case 26:Et||Gn(s,r),yr(t,r,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Et||Gn(s,r);var u=ct,y=Xt;ta(s.type)&&(ct=s.stateNode,Xt=!1),yr(t,r,s),as(s.stateNode),ct=u,Xt=y;break;case 5:Et||Gn(s,r);case 6:if(u=ct,y=Xt,ct=null,yr(t,r,s),ct=u,Xt=y,ct!==null)if(Xt)try{(ct.nodeType===9?ct.body:ct.nodeName==="HTML"?ct.ownerDocument.body:ct).removeChild(s.stateNode)}catch(x){Xe(s,r,x)}else try{ct.removeChild(s.stateNode)}catch(x){Xe(s,r,x)}break;case 18:ct!==null&&(Xt?(t=ct,s1(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,s.stateNode),Fi(t)):s1(ct,s.stateNode));break;case 4:u=ct,y=Xt,ct=s.stateNode.containerInfo,Xt=!0,yr(t,r,s),ct=u,Xt=y;break;case 0:case 11:case 14:case 15:Wr(2,s,r),Et||Wr(4,s,r),yr(t,r,s);break;case 1:Et||(Gn(s,r),u=s.stateNode,typeof u.componentWillUnmount=="function"&&l_(s,r,u)),yr(t,r,s);break;case 21:yr(t,r,s);break;case 22:Et=(u=Et)||s.memoizedState!==null,yr(t,r,s),Et=u;break;default:yr(t,r,s)}}function v_(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Fi(t)}catch(s){Xe(r,r.return,s)}}}function m_(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Fi(t)}catch(s){Xe(r,r.return,s)}}function yD(t){switch(t.tag){case 31:case 13:case 19:var r=t.stateNode;return r===null&&(r=t.stateNode=new f_),r;case 22:return t=t.stateNode,r=t._retryCache,r===null&&(r=t._retryCache=new f_),r;default:throw Error(i(435,t.tag))}}function Yl(t,r){var s=yD(t);r.forEach(function(u){if(!s.has(u)){s.add(u);var y=jD.bind(null,t,u);u.then(y,y)}})}function Kt(t,r){var s=r.deletions;if(s!==null)for(var u=0;u<s.length;u++){var y=s[u],x=t,M=r,k=M;e:for(;k!==null;){switch(k.tag){case 27:if(ta(k.type)){ct=k.stateNode,Xt=!1;break e}break;case 5:ct=k.stateNode,Xt=!1;break e;case 3:case 4:ct=k.stateNode.containerInfo,Xt=!0;break e}k=k.return}if(ct===null)throw Error(i(160));g_(x,M,y),ct=null,Xt=!1,x=y.alternate,x!==null&&(x.return=null),y.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)y_(r,t),r=r.sibling}var An=null;function y_(t,r){var s=t.alternate,u=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Kt(r,t),Zt(t),u&4&&(Wr(3,t,t.return),Wo(3,t),Wr(5,t,t.return));break;case 1:Kt(r,t),Zt(t),u&512&&(Et||s===null||Gn(s,s.return)),u&64&&mr&&(t=t.updateQueue,t!==null&&(u=t.callbacks,u!==null&&(s=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=s===null?u:s.concat(u))));break;case 26:var y=An;if(Kt(r,t),Zt(t),u&512&&(Et||s===null||Gn(s,s.return)),u&4){var x=s!==null?s.memoizedState:null;if(u=t.memoizedState,s===null)if(u===null)if(t.stateNode===null){e:{u=t.type,s=t.memoizedProps,y=y.ownerDocument||y;t:switch(u){case"title":x=y.getElementsByTagName("title")[0],(!x||x[ba]||x[Nt]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=y.createElement(u),y.head.insertBefore(x,y.querySelector("head > title"))),qt(x,u,s),x[Nt]=t,xt(x),u=x;break e;case"link":var M=y1("link","href",y).get(u+(s.href||""));if(M){for(var k=0;k<M.length;k++)if(x=M[k],x.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&x.getAttribute("rel")===(s.rel==null?null:s.rel)&&x.getAttribute("title")===(s.title==null?null:s.title)&&x.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){M.splice(k,1);break t}}x=y.createElement(u),qt(x,u,s),y.head.appendChild(x);break;case"meta":if(M=y1("meta","content",y).get(u+(s.content||""))){for(k=0;k<M.length;k++)if(x=M[k],x.getAttribute("content")===(s.content==null?null:""+s.content)&&x.getAttribute("name")===(s.name==null?null:s.name)&&x.getAttribute("property")===(s.property==null?null:s.property)&&x.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&x.getAttribute("charset")===(s.charSet==null?null:s.charSet)){M.splice(k,1);break t}}x=y.createElement(u),qt(x,u,s),y.head.appendChild(x);break;default:throw Error(i(468,u))}x[Nt]=t,xt(x),u=x}t.stateNode=u}else b1(y,t.type,t.stateNode);else t.stateNode=m1(y,u,t.memoizedProps);else x!==u?(x===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):x.count--,u===null?b1(y,t.type,t.stateNode):m1(y,u,t.memoizedProps)):u===null&&t.stateNode!==null&&lf(t,t.memoizedProps,s.memoizedProps)}break;case 27:Kt(r,t),Zt(t),u&512&&(Et||s===null||Gn(s,s.return)),s!==null&&u&4&&lf(t,t.memoizedProps,s.memoizedProps);break;case 5:if(Kt(r,t),Zt(t),u&512&&(Et||s===null||Gn(s,s.return)),t.flags&32){y=t.stateNode;try{fi(y,"")}catch(we){Xe(t,t.return,we)}}u&4&&t.stateNode!=null&&(y=t.memoizedProps,lf(t,y,s!==null?s.memoizedProps:y)),u&1024&&(df=!0);break;case 6:if(Kt(r,t),Zt(t),u&4){if(t.stateNode===null)throw Error(i(162));u=t.memoizedProps,s=t.stateNode;try{s.nodeValue=u}catch(we){Xe(t,t.return,we)}}break;case 3:if(cc=null,y=An,An=sc(r.containerInfo),Kt(r,t),An=y,Zt(t),u&4&&s!==null&&s.memoizedState.isDehydrated)try{Fi(r.containerInfo)}catch(we){Xe(t,t.return,we)}df&&(df=!1,b_(t));break;case 4:u=An,An=sc(t.stateNode.containerInfo),Kt(r,t),Zt(t),An=u;break;case 12:Kt(r,t),Zt(t);break;case 31:Kt(r,t),Zt(t),u&4&&(u=t.updateQueue,u!==null&&(t.updateQueue=null,Yl(t,u)));break;case 13:Kt(r,t),Zt(t),t.child.flags&8192&&t.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(Xl=nt()),u&4&&(u=t.updateQueue,u!==null&&(t.updateQueue=null,Yl(t,u)));break;case 22:y=t.memoizedState!==null;var X=s!==null&&s.memoizedState!==null,oe=mr,he=Et;if(mr=oe||y,Et=he||X,Kt(r,t),Et=he,mr=oe,Zt(t),u&8192)e:for(r=t.stateNode,r._visibility=y?r._visibility&-2:r._visibility|1,y&&(s===null||X||mr||Et||ka(t)),s=null,r=t;;){if(r.tag===5||r.tag===26){if(s===null){X=s=r;try{if(x=X.stateNode,y)M=x.style,typeof M.setProperty=="function"?M.setProperty("display","none","important"):M.display="none";else{k=X.stateNode;var ge=X.memoizedProps.style,ce=ge!=null&&ge.hasOwnProperty("display")?ge.display:null;k.style.display=ce==null||typeof ce=="boolean"?"":(""+ce).trim()}}catch(we){Xe(X,X.return,we)}}}else if(r.tag===6){if(s===null){X=r;try{X.stateNode.nodeValue=y?"":X.memoizedProps}catch(we){Xe(X,X.return,we)}}}else if(r.tag===18){if(s===null){X=r;try{var ue=X.stateNode;y?l1(ue,!0):l1(X.stateNode,!1)}catch(we){Xe(X,X.return,we)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===t)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break e;for(;r.sibling===null;){if(r.return===null||r.return===t)break e;s===r&&(s=null),r=r.return}s===r&&(s=null),r.sibling.return=r.return,r=r.sibling}u&4&&(u=t.updateQueue,u!==null&&(s=u.retryQueue,s!==null&&(u.retryQueue=null,Yl(t,s))));break;case 19:Kt(r,t),Zt(t),u&4&&(u=t.updateQueue,u!==null&&(t.updateQueue=null,Yl(t,u)));break;case 30:break;case 21:break;default:Kt(r,t),Zt(t)}}function Zt(t){var r=t.flags;if(r&2){try{for(var s,u=t.return;u!==null;){if(u_(u)){s=u;break}u=u.return}if(s==null)throw Error(i(160));switch(s.tag){case 27:var y=s.stateNode,x=cf(t);$l(t,x,y);break;case 5:var M=s.stateNode;s.flags&32&&(fi(M,""),s.flags&=-33);var k=cf(t);$l(t,k,M);break;case 3:case 4:var X=s.stateNode.containerInfo,oe=cf(t);uf(t,oe,X);break;default:throw Error(i(161))}}catch(he){Xe(t,t.return,he)}t.flags&=-3}r&4096&&(t.flags&=-4097)}function b_(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var r=t;b_(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),t=t.sibling}}function br(t,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)h_(t,r.alternate,r),r=r.sibling}function ka(t){for(t=t.child;t!==null;){var r=t;switch(r.tag){case 0:case 11:case 14:case 15:Wr(4,r,r.return),ka(r);break;case 1:Gn(r,r.return);var s=r.stateNode;typeof s.componentWillUnmount=="function"&&l_(r,r.return,s),ka(r);break;case 27:as(r.stateNode);case 26:case 5:Gn(r,r.return),ka(r);break;case 22:r.memoizedState===null&&ka(r);break;case 30:ka(r);break;default:ka(r)}t=t.sibling}}function xr(t,r,s){for(s=s&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var u=r.alternate,y=t,x=r,M=x.flags;switch(x.tag){case 0:case 11:case 15:xr(y,x,s),Wo(4,x);break;case 1:if(xr(y,x,s),u=x,y=u.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(oe){Xe(u,u.return,oe)}if(u=x,y=u.updateQueue,y!==null){var k=u.stateNode;try{var X=y.shared.hiddenCallbacks;if(X!==null)for(y.shared.hiddenCallbacks=null,y=0;y<X.length;y++)K0(X[y],k)}catch(oe){Xe(u,u.return,oe)}}s&&M&64&&s_(x),Xo(x,x.return);break;case 27:d_(x);case 26:case 5:xr(y,x,s),s&&u===null&&M&4&&c_(x),Xo(x,x.return);break;case 12:xr(y,x,s);break;case 31:xr(y,x,s),s&&M&4&&v_(y,x);break;case 13:xr(y,x,s),s&&M&4&&m_(y,x);break;case 22:x.memoizedState===null&&xr(y,x,s),Xo(x,x.return);break;case 30:break;default:xr(y,x,s)}r=r.sibling}}function ff(t,r){var s=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),t=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(t=r.memoizedState.cachePool.pool),t!==s&&(t!=null&&t.refCount++,s!=null&&Oo(s))}function hf(t,r){t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&Oo(t))}function zn(t,r,s,u){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)x_(t,r,s,u),r=r.sibling}function x_(t,r,s,u){var y=r.flags;switch(r.tag){case 0:case 11:case 15:zn(t,r,s,u),y&2048&&Wo(9,r);break;case 1:zn(t,r,s,u);break;case 3:zn(t,r,s,u),y&2048&&(t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&Oo(t)));break;case 12:if(y&2048){zn(t,r,s,u),t=r.stateNode;try{var x=r.memoizedProps,M=x.id,k=x.onPostCommit;typeof k=="function"&&k(M,r.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(X){Xe(r,r.return,X)}}else zn(t,r,s,u);break;case 31:zn(t,r,s,u);break;case 13:zn(t,r,s,u);break;case 23:break;case 22:x=r.stateNode,M=r.alternate,r.memoizedState!==null?x._visibility&2?zn(t,r,s,u):Ko(t,r):x._visibility&2?zn(t,r,s,u):(x._visibility|=2,zi(t,r,s,u,(r.subtreeFlags&10256)!==0||!1)),y&2048&&ff(M,r);break;case 24:zn(t,r,s,u),y&2048&&hf(r.alternate,r);break;default:zn(t,r,s,u)}}function zi(t,r,s,u,y){for(y=y&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var x=t,M=r,k=s,X=u,oe=M.flags;switch(M.tag){case 0:case 11:case 15:zi(x,M,k,X,y),Wo(8,M);break;case 23:break;case 22:var he=M.stateNode;M.memoizedState!==null?he._visibility&2?zi(x,M,k,X,y):Ko(x,M):(he._visibility|=2,zi(x,M,k,X,y)),y&&oe&2048&&ff(M.alternate,M);break;case 24:zi(x,M,k,X,y),y&&oe&2048&&hf(M.alternate,M);break;default:zi(x,M,k,X,y)}r=r.sibling}}function Ko(t,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var s=t,u=r,y=u.flags;switch(u.tag){case 22:Ko(s,u),y&2048&&ff(u.alternate,u);break;case 24:Ko(s,u),y&2048&&hf(u.alternate,u);break;default:Ko(s,u)}r=r.sibling}}var Zo=8192;function Di(t,r,s){if(t.subtreeFlags&Zo)for(t=t.child;t!==null;)__(t,r,s),t=t.sibling}function __(t,r,s){switch(t.tag){case 26:Di(t,r,s),t.flags&Zo&&t.memoizedState!==null&&a3(s,An,t.memoizedState,t.memoizedProps);break;case 5:Di(t,r,s);break;case 3:case 4:var u=An;An=sc(t.stateNode.containerInfo),Di(t,r,s),An=u;break;case 22:t.memoizedState===null&&(u=t.alternate,u!==null&&u.memoizedState!==null?(u=Zo,Zo=16777216,Di(t,r,s),Zo=u):Di(t,r,s));break;default:Di(t,r,s)}}function S_(t){var r=t.alternate;if(r!==null&&(t=r.child,t!==null)){r.child=null;do r=t.sibling,t.sibling=null,t=r;while(t!==null)}}function Qo(t){var r=t.deletions;if((t.flags&16)!==0){if(r!==null)for(var s=0;s<r.length;s++){var u=r[s];zt=u,E_(u,t)}S_(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)w_(t),t=t.sibling}function w_(t){switch(t.tag){case 0:case 11:case 15:Qo(t),t.flags&2048&&Wr(9,t,t.return);break;case 3:Qo(t);break;case 12:Qo(t);break;case 22:var r=t.stateNode;t.memoizedState!==null&&r._visibility&2&&(t.return===null||t.return.tag!==13)?(r._visibility&=-3,Wl(t)):Qo(t);break;default:Qo(t)}}function Wl(t){var r=t.deletions;if((t.flags&16)!==0){if(r!==null)for(var s=0;s<r.length;s++){var u=r[s];zt=u,E_(u,t)}S_(t)}for(t=t.child;t!==null;){switch(r=t,r.tag){case 0:case 11:case 15:Wr(8,r,r.return),Wl(r);break;case 22:s=r.stateNode,s._visibility&2&&(s._visibility&=-3,Wl(r));break;default:Wl(r)}t=t.sibling}}function E_(t,r){for(;zt!==null;){var s=zt;switch(s.tag){case 0:case 11:case 15:Wr(8,s,r);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var u=s.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:Oo(s.memoizedState.cache)}if(u=s.child,u!==null)u.return=s,zt=u;else e:for(s=t;zt!==null;){u=zt;var y=u.sibling,x=u.return;if(p_(u),u===s){zt=null;break e}if(y!==null){y.return=x,zt=y;break e}zt=x}}}var bD={getCacheForType:function(t){var r=kt(_t),s=r.data.get(t);return s===void 0&&(s=t(),r.data.set(t,s)),s},cacheSignal:function(){return kt(_t).controller.signal}},xD=typeof WeakMap=="function"?WeakMap:Map,$e=0,et=null,ke=null,Be=0,We=0,ln=null,Xr=!1,ki=!1,pf=!1,_r=0,vt=0,Kr=0,Oa=0,gf=0,cn=0,Oi=0,Jo=null,Qt=null,vf=!1,Xl=0,C_=0,Kl=1/0,Zl=null,Zr=null,Rt=0,Qr=null,qi=null,Sr=0,mf=0,yf=null,T_=null,es=0,bf=null;function un(){return($e&2)!==0&&Be!==0?Be&-Be:O.T!==null?Cf():tl()}function j_(){if(cn===0)if((Be&536870912)===0||He){var t=ni;ni<<=1,(ni&3932160)===0&&(ni=262144),cn=t}else cn=536870912;return t=on.current,t!==null&&(t.flags|=32),cn}function Jt(t,r,s){(t===et&&(We===2||We===9)||t.cancelPendingCommit!==null)&&(Bi(t,0),Jr(t,Be,cn,!1)),ya(t,s),(($e&2)===0||t!==et)&&(t===et&&(($e&2)===0&&(Oa|=s),vt===4&&Jr(t,Be,cn,!1)),$n(t))}function N_(t,r,s){if(($e&6)!==0)throw Error(i(327));var u=!s&&(r&127)===0&&(r&t.expiredLanes)===0||zr(t,r),y=u?wD(t,r):_f(t,r,!0),x=u;do{if(y===0){ki&&!u&&Jr(t,r,0,!1);break}else{if(s=t.current.alternate,x&&!_D(s)){y=_f(t,r,!1),x=!1;continue}if(y===2){if(x=r,t.errorRecoveryDisabledLanes&x)var M=0;else M=t.pendingLanes&-536870913,M=M!==0?M:M&536870912?536870912:0;if(M!==0){r=M;e:{var k=t;y=Jo;var X=k.current.memoizedState.isDehydrated;if(X&&(Bi(k,M).flags|=256),M=_f(k,M,!1),M!==2){if(pf&&!X){k.errorRecoveryDisabledLanes|=x,Oa|=x,y=4;break e}x=Qt,Qt=y,x!==null&&(Qt===null?Qt=x:Qt.push.apply(Qt,x))}y=M}if(x=!1,y!==2)continue}}if(y===1){Bi(t,0),Jr(t,r,0,!0);break}e:{switch(u=t,x=y,x){case 0:case 1:throw Error(i(345));case 4:if((r&4194048)!==r)break;case 6:Jr(u,r,cn,!Xr);break e;case 2:Qt=null;break;case 3:case 5:break;default:throw Error(i(329))}if((r&62914560)===r&&(y=Xl+300-nt(),10<y)){if(Jr(u,r,cn,!Xr),ai(u,0,!0)!==0)break e;Sr=r,u.timeoutHandle=i1(R_.bind(null,u,s,Qt,Zl,vf,r,cn,Oa,Oi,Xr,x,"Throttled",-0,0),y);break e}R_(u,s,Qt,Zl,vf,r,cn,Oa,Oi,Xr,x,null,-0,0)}}break}while(!0);$n(t)}function R_(t,r,s,u,y,x,M,k,X,oe,he,ge,ce,ue){if(t.timeoutHandle=-1,ge=r.subtreeFlags,ge&8192||(ge&16785408)===16785408){ge={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:sr},__(r,x,ge);var we=(x&62914560)===x?Xl-nt():(x&4194048)===x?C_-nt():0;if(we=i3(ge,we),we!==null){Sr=x,t.cancelPendingCommit=we(B_.bind(null,t,r,x,s,u,y,M,k,X,he,ge,null,ce,ue)),Jr(t,x,M,!oe);return}}B_(t,r,x,s,u,y,M,k,X)}function _D(t){for(var r=t;;){var s=r.tag;if((s===0||s===11||s===15)&&r.flags&16384&&(s=r.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var u=0;u<s.length;u++){var y=s[u],x=y.getSnapshot;y=y.value;try{if(!rn(x(),y))return!1}catch{return!1}}if(s=r.child,r.subtreeFlags&16384&&s!==null)s.return=r,r=s;else{if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function Jr(t,r,s,u){r&=~gf,r&=~Oa,t.suspendedLanes|=r,t.pingedLanes&=~r,u&&(t.warmLanes|=r),u=t.expirationTimes;for(var y=r;0<y;){var x=31-Pt(y),M=1<<x;u[x]=-1,y&=~M}s!==0&&Qs(t,s,r)}function Ql(){return($e&6)===0?(ts(0),!1):!0}function xf(){if(ke!==null){if(We===0)var t=ke.return;else t=ke,dr=Ta=null,Od(t),ji=null,Bo=0,t=ke;for(;t!==null;)o_(t.alternate,t),t=t.return;ke=null}}function Bi(t,r){var s=t.timeoutHandle;s!==-1&&(t.timeoutHandle=-1,UD(s)),s=t.cancelPendingCommit,s!==null&&(t.cancelPendingCommit=null,s()),Sr=0,xf(),et=t,ke=s=cr(t.current,null),Be=r,We=0,ln=null,Xr=!1,ki=zr(t,r),pf=!1,Oi=cn=gf=Oa=Kr=vt=0,Qt=Jo=null,vf=!1,(r&8)!==0&&(r|=r&32);var u=t.entangledLanes;if(u!==0)for(t=t.entanglements,u&=r;0<u;){var y=31-Pt(u),x=1<<y;r|=t[y],u&=~x}return _r=r,bl(),s}function M_(t,r){ze=null,O.H=Go,r===Ti||r===jl?(r=$0(),We=3):r===wd?(r=$0(),We=4):We=r===Zd?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,ln=r,ke===null&&(vt=1,Ul(t,vn(r,t.current)))}function A_(){var t=on.current;return t===null?!0:(Be&4194048)===Be?xn===null:(Be&62914560)===Be||(Be&536870912)!==0?t===xn:!1}function z_(){var t=O.H;return O.H=Go,t===null?Go:t}function D_(){var t=O.A;return O.A=bD,t}function Jl(){vt=4,Xr||(Be&4194048)!==Be&&on.current!==null||(ki=!0),(Kr&134217727)===0&&(Oa&134217727)===0||et===null||Jr(et,Be,cn,!1)}function _f(t,r,s){var u=$e;$e|=2;var y=z_(),x=D_();(et!==t||Be!==r)&&(Zl=null,Bi(t,r)),r=!1;var M=vt;e:do try{if(We!==0&&ke!==null){var k=ke,X=ln;switch(We){case 8:xf(),M=6;break e;case 3:case 2:case 9:case 6:on.current===null&&(r=!0);var oe=We;if(We=0,ln=null,Li(t,k,X,oe),s&&ki){M=0;break e}break;default:oe=We,We=0,ln=null,Li(t,k,X,oe)}}SD(),M=vt;break}catch(he){M_(t,he)}while(!0);return r&&t.shellSuspendCounter++,dr=Ta=null,$e=u,O.H=y,O.A=x,ke===null&&(et=null,Be=0,bl()),M}function SD(){for(;ke!==null;)k_(ke)}function wD(t,r){var s=$e;$e|=2;var u=z_(),y=D_();et!==t||Be!==r?(Zl=null,Kl=nt()+500,Bi(t,r)):ki=zr(t,r);e:do try{if(We!==0&&ke!==null){r=ke;var x=ln;t:switch(We){case 1:We=0,ln=null,Li(t,r,x,1);break;case 2:case 9:if(P0(x)){We=0,ln=null,O_(r);break}r=function(){We!==2&&We!==9||et!==t||(We=7),$n(t)},x.then(r,r);break e;case 3:We=7;break e;case 4:We=5;break e;case 7:P0(x)?(We=0,ln=null,O_(r)):(We=0,ln=null,Li(t,r,x,7));break;case 5:var M=null;switch(ke.tag){case 26:M=ke.memoizedState;case 5:case 27:var k=ke;if(M?x1(M):k.stateNode.complete){We=0,ln=null;var X=k.sibling;if(X!==null)ke=X;else{var oe=k.return;oe!==null?(ke=oe,ec(oe)):ke=null}break t}}We=0,ln=null,Li(t,r,x,5);break;case 6:We=0,ln=null,Li(t,r,x,6);break;case 8:xf(),vt=6;break e;default:throw Error(i(462))}}ED();break}catch(he){M_(t,he)}while(!0);return dr=Ta=null,O.H=u,O.A=y,$e=s,ke!==null?0:(et=null,Be=0,bl(),vt)}function ED(){for(;ke!==null&&!lt();)k_(ke)}function k_(t){var r=a_(t.alternate,t,_r);t.memoizedProps=t.pendingProps,r===null?ec(t):ke=r}function O_(t){var r=t,s=r.alternate;switch(r.tag){case 15:case 0:r=Qx(s,r,r.pendingProps,r.type,void 0,Be);break;case 11:r=Qx(s,r,r.pendingProps,r.type.render,r.ref,Be);break;case 5:Od(r);default:o_(s,r),r=ke=D0(r,_r),r=a_(s,r,_r)}t.memoizedProps=t.pendingProps,r===null?ec(t):ke=r}function Li(t,r,s,u){dr=Ta=null,Od(r),ji=null,Bo=0;var y=r.return;try{if(fD(t,y,r,s,Be)){vt=1,Ul(t,vn(s,t.current)),ke=null;return}}catch(x){if(y!==null)throw ke=y,x;vt=1,Ul(t,vn(s,t.current)),ke=null;return}r.flags&32768?(He||u===1?t=!0:ki||(Be&536870912)!==0?t=!1:(Xr=t=!0,(u===2||u===9||u===3||u===6)&&(u=on.current,u!==null&&u.tag===13&&(u.flags|=16384))),q_(r,t)):ec(r)}function ec(t){var r=t;do{if((r.flags&32768)!==0){q_(r,Xr);return}t=r.return;var s=gD(r.alternate,r,_r);if(s!==null){ke=s;return}if(r=r.sibling,r!==null){ke=r;return}ke=r=t}while(r!==null);vt===0&&(vt=5)}function q_(t,r){do{var s=vD(t.alternate,t);if(s!==null){s.flags&=32767,ke=s;return}if(s=t.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!r&&(t=t.sibling,t!==null)){ke=t;return}ke=t=s}while(t!==null);vt=6,ke=null}function B_(t,r,s,u,y,x,M,k,X){t.cancelPendingCommit=null;do tc();while(Rt!==0);if(($e&6)!==0)throw Error(i(327));if(r!==null){if(r===t.current)throw Error(i(177));if(x=r.lanes|r.childLanes,x|=ld,Lu(t,s,x,M,k,X),t===et&&(ke=et=null,Be=0),qi=r,Qr=t,Sr=s,mf=x,yf=y,T_=u,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,ND(Lt,function(){return V_(),null})):(t.callbackNode=null,t.callbackPriority=0),u=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||u){u=O.T,O.T=null,y=F.p,F.p=2,M=$e,$e|=4;try{mD(t,r,s)}finally{$e=M,F.p=y,O.T=u}}Rt=1,L_(),H_(),I_()}}function L_(){if(Rt===1){Rt=0;var t=Qr,r=qi,s=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||s){s=O.T,O.T=null;var u=F.p;F.p=2;var y=$e;$e|=4;try{y_(r,t);var x=Df,M=E0(t.containerInfo),k=x.focusedElem,X=x.selectionRange;if(M!==k&&k&&k.ownerDocument&&w0(k.ownerDocument.documentElement,k)){if(X!==null&&rd(k)){var oe=X.start,he=X.end;if(he===void 0&&(he=oe),"selectionStart"in k)k.selectionStart=oe,k.selectionEnd=Math.min(he,k.value.length);else{var ge=k.ownerDocument||document,ce=ge&&ge.defaultView||window;if(ce.getSelection){var ue=ce.getSelection(),we=k.textContent.length,Re=Math.min(X.start,we),Je=X.end===void 0?Re:Math.min(X.end,we);!ue.extend&&Re>Je&&(M=Je,Je=Re,Re=M);var ee=S0(k,Re),Q=S0(k,Je);if(ee&&Q&&(ue.rangeCount!==1||ue.anchorNode!==ee.node||ue.anchorOffset!==ee.offset||ue.focusNode!==Q.node||ue.focusOffset!==Q.offset)){var ie=ge.createRange();ie.setStart(ee.node,ee.offset),ue.removeAllRanges(),Re>Je?(ue.addRange(ie),ue.extend(Q.node,Q.offset)):(ie.setEnd(Q.node,Q.offset),ue.addRange(ie))}}}}for(ge=[],ue=k;ue=ue.parentNode;)ue.nodeType===1&&ge.push({element:ue,left:ue.scrollLeft,top:ue.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;k<ge.length;k++){var pe=ge[k];pe.element.scrollLeft=pe.left,pe.element.scrollTop=pe.top}}hc=!!zf,Df=zf=null}finally{$e=y,F.p=u,O.T=s}}t.current=r,Rt=2}}function H_(){if(Rt===2){Rt=0;var t=Qr,r=qi,s=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||s){s=O.T,O.T=null;var u=F.p;F.p=2;var y=$e;$e|=4;try{h_(t,r.alternate,r)}finally{$e=y,F.p=u,O.T=s}}Rt=3}}function I_(){if(Rt===4||Rt===3){Rt=0,tt();var t=Qr,r=qi,s=Sr,u=T_;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?Rt=5:(Rt=0,qi=Qr=null,U_(t,t.pendingLanes));var y=t.pendingLanes;if(y===0&&(Zr=null),xo(s),r=r.stateNode,ht&&typeof ht.onCommitFiberRoot=="function")try{ht.onCommitFiberRoot(Ht,r,void 0,(r.current.flags&128)===128)}catch{}if(u!==null){r=O.T,y=F.p,F.p=2,O.T=null;try{for(var x=t.onRecoverableError,M=0;M<u.length;M++){var k=u[M];x(k.value,{componentStack:k.stack})}}finally{O.T=r,F.p=y}}(Sr&3)!==0&&tc(),$n(t),y=t.pendingLanes,(s&261930)!==0&&(y&42)!==0?t===bf?es++:(es=0,bf=t):es=0,ts(0)}}function U_(t,r){(t.pooledCacheLanes&=r)===0&&(r=t.pooledCache,r!=null&&(t.pooledCache=null,Oo(r)))}function tc(){return L_(),H_(),I_(),V_()}function V_(){if(Rt!==5)return!1;var t=Qr,r=mf;mf=0;var s=xo(Sr),u=O.T,y=F.p;try{F.p=32>s?32:s,O.T=null,s=yf,yf=null;var x=Qr,M=Sr;if(Rt=0,qi=Qr=null,Sr=0,($e&6)!==0)throw Error(i(331));var k=$e;if($e|=4,w_(x.current),x_(x,x.current,M,s),$e=k,ts(0,!1),ht&&typeof ht.onPostCommitFiberRoot=="function")try{ht.onPostCommitFiberRoot(Ht,x)}catch{}return!0}finally{F.p=y,O.T=u,U_(t,r)}}function F_(t,r,s){r=vn(s,r),r=Kd(t.stateNode,r,2),t=Gr(t,r,2),t!==null&&(ya(t,2),$n(t))}function Xe(t,r,s){if(t.tag===3)F_(t,t,s);else for(;r!==null;){if(r.tag===3){F_(r,t,s);break}else if(r.tag===1){var u=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(Zr===null||!Zr.has(u))){t=vn(s,t),s=Px(2),u=Gr(r,s,2),u!==null&&(Gx(s,u,r,t),ya(u,2),$n(u));break}}r=r.return}}function Sf(t,r,s){var u=t.pingCache;if(u===null){u=t.pingCache=new xD;var y=new Set;u.set(r,y)}else y=u.get(r),y===void 0&&(y=new Set,u.set(r,y));y.has(s)||(pf=!0,y.add(s),t=CD.bind(null,t,r,s),r.then(t,t))}function CD(t,r,s){var u=t.pingCache;u!==null&&u.delete(r),t.pingedLanes|=t.suspendedLanes&s,t.warmLanes&=~s,et===t&&(Be&s)===s&&(vt===4||vt===3&&(Be&62914560)===Be&&300>nt()-Xl?($e&2)===0&&Bi(t,0):gf|=s,Oi===Be&&(Oi=0)),$n(t)}function P_(t,r){r===0&&(r=Zs()),t=wa(t,r),t!==null&&(ya(t,r),$n(t))}function TD(t){var r=t.memoizedState,s=0;r!==null&&(s=r.retryLane),P_(t,s)}function jD(t,r){var s=0;switch(t.tag){case 31:case 13:var u=t.stateNode,y=t.memoizedState;y!==null&&(s=y.retryLane);break;case 19:u=t.stateNode;break;case 22:u=t.stateNode._retryCache;break;default:throw Error(i(314))}u!==null&&u.delete(r),P_(t,s)}function ND(t,r){return Ve(t,r)}var nc=null,Hi=null,wf=!1,rc=!1,Ef=!1,ea=0;function $n(t){t!==Hi&&t.next===null&&(Hi===null?nc=Hi=t:Hi=Hi.next=t),rc=!0,wf||(wf=!0,MD())}function ts(t,r){if(!Ef&&rc){Ef=!0;do for(var s=!1,u=nc;u!==null;){if(t!==0){var y=u.pendingLanes;if(y===0)var x=0;else{var M=u.suspendedLanes,k=u.pingedLanes;x=(1<<31-Pt(42|t)+1)-1,x&=y&~(M&~k),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(s=!0,W_(u,x))}else x=Be,x=ai(u,u===et?x:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(x&3)===0||zr(u,x)||(s=!0,W_(u,x));u=u.next}while(s);Ef=!1}}function RD(){G_()}function G_(){rc=wf=!1;var t=0;ea!==0&&ID()&&(t=ea);for(var r=nt(),s=null,u=nc;u!==null;){var y=u.next,x=$_(u,r);x===0?(u.next=null,s===null?nc=y:s.next=y,y===null&&(Hi=s)):(s=u,(t!==0||(x&3)!==0)&&(rc=!0)),u=y}Rt!==0&&Rt!==5||ts(t),ea!==0&&(ea=0)}function $_(t,r){for(var s=t.suspendedLanes,u=t.pingedLanes,y=t.expirationTimes,x=t.pendingLanes&-62914561;0<x;){var M=31-Pt(x),k=1<<M,X=y[M];X===-1?((k&s)===0||(k&u)!==0)&&(y[M]=Bu(k,r)):X<=r&&(t.expiredLanes|=k),x&=~k}if(r=et,s=Be,s=ai(t,t===r?s:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),u=t.callbackNode,s===0||t===r&&(We===2||We===9)||t.cancelPendingCommit!==null)return u!==null&&u!==null&&qe(u),t.callbackNode=null,t.callbackPriority=0;if((s&3)===0||zr(t,s)){if(r=s&-s,r===t.callbackPriority)return r;switch(u!==null&&qe(u),xo(s)){case 2:case 8:s=At;break;case 32:s=Lt;break;case 268435456:s=rr;break;default:s=Lt}return u=Y_.bind(null,t),s=Ve(s,u),t.callbackPriority=r,t.callbackNode=s,r}return u!==null&&u!==null&&qe(u),t.callbackPriority=2,t.callbackNode=null,2}function Y_(t,r){if(Rt!==0&&Rt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var s=t.callbackNode;if(tc()&&t.callbackNode!==s)return null;var u=Be;return u=ai(t,t===et?u:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),u===0?null:(N_(t,u,r),$_(t,nt()),t.callbackNode!=null&&t.callbackNode===s?Y_.bind(null,t):null)}function W_(t,r){if(tc())return null;N_(t,r,!0)}function MD(){VD(function(){($e&6)!==0?Ve($t,RD):G_()})}function Cf(){if(ea===0){var t=Ei;t===0&&(t=ti,ti<<=1,(ti&261888)===0&&(ti=256)),ea=t}return ea}function X_(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:dl(""+t)}function K_(t,r){var s=r.ownerDocument.createElement("input");return s.name=r.name,s.value=r.value,t.id&&s.setAttribute("form",t.id),r.parentNode.insertBefore(s,r),t=new FormData(t),s.parentNode.removeChild(s),t}function AD(t,r,s,u,y){if(r==="submit"&&s&&s.stateNode===y){var x=X_((y[It]||null).action),M=u.submitter;M&&(r=(r=M[It]||null)?X_(r.formAction):M.getAttribute("formAction"),r!==null&&(x=r,M=null));var k=new gl("action","action",null,u,y);t.push({event:k,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(ea!==0){var X=M?K_(y,M):new FormData(y);Pd(s,{pending:!0,data:X,method:y.method,action:x},null,X)}}else typeof x=="function"&&(k.preventDefault(),X=M?K_(y,M):new FormData(y),Pd(s,{pending:!0,data:X,method:y.method,action:x},x,X))},currentTarget:y}]})}}for(var Tf=0;Tf<sd.length;Tf++){var jf=sd[Tf],zD=jf.toLowerCase(),DD=jf[0].toUpperCase()+jf.slice(1);Mn(zD,"on"+DD)}Mn(j0,"onAnimationEnd"),Mn(N0,"onAnimationIteration"),Mn(R0,"onAnimationStart"),Mn("dblclick","onDoubleClick"),Mn("focusin","onFocus"),Mn("focusout","onBlur"),Mn(Xz,"onTransitionRun"),Mn(Kz,"onTransitionStart"),Mn(Zz,"onTransitionCancel"),Mn(M0,"onTransitionEnd"),Br("onMouseEnter",["mouseout","mouseover"]),Br("onMouseLeave",["mouseout","mouseover"]),Br("onPointerEnter",["pointerout","pointerover"]),Br("onPointerLeave",["pointerout","pointerover"]),or("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),or("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),or("onBeforeInput",["compositionend","keypress","textInput","paste"]),or("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),or("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),or("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ns="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),kD=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ns));function Z_(t,r){r=(r&4)!==0;for(var s=0;s<t.length;s++){var u=t[s],y=u.event;u=u.listeners;e:{var x=void 0;if(r)for(var M=u.length-1;0<=M;M--){var k=u[M],X=k.instance,oe=k.currentTarget;if(k=k.listener,X!==x&&y.isPropagationStopped())break e;x=k,y.currentTarget=oe;try{x(y)}catch(he){yl(he)}y.currentTarget=null,x=X}else for(M=0;M<u.length;M++){if(k=u[M],X=k.instance,oe=k.currentTarget,k=k.listener,X!==x&&y.isPropagationStopped())break e;x=k,y.currentTarget=oe;try{x(y)}catch(he){yl(he)}y.currentTarget=null,x=X}}}}function Oe(t,r){var s=r[ii];s===void 0&&(s=r[ii]=new Set);var u=t+"__bubble";s.has(u)||(Q_(r,t,2,!1),s.add(u))}function Nf(t,r,s){var u=0;r&&(u|=4),Q_(s,t,u,r)}var ac="_reactListening"+Math.random().toString(36).slice(2);function Rf(t){if(!t[ac]){t[ac]=!0,il.forEach(function(s){s!=="selectionchange"&&(kD.has(s)||Nf(s,!1,t),Nf(s,!0,t))});var r=t.nodeType===9?t:t.ownerDocument;r===null||r[ac]||(r[ac]=!0,Nf("selectionchange",!1,r))}}function Q_(t,r,s,u){switch(j1(r)){case 2:var y=l3;break;case 8:y=c3;break;default:y=Pf}s=y.bind(null,r,s,t),y=void 0,!Wu||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(y=!0),u?y!==void 0?t.addEventListener(r,s,{capture:!0,passive:y}):t.addEventListener(r,s,!0):y!==void 0?t.addEventListener(r,s,{passive:y}):t.addEventListener(r,s,!1)}function Mf(t,r,s,u,y){var x=u;if((r&1)===0&&(r&2)===0&&u!==null)e:for(;;){if(u===null)return;var M=u.tag;if(M===3||M===4){var k=u.stateNode.containerInfo;if(k===y)break;if(M===4)for(M=u.return;M!==null;){var X=M.tag;if((X===3||X===4)&&M.stateNode.containerInfo===y)return;M=M.return}for(;k!==null;){if(M=Dr(k),M===null)return;if(X=M.tag,X===5||X===6||X===26||X===27){u=x=M;continue e}k=k.parentNode}}u=u.return}r0(function(){var oe=x,he=$u(s),ge=[];e:{var ce=A0.get(t);if(ce!==void 0){var ue=gl,we=t;switch(t){case"keypress":if(hl(s)===0)break e;case"keydown":case"keyup":ue=jz;break;case"focusin":we="focus",ue=Qu;break;case"focusout":we="blur",ue=Qu;break;case"beforeblur":case"afterblur":ue=Qu;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ue=o0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ue=gz;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ue=Mz;break;case j0:case N0:case R0:ue=yz;break;case M0:ue=zz;break;case"scroll":case"scrollend":ue=hz;break;case"wheel":ue=kz;break;case"copy":case"cut":case"paste":ue=xz;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ue=l0;break;case"toggle":case"beforetoggle":ue=qz}var Re=(r&4)!==0,Je=!Re&&(t==="scroll"||t==="scrollend"),ee=Re?ce!==null?ce+"Capture":null:ce;Re=[];for(var Q=oe,ie;Q!==null;){var pe=Q;if(ie=pe.stateNode,pe=pe.tag,pe!==5&&pe!==26&&pe!==27||ie===null||ee===null||(pe=Eo(Q,ee),pe!=null&&Re.push(rs(Q,pe,ie))),Je)break;Q=Q.return}0<Re.length&&(ce=new ue(ce,we,null,s,he),ge.push({event:ce,listeners:Re}))}}if((r&7)===0){e:{if(ce=t==="mouseover"||t==="pointerover",ue=t==="mouseout"||t==="pointerout",ce&&s!==Gu&&(we=s.relatedTarget||s.fromElement)&&(Dr(we)||we[ir]))break e;if((ue||ce)&&(ce=he.window===he?he:(ce=he.ownerDocument)?ce.defaultView||ce.parentWindow:window,ue?(we=s.relatedTarget||s.toElement,ue=oe,we=we?Dr(we):null,we!==null&&(Je=l(we),Re=we.tag,we!==Je||Re!==5&&Re!==27&&Re!==6)&&(we=null)):(ue=null,we=oe),ue!==we)){if(Re=o0,pe="onMouseLeave",ee="onMouseEnter",Q="mouse",(t==="pointerout"||t==="pointerover")&&(Re=l0,pe="onPointerLeave",ee="onPointerEnter",Q="pointer"),Je=ue==null?ce:Or(ue),ie=we==null?ce:Or(we),ce=new Re(pe,Q+"leave",ue,s,he),ce.target=Je,ce.relatedTarget=ie,pe=null,Dr(he)===oe&&(Re=new Re(ee,Q+"enter",we,s,he),Re.target=ie,Re.relatedTarget=Je,pe=Re),Je=pe,ue&&we)t:{for(Re=OD,ee=ue,Q=we,ie=0,pe=ee;pe;pe=Re(pe))ie++;pe=0;for(var Ne=Q;Ne;Ne=Re(Ne))pe++;for(;0<ie-pe;)ee=Re(ee),ie--;for(;0<pe-ie;)Q=Re(Q),pe--;for(;ie--;){if(ee===Q||Q!==null&&ee===Q.alternate){Re=ee;break t}ee=Re(ee),Q=Re(Q)}Re=null}else Re=null;ue!==null&&J_(ge,ce,ue,Re,!1),we!==null&&Je!==null&&J_(ge,Je,we,Re,!0)}}e:{if(ce=oe?Or(oe):window,ue=ce.nodeName&&ce.nodeName.toLowerCase(),ue==="select"||ue==="input"&&ce.type==="file")var Fe=v0;else if(p0(ce))if(m0)Fe=$z;else{Fe=Pz;var Ce=Fz}else ue=ce.nodeName,!ue||ue.toLowerCase()!=="input"||ce.type!=="checkbox"&&ce.type!=="radio"?oe&&Pu(oe.elementType)&&(Fe=v0):Fe=Gz;if(Fe&&(Fe=Fe(t,oe))){g0(ge,Fe,s,he);break e}Ce&&Ce(t,ce,oe),t==="focusout"&&oe&&ce.type==="number"&&oe.memoizedProps.value!=null&&ui(ce,"number",ce.value)}switch(Ce=oe?Or(oe):window,t){case"focusin":(p0(Ce)||Ce.contentEditable==="true")&&(vi=Ce,ad=oe,zo=null);break;case"focusout":zo=ad=vi=null;break;case"mousedown":id=!0;break;case"contextmenu":case"mouseup":case"dragend":id=!1,C0(ge,s,he);break;case"selectionchange":if(Wz)break;case"keydown":case"keyup":C0(ge,s,he)}var De;if(ed)e:{switch(t){case"compositionstart":var Le="onCompositionStart";break e;case"compositionend":Le="onCompositionEnd";break e;case"compositionupdate":Le="onCompositionUpdate";break e}Le=void 0}else gi?f0(t,s)&&(Le="onCompositionEnd"):t==="keydown"&&s.keyCode===229&&(Le="onCompositionStart");Le&&(c0&&s.locale!=="ko"&&(gi||Le!=="onCompositionStart"?Le==="onCompositionEnd"&&gi&&(De=a0()):(Lr=he,Xu="value"in Lr?Lr.value:Lr.textContent,gi=!0)),Ce=ic(oe,Le),0<Ce.length&&(Le=new s0(Le,t,null,s,he),ge.push({event:Le,listeners:Ce}),De?Le.data=De:(De=h0(s),De!==null&&(Le.data=De)))),(De=Lz?Hz(t,s):Iz(t,s))&&(Le=ic(oe,"onBeforeInput"),0<Le.length&&(Ce=new s0("onBeforeInput","beforeinput",null,s,he),ge.push({event:Ce,listeners:Le}),Ce.data=De)),AD(ge,t,oe,s,he)}Z_(ge,r)})}function rs(t,r,s){return{instance:t,listener:r,currentTarget:s}}function ic(t,r){for(var s=r+"Capture",u=[];t!==null;){var y=t,x=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||x===null||(y=Eo(t,s),y!=null&&u.unshift(rs(t,y,x)),y=Eo(t,r),y!=null&&u.push(rs(t,y,x))),t.tag===3)return u;t=t.return}return[]}function OD(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function J_(t,r,s,u,y){for(var x=r._reactName,M=[];s!==null&&s!==u;){var k=s,X=k.alternate,oe=k.stateNode;if(k=k.tag,X!==null&&X===u)break;k!==5&&k!==26&&k!==27||oe===null||(X=oe,y?(oe=Eo(s,x),oe!=null&&M.unshift(rs(s,oe,X))):y||(oe=Eo(s,x),oe!=null&&M.push(rs(s,oe,X)))),s=s.return}M.length!==0&&t.push({event:r,listeners:M})}var qD=/\r\n?/g,BD=/\u0000|\uFFFD/g;function e1(t){return(typeof t=="string"?t:""+t).replace(qD,`
`).replace(BD,"")}function t1(t,r){return r=e1(r),e1(t)===r}function Qe(t,r,s,u,y,x){switch(s){case"children":typeof u=="string"?r==="body"||r==="textarea"&&u===""||fi(t,u):(typeof u=="number"||typeof u=="bigint")&&r!=="body"&&fi(t,""+u);break;case"className":si(t,"class",u);break;case"tabIndex":si(t,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":si(t,s,u);break;case"style":t0(t,u,x);break;case"data":if(r!=="object"){si(t,"data",u);break}case"src":case"href":if(u===""&&(r!=="a"||s!=="href")){t.removeAttribute(s);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){t.removeAttribute(s);break}u=dl(""+u),t.setAttribute(s,u);break;case"action":case"formAction":if(typeof u=="function"){t.setAttribute(s,"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"&&(s==="formAction"?(r!=="input"&&Qe(t,r,"name",y.name,y,null),Qe(t,r,"formEncType",y.formEncType,y,null),Qe(t,r,"formMethod",y.formMethod,y,null),Qe(t,r,"formTarget",y.formTarget,y,null)):(Qe(t,r,"encType",y.encType,y,null),Qe(t,r,"method",y.method,y,null),Qe(t,r,"target",y.target,y,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){t.removeAttribute(s);break}u=dl(""+u),t.setAttribute(s,u);break;case"onClick":u!=null&&(t.onclick=sr);break;case"onScroll":u!=null&&Oe("scroll",t);break;case"onScrollEnd":u!=null&&Oe("scrollend",t);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(i(61));if(s=u.__html,s!=null){if(y.children!=null)throw Error(i(60));t.innerHTML=s}}break;case"multiple":t.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":t.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){t.removeAttribute("xlink:href");break}s=dl(""+u),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(s,""+u):t.removeAttribute(s);break;case"inert":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":u&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(s,""):t.removeAttribute(s);break;case"capture":case"download":u===!0?t.setAttribute(s,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(s,u):t.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?t.setAttribute(s,u):t.removeAttribute(s);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?t.removeAttribute(s):t.setAttribute(s,u);break;case"popover":Oe("beforetoggle",t),Oe("toggle",t),oi(t,"popover",u);break;case"xlinkActuate":Rn(t,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":Rn(t,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":Rn(t,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":Rn(t,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":Rn(t,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":Rn(t,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":Rn(t,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":Rn(t,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":Rn(t,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":oi(t,"is",u);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=dz.get(s)||s,oi(t,s,u))}}function Af(t,r,s,u,y,x){switch(s){case"style":t0(t,u,x);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(i(61));if(s=u.__html,s!=null){if(y.children!=null)throw Error(i(60));t.innerHTML=s}}break;case"children":typeof u=="string"?fi(t,u):(typeof u=="number"||typeof u=="bigint")&&fi(t,""+u);break;case"onScroll":u!=null&&Oe("scroll",t);break;case"onScrollEnd":u!=null&&Oe("scrollend",t);break;case"onClick":u!=null&&(t.onclick=sr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ol.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(y=s.endsWith("Capture"),r=s.slice(2,y?s.length-7:void 0),x=t[It]||null,x=x!=null?x[s]:null,typeof x=="function"&&t.removeEventListener(r,x,y),typeof u=="function")){typeof x!="function"&&x!==null&&(s in t?t[s]=null:t.hasAttribute(s)&&t.removeAttribute(s)),t.addEventListener(r,u,y);break e}s in t?t[s]=u:u===!0?t.setAttribute(s,""):oi(t,s,u)}}}function qt(t,r,s){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Oe("error",t),Oe("load",t);var u=!1,y=!1,x;for(x in s)if(s.hasOwnProperty(x)){var M=s[x];if(M!=null)switch(x){case"src":u=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,r));default:Qe(t,r,x,M,s,null)}}y&&Qe(t,r,"srcSet",s.srcSet,s,null),u&&Qe(t,r,"src",s.src,s,null);return;case"input":Oe("invalid",t);var k=x=M=y=null,X=null,oe=null;for(u in s)if(s.hasOwnProperty(u)){var he=s[u];if(he!=null)switch(u){case"name":y=he;break;case"type":M=he;break;case"checked":X=he;break;case"defaultChecked":oe=he;break;case"value":x=he;break;case"defaultValue":k=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(i(137,r));break;default:Qe(t,r,u,he,s,null)}}ul(t,x,k,X,oe,M,y,!1);return;case"select":Oe("invalid",t),u=M=x=null;for(y in s)if(s.hasOwnProperty(y)&&(k=s[y],k!=null))switch(y){case"value":x=k;break;case"defaultValue":M=k;break;case"multiple":u=k;default:Qe(t,r,y,k,s,null)}r=x,s=M,t.multiple=!!u,r!=null?di(t,!!u,r,!1):s!=null&&di(t,!!u,s,!0);return;case"textarea":Oe("invalid",t),x=y=u=null;for(M in s)if(s.hasOwnProperty(M)&&(k=s[M],k!=null))switch(M){case"value":u=k;break;case"defaultValue":y=k;break;case"children":x=k;break;case"dangerouslySetInnerHTML":if(k!=null)throw Error(i(91));break;default:Qe(t,r,M,k,s,null)}Jb(t,u,y,x);return;case"option":for(X in s)if(s.hasOwnProperty(X)&&(u=s[X],u!=null))switch(X){case"selected":t.selected=u&&typeof u!="function"&&typeof u!="symbol";break;default:Qe(t,r,X,u,s,null)}return;case"dialog":Oe("beforetoggle",t),Oe("toggle",t),Oe("cancel",t),Oe("close",t);break;case"iframe":case"object":Oe("load",t);break;case"video":case"audio":for(u=0;u<ns.length;u++)Oe(ns[u],t);break;case"image":Oe("error",t),Oe("load",t);break;case"details":Oe("toggle",t);break;case"embed":case"source":case"link":Oe("error",t),Oe("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(oe in s)if(s.hasOwnProperty(oe)&&(u=s[oe],u!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,r));default:Qe(t,r,oe,u,s,null)}return;default:if(Pu(r)){for(he in s)s.hasOwnProperty(he)&&(u=s[he],u!==void 0&&Af(t,r,he,u,s,void 0));return}}for(k in s)s.hasOwnProperty(k)&&(u=s[k],u!=null&&Qe(t,r,k,u,s,null))}function LD(t,r,s,u){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,x=null,M=null,k=null,X=null,oe=null,he=null;for(ue in s){var ge=s[ue];if(s.hasOwnProperty(ue)&&ge!=null)switch(ue){case"checked":break;case"value":break;case"defaultValue":X=ge;default:u.hasOwnProperty(ue)||Qe(t,r,ue,null,u,ge)}}for(var ce in u){var ue=u[ce];if(ge=s[ce],u.hasOwnProperty(ce)&&(ue!=null||ge!=null))switch(ce){case"type":x=ue;break;case"name":y=ue;break;case"checked":oe=ue;break;case"defaultChecked":he=ue;break;case"value":M=ue;break;case"defaultValue":k=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(i(137,r));break;default:ue!==ge&&Qe(t,r,ce,ue,u,ge)}}wo(t,M,k,X,oe,he,x,y);return;case"select":ue=M=k=ce=null;for(x in s)if(X=s[x],s.hasOwnProperty(x)&&X!=null)switch(x){case"value":break;case"multiple":ue=X;default:u.hasOwnProperty(x)||Qe(t,r,x,null,u,X)}for(y in u)if(x=u[y],X=s[y],u.hasOwnProperty(y)&&(x!=null||X!=null))switch(y){case"value":ce=x;break;case"defaultValue":k=x;break;case"multiple":M=x;default:x!==X&&Qe(t,r,y,x,u,X)}r=k,s=M,u=ue,ce!=null?di(t,!!s,ce,!1):!!u!=!!s&&(r!=null?di(t,!!s,r,!0):di(t,!!s,s?[]:"",!1));return;case"textarea":ue=ce=null;for(k in s)if(y=s[k],s.hasOwnProperty(k)&&y!=null&&!u.hasOwnProperty(k))switch(k){case"value":break;case"children":break;default:Qe(t,r,k,null,u,y)}for(M in u)if(y=u[M],x=s[M],u.hasOwnProperty(M)&&(y!=null||x!=null))switch(M){case"value":ce=y;break;case"defaultValue":ue=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(i(91));break;default:y!==x&&Qe(t,r,M,y,u,x)}Qb(t,ce,ue);return;case"option":for(var we in s)if(ce=s[we],s.hasOwnProperty(we)&&ce!=null&&!u.hasOwnProperty(we))switch(we){case"selected":t.selected=!1;break;default:Qe(t,r,we,null,u,ce)}for(X in u)if(ce=u[X],ue=s[X],u.hasOwnProperty(X)&&ce!==ue&&(ce!=null||ue!=null))switch(X){case"selected":t.selected=ce&&typeof ce!="function"&&typeof ce!="symbol";break;default:Qe(t,r,X,ce,u,ue)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Re in s)ce=s[Re],s.hasOwnProperty(Re)&&ce!=null&&!u.hasOwnProperty(Re)&&Qe(t,r,Re,null,u,ce);for(oe in u)if(ce=u[oe],ue=s[oe],u.hasOwnProperty(oe)&&ce!==ue&&(ce!=null||ue!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(i(137,r));break;default:Qe(t,r,oe,ce,u,ue)}return;default:if(Pu(r)){for(var Je in s)ce=s[Je],s.hasOwnProperty(Je)&&ce!==void 0&&!u.hasOwnProperty(Je)&&Af(t,r,Je,void 0,u,ce);for(he in u)ce=u[he],ue=s[he],!u.hasOwnProperty(he)||ce===ue||ce===void 0&&ue===void 0||Af(t,r,he,ce,u,ue);return}}for(var ee in s)ce=s[ee],s.hasOwnProperty(ee)&&ce!=null&&!u.hasOwnProperty(ee)&&Qe(t,r,ee,null,u,ce);for(ge in u)ce=u[ge],ue=s[ge],!u.hasOwnProperty(ge)||ce===ue||ce==null&&ue==null||Qe(t,r,ge,ce,u,ue)}function n1(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function HD(){if(typeof performance.getEntriesByType=="function"){for(var t=0,r=0,s=performance.getEntriesByType("resource"),u=0;u<s.length;u++){var y=s[u],x=y.transferSize,M=y.initiatorType,k=y.duration;if(x&&k&&n1(M)){for(M=0,k=y.responseEnd,u+=1;u<s.length;u++){var X=s[u],oe=X.startTime;if(oe>k)break;var he=X.transferSize,ge=X.initiatorType;he&&n1(ge)&&(X=X.responseEnd,M+=he*(X<k?1:(k-oe)/(X-oe)))}if(--u,r+=8*(x+M)/(y.duration/1e3),t++,10<t)break}}if(0<t)return r/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var zf=null,Df=null;function oc(t){return t.nodeType===9?t:t.ownerDocument}function r1(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function a1(t,r){if(t===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&r==="foreignObject"?0:t}function kf(t,r){return t==="textarea"||t==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var Of=null;function ID(){var t=window.event;return t&&t.type==="popstate"?t===Of?!1:(Of=t,!0):(Of=null,!1)}var i1=typeof setTimeout=="function"?setTimeout:void 0,UD=typeof clearTimeout=="function"?clearTimeout:void 0,o1=typeof Promise=="function"?Promise:void 0,VD=typeof queueMicrotask=="function"?queueMicrotask:typeof o1<"u"?function(t){return o1.resolve(null).then(t).catch(FD)}:i1;function FD(t){setTimeout(function(){throw t})}function ta(t){return t==="head"}function s1(t,r){var s=r,u=0;do{var y=s.nextSibling;if(t.removeChild(s),y&&y.nodeType===8)if(s=y.data,s==="/$"||s==="/&"){if(u===0){t.removeChild(y),Fi(r);return}u--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")u++;else if(s==="html")as(t.ownerDocument.documentElement);else if(s==="head"){s=t.ownerDocument.head,as(s);for(var x=s.firstChild;x;){var M=x.nextSibling,k=x.nodeName;x[ba]||k==="SCRIPT"||k==="STYLE"||k==="LINK"&&x.rel.toLowerCase()==="stylesheet"||s.removeChild(x),x=M}}else s==="body"&&as(t.ownerDocument.body);s=y}while(s);Fi(r)}function l1(t,r){var s=t;t=0;do{var u=s.nextSibling;if(s.nodeType===1?r?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(r?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),u&&u.nodeType===8)if(s=u.data,s==="/$"){if(t===0)break;t--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||t++;s=u}while(s)}function qf(t){var r=t.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var s=r;switch(r=r.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":qf(s),_o(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}t.removeChild(s)}}function PD(t,r,s,u){for(;t.nodeType===1;){var y=s;if(t.nodeName.toLowerCase()!==r.toLowerCase()){if(!u&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(u){if(!t[ba])switch(r){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(x=t.getAttribute("rel"),x==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(x!==y.rel||t.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||t.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||t.getAttribute("title")!==(y.title==null?null:y.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(x=t.getAttribute("src"),(x!==(y.src==null?null:y.src)||t.getAttribute("type")!==(y.type==null?null:y.type)||t.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&x&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(r==="input"&&t.type==="hidden"){var x=y.name==null?null:""+y.name;if(y.type==="hidden"&&t.getAttribute("name")===x)return t}else return t;if(t=_n(t.nextSibling),t===null)break}return null}function GD(t,r,s){if(r==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!s||(t=_n(t.nextSibling),t===null))return null;return t}function c1(t,r){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!r||(t=_n(t.nextSibling),t===null))return null;return t}function Bf(t){return t.data==="$?"||t.data==="$~"}function Lf(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function $D(t,r){var s=t.ownerDocument;if(t.data==="$~")t._reactRetry=r;else if(t.data!=="$?"||s.readyState!=="loading")r();else{var u=function(){r(),s.removeEventListener("DOMContentLoaded",u)};s.addEventListener("DOMContentLoaded",u),t._reactRetry=u}}function _n(t){for(;t!=null;t=t.nextSibling){var r=t.nodeType;if(r===1||r===3)break;if(r===8){if(r=t.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return t}var Hf=null;function u1(t){t=t.nextSibling;for(var r=0;t;){if(t.nodeType===8){var s=t.data;if(s==="/$"||s==="/&"){if(r===0)return _n(t.nextSibling);r--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||r++}t=t.nextSibling}return null}function d1(t){t=t.previousSibling;for(var r=0;t;){if(t.nodeType===8){var s=t.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(r===0)return t;r--}else s!=="/$"&&s!=="/&"||r++}t=t.previousSibling}return null}function f1(t,r,s){switch(r=oc(s),t){case"html":if(t=r.documentElement,!t)throw Error(i(452));return t;case"head":if(t=r.head,!t)throw Error(i(453));return t;case"body":if(t=r.body,!t)throw Error(i(454));return t;default:throw Error(i(451))}}function as(t){for(var r=t.attributes;r.length;)t.removeAttributeNode(r[0]);_o(t)}var Sn=new Map,h1=new Set;function sc(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var wr=F.d;F.d={f:YD,r:WD,D:XD,C:KD,L:ZD,m:QD,X:e3,S:JD,M:t3};function YD(){var t=wr.f(),r=Ql();return t||r}function WD(t){var r=kr(t);r!==null&&r.tag===5&&r.type==="form"?Mx(r):wr.r(t)}var Ii=typeof document>"u"?null:document;function p1(t,r,s){var u=Ii;if(u&&typeof r=="string"&&r){var y=Ut(r);y='link[rel="'+t+'"][href="'+y+'"]',typeof s=="string"&&(y+='[crossorigin="'+s+'"]'),h1.has(y)||(h1.add(y),t={rel:t,crossOrigin:s,href:r},u.querySelector(y)===null&&(r=u.createElement("link"),qt(r,"link",t),xt(r),u.head.appendChild(r)))}}function XD(t){wr.D(t),p1("dns-prefetch",t,null)}function KD(t,r){wr.C(t,r),p1("preconnect",t,r)}function ZD(t,r,s){wr.L(t,r,s);var u=Ii;if(u&&t&&r){var y='link[rel="preload"][as="'+Ut(r)+'"]';r==="image"&&s&&s.imageSrcSet?(y+='[imagesrcset="'+Ut(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(y+='[imagesizes="'+Ut(s.imageSizes)+'"]')):y+='[href="'+Ut(t)+'"]';var x=y;switch(r){case"style":x=Ui(t);break;case"script":x=Vi(t)}Sn.has(x)||(t=v({rel:"preload",href:r==="image"&&s&&s.imageSrcSet?void 0:t,as:r},s),Sn.set(x,t),u.querySelector(y)!==null||r==="style"&&u.querySelector(is(x))||r==="script"&&u.querySelector(os(x))||(r=u.createElement("link"),qt(r,"link",t),xt(r),u.head.appendChild(r)))}}function QD(t,r){wr.m(t,r);var s=Ii;if(s&&t){var u=r&&typeof r.as=="string"?r.as:"script",y='link[rel="modulepreload"][as="'+Ut(u)+'"][href="'+Ut(t)+'"]',x=y;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=Vi(t)}if(!Sn.has(x)&&(t=v({rel:"modulepreload",href:t},r),Sn.set(x,t),s.querySelector(y)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(os(x)))return}u=s.createElement("link"),qt(u,"link",t),xt(u),s.head.appendChild(u)}}}function JD(t,r,s){wr.S(t,r,s);var u=Ii;if(u&&t){var y=qr(u).hoistableStyles,x=Ui(t);r=r||"default";var M=y.get(x);if(!M){var k={loading:0,preload:null};if(M=u.querySelector(is(x)))k.loading=5;else{t=v({rel:"stylesheet",href:t,"data-precedence":r},s),(s=Sn.get(x))&&If(t,s);var X=M=u.createElement("link");xt(X),qt(X,"link",t),X._p=new Promise(function(oe,he){X.onload=oe,X.onerror=he}),X.addEventListener("load",function(){k.loading|=1}),X.addEventListener("error",function(){k.loading|=2}),k.loading|=4,lc(M,r,u)}M={type:"stylesheet",instance:M,count:1,state:k},y.set(x,M)}}}function e3(t,r){wr.X(t,r);var s=Ii;if(s&&t){var u=qr(s).hoistableScripts,y=Vi(t),x=u.get(y);x||(x=s.querySelector(os(y)),x||(t=v({src:t,async:!0},r),(r=Sn.get(y))&&Uf(t,r),x=s.createElement("script"),xt(x),qt(x,"link",t),s.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},u.set(y,x))}}function t3(t,r){wr.M(t,r);var s=Ii;if(s&&t){var u=qr(s).hoistableScripts,y=Vi(t),x=u.get(y);x||(x=s.querySelector(os(y)),x||(t=v({src:t,async:!0,type:"module"},r),(r=Sn.get(y))&&Uf(t,r),x=s.createElement("script"),xt(x),qt(x,"link",t),s.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},u.set(y,x))}}function g1(t,r,s,u){var y=(y=ne.current)?sc(y):null;if(!y)throw Error(i(446));switch(t){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(r=Ui(s.href),s=qr(y).hoistableStyles,u=s.get(r),u||(u={type:"style",instance:null,count:0,state:null},s.set(r,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){t=Ui(s.href);var x=qr(y).hoistableStyles,M=x.get(t);if(M||(y=y.ownerDocument||y,M={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(t,M),(x=y.querySelector(is(t)))&&!x._p&&(M.instance=x,M.state.loading=5),Sn.has(t)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},Sn.set(t,s),x||n3(y,t,s,M.state))),r&&u===null)throw Error(i(528,""));return M}if(r&&u!==null)throw Error(i(529,""));return null;case"script":return r=s.async,s=s.src,typeof s=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=Vi(s),s=qr(y).hoistableScripts,u=s.get(r),u||(u={type:"script",instance:null,count:0,state:null},s.set(r,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,t))}}function Ui(t){return'href="'+Ut(t)+'"'}function is(t){return'link[rel="stylesheet"]['+t+"]"}function v1(t){return v({},t,{"data-precedence":t.precedence,precedence:null})}function n3(t,r,s,u){t.querySelector('link[rel="preload"][as="style"]['+r+"]")?u.loading=1:(r=t.createElement("link"),u.preload=r,r.addEventListener("load",function(){return u.loading|=1}),r.addEventListener("error",function(){return u.loading|=2}),qt(r,"link",s),xt(r),t.head.appendChild(r))}function Vi(t){return'[src="'+Ut(t)+'"]'}function os(t){return"script[async]"+t}function m1(t,r,s){if(r.count++,r.instance===null)switch(r.type){case"style":var u=t.querySelector('style[data-href~="'+Ut(s.href)+'"]');if(u)return r.instance=u,xt(u),u;var y=v({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return u=(t.ownerDocument||t).createElement("style"),xt(u),qt(u,"style",y),lc(u,s.precedence,t),r.instance=u;case"stylesheet":y=Ui(s.href);var x=t.querySelector(is(y));if(x)return r.state.loading|=4,r.instance=x,xt(x),x;u=v1(s),(y=Sn.get(y))&&If(u,y),x=(t.ownerDocument||t).createElement("link"),xt(x);var M=x;return M._p=new Promise(function(k,X){M.onload=k,M.onerror=X}),qt(x,"link",u),r.state.loading|=4,lc(x,s.precedence,t),r.instance=x;case"script":return x=Vi(s.src),(y=t.querySelector(os(x)))?(r.instance=y,xt(y),y):(u=s,(y=Sn.get(x))&&(u=v({},s),Uf(u,y)),t=t.ownerDocument||t,y=t.createElement("script"),xt(y),qt(y,"link",u),t.head.appendChild(y),r.instance=y);case"void":return null;default:throw Error(i(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(u=r.instance,r.state.loading|=4,lc(u,s.precedence,t));return r.instance}function lc(t,r,s){for(var u=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=u.length?u[u.length-1]:null,x=y,M=0;M<u.length;M++){var k=u[M];if(k.dataset.precedence===r)x=k;else if(x!==y)break}x?x.parentNode.insertBefore(t,x.nextSibling):(r=s.nodeType===9?s.head:s,r.insertBefore(t,r.firstChild))}function If(t,r){t.crossOrigin==null&&(t.crossOrigin=r.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=r.referrerPolicy),t.title==null&&(t.title=r.title)}function Uf(t,r){t.crossOrigin==null&&(t.crossOrigin=r.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=r.referrerPolicy),t.integrity==null&&(t.integrity=r.integrity)}var cc=null;function y1(t,r,s){if(cc===null){var u=new Map,y=cc=new Map;y.set(s,u)}else y=cc,u=y.get(s),u||(u=new Map,y.set(s,u));if(u.has(t))return u;for(u.set(t,null),s=s.getElementsByTagName(t),y=0;y<s.length;y++){var x=s[y];if(!(x[ba]||x[Nt]||t==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var M=x.getAttribute(r)||"";M=t+M;var k=u.get(M);k?k.push(x):u.set(M,[x])}}return u}function b1(t,r,s){t=t.ownerDocument||t,t.head.insertBefore(s,r==="title"?t.querySelector("head > title"):null)}function r3(t,r,s){if(s===1||r.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;switch(r.rel){case"stylesheet":return t=r.disabled,typeof r.precedence=="string"&&t==null;default:return!0}case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function x1(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function a3(t,r,s,u){if(s.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var y=Ui(u.href),x=r.querySelector(is(y));if(x){r=x._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(t.count++,t=uc.bind(t),r.then(t,t)),s.state.loading|=4,s.instance=x,xt(x);return}x=r.ownerDocument||r,u=v1(u),(y=Sn.get(y))&&If(u,y),x=x.createElement("link"),xt(x);var M=x;M._p=new Promise(function(k,X){M.onload=k,M.onerror=X}),qt(x,"link",u),s.instance=x}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(s,r),(r=s.state.preload)&&(s.state.loading&3)===0&&(t.count++,s=uc.bind(t),r.addEventListener("load",s),r.addEventListener("error",s))}}var Vf=0;function i3(t,r){return t.stylesheets&&t.count===0&&fc(t,t.stylesheets),0<t.count||0<t.imgCount?function(s){var u=setTimeout(function(){if(t.stylesheets&&fc(t,t.stylesheets),t.unsuspend){var x=t.unsuspend;t.unsuspend=null,x()}},6e4+r);0<t.imgBytes&&Vf===0&&(Vf=62500*HD());var y=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&fc(t,t.stylesheets),t.unsuspend)){var x=t.unsuspend;t.unsuspend=null,x()}},(t.imgBytes>Vf?50:800)+r);return t.unsuspend=s,function(){t.unsuspend=null,clearTimeout(u),clearTimeout(y)}}:null}function uc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)fc(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var dc=null;function fc(t,r){t.stylesheets=null,t.unsuspend!==null&&(t.count++,dc=new Map,r.forEach(o3,t),dc=null,uc.call(t))}function o3(t,r){if(!(r.state.loading&4)){var s=dc.get(t);if(s)var u=s.get(null);else{s=new Map,dc.set(t,s);for(var y=t.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<y.length;x++){var M=y[x];(M.nodeName==="LINK"||M.getAttribute("media")!=="not all")&&(s.set(M.dataset.precedence,M),u=M)}u&&s.set(null,u)}y=r.instance,M=y.getAttribute("data-precedence"),x=s.get(M)||u,x===u&&s.set(null,y),s.set(M,y),this.count++,u=uc.bind(this),y.addEventListener("load",u),y.addEventListener("error",u),x?x.parentNode.insertBefore(y,x.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(y,t.firstChild)),r.state.loading|=4}}var ss={$$typeof:E,Provider:null,Consumer:null,_currentValue:J,_currentValue2:J,_threadCount:0};function s3(t,r,s,u,y,x,M,k,X){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=yo(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=yo(0),this.hiddenUpdates=yo(null),this.identifierPrefix=u,this.onUncaughtError=y,this.onCaughtError=x,this.onRecoverableError=M,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=X,this.incompleteTransitions=new Map}function _1(t,r,s,u,y,x,M,k,X,oe,he,ge){return t=new s3(t,r,s,M,X,oe,he,ge,k),r=1,x===!0&&(r|=24),x=an(3,null,null,r),t.current=x,x.stateNode=t,r=xd(),r.refCount++,t.pooledCache=r,r.refCount++,x.memoizedState={element:u,isDehydrated:s,cache:r},Ed(x),t}function S1(t){return t?(t=bi,t):bi}function w1(t,r,s,u,y,x){y=S1(y),u.context===null?u.context=y:u.pendingContext=y,u=Pr(r),u.payload={element:s},x=x===void 0?null:x,x!==null&&(u.callback=x),s=Gr(t,u,r),s!==null&&(Jt(s,t,r),Ho(s,t,r))}function E1(t,r){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var s=t.retryLane;t.retryLane=s!==0&&s<r?s:r}}function Ff(t,r){E1(t,r),(t=t.alternate)&&E1(t,r)}function C1(t){if(t.tag===13||t.tag===31){var r=wa(t,67108864);r!==null&&Jt(r,t,67108864),Ff(t,67108864)}}function T1(t){if(t.tag===13||t.tag===31){var r=un();r=bo(r);var s=wa(t,r);s!==null&&Jt(s,t,r),Ff(t,r)}}var hc=!0;function l3(t,r,s,u){var y=O.T;O.T=null;var x=F.p;try{F.p=2,Pf(t,r,s,u)}finally{F.p=x,O.T=y}}function c3(t,r,s,u){var y=O.T;O.T=null;var x=F.p;try{F.p=8,Pf(t,r,s,u)}finally{F.p=x,O.T=y}}function Pf(t,r,s,u){if(hc){var y=Gf(u);if(y===null)Mf(t,r,u,pc,s),N1(t,u);else if(d3(y,t,r,s,u))u.stopPropagation();else if(N1(t,u),r&4&&-1<u3.indexOf(t)){for(;y!==null;){var x=kr(y);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var M=ar(x.pendingLanes);if(M!==0){var k=x;for(k.pendingLanes|=2,k.entangledLanes|=2;M;){var X=1<<31-Pt(M);k.entanglements[1]|=X,M&=~X}$n(x),($e&6)===0&&(Kl=nt()+500,ts(0))}}break;case 31:case 13:k=wa(x,2),k!==null&&Jt(k,x,2),Ql(),Ff(x,2)}if(x=Gf(u),x===null&&Mf(t,r,u,pc,s),x===y)break;y=x}y!==null&&u.stopPropagation()}else Mf(t,r,u,null,s)}}function Gf(t){return t=$u(t),$f(t)}var pc=null;function $f(t){if(pc=null,t=Dr(t),t!==null){var r=l(t);if(r===null)t=null;else{var s=r.tag;if(s===13){if(t=c(r),t!==null)return t;t=null}else if(s===31){if(t=d(r),t!==null)return t;t=null}else if(s===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;t=null}else r!==t&&(t=null)}}return pc=t,null}function j1(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ft()){case $t:return 2;case At:return 8;case Lt:case Ja:return 32;case rr:return 268435456;default:return 32}default:return 32}}var Yf=!1,na=null,ra=null,aa=null,ls=new Map,cs=new Map,ia=[],u3="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function N1(t,r){switch(t){case"focusin":case"focusout":na=null;break;case"dragenter":case"dragleave":ra=null;break;case"mouseover":case"mouseout":aa=null;break;case"pointerover":case"pointerout":ls.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":cs.delete(r.pointerId)}}function us(t,r,s,u,y,x){return t===null||t.nativeEvent!==x?(t={blockedOn:r,domEventName:s,eventSystemFlags:u,nativeEvent:x,targetContainers:[y]},r!==null&&(r=kr(r),r!==null&&C1(r)),t):(t.eventSystemFlags|=u,r=t.targetContainers,y!==null&&r.indexOf(y)===-1&&r.push(y),t)}function d3(t,r,s,u,y){switch(r){case"focusin":return na=us(na,t,r,s,u,y),!0;case"dragenter":return ra=us(ra,t,r,s,u,y),!0;case"mouseover":return aa=us(aa,t,r,s,u,y),!0;case"pointerover":var x=y.pointerId;return ls.set(x,us(ls.get(x)||null,t,r,s,u,y)),!0;case"gotpointercapture":return x=y.pointerId,cs.set(x,us(cs.get(x)||null,t,r,s,u,y)),!0}return!1}function R1(t){var r=Dr(t.target);if(r!==null){var s=l(r);if(s!==null){if(r=s.tag,r===13){if(r=c(s),r!==null){t.blockedOn=r,nl(t.priority,function(){T1(s)});return}}else if(r===31){if(r=d(s),r!==null){t.blockedOn=r,nl(t.priority,function(){T1(s)});return}}else if(r===3&&s.stateNode.current.memoizedState.isDehydrated){t.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}t.blockedOn=null}function gc(t){if(t.blockedOn!==null)return!1;for(var r=t.targetContainers;0<r.length;){var s=Gf(t.nativeEvent);if(s===null){s=t.nativeEvent;var u=new s.constructor(s.type,s);Gu=u,s.target.dispatchEvent(u),Gu=null}else return r=kr(s),r!==null&&C1(r),t.blockedOn=s,!1;r.shift()}return!0}function M1(t,r,s){gc(t)&&s.delete(r)}function f3(){Yf=!1,na!==null&&gc(na)&&(na=null),ra!==null&&gc(ra)&&(ra=null),aa!==null&&gc(aa)&&(aa=null),ls.forEach(M1),cs.forEach(M1)}function vc(t,r){t.blockedOn===r&&(t.blockedOn=null,Yf||(Yf=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,f3)))}var mc=null;function A1(t){mc!==t&&(mc=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){mc===t&&(mc=null);for(var r=0;r<t.length;r+=3){var s=t[r],u=t[r+1],y=t[r+2];if(typeof u!="function"){if($f(u||s)===null)continue;break}var x=kr(s);x!==null&&(t.splice(r,3),r-=3,Pd(x,{pending:!0,data:y,method:s.method,action:u},u,y))}}))}function Fi(t){function r(X){return vc(X,t)}na!==null&&vc(na,t),ra!==null&&vc(ra,t),aa!==null&&vc(aa,t),ls.forEach(r),cs.forEach(r);for(var s=0;s<ia.length;s++){var u=ia[s];u.blockedOn===t&&(u.blockedOn=null)}for(;0<ia.length&&(s=ia[0],s.blockedOn===null);)R1(s),s.blockedOn===null&&ia.shift();if(s=(t.ownerDocument||t).$$reactFormReplay,s!=null)for(u=0;u<s.length;u+=3){var y=s[u],x=s[u+1],M=y[It]||null;if(typeof x=="function")M||A1(s);else if(M){var k=null;if(x&&x.hasAttribute("formAction")){if(y=x,M=x[It]||null)k=M.formAction;else if($f(y)!==null)continue}else k=M.action;typeof k=="function"?s[u+1]=k:(s.splice(u,3),u-=3),A1(s)}}}function z1(){function t(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:function(){return new Promise(function(M){return y=M})},focusReset:"manual",scroll:"manual"})}function r(){y!==null&&(y(),y=null),u||setTimeout(s,20)}function s(){if(!u&&!navigation.transition){var x=navigation.currentEntry;x&&x.url!=null&&navigation.navigate(x.url,{state:x.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var u=!1,y=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(s,100),function(){u=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),y!==null&&(y(),y=null)}}}function Wf(t){this._internalRoot=t}yc.prototype.render=Wf.prototype.render=function(t){var r=this._internalRoot;if(r===null)throw Error(i(409));var s=r.current,u=un();w1(s,u,t,r,null,null)},yc.prototype.unmount=Wf.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var r=t.containerInfo;w1(t.current,2,null,t,null,null),Ql(),r[ir]=null}};function yc(t){this._internalRoot=t}yc.prototype.unstable_scheduleHydration=function(t){if(t){var r=tl();t={blockedOn:null,target:t,priority:r};for(var s=0;s<ia.length&&r!==0&&r<ia[s].priority;s++);ia.splice(s,0,t),s===0&&R1(t)}};var D1=n.version;if(D1!=="19.2.0")throw Error(i(527,D1,"19.2.0"));F.findDOMNode=function(t){var r=t._reactInternals;if(r===void 0)throw typeof t.render=="function"?Error(i(188)):(t=Object.keys(t).join(","),Error(i(268,t)));return t=h(r),t=t!==null?p(t):null,t=t===null?null:t.stateNode,t};var h3={bundleType:0,version:"19.2.0",rendererPackageName:"react-dom",currentDispatcherRef:O,reconcilerVersion:"19.2.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var bc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!bc.isDisabled&&bc.supportsFiber)try{Ht=bc.inject(h3),ht=bc}catch{}}return fs.createRoot=function(t,r){if(!o(t))throw Error(i(299));var s=!1,u="",y=Ix,x=Ux,M=Vx;return r!=null&&(r.unstable_strictMode===!0&&(s=!0),r.identifierPrefix!==void 0&&(u=r.identifierPrefix),r.onUncaughtError!==void 0&&(y=r.onUncaughtError),r.onCaughtError!==void 0&&(x=r.onCaughtError),r.onRecoverableError!==void 0&&(M=r.onRecoverableError)),r=_1(t,1,!1,null,null,s,u,null,y,x,M,z1),t[ir]=r.current,Rf(t),new Wf(r)},fs.hydrateRoot=function(t,r,s){if(!o(t))throw Error(i(299));var u=!1,y="",x=Ix,M=Ux,k=Vx,X=null;return s!=null&&(s.unstable_strictMode===!0&&(u=!0),s.identifierPrefix!==void 0&&(y=s.identifierPrefix),s.onUncaughtError!==void 0&&(x=s.onUncaughtError),s.onCaughtError!==void 0&&(M=s.onCaughtError),s.onRecoverableError!==void 0&&(k=s.onRecoverableError),s.formState!==void 0&&(X=s.formState)),r=_1(t,1,!0,r,s??null,u,y,X,x,M,k,z1),r.context=S1(null),s=r.current,u=un(),u=bo(u),y=Pr(u),y.callback=null,Gr(s,y,u),s=u,r.current.lanes=s,ya(r,s),$n(r),t[ir]=r.current,Rf(t),new yc(r)},fs.version="19.2.0",fs}var F1;function w3(){if(F1)return Kf.exports;F1=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Kf.exports=S3(),Kf.exports}var E3=w3();const C3=Ls(E3);var q=$a();const Kn=Ls(q);function Tt(e){if(typeof e=="string"||typeof e=="number")return""+e;let n="";if(Array.isArray(e))for(let a=0,i;a<e.length;a++)(i=Tt(e[a]))!==""&&(n+=(n&&" ")+i);else for(let a in e)e[a]&&(n+=(n&&" ")+a);return n}var T3={value:()=>{}};function eu(){for(var e=0,n=arguments.length,a={},i;e<n;++e){if(!(i=arguments[e]+"")||i in a||/[\s.]/.test(i))throw new Error("illegal type: "+i);a[i]=[]}return new qc(a)}function qc(e){this._=e}function j3(e,n){return e.trim().split(/^|\s+/).map(function(a){var i="",o=a.indexOf(".");if(o>=0&&(i=a.slice(o+1),a=a.slice(0,o)),a&&!n.hasOwnProperty(a))throw new Error("unknown type: "+a);return{type:a,name:i}})}qc.prototype=eu.prototype={constructor:qc,on:function(e,n){var a=this._,i=j3(e+"",a),o,l=-1,c=i.length;if(arguments.length<2){for(;++l<c;)if((o=(e=i[l]).type)&&(o=N3(a[o],e.name)))return o;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++l<c;)if(o=(e=i[l]).type)a[o]=P1(a[o],e.name,n);else if(n==null)for(o in a)a[o]=P1(a[o],e.name,null);return this},copy:function(){var e={},n=this._;for(var a in n)e[a]=n[a].slice();return new qc(e)},call:function(e,n){if((o=arguments.length-2)>0)for(var a=new Array(o),i=0,o,l;i<o;++i)a[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(l=this._[e],i=0,o=l.length;i<o;++i)l[i].value.apply(n,a)},apply:function(e,n,a){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],o=0,l=i.length;o<l;++o)i[o].value.apply(n,a)}};function N3(e,n){for(var a=0,i=e.length,o;a<i;++a)if((o=e[a]).name===n)return o.value}function P1(e,n,a){for(var i=0,o=e.length;i<o;++i)if(e[i].name===n){e[i]=T3,e=e.slice(0,i).concat(e.slice(i+1));break}return a!=null&&e.push({name:n,value:a}),e}var Vy="http://www.w3.org/1999/xhtml";const G1={svg:"http://www.w3.org/2000/svg",xhtml:Vy,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function tu(e){var n=e+="",a=n.indexOf(":");return a>=0&&(n=e.slice(0,a))!=="xmlns"&&(e=e.slice(a+1)),G1.hasOwnProperty(n)?{space:G1[n],local:e}:e}function R3(e){return function(){var n=this.ownerDocument,a=this.namespaceURI;return a===Vy&&n.documentElement.namespaceURI===Vy?n.createElement(e):n.createElementNS(a,e)}}function M3(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function FN(e){var n=tu(e);return(n.local?M3:R3)(n)}function A3(){}function ob(e){return e==null?A3:function(){return this.querySelector(e)}}function z3(e){typeof e!="function"&&(e=ob(e));for(var n=this._groups,a=n.length,i=new Array(a),o=0;o<a;++o)for(var l=n[o],c=l.length,d=i[o]=new Array(c),f,h,p=0;p<c;++p)(f=l[p])&&(h=e.call(f,f.__data__,p,l))&&("__data__"in f&&(h.__data__=f.__data__),d[p]=h);return new hn(i,this._parents)}function D3(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function k3(){return[]}function PN(e){return e==null?k3:function(){return this.querySelectorAll(e)}}function O3(e){return function(){return D3(e.apply(this,arguments))}}function q3(e){typeof e=="function"?e=O3(e):e=PN(e);for(var n=this._groups,a=n.length,i=[],o=[],l=0;l<a;++l)for(var c=n[l],d=c.length,f,h=0;h<d;++h)(f=c[h])&&(i.push(e.call(f,f.__data__,h,c)),o.push(f));return new hn(i,o)}function GN(e){return function(){return this.matches(e)}}function $N(e){return function(n){return n.matches(e)}}var B3=Array.prototype.find;function L3(e){return function(){return B3.call(this.children,e)}}function H3(){return this.firstElementChild}function I3(e){return this.select(e==null?H3:L3(typeof e=="function"?e:$N(e)))}var U3=Array.prototype.filter;function V3(){return Array.from(this.children)}function F3(e){return function(){return U3.call(this.children,e)}}function P3(e){return this.selectAll(e==null?V3:F3(typeof e=="function"?e:$N(e)))}function G3(e){typeof e!="function"&&(e=GN(e));for(var n=this._groups,a=n.length,i=new Array(a),o=0;o<a;++o)for(var l=n[o],c=l.length,d=i[o]=[],f,h=0;h<c;++h)(f=l[h])&&e.call(f,f.__data__,h,l)&&d.push(f);return new hn(i,this._parents)}function YN(e){return new Array(e.length)}function $3(){return new hn(this._enter||this._groups.map(YN),this._parents)}function Uc(e,n){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=n}Uc.prototype={constructor:Uc,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,n){return this._parent.insertBefore(e,n)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Y3(e){return function(){return e}}function W3(e,n,a,i,o,l){for(var c=0,d,f=n.length,h=l.length;c<h;++c)(d=n[c])?(d.__data__=l[c],i[c]=d):a[c]=new Uc(e,l[c]);for(;c<f;++c)(d=n[c])&&(o[c]=d)}function X3(e,n,a,i,o,l,c){var d,f,h=new Map,p=n.length,v=l.length,m=new Array(p),b;for(d=0;d<p;++d)(f=n[d])&&(m[d]=b=c.call(f,f.__data__,d,n)+"",h.has(b)?o[d]=f:h.set(b,f));for(d=0;d<v;++d)b=c.call(e,l[d],d,l)+"",(f=h.get(b))?(i[d]=f,f.__data__=l[d],h.delete(b)):a[d]=new Uc(e,l[d]);for(d=0;d<p;++d)(f=n[d])&&h.get(m[d])===f&&(o[d]=f)}function K3(e){return e.__data__}function Z3(e,n){if(!arguments.length)return Array.from(this,K3);var a=n?X3:W3,i=this._parents,o=this._groups;typeof e!="function"&&(e=Y3(e));for(var l=o.length,c=new Array(l),d=new Array(l),f=new Array(l),h=0;h<l;++h){var p=i[h],v=o[h],m=v.length,b=Q3(e.call(p,p&&p.__data__,h,i)),_=b.length,S=d[h]=new Array(_),w=c[h]=new Array(_),C=f[h]=new Array(m);a(p,v,S,w,C,b,n);for(var T=0,E=0,N,R;T<_;++T)if(N=S[T]){for(T>=E&&(E=T+1);!(R=w[E])&&++E<_;);N._next=R||null}}return c=new hn(c,i),c._enter=d,c._exit=f,c}function Q3(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function J3(){return new hn(this._exit||this._groups.map(YN),this._parents)}function ek(e,n,a){var i=this.enter(),o=this,l=this.exit();return typeof e=="function"?(i=e(i),i&&(i=i.selection())):i=i.append(e+""),n!=null&&(o=n(o),o&&(o=o.selection())),a==null?l.remove():a(l),i&&o?i.merge(o).order():o}function tk(e){for(var n=e.selection?e.selection():e,a=this._groups,i=n._groups,o=a.length,l=i.length,c=Math.min(o,l),d=new Array(o),f=0;f<c;++f)for(var h=a[f],p=i[f],v=h.length,m=d[f]=new Array(v),b,_=0;_<v;++_)(b=h[_]||p[_])&&(m[_]=b);for(;f<o;++f)d[f]=a[f];return new hn(d,this._parents)}function nk(){for(var e=this._groups,n=-1,a=e.length;++n<a;)for(var i=e[n],o=i.length-1,l=i[o],c;--o>=0;)(c=i[o])&&(l&&c.compareDocumentPosition(l)^4&&l.parentNode.insertBefore(c,l),l=c);return this}function rk(e){e||(e=ak);function n(v,m){return v&&m?e(v.__data__,m.__data__):!v-!m}for(var a=this._groups,i=a.length,o=new Array(i),l=0;l<i;++l){for(var c=a[l],d=c.length,f=o[l]=new Array(d),h,p=0;p<d;++p)(h=c[p])&&(f[p]=h);f.sort(n)}return new hn(o,this._parents).order()}function ak(e,n){return e<n?-1:e>n?1:e>=n?0:NaN}function ik(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function ok(){return Array.from(this)}function sk(){for(var e=this._groups,n=0,a=e.length;n<a;++n)for(var i=e[n],o=0,l=i.length;o<l;++o){var c=i[o];if(c)return c}return null}function lk(){let e=0;for(const n of this)++e;return e}function ck(){return!this.node()}function uk(e){for(var n=this._groups,a=0,i=n.length;a<i;++a)for(var o=n[a],l=0,c=o.length,d;l<c;++l)(d=o[l])&&e.call(d,d.__data__,l,o);return this}function dk(e){return function(){this.removeAttribute(e)}}function fk(e){return function(){this.removeAttributeNS(e.space,e.local)}}function hk(e,n){return function(){this.setAttribute(e,n)}}function pk(e,n){return function(){this.setAttributeNS(e.space,e.local,n)}}function gk(e,n){return function(){var a=n.apply(this,arguments);a==null?this.removeAttribute(e):this.setAttribute(e,a)}}function vk(e,n){return function(){var a=n.apply(this,arguments);a==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,a)}}function mk(e,n){var a=tu(e);if(arguments.length<2){var i=this.node();return a.local?i.getAttributeNS(a.space,a.local):i.getAttribute(a)}return this.each((n==null?a.local?fk:dk:typeof n=="function"?a.local?vk:gk:a.local?pk:hk)(a,n))}function WN(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function yk(e){return function(){this.style.removeProperty(e)}}function bk(e,n,a){return function(){this.style.setProperty(e,n,a)}}function xk(e,n,a){return function(){var i=n.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,a)}}function _k(e,n,a){return arguments.length>1?this.each((n==null?yk:typeof n=="function"?xk:bk)(e,n,a??"")):eo(this.node(),e)}function eo(e,n){return e.style.getPropertyValue(n)||WN(e).getComputedStyle(e,null).getPropertyValue(n)}function Sk(e){return function(){delete this[e]}}function wk(e,n){return function(){this[e]=n}}function Ek(e,n){return function(){var a=n.apply(this,arguments);a==null?delete this[e]:this[e]=a}}function Ck(e,n){return arguments.length>1?this.each((n==null?Sk:typeof n=="function"?Ek:wk)(e,n)):this.node()[e]}function XN(e){return e.trim().split(/^|\s+/)}function sb(e){return e.classList||new KN(e)}function KN(e){this._node=e,this._names=XN(e.getAttribute("class")||"")}KN.prototype={add:function(e){var n=this._names.indexOf(e);n<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var n=this._names.indexOf(e);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function ZN(e,n){for(var a=sb(e),i=-1,o=n.length;++i<o;)a.add(n[i])}function QN(e,n){for(var a=sb(e),i=-1,o=n.length;++i<o;)a.remove(n[i])}function Tk(e){return function(){ZN(this,e)}}function jk(e){return function(){QN(this,e)}}function Nk(e,n){return function(){(n.apply(this,arguments)?ZN:QN)(this,e)}}function Rk(e,n){var a=XN(e+"");if(arguments.length<2){for(var i=sb(this.node()),o=-1,l=a.length;++o<l;)if(!i.contains(a[o]))return!1;return!0}return this.each((typeof n=="function"?Nk:n?Tk:jk)(a,n))}function Mk(){this.textContent=""}function Ak(e){return function(){this.textContent=e}}function zk(e){return function(){var n=e.apply(this,arguments);this.textContent=n??""}}function Dk(e){return arguments.length?this.each(e==null?Mk:(typeof e=="function"?zk:Ak)(e)):this.node().textContent}function kk(){this.innerHTML=""}function Ok(e){return function(){this.innerHTML=e}}function qk(e){return function(){var n=e.apply(this,arguments);this.innerHTML=n??""}}function Bk(e){return arguments.length?this.each(e==null?kk:(typeof e=="function"?qk:Ok)(e)):this.node().innerHTML}function Lk(){this.nextSibling&&this.parentNode.appendChild(this)}function Hk(){return this.each(Lk)}function Ik(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Uk(){return this.each(Ik)}function Vk(e){var n=typeof e=="function"?e:FN(e);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function Fk(){return null}function Pk(e,n){var a=typeof e=="function"?e:FN(e),i=n==null?Fk:typeof n=="function"?n:ob(n);return this.select(function(){return this.insertBefore(a.apply(this,arguments),i.apply(this,arguments)||null)})}function Gk(){var e=this.parentNode;e&&e.removeChild(this)}function $k(){return this.each(Gk)}function Yk(){var e=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function Wk(){var e=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function Xk(e){return this.select(e?Wk:Yk)}function Kk(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Zk(e){return function(n){e.call(this,n,this.__data__)}}function Qk(e){return e.trim().split(/^|\s+/).map(function(n){var a="",i=n.indexOf(".");return i>=0&&(a=n.slice(i+1),n=n.slice(0,i)),{type:n,name:a}})}function Jk(e){return function(){var n=this.__on;if(n){for(var a=0,i=-1,o=n.length,l;a<o;++a)l=n[a],(!e.type||l.type===e.type)&&l.name===e.name?this.removeEventListener(l.type,l.listener,l.options):n[++i]=l;++i?n.length=i:delete this.__on}}}function eO(e,n,a){return function(){var i=this.__on,o,l=Zk(n);if(i){for(var c=0,d=i.length;c<d;++c)if((o=i[c]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=l,o.options=a),o.value=n;return}}this.addEventListener(e.type,l,a),o={type:e.type,name:e.name,value:n,listener:l,options:a},i?i.push(o):this.__on=[o]}}function tO(e,n,a){var i=Qk(e+""),o,l=i.length,c;if(arguments.length<2){var d=this.node().__on;if(d){for(var f=0,h=d.length,p;f<h;++f)for(o=0,p=d[f];o<l;++o)if((c=i[o]).type===p.type&&c.name===p.name)return p.value}return}for(d=n?eO:Jk,o=0;o<l;++o)this.each(d(i[o],n,a));return this}function JN(e,n,a){var i=WN(e),o=i.CustomEvent;typeof o=="function"?o=new o(n,a):(o=i.document.createEvent("Event"),a?(o.initEvent(n,a.bubbles,a.cancelable),o.detail=a.detail):o.initEvent(n,!1,!1)),e.dispatchEvent(o)}function nO(e,n){return function(){return JN(this,e,n)}}function rO(e,n){return function(){return JN(this,e,n.apply(this,arguments))}}function aO(e,n){return this.each((typeof n=="function"?rO:nO)(e,n))}function*iO(){for(var e=this._groups,n=0,a=e.length;n<a;++n)for(var i=e[n],o=0,l=i.length,c;o<l;++o)(c=i[o])&&(yield c)}var e2=[null];function hn(e,n){this._groups=e,this._parents=n}function Hs(){return new hn([[document.documentElement]],e2)}function oO(){return this}hn.prototype=Hs.prototype={constructor:hn,select:z3,selectAll:q3,selectChild:I3,selectChildren:P3,filter:G3,data:Z3,enter:$3,exit:J3,join:ek,merge:tk,selection:oO,order:nk,sort:rk,call:ik,nodes:ok,node:sk,size:lk,empty:ck,each:uk,attr:mk,style:_k,property:Ck,classed:Rk,text:Dk,html:Bk,raise:Hk,lower:Uk,append:Vk,insert:Pk,remove:$k,clone:Xk,datum:Kk,on:tO,dispatch:aO,[Symbol.iterator]:iO};function fn(e){return typeof e=="string"?new hn([[document.querySelector(e)]],[document.documentElement]):new hn([[e]],e2)}function sO(e){let n;for(;n=e.sourceEvent;)e=n;return e}function Dn(e,n){if(e=sO(e),n===void 0&&(n=e.currentTarget),n){var a=n.ownerSVGElement||n;if(a.createSVGPoint){var i=a.createSVGPoint();return i.x=e.clientX,i.y=e.clientY,i=i.matrixTransform(n.getScreenCTM().inverse()),[i.x,i.y]}if(n.getBoundingClientRect){var o=n.getBoundingClientRect();return[e.clientX-o.left-n.clientLeft,e.clientY-o.top-n.clientTop]}}return[e.pageX,e.pageY]}const lO={passive:!1},Cs={capture:!0,passive:!1};function th(e){e.stopImmediatePropagation()}function Qi(e){e.preventDefault(),e.stopImmediatePropagation()}function t2(e){var n=e.document.documentElement,a=fn(e).on("dragstart.drag",Qi,Cs);"onselectstart"in n?a.on("selectstart.drag",Qi,Cs):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function n2(e,n){var a=e.document.documentElement,i=fn(e).on("dragstart.drag",null);n&&(i.on("click.drag",Qi,Cs),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in a?i.on("selectstart.drag",null):(a.style.MozUserSelect=a.__noselect,delete a.__noselect)}const _c=e=>()=>e;function Fy(e,{sourceEvent:n,subject:a,target:i,identifier:o,active:l,x:c,y:d,dx:f,dy:h,dispatch:p}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:a,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:l,enumerable:!0,configurable:!0},x:{value:c,enumerable:!0,configurable:!0},y:{value:d,enumerable:!0,configurable:!0},dx:{value:f,enumerable:!0,configurable:!0},dy:{value:h,enumerable:!0,configurable:!0},_:{value:p}})}Fy.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function cO(e){return!e.ctrlKey&&!e.button}function uO(){return this.parentNode}function dO(e,n){return n??{x:e.x,y:e.y}}function fO(){return navigator.maxTouchPoints||"ontouchstart"in this}function r2(){var e=cO,n=uO,a=dO,i=fO,o={},l=eu("start","drag","end"),c=0,d,f,h,p,v=0;function m(N){N.on("mousedown.drag",b).filter(i).on("touchstart.drag",w).on("touchmove.drag",C,lO).on("touchend.drag touchcancel.drag",T).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function b(N,R){if(!(p||!e.call(this,N,R))){var z=E(this,n.call(this,N,R),N,R,"mouse");z&&(fn(N.view).on("mousemove.drag",_,Cs).on("mouseup.drag",S,Cs),t2(N.view),th(N),h=!1,d=N.clientX,f=N.clientY,z("start",N))}}function _(N){if(Qi(N),!h){var R=N.clientX-d,z=N.clientY-f;h=R*R+z*z>v}o.mouse("drag",N)}function S(N){fn(N.view).on("mousemove.drag mouseup.drag",null),n2(N.view,h),Qi(N),o.mouse("end",N)}function w(N,R){if(e.call(this,N,R)){var z=N.changedTouches,j=n.call(this,N,R),A=z.length,D,I;for(D=0;D<A;++D)(I=E(this,j,N,R,z[D].identifier,z[D]))&&(th(N),I("start",N,z[D]))}}function C(N){var R=N.changedTouches,z=R.length,j,A;for(j=0;j<z;++j)(A=o[R[j].identifier])&&(Qi(N),A("drag",N,R[j]))}function T(N){var R=N.changedTouches,z=R.length,j,A;for(p&&clearTimeout(p),p=setTimeout(function(){p=null},500),j=0;j<z;++j)(A=o[R[j].identifier])&&(th(N),A("end",N,R[j]))}function E(N,R,z,j,A,D){var I=l.copy(),P=Dn(D||z,R),V,$,L;if((L=a.call(N,new Fy("beforestart",{sourceEvent:z,target:m,identifier:A,active:c,x:P[0],y:P[1],dx:0,dy:0,dispatch:I}),j))!=null)return V=L.x-P[0]||0,$=L.y-P[1]||0,function H(O,F,J){var G=P,re;switch(O){case"start":o[A]=H,re=c++;break;case"end":delete o[A],--c;case"drag":P=Dn(J||F,R),re=c;break}I.call(O,N,new Fy(O,{sourceEvent:F,subject:L,target:m,identifier:A,active:re,x:P[0]+V,y:P[1]+$,dx:P[0]-G[0],dy:P[1]-G[1],dispatch:I}),j)}}return m.filter=function(N){return arguments.length?(e=typeof N=="function"?N:_c(!!N),m):e},m.container=function(N){return arguments.length?(n=typeof N=="function"?N:_c(N),m):n},m.subject=function(N){return arguments.length?(a=typeof N=="function"?N:_c(N),m):a},m.touchable=function(N){return arguments.length?(i=typeof N=="function"?N:_c(!!N),m):i},m.on=function(){var N=l.on.apply(l,arguments);return N===l?m:N},m.clickDistance=function(N){return arguments.length?(v=(N=+N)*N,m):Math.sqrt(v)},m}function lb(e,n,a){e.prototype=n.prototype=a,a.constructor=e}function a2(e,n){var a=Object.create(e.prototype);for(var i in n)a[i]=n[i];return a}function Is(){}var Ts=.7,Vc=1/Ts,Ji="\\s*([+-]?\\d+)\\s*",js="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Zn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",hO=/^#([0-9a-f]{3,8})$/,pO=new RegExp(`^rgb\\(${Ji},${Ji},${Ji}\\)$`),gO=new RegExp(`^rgb\\(${Zn},${Zn},${Zn}\\)$`),vO=new RegExp(`^rgba\\(${Ji},${Ji},${Ji},${js}\\)$`),mO=new RegExp(`^rgba\\(${Zn},${Zn},${Zn},${js}\\)$`),yO=new RegExp(`^hsl\\(${js},${Zn},${Zn}\\)$`),bO=new RegExp(`^hsla\\(${js},${Zn},${Zn},${js}\\)$`),$1={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};lb(Is,Fa,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Y1,formatHex:Y1,formatHex8:xO,formatHsl:_O,formatRgb:W1,toString:W1});function Y1(){return this.rgb().formatHex()}function xO(){return this.rgb().formatHex8()}function _O(){return i2(this).formatHsl()}function W1(){return this.rgb().formatRgb()}function Fa(e){var n,a;return e=(e+"").trim().toLowerCase(),(n=hO.exec(e))?(a=n[1].length,n=parseInt(n[1],16),a===6?X1(n):a===3?new en(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):a===8?Sc(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):a===4?Sc(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=pO.exec(e))?new en(n[1],n[2],n[3],1):(n=gO.exec(e))?new en(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=vO.exec(e))?Sc(n[1],n[2],n[3],n[4]):(n=mO.exec(e))?Sc(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=yO.exec(e))?Q1(n[1],n[2]/100,n[3]/100,1):(n=bO.exec(e))?Q1(n[1],n[2]/100,n[3]/100,n[4]):$1.hasOwnProperty(e)?X1($1[e]):e==="transparent"?new en(NaN,NaN,NaN,0):null}function X1(e){return new en(e>>16&255,e>>8&255,e&255,1)}function Sc(e,n,a,i){return i<=0&&(e=n=a=NaN),new en(e,n,a,i)}function SO(e){return e instanceof Is||(e=Fa(e)),e?(e=e.rgb(),new en(e.r,e.g,e.b,e.opacity)):new en}function Py(e,n,a,i){return arguments.length===1?SO(e):new en(e,n,a,i??1)}function en(e,n,a,i){this.r=+e,this.g=+n,this.b=+a,this.opacity=+i}lb(en,Py,a2(Is,{brighter(e){return e=e==null?Vc:Math.pow(Vc,e),new en(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ts:Math.pow(Ts,e),new en(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new en(Ia(this.r),Ia(this.g),Ia(this.b),Fc(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:K1,formatHex:K1,formatHex8:wO,formatRgb:Z1,toString:Z1}));function K1(){return`#${Ha(this.r)}${Ha(this.g)}${Ha(this.b)}`}function wO(){return`#${Ha(this.r)}${Ha(this.g)}${Ha(this.b)}${Ha((isNaN(this.opacity)?1:this.opacity)*255)}`}function Z1(){const e=Fc(this.opacity);return`${e===1?"rgb(":"rgba("}${Ia(this.r)}, ${Ia(this.g)}, ${Ia(this.b)}${e===1?")":`, ${e})`}`}function Fc(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ia(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ha(e){return e=Ia(e),(e<16?"0":"")+e.toString(16)}function Q1(e,n,a,i){return i<=0?e=n=a=NaN:a<=0||a>=1?e=n=NaN:n<=0&&(e=NaN),new kn(e,n,a,i)}function i2(e){if(e instanceof kn)return new kn(e.h,e.s,e.l,e.opacity);if(e instanceof Is||(e=Fa(e)),!e)return new kn;if(e instanceof kn)return e;e=e.rgb();var n=e.r/255,a=e.g/255,i=e.b/255,o=Math.min(n,a,i),l=Math.max(n,a,i),c=NaN,d=l-o,f=(l+o)/2;return d?(n===l?c=(a-i)/d+(a<i)*6:a===l?c=(i-n)/d+2:c=(n-a)/d+4,d/=f<.5?l+o:2-l-o,c*=60):d=f>0&&f<1?0:c,new kn(c,d,f,e.opacity)}function EO(e,n,a,i){return arguments.length===1?i2(e):new kn(e,n,a,i??1)}function kn(e,n,a,i){this.h=+e,this.s=+n,this.l=+a,this.opacity=+i}lb(kn,EO,a2(Is,{brighter(e){return e=e==null?Vc:Math.pow(Vc,e),new kn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ts:Math.pow(Ts,e),new kn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,n=isNaN(e)||isNaN(this.s)?0:this.s,a=this.l,i=a+(a<.5?a:1-a)*n,o=2*a-i;return new en(nh(e>=240?e-240:e+120,o,i),nh(e,o,i),nh(e<120?e+240:e-120,o,i),this.opacity)},clamp(){return new kn(J1(this.h),wc(this.s),wc(this.l),Fc(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Fc(this.opacity);return`${e===1?"hsl(":"hsla("}${J1(this.h)}, ${wc(this.s)*100}%, ${wc(this.l)*100}%${e===1?")":`, ${e})`}`}}));function J1(e){return e=(e||0)%360,e<0?e+360:e}function wc(e){return Math.max(0,Math.min(1,e||0))}function nh(e,n,a){return(e<60?n+(a-n)*e/60:e<180?a:e<240?n+(a-n)*(240-e)/60:n)*255}const cb=e=>()=>e;function CO(e,n){return function(a){return e+a*n}}function TO(e,n,a){return e=Math.pow(e,a),n=Math.pow(n,a)-e,a=1/a,function(i){return Math.pow(e+i*n,a)}}function jO(e){return(e=+e)==1?o2:function(n,a){return a-n?TO(n,a,e):cb(isNaN(n)?a:n)}}function o2(e,n){var a=n-e;return a?CO(e,a):cb(isNaN(e)?n:e)}const Pc=(function e(n){var a=jO(n);function i(o,l){var c=a((o=Py(o)).r,(l=Py(l)).r),d=a(o.g,l.g),f=a(o.b,l.b),h=o2(o.opacity,l.opacity);return function(p){return o.r=c(p),o.g=d(p),o.b=f(p),o.opacity=h(p),o+""}}return i.gamma=e,i})(1);function NO(e,n){n||(n=[]);var a=e?Math.min(n.length,e.length):0,i=n.slice(),o;return function(l){for(o=0;o<a;++o)i[o]=e[o]*(1-l)+n[o]*l;return i}}function RO(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function MO(e,n){var a=n?n.length:0,i=e?Math.min(a,e.length):0,o=new Array(i),l=new Array(a),c;for(c=0;c<i;++c)o[c]=ws(e[c],n[c]);for(;c<a;++c)l[c]=n[c];return function(d){for(c=0;c<i;++c)l[c]=o[c](d);return l}}function AO(e,n){var a=new Date;return e=+e,n=+n,function(i){return a.setTime(e*(1-i)+n*i),a}}function Xn(e,n){return e=+e,n=+n,function(a){return e*(1-a)+n*a}}function zO(e,n){var a={},i={},o;(e===null||typeof e!="object")&&(e={}),(n===null||typeof n!="object")&&(n={});for(o in n)o in e?a[o]=ws(e[o],n[o]):i[o]=n[o];return function(l){for(o in a)i[o]=a[o](l);return i}}var Gy=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,rh=new RegExp(Gy.source,"g");function DO(e){return function(){return e}}function kO(e){return function(n){return e(n)+""}}function s2(e,n){var a=Gy.lastIndex=rh.lastIndex=0,i,o,l,c=-1,d=[],f=[];for(e=e+"",n=n+"";(i=Gy.exec(e))&&(o=rh.exec(n));)(l=o.index)>a&&(l=n.slice(a,l),d[c]?d[c]+=l:d[++c]=l),(i=i[0])===(o=o[0])?d[c]?d[c]+=o:d[++c]=o:(d[++c]=null,f.push({i:c,x:Xn(i,o)})),a=rh.lastIndex;return a<n.length&&(l=n.slice(a),d[c]?d[c]+=l:d[++c]=l),d.length<2?f[0]?kO(f[0].x):DO(n):(n=f.length,function(h){for(var p=0,v;p<n;++p)d[(v=f[p]).i]=v.x(h);return d.join("")})}function ws(e,n){var a=typeof n,i;return n==null||a==="boolean"?cb(n):(a==="number"?Xn:a==="string"?(i=Fa(n))?(n=i,Pc):s2:n instanceof Fa?Pc:n instanceof Date?AO:RO(n)?NO:Array.isArray(n)?MO:typeof n.valueOf!="function"&&typeof n.toString!="function"||isNaN(n)?zO:Xn)(e,n)}var eS=180/Math.PI,$y={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function l2(e,n,a,i,o,l){var c,d,f;return(c=Math.sqrt(e*e+n*n))&&(e/=c,n/=c),(f=e*a+n*i)&&(a-=e*f,i-=n*f),(d=Math.sqrt(a*a+i*i))&&(a/=d,i/=d,f/=d),e*i<n*a&&(e=-e,n=-n,f=-f,c=-c),{translateX:o,translateY:l,rotate:Math.atan2(n,e)*eS,skewX:Math.atan(f)*eS,scaleX:c,scaleY:d}}var Ec;function OO(e){const n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return n.isIdentity?$y:l2(n.a,n.b,n.c,n.d,n.e,n.f)}function qO(e){return e==null||(Ec||(Ec=document.createElementNS("http://www.w3.org/2000/svg","g")),Ec.setAttribute("transform",e),!(e=Ec.transform.baseVal.consolidate()))?$y:(e=e.matrix,l2(e.a,e.b,e.c,e.d,e.e,e.f))}function c2(e,n,a,i){function o(h){return h.length?h.pop()+" ":""}function l(h,p,v,m,b,_){if(h!==v||p!==m){var S=b.push("translate(",null,n,null,a);_.push({i:S-4,x:Xn(h,v)},{i:S-2,x:Xn(p,m)})}else(v||m)&&b.push("translate("+v+n+m+a)}function c(h,p,v,m){h!==p?(h-p>180?p+=360:p-h>180&&(h+=360),m.push({i:v.push(o(v)+"rotate(",null,i)-2,x:Xn(h,p)})):p&&v.push(o(v)+"rotate("+p+i)}function d(h,p,v,m){h!==p?m.push({i:v.push(o(v)+"skewX(",null,i)-2,x:Xn(h,p)}):p&&v.push(o(v)+"skewX("+p+i)}function f(h,p,v,m,b,_){if(h!==v||p!==m){var S=b.push(o(b)+"scale(",null,",",null,")");_.push({i:S-4,x:Xn(h,v)},{i:S-2,x:Xn(p,m)})}else(v!==1||m!==1)&&b.push(o(b)+"scale("+v+","+m+")")}return function(h,p){var v=[],m=[];return h=e(h),p=e(p),l(h.translateX,h.translateY,p.translateX,p.translateY,v,m),c(h.rotate,p.rotate,v,m),d(h.skewX,p.skewX,v,m),f(h.scaleX,h.scaleY,p.scaleX,p.scaleY,v,m),h=p=null,function(b){for(var _=-1,S=m.length,w;++_<S;)v[(w=m[_]).i]=w.x(b);return v.join("")}}}var BO=c2(OO,"px, ","px)","deg)"),LO=c2(qO,", ",")",")"),HO=1e-12;function tS(e){return((e=Math.exp(e))+1/e)/2}function IO(e){return((e=Math.exp(e))-1/e)/2}function UO(e){return((e=Math.exp(2*e))-1)/(e+1)}const Bc=(function e(n,a,i){function o(l,c){var d=l[0],f=l[1],h=l[2],p=c[0],v=c[1],m=c[2],b=p-d,_=v-f,S=b*b+_*_,w,C;if(S<HO)C=Math.log(m/h)/n,w=function(j){return[d+j*b,f+j*_,h*Math.exp(n*j*C)]};else{var T=Math.sqrt(S),E=(m*m-h*h+i*S)/(2*h*a*T),N=(m*m-h*h-i*S)/(2*m*a*T),R=Math.log(Math.sqrt(E*E+1)-E),z=Math.log(Math.sqrt(N*N+1)-N);C=(z-R)/n,w=function(j){var A=j*C,D=tS(R),I=h/(a*T)*(D*UO(n*A+R)-IO(R));return[d+I*b,f+I*_,h*D/tS(n*A+R)]}}return w.duration=C*1e3*n/Math.SQRT2,w}return o.rho=function(l){var c=Math.max(.001,+l),d=c*c,f=d*d;return e(c,d,f)},o})(Math.SQRT2,2,4);var to=0,ys=0,hs=0,u2=1e3,Gc,bs,$c=0,Pa=0,nu=0,Ns=typeof performance=="object"&&performance.now?performance:Date,d2=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function ub(){return Pa||(d2(VO),Pa=Ns.now()+nu)}function VO(){Pa=0}function Yc(){this._call=this._time=this._next=null}Yc.prototype=f2.prototype={constructor:Yc,restart:function(e,n,a){if(typeof e!="function")throw new TypeError("callback is not a function");a=(a==null?ub():+a)+(n==null?0:+n),!this._next&&bs!==this&&(bs?bs._next=this:Gc=this,bs=this),this._call=e,this._time=a,Yy()},stop:function(){this._call&&(this._call=null,this._time=1/0,Yy())}};function f2(e,n,a){var i=new Yc;return i.restart(e,n,a),i}function FO(){ub(),++to;for(var e=Gc,n;e;)(n=Pa-e._time)>=0&&e._call.call(void 0,n),e=e._next;--to}function nS(){Pa=($c=Ns.now())+nu,to=ys=0;try{FO()}finally{to=0,GO(),Pa=0}}function PO(){var e=Ns.now(),n=e-$c;n>u2&&(nu-=n,$c=e)}function GO(){for(var e,n=Gc,a,i=1/0;n;)n._call?(i>n._time&&(i=n._time),e=n,n=n._next):(a=n._next,n._next=null,n=e?e._next=a:Gc=a);bs=e,Yy(i)}function Yy(e){if(!to){ys&&(ys=clearTimeout(ys));var n=e-Pa;n>24?(e<1/0&&(ys=setTimeout(nS,e-Ns.now()-nu)),hs&&(hs=clearInterval(hs))):(hs||($c=Ns.now(),hs=setInterval(PO,u2)),to=1,d2(nS))}}function rS(e,n,a){var i=new Yc;return n=n==null?0:+n,i.restart(o=>{i.stop(),e(o+n)},n,a),i}var $O=eu("start","end","cancel","interrupt"),YO=[],h2=0,aS=1,Wy=2,Lc=3,iS=4,Xy=5,Hc=6;function ru(e,n,a,i,o,l){var c=e.__transition;if(!c)e.__transition={};else if(a in c)return;WO(e,a,{name:n,index:i,group:o,on:$O,tween:YO,time:l.time,delay:l.delay,duration:l.duration,ease:l.ease,timer:null,state:h2})}function db(e,n){var a=Ln(e,n);if(a.state>h2)throw new Error("too late; already scheduled");return a}function tr(e,n){var a=Ln(e,n);if(a.state>Lc)throw new Error("too late; already running");return a}function Ln(e,n){var a=e.__transition;if(!a||!(a=a[n]))throw new Error("transition not found");return a}function WO(e,n,a){var i=e.__transition,o;i[n]=a,a.timer=f2(l,0,a.time);function l(h){a.state=aS,a.timer.restart(c,a.delay,a.time),a.delay<=h&&c(h-a.delay)}function c(h){var p,v,m,b;if(a.state!==aS)return f();for(p in i)if(b=i[p],b.name===a.name){if(b.state===Lc)return rS(c);b.state===iS?(b.state=Hc,b.timer.stop(),b.on.call("interrupt",e,e.__data__,b.index,b.group),delete i[p]):+p<n&&(b.state=Hc,b.timer.stop(),b.on.call("cancel",e,e.__data__,b.index,b.group),delete i[p])}if(rS(function(){a.state===Lc&&(a.state=iS,a.timer.restart(d,a.delay,a.time),d(h))}),a.state=Wy,a.on.call("start",e,e.__data__,a.index,a.group),a.state===Wy){for(a.state=Lc,o=new Array(m=a.tween.length),p=0,v=-1;p<m;++p)(b=a.tween[p].value.call(e,e.__data__,a.index,a.group))&&(o[++v]=b);o.length=v+1}}function d(h){for(var p=h<a.duration?a.ease.call(null,h/a.duration):(a.timer.restart(f),a.state=Xy,1),v=-1,m=o.length;++v<m;)o[v].call(e,p);a.state===Xy&&(a.on.call("end",e,e.__data__,a.index,a.group),f())}function f(){a.state=Hc,a.timer.stop(),delete i[n];for(var h in i)return;delete e.__transition}}function Ic(e,n){var a=e.__transition,i,o,l=!0,c;if(a){n=n==null?null:n+"";for(c in a){if((i=a[c]).name!==n){l=!1;continue}o=i.state>Wy&&i.state<Xy,i.state=Hc,i.timer.stop(),i.on.call(o?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete a[c]}l&&delete e.__transition}}function XO(e){return this.each(function(){Ic(this,e)})}function KO(e,n){var a,i;return function(){var o=tr(this,e),l=o.tween;if(l!==a){i=a=l;for(var c=0,d=i.length;c<d;++c)if(i[c].name===n){i=i.slice(),i.splice(c,1);break}}o.tween=i}}function ZO(e,n,a){var i,o;if(typeof a!="function")throw new Error;return function(){var l=tr(this,e),c=l.tween;if(c!==i){o=(i=c).slice();for(var d={name:n,value:a},f=0,h=o.length;f<h;++f)if(o[f].name===n){o[f]=d;break}f===h&&o.push(d)}l.tween=o}}function QO(e,n){var a=this._id;if(e+="",arguments.length<2){for(var i=Ln(this.node(),a).tween,o=0,l=i.length,c;o<l;++o)if((c=i[o]).name===e)return c.value;return null}return this.each((n==null?KO:ZO)(a,e,n))}function fb(e,n,a){var i=e._id;return e.each(function(){var o=tr(this,i);(o.value||(o.value={}))[n]=a.apply(this,arguments)}),function(o){return Ln(o,i).value[n]}}function p2(e,n){var a;return(typeof n=="number"?Xn:n instanceof Fa?Pc:(a=Fa(n))?(n=a,Pc):s2)(e,n)}function JO(e){return function(){this.removeAttribute(e)}}function e5(e){return function(){this.removeAttributeNS(e.space,e.local)}}function t5(e,n,a){var i,o=a+"",l;return function(){var c=this.getAttribute(e);return c===o?null:c===i?l:l=n(i=c,a)}}function n5(e,n,a){var i,o=a+"",l;return function(){var c=this.getAttributeNS(e.space,e.local);return c===o?null:c===i?l:l=n(i=c,a)}}function r5(e,n,a){var i,o,l;return function(){var c,d=a(this),f;return d==null?void this.removeAttribute(e):(c=this.getAttribute(e),f=d+"",c===f?null:c===i&&f===o?l:(o=f,l=n(i=c,d)))}}function a5(e,n,a){var i,o,l;return function(){var c,d=a(this),f;return d==null?void this.removeAttributeNS(e.space,e.local):(c=this.getAttributeNS(e.space,e.local),f=d+"",c===f?null:c===i&&f===o?l:(o=f,l=n(i=c,d)))}}function i5(e,n){var a=tu(e),i=a==="transform"?LO:p2;return this.attrTween(e,typeof n=="function"?(a.local?a5:r5)(a,i,fb(this,"attr."+e,n)):n==null?(a.local?e5:JO)(a):(a.local?n5:t5)(a,i,n))}function o5(e,n){return function(a){this.setAttribute(e,n.call(this,a))}}function s5(e,n){return function(a){this.setAttributeNS(e.space,e.local,n.call(this,a))}}function l5(e,n){var a,i;function o(){var l=n.apply(this,arguments);return l!==i&&(a=(i=l)&&s5(e,l)),a}return o._value=n,o}function c5(e,n){var a,i;function o(){var l=n.apply(this,arguments);return l!==i&&(a=(i=l)&&o5(e,l)),a}return o._value=n,o}function u5(e,n){var a="attr."+e;if(arguments.length<2)return(a=this.tween(a))&&a._value;if(n==null)return this.tween(a,null);if(typeof n!="function")throw new Error;var i=tu(e);return this.tween(a,(i.local?l5:c5)(i,n))}function d5(e,n){return function(){db(this,e).delay=+n.apply(this,arguments)}}function f5(e,n){return n=+n,function(){db(this,e).delay=n}}function h5(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?d5:f5)(n,e)):Ln(this.node(),n).delay}function p5(e,n){return function(){tr(this,e).duration=+n.apply(this,arguments)}}function g5(e,n){return n=+n,function(){tr(this,e).duration=n}}function v5(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?p5:g5)(n,e)):Ln(this.node(),n).duration}function m5(e,n){if(typeof n!="function")throw new Error;return function(){tr(this,e).ease=n}}function y5(e){var n=this._id;return arguments.length?this.each(m5(n,e)):Ln(this.node(),n).ease}function b5(e,n){return function(){var a=n.apply(this,arguments);if(typeof a!="function")throw new Error;tr(this,e).ease=a}}function x5(e){if(typeof e!="function")throw new Error;return this.each(b5(this._id,e))}function _5(e){typeof e!="function"&&(e=GN(e));for(var n=this._groups,a=n.length,i=new Array(a),o=0;o<a;++o)for(var l=n[o],c=l.length,d=i[o]=[],f,h=0;h<c;++h)(f=l[h])&&e.call(f,f.__data__,h,l)&&d.push(f);return new Nr(i,this._parents,this._name,this._id)}function S5(e){if(e._id!==this._id)throw new Error;for(var n=this._groups,a=e._groups,i=n.length,o=a.length,l=Math.min(i,o),c=new Array(i),d=0;d<l;++d)for(var f=n[d],h=a[d],p=f.length,v=c[d]=new Array(p),m,b=0;b<p;++b)(m=f[b]||h[b])&&(v[b]=m);for(;d<i;++d)c[d]=n[d];return new Nr(c,this._parents,this._name,this._id)}function w5(e){return(e+"").trim().split(/^|\s+/).every(function(n){var a=n.indexOf(".");return a>=0&&(n=n.slice(0,a)),!n||n==="start"})}function E5(e,n,a){var i,o,l=w5(n)?db:tr;return function(){var c=l(this,e),d=c.on;d!==i&&(o=(i=d).copy()).on(n,a),c.on=o}}function C5(e,n){var a=this._id;return arguments.length<2?Ln(this.node(),a).on.on(e):this.each(E5(a,e,n))}function T5(e){return function(){var n=this.parentNode;for(var a in this.__transition)if(+a!==e)return;n&&n.removeChild(this)}}function j5(){return this.on("end.remove",T5(this._id))}function N5(e){var n=this._name,a=this._id;typeof e!="function"&&(e=ob(e));for(var i=this._groups,o=i.length,l=new Array(o),c=0;c<o;++c)for(var d=i[c],f=d.length,h=l[c]=new Array(f),p,v,m=0;m<f;++m)(p=d[m])&&(v=e.call(p,p.__data__,m,d))&&("__data__"in p&&(v.__data__=p.__data__),h[m]=v,ru(h[m],n,a,m,h,Ln(p,a)));return new Nr(l,this._parents,n,a)}function R5(e){var n=this._name,a=this._id;typeof e!="function"&&(e=PN(e));for(var i=this._groups,o=i.length,l=[],c=[],d=0;d<o;++d)for(var f=i[d],h=f.length,p,v=0;v<h;++v)if(p=f[v]){for(var m=e.call(p,p.__data__,v,f),b,_=Ln(p,a),S=0,w=m.length;S<w;++S)(b=m[S])&&ru(b,n,a,S,m,_);l.push(m),c.push(p)}return new Nr(l,c,n,a)}var M5=Hs.prototype.constructor;function A5(){return new M5(this._groups,this._parents)}function z5(e,n){var a,i,o;return function(){var l=eo(this,e),c=(this.style.removeProperty(e),eo(this,e));return l===c?null:l===a&&c===i?o:o=n(a=l,i=c)}}function g2(e){return function(){this.style.removeProperty(e)}}function D5(e,n,a){var i,o=a+"",l;return function(){var c=eo(this,e);return c===o?null:c===i?l:l=n(i=c,a)}}function k5(e,n,a){var i,o,l;return function(){var c=eo(this,e),d=a(this),f=d+"";return d==null&&(f=d=(this.style.removeProperty(e),eo(this,e))),c===f?null:c===i&&f===o?l:(o=f,l=n(i=c,d))}}function O5(e,n){var a,i,o,l="style."+n,c="end."+l,d;return function(){var f=tr(this,e),h=f.on,p=f.value[l]==null?d||(d=g2(n)):void 0;(h!==a||o!==p)&&(i=(a=h).copy()).on(c,o=p),f.on=i}}function q5(e,n,a){var i=(e+="")=="transform"?BO:p2;return n==null?this.styleTween(e,z5(e,i)).on("end.style."+e,g2(e)):typeof n=="function"?this.styleTween(e,k5(e,i,fb(this,"style."+e,n))).each(O5(this._id,e)):this.styleTween(e,D5(e,i,n),a).on("end.style."+e,null)}function B5(e,n,a){return function(i){this.style.setProperty(e,n.call(this,i),a)}}function L5(e,n,a){var i,o;function l(){var c=n.apply(this,arguments);return c!==o&&(i=(o=c)&&B5(e,c,a)),i}return l._value=n,l}function H5(e,n,a){var i="style."+(e+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(n==null)return this.tween(i,null);if(typeof n!="function")throw new Error;return this.tween(i,L5(e,n,a??""))}function I5(e){return function(){this.textContent=e}}function U5(e){return function(){var n=e(this);this.textContent=n??""}}function V5(e){return this.tween("text",typeof e=="function"?U5(fb(this,"text",e)):I5(e==null?"":e+""))}function F5(e){return function(n){this.textContent=e.call(this,n)}}function P5(e){var n,a;function i(){var o=e.apply(this,arguments);return o!==a&&(n=(a=o)&&F5(o)),n}return i._value=e,i}function G5(e){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;return this.tween(n,P5(e))}function $5(){for(var e=this._name,n=this._id,a=v2(),i=this._groups,o=i.length,l=0;l<o;++l)for(var c=i[l],d=c.length,f,h=0;h<d;++h)if(f=c[h]){var p=Ln(f,n);ru(f,e,a,h,c,{time:p.time+p.delay+p.duration,delay:0,duration:p.duration,ease:p.ease})}return new Nr(i,this._parents,e,a)}function Y5(){var e,n,a=this,i=a._id,o=a.size();return new Promise(function(l,c){var d={value:c},f={value:function(){--o===0&&l()}};a.each(function(){var h=tr(this,i),p=h.on;p!==e&&(n=(e=p).copy(),n._.cancel.push(d),n._.interrupt.push(d),n._.end.push(f)),h.on=n}),o===0&&l()})}var W5=0;function Nr(e,n,a,i){this._groups=e,this._parents=n,this._name=a,this._id=i}function v2(){return++W5}var Er=Hs.prototype;Nr.prototype={constructor:Nr,select:N5,selectAll:R5,selectChild:Er.selectChild,selectChildren:Er.selectChildren,filter:_5,merge:S5,selection:A5,transition:$5,call:Er.call,nodes:Er.nodes,node:Er.node,size:Er.size,empty:Er.empty,each:Er.each,on:C5,attr:i5,attrTween:u5,style:q5,styleTween:H5,text:V5,textTween:G5,remove:j5,tween:QO,delay:h5,duration:v5,ease:y5,easeVarying:x5,end:Y5,[Symbol.iterator]:Er[Symbol.iterator]};function X5(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var K5={time:null,delay:0,duration:250,ease:X5};function Z5(e,n){for(var a;!(a=e.__transition)||!(a=a[n]);)if(!(e=e.parentNode))throw new Error(`transition ${n} not found`);return a}function Q5(e){var n,a;e instanceof Nr?(n=e._id,e=e._name):(n=v2(),(a=K5).time=ub(),e=e==null?null:e+"");for(var i=this._groups,o=i.length,l=0;l<o;++l)for(var c=i[l],d=c.length,f,h=0;h<d;++h)(f=c[h])&&ru(f,e,n,h,c,a||Z5(f,n));return new Nr(i,this._parents,e,n)}Hs.prototype.interrupt=XO;Hs.prototype.transition=Q5;const Cc=e=>()=>e;function J5(e,{sourceEvent:n,target:a,transform:i,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:a,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:o}})}function Tr(e,n,a){this.k=e,this.x=n,this.y=a}Tr.prototype={constructor:Tr,scale:function(e){return e===1?this:new Tr(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new Tr(this.k,this.x+this.k*e,this.y+this.k*n)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var au=new Tr(1,0,0);m2.prototype=Tr.prototype;function m2(e){for(;!e.__zoom;)if(!(e=e.parentNode))return au;return e.__zoom}function ah(e){e.stopImmediatePropagation()}function ps(e){e.preventDefault(),e.stopImmediatePropagation()}function e6(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function t6(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function oS(){return this.__zoom||au}function n6(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function r6(){return navigator.maxTouchPoints||"ontouchstart"in this}function a6(e,n,a){var i=e.invertX(n[0][0])-a[0][0],o=e.invertX(n[1][0])-a[1][0],l=e.invertY(n[0][1])-a[0][1],c=e.invertY(n[1][1])-a[1][1];return e.translate(o>i?(i+o)/2:Math.min(0,i)||Math.max(0,o),c>l?(l+c)/2:Math.min(0,l)||Math.max(0,c))}function y2(){var e=e6,n=t6,a=a6,i=n6,o=r6,l=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],d=250,f=Bc,h=eu("start","zoom","end"),p,v,m,b=500,_=150,S=0,w=10;function C(L){L.property("__zoom",oS).on("wheel.zoom",A,{passive:!1}).on("mousedown.zoom",D).on("dblclick.zoom",I).filter(o).on("touchstart.zoom",P).on("touchmove.zoom",V).on("touchend.zoom touchcancel.zoom",$).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}C.transform=function(L,H,O,F){var J=L.selection?L.selection():L;J.property("__zoom",oS),L!==J?R(L,H,O,F):J.interrupt().each(function(){z(this,arguments).event(F).start().zoom(null,typeof H=="function"?H.apply(this,arguments):H).end()})},C.scaleBy=function(L,H,O,F){C.scaleTo(L,function(){var J=this.__zoom.k,G=typeof H=="function"?H.apply(this,arguments):H;return J*G},O,F)},C.scaleTo=function(L,H,O,F){C.transform(L,function(){var J=n.apply(this,arguments),G=this.__zoom,re=O==null?N(J):typeof O=="function"?O.apply(this,arguments):O,B=G.invert(re),Y=typeof H=="function"?H.apply(this,arguments):H;return a(E(T(G,Y),re,B),J,c)},O,F)},C.translateBy=function(L,H,O,F){C.transform(L,function(){return a(this.__zoom.translate(typeof H=="function"?H.apply(this,arguments):H,typeof O=="function"?O.apply(this,arguments):O),n.apply(this,arguments),c)},null,F)},C.translateTo=function(L,H,O,F,J){C.transform(L,function(){var G=n.apply(this,arguments),re=this.__zoom,B=F==null?N(G):typeof F=="function"?F.apply(this,arguments):F;return a(au.translate(B[0],B[1]).scale(re.k).translate(typeof H=="function"?-H.apply(this,arguments):-H,typeof O=="function"?-O.apply(this,arguments):-O),G,c)},F,J)};function T(L,H){return H=Math.max(l[0],Math.min(l[1],H)),H===L.k?L:new Tr(H,L.x,L.y)}function E(L,H,O){var F=H[0]-O[0]*L.k,J=H[1]-O[1]*L.k;return F===L.x&&J===L.y?L:new Tr(L.k,F,J)}function N(L){return[(+L[0][0]+ +L[1][0])/2,(+L[0][1]+ +L[1][1])/2]}function R(L,H,O,F){L.on("start.zoom",function(){z(this,arguments).event(F).start()}).on("interrupt.zoom end.zoom",function(){z(this,arguments).event(F).end()}).tween("zoom",function(){var J=this,G=arguments,re=z(J,G).event(F),B=n.apply(J,G),Y=O==null?N(B):typeof O=="function"?O.apply(J,G):O,ae=Math.max(B[1][0]-B[0][0],B[1][1]-B[0][1]),U=J.__zoom,Z=typeof H=="function"?H.apply(J,G):H,ne=f(U.invert(Y).concat(ae/U.k),Z.invert(Y).concat(ae/Z.k));return function(le){if(le===1)le=Z;else{var K=ne(le),de=ae/K[2];le=new Tr(de,Y[0]-K[0]*de,Y[1]-K[1]*de)}re.zoom(null,le)}})}function z(L,H,O){return!O&&L.__zooming||new j(L,H)}function j(L,H){this.that=L,this.args=H,this.active=0,this.sourceEvent=null,this.extent=n.apply(L,H),this.taps=0}j.prototype={event:function(L){return L&&(this.sourceEvent=L),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(L,H){return this.mouse&&L!=="mouse"&&(this.mouse[1]=H.invert(this.mouse[0])),this.touch0&&L!=="touch"&&(this.touch0[1]=H.invert(this.touch0[0])),this.touch1&&L!=="touch"&&(this.touch1[1]=H.invert(this.touch1[0])),this.that.__zoom=H,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(L){var H=fn(this.that).datum();h.call(L,this.that,new J5(L,{sourceEvent:this.sourceEvent,target:C,transform:this.that.__zoom,dispatch:h}),H)}};function A(L,...H){if(!e.apply(this,arguments))return;var O=z(this,H).event(L),F=this.__zoom,J=Math.max(l[0],Math.min(l[1],F.k*Math.pow(2,i.apply(this,arguments)))),G=Dn(L);if(O.wheel)(O.mouse[0][0]!==G[0]||O.mouse[0][1]!==G[1])&&(O.mouse[1]=F.invert(O.mouse[0]=G)),clearTimeout(O.wheel);else{if(F.k===J)return;O.mouse=[G,F.invert(G)],Ic(this),O.start()}ps(L),O.wheel=setTimeout(re,_),O.zoom("mouse",a(E(T(F,J),O.mouse[0],O.mouse[1]),O.extent,c));function re(){O.wheel=null,O.end()}}function D(L,...H){if(m||!e.apply(this,arguments))return;var O=L.currentTarget,F=z(this,H,!0).event(L),J=fn(L.view).on("mousemove.zoom",Y,!0).on("mouseup.zoom",ae,!0),G=Dn(L,O),re=L.clientX,B=L.clientY;t2(L.view),ah(L),F.mouse=[G,this.__zoom.invert(G)],Ic(this),F.start();function Y(U){if(ps(U),!F.moved){var Z=U.clientX-re,ne=U.clientY-B;F.moved=Z*Z+ne*ne>S}F.event(U).zoom("mouse",a(E(F.that.__zoom,F.mouse[0]=Dn(U,O),F.mouse[1]),F.extent,c))}function ae(U){J.on("mousemove.zoom mouseup.zoom",null),n2(U.view,F.moved),ps(U),F.event(U).end()}}function I(L,...H){if(e.apply(this,arguments)){var O=this.__zoom,F=Dn(L.changedTouches?L.changedTouches[0]:L,this),J=O.invert(F),G=O.k*(L.shiftKey?.5:2),re=a(E(T(O,G),F,J),n.apply(this,H),c);ps(L),d>0?fn(this).transition().duration(d).call(R,re,F,L):fn(this).call(C.transform,re,F,L)}}function P(L,...H){if(e.apply(this,arguments)){var O=L.touches,F=O.length,J=z(this,H,L.changedTouches.length===F).event(L),G,re,B,Y;for(ah(L),re=0;re<F;++re)B=O[re],Y=Dn(B,this),Y=[Y,this.__zoom.invert(Y),B.identifier],J.touch0?!J.touch1&&J.touch0[2]!==Y[2]&&(J.touch1=Y,J.taps=0):(J.touch0=Y,G=!0,J.taps=1+!!p);p&&(p=clearTimeout(p)),G&&(J.taps<2&&(v=Y[0],p=setTimeout(function(){p=null},b)),Ic(this),J.start())}}function V(L,...H){if(this.__zooming){var O=z(this,H).event(L),F=L.changedTouches,J=F.length,G,re,B,Y;for(ps(L),G=0;G<J;++G)re=F[G],B=Dn(re,this),O.touch0&&O.touch0[2]===re.identifier?O.touch0[0]=B:O.touch1&&O.touch1[2]===re.identifier&&(O.touch1[0]=B);if(re=O.that.__zoom,O.touch1){var ae=O.touch0[0],U=O.touch0[1],Z=O.touch1[0],ne=O.touch1[1],le=(le=Z[0]-ae[0])*le+(le=Z[1]-ae[1])*le,K=(K=ne[0]-U[0])*K+(K=ne[1]-U[1])*K;re=T(re,Math.sqrt(le/K)),B=[(ae[0]+Z[0])/2,(ae[1]+Z[1])/2],Y=[(U[0]+ne[0])/2,(U[1]+ne[1])/2]}else if(O.touch0)B=O.touch0[0],Y=O.touch0[1];else return;O.zoom("touch",a(E(re,B,Y),O.extent,c))}}function $(L,...H){if(this.__zooming){var O=z(this,H).event(L),F=L.changedTouches,J=F.length,G,re;for(ah(L),m&&clearTimeout(m),m=setTimeout(function(){m=null},b),G=0;G<J;++G)re=F[G],O.touch0&&O.touch0[2]===re.identifier?delete O.touch0:O.touch1&&O.touch1[2]===re.identifier&&delete O.touch1;if(O.touch1&&!O.touch0&&(O.touch0=O.touch1,delete O.touch1),O.touch0)O.touch0[1]=this.__zoom.invert(O.touch0[0]);else if(O.end(),O.taps===2&&(re=Dn(re,this),Math.hypot(v[0]-re[0],v[1]-re[1])<w)){var B=fn(this).on("dblclick.zoom");B&&B.apply(this,arguments)}}}return C.wheelDelta=function(L){return arguments.length?(i=typeof L=="function"?L:Cc(+L),C):i},C.filter=function(L){return arguments.length?(e=typeof L=="function"?L:Cc(!!L),C):e},C.touchable=function(L){return arguments.length?(o=typeof L=="function"?L:Cc(!!L),C):o},C.extent=function(L){return arguments.length?(n=typeof L=="function"?L:Cc([[+L[0][0],+L[0][1]],[+L[1][0],+L[1][1]]]),C):n},C.scaleExtent=function(L){return arguments.length?(l[0]=+L[0],l[1]=+L[1],C):[l[0],l[1]]},C.translateExtent=function(L){return arguments.length?(c[0][0]=+L[0][0],c[1][0]=+L[1][0],c[0][1]=+L[0][1],c[1][1]=+L[1][1],C):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},C.constrain=function(L){return arguments.length?(a=L,C):a},C.duration=function(L){return arguments.length?(d=+L,C):d},C.interpolate=function(L){return arguments.length?(f=L,C):f},C.on=function(){var L=h.on.apply(h,arguments);return L===h?C:L},C.clickDistance=function(L){return arguments.length?(S=(L=+L)*L,C):Math.sqrt(S)},C.tapDistance=function(L){return arguments.length?(w=+L,C):w},C}const Jn={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:n,sourceHandle:a,targetHandle:i})=>`Couldn't create edge for ${e} handle id: "${e==="source"?a:i}", edge id: ${n}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},Rs=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],b2=["Enter"," ","Escape"],x2={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:n,y:a})=>`Moved selected node ${e}. New position, x: ${n}, y: ${a}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var no;(function(e){e.Strict="strict",e.Loose="loose"})(no||(no={}));var Ua;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Ua||(Ua={}));var Ms;(function(e){e.Partial="partial",e.Full="full"})(Ms||(Ms={}));const _2={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var ha;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(ha||(ha={}));var Wc;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Wc||(Wc={}));var je;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(je||(je={}));const sS={[je.Left]:je.Right,[je.Right]:je.Left,[je.Top]:je.Bottom,[je.Bottom]:je.Top};function S2(e){return e===null?null:e?"valid":"invalid"}const w2=e=>"id"in e&&"source"in e&&"target"in e,i6=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),hb=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Us=(e,n=[0,0])=>{const{width:a,height:i}=Rr(e),o=e.origin??n,l=a*o[0],c=i*o[1];return{x:e.position.x-l,y:e.position.y-c}},o6=(e,n={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const a=e.reduce((i,o)=>{const l=typeof o=="string";let c=!n.nodeLookup&&!l?o:void 0;n.nodeLookup&&(c=l?n.nodeLookup.get(o):hb(o)?o:n.nodeLookup.get(o.id));const d=c?Xc(c,n.nodeOrigin):{x:0,y:0,x2:0,y2:0};return iu(i,d)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return ou(a)},Vs=(e,n={})=>{if(e.size===0)return{x:0,y:0,width:0,height:0};let a={x:1/0,y:1/0,x2:-1/0,y2:-1/0};return e.forEach(i=>{if(n.filter===void 0||n.filter(i)){const o=Xc(i);a=iu(a,o)}}),ou(a)},pb=(e,n,[a,i,o]=[0,0,1],l=!1,c=!1)=>{const d={...Ps(n,[a,i,o]),width:n.width/o,height:n.height/o},f=[];for(const h of e.values()){const{measured:p,selectable:v=!0,hidden:m=!1}=h;if(c&&!v||m)continue;const b=p.width??h.width??h.initialWidth??null,_=p.height??h.height??h.initialHeight??null,S=As(d,ao(h)),w=(b??0)*(_??0),C=l&&S>0;(!h.internals.handleBounds||C||S>=w||h.dragging)&&f.push(h)}return f},s6=(e,n)=>{const a=new Set;return e.forEach(i=>{a.add(i.id)}),n.filter(i=>a.has(i.source)||a.has(i.target))};function l6(e,n){const a=new Map,i=n?.nodes?new Set(n.nodes.map(o=>o.id)):null;return e.forEach(o=>{o.measured.width&&o.measured.height&&(n?.includeHiddenNodes||!o.hidden)&&(!i||i.has(o.id))&&a.set(o.id,o)}),a}async function c6({nodes:e,width:n,height:a,panZoom:i,minZoom:o,maxZoom:l},c){if(e.size===0)return Promise.resolve(!0);const d=l6(e,c),f=Vs(d),h=gb(f,n,a,c?.minZoom??o,c?.maxZoom??l,c?.padding??.1);return await i.setViewport(h,{duration:c?.duration,ease:c?.ease,interpolate:c?.interpolate}),Promise.resolve(!0)}function E2({nodeId:e,nextPosition:n,nodeLookup:a,nodeOrigin:i=[0,0],nodeExtent:o,onError:l}){const c=a.get(e),d=c.parentId?a.get(c.parentId):void 0,{x:f,y:h}=d?d.internals.positionAbsolute:{x:0,y:0},p=c.origin??i;let v=c.extent||o;if(c.extent==="parent"&&!c.expandParent)if(!d)l?.("005",Jn.error005());else{const b=d.measured.width,_=d.measured.height;b&&_&&(v=[[f,h],[f+b,h+_]])}else d&&io(c.extent)&&(v=[[c.extent[0][0]+f,c.extent[0][1]+h],[c.extent[1][0]+f,c.extent[1][1]+h]]);const m=io(v)?Ga(n,v,c.measured):n;return(c.measured.width===void 0||c.measured.height===void 0)&&l?.("015",Jn.error015()),{position:{x:m.x-f+(c.measured.width??0)*p[0],y:m.y-h+(c.measured.height??0)*p[1]},positionAbsolute:m}}async function u6({nodesToRemove:e=[],edgesToRemove:n=[],nodes:a,edges:i,onBeforeDelete:o}){const l=new Set(e.map(m=>m.id)),c=[];for(const m of a){if(m.deletable===!1)continue;const b=l.has(m.id),_=!b&&m.parentId&&c.find(S=>S.id===m.parentId);(b||_)&&c.push(m)}const d=new Set(n.map(m=>m.id)),f=i.filter(m=>m.deletable!==!1),p=s6(c,f);for(const m of f)d.has(m.id)&&!p.find(_=>_.id===m.id)&&p.push(m);if(!o)return{edges:p,nodes:c};const v=await o({nodes:c,edges:p});return typeof v=="boolean"?v?{edges:p,nodes:c}:{edges:[],nodes:[]}:v}const ro=(e,n=0,a=1)=>Math.min(Math.max(e,n),a),Ga=(e={x:0,y:0},n,a)=>({x:ro(e.x,n[0][0],n[1][0]-(a?.width??0)),y:ro(e.y,n[0][1],n[1][1]-(a?.height??0))});function C2(e,n,a){const{width:i,height:o}=Rr(a),{x:l,y:c}=a.internals.positionAbsolute;return Ga(e,[[l,c],[l+i,c+o]],n)}const lS=(e,n,a)=>e<n?ro(Math.abs(e-n),1,n)/n:e>a?-ro(Math.abs(e-a),1,n)/n:0,T2=(e,n,a=15,i=40)=>{const o=lS(e.x,i,n.width-i)*a,l=lS(e.y,i,n.height-i)*a;return[o,l]},iu=(e,n)=>({x:Math.min(e.x,n.x),y:Math.min(e.y,n.y),x2:Math.max(e.x2,n.x2),y2:Math.max(e.y2,n.y2)}),Ky=({x:e,y:n,width:a,height:i})=>({x:e,y:n,x2:e+a,y2:n+i}),ou=({x:e,y:n,x2:a,y2:i})=>({x:e,y:n,width:a-e,height:i-n}),ao=(e,n=[0,0])=>{const{x:a,y:i}=hb(e)?e.internals.positionAbsolute:Us(e,n);return{x:a,y:i,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},Xc=(e,n=[0,0])=>{const{x:a,y:i}=hb(e)?e.internals.positionAbsolute:Us(e,n);return{x:a,y:i,x2:a+(e.measured?.width??e.width??e.initialWidth??0),y2:i+(e.measured?.height??e.height??e.initialHeight??0)}},j2=(e,n)=>ou(iu(Ky(e),Ky(n))),As=(e,n)=>{const a=Math.max(0,Math.min(e.x+e.width,n.x+n.width)-Math.max(e.x,n.x)),i=Math.max(0,Math.min(e.y+e.height,n.y+n.height)-Math.max(e.y,n.y));return Math.ceil(a*i)},cS=e=>On(e.width)&&On(e.height)&&On(e.x)&&On(e.y),On=e=>!isNaN(e)&&isFinite(e),d6=(e,n)=>{},Fs=(e,n=[1,1])=>({x:n[0]*Math.round(e.x/n[0]),y:n[1]*Math.round(e.y/n[1])}),Ps=({x:e,y:n},[a,i,o],l=!1,c=[1,1])=>{const d={x:(e-a)/o,y:(n-i)/o};return l?Fs(d,c):d},Kc=({x:e,y:n},[a,i,o])=>({x:e*o+a,y:n*o+i});function Pi(e,n){if(typeof e=="number")return Math.floor((n-n/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const a=parseFloat(e);if(!Number.isNaN(a))return Math.floor(a)}if(typeof e=="string"&&e.endsWith("%")){const a=parseFloat(e);if(!Number.isNaN(a))return Math.floor(n*a*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function f6(e,n,a){if(typeof e=="string"||typeof e=="number"){const i=Pi(e,a),o=Pi(e,n);return{top:i,right:o,bottom:i,left:o,x:o*2,y:i*2}}if(typeof e=="object"){const i=Pi(e.top??e.y??0,a),o=Pi(e.bottom??e.y??0,a),l=Pi(e.left??e.x??0,n),c=Pi(e.right??e.x??0,n);return{top:i,right:c,bottom:o,left:l,x:l+c,y:i+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function h6(e,n,a,i,o,l){const{x:c,y:d}=Kc(e,[n,a,i]),{x:f,y:h}=Kc({x:e.x+e.width,y:e.y+e.height},[n,a,i]),p=o-f,v=l-h;return{left:Math.floor(c),top:Math.floor(d),right:Math.floor(p),bottom:Math.floor(v)}}const gb=(e,n,a,i,o,l)=>{const c=f6(l,n,a),d=(n-c.x)/e.width,f=(a-c.y)/e.height,h=Math.min(d,f),p=ro(h,i,o),v=e.x+e.width/2,m=e.y+e.height/2,b=n/2-v*p,_=a/2-m*p,S=h6(e,b,_,p,n,a),w={left:Math.min(S.left-c.left,0),top:Math.min(S.top-c.top,0),right:Math.min(S.right-c.right,0),bottom:Math.min(S.bottom-c.bottom,0)};return{x:b-w.left+w.right,y:_-w.top+w.bottom,zoom:p}},zs=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function io(e){return e!=null&&e!=="parent"}function Rr(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function N2(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function R2(e,n={width:0,height:0},a,i,o){const l={...e},c=i.get(a);if(c){const d=c.origin||o;l.x+=c.internals.positionAbsolute.x-(n.width??0)*d[0],l.y+=c.internals.positionAbsolute.y-(n.height??0)*d[1]}return l}function uS(e,n){if(e.size!==n.size)return!1;for(const a of e)if(!n.has(a))return!1;return!0}function p6(){let e,n;return{promise:new Promise((i,o)=>{e=i,n=o}),resolve:e,reject:n}}function g6(e){return{...x2,...e||{}}}function Es(e,{snapGrid:n=[0,0],snapToGrid:a=!1,transform:i,containerBounds:o}){const{x:l,y:c}=qn(e),d=Ps({x:l-(o?.left??0),y:c-(o?.top??0)},i),{x:f,y:h}=a?Fs(d,n):d;return{xSnapped:f,ySnapped:h,...d}}const vb=e=>({width:e.offsetWidth,height:e.offsetHeight}),M2=e=>e?.getRootNode?.()||window?.document,v6=["INPUT","SELECT","TEXTAREA"];function A2(e){const n=e.composedPath?.()?.[0]||e.target;return n?.nodeType!==1?!1:v6.includes(n.nodeName)||n.hasAttribute("contenteditable")||!!n.closest(".nokey")}const z2=e=>"clientX"in e,qn=(e,n)=>{const a=z2(e),i=a?e.clientX:e.touches?.[0].clientX,o=a?e.clientY:e.touches?.[0].clientY;return{x:i-(n?.left??0),y:o-(n?.top??0)}},dS=(e,n,a,i,o)=>{const l=n.querySelectorAll(`.${e}`);return!l||!l.length?null:Array.from(l).map(c=>{const d=c.getBoundingClientRect();return{id:c.getAttribute("data-handleid"),type:e,nodeId:o,position:c.getAttribute("data-handlepos"),x:(d.left-a.left)/i,y:(d.top-a.top)/i,...vb(c)}})};function D2({sourceX:e,sourceY:n,targetX:a,targetY:i,sourceControlX:o,sourceControlY:l,targetControlX:c,targetControlY:d}){const f=e*.125+o*.375+c*.375+a*.125,h=n*.125+l*.375+d*.375+i*.125,p=Math.abs(f-e),v=Math.abs(h-n);return[f,h,p,v]}function Tc(e,n){return e>=0?.5*e:n*25*Math.sqrt(-e)}function fS({pos:e,x1:n,y1:a,x2:i,y2:o,c:l}){switch(e){case je.Left:return[n-Tc(n-i,l),a];case je.Right:return[n+Tc(i-n,l),a];case je.Top:return[n,a-Tc(a-o,l)];case je.Bottom:return[n,a+Tc(o-a,l)]}}function su({sourceX:e,sourceY:n,sourcePosition:a=je.Bottom,targetX:i,targetY:o,targetPosition:l=je.Top,curvature:c=.25}){const[d,f]=fS({pos:a,x1:e,y1:n,x2:i,y2:o,c}),[h,p]=fS({pos:l,x1:i,y1:o,x2:e,y2:n,c}),[v,m,b,_]=D2({sourceX:e,sourceY:n,targetX:i,targetY:o,sourceControlX:d,sourceControlY:f,targetControlX:h,targetControlY:p});return[`M${e},${n} C${d},${f} ${h},${p} ${i},${o}`,v,m,b,_]}function k2({sourceX:e,sourceY:n,targetX:a,targetY:i}){const o=Math.abs(a-e)/2,l=a<e?a+o:a-o,c=Math.abs(i-n)/2,d=i<n?i+c:i-c;return[l,d,o,c]}function m6({sourceNode:e,targetNode:n,selected:a=!1,zIndex:i,elevateOnSelect:o=!1}){if(i!==void 0)return i;const l=o&&a?1e3:0,c=Math.max(e.parentId||o&&e.selected?e.internals.z:0,n.parentId||o&&n.selected?n.internals.z:0);return l+c}function y6({sourceNode:e,targetNode:n,width:a,height:i,transform:o}){const l=iu(Xc(e),Xc(n));l.x===l.x2&&(l.x2+=1),l.y===l.y2&&(l.y2+=1);const c={x:-o[0]/o[2],y:-o[1]/o[2],width:a/o[2],height:i/o[2]};return As(c,ou(l))>0}const b6=({source:e,sourceHandle:n,target:a,targetHandle:i})=>`xy-edge__${e}${n||""}-${a}${i||""}`,x6=(e,n)=>n.some(a=>a.source===e.source&&a.target===e.target&&(a.sourceHandle===e.sourceHandle||!a.sourceHandle&&!e.sourceHandle)&&(a.targetHandle===e.targetHandle||!a.targetHandle&&!e.targetHandle)),_6=(e,n)=>{if(!e.source||!e.target)return n;let a;return w2(e)?a={...e}:a={...e,id:b6(e)},x6(a,n)?n:(a.sourceHandle===null&&delete a.sourceHandle,a.targetHandle===null&&delete a.targetHandle,n.concat(a))};function lu({sourceX:e,sourceY:n,targetX:a,targetY:i}){const[o,l,c,d]=k2({sourceX:e,sourceY:n,targetX:a,targetY:i});return[`M ${e},${n}L ${a},${i}`,o,l,c,d]}const hS={[je.Left]:{x:-1,y:0},[je.Right]:{x:1,y:0},[je.Top]:{x:0,y:-1},[je.Bottom]:{x:0,y:1}},S6=({source:e,sourcePosition:n=je.Bottom,target:a})=>n===je.Left||n===je.Right?e.x<a.x?{x:1,y:0}:{x:-1,y:0}:e.y<a.y?{x:0,y:1}:{x:0,y:-1},pS=(e,n)=>Math.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2));function w6({source:e,sourcePosition:n=je.Bottom,target:a,targetPosition:i=je.Top,center:o,offset:l,stepPosition:c}){const d=hS[n],f=hS[i],h={x:e.x+d.x*l,y:e.y+d.y*l},p={x:a.x+f.x*l,y:a.y+f.y*l},v=S6({source:h,sourcePosition:n,target:p}),m=v.x!==0?"x":"y",b=v[m];let _=[],S,w;const C={x:0,y:0},T={x:0,y:0},[,,E,N]=k2({sourceX:e.x,sourceY:e.y,targetX:a.x,targetY:a.y});if(d[m]*f[m]===-1){m==="x"?(S=o.x??h.x+(p.x-h.x)*c,w=o.y??(h.y+p.y)/2):(S=o.x??(h.x+p.x)/2,w=o.y??h.y+(p.y-h.y)*c);const z=[{x:S,y:h.y},{x:S,y:p.y}],j=[{x:h.x,y:w},{x:p.x,y:w}];d[m]===b?_=m==="x"?z:j:_=m==="x"?j:z}else{const z=[{x:h.x,y:p.y}],j=[{x:p.x,y:h.y}];if(m==="x"?_=d.x===b?j:z:_=d.y===b?z:j,n===i){const V=Math.abs(e[m]-a[m]);if(V<=l){const $=Math.min(l-1,l-V);d[m]===b?C[m]=(h[m]>e[m]?-1:1)*$:T[m]=(p[m]>a[m]?-1:1)*$}}if(n!==i){const V=m==="x"?"y":"x",$=d[m]===f[V],L=h[V]>p[V],H=h[V]<p[V];(d[m]===1&&(!$&&L||$&&H)||d[m]!==1&&(!$&&H||$&&L))&&(_=m==="x"?z:j)}const A={x:h.x+C.x,y:h.y+C.y},D={x:p.x+T.x,y:p.y+T.y},I=Math.max(Math.abs(A.x-_[0].x),Math.abs(D.x-_[0].x)),P=Math.max(Math.abs(A.y-_[0].y),Math.abs(D.y-_[0].y));I>=P?(S=(A.x+D.x)/2,w=_[0].y):(S=_[0].x,w=(A.y+D.y)/2)}return[[e,{x:h.x+C.x,y:h.y+C.y},..._,{x:p.x+T.x,y:p.y+T.y},a],S,w,E,N]}function E6(e,n,a,i){const o=Math.min(pS(e,n)/2,pS(n,a)/2,i),{x:l,y:c}=n;if(e.x===l&&l===a.x||e.y===c&&c===a.y)return`L${l} ${c}`;if(e.y===c){const h=e.x<a.x?-1:1,p=e.y<a.y?1:-1;return`L ${l+o*h},${c}Q ${l},${c} ${l},${c+o*p}`}const d=e.x<a.x?1:-1,f=e.y<a.y?-1:1;return`L ${l},${c+o*f}Q ${l},${c} ${l+o*d},${c}`}function Ds({sourceX:e,sourceY:n,sourcePosition:a=je.Bottom,targetX:i,targetY:o,targetPosition:l=je.Top,borderRadius:c=5,centerX:d,centerY:f,offset:h=20,stepPosition:p=.5}){const[v,m,b,_,S]=w6({source:{x:e,y:n},sourcePosition:a,target:{x:i,y:o},targetPosition:l,center:{x:d,y:f},offset:h,stepPosition:p});return[v.reduce((C,T,E)=>{let N="";return E>0&&E<v.length-1?N=E6(v[E-1],T,v[E+1],c):N=`${E===0?"M":"L"}${T.x} ${T.y}`,C+=N,C},""),m,b,_,S]}function gS(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function C6(e){const{sourceNode:n,targetNode:a}=e;if(!gS(n)||!gS(a))return null;const i=n.internals.handleBounds||vS(n.handles),o=a.internals.handleBounds||vS(a.handles),l=mS(i?.source??[],e.sourceHandle),c=mS(e.connectionMode===no.Strict?o?.target??[]:(o?.target??[]).concat(o?.source??[]),e.targetHandle);if(!l||!c)return e.onError?.("008",Jn.error008(l?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const d=l?.position||je.Bottom,f=c?.position||je.Top,h=ks(n,l,d),p=ks(a,c,f);return{sourceX:h.x,sourceY:h.y,targetX:p.x,targetY:p.y,sourcePosition:d,targetPosition:f}}function vS(e){if(!e)return null;const n=[],a=[];for(const i of e)i.width=i.width??1,i.height=i.height??1,i.type==="source"?n.push(i):i.type==="target"&&a.push(i);return{source:n,target:a}}function ks(e,n,a=je.Left,i=!1){const o=(n?.x??0)+e.internals.positionAbsolute.x,l=(n?.y??0)+e.internals.positionAbsolute.y,{width:c,height:d}=n??Rr(e);if(i)return{x:o+c/2,y:l+d/2};switch(n?.position??a){case je.Top:return{x:o+c/2,y:l};case je.Right:return{x:o+c,y:l+d/2};case je.Bottom:return{x:o+c/2,y:l+d};case je.Left:return{x:o,y:l+d/2}}}function mS(e,n){return e&&(n?e.find(a=>a.id===n):e[0])||null}function Zy(e,n){return e?typeof e=="string"?e:`${n?`${n}__`:""}${Object.keys(e).sort().map(i=>`${i}=${e[i]}`).join("&")}`:""}function T6(e,{id:n,defaultColor:a,defaultMarkerStart:i,defaultMarkerEnd:o}){const l=new Set;return e.reduce((c,d)=>([d.markerStart||i,d.markerEnd||o].forEach(f=>{if(f&&typeof f=="object"){const h=Zy(f,n);l.has(h)||(c.push({id:h,color:f.color||a,...f}),l.add(h))}}),c),[]).sort((c,d)=>c.id.localeCompare(d.id))}const mb={nodeOrigin:[0,0],nodeExtent:Rs,elevateNodesOnSelect:!0,defaults:{}},j6={...mb,checkEquality:!0};function yb(e,n){const a={...e};for(const i in n)n[i]!==void 0&&(a[i]=n[i]);return a}function N6(e,n,a){const i=yb(mb,a);for(const o of e.values())if(o.parentId)bb(o,e,n,i);else{const l=Us(o,i.nodeOrigin),c=io(o.extent)?o.extent:i.nodeExtent,d=Ga(l,c,Rr(o));o.internals.positionAbsolute=d}}function R6(e,n){if(!e.handles)return e.measured?n?.internals.handleBounds:void 0;const a=[],i=[];for(const o of e.handles){const l={id:o.id,width:o.width??1,height:o.height??1,nodeId:e.id,x:o.x,y:o.y,position:o.position,type:o.type};o.type==="source"?a.push(l):o.type==="target"&&i.push(l)}return{source:a,target:i}}function Qy(e,n,a,i){const o=yb(j6,i);let l=e.length>0;const c=new Map(n),d=o?.elevateNodesOnSelect?1e3:0;n.clear(),a.clear();for(const f of e){let h=c.get(f.id);if(o.checkEquality&&f===h?.internals.userNode)n.set(f.id,h);else{const p=Us(f,o.nodeOrigin),v=io(f.extent)?f.extent:o.nodeExtent,m=Ga(p,v,Rr(f));h={...o.defaults,...f,measured:{width:f.measured?.width,height:f.measured?.height},internals:{positionAbsolute:m,handleBounds:R6(f,h),z:O2(f,d),userNode:f}},n.set(f.id,h)}(h.measured===void 0||h.measured.width===void 0||h.measured.height===void 0)&&!h.hidden&&(l=!1),f.parentId&&bb(h,n,a,i)}return l}function M6(e,n){if(!e.parentId)return;const a=n.get(e.parentId);a?a.set(e.id,e):n.set(e.parentId,new Map([[e.id,e]]))}function bb(e,n,a,i){const{elevateNodesOnSelect:o,nodeOrigin:l,nodeExtent:c}=yb(mb,i),d=e.parentId,f=n.get(d);if(!f){console.warn(`Parent node ${d} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}M6(e,a);const h=o?1e3:0,{x:p,y:v,z:m}=A6(e,f,l,c,h),{positionAbsolute:b}=e.internals,_=p!==b.x||v!==b.y;(_||m!==e.internals.z)&&n.set(e.id,{...e,internals:{...e.internals,positionAbsolute:_?{x:p,y:v}:b,z:m}})}function O2(e,n){return(On(e.zIndex)?e.zIndex:0)+(e.selected?n:0)}function A6(e,n,a,i,o){const{x:l,y:c}=n.internals.positionAbsolute,d=Rr(e),f=Us(e,a),h=io(e.extent)?Ga(f,e.extent,d):f;let p=Ga({x:l+h.x,y:c+h.y},i,d);e.extent==="parent"&&(p=C2(p,d,n));const v=O2(e,o),m=n.internals.z??0;return{x:p.x,y:p.y,z:m>=v?m+1:v}}function xb(e,n,a,i=[0,0]){const o=[],l=new Map;for(const c of e){const d=n.get(c.parentId);if(!d)continue;const f=l.get(c.parentId)?.expandedRect??ao(d),h=j2(f,c.rect);l.set(c.parentId,{expandedRect:h,parent:d})}return l.size>0&&l.forEach(({expandedRect:c,parent:d},f)=>{const h=d.internals.positionAbsolute,p=Rr(d),v=d.origin??i,m=c.x<h.x?Math.round(Math.abs(h.x-c.x)):0,b=c.y<h.y?Math.round(Math.abs(h.y-c.y)):0,_=Math.max(p.width,Math.round(c.width)),S=Math.max(p.height,Math.round(c.height)),w=(_-p.width)*v[0],C=(S-p.height)*v[1];(m>0||b>0||w||C)&&(o.push({id:f,type:"position",position:{x:d.position.x-m+w,y:d.position.y-b+C}}),a.get(f)?.forEach(T=>{e.some(E=>E.id===T.id)||o.push({id:T.id,type:"position",position:{x:T.position.x+m,y:T.position.y+b}})})),(p.width<c.width||p.height<c.height||m||b)&&o.push({id:f,type:"dimensions",setAttributes:!0,dimensions:{width:_+(m?v[0]*m-w:0),height:S+(b?v[1]*b-C:0)}})}),o}function z6(e,n,a,i,o,l){const c=i?.querySelector(".xyflow__viewport");let d=!1;if(!c)return{changes:[],updatedInternals:d};const f=[],h=window.getComputedStyle(c),{m22:p}=new window.DOMMatrixReadOnly(h.transform),v=[];for(const m of e.values()){const b=n.get(m.id);if(!b)continue;if(b.hidden){n.set(b.id,{...b,internals:{...b.internals,handleBounds:void 0}}),d=!0;continue}const _=vb(m.nodeElement),S=b.measured.width!==_.width||b.measured.height!==_.height;if(!!(_.width&&_.height&&(S||!b.internals.handleBounds||m.force))){const C=m.nodeElement.getBoundingClientRect(),T=io(b.extent)?b.extent:l;let{positionAbsolute:E}=b.internals;b.parentId&&b.extent==="parent"?E=C2(E,_,n.get(b.parentId)):T&&(E=Ga(E,T,_));const N={...b,measured:_,internals:{...b.internals,positionAbsolute:E,handleBounds:{source:dS("source",m.nodeElement,C,p,b.id),target:dS("target",m.nodeElement,C,p,b.id)}}};n.set(b.id,N),b.parentId&&bb(N,n,a,{nodeOrigin:o}),d=!0,S&&(f.push({id:b.id,type:"dimensions",dimensions:_}),b.expandParent&&b.parentId&&v.push({id:b.id,parentId:b.parentId,rect:ao(N,o)}))}}if(v.length>0){const m=xb(v,n,a,o);f.push(...m)}return{changes:f,updatedInternals:d}}async function D6({delta:e,panZoom:n,transform:a,translateExtent:i,width:o,height:l}){if(!n||!e.x&&!e.y)return Promise.resolve(!1);const c=await n.setViewportConstrained({x:a[0]+e.x,y:a[1]+e.y,zoom:a[2]},[[0,0],[o,l]],i),d=!!c&&(c.x!==a[0]||c.y!==a[1]||c.k!==a[2]);return Promise.resolve(d)}function yS(e,n,a,i,o,l){let c=o;const d=i.get(c)||new Map;i.set(c,d.set(a,n)),c=`${o}-${e}`;const f=i.get(c)||new Map;if(i.set(c,f.set(a,n)),l){c=`${o}-${e}-${l}`;const h=i.get(c)||new Map;i.set(c,h.set(a,n))}}function q2(e,n,a){e.clear(),n.clear();for(const i of a){const{source:o,target:l,sourceHandle:c=null,targetHandle:d=null}=i,f={edgeId:i.id,source:o,target:l,sourceHandle:c,targetHandle:d},h=`${o}-${c}--${l}-${d}`,p=`${l}-${d}--${o}-${c}`;yS("source",f,p,e,o,c),yS("target",f,h,e,l,d),n.set(i.id,i)}}function B2(e,n){if(!e.parentId)return!1;const a=n.get(e.parentId);return a?a.selected?!0:B2(a,n):!1}function bS(e,n,a){let i=e;do{if(i?.matches?.(n))return!0;if(i===a)return!1;i=i?.parentElement}while(i);return!1}function k6(e,n,a,i){const o=new Map;for(const[l,c]of e)if((c.selected||c.id===i)&&(!c.parentId||!B2(c,e))&&(c.draggable||n&&typeof c.draggable>"u")){const d=e.get(l);d&&o.set(l,{id:l,position:d.position||{x:0,y:0},distance:{x:a.x-d.internals.positionAbsolute.x,y:a.y-d.internals.positionAbsolute.y},extent:d.extent,parentId:d.parentId,origin:d.origin,expandParent:d.expandParent,internals:{positionAbsolute:d.internals.positionAbsolute||{x:0,y:0}},measured:{width:d.measured.width??0,height:d.measured.height??0}})}return o}function ih({nodeId:e,dragItems:n,nodeLookup:a,dragging:i=!0}){const o=[];for(const[c,d]of n){const f=a.get(c)?.internals.userNode;f&&o.push({...f,position:d.position,dragging:i})}if(!e)return[o[0],o];const l=a.get(e)?.internals.userNode;return[l?{...l,position:n.get(e)?.position||l.position,dragging:i}:o[0],o]}function O6({dragItems:e,snapGrid:n,x:a,y:i}){const o=e.values().next().value;if(!o)return null;const l={x:a-o.distance.x,y:i-o.distance.y},c=Fs(l,n);return{x:c.x-l.x,y:c.y-l.y}}function q6({onNodeMouseDown:e,getStoreItems:n,onDragStart:a,onDrag:i,onDragStop:o}){let l={x:null,y:null},c=0,d=new Map,f=!1,h={x:0,y:0},p=null,v=!1,m=null,b=!1,_=!1,S=null;function w({noDragClassName:T,handleSelector:E,domNode:N,isSelectable:R,nodeId:z,nodeClickDistance:j=0}){m=fn(N);function A({x:V,y:$}){const{nodeLookup:L,nodeExtent:H,snapGrid:O,snapToGrid:F,nodeOrigin:J,onNodeDrag:G,onSelectionDrag:re,onError:B,updateNodePositions:Y}=n();l={x:V,y:$};let ae=!1;const U=d.size>1,Z=U&&H?Ky(Vs(d)):null,ne=U&&F?O6({dragItems:d,snapGrid:O,x:V,y:$}):null;for(const[le,K]of d){if(!L.has(le))continue;let de={x:V-K.distance.x,y:$-K.distance.y};F&&(de=ne?{x:Math.round(de.x+ne.x),y:Math.round(de.y+ne.y)}:Fs(de,O));let ye=null;if(U&&H&&!K.extent&&Z){const{positionAbsolute:W}=K.internals,se=W.x-Z.x+H[0][0],te=W.x+K.measured.width-Z.x2+H[1][0],me=W.y-Z.y+H[0][1],ve=W.y+K.measured.height-Z.y2+H[1][1];ye=[[se,me],[te,ve]]}const{position:xe,positionAbsolute:be}=E2({nodeId:le,nextPosition:de,nodeLookup:L,nodeExtent:ye||H,nodeOrigin:J,onError:B});ae=ae||K.position.x!==xe.x||K.position.y!==xe.y,K.position=xe,K.internals.positionAbsolute=be}if(_=_||ae,!!ae&&(Y(d,!0),S&&(i||G||!z&&re))){const[le,K]=ih({nodeId:z,dragItems:d,nodeLookup:L});i?.(S,d,le,K),G?.(S,le,K),z||re?.(S,K)}}async function D(){if(!p)return;const{transform:V,panBy:$,autoPanSpeed:L,autoPanOnNodeDrag:H}=n();if(!H){f=!1,cancelAnimationFrame(c);return}const[O,F]=T2(h,p,L);(O!==0||F!==0)&&(l.x=(l.x??0)-O/V[2],l.y=(l.y??0)-F/V[2],await $({x:O,y:F})&&A(l)),c=requestAnimationFrame(D)}function I(V){const{nodeLookup:$,multiSelectionActive:L,nodesDraggable:H,transform:O,snapGrid:F,snapToGrid:J,selectNodesOnDrag:G,onNodeDragStart:re,onSelectionDragStart:B,unselectNodesAndEdges:Y}=n();v=!0,(!G||!R)&&!L&&z&&($.get(z)?.selected||Y()),R&&G&&z&&e?.(z);const ae=Es(V.sourceEvent,{transform:O,snapGrid:F,snapToGrid:J,containerBounds:p});if(l=ae,d=k6($,H,ae,z),d.size>0&&(a||re||!z&&B)){const[U,Z]=ih({nodeId:z,dragItems:d,nodeLookup:$});a?.(V.sourceEvent,d,U,Z),re?.(V.sourceEvent,U,Z),z||B?.(V.sourceEvent,Z)}}const P=r2().clickDistance(j).on("start",V=>{const{domNode:$,nodeDragThreshold:L,transform:H,snapGrid:O,snapToGrid:F}=n();p=$?.getBoundingClientRect()||null,b=!1,_=!1,S=V.sourceEvent,L===0&&I(V),l=Es(V.sourceEvent,{transform:H,snapGrid:O,snapToGrid:F,containerBounds:p}),h=qn(V.sourceEvent,p)}).on("drag",V=>{const{autoPanOnNodeDrag:$,transform:L,snapGrid:H,snapToGrid:O,nodeDragThreshold:F,nodeLookup:J}=n(),G=Es(V.sourceEvent,{transform:L,snapGrid:H,snapToGrid:O,containerBounds:p});if(S=V.sourceEvent,(V.sourceEvent.type==="touchmove"&&V.sourceEvent.touches.length>1||z&&!J.has(z))&&(b=!0),!b){if(!f&&$&&v&&(f=!0,D()),!v){const re=qn(V.sourceEvent,p),B=re.x-h.x,Y=re.y-h.y;Math.sqrt(B*B+Y*Y)>F&&I(V)}(l.x!==G.xSnapped||l.y!==G.ySnapped)&&d&&v&&(h=qn(V.sourceEvent,p),A(G))}}).on("end",V=>{if(!(!v||b)&&(f=!1,v=!1,cancelAnimationFrame(c),d.size>0)){const{nodeLookup:$,updateNodePositions:L,onNodeDragStop:H,onSelectionDragStop:O}=n();if(_&&(L(d,!1),_=!1),o||H||!z&&O){const[F,J]=ih({nodeId:z,dragItems:d,nodeLookup:$,dragging:!1});o?.(V.sourceEvent,d,F,J),H?.(V.sourceEvent,F,J),z||O?.(V.sourceEvent,J)}}}).filter(V=>{const $=V.target;return!V.button&&(!T||!bS($,`.${T}`,N))&&(!E||bS($,E,N))});m.call(P)}function C(){m?.on(".drag",null)}return{update:w,destroy:C}}function B6(e,n,a){const i=[],o={x:e.x-a,y:e.y-a,width:a*2,height:a*2};for(const l of n.values())As(o,ao(l))>0&&i.push(l);return i}const L6=250;function H6(e,n,a,i){let o=[],l=1/0;const c=B6(e,a,n+L6);for(const d of c){const f=[...d.internals.handleBounds?.source??[],...d.internals.handleBounds?.target??[]];for(const h of f){if(i.nodeId===h.nodeId&&i.type===h.type&&i.id===h.id)continue;const{x:p,y:v}=ks(d,h,h.position,!0),m=Math.sqrt(Math.pow(p-e.x,2)+Math.pow(v-e.y,2));m>n||(m<l?(o=[{...h,x:p,y:v}],l=m):m===l&&o.push({...h,x:p,y:v}))}}if(!o.length)return null;if(o.length>1){const d=i.type==="source"?"target":"source";return o.find(f=>f.type===d)??o[0]}return o[0]}function L2(e,n,a,i,o,l=!1){const c=i.get(e);if(!c)return null;const d=o==="strict"?c.internals.handleBounds?.[n]:[...c.internals.handleBounds?.source??[],...c.internals.handleBounds?.target??[]],f=(a?d?.find(h=>h.id===a):d?.[0])??null;return f&&l?{...f,...ks(c,f,f.position,!0)}:f}function H2(e,n){return e||(n?.classList.contains("target")?"target":n?.classList.contains("source")?"source":null)}function I6(e,n){let a=null;return n?a=!0:e&&!n&&(a=!1),a}const I2=()=>!0;function U6(e,{connectionMode:n,connectionRadius:a,handleId:i,nodeId:o,edgeUpdaterType:l,isTarget:c,domNode:d,nodeLookup:f,lib:h,autoPanOnConnect:p,flowId:v,panBy:m,cancelConnection:b,onConnectStart:_,onConnect:S,onConnectEnd:w,isValidConnection:C=I2,onReconnectEnd:T,updateConnection:E,getTransform:N,getFromHandle:R,autoPanSpeed:z,dragThreshold:j=1,handleDomNode:A}){const D=M2(e.target);let I=0,P;const{x:V,y:$}=qn(e),L=H2(l,A),H=d?.getBoundingClientRect();let O=!1;if(!H||!L)return;const F=L2(o,L,i,f,n);if(!F)return;let J=qn(e,H),G=!1,re=null,B=!1,Y=null;function ae(){if(!p||!H)return;const[xe,be]=T2(J,H,z);m({x:xe,y:be}),I=requestAnimationFrame(ae)}const U={...F,nodeId:o,type:L,position:F.position},Z=f.get(o);let le={inProgress:!0,isValid:null,from:ks(Z,U,je.Left,!0),fromHandle:U,fromPosition:U.position,fromNode:Z,to:J,toHandle:null,toPosition:sS[U.position],toNode:null};function K(){O=!0,E(le),_?.(e,{nodeId:o,handleId:i,handleType:L})}j===0&&K();function de(xe){if(!O){const{x:te,y:me}=qn(xe),ve=te-V,Se=me-$;if(!(ve*ve+Se*Se>j*j))return;K()}if(!R()||!U){ye(xe);return}const be=N();J=qn(xe,H),P=H6(Ps(J,be,!1,[1,1]),a,f,U),G||(ae(),G=!0);const W=U2(xe,{handle:P,connectionMode:n,fromNodeId:o,fromHandleId:i,fromType:c?"target":"source",isValidConnection:C,doc:D,lib:h,flowId:v,nodeLookup:f});Y=W.handleDomNode,re=W.connection,B=I6(!!P,W.isValid);const se={...le,isValid:B,to:W.toHandle&&B?Kc({x:W.toHandle.x,y:W.toHandle.y},be):J,toHandle:W.toHandle,toPosition:B&&W.toHandle?W.toHandle.position:sS[U.position],toNode:W.toHandle?f.get(W.toHandle.nodeId):null};B&&P&&le.toHandle&&se.toHandle&&le.toHandle.type===se.toHandle.type&&le.toHandle.nodeId===se.toHandle.nodeId&&le.toHandle.id===se.toHandle.id&&le.to.x===se.to.x&&le.to.y===se.to.y||(E(se),le=se)}function ye(xe){if(!("touches"in xe&&xe.touches.length>0)){if(O){(P||Y)&&re&&B&&S?.(re);const{inProgress:be,...W}=le,se={...W,toPosition:le.toHandle?le.toPosition:null};w?.(xe,se),l&&T?.(xe,se)}b(),cancelAnimationFrame(I),G=!1,B=!1,re=null,Y=null,D.removeEventListener("mousemove",de),D.removeEventListener("mouseup",ye),D.removeEventListener("touchmove",de),D.removeEventListener("touchend",ye)}}D.addEventListener("mousemove",de),D.addEventListener("mouseup",ye),D.addEventListener("touchmove",de),D.addEventListener("touchend",ye)}function U2(e,{handle:n,connectionMode:a,fromNodeId:i,fromHandleId:o,fromType:l,doc:c,lib:d,flowId:f,isValidConnection:h=I2,nodeLookup:p}){const v=l==="target",m=n?c.querySelector(`.${d}-flow__handle[data-id="${f}-${n?.nodeId}-${n?.id}-${n?.type}"]`):null,{x:b,y:_}=qn(e),S=c.elementFromPoint(b,_),w=S?.classList.contains(`${d}-flow__handle`)?S:m,C={handleDomNode:w,isValid:!1,connection:null,toHandle:null};if(w){const T=H2(void 0,w),E=w.getAttribute("data-nodeid"),N=w.getAttribute("data-handleid"),R=w.classList.contains("connectable"),z=w.classList.contains("connectableend");if(!E||!T)return C;const j={source:v?E:i,sourceHandle:v?N:o,target:v?i:E,targetHandle:v?o:N};C.connection=j;const D=R&&z&&(a===no.Strict?v&&T==="source"||!v&&T==="target":E!==i||N!==o);C.isValid=D&&h(j),C.toHandle=L2(E,T,N,p,a,!0)}return C}const Jy={onPointerDown:U6,isValid:U2};function V6({domNode:e,panZoom:n,getTransform:a,getViewScale:i}){const o=fn(e);function l({translateExtent:d,width:f,height:h,zoomStep:p=1,pannable:v=!0,zoomable:m=!0,inversePan:b=!1}){const _=E=>{if(E.sourceEvent.type!=="wheel"||!n)return;const N=a(),R=E.sourceEvent.ctrlKey&&zs()?10:1,z=-E.sourceEvent.deltaY*(E.sourceEvent.deltaMode===1?.05:E.sourceEvent.deltaMode?1:.002)*p,j=N[2]*Math.pow(2,z*R);n.scaleTo(j)};let S=[0,0];const w=E=>{(E.sourceEvent.type==="mousedown"||E.sourceEvent.type==="touchstart")&&(S=[E.sourceEvent.clientX??E.sourceEvent.touches[0].clientX,E.sourceEvent.clientY??E.sourceEvent.touches[0].clientY])},C=E=>{const N=a();if(E.sourceEvent.type!=="mousemove"&&E.sourceEvent.type!=="touchmove"||!n)return;const R=[E.sourceEvent.clientX??E.sourceEvent.touches[0].clientX,E.sourceEvent.clientY??E.sourceEvent.touches[0].clientY],z=[R[0]-S[0],R[1]-S[1]];S=R;const j=i()*Math.max(N[2],Math.log(N[2]))*(b?-1:1),A={x:N[0]-z[0]*j,y:N[1]-z[1]*j},D=[[0,0],[f,h]];n.setViewportConstrained({x:A.x,y:A.y,zoom:N[2]},D,d)},T=y2().on("start",w).on("zoom",v?C:null).on("zoom.wheel",m?_:null);o.call(T,{})}function c(){o.on("zoom",null)}return{update:l,destroy:c,pointer:Dn}}const F6=(e,n)=>e.x!==n.x||e.y!==n.y||e.zoom!==n.k,cu=e=>({x:e.x,y:e.y,zoom:e.k}),oh=({x:e,y:n,zoom:a})=>au.translate(e,n).scale(a),Xi=(e,n)=>e.target.closest(`.${n}`),V2=(e,n)=>n===2&&Array.isArray(e)&&e.includes(2),P6=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,sh=(e,n=0,a=P6,i=()=>{})=>{const o=typeof n=="number"&&n>0;return o||i(),o?e.transition().duration(n).ease(a).on("end",i):e},F2=e=>{const n=e.ctrlKey&&zs()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*n};function G6({zoomPanValues:e,noWheelClassName:n,d3Selection:a,d3Zoom:i,panOnScrollMode:o,panOnScrollSpeed:l,zoomOnPinch:c,onPanZoomStart:d,onPanZoom:f,onPanZoomEnd:h}){return p=>{if(Xi(p,n))return p.ctrlKey&&p.preventDefault(),!1;p.preventDefault(),p.stopImmediatePropagation();const v=a.property("__zoom").k||1;if(p.ctrlKey&&c){const w=Dn(p),C=F2(p),T=v*Math.pow(2,C);i.scaleTo(a,T,w,p);return}const m=p.deltaMode===1?20:1;let b=o===Ua.Vertical?0:p.deltaX*m,_=o===Ua.Horizontal?0:p.deltaY*m;!zs()&&p.shiftKey&&o!==Ua.Vertical&&(b=p.deltaY*m,_=0),i.translateBy(a,-(b/v)*l,-(_/v)*l,{internal:!0});const S=cu(a.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,d?.(p,S)),e.isPanScrolling&&(f?.(p,S),e.panScrollTimeout=setTimeout(()=>{h?.(p,S),e.isPanScrolling=!1},150))}}function $6({noWheelClassName:e,preventScrolling:n,d3ZoomHandler:a}){return function(i,o){const l=i.type==="wheel",c=!n&&l&&!i.ctrlKey,d=Xi(i,e);if(i.ctrlKey&&l&&d&&i.preventDefault(),c||d)return null;i.preventDefault(),a.call(this,i,o)}}function Y6({zoomPanValues:e,onDraggingChange:n,onPanZoomStart:a}){return i=>{if(i.sourceEvent?.internal)return;const o=cu(i.transform);e.mouseButton=i.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=o,i.sourceEvent?.type==="mousedown"&&n(!0),a&&a?.(i.sourceEvent,o)}}function W6({zoomPanValues:e,panOnDrag:n,onPaneContextMenu:a,onTransformChange:i,onPanZoom:o}){return l=>{e.usedRightMouseButton=!!(a&&V2(n,e.mouseButton??0)),l.sourceEvent?.sync||i([l.transform.x,l.transform.y,l.transform.k]),o&&!l.sourceEvent?.internal&&o?.(l.sourceEvent,cu(l.transform))}}function X6({zoomPanValues:e,panOnDrag:n,panOnScroll:a,onDraggingChange:i,onPanZoomEnd:o,onPaneContextMenu:l}){return c=>{if(!c.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,l&&V2(n,e.mouseButton??0)&&!e.usedRightMouseButton&&c.sourceEvent&&l(c.sourceEvent),e.usedRightMouseButton=!1,i(!1),o&&F6(e.prevViewport,c.transform))){const d=cu(c.transform);e.prevViewport=d,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o?.(c.sourceEvent,d)},a?150:0)}}}function K6({zoomActivationKeyPressed:e,zoomOnScroll:n,zoomOnPinch:a,panOnDrag:i,panOnScroll:o,zoomOnDoubleClick:l,userSelectionActive:c,noWheelClassName:d,noPanClassName:f,lib:h,connectionInProgress:p}){return v=>{const m=e||n,b=a&&v.ctrlKey,_=v.type==="wheel";if(v.button===1&&v.type==="mousedown"&&(Xi(v,`${h}-flow__node`)||Xi(v,`${h}-flow__edge`)))return!0;if(!i&&!m&&!o&&!l&&!a||c||p&&!_||Xi(v,d)&&_||Xi(v,f)&&(!_||o&&_&&!e)||!a&&v.ctrlKey&&_)return!1;if(!a&&v.type==="touchstart"&&v.touches?.length>1)return v.preventDefault(),!1;if(!m&&!o&&!b&&_||!i&&(v.type==="mousedown"||v.type==="touchstart")||Array.isArray(i)&&!i.includes(v.button)&&v.type==="mousedown")return!1;const S=Array.isArray(i)&&i.includes(v.button)||!v.button||v.button<=1;return(!v.ctrlKey||_)&&S}}function Z6({domNode:e,minZoom:n,maxZoom:a,paneClickDistance:i,translateExtent:o,viewport:l,onPanZoom:c,onPanZoomStart:d,onPanZoomEnd:f,onDraggingChange:h}){const p={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},v=e.getBoundingClientRect(),m=y2().clickDistance(!On(i)||i<0?0:i).scaleExtent([n,a]).translateExtent(o),b=fn(e).call(m);E({x:l.x,y:l.y,zoom:ro(l.zoom,n,a)},[[0,0],[v.width,v.height]],o);const _=b.on("wheel.zoom"),S=b.on("dblclick.zoom");m.wheelDelta(F2);function w(V,$){return b?new Promise(L=>{m?.interpolate($?.interpolate==="linear"?ws:Bc).transform(sh(b,$?.duration,$?.ease,()=>L(!0)),V)}):Promise.resolve(!1)}function C({noWheelClassName:V,noPanClassName:$,onPaneContextMenu:L,userSelectionActive:H,panOnScroll:O,panOnDrag:F,panOnScrollMode:J,panOnScrollSpeed:G,preventScrolling:re,zoomOnPinch:B,zoomOnScroll:Y,zoomOnDoubleClick:ae,zoomActivationKeyPressed:U,lib:Z,onTransformChange:ne,connectionInProgress:le}){H&&!p.isZoomingOrPanning&&T();const de=O&&!U&&!H?G6({zoomPanValues:p,noWheelClassName:V,d3Selection:b,d3Zoom:m,panOnScrollMode:J,panOnScrollSpeed:G,zoomOnPinch:B,onPanZoomStart:d,onPanZoom:c,onPanZoomEnd:f}):$6({noWheelClassName:V,preventScrolling:re,d3ZoomHandler:_});if(b.on("wheel.zoom",de,{passive:!1}),!H){const xe=Y6({zoomPanValues:p,onDraggingChange:h,onPanZoomStart:d});m.on("start",xe);const be=W6({zoomPanValues:p,panOnDrag:F,onPaneContextMenu:!!L,onPanZoom:c,onTransformChange:ne});m.on("zoom",be);const W=X6({zoomPanValues:p,panOnDrag:F,panOnScroll:O,onPaneContextMenu:L,onPanZoomEnd:f,onDraggingChange:h});m.on("end",W)}const ye=K6({zoomActivationKeyPressed:U,panOnDrag:F,zoomOnScroll:Y,panOnScroll:O,zoomOnDoubleClick:ae,zoomOnPinch:B,userSelectionActive:H,noPanClassName:$,noWheelClassName:V,lib:Z,connectionInProgress:le});m.filter(ye),ae?b.on("dblclick.zoom",S):b.on("dblclick.zoom",null)}function T(){m.on("zoom",null)}async function E(V,$,L){const H=oh(V),O=m?.constrain()(H,$,L);return O&&await w(O),new Promise(F=>F(O))}async function N(V,$){const L=oh(V);return await w(L,$),new Promise(H=>H(L))}function R(V){if(b){const $=oh(V),L=b.property("__zoom");(L.k!==V.zoom||L.x!==V.x||L.y!==V.y)&&m?.transform(b,$,null,{sync:!0})}}function z(){const V=b?m2(b.node()):{x:0,y:0,k:1};return{x:V.x,y:V.y,zoom:V.k}}function j(V,$){return b?new Promise(L=>{m?.interpolate($?.interpolate==="linear"?ws:Bc).scaleTo(sh(b,$?.duration,$?.ease,()=>L(!0)),V)}):Promise.resolve(!1)}function A(V,$){return b?new Promise(L=>{m?.interpolate($?.interpolate==="linear"?ws:Bc).scaleBy(sh(b,$?.duration,$?.ease,()=>L(!0)),V)}):Promise.resolve(!1)}function D(V){m?.scaleExtent(V)}function I(V){m?.translateExtent(V)}function P(V){const $=!On(V)||V<0?0:V;m?.clickDistance($)}return{update:C,destroy:T,setViewport:N,setViewportConstrained:E,getViewport:z,scaleTo:j,scaleBy:A,setScaleExtent:D,setTranslateExtent:I,syncViewport:R,setClickDistance:P}}var oo;(function(e){e.Line="line",e.Handle="handle"})(oo||(oo={}));function Q6({width:e,prevWidth:n,height:a,prevHeight:i,affectsX:o,affectsY:l}){const c=e-n,d=a-i,f=[c>0?1:c<0?-1:0,d>0?1:d<0?-1:0];return c&&o&&(f[0]=f[0]*-1),d&&l&&(f[1]=f[1]*-1),f}function J6(e){const n=e.includes("right")||e.includes("left"),a=e.includes("bottom")||e.includes("top"),i=e.includes("left"),o=e.includes("top");return{isHorizontal:n,isVertical:a,affectsX:i,affectsY:o}}function sa(e,n){return Math.max(0,n-e)}function la(e,n){return Math.max(0,e-n)}function jc(e,n,a){return Math.max(0,n-e,e-a)}function xS(e,n){return e?!n:n}function eq(e,n,a,i,o,l,c,d){let{affectsX:f,affectsY:h}=n;const{isHorizontal:p,isVertical:v}=n,m=p&&v,{xSnapped:b,ySnapped:_}=a,{minWidth:S,maxWidth:w,minHeight:C,maxHeight:T}=i,{x:E,y:N,width:R,height:z,aspectRatio:j}=e;let A=Math.floor(p?b-e.pointerX:0),D=Math.floor(v?_-e.pointerY:0);const I=R+(f?-A:A),P=z+(h?-D:D),V=-l[0]*R,$=-l[1]*z;let L=jc(I,S,w),H=jc(P,C,T);if(c){let J=0,G=0;f&&A<0?J=sa(E+A+V,c[0][0]):!f&&A>0&&(J=la(E+I+V,c[1][0])),h&&D<0?G=sa(N+D+$,c[0][1]):!h&&D>0&&(G=la(N+P+$,c[1][1])),L=Math.max(L,J),H=Math.max(H,G)}if(d){let J=0,G=0;f&&A>0?J=la(E+A,d[0][0]):!f&&A<0&&(J=sa(E+I,d[1][0])),h&&D>0?G=la(N+D,d[0][1]):!h&&D<0&&(G=sa(N+P,d[1][1])),L=Math.max(L,J),H=Math.max(H,G)}if(o){if(p){const J=jc(I/j,C,T)*j;if(L=Math.max(L,J),c){let G=0;!f&&!h||f&&!h&&m?G=la(N+$+I/j,c[1][1])*j:G=sa(N+$+(f?A:-A)/j,c[0][1])*j,L=Math.max(L,G)}if(d){let G=0;!f&&!h||f&&!h&&m?G=sa(N+I/j,d[1][1])*j:G=la(N+(f?A:-A)/j,d[0][1])*j,L=Math.max(L,G)}}if(v){const J=jc(P*j,S,w)/j;if(H=Math.max(H,J),c){let G=0;!f&&!h||h&&!f&&m?G=la(E+P*j+V,c[1][0])/j:G=sa(E+(h?D:-D)*j+V,c[0][0])/j,H=Math.max(H,G)}if(d){let G=0;!f&&!h||h&&!f&&m?G=sa(E+P*j,d[1][0])/j:G=la(E+(h?D:-D)*j,d[0][0])/j,H=Math.max(H,G)}}}D=D+(D<0?H:-H),A=A+(A<0?L:-L),o&&(m?I>P*j?D=(xS(f,h)?-A:A)/j:A=(xS(f,h)?-D:D)*j:p?(D=A/j,h=f):(A=D*j,f=h));const O=f?E+A:E,F=h?N+D:N;return{width:R+(f?-A:A),height:z+(h?-D:D),x:l[0]*A*(f?-1:1)+O,y:l[1]*D*(h?-1:1)+F}}const P2={width:0,height:0,x:0,y:0},tq={...P2,pointerX:0,pointerY:0,aspectRatio:1};function nq(e){return[[0,0],[e.measured.width,e.measured.height]]}function rq(e,n,a){const i=n.position.x+e.position.x,o=n.position.y+e.position.y,l=e.measured.width??0,c=e.measured.height??0,d=a[0]*l,f=a[1]*c;return[[i-d,o-f],[i+l-d,o+c-f]]}function aq({domNode:e,nodeId:n,getStoreItems:a,onChange:i,onEnd:o}){const l=fn(e);function c({controlPosition:f,boundaries:h,keepAspectRatio:p,resizeDirection:v,onResizeStart:m,onResize:b,onResizeEnd:_,shouldResize:S}){let w={...P2},C={...tq};const T=J6(f);let E,N=null,R=[],z,j,A,D=!1;const I=r2().on("start",P=>{const{nodeLookup:V,transform:$,snapGrid:L,snapToGrid:H,nodeOrigin:O,paneDomNode:F}=a();if(E=V.get(n),!E)return;N=F?.getBoundingClientRect()??null;const{xSnapped:J,ySnapped:G}=Es(P.sourceEvent,{transform:$,snapGrid:L,snapToGrid:H,containerBounds:N});w={width:E.measured.width??0,height:E.measured.height??0,x:E.position.x??0,y:E.position.y??0},C={...w,pointerX:J,pointerY:G,aspectRatio:w.width/w.height},z=void 0,E.parentId&&(E.extent==="parent"||E.expandParent)&&(z=V.get(E.parentId),j=z&&E.extent==="parent"?nq(z):void 0),R=[],A=void 0;for(const[re,B]of V)if(B.parentId===n&&(R.push({id:re,position:{...B.position},extent:B.extent}),B.extent==="parent"||B.expandParent)){const Y=rq(B,E,B.origin??O);A?A=[[Math.min(Y[0][0],A[0][0]),Math.min(Y[0][1],A[0][1])],[Math.max(Y[1][0],A[1][0]),Math.max(Y[1][1],A[1][1])]]:A=Y}m?.(P,{...w})}).on("drag",P=>{const{transform:V,snapGrid:$,snapToGrid:L,nodeOrigin:H}=a(),O=Es(P.sourceEvent,{transform:V,snapGrid:$,snapToGrid:L,containerBounds:N}),F=[];if(!E)return;const{x:J,y:G,width:re,height:B}=w,Y={},ae=E.origin??H,{width:U,height:Z,x:ne,y:le}=eq(C,T,O,h,p,ae,j,A),K=U!==re,de=Z!==B,ye=ne!==J&&K,xe=le!==G&&de;if(!ye&&!xe&&!K&&!de)return;if((ye||xe||ae[0]===1||ae[1]===1)&&(Y.x=ye?ne:w.x,Y.y=xe?le:w.y,w.x=Y.x,w.y=Y.y,R.length>0)){const te=ne-J,me=le-G;for(const ve of R)ve.position={x:ve.position.x-te+ae[0]*(U-re),y:ve.position.y-me+ae[1]*(Z-B)},F.push(ve)}if((K||de)&&(Y.width=K&&(!v||v==="horizontal")?U:w.width,Y.height=de&&(!v||v==="vertical")?Z:w.height,w.width=Y.width,w.height=Y.height),z&&E.expandParent){const te=ae[0]*(Y.width??0);Y.x&&Y.x<te&&(w.x=te,C.x=C.x-(Y.x-te));const me=ae[1]*(Y.height??0);Y.y&&Y.y<me&&(w.y=me,C.y=C.y-(Y.y-me))}const be=Q6({width:w.width,prevWidth:re,height:w.height,prevHeight:B,affectsX:T.affectsX,affectsY:T.affectsY}),W={...w,direction:be};S?.(P,W)!==!1&&(D=!0,b?.(P,W),i(Y,F))}).on("end",P=>{D&&(_?.(P,{...w}),o?.({...w}),D=!1)});l.call(I)}function d(){l.on(".drag",null)}return{update:c,destroy:d}}var lh={exports:{}},ch={},uh={exports:{}},dh={};/**
 * @license React
 * use-sync-external-store-shim.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var _S;function iq(){if(_S)return dh;_S=1;var e=$a();function n(v,m){return v===m&&(v!==0||1/v===1/m)||v!==v&&m!==m}var a=typeof Object.is=="function"?Object.is:n,i=e.useState,o=e.useEffect,l=e.useLayoutEffect,c=e.useDebugValue;function d(v,m){var b=m(),_=i({inst:{value:b,getSnapshot:m}}),S=_[0].inst,w=_[1];return l(function(){S.value=b,S.getSnapshot=m,f(S)&&w({inst:S})},[v,b,m]),o(function(){return f(S)&&w({inst:S}),v(function(){f(S)&&w({inst:S})})},[v]),c(b),b}function f(v){var m=v.getSnapshot;v=v.value;try{var b=m();return!a(v,b)}catch{return!0}}function h(v,m){return m()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:d;return dh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,dh}var SS;function oq(){return SS||(SS=1,uh.exports=iq()),uh.exports}/**
 * @license React
 * use-sync-external-store-shim/with-selector.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var wS;function sq(){if(wS)return ch;wS=1;var e=$a(),n=oq();function a(h,p){return h===p&&(h!==0||1/h===1/p)||h!==h&&p!==p}var i=typeof Object.is=="function"?Object.is:a,o=n.useSyncExternalStore,l=e.useRef,c=e.useEffect,d=e.useMemo,f=e.useDebugValue;return ch.useSyncExternalStoreWithSelector=function(h,p,v,m,b){var _=l(null);if(_.current===null){var S={hasValue:!1,value:null};_.current=S}else S=_.current;_=d(function(){function C(z){if(!T){if(T=!0,E=z,z=m(z),b!==void 0&&S.hasValue){var j=S.value;if(b(j,z))return N=j}return N=z}if(j=N,i(E,z))return j;var A=m(z);return b!==void 0&&b(j,A)?(E=z,j):(E=z,N=A)}var T=!1,E,N,R=v===void 0?null:v;return[function(){return C(p())},R===null?void 0:function(){return C(R())}]},[p,v,m,b]);var w=o(h,_[0],_[1]);return c(function(){S.hasValue=!0,S.value=w},[w]),f(w),w},ch}var ES;function lq(){return ES||(ES=1,lh.exports=sq()),lh.exports}var cq=lq();const uq=Ls(cq),dq={},CS=e=>{let n;const a=new Set,i=(p,v)=>{const m=typeof p=="function"?p(n):p;if(!Object.is(m,n)){const b=n;n=v??(typeof m!="object"||m===null)?m:Object.assign({},n,m),a.forEach(_=>_(n,b))}},o=()=>n,f={setState:i,getState:o,getInitialState:()=>h,subscribe:p=>(a.add(p),()=>a.delete(p)),destroy:()=>{(dq?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),a.clear()}},h=n=e(i,o,f);return f},fq=e=>e?CS(e):CS,{useDebugValue:hq}=Kn,{useSyncExternalStoreWithSelector:pq}=uq,gq=e=>e;function G2(e,n=gq,a){const i=pq(e.subscribe,e.getState,e.getServerState||e.getInitialState,n,a);return hq(i),i}const TS=(e,n)=>{const a=fq(e),i=(o,l=n)=>G2(a,o,l);return Object.assign(i,a),i},vq=(e,n)=>e?TS(e,n):TS;function pt(e,n){if(Object.is(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(const[i,o]of e)if(!Object.is(o,n.get(i)))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(const i of e)if(!n.has(i))return!1;return!0}const a=Object.keys(e);if(a.length!==Object.keys(n).length)return!1;for(const i of a)if(!Object.prototype.hasOwnProperty.call(n,i)||!Object.is(e[i],n[i]))return!1;return!0}var _b=Jc();const uu=q.createContext(null),mq=uu.Provider,$2=Jn.error001();function Ie(e,n){const a=q.useContext(uu);if(a===null)throw new Error($2);return G2(a,e,n)}function dt(){const e=q.useContext(uu);if(e===null)throw new Error($2);return q.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const jS={display:"none"},yq={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Y2="react-flow__node-desc",W2="react-flow__edge-desc",bq="react-flow__aria-live",xq=e=>e.ariaLiveMessage,_q=e=>e.ariaLabelConfig;function Sq({rfId:e}){const n=Ie(xq);return g.jsx("div",{id:`${bq}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:yq,children:n})}function wq({rfId:e,disableKeyboardA11y:n}){const a=Ie(_q);return g.jsxs(g.Fragment,{children:[g.jsx("div",{id:`${Y2}-${e}`,style:jS,children:n?a["node.a11yDescription.default"]:a["node.a11yDescription.keyboardDisabled"]}),g.jsx("div",{id:`${W2}-${e}`,style:jS,children:a["edge.a11yDescription.default"]}),!n&&g.jsx(Sq,{rfId:e})]})}const du=q.forwardRef(({position:e="top-left",children:n,className:a,style:i,...o},l)=>{const c=`${e}`.split("-");return g.jsx("div",{className:Tt(["react-flow__panel",a,...c]),style:i,ref:l,...o,children:n})});du.displayName="Panel";function Eq({proOptions:e,position:n="bottom-right"}){return e?.hideAttribution?null:g.jsx(du,{position:n,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:g.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const Cq=e=>{const n=[],a=[];for(const[,i]of e.nodeLookup)i.selected&&n.push(i.internals.userNode);for(const[,i]of e.edgeLookup)i.selected&&a.push(i);return{selectedNodes:n,selectedEdges:a}},Nc=e=>e.id;function Tq(e,n){return pt(e.selectedNodes.map(Nc),n.selectedNodes.map(Nc))&&pt(e.selectedEdges.map(Nc),n.selectedEdges.map(Nc))}function jq({onSelectionChange:e}){const n=dt(),{selectedNodes:a,selectedEdges:i}=Ie(Cq,Tq);return q.useEffect(()=>{const o={nodes:a,edges:i};e?.(o),n.getState().onSelectionChangeHandlers.forEach(l=>l(o))},[a,i,e]),null}const Nq=e=>!!e.onSelectionChangeHandlers;function Rq({onSelectionChange:e}){const n=Ie(Nq);return e||n?g.jsx(jq,{onSelectionChange:e}):null}const X2=[0,0],Mq={x:0,y:0,zoom:1},Aq=["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","paneClickDistance","ariaLabelConfig"],NS=[...Aq,"rfId"],zq=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setPaneClickDistance:e.setPaneClickDistance}),RS={translateExtent:Rs,nodeOrigin:X2,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1",paneClickDistance:0};function Dq(e){const{setNodes:n,setEdges:a,setMinZoom:i,setMaxZoom:o,setTranslateExtent:l,setNodeExtent:c,reset:d,setDefaultNodesAndEdges:f,setPaneClickDistance:h}=Ie(zq,pt),p=dt();q.useEffect(()=>(f(e.defaultNodes,e.defaultEdges),()=>{v.current=RS,d()}),[]);const v=q.useRef(RS);return q.useEffect(()=>{for(const m of NS){const b=e[m],_=v.current[m];b!==_&&(typeof e[m]>"u"||(m==="nodes"?n(b):m==="edges"?a(b):m==="minZoom"?i(b):m==="maxZoom"?o(b):m==="translateExtent"?l(b):m==="nodeExtent"?c(b):m==="paneClickDistance"?h(b):m==="ariaLabelConfig"?p.setState({ariaLabelConfig:g6(b)}):m==="fitView"?p.setState({fitViewQueued:b}):m==="fitViewOptions"?p.setState({fitViewOptions:b}):p.setState({[m]:b})))}v.current=e},NS.map(m=>e[m])),null}function MS(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function kq(e){const[n,a]=q.useState(e==="system"?null:e);return q.useEffect(()=>{if(e!=="system"){a(e);return}const i=MS(),o=()=>a(i?.matches?"dark":"light");return o(),i?.addEventListener("change",o),()=>{i?.removeEventListener("change",o)}},[e]),n!==null?n:MS()?.matches?"dark":"light"}const AS=typeof document<"u"?document:null;function Os(e=null,n={target:AS,actInsideInputWithModifier:!0}){const[a,i]=q.useState(!1),o=q.useRef(!1),l=q.useRef(new Set([])),[c,d]=q.useMemo(()=>{if(e!==null){const h=(Array.isArray(e)?e:[e]).filter(v=>typeof v=="string").map(v=>v.replace("+",`
`).replace(`

`,`
+`).split(`
`)),p=h.reduce((v,m)=>v.concat(...m),[]);return[h,p]}return[[],[]]},[e]);return q.useEffect(()=>{const f=n?.target??AS,h=n?.actInsideInputWithModifier??!0;if(e!==null){const p=b=>{if(o.current=b.ctrlKey||b.metaKey||b.shiftKey||b.altKey,(!o.current||o.current&&!h)&&A2(b))return!1;const S=DS(b.code,d);if(l.current.add(b[S]),zS(c,l.current,!1)){const w=b.composedPath?.()?.[0]||b.target,C=w?.nodeName==="BUTTON"||w?.nodeName==="A";n.preventDefault!==!1&&(o.current||!C)&&b.preventDefault(),i(!0)}},v=b=>{const _=DS(b.code,d);zS(c,l.current,!0)?(i(!1),l.current.clear()):l.current.delete(b[_]),b.key==="Meta"&&l.current.clear(),o.current=!1},m=()=>{l.current.clear(),i(!1)};return f?.addEventListener("keydown",p),f?.addEventListener("keyup",v),window.addEventListener("blur",m),window.addEventListener("contextmenu",m),()=>{f?.removeEventListener("keydown",p),f?.removeEventListener("keyup",v),window.removeEventListener("blur",m),window.removeEventListener("contextmenu",m)}}},[e,i]),a}function zS(e,n,a){return e.filter(i=>a||i.length===n.size).some(i=>i.every(o=>n.has(o)))}function DS(e,n){return n.includes(e)?"code":"key"}const Oq=()=>{const e=dt();return q.useMemo(()=>({zoomIn:n=>{const{panZoom:a}=e.getState();return a?a.scaleBy(1.2,{duration:n?.duration}):Promise.resolve(!1)},zoomOut:n=>{const{panZoom:a}=e.getState();return a?a.scaleBy(1/1.2,{duration:n?.duration}):Promise.resolve(!1)},zoomTo:(n,a)=>{const{panZoom:i}=e.getState();return i?i.scaleTo(n,{duration:a?.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(n,a)=>{const{transform:[i,o,l],panZoom:c}=e.getState();return c?(await c.setViewport({x:n.x??i,y:n.y??o,zoom:n.zoom??l},a),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[n,a,i]=e.getState().transform;return{x:n,y:a,zoom:i}},setCenter:async(n,a,i)=>e.getState().setCenter(n,a,i),fitBounds:async(n,a)=>{const{width:i,height:o,minZoom:l,maxZoom:c,panZoom:d}=e.getState(),f=gb(n,i,o,l,c,a?.padding??.1);return d?(await d.setViewport(f,{duration:a?.duration,ease:a?.ease,interpolate:a?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(n,a={})=>{const{transform:i,snapGrid:o,snapToGrid:l,domNode:c}=e.getState();if(!c)return n;const{x:d,y:f}=c.getBoundingClientRect(),h={x:n.x-d,y:n.y-f},p=a.snapGrid??o,v=a.snapToGrid??l;return Ps(h,i,v,p)},flowToScreenPosition:n=>{const{transform:a,domNode:i}=e.getState();if(!i)return n;const{x:o,y:l}=i.getBoundingClientRect(),c=Kc(n,a);return{x:c.x+o,y:c.y+l}}}),[])};function K2(e,n){const a=[],i=new Map,o=[];for(const l of e)if(l.type==="add"){o.push(l);continue}else if(l.type==="remove"||l.type==="replace")i.set(l.id,[l]);else{const c=i.get(l.id);c?c.push(l):i.set(l.id,[l])}for(const l of n){const c=i.get(l.id);if(!c){a.push(l);continue}if(c[0].type==="remove")continue;if(c[0].type==="replace"){a.push({...c[0].item});continue}const d={...l};for(const f of c)qq(f,d);a.push(d)}return o.length&&o.forEach(l=>{l.index!==void 0?a.splice(l.index,0,{...l.item}):a.push({...l.item})}),a}function qq(e,n){switch(e.type){case"select":{n.selected=e.selected;break}case"position":{typeof e.position<"u"&&(n.position=e.position),typeof e.dragging<"u"&&(n.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(n.measured??={},n.measured.width=e.dimensions.width,n.measured.height=e.dimensions.height,e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(n.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(n.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(n.resizing=e.resizing);break}}}function Z2(e,n){return K2(e,n)}function Q2(e,n){return K2(e,n)}function La(e,n){return{id:e,type:"select",selected:n}}function Ki(e,n=new Set,a=!1){const i=[];for(const[o,l]of e){const c=n.has(o);!(l.selected===void 0&&!c)&&l.selected!==c&&(a&&(l.selected=c),i.push(La(l.id,c)))}return i}function kS({items:e=[],lookup:n}){const a=[],i=new Map(e.map(o=>[o.id,o]));for(const[o,l]of e.entries()){const c=n.get(l.id),d=c?.internals?.userNode??c;d!==void 0&&d!==l&&a.push({id:l.id,item:l,type:"replace"}),d===void 0&&a.push({item:l,type:"add",index:o})}for(const[o]of n)i.get(o)===void 0&&a.push({id:o,type:"remove"});return a}function OS(e){return{id:e.id,type:"remove"}}const qS=e=>i6(e),Bq=e=>w2(e);function J2(e){return q.forwardRef(e)}const Lq=typeof window<"u"?q.useLayoutEffect:q.useEffect;function BS(e){const[n,a]=q.useState(BigInt(0)),[i]=q.useState(()=>Hq(()=>a(o=>o+BigInt(1))));return Lq(()=>{const o=i.get();o.length&&(e(o),i.reset())},[n]),i}function Hq(e){let n=[];return{get:()=>n,reset:()=>{n=[]},push:a=>{n.push(a),e()}}}const eR=q.createContext(null);function Iq({children:e}){const n=dt(),a=q.useCallback(d=>{const{nodes:f=[],setNodes:h,hasDefaultNodes:p,onNodesChange:v,nodeLookup:m,fitViewQueued:b}=n.getState();let _=f;for(const w of d)_=typeof w=="function"?w(_):w;const S=kS({items:_,lookup:m});p&&h(_),S.length>0?v?.(S):b&&window.requestAnimationFrame(()=>{const{fitViewQueued:w,nodes:C,setNodes:T}=n.getState();w&&T(C)})},[]),i=BS(a),o=q.useCallback(d=>{const{edges:f=[],setEdges:h,hasDefaultEdges:p,onEdgesChange:v,edgeLookup:m}=n.getState();let b=f;for(const _ of d)b=typeof _=="function"?_(b):_;p?h(b):v&&v(kS({items:b,lookup:m}))},[]),l=BS(o),c=q.useMemo(()=>({nodeQueue:i,edgeQueue:l}),[]);return g.jsx(eR.Provider,{value:c,children:e})}function Uq(){const e=q.useContext(eR);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const Vq=e=>!!e.panZoom;function fu(){const e=Oq(),n=dt(),a=Uq(),i=Ie(Vq),o=q.useMemo(()=>{const l=v=>n.getState().nodeLookup.get(v),c=v=>{a.nodeQueue.push(v)},d=v=>{a.edgeQueue.push(v)},f=v=>{const{nodeLookup:m,nodeOrigin:b}=n.getState(),_=qS(v)?v:m.get(v.id),S=_.parentId?R2(_.position,_.measured,_.parentId,m,b):_.position,w={..._,position:S,width:_.measured?.width??_.width,height:_.measured?.height??_.height};return ao(w)},h=(v,m,b={replace:!1})=>{c(_=>_.map(S=>{if(S.id===v){const w=typeof m=="function"?m(S):m;return b.replace&&qS(w)?w:{...S,...w}}return S}))},p=(v,m,b={replace:!1})=>{d(_=>_.map(S=>{if(S.id===v){const w=typeof m=="function"?m(S):m;return b.replace&&Bq(w)?w:{...S,...w}}return S}))};return{getNodes:()=>n.getState().nodes.map(v=>({...v})),getNode:v=>l(v)?.internals.userNode,getInternalNode:l,getEdges:()=>{const{edges:v=[]}=n.getState();return v.map(m=>({...m}))},getEdge:v=>n.getState().edgeLookup.get(v),setNodes:c,setEdges:d,addNodes:v=>{const m=Array.isArray(v)?v:[v];a.nodeQueue.push(b=>[...b,...m])},addEdges:v=>{const m=Array.isArray(v)?v:[v];a.edgeQueue.push(b=>[...b,...m])},toObject:()=>{const{nodes:v=[],edges:m=[],transform:b}=n.getState(),[_,S,w]=b;return{nodes:v.map(C=>({...C})),edges:m.map(C=>({...C})),viewport:{x:_,y:S,zoom:w}}},deleteElements:async({nodes:v=[],edges:m=[]})=>{const{nodes:b,edges:_,onNodesDelete:S,onEdgesDelete:w,triggerNodeChanges:C,triggerEdgeChanges:T,onDelete:E,onBeforeDelete:N}=n.getState(),{nodes:R,edges:z}=await u6({nodesToRemove:v,edgesToRemove:m,nodes:b,edges:_,onBeforeDelete:N}),j=z.length>0,A=R.length>0;if(j){const D=z.map(OS);w?.(z),T(D)}if(A){const D=R.map(OS);S?.(R),C(D)}return(A||j)&&E?.({nodes:R,edges:z}),{deletedNodes:R,deletedEdges:z}},getIntersectingNodes:(v,m=!0,b)=>{const _=cS(v),S=_?v:f(v),w=b!==void 0;return S?(b||n.getState().nodes).filter(C=>{const T=n.getState().nodeLookup.get(C.id);if(T&&!_&&(C.id===v.id||!T.internals.positionAbsolute))return!1;const E=ao(w?C:T),N=As(E,S);return m&&N>0||N>=E.width*E.height||N>=S.width*S.height}):[]},isNodeIntersecting:(v,m,b=!0)=>{const S=cS(v)?v:f(v);if(!S)return!1;const w=As(S,m);return b&&w>0||w>=m.width*m.height||w>=S.width*S.height},updateNode:h,updateNodeData:(v,m,b={replace:!1})=>{h(v,_=>{const S=typeof m=="function"?m(_):m;return b.replace?{..._,data:S}:{..._,data:{..._.data,...S}}},b)},updateEdge:p,updateEdgeData:(v,m,b={replace:!1})=>{p(v,_=>{const S=typeof m=="function"?m(_):m;return b.replace?{..._,data:S}:{..._,data:{..._.data,...S}}},b)},getNodesBounds:v=>{const{nodeLookup:m,nodeOrigin:b}=n.getState();return o6(v,{nodeLookup:m,nodeOrigin:b})},getHandleConnections:({type:v,id:m,nodeId:b})=>Array.from(n.getState().connectionLookup.get(`${b}-${v}${m?`-${m}`:""}`)?.values()??[]),getNodeConnections:({type:v,handleId:m,nodeId:b})=>Array.from(n.getState().connectionLookup.get(`${b}${v?m?`-${v}-${m}`:`-${v}`:""}`)?.values()??[]),fitView:async v=>{const m=n.getState().fitViewResolver??p6();return n.setState({fitViewQueued:!0,fitViewOptions:v,fitViewResolver:m}),a.nodeQueue.push(b=>[...b]),m.promise}}},[]);return q.useMemo(()=>({...o,...e,viewportInitialized:i}),[i])}const LS=e=>e.selected,Fq=typeof window<"u"?window:void 0;function Pq({deleteKeyCode:e,multiSelectionKeyCode:n}){const a=dt(),{deleteElements:i}=fu(),o=Os(e,{actInsideInputWithModifier:!1}),l=Os(n,{target:Fq});q.useEffect(()=>{if(o){const{edges:c,nodes:d}=a.getState();i({nodes:d.filter(LS),edges:c.filter(LS)}),a.setState({nodesSelectionActive:!1})}},[o]),q.useEffect(()=>{a.setState({multiSelectionActive:l})},[l])}function Gq(e){const n=dt();q.useEffect(()=>{const a=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;const i=vb(e.current);(i.height===0||i.width===0)&&n.getState().onError?.("004",Jn.error004()),n.setState({width:i.width||500,height:i.height||500})};if(e.current){a(),window.addEventListener("resize",a);const i=new ResizeObserver(()=>a());return i.observe(e.current),()=>{window.removeEventListener("resize",a),i&&e.current&&i.unobserve(e.current)}}},[])}const hu={position:"absolute",width:"100%",height:"100%",top:0,left:0},$q=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function Yq({onPaneContextMenu:e,zoomOnScroll:n=!0,zoomOnPinch:a=!0,panOnScroll:i=!1,panOnScrollSpeed:o=.5,panOnScrollMode:l=Ua.Free,zoomOnDoubleClick:c=!0,panOnDrag:d=!0,defaultViewport:f,translateExtent:h,minZoom:p,maxZoom:v,zoomActivationKeyCode:m,preventScrolling:b=!0,children:_,noWheelClassName:S,noPanClassName:w,onViewportChange:C,isControlledViewport:T,paneClickDistance:E}){const N=dt(),R=q.useRef(null),{userSelectionActive:z,lib:j,connectionInProgress:A}=Ie($q,pt),D=Os(m),I=q.useRef();Gq(R);const P=q.useCallback(V=>{C?.({x:V[0],y:V[1],zoom:V[2]}),T||N.setState({transform:V})},[C,T]);return q.useEffect(()=>{if(R.current){I.current=Z6({domNode:R.current,minZoom:p,maxZoom:v,translateExtent:h,viewport:f,paneClickDistance:E,onDraggingChange:H=>N.setState({paneDragging:H}),onPanZoomStart:(H,O)=>{const{onViewportChangeStart:F,onMoveStart:J}=N.getState();J?.(H,O),F?.(O)},onPanZoom:(H,O)=>{const{onViewportChange:F,onMove:J}=N.getState();J?.(H,O),F?.(O)},onPanZoomEnd:(H,O)=>{const{onViewportChangeEnd:F,onMoveEnd:J}=N.getState();J?.(H,O),F?.(O)}});const{x:V,y:$,zoom:L}=I.current.getViewport();return N.setState({panZoom:I.current,transform:[V,$,L],domNode:R.current.closest(".react-flow")}),()=>{I.current?.destroy()}}},[]),q.useEffect(()=>{I.current?.update({onPaneContextMenu:e,zoomOnScroll:n,zoomOnPinch:a,panOnScroll:i,panOnScrollSpeed:o,panOnScrollMode:l,zoomOnDoubleClick:c,panOnDrag:d,zoomActivationKeyPressed:D,preventScrolling:b,noPanClassName:w,userSelectionActive:z,noWheelClassName:S,lib:j,onTransformChange:P,connectionInProgress:A})},[e,n,a,i,o,l,c,d,D,b,w,z,S,j,P,A]),g.jsx("div",{className:"react-flow__renderer",ref:R,style:hu,children:_})}const Wq=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Xq(){const{userSelectionActive:e,userSelectionRect:n}=Ie(Wq,pt);return e&&n?g.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:n.width,height:n.height,transform:`translate(${n.x}px, ${n.y}px)`}}):null}const fh=(e,n)=>a=>{a.target===n.current&&e?.(a)},Kq=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function Zq({isSelecting:e,selectionKeyPressed:n,selectionMode:a=Ms.Full,panOnDrag:i,selectionOnDrag:o,onSelectionStart:l,onSelectionEnd:c,onPaneClick:d,onPaneContextMenu:f,onPaneScroll:h,onPaneMouseEnter:p,onPaneMouseMove:v,onPaneMouseLeave:m,children:b}){const _=dt(),{userSelectionActive:S,elementsSelectable:w,dragging:C,connectionInProgress:T}=Ie(Kq,pt),E=w&&(e||S),N=q.useRef(null),R=q.useRef(),z=q.useRef(new Set),j=q.useRef(new Set),A=q.useRef(!1),D=q.useRef(!1),I=F=>{if(A.current||T){A.current=!1;return}d?.(F),_.getState().resetSelectedElements(),_.setState({nodesSelectionActive:!1})},P=F=>{if(Array.isArray(i)&&i?.includes(2)){F.preventDefault();return}f?.(F)},V=h?F=>h(F):void 0,$=F=>{const{resetSelectedElements:J,domNode:G}=_.getState();if(R.current=G?.getBoundingClientRect(),!w||!e||F.button!==0||F.target!==N.current||!R.current)return;F.target?.setPointerCapture?.(F.pointerId),D.current=!0,A.current=!1;const{x:re,y:B}=qn(F.nativeEvent,R.current);J(),_.setState({userSelectionRect:{width:0,height:0,startX:re,startY:B,x:re,y:B}}),l?.(F)},L=F=>{const{userSelectionRect:J,transform:G,nodeLookup:re,edgeLookup:B,connectionLookup:Y,triggerNodeChanges:ae,triggerEdgeChanges:U,defaultEdgeOptions:Z}=_.getState();if(!R.current||!J)return;A.current=!0;const{x:ne,y:le}=qn(F.nativeEvent,R.current),{startX:K,startY:de}=J,ye={startX:K,startY:de,x:ne<K?ne:K,y:le<de?le:de,width:Math.abs(ne-K),height:Math.abs(le-de)},xe=z.current,be=j.current;z.current=new Set(pb(re,ye,G,a===Ms.Partial,!0).map(se=>se.id)),j.current=new Set;const W=Z?.selectable??!0;for(const se of z.current){const te=Y.get(se);if(te)for(const{edgeId:me}of te.values()){const ve=B.get(me);ve&&(ve.selectable??W)&&j.current.add(me)}}if(!uS(xe,z.current)){const se=Ki(re,z.current,!0);ae(se)}if(!uS(be,j.current)){const se=Ki(B,j.current);U(se)}_.setState({userSelectionRect:ye,userSelectionActive:!0,nodesSelectionActive:!1})},H=F=>{if(F.button!==0||!D.current)return;F.target?.releasePointerCapture?.(F.pointerId);const{userSelectionRect:J}=_.getState();!S&&J&&F.target===N.current&&I?.(F),_.setState({userSelectionActive:!1,userSelectionRect:null,nodesSelectionActive:z.current.size>0}),c?.(F),(n||o)&&(A.current=!1),D.current=!1},O=i===!0||Array.isArray(i)&&i.includes(0);return g.jsxs("div",{className:Tt(["react-flow__pane",{draggable:O,dragging:C,selection:e}]),onClick:E?void 0:fh(I,N),onContextMenu:fh(P,N),onWheel:fh(V,N),onPointerEnter:E?void 0:p,onPointerDown:E?$:v,onPointerMove:E?L:v,onPointerUp:E?H:void 0,onPointerLeave:m,ref:N,style:hu,children:[b,g.jsx(Xq,{})]})}function eb({id:e,store:n,unselect:a=!1,nodeRef:i}){const{addSelectedNodes:o,unselectNodesAndEdges:l,multiSelectionActive:c,nodeLookup:d,onError:f}=n.getState(),h=d.get(e);if(!h){f?.("012",Jn.error012(e));return}n.setState({nodesSelectionActive:!1}),h.selected?(a||h.selected&&c)&&(l({nodes:[h],edges:[]}),requestAnimationFrame(()=>i?.current?.blur())):o([e])}function tR({nodeRef:e,disabled:n=!1,noDragClassName:a,handleSelector:i,nodeId:o,isSelectable:l,nodeClickDistance:c}){const d=dt(),[f,h]=q.useState(!1),p=q.useRef();return q.useEffect(()=>{p.current=q6({getStoreItems:()=>d.getState(),onNodeMouseDown:v=>{eb({id:v,store:d,nodeRef:e})},onDragStart:()=>{h(!0)},onDragStop:()=>{h(!1)}})},[]),q.useEffect(()=>{if(n)p.current?.destroy();else if(e.current)return p.current?.update({noDragClassName:a,handleSelector:i,domNode:e.current,isSelectable:l,nodeId:o,nodeClickDistance:c}),()=>{p.current?.destroy()}},[a,i,n,l,e,o]),f}const Qq=e=>n=>n.selected&&(n.draggable||e&&typeof n.draggable>"u");function nR(){const e=dt();return q.useCallback(a=>{const{nodeExtent:i,snapToGrid:o,snapGrid:l,nodesDraggable:c,onError:d,updateNodePositions:f,nodeLookup:h,nodeOrigin:p}=e.getState(),v=new Map,m=Qq(c),b=o?l[0]:5,_=o?l[1]:5,S=a.direction.x*b*a.factor,w=a.direction.y*_*a.factor;for(const[,C]of h){if(!m(C))continue;let T={x:C.internals.positionAbsolute.x+S,y:C.internals.positionAbsolute.y+w};o&&(T=Fs(T,l));const{position:E,positionAbsolute:N}=E2({nodeId:C.id,nextPosition:T,nodeLookup:h,nodeExtent:i,nodeOrigin:p,onError:d});C.position=E,C.internals.positionAbsolute=N,v.set(C.id,C)}f(v)},[])}const Sb=q.createContext(null),Jq=Sb.Provider;Sb.Consumer;const rR=()=>q.useContext(Sb),e4=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),t4=(e,n,a)=>i=>{const{connectionClickStartHandle:o,connectionMode:l,connection:c}=i,{fromHandle:d,toHandle:f,isValid:h}=c,p=f?.nodeId===e&&f?.id===n&&f?.type===a;return{connectingFrom:d?.nodeId===e&&d?.id===n&&d?.type===a,connectingTo:p,clickConnecting:o?.nodeId===e&&o?.id===n&&o?.type===a,isPossibleEndHandle:l===no.Strict?d?.type!==a:e!==d?.nodeId||n!==d?.id,connectionInProcess:!!d,clickConnectionInProcess:!!o,valid:p&&h}};function n4({type:e="source",position:n=je.Top,isValidConnection:a,isConnectable:i=!0,isConnectableStart:o=!0,isConnectableEnd:l=!0,id:c,onConnect:d,children:f,className:h,onMouseDown:p,onTouchStart:v,...m},b){const _=c||null,S=e==="target",w=dt(),C=rR(),{connectOnClick:T,noPanClassName:E,rfId:N}=Ie(e4,pt),{connectingFrom:R,connectingTo:z,clickConnecting:j,isPossibleEndHandle:A,connectionInProcess:D,clickConnectionInProcess:I,valid:P}=Ie(t4(C,_,e),pt);C||w.getState().onError?.("010",Jn.error010());const V=H=>{const{defaultEdgeOptions:O,onConnect:F,hasDefaultEdges:J}=w.getState(),G={...O,...H};if(J){const{edges:re,setEdges:B}=w.getState();B(_6(G,re))}F?.(G),d?.(G)},$=H=>{if(!C)return;const O=z2(H.nativeEvent);if(o&&(O&&H.button===0||!O)){const F=w.getState();Jy.onPointerDown(H.nativeEvent,{handleDomNode:H.currentTarget,autoPanOnConnect:F.autoPanOnConnect,connectionMode:F.connectionMode,connectionRadius:F.connectionRadius,domNode:F.domNode,nodeLookup:F.nodeLookup,lib:F.lib,isTarget:S,handleId:_,nodeId:C,flowId:F.rfId,panBy:F.panBy,cancelConnection:F.cancelConnection,onConnectStart:F.onConnectStart,onConnectEnd:F.onConnectEnd,updateConnection:F.updateConnection,onConnect:V,isValidConnection:a||F.isValidConnection,getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,autoPanSpeed:F.autoPanSpeed,dragThreshold:F.connectionDragThreshold})}O?p?.(H):v?.(H)},L=H=>{const{onClickConnectStart:O,onClickConnectEnd:F,connectionClickStartHandle:J,connectionMode:G,isValidConnection:re,lib:B,rfId:Y,nodeLookup:ae,connection:U}=w.getState();if(!C||!J&&!o)return;if(!J){O?.(H.nativeEvent,{nodeId:C,handleId:_,handleType:e}),w.setState({connectionClickStartHandle:{nodeId:C,type:e,id:_}});return}const Z=M2(H.target),ne=a||re,{connection:le,isValid:K}=Jy.isValid(H.nativeEvent,{handle:{nodeId:C,id:_,type:e},connectionMode:G,fromNodeId:J.nodeId,fromHandleId:J.id||null,fromType:J.type,isValidConnection:ne,flowId:Y,doc:Z,lib:B,nodeLookup:ae});K&&le&&V(le);const de=structuredClone(U);delete de.inProgress,de.toPosition=de.toHandle?de.toHandle.position:null,F?.(H,de),w.setState({connectionClickStartHandle:null})};return g.jsx("div",{"data-handleid":_,"data-nodeid":C,"data-handlepos":n,"data-id":`${N}-${C}-${_}-${e}`,className:Tt(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",E,h,{source:!S,target:S,connectable:i,connectablestart:o,connectableend:l,clickconnecting:j,connectingfrom:R,connectingto:z,valid:P,connectionindicator:i&&(!D||A)&&(D||I?l:o)}]),onMouseDown:$,onTouchStart:$,onClick:T?L:void 0,ref:b,...m,children:f})}const ga=q.memo(J2(n4));function r4({data:e,isConnectable:n,sourcePosition:a=je.Bottom}){return g.jsxs(g.Fragment,{children:[e?.label,g.jsx(ga,{type:"source",position:a,isConnectable:n})]})}function a4({data:e,isConnectable:n,targetPosition:a=je.Top,sourcePosition:i=je.Bottom}){return g.jsxs(g.Fragment,{children:[g.jsx(ga,{type:"target",position:a,isConnectable:n}),e?.label,g.jsx(ga,{type:"source",position:i,isConnectable:n})]})}function i4(){return null}function o4({data:e,isConnectable:n,targetPosition:a=je.Top}){return g.jsxs(g.Fragment,{children:[g.jsx(ga,{type:"target",position:a,isConnectable:n}),e?.label]})}const Zc={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},HS={input:r4,default:a4,output:o4,group:i4};function s4(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}const l4=e=>{const{width:n,height:a,x:i,y:o}=Vs(e.nodeLookup,{filter:l=>!!l.selected});return{width:On(n)?n:null,height:On(a)?a:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${i}px,${o}px)`}};function c4({onSelectionContextMenu:e,noPanClassName:n,disableKeyboardA11y:a}){const i=dt(),{width:o,height:l,transformString:c,userSelectionActive:d}=Ie(l4,pt),f=nR(),h=q.useRef(null);if(q.useEffect(()=>{a||h.current?.focus({preventScroll:!0})},[a]),tR({nodeRef:h}),d||!o||!l)return null;const p=e?m=>{const b=i.getState().nodes.filter(_=>_.selected);e(m,b)}:void 0,v=m=>{Object.prototype.hasOwnProperty.call(Zc,m.key)&&(m.preventDefault(),f({direction:Zc[m.key],factor:m.shiftKey?4:1}))};return g.jsx("div",{className:Tt(["react-flow__nodesselection","react-flow__container",n]),style:{transform:c},children:g.jsx("div",{ref:h,className:"react-flow__nodesselection-rect",onContextMenu:p,tabIndex:a?void 0:-1,onKeyDown:a?void 0:v,style:{width:o,height:l}})})}const IS=typeof window<"u"?window:void 0,u4=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function aR({children:e,onPaneClick:n,onPaneMouseEnter:a,onPaneMouseMove:i,onPaneMouseLeave:o,onPaneContextMenu:l,onPaneScroll:c,paneClickDistance:d,deleteKeyCode:f,selectionKeyCode:h,selectionOnDrag:p,selectionMode:v,onSelectionStart:m,onSelectionEnd:b,multiSelectionKeyCode:_,panActivationKeyCode:S,zoomActivationKeyCode:w,elementsSelectable:C,zoomOnScroll:T,zoomOnPinch:E,panOnScroll:N,panOnScrollSpeed:R,panOnScrollMode:z,zoomOnDoubleClick:j,panOnDrag:A,defaultViewport:D,translateExtent:I,minZoom:P,maxZoom:V,preventScrolling:$,onSelectionContextMenu:L,noWheelClassName:H,noPanClassName:O,disableKeyboardA11y:F,onViewportChange:J,isControlledViewport:G}){const{nodesSelectionActive:re,userSelectionActive:B}=Ie(u4),Y=Os(h,{target:IS}),ae=Os(S,{target:IS}),U=ae||A,Z=ae||N,ne=p&&U!==!0,le=Y||B||ne;return Pq({deleteKeyCode:f,multiSelectionKeyCode:_}),g.jsx(Yq,{onPaneContextMenu:l,elementsSelectable:C,zoomOnScroll:T,zoomOnPinch:E,panOnScroll:Z,panOnScrollSpeed:R,panOnScrollMode:z,zoomOnDoubleClick:j,panOnDrag:!Y&&U,defaultViewport:D,translateExtent:I,minZoom:P,maxZoom:V,zoomActivationKeyCode:w,preventScrolling:$,noWheelClassName:H,noPanClassName:O,onViewportChange:J,isControlledViewport:G,paneClickDistance:d,children:g.jsxs(Zq,{onSelectionStart:m,onSelectionEnd:b,onPaneClick:n,onPaneMouseEnter:a,onPaneMouseMove:i,onPaneMouseLeave:o,onPaneContextMenu:l,onPaneScroll:c,panOnDrag:U,isSelecting:!!le,selectionMode:v,selectionKeyPressed:Y,selectionOnDrag:ne,children:[e,re&&g.jsx(c4,{onSelectionContextMenu:L,noPanClassName:O,disableKeyboardA11y:F})]})})}aR.displayName="FlowRenderer";const d4=q.memo(aR),f4=e=>n=>e?pb(n.nodeLookup,{x:0,y:0,width:n.width,height:n.height},n.transform,!0).map(a=>a.id):Array.from(n.nodeLookup.keys());function h4(e){return Ie(q.useCallback(f4(e),[e]),pt)}const p4=e=>e.updateNodeInternals;function g4(){const e=Ie(p4),[n]=q.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(a=>{const i=new Map;a.forEach(o=>{const l=o.target.getAttribute("data-id");i.set(l,{id:l,nodeElement:o.target,force:!0})}),e(i)}));return q.useEffect(()=>()=>{n?.disconnect()},[n]),n}function v4({node:e,nodeType:n,hasDimensions:a,resizeObserver:i}){const o=dt(),l=q.useRef(null),c=q.useRef(null),d=q.useRef(e.sourcePosition),f=q.useRef(e.targetPosition),h=q.useRef(n),p=a&&!!e.internals.handleBounds;return q.useEffect(()=>{l.current&&!e.hidden&&(!p||c.current!==l.current)&&(c.current&&i?.unobserve(c.current),i?.observe(l.current),c.current=l.current)},[p,e.hidden]),q.useEffect(()=>()=>{c.current&&(i?.unobserve(c.current),c.current=null)},[]),q.useEffect(()=>{if(l.current){const v=h.current!==n,m=d.current!==e.sourcePosition,b=f.current!==e.targetPosition;(v||m||b)&&(h.current=n,d.current=e.sourcePosition,f.current=e.targetPosition,o.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:l.current,force:!0}]])))}},[e.id,n,e.sourcePosition,e.targetPosition]),l}function m4({id:e,onClick:n,onMouseEnter:a,onMouseMove:i,onMouseLeave:o,onContextMenu:l,onDoubleClick:c,nodesDraggable:d,elementsSelectable:f,nodesConnectable:h,nodesFocusable:p,resizeObserver:v,noDragClassName:m,noPanClassName:b,disableKeyboardA11y:_,rfId:S,nodeTypes:w,nodeClickDistance:C,onError:T}){const{node:E,internals:N,isParent:R}=Ie(K=>{const de=K.nodeLookup.get(e),ye=K.parentLookup.has(e);return{node:de,internals:de.internals,isParent:ye}},pt);let z=E.type||"default",j=w?.[z]||HS[z];j===void 0&&(T?.("003",Jn.error003(z)),z="default",j=w?.default||HS.default);const A=!!(E.draggable||d&&typeof E.draggable>"u"),D=!!(E.selectable||f&&typeof E.selectable>"u"),I=!!(E.connectable||h&&typeof E.connectable>"u"),P=!!(E.focusable||p&&typeof E.focusable>"u"),V=dt(),$=N2(E),L=v4({node:E,nodeType:z,hasDimensions:$,resizeObserver:v}),H=tR({nodeRef:L,disabled:E.hidden||!A,noDragClassName:m,handleSelector:E.dragHandle,nodeId:e,isSelectable:D,nodeClickDistance:C}),O=nR();if(E.hidden)return null;const F=Rr(E),J=s4(E),G=D||A||n||a||i||o,re=a?K=>a(K,{...N.userNode}):void 0,B=i?K=>i(K,{...N.userNode}):void 0,Y=o?K=>o(K,{...N.userNode}):void 0,ae=l?K=>l(K,{...N.userNode}):void 0,U=c?K=>c(K,{...N.userNode}):void 0,Z=K=>{const{selectNodesOnDrag:de,nodeDragThreshold:ye}=V.getState();D&&(!de||!A||ye>0)&&eb({id:e,store:V,nodeRef:L}),n&&n(K,{...N.userNode})},ne=K=>{if(!(A2(K.nativeEvent)||_)){if(b2.includes(K.key)&&D){const de=K.key==="Escape";eb({id:e,store:V,unselect:de,nodeRef:L})}else if(A&&E.selected&&Object.prototype.hasOwnProperty.call(Zc,K.key)){K.preventDefault();const{ariaLabelConfig:de}=V.getState();V.setState({ariaLiveMessage:de["node.a11yDescription.ariaLiveMessage"]({direction:K.key.replace("Arrow","").toLowerCase(),x:~~N.positionAbsolute.x,y:~~N.positionAbsolute.y})}),O({direction:Zc[K.key],factor:K.shiftKey?4:1})}}},le=()=>{if(_||!L.current?.matches(":focus-visible"))return;const{transform:K,width:de,height:ye,autoPanOnNodeFocus:xe,setCenter:be}=V.getState();if(!xe)return;pb(new Map([[e,E]]),{x:0,y:0,width:de,height:ye},K,!0).length>0||be(E.position.x+F.width/2,E.position.y+F.height/2,{zoom:K[2]})};return g.jsx("div",{className:Tt(["react-flow__node",`react-flow__node-${z}`,{[b]:A},E.className,{selected:E.selected,selectable:D,parent:R,draggable:A,dragging:H}]),ref:L,style:{zIndex:N.z,transform:`translate(${N.positionAbsolute.x}px,${N.positionAbsolute.y}px)`,pointerEvents:G?"all":"none",visibility:$?"visible":"hidden",...E.style,...J},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:re,onMouseMove:B,onMouseLeave:Y,onContextMenu:ae,onClick:Z,onDoubleClick:U,onKeyDown:P?ne:void 0,tabIndex:P?0:void 0,onFocus:P?le:void 0,role:E.ariaRole??(P?"group":void 0),"aria-roledescription":"node","aria-describedby":_?void 0:`${Y2}-${S}`,"aria-label":E.ariaLabel,...E.domAttributes,children:g.jsx(Jq,{value:e,children:g.jsx(j,{id:e,data:E.data,type:z,positionAbsoluteX:N.positionAbsolute.x,positionAbsoluteY:N.positionAbsolute.y,selected:E.selected??!1,selectable:D,draggable:A,deletable:E.deletable??!0,isConnectable:I,sourcePosition:E.sourcePosition,targetPosition:E.targetPosition,dragging:H,dragHandle:E.dragHandle,zIndex:N.z,parentId:E.parentId,...F})})})}const y4=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function iR(e){const{nodesDraggable:n,nodesConnectable:a,nodesFocusable:i,elementsSelectable:o,onError:l}=Ie(y4,pt),c=h4(e.onlyRenderVisibleElements),d=g4();return g.jsx("div",{className:"react-flow__nodes",style:hu,children:c.map(f=>g.jsx(m4,{id:f,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:d,nodesDraggable:n,nodesConnectable:a,nodesFocusable:i,elementsSelectable:o,nodeClickDistance:e.nodeClickDistance,onError:l},f))})}iR.displayName="NodeRenderer";const b4=q.memo(iR);function x4(e){return Ie(q.useCallback(a=>{if(!e)return a.edges.map(o=>o.id);const i=[];if(a.width&&a.height)for(const o of a.edges){const l=a.nodeLookup.get(o.source),c=a.nodeLookup.get(o.target);l&&c&&y6({sourceNode:l,targetNode:c,width:a.width,height:a.height,transform:a.transform})&&i.push(o.id)}return i},[e]),pt)}const _4=({color:e="none",strokeWidth:n=1})=>{const a={strokeWidth:n,...e&&{stroke:e}};return g.jsx("polyline",{className:"arrow",style:a,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},S4=({color:e="none",strokeWidth:n=1})=>{const a={strokeWidth:n,...e&&{stroke:e,fill:e}};return g.jsx("polyline",{className:"arrowclosed",style:a,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},US={[Wc.Arrow]:_4,[Wc.ArrowClosed]:S4};function w4(e){const n=dt();return q.useMemo(()=>Object.prototype.hasOwnProperty.call(US,e)?US[e]:(n.getState().onError?.("009",Jn.error009(e)),null),[e])}const E4=({id:e,type:n,color:a,width:i=12.5,height:o=12.5,markerUnits:l="strokeWidth",strokeWidth:c,orient:d="auto-start-reverse"})=>{const f=w4(n);return f?g.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${i}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:l,orient:d,refX:"0",refY:"0",children:g.jsx(f,{color:a,strokeWidth:c})}):null},oR=({defaultColor:e,rfId:n})=>{const a=Ie(l=>l.edges),i=Ie(l=>l.defaultEdgeOptions),o=q.useMemo(()=>T6(a,{id:n,defaultColor:e,defaultMarkerStart:i?.markerStart,defaultMarkerEnd:i?.markerEnd}),[a,i,n,e]);return o.length?g.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:g.jsx("defs",{children:o.map(l=>g.jsx(E4,{id:l.id,type:l.type,color:l.color,width:l.width,height:l.height,markerUnits:l.markerUnits,strokeWidth:l.strokeWidth,orient:l.orient},l.id))})}):null};oR.displayName="MarkerDefinitions";var C4=q.memo(oR);function sR({x:e,y:n,label:a,labelStyle:i,labelShowBg:o=!0,labelBgStyle:l,labelBgPadding:c=[2,4],labelBgBorderRadius:d=2,children:f,className:h,...p}){const[v,m]=q.useState({x:1,y:0,width:0,height:0}),b=Tt(["react-flow__edge-textwrapper",h]),_=q.useRef(null);return q.useEffect(()=>{if(_.current){const S=_.current.getBBox();m({x:S.x,y:S.y,width:S.width,height:S.height})}},[a]),a?g.jsxs("g",{transform:`translate(${e-v.width/2} ${n-v.height/2})`,className:b,visibility:v.width?"visible":"hidden",...p,children:[o&&g.jsx("rect",{width:v.width+2*c[0],x:-c[0],y:-c[1],height:v.height+2*c[1],className:"react-flow__edge-textbg",style:l,rx:d,ry:d}),g.jsx("text",{className:"react-flow__edge-text",y:v.height/2,dy:"0.3em",ref:_,style:i,children:a}),f]}):null}sR.displayName="EdgeText";const T4=q.memo(sR);function lo({path:e,labelX:n,labelY:a,label:i,labelStyle:o,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:f,interactionWidth:h=20,...p}){return g.jsxs(g.Fragment,{children:[g.jsx("path",{...p,d:e,fill:"none",className:Tt(["react-flow__edge-path",p.className])}),h?g.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}):null,i&&On(n)&&On(a)?g.jsx(T4,{x:n,y:a,label:i,labelStyle:o,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:f}):null]})}function VS({pos:e,x1:n,y1:a,x2:i,y2:o}){return e===je.Left||e===je.Right?[.5*(n+i),a]:[n,.5*(a+o)]}function pu({sourceX:e,sourceY:n,sourcePosition:a=je.Bottom,targetX:i,targetY:o,targetPosition:l=je.Top}){const[c,d]=VS({pos:a,x1:e,y1:n,x2:i,y2:o}),[f,h]=VS({pos:l,x1:i,y1:o,x2:e,y2:n}),[p,v,m,b]=D2({sourceX:e,sourceY:n,targetX:i,targetY:o,sourceControlX:c,sourceControlY:d,targetControlX:f,targetControlY:h});return[`M${e},${n} C${c},${d} ${f},${h} ${i},${o}`,p,v,m,b]}function lR(e){return q.memo(({id:n,sourceX:a,sourceY:i,targetX:o,targetY:l,sourcePosition:c,targetPosition:d,label:f,labelStyle:h,labelShowBg:p,labelBgStyle:v,labelBgPadding:m,labelBgBorderRadius:b,style:_,markerEnd:S,markerStart:w,interactionWidth:C})=>{const[T,E,N]=pu({sourceX:a,sourceY:i,sourcePosition:c,targetX:o,targetY:l,targetPosition:d}),R=e.isInternal?void 0:n;return g.jsx(lo,{id:R,path:T,labelX:E,labelY:N,label:f,labelStyle:h,labelShowBg:p,labelBgStyle:v,labelBgPadding:m,labelBgBorderRadius:b,style:_,markerEnd:S,markerStart:w,interactionWidth:C})})}const j4=lR({isInternal:!1}),cR=lR({isInternal:!0});j4.displayName="SimpleBezierEdge";cR.displayName="SimpleBezierEdgeInternal";function uR(e){return q.memo(({id:n,sourceX:a,sourceY:i,targetX:o,targetY:l,label:c,labelStyle:d,labelShowBg:f,labelBgStyle:h,labelBgPadding:p,labelBgBorderRadius:v,style:m,sourcePosition:b=je.Bottom,targetPosition:_=je.Top,markerEnd:S,markerStart:w,pathOptions:C,interactionWidth:T})=>{const[E,N,R]=Ds({sourceX:a,sourceY:i,sourcePosition:b,targetX:o,targetY:l,targetPosition:_,borderRadius:C?.borderRadius,offset:C?.offset,stepPosition:C?.stepPosition}),z=e.isInternal?void 0:n;return g.jsx(lo,{id:z,path:E,labelX:N,labelY:R,label:c,labelStyle:d,labelShowBg:f,labelBgStyle:h,labelBgPadding:p,labelBgBorderRadius:v,style:m,markerEnd:S,markerStart:w,interactionWidth:T})})}const dR=uR({isInternal:!1}),fR=uR({isInternal:!0});dR.displayName="SmoothStepEdge";fR.displayName="SmoothStepEdgeInternal";function hR(e){return q.memo(({id:n,...a})=>{const i=e.isInternal?void 0:n;return g.jsx(dR,{...a,id:i,pathOptions:q.useMemo(()=>({borderRadius:0,offset:a.pathOptions?.offset}),[a.pathOptions?.offset])})})}const N4=hR({isInternal:!1}),pR=hR({isInternal:!0});N4.displayName="StepEdge";pR.displayName="StepEdgeInternal";function gR(e){return q.memo(({id:n,sourceX:a,sourceY:i,targetX:o,targetY:l,label:c,labelStyle:d,labelShowBg:f,labelBgStyle:h,labelBgPadding:p,labelBgBorderRadius:v,style:m,markerEnd:b,markerStart:_,interactionWidth:S})=>{const[w,C,T]=lu({sourceX:a,sourceY:i,targetX:o,targetY:l}),E=e.isInternal?void 0:n;return g.jsx(lo,{id:E,path:w,labelX:C,labelY:T,label:c,labelStyle:d,labelShowBg:f,labelBgStyle:h,labelBgPadding:p,labelBgBorderRadius:v,style:m,markerEnd:b,markerStart:_,interactionWidth:S})})}const R4=gR({isInternal:!1}),vR=gR({isInternal:!0});R4.displayName="StraightEdge";vR.displayName="StraightEdgeInternal";function mR(e){return q.memo(({id:n,sourceX:a,sourceY:i,targetX:o,targetY:l,sourcePosition:c=je.Bottom,targetPosition:d=je.Top,label:f,labelStyle:h,labelShowBg:p,labelBgStyle:v,labelBgPadding:m,labelBgBorderRadius:b,style:_,markerEnd:S,markerStart:w,pathOptions:C,interactionWidth:T})=>{const[E,N,R]=su({sourceX:a,sourceY:i,sourcePosition:c,targetX:o,targetY:l,targetPosition:d,curvature:C?.curvature}),z=e.isInternal?void 0:n;return g.jsx(lo,{id:z,path:E,labelX:N,labelY:R,label:f,labelStyle:h,labelShowBg:p,labelBgStyle:v,labelBgPadding:m,labelBgBorderRadius:b,style:_,markerEnd:S,markerStart:w,interactionWidth:T})})}const M4=mR({isInternal:!1}),yR=mR({isInternal:!0});M4.displayName="BezierEdge";yR.displayName="BezierEdgeInternal";const FS={default:yR,straight:vR,step:pR,smoothstep:fR,simplebezier:cR},PS={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},A4=(e,n,a)=>a===je.Left?e-n:a===je.Right?e+n:e,z4=(e,n,a)=>a===je.Top?e-n:a===je.Bottom?e+n:e,GS="react-flow__edgeupdater";function $S({position:e,centerX:n,centerY:a,radius:i=10,onMouseDown:o,onMouseEnter:l,onMouseOut:c,type:d}){return g.jsx("circle",{onMouseDown:o,onMouseEnter:l,onMouseOut:c,className:Tt([GS,`${GS}-${d}`]),cx:A4(n,i,e),cy:z4(a,i,e),r:i,stroke:"transparent",fill:"transparent"})}function D4({isReconnectable:e,reconnectRadius:n,edge:a,sourceX:i,sourceY:o,targetX:l,targetY:c,sourcePosition:d,targetPosition:f,onReconnect:h,onReconnectStart:p,onReconnectEnd:v,setReconnecting:m,setUpdateHover:b}){const _=dt(),S=(N,R)=>{if(N.button!==0)return;const{autoPanOnConnect:z,domNode:j,isValidConnection:A,connectionMode:D,connectionRadius:I,lib:P,onConnectStart:V,onConnectEnd:$,cancelConnection:L,nodeLookup:H,rfId:O,panBy:F,updateConnection:J}=_.getState(),G=R.type==="target",re=(ae,U)=>{m(!1),v?.(ae,a,R.type,U)},B=ae=>h?.(a,ae),Y=(ae,U)=>{m(!0),p?.(N,a,R.type),V?.(ae,U)};Jy.onPointerDown(N.nativeEvent,{autoPanOnConnect:z,connectionMode:D,connectionRadius:I,domNode:j,handleId:R.id,nodeId:R.nodeId,nodeLookup:H,isTarget:G,edgeUpdaterType:R.type,lib:P,flowId:O,cancelConnection:L,panBy:F,isValidConnection:A,onConnect:B,onConnectStart:Y,onConnectEnd:$,onReconnectEnd:re,updateConnection:J,getTransform:()=>_.getState().transform,getFromHandle:()=>_.getState().connection.fromHandle,dragThreshold:_.getState().connectionDragThreshold,handleDomNode:N.currentTarget})},w=N=>S(N,{nodeId:a.target,id:a.targetHandle??null,type:"target"}),C=N=>S(N,{nodeId:a.source,id:a.sourceHandle??null,type:"source"}),T=()=>b(!0),E=()=>b(!1);return g.jsxs(g.Fragment,{children:[(e===!0||e==="source")&&g.jsx($S,{position:d,centerX:i,centerY:o,radius:n,onMouseDown:w,onMouseEnter:T,onMouseOut:E,type:"source"}),(e===!0||e==="target")&&g.jsx($S,{position:f,centerX:l,centerY:c,radius:n,onMouseDown:C,onMouseEnter:T,onMouseOut:E,type:"target"})]})}function k4({id:e,edgesFocusable:n,edgesReconnectable:a,elementsSelectable:i,onClick:o,onDoubleClick:l,onContextMenu:c,onMouseEnter:d,onMouseMove:f,onMouseLeave:h,reconnectRadius:p,onReconnect:v,onReconnectStart:m,onReconnectEnd:b,rfId:_,edgeTypes:S,noPanClassName:w,onError:C,disableKeyboardA11y:T}){let E=Ie(be=>be.edgeLookup.get(e));const N=Ie(be=>be.defaultEdgeOptions);E=N?{...N,...E}:E;let R=E.type||"default",z=S?.[R]||FS[R];z===void 0&&(C?.("011",Jn.error011(R)),R="default",z=S?.default||FS.default);const j=!!(E.focusable||n&&typeof E.focusable>"u"),A=typeof v<"u"&&(E.reconnectable||a&&typeof E.reconnectable>"u"),D=!!(E.selectable||i&&typeof E.selectable>"u"),I=q.useRef(null),[P,V]=q.useState(!1),[$,L]=q.useState(!1),H=dt(),{zIndex:O,sourceX:F,sourceY:J,targetX:G,targetY:re,sourcePosition:B,targetPosition:Y}=Ie(q.useCallback(be=>{const W=be.nodeLookup.get(E.source),se=be.nodeLookup.get(E.target);if(!W||!se)return{zIndex:E.zIndex,...PS};const te=C6({id:e,sourceNode:W,targetNode:se,sourceHandle:E.sourceHandle||null,targetHandle:E.targetHandle||null,connectionMode:be.connectionMode,onError:C});return{zIndex:m6({selected:E.selected,zIndex:E.zIndex,sourceNode:W,targetNode:se,elevateOnSelect:be.elevateEdgesOnSelect}),...te||PS}},[E.source,E.target,E.sourceHandle,E.targetHandle,E.selected,E.zIndex]),pt),ae=q.useMemo(()=>E.markerStart?`url('#${Zy(E.markerStart,_)}')`:void 0,[E.markerStart,_]),U=q.useMemo(()=>E.markerEnd?`url('#${Zy(E.markerEnd,_)}')`:void 0,[E.markerEnd,_]);if(E.hidden||F===null||J===null||G===null||re===null)return null;const Z=be=>{const{addSelectedEdges:W,unselectNodesAndEdges:se,multiSelectionActive:te}=H.getState();D&&(H.setState({nodesSelectionActive:!1}),E.selected&&te?(se({nodes:[],edges:[E]}),I.current?.blur()):W([e])),o&&o(be,E)},ne=l?be=>{l(be,{...E})}:void 0,le=c?be=>{c(be,{...E})}:void 0,K=d?be=>{d(be,{...E})}:void 0,de=f?be=>{f(be,{...E})}:void 0,ye=h?be=>{h(be,{...E})}:void 0,xe=be=>{if(!T&&b2.includes(be.key)&&D){const{unselectNodesAndEdges:W,addSelectedEdges:se}=H.getState();be.key==="Escape"?(I.current?.blur(),W({edges:[E]})):se([e])}};return g.jsx("svg",{style:{zIndex:O},children:g.jsxs("g",{className:Tt(["react-flow__edge",`react-flow__edge-${R}`,E.className,w,{selected:E.selected,animated:E.animated,inactive:!D&&!o,updating:P,selectable:D}]),onClick:Z,onDoubleClick:ne,onContextMenu:le,onMouseEnter:K,onMouseMove:de,onMouseLeave:ye,onKeyDown:j?xe:void 0,tabIndex:j?0:void 0,role:E.ariaRole??(j?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":E.ariaLabel===null?void 0:E.ariaLabel||`Edge from ${E.source} to ${E.target}`,"aria-describedby":j?`${W2}-${_}`:void 0,ref:I,...E.domAttributes,children:[!$&&g.jsx(z,{id:e,source:E.source,target:E.target,type:E.type,selected:E.selected,animated:E.animated,selectable:D,deletable:E.deletable??!0,label:E.label,labelStyle:E.labelStyle,labelShowBg:E.labelShowBg,labelBgStyle:E.labelBgStyle,labelBgPadding:E.labelBgPadding,labelBgBorderRadius:E.labelBgBorderRadius,sourceX:F,sourceY:J,targetX:G,targetY:re,sourcePosition:B,targetPosition:Y,data:E.data,style:E.style,sourceHandleId:E.sourceHandle,targetHandleId:E.targetHandle,markerStart:ae,markerEnd:U,pathOptions:"pathOptions"in E?E.pathOptions:void 0,interactionWidth:E.interactionWidth}),A&&g.jsx(D4,{edge:E,isReconnectable:A,reconnectRadius:p,onReconnect:v,onReconnectStart:m,onReconnectEnd:b,sourceX:F,sourceY:J,targetX:G,targetY:re,sourcePosition:B,targetPosition:Y,setUpdateHover:V,setReconnecting:L})]})})}const O4=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function bR({defaultMarkerColor:e,onlyRenderVisibleElements:n,rfId:a,edgeTypes:i,noPanClassName:o,onReconnect:l,onEdgeContextMenu:c,onEdgeMouseEnter:d,onEdgeMouseMove:f,onEdgeMouseLeave:h,onEdgeClick:p,reconnectRadius:v,onEdgeDoubleClick:m,onReconnectStart:b,onReconnectEnd:_,disableKeyboardA11y:S}){const{edgesFocusable:w,edgesReconnectable:C,elementsSelectable:T,onError:E}=Ie(O4,pt),N=x4(n);return g.jsxs("div",{className:"react-flow__edges",children:[g.jsx(C4,{defaultColor:e,rfId:a}),N.map(R=>g.jsx(k4,{id:R,edgesFocusable:w,edgesReconnectable:C,elementsSelectable:T,noPanClassName:o,onReconnect:l,onContextMenu:c,onMouseEnter:d,onMouseMove:f,onMouseLeave:h,onClick:p,reconnectRadius:v,onDoubleClick:m,onReconnectStart:b,onReconnectEnd:_,rfId:a,onError:E,edgeTypes:i,disableKeyboardA11y:S},R))]})}bR.displayName="EdgeRenderer";const q4=q.memo(bR),B4=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function L4({children:e}){const n=Ie(B4);return g.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:n},children:e})}function H4(e){const n=fu(),a=q.useRef(!1);q.useEffect(()=>{!a.current&&n.viewportInitialized&&e&&(setTimeout(()=>e(n),1),a.current=!0)},[e,n.viewportInitialized])}const I4=e=>e.panZoom?.syncViewport;function U4(e){const n=Ie(I4),a=dt();return q.useEffect(()=>{e&&(n?.(e),a.setState({transform:[e.x,e.y,e.zoom]}))},[e,n]),null}function V4(e){return e.connection.inProgress?{...e.connection,to:Ps(e.connection.to,e.transform)}:{...e.connection}}function F4(e){return V4}function P4(e){const n=F4();return Ie(n,pt)}const G4=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function $4({containerStyle:e,style:n,type:a,component:i}){const{nodesConnectable:o,width:l,height:c,isValid:d,inProgress:f}=Ie(G4,pt);return!(l&&o&&f)?null:g.jsx("svg",{style:e,width:l,height:c,className:"react-flow__connectionline react-flow__container",children:g.jsx("g",{className:Tt(["react-flow__connection",S2(d)]),children:g.jsx(xR,{style:n,type:a,CustomComponent:i,isValid:d})})})}const xR=({style:e,type:n=ha.Bezier,CustomComponent:a,isValid:i})=>{const{inProgress:o,from:l,fromNode:c,fromHandle:d,fromPosition:f,to:h,toNode:p,toHandle:v,toPosition:m}=P4();if(!o)return;if(a)return g.jsx(a,{connectionLineType:n,connectionLineStyle:e,fromNode:c,fromHandle:d,fromX:l.x,fromY:l.y,toX:h.x,toY:h.y,fromPosition:f,toPosition:m,connectionStatus:S2(i),toNode:p,toHandle:v});let b="";const _={sourceX:l.x,sourceY:l.y,sourcePosition:f,targetX:h.x,targetY:h.y,targetPosition:m};switch(n){case ha.Bezier:[b]=su(_);break;case ha.SimpleBezier:[b]=pu(_);break;case ha.Step:[b]=Ds({..._,borderRadius:0});break;case ha.SmoothStep:[b]=Ds(_);break;default:[b]=lu(_)}return g.jsx("path",{d:b,fill:"none",className:"react-flow__connection-path",style:e})};xR.displayName="ConnectionLine";const Y4={};function YS(e=Y4){q.useRef(e),dt(),q.useEffect(()=>{},[e])}function W4(){dt(),q.useRef(!1),q.useEffect(()=>{},[])}function _R({nodeTypes:e,edgeTypes:n,onInit:a,onNodeClick:i,onEdgeClick:o,onNodeDoubleClick:l,onEdgeDoubleClick:c,onNodeMouseEnter:d,onNodeMouseMove:f,onNodeMouseLeave:h,onNodeContextMenu:p,onSelectionContextMenu:v,onSelectionStart:m,onSelectionEnd:b,connectionLineType:_,connectionLineStyle:S,connectionLineComponent:w,connectionLineContainerStyle:C,selectionKeyCode:T,selectionOnDrag:E,selectionMode:N,multiSelectionKeyCode:R,panActivationKeyCode:z,zoomActivationKeyCode:j,deleteKeyCode:A,onlyRenderVisibleElements:D,elementsSelectable:I,defaultViewport:P,translateExtent:V,minZoom:$,maxZoom:L,preventScrolling:H,defaultMarkerColor:O,zoomOnScroll:F,zoomOnPinch:J,panOnScroll:G,panOnScrollSpeed:re,panOnScrollMode:B,zoomOnDoubleClick:Y,panOnDrag:ae,onPaneClick:U,onPaneMouseEnter:Z,onPaneMouseMove:ne,onPaneMouseLeave:le,onPaneScroll:K,onPaneContextMenu:de,paneClickDistance:ye,nodeClickDistance:xe,onEdgeContextMenu:be,onEdgeMouseEnter:W,onEdgeMouseMove:se,onEdgeMouseLeave:te,reconnectRadius:me,onReconnect:ve,onReconnectStart:Se,onReconnectEnd:Ee,noDragClassName:Ve,noWheelClassName:qe,noPanClassName:lt,disableKeyboardA11y:tt,nodeExtent:nt,rfId:Ft,viewport:$t,onViewportChange:At}){return YS(e),YS(n),W4(),H4(a),U4($t),g.jsx(d4,{onPaneClick:U,onPaneMouseEnter:Z,onPaneMouseMove:ne,onPaneMouseLeave:le,onPaneContextMenu:de,onPaneScroll:K,paneClickDistance:ye,deleteKeyCode:A,selectionKeyCode:T,selectionOnDrag:E,selectionMode:N,onSelectionStart:m,onSelectionEnd:b,multiSelectionKeyCode:R,panActivationKeyCode:z,zoomActivationKeyCode:j,elementsSelectable:I,zoomOnScroll:F,zoomOnPinch:J,zoomOnDoubleClick:Y,panOnScroll:G,panOnScrollSpeed:re,panOnScrollMode:B,panOnDrag:ae,defaultViewport:P,translateExtent:V,minZoom:$,maxZoom:L,onSelectionContextMenu:v,preventScrolling:H,noDragClassName:Ve,noWheelClassName:qe,noPanClassName:lt,disableKeyboardA11y:tt,onViewportChange:At,isControlledViewport:!!$t,children:g.jsxs(L4,{children:[g.jsx(q4,{edgeTypes:n,onEdgeClick:o,onEdgeDoubleClick:c,onReconnect:ve,onReconnectStart:Se,onReconnectEnd:Ee,onlyRenderVisibleElements:D,onEdgeContextMenu:be,onEdgeMouseEnter:W,onEdgeMouseMove:se,onEdgeMouseLeave:te,reconnectRadius:me,defaultMarkerColor:O,noPanClassName:lt,disableKeyboardA11y:tt,rfId:Ft}),g.jsx($4,{style:S,type:_,component:w,containerStyle:C}),g.jsx("div",{className:"react-flow__edgelabel-renderer"}),g.jsx(b4,{nodeTypes:e,onNodeClick:i,onNodeDoubleClick:l,onNodeMouseEnter:d,onNodeMouseMove:f,onNodeMouseLeave:h,onNodeContextMenu:p,nodeClickDistance:xe,onlyRenderVisibleElements:D,noPanClassName:lt,noDragClassName:Ve,disableKeyboardA11y:tt,nodeExtent:nt,rfId:Ft}),g.jsx("div",{className:"react-flow__viewport-portal"})]})})}_R.displayName="GraphView";const X4=q.memo(_R),WS=({nodes:e,edges:n,defaultNodes:a,defaultEdges:i,width:o,height:l,fitView:c,fitViewOptions:d,minZoom:f=.5,maxZoom:h=2,nodeOrigin:p,nodeExtent:v}={})=>{const m=new Map,b=new Map,_=new Map,S=new Map,w=i??n??[],C=a??e??[],T=p??[0,0],E=v??Rs;q2(_,S,w);const N=Qy(C,m,b,{nodeOrigin:T,nodeExtent:E,elevateNodesOnSelect:!1});let R=[0,0,1];if(c&&o&&l){const z=Vs(m,{filter:I=>!!((I.width||I.initialWidth)&&(I.height||I.initialHeight))}),{x:j,y:A,zoom:D}=gb(z,o,l,f,h,d?.padding??.1);R=[j,A,D]}return{rfId:"1",width:o??0,height:l??0,transform:R,nodes:C,nodesInitialized:N,nodeLookup:m,parentLookup:b,edges:w,edgeLookup:S,connectionLookup:_,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:a!==void 0,hasDefaultEdges:i!==void 0,panZoom:null,minZoom:f,maxZoom:h,translateExtent:Rs,nodeExtent:E,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:no.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:T,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:c??!1,fitViewOptions:d,fitViewResolver:null,connection:{..._2},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:d6,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:x2}},K4=({nodes:e,edges:n,defaultNodes:a,defaultEdges:i,width:o,height:l,fitView:c,fitViewOptions:d,minZoom:f,maxZoom:h,nodeOrigin:p,nodeExtent:v})=>vq((m,b)=>{async function _(){const{nodeLookup:S,panZoom:w,fitViewOptions:C,fitViewResolver:T,width:E,height:N,minZoom:R,maxZoom:z}=b();w&&(await c6({nodes:S,width:E,height:N,panZoom:w,minZoom:R,maxZoom:z},C),T?.resolve(!0),m({fitViewResolver:null}))}return{...WS({nodes:e,edges:n,width:o,height:l,fitView:c,fitViewOptions:d,minZoom:f,maxZoom:h,nodeOrigin:p,nodeExtent:v,defaultNodes:a,defaultEdges:i}),setNodes:S=>{const{nodeLookup:w,parentLookup:C,nodeOrigin:T,elevateNodesOnSelect:E,fitViewQueued:N}=b(),R=Qy(S,w,C,{nodeOrigin:T,nodeExtent:v,elevateNodesOnSelect:E,checkEquality:!0});N&&R?(_(),m({nodes:S,nodesInitialized:R,fitViewQueued:!1,fitViewOptions:void 0})):m({nodes:S,nodesInitialized:R})},setEdges:S=>{const{connectionLookup:w,edgeLookup:C}=b();q2(w,C,S),m({edges:S})},setDefaultNodesAndEdges:(S,w)=>{if(S){const{setNodes:C}=b();C(S),m({hasDefaultNodes:!0})}if(w){const{setEdges:C}=b();C(w),m({hasDefaultEdges:!0})}},updateNodeInternals:S=>{const{triggerNodeChanges:w,nodeLookup:C,parentLookup:T,domNode:E,nodeOrigin:N,nodeExtent:R,debug:z,fitViewQueued:j}=b(),{changes:A,updatedInternals:D}=z6(S,C,T,E,N,R);D&&(N6(C,T,{nodeOrigin:N,nodeExtent:R}),j?(_(),m({fitViewQueued:!1,fitViewOptions:void 0})):m({}),A?.length>0&&(z&&console.log("React Flow: trigger node changes",A),w?.(A)))},updateNodePositions:(S,w=!1)=>{const C=[],T=[],{nodeLookup:E,triggerNodeChanges:N}=b();for(const[R,z]of S){const j=E.get(R),A=!!(j?.expandParent&&j?.parentId&&z?.position),D={id:R,type:"position",position:A?{x:Math.max(0,z.position.x),y:Math.max(0,z.position.y)}:z.position,dragging:w};A&&j.parentId&&C.push({id:R,parentId:j.parentId,rect:{...z.internals.positionAbsolute,width:z.measured.width??0,height:z.measured.height??0}}),T.push(D)}if(C.length>0){const{parentLookup:R,nodeOrigin:z}=b(),j=xb(C,E,R,z);T.push(...j)}N(T)},triggerNodeChanges:S=>{const{onNodesChange:w,setNodes:C,nodes:T,hasDefaultNodes:E,debug:N}=b();if(S?.length){if(E){const R=Z2(S,T);C(R)}N&&console.log("React Flow: trigger node changes",S),w?.(S)}},triggerEdgeChanges:S=>{const{onEdgesChange:w,setEdges:C,edges:T,hasDefaultEdges:E,debug:N}=b();if(S?.length){if(E){const R=Q2(S,T);C(R)}N&&console.log("React Flow: trigger edge changes",S),w?.(S)}},addSelectedNodes:S=>{const{multiSelectionActive:w,edgeLookup:C,nodeLookup:T,triggerNodeChanges:E,triggerEdgeChanges:N}=b();if(w){const R=S.map(z=>La(z,!0));E(R);return}E(Ki(T,new Set([...S]),!0)),N(Ki(C))},addSelectedEdges:S=>{const{multiSelectionActive:w,edgeLookup:C,nodeLookup:T,triggerNodeChanges:E,triggerEdgeChanges:N}=b();if(w){const R=S.map(z=>La(z,!0));N(R);return}N(Ki(C,new Set([...S]))),E(Ki(T,new Set,!0))},unselectNodesAndEdges:({nodes:S,edges:w}={})=>{const{edges:C,nodes:T,nodeLookup:E,triggerNodeChanges:N,triggerEdgeChanges:R}=b(),z=S||T,j=w||C,A=z.map(I=>{const P=E.get(I.id);return P&&(P.selected=!1),La(I.id,!1)}),D=j.map(I=>La(I.id,!1));N(A),R(D)},setMinZoom:S=>{const{panZoom:w,maxZoom:C}=b();w?.setScaleExtent([S,C]),m({minZoom:S})},setMaxZoom:S=>{const{panZoom:w,minZoom:C}=b();w?.setScaleExtent([C,S]),m({maxZoom:S})},setTranslateExtent:S=>{b().panZoom?.setTranslateExtent(S),m({translateExtent:S})},setPaneClickDistance:S=>{b().panZoom?.setClickDistance(S)},resetSelectedElements:()=>{const{edges:S,nodes:w,triggerNodeChanges:C,triggerEdgeChanges:T,elementsSelectable:E}=b();if(!E)return;const N=w.reduce((z,j)=>j.selected?[...z,La(j.id,!1)]:z,[]),R=S.reduce((z,j)=>j.selected?[...z,La(j.id,!1)]:z,[]);C(N),T(R)},setNodeExtent:S=>{const{nodes:w,nodeLookup:C,parentLookup:T,nodeOrigin:E,elevateNodesOnSelect:N,nodeExtent:R}=b();S[0][0]===R[0][0]&&S[0][1]===R[0][1]&&S[1][0]===R[1][0]&&S[1][1]===R[1][1]||(Qy(w,C,T,{nodeOrigin:E,nodeExtent:S,elevateNodesOnSelect:N,checkEquality:!1}),m({nodeExtent:S}))},panBy:S=>{const{transform:w,width:C,height:T,panZoom:E,translateExtent:N}=b();return D6({delta:S,panZoom:E,transform:w,translateExtent:N,width:C,height:T})},setCenter:async(S,w,C)=>{const{width:T,height:E,maxZoom:N,panZoom:R}=b();if(!R)return Promise.resolve(!1);const z=typeof C?.zoom<"u"?C.zoom:N;return await R.setViewport({x:T/2-S*z,y:E/2-w*z,zoom:z},{duration:C?.duration,ease:C?.ease,interpolate:C?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{m({connection:{..._2}})},updateConnection:S=>{m({connection:S})},reset:()=>m({...WS()})}},Object.is);function SR({initialNodes:e,initialEdges:n,defaultNodes:a,defaultEdges:i,initialWidth:o,initialHeight:l,initialMinZoom:c,initialMaxZoom:d,initialFitViewOptions:f,fitView:h,nodeOrigin:p,nodeExtent:v,children:m}){const[b]=q.useState(()=>K4({nodes:e,edges:n,defaultNodes:a,defaultEdges:i,width:o,height:l,fitView:h,minZoom:c,maxZoom:d,fitViewOptions:f,nodeOrigin:p,nodeExtent:v}));return g.jsx(mq,{value:b,children:g.jsx(Iq,{children:m})})}function Z4({children:e,nodes:n,edges:a,defaultNodes:i,defaultEdges:o,width:l,height:c,fitView:d,fitViewOptions:f,minZoom:h,maxZoom:p,nodeOrigin:v,nodeExtent:m}){return q.useContext(uu)?g.jsx(g.Fragment,{children:e}):g.jsx(SR,{initialNodes:n,initialEdges:a,defaultNodes:i,defaultEdges:o,initialWidth:l,initialHeight:c,fitView:d,initialFitViewOptions:f,initialMinZoom:h,initialMaxZoom:p,nodeOrigin:v,nodeExtent:m,children:e})}const Q4={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function J4({nodes:e,edges:n,defaultNodes:a,defaultEdges:i,className:o,nodeTypes:l,edgeTypes:c,onNodeClick:d,onEdgeClick:f,onInit:h,onMove:p,onMoveStart:v,onMoveEnd:m,onConnect:b,onConnectStart:_,onConnectEnd:S,onClickConnectStart:w,onClickConnectEnd:C,onNodeMouseEnter:T,onNodeMouseMove:E,onNodeMouseLeave:N,onNodeContextMenu:R,onNodeDoubleClick:z,onNodeDragStart:j,onNodeDrag:A,onNodeDragStop:D,onNodesDelete:I,onEdgesDelete:P,onDelete:V,onSelectionChange:$,onSelectionDragStart:L,onSelectionDrag:H,onSelectionDragStop:O,onSelectionContextMenu:F,onSelectionStart:J,onSelectionEnd:G,onBeforeDelete:re,connectionMode:B,connectionLineType:Y=ha.Bezier,connectionLineStyle:ae,connectionLineComponent:U,connectionLineContainerStyle:Z,deleteKeyCode:ne="Backspace",selectionKeyCode:le="Shift",selectionOnDrag:K=!1,selectionMode:de=Ms.Full,panActivationKeyCode:ye="Space",multiSelectionKeyCode:xe=zs()?"Meta":"Control",zoomActivationKeyCode:be=zs()?"Meta":"Control",snapToGrid:W,snapGrid:se,onlyRenderVisibleElements:te=!1,selectNodesOnDrag:me,nodesDraggable:ve,autoPanOnNodeFocus:Se,nodesConnectable:Ee,nodesFocusable:Ve,nodeOrigin:qe=X2,edgesFocusable:lt,edgesReconnectable:tt,elementsSelectable:nt=!0,defaultViewport:Ft=Mq,minZoom:$t=.5,maxZoom:At=2,translateExtent:Lt=Rs,preventScrolling:Ja=!0,nodeExtent:rr,defaultMarkerColor:mo="#b1b1b7",zoomOnScroll:ei=!0,zoomOnPinch:Ht=!0,panOnScroll:ht=!1,panOnScrollSpeed:Un=.5,panOnScrollMode:Pt=Ua.Free,zoomOnDoubleClick:ku=!0,panOnDrag:Ou=!0,onPaneClick:qu,onPaneMouseEnter:ti,onPaneMouseMove:ni,onPaneMouseLeave:ri,onPaneScroll:ar,onPaneContextMenu:ai,paneClickDistance:zr=0,nodeClickDistance:Bu=0,children:Zs,onReconnect:yo,onReconnectStart:ya,onReconnectEnd:Lu,onEdgeContextMenu:Qs,onEdgeDoubleClick:Js,onEdgeMouseEnter:el,onEdgeMouseMove:bo,onEdgeMouseLeave:xo,reconnectRadius:tl=10,onNodesChange:nl,onEdgesChange:Vn,noDragClassName:Nt="nodrag",noWheelClassName:It="nowheel",noPanClassName:ir="nopan",fitView:ii,fitViewOptions:rl,connectOnClick:Hu,attributionPosition:al,proOptions:ba,defaultEdgeOptions:_o,elevateNodesOnSelect:Dr,elevateEdgesOnSelect:kr,disableKeyboardA11y:Or=!1,autoPanOnConnect:qr,autoPanOnNodeDrag:xt,autoPanSpeed:il,connectionRadius:ol,isValidConnection:or,onError:Br,style:Iu,id:So,nodeDragThreshold:sl,connectionDragThreshold:Uu,viewport:oi,onViewportChange:si,width:Rn,height:Yt,colorMode:ll="light",debug:Vu,onScroll:li,ariaLabelConfig:cl,...ci},Fu){const Ut=So||"1",wo=kq(ll),ul=q.useCallback(ui=>{ui.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),li?.(ui)},[li]);return g.jsx("div",{"data-testid":"rf__wrapper",...ci,onScroll:ul,style:{...Iu,...Q4},ref:Fu,className:Tt(["react-flow",o,wo]),id:So,role:"application",children:g.jsxs(Z4,{nodes:e,edges:n,width:Rn,height:Yt,fitView:ii,fitViewOptions:rl,minZoom:$t,maxZoom:At,nodeOrigin:qe,nodeExtent:rr,children:[g.jsx(X4,{onInit:h,onNodeClick:d,onEdgeClick:f,onNodeMouseEnter:T,onNodeMouseMove:E,onNodeMouseLeave:N,onNodeContextMenu:R,onNodeDoubleClick:z,nodeTypes:l,edgeTypes:c,connectionLineType:Y,connectionLineStyle:ae,connectionLineComponent:U,connectionLineContainerStyle:Z,selectionKeyCode:le,selectionOnDrag:K,selectionMode:de,deleteKeyCode:ne,multiSelectionKeyCode:xe,panActivationKeyCode:ye,zoomActivationKeyCode:be,onlyRenderVisibleElements:te,defaultViewport:Ft,translateExtent:Lt,minZoom:$t,maxZoom:At,preventScrolling:Ja,zoomOnScroll:ei,zoomOnPinch:Ht,zoomOnDoubleClick:ku,panOnScroll:ht,panOnScrollSpeed:Un,panOnScrollMode:Pt,panOnDrag:Ou,onPaneClick:qu,onPaneMouseEnter:ti,onPaneMouseMove:ni,onPaneMouseLeave:ri,onPaneScroll:ar,onPaneContextMenu:ai,paneClickDistance:zr,nodeClickDistance:Bu,onSelectionContextMenu:F,onSelectionStart:J,onSelectionEnd:G,onReconnect:yo,onReconnectStart:ya,onReconnectEnd:Lu,onEdgeContextMenu:Qs,onEdgeDoubleClick:Js,onEdgeMouseEnter:el,onEdgeMouseMove:bo,onEdgeMouseLeave:xo,reconnectRadius:tl,defaultMarkerColor:mo,noDragClassName:Nt,noWheelClassName:It,noPanClassName:ir,rfId:Ut,disableKeyboardA11y:Or,nodeExtent:rr,viewport:oi,onViewportChange:si}),g.jsx(Dq,{nodes:e,edges:n,defaultNodes:a,defaultEdges:i,onConnect:b,onConnectStart:_,onConnectEnd:S,onClickConnectStart:w,onClickConnectEnd:C,nodesDraggable:ve,autoPanOnNodeFocus:Se,nodesConnectable:Ee,nodesFocusable:Ve,edgesFocusable:lt,edgesReconnectable:tt,elementsSelectable:nt,elevateNodesOnSelect:Dr,elevateEdgesOnSelect:kr,minZoom:$t,maxZoom:At,nodeExtent:rr,onNodesChange:nl,onEdgesChange:Vn,snapToGrid:W,snapGrid:se,connectionMode:B,translateExtent:Lt,connectOnClick:Hu,defaultEdgeOptions:_o,fitView:ii,fitViewOptions:rl,onNodesDelete:I,onEdgesDelete:P,onDelete:V,onNodeDragStart:j,onNodeDrag:A,onNodeDragStop:D,onSelectionDrag:H,onSelectionDragStart:L,onSelectionDragStop:O,onMove:p,onMoveStart:v,onMoveEnd:m,noPanClassName:ir,nodeOrigin:qe,rfId:Ut,autoPanOnConnect:qr,autoPanOnNodeDrag:xt,autoPanSpeed:il,onError:Br,connectionRadius:ol,isValidConnection:or,selectNodesOnDrag:me,nodeDragThreshold:sl,connectionDragThreshold:Uu,onBeforeDelete:re,paneClickDistance:zr,debug:Vu,ariaLabelConfig:cl}),g.jsx(Rq,{onSelectionChange:$}),Zs,g.jsx(Eq,{proOptions:ba,position:al}),g.jsx(wq,{rfId:Ut,disableKeyboardA11y:Or})]})})}var eB=J2(J4);const tB=e=>e.domNode?.querySelector(".react-flow__edgelabel-renderer");function wR({children:e}){const n=Ie(tB);return n?_b.createPortal(e,n):null}function nB({dimensions:e,lineWidth:n,variant:a,className:i}){return g.jsx("path",{strokeWidth:n,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Tt(["react-flow__background-pattern",a,i])})}function rB({radius:e,className:n}){return g.jsx("circle",{cx:e,cy:e,r:e,className:Tt(["react-flow__background-pattern","dots",n])})}var pa;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(pa||(pa={}));const aB={[pa.Dots]:1,[pa.Lines]:1,[pa.Cross]:6},iB=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function ER({id:e,variant:n=pa.Dots,gap:a=20,size:i,lineWidth:o=1,offset:l=0,color:c,bgColor:d,style:f,className:h,patternClassName:p}){const v=q.useRef(null),{transform:m,patternId:b}=Ie(iB,pt),_=i||aB[n],S=n===pa.Dots,w=n===pa.Cross,C=Array.isArray(a)?a:[a,a],T=[C[0]*m[2]||1,C[1]*m[2]||1],E=_*m[2],N=Array.isArray(l)?l:[l,l],R=w?[E,E]:T,z=[N[0]*m[2]||1+R[0]/2,N[1]*m[2]||1+R[1]/2],j=`${b}${e||""}`;return g.jsxs("svg",{className:Tt(["react-flow__background",h]),style:{...f,...hu,"--xy-background-color-props":d,"--xy-background-pattern-color-props":c},ref:v,"data-testid":"rf__background",children:[g.jsx("pattern",{id:j,x:m[0]%T[0],y:m[1]%T[1],width:T[0],height:T[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${z[0]},-${z[1]})`,children:S?g.jsx(rB,{radius:E/2,className:p}):g.jsx(nB,{dimensions:R,lineWidth:o,variant:n,className:p})}),g.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${j})`})]})}ER.displayName="Background";const oB=q.memo(ER);function sB(){return g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:g.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function lB(){return g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:g.jsx("path",{d:"M0 0h32v4.2H0z"})})}function cB(){return g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:g.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 uB(){return g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:g.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 dB(){return g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:g.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 Rc({children:e,className:n,...a}){return g.jsx("button",{type:"button",className:Tt(["react-flow__controls-button",n]),...a,children:e})}const fB=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function CR({style:e,showZoom:n=!0,showFitView:a=!0,showInteractive:i=!0,fitViewOptions:o,onZoomIn:l,onZoomOut:c,onFitView:d,onInteractiveChange:f,className:h,children:p,position:v="bottom-left",orientation:m="vertical","aria-label":b}){const _=dt(),{isInteractive:S,minZoomReached:w,maxZoomReached:C,ariaLabelConfig:T}=Ie(fB,pt),{zoomIn:E,zoomOut:N,fitView:R}=fu(),z=()=>{E(),l?.()},j=()=>{N(),c?.()},A=()=>{R(o),d?.()},D=()=>{_.setState({nodesDraggable:!S,nodesConnectable:!S,elementsSelectable:!S}),f?.(!S)},I=m==="horizontal"?"horizontal":"vertical";return g.jsxs(du,{className:Tt(["react-flow__controls",I,h]),position:v,style:e,"data-testid":"rf__controls","aria-label":b??T["controls.ariaLabel"],children:[n&&g.jsxs(g.Fragment,{children:[g.jsx(Rc,{onClick:z,className:"react-flow__controls-zoomin",title:T["controls.zoomIn.ariaLabel"],"aria-label":T["controls.zoomIn.ariaLabel"],disabled:C,children:g.jsx(sB,{})}),g.jsx(Rc,{onClick:j,className:"react-flow__controls-zoomout",title:T["controls.zoomOut.ariaLabel"],"aria-label":T["controls.zoomOut.ariaLabel"],disabled:w,children:g.jsx(lB,{})})]}),a&&g.jsx(Rc,{className:"react-flow__controls-fitview",onClick:A,title:T["controls.fitView.ariaLabel"],"aria-label":T["controls.fitView.ariaLabel"],children:g.jsx(cB,{})}),i&&g.jsx(Rc,{className:"react-flow__controls-interactive",onClick:D,title:T["controls.interactive.ariaLabel"],"aria-label":T["controls.interactive.ariaLabel"],children:S?g.jsx(dB,{}):g.jsx(uB,{})}),p]})}CR.displayName="Controls";const hB=q.memo(CR);function pB({id:e,x:n,y:a,width:i,height:o,style:l,color:c,strokeColor:d,strokeWidth:f,className:h,borderRadius:p,shapeRendering:v,selected:m,onClick:b}){const{background:_,backgroundColor:S}=l||{},w=c||_||S;return g.jsx("rect",{className:Tt(["react-flow__minimap-node",{selected:m},h]),x:n,y:a,rx:p,ry:p,width:i,height:o,style:{fill:w,stroke:d,strokeWidth:f},shapeRendering:v,onClick:b?C=>b(C,e):void 0})}const gB=q.memo(pB),vB=e=>e.nodes.map(n=>n.id),hh=e=>e instanceof Function?e:()=>e;function mB({nodeStrokeColor:e,nodeColor:n,nodeClassName:a="",nodeBorderRadius:i=5,nodeStrokeWidth:o,nodeComponent:l=gB,onClick:c}){const d=Ie(vB,pt),f=hh(n),h=hh(e),p=hh(a),v=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return g.jsx(g.Fragment,{children:d.map(m=>g.jsx(bB,{id:m,nodeColorFunc:f,nodeStrokeColorFunc:h,nodeClassNameFunc:p,nodeBorderRadius:i,nodeStrokeWidth:o,NodeComponent:l,onClick:c,shapeRendering:v},m))})}function yB({id:e,nodeColorFunc:n,nodeStrokeColorFunc:a,nodeClassNameFunc:i,nodeBorderRadius:o,nodeStrokeWidth:l,shapeRendering:c,NodeComponent:d,onClick:f}){const{node:h,x:p,y:v,width:m,height:b}=Ie(_=>{const{internals:S}=_.nodeLookup.get(e),w=S.userNode,{x:C,y:T}=S.positionAbsolute,{width:E,height:N}=Rr(w);return{node:w,x:C,y:T,width:E,height:N}},pt);return!h||h.hidden||!N2(h)?null:g.jsx(d,{x:p,y:v,width:m,height:b,style:h.style,selected:!!h.selected,className:i(h),color:n(h),borderRadius:o,strokeColor:a(h),strokeWidth:l,shapeRendering:c,onClick:f,id:h.id})}const bB=q.memo(yB);var xB=q.memo(mB);const _B=200,SB=150,wB=e=>!e.hidden,EB=e=>{const n={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:n,boundingRect:e.nodeLookup.size>0?j2(Vs(e.nodeLookup,{filter:wB}),n):n,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},CB="react-flow__minimap-desc";function TR({style:e,className:n,nodeStrokeColor:a,nodeColor:i,nodeClassName:o="",nodeBorderRadius:l=5,nodeStrokeWidth:c,nodeComponent:d,bgColor:f,maskColor:h,maskStrokeColor:p,maskStrokeWidth:v,position:m="bottom-right",onClick:b,onNodeClick:_,pannable:S=!1,zoomable:w=!1,ariaLabel:C,inversePan:T,zoomStep:E=1,offsetScale:N=5}){const R=dt(),z=q.useRef(null),{boundingRect:j,viewBB:A,rfId:D,panZoom:I,translateExtent:P,flowWidth:V,flowHeight:$,ariaLabelConfig:L}=Ie(EB,pt),H=e?.width??_B,O=e?.height??SB,F=j.width/H,J=j.height/O,G=Math.max(F,J),re=G*H,B=G*O,Y=N*G,ae=j.x-(re-j.width)/2-Y,U=j.y-(B-j.height)/2-Y,Z=re+Y*2,ne=B+Y*2,le=`${CB}-${D}`,K=q.useRef(0),de=q.useRef();K.current=G,q.useEffect(()=>{if(z.current&&I)return de.current=V6({domNode:z.current,panZoom:I,getTransform:()=>R.getState().transform,getViewScale:()=>K.current}),()=>{de.current?.destroy()}},[I]),q.useEffect(()=>{de.current?.update({translateExtent:P,width:V,height:$,inversePan:T,pannable:S,zoomStep:E,zoomable:w})},[S,w,T,E,P,V,$]);const ye=b?W=>{const[se,te]=de.current?.pointer(W)||[0,0];b(W,{x:se,y:te})}:void 0,xe=_?q.useCallback((W,se)=>{const te=R.getState().nodeLookup.get(se).internals.userNode;_(W,te)},[]):void 0,be=C??L["minimap.ariaLabel"];return g.jsx(du,{position:m,style:{...e,"--xy-minimap-background-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-background-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-stroke-color-props":typeof p=="string"?p:void 0,"--xy-minimap-mask-stroke-width-props":typeof v=="number"?v*G:void 0,"--xy-minimap-node-background-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-color-props":typeof a=="string"?a:void 0,"--xy-minimap-node-stroke-width-props":typeof c=="number"?c:void 0},className:Tt(["react-flow__minimap",n]),"data-testid":"rf__minimap",children:g.jsxs("svg",{width:H,height:O,viewBox:`${ae} ${U} ${Z} ${ne}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":le,ref:z,onClick:ye,children:[be&&g.jsx("title",{id:le,children:be}),g.jsx(xB,{onClick:xe,nodeColor:i,nodeStrokeColor:a,nodeBorderRadius:l,nodeClassName:o,nodeStrokeWidth:c,nodeComponent:d}),g.jsx("path",{className:"react-flow__minimap-mask",d:`M${ae-Y},${U-Y}h${Z+Y*2}v${ne+Y*2}h${-Z-Y*2}z
        M${A.x},${A.y}h${A.width}v${A.height}h${-A.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}TR.displayName="MiniMap";const TB=q.memo(TR),jB=e=>n=>e?`${Math.max(1/n.transform[2],1)}`:void 0,NB={[oo.Line]:"right",[oo.Handle]:"bottom-right"};function RB({nodeId:e,position:n,variant:a=oo.Handle,className:i,style:o=void 0,children:l,color:c,minWidth:d=10,minHeight:f=10,maxWidth:h=Number.MAX_VALUE,maxHeight:p=Number.MAX_VALUE,keepAspectRatio:v=!1,resizeDirection:m,autoScale:b=!0,shouldResize:_,onResizeStart:S,onResize:w,onResizeEnd:C}){const T=rR(),E=typeof e=="string"?e:T,N=dt(),R=q.useRef(null),z=a===oo.Handle,j=Ie(q.useCallback(jB(z&&b),[z,b]),pt),A=q.useRef(null),D=n??NB[a];q.useEffect(()=>{if(!(!R.current||!E))return A.current||(A.current=aq({domNode:R.current,nodeId:E,getStoreItems:()=>{const{nodeLookup:P,transform:V,snapGrid:$,snapToGrid:L,nodeOrigin:H,domNode:O}=N.getState();return{nodeLookup:P,transform:V,snapGrid:$,snapToGrid:L,nodeOrigin:H,paneDomNode:O}},onChange:(P,V)=>{const{triggerNodeChanges:$,nodeLookup:L,parentLookup:H,nodeOrigin:O}=N.getState(),F=[],J={x:P.x,y:P.y},G=L.get(E);if(G&&G.expandParent&&G.parentId){const re=G.origin??O,B=P.width??G.measured.width??0,Y=P.height??G.measured.height??0,ae={id:G.id,parentId:G.parentId,rect:{width:B,height:Y,...R2({x:P.x??G.position.x,y:P.y??G.position.y},{width:B,height:Y},G.parentId,L,re)}},U=xb([ae],L,H,O);F.push(...U),J.x=P.x?Math.max(re[0]*B,P.x):void 0,J.y=P.y?Math.max(re[1]*Y,P.y):void 0}if(J.x!==void 0&&J.y!==void 0){const re={id:E,type:"position",position:{...J}};F.push(re)}if(P.width!==void 0&&P.height!==void 0){const B={id:E,type:"dimensions",resizing:!0,setAttributes:m?m==="horizontal"?"width":"height":!0,dimensions:{width:P.width,height:P.height}};F.push(B)}for(const re of V){const B={...re,type:"position"};F.push(B)}$(F)},onEnd:({width:P,height:V})=>{const $={id:E,type:"dimensions",resizing:!1,dimensions:{width:P,height:V}};N.getState().triggerNodeChanges([$])}})),A.current.update({controlPosition:D,boundaries:{minWidth:d,minHeight:f,maxWidth:h,maxHeight:p},keepAspectRatio:v,resizeDirection:m,onResizeStart:S,onResize:w,onResizeEnd:C,shouldResize:_}),()=>{A.current?.destroy()}},[D,d,f,h,p,v,S,w,C,_]);const I=D.split("-");return g.jsx("div",{className:Tt(["react-flow__resize-control","nodrag",...I,a,i]),ref:R,style:{...o,scale:j,...c&&{[z?"backgroundColor":"borderColor"]:c}},children:l})}q.memo(RB);const XS=e=>{let n;const a=new Set,i=(h,p)=>{const v=typeof h=="function"?h(n):h;if(!Object.is(v,n)){const m=n;n=p??(typeof v!="object"||v===null)?v:Object.assign({},n,v),a.forEach(b=>b(n,m))}},o=()=>n,d={setState:i,getState:o,getInitialState:()=>f,subscribe:h=>(a.add(h),()=>a.delete(h))},f=n=e(i,o,d);return d},MB=(e=>e?XS(e):XS),AB=e=>e;function zB(e,n=AB){const a=Kn.useSyncExternalStore(e.subscribe,Kn.useCallback(()=>n(e.getState()),[e,n]),Kn.useCallback(()=>n(e.getInitialState()),[e,n]));return Kn.useDebugValue(a),a}const DB=e=>{const n=MB(e),a=i=>zB(n,i);return Object.assign(a,n),a},Ya=(e=>DB),KS={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},qs=new Map,Mc=e=>{const n=qs.get(e);return n?Object.fromEntries(Object.entries(n.stores).map(([a,i])=>[a,i.getState()])):{}},kB=(e,n,a)=>{if(e===void 0)return{type:"untracked",connection:n.connect(a)};const i=qs.get(a.name);if(i)return{type:"tracked",store:e,...i};const o={connection:n.connect(a),stores:{}};return qs.set(a.name,o),{type:"tracked",store:e,...o}},OB=(e,n)=>{if(n===void 0)return;const a=qs.get(e);a&&(delete a.stores[n],Object.keys(a.stores).length===0&&qs.delete(e))},qB=e=>{var n,a;if(!e)return;const i=e.split(`
`),o=i.findIndex(c=>c.includes("api.setState"));if(o<0)return;const l=((n=i[o+1])==null?void 0:n.trim())||"";return(a=/.+ (.+) .+/.exec(l))==null?void 0:a[1]},BB=(e,n={})=>(a,i,o)=>{const{enabled:l,anonymousActionType:c,store:d,...f}=n;let h;try{h=(l??(KS?"production":void 0)!=="production")&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!h)return e(a,i,o);const{connection:p,...v}=kB(d,h,f);let m=!0;o.setState=((S,w,C)=>{const T=a(S,w);if(!m)return T;const E=C===void 0?{type:c||qB(new Error().stack)||"anonymous"}:typeof C=="string"?{type:C}:C;return d===void 0?(p?.send(E,i()),T):(p?.send({...E,type:`${d}/${E.type}`},{...Mc(f.name),[d]:o.getState()}),T)}),o.devtools={cleanup:()=>{p&&typeof p.unsubscribe=="function"&&p.unsubscribe(),OB(f.name,d)}};const b=(...S)=>{const w=m;m=!1,a(...S),m=w},_=e(o.setState,i,o);if(v.type==="untracked"?p?.init(_):(v.stores[v.store]=o,p?.init(Object.fromEntries(Object.entries(v.stores).map(([S,w])=>[S,S===v.store?_:w.getState()])))),o.dispatchFromDevtools&&typeof o.dispatch=="function"){let S=!1;const w=o.dispatch;o.dispatch=(...C)=>{(KS?"production":void 0)!=="production"&&C[0].type==="__setState"&&!S&&(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),S=!0),w(...C)}}return p.subscribe(S=>{var w;switch(S.type){case"ACTION":if(typeof S.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return ph(S.payload,C=>{if(C.type==="__setState"){if(d===void 0){b(C.state);return}Object.keys(C.state).length!==1&&console.error(`
                    [zustand devtools middleware] Unsupported __setState action format.
                    When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),
                    and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }
                    `);const T=C.state[d];if(T==null)return;JSON.stringify(o.getState())!==JSON.stringify(T)&&b(T);return}o.dispatchFromDevtools&&typeof o.dispatch=="function"&&o.dispatch(C)});case"DISPATCH":switch(S.payload.type){case"RESET":return b(_),d===void 0?p?.init(o.getState()):p?.init(Mc(f.name));case"COMMIT":if(d===void 0){p?.init(o.getState());return}return p?.init(Mc(f.name));case"ROLLBACK":return ph(S.state,C=>{if(d===void 0){b(C),p?.init(o.getState());return}b(C[d]),p?.init(Mc(f.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return ph(S.state,C=>{if(d===void 0){b(C);return}JSON.stringify(o.getState())!==JSON.stringify(C[d])&&b(C[d])});case"IMPORT_STATE":{const{nextLiftedState:C}=S.payload,T=(w=C.computedStates.slice(-1)[0])==null?void 0:w.state;if(!T)return;b(d===void 0?T:T[d]),p?.send(null,C);return}case"PAUSE_RECORDING":return m=!m}return}}),_},co=BB,ph=(e,n)=>{let a;try{a=JSON.parse(e)}catch(i){console.error("[zustand devtools middleware] Could not parse the received json",i)}a!==void 0&&n(a)};function LB(e,n){let a;try{a=e()}catch{return}return{getItem:o=>{var l;const c=f=>f===null?null:JSON.parse(f,void 0),d=(l=a.getItem(o))!=null?l:null;return d instanceof Promise?d.then(c):c(d)},setItem:(o,l)=>a.setItem(o,JSON.stringify(l,void 0)),removeItem:o=>a.removeItem(o)}}const tb=e=>n=>{try{const a=e(n);return a instanceof Promise?a:{then(i){return tb(i)(a)},catch(i){return this}}}catch(a){return{then(i){return this},catch(i){return tb(i)(a)}}}},HB=(e,n)=>(a,i,o)=>{let l={storage:LB(()=>localStorage),partialize:S=>S,version:0,merge:(S,w)=>({...w,...S}),...n},c=!1;const d=new Set,f=new Set;let h=l.storage;if(!h)return e((...S)=>{console.warn(`[zustand persist middleware] Unable to update item '${l.name}', the given storage is currently unavailable.`),a(...S)},i,o);const p=()=>{const S=l.partialize({...i()});return h.setItem(l.name,{state:S,version:l.version})},v=o.setState;o.setState=(S,w)=>(v(S,w),p());const m=e((...S)=>(a(...S),p()),i,o);o.getInitialState=()=>m;let b;const _=()=>{var S,w;if(!h)return;c=!1,d.forEach(T=>{var E;return T((E=i())!=null?E:m)});const C=((w=l.onRehydrateStorage)==null?void 0:w.call(l,(S=i())!=null?S:m))||void 0;return tb(h.getItem.bind(h))(l.name).then(T=>{if(T)if(typeof T.version=="number"&&T.version!==l.version){if(l.migrate){const E=l.migrate(T.state,T.version);return E instanceof Promise?E.then(N=>[!0,N]):[!0,E]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,T.state];return[!1,void 0]}).then(T=>{var E;const[N,R]=T;if(b=l.merge(R,(E=i())!=null?E:m),a(b,!0),N)return p()}).then(()=>{C?.(b,void 0),b=i(),c=!0,f.forEach(T=>T(b))}).catch(T=>{C?.(void 0,T)})};return o.persist={setOptions:S=>{l={...l,...S},S.storage&&(h=S.storage)},clearStorage:()=>{h?.removeItem(l.name)},getOptions:()=>l,rehydrate:()=>_(),hasHydrated:()=>c,onHydrate:S=>(d.add(S),()=>{d.delete(S)}),onFinishHydration:S=>(f.add(S),()=>{f.delete(S)})},l.skipHydration||_(),b||m},jR=HB,ut=Ya()(co(jR(e=>({mode:"agent",setMode:n=>e({mode:n}),selectedNodeIds:new Set,selectNode:n=>e(a=>({selectedNodeIds:new Set(a.selectedNodeIds).add(n)})),deselectNode:n=>e(a=>{const i=new Set(a.selectedNodeIds);return i.delete(n),{selectedNodeIds:i}}),clearSelection:()=>e({selectedNodeIds:new Set}),detailWindows:new Map,openDetailWindow:n=>e(a=>{const i=new Map(a.detailWindows);return i.has(n)||i.set(n,{nodeId:n,position:{x:100+i.size*20,y:100+i.size*20},size:{width:600,height:400},activeTab:a.defaultTab}),{detailWindows:i}}),closeDetailWindow:n=>e(a=>{const i=new Map(a.detailWindows);return i.delete(n),{detailWindows:i}}),updateDetailWindow:(n,a)=>e(i=>{const o=new Map(i.detailWindows),l=o.get(n);return l&&o.set(n,{...l,...a}),{detailWindows:o}}),layoutDirection:"TB",setLayoutDirection:n=>e({layoutDirection:n}),autoLayoutEnabled:!0,setAutoLayoutEnabled:n=>e({autoLayoutEnabled:n}),defaultTab:"liveOutput",setDefaultTab:n=>e({defaultTab:n})}),{name:"ui-storage",partialize:e=>({defaultTab:e.defaultTab,layoutDirection:e.layoutDirection,autoLayoutEnabled:e.autoLayoutEnabled})}),{name:"uiStore"})),NR={version:"1.0.0",ui:{showFilters:!1,showControls:!0,showSettings:!1},graph:{edgeType:"bezier",edgeStrokeWidth:3,edgeAnimation:!0,showEdgeLabels:!0},appearance:{agentIdleColor:"#60a5fa",agentActiveColor:"#10b981",agentErrorColor:"#ef4444",nodeShadow:"medium",showStatusPulse:!0,compactNodeView:!1,theme:"default"},advanced:{layoutDirection:"LR",nodeSpacing:75,rankSpacing:150,debugMode:!1,performanceMode:!1}},IB=e=>({setShowFilters:n=>e(a=>({ui:{...a.ui,showFilters:n}})),setShowControls:n=>e(a=>({ui:{...a.ui,showControls:n}})),setShowSettings:n=>e(a=>({ui:{...a.ui,showSettings:n}})),setEdgeType:n=>e(a=>({graph:{...a.graph,edgeType:n}})),setEdgeStrokeWidth:n=>e(a=>({graph:{...a.graph,edgeStrokeWidth:n}})),setEdgeAnimation:n=>e(a=>({graph:{...a.graph,edgeAnimation:n}})),setShowEdgeLabels:n=>e(a=>({graph:{...a.graph,showEdgeLabels:n}})),setTheme:n=>e(a=>({appearance:{...a.appearance,theme:n}})),setAgentIdleColor:n=>e(a=>({appearance:{...a.appearance,agentIdleColor:n}})),setAgentActiveColor:n=>e(a=>({appearance:{...a.appearance,agentActiveColor:n}})),setAgentErrorColor:n=>e(a=>({appearance:{...a.appearance,agentErrorColor:n}})),setNodeShadow:n=>e(a=>({appearance:{...a.appearance,nodeShadow:n}})),setShowStatusPulse:n=>e(a=>({appearance:{...a.appearance,showStatusPulse:n}})),setCompactNodeView:n=>e(a=>({appearance:{...a.appearance,compactNodeView:n}})),setLayoutDirection:n=>e(a=>({advanced:{...a.advanced,layoutDirection:n}})),setNodeSpacing:n=>e(a=>({advanced:{...a.advanced,nodeSpacing:n}})),setRankSpacing:n=>e(a=>({advanced:{...a.advanced,rankSpacing:n}})),setDebugMode:n=>e(a=>({advanced:{...a.advanced,debugMode:n}})),setPerformanceMode:n=>e(a=>({advanced:{...a.advanced,performanceMode:n}})),resetToDefaults:()=>e(NR)}),_e=Ya()(jR(e=>({...NR,...IB(e)}),{name:"flock-flow-settings",version:1})),RR=q.memo(({data:e,selected:n})=>{const a=e,i=a.name,o=a.status,l=a.sentCount,c=a.recvCount,d=a.subscriptions||[],f=a.outputTypes||[],h=a.receivedByType||{},p=a.sentByType||{},v=a.streamingTokens||[],m={...h};d.forEach($=>{$ in m||(m[$]=0)});const b={...p};f.forEach($=>{$ in b||(b[$]=0)});const[_,S]=q.useState(new Set),w=q.useRef({});q.useEffect(()=>{const $={...h,...p},L=new Set;if(Object.entries($).forEach(([H,O])=>{w.current[H]!==void 0&&w.current[H]!==O&&L.add(H),w.current[H]=O}),L.size>0){S(L);const H=setTimeout(()=>S(new Set),500);return()=>clearTimeout(H)}},[h,p]);const C=()=>{ut.getState().openDetailWindow(i)},T=_e($=>$.appearance.agentIdleColor),E=_e($=>$.appearance.agentActiveColor),N=_e($=>$.appearance.agentErrorColor),R=_e($=>$.appearance.nodeShadow),z=_e($=>$.appearance.showStatusPulse),j=_e($=>$.appearance.compactNodeView),D=o==="running"?{indicatorColor:E,borderColor:E,borderWidth:"3px"}:o==="error"?{indicatorColor:N,borderColor:N,borderWidth:"2px"}:{indicatorColor:T,borderColor:T,borderWidth:"2px"},P={none:"none",small:"var(--shadow-sm)",medium:"var(--shadow-md)",large:"var(--shadow-lg)"}[R],V=n?"var(--shadow-lg), var(--shadow-glow-primary)":P;return g.jsxs("div",{className:`agent-node ${n?"selected":""}`,onDoubleClick:C,style:{padding:j?"var(--space-component-sm)":"var(--space-component-md)",border:`${D.borderWidth} solid ${D.borderColor}`,borderRadius:"var(--radius-lg)",backgroundColor:"var(--color-bg-surface)",minWidth:j?"160px":"200px",maxWidth:"300px",boxShadow:V,cursor:"pointer",transition:"var(--transition-all)"},children:[g.jsx(ga,{type:"target",position:je.Left}),g.jsx(ga,{type:"source",position:je.Right}),g.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"var(--spacing-2)"},children:[g.jsx("span",{style:{fontWeight:600,fontSize:j?"14px":"16px",color:"var(--color-text-primary)",lineHeight:1.4},children:i}),g.jsx("span",{style:{width:j?"12px":"14px",height:j?"12px":"14px",borderRadius:"50%",backgroundColor:D.indicatorColor,display:"inline-block",flexShrink:0,marginLeft:"var(--spacing-2)",animation:o==="running"&&z?"pulse 2s infinite":"none"},title:o})]}),!j&&g.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[Object.entries(m).map(([$,L])=>{const H=_.has($);return g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--spacing-2)",padding:"6px 10px",background:H?"var(--color-info-bg)":"rgba(59, 130, 246, 0.08)",borderLeft:"3px solid var(--color-info)",borderRadius:"var(--radius-md)",transition:"var(--transition-all)",boxShadow:H?"var(--shadow-glow-primary)":"var(--shadow-xs)"},children:[g.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",borderRadius:"var(--radius-sm)",background:"var(--color-info-bg)",color:"var(--color-info-light)",fontSize:"12px",fontWeight:700},children:"↓"}),g.jsx("div",{style:{minWidth:"24px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"var(--radius-full)",background:H?"var(--color-info)":"var(--color-info-bg)",color:H?"var(--color-text-on-primary)":"var(--color-info-light)",fontSize:"12px",fontWeight:700,padding:"0 var(--spacing-2)",transition:"var(--transition-all)"},children:L}),g.jsx("div",{style:{flex:1,fontSize:"11px",fontFamily:"var(--font-family-mono)",color:"var(--color-text-secondary)",fontWeight:500,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:$})]},`in-${$}`)}),Object.entries(b).map(([$,L])=>{const H=_.has($);return g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--spacing-2)",padding:"6px 10px",background:H?"var(--color-success-bg)":"rgba(16, 185, 129, 0.08)",borderLeft:"3px solid var(--color-success)",borderRadius:"var(--radius-md)",transition:"var(--transition-all)",boxShadow:H?"var(--shadow-glow-success)":"var(--shadow-xs)"},children:[g.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",borderRadius:"var(--radius-sm)",background:"var(--color-success-bg)",color:"var(--color-success-light)",fontSize:"12px",fontWeight:700},children:"↑"}),g.jsx("div",{style:{minWidth:"24px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"var(--radius-full)",background:H?"var(--color-success)":"var(--color-success-bg)",color:H?"var(--color-text-on-primary)":"var(--color-success-light)",fontSize:"12px",fontWeight:700,padding:"0 var(--spacing-2)",transition:"var(--transition-all)"},children:L}),g.jsx("div",{style:{flex:1,fontSize:"11px",fontFamily:"var(--font-family-mono)",color:"var(--color-text-secondary)",fontWeight:500,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:$})]},`out-${$}`)}),Object.keys(m).length===0&&Object.keys(b).length===0&&g.jsxs("div",{style:{fontSize:"11px",color:"var(--color-text-tertiary)",opacity:.6},children:[g.jsxs("span",{children:["↓ ",c," in"]}),g.jsxs("span",{style:{marginLeft:"var(--spacing-2)"},children:["↑ ",l," out"]})]}),v.length>0&&g.jsx("div",{style:{padding:"4px 8px",background:"rgba(250, 204, 21, 0.08)",borderLeft:"2px solid var(--color-warning)",borderRadius:"var(--radius-sm)",overflow:"hidden",minWidth:0,display:"flex",justifyContent:"center"},children:g.jsx("div",{style:{width:"200px",fontSize:"10px",fontFamily:"var(--font-family-mono)",color:"var(--color-warning-light)",fontWeight:500,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:v.join("")})})]}),j&&g.jsxs("div",{style:{display:"flex",gap:"var(--spacing-4)",fontSize:"11px",color:"var(--color-text-tertiary)"},children:[g.jsxs("span",{title:"Received",children:["↓ ",c," ",g.jsx("span",{style:{fontSize:"10px",opacity:.7},children:"in"})]}),g.jsxs("span",{title:"Sent",children:["↑ ",l," ",g.jsx("span",{style:{fontSize:"10px",opacity:.7},children:"out"})]})]})]})});RR.displayName="AgentNode";function fe(){return fe=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var a=arguments[n];for(var i in a)({}).hasOwnProperty.call(a,i)&&(e[i]=a[i])}return e},fe.apply(null,arguments)}function Ue(e,n){if(e==null)return{};var a={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(n.indexOf(i)!==-1)continue;a[i]=e[i]}return a}var MR={},AR=q.createContext(MR),UB=(e,n)=>fe({},e,n),VB=()=>q.useContext(AR),wb=q.createContext(()=>{});wb.displayName="JVR.DispatchShowTools";function FB(){return q.useReducer(UB,MR)}function zR(){return q.useContext(wb)}var DR=e=>{var{initial:n,dispatch:a,children:i}=e;return g.jsx(AR.Provider,{value:n,children:g.jsx(wb.Provider,{value:a,children:i})})};DR.displayName="JVR.ShowTools";var kR={},OR=q.createContext(kR),PB=(e,n)=>fe({},e,n),gu=()=>q.useContext(OR),Eb=q.createContext(()=>{});Eb.displayName="JVR.DispatchExpands";function GB(){return q.useReducer(PB,kR)}function $B(){return q.useContext(Eb)}var qR=e=>{var{initial:n,dispatch:a,children:i}=e;return g.jsx(OR.Provider,{value:n,children:g.jsx(Eb.Provider,{value:a,children:i})})};qR.displayName="JVR.Expands";var BR={Str:{as:"span","data-type":"string",style:{color:"var(--w-rjv-type-string-color, #cb4b16)"},className:"w-rjv-type",children:"string"},Url:{as:"a",style:{color:"var(--w-rjv-type-url-color, #0969da)"},"data-type":"url",className:"w-rjv-type",children:"url"},Undefined:{style:{color:"var(--w-rjv-type-undefined-color, #586e75)"},as:"span","data-type":"undefined",className:"w-rjv-type",children:"undefined"},Null:{style:{color:"var(--w-rjv-type-null-color, #d33682)"},as:"span","data-type":"null",className:"w-rjv-type",children:"null"},Map:{style:{color:"var(--w-rjv-type-map-color, #268bd2)",marginRight:3},as:"span","data-type":"map",className:"w-rjv-type",children:"Map"},Nan:{style:{color:"var(--w-rjv-type-nan-color, #859900)"},as:"span","data-type":"nan",className:"w-rjv-type",children:"NaN"},Bigint:{style:{color:"var(--w-rjv-type-bigint-color, #268bd2)"},as:"span","data-type":"bigint",className:"w-rjv-type",children:"bigint"},Int:{style:{color:"var(--w-rjv-type-int-color, #268bd2)"},as:"span","data-type":"int",className:"w-rjv-type",children:"int"},Set:{style:{color:"var(--w-rjv-type-set-color, #268bd2)",marginRight:3},as:"span","data-type":"set",className:"w-rjv-type",children:"Set"},Float:{style:{color:"var(--w-rjv-type-float-color, #859900)"},as:"span","data-type":"float",className:"w-rjv-type",children:"float"},True:{style:{color:"var(--w-rjv-type-boolean-color, #2aa198)"},as:"span","data-type":"bool",className:"w-rjv-type",children:"bool"},False:{style:{color:"var(--w-rjv-type-boolean-color, #2aa198)"},as:"span","data-type":"bool",className:"w-rjv-type",children:"bool"},Date:{style:{color:"var(--w-rjv-type-date-color, #268bd2)"},as:"span","data-type":"date",className:"w-rjv-type",children:"date"}},LR=q.createContext(BR),YB=(e,n)=>fe({},e,n),it=()=>q.useContext(LR),Cb=q.createContext(()=>{});Cb.displayName="JVR.DispatchTypes";function WB(){return q.useReducer(YB,BR)}function XB(){return q.useContext(Cb)}function HR(e){var{initial:n,dispatch:a,children:i}=e;return g.jsx(LR.Provider,{value:n,children:g.jsx(Cb.Provider,{value:a,children:i})})}HR.displayName="JVR.Types";var KB=["style"];function IR(e){var{style:n}=e,a=Ue(e,KB),i=fe({cursor:"pointer",height:"1em",width:"1em",userSelect:"none",display:"inline-flex"},n);return g.jsx("svg",fe({viewBox:"0 0 24 24",fill:"var(--w-rjv-arrow-color, currentColor)",style:i},a,{children:g.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"})}))}IR.displayName="JVR.TriangleArrow";var UR={Arrow:{as:"span",className:"w-rjv-arrow",style:{transform:"rotate(0deg)",transition:"all 0.3s"},children:g.jsx(IR,{})},Colon:{as:"span",style:{color:"var(--w-rjv-colon-color, var(--w-rjv-color))",marginLeft:0,marginRight:2},className:"w-rjv-colon",children:":"},Quote:{as:"span",style:{color:"var(--w-rjv-quotes-color, #236a7c)"},className:"w-rjv-quotes",children:'"'},ValueQuote:{as:"span",style:{color:"var(--w-rjv-quotes-string-color, #cb4b16)"},className:"w-rjv-quotes",children:'"'},BracketsLeft:{as:"span",style:{color:"var(--w-rjv-brackets-color, #236a7c)"},className:"w-rjv-brackets-start",children:"["},BracketsRight:{as:"span",style:{color:"var(--w-rjv-brackets-color, #236a7c)"},className:"w-rjv-brackets-end",children:"]"},BraceLeft:{as:"span",style:{color:"var(--w-rjv-curlybraces-color, #236a7c)"},className:"w-rjv-curlybraces-start",children:"{"},BraceRight:{as:"span",style:{color:"var(--w-rjv-curlybraces-color, #236a7c)"},className:"w-rjv-curlybraces-end",children:"}"}},VR=q.createContext(UR),ZB=(e,n)=>fe({},e,n),nn=()=>q.useContext(VR),Tb=q.createContext(()=>{});Tb.displayName="JVR.DispatchSymbols";function QB(){return q.useReducer(ZB,UR)}function JB(){return q.useContext(Tb)}var FR=e=>{var{initial:n,dispatch:a,children:i}=e;return g.jsx(VR.Provider,{value:n,children:g.jsx(Tb.Provider,{value:a,children:i})})};FR.displayName="JVR.Symbols";var PR={Copied:{className:"w-rjv-copied",style:{height:"1em",width:"1em",cursor:"pointer",verticalAlign:"middle",marginLeft:5}},CountInfo:{as:"span",className:"w-rjv-object-size",style:{color:"var(--w-rjv-info-color, #0000004d)",paddingLeft:8,fontStyle:"italic"}},CountInfoExtra:{as:"span",className:"w-rjv-object-extra",style:{paddingLeft:8}},Ellipsis:{as:"span",style:{cursor:"pointer",color:"var(--w-rjv-ellipsis-color, #cb4b16)",userSelect:"none"},className:"w-rjv-ellipsis",children:"..."},Row:{as:"div",className:"w-rjv-line"},KeyName:{as:"span",className:"w-rjv-object-key"}},GR=q.createContext(PR),eL=(e,n)=>fe({},e,n),Tn=()=>q.useContext(GR),jb=q.createContext(()=>{});jb.displayName="JVR.DispatchSection";function tL(){return q.useReducer(eL,PR)}function nL(){return q.useContext(jb)}var $R=e=>{var{initial:n,dispatch:a,children:i}=e;return g.jsx(GR.Provider,{value:n,children:g.jsx(jb.Provider,{value:a,children:i})})};$R.displayName="JVR.Section";var YR={objectSortKeys:!1,indentWidth:15},Nb=q.createContext(YR);Nb.displayName="JVR.Context";var WR=q.createContext(()=>{});WR.displayName="JVR.DispatchContext";function rL(e,n){return fe({},e,n)}var Wa=()=>q.useContext(Nb),XR=e=>{var{children:n,initialState:a,initialTypes:i}=e,[o,l]=q.useReducer(rL,Object.assign({},YR,a)),[c,d]=FB(),[f,h]=GB(),[p,v]=WB(),[m,b]=QB(),[_,S]=tL();return q.useEffect(()=>l(fe({},a)),[a]),g.jsx(Nb.Provider,{value:o,children:g.jsx(WR.Provider,{value:l,children:g.jsx(DR,{initial:c,dispatch:d,children:g.jsx(qR,{initial:f,dispatch:h,children:g.jsx(HR,{initial:fe({},p,i),dispatch:v,children:g.jsx(FR,{initial:m,dispatch:b,children:g.jsx($R,{initial:_,dispatch:S,children:n})})})})})})})};XR.displayName="JVR.Provider";function aL(e){if(e==null)throw new TypeError("Cannot destructure "+e)}var iL=["isNumber","value","parentValue","keyName","keys"],oL=["as","render"],sL=["as","render"],lL=["as","render"],cL=["as","style","render"],uL=["as","render"],dL=["as","render"],fL=["as","render"],hL=["as","render"],nb=e=>{var{Quote:n={}}=nn(),{isNumber:a,value:i,parentValue:o,keyName:l,keys:c}=e,d=Ue(e,iL);if(a)return null;var{as:f,render:h}=n,p=Ue(n,oL),v=f||"span",m=fe({},d,p),b={value:i,parentValue:o,keyName:l,keys:c||(l?[l]:[])},_=h&&typeof h=="function"&&h(m,b);return _||g.jsx(v,fe({},m))};nb.displayName="JVR.Quote";var Bs=e=>{var{ValueQuote:n={}}=nn(),a=fe({},(aL(e),e)),{as:i,render:o}=n,l=Ue(n,sL),c=i||"span",d=fe({},a,l),f=o&&typeof o=="function"&&o(d,{});return f||g.jsx(c,fe({},d))};Bs.displayName="JVR.ValueQuote";var KR=e=>{var{value:n,parentValue:a,keyName:i,keys:o}=e,{Colon:l={}}=nn(),{as:c,render:d}=l,f=Ue(l,lL),h=c||"span",p=d&&typeof d=="function"&&d(f,{value:n,parentValue:a,keyName:i,keys:o||(i?[i]:[])});return p||g.jsx(h,fe({},f))};KR.displayName="JVR.Colon";var ZR=e=>{var{Arrow:n={}}=nn(),a=gu(),{expandKey:i,style:o,value:l,parentValue:c,keyName:d,keys:f}=e,h=!!a[i],{as:p,style:v,render:m}=n,b=Ue(n,cL),_=p||"span",S=m&&typeof m=="function",w=fe({},b,{"data-expanded":h,style:fe({},v,o)}),C={value:l,parentValue:c,keyName:d,keys:f||(d?[d]:[])},T=S&&m(w,C);return T||g.jsx(_,fe({},b,{style:fe({},v,o)}))};ZR.displayName="JVR.Arrow";var QR=e=>{var{isBrackets:n,value:a,parentValue:i,keyName:o,keys:l}=e,{BracketsLeft:c={},BraceLeft:d={}}=nn(),f={value:a,parentValue:i,keyName:o,keys:l||(o?[o]:[])};if(n){var{as:h,render:p}=c,v=Ue(c,uL),m=h||"span",b=p&&typeof p=="function"&&p(v,f);return b||g.jsx(m,fe({},v))}var{as:_,render:S}=d,w=Ue(d,dL),C=_||"span",T=S&&typeof S=="function"&&S(w,f);return T||g.jsx(C,fe({},w))};QR.displayName="JVR.BracketsOpen";var Rb=e=>{var{isBrackets:n,isVisiable:a,value:i,parentValue:o,keyName:l,keys:c}=e,d={value:i,parentValue:o,keyName:l,keys:c||(l?[l]:[])};if(!a)return null;var{BracketsRight:f={},BraceRight:h={}}=nn();if(n){var{as:p,render:v}=f,m=Ue(f,fL),b=p||"span",_=v&&typeof v=="function"&&v(m,d);return _||g.jsx(b,fe({},m))}var{as:S,render:w}=h,C=Ue(h,hL),T=S||"span",E=w&&typeof w=="function"&&w(C,d);return E||g.jsx(T,fe({},C))};Rb.displayName="JVR.BracketsClose";var JR=e=>{var n,{keyName:a,value:i,expandKey:o,parentValue:l,level:c,keys:d=[]}=e,f=gu(),{collapsed:h,shouldExpandNodeInitially:p}=Wa(),v=typeof h=="boolean"?h:typeof h=="number"?c>h:!1,m=(n=f[o])!=null?n:p?!1:v,b=p&&p(!m,{value:i,keys:d,level:c,keyName:a,parentValue:l});if(f[o]===void 0&&!b)return null;var _=Object.keys(i).length;if(m||_===0)return null;var S={paddingLeft:4},w={keyName:a,value:i,keys:d,parentValue:l},C=Array.isArray(i),T=i instanceof Set;return g.jsx("div",{style:S,children:g.jsx(Rb,fe({isBrackets:C||T},w,{isVisiable:!0}))})};JR.displayName="JVR.NestedClose";var pL=["as","render"],gL=["as","render"],vL=["as","render"],mL=["as","render"],yL=["as","render"],bL=["as","render"],xL=["as","render"],_L=["as","render"],SL=["as","render"],wL=["as","render"],EL=["as","render"],CL=["as","render"],TL=["as","render"],rb=e=>{if(e===void 0)return"0n";if(typeof e=="string")try{e=BigInt(e)}catch{return"0n"}return e?e.toString()+"n":"0n"},eM=e=>{var{value:n,keyName:a}=e,{Set:i={},displayDataTypes:o}=it(),l=n instanceof Set;if(!l||!o)return null;var{as:c,render:d}=i,f=Ue(i,pL),h=d&&typeof d=="function",p=h&&d(f,{type:"type",value:n,keyName:a});if(p)return p;var v=c||"span";return g.jsx(v,fe({},f))};eM.displayName="JVR.SetComp";var tM=e=>{var{value:n,keyName:a}=e,{Map:i={},displayDataTypes:o}=it(),l=n instanceof Map;if(!l||!o)return null;var{as:c,render:d}=i,f=Ue(i,gL),h=d&&typeof d=="function",p=h&&d(f,{type:"type",value:n,keyName:a});if(p)return p;var v=c||"span";return g.jsx(v,fe({},f))};tM.displayName="JVR.MapComp";var Hn={opacity:.75,paddingRight:4},nM=e=>{var{children:n="",keyName:a,keys:i}=e,{Str:o={},displayDataTypes:l}=it(),{shortenTextAfterLength:c=30,stringEllipsis:d="..."}=Wa(),{as:f,render:h}=o,p=Ue(o,vL),v=n,[m,b]=q.useState(c&&v.length>c);q.useEffect(()=>b(c&&v.length>c),[c]);var _=f||"span",S=fe({},Hn,o.style||{});c>0&&(p.style=fe({},p.style,{cursor:v.length<=c?"initial":"pointer"}),v.length>c&&(p.onClick=()=>{b(!m)}));var w=m?""+v.slice(0,c)+d:v,C=h&&typeof h=="function",T=C&&h(fe({},p,{style:S}),{type:"type",value:n,keyName:a,keys:i}),E=m?"w-rjv-value w-rjv-value-short":"w-rjv-value",N=C&&h(fe({},p,{children:w,className:E}),{type:"value",value:n,keyName:a,keys:i});return g.jsxs(q.Fragment,{children:[l&&(T||g.jsx(_,fe({},p,{style:S}))),N||g.jsxs(q.Fragment,{children:[g.jsx(Bs,{}),g.jsx(_,fe({},p,{className:E,children:w})),g.jsx(Bs,{})]})]})};nM.displayName="JVR.TypeString";var rM=e=>{var{children:n,keyName:a,keys:i}=e,{True:o={},displayDataTypes:l}=it(),{as:c,render:d}=o,f=Ue(o,mL),h=c||"span",p=fe({},Hn,o.style||{}),v=d&&typeof d=="function",m=v&&d(fe({},f,{style:p}),{type:"type",value:n,keyName:a,keys:i}),b=v&&d(fe({},f,{children:n,className:"w-rjv-value"}),{type:"value",value:n,keyName:a,keys:i});return g.jsxs(q.Fragment,{children:[l&&(m||g.jsx(h,fe({},f,{style:p}))),b||g.jsx(h,fe({},f,{className:"w-rjv-value",children:n?.toString()}))]})};rM.displayName="JVR.TypeTrue";var aM=e=>{var{children:n,keyName:a,keys:i}=e,{False:o={},displayDataTypes:l}=it(),{as:c,render:d}=o,f=Ue(o,yL),h=c||"span",p=fe({},Hn,o.style||{}),v=d&&typeof d=="function",m=v&&d(fe({},f,{style:p}),{type:"type",value:n,keyName:a,keys:i}),b=v&&d(fe({},f,{children:n,className:"w-rjv-value"}),{type:"value",value:n,keyName:a,keys:i});return g.jsxs(q.Fragment,{children:[l&&(m||g.jsx(h,fe({},f,{style:p}))),b||g.jsx(h,fe({},f,{className:"w-rjv-value",children:n?.toString()}))]})};aM.displayName="JVR.TypeFalse";var iM=e=>{var{children:n,keyName:a,keys:i}=e,{Float:o={},displayDataTypes:l}=it(),{as:c,render:d}=o,f=Ue(o,bL),h=c||"span",p=fe({},Hn,o.style||{}),v=d&&typeof d=="function",m=v&&d(fe({},f,{style:p}),{type:"type",value:n,keyName:a,keys:i}),b=v&&d(fe({},f,{children:n,className:"w-rjv-value"}),{type:"value",value:n,keyName:a,keys:i});return g.jsxs(q.Fragment,{children:[l&&(m||g.jsx(h,fe({},f,{style:p}))),b||g.jsx(h,fe({},f,{className:"w-rjv-value",children:n?.toString()}))]})};iM.displayName="JVR.TypeFloat";var oM=e=>{var{children:n,keyName:a,keys:i}=e,{Int:o={},displayDataTypes:l}=it(),{as:c,render:d}=o,f=Ue(o,xL),h=c||"span",p=fe({},Hn,o.style||{}),v=d&&typeof d=="function",m=v&&d(fe({},f,{style:p}),{type:"type",value:n,keyName:a,keys:i}),b=v&&d(fe({},f,{children:n,className:"w-rjv-value"}),{type:"value",value:n,keyName:a,keys:i});return g.jsxs(q.Fragment,{children:[l&&(m||g.jsx(h,fe({},f,{style:p}))),b||g.jsx(h,fe({},f,{className:"w-rjv-value",children:n?.toString()}))]})};oM.displayName="JVR.TypeInt";var sM=e=>{var{children:n,keyName:a,keys:i}=e,{Bigint:o={},displayDataTypes:l}=it(),{as:c,render:d}=o,f=Ue(o,_L),h=c||"span",p=fe({},Hn,o.style||{}),v=d&&typeof d=="function",m=v&&d(fe({},f,{style:p}),{type:"type",value:n,keyName:a,keys:i}),b=v&&d(fe({},f,{children:n,className:"w-rjv-value"}),{type:"value",value:n,keyName:a,keys:i});return g.jsxs(q.Fragment,{children:[l&&(m||g.jsx(h,fe({},f,{style:p}))),b||g.jsx(h,fe({},f,{className:"w-rjv-value",children:rb(n?.toString())}))]})};sM.displayName="JVR.TypeFloat";var lM=e=>{var{children:n,keyName:a,keys:i}=e,{Url:o={},displayDataTypes:l}=it(),{as:c,render:d}=o,f=Ue(o,SL),h=c||"span",p=fe({},Hn,o.style),v=d&&typeof d=="function",m=v&&d(fe({},f,{style:p}),{type:"type",value:n,keyName:a,keys:i}),b=v&&d(fe({},f,{children:n?.href,className:"w-rjv-value"}),{type:"value",value:n,keyName:a,keys:i});return g.jsxs(q.Fragment,{children:[l&&(m||g.jsx(h,fe({},f,{style:p}))),b||g.jsxs("a",fe({href:n?.href,target:"_blank"},f,{className:"w-rjv-value",children:[g.jsx(Bs,{}),n?.href,g.jsx(Bs,{})]}))]})};lM.displayName="JVR.TypeUrl";var cM=e=>{var{children:n,keyName:a,keys:i}=e,{Date:o={},displayDataTypes:l}=it(),{as:c,render:d}=o,f=Ue(o,wL),h=c||"span",p=fe({},Hn,o.style||{}),v=d&&typeof d=="function",m=v&&d(fe({},f,{style:p}),{type:"type",value:n,keyName:a,keys:i}),b=n instanceof Date?n.toLocaleString():n,_=v&&d(fe({},f,{children:b,className:"w-rjv-value"}),{type:"value",value:n,keyName:a,keys:i});return g.jsxs(q.Fragment,{children:[l&&(m||g.jsx(h,fe({},f,{style:p}))),_||g.jsx(h,fe({},f,{className:"w-rjv-value",children:b}))]})};cM.displayName="JVR.TypeDate";var uM=e=>{var{children:n,keyName:a,keys:i}=e,{Undefined:o={},displayDataTypes:l}=it(),{as:c,render:d}=o,f=Ue(o,EL),h=c||"span",p=fe({},Hn,o.style||{}),v=d&&typeof d=="function",m=v&&d(fe({},f,{style:p}),{type:"type",value:n,keyName:a,keys:i}),b=v&&d(fe({},f,{children:n,className:"w-rjv-value"}),{type:"value",value:n,keyName:a,keys:i});return g.jsxs(q.Fragment,{children:[l&&(m||g.jsx(h,fe({},f,{style:p}))),b]})};uM.displayName="JVR.TypeUndefined";var dM=e=>{var{children:n,keyName:a,keys:i}=e,{Null:o={},displayDataTypes:l}=it(),{as:c,render:d}=o,f=Ue(o,CL),h=c||"span",p=fe({},Hn,o.style||{}),v=d&&typeof d=="function",m=v&&d(fe({},f,{style:p}),{type:"type",value:n,keyName:a,keys:i}),b=v&&d(fe({},f,{children:n,className:"w-rjv-value"}),{type:"value",value:n,keyName:a,keys:i});return g.jsxs(q.Fragment,{children:[l&&(m||g.jsx(h,fe({},f,{style:p}))),b]})};dM.displayName="JVR.TypeNull";var fM=e=>{var{children:n,keyName:a,keys:i}=e,{Nan:o={},displayDataTypes:l}=it(),{as:c,render:d}=o,f=Ue(o,TL),h=c||"span",p=fe({},Hn,o.style||{}),v=d&&typeof d=="function",m=v&&d(fe({},f,{style:p}),{type:"type",value:n,keyName:a,keys:i}),b=v&&d(fe({},f,{children:n?.toString(),className:"w-rjv-value"}),{type:"value",value:n,keyName:a,keys:i});return g.jsxs(q.Fragment,{children:[l&&(m||g.jsx(h,fe({},f,{style:p}))),b]})};fM.displayName="JVR.TypeNan";var jL=e=>Number(e)===e&&e%1!==0||isNaN(e),hM=e=>{var{value:n,keyName:a,keys:i}=e,o={keyName:a,keys:i};return n instanceof URL?g.jsx(lM,fe({},o,{children:n})):typeof n=="string"?g.jsx(nM,fe({},o,{children:n})):n===!0?g.jsx(rM,fe({},o,{children:n})):n===!1?g.jsx(aM,fe({},o,{children:n})):n===null?g.jsx(dM,fe({},o,{children:n})):n===void 0?g.jsx(uM,fe({},o,{children:n})):n instanceof Date?g.jsx(cM,fe({},o,{children:n})):typeof n=="number"&&isNaN(n)?g.jsx(fM,fe({},o,{children:n})):typeof n=="number"&&jL(n)?g.jsx(iM,fe({},o,{children:n})):typeof n=="bigint"?g.jsx(sM,fe({},o,{children:n})):typeof n=="number"?g.jsx(oM,fe({},o,{children:n})):null};hM.displayName="JVR.Value";function va(e,n,a){var i=JB(),o=[e.className,n.className].filter(Boolean).join(" "),l=fe({},e,n,{className:o,style:fe({},e.style,n.style),children:n.children||e.children});q.useEffect(()=>i({[a]:l}),[n])}function pn(e,n,a){var i=XB(),o=[e.className,n.className].filter(Boolean).join(" "),l=fe({},e,n,{className:o,style:fe({},e.style,n.style),children:n.children||e.children});q.useEffect(()=>i({[a]:l}),[n])}function uo(e,n,a){var i=nL(),o=[e.className,n.className].filter(Boolean).join(" "),l=fe({},e,n,{className:o,style:fe({},e.style,n.style),children:n.children||e.children});q.useEffect(()=>i({[a]:l}),[n])}var NL=["as","render"],pM=e=>{var{KeyName:n={}}=Tn();return uo(n,e,"KeyName"),null};pM.displayName="JVR.KeyName";var gM=e=>{var{children:n,value:a,parentValue:i,keyName:o,keys:l}=e,c=typeof n=="number",d={color:c?"var(--w-rjv-key-number, #268bd2)":"var(--w-rjv-key-string, #002b36)"},{KeyName:f={}}=Tn(),{as:h,render:p}=f,v=Ue(f,NL);v.style=fe({},v.style,d);var m=h||"span",b=p&&typeof p=="function"&&p(fe({},v,{children:n}),{value:a,parentValue:i,keyName:o,keys:l||(o?[o]:[])});return b||g.jsx(m,fe({},v,{children:n}))};gM.displayName="JVR.KeyNameComp";var RL=["children","value","parentValue","keyName","keys"],ML=["as","render","children"],vM=e=>{var{Row:n={}}=Tn();return uo(n,e,"Row"),null};vM.displayName="JVR.Row";var mM=e=>{var{children:n,value:a,parentValue:i,keyName:o,keys:l}=e,c=Ue(e,RL),{Row:d={}}=Tn(),{as:f,render:h}=d,p=Ue(d,ML),v=f||"div",m=h&&typeof h=="function"&&h(fe({},c,p,{children:n}),{value:a,keyName:o,parentValue:i,keys:l});return m||g.jsx(v,fe({},c,p,{children:n}))};mM.displayName="JVR.RowComp";function AL(e){var n=q.useRef();return q.useEffect(()=>{n.current=e}),n.current}function zL(e){var{value:n,highlightUpdates:a,highlightContainer:i}=e,o=AL(n),l=q.useMemo(()=>{if(!a||o===void 0)return!1;if(typeof n!=typeof o)return!0;if(typeof n=="number")return isNaN(n)&&isNaN(o)?!1:n!==o;if(Array.isArray(n)!==Array.isArray(o))return!0;if(typeof n=="object"||typeof n=="function")return!1;if(n!==o)return!0},[a,n]);q.useEffect(()=>{i&&i.current&&l&&"animate"in i.current&&i.current.animate([{backgroundColor:"var(--w-rjv-update-color, #ebcb8b)"},{backgroundColor:""}],{duration:1e3,easing:"ease-in"})},[l,n,i])}var DL=["keyName","value","parentValue","expandKey","keys","beforeCopy"],kL=["as","render"],Mb=e=>{var{keyName:n,value:a,parentValue:i,expandKey:o,keys:l,beforeCopy:c}=e,d=Ue(e,DL),{onCopied:f,enableClipboard:h,beforeCopy:p}=Wa(),v=VB(),m=v[o],[b,_]=q.useState(!1),{Copied:S={}}=Tn(),w=S?.beforeCopy;if(h===!1||!m)return null;var C=A=>{A.stopPropagation();var D="";typeof a=="number"&&a===1/0?D="Infinity":typeof a=="number"&&isNaN(a)?D="NaN":typeof a=="bigint"?D=rb(a):a instanceof Date?D=a.toLocaleString():D=JSON.stringify(a,(V,$)=>typeof $=="bigint"?rb($):$,2);var I=c||w||p;I&&typeof I=="function"&&(D=I(D,n,a,i,o,l)),f&&f(D,a),_(!0);var P=navigator.clipboard||{writeText(V){return new Promise(($,L)=>{var H=document.createElement("textarea");H.style.position="absolute",H.style.opacity="0",H.style.left="-99999999px",H.value=V,document.body.appendChild(H),H.select(),document.execCommand("copy")?$():L(),H.remove()})}};P.writeText(D).then(()=>{var V=setTimeout(()=>{_(!1),clearTimeout(V)},3e3)}).catch(V=>{})},T={style:{display:"inline-flex"},fill:b?"var(--w-rjv-copied-success-color, #28a745)":"var(--w-rjv-copied-color, currentColor)",onClick:C},{render:E}=S,N=Ue(S,kL),R=fe({},N,d,T,{style:fe({},N.style,d.style,T.style)}),z=E&&typeof E=="function",j=z&&E(fe({},R,{"data-copied":b}),{value:a,keyName:n,keys:l,parentValue:i});return j||(b?g.jsx("svg",fe({viewBox:"0 0 32 36"},R,{children:g.jsx("path",{d:"M27.5,33 L2.5,33 L2.5,12.5 L27.5,12.5 L27.5,15.2249049 C29.1403264,13.8627542 29.9736597,13.1778155 30,13.1700887 C30,11.9705278 30,10.0804982 30,7.5 C30,6.1 28.9,5 27.5,5 L20,5 C20,2.2 17.8,0 15,0 C12.2,0 10,2.2 10,5 L2.5,5 C1.1,5 0,6.1 0,7.5 L0,33 C0,34.4 1.1,36 2.5,36 L27.5,36 C28.9,36 30,34.4 30,33 L30,26.1114493 L27.5,28.4926435 L27.5,33 Z M7.5,7.5 L10,7.5 C10,7.5 12.5,6.4 12.5,5 C12.5,3.6 13.6,2.5 15,2.5 C16.4,2.5 17.5,3.6 17.5,5 C17.5,6.4 18.8,7.5 20,7.5 L22.5,7.5 C22.5,7.5 25,8.6 25,10 L5,10 C5,8.5 6.1,7.5 7.5,7.5 Z M5,27.5 L10,27.5 L10,25 L5,25 L5,27.5 Z M28.5589286,16 L32,19.6 L21.0160714,30.5382252 L13.5303571,24.2571429 L17.1303571,20.6571429 L21.0160714,24.5428571 L28.5589286,16 Z M17.5,15 L5,15 L5,17.5 L17.5,17.5 L17.5,15 Z M10,20 L5,20 L5,22.5 L10,22.5 L10,20 Z"})})):g.jsx("svg",fe({viewBox:"0 0 32 36"},R,{children:g.jsx("path",{d:"M27.5,33 L2.5,33 L2.5,12.5 L27.5,12.5 L27.5,20 L30,20 L30,7.5 C30,6.1 28.9,5 27.5,5 L20,5 C20,2.2 17.8,0 15,0 C12.2,0 10,2.2 10,5 L2.5,5 C1.1,5 0,6.1 0,7.5 L0,33 C0,34.4 1.1,36 2.5,36 L27.5,36 C28.9,36 30,34.4 30,33 L30,29 L27.5,29 L27.5,33 Z M7.5,7.5 L10,7.5 C10,7.5 12.5,6.4 12.5,5 C12.5,3.6 13.6,2.5 15,2.5 C16.4,2.5 17.5,3.6 17.5,5 C17.5,6.4 18.8,7.5 20,7.5 L22.5,7.5 C22.5,7.5 25,8.6 25,10 L5,10 C5,8.5 6.1,7.5 7.5,7.5 Z M5,27.5 L10,27.5 L10,25 L5,25 L5,27.5 Z M22.5,21.5 L22.5,16.5 L12.5,24 L22.5,31.5 L22.5,26.5 L32,26.5 L32,21.5 L22.5,21.5 Z M17.5,15 L5,15 L5,17.5 L17.5,17.5 L17.5,15 Z M10,20 L5,20 L5,22.5 L10,22.5 L10,20 Z"})})))};Mb.displayName="JVR.Copied";function yM(){var e=q.useRef(null);return e.current===null&&(e.current="custom-id-"+Math.random().toString(36).substr(2,9)),e.current}var bM=e=>{var n,{keyName:a,value:i,expandKey:o="",level:l,keys:c=[],parentValue:d}=e,f=gu(),{objectSortKeys:h,indentWidth:p,collapsed:v,shouldExpandNodeInitially:m}=Wa(),b=typeof v=="boolean"?v:typeof v=="number"?l>v:!1,_=(n=f[o])!=null?n:m?!1:b,S=m&&m(!_,{value:i,keys:c,level:l,keyName:a,parentValue:d});if(f[o]===void 0&&!S||_)return null;var w=Array.isArray(i),C=w?Object.entries(i).map(E=>[Number(E[0]),E[1]]):Object.entries(i);h&&(C=h===!0?C.sort((E,N)=>{var[R]=E,[z]=N;return typeof R=="string"&&typeof z=="string"?R.localeCompare(z):0}):C.sort((E,N)=>{var[R,z]=E,[j,A]=N;return typeof R=="string"&&typeof j=="string"?h(R,j,z,A):0}));var T={borderLeft:"var(--w-rjv-border-left-width, 1px) var(--w-rjv-line-style, solid) var(--w-rjv-line-color, #ebebeb)",paddingLeft:p,marginLeft:6};return g.jsx("div",{className:"w-rjv-wrap",style:T,children:C.map((E,N)=>{var[R,z]=E;return g.jsx(xM,{parentValue:i,keyName:R,keys:[...c,R],value:z,level:l},N)})})};bM.displayName="JVR.KeyValues";var Ab=e=>{var{keyName:n,parentValue:a,keys:i,value:o}=e,{highlightUpdates:l}=Wa(),c=typeof n=="number",d=q.useRef(null);zL({value:o,highlightUpdates:l,highlightContainer:d});var f={keyName:n,value:o,keys:i,parentValue:a};return g.jsxs(q.Fragment,{children:[g.jsxs("span",{ref:d,children:[g.jsx(nb,fe({isNumber:c,"data-placement":"left"},f)),g.jsx(gM,fe({},f,{children:n})),g.jsx(nb,fe({isNumber:c,"data-placement":"right"},f))]}),g.jsx(KR,fe({},f))]})};Ab.displayName="JVR.KayName";var xM=e=>{var{keyName:n,value:a,parentValue:i,level:o=0,keys:l=[]}=e,c=zR(),d=yM(),f=Array.isArray(a),h=a instanceof Set,p=a instanceof Map,v=a instanceof Date,m=a instanceof URL,b=a&&typeof a=="object"&&!f&&!h&&!p&&!v&&!m,_=b||f||h||p;if(_){var S=h?Array.from(a):p?Object.fromEntries(a):a;return g.jsx(zb,{keyName:n,value:S,parentValue:i,initialValue:a,keys:l,level:o+1})}var w={onMouseEnter:()=>c({[d]:!0}),onMouseLeave:()=>c({[d]:!1})};return g.jsxs(mM,fe({className:"w-rjv-line",value:a,keyName:n,keys:l,parentValue:i},w,{children:[g.jsx(Ab,{keyName:n,value:a,keys:l,parentValue:i}),g.jsx(hM,{keyName:n,value:a,keys:l}),g.jsx(Mb,{keyName:n,value:a,keys:l,parentValue:i,expandKey:d})]}))};xM.displayName="JVR.KeyValuesItem";var OL=["value","keyName"],qL=["as","render"],_M=e=>{var{CountInfoExtra:n={}}=Tn();return uo(n,e,"CountInfoExtra"),null};_M.displayName="JVR.CountInfoExtra";var SM=e=>{var{value:n={},keyName:a}=e,i=Ue(e,OL),{CountInfoExtra:o={}}=Tn(),{as:l,render:c}=o,d=Ue(o,qL);if(!c&&!d.children)return null;var f=l||"span",h=c&&typeof c=="function",p=fe({},d,i),v=h&&c(p,{value:n,keyName:a});return v||g.jsx(f,fe({},p))};SM.displayName="JVR.CountInfoExtraComps";var BL=["value","keyName"],LL=["as","render"],wM=e=>{var{CountInfo:n={}}=Tn();return uo(n,e,"CountInfo"),null};wM.displayName="JVR.CountInfo";var EM=e=>{var{value:n={},keyName:a}=e,i=Ue(e,BL),{displayObjectSize:o}=Wa(),{CountInfo:l={}}=Tn();if(!o)return null;var{as:c,render:d}=l,f=Ue(l,LL),h=c||"span";f.style=fe({},f.style,e.style);var p=Object.keys(n).length;f.children||(f.children=p+" item"+(p===1?"":"s"));var v=fe({},f,i),m=d&&typeof d=="function",b=m&&d(fe({},v,{"data-length":p}),{value:n,keyName:a});return b||g.jsx(h,fe({},v))};EM.displayName="JVR.CountInfoComp";var HL=["as","render"],CM=e=>{var{Ellipsis:n={}}=Tn();return uo(n,e,"Ellipsis"),null};CM.displayName="JVR.Ellipsis";var TM=e=>{var{isExpanded:n,value:a,keyName:i}=e,{Ellipsis:o={}}=Tn(),{as:l,render:c}=o,d=Ue(o,HL),f=l||"span",h=c&&typeof c=="function"&&c(fe({},d,{"data-expanded":n}),{value:a,keyName:i});return h||(!n||typeof a=="object"&&Object.keys(a).length==0?null:g.jsx(f,fe({},d)))};TM.displayName="JVR.EllipsisComp";var jM=e=>{var n,{keyName:a,expandKey:i,keys:o=[],initialValue:l,value:c,parentValue:d,level:f}=e,h=gu(),p=$B(),{onExpand:v,collapsed:m,shouldExpandNodeInitially:b}=Wa(),_=typeof m=="boolean"?m:typeof m=="number"?f>m:!1,S=(n=h[i])!=null?n:b?!1:_,w=b&&b(!S,{value:c,keys:o,level:f,keyName:a,parentValue:d});h[i]===void 0&&b&&(S=!w);var C=()=>{var P={expand:!S,value:c,keyid:i,keyName:a};v&&v(P),p({[i]:P.expand})},T={display:"inline-flex",alignItems:"center"},E={transform:"rotate("+(S?"-90":"0")+"deg)",transition:"all 0.3s"},N=Object.keys(c).length,R=typeof c=="object",z=Array.isArray(c),j=c instanceof Set,A=N!==0&&(z||j||R),D={style:T};A&&(D.onClick=C);var I={keyName:a,value:c,keys:o,parentValue:d};return g.jsxs("span",fe({},D,{children:[A&&g.jsx(ZR,fe({style:E,expandKey:i},I)),(a||typeof a=="number")&&g.jsx(Ab,fe({},I)),g.jsx(eM,{value:l,keyName:a}),g.jsx(tM,{value:l,keyName:a}),g.jsx(QR,fe({isBrackets:z||j},I)),g.jsx(TM,{keyName:a,value:c,isExpanded:S}),g.jsx(Rb,fe({isVisiable:S||!A,isBrackets:z||j},I)),g.jsx(EM,{value:c,keyName:a}),g.jsx(SM,{value:c,keyName:a}),g.jsx(Mb,{keyName:a,value:c,expandKey:i,parentValue:d,keys:o})]}))};jM.displayName="JVR.NestedOpen";var IL=["className","children","parentValue","keyid","level","value","initialValue","keys","keyName"],zb=q.forwardRef((e,n)=>{var{className:a="",parentValue:i,level:o=1,value:l,initialValue:c,keys:d,keyName:f}=e,h=Ue(e,IL),p=zR(),v=yM(),m=[a,"w-rjv-inner"].filter(Boolean).join(" "),b={onMouseEnter:()=>p({[v]:!0}),onMouseLeave:()=>p({[v]:!1})};return g.jsxs("div",fe({className:m,ref:n},h,b,{children:[g.jsx(jM,{expandKey:v,value:l,level:o,keys:d,parentValue:i,keyName:f,initialValue:c}),g.jsx(bM,{expandKey:v,value:l,level:o,keys:d,parentValue:i,keyName:f}),g.jsx(JR,{expandKey:v,value:l,level:o,keys:d,parentValue:i,keyName:f})]}))});zb.displayName="JVR.Container";var NM=e=>{var{BraceLeft:n={}}=nn();return va(n,e,"BraceLeft"),null};NM.displayName="JVR.BraceLeft";var RM=e=>{var{BraceRight:n={}}=nn();return va(n,e,"BraceRight"),null};RM.displayName="JVR.BraceRight";var MM=e=>{var{BracketsLeft:n={}}=nn();return va(n,e,"BracketsLeft"),null};MM.displayName="JVR.BracketsLeft";var AM=e=>{var{BracketsRight:n={}}=nn();return va(n,e,"BracketsRight"),null};AM.displayName="JVR.BracketsRight";var zM=e=>{var{Arrow:n={}}=nn();return va(n,e,"Arrow"),null};zM.displayName="JVR.Arrow";var DM=e=>{var{Colon:n={}}=nn();return va(n,e,"Colon"),null};DM.displayName="JVR.Colon";var kM=e=>{var{Quote:n={}}=nn();return va(n,e,"Quote"),null};kM.displayName="JVR.Quote";var OM=e=>{var{ValueQuote:n={}}=nn();return va(n,e,"ValueQuote"),null};OM.displayName="JVR.ValueQuote";var qM=e=>{var{Bigint:n={}}=it();return pn(n,e,"Bigint"),null};qM.displayName="JVR.Bigint";var BM=e=>{var{Date:n={}}=it();return pn(n,e,"Date"),null};BM.displayName="JVR.Date";var LM=e=>{var{False:n={}}=it();return pn(n,e,"False"),null};LM.displayName="JVR.False";var HM=e=>{var{Float:n={}}=it();return pn(n,e,"Float"),null};HM.displayName="JVR.Float";var IM=e=>{var{Int:n={}}=it();return pn(n,e,"Int"),null};IM.displayName="JVR.Int";var UM=e=>{var{Map:n={}}=it();return pn(n,e,"Map"),null};UM.displayName="JVR.Map";var VM=e=>{var{Nan:n={}}=it();return pn(n,e,"Nan"),null};VM.displayName="JVR.Nan";var FM=e=>{var{Null:n={}}=it();return pn(n,e,"Null"),null};FM.displayName="JVR.Null";var PM=e=>{var{Set:n={}}=it();return pn(n,e,"Set"),null};PM.displayName="JVR.Set";var GM=e=>{var{Str:n={}}=it();return pn(n,e,"Str"),null};GM.displayName="JVR.StringText";var $M=e=>{var{True:n={}}=it();return pn(n,e,"True"),null};$M.displayName="JVR.True";var YM=e=>{var{Undefined:n={}}=it();return pn(n,e,"Undefined"),null};YM.displayName="JVR.Undefined";var WM=e=>{var{Url:n={}}=it();return pn(n,e,"Url"),null};WM.displayName="JVR.Url";var XM=e=>{var{Copied:n={}}=Tn();return uo(n,e,"Copied"),null};XM.displayName="JVR.Copied";var UL=["className","style","value","children","collapsed","shouldExpandNodeInitially","indentWidth","displayObjectSize","shortenTextAfterLength","stringEllipsis","highlightUpdates","enableClipboard","displayDataTypes","objectSortKeys","onExpand","onCopied","beforeCopy"],Ye=q.forwardRef((e,n)=>{var{className:a="",style:i,value:o,children:l,collapsed:c=!1,shouldExpandNodeInitially:d=()=>!0,indentWidth:f=15,displayObjectSize:h=!0,shortenTextAfterLength:p=30,stringEllipsis:v,highlightUpdates:m=!0,enableClipboard:b=!0,displayDataTypes:_=!0,objectSortKeys:S=!1,onExpand:w,onCopied:C,beforeCopy:T}=e,E=Ue(e,UL),N=fe({lineHeight:1.4,fontFamily:"var(--w-rjv-font-family, Menlo, monospace)",color:"var(--w-rjv-color, #002b36)",backgroundColor:"var(--w-rjv-background-color, #00000000)",fontSize:13},i),R=["w-json-view-container","w-rjv",a].filter(Boolean).join(" ");return g.jsxs(XR,{initialState:{value:o,objectSortKeys:S,indentWidth:f,shouldExpandNodeInitially:c===!1?d:()=>!1,displayObjectSize:h,collapsed:c,enableClipboard:b,shortenTextAfterLength:p,stringEllipsis:v,highlightUpdates:m,onCopied:C,onExpand:w,beforeCopy:T},initialTypes:{displayDataTypes:_},children:[g.jsx(zb,fe({value:o},E,{ref:n,className:R,style:N})),l]})});Ye.Bigint=qM;Ye.Date=BM;Ye.False=LM;Ye.Float=HM;Ye.Int=IM;Ye.Map=UM;Ye.Nan=VM;Ye.Null=FM;Ye.Set=PM;Ye.String=GM;Ye.True=$M;Ye.Undefined=YM;Ye.Url=WM;Ye.ValueQuote=OM;Ye.Arrow=zM;Ye.Colon=DM;Ye.Quote=kM;Ye.Ellipsis=CM;Ye.BraceLeft=NM;Ye.BraceRight=RM;Ye.BracketsLeft=MM;Ye.BracketsRight=AM;Ye.Copied=XM;Ye.CountInfo=wM;Ye.CountInfoExtra=_M;Ye.KeyName=pM;Ye.Row=vM;Ye.displayName="JVR.JsonView";const KM=q.memo(({data:e,selected:n})=>{const a=e,i=a.artifactType,o=a.payload,l=a.producedBy,c=a.timestamp,d=a.isStreaming||!1,f=a.streamingText||"";return g.jsxs("div",{className:`message-node ${n?"selected":""}`,style:{padding:"12px",border:`2px solid ${n?"#8b5cf6":"#e2e8f0"}`,borderRadius:"8px",backgroundColor:"#fefce8",minWidth:"300px",maxWidth:"600px",width:"auto",boxShadow:n?"0 4px 12px rgba(139,92,246,0.3)":"0 2px 8px rgba(0,0,0,0.1)",transition:"all 0.2s ease"},children:[g.jsx(ga,{type:"target",position:je.Left}),g.jsx(ga,{type:"source",position:je.Right}),g.jsxs("div",{style:{marginBottom:"10px",paddingBottom:"8px",borderBottom:"1px solid #e2e8f0"},children:[g.jsx("div",{style:{fontWeight:700,fontSize:"14px",marginBottom:"4px",color:"#713f12",fontFamily:"monospace"},children:i}),g.jsxs("div",{style:{fontSize:"11px",color:"#a8a29e",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[g.jsxs("div",{children:["by: ",g.jsx("span",{style:{color:"#78716c",fontWeight:600},children:l})]}),g.jsx("div",{children:new Date(c).toLocaleTimeString()})]})]}),g.jsx("div",{style:{fontSize:"12px",maxHeight:"600px",overflowY:"auto",overflowX:"auto",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:d?g.jsxs("div",{style:{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",color:"#78716c",lineHeight:"1.5"},children:[f,g.jsx("span",{style:{display:"inline-block",width:"8px",height:"14px",backgroundColor:"#8b5cf6",marginLeft:"2px",animation:"blink 1s step-end infinite"}}),g.jsx("style",{children:`
              @keyframes blink {
                0%, 50% { opacity: 1; }
                51%, 100% { opacity: 0; }
              }
            `})]}):g.jsx(Ye,{value:o,collapsed:!1,displayDataTypes:!1,shortenTextAfterLength:0,style:{backgroundColor:"transparent",fontSize:"12px",fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace","--w-rjv-line-color":"#78716c","--w-rjv-key-string":"#713f12","--w-rjv-info-color":"#a8a29e"}})})]})});KM.displayName="MessageNode";const VL=({id:e,sourceX:n,sourceY:a,targetX:i,targetY:o,sourcePosition:l,targetPosition:c,label:d,style:f={},markerEnd:h,data:p})=>{const v=_e(j=>j.graph.edgeType),m=_e(j=>j.graph.edgeStrokeWidth),b=_e(j=>j.graph.edgeAnimation),_=_e(j=>j.graph.showEdgeLabels),S=()=>{const j={sourceX:n,sourceY:a,sourcePosition:l,targetX:i,targetY:o,targetPosition:c};switch(v){case"straight":return lu(j);case"smoothstep":return Ds(j);case"simplebezier":return pu(j);case"bezier":default:return su(j)}},[w,C,T]=S(),N=p?.labelOffset||0,[R,z]=Kn.useState(!1);return g.jsxs(g.Fragment,{children:[g.jsx(lo,{id:e,path:w,style:{...f,stroke:"var(--color-edge-message)",strokeWidth:R?m+1:m,animation:b?"dash 20s linear infinite":"none",transition:"var(--transition-all)",filter:R?"drop-shadow(0 0 4px var(--color-edge-message))":"none"},markerEnd:h}),d&&_&&g.jsx(wR,{children:g.jsx("div",{style:{position:"absolute",transform:`translate(-50%, -50%) translate(${C}px,${T+N}px)`,fontSize:"var(--font-size-caption)",fontWeight:"var(--font-weight-medium)",background:"var(--color-edge-label-bg)",color:"var(--color-edge-label-text)",padding:"var(--spacing-1) var(--spacing-2)",borderRadius:"var(--radius-sm)",border:"var(--border-width-1) solid var(--color-edge-message)",pointerEvents:"all",backdropFilter:"blur(var(--blur-sm))",boxShadow:"var(--shadow-sm)",transition:"var(--transition-all)"},className:"nodrag nopan",onMouseEnter:()=>z(!0),onMouseLeave:()=>z(!1),children:d})}),g.jsx("style",{children:`
        @keyframes dash {
          to {
            stroke-dashoffset: -100;
          }
        }
      `})]})},FL=({id:e,sourceX:n,sourceY:a,targetX:i,targetY:o,sourcePosition:l,targetPosition:c,label:d,style:f={},markerEnd:h,data:p,selected:v})=>{const m=_e(A=>A.graph.edgeType),b=_e(A=>A.graph.edgeStrokeWidth),_=_e(A=>A.graph.showEdgeLabels),S=()=>{const A={sourceX:n,sourceY:a,sourcePosition:l,targetX:i,targetY:o,targetPosition:c};switch(m){case"straight":return lu(A);case"smoothstep":return Ds(A);case"simplebezier":return pu(A);case"bezier":default:return su(A)}},[w,C,T]=S(),N=p?.labelOffset||0,[R,z]=Kn.useState(!1),j=v||R?"var(--color-edge-active)":"var(--color-edge-default)";return g.jsxs(g.Fragment,{children:[g.jsx(lo,{id:e,path:w,style:{...f,stroke:j,strokeWidth:R||v?b+1:b,strokeDasharray:"5,5",transition:"var(--transition-all)",filter:R||v?`drop-shadow(0 0 4px ${j})`:"none"},markerEnd:h}),d&&_&&g.jsx(wR,{children:g.jsx("div",{style:{position:"absolute",transform:`translate(-50%, -50%) translate(${C}px,${T+N}px)`,fontSize:"var(--font-size-caption)",fontWeight:"var(--font-weight-medium)",background:"var(--color-edge-label-bg)",color:"var(--color-edge-label-text)",padding:"var(--spacing-1) var(--spacing-2)",borderRadius:"var(--radius-sm)",border:`var(--border-width-1) solid ${j}`,pointerEvents:"all",backdropFilter:"blur(var(--blur-sm))",boxShadow:"var(--shadow-sm)",transition:"var(--transition-all)"},className:"nodrag nopan",onMouseEnter:()=>z(!0),onMouseLeave:()=>z(!1),children:d})})]})},PL=()=>{const e=n=>{switch(n.type){case"agent":return"#3b82f6";case"message":return"#f59e0b";default:return"#64748b"}};return g.jsx(TB,{nodeColor:e,style:{width:150,height:100,backgroundColor:"var(--color-bg-surface)",border:"var(--border-default)",borderRadius:"var(--radius-lg)"},maskColor:"rgba(10, 10, 11, 0.7)",position:"bottom-right",pannable:!0,zoomable:!0})};function GL(e){const n=new Map;e.artifacts.forEach(o=>{const l=o.produced_by,c=o.artifact_type;o.consumed_by.forEach(d=>{const f=`${l}_${d}_${c}`,h=n.get(f);h?(h.artifact_ids.push(o.artifact_id),o.published_at>h.latest_timestamp&&(h.latest_timestamp=o.published_at)):n.set(f,{source:l,target:d,message_type:c,artifact_ids:[o.artifact_id],latest_timestamp:o.published_at})})});const a=new Map;n.forEach((o,l)=>{const c=[o.source,o.target].sort(),d=`${c[0]}_${c[1]}`,f=a.get(d)||[];f.push(l),a.set(d,f)});const i=[];return n.forEach((o,l)=>{const c=[o.source,o.target].sort(),d=`${c[0]}_${c[1]}`,f=a.get(d)||[],h=f.indexOf(l),p=f.length;let v=0;if(p>1){const S=Math.min(40,p*15),w=S/(p-1);v=h*w-S/2}const m=o.artifact_ids.length,b=o.artifact_ids.filter(S=>(e.consumptions.get(S)||[]).includes(o.target)).length;let _=`${o.message_type} (${m})`;b<m&&b>0&&(_=`${o.message_type} (${m}, filtered: ${b})`),i.push({id:l,source:o.source,target:o.target,type:"message_flow",label:_,markerEnd:{type:"arrowclosed",width:20,height:20},data:{messageType:o.message_type,messageCount:o.artifact_ids.length,artifactIds:o.artifact_ids,latestTimestamp:o.latest_timestamp,labelOffset:v}})}),i}function $L(e){const n=[];e.runs.forEach(o=>{o.status!=="active"&&(o.consumed_artifacts.length===0||o.produced_artifacts.length===0||o.consumed_artifacts.forEach(l=>{o.produced_artifacts.forEach(c=>{const d=`${l}_${c}_${o.run_id}`;n.push({id:d,source:l,target:c,label:o.agent_name,data:{transformerAgent:o.agent_name,runId:o.run_id,durationMs:o.duration_ms}})})}))});const a=new Map;return n.forEach(o=>{const l=[o.source,o.target].sort(),c=`${l[0]}_${l[1]}`,d=a.get(c)||[];d.push(o.id),a.set(c,d)}),n.map(o=>{const l=[o.source,o.target].sort(),c=`${l[0]}_${l[1]}`,d=a.get(c)||[],f=d.indexOf(o.id),h=d.length;let p=0;if(h>1){const v=Math.min(40,h*15),m=v/(h-1);p=f*m-v/2}return{id:o.id,source:o.source,target:o.target,type:"transformation",label:o.label,markerEnd:{type:"arrowclosed",width:20,height:20},data:{...o.data,labelOffset:p}}})}const gh={preset:"last10min"},ab=e=>{if(e.preset==="last5min")return"Last 5 min";if(e.preset==="last10min")return"Last 10 min";if(e.preset==="last1hour")return"Last hour";if(e.preset==="all")return"All time";if(e.preset==="custom"&&e.start&&e.end){const n=new Date(e.start).toLocaleString(),a=new Date(e.end).toLocaleString();return`${n} - ${a}`}return e.preset==="custom"?"Custom range":"Last 10 min"},wn=e=>Array.from(new Set(e)).sort((n,a)=>n.localeCompare(a)),Te=Ya()(co((e,n)=>({correlationId:null,timeRange:gh,selectedArtifactTypes:[],selectedProducers:[],selectedTags:[],selectedVisibility:[],availableCorrelationIds:[],availableArtifactTypes:[],availableProducers:[],availableTags:[],availableVisibility:[],summary:null,savedFilters:[],setCorrelationId:a=>e({correlationId:a}),setTimeRange:a=>e({timeRange:a}),setArtifactTypes:a=>e({selectedArtifactTypes:wn(a)}),setProducers:a=>e({selectedProducers:wn(a)}),setTags:a=>e({selectedTags:wn(a)}),setVisibility:a=>e({selectedVisibility:wn(a)}),clearFilters:()=>e({correlationId:null,timeRange:gh,selectedArtifactTypes:[],selectedProducers:[],selectedTags:[],selectedVisibility:[]}),updateAvailableCorrelationIds:a=>{const i=[...a].sort((o,l)=>l.first_seen-o.first_seen);e({availableCorrelationIds:i.slice(0,50)})},updateAvailableFacets:a=>e({availableArtifactTypes:wn(a.artifactTypes),availableProducers:wn(a.producers),availableTags:wn(a.tags),availableVisibility:wn(a.visibilities)}),setSummary:a=>e({summary:a}),setSavedFilters:a=>e({savedFilters:a}),addSavedFilter:a=>e(i=>({savedFilters:[...i.savedFilters.filter(o=>o.filter_id!==a.filter_id),a]})),removeSavedFilter:a=>e(i=>({savedFilters:i.savedFilters.filter(o=>o.filter_id!==a)})),getFilterSnapshot:()=>{const a=n();return{correlationId:a.correlationId,timeRange:a.timeRange,artifactTypes:[...a.selectedArtifactTypes],producers:[...a.selectedProducers],tags:[...a.selectedTags],visibility:[...a.selectedVisibility]}},applyFilterSnapshot:a=>e({correlationId:a.correlationId,timeRange:a.timeRange,selectedArtifactTypes:wn(a.artifactTypes),selectedProducers:wn(a.producers),selectedTags:wn(a.tags),selectedVisibility:wn(a.visibility)}),getActiveFilters:()=>{console.debug("[filterStore] computing active filters",{correlationId:n().correlationId,timeRange:n().timeRange});const a=n(),i=[];return a.correlationId&&i.push({type:"correlationId",value:a.correlationId,label:`Correlation ID: ${a.correlationId}`}),i.push({type:"timeRange",value:a.timeRange,label:`Time: ${ab(a.timeRange)}`}),a.selectedArtifactTypes.forEach(o=>{i.push({type:"artifactTypes",value:o,label:`Type: ${o}`})}),a.selectedProducers.forEach(o=>{i.push({type:"producers",value:o,label:`Producer: ${o}`})}),a.selectedTags.forEach(o=>{i.push({type:"tags",value:o,label:`Tag: ${o}`})}),a.selectedVisibility.forEach(o=>{i.push({type:"visibility",value:o,label:`Visibility: ${o}`})}),i},removeFilter:a=>{if(a.type==="correlationId"){e({correlationId:null});return}if(a.type==="timeRange"){e({timeRange:gh});return}typeof a.value=="string"&&e(i=>a.type==="artifactTypes"?{selectedArtifactTypes:i.selectedArtifactTypes.filter(o=>o!==a.value)}:a.type==="producers"?{selectedProducers:i.selectedProducers.filter(o=>o!==a.value)}:a.type==="tags"?{selectedTags:i.selectedTags.filter(o=>o!==a.value)}:a.type==="visibility"?{selectedVisibility:i.selectedVisibility.filter(o=>o!==a.value)}:{})}}),{name:"filterStore"}));function YL(e,n){const a=n.get(e.id)||[];return{artifact_id:e.id,artifact_type:e.type,produced_by:e.producedBy,consumed_by:a,published_at:new Date(e.timestamp).toISOString(),payload:e.payload,correlation_id:e.correlationId}}function ZS(e,n,a){const i=new Map,o=new Map(n),l=new Map,c=new Map,d=(p,v)=>`${p}::${v||"uncorrelated"}`,f=new Set;n.forEach(p=>{f.add(d(p.agent_name,p.correlation_id))}),e.forEach(p=>{if(i.set(p.id,YL(p,a)),p.producedBy){const v=d(p.producedBy,p.correlationId);l.has(v)||l.set(v,new Set),l.get(v).add(p.id)}}),a.forEach((p,v)=>{const b=e.get(v)?.correlationId??"";p.forEach(_=>{const S=d(_,b);c.has(S)||c.set(S,new Set),c.get(S).add(v)})});let h=0;return c.forEach((p,v)=>{if(p.size===0)return;const m=l.get(v);if(!m||m.size===0||f.has(v))return;const[b,_]=v.split("::"),S=b||"unknown-agent",w=_||"uncorrelated",C=`historic_${S}_${w}_${h++}`;o.has(C)||o.set(C,{run_id:C,agent_name:S,correlation_id:w==="uncorrelated"?"":w,status:"completed",consumed_artifacts:Array.from(p),produced_artifacts:Array.from(m)})}),{artifacts:i,runs:o,consumptions:a}}const Me=Ya()(co((e,n)=>({agents:new Map,messages:new Map,events:[],runs:new Map,consumptions:new Map,messagePositions:new Map,nodes:[],edges:[],addAgent:a=>e(i=>{const o=new Map(i.agents);return o.set(a.id,a),{agents:o}}),updateAgent:(a,i)=>e(o=>{const l=new Map(o.agents),c=l.get(a);return c&&l.set(a,{...c,...i}),{agents:l}}),removeAgent:a=>e(i=>{const o=new Map(i.agents);return o.delete(a),{agents:o}}),addMessage:a=>e(i=>{const o=new Map(i.messages);o.set(a.id,a);const c=i.events.some(d=>d.id===a.id)?i.events:[a,...i.events].slice(0,100);return{messages:o,events:c}}),updateMessage:(a,i)=>e(o=>{const l=new Map(o.messages),c=l.get(a);return c&&l.set(a,{...c,...i}),{messages:l}}),addRun:a=>e(i=>{const o=new Map(i.runs);return o.set(a.run_id,a),{runs:o}}),recordConsumption:(a,i)=>e(o=>{const l=new Map(o.consumptions);return a.forEach(c=>{const d=l.get(c)||[];d.includes(i)||l.set(c,[...d,i])}),{consumptions:l}}),finalizeStreamingMessage:(a,i)=>e(o=>{const l=new Map(o.messages);l.delete(a),l.set(i.id,i);const c=new Map(o.messagePositions),d=c.get(a);d&&(c.delete(a),c.set(i.id,d));const f=o.events.map(h=>h.id===a?i:h);return{messages:l,messagePositions:c,events:f}}),updateNodePosition:(a,i)=>e(o=>{const l=new Map(o.agents),c=l.get(a);if(c)return l.set(a,{...c,position:i}),{agents:l};{const d=new Map(o.messagePositions);return d.set(a,i),{messagePositions:d}}}),generateAgentViewGraph:()=>{const{agents:a,messages:i,runs:o,consumptions:l,nodes:c}=n(),d=new Map;c.forEach(v=>{d.set(v.id,v.position)});const f=[];a.forEach(v=>{const m=v.position||d.get(v.id)||{x:400+Math.random()*200,y:300+Math.random()*200};f.push({id:v.id,type:"agent",position:m,data:{name:v.name,status:v.status,subscriptions:v.subscriptions,outputTypes:v.outputTypes,sentCount:v.sentCount,recvCount:v.recvCount,receivedByType:v.receivedByType,sentByType:v.sentByType,streamingTokens:v.streamingTokens}})});const h=ZS(i,o,l),p=GL(h);e({nodes:f,edges:p}),Me.getState().applyFilters()},generateBlackboardViewGraph:()=>{const{messages:a,runs:i,consumptions:o,messagePositions:l,nodes:c}=n(),d=new Map;c.forEach(v=>{d.set(v.id,v.position)});const f=[];a.forEach(v=>{const m=JSON.stringify(v.payload),b=o.get(v.id)||[],_=l.get(v.id)||d.get(v.id)||{x:400+Math.random()*200,y:300+Math.random()*200};f.push({id:v.id,type:"message",position:_,data:{artifactType:v.type,payloadPreview:m.slice(0,100),payload:v.payload,producedBy:v.producedBy,consumedBy:b,timestamp:v.timestamp,isStreaming:v.isStreaming||!1,streamingText:v.streamingText||"",tags:v.tags||[],visibilityKind:v.visibilityKind||"Unknown"}})});const h=ZS(a,i,o),p=$L(h);e({nodes:f,edges:p}),Me.getState().applyFilters()},batchUpdate:a=>e(i=>{const o={};if(a.agents){const l=new Map(i.agents);a.agents.forEach(c=>l.set(c.id,c)),o.agents=l}if(a.messages){const l=new Map(i.messages),c=new Map(i.consumptions);a.messages.forEach(d=>{l.set(d.id,d),d.consumedBy&&d.consumedBy.length>0&&c.set(d.id,Array.from(new Set(d.consumedBy)))}),o.messages=l,o.events=[...a.messages,...i.events].slice(0,100),o.consumptions=c}if(a.runs){const l=new Map(i.runs);a.runs.forEach(c=>l.set(c.run_id,c)),o.runs=l}return o}),applyFilters:()=>{const{nodes:a,edges:i,messages:o,consumptions:l}=n(),{correlationId:c,timeRange:d,selectedArtifactTypes:f,selectedProducers:h,selectedTags:p,selectedVisibility:v}=Te.getState(),m=()=>{const R=Date.now();return d.preset==="last5min"?{start:R-300*1e3,end:R}:d.preset==="last10min"?{start:R-600*1e3,end:R}:d.preset==="last1hour"?{start:R-3600*1e3,end:R}:d.preset==="custom"&&d.start&&d.end?{start:d.start,end:d.end}:{start:Number.NEGATIVE_INFINITY,end:Number.POSITIVE_INFINITY}},{start:b,end:_}=m(),S=new Set,w=new Map,C=new Map,T=(R,z,j)=>{R.has(z)||R.set(z,{total:0,byType:{}});const A=R.get(z);A.total+=1,A.byType[j]=(A.byType[j]||0)+1};o.forEach(R=>{let z=!0;if(c&&R.correlationId!==c&&(z=!1),z&&(R.timestamp<b||R.timestamp>_)&&(z=!1),z&&f.length>0&&!f.includes(R.type)&&(z=!1),z&&h.length>0&&!h.includes(R.producedBy)&&(z=!1),z&&v.length>0&&!v.includes(R.visibilityKind||"Unknown")&&(z=!1),z&&p.length>0){const j=R.tags||[];p.every(D=>j.includes(D))||(z=!1)}z&&(S.add(R.id),T(w,R.producedBy,R.type),(l.get(R.id)||[]).forEach(A=>{T(C,A,R.type)}))});const E=a.map(R=>{if(R.type==="message")return{...R,hidden:!S.has(R.id)};if(R.type==="agent"){const z=w.get(R.id),j=C.get(R.id),A=R.data;return{...R,hidden:!1,data:{...R.data,sentCount:z?.total??A.sentCount??0,recvCount:j?.total??A.recvCount??0,sentByType:z?.byType??A.sentByType??{},receivedByType:j?.byType??A.receivedByType??{}}}}return R}),N=i.map(R=>{let z=R.hidden??!1;const j=R.data;if(j&&Array.isArray(j.artifactIds)&&j.artifactIds.length>0)z=j.artifactIds.every(A=>!S.has(A));else{const A=E.find(I=>I.id===R.source),D=E.find(I=>I.id===R.target);z=!!(A?.hidden||D?.hidden)}return{...R,hidden:z}});e({nodes:E,edges:N})}}),{name:"graphStore"})),jr=Ya()(co(e=>({instances:new Map,addModule:n=>e(a=>{const i=new Map(a.instances);return i.set(n.id,n),{instances:i}}),updateModule:(n,a)=>e(i=>{const o=new Map(i.instances),l=o.get(n);return l&&o.set(n,{...l,...a}),{instances:o}}),removeModule:n=>e(a=>{const i=new Map(a.instances);return i.delete(n),{instances:i}}),toggleVisibility:n=>e(a=>{const i=new Map(a.instances),o=i.get(n);return o&&i.set(n,{...o,visible:!o.visible}),{instances:i}})}),{name:"moduleStore"}));class fa{static instance;modules=new Map;constructor(){}static getInstance(){return fa.instance||(fa.instance=new fa),fa.instance}register(n){if(this.modules.has(n.id)){console.warn(`Module with id "${n.id}" is already registered. Skipping registration.`);return}this.modules.set(n.id,n),console.log(`Module "${n.name}" (${n.id}) registered successfully.`)}unregister(n){if(this.modules.has(n)){const a=this.modules.get(n);this.modules.delete(n),console.log(`Module "${a?.name}" (${n}) unregistered successfully.`)}}getAll(){return Array.from(this.modules.values())}get(n){return this.modules.get(n)}static resetInstance(){fa.instance&&fa.instance.modules.clear()}}const Va=fa.getInstance();function Db(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var vh,QS;function WL(){if(QS)return vh;QS=1;function e(){this.__data__=[],this.size=0}return vh=e,vh}var mh,JS;function fo(){if(JS)return mh;JS=1;function e(n,a){return n===a||n!==n&&a!==a}return mh=e,mh}var yh,ew;function vu(){if(ew)return yh;ew=1;var e=fo();function n(a,i){for(var o=a.length;o--;)if(e(a[o][0],i))return o;return-1}return yh=n,yh}var bh,tw;function XL(){if(tw)return bh;tw=1;var e=vu(),n=Array.prototype,a=n.splice;function i(o){var l=this.__data__,c=e(l,o);if(c<0)return!1;var d=l.length-1;return c==d?l.pop():a.call(l,c,1),--this.size,!0}return bh=i,bh}var xh,nw;function KL(){if(nw)return xh;nw=1;var e=vu();function n(a){var i=this.__data__,o=e(i,a);return o<0?void 0:i[o][1]}return xh=n,xh}var _h,rw;function ZL(){if(rw)return _h;rw=1;var e=vu();function n(a){return e(this.__data__,a)>-1}return _h=n,_h}var Sh,aw;function QL(){if(aw)return Sh;aw=1;var e=vu();function n(a,i){var o=this.__data__,l=e(o,a);return l<0?(++this.size,o.push([a,i])):o[l][1]=i,this}return Sh=n,Sh}var wh,iw;function mu(){if(iw)return wh;iw=1;var e=WL(),n=XL(),a=KL(),i=ZL(),o=QL();function l(c){var d=-1,f=c==null?0:c.length;for(this.clear();++d<f;){var h=c[d];this.set(h[0],h[1])}}return l.prototype.clear=e,l.prototype.delete=n,l.prototype.get=a,l.prototype.has=i,l.prototype.set=o,wh=l,wh}var Eh,ow;function JL(){if(ow)return Eh;ow=1;var e=mu();function n(){this.__data__=new e,this.size=0}return Eh=n,Eh}var Ch,sw;function e8(){if(sw)return Ch;sw=1;function e(n){var a=this.__data__,i=a.delete(n);return this.size=a.size,i}return Ch=e,Ch}var Th,lw;function t8(){if(lw)return Th;lw=1;function e(n){return this.__data__.get(n)}return Th=e,Th}var jh,cw;function n8(){if(cw)return jh;cw=1;function e(n){return this.__data__.has(n)}return jh=e,jh}var Nh,uw;function ZM(){if(uw)return Nh;uw=1;var e=typeof xc=="object"&&xc&&xc.Object===Object&&xc;return Nh=e,Nh}var Rh,dw;function In(){if(dw)return Rh;dw=1;var e=ZM(),n=typeof self=="object"&&self&&self.Object===Object&&self,a=e||n||Function("return this")();return Rh=a,Rh}var Mh,fw;function ho(){if(fw)return Mh;fw=1;var e=In(),n=e.Symbol;return Mh=n,Mh}var Ah,hw;function r8(){if(hw)return Ah;hw=1;var e=ho(),n=Object.prototype,a=n.hasOwnProperty,i=n.toString,o=e?e.toStringTag:void 0;function l(c){var d=a.call(c,o),f=c[o];try{c[o]=void 0;var h=!0}catch{}var p=i.call(c);return h&&(d?c[o]=f:delete c[o]),p}return Ah=l,Ah}var zh,pw;function a8(){if(pw)return zh;pw=1;var e=Object.prototype,n=e.toString;function a(i){return n.call(i)}return zh=a,zh}var Dh,gw;function Xa(){if(gw)return Dh;gw=1;var e=ho(),n=r8(),a=a8(),i="[object Null]",o="[object Undefined]",l=e?e.toStringTag:void 0;function c(d){return d==null?d===void 0?o:i:l&&l in Object(d)?n(d):a(d)}return Dh=c,Dh}var kh,vw;function jn(){if(vw)return kh;vw=1;function e(n){var a=typeof n;return n!=null&&(a=="object"||a=="function")}return kh=e,kh}var Oh,mw;function Gs(){if(mw)return Oh;mw=1;var e=Xa(),n=jn(),a="[object AsyncFunction]",i="[object Function]",o="[object GeneratorFunction]",l="[object Proxy]";function c(d){if(!n(d))return!1;var f=e(d);return f==i||f==o||f==a||f==l}return Oh=c,Oh}var qh,yw;function i8(){if(yw)return qh;yw=1;var e=In(),n=e["__core-js_shared__"];return qh=n,qh}var Bh,bw;function o8(){if(bw)return Bh;bw=1;var e=i8(),n=(function(){var i=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return i?"Symbol(src)_1."+i:""})();function a(i){return!!n&&n in i}return Bh=a,Bh}var Lh,xw;function QM(){if(xw)return Lh;xw=1;var e=Function.prototype,n=e.toString;function a(i){if(i!=null){try{return n.call(i)}catch{}try{return i+""}catch{}}return""}return Lh=a,Lh}var Hh,_w;function s8(){if(_w)return Hh;_w=1;var e=Gs(),n=o8(),a=jn(),i=QM(),o=/[\\^$.*+?()[\]{}|]/g,l=/^\[object .+?Constructor\]$/,c=Function.prototype,d=Object.prototype,f=c.toString,h=d.hasOwnProperty,p=RegExp("^"+f.call(h).replace(o,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function v(m){if(!a(m)||n(m))return!1;var b=e(m)?p:l;return b.test(i(m))}return Hh=v,Hh}var Ih,Sw;function l8(){if(Sw)return Ih;Sw=1;function e(n,a){return n?.[a]}return Ih=e,Ih}var Uh,ww;function Ka(){if(ww)return Uh;ww=1;var e=s8(),n=l8();function a(i,o){var l=n(i,o);return e(l)?l:void 0}return Uh=a,Uh}var Vh,Ew;function kb(){if(Ew)return Vh;Ew=1;var e=Ka(),n=In(),a=e(n,"Map");return Vh=a,Vh}var Fh,Cw;function yu(){if(Cw)return Fh;Cw=1;var e=Ka(),n=e(Object,"create");return Fh=n,Fh}var Ph,Tw;function c8(){if(Tw)return Ph;Tw=1;var e=yu();function n(){this.__data__=e?e(null):{},this.size=0}return Ph=n,Ph}var Gh,jw;function u8(){if(jw)return Gh;jw=1;function e(n){var a=this.has(n)&&delete this.__data__[n];return this.size-=a?1:0,a}return Gh=e,Gh}var $h,Nw;function d8(){if(Nw)return $h;Nw=1;var e=yu(),n="__lodash_hash_undefined__",a=Object.prototype,i=a.hasOwnProperty;function o(l){var c=this.__data__;if(e){var d=c[l];return d===n?void 0:d}return i.call(c,l)?c[l]:void 0}return $h=o,$h}var Yh,Rw;function f8(){if(Rw)return Yh;Rw=1;var e=yu(),n=Object.prototype,a=n.hasOwnProperty;function i(o){var l=this.__data__;return e?l[o]!==void 0:a.call(l,o)}return Yh=i,Yh}var Wh,Mw;function h8(){if(Mw)return Wh;Mw=1;var e=yu(),n="__lodash_hash_undefined__";function a(i,o){var l=this.__data__;return this.size+=this.has(i)?0:1,l[i]=e&&o===void 0?n:o,this}return Wh=a,Wh}var Xh,Aw;function p8(){if(Aw)return Xh;Aw=1;var e=c8(),n=u8(),a=d8(),i=f8(),o=h8();function l(c){var d=-1,f=c==null?0:c.length;for(this.clear();++d<f;){var h=c[d];this.set(h[0],h[1])}}return l.prototype.clear=e,l.prototype.delete=n,l.prototype.get=a,l.prototype.has=i,l.prototype.set=o,Xh=l,Xh}var Kh,zw;function g8(){if(zw)return Kh;zw=1;var e=p8(),n=mu(),a=kb();function i(){this.size=0,this.__data__={hash:new e,map:new(a||n),string:new e}}return Kh=i,Kh}var Zh,Dw;function v8(){if(Dw)return Zh;Dw=1;function e(n){var a=typeof n;return a=="string"||a=="number"||a=="symbol"||a=="boolean"?n!=="__proto__":n===null}return Zh=e,Zh}var Qh,kw;function bu(){if(kw)return Qh;kw=1;var e=v8();function n(a,i){var o=a.__data__;return e(i)?o[typeof i=="string"?"string":"hash"]:o.map}return Qh=n,Qh}var Jh,Ow;function m8(){if(Ow)return Jh;Ow=1;var e=bu();function n(a){var i=e(this,a).delete(a);return this.size-=i?1:0,i}return Jh=n,Jh}var ep,qw;function y8(){if(qw)return ep;qw=1;var e=bu();function n(a){return e(this,a).get(a)}return ep=n,ep}var tp,Bw;function b8(){if(Bw)return tp;Bw=1;var e=bu();function n(a){return e(this,a).has(a)}return tp=n,tp}var np,Lw;function x8(){if(Lw)return np;Lw=1;var e=bu();function n(a,i){var o=e(this,a),l=o.size;return o.set(a,i),this.size+=o.size==l?0:1,this}return np=n,np}var rp,Hw;function Ob(){if(Hw)return rp;Hw=1;var e=g8(),n=m8(),a=y8(),i=b8(),o=x8();function l(c){var d=-1,f=c==null?0:c.length;for(this.clear();++d<f;){var h=c[d];this.set(h[0],h[1])}}return l.prototype.clear=e,l.prototype.delete=n,l.prototype.get=a,l.prototype.has=i,l.prototype.set=o,rp=l,rp}var ap,Iw;function _8(){if(Iw)return ap;Iw=1;var e=mu(),n=kb(),a=Ob(),i=200;function o(l,c){var d=this.__data__;if(d instanceof e){var f=d.__data__;if(!n||f.length<i-1)return f.push([l,c]),this.size=++d.size,this;d=this.__data__=new a(f)}return d.set(l,c),this.size=d.size,this}return ap=o,ap}var ip,Uw;function xu(){if(Uw)return ip;Uw=1;var e=mu(),n=JL(),a=e8(),i=t8(),o=n8(),l=_8();function c(d){var f=this.__data__=new e(d);this.size=f.size}return c.prototype.clear=n,c.prototype.delete=a,c.prototype.get=i,c.prototype.has=o,c.prototype.set=l,ip=c,ip}var op,Vw;function qb(){if(Vw)return op;Vw=1;function e(n,a){for(var i=-1,o=n==null?0:n.length;++i<o&&a(n[i],i,n)!==!1;);return n}return op=e,op}var sp,Fw;function JM(){if(Fw)return sp;Fw=1;var e=Ka(),n=(function(){try{var a=e(Object,"defineProperty");return a({},"",{}),a}catch{}})();return sp=n,sp}var lp,Pw;function _u(){if(Pw)return lp;Pw=1;var e=JM();function n(a,i,o){i=="__proto__"&&e?e(a,i,{configurable:!0,enumerable:!0,value:o,writable:!0}):a[i]=o}return lp=n,lp}var cp,Gw;function Su(){if(Gw)return cp;Gw=1;var e=_u(),n=fo(),a=Object.prototype,i=a.hasOwnProperty;function o(l,c,d){var f=l[c];(!(i.call(l,c)&&n(f,d))||d===void 0&&!(c in l))&&e(l,c,d)}return cp=o,cp}var up,$w;function $s(){if($w)return up;$w=1;var e=Su(),n=_u();function a(i,o,l,c){var d=!l;l||(l={});for(var f=-1,h=o.length;++f<h;){var p=o[f],v=c?c(l[p],i[p],p,l,i):void 0;v===void 0&&(v=i[p]),d?n(l,p,v):e(l,p,v)}return l}return up=a,up}var dp,Yw;function S8(){if(Yw)return dp;Yw=1;function e(n,a){for(var i=-1,o=Array(n);++i<n;)o[i]=a(i);return o}return dp=e,dp}var fp,Ww;function nr(){if(Ww)return fp;Ww=1;function e(n){return n!=null&&typeof n=="object"}return fp=e,fp}var hp,Xw;function w8(){if(Xw)return hp;Xw=1;var e=Xa(),n=nr(),a="[object Arguments]";function i(o){return n(o)&&e(o)==a}return hp=i,hp}var pp,Kw;function Ys(){if(Kw)return pp;Kw=1;var e=w8(),n=nr(),a=Object.prototype,i=a.hasOwnProperty,o=a.propertyIsEnumerable,l=e((function(){return arguments})())?e:function(c){return n(c)&&i.call(c,"callee")&&!o.call(c,"callee")};return pp=l,pp}var gp,Zw;function jt(){if(Zw)return gp;Zw=1;var e=Array.isArray;return gp=e,gp}var xs={exports:{}},vp,Qw;function E8(){if(Qw)return vp;Qw=1;function e(){return!1}return vp=e,vp}xs.exports;var Jw;function po(){return Jw||(Jw=1,(function(e,n){var a=In(),i=E8(),o=n&&!n.nodeType&&n,l=o&&!0&&e&&!e.nodeType&&e,c=l&&l.exports===o,d=c?a.Buffer:void 0,f=d?d.isBuffer:void 0,h=f||i;e.exports=h})(xs,xs.exports)),xs.exports}var mp,eE;function wu(){if(eE)return mp;eE=1;var e=9007199254740991,n=/^(?:0|[1-9]\d*)$/;function a(i,o){var l=typeof i;return o=o??e,!!o&&(l=="number"||l!="symbol"&&n.test(i))&&i>-1&&i%1==0&&i<o}return mp=a,mp}var yp,tE;function Bb(){if(tE)return yp;tE=1;var e=9007199254740991;function n(a){return typeof a=="number"&&a>-1&&a%1==0&&a<=e}return yp=n,yp}var bp,nE;function C8(){if(nE)return bp;nE=1;var e=Xa(),n=Bb(),a=nr(),i="[object Arguments]",o="[object Array]",l="[object Boolean]",c="[object Date]",d="[object Error]",f="[object Function]",h="[object Map]",p="[object Number]",v="[object Object]",m="[object RegExp]",b="[object Set]",_="[object String]",S="[object WeakMap]",w="[object ArrayBuffer]",C="[object DataView]",T="[object Float32Array]",E="[object Float64Array]",N="[object Int8Array]",R="[object Int16Array]",z="[object Int32Array]",j="[object Uint8Array]",A="[object Uint8ClampedArray]",D="[object Uint16Array]",I="[object Uint32Array]",P={};P[T]=P[E]=P[N]=P[R]=P[z]=P[j]=P[A]=P[D]=P[I]=!0,P[i]=P[o]=P[w]=P[l]=P[C]=P[c]=P[d]=P[f]=P[h]=P[p]=P[v]=P[m]=P[b]=P[_]=P[S]=!1;function V($){return a($)&&n($.length)&&!!P[e($)]}return bp=V,bp}var xp,rE;function Eu(){if(rE)return xp;rE=1;function e(n){return function(a){return n(a)}}return xp=e,xp}var _s={exports:{}};_s.exports;var aE;function Lb(){return aE||(aE=1,(function(e,n){var a=ZM(),i=n&&!n.nodeType&&n,o=i&&!0&&e&&!e.nodeType&&e,l=o&&o.exports===i,c=l&&a.process,d=(function(){try{var f=o&&o.require&&o.require("util").types;return f||c&&c.binding&&c.binding("util")}catch{}})();e.exports=d})(_s,_s.exports)),_s.exports}var _p,iE;function Ws(){if(iE)return _p;iE=1;var e=C8(),n=Eu(),a=Lb(),i=a&&a.isTypedArray,o=i?n(i):e;return _p=o,_p}var Sp,oE;function eA(){if(oE)return Sp;oE=1;var e=S8(),n=Ys(),a=jt(),i=po(),o=wu(),l=Ws(),c=Object.prototype,d=c.hasOwnProperty;function f(h,p){var v=a(h),m=!v&&n(h),b=!v&&!m&&i(h),_=!v&&!m&&!b&&l(h),S=v||m||b||_,w=S?e(h.length,String):[],C=w.length;for(var T in h)(p||d.call(h,T))&&!(S&&(T=="length"||b&&(T=="offset"||T=="parent")||_&&(T=="buffer"||T=="byteLength"||T=="byteOffset")||o(T,C)))&&w.push(T);return w}return Sp=f,Sp}var wp,sE;function Cu(){if(sE)return wp;sE=1;var e=Object.prototype;function n(a){var i=a&&a.constructor,o=typeof i=="function"&&i.prototype||e;return a===o}return wp=n,wp}var Ep,lE;function tA(){if(lE)return Ep;lE=1;function e(n,a){return function(i){return n(a(i))}}return Ep=e,Ep}var Cp,cE;function T8(){if(cE)return Cp;cE=1;var e=tA(),n=e(Object.keys,Object);return Cp=n,Cp}var Tp,uE;function Hb(){if(uE)return Tp;uE=1;var e=Cu(),n=T8(),a=Object.prototype,i=a.hasOwnProperty;function o(l){if(!e(l))return n(l);var c=[];for(var d in Object(l))i.call(l,d)&&d!="constructor"&&c.push(d);return c}return Tp=o,Tp}var jp,dE;function Mr(){if(dE)return jp;dE=1;var e=Gs(),n=Bb();function a(i){return i!=null&&n(i.length)&&!e(i)}return jp=a,jp}var Np,fE;function ma(){if(fE)return Np;fE=1;var e=eA(),n=Hb(),a=Mr();function i(o){return a(o)?e(o):n(o)}return Np=i,Np}var Rp,hE;function j8(){if(hE)return Rp;hE=1;var e=$s(),n=ma();function a(i,o){return i&&e(o,n(o),i)}return Rp=a,Rp}var Mp,pE;function N8(){if(pE)return Mp;pE=1;function e(n){var a=[];if(n!=null)for(var i in Object(n))a.push(i);return a}return Mp=e,Mp}var Ap,gE;function R8(){if(gE)return Ap;gE=1;var e=jn(),n=Cu(),a=N8(),i=Object.prototype,o=i.hasOwnProperty;function l(c){if(!e(c))return a(c);var d=n(c),f=[];for(var h in c)h=="constructor"&&(d||!o.call(c,h))||f.push(h);return f}return Ap=l,Ap}var zp,vE;function Za(){if(vE)return zp;vE=1;var e=eA(),n=R8(),a=Mr();function i(o){return a(o)?e(o,!0):n(o)}return zp=i,zp}var Dp,mE;function M8(){if(mE)return Dp;mE=1;var e=$s(),n=Za();function a(i,o){return i&&e(o,n(o),i)}return Dp=a,Dp}var Ss={exports:{}};Ss.exports;var yE;function nA(){return yE||(yE=1,(function(e,n){var a=In(),i=n&&!n.nodeType&&n,o=i&&!0&&e&&!e.nodeType&&e,l=o&&o.exports===i,c=l?a.Buffer:void 0,d=c?c.allocUnsafe:void 0;function f(h,p){if(p)return h.slice();var v=h.length,m=d?d(v):new h.constructor(v);return h.copy(m),m}e.exports=f})(Ss,Ss.exports)),Ss.exports}var kp,bE;function rA(){if(bE)return kp;bE=1;function e(n,a){var i=-1,o=n.length;for(a||(a=Array(o));++i<o;)a[i]=n[i];return a}return kp=e,kp}var Op,xE;function aA(){if(xE)return Op;xE=1;function e(n,a){for(var i=-1,o=n==null?0:n.length,l=0,c=[];++i<o;){var d=n[i];a(d,i,n)&&(c[l++]=d)}return c}return Op=e,Op}var qp,_E;function iA(){if(_E)return qp;_E=1;function e(){return[]}return qp=e,qp}var Bp,SE;function Ib(){if(SE)return Bp;SE=1;var e=aA(),n=iA(),a=Object.prototype,i=a.propertyIsEnumerable,o=Object.getOwnPropertySymbols,l=o?function(c){return c==null?[]:(c=Object(c),e(o(c),function(d){return i.call(c,d)}))}:n;return Bp=l,Bp}var Lp,wE;function A8(){if(wE)return Lp;wE=1;var e=$s(),n=Ib();function a(i,o){return e(i,n(i),o)}return Lp=a,Lp}var Hp,EE;function Ub(){if(EE)return Hp;EE=1;function e(n,a){for(var i=-1,o=a.length,l=n.length;++i<o;)n[l+i]=a[i];return n}return Hp=e,Hp}var Ip,CE;function Tu(){if(CE)return Ip;CE=1;var e=tA(),n=e(Object.getPrototypeOf,Object);return Ip=n,Ip}var Up,TE;function oA(){if(TE)return Up;TE=1;var e=Ub(),n=Tu(),a=Ib(),i=iA(),o=Object.getOwnPropertySymbols,l=o?function(c){for(var d=[];c;)e(d,a(c)),c=n(c);return d}:i;return Up=l,Up}var Vp,jE;function z8(){if(jE)return Vp;jE=1;var e=$s(),n=oA();function a(i,o){return e(i,n(i),o)}return Vp=a,Vp}var Fp,NE;function sA(){if(NE)return Fp;NE=1;var e=Ub(),n=jt();function a(i,o,l){var c=o(i);return n(i)?c:e(c,l(i))}return Fp=a,Fp}var Pp,RE;function lA(){if(RE)return Pp;RE=1;var e=sA(),n=Ib(),a=ma();function i(o){return e(o,a,n)}return Pp=i,Pp}var Gp,ME;function D8(){if(ME)return Gp;ME=1;var e=sA(),n=oA(),a=Za();function i(o){return e(o,a,n)}return Gp=i,Gp}var $p,AE;function k8(){if(AE)return $p;AE=1;var e=Ka(),n=In(),a=e(n,"DataView");return $p=a,$p}var Yp,zE;function O8(){if(zE)return Yp;zE=1;var e=Ka(),n=In(),a=e(n,"Promise");return Yp=a,Yp}var Wp,DE;function cA(){if(DE)return Wp;DE=1;var e=Ka(),n=In(),a=e(n,"Set");return Wp=a,Wp}var Xp,kE;function q8(){if(kE)return Xp;kE=1;var e=Ka(),n=In(),a=e(n,"WeakMap");return Xp=a,Xp}var Kp,OE;function go(){if(OE)return Kp;OE=1;var e=k8(),n=kb(),a=O8(),i=cA(),o=q8(),l=Xa(),c=QM(),d="[object Map]",f="[object Object]",h="[object Promise]",p="[object Set]",v="[object WeakMap]",m="[object DataView]",b=c(e),_=c(n),S=c(a),w=c(i),C=c(o),T=l;return(e&&T(new e(new ArrayBuffer(1)))!=m||n&&T(new n)!=d||a&&T(a.resolve())!=h||i&&T(new i)!=p||o&&T(new o)!=v)&&(T=function(E){var N=l(E),R=N==f?E.constructor:void 0,z=R?c(R):"";if(z)switch(z){case b:return m;case _:return d;case S:return h;case w:return p;case C:return v}return N}),Kp=T,Kp}var Zp,qE;function B8(){if(qE)return Zp;qE=1;var e=Object.prototype,n=e.hasOwnProperty;function a(i){var o=i.length,l=new i.constructor(o);return o&&typeof i[0]=="string"&&n.call(i,"index")&&(l.index=i.index,l.input=i.input),l}return Zp=a,Zp}var Qp,BE;function uA(){if(BE)return Qp;BE=1;var e=In(),n=e.Uint8Array;return Qp=n,Qp}var Jp,LE;function Vb(){if(LE)return Jp;LE=1;var e=uA();function n(a){var i=new a.constructor(a.byteLength);return new e(i).set(new e(a)),i}return Jp=n,Jp}var eg,HE;function L8(){if(HE)return eg;HE=1;var e=Vb();function n(a,i){var o=i?e(a.buffer):a.buffer;return new a.constructor(o,a.byteOffset,a.byteLength)}return eg=n,eg}var tg,IE;function H8(){if(IE)return tg;IE=1;var e=/\w*$/;function n(a){var i=new a.constructor(a.source,e.exec(a));return i.lastIndex=a.lastIndex,i}return tg=n,tg}var ng,UE;function I8(){if(UE)return ng;UE=1;var e=ho(),n=e?e.prototype:void 0,a=n?n.valueOf:void 0;function i(o){return a?Object(a.call(o)):{}}return ng=i,ng}var rg,VE;function dA(){if(VE)return rg;VE=1;var e=Vb();function n(a,i){var o=i?e(a.buffer):a.buffer;return new a.constructor(o,a.byteOffset,a.length)}return rg=n,rg}var ag,FE;function U8(){if(FE)return ag;FE=1;var e=Vb(),n=L8(),a=H8(),i=I8(),o=dA(),l="[object Boolean]",c="[object Date]",d="[object Map]",f="[object Number]",h="[object RegExp]",p="[object Set]",v="[object String]",m="[object Symbol]",b="[object ArrayBuffer]",_="[object DataView]",S="[object Float32Array]",w="[object Float64Array]",C="[object Int8Array]",T="[object Int16Array]",E="[object Int32Array]",N="[object Uint8Array]",R="[object Uint8ClampedArray]",z="[object Uint16Array]",j="[object Uint32Array]";function A(D,I,P){var V=D.constructor;switch(I){case b:return e(D);case l:case c:return new V(+D);case _:return n(D,P);case S:case w:case C:case T:case E:case N:case R:case z:case j:return o(D,P);case d:return new V;case f:case v:return new V(D);case h:return a(D);case p:return new V;case m:return i(D)}}return ag=A,ag}var ig,PE;function fA(){if(PE)return ig;PE=1;var e=jn(),n=Object.create,a=(function(){function i(){}return function(o){if(!e(o))return{};if(n)return n(o);i.prototype=o;var l=new i;return i.prototype=void 0,l}})();return ig=a,ig}var og,GE;function hA(){if(GE)return og;GE=1;var e=fA(),n=Tu(),a=Cu();function i(o){return typeof o.constructor=="function"&&!a(o)?e(n(o)):{}}return og=i,og}var sg,$E;function V8(){if($E)return sg;$E=1;var e=go(),n=nr(),a="[object Map]";function i(o){return n(o)&&e(o)==a}return sg=i,sg}var lg,YE;function F8(){if(YE)return lg;YE=1;var e=V8(),n=Eu(),a=Lb(),i=a&&a.isMap,o=i?n(i):e;return lg=o,lg}var cg,WE;function P8(){if(WE)return cg;WE=1;var e=go(),n=nr(),a="[object Set]";function i(o){return n(o)&&e(o)==a}return cg=i,cg}var ug,XE;function G8(){if(XE)return ug;XE=1;var e=P8(),n=Eu(),a=Lb(),i=a&&a.isSet,o=i?n(i):e;return ug=o,ug}var dg,KE;function pA(){if(KE)return dg;KE=1;var e=xu(),n=qb(),a=Su(),i=j8(),o=M8(),l=nA(),c=rA(),d=A8(),f=z8(),h=lA(),p=D8(),v=go(),m=B8(),b=U8(),_=hA(),S=jt(),w=po(),C=F8(),T=jn(),E=G8(),N=ma(),R=Za(),z=1,j=2,A=4,D="[object Arguments]",I="[object Array]",P="[object Boolean]",V="[object Date]",$="[object Error]",L="[object Function]",H="[object GeneratorFunction]",O="[object Map]",F="[object Number]",J="[object Object]",G="[object RegExp]",re="[object Set]",B="[object String]",Y="[object Symbol]",ae="[object WeakMap]",U="[object ArrayBuffer]",Z="[object DataView]",ne="[object Float32Array]",le="[object Float64Array]",K="[object Int8Array]",de="[object Int16Array]",ye="[object Int32Array]",xe="[object Uint8Array]",be="[object Uint8ClampedArray]",W="[object Uint16Array]",se="[object Uint32Array]",te={};te[D]=te[I]=te[U]=te[Z]=te[P]=te[V]=te[ne]=te[le]=te[K]=te[de]=te[ye]=te[O]=te[F]=te[J]=te[G]=te[re]=te[B]=te[Y]=te[xe]=te[be]=te[W]=te[se]=!0,te[$]=te[L]=te[ae]=!1;function me(ve,Se,Ee,Ve,qe,lt){var tt,nt=Se&z,Ft=Se&j,$t=Se&A;if(Ee&&(tt=qe?Ee(ve,Ve,qe,lt):Ee(ve)),tt!==void 0)return tt;if(!T(ve))return ve;var At=S(ve);if(At){if(tt=m(ve),!nt)return c(ve,tt)}else{var Lt=v(ve),Ja=Lt==L||Lt==H;if(w(ve))return l(ve,nt);if(Lt==J||Lt==D||Ja&&!qe){if(tt=Ft||Ja?{}:_(ve),!nt)return Ft?f(ve,o(tt,ve)):d(ve,i(tt,ve))}else{if(!te[Lt])return qe?ve:{};tt=b(ve,Lt,nt)}}lt||(lt=new e);var rr=lt.get(ve);if(rr)return rr;lt.set(ve,tt),E(ve)?ve.forEach(function(Ht){tt.add(me(Ht,Se,Ee,Ht,ve,lt))}):C(ve)&&ve.forEach(function(Ht,ht){tt.set(ht,me(Ht,Se,Ee,ht,ve,lt))});var mo=$t?Ft?p:h:Ft?R:N,ei=At?void 0:mo(ve);return n(ei||ve,function(Ht,ht){ei&&(ht=Ht,Ht=ve[ht]),a(tt,ht,me(Ht,Se,Ee,ht,ve,lt))}),tt}return dg=me,dg}var fg,ZE;function $8(){if(ZE)return fg;ZE=1;var e=pA(),n=4;function a(i){return e(i,n)}return fg=a,fg}var hg,QE;function Fb(){if(QE)return hg;QE=1;function e(n){return function(){return n}}return hg=e,hg}var pg,JE;function Y8(){if(JE)return pg;JE=1;function e(n){return function(a,i,o){for(var l=-1,c=Object(a),d=o(a),f=d.length;f--;){var h=d[n?f:++l];if(i(c[h],h,c)===!1)break}return a}}return pg=e,pg}var gg,eC;function Pb(){if(eC)return gg;eC=1;var e=Y8(),n=e();return gg=n,gg}var vg,tC;function Gb(){if(tC)return vg;tC=1;var e=Pb(),n=ma();function a(i,o){return i&&e(i,o,n)}return vg=a,vg}var mg,nC;function W8(){if(nC)return mg;nC=1;var e=Mr();function n(a,i){return function(o,l){if(o==null)return o;if(!e(o))return a(o,l);for(var c=o.length,d=i?c:-1,f=Object(o);(i?d--:++d<c)&&l(f[d],d,f)!==!1;);return o}}return mg=n,mg}var yg,rC;function ju(){if(rC)return yg;rC=1;var e=Gb(),n=W8(),a=n(e);return yg=a,yg}var bg,aC;function Qa(){if(aC)return bg;aC=1;function e(n){return n}return bg=e,bg}var xg,iC;function gA(){if(iC)return xg;iC=1;var e=Qa();function n(a){return typeof a=="function"?a:e}return xg=n,xg}var _g,oC;function vA(){if(oC)return _g;oC=1;var e=qb(),n=ju(),a=gA(),i=jt();function o(l,c){var d=i(l)?e:n;return d(l,a(c))}return _g=o,_g}var Sg,sC;function mA(){return sC||(sC=1,Sg=vA()),Sg}var wg,lC;function X8(){if(lC)return wg;lC=1;var e=ju();function n(a,i){var o=[];return e(a,function(l,c,d){i(l,c,d)&&o.push(l)}),o}return wg=n,wg}var Eg,cC;function K8(){if(cC)return Eg;cC=1;var e="__lodash_hash_undefined__";function n(a){return this.__data__.set(a,e),this}return Eg=n,Eg}var Cg,uC;function Z8(){if(uC)return Cg;uC=1;function e(n){return this.__data__.has(n)}return Cg=e,Cg}var Tg,dC;function yA(){if(dC)return Tg;dC=1;var e=Ob(),n=K8(),a=Z8();function i(o){var l=-1,c=o==null?0:o.length;for(this.__data__=new e;++l<c;)this.add(o[l])}return i.prototype.add=i.prototype.push=n,i.prototype.has=a,Tg=i,Tg}var jg,fC;function Q8(){if(fC)return jg;fC=1;function e(n,a){for(var i=-1,o=n==null?0:n.length;++i<o;)if(a(n[i],i,n))return!0;return!1}return jg=e,jg}var Ng,hC;function bA(){if(hC)return Ng;hC=1;function e(n,a){return n.has(a)}return Ng=e,Ng}var Rg,pC;function xA(){if(pC)return Rg;pC=1;var e=yA(),n=Q8(),a=bA(),i=1,o=2;function l(c,d,f,h,p,v){var m=f&i,b=c.length,_=d.length;if(b!=_&&!(m&&_>b))return!1;var S=v.get(c),w=v.get(d);if(S&&w)return S==d&&w==c;var C=-1,T=!0,E=f&o?new e:void 0;for(v.set(c,d),v.set(d,c);++C<b;){var N=c[C],R=d[C];if(h)var z=m?h(R,N,C,d,c,v):h(N,R,C,c,d,v);if(z!==void 0){if(z)continue;T=!1;break}if(E){if(!n(d,function(j,A){if(!a(E,A)&&(N===j||p(N,j,f,h,v)))return E.push(A)})){T=!1;break}}else if(!(N===R||p(N,R,f,h,v))){T=!1;break}}return v.delete(c),v.delete(d),T}return Rg=l,Rg}var Mg,gC;function J8(){if(gC)return Mg;gC=1;function e(n){var a=-1,i=Array(n.size);return n.forEach(function(o,l){i[++a]=[l,o]}),i}return Mg=e,Mg}var Ag,vC;function $b(){if(vC)return Ag;vC=1;function e(n){var a=-1,i=Array(n.size);return n.forEach(function(o){i[++a]=o}),i}return Ag=e,Ag}var zg,mC;function eH(){if(mC)return zg;mC=1;var e=ho(),n=uA(),a=fo(),i=xA(),o=J8(),l=$b(),c=1,d=2,f="[object Boolean]",h="[object Date]",p="[object Error]",v="[object Map]",m="[object Number]",b="[object RegExp]",_="[object Set]",S="[object String]",w="[object Symbol]",C="[object ArrayBuffer]",T="[object DataView]",E=e?e.prototype:void 0,N=E?E.valueOf:void 0;function R(z,j,A,D,I,P,V){switch(A){case T:if(z.byteLength!=j.byteLength||z.byteOffset!=j.byteOffset)return!1;z=z.buffer,j=j.buffer;case C:return!(z.byteLength!=j.byteLength||!P(new n(z),new n(j)));case f:case h:case m:return a(+z,+j);case p:return z.name==j.name&&z.message==j.message;case b:case S:return z==j+"";case v:var $=o;case _:var L=D&c;if($||($=l),z.size!=j.size&&!L)return!1;var H=V.get(z);if(H)return H==j;D|=d,V.set(z,j);var O=i($(z),$(j),D,I,P,V);return V.delete(z),O;case w:if(N)return N.call(z)==N.call(j)}return!1}return zg=R,zg}var Dg,yC;function tH(){if(yC)return Dg;yC=1;var e=lA(),n=1,a=Object.prototype,i=a.hasOwnProperty;function o(l,c,d,f,h,p){var v=d&n,m=e(l),b=m.length,_=e(c),S=_.length;if(b!=S&&!v)return!1;for(var w=b;w--;){var C=m[w];if(!(v?C in c:i.call(c,C)))return!1}var T=p.get(l),E=p.get(c);if(T&&E)return T==c&&E==l;var N=!0;p.set(l,c),p.set(c,l);for(var R=v;++w<b;){C=m[w];var z=l[C],j=c[C];if(f)var A=v?f(j,z,C,c,l,p):f(z,j,C,l,c,p);if(!(A===void 0?z===j||h(z,j,d,f,p):A)){N=!1;break}R||(R=C=="constructor")}if(N&&!R){var D=l.constructor,I=c.constructor;D!=I&&"constructor"in l&&"constructor"in c&&!(typeof D=="function"&&D instanceof D&&typeof I=="function"&&I instanceof I)&&(N=!1)}return p.delete(l),p.delete(c),N}return Dg=o,Dg}var kg,bC;function nH(){if(bC)return kg;bC=1;var e=xu(),n=xA(),a=eH(),i=tH(),o=go(),l=jt(),c=po(),d=Ws(),f=1,h="[object Arguments]",p="[object Array]",v="[object Object]",m=Object.prototype,b=m.hasOwnProperty;function _(S,w,C,T,E,N){var R=l(S),z=l(w),j=R?p:o(S),A=z?p:o(w);j=j==h?v:j,A=A==h?v:A;var D=j==v,I=A==v,P=j==A;if(P&&c(S)){if(!c(w))return!1;R=!0,D=!1}if(P&&!D)return N||(N=new e),R||d(S)?n(S,w,C,T,E,N):a(S,w,j,C,T,E,N);if(!(C&f)){var V=D&&b.call(S,"__wrapped__"),$=I&&b.call(w,"__wrapped__");if(V||$){var L=V?S.value():S,H=$?w.value():w;return N||(N=new e),E(L,H,C,T,N)}}return P?(N||(N=new e),i(S,w,C,T,E,N)):!1}return kg=_,kg}var Og,xC;function _A(){if(xC)return Og;xC=1;var e=nH(),n=nr();function a(i,o,l,c,d){return i===o?!0:i==null||o==null||!n(i)&&!n(o)?i!==i&&o!==o:e(i,o,l,c,a,d)}return Og=a,Og}var qg,_C;function rH(){if(_C)return qg;_C=1;var e=xu(),n=_A(),a=1,i=2;function o(l,c,d,f){var h=d.length,p=h,v=!f;if(l==null)return!p;for(l=Object(l);h--;){var m=d[h];if(v&&m[2]?m[1]!==l[m[0]]:!(m[0]in l))return!1}for(;++h<p;){m=d[h];var b=m[0],_=l[b],S=m[1];if(v&&m[2]){if(_===void 0&&!(b in l))return!1}else{var w=new e;if(f)var C=f(_,S,b,l,c,w);if(!(C===void 0?n(S,_,a|i,f,w):C))return!1}}return!0}return qg=o,qg}var Bg,SC;function SA(){if(SC)return Bg;SC=1;var e=jn();function n(a){return a===a&&!e(a)}return Bg=n,Bg}var Lg,wC;function aH(){if(wC)return Lg;wC=1;var e=SA(),n=ma();function a(i){for(var o=n(i),l=o.length;l--;){var c=o[l],d=i[c];o[l]=[c,d,e(d)]}return o}return Lg=a,Lg}var Hg,EC;function wA(){if(EC)return Hg;EC=1;function e(n,a){return function(i){return i==null?!1:i[n]===a&&(a!==void 0||n in Object(i))}}return Hg=e,Hg}var Ig,CC;function iH(){if(CC)return Ig;CC=1;var e=rH(),n=aH(),a=wA();function i(o){var l=n(o);return l.length==1&&l[0][2]?a(l[0][0],l[0][1]):function(c){return c===o||e(c,o,l)}}return Ig=i,Ig}var Ug,TC;function vo(){if(TC)return Ug;TC=1;var e=Xa(),n=nr(),a="[object Symbol]";function i(o){return typeof o=="symbol"||n(o)&&e(o)==a}return Ug=i,Ug}var Vg,jC;function Yb(){if(jC)return Vg;jC=1;var e=jt(),n=vo(),a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,i=/^\w*$/;function o(l,c){if(e(l))return!1;var d=typeof l;return d=="number"||d=="symbol"||d=="boolean"||l==null||n(l)?!0:i.test(l)||!a.test(l)||c!=null&&l in Object(c)}return Vg=o,Vg}var Fg,NC;function oH(){if(NC)return Fg;NC=1;var e=Ob(),n="Expected a function";function a(i,o){if(typeof i!="function"||o!=null&&typeof o!="function")throw new TypeError(n);var l=function(){var c=arguments,d=o?o.apply(this,c):c[0],f=l.cache;if(f.has(d))return f.get(d);var h=i.apply(this,c);return l.cache=f.set(d,h)||f,h};return l.cache=new(a.Cache||e),l}return a.Cache=e,Fg=a,Fg}var Pg,RC;function sH(){if(RC)return Pg;RC=1;var e=oH(),n=500;function a(i){var o=e(i,function(c){return l.size===n&&l.clear(),c}),l=o.cache;return o}return Pg=a,Pg}var Gg,MC;function lH(){if(MC)return Gg;MC=1;var e=sH(),n=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,a=/\\(\\)?/g,i=e(function(o){var l=[];return o.charCodeAt(0)===46&&l.push(""),o.replace(n,function(c,d,f,h){l.push(f?h.replace(a,"$1"):d||c)}),l});return Gg=i,Gg}var $g,AC;function Nu(){if(AC)return $g;AC=1;function e(n,a){for(var i=-1,o=n==null?0:n.length,l=Array(o);++i<o;)l[i]=a(n[i],i,n);return l}return $g=e,$g}var Yg,zC;function cH(){if(zC)return Yg;zC=1;var e=ho(),n=Nu(),a=jt(),i=vo(),o=e?e.prototype:void 0,l=o?o.toString:void 0;function c(d){if(typeof d=="string")return d;if(a(d))return n(d,c)+"";if(i(d))return l?l.call(d):"";var f=d+"";return f=="0"&&1/d==-1/0?"-0":f}return Yg=c,Yg}var Wg,DC;function EA(){if(DC)return Wg;DC=1;var e=cH();function n(a){return a==null?"":e(a)}return Wg=n,Wg}var Xg,kC;function Ru(){if(kC)return Xg;kC=1;var e=jt(),n=Yb(),a=lH(),i=EA();function o(l,c){return e(l)?l:n(l,c)?[l]:a(i(l))}return Xg=o,Xg}var Kg,OC;function Xs(){if(OC)return Kg;OC=1;var e=vo();function n(a){if(typeof a=="string"||e(a))return a;var i=a+"";return i=="0"&&1/a==-1/0?"-0":i}return Kg=n,Kg}var Zg,qC;function Mu(){if(qC)return Zg;qC=1;var e=Ru(),n=Xs();function a(i,o){o=e(o,i);for(var l=0,c=o.length;i!=null&&l<c;)i=i[n(o[l++])];return l&&l==c?i:void 0}return Zg=a,Zg}var Qg,BC;function uH(){if(BC)return Qg;BC=1;var e=Mu();function n(a,i,o){var l=a==null?void 0:e(a,i);return l===void 0?o:l}return Qg=n,Qg}var Jg,LC;function dH(){if(LC)return Jg;LC=1;function e(n,a){return n!=null&&a in Object(n)}return Jg=e,Jg}var ev,HC;function CA(){if(HC)return ev;HC=1;var e=Ru(),n=Ys(),a=jt(),i=wu(),o=Bb(),l=Xs();function c(d,f,h){f=e(f,d);for(var p=-1,v=f.length,m=!1;++p<v;){var b=l(f[p]);if(!(m=d!=null&&h(d,b)))break;d=d[b]}return m||++p!=v?m:(v=d==null?0:d.length,!!v&&o(v)&&i(b,v)&&(a(d)||n(d)))}return ev=c,ev}var tv,IC;function TA(){if(IC)return tv;IC=1;var e=dH(),n=CA();function a(i,o){return i!=null&&n(i,o,e)}return tv=a,tv}var nv,UC;function fH(){if(UC)return nv;UC=1;var e=_A(),n=uH(),a=TA(),i=Yb(),o=SA(),l=wA(),c=Xs(),d=1,f=2;function h(p,v){return i(p)&&o(v)?l(c(p),v):function(m){var b=n(m,p);return b===void 0&&b===v?a(m,p):e(v,b,d|f)}}return nv=h,nv}var rv,VC;function jA(){if(VC)return rv;VC=1;function e(n){return function(a){return a?.[n]}}return rv=e,rv}var av,FC;function hH(){if(FC)return av;FC=1;var e=Mu();function n(a){return function(i){return e(i,a)}}return av=n,av}var iv,PC;function pH(){if(PC)return iv;PC=1;var e=jA(),n=hH(),a=Yb(),i=Xs();function o(l){return a(l)?e(i(l)):n(l)}return iv=o,iv}var ov,GC;function Ar(){if(GC)return ov;GC=1;var e=iH(),n=fH(),a=Qa(),i=jt(),o=pH();function l(c){return typeof c=="function"?c:c==null?a:typeof c=="object"?i(c)?n(c[0],c[1]):e(c):o(c)}return ov=l,ov}var sv,$C;function NA(){if($C)return sv;$C=1;var e=aA(),n=X8(),a=Ar(),i=jt();function o(l,c){var d=i(l)?e:n;return d(l,a(c,3))}return sv=o,sv}var lv,YC;function gH(){if(YC)return lv;YC=1;var e=Object.prototype,n=e.hasOwnProperty;function a(i,o){return i!=null&&n.call(i,o)}return lv=a,lv}var cv,WC;function RA(){if(WC)return cv;WC=1;var e=gH(),n=CA();function a(i,o){return i!=null&&n(i,o,e)}return cv=a,cv}var uv,XC;function vH(){if(XC)return uv;XC=1;var e=Hb(),n=go(),a=Ys(),i=jt(),o=Mr(),l=po(),c=Cu(),d=Ws(),f="[object Map]",h="[object Set]",p=Object.prototype,v=p.hasOwnProperty;function m(b){if(b==null)return!0;if(o(b)&&(i(b)||typeof b=="string"||typeof b.splice=="function"||l(b)||d(b)||a(b)))return!b.length;var _=n(b);if(_==f||_==h)return!b.size;if(c(b))return!e(b).length;for(var S in b)if(v.call(b,S))return!1;return!0}return uv=m,uv}var dv,KC;function MA(){if(KC)return dv;KC=1;function e(n){return n===void 0}return dv=e,dv}var fv,ZC;function AA(){if(ZC)return fv;ZC=1;var e=ju(),n=Mr();function a(i,o){var l=-1,c=n(i)?Array(i.length):[];return e(i,function(d,f,h){c[++l]=o(d,f,h)}),c}return fv=a,fv}var hv,QC;function zA(){if(QC)return hv;QC=1;var e=Nu(),n=Ar(),a=AA(),i=jt();function o(l,c){var d=i(l)?e:a;return d(l,n(c,3))}return hv=o,hv}var pv,JC;function mH(){if(JC)return pv;JC=1;function e(n,a,i,o){var l=-1,c=n==null?0:n.length;for(o&&c&&(i=n[++l]);++l<c;)i=a(i,n[l],l,n);return i}return pv=e,pv}var gv,eT;function yH(){if(eT)return gv;eT=1;function e(n,a,i,o,l){return l(n,function(c,d,f){i=o?(o=!1,c):a(i,c,d,f)}),i}return gv=e,gv}var vv,tT;function DA(){if(tT)return vv;tT=1;var e=mH(),n=ju(),a=Ar(),i=yH(),o=jt();function l(c,d,f){var h=o(c)?e:i,p=arguments.length<3;return h(c,a(d,4),f,p,n)}return vv=l,vv}var mv,nT;function bH(){if(nT)return mv;nT=1;var e=Xa(),n=jt(),a=nr(),i="[object String]";function o(l){return typeof l=="string"||!n(l)&&a(l)&&e(l)==i}return mv=o,mv}var yv,rT;function xH(){if(rT)return yv;rT=1;var e=jA(),n=e("length");return yv=n,yv}var bv,aT;function _H(){if(aT)return bv;aT=1;var e="\\ud800-\\udfff",n="\\u0300-\\u036f",a="\\ufe20-\\ufe2f",i="\\u20d0-\\u20ff",o=n+a+i,l="\\ufe0e\\ufe0f",c="\\u200d",d=RegExp("["+c+e+o+l+"]");function f(h){return d.test(h)}return bv=f,bv}var xv,iT;function SH(){if(iT)return xv;iT=1;var e="\\ud800-\\udfff",n="\\u0300-\\u036f",a="\\ufe20-\\ufe2f",i="\\u20d0-\\u20ff",o=n+a+i,l="\\ufe0e\\ufe0f",c="["+e+"]",d="["+o+"]",f="\\ud83c[\\udffb-\\udfff]",h="(?:"+d+"|"+f+")",p="[^"+e+"]",v="(?:\\ud83c[\\udde6-\\uddff]){2}",m="[\\ud800-\\udbff][\\udc00-\\udfff]",b="\\u200d",_=h+"?",S="["+l+"]?",w="(?:"+b+"(?:"+[p,v,m].join("|")+")"+S+_+")*",C=S+_+w,T="(?:"+[p+d+"?",d,v,m,c].join("|")+")",E=RegExp(f+"(?="+f+")|"+T+C,"g");function N(R){for(var z=E.lastIndex=0;E.test(R);)++z;return z}return xv=N,xv}var _v,oT;function wH(){if(oT)return _v;oT=1;var e=xH(),n=_H(),a=SH();function i(o){return n(o)?a(o):e(o)}return _v=i,_v}var Sv,sT;function EH(){if(sT)return Sv;sT=1;var e=Hb(),n=go(),a=Mr(),i=bH(),o=wH(),l="[object Map]",c="[object Set]";function d(f){if(f==null)return 0;if(a(f))return i(f)?o(f):f.length;var h=n(f);return h==l||h==c?f.size:e(f).length}return Sv=d,Sv}var wv,lT;function CH(){if(lT)return wv;lT=1;var e=qb(),n=fA(),a=Gb(),i=Ar(),o=Tu(),l=jt(),c=po(),d=Gs(),f=jn(),h=Ws();function p(v,m,b){var _=l(v),S=_||c(v)||h(v);if(m=i(m,4),b==null){var w=v&&v.constructor;S?b=_?new w:[]:f(v)?b=d(w)?n(o(v)):{}:b={}}return(S?e:a)(v,function(C,T,E){return m(b,C,T,E)}),b}return wv=p,wv}var Ev,cT;function TH(){if(cT)return Ev;cT=1;var e=ho(),n=Ys(),a=jt(),i=e?e.isConcatSpreadable:void 0;function o(l){return a(l)||n(l)||!!(i&&l&&l[i])}return Ev=o,Ev}var Cv,uT;function Wb(){if(uT)return Cv;uT=1;var e=Ub(),n=TH();function a(i,o,l,c,d){var f=-1,h=i.length;for(l||(l=n),d||(d=[]);++f<h;){var p=i[f];o>0&&l(p)?o>1?a(p,o-1,l,c,d):e(d,p):c||(d[d.length]=p)}return d}return Cv=a,Cv}var Tv,dT;function jH(){if(dT)return Tv;dT=1;function e(n,a,i){switch(i.length){case 0:return n.call(a);case 1:return n.call(a,i[0]);case 2:return n.call(a,i[0],i[1]);case 3:return n.call(a,i[0],i[1],i[2])}return n.apply(a,i)}return Tv=e,Tv}var jv,fT;function kA(){if(fT)return jv;fT=1;var e=jH(),n=Math.max;function a(i,o,l){return o=n(o===void 0?i.length-1:o,0),function(){for(var c=arguments,d=-1,f=n(c.length-o,0),h=Array(f);++d<f;)h[d]=c[o+d];d=-1;for(var p=Array(o+1);++d<o;)p[d]=c[d];return p[o]=l(h),e(i,this,p)}}return jv=a,jv}var Nv,hT;function NH(){if(hT)return Nv;hT=1;var e=Fb(),n=JM(),a=Qa(),i=n?function(o,l){return n(o,"toString",{configurable:!0,enumerable:!1,value:e(l),writable:!0})}:a;return Nv=i,Nv}var Rv,pT;function RH(){if(pT)return Rv;pT=1;var e=800,n=16,a=Date.now;function i(o){var l=0,c=0;return function(){var d=a(),f=n-(d-c);if(c=d,f>0){if(++l>=e)return arguments[0]}else l=0;return o.apply(void 0,arguments)}}return Rv=i,Rv}var Mv,gT;function OA(){if(gT)return Mv;gT=1;var e=NH(),n=RH(),a=n(e);return Mv=a,Mv}var Av,vT;function Au(){if(vT)return Av;vT=1;var e=Qa(),n=kA(),a=OA();function i(o,l){return a(n(o,l,e),o+"")}return Av=i,Av}var zv,mT;function qA(){if(mT)return zv;mT=1;function e(n,a,i,o){for(var l=n.length,c=i+(o?1:-1);o?c--:++c<l;)if(a(n[c],c,n))return c;return-1}return zv=e,zv}var Dv,yT;function MH(){if(yT)return Dv;yT=1;function e(n){return n!==n}return Dv=e,Dv}var kv,bT;function AH(){if(bT)return kv;bT=1;function e(n,a,i){for(var o=i-1,l=n.length;++o<l;)if(n[o]===a)return o;return-1}return kv=e,kv}var Ov,xT;function zH(){if(xT)return Ov;xT=1;var e=qA(),n=MH(),a=AH();function i(o,l,c){return l===l?a(o,l,c):e(o,n,c)}return Ov=i,Ov}var qv,_T;function DH(){if(_T)return qv;_T=1;var e=zH();function n(a,i){var o=a==null?0:a.length;return!!o&&e(a,i,0)>-1}return qv=n,qv}var Bv,ST;function kH(){if(ST)return Bv;ST=1;function e(n,a,i){for(var o=-1,l=n==null?0:n.length;++o<l;)if(i(a,n[o]))return!0;return!1}return Bv=e,Bv}var Lv,wT;function OH(){if(wT)return Lv;wT=1;function e(){}return Lv=e,Lv}var Hv,ET;function qH(){if(ET)return Hv;ET=1;var e=cA(),n=OH(),a=$b(),i=1/0,o=e&&1/a(new e([,-0]))[1]==i?function(l){return new e(l)}:n;return Hv=o,Hv}var Iv,CT;function BH(){if(CT)return Iv;CT=1;var e=yA(),n=DH(),a=kH(),i=bA(),o=qH(),l=$b(),c=200;function d(f,h,p){var v=-1,m=n,b=f.length,_=!0,S=[],w=S;if(p)_=!1,m=a;else if(b>=c){var C=h?null:o(f);if(C)return l(C);_=!1,m=i,w=new e}else w=h?[]:S;e:for(;++v<b;){var T=f[v],E=h?h(T):T;if(T=p||T!==0?T:0,_&&E===E){for(var N=w.length;N--;)if(w[N]===E)continue e;h&&w.push(E),S.push(T)}else m(w,E,p)||(w!==S&&w.push(E),S.push(T))}return S}return Iv=d,Iv}var Uv,TT;function BA(){if(TT)return Uv;TT=1;var e=Mr(),n=nr();function a(i){return n(i)&&e(i)}return Uv=a,Uv}var Vv,jT;function LH(){if(jT)return Vv;jT=1;var e=Wb(),n=Au(),a=BH(),i=BA(),o=n(function(l){return a(e(l,1,i,!0))});return Vv=o,Vv}var Fv,NT;function HH(){if(NT)return Fv;NT=1;var e=Nu();function n(a,i){return e(i,function(o){return a[o]})}return Fv=n,Fv}var Pv,RT;function LA(){if(RT)return Pv;RT=1;var e=HH(),n=ma();function a(i){return i==null?[]:e(i,n(i))}return Pv=a,Pv}var Gv,MT;function Nn(){if(MT)return Gv;MT=1;var e;if(typeof Db=="function")try{e={clone:$8(),constant:Fb(),each:mA(),filter:NA(),has:RA(),isArray:jt(),isEmpty:vH(),isFunction:Gs(),isUndefined:MA(),keys:ma(),map:zA(),reduce:DA(),size:EH(),transform:CH(),union:LH(),values:LA()}}catch{}return e||(e=window._),Gv=e,Gv}var $v,AT;function Xb(){if(AT)return $v;AT=1;var e=Nn();$v=o;var n="\0",a="\0",i="";function o(p){this._isDirected=e.has(p,"directed")?p.directed:!0,this._isMultigraph=e.has(p,"multigraph")?p.multigraph:!1,this._isCompound=e.has(p,"compound")?p.compound:!1,this._label=void 0,this._defaultNodeLabelFn=e.constant(void 0),this._defaultEdgeLabelFn=e.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[a]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}o.prototype._nodeCount=0,o.prototype._edgeCount=0,o.prototype.isDirected=function(){return this._isDirected},o.prototype.isMultigraph=function(){return this._isMultigraph},o.prototype.isCompound=function(){return this._isCompound},o.prototype.setGraph=function(p){return this._label=p,this},o.prototype.graph=function(){return this._label},o.prototype.setDefaultNodeLabel=function(p){return e.isFunction(p)||(p=e.constant(p)),this._defaultNodeLabelFn=p,this},o.prototype.nodeCount=function(){return this._nodeCount},o.prototype.nodes=function(){return e.keys(this._nodes)},o.prototype.sources=function(){var p=this;return e.filter(this.nodes(),function(v){return e.isEmpty(p._in[v])})},o.prototype.sinks=function(){var p=this;return e.filter(this.nodes(),function(v){return e.isEmpty(p._out[v])})},o.prototype.setNodes=function(p,v){var m=arguments,b=this;return e.each(p,function(_){m.length>1?b.setNode(_,v):b.setNode(_)}),this},o.prototype.setNode=function(p,v){return e.has(this._nodes,p)?(arguments.length>1&&(this._nodes[p]=v),this):(this._nodes[p]=arguments.length>1?v:this._defaultNodeLabelFn(p),this._isCompound&&(this._parent[p]=a,this._children[p]={},this._children[a][p]=!0),this._in[p]={},this._preds[p]={},this._out[p]={},this._sucs[p]={},++this._nodeCount,this)},o.prototype.node=function(p){return this._nodes[p]},o.prototype.hasNode=function(p){return e.has(this._nodes,p)},o.prototype.removeNode=function(p){var v=this;if(e.has(this._nodes,p)){var m=function(b){v.removeEdge(v._edgeObjs[b])};delete this._nodes[p],this._isCompound&&(this._removeFromParentsChildList(p),delete this._parent[p],e.each(this.children(p),function(b){v.setParent(b)}),delete this._children[p]),e.each(e.keys(this._in[p]),m),delete this._in[p],delete this._preds[p],e.each(e.keys(this._out[p]),m),delete this._out[p],delete this._sucs[p],--this._nodeCount}return this},o.prototype.setParent=function(p,v){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(e.isUndefined(v))v=a;else{v+="";for(var m=v;!e.isUndefined(m);m=this.parent(m))if(m===p)throw new Error("Setting "+v+" as parent of "+p+" would create a cycle");this.setNode(v)}return this.setNode(p),this._removeFromParentsChildList(p),this._parent[p]=v,this._children[v][p]=!0,this},o.prototype._removeFromParentsChildList=function(p){delete this._children[this._parent[p]][p]},o.prototype.parent=function(p){if(this._isCompound){var v=this._parent[p];if(v!==a)return v}},o.prototype.children=function(p){if(e.isUndefined(p)&&(p=a),this._isCompound){var v=this._children[p];if(v)return e.keys(v)}else{if(p===a)return this.nodes();if(this.hasNode(p))return[]}},o.prototype.predecessors=function(p){var v=this._preds[p];if(v)return e.keys(v)},o.prototype.successors=function(p){var v=this._sucs[p];if(v)return e.keys(v)},o.prototype.neighbors=function(p){var v=this.predecessors(p);if(v)return e.union(v,this.successors(p))},o.prototype.isLeaf=function(p){var v;return this.isDirected()?v=this.successors(p):v=this.neighbors(p),v.length===0},o.prototype.filterNodes=function(p){var v=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});v.setGraph(this.graph());var m=this;e.each(this._nodes,function(S,w){p(w)&&v.setNode(w,S)}),e.each(this._edgeObjs,function(S){v.hasNode(S.v)&&v.hasNode(S.w)&&v.setEdge(S,m.edge(S))});var b={};function _(S){var w=m.parent(S);return w===void 0||v.hasNode(w)?(b[S]=w,w):w in b?b[w]:_(w)}return this._isCompound&&e.each(v.nodes(),function(S){v.setParent(S,_(S))}),v},o.prototype.setDefaultEdgeLabel=function(p){return e.isFunction(p)||(p=e.constant(p)),this._defaultEdgeLabelFn=p,this},o.prototype.edgeCount=function(){return this._edgeCount},o.prototype.edges=function(){return e.values(this._edgeObjs)},o.prototype.setPath=function(p,v){var m=this,b=arguments;return e.reduce(p,function(_,S){return b.length>1?m.setEdge(_,S,v):m.setEdge(_,S),S}),this},o.prototype.setEdge=function(){var p,v,m,b,_=!1,S=arguments[0];typeof S=="object"&&S!==null&&"v"in S?(p=S.v,v=S.w,m=S.name,arguments.length===2&&(b=arguments[1],_=!0)):(p=S,v=arguments[1],m=arguments[3],arguments.length>2&&(b=arguments[2],_=!0)),p=""+p,v=""+v,e.isUndefined(m)||(m=""+m);var w=d(this._isDirected,p,v,m);if(e.has(this._edgeLabels,w))return _&&(this._edgeLabels[w]=b),this;if(!e.isUndefined(m)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(p),this.setNode(v),this._edgeLabels[w]=_?b:this._defaultEdgeLabelFn(p,v,m);var C=f(this._isDirected,p,v,m);return p=C.v,v=C.w,Object.freeze(C),this._edgeObjs[w]=C,l(this._preds[v],p),l(this._sucs[p],v),this._in[v][w]=C,this._out[p][w]=C,this._edgeCount++,this},o.prototype.edge=function(p,v,m){var b=arguments.length===1?h(this._isDirected,arguments[0]):d(this._isDirected,p,v,m);return this._edgeLabels[b]},o.prototype.hasEdge=function(p,v,m){var b=arguments.length===1?h(this._isDirected,arguments[0]):d(this._isDirected,p,v,m);return e.has(this._edgeLabels,b)},o.prototype.removeEdge=function(p,v,m){var b=arguments.length===1?h(this._isDirected,arguments[0]):d(this._isDirected,p,v,m),_=this._edgeObjs[b];return _&&(p=_.v,v=_.w,delete this._edgeLabels[b],delete this._edgeObjs[b],c(this._preds[v],p),c(this._sucs[p],v),delete this._in[v][b],delete this._out[p][b],this._edgeCount--),this},o.prototype.inEdges=function(p,v){var m=this._in[p];if(m){var b=e.values(m);return v?e.filter(b,function(_){return _.v===v}):b}},o.prototype.outEdges=function(p,v){var m=this._out[p];if(m){var b=e.values(m);return v?e.filter(b,function(_){return _.w===v}):b}},o.prototype.nodeEdges=function(p,v){var m=this.inEdges(p,v);if(m)return m.concat(this.outEdges(p,v))};function l(p,v){p[v]?p[v]++:p[v]=1}function c(p,v){--p[v]||delete p[v]}function d(p,v,m,b){var _=""+v,S=""+m;if(!p&&_>S){var w=_;_=S,S=w}return _+i+S+i+(e.isUndefined(b)?n:b)}function f(p,v,m,b){var _=""+v,S=""+m;if(!p&&_>S){var w=_;_=S,S=w}var C={v:_,w:S};return b&&(C.name=b),C}function h(p,v){return d(p,v.v,v.w,v.name)}return $v}var Yv,zT;function IH(){return zT||(zT=1,Yv="2.1.8"),Yv}var Wv,DT;function UH(){return DT||(DT=1,Wv={Graph:Xb(),version:IH()}),Wv}var Xv,kT;function VH(){if(kT)return Xv;kT=1;var e=Nn(),n=Xb();Xv={write:a,read:l};function a(c){var d={options:{directed:c.isDirected(),multigraph:c.isMultigraph(),compound:c.isCompound()},nodes:i(c),edges:o(c)};return e.isUndefined(c.graph())||(d.value=e.clone(c.graph())),d}function i(c){return e.map(c.nodes(),function(d){var f=c.node(d),h=c.parent(d),p={v:d};return e.isUndefined(f)||(p.value=f),e.isUndefined(h)||(p.parent=h),p})}function o(c){return e.map(c.edges(),function(d){var f=c.edge(d),h={v:d.v,w:d.w};return e.isUndefined(d.name)||(h.name=d.name),e.isUndefined(f)||(h.value=f),h})}function l(c){var d=new n(c.options).setGraph(c.value);return e.each(c.nodes,function(f){d.setNode(f.v,f.value),f.parent&&d.setParent(f.v,f.parent)}),e.each(c.edges,function(f){d.setEdge({v:f.v,w:f.w,name:f.name},f.value)}),d}return Xv}var Kv,OT;function FH(){if(OT)return Kv;OT=1;var e=Nn();Kv=n;function n(a){var i={},o=[],l;function c(d){e.has(i,d)||(i[d]=!0,l.push(d),e.each(a.successors(d),c),e.each(a.predecessors(d),c))}return e.each(a.nodes(),function(d){l=[],c(d),l.length&&o.push(l)}),o}return Kv}var Zv,qT;function HA(){if(qT)return Zv;qT=1;var e=Nn();Zv=n;function n(){this._arr=[],this._keyIndices={}}return n.prototype.size=function(){return this._arr.length},n.prototype.keys=function(){return this._arr.map(function(a){return a.key})},n.prototype.has=function(a){return e.has(this._keyIndices,a)},n.prototype.priority=function(a){var i=this._keyIndices[a];if(i!==void 0)return this._arr[i].priority},n.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},n.prototype.add=function(a,i){var o=this._keyIndices;if(a=String(a),!e.has(o,a)){var l=this._arr,c=l.length;return o[a]=c,l.push({key:a,priority:i}),this._decrease(c),!0}return!1},n.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var a=this._arr.pop();return delete this._keyIndices[a.key],this._heapify(0),a.key},n.prototype.decrease=function(a,i){var o=this._keyIndices[a];if(i>this._arr[o].priority)throw new Error("New priority is greater than current priority. Key: "+a+" Old: "+this._arr[o].priority+" New: "+i);this._arr[o].priority=i,this._decrease(o)},n.prototype._heapify=function(a){var i=this._arr,o=2*a,l=o+1,c=a;o<i.length&&(c=i[o].priority<i[c].priority?o:c,l<i.length&&(c=i[l].priority<i[c].priority?l:c),c!==a&&(this._swap(a,c),this._heapify(c)))},n.prototype._decrease=function(a){for(var i=this._arr,o=i[a].priority,l;a!==0&&(l=a>>1,!(i[l].priority<o));)this._swap(a,l),a=l},n.prototype._swap=function(a,i){var o=this._arr,l=this._keyIndices,c=o[a],d=o[i];o[a]=d,o[i]=c,l[d.key]=a,l[c.key]=i},Zv}var Qv,BT;function IA(){if(BT)return Qv;BT=1;var e=Nn(),n=HA();Qv=i;var a=e.constant(1);function i(l,c,d,f){return o(l,String(c),d||a,f||function(h){return l.outEdges(h)})}function o(l,c,d,f){var h={},p=new n,v,m,b=function(_){var S=_.v!==v?_.v:_.w,w=h[S],C=d(_),T=m.distance+C;if(C<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+_+" Weight: "+C);T<w.distance&&(w.distance=T,w.predecessor=v,p.decrease(S,T))};for(l.nodes().forEach(function(_){var S=_===c?0:Number.POSITIVE_INFINITY;h[_]={distance:S},p.add(_,S)});p.size()>0&&(v=p.removeMin(),m=h[v],m.distance!==Number.POSITIVE_INFINITY);)f(v).forEach(b);return h}return Qv}var Jv,LT;function PH(){if(LT)return Jv;LT=1;var e=IA(),n=Nn();Jv=a;function a(i,o,l){return n.transform(i.nodes(),function(c,d){c[d]=e(i,d,o,l)},{})}return Jv}var em,HT;function UA(){if(HT)return em;HT=1;var e=Nn();em=n;function n(a){var i=0,o=[],l={},c=[];function d(f){var h=l[f]={onStack:!0,lowlink:i,index:i++};if(o.push(f),a.successors(f).forEach(function(m){e.has(l,m)?l[m].onStack&&(h.lowlink=Math.min(h.lowlink,l[m].index)):(d(m),h.lowlink=Math.min(h.lowlink,l[m].lowlink))}),h.lowlink===h.index){var p=[],v;do v=o.pop(),l[v].onStack=!1,p.push(v);while(f!==v);c.push(p)}}return a.nodes().forEach(function(f){e.has(l,f)||d(f)}),c}return em}var tm,IT;function GH(){if(IT)return tm;IT=1;var e=Nn(),n=UA();tm=a;function a(i){return e.filter(n(i),function(o){return o.length>1||o.length===1&&i.hasEdge(o[0],o[0])})}return tm}var nm,UT;function $H(){if(UT)return nm;UT=1;var e=Nn();nm=a;var n=e.constant(1);function a(o,l,c){return i(o,l||n,c||function(d){return o.outEdges(d)})}function i(o,l,c){var d={},f=o.nodes();return f.forEach(function(h){d[h]={},d[h][h]={distance:0},f.forEach(function(p){h!==p&&(d[h][p]={distance:Number.POSITIVE_INFINITY})}),c(h).forEach(function(p){var v=p.v===h?p.w:p.v,m=l(p);d[h][v]={distance:m,predecessor:h}})}),f.forEach(function(h){var p=d[h];f.forEach(function(v){var m=d[v];f.forEach(function(b){var _=m[h],S=p[b],w=m[b],C=_.distance+S.distance;C<w.distance&&(w.distance=C,w.predecessor=S.predecessor)})})}),d}return nm}var rm,VT;function VA(){if(VT)return rm;VT=1;var e=Nn();rm=n,n.CycleException=a;function n(i){var o={},l={},c=[];function d(f){if(e.has(l,f))throw new a;e.has(o,f)||(l[f]=!0,o[f]=!0,e.each(i.predecessors(f),d),delete l[f],c.push(f))}if(e.each(i.sinks(),d),e.size(o)!==i.nodeCount())throw new a;return c}function a(){}return a.prototype=new Error,rm}var am,FT;function YH(){if(FT)return am;FT=1;var e=VA();am=n;function n(a){try{e(a)}catch(i){if(i instanceof e.CycleException)return!1;throw i}return!0}return am}var im,PT;function FA(){if(PT)return im;PT=1;var e=Nn();im=n;function n(i,o,l){e.isArray(o)||(o=[o]);var c=(i.isDirected()?i.successors:i.neighbors).bind(i),d=[],f={};return e.each(o,function(h){if(!i.hasNode(h))throw new Error("Graph does not have node: "+h);a(i,h,l==="post",f,c,d)}),d}function a(i,o,l,c,d,f){e.has(c,o)||(c[o]=!0,l||f.push(o),e.each(d(o),function(h){a(i,h,l,c,d,f)}),l&&f.push(o))}return im}var om,GT;function WH(){if(GT)return om;GT=1;var e=FA();om=n;function n(a,i){return e(a,i,"post")}return om}var sm,$T;function XH(){if($T)return sm;$T=1;var e=FA();sm=n;function n(a,i){return e(a,i,"pre")}return sm}var lm,YT;function KH(){if(YT)return lm;YT=1;var e=Nn(),n=Xb(),a=HA();lm=i;function i(o,l){var c=new n,d={},f=new a,h;function p(m){var b=m.v===h?m.w:m.v,_=f.priority(b);if(_!==void 0){var S=l(m);S<_&&(d[b]=h,f.decrease(b,S))}}if(o.nodeCount()===0)return c;e.each(o.nodes(),function(m){f.add(m,Number.POSITIVE_INFINITY),c.setNode(m)}),f.decrease(o.nodes()[0],0);for(var v=!1;f.size()>0;){if(h=f.removeMin(),e.has(d,h))c.setEdge(h,d[h]);else{if(v)throw new Error("Input graph is not connected: "+o);v=!0}o.nodeEdges(h).forEach(p)}return c}return lm}var cm,WT;function ZH(){return WT||(WT=1,cm={components:FH(),dijkstra:IA(),dijkstraAll:PH(),findCycles:GH(),floydWarshall:$H(),isAcyclic:YH(),postorder:WH(),preorder:XH(),prim:KH(),tarjan:UA(),topsort:VA()}),cm}var um,XT;function QH(){if(XT)return um;XT=1;var e=UH();return um={Graph:e.Graph,json:VH(),alg:ZH(),version:e.version},um}var dm,KT;function Bn(){if(KT)return dm;KT=1;var e;if(typeof Db=="function")try{e=QH()}catch{}return e||(e=window.graphlib),dm=e,dm}var fm,ZT;function JH(){if(ZT)return fm;ZT=1;var e=pA(),n=1,a=4;function i(o){return e(o,n|a)}return fm=i,fm}var hm,QT;function zu(){if(QT)return hm;QT=1;var e=fo(),n=Mr(),a=wu(),i=jn();function o(l,c,d){if(!i(d))return!1;var f=typeof c;return(f=="number"?n(d)&&a(c,d.length):f=="string"&&c in d)?e(d[c],l):!1}return hm=o,hm}var pm,JT;function eI(){if(JT)return pm;JT=1;var e=Au(),n=fo(),a=zu(),i=Za(),o=Object.prototype,l=o.hasOwnProperty,c=e(function(d,f){d=Object(d);var h=-1,p=f.length,v=p>2?f[2]:void 0;for(v&&a(f[0],f[1],v)&&(p=1);++h<p;)for(var m=f[h],b=i(m),_=-1,S=b.length;++_<S;){var w=b[_],C=d[w];(C===void 0||n(C,o[w])&&!l.call(d,w))&&(d[w]=m[w])}return d});return pm=c,pm}var gm,ej;function tI(){if(ej)return gm;ej=1;var e=Ar(),n=Mr(),a=ma();function i(o){return function(l,c,d){var f=Object(l);if(!n(l)){var h=e(c,3);l=a(l),c=function(v){return h(f[v],v,f)}}var p=o(l,c,d);return p>-1?f[h?l[p]:p]:void 0}}return gm=i,gm}var vm,tj;function nI(){if(tj)return vm;tj=1;var e=/\s/;function n(a){for(var i=a.length;i--&&e.test(a.charAt(i)););return i}return vm=n,vm}var mm,nj;function rI(){if(nj)return mm;nj=1;var e=nI(),n=/^\s+/;function a(i){return i&&i.slice(0,e(i)+1).replace(n,"")}return mm=a,mm}var ym,rj;function aI(){if(rj)return ym;rj=1;var e=rI(),n=jn(),a=vo(),i=NaN,o=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,c=/^0o[0-7]+$/i,d=parseInt;function f(h){if(typeof h=="number")return h;if(a(h))return i;if(n(h)){var p=typeof h.valueOf=="function"?h.valueOf():h;h=n(p)?p+"":p}if(typeof h!="string")return h===0?h:+h;h=e(h);var v=l.test(h);return v||c.test(h)?d(h.slice(2),v?2:8):o.test(h)?i:+h}return ym=f,ym}var bm,aj;function PA(){if(aj)return bm;aj=1;var e=aI(),n=1/0,a=17976931348623157e292;function i(o){if(!o)return o===0?o:0;if(o=e(o),o===n||o===-n){var l=o<0?-1:1;return l*a}return o===o?o:0}return bm=i,bm}var xm,ij;function iI(){if(ij)return xm;ij=1;var e=PA();function n(a){var i=e(a),o=i%1;return i===i?o?i-o:i:0}return xm=n,xm}var _m,oj;function oI(){if(oj)return _m;oj=1;var e=qA(),n=Ar(),a=iI(),i=Math.max;function o(l,c,d){var f=l==null?0:l.length;if(!f)return-1;var h=d==null?0:a(d);return h<0&&(h=i(f+h,0)),e(l,n(c,3),h)}return _m=o,_m}var Sm,sj;function sI(){if(sj)return Sm;sj=1;var e=tI(),n=oI(),a=e(n);return Sm=a,Sm}var wm,lj;function GA(){if(lj)return wm;lj=1;var e=Wb();function n(a){var i=a==null?0:a.length;return i?e(a,1):[]}return wm=n,wm}var Em,cj;function lI(){if(cj)return Em;cj=1;var e=Pb(),n=gA(),a=Za();function i(o,l){return o==null?o:e(o,n(l),a)}return Em=i,Em}var Cm,uj;function cI(){if(uj)return Cm;uj=1;function e(n){var a=n==null?0:n.length;return a?n[a-1]:void 0}return Cm=e,Cm}var Tm,dj;function uI(){if(dj)return Tm;dj=1;var e=_u(),n=Gb(),a=Ar();function i(o,l){var c={};return l=a(l,3),n(o,function(d,f,h){e(c,f,l(d,f,h))}),c}return Tm=i,Tm}var jm,fj;function Kb(){if(fj)return jm;fj=1;var e=vo();function n(a,i,o){for(var l=-1,c=a.length;++l<c;){var d=a[l],f=i(d);if(f!=null&&(h===void 0?f===f&&!e(f):o(f,h)))var h=f,p=d}return p}return jm=n,jm}var Nm,hj;function dI(){if(hj)return Nm;hj=1;function e(n,a){return n>a}return Nm=e,Nm}var Rm,pj;function fI(){if(pj)return Rm;pj=1;var e=Kb(),n=dI(),a=Qa();function i(o){return o&&o.length?e(o,a,n):void 0}return Rm=i,Rm}var Mm,gj;function $A(){if(gj)return Mm;gj=1;var e=_u(),n=fo();function a(i,o,l){(l!==void 0&&!n(i[o],l)||l===void 0&&!(o in i))&&e(i,o,l)}return Mm=a,Mm}var Am,vj;function hI(){if(vj)return Am;vj=1;var e=Xa(),n=Tu(),a=nr(),i="[object Object]",o=Function.prototype,l=Object.prototype,c=o.toString,d=l.hasOwnProperty,f=c.call(Object);function h(p){if(!a(p)||e(p)!=i)return!1;var v=n(p);if(v===null)return!0;var m=d.call(v,"constructor")&&v.constructor;return typeof m=="function"&&m instanceof m&&c.call(m)==f}return Am=h,Am}var zm,mj;function YA(){if(mj)return zm;mj=1;function e(n,a){if(!(a==="constructor"&&typeof n[a]=="function")&&a!="__proto__")return n[a]}return zm=e,zm}var Dm,yj;function pI(){if(yj)return Dm;yj=1;var e=$s(),n=Za();function a(i){return e(i,n(i))}return Dm=a,Dm}var km,bj;function gI(){if(bj)return km;bj=1;var e=$A(),n=nA(),a=dA(),i=rA(),o=hA(),l=Ys(),c=jt(),d=BA(),f=po(),h=Gs(),p=jn(),v=hI(),m=Ws(),b=YA(),_=pI();function S(w,C,T,E,N,R,z){var j=b(w,T),A=b(C,T),D=z.get(A);if(D){e(w,T,D);return}var I=R?R(j,A,T+"",w,C,z):void 0,P=I===void 0;if(P){var V=c(A),$=!V&&f(A),L=!V&&!$&&m(A);I=A,V||$||L?c(j)?I=j:d(j)?I=i(j):$?(P=!1,I=n(A,!0)):L?(P=!1,I=a(A,!0)):I=[]:v(A)||l(A)?(I=j,l(j)?I=_(j):(!p(j)||h(j))&&(I=o(A))):P=!1}P&&(z.set(A,I),N(I,A,E,R,z),z.delete(A)),e(w,T,I)}return km=S,km}var Om,xj;function vI(){if(xj)return Om;xj=1;var e=xu(),n=$A(),a=Pb(),i=gI(),o=jn(),l=Za(),c=YA();function d(f,h,p,v,m){f!==h&&a(h,function(b,_){if(m||(m=new e),o(b))i(f,h,_,p,d,v,m);else{var S=v?v(c(f,_),b,_+"",f,h,m):void 0;S===void 0&&(S=b),n(f,_,S)}},l)}return Om=d,Om}var qm,_j;function mI(){if(_j)return qm;_j=1;var e=Au(),n=zu();function a(i){return e(function(o,l){var c=-1,d=l.length,f=d>1?l[d-1]:void 0,h=d>2?l[2]:void 0;for(f=i.length>3&&typeof f=="function"?(d--,f):void 0,h&&n(l[0],l[1],h)&&(f=d<3?void 0:f,d=1),o=Object(o);++c<d;){var p=l[c];p&&i(o,p,c,f)}return o})}return qm=a,qm}var Bm,Sj;function yI(){if(Sj)return Bm;Sj=1;var e=vI(),n=mI(),a=n(function(i,o,l){e(i,o,l)});return Bm=a,Bm}var Lm,wj;function WA(){if(wj)return Lm;wj=1;function e(n,a){return n<a}return Lm=e,Lm}var Hm,Ej;function bI(){if(Ej)return Hm;Ej=1;var e=Kb(),n=WA(),a=Qa();function i(o){return o&&o.length?e(o,a,n):void 0}return Hm=i,Hm}var Im,Cj;function xI(){if(Cj)return Im;Cj=1;var e=Kb(),n=Ar(),a=WA();function i(o,l){return o&&o.length?e(o,n(l,2),a):void 0}return Im=i,Im}var Um,Tj;function _I(){if(Tj)return Um;Tj=1;var e=In(),n=function(){return e.Date.now()};return Um=n,Um}var Vm,jj;function SI(){if(jj)return Vm;jj=1;var e=Su(),n=Ru(),a=wu(),i=jn(),o=Xs();function l(c,d,f,h){if(!i(c))return c;d=n(d,c);for(var p=-1,v=d.length,m=v-1,b=c;b!=null&&++p<v;){var _=o(d[p]),S=f;if(_==="__proto__"||_==="constructor"||_==="prototype")return c;if(p!=m){var w=b[_];S=h?h(w,_,b):void 0,S===void 0&&(S=i(w)?w:a(d[p+1])?[]:{})}e(b,_,S),b=b[_]}return c}return Vm=l,Vm}var Fm,Nj;function wI(){if(Nj)return Fm;Nj=1;var e=Mu(),n=SI(),a=Ru();function i(o,l,c){for(var d=-1,f=l.length,h={};++d<f;){var p=l[d],v=e(o,p);c(v,p)&&n(h,a(p,o),v)}return h}return Fm=i,Fm}var Pm,Rj;function EI(){if(Rj)return Pm;Rj=1;var e=wI(),n=TA();function a(i,o){return e(i,o,function(l,c){return n(i,c)})}return Pm=a,Pm}var Gm,Mj;function CI(){if(Mj)return Gm;Mj=1;var e=GA(),n=kA(),a=OA();function i(o){return a(n(o,void 0,e),o+"")}return Gm=i,Gm}var $m,Aj;function TI(){if(Aj)return $m;Aj=1;var e=EI(),n=CI(),a=n(function(i,o){return i==null?{}:e(i,o)});return $m=a,$m}var Ym,zj;function jI(){if(zj)return Ym;zj=1;var e=Math.ceil,n=Math.max;function a(i,o,l,c){for(var d=-1,f=n(e((o-i)/(l||1)),0),h=Array(f);f--;)h[c?f:++d]=i,i+=l;return h}return Ym=a,Ym}var Wm,Dj;function NI(){if(Dj)return Wm;Dj=1;var e=jI(),n=zu(),a=PA();function i(o){return function(l,c,d){return d&&typeof d!="number"&&n(l,c,d)&&(c=d=void 0),l=a(l),c===void 0?(c=l,l=0):c=a(c),d=d===void 0?l<c?1:-1:a(d),e(l,c,d,o)}}return Wm=i,Wm}var Xm,kj;function RI(){if(kj)return Xm;kj=1;var e=NI(),n=e();return Xm=n,Xm}var Km,Oj;function MI(){if(Oj)return Km;Oj=1;function e(n,a){var i=n.length;for(n.sort(a);i--;)n[i]=n[i].value;return n}return Km=e,Km}var Zm,qj;function AI(){if(qj)return Zm;qj=1;var e=vo();function n(a,i){if(a!==i){var o=a!==void 0,l=a===null,c=a===a,d=e(a),f=i!==void 0,h=i===null,p=i===i,v=e(i);if(!h&&!v&&!d&&a>i||d&&f&&p&&!h&&!v||l&&f&&p||!o&&p||!c)return 1;if(!l&&!d&&!v&&a<i||v&&o&&c&&!l&&!d||h&&o&&c||!f&&c||!p)return-1}return 0}return Zm=n,Zm}var Qm,Bj;function zI(){if(Bj)return Qm;Bj=1;var e=AI();function n(a,i,o){for(var l=-1,c=a.criteria,d=i.criteria,f=c.length,h=o.length;++l<f;){var p=e(c[l],d[l]);if(p){if(l>=h)return p;var v=o[l];return p*(v=="desc"?-1:1)}}return a.index-i.index}return Qm=n,Qm}var Jm,Lj;function DI(){if(Lj)return Jm;Lj=1;var e=Nu(),n=Mu(),a=Ar(),i=AA(),o=MI(),l=Eu(),c=zI(),d=Qa(),f=jt();function h(p,v,m){v.length?v=e(v,function(S){return f(S)?function(w){return n(w,S.length===1?S[0]:S)}:S}):v=[d];var b=-1;v=e(v,l(a));var _=i(p,function(S,w,C){var T=e(v,function(E){return E(S)});return{criteria:T,index:++b,value:S}});return o(_,function(S,w){return c(S,w,m)})}return Jm=h,Jm}var ey,Hj;function kI(){if(Hj)return ey;Hj=1;var e=Wb(),n=DI(),a=Au(),i=zu(),o=a(function(l,c){if(l==null)return[];var d=c.length;return d>1&&i(l,c[0],c[1])?c=[]:d>2&&i(c[0],c[1],c[2])&&(c=[c[0]]),n(l,e(c,1),[])});return ey=o,ey}var ty,Ij;function OI(){if(Ij)return ty;Ij=1;var e=EA(),n=0;function a(i){var o=++n;return e(i)+o}return ty=a,ty}var ny,Uj;function qI(){if(Uj)return ny;Uj=1;function e(n,a,i){for(var o=-1,l=n.length,c=a.length,d={};++o<l;){var f=o<c?a[o]:void 0;i(d,n[o],f)}return d}return ny=e,ny}var ry,Vj;function BI(){if(Vj)return ry;Vj=1;var e=Su(),n=qI();function a(i,o){return n(i||[],o||[],e)}return ry=a,ry}var ay,Fj;function ft(){if(Fj)return ay;Fj=1;var e;if(typeof Db=="function")try{e={cloneDeep:JH(),constant:Fb(),defaults:eI(),each:mA(),filter:NA(),find:sI(),flatten:GA(),forEach:vA(),forIn:lI(),has:RA(),isUndefined:MA(),last:cI(),map:zA(),mapValues:uI(),max:fI(),merge:yI(),min:bI(),minBy:xI(),now:_I(),pick:TI(),range:RI(),reduce:DA(),sortBy:kI(),uniqueId:OI(),values:LA(),zipObject:BI()}}catch{}return e||(e=window._),ay=e,ay}var iy,Pj;function LI(){if(Pj)return iy;Pj=1,iy=e;function e(){var i={};i._next=i._prev=i,this._sentinel=i}e.prototype.dequeue=function(){var i=this._sentinel,o=i._prev;if(o!==i)return n(o),o},e.prototype.enqueue=function(i){var o=this._sentinel;i._prev&&i._next&&n(i),i._next=o._next,o._next._prev=i,o._next=i,i._prev=o},e.prototype.toString=function(){for(var i=[],o=this._sentinel,l=o._prev;l!==o;)i.push(JSON.stringify(l,a)),l=l._prev;return"["+i.join(", ")+"]"};function n(i){i._prev._next=i._next,i._next._prev=i._prev,delete i._next,delete i._prev}function a(i,o){if(i!=="_next"&&i!=="_prev")return o}return iy}var oy,Gj;function HI(){if(Gj)return oy;Gj=1;var e=ft(),n=Bn().Graph,a=LI();oy=o;var i=e.constant(1);function o(h,p){if(h.nodeCount()<=1)return[];var v=d(h,p||i),m=l(v.graph,v.buckets,v.zeroIdx);return e.flatten(e.map(m,function(b){return h.outEdges(b.v,b.w)}),!0)}function l(h,p,v){for(var m=[],b=p[p.length-1],_=p[0],S;h.nodeCount();){for(;S=_.dequeue();)c(h,p,v,S);for(;S=b.dequeue();)c(h,p,v,S);if(h.nodeCount()){for(var w=p.length-2;w>0;--w)if(S=p[w].dequeue(),S){m=m.concat(c(h,p,v,S,!0));break}}}return m}function c(h,p,v,m,b){var _=b?[]:void 0;return e.forEach(h.inEdges(m.v),function(S){var w=h.edge(S),C=h.node(S.v);b&&_.push({v:S.v,w:S.w}),C.out-=w,f(p,v,C)}),e.forEach(h.outEdges(m.v),function(S){var w=h.edge(S),C=S.w,T=h.node(C);T.in-=w,f(p,v,T)}),h.removeNode(m.v),_}function d(h,p){var v=new n,m=0,b=0;e.forEach(h.nodes(),function(w){v.setNode(w,{v:w,in:0,out:0})}),e.forEach(h.edges(),function(w){var C=v.edge(w.v,w.w)||0,T=p(w),E=C+T;v.setEdge(w.v,w.w,E),b=Math.max(b,v.node(w.v).out+=T),m=Math.max(m,v.node(w.w).in+=T)});var _=e.range(b+m+3).map(function(){return new a}),S=m+1;return e.forEach(v.nodes(),function(w){f(_,S,v.node(w))}),{graph:v,buckets:_,zeroIdx:S}}function f(h,p,v){v.out?v.in?h[v.out-v.in+p].enqueue(v):h[h.length-1].enqueue(v):h[0].enqueue(v)}return oy}var sy,$j;function II(){if($j)return sy;$j=1;var e=ft(),n=HI();sy={run:a,undo:o};function a(l){var c=l.graph().acyclicer==="greedy"?n(l,d(l)):i(l);e.forEach(c,function(f){var h=l.edge(f);l.removeEdge(f),h.forwardName=f.name,h.reversed=!0,l.setEdge(f.w,f.v,h,e.uniqueId("rev"))});function d(f){return function(h){return f.edge(h).weight}}}function i(l){var c=[],d={},f={};function h(p){e.has(f,p)||(f[p]=!0,d[p]=!0,e.forEach(l.outEdges(p),function(v){e.has(d,v.w)?c.push(v):h(v.w)}),delete d[p])}return e.forEach(l.nodes(),h),c}function o(l){e.forEach(l.edges(),function(c){var d=l.edge(c);if(d.reversed){l.removeEdge(c);var f=d.forwardName;delete d.reversed,delete d.forwardName,l.setEdge(c.w,c.v,d,f)}})}return sy}var ly,Yj;function tn(){if(Yj)return ly;Yj=1;var e=ft(),n=Bn().Graph;ly={addDummyNode:a,simplify:i,asNonCompoundGraph:o,successorWeights:l,predecessorWeights:c,intersectRect:d,buildLayerMatrix:f,normalizeRanks:h,removeEmptyRanks:p,addBorderNode:v,maxRank:m,partition:b,time:_,notime:S};function a(w,C,T,E){var N;do N=e.uniqueId(E);while(w.hasNode(N));return T.dummy=C,w.setNode(N,T),N}function i(w){var C=new n().setGraph(w.graph());return e.forEach(w.nodes(),function(T){C.setNode(T,w.node(T))}),e.forEach(w.edges(),function(T){var E=C.edge(T.v,T.w)||{weight:0,minlen:1},N=w.edge(T);C.setEdge(T.v,T.w,{weight:E.weight+N.weight,minlen:Math.max(E.minlen,N.minlen)})}),C}function o(w){var C=new n({multigraph:w.isMultigraph()}).setGraph(w.graph());return e.forEach(w.nodes(),function(T){w.children(T).length||C.setNode(T,w.node(T))}),e.forEach(w.edges(),function(T){C.setEdge(T,w.edge(T))}),C}function l(w){var C=e.map(w.nodes(),function(T){var E={};return e.forEach(w.outEdges(T),function(N){E[N.w]=(E[N.w]||0)+w.edge(N).weight}),E});return e.zipObject(w.nodes(),C)}function c(w){var C=e.map(w.nodes(),function(T){var E={};return e.forEach(w.inEdges(T),function(N){E[N.v]=(E[N.v]||0)+w.edge(N).weight}),E});return e.zipObject(w.nodes(),C)}function d(w,C){var T=w.x,E=w.y,N=C.x-T,R=C.y-E,z=w.width/2,j=w.height/2;if(!N&&!R)throw new Error("Not possible to find intersection inside of the rectangle");var A,D;return Math.abs(R)*z>Math.abs(N)*j?(R<0&&(j=-j),A=j*N/R,D=j):(N<0&&(z=-z),A=z,D=z*R/N),{x:T+A,y:E+D}}function f(w){var C=e.map(e.range(m(w)+1),function(){return[]});return e.forEach(w.nodes(),function(T){var E=w.node(T),N=E.rank;e.isUndefined(N)||(C[N][E.order]=T)}),C}function h(w){var C=e.min(e.map(w.nodes(),function(T){return w.node(T).rank}));e.forEach(w.nodes(),function(T){var E=w.node(T);e.has(E,"rank")&&(E.rank-=C)})}function p(w){var C=e.min(e.map(w.nodes(),function(R){return w.node(R).rank})),T=[];e.forEach(w.nodes(),function(R){var z=w.node(R).rank-C;T[z]||(T[z]=[]),T[z].push(R)});var E=0,N=w.graph().nodeRankFactor;e.forEach(T,function(R,z){e.isUndefined(R)&&z%N!==0?--E:E&&e.forEach(R,function(j){w.node(j).rank+=E})})}function v(w,C,T,E){var N={width:0,height:0};return arguments.length>=4&&(N.rank=T,N.order=E),a(w,"border",N,C)}function m(w){return e.max(e.map(w.nodes(),function(C){var T=w.node(C).rank;if(!e.isUndefined(T))return T}))}function b(w,C){var T={lhs:[],rhs:[]};return e.forEach(w,function(E){C(E)?T.lhs.push(E):T.rhs.push(E)}),T}function _(w,C){var T=e.now();try{return C()}finally{console.log(w+" time: "+(e.now()-T)+"ms")}}function S(w,C){return C()}return ly}var cy,Wj;function UI(){if(Wj)return cy;Wj=1;var e=ft(),n=tn();cy={run:a,undo:o};function a(l){l.graph().dummyChains=[],e.forEach(l.edges(),function(c){i(l,c)})}function i(l,c){var d=c.v,f=l.node(d).rank,h=c.w,p=l.node(h).rank,v=c.name,m=l.edge(c),b=m.labelRank;if(p!==f+1){l.removeEdge(c);var _,S,w;for(w=0,++f;f<p;++w,++f)m.points=[],S={width:0,height:0,edgeLabel:m,edgeObj:c,rank:f},_=n.addDummyNode(l,"edge",S,"_d"),f===b&&(S.width=m.width,S.height=m.height,S.dummy="edge-label",S.labelpos=m.labelpos),l.setEdge(d,_,{weight:m.weight},v),w===0&&l.graph().dummyChains.push(_),d=_;l.setEdge(d,h,{weight:m.weight},v)}}function o(l){e.forEach(l.graph().dummyChains,function(c){var d=l.node(c),f=d.edgeLabel,h;for(l.setEdge(d.edgeObj,f);d.dummy;)h=l.successors(c)[0],l.removeNode(c),f.points.push({x:d.x,y:d.y}),d.dummy==="edge-label"&&(f.x=d.x,f.y=d.y,f.width=d.width,f.height=d.height),c=h,d=l.node(c)})}return cy}var uy,Xj;function Qc(){if(Xj)return uy;Xj=1;var e=ft();uy={longestPath:n,slack:a};function n(i){var o={};function l(c){var d=i.node(c);if(e.has(o,c))return d.rank;o[c]=!0;var f=e.min(e.map(i.outEdges(c),function(h){return l(h.w)-i.edge(h).minlen}));return(f===Number.POSITIVE_INFINITY||f===void 0||f===null)&&(f=0),d.rank=f}e.forEach(i.sources(),l)}function a(i,o){return i.node(o.w).rank-i.node(o.v).rank-i.edge(o).minlen}return uy}var dy,Kj;function XA(){if(Kj)return dy;Kj=1;var e=ft(),n=Bn().Graph,a=Qc().slack;dy=i;function i(d){var f=new n({directed:!1}),h=d.nodes()[0],p=d.nodeCount();f.setNode(h,{});for(var v,m;o(f,d)<p;)v=l(f,d),m=f.hasNode(v.v)?a(d,v):-a(d,v),c(f,d,m);return f}function o(d,f){function h(p){e.forEach(f.nodeEdges(p),function(v){var m=v.v,b=p===m?v.w:m;!d.hasNode(b)&&!a(f,v)&&(d.setNode(b,{}),d.setEdge(p,b,{}),h(b))})}return e.forEach(d.nodes(),h),d.nodeCount()}function l(d,f){return e.minBy(f.edges(),function(h){if(d.hasNode(h.v)!==d.hasNode(h.w))return a(f,h)})}function c(d,f,h){e.forEach(d.nodes(),function(p){f.node(p).rank+=h})}return dy}var fy,Zj;function VI(){if(Zj)return fy;Zj=1;var e=ft(),n=XA(),a=Qc().slack,i=Qc().longestPath,o=Bn().alg.preorder,l=Bn().alg.postorder,c=tn().simplify;fy=d,d.initLowLimValues=v,d.initCutValues=f,d.calcCutValue=p,d.leaveEdge=b,d.enterEdge=_,d.exchangeEdges=S;function d(E){E=c(E),i(E);var N=n(E);v(N),f(N,E);for(var R,z;R=b(N);)z=_(N,E,R),S(N,E,R,z)}function f(E,N){var R=l(E,E.nodes());R=R.slice(0,R.length-1),e.forEach(R,function(z){h(E,N,z)})}function h(E,N,R){var z=E.node(R),j=z.parent;E.edge(R,j).cutvalue=p(E,N,R)}function p(E,N,R){var z=E.node(R),j=z.parent,A=!0,D=N.edge(R,j),I=0;return D||(A=!1,D=N.edge(j,R)),I=D.weight,e.forEach(N.nodeEdges(R),function(P){var V=P.v===R,$=V?P.w:P.v;if($!==j){var L=V===A,H=N.edge(P).weight;if(I+=L?H:-H,C(E,R,$)){var O=E.edge(R,$).cutvalue;I+=L?-O:O}}}),I}function v(E,N){arguments.length<2&&(N=E.nodes()[0]),m(E,{},1,N)}function m(E,N,R,z,j){var A=R,D=E.node(z);return N[z]=!0,e.forEach(E.neighbors(z),function(I){e.has(N,I)||(R=m(E,N,R,I,z))}),D.low=A,D.lim=R++,j?D.parent=j:delete D.parent,R}function b(E){return e.find(E.edges(),function(N){return E.edge(N).cutvalue<0})}function _(E,N,R){var z=R.v,j=R.w;N.hasEdge(z,j)||(z=R.w,j=R.v);var A=E.node(z),D=E.node(j),I=A,P=!1;A.lim>D.lim&&(I=D,P=!0);var V=e.filter(N.edges(),function($){return P===T(E,E.node($.v),I)&&P!==T(E,E.node($.w),I)});return e.minBy(V,function($){return a(N,$)})}function S(E,N,R,z){var j=R.v,A=R.w;E.removeEdge(j,A),E.setEdge(z.v,z.w,{}),v(E),f(E,N),w(E,N)}function w(E,N){var R=e.find(E.nodes(),function(j){return!N.node(j).parent}),z=o(E,R);z=z.slice(1),e.forEach(z,function(j){var A=E.node(j).parent,D=N.edge(j,A),I=!1;D||(D=N.edge(A,j),I=!0),N.node(j).rank=N.node(A).rank+(I?D.minlen:-D.minlen)})}function C(E,N,R){return E.hasEdge(N,R)}function T(E,N,R){return R.low<=N.lim&&N.lim<=R.lim}return fy}var hy,Qj;function FI(){if(Qj)return hy;Qj=1;var e=Qc(),n=e.longestPath,a=XA(),i=VI();hy=o;function o(f){switch(f.graph().ranker){case"network-simplex":d(f);break;case"tight-tree":c(f);break;case"longest-path":l(f);break;default:d(f)}}var l=n;function c(f){n(f),a(f)}function d(f){i(f)}return hy}var py,Jj;function PI(){if(Jj)return py;Jj=1;var e=ft();py=n;function n(o){var l=i(o);e.forEach(o.graph().dummyChains,function(c){for(var d=o.node(c),f=d.edgeObj,h=a(o,l,f.v,f.w),p=h.path,v=h.lca,m=0,b=p[m],_=!0;c!==f.w;){if(d=o.node(c),_){for(;(b=p[m])!==v&&o.node(b).maxRank<d.rank;)m++;b===v&&(_=!1)}if(!_){for(;m<p.length-1&&o.node(b=p[m+1]).minRank<=d.rank;)m++;b=p[m]}o.setParent(c,b),c=o.successors(c)[0]}})}function a(o,l,c,d){var f=[],h=[],p=Math.min(l[c].low,l[d].low),v=Math.max(l[c].lim,l[d].lim),m,b;m=c;do m=o.parent(m),f.push(m);while(m&&(l[m].low>p||v>l[m].lim));for(b=m,m=d;(m=o.parent(m))!==b;)h.push(m);return{path:f.concat(h.reverse()),lca:b}}function i(o){var l={},c=0;function d(f){var h=c;e.forEach(o.children(f),d),l[f]={low:h,lim:c++}}return e.forEach(o.children(),d),l}return py}var gy,eN;function GI(){if(eN)return gy;eN=1;var e=ft(),n=tn();gy={run:a,cleanup:c};function a(d){var f=n.addDummyNode(d,"root",{},"_root"),h=o(d),p=e.max(e.values(h))-1,v=2*p+1;d.graph().nestingRoot=f,e.forEach(d.edges(),function(b){d.edge(b).minlen*=v});var m=l(d)+1;e.forEach(d.children(),function(b){i(d,f,v,m,p,h,b)}),d.graph().nodeRankFactor=v}function i(d,f,h,p,v,m,b){var _=d.children(b);if(!_.length){b!==f&&d.setEdge(f,b,{weight:0,minlen:h});return}var S=n.addBorderNode(d,"_bt"),w=n.addBorderNode(d,"_bb"),C=d.node(b);d.setParent(S,b),C.borderTop=S,d.setParent(w,b),C.borderBottom=w,e.forEach(_,function(T){i(d,f,h,p,v,m,T);var E=d.node(T),N=E.borderTop?E.borderTop:T,R=E.borderBottom?E.borderBottom:T,z=E.borderTop?p:2*p,j=N!==R?1:v-m[b]+1;d.setEdge(S,N,{weight:z,minlen:j,nestingEdge:!0}),d.setEdge(R,w,{weight:z,minlen:j,nestingEdge:!0})}),d.parent(b)||d.setEdge(f,S,{weight:0,minlen:v+m[b]})}function o(d){var f={};function h(p,v){var m=d.children(p);m&&m.length&&e.forEach(m,function(b){h(b,v+1)}),f[p]=v}return e.forEach(d.children(),function(p){h(p,1)}),f}function l(d){return e.reduce(d.edges(),function(f,h){return f+d.edge(h).weight},0)}function c(d){var f=d.graph();d.removeNode(f.nestingRoot),delete f.nestingRoot,e.forEach(d.edges(),function(h){var p=d.edge(h);p.nestingEdge&&d.removeEdge(h)})}return gy}var vy,tN;function $I(){if(tN)return vy;tN=1;var e=ft(),n=tn();vy=a;function a(o){function l(c){var d=o.children(c),f=o.node(c);if(d.length&&e.forEach(d,l),e.has(f,"minRank")){f.borderLeft=[],f.borderRight=[];for(var h=f.minRank,p=f.maxRank+1;h<p;++h)i(o,"borderLeft","_bl",c,f,h),i(o,"borderRight","_br",c,f,h)}}e.forEach(o.children(),l)}function i(o,l,c,d,f,h){var p={width:0,height:0,rank:h,borderType:l},v=f[l][h-1],m=n.addDummyNode(o,"border",p,c);f[l][h]=m,o.setParent(m,d),v&&o.setEdge(v,m,{weight:1})}return vy}var my,nN;function YI(){if(nN)return my;nN=1;var e=ft();my={adjust:n,undo:a};function n(h){var p=h.graph().rankdir.toLowerCase();(p==="lr"||p==="rl")&&i(h)}function a(h){var p=h.graph().rankdir.toLowerCase();(p==="bt"||p==="rl")&&l(h),(p==="lr"||p==="rl")&&(d(h),i(h))}function i(h){e.forEach(h.nodes(),function(p){o(h.node(p))}),e.forEach(h.edges(),function(p){o(h.edge(p))})}function o(h){var p=h.width;h.width=h.height,h.height=p}function l(h){e.forEach(h.nodes(),function(p){c(h.node(p))}),e.forEach(h.edges(),function(p){var v=h.edge(p);e.forEach(v.points,c),e.has(v,"y")&&c(v)})}function c(h){h.y=-h.y}function d(h){e.forEach(h.nodes(),function(p){f(h.node(p))}),e.forEach(h.edges(),function(p){var v=h.edge(p);e.forEach(v.points,f),e.has(v,"x")&&f(v)})}function f(h){var p=h.x;h.x=h.y,h.y=p}return my}var yy,rN;function WI(){if(rN)return yy;rN=1;var e=ft();yy=n;function n(a){var i={},o=e.filter(a.nodes(),function(h){return!a.children(h).length}),l=e.max(e.map(o,function(h){return a.node(h).rank})),c=e.map(e.range(l+1),function(){return[]});function d(h){if(!e.has(i,h)){i[h]=!0;var p=a.node(h);c[p.rank].push(h),e.forEach(a.successors(h),d)}}var f=e.sortBy(o,function(h){return a.node(h).rank});return e.forEach(f,d),c}return yy}var by,aN;function XI(){if(aN)return by;aN=1;var e=ft();by=n;function n(i,o){for(var l=0,c=1;c<o.length;++c)l+=a(i,o[c-1],o[c]);return l}function a(i,o,l){for(var c=e.zipObject(l,e.map(l,function(m,b){return b})),d=e.flatten(e.map(o,function(m){return e.sortBy(e.map(i.outEdges(m),function(b){return{pos:c[b.w],weight:i.edge(b).weight}}),"pos")}),!0),f=1;f<l.length;)f<<=1;var h=2*f-1;f-=1;var p=e.map(new Array(h),function(){return 0}),v=0;return e.forEach(d.forEach(function(m){var b=m.pos+f;p[b]+=m.weight;for(var _=0;b>0;)b%2&&(_+=p[b+1]),b=b-1>>1,p[b]+=m.weight;v+=m.weight*_})),v}return by}var xy,iN;function KI(){if(iN)return xy;iN=1;var e=ft();xy=n;function n(a,i){return e.map(i,function(o){var l=a.inEdges(o);if(l.length){var c=e.reduce(l,function(d,f){var h=a.edge(f),p=a.node(f.v);return{sum:d.sum+h.weight*p.order,weight:d.weight+h.weight}},{sum:0,weight:0});return{v:o,barycenter:c.sum/c.weight,weight:c.weight}}else return{v:o}})}return xy}var _y,oN;function ZI(){if(oN)return _y;oN=1;var e=ft();_y=n;function n(o,l){var c={};e.forEach(o,function(f,h){var p=c[f.v]={indegree:0,in:[],out:[],vs:[f.v],i:h};e.isUndefined(f.barycenter)||(p.barycenter=f.barycenter,p.weight=f.weight)}),e.forEach(l.edges(),function(f){var h=c[f.v],p=c[f.w];!e.isUndefined(h)&&!e.isUndefined(p)&&(p.indegree++,h.out.push(c[f.w]))});var d=e.filter(c,function(f){return!f.indegree});return a(d)}function a(o){var l=[];function c(h){return function(p){p.merged||(e.isUndefined(p.barycenter)||e.isUndefined(h.barycenter)||p.barycenter>=h.barycenter)&&i(h,p)}}function d(h){return function(p){p.in.push(h),--p.indegree===0&&o.push(p)}}for(;o.length;){var f=o.pop();l.push(f),e.forEach(f.in.reverse(),c(f)),e.forEach(f.out,d(f))}return e.map(e.filter(l,function(h){return!h.merged}),function(h){return e.pick(h,["vs","i","barycenter","weight"])})}function i(o,l){var c=0,d=0;o.weight&&(c+=o.barycenter*o.weight,d+=o.weight),l.weight&&(c+=l.barycenter*l.weight,d+=l.weight),o.vs=l.vs.concat(o.vs),o.barycenter=c/d,o.weight=d,o.i=Math.min(l.i,o.i),l.merged=!0}return _y}var Sy,sN;function QI(){if(sN)return Sy;sN=1;var e=ft(),n=tn();Sy=a;function a(l,c){var d=n.partition(l,function(S){return e.has(S,"barycenter")}),f=d.lhs,h=e.sortBy(d.rhs,function(S){return-S.i}),p=[],v=0,m=0,b=0;f.sort(o(!!c)),b=i(p,h,b),e.forEach(f,function(S){b+=S.vs.length,p.push(S.vs),v+=S.barycenter*S.weight,m+=S.weight,b=i(p,h,b)});var _={vs:e.flatten(p,!0)};return m&&(_.barycenter=v/m,_.weight=m),_}function i(l,c,d){for(var f;c.length&&(f=e.last(c)).i<=d;)c.pop(),l.push(f.vs),d++;return d}function o(l){return function(c,d){return c.barycenter<d.barycenter?-1:c.barycenter>d.barycenter?1:l?d.i-c.i:c.i-d.i}}return Sy}var wy,lN;function JI(){if(lN)return wy;lN=1;var e=ft(),n=KI(),a=ZI(),i=QI();wy=o;function o(d,f,h,p){var v=d.children(f),m=d.node(f),b=m?m.borderLeft:void 0,_=m?m.borderRight:void 0,S={};b&&(v=e.filter(v,function(R){return R!==b&&R!==_}));var w=n(d,v);e.forEach(w,function(R){if(d.children(R.v).length){var z=o(d,R.v,h,p);S[R.v]=z,e.has(z,"barycenter")&&c(R,z)}});var C=a(w,h);l(C,S);var T=i(C,p);if(b&&(T.vs=e.flatten([b,T.vs,_],!0),d.predecessors(b).length)){var E=d.node(d.predecessors(b)[0]),N=d.node(d.predecessors(_)[0]);e.has(T,"barycenter")||(T.barycenter=0,T.weight=0),T.barycenter=(T.barycenter*T.weight+E.order+N.order)/(T.weight+2),T.weight+=2}return T}function l(d,f){e.forEach(d,function(h){h.vs=e.flatten(h.vs.map(function(p){return f[p]?f[p].vs:p}),!0)})}function c(d,f){e.isUndefined(d.barycenter)?(d.barycenter=f.barycenter,d.weight=f.weight):(d.barycenter=(d.barycenter*d.weight+f.barycenter*f.weight)/(d.weight+f.weight),d.weight+=f.weight)}return wy}var Ey,cN;function e7(){if(cN)return Ey;cN=1;var e=ft(),n=Bn().Graph;Ey=a;function a(o,l,c){var d=i(o),f=new n({compound:!0}).setGraph({root:d}).setDefaultNodeLabel(function(h){return o.node(h)});return e.forEach(o.nodes(),function(h){var p=o.node(h),v=o.parent(h);(p.rank===l||p.minRank<=l&&l<=p.maxRank)&&(f.setNode(h),f.setParent(h,v||d),e.forEach(o[c](h),function(m){var b=m.v===h?m.w:m.v,_=f.edge(b,h),S=e.isUndefined(_)?0:_.weight;f.setEdge(b,h,{weight:o.edge(m).weight+S})}),e.has(p,"minRank")&&f.setNode(h,{borderLeft:p.borderLeft[l],borderRight:p.borderRight[l]}))}),f}function i(o){for(var l;o.hasNode(l=e.uniqueId("_root")););return l}return Ey}var Cy,uN;function t7(){if(uN)return Cy;uN=1;var e=ft();Cy=n;function n(a,i,o){var l={},c;e.forEach(o,function(d){for(var f=a.parent(d),h,p;f;){if(h=a.parent(f),h?(p=l[h],l[h]=f):(p=c,c=f),p&&p!==f){i.setEdge(p,f);return}f=h}})}return Cy}var Ty,dN;function n7(){if(dN)return Ty;dN=1;var e=ft(),n=WI(),a=XI(),i=JI(),o=e7(),l=t7(),c=Bn().Graph,d=tn();Ty=f;function f(m){var b=d.maxRank(m),_=h(m,e.range(1,b+1),"inEdges"),S=h(m,e.range(b-1,-1,-1),"outEdges"),w=n(m);v(m,w);for(var C=Number.POSITIVE_INFINITY,T,E=0,N=0;N<4;++E,++N){p(E%2?_:S,E%4>=2),w=d.buildLayerMatrix(m);var R=a(m,w);R<C&&(N=0,T=e.cloneDeep(w),C=R)}v(m,T)}function h(m,b,_){return e.map(b,function(S){return o(m,S,_)})}function p(m,b){var _=new c;e.forEach(m,function(S){var w=S.graph().root,C=i(S,w,_,b);e.forEach(C.vs,function(T,E){S.node(T).order=E}),l(S,_,C.vs)})}function v(m,b){e.forEach(b,function(_){e.forEach(_,function(S,w){m.node(S).order=w})})}return Ty}var jy,fN;function r7(){if(fN)return jy;fN=1;var e=ft(),n=Bn().Graph,a=tn();jy={positionX:_,findType1Conflicts:i,findType2Conflicts:o,addConflict:c,hasConflict:d,verticalAlignment:f,horizontalCompaction:h,alignCoordinates:m,findSmallestWidthAlignment:v,balance:b};function i(C,T){var E={};function N(R,z){var j=0,A=0,D=R.length,I=e.last(z);return e.forEach(z,function(P,V){var $=l(C,P),L=$?C.node($).order:D;($||P===I)&&(e.forEach(z.slice(A,V+1),function(H){e.forEach(C.predecessors(H),function(O){var F=C.node(O),J=F.order;(J<j||L<J)&&!(F.dummy&&C.node(H).dummy)&&c(E,O,H)})}),A=V+1,j=L)}),z}return e.reduce(T,N),E}function o(C,T){var E={};function N(z,j,A,D,I){var P;e.forEach(e.range(j,A),function(V){P=z[V],C.node(P).dummy&&e.forEach(C.predecessors(P),function($){var L=C.node($);L.dummy&&(L.order<D||L.order>I)&&c(E,$,P)})})}function R(z,j){var A=-1,D,I=0;return e.forEach(j,function(P,V){if(C.node(P).dummy==="border"){var $=C.predecessors(P);$.length&&(D=C.node($[0]).order,N(j,I,V,A,D),I=V,A=D)}N(j,I,j.length,D,z.length)}),j}return e.reduce(T,R),E}function l(C,T){if(C.node(T).dummy)return e.find(C.predecessors(T),function(E){return C.node(E).dummy})}function c(C,T,E){if(T>E){var N=T;T=E,E=N}var R=C[T];R||(C[T]=R={}),R[E]=!0}function d(C,T,E){if(T>E){var N=T;T=E,E=N}return e.has(C[T],E)}function f(C,T,E,N){var R={},z={},j={};return e.forEach(T,function(A){e.forEach(A,function(D,I){R[D]=D,z[D]=D,j[D]=I})}),e.forEach(T,function(A){var D=-1;e.forEach(A,function(I){var P=N(I);if(P.length){P=e.sortBy(P,function(O){return j[O]});for(var V=(P.length-1)/2,$=Math.floor(V),L=Math.ceil(V);$<=L;++$){var H=P[$];z[I]===I&&D<j[H]&&!d(E,I,H)&&(z[H]=I,z[I]=R[I]=R[H],D=j[H])}}})}),{root:R,align:z}}function h(C,T,E,N,R){var z={},j=p(C,T,E,R),A=R?"borderLeft":"borderRight";function D(V,$){for(var L=j.nodes(),H=L.pop(),O={};H;)O[H]?V(H):(O[H]=!0,L.push(H),L=L.concat($(H))),H=L.pop()}function I(V){z[V]=j.inEdges(V).reduce(function($,L){return Math.max($,z[L.v]+j.edge(L))},0)}function P(V){var $=j.outEdges(V).reduce(function(H,O){return Math.min(H,z[O.w]-j.edge(O))},Number.POSITIVE_INFINITY),L=C.node(V);$!==Number.POSITIVE_INFINITY&&L.borderType!==A&&(z[V]=Math.max(z[V],$))}return D(I,j.predecessors.bind(j)),D(P,j.successors.bind(j)),e.forEach(N,function(V){z[V]=z[E[V]]}),z}function p(C,T,E,N){var R=new n,z=C.graph(),j=S(z.nodesep,z.edgesep,N);return e.forEach(T,function(A){var D;e.forEach(A,function(I){var P=E[I];if(R.setNode(P),D){var V=E[D],$=R.edge(V,P);R.setEdge(V,P,Math.max(j(C,I,D),$||0))}D=I})}),R}function v(C,T){return e.minBy(e.values(T),function(E){var N=Number.NEGATIVE_INFINITY,R=Number.POSITIVE_INFINITY;return e.forIn(E,function(z,j){var A=w(C,j)/2;N=Math.max(z+A,N),R=Math.min(z-A,R)}),N-R})}function m(C,T){var E=e.values(T),N=e.min(E),R=e.max(E);e.forEach(["u","d"],function(z){e.forEach(["l","r"],function(j){var A=z+j,D=C[A],I;if(D!==T){var P=e.values(D);I=j==="l"?N-e.min(P):R-e.max(P),I&&(C[A]=e.mapValues(D,function(V){return V+I}))}})})}function b(C,T){return e.mapValues(C.ul,function(E,N){if(T)return C[T.toLowerCase()][N];var R=e.sortBy(e.map(C,N));return(R[1]+R[2])/2})}function _(C){var T=a.buildLayerMatrix(C),E=e.merge(i(C,T),o(C,T)),N={},R;e.forEach(["u","d"],function(j){R=j==="u"?T:e.values(T).reverse(),e.forEach(["l","r"],function(A){A==="r"&&(R=e.map(R,function(V){return e.values(V).reverse()}));var D=(j==="u"?C.predecessors:C.successors).bind(C),I=f(C,R,E,D),P=h(C,R,I.root,I.align,A==="r");A==="r"&&(P=e.mapValues(P,function(V){return-V})),N[j+A]=P})});var z=v(C,N);return m(N,z),b(N,C.graph().align)}function S(C,T,E){return function(N,R,z){var j=N.node(R),A=N.node(z),D=0,I;if(D+=j.width/2,e.has(j,"labelpos"))switch(j.labelpos.toLowerCase()){case"l":I=-j.width/2;break;case"r":I=j.width/2;break}if(I&&(D+=E?I:-I),I=0,D+=(j.dummy?T:C)/2,D+=(A.dummy?T:C)/2,D+=A.width/2,e.has(A,"labelpos"))switch(A.labelpos.toLowerCase()){case"l":I=A.width/2;break;case"r":I=-A.width/2;break}return I&&(D+=E?I:-I),I=0,D}}function w(C,T){return C.node(T).width}return jy}var Ny,hN;function a7(){if(hN)return Ny;hN=1;var e=ft(),n=tn(),a=r7().positionX;Ny=i;function i(l){l=n.asNonCompoundGraph(l),o(l),e.forEach(a(l),function(c,d){l.node(d).x=c})}function o(l){var c=n.buildLayerMatrix(l),d=l.graph().ranksep,f=0;e.forEach(c,function(h){var p=e.max(e.map(h,function(v){return l.node(v).height}));e.forEach(h,function(v){l.node(v).y=f+p/2}),f+=p+d})}return Ny}var Ry,pN;function i7(){if(pN)return Ry;pN=1;var e=ft(),n=II(),a=UI(),i=FI(),o=tn().normalizeRanks,l=PI(),c=tn().removeEmptyRanks,d=GI(),f=$I(),h=YI(),p=n7(),v=a7(),m=tn(),b=Bn().Graph;Ry=_;function _(U,Z){var ne=Z&&Z.debugTiming?m.time:m.notime;ne("layout",function(){var le=ne("  buildLayoutGraph",function(){return D(U)});ne("  runLayout",function(){S(le,ne)}),ne("  updateInputGraph",function(){w(U,le)})})}function S(U,Z){Z("    makeSpaceForEdgeLabels",function(){I(U)}),Z("    removeSelfEdges",function(){G(U)}),Z("    acyclic",function(){n.run(U)}),Z("    nestingGraph.run",function(){d.run(U)}),Z("    rank",function(){i(m.asNonCompoundGraph(U))}),Z("    injectEdgeLabelProxies",function(){P(U)}),Z("    removeEmptyRanks",function(){c(U)}),Z("    nestingGraph.cleanup",function(){d.cleanup(U)}),Z("    normalizeRanks",function(){o(U)}),Z("    assignRankMinMax",function(){V(U)}),Z("    removeEdgeLabelProxies",function(){$(U)}),Z("    normalize.run",function(){a.run(U)}),Z("    parentDummyChains",function(){l(U)}),Z("    addBorderSegments",function(){f(U)}),Z("    order",function(){p(U)}),Z("    insertSelfEdges",function(){re(U)}),Z("    adjustCoordinateSystem",function(){h.adjust(U)}),Z("    position",function(){v(U)}),Z("    positionSelfEdges",function(){B(U)}),Z("    removeBorderNodes",function(){J(U)}),Z("    normalize.undo",function(){a.undo(U)}),Z("    fixupEdgeLabelCoords",function(){O(U)}),Z("    undoCoordinateSystem",function(){h.undo(U)}),Z("    translateGraph",function(){L(U)}),Z("    assignNodeIntersects",function(){H(U)}),Z("    reversePoints",function(){F(U)}),Z("    acyclic.undo",function(){n.undo(U)})}function w(U,Z){e.forEach(U.nodes(),function(ne){var le=U.node(ne),K=Z.node(ne);le&&(le.x=K.x,le.y=K.y,Z.children(ne).length&&(le.width=K.width,le.height=K.height))}),e.forEach(U.edges(),function(ne){var le=U.edge(ne),K=Z.edge(ne);le.points=K.points,e.has(K,"x")&&(le.x=K.x,le.y=K.y)}),U.graph().width=Z.graph().width,U.graph().height=Z.graph().height}var C=["nodesep","edgesep","ranksep","marginx","marginy"],T={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},E=["acyclicer","ranker","rankdir","align"],N=["width","height"],R={width:0,height:0},z=["minlen","weight","width","height","labeloffset"],j={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},A=["labelpos"];function D(U){var Z=new b({multigraph:!0,compound:!0}),ne=ae(U.graph());return Z.setGraph(e.merge({},T,Y(ne,C),e.pick(ne,E))),e.forEach(U.nodes(),function(le){var K=ae(U.node(le));Z.setNode(le,e.defaults(Y(K,N),R)),Z.setParent(le,U.parent(le))}),e.forEach(U.edges(),function(le){var K=ae(U.edge(le));Z.setEdge(le,e.merge({},j,Y(K,z),e.pick(K,A)))}),Z}function I(U){var Z=U.graph();Z.ranksep/=2,e.forEach(U.edges(),function(ne){var le=U.edge(ne);le.minlen*=2,le.labelpos.toLowerCase()!=="c"&&(Z.rankdir==="TB"||Z.rankdir==="BT"?le.width+=le.labeloffset:le.height+=le.labeloffset)})}function P(U){e.forEach(U.edges(),function(Z){var ne=U.edge(Z);if(ne.width&&ne.height){var le=U.node(Z.v),K=U.node(Z.w),de={rank:(K.rank-le.rank)/2+le.rank,e:Z};m.addDummyNode(U,"edge-proxy",de,"_ep")}})}function V(U){var Z=0;e.forEach(U.nodes(),function(ne){var le=U.node(ne);le.borderTop&&(le.minRank=U.node(le.borderTop).rank,le.maxRank=U.node(le.borderBottom).rank,Z=e.max(Z,le.maxRank))}),U.graph().maxRank=Z}function $(U){e.forEach(U.nodes(),function(Z){var ne=U.node(Z);ne.dummy==="edge-proxy"&&(U.edge(ne.e).labelRank=ne.rank,U.removeNode(Z))})}function L(U){var Z=Number.POSITIVE_INFINITY,ne=0,le=Number.POSITIVE_INFINITY,K=0,de=U.graph(),ye=de.marginx||0,xe=de.marginy||0;function be(W){var se=W.x,te=W.y,me=W.width,ve=W.height;Z=Math.min(Z,se-me/2),ne=Math.max(ne,se+me/2),le=Math.min(le,te-ve/2),K=Math.max(K,te+ve/2)}e.forEach(U.nodes(),function(W){be(U.node(W))}),e.forEach(U.edges(),function(W){var se=U.edge(W);e.has(se,"x")&&be(se)}),Z-=ye,le-=xe,e.forEach(U.nodes(),function(W){var se=U.node(W);se.x-=Z,se.y-=le}),e.forEach(U.edges(),function(W){var se=U.edge(W);e.forEach(se.points,function(te){te.x-=Z,te.y-=le}),e.has(se,"x")&&(se.x-=Z),e.has(se,"y")&&(se.y-=le)}),de.width=ne-Z+ye,de.height=K-le+xe}function H(U){e.forEach(U.edges(),function(Z){var ne=U.edge(Z),le=U.node(Z.v),K=U.node(Z.w),de,ye;ne.points?(de=ne.points[0],ye=ne.points[ne.points.length-1]):(ne.points=[],de=K,ye=le),ne.points.unshift(m.intersectRect(le,de)),ne.points.push(m.intersectRect(K,ye))})}function O(U){e.forEach(U.edges(),function(Z){var ne=U.edge(Z);if(e.has(ne,"x"))switch((ne.labelpos==="l"||ne.labelpos==="r")&&(ne.width-=ne.labeloffset),ne.labelpos){case"l":ne.x-=ne.width/2+ne.labeloffset;break;case"r":ne.x+=ne.width/2+ne.labeloffset;break}})}function F(U){e.forEach(U.edges(),function(Z){var ne=U.edge(Z);ne.reversed&&ne.points.reverse()})}function J(U){e.forEach(U.nodes(),function(Z){if(U.children(Z).length){var ne=U.node(Z),le=U.node(ne.borderTop),K=U.node(ne.borderBottom),de=U.node(e.last(ne.borderLeft)),ye=U.node(e.last(ne.borderRight));ne.width=Math.abs(ye.x-de.x),ne.height=Math.abs(K.y-le.y),ne.x=de.x+ne.width/2,ne.y=le.y+ne.height/2}}),e.forEach(U.nodes(),function(Z){U.node(Z).dummy==="border"&&U.removeNode(Z)})}function G(U){e.forEach(U.edges(),function(Z){if(Z.v===Z.w){var ne=U.node(Z.v);ne.selfEdges||(ne.selfEdges=[]),ne.selfEdges.push({e:Z,label:U.edge(Z)}),U.removeEdge(Z)}})}function re(U){var Z=m.buildLayerMatrix(U);e.forEach(Z,function(ne){var le=0;e.forEach(ne,function(K,de){var ye=U.node(K);ye.order=de+le,e.forEach(ye.selfEdges,function(xe){m.addDummyNode(U,"selfedge",{width:xe.label.width,height:xe.label.height,rank:ye.rank,order:de+ ++le,e:xe.e,label:xe.label},"_se")}),delete ye.selfEdges})})}function B(U){e.forEach(U.nodes(),function(Z){var ne=U.node(Z);if(ne.dummy==="selfedge"){var le=U.node(ne.e.v),K=le.x+le.width/2,de=le.y,ye=ne.x-K,xe=le.height/2;U.setEdge(ne.e,ne.label),U.removeNode(Z),ne.label.points=[{x:K+2*ye/3,y:de-xe},{x:K+5*ye/6,y:de-xe},{x:K+ye,y:de},{x:K+5*ye/6,y:de+xe},{x:K+2*ye/3,y:de+xe}],ne.label.x=ne.x,ne.label.y=ne.y}})}function Y(U,Z){return e.mapValues(e.pick(U,Z),Number)}function ae(U){var Z={};return e.forEach(U,function(ne,le){Z[le.toLowerCase()]=ne}),Z}return Ry}var My,gN;function o7(){if(gN)return My;gN=1;var e=ft(),n=tn(),a=Bn().Graph;My={debugOrdering:i};function i(o){var l=n.buildLayerMatrix(o),c=new a({compound:!0,multigraph:!0}).setGraph({});return e.forEach(o.nodes(),function(d){c.setNode(d,{label:d}),c.setParent(d,"layer"+o.node(d).rank)}),e.forEach(o.edges(),function(d){c.setEdge(d.v,d.w,{},d.name)}),e.forEach(l,function(d,f){var h="layer"+f;c.setNode(h,{rank:"same"}),e.reduce(d,function(p,v){return c.setEdge(p,v,{style:"invis"}),v})}),c}return My}var Ay,vN;function s7(){return vN||(vN=1,Ay="0.8.5"),Ay}var zy,mN;function l7(){return mN||(mN=1,zy={graphlib:Bn(),layout:i7(),debug:o7(),util:{time:tn().time,notime:tn().notime},version:s7()}),zy}var c7=l7();const yN=Ls(c7),u7=200,d7=80,f7=150,h7=60;function Qn(e){return e.type==="message"?{width:f7,height:h7}:{width:u7,height:d7}}function Dy(e,n,a={}){const{direction:i="TB",center:o}=a;if(e.length===0)return{nodes:[],edges:n,width:0,height:0};let l=0,c=0;e.forEach(w=>{const{width:C,height:T}=Qn(w);l=Math.max(l,C),c=Math.max(c,T)});const d=a.nodeSpacing??l/2+200,f=a.rankSpacing??c/2+200,h=new yN.graphlib.Graph;h.setGraph({rankdir:i,nodesep:d,ranksep:f,marginx:20,marginy:20}),h.setDefaultEdgeLabel(()=>({})),e.forEach(w=>{const{width:C,height:T}=Qn(w);h.setNode(w.id,{width:C,height:T})}),n.forEach(w=>{h.setEdge(w.source,w.target)}),yN.layout(h);const p=h.graph(),v=(p.width||0)+40,m=(p.height||0)+40,b=o?o.x-v/2:0,_=o?o.y-m/2:0;return{nodes:e.map(w=>{const C=h.node(w.id),{width:T,height:E}=Qn(w);return{...w,position:{x:C.x-T/2+b,y:C.y-E/2+_}}}),edges:n,width:v,height:m}}function p7(e,n,a={}){const{center:i}=a;if(e.length===0)return{nodes:[],edges:n,width:0,height:0};let o=0,l=0;e.forEach(S=>{const{width:w,height:C}=Qn(S);o=Math.max(o,w),l=Math.max(l,C)});const c=200,d=Math.max(o,l),h=e.length*(d+c)/(2*Math.PI),p=i?.x??0,v=i?.y??0,m=e.map((S,w)=>{const C=2*Math.PI*w/e.length,{width:T,height:E}=Qn(S);return{...S,position:{x:p+h*Math.cos(C)-T/2,y:v+h*Math.sin(C)-E/2}}}),b=h*2+o,_=h*2+l;return{nodes:m,edges:n,width:b,height:_}}function g7(e,n,a={}){const{center:i}=a;if(e.length===0)return{nodes:[],edges:n,width:0,height:0};const o=Math.ceil(Math.sqrt(e.length)),l=Math.ceil(e.length/o);let c=0,d=0;e.forEach(w=>{const{width:C,height:T}=Qn(w);c=Math.max(c,C),d=Math.max(d,T)});const f=200,h=c+f,p=d+f,v=o*h,m=l*p,b=i?i.x-v/2:0,_=i?i.y-m/2:0;return{nodes:e.map((w,C)=>{const T=C%o,E=Math.floor(C/o),{width:N,height:R}=Qn(w);return{...w,position:{x:b+T*h+(h-N)/2,y:_+E*p+(p-R)/2}}}),edges:n,width:v,height:m}}function v7(e,n,a={}){const{center:i}=a;if(e.length===0)return{nodes:[],edges:n,width:0,height:0};let o=0,l=0;e.forEach(b=>{const{width:_,height:S}=Qn(b);o=Math.max(o,_),l=Math.max(l,S)});const c=200,f=Math.sqrt(e.length)*(o+l+c)*1.5,h=i?.x??0,p=i?.y??0,v=[],m=100;return e.forEach(b=>{const{width:_,height:S}=Qn(b);let w=!1,C=0;for(;!w&&C<m;){const T=h+(Math.random()-.5)*f-_/2,E=p+(Math.random()-.5)*f-S/2;v.some(R=>{const z=Qn(R),j=Math.abs(T-R.position.x),A=Math.abs(E-R.position.y);return j<(_+z.width)/2+c&&A<(S+z.height)/2+c})||(v.push({...b,position:{x:T,y:E}}),w=!0),C++}w||v.push({...b,position:{x:h+(Math.random()-.5)*f-_/2,y:p+(Math.random()-.5)*f-S/2}})}),{nodes:v,edges:n,width:f,height:f}}const bN="flock_dashboard_v1",xN=1,m7=.8,y7=.6,_N=500;function Ke(e){return new Promise((n,a)=>{e.onsuccess=()=>n(e.result),e.onerror=()=>a(e.error)})}class b7{db=null;inMemoryStore=new Map;available=!1;async initialize(){if(typeof indexedDB>"u"){console.warn("[IndexedDB] IndexedDB not available, using in-memory fallback"),this.available=!1,this.initializeInMemoryStores();return}try{const n=indexedDB.open(bN,xN);this.db=await new Promise(async(a,i)=>{if(n.onerror=()=>{i(n.error)},n.onsuccess=()=>{a(n.result)},n.onupgradeneeded=o=>{const l=o.target.result,c=[],d=(f,h)=>{Array.isArray(f.indexNames)&&!f.indexNames.includes(h)&&f.indexNames.push(h)};if(!l.objectStoreNames.contains("agents")){const f=l.createObjectStore("agents",{keyPath:"agent_id"});f.createIndex("last_active","last_active",{unique:!1}),d(f,"last_active"),f.createIndex("tenant_id","tenant_id",{unique:!1}),d(f,"tenant_id"),c.push("agents")}if(!l.objectStoreNames.contains("artifacts")){const f=l.createObjectStore("artifacts",{keyPath:"artifact_id"});f.createIndex("correlation_id","correlation_id",{unique:!1}),d(f,"correlation_id"),f.createIndex("published_at","published_at",{unique:!1}),d(f,"published_at"),f.createIndex("artifact_type","artifact_type",{unique:!1}),d(f,"artifact_type"),f.createIndex("produced_by","produced_by",{unique:!1}),d(f,"produced_by"),c.push("artifacts")}if(!l.objectStoreNames.contains("runs")){const f=l.createObjectStore("runs",{keyPath:"run_id"});f.createIndex("agent_name","agent_name",{unique:!1}),d(f,"agent_name"),f.createIndex("correlation_id","correlation_id",{unique:!1}),d(f,"correlation_id"),f.createIndex("started_at","started_at",{unique:!1}),d(f,"started_at"),c.push("runs")}if(l.objectStoreNames.contains("layout_agent_view")||(l.createObjectStore("layout_agent_view",{keyPath:"node_id"}),c.push("layout_agent_view")),l.objectStoreNames.contains("layout_blackboard_view")||(l.createObjectStore("layout_blackboard_view",{keyPath:"node_id"}),c.push("layout_blackboard_view")),!l.objectStoreNames.contains("sessions")){const f=l.createObjectStore("sessions",{keyPath:"session_id"});f.createIndex("created_at","created_at",{unique:!1}),d(f,"created_at"),c.push("sessions")}l.objectStoreNames.contains("module_instances")||(l.createObjectStore("module_instances",{keyPath:"instance_id"}),c.push("module_instances")),l.objectStoreNames.contains("filters")||(l.createObjectStore("filters",{keyPath:"filter_id"}),c.push("filters"))},typeof globalThis.vi<"u")try{globalThis.vi.runAllTimers()}catch{}}),this.available=!0,console.log("[IndexedDB] Database initialized:",bN,"version",xN)}catch(n){console.error("[IndexedDB] Initialization failed, using in-memory fallback:",n),this.available=!1,this.initializeInMemoryStores()}}initializeInMemoryStores(){["agents","artifacts","runs","layout_agent_view","layout_blackboard_view","module_instances","sessions","filters"].forEach(a=>{this.inMemoryStore.set(a,new Map)})}isAvailable(){return this.available}async saveAgent(n){if(!this.db){this.inMemoryStore.get("agents")?.set(n.agent_id,n);return}try{const i=this.db.transaction("agents","readwrite").objectStore("agents");await Ke(i.put(n)),await this.checkAndEvictByRecordLimit("agents","last_active")}catch(a){console.error("[IndexedDB] Failed to save agent:",a)}}async getAgent(n){if(!this.db)return this.inMemoryStore.get("agents")?.get(n);try{const i=this.db.transaction("agents","readonly").objectStore("agents");return await Ke(i.get(n))}catch(a){console.error("[IndexedDB] Failed to get agent:",a);return}}async deleteAgent(n){if(!this.db){this.inMemoryStore.get("agents")?.delete(n);return}try{const i=this.db.transaction("agents","readwrite").objectStore("agents");await Ke(i.delete(n))}catch(a){console.error("[IndexedDB] Failed to delete agent:",a)}}async saveArtifact(n){if(!this.db){this.inMemoryStore.get("artifacts")?.set(n.artifact_id,n);return}try{const i=this.db.transaction("artifacts","readwrite").objectStore("artifacts");await Ke(i.put(n)),await this.checkAndEvictByRecordLimit("artifacts","published_at")}catch(a){console.error("[IndexedDB] Failed to save artifact:",a)}}async getArtifact(n){if(!this.db)return this.inMemoryStore.get("artifacts")?.get(n);try{const i=this.db.transaction("artifacts","readonly").objectStore("artifacts");return await Ke(i.get(n))}catch(a){console.error("[IndexedDB] Failed to get artifact:",a);return}}async getArtifactsByCorrelationId(n){if(!this.db){const a=this.inMemoryStore.get("artifacts");return a?Array.from(a.values()).filter(i=>i.correlation_id===n):[]}try{const o=this.db.transaction("artifacts","readonly").objectStore("artifacts").index("correlation_id");return await Ke(o.getAll(n))}catch(a){return console.error("[IndexedDB] Failed to query artifacts by correlation_id:",a),[]}}async getArtifactsByTimeRange(n,a){if(!this.db){const i=this.inMemoryStore.get("artifacts");return i?Array.from(i.values()).filter(o=>o.published_at>=n&&o.published_at<=a):[]}try{const i=IDBKeyRange.bound(n,a),c=this.db.transaction("artifacts","readonly").objectStore("artifacts").index("published_at");return await Ke(c.getAll(i))}catch(i){return console.error("[IndexedDB] Failed to query artifacts by time range:",i),[]}}async saveFilterPreset(n){if(!this.db){this.inMemoryStore.get("filters")?.set(n.filter_id,n);return}try{const i=this.db.transaction("filters","readwrite").objectStore("filters");await Ke(i.put(n))}catch(a){console.error("[IndexedDB] Failed to save filter preset:",a)}}async getAllFilterPresets(){if(!this.db){const n=this.inMemoryStore.get("filters");return n?Array.from(n.values()).sort((a,i)=>i.created_at-a.created_at):[]}try{const a=this.db.transaction("filters","readonly").objectStore("filters");return(await Ke(a.getAll())).sort((o,l)=>l.created_at-o.created_at)}catch(n){return console.error("[IndexedDB] Failed to load filter presets:",n),[]}}async deleteFilterPreset(n){if(!this.db){this.inMemoryStore.get("filters")?.delete(n);return}try{const i=this.db.transaction("filters","readwrite").objectStore("filters");await Ke(i.delete(n))}catch(a){console.error("[IndexedDB] Failed to delete filter preset:",a)}}async saveRun(n){if(!this.db){this.inMemoryStore.get("runs")?.set(n.run_id,n);return}try{const i=this.db.transaction("runs","readwrite").objectStore("runs");await Ke(i.put(n)),await this.checkAndEvictByRecordLimit("runs","started_at")}catch(a){console.error("[IndexedDB] Failed to save run:",a)}}async getRun(n){if(!this.db)return this.inMemoryStore.get("runs")?.get(n);try{const i=this.db.transaction("runs","readonly").objectStore("runs");return await Ke(i.get(n))}catch(a){console.error("[IndexedDB] Failed to get run:",a);return}}async saveAgentViewLayout(n){if(!this.db){this.inMemoryStore.get("layout_agent_view")?.set(n.node_id,n);return}try{const i=this.db.transaction("layout_agent_view","readwrite").objectStore("layout_agent_view");await Ke(i.put(n))}catch(a){console.error("[IndexedDB] Failed to save agent view layout:",a)}}async getAgentViewLayout(n){if(!this.db)return this.inMemoryStore.get("layout_agent_view")?.get(n);try{const i=this.db.transaction("layout_agent_view","readonly").objectStore("layout_agent_view");return await Ke(i.get(n))}catch(a){console.error("[IndexedDB] Failed to get agent view layout:",a);return}}async getAllAgentViewLayouts(){if(!this.db){const n=this.inMemoryStore.get("layout_agent_view");return n?Array.from(n.values()):[]}try{const a=this.db.transaction("layout_agent_view","readonly").objectStore("layout_agent_view");return await Ke(a.getAll())}catch(n){return console.error("[IndexedDB] Failed to get all agent view layouts:",n),[]}}async saveBlackboardViewLayout(n){if(!this.db){this.inMemoryStore.get("layout_blackboard_view")?.set(n.node_id,n);return}try{const i=this.db.transaction("layout_blackboard_view","readwrite").objectStore("layout_blackboard_view");await Ke(i.put(n))}catch(a){console.error("[IndexedDB] Failed to save blackboard view layout:",a)}}async getBlackboardViewLayout(n){if(!this.db)return this.inMemoryStore.get("layout_blackboard_view")?.get(n);try{const i=this.db.transaction("layout_blackboard_view","readonly").objectStore("layout_blackboard_view");return await Ke(i.get(n))}catch(a){console.error("[IndexedDB] Failed to get blackboard view layout:",a);return}}async getAllBlackboardViewLayouts(){if(!this.db){const n=this.inMemoryStore.get("layout_blackboard_view");return n?Array.from(n.values()):[]}try{const a=this.db.transaction("layout_blackboard_view","readonly").objectStore("layout_blackboard_view");return await Ke(a.getAll())}catch(n){return console.error("[IndexedDB] Failed to get all blackboard view layouts:",n),[]}}async saveModuleInstance(n){if(!this.db){this.inMemoryStore.get("module_instances")?.set(n.instance_id,n);return}try{const i=this.db.transaction("module_instances","readwrite").objectStore("module_instances");await Ke(i.put(n))}catch(a){console.error("[IndexedDB] Failed to save module instance:",a)}}async getModuleInstance(n){if(!this.db)return this.inMemoryStore.get("module_instances")?.get(n);try{const i=this.db.transaction("module_instances","readonly").objectStore("module_instances");return await Ke(i.get(n))}catch(a){console.error("[IndexedDB] Failed to get module instance:",a);return}}async getAllModuleInstances(){if(!this.db){const n=this.inMemoryStore.get("module_instances");return n?Array.from(n.values()):[]}try{const a=this.db.transaction("module_instances","readonly").objectStore("module_instances");return await Ke(a.getAll())}catch(n){return console.error("[IndexedDB] Failed to get all module instances:",n),[]}}async deleteModuleInstance(n){if(!this.db){this.inMemoryStore.get("module_instances")?.delete(n);return}try{const i=this.db.transaction("module_instances","readwrite").objectStore("module_instances");await Ke(i.delete(n))}catch(a){console.error("[IndexedDB] Failed to delete module instance:",a)}}async saveSession(n){if(!this.db){this.inMemoryStore.get("sessions")?.set(n.session_id,n);return}try{const i=this.db.transaction("sessions","readwrite").objectStore("sessions");await Ke(i.put(n))}catch(a){console.error("[IndexedDB] Failed to save session:",a)}}async getAllSessions(){if(!this.db){const n=this.inMemoryStore.get("sessions");return n?Array.from(n.values()):[]}try{const a=this.db.transaction("sessions","readonly").objectStore("sessions");return await Ke(a.getAll())}catch(n){return console.error("[IndexedDB] Failed to get all sessions:",n),[]}}async checkShouldEvict(){if(!this.db)return!1;try{if(!navigator.storage?.estimate)return!1;const n=await navigator.storage.estimate(),a=n.usage||0,i=n.quota||0;if(i===0)return!1;const o=a/i;return o>m7?(console.warn(`[IndexedDB] Storage quota exceeded threshold: ${(o*100).toFixed(1)}% (${a}/${i} bytes)`),!0):!1}catch(n){return console.error("[IndexedDB] Failed to check storage quota:",n),!1}}async evictOldSessions(){if(this.db)try{const i=this.db.transaction("sessions","readwrite").objectStore("sessions").index("created_at"),o=await Ke(i.getAll());if(o.length===0)return;for(const l of o){const c=await navigator.storage.estimate(),d=c.usage||0,f=c.quota||0;if(f===0||d/f<=y7)break;const v=this.db.transaction("sessions","readwrite").objectStore("sessions");await Ke(v.delete(l.session_id)),console.log(`[IndexedDB] Evicted session: ${l.session_id}`)}}catch(n){console.error("[IndexedDB] Failed to evict old sessions:",n)}}async checkAndEvictByRecordLimit(n,a){if(this.db)try{const o=this.db.transaction(n,"readonly").objectStore(n),l=await Ke(o.count());if(l>_N){const f=this.db.transaction(n,"readonly").objectStore(n).index(a),h=await Ke(f.getAllKeys()),p=l-_N,m=this.db.transaction(n,"readwrite").objectStore(n);for(let b=0;b<p&&b<h.length;b++)await Ke(m.delete(h[b]))}}catch(i){console.error(`[IndexedDB] Failed to evict by record limit for ${n}:`,i)}}}const Cn=new b7;function x7(e,n){let a=null;return(...i)=>{a&&clearTimeout(a),a=setTimeout(()=>{e(...i),a=null},n)}}function _7(){const e=ut(l=>l.mode),n=Me(l=>l.updateNodePosition),a=q.useRef(null);a.current||(a.current=x7(async(l,c,d)=>{try{console.log(`[usePersistence] Saving position for ${l} in ${c} view:`,d);const f={node_id:l,x:d.x,y:d.y,last_updated:new Date().toISOString()};c==="agent"?(await Cn.saveAgentViewLayout(f),console.log("[usePersistence] ✓ Saved to agent view layout")):(await Cn.saveBlackboardViewLayout(f),console.log("[usePersistence] ✓ Saved to blackboard view layout"))}catch(f){console.error(`[usePersistence] Failed to save node position for ${l}:`,f)}},300));const i=q.useCallback(async l=>{try{let c=[];l==="agent"?c=await Cn.getAllAgentViewLayouts():c=await Cn.getAllBlackboardViewLayouts(),c.forEach(d=>{n(d.node_id,{x:d.x,y:d.y})}),console.log(`[usePersistence] Loaded ${c.length} node positions for ${l} view`)}catch(c){console.error(`[usePersistence] Failed to load node positions for ${l} view:`,c)}},[n]);return q.useEffect(()=>{i(e)},[e,i]),{saveNodePosition:q.useCallback((l,c)=>{a.current&&a.current(l,e,c)},[e])}}const Bt=[];for(let e=0;e<256;++e)Bt.push((e+256).toString(16).slice(1));function S7(e,n=0){return(Bt[e[n+0]]+Bt[e[n+1]]+Bt[e[n+2]]+Bt[e[n+3]]+"-"+Bt[e[n+4]]+Bt[e[n+5]]+"-"+Bt[e[n+6]]+Bt[e[n+7]]+"-"+Bt[e[n+8]]+Bt[e[n+9]]+"-"+Bt[e[n+10]]+Bt[e[n+11]]+Bt[e[n+12]]+Bt[e[n+13]]+Bt[e[n+14]]+Bt[e[n+15]]).toLowerCase()}let ky;const w7=new Uint8Array(16);function E7(){if(!ky){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");ky=crypto.getRandomValues.bind(crypto)}return ky(w7)}const C7=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),SN={randomUUID:C7};function T7(e,n,a){e=e||{};const i=e.random??e.rng?.()??E7();if(i.length<16)throw new Error("Random bytes length must be >= 16");return i[6]=i[6]&15|64,i[8]=i[8]&63|128,S7(i)}function j7(e,n,a){return SN.randomUUID&&!e?SN.randomUUID():T7(e)}const N7=()=>{const{fitView:e,getIntersectingNodes:n,screenToFlowPosition:a}=fu(),i=ut(K=>K.mode),o=ut(K=>K.openDetailWindow),l=Me(K=>K.nodes),c=Me(K=>K.edges),d=Me(K=>K.agents),f=Me(K=>K.messages),h=Me(K=>K.runs),p=Me(K=>K.generateAgentViewGraph),v=Me(K=>K.generateBlackboardViewGraph),m=Me(K=>K.updateNodePosition),b=jr(K=>K.addModule),_=Me(K=>K.applyFilters),S=Te(K=>K.correlationId),w=Te(K=>K.timeRange),C=Te(K=>K.selectedArtifactTypes),T=Te(K=>K.selectedProducers),E=Te(K=>K.selectedTags),N=Te(K=>K.selectedVisibility),R=_e(K=>K.graph.edgeType),z=_e(K=>K.graph.edgeStrokeWidth),j=_e(K=>K.graph.edgeAnimation),[A,D]=q.useState(null),[I,P]=q.useState(!1),[V,$]=q.useState(!1),{saveNodePosition:L}=_7(),H=q.useMemo(()=>({agent:RR,message:KM}),[]),O=q.useMemo(()=>({message_flow:VL,transformation:FL}),[]);q.useEffect(()=>{i==="agent"?p():v()},[i,d,f,h,p,v]),q.useEffect(()=>{i==="agent"?p():v()},[R,z,j,i,p,v]),q.useEffect(()=>{_()},[_,S,w.preset,w.start,w.end,C.join("|"),T.join("|"),E.join("|"),N.join("|")]);const F=q.useCallback(K=>{const de=Z2(K,l);Me.setState({nodes:de}),K.forEach(ye=>{ye.type==="position"&&ye.position&&m(ye.id,ye.position)})},[l,m]),J=q.useCallback(K=>{const de=Q2(K,c);Me.setState({edges:de})},[c]),G=q.useCallback(K=>{const de=document.querySelector(".react-flow__pane");let ye={x:0,y:0};if(de){const be=de.getBoundingClientRect();ye=a({x:be.left+be.width/2,y:be.top+be.height/2})}let xe;switch(K){case"hierarchical-vertical":xe=Dy(l,c,{direction:"TB",center:ye});break;case"hierarchical-horizontal":xe=Dy(l,c,{direction:"LR",center:ye});break;case"circular":xe=p7(l,c,{center:ye});break;case"grid":xe=g7(l,c,{center:ye});break;case"random":xe=v7(l,c,{center:ye});break;default:xe=Dy(l,c,{direction:"TB",center:ye})}xe.nodes.forEach(be=>{m(be.id,be.position)}),Me.setState({nodes:xe.nodes}),D(null),P(!1),$(!1)},[l,c,m,a]),re=q.useCallback(()=>{e({padding:.1,duration:300}),D(null),P(!1)},[e]),B=q.useCallback((K,de,ye)=>{const xe={id:j7(),type:K,position:{x:de,y:ye},size:{width:600,height:400},visible:!0};b(xe),D(null),P(!1)},[b]),Y=q.useCallback(K=>{K.preventDefault(),D({x:K.clientX,y:K.clientY}),P(!1)},[]),ae=q.useCallback(()=>{D(null),P(!1),$(!1)},[]),U=q.useCallback((K,de)=>{n(de).length>0&&Me.setState(xe=>({nodes:xe.nodes.map(be=>be.id===de.id?{...be,position:be.position}:be)}))},[n]),Z=q.useCallback((K,de)=>{L(de.id,de.position)},[L]),ne=q.useCallback((K,de)=>{o(de.id)},[o]),le=q.useMemo(()=>({type:R,animated:j,style:{stroke:"var(--color-edge-default)",strokeWidth:z}}),[R,j,z]);return g.jsxs("div",{style:{width:"100%",height:"100%",position:"relative"},children:[g.jsxs(eB,{nodes:l,edges:c,onNodesChange:F,onEdgesChange:J,onNodeDrag:U,onNodeDragStop:Z,onNodeDoubleClick:ne,nodeTypes:H,edgeTypes:O,defaultEdgeOptions:le,onPaneContextMenu:Y,onPaneClick:ae,style:{backgroundColor:"var(--color-bg-elevated)"},children:[g.jsx(oB,{color:"var(--color-border-subtle)",gap:16,size:1,style:{backgroundColor:"var(--color-bg-elevated)"}}),g.jsx(hB,{style:{backgroundColor:"var(--color-bg-surface)",border:"1px solid var(--color-border-default)",borderRadius:"var(--radius-lg)",overflow:"hidden",boxShadow:"var(--shadow-lg)"},showZoom:!0,showFitView:!0,showInteractive:!0}),g.jsx(PL,{})]}),A&&g.jsxs("div",{style:{position:"fixed",top:A.y,left:A.x,background:"var(--color-bg-surface)",border:"var(--border-default)",borderRadius:"var(--radius-md)",boxShadow:"var(--shadow-lg)",zIndex:1e3,minWidth:180},children:[g.jsxs("div",{style:{position:"relative"},children:[g.jsxs("button",{onMouseEnter:()=>$(!0),onMouseLeave:K=>{const de=K.relatedTarget;(!de||!de.closest(".layout-submenu"))&&$(!1)},style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",padding:"var(--spacing-2) var(--spacing-4)",border:"none",background:V?"var(--color-bg-overlay)":"transparent",cursor:"pointer",textAlign:"left",fontSize:"var(--font-size-body-sm)",color:"var(--color-text-primary)",transition:"var(--transition-colors)"},children:[g.jsx("span",{children:"Auto Layout"}),g.jsx("span",{style:{marginLeft:"var(--spacing-2)"},children:"▶"})]}),V&&g.jsxs("div",{className:"layout-submenu",onMouseEnter:()=>$(!0),onMouseLeave:()=>$(!1),style:{position:"absolute",top:0,left:"100%",background:"var(--color-bg-surface)",border:"var(--border-default)",borderRadius:"var(--radius-md)",boxShadow:"var(--shadow-lg)",zIndex:1001,minWidth:180},children:[g.jsx("button",{onClick:()=>G("hierarchical-vertical"),style:{display:"block",width:"100%",padding:"var(--spacing-2) var(--spacing-4)",border:"none",background:"transparent",cursor:"pointer",textAlign:"left",fontSize:"var(--font-size-body-sm)",color:"var(--color-text-primary)",transition:"var(--transition-colors)"},onMouseEnter:K=>{K.currentTarget.style.background="var(--color-bg-overlay)"},onMouseLeave:K=>{K.currentTarget.style.background="transparent"},children:"Hierarchical (Vertical)"}),g.jsx("button",{onClick:()=>G("hierarchical-horizontal"),style:{display:"block",width:"100%",padding:"var(--spacing-2) var(--spacing-4)",border:"none",background:"transparent",cursor:"pointer",textAlign:"left",fontSize:"var(--font-size-body-sm)",color:"var(--color-text-primary)",transition:"var(--transition-colors)"},onMouseEnter:K=>{K.currentTarget.style.background="var(--color-bg-overlay)"},onMouseLeave:K=>{K.currentTarget.style.background="transparent"},children:"Hierarchical (Horizontal)"}),g.jsx("button",{onClick:()=>G("circular"),style:{display:"block",width:"100%",padding:"var(--spacing-2) var(--spacing-4)",border:"none",background:"transparent",cursor:"pointer",textAlign:"left",fontSize:"var(--font-size-body-sm)",color:"var(--color-text-primary)",transition:"var(--transition-colors)"},onMouseEnter:K=>{K.currentTarget.style.background="var(--color-bg-overlay)"},onMouseLeave:K=>{K.currentTarget.style.background="transparent"},children:"Circular"}),g.jsx("button",{onClick:()=>G("grid"),style:{display:"block",width:"100%",padding:"var(--spacing-2) var(--spacing-4)",border:"none",background:"transparent",cursor:"pointer",textAlign:"left",fontSize:"var(--font-size-body-sm)",color:"var(--color-text-primary)",transition:"var(--transition-colors)"},onMouseEnter:K=>{K.currentTarget.style.background="var(--color-bg-overlay)"},onMouseLeave:K=>{K.currentTarget.style.background="transparent"},children:"Grid"}),g.jsx("button",{onClick:()=>G("random"),style:{display:"block",width:"100%",padding:"var(--spacing-2) var(--spacing-4)",border:"none",background:"transparent",cursor:"pointer",textAlign:"left",fontSize:"var(--font-size-body-sm)",color:"var(--color-text-primary)",transition:"var(--transition-colors)"},onMouseEnter:K=>{K.currentTarget.style.background="var(--color-bg-overlay)"},onMouseLeave:K=>{K.currentTarget.style.background="transparent"},children:"Random"})]})]}),g.jsx("button",{onClick:re,style:{display:"block",width:"100%",padding:"var(--spacing-2) var(--spacing-4)",border:"none",background:"transparent",cursor:"pointer",textAlign:"left",fontSize:"var(--font-size-body-sm)",color:"var(--color-text-primary)",transition:"var(--transition-colors)"},onMouseEnter:K=>{K.currentTarget.style.background="var(--color-bg-overlay)"},onMouseLeave:K=>{K.currentTarget.style.background="transparent"},children:"Auto Zoom"}),g.jsxs("div",{style:{position:"relative"},children:[g.jsxs("button",{onMouseEnter:()=>P(!0),onMouseLeave:K=>{const de=K.relatedTarget;(!de||!de.closest(".module-submenu"))&&P(!1)},style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",padding:"var(--spacing-2) var(--spacing-4)",border:"none",background:I?"var(--color-bg-overlay)":"transparent",cursor:"pointer",textAlign:"left",fontSize:"var(--font-size-body-sm)",color:"var(--color-text-primary)",transition:"var(--transition-colors)"},children:[g.jsx("span",{children:"Add Module"}),g.jsx("span",{style:{marginLeft:"var(--spacing-2)"},children:"▶"})]}),I&&g.jsx("div",{className:"module-submenu",onMouseEnter:()=>P(!0),onMouseLeave:()=>P(!1),style:{position:"absolute",top:0,left:"100%",background:"var(--color-bg-surface)",border:"var(--border-default)",borderRadius:"var(--radius-md)",boxShadow:"var(--shadow-lg)",zIndex:1001,minWidth:160},children:Va.getAll().map(K=>g.jsxs("button",{onClick:()=>B(K.id,A.x,A.y),style:{display:"flex",alignItems:"center",gap:"var(--gap-sm)",width:"100%",padding:"var(--spacing-2) var(--spacing-4)",border:"none",background:"transparent",cursor:"pointer",textAlign:"left",fontSize:"var(--font-size-body-sm)",color:"var(--color-text-primary)",transition:"var(--transition-colors)"},onMouseEnter:de=>{de.currentTarget.style.background="var(--color-bg-overlay)"},onMouseLeave:de=>{de.currentTarget.style.background="transparent"},children:[K.icon&&g.jsx("span",{children:K.icon}),g.jsx("span",{children:K.name})]},K.id))})]})]})]})};var gs={exports:{}},Oy={},qy={exports:{}},By,wN;function R7(){if(wN)return By;wN=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return By=e,By}var Ly,EN;function M7(){if(EN)return Ly;EN=1;var e=R7();function n(){}function a(){}return a.resetWarningCache=n,Ly=function(){function i(c,d,f,h,p,v){if(v!==e){var m=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw m.name="Invariant Violation",m}}i.isRequired=i;function o(){return i}var l={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:o,element:i,elementType:i,instanceOf:o,node:i,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:a,resetWarningCache:n};return l.PropTypes=l,l},Ly}var CN;function KA(){return CN||(CN=1,qy.exports=M7()()),qy.exports}function ZA(e){var n,a,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e))for(n=0;n<e.length;n++)e[n]&&(a=ZA(e[n]))&&(i&&(i+=" "),i+=a);else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function TN(){for(var e,n,a=0,i="";a<arguments.length;)(e=arguments[a++])&&(n=ZA(e))&&(i&&(i+=" "),i+=n);return i}const A7=Object.freeze(Object.defineProperty({__proto__:null,clsx:TN,default:TN},Symbol.toStringTag,{value:"Module"})),z7=g3(A7);var bt={},ca={},jN;function Du(){if(jN)return ca;jN=1,Object.defineProperty(ca,"__esModule",{value:!0}),ca.dontSetMe=o,ca.findInArray=e,ca.int=i,ca.isFunction=n,ca.isNum=a;function e(l,c){for(let d=0,f=l.length;d<f;d++)if(c.apply(c,[l[d],d,l]))return l[d]}function n(l){return typeof l=="function"||Object.prototype.toString.call(l)==="[object Function]"}function a(l){return typeof l=="number"&&!isNaN(l)}function i(l){return parseInt(l,10)}function o(l,c,d){if(l[c])return new Error("Invalid prop ".concat(c," passed to ").concat(d," - do not set this, set it on the child."))}return ca}var ua={},NN;function D7(){if(NN)return ua;NN=1,Object.defineProperty(ua,"__esModule",{value:!0}),ua.browserPrefixToKey=a,ua.browserPrefixToStyle=i,ua.default=void 0,ua.getPrefix=n;const e=["Moz","Webkit","O","ms"];function n(){var l;let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const d=(l=window.document)===null||l===void 0||(l=l.documentElement)===null||l===void 0?void 0:l.style;if(!d||c in d)return"";for(let f=0;f<e.length;f++)if(a(c,e[f])in d)return e[f];return""}function a(l,c){return c?"".concat(c).concat(o(l)):l}function i(l,c){return c?"-".concat(c.toLowerCase(),"-").concat(l):l}function o(l){let c="",d=!0;for(let f=0;f<l.length;f++)d?(c+=l[f].toUpperCase(),d=!1):l[f]==="-"?d=!0:c+=l[f];return c}return ua.default=n(),ua}var RN;function Zb(){if(RN)return bt;RN=1,Object.defineProperty(bt,"__esModule",{value:!0}),bt.addClassName=R,bt.addEvent=d,bt.addUserSelectStyles=E,bt.createCSSTransform=_,bt.createSVGTransform=S,bt.getTouch=C,bt.getTouchIdentifier=T,bt.getTranslation=w,bt.innerHeight=v,bt.innerWidth=m,bt.matchesSelector=l,bt.matchesSelectorAndParentsTo=c,bt.offsetXYFromParent=b,bt.outerHeight=h,bt.outerWidth=p,bt.removeClassName=z,bt.removeEvent=f,bt.removeUserSelectStyles=N;var e=Du(),n=i(D7());function a(j){if(typeof WeakMap!="function")return null;var A=new WeakMap,D=new WeakMap;return(a=function(I){return I?D:A})(j)}function i(j,A){if(j&&j.__esModule)return j;if(j===null||typeof j!="object"&&typeof j!="function")return{default:j};var D=a(A);if(D&&D.has(j))return D.get(j);var I={},P=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var V in j)if(V!=="default"&&Object.prototype.hasOwnProperty.call(j,V)){var $=P?Object.getOwnPropertyDescriptor(j,V):null;$&&($.get||$.set)?Object.defineProperty(I,V,$):I[V]=j[V]}return I.default=j,D&&D.set(j,I),I}let o="";function l(j,A){return o||(o=(0,e.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(D){return(0,e.isFunction)(j[D])})),(0,e.isFunction)(j[o])?j[o](A):!1}function c(j,A,D){let I=j;do{if(l(I,A))return!0;if(I===D)return!1;I=I.parentNode}while(I);return!1}function d(j,A,D,I){if(!j)return;const P={capture:!0,...I};j.addEventListener?j.addEventListener(A,D,P):j.attachEvent?j.attachEvent("on"+A,D):j["on"+A]=D}function f(j,A,D,I){if(!j)return;const P={capture:!0,...I};j.removeEventListener?j.removeEventListener(A,D,P):j.detachEvent?j.detachEvent("on"+A,D):j["on"+A]=null}function h(j){let A=j.clientHeight;const D=j.ownerDocument.defaultView.getComputedStyle(j);return A+=(0,e.int)(D.borderTopWidth),A+=(0,e.int)(D.borderBottomWidth),A}function p(j){let A=j.clientWidth;const D=j.ownerDocument.defaultView.getComputedStyle(j);return A+=(0,e.int)(D.borderLeftWidth),A+=(0,e.int)(D.borderRightWidth),A}function v(j){let A=j.clientHeight;const D=j.ownerDocument.defaultView.getComputedStyle(j);return A-=(0,e.int)(D.paddingTop),A-=(0,e.int)(D.paddingBottom),A}function m(j){let A=j.clientWidth;const D=j.ownerDocument.defaultView.getComputedStyle(j);return A-=(0,e.int)(D.paddingLeft),A-=(0,e.int)(D.paddingRight),A}function b(j,A,D){const P=A===A.ownerDocument.body?{left:0,top:0}:A.getBoundingClientRect(),V=(j.clientX+A.scrollLeft-P.left)/D,$=(j.clientY+A.scrollTop-P.top)/D;return{x:V,y:$}}function _(j,A){const D=w(j,A,"px");return{[(0,n.browserPrefixToKey)("transform",n.default)]:D}}function S(j,A){return w(j,A,"")}function w(j,A,D){let{x:I,y:P}=j,V="translate(".concat(I).concat(D,",").concat(P).concat(D,")");if(A){const $="".concat(typeof A.x=="string"?A.x:A.x+D),L="".concat(typeof A.y=="string"?A.y:A.y+D);V="translate(".concat($,", ").concat(L,")")+V}return V}function C(j,A){return j.targetTouches&&(0,e.findInArray)(j.targetTouches,D=>A===D.identifier)||j.changedTouches&&(0,e.findInArray)(j.changedTouches,D=>A===D.identifier)}function T(j){if(j.targetTouches&&j.targetTouches[0])return j.targetTouches[0].identifier;if(j.changedTouches&&j.changedTouches[0])return j.changedTouches[0].identifier}function E(j){if(!j)return;let A=j.getElementById("react-draggable-style-el");A||(A=j.createElement("style"),A.type="text/css",A.id="react-draggable-style-el",A.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
`,A.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
`,j.getElementsByTagName("head")[0].appendChild(A)),j.body&&R(j.body,"react-draggable-transparent-selection")}function N(j){if(j)try{if(j.body&&z(j.body,"react-draggable-transparent-selection"),j.selection)j.selection.empty();else{const A=(j.defaultView||window).getSelection();A&&A.type!=="Caret"&&A.removeAllRanges()}}catch{}}function R(j,A){j.classList?j.classList.add(A):j.className.match(new RegExp("(?:^|\\s)".concat(A,"(?!\\S)")))||(j.className+=" ".concat(A))}function z(j,A){j.classList?j.classList.remove(A):j.className=j.className.replace(new RegExp("(?:^|\\s)".concat(A,"(?!\\S)"),"g"),"")}return bt}var Yn={},MN;function QA(){if(MN)return Yn;MN=1,Object.defineProperty(Yn,"__esModule",{value:!0}),Yn.canDragX=o,Yn.canDragY=l,Yn.createCoreData=d,Yn.createDraggableData=f,Yn.getBoundPosition=a,Yn.getControlPosition=c,Yn.snapToGrid=i;var e=Du(),n=Zb();function a(v,m,b){if(!v.props.bounds)return[m,b];let{bounds:_}=v.props;_=typeof _=="string"?_:h(_);const S=p(v);if(typeof _=="string"){const{ownerDocument:w}=S,C=w.defaultView;let T;if(_==="parent"?T=S.parentNode:T=w.querySelector(_),!(T instanceof C.HTMLElement))throw new Error('Bounds selector "'+_+'" could not find an element.');const E=T,N=C.getComputedStyle(S),R=C.getComputedStyle(E);_={left:-S.offsetLeft+(0,e.int)(R.paddingLeft)+(0,e.int)(N.marginLeft),top:-S.offsetTop+(0,e.int)(R.paddingTop)+(0,e.int)(N.marginTop),right:(0,n.innerWidth)(E)-(0,n.outerWidth)(S)-S.offsetLeft+(0,e.int)(R.paddingRight)-(0,e.int)(N.marginRight),bottom:(0,n.innerHeight)(E)-(0,n.outerHeight)(S)-S.offsetTop+(0,e.int)(R.paddingBottom)-(0,e.int)(N.marginBottom)}}return(0,e.isNum)(_.right)&&(m=Math.min(m,_.right)),(0,e.isNum)(_.bottom)&&(b=Math.min(b,_.bottom)),(0,e.isNum)(_.left)&&(m=Math.max(m,_.left)),(0,e.isNum)(_.top)&&(b=Math.max(b,_.top)),[m,b]}function i(v,m,b){const _=Math.round(m/v[0])*v[0],S=Math.round(b/v[1])*v[1];return[_,S]}function o(v){return v.props.axis==="both"||v.props.axis==="x"}function l(v){return v.props.axis==="both"||v.props.axis==="y"}function c(v,m,b){const _=typeof m=="number"?(0,n.getTouch)(v,m):null;if(typeof m=="number"&&!_)return null;const S=p(b),w=b.props.offsetParent||S.offsetParent||S.ownerDocument.body;return(0,n.offsetXYFromParent)(_||v,w,b.props.scale)}function d(v,m,b){const _=!(0,e.isNum)(v.lastX),S=p(v);return _?{node:S,deltaX:0,deltaY:0,lastX:m,lastY:b,x:m,y:b}:{node:S,deltaX:m-v.lastX,deltaY:b-v.lastY,lastX:v.lastX,lastY:v.lastY,x:m,y:b}}function f(v,m){const b=v.props.scale;return{node:m.node,x:v.state.x+m.deltaX/b,y:v.state.y+m.deltaY/b,deltaX:m.deltaX/b,deltaY:m.deltaY/b,lastX:v.state.x,lastY:v.state.y}}function h(v){return{left:v.left,top:v.top,right:v.right,bottom:v.bottom}}function p(v){const m=v.findDOMNode();if(!m)throw new Error("<DraggableCore>: Unmounted during event!");return m}return Yn}var vs={},Ac={},AN;function JA(){if(AN)return Ac;AN=1,Object.defineProperty(Ac,"__esModule",{value:!0}),Ac.default=e;function e(){}return Ac}var zN;function k7(){if(zN)return vs;zN=1,Object.defineProperty(vs,"__esModule",{value:!0}),vs.default=void 0;var e=h($a()),n=d(KA()),a=d(Jc()),i=Zb(),o=QA(),l=Du(),c=d(JA());function d(w){return w&&w.__esModule?w:{default:w}}function f(w){if(typeof WeakMap!="function")return null;var C=new WeakMap,T=new WeakMap;return(f=function(E){return E?T:C})(w)}function h(w,C){if(w&&w.__esModule)return w;if(w===null||typeof w!="object"&&typeof w!="function")return{default:w};var T=f(C);if(T&&T.has(w))return T.get(w);var E={},N=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var R in w)if(R!=="default"&&Object.prototype.hasOwnProperty.call(w,R)){var z=N?Object.getOwnPropertyDescriptor(w,R):null;z&&(z.get||z.set)?Object.defineProperty(E,R,z):E[R]=w[R]}return E.default=w,T&&T.set(w,E),E}function p(w,C,T){return C=v(C),C in w?Object.defineProperty(w,C,{value:T,enumerable:!0,configurable:!0,writable:!0}):w[C]=T,w}function v(w){var C=m(w,"string");return typeof C=="symbol"?C:String(C)}function m(w,C){if(typeof w!="object"||w===null)return w;var T=w[Symbol.toPrimitive];if(T!==void 0){var E=T.call(w,C);if(typeof E!="object")return E;throw new TypeError("@@toPrimitive must return a primitive value.")}return(C==="string"?String:Number)(w)}const b={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let _=b.mouse,S=class extends e.Component{constructor(){super(...arguments),p(this,"dragging",!1),p(this,"lastX",NaN),p(this,"lastY",NaN),p(this,"touchIdentifier",null),p(this,"mounted",!1),p(this,"handleDragStart",C=>{if(this.props.onMouseDown(C),!this.props.allowAnyClick&&typeof C.button=="number"&&C.button!==0)return!1;const T=this.findDOMNode();if(!T||!T.ownerDocument||!T.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:E}=T;if(this.props.disabled||!(C.target instanceof E.defaultView.Node)||this.props.handle&&!(0,i.matchesSelectorAndParentsTo)(C.target,this.props.handle,T)||this.props.cancel&&(0,i.matchesSelectorAndParentsTo)(C.target,this.props.cancel,T))return;C.type==="touchstart"&&C.preventDefault();const N=(0,i.getTouchIdentifier)(C);this.touchIdentifier=N;const R=(0,o.getControlPosition)(C,N,this);if(R==null)return;const{x:z,y:j}=R,A=(0,o.createCoreData)(this,z,j);(0,c.default)("DraggableCore: handleDragStart: %j",A),(0,c.default)("calling",this.props.onStart),!(this.props.onStart(C,A)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,i.addUserSelectStyles)(E),this.dragging=!0,this.lastX=z,this.lastY=j,(0,i.addEvent)(E,_.move,this.handleDrag),(0,i.addEvent)(E,_.stop,this.handleDragStop))}),p(this,"handleDrag",C=>{const T=(0,o.getControlPosition)(C,this.touchIdentifier,this);if(T==null)return;let{x:E,y:N}=T;if(Array.isArray(this.props.grid)){let j=E-this.lastX,A=N-this.lastY;if([j,A]=(0,o.snapToGrid)(this.props.grid,j,A),!j&&!A)return;E=this.lastX+j,N=this.lastY+A}const R=(0,o.createCoreData)(this,E,N);if((0,c.default)("DraggableCore: handleDrag: %j",R),this.props.onDrag(C,R)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const A=document.createEvent("MouseEvents");A.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(A)}return}this.lastX=E,this.lastY=N}),p(this,"handleDragStop",C=>{if(!this.dragging)return;const T=(0,o.getControlPosition)(C,this.touchIdentifier,this);if(T==null)return;let{x:E,y:N}=T;if(Array.isArray(this.props.grid)){let A=E-this.lastX||0,D=N-this.lastY||0;[A,D]=(0,o.snapToGrid)(this.props.grid,A,D),E=this.lastX+A,N=this.lastY+D}const R=(0,o.createCoreData)(this,E,N);if(this.props.onStop(C,R)===!1||this.mounted===!1)return!1;const j=this.findDOMNode();j&&this.props.enableUserSelectHack&&(0,i.removeUserSelectStyles)(j.ownerDocument),(0,c.default)("DraggableCore: handleDragStop: %j",R),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,j&&((0,c.default)("DraggableCore: Removing handlers"),(0,i.removeEvent)(j.ownerDocument,_.move,this.handleDrag),(0,i.removeEvent)(j.ownerDocument,_.stop,this.handleDragStop))}),p(this,"onMouseDown",C=>(_=b.mouse,this.handleDragStart(C))),p(this,"onMouseUp",C=>(_=b.mouse,this.handleDragStop(C))),p(this,"onTouchStart",C=>(_=b.touch,this.handleDragStart(C))),p(this,"onTouchEnd",C=>(_=b.touch,this.handleDragStop(C)))}componentDidMount(){this.mounted=!0;const C=this.findDOMNode();C&&(0,i.addEvent)(C,b.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const C=this.findDOMNode();if(C){const{ownerDocument:T}=C;(0,i.removeEvent)(T,b.mouse.move,this.handleDrag),(0,i.removeEvent)(T,b.touch.move,this.handleDrag),(0,i.removeEvent)(T,b.mouse.stop,this.handleDragStop),(0,i.removeEvent)(T,b.touch.stop,this.handleDragStop),(0,i.removeEvent)(C,b.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,i.removeUserSelectStyles)(T)}}findDOMNode(){var C,T;return(C=this.props)!==null&&C!==void 0&&C.nodeRef?(T=this.props)===null||T===void 0||(T=T.nodeRef)===null||T===void 0?void 0:T.current:a.default.findDOMNode(this)}render(){return e.cloneElement(e.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return vs.default=S,p(S,"displayName","DraggableCore"),p(S,"propTypes",{allowAnyClick:n.default.bool,children:n.default.node.isRequired,disabled:n.default.bool,enableUserSelectHack:n.default.bool,offsetParent:function(w,C){if(w[C]&&w[C].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:n.default.arrayOf(n.default.number),handle:n.default.string,cancel:n.default.string,nodeRef:n.default.object,onStart:n.default.func,onDrag:n.default.func,onStop:n.default.func,onMouseDown:n.default.func,scale:n.default.number,className:l.dontSetMe,style:l.dontSetMe,transform:l.dontSetMe}),p(S,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),vs}var DN;function O7(){return DN||(DN=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return f.default}}),e.default=void 0;var n=m($a()),a=p(KA()),i=p(Jc()),o=p(z7),l=Zb(),c=QA(),d=Du(),f=p(k7()),h=p(JA());function p(T){return T&&T.__esModule?T:{default:T}}function v(T){if(typeof WeakMap!="function")return null;var E=new WeakMap,N=new WeakMap;return(v=function(R){return R?N:E})(T)}function m(T,E){if(T&&T.__esModule)return T;if(T===null||typeof T!="object"&&typeof T!="function")return{default:T};var N=v(E);if(N&&N.has(T))return N.get(T);var R={},z=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var j in T)if(j!=="default"&&Object.prototype.hasOwnProperty.call(T,j)){var A=z?Object.getOwnPropertyDescriptor(T,j):null;A&&(A.get||A.set)?Object.defineProperty(R,j,A):R[j]=T[j]}return R.default=T,N&&N.set(T,R),R}function b(){return b=Object.assign?Object.assign.bind():function(T){for(var E=1;E<arguments.length;E++){var N=arguments[E];for(var R in N)Object.prototype.hasOwnProperty.call(N,R)&&(T[R]=N[R])}return T},b.apply(this,arguments)}function _(T,E,N){return E=S(E),E in T?Object.defineProperty(T,E,{value:N,enumerable:!0,configurable:!0,writable:!0}):T[E]=N,T}function S(T){var E=w(T,"string");return typeof E=="symbol"?E:String(E)}function w(T,E){if(typeof T!="object"||T===null)return T;var N=T[Symbol.toPrimitive];if(N!==void 0){var R=N.call(T,E);if(typeof R!="object")return R;throw new TypeError("@@toPrimitive must return a primitive value.")}return(E==="string"?String:Number)(T)}class C extends n.Component{static getDerivedStateFromProps(E,N){let{position:R}=E,{prevPropsPosition:z}=N;return R&&(!z||R.x!==z.x||R.y!==z.y)?((0,h.default)("Draggable: getDerivedStateFromProps %j",{position:R,prevPropsPosition:z}),{x:R.x,y:R.y,prevPropsPosition:{...R}}):null}constructor(E){super(E),_(this,"onDragStart",(N,R)=>{if((0,h.default)("Draggable: onDragStart: %j",R),this.props.onStart(N,(0,c.createDraggableData)(this,R))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),_(this,"onDrag",(N,R)=>{if(!this.state.dragging)return!1;(0,h.default)("Draggable: onDrag: %j",R);const z=(0,c.createDraggableData)(this,R),j={x:z.x,y:z.y,slackX:0,slackY:0};if(this.props.bounds){const{x:D,y:I}=j;j.x+=this.state.slackX,j.y+=this.state.slackY;const[P,V]=(0,c.getBoundPosition)(this,j.x,j.y);j.x=P,j.y=V,j.slackX=this.state.slackX+(D-j.x),j.slackY=this.state.slackY+(I-j.y),z.x=j.x,z.y=j.y,z.deltaX=j.x-this.state.x,z.deltaY=j.y-this.state.y}if(this.props.onDrag(N,z)===!1)return!1;this.setState(j)}),_(this,"onDragStop",(N,R)=>{if(!this.state.dragging||this.props.onStop(N,(0,c.createDraggableData)(this,R))===!1)return!1;(0,h.default)("Draggable: onDragStop: %j",R);const j={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:D,y:I}=this.props.position;j.x=D,j.y=I}this.setState(j)}),this.state={dragging:!1,dragged:!1,x:E.position?E.position.x:E.defaultPosition.x,y:E.position?E.position.y:E.defaultPosition.y,prevPropsPosition:{...E.position},slackX:0,slackY:0,isElementSVG:!1},E.position&&!(E.onDrag||E.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var E,N;return(E=(N=this.props)===null||N===void 0||(N=N.nodeRef)===null||N===void 0?void 0:N.current)!==null&&E!==void 0?E:i.default.findDOMNode(this)}render(){const{axis:E,bounds:N,children:R,defaultPosition:z,defaultClassName:j,defaultClassNameDragging:A,defaultClassNameDragged:D,position:I,positionOffset:P,scale:V,...$}=this.props;let L={},H=null;const F=!!!I||this.state.dragging,J=I||z,G={x:(0,c.canDragX)(this)&&F?this.state.x:J.x,y:(0,c.canDragY)(this)&&F?this.state.y:J.y};this.state.isElementSVG?H=(0,l.createSVGTransform)(G,P):L=(0,l.createCSSTransform)(G,P);const re=(0,o.default)(R.props.className||"",j,{[A]:this.state.dragging,[D]:this.state.dragged});return n.createElement(f.default,b({},$,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),n.cloneElement(n.Children.only(R),{className:re,style:{...R.props.style,...L},transform:H}))}}e.default=C,_(C,"displayName","Draggable"),_(C,"propTypes",{...f.default.propTypes,axis:a.default.oneOf(["both","x","y","none"]),bounds:a.default.oneOfType([a.default.shape({left:a.default.number,right:a.default.number,top:a.default.number,bottom:a.default.number}),a.default.string,a.default.oneOf([!1])]),defaultClassName:a.default.string,defaultClassNameDragging:a.default.string,defaultClassNameDragged:a.default.string,defaultPosition:a.default.shape({x:a.default.number,y:a.default.number}),positionOffset:a.default.shape({x:a.default.oneOfType([a.default.number,a.default.string]),y:a.default.oneOfType([a.default.number,a.default.string])}),position:a.default.shape({x:a.default.number,y:a.default.number}),className:d.dontSetMe,style:d.dontSetMe,transform:d.dontSetMe}),_(C,"defaultProps",{...f.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(Oy)),Oy}var kN;function q7(){if(kN)return gs.exports;kN=1;const{default:e,DraggableCore:n}=O7();return gs.exports=e,gs.exports.default=e,gs.exports.DraggableCore=n,gs.exports}var B7=q7();const L7=Ls(B7);var Ct=function(){return Ct=Object.assign||function(e){for(var n,a=1,i=arguments.length;a<i;a++){n=arguments[a];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Ct.apply(this,arguments)},ON={width:"100%",height:"10px",top:"0px",left:"0px",cursor:"row-resize"},qN={width:"10px",height:"100%",top:"0px",left:"0px",cursor:"col-resize"},zc={width:"20px",height:"20px",position:"absolute",zIndex:1},H7={top:Ct(Ct({},ON),{top:"-5px"}),right:Ct(Ct({},qN),{left:void 0,right:"-5px"}),bottom:Ct(Ct({},ON),{top:void 0,bottom:"-5px"}),left:Ct(Ct({},qN),{left:"-5px"}),topRight:Ct(Ct({},zc),{right:"-10px",top:"-10px",cursor:"ne-resize"}),bottomRight:Ct(Ct({},zc),{right:"-10px",bottom:"-10px",cursor:"se-resize"}),bottomLeft:Ct(Ct({},zc),{left:"-10px",bottom:"-10px",cursor:"sw-resize"}),topLeft:Ct(Ct({},zc),{left:"-10px",top:"-10px",cursor:"nw-resize"})},I7=q.memo(function(e){var n=e.onResizeStart,a=e.direction,i=e.children,o=e.replaceStyles,l=e.className,c=q.useCallback(function(h){n(h,a)},[n,a]),d=q.useCallback(function(h){n(h,a)},[n,a]),f=q.useMemo(function(){return Ct(Ct({position:"absolute",userSelect:"none"},H7[a]),o??{})},[o,a]);return g.jsx("div",{className:l||void 0,style:f,onMouseDown:c,onTouchStart:d,children:i})}),U7=(function(){var e=function(n,a){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,o){i.__proto__=o}||function(i,o){for(var l in o)Object.prototype.hasOwnProperty.call(o,l)&&(i[l]=o[l])},e(n,a)};return function(n,a){if(typeof a!="function"&&a!==null)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");e(n,a);function i(){this.constructor=n}n.prototype=a===null?Object.create(a):(i.prototype=a.prototype,new i)}})(),Wn=function(){return Wn=Object.assign||function(e){for(var n,a=1,i=arguments.length;a<i;a++){n=arguments[a];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Wn.apply(this,arguments)},V7={width:"auto",height:"auto"},Dc=function(e,n,a){return Math.max(Math.min(e,a),n)},BN=function(e,n,a){var i=Math.round(e/n);return i*n+a*(i-1)},Gi=function(e,n){return new RegExp(e,"i").test(n)},kc=function(e){return!!(e.touches&&e.touches.length)},F7=function(e){return!!((e.clientX||e.clientX===0)&&(e.clientY||e.clientY===0))},LN=function(e,n,a){a===void 0&&(a=0);var i=n.reduce(function(l,c,d){return Math.abs(c-e)<Math.abs(n[l]-e)?d:l},0),o=Math.abs(n[i]-e);return a===0||o<a?n[i]:e},Hy=function(e){return e=e.toString(),e==="auto"||e.endsWith("px")||e.endsWith("%")||e.endsWith("vh")||e.endsWith("vw")||e.endsWith("vmax")||e.endsWith("vmin")?e:"".concat(e,"px")},Oc=function(e,n,a,i){if(e&&typeof e=="string"){if(e.endsWith("px"))return Number(e.replace("px",""));if(e.endsWith("%")){var o=Number(e.replace("%",""))/100;return n*o}if(e.endsWith("vw")){var o=Number(e.replace("vw",""))/100;return a*o}if(e.endsWith("vh")){var o=Number(e.replace("vh",""))/100;return i*o}}return e},P7=function(e,n,a,i,o,l,c){return i=Oc(i,e.width,n,a),o=Oc(o,e.height,n,a),l=Oc(l,e.width,n,a),c=Oc(c,e.height,n,a),{maxWidth:typeof i>"u"?void 0:Number(i),maxHeight:typeof o>"u"?void 0:Number(o),minWidth:typeof l>"u"?void 0:Number(l),minHeight:typeof c>"u"?void 0:Number(c)}},G7=function(e){return Array.isArray(e)?e:[e,e]},$7=["as","ref","style","className","grid","gridGap","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],HN="__resizable_base__",Y7=(function(e){U7(n,e);function n(a){var i,o,l,c,d=e.call(this,a)||this;return d.ratio=1,d.resizable=null,d.parentLeft=0,d.parentTop=0,d.resizableLeft=0,d.resizableRight=0,d.resizableTop=0,d.resizableBottom=0,d.targetLeft=0,d.targetTop=0,d.delta={width:0,height:0},d.appendBase=function(){if(!d.resizable||!d.window)return null;var f=d.parentNode;if(!f)return null;var h=d.window.document.createElement("div");return h.style.width="100%",h.style.height="100%",h.style.position="absolute",h.style.transform="scale(0, 0)",h.style.left="0",h.style.flex="0 0 100%",h.classList?h.classList.add(HN):h.className+=HN,f.appendChild(h),h},d.removeBase=function(f){var h=d.parentNode;h&&h.removeChild(f)},d.state={isResizing:!1,width:(o=(i=d.propsSize)===null||i===void 0?void 0:i.width)!==null&&o!==void 0?o:"auto",height:(c=(l=d.propsSize)===null||l===void 0?void 0:l.height)!==null&&c!==void 0?c:"auto",direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},d.onResizeStart=d.onResizeStart.bind(d),d.onMouseMove=d.onMouseMove.bind(d),d.onMouseUp=d.onMouseUp.bind(d),d}return Object.defineProperty(n.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"window",{get:function(){return!this.resizable||!this.resizable.ownerDocument?null:this.resizable.ownerDocument.defaultView},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||V7},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"size",{get:function(){var a=0,i=0;if(this.resizable&&this.window){var o=this.resizable.offsetWidth,l=this.resizable.offsetHeight,c=this.resizable.style.position;c!=="relative"&&(this.resizable.style.position="relative"),a=this.resizable.style.width!=="auto"?this.resizable.offsetWidth:o,i=this.resizable.style.height!=="auto"?this.resizable.offsetHeight:l,this.resizable.style.position=c}return{width:a,height:i}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"sizeStyle",{get:function(){var a=this,i=this.props.size,o=function(d){var f;if(typeof a.state[d]>"u"||a.state[d]==="auto")return"auto";if(a.propsSize&&a.propsSize[d]&&(!((f=a.propsSize[d])===null||f===void 0)&&f.toString().endsWith("%"))){if(a.state[d].toString().endsWith("%"))return a.state[d].toString();var h=a.getParentSize(),p=Number(a.state[d].toString().replace("px","")),v=p/h[d]*100;return"".concat(v,"%")}return Hy(a.state[d])},l=i&&typeof i.width<"u"&&!this.state.isResizing?Hy(i.width):o("width"),c=i&&typeof i.height<"u"&&!this.state.isResizing?Hy(i.height):o("height");return{width:l,height:c}},enumerable:!1,configurable:!0}),n.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var a=this.appendBase();if(!a)return{width:0,height:0};var i=!1,o=this.parentNode.style.flexWrap;o!=="wrap"&&(i=!0,this.parentNode.style.flexWrap="wrap"),a.style.position="relative",a.style.minWidth="100%",a.style.minHeight="100%";var l={width:a.offsetWidth,height:a.offsetHeight};return i&&(this.parentNode.style.flexWrap=o),this.removeBase(a),l},n.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},n.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},n.prototype.componentDidMount=function(){if(!(!this.resizable||!this.window)){var a=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:a.flexBasis!=="auto"?a.flexBasis:void 0})}},n.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},n.prototype.createSizeForCssProperty=function(a,i){var o=this.propsSize&&this.propsSize[i];return this.state[i]==="auto"&&this.state.original[i]===a&&(typeof o>"u"||o==="auto")?"auto":a},n.prototype.calculateNewMaxFromBoundary=function(a,i){var o=this.props.boundsByDirection,l=this.state.direction,c=o&&Gi("left",l),d=o&&Gi("top",l),f,h;if(this.props.bounds==="parent"){var p=this.parentNode;p&&(f=c?this.resizableRight-this.parentLeft:p.offsetWidth+(this.parentLeft-this.resizableLeft),h=d?this.resizableBottom-this.parentTop:p.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds==="window"?this.window&&(f=c?this.resizableRight:this.window.innerWidth-this.resizableLeft,h=d?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(f=c?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),h=d?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return f&&Number.isFinite(f)&&(a=a&&a<f?a:f),h&&Number.isFinite(h)&&(i=i&&i<h?i:h),{maxWidth:a,maxHeight:i}},n.prototype.calculateNewSizeFromDirection=function(a,i){var o=this.props.scale||1,l=G7(this.props.resizeRatio||1),c=l[0],d=l[1],f=this.state,h=f.direction,p=f.original,v=this.props,m=v.lockAspectRatio,b=v.lockAspectRatioExtraHeight,_=v.lockAspectRatioExtraWidth,S=p.width,w=p.height,C=b||0,T=_||0;return Gi("right",h)&&(S=p.width+(a-p.x)*c/o,m&&(w=(S-T)/this.ratio+C)),Gi("left",h)&&(S=p.width-(a-p.x)*c/o,m&&(w=(S-T)/this.ratio+C)),Gi("bottom",h)&&(w=p.height+(i-p.y)*d/o,m&&(S=(w-C)*this.ratio+T)),Gi("top",h)&&(w=p.height-(i-p.y)*d/o,m&&(S=(w-C)*this.ratio+T)),{newWidth:S,newHeight:w}},n.prototype.calculateNewSizeFromAspectRatio=function(a,i,o,l){var c=this.props,d=c.lockAspectRatio,f=c.lockAspectRatioExtraHeight,h=c.lockAspectRatioExtraWidth,p=typeof l.width>"u"?10:l.width,v=typeof o.width>"u"||o.width<0?a:o.width,m=typeof l.height>"u"?10:l.height,b=typeof o.height>"u"||o.height<0?i:o.height,_=f||0,S=h||0;if(d){var w=(m-_)*this.ratio+S,C=(b-_)*this.ratio+S,T=(p-S)/this.ratio+_,E=(v-S)/this.ratio+_,N=Math.max(p,w),R=Math.min(v,C),z=Math.max(m,T),j=Math.min(b,E);a=Dc(a,N,R),i=Dc(i,z,j)}else a=Dc(a,p,v),i=Dc(i,m,b);return{newWidth:a,newHeight:i}},n.prototype.setBoundingClientRect=function(){var a=1/(this.props.scale||1);if(this.props.bounds==="parent"){var i=this.parentNode;if(i){var o=i.getBoundingClientRect();this.parentLeft=o.left*a,this.parentTop=o.top*a}}if(this.props.bounds&&typeof this.props.bounds!="string"){var l=this.props.bounds.getBoundingClientRect();this.targetLeft=l.left*a,this.targetTop=l.top*a}if(this.resizable){var c=this.resizable.getBoundingClientRect(),d=c.left,f=c.top,h=c.right,p=c.bottom;this.resizableLeft=d*a,this.resizableRight=h*a,this.resizableTop=f*a,this.resizableBottom=p*a}},n.prototype.onResizeStart=function(a,i){if(!(!this.resizable||!this.window)){var o=0,l=0;if(a.nativeEvent&&F7(a.nativeEvent)?(o=a.nativeEvent.clientX,l=a.nativeEvent.clientY):a.nativeEvent&&kc(a.nativeEvent)&&(o=a.nativeEvent.touches[0].clientX,l=a.nativeEvent.touches[0].clientY),this.props.onResizeStart&&this.resizable){var c=this.props.onResizeStart(a,i,this.resizable);if(c===!1)return}this.props.size&&(typeof this.props.size.height<"u"&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),typeof this.props.size.width<"u"&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio=typeof this.props.lockAspectRatio=="number"?this.props.lockAspectRatio:this.size.width/this.size.height;var d,f=this.window.getComputedStyle(this.resizable);if(f.flexBasis!=="auto"){var h=this.parentNode;if(h){var p=this.window.getComputedStyle(h).flexDirection;this.flexDir=p.startsWith("row")?"row":"column",d=f.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var v={original:{x:o,y:l,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:Wn(Wn({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(a.target).cursor||"auto"}),direction:i,flexBasis:d};this.setState(v)}},n.prototype.onMouseMove=function(a){var i=this;if(!(!this.state.isResizing||!this.resizable||!this.window)){if(this.window.TouchEvent&&kc(a))try{a.preventDefault(),a.stopPropagation()}catch{}var o=this.props,l=o.maxWidth,c=o.maxHeight,d=o.minWidth,f=o.minHeight,h=kc(a)?a.touches[0].clientX:a.clientX,p=kc(a)?a.touches[0].clientY:a.clientY,v=this.state,m=v.direction,b=v.original,_=v.width,S=v.height,w=this.getParentSize(),C=P7(w,this.window.innerWidth,this.window.innerHeight,l,c,d,f);l=C.maxWidth,c=C.maxHeight,d=C.minWidth,f=C.minHeight;var T=this.calculateNewSizeFromDirection(h,p),E=T.newHeight,N=T.newWidth,R=this.calculateNewMaxFromBoundary(l,c);this.props.snap&&this.props.snap.x&&(N=LN(N,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(E=LN(E,this.props.snap.y,this.props.snapGap));var z=this.calculateNewSizeFromAspectRatio(N,E,{width:R.maxWidth,height:R.maxHeight},{width:d,height:f});if(N=z.newWidth,E=z.newHeight,this.props.grid){var j=BN(N,this.props.grid[0],this.props.gridGap?this.props.gridGap[0]:0),A=BN(E,this.props.grid[1],this.props.gridGap?this.props.gridGap[1]:0),D=this.props.snapGap||0,I=D===0||Math.abs(j-N)<=D?j:N,P=D===0||Math.abs(A-E)<=D?A:E;N=I,E=P}var V={width:N-b.width,height:E-b.height};if(this.delta=V,_&&typeof _=="string"){if(_.endsWith("%")){var $=N/w.width*100;N="".concat($,"%")}else if(_.endsWith("vw")){var L=N/this.window.innerWidth*100;N="".concat(L,"vw")}else if(_.endsWith("vh")){var H=N/this.window.innerHeight*100;N="".concat(H,"vh")}}if(S&&typeof S=="string"){if(S.endsWith("%")){var $=E/w.height*100;E="".concat($,"%")}else if(S.endsWith("vw")){var L=E/this.window.innerWidth*100;E="".concat(L,"vw")}else if(S.endsWith("vh")){var H=E/this.window.innerHeight*100;E="".concat(H,"vh")}}var O={width:this.createSizeForCssProperty(N,"width"),height:this.createSizeForCssProperty(E,"height")};this.flexDir==="row"?O.flexBasis=O.width:this.flexDir==="column"&&(O.flexBasis=O.height);var F=this.state.width!==O.width,J=this.state.height!==O.height,G=this.state.flexBasis!==O.flexBasis,re=F||J||G;re&&_b.flushSync(function(){i.setState(O)}),this.props.onResize&&re&&this.props.onResize(a,m,this.resizable,V)}},n.prototype.onMouseUp=function(a){var i,o,l=this.state,c=l.isResizing,d=l.direction;l.original,!(!c||!this.resizable)&&(this.props.onResizeStop&&this.props.onResizeStop(a,d,this.resizable,this.delta),this.props.size&&this.setState({width:(i=this.props.size.width)!==null&&i!==void 0?i:"auto",height:(o=this.props.size.height)!==null&&o!==void 0?o:"auto"}),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:Wn(Wn({},this.state.backgroundStyle),{cursor:"auto"})}))},n.prototype.updateSize=function(a){var i,o;this.setState({width:(i=a.width)!==null&&i!==void 0?i:"auto",height:(o=a.height)!==null&&o!==void 0?o:"auto"})},n.prototype.renderResizer=function(){var a=this,i=this.props,o=i.enable,l=i.handleStyles,c=i.handleClasses,d=i.handleWrapperStyle,f=i.handleWrapperClass,h=i.handleComponent;if(!o)return null;var p=Object.keys(o).map(function(v){return o[v]!==!1?g.jsx(I7,{direction:v,onResizeStart:a.onResizeStart,replaceStyles:l&&l[v],className:c&&c[v],children:h&&h[v]?h[v]:null},v):null});return g.jsx("div",{className:f,style:d,children:p})},n.prototype.render=function(){var a=this,i=Object.keys(this.props).reduce(function(c,d){return $7.indexOf(d)!==-1||(c[d]=a.props[d]),c},{}),o=Wn(Wn(Wn({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(o.flexBasis=this.state.flexBasis);var l=this.props.as||"div";return g.jsxs(l,Wn({style:o,className:this.props.className},i,{ref:function(c){c&&(a.resizable=c)},children:[this.state.isResizing&&g.jsx("div",{style:this.state.backgroundStyle}),this.props.children,this.renderResizer()]}))},n.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],gridGap:[0,0],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},n})(q.PureComponent);/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0

THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.

See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */var ib=function(e,n){return ib=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,i){a.__proto__=i}||function(a,i){for(var o in i)i.hasOwnProperty(o)&&(a[o]=i[o])},ib(e,n)};function W7(e,n){ib(e,n);function a(){this.constructor=e}e.prototype=n===null?Object.create(n):(a.prototype=n.prototype,new a)}var Mt=function(){return Mt=Object.assign||function(n){for(var a,i=1,o=arguments.length;i<o;i++){a=arguments[i];for(var l in a)Object.prototype.hasOwnProperty.call(a,l)&&(n[l]=a[l])}return n},Mt.apply(this,arguments)};function X7(e,n){var a={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(a[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,i=Object.getOwnPropertySymbols(e);o<i.length;o++)n.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(a[i[o]]=e[i[o]]);return a}var K7={width:"auto",height:"auto",display:"inline-block",position:"absolute",top:0,left:0},Z7=function(e){return{bottom:e,bottomLeft:e,bottomRight:e,left:e,right:e,top:e,topLeft:e,topRight:e}},ez=(function(e){W7(n,e);function n(a){var i=e.call(this,a)||this;return i.resizingPosition={x:0,y:0},i.offsetFromParent={left:0,top:0},i.resizableElement={current:null},i.originalPosition={x:0,y:0},i.state={resizing:!1,bounds:{top:0,right:0,bottom:0,left:0},maxWidth:a.maxWidth,maxHeight:a.maxHeight},i.onResizeStart=i.onResizeStart.bind(i),i.onResize=i.onResize.bind(i),i.onResizeStop=i.onResizeStop.bind(i),i.onDragStart=i.onDragStart.bind(i),i.onDrag=i.onDrag.bind(i),i.onDragStop=i.onDragStop.bind(i),i.getMaxSizesFromProps=i.getMaxSizesFromProps.bind(i),i}return n.prototype.componentDidMount=function(){this.updateOffsetFromParent();var a=this.offsetFromParent,i=a.left,o=a.top,l=this.getDraggablePosition(),c=l.x,d=l.y;this.draggable.setState({x:c-i,y:d-o}),this.forceUpdate()},n.prototype.getDraggablePosition=function(){var a=this.draggable.state,i=a.x,o=a.y;return{x:i,y:o}},n.prototype.getParent=function(){return this.resizable&&this.resizable.parentNode},n.prototype.getParentSize=function(){return this.resizable.getParentSize()},n.prototype.getMaxSizesFromProps=function(){var a=typeof this.props.maxWidth>"u"?Number.MAX_SAFE_INTEGER:this.props.maxWidth,i=typeof this.props.maxHeight>"u"?Number.MAX_SAFE_INTEGER:this.props.maxHeight;return{maxWidth:a,maxHeight:i}},n.prototype.getSelfElement=function(){return this.resizable&&this.resizable.resizable},n.prototype.getOffsetHeight=function(a){var i=this.props.scale;switch(this.props.bounds){case"window":return window.innerHeight/i;case"body":return document.body.offsetHeight/i;default:return a.offsetHeight}},n.prototype.getOffsetWidth=function(a){var i=this.props.scale;switch(this.props.bounds){case"window":return window.innerWidth/i;case"body":return document.body.offsetWidth/i;default:return a.offsetWidth}},n.prototype.onDragStart=function(a,i){this.props.onDragStart&&this.props.onDragStart(a,i);var o=this.getDraggablePosition();if(this.originalPosition=o,!!this.props.bounds){var l=this.getParent(),c=this.props.scale,d;if(this.props.bounds==="parent")d=l;else if(this.props.bounds==="body"){var f=l.getBoundingClientRect(),h=f.left,p=f.top,v=document.body.getBoundingClientRect(),m=-(h-l.offsetLeft*c-v.left)/c,b=-(p-l.offsetTop*c-v.top)/c,_=(document.body.offsetWidth-this.resizable.size.width*c)/c+m,S=(document.body.offsetHeight-this.resizable.size.height*c)/c+b;return this.setState({bounds:{top:b,right:_,bottom:S,left:m}})}else if(this.props.bounds==="window"){if(!this.resizable)return;var w=l.getBoundingClientRect(),C=w.left,T=w.top,E=-(C-l.offsetLeft*c)/c,N=-(T-l.offsetTop*c)/c,_=(window.innerWidth-this.resizable.size.width*c)/c+E,S=(window.innerHeight-this.resizable.size.height*c)/c+N;return this.setState({bounds:{top:N,right:_,bottom:S,left:E}})}else typeof this.props.bounds=="string"?d=document.querySelector(this.props.bounds):this.props.bounds instanceof HTMLElement&&(d=this.props.bounds);if(!(!(d instanceof HTMLElement)||!(l instanceof HTMLElement))){var R=d.getBoundingClientRect(),z=R.left,j=R.top,A=l.getBoundingClientRect(),D=A.left,I=A.top,P=(z-D)/c,V=j-I;if(this.resizable){this.updateOffsetFromParent();var $=this.offsetFromParent;this.setState({bounds:{top:V-$.top,right:P+(d.offsetWidth-this.resizable.size.width)-$.left/c,bottom:V+(d.offsetHeight-this.resizable.size.height)-$.top,left:P-$.left/c}})}}}},n.prototype.onDrag=function(a,i){if(this.props.onDrag){var o=this.offsetFromParent,l=o.left,c=o.top;if(!this.props.dragAxis||this.props.dragAxis==="both")return this.props.onDrag(a,Mt(Mt({},i),{x:i.x+l,y:i.y+c}));if(this.props.dragAxis==="x")return this.props.onDrag(a,Mt(Mt({},i),{x:i.x+l,y:this.originalPosition.y+c,deltaY:0}));if(this.props.dragAxis==="y")return this.props.onDrag(a,Mt(Mt({},i),{x:this.originalPosition.x+l,y:i.y+c,deltaX:0}))}},n.prototype.onDragStop=function(a,i){if(this.props.onDragStop){var o=this.offsetFromParent,l=o.left,c=o.top;if(!this.props.dragAxis||this.props.dragAxis==="both")return this.props.onDragStop(a,Mt(Mt({},i),{x:i.x+l,y:i.y+c}));if(this.props.dragAxis==="x")return this.props.onDragStop(a,Mt(Mt({},i),{x:i.x+l,y:this.originalPosition.y+c,deltaY:0}));if(this.props.dragAxis==="y")return this.props.onDragStop(a,Mt(Mt({},i),{x:this.originalPosition.x+l,y:i.y+c,deltaX:0}))}},n.prototype.onResizeStart=function(a,i,o){a.stopPropagation(),this.setState({resizing:!0});var l=this.props.scale,c=this.offsetFromParent,d=this.getDraggablePosition();if(this.resizingPosition={x:d.x+c.left,y:d.y+c.top},this.originalPosition=d,this.props.bounds){var f=this.getParent(),h=void 0;this.props.bounds==="parent"?h=f:this.props.bounds==="body"?h=document.body:this.props.bounds==="window"?h=window:typeof this.props.bounds=="string"?h=document.querySelector(this.props.bounds):this.props.bounds instanceof HTMLElement&&(h=this.props.bounds);var p=this.getSelfElement();if(p instanceof Element&&(h instanceof HTMLElement||h===window)&&f instanceof HTMLElement){var v=this.getMaxSizesFromProps(),m=v.maxWidth,b=v.maxHeight,_=this.getParentSize();if(m&&typeof m=="string")if(m.endsWith("%")){var S=Number(m.replace("%",""))/100;m=_.width*S}else m.endsWith("px")&&(m=Number(m.replace("px","")));if(b&&typeof b=="string")if(b.endsWith("%")){var S=Number(b.replace("%",""))/100;b=_.height*S}else b.endsWith("px")&&(b=Number(b.replace("px","")));var w=p.getBoundingClientRect(),C=w.left,T=w.top,E=this.props.bounds==="window"?{left:0,top:0}:h.getBoundingClientRect(),N=E.left,R=E.top,z=this.getOffsetWidth(h),j=this.getOffsetHeight(h),A=i.toLowerCase().endsWith("left"),D=i.toLowerCase().endsWith("right"),I=i.startsWith("top"),P=i.startsWith("bottom");if((A||I)&&this.resizable){var V=(C-N)/l+this.resizable.size.width;this.setState({maxWidth:V>Number(m)?m:V})}if(D||this.props.lockAspectRatio&&!A&&!I){var V=z+(N-C)/l;this.setState({maxWidth:V>Number(m)?m:V})}if((I||A)&&this.resizable){var V=(T-R)/l+this.resizable.size.height;this.setState({maxHeight:V>Number(b)?b:V})}if(P||this.props.lockAspectRatio&&!I&&!A){var V=j+(R-T)/l;this.setState({maxHeight:V>Number(b)?b:V})}}}else this.setState({maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight});this.props.onResizeStart&&this.props.onResizeStart(a,i,o)},n.prototype.onResize=function(a,i,o,l){var c=this,d={x:this.originalPosition.x,y:this.originalPosition.y},f=-l.width,h=-l.height,p=["top","left","topLeft","bottomLeft","topRight"];p.includes(i)&&(i==="bottomLeft"?d.x+=f:(i==="topRight"||(d.x+=f),d.y+=h));var v=this.draggable.state;(d.x!==v.x||d.y!==v.y)&&_b.flushSync(function(){c.draggable.setState(d)}),this.updateOffsetFromParent();var m=this.offsetFromParent,b=this.getDraggablePosition().x+m.left,_=this.getDraggablePosition().y+m.top;this.resizingPosition={x:b,y:_},this.props.onResize&&this.props.onResize(a,i,o,l,{x:b,y:_})},n.prototype.onResizeStop=function(a,i,o,l){this.setState({resizing:!1});var c=this.getMaxSizesFromProps(),d=c.maxWidth,f=c.maxHeight;this.setState({maxWidth:d,maxHeight:f}),this.props.onResizeStop&&this.props.onResizeStop(a,i,o,l,this.resizingPosition)},n.prototype.updateSize=function(a){this.resizable&&this.resizable.updateSize({width:a.width,height:a.height})},n.prototype.updatePosition=function(a){this.draggable.setState(a)},n.prototype.updateOffsetFromParent=function(){var a=this.props.scale,i=this.getParent(),o=this.getSelfElement();if(!i||o===null)return{top:0,left:0};var l=i.getBoundingClientRect(),c=l.left,d=l.top,f=o.getBoundingClientRect(),h=this.getDraggablePosition(),p=i.scrollLeft,v=i.scrollTop;this.offsetFromParent={left:f.left-c+p-h.x*a,top:f.top-d+v-h.y*a}},n.prototype.render=function(){var a=this,i=this.props,o=i.disableDragging,l=i.style,c=i.dragHandleClassName,d=i.position,f=i.onMouseDown,h=i.onMouseUp,p=i.dragAxis,v=i.dragGrid,m=i.bounds,b=i.enableUserSelectHack,_=i.cancel,S=i.children;i.onResizeStart,i.onResize,i.onResizeStop,i.onDragStart,i.onDrag,i.onDragStop;var w=i.resizeHandleStyles,C=i.resizeHandleClasses,T=i.resizeHandleComponent,E=i.enableResizing,N=i.resizeGrid,R=i.resizeHandleWrapperClass,z=i.resizeHandleWrapperStyle,j=i.scale,A=i.allowAnyClick,D=i.dragPositionOffset,I=X7(i,["disableDragging","style","dragHandleClassName","position","onMouseDown","onMouseUp","dragAxis","dragGrid","bounds","enableUserSelectHack","cancel","children","onResizeStart","onResize","onResizeStop","onDragStart","onDrag","onDragStop","resizeHandleStyles","resizeHandleClasses","resizeHandleComponent","enableResizing","resizeGrid","resizeHandleWrapperClass","resizeHandleWrapperStyle","scale","allowAnyClick","dragPositionOffset"]),P=this.props.default?Mt({},this.props.default):void 0;delete I.default;var V=o||c?{cursor:"auto"}:{cursor:"move"},$=Mt(Mt(Mt({},K7),V),l),L=this.offsetFromParent,H=L.left,O=L.top,F;d&&(F={x:d.x-H,y:d.y-O});var J=this.state.resizing?void 0:F,G=this.state.resizing?"both":p;return q.createElement(L7,{ref:function(re){re&&(a.draggable=re)},handle:c?".".concat(c):void 0,defaultPosition:P,onMouseDown:f,onMouseUp:h,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,axis:G,disabled:o,grid:v,bounds:m?this.state.bounds:void 0,position:J,enableUserSelectHack:b,cancel:_,scale:j,allowAnyClick:A,nodeRef:this.resizableElement,positionOffset:D},q.createElement(Y7,Mt({},I,{ref:function(re){re&&(a.resizable=re,a.resizableElement.current=re.resizable)},defaultSize:P,size:this.props.size,enable:typeof E=="boolean"?Z7(E):E,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,style:$,minWidth:this.props.minWidth,minHeight:this.props.minHeight,maxWidth:this.state.resizing?this.state.maxWidth:this.props.maxWidth,maxHeight:this.state.resizing?this.state.maxHeight:this.props.maxHeight,grid:N,handleWrapperClass:R,handleWrapperStyle:z,lockAspectRatio:this.props.lockAspectRatio,lockAspectRatioExtraWidth:this.props.lockAspectRatioExtraWidth,lockAspectRatioExtraHeight:this.props.lockAspectRatioExtraHeight,handleStyles:w,handleClasses:C,handleComponent:T,scale:this.props.scale}),S))},n.defaultProps={maxWidth:Number.MAX_SAFE_INTEGER,maxHeight:Number.MAX_SAFE_INTEGER,scale:1,onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},onDragStart:function(){},onDrag:function(){},onDragStop:function(){}},n})(q.PureComponent);const IN=Ya()(co((e,n)=>({outputs:new Map,addOutput:(a,i)=>e(o=>{const l=new Map(o.outputs),d=[...l.get(a)||[],i];return l.set(a,d),{outputs:l}}),clearOutputs:a=>e(i=>{const o=new Map(i.outputs);return o.delete(a),{outputs:o}}),getOutputs:a=>n().outputs.get(a)||[]}),{name:"streamStore"})),at=Ya()(co(e=>({status:"disconnected",lastError:null,reconnectAttempts:0,setStatus:n=>e({status:n}),setError:n=>e({lastError:n}),incrementAttempts:()=>e(n=>({reconnectAttempts:n.reconnectAttempts+1})),resetAttempts:()=>e({reconnectAttempts:0})}),{name:"wsStore"}));class Q7{ws=null;reconnectTimeout=null;reconnectAttempt=0;maxReconnectDelay=3e4;connectionTimeout=null;connectionTimeoutMs=1e4;messageBuffer=[];maxBufferSize=100;eventHandlers=new Map;url;shouldReconnect=!0;heartbeatInterval=null;heartbeatTimeout=null;connectionStatus="disconnected";store;enableHeartbeat;constructor(n,a){this.url=n,this.store=a||{addAgent:i=>Me.getState().addAgent(i),updateAgent:(i,o)=>Me.getState().updateAgent(i,o),addMessage:i=>Me.getState().addMessage(i),updateMessage:(i,o)=>Me.getState().updateMessage(i,o),batchUpdate:i=>Me.getState().batchUpdate(i)},this.enableHeartbeat=!1,this.setupEventHandlers()}updateFilterStateFromPublishedMessage(n){const a=Te.getState(),i=typeof n.artifact_type=="string"?n.artifact_type:"",o=typeof n.produced_by=="string"?n.produced_by:"",l=Array.isArray(n.tags)?n.tags.filter(_=>typeof _=="string"&&_.length>0):[],c=(typeof n.visibility=="object"&&n.visibility&&typeof n.visibility.kind=="string"?n.visibility.kind:void 0)||(typeof n.visibility_kind=="string"?n.visibility_kind:void 0)||(typeof n.visibility=="string"?n.visibility:void 0)||"",d=i?[...a.availableArtifactTypes,i]:[...a.availableArtifactTypes],f=o?[...a.availableProducers,o]:[...a.availableProducers],h=l.length>0?[...a.availableTags,...l]:[...a.availableTags],p=c?[...a.availableVisibility,c]:[...a.availableVisibility];a.updateAvailableFacets({artifactTypes:d,producers:f,tags:h,visibilities:p});const v=a.summary??{total:0,by_type:{},by_producer:{},by_visibility:{},tag_counts:{},earliest_created_at:null,latest_created_at:null},m=(typeof n.timestamp=="string"?n.timestamp:void 0)??new Date().toISOString(),b={total:v.total+1,by_type:{...v.by_type},by_producer:{...v.by_producer},by_visibility:{...v.by_visibility},tag_counts:{...v.tag_counts},earliest_created_at:v.earliest_created_at===null||m<v.earliest_created_at?m:v.earliest_created_at,latest_created_at:v.latest_created_at===null||m>v.latest_created_at?m:v.latest_created_at};if(i&&(b.by_type[i]=(b.by_type[i]||0)+1),o&&(b.by_producer[o]=(b.by_producer[o]||0)+1),c&&(b.by_visibility[c]=(b.by_visibility[c]||0)+1),l.forEach(_=>{b.tag_counts[_]=(b.tag_counts[_]||0)+1}),a.setSummary(b),typeof n.correlation_id=="string"&&n.correlation_id.length>0){const _=typeof n.timestamp=="string"?new Date(n.timestamp).getTime():Date.now(),S=a.availableCorrelationIds.find(T=>T.correlation_id===n.correlation_id),w=S?{...S,artifact_count:S.artifact_count+1,first_seen:Math.min(S.first_seen,_)}:{correlation_id:n.correlation_id,first_seen:_,artifact_count:1,run_count:0},C=[...a.availableCorrelationIds.filter(T=>T.correlation_id!==n.correlation_id),w];a.updateAvailableCorrelationIds(C)}}setupEventHandlers(){this.on("agent_activated",n=>{const a=Me.getState().agents,i=Me.getState().messages,o=a.get(n.agent_id),l={...o?.receivedByType||{}};n.consumed_artifacts&&n.consumed_artifacts.length>0&&n.consumed_artifacts.forEach(f=>{const h=i.get(f);h&&(l[h.type]=(l[h.type]||0)+1)});const c={id:n.agent_id,name:n.agent_name,status:"running",subscriptions:n.consumed_types||[],lastActive:Date.now(),sentCount:o?.sentCount||0,recvCount:(o?.recvCount||0)+(n.consumed_artifacts?.length||0),outputTypes:n.produced_types||[],receivedByType:l,sentByType:o?.sentByType||{}};this.store.addAgent(c),n.consumed_artifacts&&n.consumed_artifacts.length>0&&Me.getState().recordConsumption(n.consumed_artifacts,n.agent_id);const d={run_id:n.run_id||`run_${Date.now()}`,agent_name:n.agent_name,correlation_id:n.correlation_id,status:"active",consumed_artifacts:n.consumed_artifacts||[],produced_artifacts:[],started_at:new Date().toISOString()};this.store.batchUpdate&&this.store.batchUpdate({runs:[d]})}),this.on("message_published",n=>{const a=Me.getState().messages,i=`streaming_${n.produced_by}_${n.correlation_id}`,o=a.get(i);if(o){const d=Array.isArray(n.tags)?n.tags:[],f=n.visibility?.kind||n.visibility_kind||"Unknown",h={...o,id:n.artifact_id,type:n.artifact_type,payload:n.payload,tags:d,visibilityKind:f,partitionKey:n.partition_key??null,version:n.version??1,isStreaming:!1,streamingText:""};Me.getState().finalizeStreamingMessage(i,h)}else{const d=Array.isArray(n.tags)?n.tags:[],f=n.visibility?.kind||n.visibility_kind||"Unknown",h={id:n.artifact_id,type:n.artifact_type,payload:n.payload,timestamp:n.timestamp?new Date(n.timestamp).getTime():Date.now(),correlationId:n.correlation_id||"",producedBy:n.produced_by,tags:d,visibilityKind:f,partitionKey:n.partition_key??null,version:n.version??1,isStreaming:!1};this.store.addMessage(h)}const l=Me.getState().agents.get(n.produced_by);if(l){const d={...l.sentByType||{}};d[n.artifact_type]=(d[n.artifact_type]||0)+1,this.store.updateAgent(n.produced_by,{sentCount:(l.sentCount||0)+1,lastActive:Date.now(),sentByType:d})}else this.store.addAgent({id:n.produced_by,name:n.produced_by,status:"idle",subscriptions:[],lastActive:Date.now(),sentCount:1,recvCount:0,outputTypes:[n.artifact_type],sentByType:{[n.artifact_type]:1},receivedByType:{}});if(n.consumers&&Array.isArray(n.consumers)){const d=Me.getState().agents;n.consumers.forEach(f=>{const h=d.get(f);h&&this.store.updateAgent(f,{recvCount:(h.recvCount||0)+1,lastActive:Date.now()})})}if(n.correlation_id&&this.store.batchUpdate){const d=Me.getState().runs,f=Array.from(d.values()).find(h=>h.agent_name===n.produced_by&&h.correlation_id===n.correlation_id&&h.status==="active");if(f&&!f.produced_artifacts.includes(n.artifact_id)){const h={...f,produced_artifacts:[...f.produced_artifacts,n.artifact_id]};this.store.batchUpdate({runs:[h]})}}this.updateFilterStateFromPublishedMessage(n);const c=ut.getState().mode;c==="blackboard"?Me.getState().generateBlackboardViewGraph():c==="agent"&&Me.getState().generateAgentViewGraph()}),this.on("streaming_output",n=>{if(console.log("[WebSocket] Streaming output:",n),n.agent_name&&n.output_type==="llm_token"){const l=[...Me.getState().agents.get(n.agent_name)?.streamingTokens||[],n.content].slice(-6);this.store.updateAgent(n.agent_name,{lastActive:Date.now(),streamingTokens:l})}if(n.output_type==="llm_token"&&n.agent_name&&n.correlation_id){const a=Me.getState().messages,i=`streaming_${n.agent_name}_${n.correlation_id}`,o=a.get(i);if(o)this.store.updateMessage(i,{streamingText:(o.streamingText||"")+n.content,timestamp:n.timestamp?new Date(n.timestamp).getTime():Date.now()});else if(n.sequence===0||!o){const d=Me.getState().agents.get(n.agent_name)?.outputTypes?.[0]||"output",f={id:i,type:d,payload:{},timestamp:n.timestamp?new Date(n.timestamp).getTime():Date.now(),correlationId:n.correlation_id||"",producedBy:n.agent_name,tags:[],visibilityKind:"Unknown",isStreaming:!0,streamingText:n.content};this.store.addMessage(f)}}}),this.on("agent_completed",n=>{if(this.store.updateAgent(n.agent_name,{status:"idle",lastActive:Date.now(),streamingTokens:[]}),n.run_id&&this.store.batchUpdate){const i=Me.getState().runs.get(n.run_id);if(i){const o={...i,status:"completed",completed_at:new Date().toISOString(),duration_ms:n.duration_ms};this.store.batchUpdate({runs:[o]})}}}),this.on("agent_error",n=>{if(this.store.updateAgent(n.agent_name,{status:"error",lastActive:Date.now()}),n.run_id&&this.store.batchUpdate){const i=Me.getState().runs.get(n.run_id);if(i){const o={...i,status:"error",completed_at:new Date().toISOString(),error_message:n.error_message||"Unknown error"};this.store.batchUpdate({runs:[o]})}}}),this.on("ping",()=>{this.send({type:"pong",timestamp:Date.now()})})}connect(){if(!(this.ws?.readyState===WebSocket.OPEN||this.ws?.readyState===WebSocket.CONNECTING))try{this.connectionStatus="connecting",typeof at<"u"&&at.getState().setStatus("connecting"),this.ws=new WebSocket(this.url),this.connectionTimeout=window.setTimeout(()=>{console.warn("[WebSocket] Connection timeout"),this.ws&&this.ws.readyState!==WebSocket.OPEN&&(this.ws.close(),this.connectionStatus="error",typeof at<"u"&&(at.getState().setStatus("disconnected"),at.getState().setError("Connection timeout")),this.shouldReconnect&&this.reconnect())},this.connectionTimeoutMs),this.ws.onopen=()=>{console.log("[WebSocket] Connected"),this.connectionTimeout!==null&&(clearTimeout(this.connectionTimeout),this.connectionTimeout=null),this.connectionStatus="connected",typeof at<"u"&&(at.getState().setStatus("connected"),at.getState().setError(null),at.getState().resetAttempts()),this.reconnectAttempt=0,this.flushBuffer(),this.enableHeartbeat&&this.startHeartbeat()},this.ws.onmessage=n=>{this.handleMessage(n)},this.ws.onerror=n=>{console.error("[WebSocket] Error:",n),this.connectionStatus="error",typeof at<"u"&&(at.getState().setError("Connection error"),at.getState().setStatus("disconnected"))},this.ws.onclose=n=>{console.log("[WebSocket] Closed:",n.code,n.reason),this.stopHeartbeat(),this.connectionStatus!=="error"&&(this.shouldReconnect&&n.code!==1e3?(this.connectionStatus="connecting",typeof at<"u"&&at.getState().setStatus("reconnecting"),this.reconnect()):(this.connectionStatus="disconnected",typeof at<"u"&&at.getState().setStatus("disconnected")))}}catch(n){console.error("[WebSocket] Connection failed:",n),this.connectionStatus="error",typeof at<"u"&&(at.getState().setStatus("disconnected"),at.getState().setError(n instanceof Error?n.message:"Connection failed")),this.shouldReconnect&&this.reconnect()}}reconnect(){if(this.reconnectTimeout!==null)return;const n=Math.min(1e3*Math.pow(2,this.reconnectAttempt),this.maxReconnectDelay);typeof at<"u"&&at.getState().incrementAttempts(),this.reconnectAttempt++,console.log(`[WebSocket] Reconnecting in ${n}ms (attempt ${this.reconnectAttempt})`),this.reconnectTimeout=window.setTimeout(()=>{this.reconnectTimeout=null,this.connect()},n)}handleMessage(n){try{const a=JSON.parse(n.data);if(a.type==="ping"){this.send({type:"pong",timestamp:Date.now()});return}if(a.type==="pong"){this.resetHeartbeatTimeout();return}const i=a;if(i.event_type==="pong"){this.resetHeartbeatTimeout();return}const o=i.event_type?i.data:a;let l=i.event_type;if(l||(a.agent_id&&a.consumed_types?l="agent_activated":a.artifact_id&&a.artifact_type?l="message_published":a.run_id&&a.output_type?l="streaming_output":a.run_id&&a.duration_ms!==void 0?l="agent_completed":a.run_id&&a.error_type&&(l="agent_error")),l){const c=this.eventHandlers.get(l);c&&c.forEach(d=>{try{d(o)}catch(f){console.error(`[WebSocket] Handler error for ${l}:`,f)}})}}catch(a){console.error("[WebSocket] Failed to parse message:",a)}}send(n){if(this.ws?.readyState===WebSocket.OPEN)try{this.ws.send(JSON.stringify(n))}catch(a){console.error("[WebSocket] Send failed:",a),this.bufferMessage(n)}else this.bufferMessage(n)}bufferMessage(n){this.messageBuffer.length>=this.maxBufferSize&&this.messageBuffer.shift(),this.messageBuffer.push(n)}flushBuffer(){if(this.messageBuffer.length===0)return;console.log(`[WebSocket] Flushing ${this.messageBuffer.length} buffered messages`);const n=[...this.messageBuffer];this.messageBuffer=[],n.forEach(a=>{if(this.ws?.readyState===WebSocket.OPEN)try{this.ws.send(JSON.stringify(a))}catch(i){console.error("[WebSocket] Failed to send buffered message:",i)}})}on(n,a){this.eventHandlers.has(n)||this.eventHandlers.set(n,[]),this.eventHandlers.get(n).push(a)}off(n,a){const i=this.eventHandlers.get(n);if(i){const o=i.indexOf(a);o>-1&&i.splice(o,1)}}startHeartbeat(){this.stopHeartbeat(),this.heartbeatInterval=window.setInterval(()=>{this.ws?.readyState===WebSocket.OPEN&&(this.send({type:"ping"}),this.heartbeatTimeout=window.setTimeout(()=>{console.warn("[WebSocket] Heartbeat timeout, closing connection"),this.ws?.close()},1e4))},12e4)}stopHeartbeat(){this.heartbeatInterval!==null&&(clearInterval(this.heartbeatInterval),this.heartbeatInterval=null),this.heartbeatTimeout!==null&&(clearTimeout(this.heartbeatTimeout),this.heartbeatTimeout=null)}resetHeartbeatTimeout(){this.heartbeatTimeout!==null&&(clearTimeout(this.heartbeatTimeout),this.heartbeatTimeout=null)}disconnect(){this.shouldReconnect=!1,this.connectionStatus="disconnecting",this.reconnectTimeout!==null&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=null),this.connectionTimeout!==null&&(clearTimeout(this.connectionTimeout),this.connectionTimeout=null),this.stopHeartbeat(),this.ws&&(this.ws.close(),this.ws=null)}reconnectManually(){this.shouldReconnect=!0,this.reconnectAttempt=0,typeof at<"u"&&at.getState().resetAttempts(),this.connect()}isConnected(){return this.ws?.readyState===WebSocket.OPEN&&this.connectionStatus!=="error"}getConnectionStatus(){return this.connectionStatus}getBufferedMessageCount(){return this.messageBuffer.length}getStatus(){if(!this.ws)return"disconnected";switch(this.ws.readyState){case WebSocket.CONNECTING:return"connecting";case WebSocket.OPEN:return"connected";case WebSocket.CLOSING:return"disconnecting";case WebSocket.CLOSED:return"disconnected";default:return"disconnected"}}}let Zi=null;const J7=e=>{if(!Zi)throw new Error("WebSocket client not initialized");return Zi},eU=e=>(Zi&&Zi.disconnect(),Zi=new Q7(e),Zi),tU=[],nU=({nodeId:e,nodeType:n})=>{const[a,i]=q.useState(!0),[o,l]=q.useState(!1),c=IN(v=>v.outputs.get(e)??tU),d=IN(v=>v.addOutput);q.useEffect(()=>{if(n!=="agent")return;(async()=>{l(!0);try{const m=await fetch(`/api/streaming-history/${e}`);if(m.ok){const b=await m.json();b.events&&Array.isArray(b.events)&&b.events.forEach(_=>{d(e,_)})}}catch(m){console.error(`Failed to fetch streaming history for ${e}:`,m)}finally{l(!1)}})()},[e,n,d]),q.useEffect(()=>{if(n!=="agent")return;const v=J7(),m=b=>{b.agent_name===e&&d(e,b)};return v.on("streaming_output",m),()=>{v.off("streaming_output",m)}},[e,n,d]);const f=q.useMemo(()=>{let v="";for(const m of c)m.output_type==="llm_token"?v+=m.content:(v&&!v.endsWith(`
`)&&(v+=`
`),v+=m.content,v+=`
`);return v},[c]),h=q.useRef(null);q.useEffect(()=>{a&&h.current&&h.current.scrollIntoView({behavior:"smooth"})},[f,a]);const p=c.some(v=>v.is_final);return g.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",background:"var(--color-bg-elevated)"},children:[g.jsxs("div",{style:{padding:"var(--space-component-sm) var(--space-component-md)",background:"var(--color-bg-surface)",borderBottom:"var(--border-width-1) solid var(--color-border-subtle)",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[g.jsxs("span",{style:{color:"var(--color-text-tertiary)",fontSize:"var(--font-size-caption)",fontWeight:"var(--font-weight-medium)",fontFamily:"var(--font-family-sans)"},children:[c.length," ",c.length===1?"event":"events"]}),g.jsxs("label",{style:{color:"var(--color-text-tertiary)",fontSize:"var(--font-size-caption)",fontFamily:"var(--font-family-sans)",display:"flex",alignItems:"center",gap:"var(--gap-sm)",cursor:"pointer",userSelect:"none"},children:[g.jsx("input",{type:"checkbox",checked:a,onChange:v=>i(v.target.checked),style:{cursor:"pointer",accentColor:"var(--color-primary-500)"}}),"Auto-scroll"]})]}),g.jsx("div",{"data-testid":`live-output-${e}`,style:{flex:1,overflow:"auto",position:"relative",padding:"var(--spacing-2)"},children:o?g.jsx("div",{style:{padding:"var(--space-layout-md)",color:"var(--color-text-muted)",fontSize:"var(--font-size-body-sm)",fontFamily:"var(--font-family-sans)",textAlign:"center"},children:"Loading history..."}):c.length===0?g.jsx("div",{"data-testid":"empty-output",style:{padding:"var(--space-layout-md)",color:"var(--color-text-muted)",fontSize:"var(--font-size-body-sm)",fontFamily:"var(--font-family-sans)",textAlign:"center"},children:"Idle - no output"}):g.jsxs(g.Fragment,{children:[g.jsx("pre",{style:{margin:0,color:"var(--color-tertiary-400)",fontFamily:"var(--font-family-mono)",fontSize:"var(--font-size-caption)",whiteSpace:"pre-wrap",wordBreak:"break-word",lineHeight:"var(--line-height-relaxed)"},children:f}),p&&g.jsx("div",{"data-testid":"final-marker",style:{color:"var(--color-text-muted)",fontSize:"var(--font-size-caption)",fontFamily:"var(--font-family-mono)",padding:"var(--spacing-2) 0",borderTop:"var(--border-width-1) solid var(--color-border-subtle)",marginTop:"var(--spacing-2)"},children:"--- End of output ---"}),g.jsx("div",{ref:h})]})})]})},rU=({nodeId:e,nodeType:n})=>{const a=Me(p=>p.messages),i=Me(p=>p.agents),[o,l]=q.useState(new Set),c=q.useMemo(()=>{const p=[];if(n==="agent"){const v=i.get(e);if(!v)return p;a.forEach(m=>{const b=v.subscriptions.includes(m.type),_=m.producedBy===e;b&&p.push({id:m.id,type:m.type,direction:"consumed",payload:m.payload,timestamp:m.timestamp,correlationId:m.correlationId}),_&&p.push({id:`${m.id}-published`,type:m.type,direction:"published",payload:m.payload,timestamp:m.timestamp,correlationId:m.correlationId})})}else if(n==="message"){const v=a.get(e);v&&p.push({id:v.id,type:v.type,direction:"published",payload:v.payload,timestamp:v.timestamp,correlationId:v.correlationId})}return p.sort((v,m)=>m.timestamp-v.timestamp)},[e,n,a,i]),d=p=>new Date(p).toLocaleString(),f=p=>{try{return JSON.stringify(p,null,2)}catch{return String(p)}},h=p=>{l(v=>{const m=new Set(v);return m.has(p)?m.delete(p):m.add(p),m})};return g.jsx("div",{"data-testid":`message-history-${e}`,style:{height:"100%",overflow:"auto",background:"var(--color-bg-elevated)",color:"var(--color-text-primary)"},children:c.length===0?g.jsx("div",{"data-testid":"empty-messages",style:{padding:"var(--space-layout-md)",color:"var(--color-text-muted)",fontSize:"var(--font-size-body-sm)",fontFamily:"var(--font-family-sans)",textAlign:"center"},children:"No messages yet"}):g.jsxs("table",{"data-testid":"message-table",style:{width:"100%",borderCollapse:"collapse",fontSize:"var(--font-size-caption)",fontFamily:"var(--font-family-sans)"},children:[g.jsx("thead",{children:g.jsxs("tr",{style:{background:"var(--color-bg-surface)",borderBottom:"var(--border-width-1) solid var(--color-border-subtle)",position:"sticky",top:0,zIndex:1},children:[g.jsx("th",{style:{padding:"var(--space-component-sm) var(--space-component-md)",textAlign:"left",fontWeight:"var(--font-weight-semibold)",color:"var(--color-text-secondary)"},children:"Time"}),g.jsx("th",{style:{padding:"var(--space-component-sm) var(--space-component-md)",textAlign:"left",fontWeight:"var(--font-weight-semibold)",color:"var(--color-text-secondary)"},children:"Direction"}),g.jsx("th",{style:{padding:"var(--space-component-sm) var(--space-component-md)",textAlign:"left",fontWeight:"var(--font-weight-semibold)",color:"var(--color-text-secondary)"},children:"Type"}),g.jsx("th",{style:{padding:"var(--space-component-sm) var(--space-component-md)",textAlign:"left",fontWeight:"var(--font-weight-semibold)",color:"var(--color-text-secondary)"},children:"Correlation ID"}),g.jsx("th",{style:{padding:"var(--space-component-sm) var(--space-component-md)",textAlign:"left",fontWeight:"var(--font-weight-semibold)",color:"var(--color-text-secondary)"},children:"Payload"})]})}),g.jsx("tbody",{children:c.map(p=>{const v=o.has(p.id);return g.jsx(Kn.Fragment,{children:g.jsxs("tr",{"data-testid":`message-row-${p.id}`,style:{borderBottom:"var(--border-width-1) solid var(--color-border-subtle)",cursor:"pointer",transition:"var(--transition-colors)"},onClick:()=>h(p.id),onMouseEnter:m=>{m.currentTarget.style.background="var(--color-bg-surface)"},onMouseLeave:m=>{m.currentTarget.style.background="transparent"},children:[g.jsx("td",{"data-testid":`msg-time-${p.id}`,style:{padding:"var(--space-component-sm) var(--space-component-md)",whiteSpace:"nowrap",color:"var(--color-text-tertiary)"},children:d(p.timestamp)}),g.jsx("td",{"data-testid":`msg-direction-${p.id}`,style:{padding:"var(--space-component-sm) var(--space-component-md)",color:p.direction==="consumed"?"var(--color-tertiary-400)":"var(--color-success-light)",fontWeight:"var(--font-weight-semibold)"},children:p.direction==="consumed"?"↓ Consumed":"↑ Published"}),g.jsx("td",{"data-testid":`msg-type-${p.id}`,style:{padding:"var(--space-component-sm) var(--space-component-md)",fontFamily:"var(--font-family-mono)",color:"var(--color-text-primary)"},children:p.type}),g.jsx("td",{"data-testid":`msg-correlation-${p.id}`,style:{padding:"var(--space-component-sm) var(--space-component-md)",fontFamily:"var(--font-family-mono)",fontSize:"var(--font-size-overline)",color:"var(--color-text-muted)"},children:p.correlationId}),g.jsx("td",{"data-testid":`msg-payload-${p.id}`,style:{padding:"var(--space-component-sm) var(--space-component-md)",maxWidth:"300px"},children:g.jsx("pre",{style:{fontSize:"var(--font-size-overline)",fontFamily:"var(--font-family-mono)",maxHeight:v?"none":"60px",overflow:v?"visible":"hidden",textOverflow:"ellipsis",margin:0,whiteSpace:v?"pre-wrap":"nowrap",color:"var(--color-text-secondary)",background:"var(--color-bg-base)",padding:"var(--spacing-1)",borderRadius:"var(--radius-sm)"},children:f(p.payload)})})]})},p.id)})})]})})},aU=({nodeId:e,nodeType:n})=>{const a=Me(f=>f.runs),i=q.useMemo(()=>{const f=[];return n!=="agent"?f:(a.forEach(h=>{if(h.agent_name===e){const p=h.started_at?new Date(h.started_at).getTime():Date.now(),v=h.completed_at?new Date(h.completed_at).getTime():Date.now();let m="idle";h.status==="active"?m="processing":h.status==="error"?m="error":m="idle",f.push({runId:h.run_id,startTime:p,endTime:v,duration:h.duration_ms||0,status:m,metrics:h.metrics||{},errorMessage:h.error_message||void 0})}}),f.sort((h,p)=>p.startTime-h.startTime))},[e,n,a]),o=f=>new Date(f).toLocaleString(),l=f=>f<1e3?`${f}ms`:f<6e4?`${(f/1e3).toFixed(2)}s`:`${(f/6e4).toFixed(2)}m`,c=f=>{switch(f){case"idle":return"var(--color-success-light)";case"processing":return"var(--color-tertiary-400)";case"error":return"var(--color-error-light)";default:return"var(--color-text-primary)"}},d=f=>{switch(f){case"idle":return"Completed";case"processing":return"Processing";case"error":return"Error";default:return f}};return g.jsx("div",{"data-testid":`run-status-${e}`,style:{height:"100%",overflow:"auto",background:"var(--color-bg-elevated)",color:"var(--color-text-primary)"},children:i.length===0?g.jsx("div",{"data-testid":"empty-runs",style:{padding:"var(--space-layout-md)",color:"var(--color-text-muted)",fontSize:"var(--font-size-body-sm)",fontFamily:"var(--font-family-sans)",textAlign:"center"},children:"No previous runs"}):g.jsxs("table",{"data-testid":"run-table",style:{width:"100%",borderCollapse:"collapse",fontSize:"var(--font-size-caption)",fontFamily:"var(--font-family-sans)"},children:[g.jsx("thead",{children:g.jsxs("tr",{style:{background:"var(--color-bg-surface)",borderBottom:"var(--border-width-1) solid var(--color-border-subtle)",position:"sticky",top:0,zIndex:1},children:[g.jsx("th",{style:{padding:"var(--space-component-sm) var(--space-component-md)",textAlign:"left",fontWeight:"var(--font-weight-semibold)",color:"var(--color-text-secondary)"},children:"Run ID"}),g.jsx("th",{style:{padding:"var(--space-component-sm) var(--space-component-md)",textAlign:"left",fontWeight:"var(--font-weight-semibold)",color:"var(--color-text-secondary)"},children:"Start Time"}),g.jsx("th",{style:{padding:"var(--space-component-sm) var(--space-component-md)",textAlign:"left",fontWeight:"var(--font-weight-semibold)",color:"var(--color-text-secondary)"},children:"Duration"}),g.jsx("th",{style:{padding:"var(--space-component-sm) var(--space-component-md)",textAlign:"left",fontWeight:"var(--font-weight-semibold)",color:"var(--color-text-secondary)"},children:"Status"}),g.jsx("th",{style:{padding:"var(--space-component-sm) var(--space-component-md)",textAlign:"left",fontWeight:"var(--font-weight-semibold)",color:"var(--color-text-secondary)"},children:"Metrics"})]})}),g.jsx("tbody",{children:i.map(f=>g.jsxs("tr",{"data-testid":`run-row-${f.runId}`,style:{borderBottom:"var(--border-width-1) solid var(--color-border-subtle)",transition:"var(--transition-colors)"},onMouseEnter:h=>{h.currentTarget.style.background="var(--color-bg-surface)"},onMouseLeave:h=>{h.currentTarget.style.background="transparent"},children:[g.jsx("td",{"data-testid":`run-id-${f.runId}`,style:{padding:"var(--space-component-sm) var(--space-component-md)",fontFamily:"var(--font-family-mono)",fontSize:"var(--font-size-overline)",maxWidth:"150px",overflow:"hidden",textOverflow:"ellipsis",color:"var(--color-text-muted)"},children:f.runId}),g.jsx("td",{"data-testid":`run-start-${f.runId}`,style:{padding:"var(--space-component-sm) var(--space-component-md)",whiteSpace:"nowrap",color:"var(--color-text-tertiary)"},children:o(f.startTime)}),g.jsx("td",{"data-testid":`run-duration-${f.runId}`,style:{padding:"var(--space-component-sm) var(--space-component-md)",fontFamily:"var(--font-family-mono)",color:"var(--color-text-secondary)"},children:l(f.duration)}),g.jsxs("td",{"data-testid":`run-status-${f.runId}`,style:{padding:"var(--space-component-sm) var(--space-component-md)",color:c(f.status),fontWeight:"var(--font-weight-semibold)"},children:[d(f.status),f.errorMessage&&g.jsx("div",{style:{fontSize:"var(--font-size-overline)",color:"var(--color-text-muted)",marginTop:"var(--spacing-1)",fontStyle:"italic"},children:f.errorMessage})]}),g.jsx("td",{"data-testid":`run-metrics-${f.runId}`,style:{padding:"var(--space-component-sm) var(--space-component-md)"},children:g.jsxs("div",{style:{fontSize:"var(--font-size-overline)",fontFamily:"var(--font-family-mono)",color:"var(--color-text-muted)"},children:[f.metrics.tokensUsed!==void 0&&g.jsxs("div",{children:["Tokens: ",f.metrics.tokensUsed]}),f.metrics.costUsd!==void 0&&g.jsxs("div",{children:["Cost: $",f.metrics.costUsd.toFixed(4)]}),f.metrics.artifactsProduced!==void 0&&g.jsxs("div",{children:["Artifacts: ",f.metrics.artifactsProduced]}),Object.keys(f.metrics).length===0&&g.jsx("div",{children:"-"})]})})]},f.runId))})]})})},iU=({nodeId:e,nodeType:n="agent"})=>{const a=ut(p=>p.detailWindows.get(e)),i=ut(p=>p.updateDetailWindow),o=ut(p=>p.closeDetailWindow),l=q.useCallback(()=>{o(e)},[e,o]),c=q.useCallback(p=>{i(e,{activeTab:p})},[e,i]);if(!a)return null;const{position:d,size:f,activeTab:h}=a;return g.jsx(ez,{position:d,size:f,onDragStop:(p,v)=>{i(e,{position:{x:v.x,y:v.y}})},onResizeStop:(p,v,m,b,_)=>{i(e,{size:{width:parseInt(m.style.width,10),height:parseInt(m.style.height,10)},position:_})},minWidth:600,minHeight:400,bounds:"parent",dragHandleClassName:"window-header",style:{zIndex:1e3,display:"flex",flexDirection:"column",pointerEvents:"all"},children:g.jsxs("div",{style:{display:"flex",flexDirection:"column",width:"100%",height:"100%",background:"var(--color-glass-bg)",border:"var(--border-width-1) solid var(--color-glass-border)",borderRadius:"var(--radius-xl)",overflow:"hidden",boxShadow:"var(--shadow-xl)",backdropFilter:"blur(var(--blur-lg))",WebkitBackdropFilter:"blur(var(--blur-lg))"},children:[g.jsxs("div",{className:"window-header",style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"var(--space-component-md) var(--space-component-lg)",background:"rgba(42, 42, 50, 0.5)",borderBottom:"var(--border-width-1) solid var(--color-border-subtle)",cursor:"move",userSelect:"none"},children:[g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--gap-md)"},children:[g.jsx("div",{style:{width:"10px",height:"10px",borderRadius:"var(--radius-circle)",background:n==="agent"?"var(--color-primary-500)":"var(--color-warning)",boxShadow:n==="agent"?"0 0 8px var(--color-primary-500)":"0 0 8px var(--color-warning)"}}),g.jsxs("span",{style:{color:"var(--color-text-primary)",fontSize:"var(--font-size-body-sm)",fontWeight:"var(--font-weight-semibold)",fontFamily:"var(--font-family-sans)"},children:[n==="agent"?"Agent":"Message",": ",e]})]}),g.jsx("button",{onClick:l,"aria-label":"Close window",style:{background:"transparent",border:"none",color:"var(--color-text-secondary)",fontSize:"var(--font-size-h3)",cursor:"pointer",padding:"var(--spacing-1) var(--spacing-2)",lineHeight:1,borderRadius:"var(--radius-md)",transition:"var(--transition-colors)",display:"flex",alignItems:"center",justifyContent:"center"},onMouseEnter:p=>{p.currentTarget.style.color="var(--color-error)",p.currentTarget.style.background="var(--color-error-bg)"},onMouseLeave:p=>{p.currentTarget.style.color="var(--color-text-secondary)",p.currentTarget.style.background="transparent"},children:"×"})]}),g.jsx("div",{style:{display:"flex",gap:"var(--gap-sm)",padding:"var(--space-component-sm) var(--space-component-lg)",background:"rgba(35, 35, 41, 0.4)",borderBottom:"var(--border-width-1) solid var(--color-border-subtle)"},children:["liveOutput","messageHistory","runStatus"].map(p=>{const v=h===p;return g.jsx("button",{onClick:()=>c(p),style:{position:"relative",padding:"var(--space-component-sm) var(--space-component-md)",background:v?"var(--color-bg-surface)":"transparent",border:"none",borderRadius:"var(--radius-md)",color:v?"var(--color-text-primary)":"var(--color-text-secondary)",fontSize:"var(--font-size-body-sm)",fontWeight:v?"var(--font-weight-semibold)":"var(--font-weight-medium)",fontFamily:"var(--font-family-sans)",cursor:"pointer",transition:"var(--transition-colors)",borderBottom:v?"2px solid var(--color-primary-500)":"2px solid transparent"},onMouseEnter:m=>{v||(m.currentTarget.style.background="var(--color-bg-elevated)",m.currentTarget.style.color="var(--color-text-primary)")},onMouseLeave:m=>{v||(m.currentTarget.style.background="transparent",m.currentTarget.style.color="var(--color-text-secondary)")},children:p==="liveOutput"?"Live Output":p==="messageHistory"?"Message History":"Run Status"},p)})}),g.jsxs("div",{style:{flex:1,overflow:"hidden",background:"var(--color-bg-surface)"},children:[h==="liveOutput"&&g.jsx(nU,{nodeId:e,nodeType:n}),h==="messageHistory"&&g.jsx(rU,{nodeId:e,nodeType:n}),h==="runStatus"&&g.jsx(aU,{nodeId:e,nodeType:n})]})]})})},oU=()=>{const e=ut(l=>l.detailWindows),n=ut(l=>l.mode),a=Me(l=>l.agents),i=Me(l=>l.messages),o=Array.from(e.entries());return g.jsx("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,pointerEvents:"none",zIndex:999},children:g.jsx("div",{style:{position:"relative",width:"100%",height:"100%",pointerEvents:"none"},children:o.map(([l,c])=>{let d="agent";return n==="agent"?a.has(l)&&(d="agent"):n==="blackboard"&&i.has(l)&&(d="message"),g.jsx(iU,{nodeId:l,nodeType:d},l)})})})},sU="_container_18lbh_1",lU="_inputWrapper_18lbh_11",cU="_input_18lbh_11",uU="_clearButton_18lbh_67",dU="_dropdown_18lbh_105",fU="_dropdownEmpty_18lbh_135",hU="_dropdownItem_18lbh_149",pU="_correlationId_18lbh_179",gU="_metadata_18lbh_197",Cr={container:sU,inputWrapper:lU,input:cU,clearButton:uU,dropdown:dU,dropdownEmpty:fU,dropdownItem:hU,correlationId:pU,metadata:gU},vU=e=>{const n=Math.floor((Date.now()-e)/1e3);if(n<60)return`${n}s ago`;const a=Math.floor(n/60);if(a<60)return`${a}m ago`;const i=Math.floor(a/60);return i<24?`${i}h ago`:`${Math.floor(i/24)}d ago`},mU=()=>{const e=Te(_=>_.correlationId),n=Te(_=>_.availableCorrelationIds),a=Te(_=>_.setCorrelationId),[i,o]=q.useState(e||""),[l,c]=q.useState(!1),d=q.useRef(null);q.useEffect(()=>{o(e||"")},[e]),q.useEffect(()=>{const _=S=>{d.current&&!d.current.contains(S.target)&&c(!1)};return document.addEventListener("mousedown",_),()=>document.removeEventListener("mousedown",_)},[]);const f=n.filter(_=>_.correlation_id.toLowerCase().includes(i.toLowerCase())),h=_=>{a(_),o(_),c(!1)},p=()=>{a(null),o(""),c(!1)},v=_=>{o(_.target.value),c(!0)},m=()=>{c(!0)},b=()=>{setTimeout(()=>c(!1),200)};return g.jsxs("div",{ref:d,className:Cr.container,children:[g.jsxs("div",{className:Cr.inputWrapper,children:[g.jsx("input",{type:"text",value:i,onChange:v,onFocus:m,onBlur:b,placeholder:"Search correlation ID...",className:Cr.input}),e&&g.jsx("button",{onClick:p,"aria-label":"Clear",className:Cr.clearButton,children:"×"})]}),l&&g.jsx("div",{className:Cr.dropdown,children:f.length===0?g.jsx("div",{className:Cr.dropdownEmpty,children:"No correlation IDs found"}):f.map(_=>g.jsxs("div",{onClick:()=>h(_.correlation_id),className:Cr.dropdownItem,children:[g.jsx("div",{className:Cr.correlationId,children:_.correlation_id}),g.jsxs("div",{className:Cr.metadata,children:[_.artifact_count," messages, ",vU(_.first_seen)]})]},_.correlation_id))})]})},yU="_container_kluuc_1",bU="_presetButtons_kluuc_13",xU="_presetButton_kluuc_13",_U="_active_kluuc_65",SU="_presetButtonAll_kluuc_87",wU="_customRange_kluuc_133",EU="_dateInputGroup_kluuc_153",CU="_dateLabel_kluuc_165",TU="_dateInput_kluuc_153",En={container:yU,presetButtons:bU,presetButton:xU,active:_U,presetButtonAll:SU,customRange:wU,dateInputGroup:EU,dateLabel:CU,dateInput:TU},jU=()=>{const e=Te(d=>d.timeRange),n=Te(d=>d.setTimeRange),a=d=>{if(d==="custom"){const f=Date.now(),h=f-36e5;n({preset:"custom",start:h,end:f})}else n({preset:d})},i=d=>{const f=new Date(d.target.value).getTime();n({preset:"custom",start:f,end:e.end||Date.now()})},o=d=>{const f=new Date(d.target.value).getTime();n({preset:"custom",start:e.start||Date.now()-36e5,end:f})},l=d=>new Date(d).toISOString().slice(0,16),c=[{preset:"all",label:"All"},{preset:"last5min",label:"Last 5 min"},{preset:"last10min",label:"Last 10 min"},{preset:"last1hour",label:"Last hour"},{preset:"custom",label:"Custom"}];return g.jsxs("div",{className:En.container,children:[g.jsx("div",{className:En.presetButtons,children:c.map(({preset:d,label:f})=>g.jsx("button",{onClick:()=>a(d),className:[En.presetButton,d==="all"?En.presetButtonAll:"",e.preset===d?En.active:""].filter(Boolean).join(" "),children:f},d))}),e.preset==="custom"&&g.jsxs("div",{className:En.customRange,children:[g.jsxs("div",{className:En.dateInputGroup,children:[g.jsx("label",{htmlFor:"start-time",className:En.dateLabel,children:"Start"}),g.jsx("input",{id:"start-time",type:"datetime-local",value:e.start?l(e.start):"",onChange:i,className:En.dateInput})]}),g.jsxs("div",{className:En.dateInputGroup,children:[g.jsx("label",{htmlFor:"end-time",className:En.dateLabel,children:"End"}),g.jsx("input",{id:"end-time",type:"datetime-local",value:e.end?l(e.end):"",onChange:o,className:En.dateInput})]})]})]})},so=({options:e,selected:n,onChange:a,placeholder:i="Select items...",disabled:o=!1})=>{const[l,c]=q.useState(!1),[d,f]=q.useState(""),[h,p]=q.useState(0),v=q.useRef(null),m=q.useRef(null),b=e.filter(C=>!n.includes(C)&&C.toLowerCase().includes(d.toLowerCase()));q.useEffect(()=>{const C=T=>{v.current&&!v.current.contains(T.target)&&(c(!1),f(""))};return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[]);const _=C=>{a([...n,C]),f(""),p(0),m.current?.focus()},S=C=>{a(n.filter(T=>T!==C))},w=C=>{if(!o)switch(C.key){case"ArrowDown":C.preventDefault(),p(T=>Math.min(T+1,b.length-1));break;case"ArrowUp":C.preventDefault(),p(T=>Math.max(T-1,0));break;case"Enter":C.preventDefault(),b[h]&&_(b[h]);break;case"Escape":c(!1),f("");break;case"Backspace":if(d===""&&n.length>0){const T=n[n.length-1];T&&S(T)}break}};return g.jsxs("div",{ref:v,style:{position:"relative"},children:[g.jsxs("div",{onClick:()=>!o&&m.current?.focus(),style:{minHeight:"38px",padding:"var(--space-xs)",backgroundColor:o?"rgba(0, 0, 0, 0.2)":"rgba(0, 0, 0, 0.3)",border:`1px solid ${l?"rgba(96, 165, 250, 0.5)":"rgba(255, 255, 255, 0.1)"}`,borderRadius:"var(--radius-sm)",display:"flex",flexWrap:"wrap",gap:"var(--gap-xs)",cursor:o?"not-allowed":"text",transition:"border-color 0.2s",opacity:o?.6:1},children:[n.map(C=>g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--gap-xs)",padding:"2px 8px",backgroundColor:"rgba(96, 165, 250, 0.2)",border:"1px solid rgba(96, 165, 250, 0.4)",borderRadius:"var(--radius-sm)",fontSize:"var(--font-size-sm)",color:"#60a5fa",maxWidth:"100%",overflow:"hidden"},children:[g.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},title:C,children:C}),!o&&g.jsx("button",{onClick:T=>{T.stopPropagation(),S(C)},style:{background:"none",border:"none",color:"#60a5fa",cursor:"pointer",padding:0,display:"flex",alignItems:"center",fontSize:"14px",lineHeight:1,flexShrink:0},children:"×"})]},C)),g.jsx("input",{ref:m,type:"text",value:d,onChange:C=>{f(C.target.value),c(!0),p(0)},onFocus:()=>!o&&c(!0),onKeyDown:w,placeholder:n.length===0?i:"",disabled:o,style:{flex:1,minWidth:"120px",background:"transparent",border:"none",outline:"none",color:"var(--color-text-primary)",fontSize:"var(--font-size-base)",padding:"4px"}})]}),l&&!o&&b.length>0&&g.jsx("div",{style:{position:"absolute",top:"calc(100% + 4px)",left:0,right:0,maxHeight:"240px",overflowY:"auto",backgroundColor:"rgba(0, 0, 0, 0.9)",border:"1px solid rgba(96, 165, 250, 0.3)",borderRadius:"var(--radius-sm)",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.5)",zIndex:1e3},children:b.map((C,T)=>g.jsx("div",{onClick:()=>_(C),onMouseEnter:()=>p(T),style:{padding:"var(--space-xs) var(--space-sm)",cursor:"pointer",backgroundColor:T===h?"rgba(96, 165, 250, 0.2)":"transparent",color:T===h?"#60a5fa":"var(--color-text-primary)",fontSize:"var(--font-size-sm)",transition:"background-color 0.15s"},children:C},C))})]})},NU=()=>{const e=Te(i=>i.availableArtifactTypes),n=Te(i=>i.selectedArtifactTypes),a=Te(i=>i.setArtifactTypes);return g.jsx(so,{options:e,selected:n,onChange:a,placeholder:e.length?"Select types…":"No types available",disabled:e.length===0})},RU=()=>{const e=Te(i=>i.availableProducers),n=Te(i=>i.selectedProducers),a=Te(i=>i.setProducers);return g.jsx(so,{options:e,selected:n,onChange:a,placeholder:e.length?"Select producers…":"No producers",disabled:e.length===0})},MU=()=>{const e=Te(i=>i.availableTags),n=Te(i=>i.selectedTags),a=Te(i=>i.setTags);return g.jsx(so,{options:e,selected:n,onChange:a,placeholder:e.length?"Select tags…":"No tags available",disabled:e.length===0})},AU=()=>{const e=Te(i=>i.availableVisibility),n=Te(i=>i.selectedVisibility),a=Te(i=>i.setVisibility);return g.jsx(so,{options:e,selected:n,onChange:a,placeholder:e.length?"Select visibility…":"No visibility options",disabled:e.length===0})},zU="_container_9ted7_1",DU="_controlsRow_9ted7_13",kU="_select_9ted7_27",OU="_saveButton_9ted7_45",qU="_applyButton_9ted7_47",BU="_deleteButton_9ted7_49",LU="_error_9ted7_113",qa={container:zU,controlsRow:DU,select:kU,saveButton:OU,applyButton:qU,deleteButton:BU,error:LU},HU=()=>{const e=Te(w=>w.savedFilters),n=Te(w=>w.setSavedFilters),a=Te(w=>w.addSavedFilter),i=Te(w=>w.removeSavedFilter),o=Te(w=>w.getFilterSnapshot),l=Te(w=>w.applyFilterSnapshot),[c,d]=q.useState(""),[f,h]=q.useState(!0),[p,v]=q.useState(null),m=q.useRef(0);m.current+=1,q.useEffect(()=>{let w=!0;return(async()=>{try{await Cn.initialize();const C=await Cn.getAllFilterPresets();if(!w)return;n(C),C.length>0?d(C[0]?.filter_id??""):d(""),v(null)}catch(C){console.error("[SavedFilters] Failed to load presets",C),w&&v("Unable to load saved presets")}finally{w&&h(!1)}})(),()=>{w=!1}},[n]);const b=async()=>{const w=window.prompt("Save current filters as preset. Enter a name:");if(!(!w||!w.trim()))try{const C={filter_id:typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():`filter-${Date.now()}`,name:w.trim(),created_at:Date.now(),filters:o()};await Cn.saveFilterPreset(C),a(C),d(C.filter_id),v(null)}catch(C){console.error("[SavedFilters] Failed to save preset",C),v("Failed to save preset")}},_=()=>{if(!c)return;const w=e.find(C=>C.filter_id===c);w&&l(w.filters)},S=async()=>{if(c)try{await Cn.deleteFilterPreset(c),i(c);const w=e.filter(C=>C.filter_id!==c);d(w[0]?.filter_id??""),v(null)}catch(w){console.error("[SavedFilters] Failed to delete preset",w),v("Failed to delete preset")}};return g.jsxs("div",{className:qa.container,children:[g.jsxs("div",{className:qa.controlsRow,children:[g.jsx("button",{type:"button",className:qa.saveButton,onClick:b,disabled:f,children:"Save Current"}),g.jsxs("select",{className:qa.select,value:c,onChange:w=>d(w.target.value),disabled:f||e.length===0,"aria-label":"Saved filter presets",children:[e.length===0&&g.jsx("option",{value:"",children:"No presets"}),e.map(w=>g.jsx("option",{value:w.filter_id,children:w.name},w.filter_id))]}),g.jsx("button",{type:"button",className:qa.applyButton,onClick:_,disabled:!c,children:"Apply"}),g.jsx("button",{type:"button",className:qa.deleteButton,onClick:S,disabled:!c,children:"Delete"})]}),p&&g.jsx("div",{className:qa.error,children:p})]})},IU="_panel_knkln_1",UU="_header_knkln_33",VU="_title_knkln_51",FU="_subtitle_knkln_63",PU="_closeButton_knkln_75",GU="_content_knkln_109",$U="_section_knkln_127",YU="_sectionLabel_knkln_139",WU="_separator_knkln_155",rt={panel:IU,header:UU,title:VU,subtitle:FU,closeButton:PU,content:GU,section:$U,sectionLabel:YU,separator:WU},XU=({onClose:e})=>g.jsxs("aside",{className:rt.panel,role:"dialog","aria-label":"Filters",children:[g.jsxs("header",{className:rt.header,children:[g.jsxs("div",{children:[g.jsx("h2",{className:rt.title,children:"Filters"}),g.jsx("p",{className:rt.subtitle,children:"Slice historical data without losing your place."})]}),g.jsx("button",{type:"button",className:rt.closeButton,onClick:e,"aria-label":"Close filters",children:"×"})]}),g.jsxs("div",{className:rt.content,children:[g.jsxs("section",{className:rt.section,children:[g.jsx("h3",{className:rt.sectionLabel,children:"Presets"}),g.jsx(HU,{})]}),g.jsx("div",{className:rt.separator,role:"presentation"}),g.jsxs("section",{className:rt.section,children:[g.jsx("h3",{className:rt.sectionLabel,children:"Correlation"}),g.jsx(mU,{})]}),g.jsx("div",{className:rt.separator,role:"presentation"}),g.jsxs("section",{className:rt.section,children:[g.jsx("h3",{className:rt.sectionLabel,children:"Time Range"}),g.jsx(jU,{})]}),g.jsx("div",{className:rt.separator,role:"presentation"}),g.jsxs("section",{className:rt.section,children:[g.jsx("h3",{className:rt.sectionLabel,children:"Artifact Types"}),g.jsx(NU,{})]}),g.jsx("div",{className:rt.separator,role:"presentation"}),g.jsxs("section",{className:rt.section,children:[g.jsx("h3",{className:rt.sectionLabel,children:"Producers"}),g.jsx(RU,{})]}),g.jsx("div",{className:rt.separator,role:"presentation"}),g.jsxs("section",{className:rt.section,children:[g.jsx("h3",{className:rt.sectionLabel,children:"Tags"}),g.jsx(MU,{})]}),g.jsx("div",{className:rt.separator,role:"presentation"}),g.jsxs("section",{className:rt.section,children:[g.jsx("h3",{className:rt.sectionLabel,children:"Visibility"}),g.jsx(AU,{})]})]})]}),KU="_wrapper_1qq57_1",ZU="_container_1qq57_15",QU="_toggleButton_1qq57_37",JU="_toggleButtonActive_1qq57_103",eV="_toggleIcon_1qq57_125",tV="_toggleLabel_1qq57_155",nV="_pill_1qq57_163",rV="_pillAccent_1qq57_227",aV="_textGroup_1qq57_245",iV="_pillTitle_1qq57_259",oV="_pillValue_1qq57_275",sV="_removeButton_1qq57_289",lV="_removeIcon_1qq57_349",dn={wrapper:KU,container:ZU,toggleButton:QU,toggleButtonActive:JU,toggleIcon:eV,toggleLabel:tV,pill:nV,pillAccent:rV,textGroup:aV,pillTitle:iV,pillValue:oV,removeButton:sV,removeIcon:lV},cV=e=>{const n=e.match(/^([^:]+):(.*)$/),a=n?.[1]?.trim()??e.trim(),i=n?.[2]?.trim()??"";return{title:a,value:i}},uV=()=>{const e=_e(p=>p.ui.showFilters),n=_e(p=>p.setShowFilters),a=Te(p=>p.correlationId),i=Te(p=>p.timeRange),o=Te(p=>p.selectedArtifactTypes),l=Te(p=>p.selectedProducers),c=Te(p=>p.selectedTags),d=Te(p=>p.selectedVisibility),f=Te(p=>p.removeFilter),h=q.useMemo(()=>{const p=[];return a&&p.push({type:"correlationId",value:a,label:`Correlation ID: ${a}`}),p.push({type:"timeRange",value:i,label:`Time: ${ab(i)}`}),o.forEach(v=>{p.push({type:"artifactTypes",value:v,label:`Type: ${v}`})}),l.forEach(v=>{p.push({type:"producers",value:v,label:`Producer: ${v}`})}),c.forEach(v=>{p.push({type:"tags",value:v,label:`Tag: ${v}`})}),d.forEach(v=>{p.push({type:"visibility",value:v,label:`Visibility: ${v}`})}),p},[a,i,o,l,c,d]);return h.length===0?null:g.jsxs("div",{className:dn.wrapper,children:[g.jsxs("button",{type:"button",onClick:()=>n(!e),className:`${dn.toggleButton} ${e?dn.toggleButtonActive:""}`,title:`${e?"Hide":"Show"} filter panel (Ctrl+Shift+F)`,"aria-pressed":e,"aria-label":e?"Hide filter panel":"Show filter panel",children:[g.jsx("span",{className:dn.toggleIcon,"aria-hidden":"true",children:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:g.jsx("path",{d:"M2.667 2.667h10.666L9.333 7v4.667l-2.666 1.333V7L2.667 2.667z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),g.jsx("span",{className:dn.toggleLabel,children:"Filter"})]}),g.jsx("div",{className:dn.container,role:"list",children:h.map((p,v)=>{const m=p.type==="timeRange"&&typeof p.value!="string"?`Time: ${ab(p.value)}`:p.label,{title:b,value:_}=cV(m),S=_?`${b} ${_}`:b;return g.jsxs("div",{className:dn.pill,"data-filter-type":p.type,role:"listitem",children:[g.jsx("span",{className:dn.pillAccent,"aria-hidden":"true"}),g.jsxs("div",{className:dn.textGroup,children:[g.jsx("span",{className:dn.pillTitle,children:b}),_&&g.jsx("span",{className:dn.pillValue,children:_})]}),g.jsx("button",{onClick:()=>f(p),"aria-label":`Remove ${S} filter`,className:dn.removeButton,type:"button",children:g.jsx("span",{"aria-hidden":"true",className:dn.removeIcon,children:"×"})})]},`${p.type}-${String(p.value)}-${v}`)})})]})},Ks="/api";class er extends Error{constructor(n,a){super(a.message||a.error),this.status=n,this.errorResponse=a,this.name="ApiError"}}async function dV(){try{const e=await fetch(`${Ks}/artifact-types`,{method:"GET",headers:{"Content-Type":"application/json"}});if(!e.ok){const a=await e.json().catch(()=>({error:"Unknown error",message:"Failed to fetch artifact types"}));throw new er(e.status,a)}return(await e.json()).artifact_types}catch(e){throw e instanceof er?e:new Error("Failed to connect to API server")}}async function fV(){try{const e=await fetch(`${Ks}/agents`,{method:"GET",headers:{"Content-Type":"application/json"}});if(!e.ok){const a=await e.json().catch(()=>({error:"Unknown error",message:"Failed to fetch agents"}));throw new er(e.status,a)}return(await e.json()).agents}catch(e){throw e instanceof er?e:new Error("Failed to connect to API server")}}async function hV(){return(await fV()).map(n=>({id:n.name,name:n.name,status:"idle",subscriptions:n.subscriptions||[],outputTypes:n.output_types||[],lastActive:Date.now(),sentCount:0,recvCount:0,receivedByType:{},sentByType:{}}))}async function pV(e,n){try{const a=await fetch(`${Ks}/control/publish`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({artifact_type:e,content:n})});if(!a.ok){const i=await a.json().catch(()=>({error:"Unknown error",message:"Failed to publish artifact"}));throw new er(a.status,i)}return await a.json()}catch(a){throw a instanceof er?a:new Error("Failed to connect to API server")}}const tz=e=>{const n=new URLSearchParams;return e.types?.forEach(a=>n.append("type",a)),e.producers?.forEach(a=>n.append("produced_by",a)),e.tags?.forEach(a=>n.append("tag",a)),e.visibility?.forEach(a=>n.append("visibility",a)),e.correlationId&&n.append("correlation_id",e.correlationId),e.from&&n.append("from",e.from),e.to&&n.append("to",e.to),typeof e.limit=="number"&&n.append("limit",String(e.limit)),typeof e.offset=="number"&&n.append("offset",String(e.offset)),e.embedMeta&&n.append("embed_meta","true"),n.toString()};async function nz(e={}){const n=tz(e);try{const a=await fetch(`${Ks}/v1/artifacts${n?`?${n}`:""}`,{method:"GET",headers:{"Content-Type":"application/json"}});if(!a.ok){const o=await a.json().catch(()=>({error:"Unknown error",message:"Failed to fetch artifacts"}));throw new er(a.status,o)}return await a.json()}catch(a){throw a instanceof er?a:new Error("Failed to connect to API server")}}async function rz(e={}){const n=tz(e);try{const a=await fetch(`${Ks}/v1/artifacts/summary${n?`?${n}`:""}`,{method:"GET",headers:{"Content-Type":"application/json"}});if(!a.ok){const o=await a.json().catch(()=>({error:"Unknown error",message:"Failed to fetch artifact summary"}));throw new er(a.status,o)}return(await a.json()).summary}catch(a){throw a instanceof er?a:new Error("Failed to connect to API server")}}const gV=()=>{const[e,n]=q.useState([]),[a,i]=q.useState(""),[o,l]=q.useState({}),[c,d]=q.useState(!1),[f,h]=q.useState(!0),[p,v]=q.useState({}),[m,b]=q.useState(""),[_,S]=q.useState(""),[w,C]=q.useState(!0),T=_e(j=>j.setShowControls),E=()=>{T(!1)};q.useEffect(()=>{(async()=>{try{h(!0);const A=await dV();n(A)}catch(A){console.error("Failed to fetch artifact types:",A),S("Failed to load artifact types")}finally{h(!1)}})()},[]),q.useEffect(()=>{if(a){const j=e.find(A=>A.name===a);if(j&&j.schema.properties){const A={};Object.keys(j.schema.properties).forEach(D=>{const I=j.schema.properties[D];I.type==="boolean"?A[D]=!1:(I.type==="number"||I.type,A[D]=I.default??"")}),l(A)}}else l({});v({})},[a,e]);const N=()=>{const j={};if(!a)return j.artifactType="Artifact type is required",v(j),!1;const A=e.find(D=>D.name===a);return A?(A.schema.properties&&Object.entries(A.schema.properties).forEach(([D,I])=>{const P=o[D];if(P===""||P===null||P===void 0){j[D]=`${D} is required`;return}(I.type==="number"||I.type==="integer")&&isNaN(Number(P))&&(j[D]=`${D} must be a number`)}),v(j),Object.keys(j).length===0):(j.artifactType="Invalid artifact type",v(j),!1)},R=async j=>{if(j.preventDefault(),b(""),S(""),!!N()){d(!0);try{const A=e.find(P=>P.name===a),D={};A&&A.schema.properties&&Object.entries(o).forEach(([P,V])=>{const $=A.schema.properties[P];$.type==="number"||$.type==="integer"?D[P]=Number(V):$.type==="boolean"?D[P]=!!V:D[P]=V});const I=await pV(a,D);w&&I.correlation_id?(Te.setState({correlationId:I.correlation_id}),b(`Successfully published artifact. Filter set to: ${I.correlation_id}`)):b(`Successfully published artifact. Correlation ID: ${I.correlation_id}`),i(""),l({}),v({}),setTimeout(()=>{T(!1)},800)}catch(A){A.message.includes("Network error")||A.message.includes("Failed to connect")?S("Network error. Failed to connect to API server."):S(A.message||"Failed to publish artifact")}finally{d(!1)}}},z=(j,A)=>{const D=o[j]??"",I=!!p[j],P=$=>{if(l({...o,[j]:$}),p[j]){const L={...p};delete L[j],v(L)}};return A.type==="boolean"?g.jsxs("div",{className:"publish-control__field",children:[g.jsxs("div",{className:"publish-control__checkbox-wrapper",children:[g.jsx("input",{type:"checkbox",id:`field-${j}`,checked:!!D,onChange:$=>P($.target.checked),disabled:c,className:"publish-control__checkbox"}),g.jsxs("label",{htmlFor:`field-${j}`,className:"publish-control__checkbox-label",children:[A.title||j,A.description&&g.jsxs("span",{className:"publish-control__field-hint",children:[" — ",A.description]})]})]}),I&&g.jsx("div",{className:"publish-control__error-text",children:p[j]})]},j):A.type==="number"||A.type==="integer"?g.jsxs("div",{className:"publish-control__field",children:[g.jsxs("label",{htmlFor:`field-${j}`,className:"publish-control__label",children:[A.title||j,A.description&&g.jsxs("span",{className:"publish-control__field-hint",children:[" — ",A.description]})]}),g.jsx("input",{type:"number",id:`field-${j}`,value:D,onChange:$=>P($.target.value),disabled:c,step:A.type==="integer"?1:"any",className:`publish-control__input ${I?"publish-control__input--error":""}`}),I&&g.jsx("div",{className:"publish-control__error-text",children:p[j]})]},j):A.enum&&Array.isArray(A.enum)?g.jsxs("div",{className:"publish-control__field",children:[g.jsxs("label",{htmlFor:`field-${j}`,className:"publish-control__label",children:[A.title||j,A.description&&g.jsxs("span",{className:"publish-control__field-hint",children:[" — ",A.description]})]}),g.jsxs("select",{id:`field-${j}`,value:D,onChange:$=>P($.target.value),disabled:c,className:`publish-control__select ${I?"publish-control__select--error":""}`,children:[g.jsx("option",{value:"",children:"Select..."}),A.enum.map($=>g.jsx("option",{value:$,children:$},$))]}),I&&g.jsx("div",{className:"publish-control__error-text",children:p[j]})]},j):A.maxLength>100||j.toLowerCase().includes("description")?g.jsxs("div",{className:"publish-control__field",children:[g.jsxs("label",{htmlFor:`field-${j}`,className:"publish-control__label",children:[A.title||j,A.description&&g.jsxs("span",{className:"publish-control__field-hint",children:[" — ",A.description]})]}),g.jsx("textarea",{id:`field-${j}`,value:D,onChange:$=>P($.target.value),disabled:c,rows:4,className:`publish-control__textarea ${I?"publish-control__textarea--error":""}`}),I&&g.jsx("div",{className:"publish-control__error-text",children:p[j]})]},j):g.jsxs("div",{className:"publish-control__field",children:[g.jsxs("label",{htmlFor:`field-${j}`,className:"publish-control__label",children:[A.title||j,A.description&&g.jsxs("span",{className:"publish-control__field-hint",children:[" — ",A.description]})]}),g.jsx("input",{type:"text",id:`field-${j}`,value:D,onChange:$=>P($.target.value),disabled:c,placeholder:A.examples?.[0]||"",className:`publish-control__input ${I?"publish-control__input--error":""}`}),I&&g.jsx("div",{className:"publish-control__error-text",children:p[j]})]},j)};return g.jsx("div",{className:"publish-control-panel",children:g.jsxs("div",{className:"publish-control-panel-inner",children:[g.jsxs("div",{className:"publish-control-header",children:[g.jsx("h2",{className:"publish-control-title",children:"Publish Artifact"}),g.jsx("button",{onClick:E,className:"publish-control-close-button","aria-label":"Close publish panel",title:"Close publish panel (Esc)",children:g.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:g.jsx("path",{d:"M15 5L5 15M5 5l10 10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),g.jsx("div",{className:"publish-control-content",children:g.jsxs("form",{className:"publish-control__form",onSubmit:R,children:[g.jsxs("div",{className:"publish-control__field",children:[g.jsx("label",{htmlFor:"artifact-type",className:"publish-control__label",children:"Artifact Type"}),g.jsxs("select",{id:"artifact-type",value:a,onChange:j=>{i(j.target.value),v({...p,artifactType:void 0})},disabled:f||c,className:`publish-control__select ${p.artifactType?"publish-control__select--error":""}`,children:[g.jsx("option",{value:"",children:"Select an artifact type..."}),e.map(j=>g.jsx("option",{value:j.name,children:j.name},j.name))]}),p.artifactType&&g.jsx("div",{className:"publish-control__error-text",children:p.artifactType})]}),a&&(()=>{const j=e.find(A=>A.name===a);return j&&j.schema.properties?Object.entries(j.schema.properties).map(([A,D])=>z(A,D)):g.jsx("div",{className:"publish-control__field",children:g.jsx("p",{className:"publish-control__hint",children:"Select an artifact type to see form fields"})})})(),g.jsxs("div",{className:"publish-control__checkbox-wrapper",children:[g.jsx("input",{type:"checkbox",id:"auto-set-filter",checked:w,onChange:j=>C(j.target.checked),disabled:c,className:"publish-control__checkbox"}),g.jsx("label",{htmlFor:"auto-set-filter",className:"publish-control__checkbox-label",children:"Set filter to correlation ID (show only this execution)"})]}),g.jsx("button",{type:"submit",disabled:c||f,className:"publish-control__submit",children:c?"Publishing...":"Publish Artifact"}),m&&g.jsx("div",{className:"publish-control__message publish-control__message--success",children:m}),_&&g.jsx("div",{className:"publish-control__message publish-control__message--error",children:_})]})})]})})};function vV(){const e=jr(b=>b.instances),n=Me(b=>b.agents),a=Me(b=>b.messages),i=Me(b=>b.events),o=Te(b=>b.correlationId),l=Te(b=>b.timeRange),c=Te(b=>b.selectedArtifactTypes),d=Te(b=>b.selectedProducers),f=Te(b=>b.selectedTags),h=Te(b=>b.selectedVisibility),p=Te(b=>b.summary),v=q.useRef(new Map),m=q.useMemo(()=>({agents:n,messages:a,events:i,filters:{correlationId:o,timeRange:l,artifactTypes:c,producers:d,tags:f,visibility:h},summary:p,publish:b=>{console.log("[Module Context] Publish artifact:",b)},invoke:(b,_)=>{console.log("[Module Context] Invoke agent:",b,"with inputs:",_)}}),[n,a,i,o,l,c,d,f,h,p]);return q.useEffect(()=>{const b=e,_=v.current,S=new Map;b.forEach((C,T)=>{_.has(T)||S.set(T,C)});const w=new Map;return _.forEach((C,T)=>{b.has(T)||w.set(T,C)}),S.forEach(C=>{const T=Va.get(C.type);if(T?.onMount){console.log(`[useModules] Calling onMount for module: ${T.name} (${C.id})`);try{T.onMount(m)}catch(E){console.error(`[useModules] Error in onMount for module ${T.name}:`,E)}}}),w.forEach(C=>{const T=Va.get(C.type);if(T?.onUnmount){console.log(`[useModules] Calling onUnmount for module: ${T.name} (${C.id})`);try{T.onUnmount()}catch(E){console.error(`[useModules] Error in onUnmount for module ${T.name}:`,E)}}}),v.current=new Map(b),()=>{b.forEach(C=>{const T=Va.get(C.type);if(T?.onUnmount){console.log(`[useModules] Cleanup: Calling onUnmount for module: ${T.name} (${C.id})`);try{T.onUnmount()}catch(E){console.error(`[useModules] Error in cleanup onUnmount for module ${T.name}:`,E)}}})}},[e,m]),{context:m}}const az=q.memo(({instanceId:e})=>{const n=jr(v=>v.instances.get(e)),a=jr(v=>v.updateModule),i=jr(v=>v.removeModule),{context:o}=vV(),l=q.useCallback(()=>{i(e)},[e,i]),c=q.useCallback(()=>{n&&(n.maximized?a(e,{maximized:!1,position:n.preMaximizePosition||n.position,size:n.preMaximizeSize||n.size}):a(e,{maximized:!0,preMaximizePosition:n.position,preMaximizeSize:n.size,position:{x:0,y:0},size:{width:window.innerWidth,height:window.innerHeight}}))},[e,n,a]);if(!n||!n.visible)return null;const d=Va.get(n.type);if(!d)return console.error(`Module definition not found for type: ${n.type}`),null;const{position:f,size:h}=n,p=d.component;return g.jsx(ez,{position:f,size:h,disableDragging:n.maximized,enableResizing:!n.maximized,onDragStop:(v,m)=>{a(e,{position:{x:m.x,y:m.y}})},onResizeStop:(v,m,b,_,S)=>{a(e,{size:{width:parseInt(b.style.width,10),height:parseInt(b.style.height,10)},position:S})},minWidth:1e3,minHeight:500,bounds:"parent",dragHandleClassName:"module-window-header",style:{zIndex:1e3,display:"flex",flexDirection:"column"},children:g.jsxs("div",{style:{display:"flex",flexDirection:"column",width:"100%",height:"100%",background:"var(--color-glass-bg)",border:"var(--border-width-1) solid var(--color-glass-border)",borderRadius:"var(--radius-xl)",overflow:"hidden",boxShadow:"var(--shadow-xl)",backdropFilter:"blur(var(--blur-lg))",WebkitBackdropFilter:"blur(var(--blur-lg))"},children:[g.jsxs("div",{className:"module-window-header",style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"var(--space-component-md) var(--space-component-lg)",background:"rgba(42, 42, 50, 0.5)",borderBottom:"var(--border-width-1) solid var(--color-border-subtle)",cursor:n.maximized?"default":"move",userSelect:"none"},children:[g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--gap-md)"},children:[d.icon&&g.jsx("span",{style:{fontSize:16},children:d.icon}),g.jsx("span",{style:{color:"var(--color-text-primary)",fontSize:"var(--font-size-body-sm)",fontWeight:"var(--font-weight-semibold)",fontFamily:"var(--font-family-sans)"},children:d.name})]}),g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--gap-xs)"},children:[g.jsx("button",{onClick:c,"aria-label":n.maximized?"Restore window":"Maximize window",title:n.maximized?"Restore":"Maximize",style:{background:"transparent",border:"none",color:"var(--color-text-secondary)",fontSize:"16px",cursor:"pointer",padding:"var(--spacing-1) var(--spacing-2)",lineHeight:1,borderRadius:"var(--radius-md)",transition:"var(--transition-colors)",display:"flex",alignItems:"center",justifyContent:"center"},onMouseEnter:v=>{v.currentTarget.style.color="var(--color-text-primary)",v.currentTarget.style.background="var(--color-bg-elevated)"},onMouseLeave:v=>{v.currentTarget.style.color="var(--color-text-secondary)",v.currentTarget.style.background="transparent"},children:n.maximized?g.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[g.jsx("rect",{x:"4",y:"4",width:"6",height:"6"}),g.jsx("path",{d:"M2 2h4v4M12 12H8V8"})]}):g.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:g.jsx("rect",{x:"2",y:"2",width:"10",height:"10"})})}),g.jsx("button",{onClick:l,"aria-label":"Close window",title:"Close",style:{background:"transparent",border:"none",color:"var(--color-text-secondary)",fontSize:"var(--font-size-h3)",cursor:"pointer",padding:"var(--spacing-1) var(--spacing-2)",lineHeight:1,borderRadius:"var(--radius-md)",transition:"var(--transition-colors)",display:"flex",alignItems:"center",justifyContent:"center"},onMouseEnter:v=>{v.currentTarget.style.color="var(--color-error)",v.currentTarget.style.background="var(--color-error-bg)"},onMouseLeave:v=>{v.currentTarget.style.color="var(--color-text-secondary)",v.currentTarget.style.background="transparent"},children:"×"})]})]}),g.jsx("div",{style:{flex:1,overflow:"hidden",background:"var(--color-bg-surface)"},children:g.jsx(p,{context:o})})]})})});az.displayName="ModuleWindow";const mV=()=>{const e=_e(f=>f.graph.edgeType),n=_e(f=>f.graph.edgeStrokeWidth),a=_e(f=>f.graph.edgeAnimation),i=_e(f=>f.graph.showEdgeLabels),o=_e(f=>f.setEdgeType),l=_e(f=>f.setEdgeStrokeWidth),c=_e(f=>f.setEdgeAnimation),d=_e(f=>f.setShowEdgeLabels);return g.jsxs("div",{children:[g.jsxs("div",{className:"settings-section",children:[g.jsx("h3",{className:"settings-section-title",children:"Edge Appearance"}),g.jsxs("div",{className:"settings-field",children:[g.jsx("label",{htmlFor:"edge-type",className:"settings-label",children:"Edge Type"}),g.jsx("p",{className:"settings-description",children:"Choose how connections between nodes are drawn"}),g.jsxs("select",{id:"edge-type",value:e,onChange:f=>o(f.target.value),className:"settings-select",children:[g.jsx("option",{value:"bezier",children:"Bezier (Curved) - Default"}),g.jsx("option",{value:"smoothstep",children:"Smooth Step"}),g.jsx("option",{value:"straight",children:"Straight (90° Angles)"}),g.jsx("option",{value:"simplebezier",children:"Simple Bezier"})]})]}),g.jsxs("div",{className:"settings-field",children:[g.jsxs("label",{htmlFor:"edge-width",className:"settings-label",children:["Edge Stroke Width: ",n,"px"]}),g.jsx("input",{id:"edge-width",type:"range",min:"1",max:"5",step:"0.5",value:n,onChange:f=>l(parseFloat(f.target.value)),className:"settings-input"})]})]}),g.jsxs("div",{className:"settings-section",children:[g.jsx("h3",{className:"settings-section-title",children:"Edge Behavior"}),g.jsxs("div",{className:"settings-field",children:[g.jsxs("div",{className:"settings-checkbox-wrapper",children:[g.jsx("input",{id:"edge-animation",type:"checkbox",checked:a,onChange:f=>c(f.target.checked),className:"settings-checkbox"}),g.jsx("label",{htmlFor:"edge-animation",className:"settings-checkbox-label",children:"Enable edge animation"})]}),g.jsx("p",{className:"settings-description",children:"Animate message flow along edges (may impact performance)"})]}),g.jsxs("div",{className:"settings-field",children:[g.jsxs("div",{className:"settings-checkbox-wrapper",children:[g.jsx("input",{id:"edge-labels",type:"checkbox",checked:i,onChange:f=>d(f.target.checked),className:"settings-checkbox"}),g.jsx("label",{htmlFor:"edge-labels",className:"settings-checkbox-label",children:"Show edge labels"})]}),g.jsx("p",{className:"settings-description",children:"Display correlation IDs and other metadata on edges"})]})]})]})},iz="/api";async function yV(){try{const e=await fetch(`${iz}/themes`,{method:"GET",headers:{"Content-Type":"application/json"}});if(!e.ok)throw new Error(`Failed to fetch themes: ${e.statusText}`);return(await e.json()).themes}catch(e){throw console.error("Error fetching theme list:",e),e}}async function UN(e){try{const n=await fetch(`${iz}/themes/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}});if(!n.ok)throw new Error(`Failed to fetch theme "${e}": ${n.statusText}`);const a=await n.json();return{name:a.name,colors:a.data.colors}}catch(n){throw console.error(`Error fetching theme "${e}":`,n),n}}const Iy=["dracula","nord","catppuccin-mocha","tokyonight","gruvboxdark","solarized-dark","github-dark","one-half-dark","monokai","material"];function ms(e,n){const a=parseInt(e.slice(1,3),16),i=parseInt(e.slice(3,5),16),o=parseInt(e.slice(5,7),16);return`rgba(${a}, ${i}, ${o}, ${n})`}function VN(e){const n=document.documentElement,{colors:a}=e;n.style.setProperty("--color-bg-base",a.primary.background),n.style.setProperty("--color-bg-elevated",a.selection.background),n.style.setProperty("--color-bg-surface",a.normal.black),n.style.setProperty("--color-bg-overlay",a.bright.black),n.style.setProperty("--color-bg-float",ms(a.normal.white,.1)),n.style.setProperty("--color-text-primary",a.primary.foreground),n.style.setProperty("--color-text-secondary",a.bright.white),n.style.setProperty("--color-text-tertiary",a.selection.text),n.style.setProperty("--color-text-muted",a.cursor.text),n.style.setProperty("--color-text-on-primary",a.selection.text),n.style.setProperty("--color-primary-500",a.normal.blue),n.style.setProperty("--color-primary-400",a.bright.blue),n.style.setProperty("--color-primary-600",a.normal.blue),n.style.setProperty("--color-secondary-500",a.normal.magenta),n.style.setProperty("--color-secondary-400",a.bright.magenta),n.style.setProperty("--color-tertiary-500",a.normal.cyan),n.style.setProperty("--color-success",a.normal.green),n.style.setProperty("--color-success-light",a.bright.green),n.style.setProperty("--color-error",a.normal.red),n.style.setProperty("--color-error-light",a.bright.red),n.style.setProperty("--color-warning",a.normal.yellow),n.style.setProperty("--color-warning-light",a.bright.yellow),n.style.setProperty("--color-info",a.normal.cyan),n.style.setProperty("--color-info-light",a.bright.cyan);const i=n.style.getPropertyValue("--agent-idle-color");(!i||i==="#60a5fa")&&n.style.setProperty("--agent-idle-color",a.normal.cyan);const o=n.style.getPropertyValue("--agent-active-color");(!o||o==="#10b981")&&n.style.setProperty("--agent-active-color",a.normal.green);const l=n.style.getPropertyValue("--agent-error-color");(!l||l==="#ef4444")&&n.style.setProperty("--agent-error-color",a.normal.red),n.style.setProperty("--color-border-default",a.bright.black),n.style.setProperty("--color-border-subtle",ms(a.normal.white,.2)),n.style.setProperty("--color-border-strong",a.cursor.cursor),n.style.setProperty("--color-border-focus",a.normal.blue),n.style.setProperty("--color-border-error",a.normal.red),n.style.setProperty("--color-glass-bg",ms(a.selection.background,.8)),n.style.setProperty("--color-glow-primary",a.cursor.cursor),n.style.setProperty("--shadow-glow-primary",`0 0 0 3px ${ms(a.bright.blue,.5)}`),n.style.setProperty("--shadow-glow-error",`0 0 0 3px ${ms(a.bright.red,.5)}`),n.style.setProperty("--color-edge-default",a.bright.black),n.style.setProperty("--color-edge-message",a.bright.yellow),n.style.setProperty("--color-edge-active",a.bright.blue),n.style.setProperty("--color-node-message-border",a.normal.magenta),console.log(`[Theme] Applied theme: ${e.name}`)}function Uy(){const e=document.documentElement;e.style.setProperty("--color-bg-base","#0a0a0b"),e.style.setProperty("--color-bg-elevated","#121214"),e.style.setProperty("--color-bg-surface","#1a1a1e"),e.style.setProperty("--color-bg-overlay","#232329"),e.style.setProperty("--color-bg-float","#2a2a32"),e.style.setProperty("--color-text-primary","#e5e7eb"),e.style.setProperty("--color-text-secondary","#9ca3af"),e.style.setProperty("--color-text-tertiary","#6b7280"),e.style.setProperty("--color-primary-500","#6366f1"),e.style.setProperty("--color-primary-400","#818cf8"),e.style.setProperty("--color-primary-600","#4f46e5"),console.log("[Theme] Reset to default theme")}const bV=()=>{const[e,n]=q.useState([]),[a,i]=q.useState(!1),[o,l]=q.useState(null),[c,d]=q.useState(""),[f,h]=q.useState(null),p=_e(R=>R.appearance.theme),v=_e(R=>R.setTheme);q.useEffect(()=>{m()},[]);const m=async()=>{try{i(!0),l(null);const R=await yV();n(R)}catch(R){l("Failed to load themes. Backend may not be running."),console.error("Theme loading error:",R),n(Iy)}finally{i(!1)}},b=async R=>{try{if(l(null),R==="default"){Uy(),v("default"),h(null);return}const z=await UN(R);VN(z),v(R),h(null)}catch(z){l(`Failed to load theme "${R}"`),console.error("Theme application error:",z)}},_=async R=>{try{if(R==="default"){Uy(),h(null);return}const z=await UN(R);h(z),VN(z)}catch(z){console.error("Theme preview error:",z)}},S=()=>{Uy(),v("default"),h(null)},C=["default",...e].filter(R=>R.toLowerCase().includes(c.toLowerCase())),T=C.filter(R=>Iy.includes(R)),E=C.includes("default")?["default"]:[],N=C.filter(R=>!Iy.includes(R)&&R!=="default");return g.jsxs("div",{children:[g.jsxs("div",{className:"settings-field",children:[g.jsx("label",{htmlFor:"theme-search",className:"settings-label",children:"Search Themes"}),g.jsx("input",{id:"theme-search",type:"text",value:c,onChange:R=>d(R.target.value),placeholder:"Search 300+ themes...",className:"settings-input",disabled:a})]}),o&&g.jsx("div",{style:{padding:"var(--space-component-sm)",background:"var(--color-error-bg)",color:"var(--color-error-light)",borderRadius:"var(--radius-md)",marginBottom:"var(--space-component-md)",fontSize:"var(--font-size-caption)"},children:o}),a&&g.jsx("div",{style:{padding:"var(--space-component-md)",textAlign:"center",color:"var(--color-text-secondary)"},children:"Loading themes..."}),!a&&g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"settings-field",children:[g.jsx("label",{className:"settings-label",children:"Current Theme"}),g.jsxs("div",{style:{padding:"var(--space-component-sm)",background:"var(--color-bg-elevated)",borderRadius:"var(--radius-md)",border:"var(--border-default)",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[g.jsx("span",{style:{color:"var(--color-text-primary)"},children:p==="default"?"Default (Flock)":p}),p!=="default"&&g.jsx("button",{onClick:S,style:{padding:"4px 8px",background:"transparent",border:"var(--border-default)",borderRadius:"var(--radius-sm)",color:"var(--color-text-secondary)",fontSize:"var(--font-size-caption)",cursor:"pointer"},children:"Reset"})]})]}),E.length>0&&g.jsxs("div",{className:"settings-field",children:[g.jsx("label",{className:"settings-label",children:"Built-in Theme"}),g.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"var(--gap-xs)"},children:g.jsx("button",{onClick:()=>b("default"),onMouseEnter:()=>_("default"),style:{padding:"var(--space-component-sm)",background:p==="default"?"var(--color-primary-500)":"var(--color-bg-elevated)",border:"var(--border-default)",borderRadius:"var(--radius-md)",color:p==="default"?"white":"var(--color-text-primary)",fontSize:"var(--font-size-body-sm)",cursor:"pointer",textAlign:"left",transition:"var(--transition-all)"},children:"Default (Flock)"})})]}),T.length>0&&g.jsxs("div",{className:"settings-field",children:[g.jsx("label",{className:"settings-label",children:"Popular Themes"}),g.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"var(--gap-xs)"},children:T.map(R=>g.jsx("button",{onClick:()=>b(R),onMouseEnter:()=>_(R),style:{padding:"var(--space-component-sm)",background:p===R?"var(--color-primary-500)":"var(--color-bg-elevated)",border:"var(--border-default)",borderRadius:"var(--radius-md)",color:p===R?"white":"var(--color-text-primary)",fontSize:"var(--font-size-body-sm)",cursor:"pointer",textAlign:"left",transition:"var(--transition-all)"},children:R},R))})]}),N.length>0&&g.jsxs("div",{className:"settings-field",children:[g.jsxs("label",{className:"settings-label",children:["All Themes (",N.length,")"]}),g.jsx("div",{style:{maxHeight:"300px",overflowY:"auto",display:"flex",flexDirection:"column",gap:"var(--gap-xs)",padding:"var(--space-component-xs)",background:"var(--color-bg-base)",borderRadius:"var(--radius-md)"},children:N.map(R=>g.jsx("button",{onClick:()=>b(R),onMouseEnter:()=>_(R),style:{padding:"var(--space-component-sm)",background:p===R?"var(--color-primary-500)":"var(--color-bg-elevated)",border:"var(--border-default)",borderRadius:"var(--radius-sm)",color:p===R?"white":"var(--color-text-primary)",fontSize:"var(--font-size-body-sm)",cursor:"pointer",textAlign:"left",transition:"var(--transition-all)"},children:R},R))})]}),C.length===0&&!a&&g.jsxs("div",{style:{padding:"var(--space-component-md)",textAlign:"center",color:"var(--color-text-tertiary)"},children:['No themes found matching "',c,'"']})]}),f&&g.jsxs("div",{style:{padding:"var(--space-component-sm)",background:"var(--color-bg-overlay)",borderRadius:"var(--radius-md)",marginTop:"var(--space-component-md)",fontSize:"var(--font-size-caption)",color:"var(--color-text-tertiary)",textAlign:"center"},children:["Previewing: ",f.name," (click to apply)"]})]})},xV=()=>{const e=_e(m=>m.appearance.agentIdleColor),n=_e(m=>m.appearance.agentActiveColor),a=_e(m=>m.appearance.agentErrorColor),i=_e(m=>m.appearance.nodeShadow),o=_e(m=>m.appearance.showStatusPulse),l=_e(m=>m.appearance.compactNodeView),c=_e(m=>m.setAgentIdleColor),d=_e(m=>m.setAgentActiveColor),f=_e(m=>m.setAgentErrorColor),h=_e(m=>m.setNodeShadow),p=_e(m=>m.setShowStatusPulse),v=_e(m=>m.setCompactNodeView);return g.jsxs("div",{children:[g.jsxs("div",{className:"settings-section",children:[g.jsx("h3",{className:"settings-section-title",children:"Theme"}),g.jsx("p",{className:"settings-description",style:{marginBottom:"var(--space-component-md)"},children:"Choose from 300+ terminal color themes. Themes are loaded from the backend and applied in real-time."}),g.jsx(bV,{})]}),g.jsxs("div",{className:"settings-section",children:[g.jsx("h3",{className:"settings-section-title",children:"Agent Colors"}),g.jsxs("div",{className:"settings-field",children:[g.jsx("label",{htmlFor:"idle-color",className:"settings-label",children:"Idle Agent Color"}),g.jsx("p",{className:"settings-description",children:"Border and indicator color for idle agents"}),g.jsxs("div",{style:{display:"flex",gap:"var(--gap-sm)",alignItems:"center"},children:[g.jsx("input",{id:"idle-color",type:"color",value:e,onChange:m=>c(m.target.value),style:{width:"60px",height:"36px",cursor:"pointer"}}),g.jsx("input",{type:"text",value:e,onChange:m=>c(m.target.value),className:"settings-input",placeholder:"#60a5fa"})]})]}),g.jsxs("div",{className:"settings-field",children:[g.jsx("label",{htmlFor:"active-color",className:"settings-label",children:"Active Agent Color"}),g.jsx("p",{className:"settings-description",children:"Border and indicator color for running agents (thick border)"}),g.jsxs("div",{style:{display:"flex",gap:"var(--gap-sm)",alignItems:"center"},children:[g.jsx("input",{id:"active-color",type:"color",value:n,onChange:m=>d(m.target.value),style:{width:"60px",height:"36px",cursor:"pointer"}}),g.jsx("input",{type:"text",value:n,onChange:m=>d(m.target.value),className:"settings-input",placeholder:"#10b981"})]})]}),g.jsxs("div",{className:"settings-field",children:[g.jsx("label",{htmlFor:"error-color",className:"settings-label",children:"Error Agent Color"}),g.jsx("p",{className:"settings-description",children:"Border and indicator color for agents in error state"}),g.jsxs("div",{style:{display:"flex",gap:"var(--gap-sm)",alignItems:"center"},children:[g.jsx("input",{id:"error-color",type:"color",value:a,onChange:m=>f(m.target.value),style:{width:"60px",height:"36px",cursor:"pointer"}}),g.jsx("input",{type:"text",value:a,onChange:m=>f(m.target.value),className:"settings-input",placeholder:"#ef4444"})]})]})]}),g.jsxs("div",{className:"settings-section",children:[g.jsx("h3",{className:"settings-section-title",children:"Node Appearance"}),g.jsxs("div",{className:"settings-field",children:[g.jsx("label",{htmlFor:"node-shadow",className:"settings-label",children:"Node Shadow"}),g.jsx("p",{className:"settings-description",children:"Shadow intensity for node elevation effect"}),g.jsxs("select",{id:"node-shadow",value:i,onChange:m=>h(m.target.value),className:"settings-select",children:[g.jsx("option",{value:"none",children:"None"}),g.jsx("option",{value:"small",children:"Small"}),g.jsx("option",{value:"medium",children:"Medium (Default)"}),g.jsx("option",{value:"large",children:"Large"})]})]}),g.jsxs("div",{className:"settings-field",children:[g.jsxs("div",{className:"settings-checkbox-wrapper",children:[g.jsx("input",{id:"status-pulse",type:"checkbox",checked:o,onChange:m=>p(m.target.checked),className:"settings-checkbox"}),g.jsx("label",{htmlFor:"status-pulse",className:"settings-checkbox-label",children:"Show status pulse animation"})]}),g.jsx("p",{className:"settings-description",children:"Animate status indicator for running agents"})]}),g.jsxs("div",{className:"settings-field",children:[g.jsxs("div",{className:"settings-checkbox-wrapper",children:[g.jsx("input",{id:"compact-view",type:"checkbox",checked:l,onChange:m=>v(m.target.checked),className:"settings-checkbox"}),g.jsx("label",{htmlFor:"compact-view",className:"settings-checkbox-label",children:"Compact node view"})]}),g.jsx("p",{className:"settings-description",children:"Reduce node size and spacing (useful for large graphs)"})]})]})]})},_V=()=>{const e=_e(b=>b.advanced.layoutDirection),n=_e(b=>b.advanced.nodeSpacing),a=_e(b=>b.advanced.rankSpacing),i=_e(b=>b.advanced.debugMode),o=_e(b=>b.advanced.performanceMode),l=_e(b=>b.setLayoutDirection),c=_e(b=>b.setNodeSpacing),d=_e(b=>b.setRankSpacing),f=_e(b=>b.setDebugMode),h=_e(b=>b.setPerformanceMode),[p,v]=q.useState("Loading..."),m="0.1.1";return q.useEffect(()=>{(async()=>{try{const _=await fetch("/api/version");if(_.ok){const S=await _.json();v(S.backend_version||"Unknown")}else v("Error fetching version")}catch(_){console.error("Failed to fetch version:",_),v("Error fetching version")}})()},[]),g.jsxs("div",{children:[g.jsxs("div",{className:"settings-section",children:[g.jsx("h3",{className:"settings-section-title",children:"Graph Layout"}),g.jsxs("div",{className:"settings-field",children:[g.jsx("label",{htmlFor:"layout-direction",className:"settings-label",children:"Layout Direction"}),g.jsx("p",{className:"settings-description",children:"Direction for manual layout algorithm (right-click → Auto Layout)"}),g.jsxs("select",{id:"layout-direction",value:e,onChange:b=>l(b.target.value),className:"settings-select",children:[g.jsx("option",{value:"LR",children:"Left to Right (Default)"}),g.jsx("option",{value:"TB",children:"Top to Bottom"})]})]}),g.jsxs("div",{className:"settings-field",children:[g.jsxs("label",{htmlFor:"node-spacing",className:"settings-label",children:["Node Spacing: ",n,"px"]}),g.jsx("p",{className:"settings-description",children:"Horizontal space between nodes when using manual layout (affects edge label visibility)"}),g.jsx("input",{id:"node-spacing",type:"range",min:"25",max:"150",step:"5",value:n,onChange:b=>c(parseFloat(b.target.value)),className:"settings-input"})]}),g.jsxs("div",{className:"settings-field",children:[g.jsxs("label",{htmlFor:"rank-spacing",className:"settings-label",children:["Rank Spacing: ",a,"px"]}),g.jsx("p",{className:"settings-description",children:"Vertical space between graph layers when using manual layout"}),g.jsx("input",{id:"rank-spacing",type:"range",min:"50",max:"300",step:"10",value:a,onChange:b=>d(parseFloat(b.target.value)),className:"settings-input"})]})]}),g.jsxs("div",{className:"settings-section",children:[g.jsx("h3",{className:"settings-section-title",children:"Developer Options"}),g.jsxs("div",{className:"settings-field",children:[g.jsxs("div",{className:"settings-checkbox-wrapper",children:[g.jsx("input",{id:"debug-mode",type:"checkbox",checked:i,onChange:b=>f(b.target.checked),className:"settings-checkbox"}),g.jsx("label",{htmlFor:"debug-mode",className:"settings-checkbox-label",children:"Debug mode"})]}),g.jsx("p",{className:"settings-description",children:"Show node IDs, detailed message counts, and verbose console logging"})]}),g.jsxs("div",{className:"settings-field",children:[g.jsxs("div",{className:"settings-checkbox-wrapper",children:[g.jsx("input",{id:"performance-mode",type:"checkbox",checked:o,onChange:b=>h(b.target.checked),className:"settings-checkbox"}),g.jsx("label",{htmlFor:"performance-mode",className:"settings-checkbox-label",children:"Performance mode"})]}),g.jsx("p",{className:"settings-description",children:"Disable animations, shadows, and blur effects for better performance"})]})]}),g.jsxs("div",{className:"settings-section",children:[g.jsx("h3",{className:"settings-section-title",children:"Information"}),g.jsxs("div",{className:"settings-field",children:[g.jsxs("p",{className:"settings-description",style:{marginBottom:"var(--spacing-2)"},children:[g.jsx("strong",{children:"Dashboard Version:"})," ",m]}),g.jsxs("p",{className:"settings-description",style:{marginBottom:"var(--spacing-2)"},children:[g.jsx("strong",{children:"Backend Version:"})," ",p]}),g.jsxs("p",{className:"settings-description",style:{marginBottom:"var(--spacing-2)"},children:[g.jsx("strong",{children:"React Flow Version:"})," 12.8.6"]}),g.jsxs("p",{className:"settings-description",children:[g.jsx("strong",{children:"Local Storage Used:"})," ",localStorage.length," keys"]})]})]})]})},SV=()=>{const e="mgljr9wlkbscmlh",n="2025-10-11T00:38:22.437Z",a=new Date(n).toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"});return g.jsxs("div",{style:{fontSize:"10px",color:"var(--color-text-tertiary, #6b7280)",fontFamily:"monospace",lineHeight:"1.4",opacity:.7},children:[g.jsxs("div",{children:["Build: ",e]}),g.jsx("div",{children:a})]})},wV=()=>{const[e,n]=q.useState("graph"),a=_e(c=>c.setShowSettings),i=_e(c=>c.resetToDefaults),o=()=>{a(!1)},l=()=>{confirm("Reset all settings to defaults? This cannot be undone.")&&i()};return g.jsx("div",{className:"settings-panel",children:g.jsxs("div",{className:"settings-panel-inner",children:[g.jsxs("div",{className:"settings-header",children:[g.jsx("h2",{className:"settings-title",children:"Settings"}),g.jsx("button",{onClick:o,className:"settings-close-button","aria-label":"Close settings",title:"Close settings (Esc)",children:g.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:g.jsx("path",{d:"M15 5L5 15M5 5l10 10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),g.jsxs("div",{className:"settings-tabs",children:[g.jsxs("button",{onClick:()=>n("graph"),className:`settings-tab ${e==="graph"?"active":""}`,children:[g.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[g.jsx("circle",{cx:"4",cy:"8",r:"2",stroke:"currentColor",strokeWidth:"1.5"}),g.jsx("circle",{cx:"12",cy:"4",r:"2",stroke:"currentColor",strokeWidth:"1.5"}),g.jsx("circle",{cx:"12",cy:"12",r:"2",stroke:"currentColor",strokeWidth:"1.5"}),g.jsx("path",{d:"M6 8h4M10 5l2 6",stroke:"currentColor",strokeWidth:"1.5"})]}),"Graph"]}),g.jsxs("button",{onClick:()=>n("appearance"),className:`settings-tab ${e==="appearance"?"active":""}`,children:[g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:g.jsx("path",{d:"M8 2v12M2 8h12M4.343 4.343l7.314 7.314M11.657 4.343L4.343 11.657",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})}),"Appearance"]}),g.jsxs("button",{onClick:()=>n("advanced"),className:`settings-tab ${e==="advanced"?"active":""}`,children:[g.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[g.jsx("path",{d:"M8 10.667a2.667 2.667 0 100-5.334 2.667 2.667 0 000 5.334z",stroke:"currentColor",strokeWidth:"1.5"}),g.jsx("path",{d:"M13 8a5 5 0 01-5 5m0-10a5 5 0 015 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),"Advanced"]})]}),g.jsxs("div",{className:"settings-content",children:[e==="graph"&&g.jsx(mV,{}),e==="appearance"&&g.jsx(xV,{}),e==="advanced"&&g.jsx(_V,{})]}),g.jsxs("div",{className:"settings-footer",children:[g.jsx("div",{className:"settings-footer-left",children:g.jsx(SV,{})}),g.jsx("button",{onClick:l,className:"settings-reset-button",children:"Reset to Defaults"})]})]})})},Ba=typeof navigator<"u"&&navigator.platform.toUpperCase().indexOf("MAC")>=0,EV=[{keys:Ba?["⌘","M"]:["Ctrl","M"],description:"Toggle Agent/Blackboard View",category:"Navigation"},{keys:Ba?["⌘","F"]:["Ctrl","F"],description:"Focus filter input",category:"Navigation"},{keys:Ba?["⌘","Shift","P"]:["Ctrl","Shift","P"],description:"Toggle Publish Panel",category:"Panels"},{keys:Ba?["⌘","Shift","D"]:["Ctrl","Shift","D"],description:"Toggle Agent Details",category:"Panels"},{keys:Ba?["⌘","Shift","F"]:["Ctrl","Shift","F"],description:"Toggle Filters Panel",category:"Panels"},{keys:Ba?["⌘",","]:["Ctrl",","],description:"Toggle Settings Panel",category:"Panels"},{keys:["Esc"],description:"Close panels and windows",category:"General"},{keys:Ba?["⌘","/"]:["Ctrl","/"],description:"Show this help dialog",category:"General"}],CV=({isOpen:e,onClose:n})=>{if(q.useEffect(()=>{if(!e)return;const i=o=>{o.key==="Escape"&&(o.preventDefault(),o.stopPropagation(),n())};return window.addEventListener("keydown",i,{capture:!0}),()=>{window.removeEventListener("keydown",i,{capture:!0})}},[e,n]),!e)return null;const a=EV.reduce((i,o)=>(i[o.category]||(i[o.category]=[]),i[o.category].push(o),i),{});return g.jsx("div",{className:"keyboard-shortcuts-overlay",onClick:n,children:g.jsxs("div",{className:"keyboard-shortcuts-dialog",onClick:i=>i.stopPropagation(),children:[g.jsxs("div",{className:"keyboard-shortcuts-header",children:[g.jsx("h2",{className:"keyboard-shortcuts-title",children:"Keyboard Shortcuts"}),g.jsx("button",{className:"keyboard-shortcuts-close",onClick:n,"aria-label":"Close keyboard shortcuts",children:g.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:g.jsx("path",{d:"M15 5L5 15M5 5l10 10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),g.jsx("div",{className:"keyboard-shortcuts-content",children:Object.entries(a).map(([i,o])=>g.jsxs("div",{className:"keyboard-shortcuts-category",children:[g.jsx("h3",{className:"keyboard-shortcuts-category-title",children:i}),g.jsx("div",{className:"keyboard-shortcuts-list",children:o.map((l,c)=>g.jsxs("div",{className:"keyboard-shortcut-item",children:[g.jsx("div",{className:"keyboard-shortcut-keys",children:l.keys.map((d,f)=>g.jsxs(Kn.Fragment,{children:[g.jsx("kbd",{className:"keyboard-key",children:d}),f<l.keys.length-1&&g.jsx("span",{className:"keyboard-key-separator",children:"+"})]},f))}),g.jsx("div",{className:"keyboard-shortcut-description",children:l.description})]},c))})]},i))}),g.jsx("div",{className:"keyboard-shortcuts-footer",children:g.jsxs("p",{className:"keyboard-shortcuts-hint",children:["Press ",g.jsx("kbd",{className:"keyboard-key",children:"Esc"})," or click outside to close"]})})]})})},TV=()=>{const e=jr(c=>c.instances),n=jr(c=>c.addModule),a=q.useRef(new Map),i=q.useRef({});q.useEffect(()=>{(async()=>{try{const d=await Cn.getAllModuleInstances();d.forEach(f=>{const h={id:f.instance_id,type:f.type,position:f.position,size:f.size,visible:f.visible};n(h)}),console.log(`[ModulePersistence] Restored ${d.length} module instances`)}catch(d){console.error("[ModulePersistence] Failed to load module instances:",d)}})()},[]);const o=q.useCallback(async c=>{i.current[c.id]&&clearTimeout(i.current[c.id]),i.current[c.id]=setTimeout(async()=>{try{const d=new Date().toISOString(),f={instance_id:c.id,type:c.type,position:c.position,size:c.size,visible:c.visible,created_at:d,updated_at:d};await Cn.saveModuleInstance(f),console.log(`[ModulePersistence] Saved instance: ${c.id}`)}catch(d){console.error(`[ModulePersistence] Failed to save instance ${c.id}:`,d)}delete i.current[c.id]},300)},[]),l=q.useCallback(async c=>{i.current[c]&&(clearTimeout(i.current[c]),delete i.current[c]);try{await Cn.deleteModuleInstance(c),console.log(`[ModulePersistence] Deleted instance: ${c}`)}catch(d){console.error(`[ModulePersistence] Failed to delete instance ${c}:`,d)}},[]);q.useEffect(()=>{const c=new Set(e.keys()),d=new Set(a.current.keys());c.forEach(f=>{if(!d.has(f)){const h=e.get(f);h&&(console.log(`[ModulePersistence] Detected new instance: ${f}`),o(h))}}),e.forEach((f,h)=>{const p=a.current.get(h);if(p){const v=p.position.x!==f.position.x||p.position.y!==f.position.y,m=p.size.width!==f.size.width||p.size.height!==f.size.height,b=p.visible!==f.visible;(v||m||b)&&(console.log(`[ModulePersistence] Detected update to instance: ${h}`),o(f))}}),d.forEach(f=>{c.has(f)||(console.log(`[ModulePersistence] Detected removed instance: ${f}`),l(f))}),a.current=new Map(e)},[e,o,l]),q.useEffect(()=>()=>{Object.values(i.current).forEach(clearTimeout)},[])},oz=(e={})=>{q.useEffect(()=>{const n=a=>{const i=a.ctrlKey||a.metaKey;if(i&&a.key===","){a.preventDefault();const o=_e.getState().ui.showSettings;_e.getState().setShowSettings(!o);return}if(i&&a.shiftKey&&a.key==="F"){a.preventDefault();const o=_e.getState().ui.showFilters;_e.getState().setShowFilters(!o);return}if(i&&a.shiftKey&&a.key==="P"){a.preventDefault();const o=_e.getState().ui.showControls;_e.getState().setShowControls(!o);return}if(i&&a.shiftKey&&a.key==="D"){a.preventDefault(),e.onToggleAgentDetails&&e.onToggleAgentDetails();return}if(i&&a.key==="/"){a.preventDefault(),e.onToggleHelp&&e.onToggleHelp();return}if(i&&a.key==="m"){if(a.preventDefault(),e.onToggleMode)e.onToggleMode();else{const o=ut.getState().mode;ut.getState().setMode(o==="agent"?"blackboard":"agent")}return}if(i&&a.key==="f"){const o=document.activeElement;if(!(o?.tagName==="INPUT"||o?.tagName==="TEXTAREA"))if(a.preventDefault(),e.onFocusFilter)e.onFocusFilter();else{const c=document.querySelector('input[placeholder*="correlation"], input[placeholder*="Correlation"]');c&&(c.focus(),c.select())}return}if(a.key==="Escape"){if(e.onCloseWindows)e.onCloseWindows();else{const{showSettings:o,showFilters:l,showControls:c}=_e.getState().ui,d=ut.getState().detailWindows;o?(a.preventDefault(),_e.getState().setShowSettings(!1)):c?(a.preventDefault(),_e.getState().setShowControls(!1)):l?(a.preventDefault(),_e.getState().setShowFilters(!1)):d.size>0&&(a.preventDefault(),d.clear(),ut.setState({detailWindows:new Map}))}return}};return window.addEventListener("keydown",n),()=>{window.removeEventListener("keydown",n)}},[e])},jV="_connectionBadge_kl6ey_1",NV="_hasError_kl6ey_27",RV="_connected_kl6ey_37",MV="_connecting_kl6ey_49",AV="_reconnecting_kl6ey_51",zV="_disconnected_kl6ey_63",DV="_statusIndicator_kl6ey_77",kV="_statusPulse_kl6ey_1",OV="_statusText_kl6ey_121",$i={connectionBadge:jV,hasError:NV,connected:RV,connecting:MV,reconnecting:AV,disconnected:zV,statusIndicator:DV,statusPulse:kV,statusText:OV},qV=({status:e,attempts:n,error:a})=>{const i={connected:"Connected",connecting:"Connecting...",reconnecting:`Reconnecting (${n})...`,disconnected:"Disconnected"},o=[$i.connectionBadge,$i[e],a?$i.hasError:""].filter(Boolean).join(" "),l=[$i.statusIndicator,$i[e]].join(" ");return g.jsxs("div",{className:o,title:a||void 0,role:"status","aria-live":"polite","aria-label":`WebSocket connection status: ${i[e]}`,children:[g.jsx("div",{className:l,"aria-hidden":"true"}),g.jsx("span",{className:$i.statusText,children:i[e]})]})},BV=()=>{const e=at(i=>i.status),n=at(i=>i.reconnectAttempts),a=at(i=>i.lastError);return g.jsx(qV,{status:e,attempts:n,error:a})},LV=()=>{const e=ut(_=>_.mode),n=ut(_=>_.setMode),a=jr(_=>_.instances),i=ut(_=>_.detailWindows),o=_e(_=>_.ui.showFilters),l=_e(_=>_.ui.showControls),c=_e(_=>_.ui.showSettings),d=_e(_=>_.setShowFilters),f=_e(_=>_.setShowControls),h=_e(_=>_.setShowSettings),[p,v]=q.useState(!1);TV();const m=()=>{const _=ut.getState().detailWindows,S=Me.getState().agents;_.size>0?_.forEach((w,C)=>{ut.getState().closeDetailWindow(C)}):S.forEach(w=>{ut.getState().openDetailWindow(w.id)})};oz({onToggleHelp:()=>v(_=>!_),onToggleAgentDetails:m});const b=()=>{confirm("Clear all dashboard data? This will remove all agents, messages, and session data.")&&(Me.setState({agents:new Map,messages:new Map,events:[],runs:new Map,nodes:[],edges:[]}),ut.setState({mode:"agent"}),Te.setState({correlationId:void 0,timeRange:void 0}),jr.getState().instances.clear(),indexedDB.databases().then(_=>{_.forEach(S=>{S.name&&indexedDB.deleteDatabase(S.name)})}),localStorage.clear(),window.location.reload())};return g.jsxs("div",{className:"dashboard-layout",children:[g.jsxs("header",{className:"dashboard-header",children:[g.jsx("h1",{className:"dashboard-title",children:"🦆🐓  Flock  🐤🐧"}),g.jsxs("div",{className:"view-toggle-container",children:[g.jsx("span",{className:"view-toggle-label",children:"View:"}),g.jsxs("div",{className:"view-toggle-group",children:[g.jsx("button",{type:"button",onClick:()=>n("agent"),className:`view-toggle-button ${e==="agent"?"active":""}`,children:"Agent View"}),g.jsx("button",{type:"button",onClick:()=>n("blackboard"),className:`view-toggle-button ${e==="blackboard"?"active":""}`,children:"Blackboard View"})]})]}),g.jsxs("div",{className:"dashboard-actions",children:[g.jsxs("button",{type:"button",onClick:()=>f(!l),className:`controls-toggle primary ${l?"active":""}`,title:"Publish artifacts to the blackboard (Ctrl+Shift+P)","aria-pressed":l?"true":"false","aria-label":l?"Publish panel open":"Publish panel closed",children:[g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:g.jsx("path",{d:"M8 2.667v10.666M2.667 8h10.666",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),g.jsx("span",{children:"Publish"})]}),g.jsxs("button",{type:"button",onClick:m,className:`controls-toggle ${i.size>0?"active":""}`,title:`${i.size>0?"Close":"Show"} agent detail windows (Ctrl+Shift+D)`,"aria-pressed":i.size>0?"true":"false","aria-label":i.size>0?"Agent details shown":"Agent details hidden",children:[g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:g.jsx("path",{d:"M2 4.667h12M2 8h12M2 11.333h12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),g.jsx("span",{children:"Agent Details"})]}),g.jsxs("button",{type:"button",onClick:()=>h(!c),className:`controls-toggle ${c?"active":""}`,title:`${c?"Hide":"Show"} settings panel (Ctrl+,)`,"aria-pressed":c?"true":"false","aria-label":c?"Settings shown":"Settings hidden",children:[g.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[g.jsx("path",{d:"M8 10a2 2 0 100-4 2 2 0 000 4z",stroke:"currentColor",strokeWidth:"1.5"}),g.jsx("path",{d:"M13.333 8c0-.367-.2-.7-.533-.867l-.933-.467a.933.933 0 01-.467-.8v-.133c0-.334.133-.6.467-.8l.933-.467c.333-.166.533-.5.533-.866 0-.367-.2-.7-.533-.867L11.867 2.4a.933.933 0 01-.467-.8V1.333c0-.366-.233-.666-.6-.666H9.2c-.366 0-.666.3-.666.666V1.6c0 .334-.267.634-.6.8l-.934.467c-.333.166-.7.166-1 0l-.933-.467a.933.933 0 00-.8 0L2.533 3.067c-.333.166-.533.5-.533.866 0 .367.2.7.533.867l.933.467c.334.2.467.466.467.8v.133c0 .334-.133.6-.467.8l-.933.467c-.333.166-.533.5-.533.866 0 .367.2.7.533.867l.934.533c.333.2.6.5.6.8v.267c0 .366.3.666.666.666h1.6c.367 0 .667-.3.667-.666v-.267c0-.3.267-.6.6-.8l.933-.533c.334-.167.7-.167 1 0l.934.533c.333.2.6.5.6.8v.267c0 .366.3.666.666.666H9.2c.367 0 .667-.3.667-.666v-.267c0-.3.266-.6.6-.8l.933-.533c.333-.167.533-.5.533-.867z",stroke:"currentColor",strokeWidth:"1.5"})]}),g.jsx("span",{children:"Settings"})]}),g.jsx("button",{type:"button",onClick:()=>v(!0),className:"icon-button help-button",title:"Keyboard shortcuts (Ctrl+/)","aria-label":"Show keyboard shortcuts",children:g.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[g.jsx("circle",{cx:"8",cy:"8",r:"6.5",stroke:"currentColor",strokeWidth:"1.5"}),g.jsx("path",{d:"M8 11.5v-.5M8 8.5v-2a1.5 1.5 0 10-1.5-1.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),g.jsx("circle",{cx:"8",cy:"11.5",r:"0.5",fill:"currentColor"})]})}),g.jsx("button",{type:"button",onClick:b,className:"icon-button clear-button",title:"Clear all dashboard data","aria-label":"Clear all dashboard data",children:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:g.jsx("path",{d:"M2 4h12M5.333 4V2.667a1.333 1.333 0 011.334-1.334h2.666a1.333 1.333 0 011.334 1.334V4m2 0v9.333a1.333 1.333 0 01-1.334 1.334H4.667a1.333 1.333 0 01-1.334-1.334V4h9.334z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),g.jsx(BV,{})]})]}),g.jsx("div",{className:"filter-pills-bar",children:g.jsx(uV,{})}),o&&g.jsx(XU,{onClose:()=>d(!1)}),g.jsx("div",{className:"dashboard-main",children:g.jsx("main",{className:"graph-container",children:g.jsx(SR,{children:g.jsx(N7,{})})})}),g.jsx(oU,{}),Array.from(a.values()).map(_=>g.jsx(az,{instanceId:_.id},_.id)),l&&g.jsx(gV,{}),c&&g.jsx(wV,{}),g.jsx(CV,{isOpen:p,onClose:()=>v(!1)})]})},HV="_container_z8335_5",IV="_content_z8335_23",UV="_icon_z8335_43",VV="_title_z8335_55",FV="_description_z8335_71",PV="_actions_z8335_175",GV="_primaryButton_z8335_187",$V="_secondaryButton_z8335_245",da={container:HV,content:IV,icon:UV,title:VV,description:FV,actions:PV,primaryButton:GV,secondaryButton:$V};class YV extends q.Component{constructor(n){super(n),this.state={hasError:!1,error:null,errorInfo:null}}static getDerivedStateFromError(n){return{hasError:!0,error:n}}componentDidCatch(n,a){console.error("ErrorBoundary caught an error:",n,a),this.setState({errorInfo:a})}handleReset=()=>{this.setState({hasError:!1,error:null,errorInfo:null})};handleReload=()=>{window.location.reload()};render(){return this.state.hasError?this.props.fallback?this.props.fallback:g.jsx("div",{className:da.container,role:"alert",children:g.jsxs("div",{className:da.content,children:[g.jsx("div",{className:da.icon,children:g.jsxs("svg",{width:"64",height:"64",viewBox:"0 0 64 64",fill:"none",children:[g.jsx("circle",{cx:"32",cy:"32",r:"28",stroke:"currentColor",strokeWidth:"2",fill:"none"}),g.jsx("path",{d:"M32 20v16M32 44v.5",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round"})]})}),g.jsx("h2",{className:da.title,children:"Something went wrong"}),g.jsx("p",{className:da.description,children:"An unexpected error occurred. You can try resetting the component or reloading the page."}),this.state.error&&!1,g.jsxs("div",{className:da.actions,children:[g.jsx("button",{className:da.primaryButton,onClick:this.handleReset,children:"Try Again"}),g.jsx("button",{className:da.secondaryButton,onClick:this.handleReload,children:"Reload Page"})]})]})}):this.props.children}}function WV(e,n,a){performance.mark(a);const i=performance.measure(`${e}-render`,n,a);return console.log(`[Performance] ${e} render time: ${i.duration.toFixed(2)}ms`),i.duration}const sz=({value:e,maxStringLength:n=200})=>{const[a,i]=q.useState(2);try{const o=JSON.parse(e);return typeof o=="string"||typeof o=="number"||typeof o=="boolean"||o===null?g.jsx("div",{style:{fontFamily:"var(--font-family-mono)",fontSize:"var(--font-size-body-xs)",color:"var(--color-text-secondary)",wordBreak:"break-word"},children:String(o)}):g.jsxs("div",{children:[g.jsxs("div",{style:{display:"flex",gap:"var(--gap-xs)",marginBottom:"var(--gap-xs)"},children:[g.jsx("button",{onClick:()=>i(!1),style:{padding:"2px 8px",fontSize:"var(--font-size-body-xs)",color:"var(--color-text-secondary)",backgroundColor:"var(--color-bg-elevated)",border:"1px solid var(--color-border-subtle)",borderRadius:"var(--radius-xs)",cursor:"pointer",fontFamily:"var(--font-family-mono)"},onMouseEnter:l=>{l.currentTarget.style.backgroundColor="var(--color-bg-hover)"},onMouseLeave:l=>{l.currentTarget.style.backgroundColor="var(--color-bg-elevated)"},children:"Expand All"}),g.jsx("button",{onClick:()=>i(!0),style:{padding:"2px 8px",fontSize:"var(--font-size-body-xs)",color:"var(--color-text-secondary)",backgroundColor:"var(--color-bg-elevated)",border:"1px solid var(--color-border-subtle)",borderRadius:"var(--radius-xs)",cursor:"pointer",fontFamily:"var(--font-family-mono)"},onMouseEnter:l=>{l.currentTarget.style.backgroundColor="var(--color-bg-hover)"},onMouseLeave:l=>{l.currentTarget.style.backgroundColor="var(--color-bg-elevated)"},children:"Collapse All"})]}),g.jsx("div",{style:{maxHeight:"400px",overflowY:"auto",overflowX:"auto"},children:g.jsx(Ye,{value:o,collapsed:a,displayDataTypes:!1,shortenTextAfterLength:0,style:{backgroundColor:"var(--color-bg-elevated)",fontSize:"var(--font-size-body-xs)",fontFamily:"var(--font-family-mono)",padding:"var(--space-component-sm)",borderRadius:"var(--radius-sm)","--w-rjv-line-color":"var(--color-text-tertiary)","--w-rjv-key-string":"var(--color-primary-500)","--w-rjv-info-color":"var(--color-text-secondary)","--w-rjv-curlybraces-color":"var(--color-text-tertiary)","--w-rjv-brackets-color":"var(--color-text-tertiary)","--w-rjv-arrow-color":"var(--color-text-tertiary)","--w-rjv-edit-color":"var(--color-primary-500)","--w-rjv-add-color":"var(--color-success)","--w-rjv-del-color":"var(--color-error)","--w-rjv-update-color":"var(--color-warning)","--w-rjv-border-left-color":"var(--color-border-subtle)"}})})]})}catch{const l=e.length>n?e.substring(0,n)+"...":e;return g.jsx("div",{style:{fontFamily:"var(--font-family-mono)",fontSize:"var(--font-size-body-xs)",color:"var(--color-text-secondary)",wordBreak:"break-word",whiteSpace:"pre-wrap"},children:l})}},XV=()=>{const[e,n]=q.useState(!1),[a,i]=q.useState(!0),[o,l]=q.useState(!1),[c,d]=q.useState(30),[f,h]=q.useState([]),[p,v]=q.useState([]),[m,b]=q.useState([]),[_,S]=q.useState([]),[w,C]=q.useState(null),[T,E]=q.useState(!1),[N,R]=q.useState(null),[z,j]=q.useState(null);q.useEffect(()=>{A(),D(),I()},[]);const A=async()=>{try{const H=await fetch("/api/traces/services");if(!H.ok)throw new Error("Failed to load trace services");const O=await H.json();h(O.services),v(O.operations)}catch(H){console.error("Error loading trace services:",H)}},D=async()=>{try{const H=await fetch("/api/traces/stats");if(!H.ok)throw new Error("Failed to load trace stats");const O=await H.json();C(O)}catch(H){console.error("Error loading trace stats:",H)}},I=async()=>{n(!0),i(!0),l(!1),d(30),b(["flock","agent","dspyengine","outpututilitycomponent"]),S(["DashboardEventCollector.set_websocket_manager"])},P=async()=>{if(confirm("Clear all traces from the database? This cannot be undone.")){E(!0),R(null),j(null);try{const H=await fetch("/api/traces/clear",{method:"POST"});if(!H.ok)throw new Error("Failed to clear traces");const O=await H.json();O.success?(j(`Successfully deleted ${O.deleted_count} trace spans`),D()):R(O.error||"Failed to clear traces")}catch(H){R(H instanceof Error?H.message:"Unknown error")}finally{E(!1),setTimeout(()=>j(null),5e3)}}},V=async()=>{E(!0),R(null),j(null);try{j("Settings saved successfully (persistence coming soon)")}catch(H){R(H instanceof Error?H.message:"Failed to save settings")}finally{E(!1),setTimeout(()=>j(null),5e3)}},$=H=>H?new Date(H).toLocaleString():"N/A",L=H=>H<1?`${(H*1024).toFixed(1)} KB`:`${H.toFixed(2)} MB`;return g.jsxs("div",{children:[N&&g.jsx("div",{className:"settings-message settings-message-error",style:{padding:"var(--space-component-sm)",marginBottom:"var(--space-component-md)",backgroundColor:"rgba(239, 68, 68, 0.1)",border:"1px solid rgba(239, 68, 68, 0.3)",borderRadius:"var(--radius-md)",color:"#ef4444"},children:N}),z&&g.jsx("div",{className:"settings-message settings-message-success",style:{padding:"var(--space-component-sm)",marginBottom:"var(--space-component-md)",backgroundColor:"rgba(16, 185, 129, 0.1)",border:"1px solid rgba(16, 185, 129, 0.3)",borderRadius:"var(--radius-md)",color:"#10b981"},children:z}),g.jsxs("div",{className:"settings-section",children:[g.jsx("h3",{className:"settings-section-title",children:"OpenTelemetry Tracing"}),g.jsxs("div",{className:"settings-field",children:[g.jsxs("div",{className:"settings-checkbox-wrapper",children:[g.jsx("input",{id:"auto-trace",type:"checkbox",checked:e,onChange:H=>n(H.target.checked),className:"settings-checkbox"}),g.jsx("label",{htmlFor:"auto-trace",className:"settings-checkbox-label",children:"Enable auto-tracing (FLOCK_AUTO_TRACE)"})]}),g.jsx("p",{className:"settings-description",children:"Automatically trace all agent operations and system events with OpenTelemetry"})]}),g.jsxs("div",{className:"settings-field",children:[g.jsxs("div",{className:"settings-checkbox-wrapper",children:[g.jsx("input",{id:"trace-file",type:"checkbox",checked:a,onChange:H=>i(H.target.checked),className:"settings-checkbox",disabled:!e}),g.jsx("label",{htmlFor:"trace-file",className:"settings-checkbox-label",children:"Store traces in DuckDB (FLOCK_TRACE_FILE)"})]}),g.jsx("p",{className:"settings-description",children:"Save traces to .flock/traces.duckdb for analysis and debugging"})]}),g.jsxs("div",{className:"settings-field",children:[g.jsxs("div",{className:"settings-checkbox-wrapper",children:[g.jsx("input",{id:"auto-workflow",type:"checkbox",checked:o,onChange:H=>l(H.target.checked),className:"settings-checkbox",disabled:!e}),g.jsx("label",{htmlFor:"auto-workflow",className:"settings-checkbox-label",children:"Unified workflow tracing (FLOCK_AUTO_WORKFLOW_TRACE)"})]}),g.jsx("p",{className:"settings-description",children:"Automatically wrap operations in unified workflow traces (experimental)"})]}),g.jsxs("div",{className:"settings-field",children:[g.jsx("label",{htmlFor:"trace-ttl",className:"settings-label",children:"Trace Time-To-Live (FLOCK_TRACE_TTL_DAYS)"}),g.jsx("p",{className:"settings-description",children:"Auto-delete traces older than specified days (leave empty to keep forever)"}),g.jsx("input",{id:"trace-ttl",type:"number",min:"1",max:"365",value:c??"",onChange:H=>d(H.target.value?parseInt(H.target.value):null),className:"settings-input",placeholder:"30",disabled:!e})]})]}),g.jsxs("div",{className:"settings-section",children:[g.jsx("h3",{className:"settings-section-title",children:"Service Whitelist (FLOCK_TRACE_SERVICES)"}),g.jsx("p",{className:"settings-description",style:{marginBottom:"var(--space-component-md)"},children:"Only trace specific services. Leave empty to trace all services."}),g.jsx(so,{options:f,selected:m,onChange:b,placeholder:"Select services to trace...",disabled:!e})]}),g.jsxs("div",{className:"settings-section",children:[g.jsx("h3",{className:"settings-section-title",children:"Operation Blacklist (FLOCK_TRACE_IGNORE)"}),g.jsx("p",{className:"settings-description",style:{marginBottom:"var(--space-component-md)"},children:"Exclude specific operations from tracing (format: Service.method)"}),g.jsx(so,{options:p,selected:_,onChange:S,placeholder:"Select operations to ignore...",disabled:!e})]}),g.jsxs("div",{className:"settings-section",children:[g.jsx("h3",{className:"settings-section-title",children:"Trace Database Statistics"}),w&&g.jsx("div",{style:{backgroundColor:"rgba(96, 165, 250, 0.05)",border:"1px solid rgba(96, 165, 250, 0.2)",borderRadius:"var(--radius-md)",padding:"var(--space-component-md)"},children:g.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"var(--gap-md)"},children:[g.jsxs("div",{children:[g.jsx("div",{style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-secondary)",marginBottom:"var(--space-xs)"},children:"Total Spans"}),g.jsx("div",{style:{fontSize:"var(--font-size-lg)",fontWeight:600},children:w.total_spans.toLocaleString()})]}),g.jsxs("div",{children:[g.jsx("div",{style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-secondary)",marginBottom:"var(--space-xs)"},children:"Total Traces"}),g.jsx("div",{style:{fontSize:"var(--font-size-lg)",fontWeight:600},children:w.total_traces.toLocaleString()})]}),g.jsxs("div",{children:[g.jsx("div",{style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-secondary)",marginBottom:"var(--space-xs)"},children:"Services Traced"}),g.jsx("div",{style:{fontSize:"var(--font-size-lg)",fontWeight:600},children:w.services_count})]}),g.jsxs("div",{children:[g.jsx("div",{style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-secondary)",marginBottom:"var(--space-xs)"},children:"Database Size"}),g.jsx("div",{style:{fontSize:"var(--font-size-lg)",fontWeight:600},children:L(w.database_size_mb)})]}),g.jsxs("div",{children:[g.jsx("div",{style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-secondary)",marginBottom:"var(--space-xs)"},children:"Oldest Trace"}),g.jsx("div",{style:{fontSize:"var(--font-size-xs)"},children:$(w.oldest_trace)})]}),g.jsxs("div",{children:[g.jsx("div",{style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-secondary)",marginBottom:"var(--space-xs)"},children:"Newest Trace"}),g.jsx("div",{style:{fontSize:"var(--font-size-xs)"},children:$(w.newest_trace)})]})]})}),g.jsxs("div",{style:{marginTop:"var(--space-component-md)"},children:[g.jsx("button",{onClick:P,disabled:T||!w||w.total_spans===0,className:"settings-reset-button",style:{backgroundColor:"rgba(239, 68, 68, 0.1)",border:"1px solid rgba(239, 68, 68, 0.3)",color:"#ef4444"},children:T?"Clearing...":"Clear All Traces"}),g.jsx("p",{className:"settings-description",style:{marginTop:"var(--space-xs)"},children:"Delete all spans and run VACUUM to reclaim disk space"})]})]}),g.jsxs("div",{className:"settings-section",children:[g.jsx("button",{onClick:V,disabled:T,className:"settings-save-button",style:{backgroundColor:"rgba(96, 165, 250, 0.1)",border:"1px solid rgba(96, 165, 250, 0.3)",color:"#60a5fa",padding:"var(--space-component-sm) var(--space-component-md)",borderRadius:"var(--radius-md)",fontSize:"var(--font-size-base)",fontWeight:500,cursor:T?"not-allowed":"pointer",opacity:T?.6:1},children:T?"Saving...":"Save Tracing Settings"}),g.jsx("p",{className:"settings-description",style:{marginTop:"var(--space-xs)"},children:"Settings will be persisted to .env file (requires backend restart)"})]})]})},KV=()=>{const[e,n]=q.useState([]),[a,i]=q.useState(!0),[o,l]=q.useState(null),[c,d]=q.useState(new Set),[f,h]=q.useState(new Set),[p,v]=q.useState(new Set),[m,b]=q.useState(""),[_,S]=q.useState("timeline"),[w,C]=q.useState(null),[T,E]=q.useState(new Set),[N,R]=q.useState("SELECT * FROM spans LIMIT 10"),[z,j]=q.useState(null),[A,D]=q.useState([]),[I,P]=q.useState(!1),[V,$]=q.useState(null),[L,H]=q.useState("date"),[O,F]=q.useState("desc"),J=q.useRef(null),G=q.useRef(0),re=async()=>{P(!0),$(null);try{const W=await fetch("/api/traces/query",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:N})});if(!W.ok){const te=await W.json();throw new Error(te.error||"Query failed")}const se=await W.json();j(se.results),D(se.columns)}catch(W){$(W instanceof Error?W.message:"Unknown error"),j(null),D([])}finally{P(!1)}},B=q.useMemo(()=>{const W=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6","#ec4899","#06b6d4","#f97316"],se=new Map,te=[],me=[];return e.forEach(ve=>{const Se=ve.name.split(".")[0]||ve.resource["service.name"]||"unknown";te.includes(Se)||te.push(Se);const Ee=ve.name.split(".")[0]||ve.name;Ee&&!me.includes(Ee)&&me.push(Ee)}),te.length===1?me.forEach((ve,Se)=>{const Ee=W[Se%W.length]||"#6366f1";se.set(ve,Ee)}):te.forEach((ve,Se)=>{const Ee=W[Se%W.length]||"#6366f1";se.set(ve,Ee)}),{colorMap:se,useSpanType:te.length===1}},[e]);q.useEffect(()=>{const W=async()=>{try{e.length===0&&i(!0);const te=await fetch("/api/traces");if(!te.ok)throw new Error(`HTTP ${te.status}: ${te.statusText}`);const me=await te.json();if(JSON.stringify(me)!==JSON.stringify(e)){const ve=J.current?.scrollTop||0;n(me),l(null),requestAnimationFrame(()=>{J.current&&me.length===G.current&&(J.current.scrollTop=ve)}),G.current=me.length}}catch(te){l(te instanceof Error?te.message:"Failed to load traces")}finally{i(!1)}};W();const se=setInterval(W,5e3);return()=>clearInterval(se)},[e]);const Y=q.useMemo(()=>{const W=new Map;return e.forEach(se=>{const te=se.context.trace_id;W.has(te)||W.set(te,[]),W.get(te).push(se)}),Array.from(W.entries()).map(([se,te])=>{const me=Math.min(...te.map(qe=>qe.start_time)),ve=Math.max(...te.map(qe=>qe.end_time)),Se=(ve-me)/1e6,Ee=te.some(qe=>qe.status.status_code==="ERROR"),Ve=new Set(te.map(qe=>qe.name.split(".")[0]||qe.resource["service.name"]||"unknown"));return{traceId:se,spans:te.sort((qe,lt)=>qe.start_time-lt.start_time),startTime:me,endTime:ve,duration:Se,spanCount:te.length,hasError:Ee,services:Ve}})},[e]),ae=q.useMemo(()=>{let W=Y;if(m){const se=m.toLowerCase();W=W.filter(te=>te.traceId.toLowerCase().includes(se)||te.spans.some(me=>me.name.toLowerCase().includes(se)||Object.values(me.attributes).some(ve=>typeof ve=="string"&&ve.toLowerCase().includes(se))))}return[...W].sort((se,te)=>{let me=0;switch(L){case"date":me=se.startTime-te.startTime;break;case"spans":me=se.spanCount-te.spanCount;break;case"duration":me=se.duration-te.duration;break}return O==="asc"?me:-me})},[Y,m,L,O]),U=q.useMemo(()=>{const W=new Map;return e.forEach(se=>{const te=se.name.split(".")[0]||"unknown";W.has(te)||W.set(te,{service:te,totalSpans:0,errorSpans:0,avgDuration:0,p95Duration:0,p99Duration:0,rate:0});const me=W.get(te);me.totalSpans++,se.status.status_code==="ERROR"&&me.errorSpans++}),W.forEach((se,te)=>{const me=e.filter(Se=>(Se.name.split(".")[0]||"unknown")===te),ve=me.map(Se=>(Se.end_time-Se.start_time)/1e6).sort((Se,Ee)=>Se-Ee);if(se.avgDuration=ve.reduce((Se,Ee)=>Se+Ee,0)/ve.length||0,se.p95Duration=ve[Math.floor(ve.length*.95)]||0,se.p99Duration=ve[Math.floor(ve.length*.99)]||0,me.length>1){const Se=(Math.max(...me.map(Ee=>Ee.end_time))-Math.min(...me.map(Ee=>Ee.start_time)))/1e9;se.rate=me.length/Math.max(Se,1)}}),Array.from(W.values()).sort((se,te)=>te.totalSpans-se.totalSpans)},[e]),Z=q.useMemo(()=>{const W=new Map;return Y.forEach(se=>{se.spans.forEach(te=>{if(te.parent_id){const me=se.spans.find(ve=>ve.context.span_id===te.parent_id);if(me){const ve=me.name.split(".")[0]||"unknown",Se=te.name.split(".")[0]||"unknown";if(ve!==Se){const Ee=`${ve}->${Se}`;W.has(Ee)||W.set(Ee,{from:ve,to:Se,operations:new Map});const Ve=W.get(Ee),qe=`${me.name} → ${te.name}`;Ve.operations.has(qe)||Ve.operations.set(qe,{operation:qe,service:Se,totalCalls:0,errorCalls:0,avgDuration:0,p95Duration:0});const lt=Ve.operations.get(qe);lt.totalCalls++,te.status.status_code==="ERROR"&&lt.errorCalls++}}}})}),W.forEach(se=>{se.operations.forEach((te,me)=>{const ve=me.split(" → ")[1],Ee=e.filter(Ve=>Ve.name===ve).map(Ve=>(Ve.end_time-Ve.start_time)/1e6).sort((Ve,qe)=>Ve-qe);te.avgDuration=Ee.reduce((Ve,qe)=>Ve+qe,0)/Ee.length||0,te.p95Duration=Ee[Math.floor(Ee.length*.95)]||0})}),Array.from(W.values())},[Y,e]),ne=W=>{const se=new Map,te=[];W.forEach(ve=>{se.set(ve.context.span_id,{...ve,children:[],depth:0})}),W.forEach(ve=>{const Se=se.get(ve.context.span_id);if(ve.parent_id&&se.has(ve.parent_id)){const Ee=se.get(ve.parent_id);Ee.children.push(Se),Se.depth=Ee.depth+1}else te.push(Se)});const me=ve=>{ve.children.sort((Se,Ee)=>Se.start_time-Ee.start_time),ve.children.forEach(me)};return te.forEach(me),te},le=W=>{h(se=>{const te=new Set(se);return te.has(W)?te.delete(W):te.add(W),te})},K=W=>{v(se=>{const te=new Set(se);return te.has(W)?te.delete(W):te.add(W),te})},de=(W,se)=>{if(B.useSpanType){const te=se.split(".")[0]||se;return B.colorMap.get(te)||"#6366f1"}return W&&B.colorMap.get(W)||"#6366f1"},ye=W=>g.jsx("div",{style:{marginTop:"var(--space-component-md)",background:"var(--color-bg-base)",borderRadius:"var(--radius-lg)",overflow:"hidden"},children:g.jsxs("table",{style:{width:"100%",fontSize:"var(--font-size-body-sm)",fontFamily:"var(--font-family-mono)",borderCollapse:"collapse"},children:[g.jsx("thead",{children:g.jsxs("tr",{style:{background:"var(--color-bg-surface)",borderBottom:"2px solid var(--color-border-subtle)"},children:[g.jsx("th",{style:{padding:"12px",textAlign:"left",color:"var(--color-text-secondary)",fontWeight:"var(--font-weight-bold)"},children:"Service"}),g.jsx("th",{style:{padding:"12px",textAlign:"left",color:"var(--color-text-secondary)",fontWeight:"var(--font-weight-bold)"},children:"Operation"}),g.jsx("th",{style:{padding:"12px",textAlign:"right",color:"var(--color-text-secondary)",fontWeight:"var(--font-weight-bold)"},children:"Duration"}),g.jsx("th",{style:{padding:"12px",textAlign:"right",color:"var(--color-text-secondary)",fontWeight:"var(--font-weight-bold)"},children:"Start Time"}),g.jsx("th",{style:{padding:"12px",textAlign:"center",color:"var(--color-text-secondary)",fontWeight:"var(--font-weight-bold)"},children:"Status"})]})}),g.jsx("tbody",{children:W.spans.map((se,te)=>{const me=(se.end_time-se.start_time)/1e6,ve=(se.start_time-W.startTime)/1e6,Se=se.name.split(".")[0]||se.resource["service.name"]||"unknown";return g.jsxs("tr",{style:{background:te%2===0?"transparent":"var(--color-bg-surface)",borderBottom:"1px solid var(--color-border-subtle)"},children:[g.jsxs("td",{style:{padding:"10px"},children:[g.jsx("span",{style:{display:"inline-block",width:"8px",height:"8px",borderRadius:"50%",background:de(Se,se.name),marginRight:"8px"}}),Se]}),g.jsx("td",{style:{padding:"10px",color:"var(--color-text-primary)"},children:se.name}),g.jsxs("td",{style:{padding:"10px",textAlign:"right",color:"var(--color-text-primary)",fontWeight:"var(--font-weight-medium)"},children:[me.toFixed(2),"ms"]}),g.jsxs("td",{style:{padding:"10px",textAlign:"right",color:"var(--color-text-tertiary)"},children:["+",ve.toFixed(2),"ms"]}),g.jsx("td",{style:{padding:"10px",textAlign:"center"},children:g.jsx("span",{style:{padding:"2px 8px",borderRadius:"var(--radius-sm)",fontSize:"var(--font-size-body-xs)",fontWeight:"var(--font-weight-medium)",background:se.status.status_code==="ERROR"?"rgba(239, 68, 68, 0.2)":"rgba(16, 185, 129, 0.2)",color:se.status.status_code==="ERROR"?"#ef4444":"#10b981"},children:se.status.status_code})})]},se.context.span_id)})})]})}),xe=(W,se,te)=>{const me=(W.start_time-se)/1e6,ve=(W.end_time-W.start_time)/1e6,Se=Math.min(me/te*100,100),Ee=Math.min(ve/te*100,100-Se),Ve=Math.max(Ee,.5),qe=f.has(W.context.span_id),lt=p.has(W.context.span_id),tt=W.children.length>0,nt=W.name.split(".")[0]||W.resource["service.name"]||"unknown",Ft=de(nt,W.name),$t=w===W.context.span_id;return g.jsxs("div",{style:{marginBottom:"1px",opacity:$t?1:w?.4:1},children:[g.jsxs("div",{style:{display:"grid",gridTemplateColumns:"400px 1fr",alignItems:"center",background:qe?"var(--color-bg-elevated)":"transparent",borderBottom:"1px solid rgba(255, 255, 255, 0.03)"},children:[g.jsxs("div",{style:{padding:"8px 12px",fontSize:"var(--font-size-body-sm)",fontFamily:"var(--font-family-mono)",color:"var(--color-text-primary)",display:"flex",alignItems:"center",gap:"8px",paddingLeft:`${12+W.depth*20}px`,borderRight:"1px solid var(--color-border-subtle)"},children:[tt&&g.jsx("span",{onClick:()=>K(W.context.span_id),style:{cursor:"pointer",userSelect:"none",width:"12px",opacity:.6,fontSize:"10px"},children:lt?"►":"▼"}),!tt&&g.jsx("span",{style:{width:"12px"}}),g.jsx("span",{style:{display:"inline-block",width:"6px",height:"6px",borderRadius:"50%",background:Ft,flexShrink:0}}),g.jsx("span",{onClick:At=>{At.shiftKey?C($t?null:W.context.span_id):le(W.context.span_id)},style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:"pointer",display:"flex",alignItems:"center",gap:"4px"},title:`${W.name}
Shift+click to focus`,children:g.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis"},children:W.name})}),g.jsxs("span",{style:{fontSize:"var(--font-size-body-xs)",color:"var(--color-text-tertiary)",flexShrink:0},children:[ve.toFixed(1),"ms"]})]}),g.jsx("div",{style:{padding:"8px 12px",height:"32px"},children:g.jsx("div",{style:{position:"relative",height:"18px",width:"100%"},children:g.jsx("div",{style:{position:"absolute",left:`${Se}%`,width:`${Ve}%`,height:"100%",background:Ft,border:W.status.status_code==="ERROR"?"2px solid #ef4444":"none",borderRadius:"2px",display:"flex",alignItems:"center",paddingLeft:"4px",fontSize:"10px",color:"white",fontWeight:"var(--font-weight-medium)",cursor:"pointer",boxSizing:"border-box"},onClick:()=>le(W.context.span_id),title:`${W.name}
Service: ${nt}
${ve.toFixed(2)}ms
Start: +${me.toFixed(2)}ms`})})})]}),qe&&g.jsx("div",{style:{background:"var(--color-bg-surface)",border:"1px solid var(--color-border-subtle)",borderLeft:`4px solid ${Ft}`,margin:"0 12px 8px 12px",padding:"var(--space-component-sm)",borderRadius:"var(--radius-md)",fontSize:"var(--font-size-body-xs)",fontFamily:"var(--font-family-mono)"},children:g.jsxs("div",{style:{display:"grid",gridTemplateColumns:"120px 1fr",gap:"6px",color:"var(--color-text-secondary)"},children:[g.jsx("div",{style:{color:"var(--color-text-tertiary)",fontWeight:"var(--font-weight-medium)"},children:"Service:"}),g.jsx("div",{children:nt}),g.jsx("div",{style:{color:"var(--color-text-tertiary)",fontWeight:"var(--font-weight-medium)"},children:"Span ID:"}),g.jsx("div",{style:{wordBreak:"break-all"},children:W.context.span_id}),W.parent_id&&g.jsxs(g.Fragment,{children:[g.jsx("div",{style:{color:"var(--color-text-tertiary)",fontWeight:"var(--font-weight-medium)"},children:"Parent ID:"}),g.jsx("div",{style:{wordBreak:"break-all"},children:W.parent_id})]}),g.jsx("div",{style:{color:"var(--color-text-tertiary)",fontWeight:"var(--font-weight-medium)"},children:"Duration:"}),g.jsxs("div",{children:[ve.toFixed(3),"ms"]}),g.jsx("div",{style:{color:"var(--color-text-tertiary)",fontWeight:"var(--font-weight-medium)"},children:"Start Time:"}),g.jsxs("div",{children:["+",me.toFixed(3),"ms"]}),g.jsx("div",{style:{color:"var(--color-text-tertiary)",fontWeight:"var(--font-weight-medium)"},children:"Status:"}),g.jsx("div",{style:{color:W.status.status_code==="ERROR"?"#ef4444":"#10b981",fontWeight:"var(--font-weight-bold)"},children:W.status.status_code}),Object.entries(W.attributes).length>0&&g.jsxs(g.Fragment,{children:[g.jsx("div",{style:{gridColumn:"1 / -1",borderTop:"1px solid var(--color-border-subtle)",margin:"8px 0 4px 0",paddingTop:"8px",color:"var(--color-text-secondary)",fontWeight:"var(--font-weight-medium)"},children:"Tags:"}),Object.entries(W.attributes).map(([At,Lt])=>g.jsxs(Kn.Fragment,{children:[g.jsxs("div",{style:{color:"var(--color-text-tertiary)",alignSelf:"start"},children:[At,":"]}),g.jsx("div",{children:g.jsx(sz,{value:Lt})})]},At))]})]})}),tt&&!lt&&g.jsx("div",{children:W.children.map(At=>xe(At,se,te))})]},W.context.span_id)},be=W=>{const se=Math.max(...W.spans.map(ve=>(ve.end_time-W.startTime)/1e6)),te=Math.max(se,W.duration),me=ne(W.spans);return g.jsxs("div",{style:{marginTop:"var(--space-component-md)",background:"var(--color-bg-base)",borderRadius:"var(--radius-lg)",overflow:"hidden"},children:[g.jsxs("div",{style:{display:"grid",gridTemplateColumns:"400px 1fr",background:"var(--color-bg-surface)",borderBottom:"2px solid var(--color-border-subtle)",fontSize:"var(--font-size-body-xs)",color:"var(--color-text-tertiary)",fontWeight:"var(--font-weight-medium)"},children:[g.jsx("div",{style:{padding:"10px 12px",borderRight:"1px solid var(--color-border-subtle)"},children:"Service & Operation"}),g.jsxs("div",{style:{padding:"10px 12px"},children:["Timeline (0ms - ",te.toFixed(0),"ms)"]})]}),me.map(ve=>xe(ve,W.startTime,te))]})};return a?g.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",color:"var(--color-text-secondary)"},children:g.jsxs("div",{style:{textAlign:"center"},children:[g.jsx("div",{style:{fontSize:"32px",marginBottom:"var(--gap-md)",opacity:.5},children:"🔎"}),g.jsx("div",{children:"Loading traces..."})]})}):o?g.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",color:"var(--color-error)"},children:g.jsxs("div",{style:{textAlign:"center"},children:[g.jsx("div",{style:{fontSize:"32px",marginBottom:"var(--gap-md)"},children:"⚠️"}),g.jsx("div",{children:o})]})}):g.jsxs("div",{style:{height:"100%",display:"flex",flexDirection:"column",background:"var(--color-bg-surface)"},children:[g.jsxs("div",{style:{padding:"var(--space-component-md)",borderBottom:"1px solid var(--color-border-subtle)",display:"flex",flexDirection:"column",gap:"var(--gap-sm)"},children:[g.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[g.jsx("button",{onClick:()=>S("timeline"),style:{padding:"6px 12px",border:"1px solid var(--color-border-subtle)",borderRadius:"var(--radius-md)",background:_==="timeline"?"var(--color-primary-500)":"var(--color-bg-base)",color:_==="timeline"?"white":"var(--color-text-primary)",fontSize:"var(--font-size-body-sm)",cursor:"pointer",fontWeight:"var(--font-weight-medium)"},children:"📅 Timeline"}),g.jsx("button",{onClick:()=>S("statistics"),style:{padding:"6px 12px",border:"1px solid var(--color-border-subtle)",borderRadius:"var(--radius-md)",background:_==="statistics"?"var(--color-primary-500)":"var(--color-bg-base)",color:_==="statistics"?"white":"var(--color-text-primary)",fontSize:"var(--font-size-body-sm)",cursor:"pointer",fontWeight:"var(--font-weight-medium)"},children:"📊 Statistics"}),g.jsx("button",{onClick:()=>S("metrics"),style:{padding:"6px 12px",border:"1px solid var(--color-border-subtle)",borderRadius:"var(--radius-md)",background:_==="metrics"?"var(--color-primary-500)":"var(--color-bg-base)",color:_==="metrics"?"white":"var(--color-text-primary)",fontSize:"var(--font-size-body-sm)",cursor:"pointer",fontWeight:"var(--font-weight-medium)"},children:"🔴 RED Metrics"}),g.jsx("button",{onClick:()=>S("dependencies"),style:{padding:"6px 12px",border:"1px solid var(--color-border-subtle)",borderRadius:"var(--radius-md)",background:_==="dependencies"?"var(--color-primary-500)":"var(--color-bg-base)",color:_==="dependencies"?"white":"var(--color-text-primary)",fontSize:"var(--font-size-body-sm)",cursor:"pointer",fontWeight:"var(--font-weight-medium)"},children:"🔗 Dependencies"}),g.jsx("button",{onClick:()=>S("sql"),style:{padding:"6px 12px",border:"1px solid var(--color-border-subtle)",borderRadius:"var(--radius-md)",background:_==="sql"?"var(--color-primary-500)":"var(--color-bg-base)",color:_==="sql"?"white":"var(--color-text-primary)",fontSize:"var(--font-size-body-sm)",cursor:"pointer",fontWeight:"var(--font-weight-medium)"},children:"🗄️ DuckDB SQL"}),g.jsx("button",{onClick:()=>S("configuration"),style:{padding:"6px 12px",border:"1px solid var(--color-border-subtle)",borderRadius:"var(--radius-md)",background:_==="configuration"?"var(--color-primary-500)":"var(--color-bg-base)",color:_==="configuration"?"white":"var(--color-text-primary)",fontSize:"var(--font-size-body-sm)",cursor:"pointer",fontWeight:"var(--font-weight-medium)"},children:"⚙️ Configuration"}),g.jsx("button",{onClick:()=>S("guide"),style:{padding:"6px 12px",border:"1px solid var(--color-border-subtle)",borderRadius:"var(--radius-md)",background:_==="guide"?"var(--color-primary-500)":"var(--color-bg-base)",color:_==="guide"?"white":"var(--color-text-primary)",fontSize:"var(--font-size-body-sm)",cursor:"pointer",fontWeight:"var(--font-weight-medium)"},children:"📚 Guide"}),(_==="timeline"||_==="statistics")&&g.jsxs("div",{style:{fontSize:"var(--font-size-body-xs)",color:"var(--color-text-secondary)",marginLeft:"auto"},children:[ae.length," trace",ae.length!==1?"s":""]})]}),g.jsx("input",{type:"text",placeholder:"🔎 Find traces (Jaeger style) - Search by service, operation, trace ID, correlation ID, or error",value:m,onChange:W=>b(W.target.value),style:{width:"100%",padding:"var(--space-component-sm)",border:"1px solid var(--color-border-subtle)",borderRadius:"var(--radius-md)",background:"var(--color-bg-base)",color:"var(--color-text-primary)",fontSize:"var(--font-size-body-sm)"}}),(_==="timeline"||_==="statistics")&&g.jsxs("div",{style:{display:"flex",gap:"var(--gap-xs)",alignItems:"center",fontSize:"var(--font-size-body-xs)"},children:[g.jsx("span",{style:{color:"var(--color-text-tertiary)",flexShrink:0},children:"Sort:"}),["date","spans","duration"].map(W=>{const se=L===W,te={date:"Date",spans:"Spans",duration:"Duration"};return g.jsxs("button",{onClick:()=>{L===W?F(O==="asc"?"desc":"asc"):(H(W),F(W==="date"?"desc":"asc"))},style:{padding:"4px 10px",background:se?"var(--color-accent)":"var(--color-bg-elevated)",color:se?"white":"var(--color-text-secondary)",border:se?"none":"1px solid var(--color-border-subtle)",borderRadius:"var(--radius-sm)",fontSize:"var(--font-size-body-xs)",cursor:"pointer",display:"flex",alignItems:"center",gap:"4px",fontWeight:se?"var(--font-weight-medium)":"normal"},children:[g.jsx("span",{children:te[W]}),se&&g.jsx("span",{style:{fontSize:"10px"},children:O==="asc"?"↑":"↓"})]},W)})]})]}),g.jsxs("div",{ref:J,style:{flex:1,overflow:"auto",padding:"var(--space-component-md)"},children:[_==="metrics"&&g.jsxs("div",{children:[g.jsx("div",{style:{fontSize:"var(--font-size-body-md)",fontWeight:"var(--font-weight-medium)",color:"var(--color-text-primary)",marginBottom:"var(--space-component-md)"},children:"RED Metrics by Service"}),U.length===0?g.jsx("div",{style:{textAlign:"center",padding:"var(--space-component-xl)",color:"var(--color-text-tertiary)"},children:"No metrics data available"}):g.jsx("div",{style:{display:"grid",gap:"var(--gap-md)"},children:U.map(W=>{const se=B.colorMap.get(W.service)||"#6366f1",te=W.totalSpans>0?W.errorSpans/W.totalSpans*100:0;return g.jsxs("div",{style:{padding:"var(--space-component-md)",background:"var(--color-bg-elevated)",borderRadius:"var(--radius-lg)",border:"1px solid var(--color-border-subtle)",borderLeft:`4px solid ${se}`},children:[g.jsx("div",{style:{fontSize:"var(--font-size-body-lg)",fontWeight:"var(--font-weight-bold)",color:se,marginBottom:"var(--space-component-sm)"},children:W.service}),g.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(150px, 1fr))",gap:"var(--gap-md)"},children:[g.jsxs("div",{children:[g.jsx("div",{style:{fontSize:"var(--font-size-body-xs)",color:"var(--color-text-tertiary)",marginBottom:"4px"},children:"Rate"}),g.jsxs("div",{style:{fontSize:"var(--font-size-body-lg)",fontWeight:"var(--font-weight-medium)",color:"var(--color-text-primary)"},children:[W.rate.toFixed(2)," req/s"]})]}),g.jsxs("div",{children:[g.jsx("div",{style:{fontSize:"var(--font-size-body-xs)",color:"var(--color-text-tertiary)",marginBottom:"4px"},children:"Error Rate"}),g.jsxs("div",{style:{fontSize:"var(--font-size-body-lg)",fontWeight:"var(--font-weight-medium)",color:te>0?"#ef4444":"#10b981"},children:[te.toFixed(1),"%"]})]}),g.jsxs("div",{children:[g.jsx("div",{style:{fontSize:"var(--font-size-body-xs)",color:"var(--color-text-tertiary)",marginBottom:"4px"},children:"Avg Duration"}),g.jsxs("div",{style:{fontSize:"var(--font-size-body-lg)",fontWeight:"var(--font-weight-medium)",color:"var(--color-text-primary)"},children:[W.avgDuration.toFixed(2),"ms"]})]}),g.jsxs("div",{children:[g.jsx("div",{style:{fontSize:"var(--font-size-body-xs)",color:"var(--color-text-tertiary)",marginBottom:"4px"},children:"P95 Duration"}),g.jsxs("div",{style:{fontSize:"var(--font-size-body-lg)",fontWeight:"var(--font-weight-medium)",color:"var(--color-text-primary)"},children:[W.p95Duration.toFixed(2),"ms"]})]}),g.jsxs("div",{children:[g.jsx("div",{style:{fontSize:"var(--font-size-body-xs)",color:"var(--color-text-tertiary)",marginBottom:"4px"},children:"P99 Duration"}),g.jsxs("div",{style:{fontSize:"var(--font-size-body-lg)",fontWeight:"var(--font-weight-medium)",color:"var(--color-text-primary)"},children:[W.p99Duration.toFixed(2),"ms"]})]}),g.jsxs("div",{children:[g.jsx("div",{style:{fontSize:"var(--font-size-body-xs)",color:"var(--color-text-tertiary)",marginBottom:"4px"},children:"Total Spans"}),g.jsx("div",{style:{fontSize:"var(--font-size-body-lg)",fontWeight:"var(--font-weight-medium)",color:"var(--color-text-primary)"},children:W.totalSpans})]})]})]},W.service)})})]}),_==="dependencies"&&g.jsxs("div",{children:[g.jsx("div",{style:{fontSize:"var(--font-size-body-md)",fontWeight:"var(--font-weight-medium)",color:"var(--color-text-primary)",marginBottom:"var(--space-component-md)"},children:"Service Dependencies with Operation Drill-down"}),Z.length===0?g.jsx("div",{style:{textAlign:"center",padding:"var(--space-component-xl)",color:"var(--color-text-tertiary)"},children:"No service dependencies detected"}):g.jsx("div",{style:{display:"grid",gap:"var(--gap-md)"},children:Z.map(W=>{const se=`${W.from}->${W.to}`,te=T.has(se),me=B.colorMap.get(W.from)||"#6366f1",ve=B.colorMap.get(W.to)||"#6366f1";return g.jsxs("div",{style:{padding:"var(--space-component-md)",background:"var(--color-bg-elevated)",borderRadius:"var(--radius-lg)",border:"1px solid var(--color-border-subtle)"},children:[g.jsxs("div",{onClick:()=>{E(Se=>{const Ee=new Set(Se);return Ee.has(se)?Ee.delete(se):Ee.add(se),Ee})},style:{display:"flex",alignItems:"center",gap:"var(--gap-md)",cursor:"pointer",marginBottom:te?"var(--space-component-md)":0},children:[g.jsx("div",{style:{fontSize:"14px",opacity:.5},children:te?"▼":"►"}),g.jsx("div",{style:{padding:"6px 16px",borderRadius:"var(--radius-md)",background:me,color:"white",fontSize:"var(--font-size-body-sm)",fontWeight:"var(--font-weight-bold)"},children:W.from}),g.jsx("div",{style:{fontSize:"var(--font-size-body-lg)",color:"var(--color-text-tertiary)"},children:"→"}),g.jsx("div",{style:{padding:"6px 16px",borderRadius:"var(--radius-md)",background:ve,color:"white",fontSize:"var(--font-size-body-sm)",fontWeight:"var(--font-weight-bold)"},children:W.to}),g.jsxs("div",{style:{fontSize:"var(--font-size-body-xs)",color:"var(--color-text-tertiary)",marginLeft:"auto"},children:[W.operations.size," operation",W.operations.size!==1?"s":""]})]}),te&&g.jsx("div",{style:{display:"grid",gap:"var(--gap-sm)",paddingLeft:"30px"},children:Array.from(W.operations.values()).map(Se=>{const Ee=Se.totalCalls>0?Se.errorCalls/Se.totalCalls*100:0;return g.jsxs("div",{style:{padding:"var(--space-component-sm)",background:"var(--color-bg-surface)",borderRadius:"var(--radius-md)",border:"1px solid var(--color-border-subtle)"},children:[g.jsx("div",{style:{fontSize:"var(--font-size-body-xs)",fontFamily:"var(--font-family-mono)",color:"var(--color-text-secondary)",marginBottom:"var(--gap-xs)"},children:Se.operation}),g.jsxs("div",{style:{display:"flex",gap:"var(--gap-lg)",fontSize:"var(--font-size-body-xs)"},children:[g.jsxs("div",{children:[g.jsx("span",{style:{color:"var(--color-text-tertiary)"},children:"Calls: "}),g.jsx("span",{style:{color:"var(--color-text-primary)",fontWeight:"var(--font-weight-medium)"},children:Se.totalCalls})]}),g.jsxs("div",{children:[g.jsx("span",{style:{color:"var(--color-text-tertiary)"},children:"Errors: "}),g.jsxs("span",{style:{color:Ee>0?"#ef4444":"#10b981",fontWeight:"var(--font-weight-medium)"},children:[Ee.toFixed(1),"%"]})]}),g.jsxs("div",{children:[g.jsx("span",{style:{color:"var(--color-text-tertiary)"},children:"Avg: "}),g.jsxs("span",{style:{color:"var(--color-text-primary)",fontWeight:"var(--font-weight-medium)"},children:[Se.avgDuration.toFixed(2),"ms"]})]}),g.jsxs("div",{children:[g.jsx("span",{style:{color:"var(--color-text-tertiary)"},children:"P95: "}),g.jsxs("span",{style:{color:"var(--color-text-primary)",fontWeight:"var(--font-weight-medium)"},children:[Se.p95Duration.toFixed(2),"ms"]})]})]})]},Se.operation)})})]},se)})})]}),_==="configuration"&&g.jsx("div",{children:g.jsx(XV,{})}),_==="guide"&&g.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--gap-lg)",padding:"var(--space-component-md)"},children:[g.jsxs("div",{children:[g.jsx("h3",{style:{fontSize:"var(--font-size-heading-sm)",fontWeight:"var(--font-weight-bold)",color:"var(--color-text-primary)",marginBottom:"var(--gap-md)"},children:"🚀 Quick Start Guide"}),g.jsx("div",{style:{display:"grid",gap:"var(--gap-md)",color:"var(--color-text-secondary)",fontSize:"var(--font-size-body-sm)"},children:g.jsx("p",{children:"The Trace Viewer provides comprehensive observability for your Flock applications using OpenTelemetry distributed tracing."})})]}),g.jsxs("div",{children:[g.jsx("h4",{style:{fontSize:"var(--font-size-body-md)",fontWeight:"var(--font-weight-bold)",color:"var(--color-text-primary)",marginBottom:"var(--gap-sm)"},children:"📊 View Modes"}),g.jsx("div",{style:{display:"grid",gap:"var(--gap-sm)"},children:[{icon:"📅",name:"Timeline",desc:"Waterfall view of spans showing execution flow and dependencies"},{icon:"📈",name:"Statistics",desc:"Aggregated metrics including duration, error rates, and call counts"},{icon:"🔴",name:"RED Metrics",desc:"Rate, Errors, Duration metrics for service health monitoring"},{icon:"🔗",name:"Dependencies",desc:"Service-to-service communication patterns and operation drill-down"},{icon:"🗄️",name:"DuckDB SQL",desc:"Write custom SQL queries against the trace database for advanced analysis"},{icon:"⚙️",name:"Configuration",desc:"Configure tracing settings, service filters, and operation blacklists"}].map(W=>g.jsxs("div",{style:{padding:"var(--space-component-sm)",background:"var(--color-bg-surface)",borderRadius:"var(--radius-md)",border:"1px solid var(--color-border-subtle)"},children:[g.jsxs("div",{style:{fontWeight:"var(--font-weight-medium)",color:"var(--color-text-primary)",marginBottom:"4px"},children:[W.icon," ",W.name]}),g.jsx("div",{style:{fontSize:"var(--font-size-body-xs)",color:"var(--color-text-tertiary)"},children:W.desc})]},W.name))})]}),g.jsxs("div",{children:[g.jsx("h4",{style:{fontSize:"var(--font-size-body-md)",fontWeight:"var(--font-weight-bold)",color:"var(--color-text-primary)",marginBottom:"var(--gap-sm)"},children:"🔍 Search Tips"}),g.jsxs("div",{style:{padding:"var(--space-component-sm)",background:"var(--color-bg-surface)",borderRadius:"var(--radius-md)",border:"1px solid var(--color-border-subtle)",fontSize:"var(--font-size-body-xs)",color:"var(--color-text-secondary)"},children:[g.jsx("p",{style:{marginBottom:"var(--gap-xs)"},children:"The search box performs text matching across:"}),g.jsxs("ul",{style:{marginLeft:"20px",marginBottom:"var(--gap-xs)"},children:[g.jsx("li",{children:"Trace IDs"}),g.jsx("li",{children:"Span names and operation names"}),g.jsx("li",{children:"Span attributes (key-value pairs)"})]}),g.jsx("p",{style:{fontStyle:"italic",color:"var(--color-text-tertiary)"},children:"For advanced queries, use the DuckDB SQL tab to write custom queries."})]})]}),g.jsxs("div",{children:[g.jsx("h4",{style:{fontSize:"var(--font-size-body-md)",fontWeight:"var(--font-weight-bold)",color:"var(--color-text-primary)",marginBottom:"var(--gap-sm)"},children:"💡 DuckDB SQL Examples"}),g.jsx("div",{style:{display:"grid",gap:"var(--gap-sm)"},children:[{title:"Find slow operations",query:"SELECT service_name, name, duration_ms FROM spans WHERE duration_ms > 1000 ORDER BY duration_ms DESC LIMIT 10"},{title:"Error rate by service",query:"SELECT service_name, COUNT(*) as total, SUM(CASE WHEN status_code = 'ERROR' THEN 1 ELSE 0 END) as errors FROM spans GROUP BY service_name"},{title:"Recent traces",query:"SELECT DISTINCT trace_id, MIN(timestamp) as start_time FROM spans GROUP BY trace_id ORDER BY start_time DESC LIMIT 20"},{title:"Operation hotspots",query:"SELECT name, COUNT(*) as call_count, AVG(duration_ms) as avg_duration FROM spans GROUP BY name ORDER BY call_count DESC LIMIT 10"}].map(W=>g.jsxs("div",{style:{padding:"var(--space-component-sm)",background:"var(--color-bg-surface)",borderRadius:"var(--radius-md)",border:"1px solid var(--color-border-subtle)"},children:[g.jsx("div",{style:{fontWeight:"var(--font-weight-medium)",color:"var(--color-text-primary)",marginBottom:"4px",fontSize:"var(--font-size-body-xs)"},children:W.title}),g.jsx("code",{style:{display:"block",padding:"8px",background:"var(--color-bg-elevated)",borderRadius:"var(--radius-sm)",fontSize:"var(--font-size-body-xs)",fontFamily:"var(--font-family-mono)",color:"var(--color-text-secondary)",overflowX:"auto",whiteSpace:"pre-wrap",wordBreak:"break-all"},children:W.query})]},W.title))})]}),g.jsxs("div",{children:[g.jsx("h4",{style:{fontSize:"var(--font-size-body-md)",fontWeight:"var(--font-weight-bold)",color:"var(--color-text-primary)",marginBottom:"var(--gap-sm)"},children:"⚡ Best Practices"}),g.jsx("div",{style:{display:"grid",gap:"var(--gap-xs)",fontSize:"var(--font-size-body-xs)",color:"var(--color-text-secondary)"},children:["Use service filters to focus on specific components","Blacklist noisy operations to reduce clutter","Check RED metrics for quick health overview","Use Dependencies view to understand service communication","Write SQL queries for custom analysis and reporting","Monitor error traces to identify failure patterns"].map((W,se)=>g.jsxs("div",{style:{padding:"8px 12px",background:"var(--color-bg-surface)",borderRadius:"var(--radius-sm)",border:"1px solid var(--color-border-subtle)"},children:["✓ ",W]},se))})]}),g.jsxs("div",{style:{padding:"var(--space-component-sm)",background:"rgba(59, 130, 246, 0.1)",border:"1px solid #3b82f6",borderRadius:"var(--radius-md)",fontSize:"var(--font-size-body-xs)",color:"var(--color-text-secondary)"},children:[g.jsx("div",{style:{fontWeight:"var(--font-weight-bold)",color:"#3b82f6",marginBottom:"4px"},children:"📚 Full Documentation"}),"For comprehensive tracing guides, see ",g.jsx("code",{style:{fontFamily:"var(--font-family-mono)"},children:"docs/how_to_use_tracing_effectively.md"})]})]}),_==="sql"&&g.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--gap-sm)",height:"100%"},children:[g.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--gap-xs)",flexShrink:0},children:[g.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:"var(--gap-sm)"},children:[g.jsxs("div",{style:{display:"flex",gap:"var(--gap-xs)",flexWrap:"wrap",flex:1,alignItems:"center"},children:[g.jsx("span",{style:{fontSize:"var(--font-size-body-xs)",color:"var(--color-text-tertiary)",flexShrink:0},children:"Quick:"}),[{label:"All",query:"SELECT * FROM spans LIMIT 10"},{label:"By Service",query:"SELECT service_name, COUNT(*) FROM spans GROUP BY service_name"},{label:"Errors",query:"SELECT * FROM spans WHERE status_code = 'ERROR'"},{label:"Avg Duration",query:"SELECT service_name, AVG(duration_ms) FROM spans GROUP BY service_name"}].map(W=>g.jsx("button",{onClick:()=>R(W.query),style:{padding:"4px 8px",background:"var(--color-bg-elevated)",color:"var(--color-text-secondary)",border:"1px solid var(--color-border-subtle)",borderRadius:"var(--radius-sm)",fontSize:"var(--font-size-body-xs)",cursor:"pointer",whiteSpace:"nowrap"},children:W.label},W.label))]}),g.jsx("button",{onClick:re,disabled:I,style:{padding:"6px 12px",background:I?"var(--color-bg-surface)":"var(--color-accent)",color:I?"var(--color-text-tertiary)":"white",border:"none",borderRadius:"var(--radius-md)",fontSize:"var(--font-size-body-xs)",fontWeight:"var(--font-weight-medium)",cursor:I?"not-allowed":"pointer",display:"flex",alignItems:"center",gap:"6px",flexShrink:0},children:I?g.jsxs(g.Fragment,{children:[g.jsx("span",{children:"⏳"}),g.jsx("span",{children:"Running..."})]}):g.jsxs(g.Fragment,{children:[g.jsx("span",{children:"▶️"}),g.jsx("span",{children:"Run (Cmd+Enter)"})]})})]}),g.jsx("textarea",{value:N,onChange:W=>R(W.target.value),onKeyDown:W=>{(W.metaKey||W.ctrlKey)&&W.key==="Enter"&&(W.preventDefault(),re())},placeholder:"SELECT * FROM spans WHERE service_name = 'my-service' LIMIT 100",style:{width:"100%",minHeight:"60px",maxHeight:"120px",padding:"8px 12px",fontFamily:"var(--font-family-mono)",fontSize:"var(--font-size-body-xs)",background:"var(--color-bg-surface)",color:"var(--color-text-primary)",border:"1px solid var(--color-border-subtle)",borderRadius:"var(--radius-md)",resize:"vertical",lineHeight:"1.5"}})]}),V&&g.jsxs("div",{style:{padding:"8px 12px",background:"rgba(239, 68, 68, 0.1)",border:"1px solid #ef4444",borderRadius:"var(--radius-md)",color:"#ef4444",fontSize:"var(--font-size-body-xs)",fontFamily:"var(--font-family-mono)",display:"flex",gap:"8px",alignItems:"center",flexShrink:0},children:[g.jsx("span",{children:"❌"}),g.jsx("span",{children:V})]}),z&&z.length>0&&g.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"var(--gap-xs)",minHeight:0},children:[g.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[g.jsxs("div",{style:{fontSize:"var(--font-size-body-sm)",fontWeight:"var(--font-weight-medium)",color:"var(--color-text-secondary)"},children:["Results (",z.length," row",z.length!==1?"s":"",", ",A.length," column",A.length!==1?"s":"",")"]}),g.jsxs("button",{onClick:()=>{const W=[A.join(","),...z.map(ve=>A.map(Se=>{const Ee=ve[Se];if(Ee==null)return"";const Ve=String(Ee);return Ve.includes(",")||Ve.includes('"')||Ve.includes(`
`)?`"${Ve.replace(/"/g,'""')}"`:Ve}).join(","))].join(`
`),se=new Blob([W],{type:"text/csv;charset=utf-8;"}),te=document.createElement("a"),me=URL.createObjectURL(se);te.setAttribute("href",me),te.setAttribute("download",`trace-query-${new Date().toISOString().split("T")[0]}.csv`),te.style.visibility="hidden",document.body.appendChild(te),te.click(),document.body.removeChild(te)},style:{padding:"4px 10px",background:"var(--color-bg-elevated)",color:"var(--color-text-secondary)",border:"1px solid var(--color-border-subtle)",borderRadius:"var(--radius-sm)",fontSize:"var(--font-size-body-xs)",fontWeight:"var(--font-weight-medium)",cursor:"pointer",display:"flex",alignItems:"center",gap:"4px"},children:[g.jsx("span",{children:"📥"}),g.jsx("span",{children:"Export CSV"})]})]}),g.jsx("div",{style:{flex:1,overflow:"auto",background:"var(--color-bg-surface)",border:"1px solid var(--color-border-subtle)",borderRadius:"var(--radius-md)"},children:g.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"var(--font-size-body-xs)"},children:[g.jsx("thead",{style:{position:"sticky",top:0,background:"var(--color-bg-elevated)",borderBottom:"2px solid var(--color-border-subtle)",zIndex:1},children:g.jsx("tr",{children:A.map(W=>g.jsx("th",{style:{padding:"10px 12px",textAlign:"left",fontWeight:"var(--font-weight-bold)",color:"var(--color-text-secondary)",whiteSpace:"nowrap",borderRight:"1px solid var(--color-border-subtle)"},children:W},W))})}),g.jsx("tbody",{children:z.map((W,se)=>g.jsx("tr",{style:{borderBottom:"1px solid var(--color-border-subtle)",background:se%2===0?"transparent":"rgba(255, 255, 255, 0.02)"},children:A.map(te=>g.jsx("td",{style:{padding:"8px 12px",color:"var(--color-text-primary)",fontFamily:typeof W[te]=="string"&&W[te].length>50?"var(--font-family-mono)":"inherit",maxWidth:"400px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",borderRight:"1px solid var(--color-border-subtle)"},title:String(W[te]),children:W[te]===null||W[te]===void 0?g.jsx("span",{style:{color:"var(--color-text-tertiary)",fontStyle:"italic"},children:"null"}):String(W[te])},te))},se))})]})})]}),!I&&!V&&(!z||z.length===0)&&g.jsxs("div",{style:{textAlign:"center",padding:"var(--space-component-xl)",color:"var(--color-text-secondary)"},children:[g.jsx("div",{style:{fontSize:"32px",marginBottom:"var(--gap-md)",opacity:.5},children:"📊"}),g.jsx("div",{children:"Run a query to see results"}),g.jsx("div",{style:{fontSize:"var(--font-size-body-xs)",marginTop:"var(--gap-xs)",opacity:.7},children:"Try one of the example queries above"})]})]}),(_==="timeline"||_==="statistics")&&g.jsx(g.Fragment,{children:ae.length===0?g.jsxs("div",{style:{textAlign:"center",padding:"var(--space-component-xl)",color:"var(--color-text-secondary)"},children:[g.jsx("div",{style:{fontSize:"32px",marginBottom:"var(--gap-md)",opacity:.5},children:"🔎"}),g.jsx("div",{children:"No traces found"})]}):ae.map(W=>g.jsxs("div",{style:{marginBottom:"var(--space-component-lg)",background:"var(--color-bg-elevated)",borderRadius:"var(--radius-lg)",border:`1px solid ${W.hasError?"#ef4444":"var(--color-border-subtle)"}`,overflow:"hidden"},children:[g.jsxs("div",{onClick:()=>{d(se=>{const te=new Set(se);return te.has(W.traceId)?te.delete(W.traceId):te.add(W.traceId),te})},style:{padding:"var(--space-component-md)",background:W.hasError?"rgba(239, 68, 68, 0.1)":"var(--color-bg-surface)",cursor:"pointer",display:"flex",flexDirection:"column",gap:"var(--gap-sm)"},children:[g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--gap-md)"},children:[g.jsx("div",{style:{fontSize:"14px",opacity:.5},children:c.has(W.traceId)?"▼":"►"}),g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",fontSize:"var(--font-size-body-sm)",fontWeight:"var(--font-weight-medium)",color:W.hasError?"#ef4444":"#10b981"},children:[g.jsx("span",{children:W.hasError?"✗":"✓"}),g.jsx("span",{children:W.hasError?"ERROR":"OK"})]}),g.jsxs("div",{style:{fontSize:"var(--font-size-body-sm)",fontWeight:"var(--font-weight-medium)",color:"var(--color-text-primary)"},children:[W.duration.toFixed(2),"ms"]}),g.jsx("div",{style:{display:"flex",gap:"6px",flex:1,flexWrap:"wrap"},children:Array.from(W.services).map(se=>{const te=B.colorMap.get(se)||"#6366f1";return g.jsx("div",{style:{padding:"4px 12px",borderRadius:"var(--radius-sm)",background:te,color:"white",fontSize:"var(--font-size-body-xs)",fontWeight:"var(--font-weight-medium)",whiteSpace:"nowrap"},children:se},se)})})]}),g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--gap-md)",paddingLeft:"30px",fontSize:"var(--font-size-body-xs)",color:"var(--color-text-tertiary)"},children:[g.jsxs("div",{style:{fontFamily:"var(--font-family-mono)",color:"var(--color-text-secondary)"},children:[W.traceId.slice(0,16),"..."]}),g.jsx("span",{children:"•"}),g.jsxs("span",{children:[W.spanCount," spans"]}),g.jsx("span",{children:"•"}),g.jsxs("span",{children:[W.services.size," service",W.services.size!==1?"s":""]}),g.jsx("span",{children:"•"}),g.jsx("span",{children:new Date(W.startTime/1e6).toLocaleTimeString()})]})]}),c.has(W.traceId)&&g.jsxs("div",{style:{padding:"var(--space-component-md)",paddingTop:0},children:[_==="timeline"&&be(W),_==="statistics"&&ye(W)]})]},W.traceId))})]})]})},ZV=({context:e})=>g.jsx(KV,{context:e});function lz(e){const n=e.consumed_by??(e.consumptions?Array.from(new Set(e.consumptions.map(a=>a.consumer))):[]);return{id:e.id,type:e.type,payload:e.payload,timestamp:new Date(e.created_at).getTime(),correlationId:e.correlation_id??"",producedBy:e.produced_by,tags:e.tags||[],visibilityKind:e.visibility_kind||e.visibility?.kind||"Unknown",partitionKey:e.partition_key??null,version:e.version??1,isStreaming:!1,streamingText:"",consumedBy:n}}const QV="_container_1vp06_1",JV="_header_1vp06_19",e9="_metrics_1vp06_33",t9="_metricLabel_1vp06_45",n9="_metricValue_1vp06_61",r9="_actions_1vp06_73",a9="_tableContainer_1vp06_121",i9="_contentArea_1vp06_143",o9="_detailPanel_1vp06_157",s9="_headerRow_1vp06_183",l9="_dataRow_1vp06_185",c9="_virtualViewport_1vp06_225",u9="_dataRowStripe_1vp06_233",d9="_dataRowSelected_1vp06_261",f9="_emptyState_1vp06_279",h9="_loading_1vp06_281",p9="_error_1vp06_283",g9="_retentionBanner_1vp06_303",v9="_detailHeader_1vp06_357",m9="_detailSection_1vp06_427",y9="_detailList_1vp06_455",b9="_consumptionList_1vp06_491",x9="_consumerName_1vp06_529",_9="_runBadge_1vp06_539",S9="_emptyDetail_1vp06_565",w9="_emptyConsumption_1vp06_567",Ge={container:QV,header:JV,metrics:e9,metricLabel:t9,metricValue:n9,actions:r9,tableContainer:a9,contentArea:i9,detailPanel:o9,headerRow:s9,dataRow:l9,virtualViewport:c9,dataRowStripe:u9,dataRowSelected:d9,emptyState:f9,loading:h9,error:p9,retentionBanner:g9,detailHeader:v9,detailSection:m9,detailList:y9,consumptionList:b9,consumerName:x9,runBadge:_9,emptyDetail:S9,emptyConsumption:w9},E9=100,Yi=48,Wi=8,C9=e=>{const n=Date.now();return e.preset==="last5min"?{from:new Date(n-300*1e3).toISOString(),to:new Date(n).toISOString()}:e.preset==="last10min"?{from:new Date(n-600*1e3).toISOString(),to:new Date(n).toISOString()}:e.preset==="last1hour"?{from:new Date(n-3600*1e3).toISOString(),to:new Date(n).toISOString()}:e.preset==="custom"&&e.start&&e.end?{from:new Date(e.start).toISOString(),to:new Date(e.end).toISOString()}:{}},T9=({context:e})=>{const n=Te(G=>G.correlationId),a=Te(G=>G.timeRange),i=Te(G=>G.selectedArtifactTypes),o=Te(G=>G.selectedProducers),l=Te(G=>G.selectedTags),c=Te(G=>G.selectedVisibility),d=Te(G=>G.setSummary),f=Te(G=>G.updateAvailableCorrelationIds),h=Te(G=>G.summary),[p,v]=q.useState([]),[m,b]=q.useState(0),[_,S]=q.useState(0),[w,C]=q.useState(!1),[T,E]=q.useState(null),[N,R]=q.useState(null),z=q.useRef(-1),j=q.useRef(null),[A,D]=q.useState({start:0,end:Wi}),I=q.useMemo(()=>p.find(G=>G.id===N)??null,[p,N]),P=_>m;q.useEffect(()=>{N&&!p.some(G=>G.id===N)&&R(null)},[p,N]);const V=q.useCallback(G=>{const re=C9(a);return{types:i,producers:o,tags:l,visibility:c,correlationId:n,from:re.from,to:re.to,limit:E9,offset:G,embedMeta:!0}},[a,i,o,l,c,n]),$=q.useCallback(G=>{if(G.length===0)return;const re=Te.getState().availableCorrelationIds,B=new Map(re.map(Y=>[Y.correlation_id,{...Y}]));G.forEach(Y=>{if(!Y.correlation_id)return;const ae=new Date(Y.created_at).getTime(),U=B.get(Y.correlation_id);U?(U.artifact_count+=1,U.first_seen=Math.min(U.first_seen,ae)):B.set(Y.correlation_id,{correlation_id:Y.correlation_id,first_seen:ae,artifact_count:1,run_count:0})}),f(Array.from(B.values()))},[f]),L=q.useCallback(async G=>{C(!0);try{const re=G?0:m,B=V(re),Y=await nz(B);if(v(U=>G?Y.items:[...U,...Y.items]),b(re+Y.pagination.limit),S(Y.pagination.total),E(null),$(Y.items),Y.items.length>0){const U=Me.getState();U.batchUpdate({messages:Y.items.map(lz)}),ut.getState().mode==="agent"?U.generateAgentViewGraph():U.generateBlackboardViewGraph(),U.applyFilters()}const ae=await rz({...B,limit:void 0,offset:void 0});d(ae)}catch(re){console.error("[HistoricalArtifactsModule] Failed to load artifacts",re),E("Failed to load artifacts")}finally{C(!1)}},[V,$,m,d]);q.useEffect(()=>{z.current=-1,L(!0)},[L]);const H=q.useMemo(()=>p.map(G=>({id:G.id,timestamp:new Date(G.created_at).toLocaleString(),type:G.type,producedBy:G.produced_by,correlationId:G.correlation_id??"—",tags:G.tags.join(", ")||"—",visibility:G.visibility_kind||G.visibility?.kind||"Unknown",consumedCount:G.consumptions?.length??0})),[p]),O=()=>{!w&&P&&(z.current=-1,L(!1))},F=q.useMemo(()=>Math.max(Wi,Math.min(H.length||Wi,12))*Yi,[H.length]);q.useEffect(()=>{const G=j.current;if(!G)return;const re=()=>{const B=H.length;if(B===0){D({start:0,end:Wi});return}const Y=G.scrollTop,ae=G.clientHeight,U=Math.max(0,Math.floor(Y/Yi)-5),Z=Math.min(B,Math.ceil((Y+ae)/Yi)+5);D({start:U,end:Z}),P&&!w&&Z>=B-5&&z.current!==Z&&(z.current=Z,O())};return re(),G.addEventListener("scroll",re),()=>G.removeEventListener("scroll",re)},[O,P,w,H.length]),q.useEffect(()=>{const G=j.current;G&&(G.scrollTop=0),D({start:0,end:Math.max(Wi,Math.min(H.length,Wi*2))}),z.current=-1},[H.length]);const J=q.useMemo(()=>{if(!h?.earliest_created_at||!h?.latest_created_at)return null;const G=new Date(h.earliest_created_at),re=new Date(h.latest_created_at),B=Math.max(0,re.getTime()-G.getTime()),Y=B/(1e3*60*60*24);let ae;return Y>=2?ae=`${Y.toFixed(1)} days`:Y>=.5?ae=`${(Y*24).toFixed(0)} hours`:ae=`${Math.max(1,Math.round(B/(1e3*60)))} minutes`,{earliest:G.toLocaleString(),latest:re.toLocaleString(),spanLabel:ae}},[h]);return g.jsxs("div",{className:Ge.container,children:[g.jsxs("header",{className:Ge.header,children:[g.jsxs("div",{className:Ge.metrics,children:[g.jsxs("div",{children:[g.jsx("span",{className:Ge.metricLabel,children:"Artifacts"}),g.jsx("span",{className:Ge.metricValue,children:_})]}),g.jsxs("div",{children:[g.jsx("span",{className:Ge.metricLabel,children:"Earliest"}),g.jsx("span",{className:Ge.metricValue,children:h?.earliest_created_at?new Date(h.earliest_created_at).toLocaleString():"—"})]}),g.jsxs("div",{children:[g.jsx("span",{className:Ge.metricLabel,children:"Latest"}),g.jsx("span",{className:Ge.metricValue,children:h?.latest_created_at?new Date(h.latest_created_at).toLocaleString():"—"})]})]}),g.jsxs("div",{className:Ge.actions,children:[g.jsx("button",{type:"button",onClick:()=>L(!0),disabled:w,children:"Refresh"}),g.jsx("button",{type:"button",onClick:O,disabled:w||!P,children:"Load Older"})]})]}),J&&g.jsxs("div",{className:Ge.retentionBanner,children:[g.jsxs("span",{children:["Historical window: ",g.jsx("strong",{children:J.spanLabel})," (oldest artifact ",J.earliest,")"]}),g.jsxs("span",{children:["Latest artifact recorded at ",g.jsx("strong",{children:J.latest}),"."," ",P?"Use “Load Older” to fetch additional retained history.":"You are viewing the full retained history."]})]}),T&&g.jsx("div",{className:Ge.error,children:T}),!w&&p.length===0&&!T&&g.jsx("div",{className:Ge.emptyState,children:"No artifacts found for current filters."}),p.length>0&&g.jsxs("div",{className:Ge.contentArea,children:[g.jsxs("div",{className:Ge.tableContainer,children:[g.jsxs("div",{className:Ge.headerRow,children:[g.jsx("span",{children:"Timestamp"}),g.jsx("span",{children:"Type"}),g.jsx("span",{children:"Produced By"}),g.jsx("span",{children:"Correlation ID"}),g.jsx("span",{children:"Tags"}),g.jsx("span",{children:"Visibility"}),g.jsx("span",{children:"Consumed"})]}),g.jsx("div",{ref:j,className:Ge.virtualViewport,style:{height:F},children:g.jsx("div",{style:{height:H.length*Yi,position:"relative"},children:g.jsx("div",{style:{position:"absolute",top:A.start*Yi,left:0,right:0},children:H.slice(A.start,A.end).map((G,re)=>{const B=A.start+re,Y=G.id===N,ae=[Ge.dataRow];return B%2===1&&ae.push(Ge.dataRowStripe),Y&&ae.push(Ge.dataRowSelected),g.jsxs("div",{className:ae.join(" "),style:{height:Yi},role:"button",tabIndex:0,"aria-selected":Y,onClick:()=>R(G.id),onKeyDown:U=>{(U.key==="Enter"||U.key===" ")&&(U.preventDefault(),R(G.id))},children:[g.jsx("span",{children:G.timestamp}),g.jsx("span",{children:G.type}),g.jsx("span",{children:G.producedBy}),g.jsx("span",{children:G.correlationId}),g.jsx("span",{children:G.tags}),g.jsx("span",{children:G.visibility}),g.jsx("span",{children:G.consumedCount})]},G.id)})})})})]}),g.jsx("aside",{className:Ge.detailPanel,children:I?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:Ge.detailHeader,children:[g.jsxs("div",{children:[g.jsx("h3",{children:I.type}),g.jsx("p",{children:new Date(I.created_at).toLocaleString()})]}),g.jsx("button",{type:"button",onClick:()=>R(null),children:"Clear"})]}),g.jsxs("div",{className:Ge.detailSection,children:[g.jsx("h4",{children:"Metadata"}),g.jsxs("dl",{className:Ge.detailList,children:[g.jsxs("div",{children:[g.jsx("dt",{children:"Produced By"}),g.jsx("dd",{children:I.produced_by})]}),g.jsxs("div",{children:[g.jsx("dt",{children:"Correlation"}),g.jsx("dd",{children:I.correlation_id||"—"})]}),g.jsxs("div",{children:[g.jsx("dt",{children:"Partition"}),g.jsx("dd",{children:I.partition_key||"—"})]}),g.jsxs("div",{children:[g.jsx("dt",{children:"Tags"}),g.jsx("dd",{children:I.tags.length?I.tags.join(", "):"—"})]}),g.jsxs("div",{children:[g.jsx("dt",{children:"Visibility"}),g.jsx("dd",{children:I.visibility_kind||I.visibility?.kind||"Unknown"})]}),g.jsxs("div",{children:[g.jsx("dt",{children:"Consumed By"}),g.jsx("dd",{children:I.consumed_by?.length?I.consumed_by.join(", "):"—"})]})]})]}),g.jsxs("div",{className:Ge.detailSection,children:[g.jsx("h4",{children:"Payload"}),g.jsx(sz,{value:JSON.stringify(I.payload,null,2),maxStringLength:Number.POSITIVE_INFINITY})]}),g.jsxs("div",{className:Ge.detailSection,children:[g.jsx("h4",{children:"Consumption History"}),I.consumptions&&I.consumptions.length>0?g.jsx("ul",{className:Ge.consumptionList,children:I.consumptions.map(G=>g.jsxs("li",{children:[g.jsx("span",{className:Ge.consumerName,children:G.consumer}),g.jsx("span",{children:new Date(G.consumed_at).toLocaleString()}),G.run_id?g.jsxs("span",{className:Ge.runBadge,children:["Run ",G.run_id]}):null]},`${G.consumer}-${G.consumed_at}`))}):g.jsx("p",{className:Ge.emptyConsumption,children:"No consumers recorded for this artifact."})]})]}):g.jsx("div",{className:Ge.emptyDetail,children:"Select an artifact to inspect payload and history."})})]}),w&&g.jsx("div",{className:Ge.loading,children:"Loading…"})]})},j9=({context:e})=>g.jsx(T9,{context:e});function N9(){Va.register({id:"traceViewerJaeger",name:"Trace Viewer",description:"Timeline, Statistics, RED Metrics, and Dependencies",icon:"🔎",component:ZV}),Va.register({id:"historicalArtifacts",name:"Historical Blackboard",description:"Browse persisted artifacts and retention metrics",icon:"📚",component:j9})}N9();const R9=()=>(oz(),q.useEffect(()=>{const e="app-initial-render-start";performance.mark(e),requestAnimationFrame(()=>{WV("App (initial)",e,"app-initial-render-end")<200?console.log("[Performance] ✓ Initial render under 200ms target"):console.warn("[Performance] ✗ Initial render exceeded 200ms target")});const n=async()=>{try{await Cn.initialize();const d=Te.getState(),f=Me.getState(),h=ut.getState(),p=await rz();d.setSummary(p),d.updateAvailableFacets({artifactTypes:Object.keys(p.by_type),producers:Object.keys(p.by_producer),tags:Object.keys(p.tag_counts),visibilities:Object.keys(p.by_visibility)});const v=await nz({limit:200,embedMeta:!0}),m=v.items.map(lz);if(m.length>0){f.batchUpdate({messages:m}),h.mode==="blackboard"?f.generateBlackboardViewGraph():f.generateAgentViewGraph(),f.applyFilters();const b=new Map;v.items.forEach(_=>{if(!_.correlation_id)return;const S=new Date(_.created_at).getTime(),w=b.get(_.correlation_id);w?(w.artifact_count+=1,w.first_seen=Math.min(w.first_seen,S)):b.set(_.correlation_id,{correlation_id:_.correlation_id,first_seen:S,artifact_count:1,run_count:0})}),b.size>0&&d.updateAvailableCorrelationIds(Array.from(b.values()))}}catch(d){console.error("[App] Failed to load historical artifacts:",d)}},a=async()=>{try{console.log("[App] Fetching registered agents...");const d=await hV();console.log(`[App] Loaded ${d.length} registered agents`);const f=Me.getState(),h=ut.getState();d.forEach(p=>f.addAgent(p)),h.mode==="agent"?f.generateAgentViewGraph():f.generateBlackboardViewGraph()}catch(d){console.error("[App] Failed to load registered agents:",d)}},o=eU("ws://localhost:8344/ws");let l=!1;return(async()=>{await n(),await a(),l||o.connect()})().catch(d=>{console.error("[App] Bootstrap failed:",d)}),()=>{l=!0,o.disconnect()}},[]),g.jsx(YV,{children:g.jsx(LV,{})})),cz=document.getElementById("root");if(!cz)throw new Error("Root element not found");C3.createRoot(cz).render(g.jsx(R9,{}));
