@opentrust/dashboard 7.3.31 → 7.3.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/routes/hosts.js +4 -27
- package/dist/routes/settings.js +52 -24
- package/package.json +3 -3
- package/public/assets/index-DzS9Yr59.js +418 -0
- package/public/assets/index-DzS9Yr59.js.map +1 -0
- package/public/assets/index-v4Sx1ze0.css +1 -0
- package/public/index.html +2 -2
- package/public/assets/index-2q5MJOn_.js +0 -408
- package/public/assets/index-2q5MJOn_.js.map +0 -1
- package/public/assets/index-C-TZSvxA.css +0 -1
|
@@ -1,408 +0,0 @@
|
|
|
1
|
-
function Zw(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const o=Object.getOwnPropertyDescriptor(r,s);o&&Object.defineProperty(e,s,o.get?o:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();function Yu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var yp={exports:{}},Xa={},vp={exports:{}},oe={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react.production.min.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Uo=Symbol.for("react.element"),Jw=Symbol.for("react.portal"),e1=Symbol.for("react.fragment"),t1=Symbol.for("react.strict_mode"),n1=Symbol.for("react.profiler"),r1=Symbol.for("react.provider"),s1=Symbol.for("react.context"),o1=Symbol.for("react.forward_ref"),i1=Symbol.for("react.suspense"),a1=Symbol.for("react.memo"),l1=Symbol.for("react.lazy"),Of=Symbol.iterator;function c1(e){return e===null||typeof e!="object"?null:(e=Of&&e[Of]||e["@@iterator"],typeof e=="function"?e:null)}var wp={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Np=Object.assign,jp={};function ks(e,t,n){this.props=e,this.context=t,this.refs=jp,this.updater=n||wp}ks.prototype.isReactComponent={};ks.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};ks.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Sp(){}Sp.prototype=ks.prototype;function Xu(e,t,n){this.props=e,this.context=t,this.refs=jp,this.updater=n||wp}var Qu=Xu.prototype=new Sp;Qu.constructor=Xu;Np(Qu,ks.prototype);Qu.isPureReactComponent=!0;var Ff=Array.isArray,bp=Object.prototype.hasOwnProperty,qu={current:null},kp={key:!0,ref:!0,__self:!0,__source:!0};function Cp(e,t,n){var r,s={},o=null,i=null;if(t!=null)for(r in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(o=""+t.key),t)bp.call(t,r)&&!kp.hasOwnProperty(r)&&(s[r]=t[r]);var l=arguments.length-2;if(l===1)s.children=n;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];s.children=c}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)s[r]===void 0&&(s[r]=l[r]);return{$$typeof:Uo,type:e,key:o,ref:i,props:s,_owner:qu.current}}function u1(e,t){return{$$typeof:Uo,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Zu(e){return typeof e=="object"&&e!==null&&e.$$typeof===Uo}function d1(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Hf=/\/+/g;function Ol(e,t){return typeof e=="object"&&e!==null&&e.key!=null?d1(""+e.key):t.toString(36)}function Fi(e,t,n,r,s){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var i=!1;if(e===null)i=!0;else switch(o){case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case Uo:case Jw:i=!0}}if(i)return i=e,s=s(i),e=r===""?"."+Ol(i,0):r,Ff(s)?(n="",e!=null&&(n=e.replace(Hf,"$&/")+"/"),Fi(s,t,n,"",function(u){return u})):s!=null&&(Zu(s)&&(s=u1(s,n+(!s.key||i&&i.key===s.key?"":(""+s.key).replace(Hf,"$&/")+"/")+e)),t.push(s)),1;if(i=0,r=r===""?".":r+":",Ff(e))for(var l=0;l<e.length;l++){o=e[l];var c=r+Ol(o,l);i+=Fi(o,t,n,c,s)}else if(c=c1(e),typeof c=="function")for(e=c.call(e),l=0;!(o=e.next()).done;)o=o.value,c=r+Ol(o,l++),i+=Fi(o,t,n,c,s);else if(o==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return i}function ii(e,t,n){if(e==null)return e;var r=[],s=0;return Fi(e,r,"","",function(o){return t.call(n,o,s++)}),r}function f1(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var tt={current:null},Hi={transition:null},h1={ReactCurrentDispatcher:tt,ReactCurrentBatchConfig:Hi,ReactCurrentOwner:qu};oe.Children={map:ii,forEach:function(e,t,n){ii(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ii(e,function(){t++}),t},toArray:function(e){return ii(e,function(t){return t})||[]},only:function(e){if(!Zu(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};oe.Component=ks;oe.Fragment=e1;oe.Profiler=n1;oe.PureComponent=Xu;oe.StrictMode=t1;oe.Suspense=i1;oe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=h1;oe.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=Np({},e.props),s=e.key,o=e.ref,i=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,i=qu.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)bp.call(t,c)&&!kp.hasOwnProperty(c)&&(r[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];r.children=l}return{$$typeof:Uo,type:e.type,key:s,ref:o,props:r,_owner:i}};oe.createContext=function(e){return e={$$typeof:s1,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:r1,_context:e},e.Consumer=e};oe.createElement=Cp;oe.createFactory=function(e){var t=Cp.bind(null,e);return t.type=e,t};oe.createRef=function(){return{current:null}};oe.forwardRef=function(e){return{$$typeof:o1,render:e}};oe.isValidElement=Zu;oe.lazy=function(e){return{$$typeof:l1,_payload:{_status:-1,_result:e},_init:f1}};oe.memo=function(e,t){return{$$typeof:a1,type:e,compare:t===void 0?null:t}};oe.startTransition=function(e){var t=Hi.transition;Hi.transition={};try{e()}finally{Hi.transition=t}};oe.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};oe.useCallback=function(e,t){return tt.current.useCallback(e,t)};oe.useContext=function(e){return tt.current.useContext(e)};oe.useDebugValue=function(){};oe.useDeferredValue=function(e){return tt.current.useDeferredValue(e)};oe.useEffect=function(e,t){return tt.current.useEffect(e,t)};oe.useId=function(){return tt.current.useId()};oe.useImperativeHandle=function(e,t,n){return tt.current.useImperativeHandle(e,t,n)};oe.useInsertionEffect=function(e,t){return tt.current.useInsertionEffect(e,t)};oe.useLayoutEffect=function(e,t){return tt.current.useLayoutEffect(e,t)};oe.useMemo=function(e,t){return tt.current.useMemo(e,t)};oe.useReducer=function(e,t,n){return tt.current.useReducer(e,t,n)};oe.useRef=function(e){return tt.current.useRef(e)};oe.useState=function(e){return tt.current.useState(e)};oe.useSyncExternalStore=function(e,t,n){return tt.current.useSyncExternalStore(e,t,n)};oe.useTransition=function(){return tt.current.useTransition()};oe.version="18.3.0";vp.exports=oe;var m=vp.exports;const Wt=Yu(m),m1=Zw({__proto__:null,default:Wt},[m]);/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.production.min.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var p1=m,g1=Symbol.for("react.element"),x1=Symbol.for("react.fragment"),y1=Object.prototype.hasOwnProperty,v1=p1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,w1={key:!0,ref:!0,__self:!0,__source:!0};function Ep(e,t,n){var r,s={},o=null,i=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(i=t.ref);for(r in t)y1.call(t,r)&&!w1.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)s[r]===void 0&&(s[r]=t[r]);return{$$typeof:g1,type:e,key:o,ref:i,props:s,_owner:v1.current}}Xa.Fragment=x1;Xa.jsx=Ep;Xa.jsxs=Ep;yp.exports=Xa;var a=yp.exports,Rc={},_p={exports:{}},xt={},Pp={exports:{}},Mp={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* scheduler.production.min.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/(function(e){function t(_,M){var A=_.length;_.push(M);e:for(;0<A;){var F=A-1>>>1,O=_[F];if(0<s(O,M))_[F]=M,_[A]=O,A=F;else break e}}function n(_){return _.length===0?null:_[0]}function r(_){if(_.length===0)return null;var M=_[0],A=_.pop();if(A!==M){_[0]=A;e:for(var F=0,O=_.length,U=O>>>1;F<U;){var V=2*(F+1)-1,G=_[V],Y=V+1,X=_[Y];if(0>s(G,A))Y<O&&0>s(X,G)?(_[F]=X,_[Y]=A,F=Y):(_[F]=G,_[V]=A,F=V);else if(Y<O&&0>s(X,A))_[F]=X,_[Y]=A,F=Y;else break e}}return M}function s(_,M){var A=_.sortIndex-M.sortIndex;return A!==0?A:_.id-M.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var i=Date,l=i.now();e.unstable_now=function(){return i.now()-l}}var c=[],u=[],h=1,d=null,f=3,g=!1,x=!1,w=!1,N=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(_){for(var M=n(u);M!==null;){if(M.callback===null)r(u);else if(M.startTime<=_)r(u),M.sortIndex=M.expirationTime,t(c,M);else break;M=n(u)}}function j(_){if(w=!1,y(_),!x)if(n(c)!==null)x=!0,k(S);else{var M=n(u);M!==null&&z(j,M.startTime-_)}}function S(_,M){x=!1,w&&(w=!1,p(P),P=-1),g=!0;var A=f;try{for(y(M),d=n(c);d!==null&&(!(d.expirationTime>M)||_&&!R());){var F=d.callback;if(typeof F=="function"){d.callback=null,f=d.priorityLevel;var O=F(d.expirationTime<=M);M=e.unstable_now(),typeof O=="function"?d.callback=O:d===n(c)&&r(c),y(M)}else r(c);d=n(c)}if(d!==null)var U=!0;else{var V=n(u);V!==null&&z(j,V.startTime-M),U=!1}return U}finally{d=null,f=A,g=!1}}var C=!1,b=null,P=-1,I=5,$=-1;function R(){return!(e.unstable_now()-$<I)}function T(){if(b!==null){var _=e.unstable_now();$=_;var M=!0;try{M=b(!0,_)}finally{M?D():(C=!1,b=null)}}else C=!1}var D;if(typeof v=="function")D=function(){v(T)};else if(typeof MessageChannel<"u"){var E=new MessageChannel,L=E.port2;E.port1.onmessage=T,D=function(){L.postMessage(null)}}else D=function(){N(T,0)};function k(_){b=_,C||(C=!0,D())}function z(_,M){P=N(function(){_(e.unstable_now())},M)}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(_){_.callback=null},e.unstable_continueExecution=function(){x||g||(x=!0,k(S))},e.unstable_forceFrameRate=function(_){0>_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<_?Math.floor(1e3/_):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(_){switch(f){case 1:case 2:case 3:var M=3;break;default:M=f}var A=f;f=M;try{return _()}finally{f=A}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(_,M){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var A=f;f=_;try{return M()}finally{f=A}},e.unstable_scheduleCallback=function(_,M,A){var F=e.unstable_now();switch(typeof A=="object"&&A!==null?(A=A.delay,A=typeof A=="number"&&0<A?F+A:F):A=F,_){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=A+O,_={id:h++,callback:M,priorityLevel:_,startTime:A,expirationTime:O,sortIndex:-1},A>F?(_.sortIndex=A,t(u,_),n(c)===null&&_===n(u)&&(w?(p(P),P=-1):w=!0,z(j,A-F))):(_.sortIndex=O,t(c,_),x||g||(x=!0,k(S))),_},e.unstable_shouldYield=R,e.unstable_wrapCallback=function(_){var M=f;return function(){var A=f;f=M;try{return _.apply(this,arguments)}finally{f=A}}}})(Mp);Pp.exports=Mp;var N1=Pp.exports;/**
|
|
26
|
-
* @license React
|
|
27
|
-
* react-dom.production.min.js
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the MIT license found in the
|
|
32
|
-
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var j1=m,mt=N1;function H(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Ip=new Set,go={};function Er(e,t){ls(e,t),ls(e+"Capture",t)}function ls(e,t){for(go[e]=t,e=0;e<t.length;e++)Ip.add(t[e])}var mn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Tc=Object.prototype.hasOwnProperty,S1=/^[: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]*$/,Bf={},Vf={};function b1(e){return Tc.call(Vf,e)?!0:Tc.call(Bf,e)?!1:S1.test(e)?Vf[e]=!0:(Bf[e]=!0,!1)}function k1(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function C1(e,t,n,r){if(t===null||typeof t>"u"||k1(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function nt(e,t,n,r,s,o,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=i}var Ue={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ue[e]=new nt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ue[t]=new nt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ue[e]=new nt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ue[e]=new nt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ue[e]=new nt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ue[e]=new nt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ue[e]=new nt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ue[e]=new nt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ue[e]=new nt(e,5,!1,e.toLowerCase(),null,!1,!1)});var Ju=/[\-:]([a-z])/g;function ed(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Ju,ed);Ue[t]=new nt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Ju,ed);Ue[t]=new nt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Ju,ed);Ue[t]=new nt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ue[e]=new nt(e,1,!1,e.toLowerCase(),null,!1,!1)});Ue.xlinkHref=new nt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ue[e]=new nt(e,1,!1,e.toLowerCase(),null,!0,!0)});function td(e,t,n,r){var s=Ue.hasOwnProperty(t)?Ue[t]:null;(s!==null?s.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(C1(t,n,s,r)&&(n=null),r||s===null?b1(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):s.mustUseProperty?e[s.propertyName]=n===null?s.type===3?!1:"":n:(t=s.attributeName,r=s.attributeNamespace,n===null?e.removeAttribute(t):(s=s.type,n=s===3||s===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var vn=j1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,ai=Symbol.for("react.element"),Or=Symbol.for("react.portal"),Fr=Symbol.for("react.fragment"),nd=Symbol.for("react.strict_mode"),Lc=Symbol.for("react.profiler"),Rp=Symbol.for("react.provider"),Tp=Symbol.for("react.context"),rd=Symbol.for("react.forward_ref"),Ac=Symbol.for("react.suspense"),zc=Symbol.for("react.suspense_list"),sd=Symbol.for("react.memo"),_n=Symbol.for("react.lazy"),Lp=Symbol.for("react.offscreen"),Uf=Symbol.iterator;function Ds(e){return e===null||typeof e!="object"?null:(e=Uf&&e[Uf]||e["@@iterator"],typeof e=="function"?e:null)}var Ee=Object.assign,Fl;function qs(e){if(Fl===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Fl=t&&t[1]||""}return`
|
|
34
|
-
`+Fl+e}var Hl=!1;function Bl(e,t){if(!e||Hl)return"";Hl=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var s=u.stack.split(`
|
|
35
|
-
`),o=r.stack.split(`
|
|
36
|
-
`),i=s.length-1,l=o.length-1;1<=i&&0<=l&&s[i]!==o[l];)l--;for(;1<=i&&0<=l;i--,l--)if(s[i]!==o[l]){if(i!==1||l!==1)do if(i--,l--,0>l||s[i]!==o[l]){var c=`
|
|
37
|
-
`+s[i].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=i&&0<=l);break}}}finally{Hl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?qs(e):""}function E1(e){switch(e.tag){case 5:return qs(e.type);case 16:return qs("Lazy");case 13:return qs("Suspense");case 19:return qs("SuspenseList");case 0:case 2:case 15:return e=Bl(e.type,!1),e;case 11:return e=Bl(e.type.render,!1),e;case 1:return e=Bl(e.type,!0),e;default:return""}}function Dc(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Fr:return"Fragment";case Or:return"Portal";case Lc:return"Profiler";case nd:return"StrictMode";case Ac:return"Suspense";case zc:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Tp:return(e.displayName||"Context")+".Consumer";case Rp:return(e._context.displayName||"Context")+".Provider";case rd:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case sd:return t=e.displayName||null,t!==null?t:Dc(e.type)||"Memo";case _n:t=e._payload,e=e._init;try{return Dc(e(t))}catch{}}return null}function _1(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Dc(t);case 8:return t===nd?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Un(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ap(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function P1(e){var t=Ap(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(i){r=""+i,o.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function li(e){e._valueTracker||(e._valueTracker=P1(e))}function zp(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Ap(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function la(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function $c(e,t){var n=t.checked;return Ee({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Wf(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Un(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Dp(e,t){t=t.checked,t!=null&&td(e,"checked",t,!1)}function Oc(e,t){Dp(e,t);var n=Un(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Fc(e,t.type,n):t.hasOwnProperty("defaultValue")&&Fc(e,t.type,Un(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Kf(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Fc(e,t,n){(t!=="number"||la(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Zs=Array.isArray;function Jr(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Un(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,r&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function Hc(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(H(91));return Ee({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Gf(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(H(92));if(Zs(n)){if(1<n.length)throw Error(H(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Un(n)}}function $p(e,t){var n=Un(t.value),r=Un(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Yf(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Op(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Bc(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Op(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var ci,Fp=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,s){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(ci=ci||document.createElement("div"),ci.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ci.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function xo(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ro={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},M1=["Webkit","ms","Moz","O"];Object.keys(ro).forEach(function(e){M1.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ro[t]=ro[e]})});function Hp(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||ro.hasOwnProperty(e)&&ro[e]?(""+t).trim():t+"px"}function Bp(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=Hp(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var I1=Ee({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Vc(e,t){if(t){if(I1[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(H(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(H(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(H(61))}if(t.style!=null&&typeof t.style!="object")throw Error(H(62))}}function Uc(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){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 Wc=null;function od(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Kc=null,es=null,ts=null;function Xf(e){if(e=Go(e)){if(typeof Kc!="function")throw Error(H(280));var t=e.stateNode;t&&(t=el(t),Kc(e.stateNode,e.type,t))}}function Vp(e){es?ts?ts.push(e):ts=[e]:es=e}function Up(){if(es){var e=es,t=ts;if(ts=es=null,Xf(e),t)for(e=0;e<t.length;e++)Xf(t[e])}}function Wp(e,t){return e(t)}function Kp(){}var Vl=!1;function Gp(e,t,n){if(Vl)return e(t,n);Vl=!0;try{return Wp(e,t,n)}finally{Vl=!1,(es!==null||ts!==null)&&(Kp(),Up())}}function yo(e,t){var n=e.stateNode;if(n===null)return null;var r=el(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(H(231,t,typeof n));return n}var Gc=!1;if(mn)try{var $s={};Object.defineProperty($s,"passive",{get:function(){Gc=!0}}),window.addEventListener("test",$s,$s),window.removeEventListener("test",$s,$s)}catch{Gc=!1}function R1(e,t,n,r,s,o,i,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(h){this.onError(h)}}var so=!1,ca=null,ua=!1,Yc=null,T1={onError:function(e){so=!0,ca=e}};function L1(e,t,n,r,s,o,i,l,c){so=!1,ca=null,R1.apply(T1,arguments)}function A1(e,t,n,r,s,o,i,l,c){if(L1.apply(this,arguments),so){if(so){var u=ca;so=!1,ca=null}else throw Error(H(198));ua||(ua=!0,Yc=u)}}function _r(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Yp(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Qf(e){if(_r(e)!==e)throw Error(H(188))}function z1(e){var t=e.alternate;if(!t){if(t=_r(e),t===null)throw Error(H(188));return t!==e?null:e}for(var n=e,r=t;;){var s=n.return;if(s===null)break;var o=s.alternate;if(o===null){if(r=s.return,r!==null){n=r;continue}break}if(s.child===o.child){for(o=s.child;o;){if(o===n)return Qf(s),e;if(o===r)return Qf(s),t;o=o.sibling}throw Error(H(188))}if(n.return!==r.return)n=s,r=o;else{for(var i=!1,l=s.child;l;){if(l===n){i=!0,n=s,r=o;break}if(l===r){i=!0,r=s,n=o;break}l=l.sibling}if(!i){for(l=o.child;l;){if(l===n){i=!0,n=o,r=s;break}if(l===r){i=!0,r=o,n=s;break}l=l.sibling}if(!i)throw Error(H(189))}}if(n.alternate!==r)throw Error(H(190))}if(n.tag!==3)throw Error(H(188));return n.stateNode.current===n?e:t}function Xp(e){return e=z1(e),e!==null?Qp(e):null}function Qp(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Qp(e);if(t!==null)return t;e=e.sibling}return null}var qp=mt.unstable_scheduleCallback,qf=mt.unstable_cancelCallback,D1=mt.unstable_shouldYield,$1=mt.unstable_requestPaint,Me=mt.unstable_now,O1=mt.unstable_getCurrentPriorityLevel,id=mt.unstable_ImmediatePriority,Zp=mt.unstable_UserBlockingPriority,da=mt.unstable_NormalPriority,F1=mt.unstable_LowPriority,Jp=mt.unstable_IdlePriority,Qa=null,Xt=null;function H1(e){if(Xt&&typeof Xt.onCommitFiberRoot=="function")try{Xt.onCommitFiberRoot(Qa,e,void 0,(e.current.flags&128)===128)}catch{}}var zt=Math.clz32?Math.clz32:U1,B1=Math.log,V1=Math.LN2;function U1(e){return e>>>=0,e===0?32:31-(B1(e)/V1|0)|0}var ui=64,di=4194304;function Js(e){switch(e&-e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function fa(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,o=e.pingedLanes,i=n&268435455;if(i!==0){var l=i&~s;l!==0?r=Js(l):(o&=i,o!==0&&(r=Js(o)))}else i=n&~s,i!==0?r=Js(i):o!==0&&(r=Js(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,o=t&-t,s>=o||s===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-zt(t),s=1<<n,r|=e[n],t&=~s;return r}function W1(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64: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 t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function K1(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,o=e.pendingLanes;0<o;){var i=31-zt(o),l=1<<i,c=s[i];c===-1?(!(l&n)||l&r)&&(s[i]=W1(l,t)):c<=t&&(e.expiredLanes|=l),o&=~l}}function Xc(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function eg(){var e=ui;return ui<<=1,!(ui&4194240)&&(ui=64),e}function Ul(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Wo(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-zt(t),e[t]=n}function G1(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var s=31-zt(n),o=1<<s;t[s]=0,r[s]=-1,e[s]=-1,n&=~o}}function ad(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-zt(n),s=1<<r;s&t|e[r]&t&&(e[r]|=t),n&=~s}}var de=0;function tg(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var ng,ld,rg,sg,og,Qc=!1,fi=[],An=null,zn=null,Dn=null,vo=new Map,wo=new Map,Mn=[],Y1="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 submit".split(" ");function Zf(e,t){switch(e){case"focusin":case"focusout":An=null;break;case"dragenter":case"dragleave":zn=null;break;case"mouseover":case"mouseout":Dn=null;break;case"pointerover":case"pointerout":vo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":wo.delete(t.pointerId)}}function Os(e,t,n,r,s,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[s]},t!==null&&(t=Go(t),t!==null&&ld(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function X1(e,t,n,r,s){switch(t){case"focusin":return An=Os(An,e,t,n,r,s),!0;case"dragenter":return zn=Os(zn,e,t,n,r,s),!0;case"mouseover":return Dn=Os(Dn,e,t,n,r,s),!0;case"pointerover":var o=s.pointerId;return vo.set(o,Os(vo.get(o)||null,e,t,n,r,s)),!0;case"gotpointercapture":return o=s.pointerId,wo.set(o,Os(wo.get(o)||null,e,t,n,r,s)),!0}return!1}function ig(e){var t=ar(e.target);if(t!==null){var n=_r(t);if(n!==null){if(t=n.tag,t===13){if(t=Yp(n),t!==null){e.blockedOn=t,og(e.priority,function(){rg(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Bi(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=qc(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Wc=r,n.target.dispatchEvent(r),Wc=null}else return t=Go(n),t!==null&&ld(t),e.blockedOn=n,!1;t.shift()}return!0}function Jf(e,t,n){Bi(e)&&n.delete(t)}function Q1(){Qc=!1,An!==null&&Bi(An)&&(An=null),zn!==null&&Bi(zn)&&(zn=null),Dn!==null&&Bi(Dn)&&(Dn=null),vo.forEach(Jf),wo.forEach(Jf)}function Fs(e,t){e.blockedOn===t&&(e.blockedOn=null,Qc||(Qc=!0,mt.unstable_scheduleCallback(mt.unstable_NormalPriority,Q1)))}function No(e){function t(s){return Fs(s,e)}if(0<fi.length){Fs(fi[0],e);for(var n=1;n<fi.length;n++){var r=fi[n];r.blockedOn===e&&(r.blockedOn=null)}}for(An!==null&&Fs(An,e),zn!==null&&Fs(zn,e),Dn!==null&&Fs(Dn,e),vo.forEach(t),wo.forEach(t),n=0;n<Mn.length;n++)r=Mn[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Mn.length&&(n=Mn[0],n.blockedOn===null);)ig(n),n.blockedOn===null&&Mn.shift()}var ns=vn.ReactCurrentBatchConfig,ha=!0;function q1(e,t,n,r){var s=de,o=ns.transition;ns.transition=null;try{de=1,cd(e,t,n,r)}finally{de=s,ns.transition=o}}function Z1(e,t,n,r){var s=de,o=ns.transition;ns.transition=null;try{de=4,cd(e,t,n,r)}finally{de=s,ns.transition=o}}function cd(e,t,n,r){if(ha){var s=qc(e,t,n,r);if(s===null)ec(e,t,r,ma,n),Zf(e,r);else if(X1(s,e,t,n,r))r.stopPropagation();else if(Zf(e,r),t&4&&-1<Y1.indexOf(e)){for(;s!==null;){var o=Go(s);if(o!==null&&ng(o),o=qc(e,t,n,r),o===null&&ec(e,t,r,ma,n),o===s)break;s=o}s!==null&&r.stopPropagation()}else ec(e,t,r,null,n)}}var ma=null;function qc(e,t,n,r){if(ma=null,e=od(r),e=ar(e),e!==null)if(t=_r(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Yp(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return ma=e,null}function ag(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(O1()){case id:return 1;case Zp:return 4;case da:case F1:return 16;case Jp:return 536870912;default:return 16}default:return 16}}var Tn=null,ud=null,Vi=null;function lg(){if(Vi)return Vi;var e,t=ud,n=t.length,r,s="value"in Tn?Tn.value:Tn.textContent,o=s.length;for(e=0;e<n&&t[e]===s[e];e++);var i=n-e;for(r=1;r<=i&&t[n-r]===s[o-r];r++);return Vi=s.slice(e,1<r?1-r:void 0)}function Ui(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function hi(){return!0}function eh(){return!1}function yt(e){function t(n,r,s,o,i){this._reactName=n,this._targetInst=s,this.type=r,this.nativeEvent=o,this.target=i,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(o):o[l]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?hi:eh,this.isPropagationStopped=eh,this}return Ee(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=hi)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=hi)},persist:function(){},isPersistent:hi}),t}var Cs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},dd=yt(Cs),Ko=Ee({},Cs,{view:0,detail:0}),J1=yt(Ko),Wl,Kl,Hs,qa=Ee({},Ko,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:fd,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Hs&&(Hs&&e.type==="mousemove"?(Wl=e.screenX-Hs.screenX,Kl=e.screenY-Hs.screenY):Kl=Wl=0,Hs=e),Wl)},movementY:function(e){return"movementY"in e?e.movementY:Kl}}),th=yt(qa),eN=Ee({},qa,{dataTransfer:0}),tN=yt(eN),nN=Ee({},Ko,{relatedTarget:0}),Gl=yt(nN),rN=Ee({},Cs,{animationName:0,elapsedTime:0,pseudoElement:0}),sN=yt(rN),oN=Ee({},Cs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),iN=yt(oN),aN=Ee({},Cs,{data:0}),nh=yt(aN),lN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},cN={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"},uN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function dN(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=uN[e])?!!t[e]:!1}function fd(){return dN}var fN=Ee({},Ko,{key:function(e){if(e.key){var t=lN[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ui(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?cN[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:fd,charCode:function(e){return e.type==="keypress"?Ui(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ui(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),hN=yt(fN),mN=Ee({},qa,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),rh=yt(mN),pN=Ee({},Ko,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:fd}),gN=yt(pN),xN=Ee({},Cs,{propertyName:0,elapsedTime:0,pseudoElement:0}),yN=yt(xN),vN=Ee({},qa,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),wN=yt(vN),NN=[9,13,27,32],hd=mn&&"CompositionEvent"in window,oo=null;mn&&"documentMode"in document&&(oo=document.documentMode);var jN=mn&&"TextEvent"in window&&!oo,cg=mn&&(!hd||oo&&8<oo&&11>=oo),sh=" ",oh=!1;function ug(e,t){switch(e){case"keyup":return NN.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function dg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Hr=!1;function SN(e,t){switch(e){case"compositionend":return dg(t);case"keypress":return t.which!==32?null:(oh=!0,sh);case"textInput":return e=t.data,e===sh&&oh?null:e;default:return null}}function bN(e,t){if(Hr)return e==="compositionend"||!hd&&ug(e,t)?(e=lg(),Vi=ud=Tn=null,Hr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return cg&&t.locale!=="ko"?null:t.data;default:return null}}var kN={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 ih(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!kN[e.type]:t==="textarea"}function fg(e,t,n,r){Vp(r),t=pa(t,"onChange"),0<t.length&&(n=new dd("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var io=null,jo=null;function CN(e){Sg(e,0)}function Za(e){var t=Ur(e);if(zp(t))return e}function EN(e,t){if(e==="change")return t}var hg=!1;if(mn){var Yl;if(mn){var Xl="oninput"in document;if(!Xl){var ah=document.createElement("div");ah.setAttribute("oninput","return;"),Xl=typeof ah.oninput=="function"}Yl=Xl}else Yl=!1;hg=Yl&&(!document.documentMode||9<document.documentMode)}function lh(){io&&(io.detachEvent("onpropertychange",mg),jo=io=null)}function mg(e){if(e.propertyName==="value"&&Za(jo)){var t=[];fg(t,jo,e,od(e)),Gp(CN,t)}}function _N(e,t,n){e==="focusin"?(lh(),io=t,jo=n,io.attachEvent("onpropertychange",mg)):e==="focusout"&&lh()}function PN(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Za(jo)}function MN(e,t){if(e==="click")return Za(t)}function IN(e,t){if(e==="input"||e==="change")return Za(t)}function RN(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var $t=typeof Object.is=="function"?Object.is:RN;function So(e,t){if($t(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var s=n[r];if(!Tc.call(t,s)||!$t(e[s],t[s]))return!1}return!0}function ch(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function uh(e,t){var n=ch(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=ch(n)}}function pg(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?pg(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function gg(){for(var e=window,t=la();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=la(e.document)}return t}function md(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function TN(e){var t=gg(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&pg(n.ownerDocument.documentElement,n)){if(r!==null&&md(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,o=Math.min(r.start,s);r=r.end===void 0?o:Math.min(r.end,s),!e.extend&&o>r&&(s=r,r=o,o=s),s=uh(n,o);var i=uh(n,r);s&&i&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var LN=mn&&"documentMode"in document&&11>=document.documentMode,Br=null,Zc=null,ao=null,Jc=!1;function dh(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Jc||Br==null||Br!==la(r)||(r=Br,"selectionStart"in r&&md(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ao&&So(ao,r)||(ao=r,r=pa(Zc,"onSelect"),0<r.length&&(t=new dd("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Br)))}function mi(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Vr={animationend:mi("Animation","AnimationEnd"),animationiteration:mi("Animation","AnimationIteration"),animationstart:mi("Animation","AnimationStart"),transitionend:mi("Transition","TransitionEnd")},Ql={},xg={};mn&&(xg=document.createElement("div").style,"AnimationEvent"in window||(delete Vr.animationend.animation,delete Vr.animationiteration.animation,delete Vr.animationstart.animation),"TransitionEvent"in window||delete Vr.transitionend.transition);function Ja(e){if(Ql[e])return Ql[e];if(!Vr[e])return e;var t=Vr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in xg)return Ql[e]=t[n];return e}var yg=Ja("animationend"),vg=Ja("animationiteration"),wg=Ja("animationstart"),Ng=Ja("transitionend"),jg=new Map,fh="abort auxClick 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(" ");function qn(e,t){jg.set(e,t),Er(t,[e])}for(var ql=0;ql<fh.length;ql++){var Zl=fh[ql],AN=Zl.toLowerCase(),zN=Zl[0].toUpperCase()+Zl.slice(1);qn(AN,"on"+zN)}qn(yg,"onAnimationEnd");qn(vg,"onAnimationIteration");qn(wg,"onAnimationStart");qn("dblclick","onDoubleClick");qn("focusin","onFocus");qn("focusout","onBlur");qn(Ng,"onTransitionEnd");ls("onMouseEnter",["mouseout","mouseover"]);ls("onMouseLeave",["mouseout","mouseover"]);ls("onPointerEnter",["pointerout","pointerover"]);ls("onPointerLeave",["pointerout","pointerover"]);Er("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Er("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Er("onBeforeInput",["compositionend","keypress","textInput","paste"]);Er("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Er("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Er("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var eo="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(" "),DN=new Set("cancel close invalid load scroll toggle".split(" ").concat(eo));function hh(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,A1(r,t,void 0,e),e.currentTarget=null}function Sg(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],s=r.event;r=r.listeners;e:{var o=void 0;if(t)for(var i=r.length-1;0<=i;i--){var l=r[i],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==o&&s.isPropagationStopped())break e;hh(s,l,u),o=c}else for(i=0;i<r.length;i++){if(l=r[i],c=l.instance,u=l.currentTarget,l=l.listener,c!==o&&s.isPropagationStopped())break e;hh(s,l,u),o=c}}}if(ua)throw e=Yc,ua=!1,Yc=null,e}function ye(e,t){var n=t[su];n===void 0&&(n=t[su]=new Set);var r=e+"__bubble";n.has(r)||(bg(t,e,2,!1),n.add(r))}function Jl(e,t,n){var r=0;t&&(r|=4),bg(n,e,r,t)}var pi="_reactListening"+Math.random().toString(36).slice(2);function bo(e){if(!e[pi]){e[pi]=!0,Ip.forEach(function(n){n!=="selectionchange"&&(DN.has(n)||Jl(n,!1,e),Jl(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[pi]||(t[pi]=!0,Jl("selectionchange",!1,t))}}function bg(e,t,n,r){switch(ag(t)){case 1:var s=q1;break;case 4:s=Z1;break;default:s=cd}n=s.bind(null,t,n,e),s=void 0,!Gc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),r?s!==void 0?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):s!==void 0?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}function ec(e,t,n,r,s){var o=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var i=r.tag;if(i===3||i===4){var l=r.stateNode.containerInfo;if(l===s||l.nodeType===8&&l.parentNode===s)break;if(i===4)for(i=r.return;i!==null;){var c=i.tag;if((c===3||c===4)&&(c=i.stateNode.containerInfo,c===s||c.nodeType===8&&c.parentNode===s))return;i=i.return}for(;l!==null;){if(i=ar(l),i===null)return;if(c=i.tag,c===5||c===6){r=o=i;continue e}l=l.parentNode}}r=r.return}Gp(function(){var u=o,h=od(n),d=[];e:{var f=jg.get(e);if(f!==void 0){var g=dd,x=e;switch(e){case"keypress":if(Ui(n)===0)break e;case"keydown":case"keyup":g=hN;break;case"focusin":x="focus",g=Gl;break;case"focusout":x="blur",g=Gl;break;case"beforeblur":case"afterblur":g=Gl;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":g=th;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":g=tN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":g=gN;break;case yg:case vg:case wg:g=sN;break;case Ng:g=yN;break;case"scroll":g=J1;break;case"wheel":g=wN;break;case"copy":case"cut":case"paste":g=iN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":g=rh}var w=(t&4)!==0,N=!w&&e==="scroll",p=w?f!==null?f+"Capture":null:f;w=[];for(var v=u,y;v!==null;){y=v;var j=y.stateNode;if(y.tag===5&&j!==null&&(y=j,p!==null&&(j=yo(v,p),j!=null&&w.push(ko(v,j,y)))),N)break;v=v.return}0<w.length&&(f=new g(f,x,null,n,h),d.push({event:f,listeners:w}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",g=e==="mouseout"||e==="pointerout",f&&n!==Wc&&(x=n.relatedTarget||n.fromElement)&&(ar(x)||x[pn]))break e;if((g||f)&&(f=h.window===h?h:(f=h.ownerDocument)?f.defaultView||f.parentWindow:window,g?(x=n.relatedTarget||n.toElement,g=u,x=x?ar(x):null,x!==null&&(N=_r(x),x!==N||x.tag!==5&&x.tag!==6)&&(x=null)):(g=null,x=u),g!==x)){if(w=th,j="onMouseLeave",p="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(w=rh,j="onPointerLeave",p="onPointerEnter",v="pointer"),N=g==null?f:Ur(g),y=x==null?f:Ur(x),f=new w(j,v+"leave",g,n,h),f.target=N,f.relatedTarget=y,j=null,ar(h)===u&&(w=new w(p,v+"enter",x,n,h),w.target=y,w.relatedTarget=N,j=w),N=j,g&&x)t:{for(w=g,p=x,v=0,y=w;y;y=Lr(y))v++;for(y=0,j=p;j;j=Lr(j))y++;for(;0<v-y;)w=Lr(w),v--;for(;0<y-v;)p=Lr(p),y--;for(;v--;){if(w===p||p!==null&&w===p.alternate)break t;w=Lr(w),p=Lr(p)}w=null}else w=null;g!==null&&mh(d,f,g,w,!1),x!==null&&N!==null&&mh(d,N,x,w,!0)}}e:{if(f=u?Ur(u):window,g=f.nodeName&&f.nodeName.toLowerCase(),g==="select"||g==="input"&&f.type==="file")var S=EN;else if(ih(f))if(hg)S=IN;else{S=PN;var C=_N}else(g=f.nodeName)&&g.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(S=MN);if(S&&(S=S(e,u))){fg(d,S,n,h);break e}C&&C(e,f,u),e==="focusout"&&(C=f._wrapperState)&&C.controlled&&f.type==="number"&&Fc(f,"number",f.value)}switch(C=u?Ur(u):window,e){case"focusin":(ih(C)||C.contentEditable==="true")&&(Br=C,Zc=u,ao=null);break;case"focusout":ao=Zc=Br=null;break;case"mousedown":Jc=!0;break;case"contextmenu":case"mouseup":case"dragend":Jc=!1,dh(d,n,h);break;case"selectionchange":if(LN)break;case"keydown":case"keyup":dh(d,n,h)}var b;if(hd)e:{switch(e){case"compositionstart":var P="onCompositionStart";break e;case"compositionend":P="onCompositionEnd";break e;case"compositionupdate":P="onCompositionUpdate";break e}P=void 0}else Hr?ug(e,n)&&(P="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(P="onCompositionStart");P&&(cg&&n.locale!=="ko"&&(Hr||P!=="onCompositionStart"?P==="onCompositionEnd"&&Hr&&(b=lg()):(Tn=h,ud="value"in Tn?Tn.value:Tn.textContent,Hr=!0)),C=pa(u,P),0<C.length&&(P=new nh(P,e,null,n,h),d.push({event:P,listeners:C}),b?P.data=b:(b=dg(n),b!==null&&(P.data=b)))),(b=jN?SN(e,n):bN(e,n))&&(u=pa(u,"onBeforeInput"),0<u.length&&(h=new nh("onBeforeInput","beforeinput",null,n,h),d.push({event:h,listeners:u}),h.data=b))}Sg(d,t)})}function ko(e,t,n){return{instance:e,listener:t,currentTarget:n}}function pa(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,o=s.stateNode;s.tag===5&&o!==null&&(s=o,o=yo(e,n),o!=null&&r.unshift(ko(e,o,s)),o=yo(e,t),o!=null&&r.push(ko(e,o,s))),e=e.return}return r}function Lr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function mh(e,t,n,r,s){for(var o=t._reactName,i=[];n!==null&&n!==r;){var l=n,c=l.alternate,u=l.stateNode;if(c!==null&&c===r)break;l.tag===5&&u!==null&&(l=u,s?(c=yo(n,o),c!=null&&i.unshift(ko(n,c,l))):s||(c=yo(n,o),c!=null&&i.push(ko(n,c,l)))),n=n.return}i.length!==0&&e.push({event:t,listeners:i})}var $N=/\r\n?/g,ON=/\u0000|\uFFFD/g;function ph(e){return(typeof e=="string"?e:""+e).replace($N,`
|
|
38
|
-
`).replace(ON,"")}function gi(e,t,n){if(t=ph(t),ph(e)!==t&&n)throw Error(H(425))}function ga(){}var eu=null,tu=null;function nu(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var ru=typeof setTimeout=="function"?setTimeout:void 0,FN=typeof clearTimeout=="function"?clearTimeout:void 0,gh=typeof Promise=="function"?Promise:void 0,HN=typeof queueMicrotask=="function"?queueMicrotask:typeof gh<"u"?function(e){return gh.resolve(null).then(e).catch(BN)}:ru;function BN(e){setTimeout(function(){throw e})}function tc(e,t){var n=t,r=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(r===0){e.removeChild(s),No(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);No(t)}function $n(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function xh(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Es=Math.random().toString(36).slice(2),Gt="__reactFiber$"+Es,Co="__reactProps$"+Es,pn="__reactContainer$"+Es,su="__reactEvents$"+Es,VN="__reactListeners$"+Es,UN="__reactHandles$"+Es;function ar(e){var t=e[Gt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[pn]||n[Gt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=xh(e);e!==null;){if(n=e[Gt])return n;e=xh(e)}return t}e=n,n=e.parentNode}return null}function Go(e){return e=e[Gt]||e[pn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ur(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(H(33))}function el(e){return e[Co]||null}var ou=[],Wr=-1;function Zn(e){return{current:e}}function ve(e){0>Wr||(e.current=ou[Wr],ou[Wr]=null,Wr--)}function pe(e,t){Wr++,ou[Wr]=e.current,e.current=t}var Wn={},Qe=Zn(Wn),at=Zn(!1),gr=Wn;function cs(e,t){var n=e.type.contextTypes;if(!n)return Wn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},o;for(o in n)s[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function lt(e){return e=e.childContextTypes,e!=null}function xa(){ve(at),ve(Qe)}function yh(e,t,n){if(Qe.current!==Wn)throw Error(H(168));pe(Qe,t),pe(at,n)}function kg(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(H(108,_1(e)||"Unknown",s));return Ee({},n,r)}function ya(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Wn,gr=Qe.current,pe(Qe,e),pe(at,at.current),!0}function vh(e,t,n){var r=e.stateNode;if(!r)throw Error(H(169));n?(e=kg(e,t,gr),r.__reactInternalMemoizedMergedChildContext=e,ve(at),ve(Qe),pe(Qe,e)):ve(at),pe(at,n)}var ln=null,tl=!1,nc=!1;function Cg(e){ln===null?ln=[e]:ln.push(e)}function WN(e){tl=!0,Cg(e)}function Jn(){if(!nc&&ln!==null){nc=!0;var e=0,t=de;try{var n=ln;for(de=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}ln=null,tl=!1}catch(s){throw ln!==null&&(ln=ln.slice(e+1)),qp(id,Jn),s}finally{de=t,nc=!1}}return null}var Kr=[],Gr=0,va=null,wa=0,vt=[],wt=0,xr=null,cn=1,un="";function sr(e,t){Kr[Gr++]=wa,Kr[Gr++]=va,va=e,wa=t}function Eg(e,t,n){vt[wt++]=cn,vt[wt++]=un,vt[wt++]=xr,xr=e;var r=cn;e=un;var s=32-zt(r)-1;r&=~(1<<s),n+=1;var o=32-zt(t)+s;if(30<o){var i=s-s%5;o=(r&(1<<i)-1).toString(32),r>>=i,s-=i,cn=1<<32-zt(t)+s|n<<s|r,un=o+e}else cn=1<<o|n<<s|r,un=e}function pd(e){e.return!==null&&(sr(e,1),Eg(e,1,0))}function gd(e){for(;e===va;)va=Kr[--Gr],Kr[Gr]=null,wa=Kr[--Gr],Kr[Gr]=null;for(;e===xr;)xr=vt[--wt],vt[wt]=null,un=vt[--wt],vt[wt]=null,cn=vt[--wt],vt[wt]=null}var ht=null,ft=null,Ne=!1,Rt=null;function _g(e,t){var n=Nt(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function wh(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,ht=e,ft=$n(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,ht=e,ft=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=xr!==null?{id:cn,overflow:un}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Nt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,ht=e,ft=null,!0):!1;default:return!1}}function iu(e){return(e.mode&1)!==0&&(e.flags&128)===0}function au(e){if(Ne){var t=ft;if(t){var n=t;if(!wh(e,t)){if(iu(e))throw Error(H(418));t=$n(n.nextSibling);var r=ht;t&&wh(e,t)?_g(r,n):(e.flags=e.flags&-4097|2,Ne=!1,ht=e)}}else{if(iu(e))throw Error(H(418));e.flags=e.flags&-4097|2,Ne=!1,ht=e}}}function Nh(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;ht=e}function xi(e){if(e!==ht)return!1;if(!Ne)return Nh(e),Ne=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!nu(e.type,e.memoizedProps)),t&&(t=ft)){if(iu(e))throw Pg(),Error(H(418));for(;t;)_g(e,t),t=$n(t.nextSibling)}if(Nh(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(H(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){ft=$n(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}ft=null}}else ft=ht?$n(e.stateNode.nextSibling):null;return!0}function Pg(){for(var e=ft;e;)e=$n(e.nextSibling)}function us(){ft=ht=null,Ne=!1}function xd(e){Rt===null?Rt=[e]:Rt.push(e)}var KN=vn.ReactCurrentBatchConfig;function Bs(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(H(309));var r=n.stateNode}if(!r)throw Error(H(147,e));var s=r,o=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===o?t.ref:(t=function(i){var l=s.refs;i===null?delete l[o]:l[o]=i},t._stringRef=o,t)}if(typeof e!="string")throw Error(H(284));if(!n._owner)throw Error(H(290,e))}return e}function yi(e,t){throw e=Object.prototype.toString.call(t),Error(H(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function jh(e){var t=e._init;return t(e._payload)}function Mg(e){function t(p,v){if(e){var y=p.deletions;y===null?(p.deletions=[v],p.flags|=16):y.push(v)}}function n(p,v){if(!e)return null;for(;v!==null;)t(p,v),v=v.sibling;return null}function r(p,v){for(p=new Map;v!==null;)v.key!==null?p.set(v.key,v):p.set(v.index,v),v=v.sibling;return p}function s(p,v){return p=Bn(p,v),p.index=0,p.sibling=null,p}function o(p,v,y){return p.index=y,e?(y=p.alternate,y!==null?(y=y.index,y<v?(p.flags|=2,v):y):(p.flags|=2,v)):(p.flags|=1048576,v)}function i(p){return e&&p.alternate===null&&(p.flags|=2),p}function l(p,v,y,j){return v===null||v.tag!==6?(v=cc(y,p.mode,j),v.return=p,v):(v=s(v,y),v.return=p,v)}function c(p,v,y,j){var S=y.type;return S===Fr?h(p,v,y.props.children,j,y.key):v!==null&&(v.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===_n&&jh(S)===v.type)?(j=s(v,y.props),j.ref=Bs(p,v,y),j.return=p,j):(j=qi(y.type,y.key,y.props,null,p.mode,j),j.ref=Bs(p,v,y),j.return=p,j)}function u(p,v,y,j){return v===null||v.tag!==4||v.stateNode.containerInfo!==y.containerInfo||v.stateNode.implementation!==y.implementation?(v=uc(y,p.mode,j),v.return=p,v):(v=s(v,y.children||[]),v.return=p,v)}function h(p,v,y,j,S){return v===null||v.tag!==7?(v=hr(y,p.mode,j,S),v.return=p,v):(v=s(v,y),v.return=p,v)}function d(p,v,y){if(typeof v=="string"&&v!==""||typeof v=="number")return v=cc(""+v,p.mode,y),v.return=p,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case ai:return y=qi(v.type,v.key,v.props,null,p.mode,y),y.ref=Bs(p,null,v),y.return=p,y;case Or:return v=uc(v,p.mode,y),v.return=p,v;case _n:var j=v._init;return d(p,j(v._payload),y)}if(Zs(v)||Ds(v))return v=hr(v,p.mode,y,null),v.return=p,v;yi(p,v)}return null}function f(p,v,y,j){var S=v!==null?v.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return S!==null?null:l(p,v,""+y,j);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case ai:return y.key===S?c(p,v,y,j):null;case Or:return y.key===S?u(p,v,y,j):null;case _n:return S=y._init,f(p,v,S(y._payload),j)}if(Zs(y)||Ds(y))return S!==null?null:h(p,v,y,j,null);yi(p,y)}return null}function g(p,v,y,j,S){if(typeof j=="string"&&j!==""||typeof j=="number")return p=p.get(y)||null,l(v,p,""+j,S);if(typeof j=="object"&&j!==null){switch(j.$$typeof){case ai:return p=p.get(j.key===null?y:j.key)||null,c(v,p,j,S);case Or:return p=p.get(j.key===null?y:j.key)||null,u(v,p,j,S);case _n:var C=j._init;return g(p,v,y,C(j._payload),S)}if(Zs(j)||Ds(j))return p=p.get(y)||null,h(v,p,j,S,null);yi(v,j)}return null}function x(p,v,y,j){for(var S=null,C=null,b=v,P=v=0,I=null;b!==null&&P<y.length;P++){b.index>P?(I=b,b=null):I=b.sibling;var $=f(p,b,y[P],j);if($===null){b===null&&(b=I);break}e&&b&&$.alternate===null&&t(p,b),v=o($,v,P),C===null?S=$:C.sibling=$,C=$,b=I}if(P===y.length)return n(p,b),Ne&&sr(p,P),S;if(b===null){for(;P<y.length;P++)b=d(p,y[P],j),b!==null&&(v=o(b,v,P),C===null?S=b:C.sibling=b,C=b);return Ne&&sr(p,P),S}for(b=r(p,b);P<y.length;P++)I=g(b,p,P,y[P],j),I!==null&&(e&&I.alternate!==null&&b.delete(I.key===null?P:I.key),v=o(I,v,P),C===null?S=I:C.sibling=I,C=I);return e&&b.forEach(function(R){return t(p,R)}),Ne&&sr(p,P),S}function w(p,v,y,j){var S=Ds(y);if(typeof S!="function")throw Error(H(150));if(y=S.call(y),y==null)throw Error(H(151));for(var C=S=null,b=v,P=v=0,I=null,$=y.next();b!==null&&!$.done;P++,$=y.next()){b.index>P?(I=b,b=null):I=b.sibling;var R=f(p,b,$.value,j);if(R===null){b===null&&(b=I);break}e&&b&&R.alternate===null&&t(p,b),v=o(R,v,P),C===null?S=R:C.sibling=R,C=R,b=I}if($.done)return n(p,b),Ne&&sr(p,P),S;if(b===null){for(;!$.done;P++,$=y.next())$=d(p,$.value,j),$!==null&&(v=o($,v,P),C===null?S=$:C.sibling=$,C=$);return Ne&&sr(p,P),S}for(b=r(p,b);!$.done;P++,$=y.next())$=g(b,p,P,$.value,j),$!==null&&(e&&$.alternate!==null&&b.delete($.key===null?P:$.key),v=o($,v,P),C===null?S=$:C.sibling=$,C=$);return e&&b.forEach(function(T){return t(p,T)}),Ne&&sr(p,P),S}function N(p,v,y,j){if(typeof y=="object"&&y!==null&&y.type===Fr&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case ai:e:{for(var S=y.key,C=v;C!==null;){if(C.key===S){if(S=y.type,S===Fr){if(C.tag===7){n(p,C.sibling),v=s(C,y.props.children),v.return=p,p=v;break e}}else if(C.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===_n&&jh(S)===C.type){n(p,C.sibling),v=s(C,y.props),v.ref=Bs(p,C,y),v.return=p,p=v;break e}n(p,C);break}else t(p,C);C=C.sibling}y.type===Fr?(v=hr(y.props.children,p.mode,j,y.key),v.return=p,p=v):(j=qi(y.type,y.key,y.props,null,p.mode,j),j.ref=Bs(p,v,y),j.return=p,p=j)}return i(p);case Or:e:{for(C=y.key;v!==null;){if(v.key===C)if(v.tag===4&&v.stateNode.containerInfo===y.containerInfo&&v.stateNode.implementation===y.implementation){n(p,v.sibling),v=s(v,y.children||[]),v.return=p,p=v;break e}else{n(p,v);break}else t(p,v);v=v.sibling}v=uc(y,p.mode,j),v.return=p,p=v}return i(p);case _n:return C=y._init,N(p,v,C(y._payload),j)}if(Zs(y))return x(p,v,y,j);if(Ds(y))return w(p,v,y,j);yi(p,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,v!==null&&v.tag===6?(n(p,v.sibling),v=s(v,y),v.return=p,p=v):(n(p,v),v=cc(y,p.mode,j),v.return=p,p=v),i(p)):n(p,v)}return N}var ds=Mg(!0),Ig=Mg(!1),Na=Zn(null),ja=null,Yr=null,yd=null;function vd(){yd=Yr=ja=null}function wd(e){var t=Na.current;ve(Na),e._currentValue=t}function lu(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function rs(e,t){ja=e,yd=Yr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(ot=!0),e.firstContext=null)}function St(e){var t=e._currentValue;if(yd!==e)if(e={context:e,memoizedValue:t,next:null},Yr===null){if(ja===null)throw Error(H(308));Yr=e,ja.dependencies={lanes:0,firstContext:e}}else Yr=Yr.next=e;return t}var lr=null;function Nd(e){lr===null?lr=[e]:lr.push(e)}function Rg(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,Nd(t)):(n.next=s.next,s.next=n),t.interleaved=n,gn(e,r)}function gn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Pn=!1;function jd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Tg(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function fn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function On(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ae&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,gn(e,n)}return s=r.interleaved,s===null?(t.next=t,Nd(r)):(t.next=s.next,s.next=t),r.interleaved=t,gn(e,n)}function Wi(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ad(e,n)}}function Sh(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?s=o=i:o=o.next=i,n=n.next}while(n!==null);o===null?s=o=t:o=o.next=t}else s=o=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Sa(e,t,n,r){var s=e.updateQueue;Pn=!1;var o=s.firstBaseUpdate,i=s.lastBaseUpdate,l=s.shared.pending;if(l!==null){s.shared.pending=null;var c=l,u=c.next;c.next=null,i===null?o=u:i.next=u,i=c;var h=e.alternate;h!==null&&(h=h.updateQueue,l=h.lastBaseUpdate,l!==i&&(l===null?h.firstBaseUpdate=u:l.next=u,h.lastBaseUpdate=c))}if(o!==null){var d=s.baseState;i=0,h=u=c=null,l=o;do{var f=l.lane,g=l.eventTime;if((r&f)===f){h!==null&&(h=h.next={eventTime:g,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var x=e,w=l;switch(f=t,g=n,w.tag){case 1:if(x=w.payload,typeof x=="function"){d=x.call(g,d,f);break e}d=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=w.payload,f=typeof x=="function"?x.call(g,d,f):x,f==null)break e;d=Ee({},d,f);break e;case 2:Pn=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,f=s.effects,f===null?s.effects=[l]:f.push(l))}else g={eventTime:g,lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},h===null?(u=h=g,c=d):h=h.next=g,i|=f;if(l=l.next,l===null){if(l=s.shared.pending,l===null)break;f=l,l=f.next,f.next=null,s.lastBaseUpdate=f,s.shared.pending=null}}while(!0);if(h===null&&(c=d),s.baseState=c,s.firstBaseUpdate=u,s.lastBaseUpdate=h,t=s.shared.interleaved,t!==null){s=t;do i|=s.lane,s=s.next;while(s!==t)}else o===null&&(s.shared.lanes=0);vr|=i,e.lanes=i,e.memoizedState=d}}function bh(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],s=r.callback;if(s!==null){if(r.callback=null,r=n,typeof s!="function")throw Error(H(191,s));s.call(r)}}}var Yo={},Qt=Zn(Yo),Eo=Zn(Yo),_o=Zn(Yo);function cr(e){if(e===Yo)throw Error(H(174));return e}function Sd(e,t){switch(pe(_o,t),pe(Eo,e),pe(Qt,Yo),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Bc(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Bc(t,e)}ve(Qt),pe(Qt,t)}function fs(){ve(Qt),ve(Eo),ve(_o)}function Lg(e){cr(_o.current);var t=cr(Qt.current),n=Bc(t,e.type);t!==n&&(pe(Eo,e),pe(Qt,n))}function bd(e){Eo.current===e&&(ve(Qt),ve(Eo))}var ke=Zn(0);function ba(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var rc=[];function kd(){for(var e=0;e<rc.length;e++)rc[e]._workInProgressVersionPrimary=null;rc.length=0}var Ki=vn.ReactCurrentDispatcher,sc=vn.ReactCurrentBatchConfig,yr=0,Ce=null,ze=null,Oe=null,ka=!1,lo=!1,Po=0,GN=0;function Ke(){throw Error(H(321))}function Cd(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!$t(e[n],t[n]))return!1;return!0}function Ed(e,t,n,r,s,o){if(yr=o,Ce=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ki.current=e===null||e.memoizedState===null?qN:ZN,e=n(r,s),lo){o=0;do{if(lo=!1,Po=0,25<=o)throw Error(H(301));o+=1,Oe=ze=null,t.updateQueue=null,Ki.current=JN,e=n(r,s)}while(lo)}if(Ki.current=Ca,t=ze!==null&&ze.next!==null,yr=0,Oe=ze=Ce=null,ka=!1,t)throw Error(H(300));return e}function _d(){var e=Po!==0;return Po=0,e}function Ut(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Oe===null?Ce.memoizedState=Oe=e:Oe=Oe.next=e,Oe}function bt(){if(ze===null){var e=Ce.alternate;e=e!==null?e.memoizedState:null}else e=ze.next;var t=Oe===null?Ce.memoizedState:Oe.next;if(t!==null)Oe=t,ze=e;else{if(e===null)throw Error(H(310));ze=e,e={memoizedState:ze.memoizedState,baseState:ze.baseState,baseQueue:ze.baseQueue,queue:ze.queue,next:null},Oe===null?Ce.memoizedState=Oe=e:Oe=Oe.next=e}return Oe}function Mo(e,t){return typeof t=="function"?t(e):t}function oc(e){var t=bt(),n=t.queue;if(n===null)throw Error(H(311));n.lastRenderedReducer=e;var r=ze,s=r.baseQueue,o=n.pending;if(o!==null){if(s!==null){var i=s.next;s.next=o.next,o.next=i}r.baseQueue=s=o,n.pending=null}if(s!==null){o=s.next,r=r.baseState;var l=i=null,c=null,u=o;do{var h=u.lane;if((yr&h)===h)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var d={lane:h,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(l=c=d,i=r):c=c.next=d,Ce.lanes|=h,vr|=h}u=u.next}while(u!==null&&u!==o);c===null?i=r:c.next=l,$t(r,t.memoizedState)||(ot=!0),t.memoizedState=r,t.baseState=i,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){s=e;do o=s.lane,Ce.lanes|=o,vr|=o,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function ic(e){var t=bt(),n=t.queue;if(n===null)throw Error(H(311));n.lastRenderedReducer=e;var r=n.dispatch,s=n.pending,o=t.memoizedState;if(s!==null){n.pending=null;var i=s=s.next;do o=e(o,i.action),i=i.next;while(i!==s);$t(o,t.memoizedState)||(ot=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Ag(){}function zg(e,t){var n=Ce,r=bt(),s=t(),o=!$t(r.memoizedState,s);if(o&&(r.memoizedState=s,ot=!0),r=r.queue,Pd(Og.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||Oe!==null&&Oe.memoizedState.tag&1){if(n.flags|=2048,Io(9,$g.bind(null,n,r,s,t),void 0,null),Fe===null)throw Error(H(349));yr&30||Dg(n,t,s)}return s}function Dg(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ce.updateQueue,t===null?(t={lastEffect:null,stores:null},Ce.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function $g(e,t,n,r){t.value=n,t.getSnapshot=r,Fg(t)&&Hg(e)}function Og(e,t,n){return n(function(){Fg(t)&&Hg(e)})}function Fg(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!$t(e,n)}catch{return!0}}function Hg(e){var t=gn(e,1);t!==null&&Dt(t,e,1,-1)}function kh(e){var t=Ut();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Mo,lastRenderedState:e},t.queue=e,e=e.dispatch=QN.bind(null,Ce,e),[t.memoizedState,e]}function Io(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Ce.updateQueue,t===null?(t={lastEffect:null,stores:null},Ce.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Bg(){return bt().memoizedState}function Gi(e,t,n,r){var s=Ut();Ce.flags|=e,s.memoizedState=Io(1|t,n,void 0,r===void 0?null:r)}function nl(e,t,n,r){var s=bt();r=r===void 0?null:r;var o=void 0;if(ze!==null){var i=ze.memoizedState;if(o=i.destroy,r!==null&&Cd(r,i.deps)){s.memoizedState=Io(t,n,o,r);return}}Ce.flags|=e,s.memoizedState=Io(1|t,n,o,r)}function Ch(e,t){return Gi(8390656,8,e,t)}function Pd(e,t){return nl(2048,8,e,t)}function Vg(e,t){return nl(4,2,e,t)}function Ug(e,t){return nl(4,4,e,t)}function Wg(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Kg(e,t,n){return n=n!=null?n.concat([e]):null,nl(4,4,Wg.bind(null,t,e),n)}function Md(){}function Gg(e,t){var n=bt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Cd(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Yg(e,t){var n=bt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Cd(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Xg(e,t,n){return yr&21?($t(n,t)||(n=eg(),Ce.lanes|=n,vr|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,ot=!0),e.memoizedState=n)}function YN(e,t){var n=de;de=n!==0&&4>n?n:4,e(!0);var r=sc.transition;sc.transition={};try{e(!1),t()}finally{de=n,sc.transition=r}}function Qg(){return bt().memoizedState}function XN(e,t,n){var r=Hn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},qg(e))Zg(t,n);else if(n=Rg(e,t,n,r),n!==null){var s=et();Dt(n,e,r,s),Jg(n,t,r)}}function QN(e,t,n){var r=Hn(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(qg(e))Zg(t,s);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var i=t.lastRenderedState,l=o(i,n);if(s.hasEagerState=!0,s.eagerState=l,$t(l,i)){var c=t.interleaved;c===null?(s.next=s,Nd(t)):(s.next=c.next,c.next=s),t.interleaved=s;return}}catch{}finally{}n=Rg(e,t,s,r),n!==null&&(s=et(),Dt(n,e,r,s),Jg(n,t,r))}}function qg(e){var t=e.alternate;return e===Ce||t!==null&&t===Ce}function Zg(e,t){lo=ka=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Jg(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ad(e,n)}}var Ca={readContext:St,useCallback:Ke,useContext:Ke,useEffect:Ke,useImperativeHandle:Ke,useInsertionEffect:Ke,useLayoutEffect:Ke,useMemo:Ke,useReducer:Ke,useRef:Ke,useState:Ke,useDebugValue:Ke,useDeferredValue:Ke,useTransition:Ke,useMutableSource:Ke,useSyncExternalStore:Ke,useId:Ke,unstable_isNewReconciler:!1},qN={readContext:St,useCallback:function(e,t){return Ut().memoizedState=[e,t===void 0?null:t],e},useContext:St,useEffect:Ch,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Gi(4194308,4,Wg.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Gi(4194308,4,e,t)},useInsertionEffect:function(e,t){return Gi(4,2,e,t)},useMemo:function(e,t){var n=Ut();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ut();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=XN.bind(null,Ce,e),[r.memoizedState,e]},useRef:function(e){var t=Ut();return e={current:e},t.memoizedState=e},useState:kh,useDebugValue:Md,useDeferredValue:function(e){return Ut().memoizedState=e},useTransition:function(){var e=kh(!1),t=e[0];return e=YN.bind(null,e[1]),Ut().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ce,s=Ut();if(Ne){if(n===void 0)throw Error(H(407));n=n()}else{if(n=t(),Fe===null)throw Error(H(349));yr&30||Dg(r,t,n)}s.memoizedState=n;var o={value:n,getSnapshot:t};return s.queue=o,Ch(Og.bind(null,r,o,e),[e]),r.flags|=2048,Io(9,$g.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Ut(),t=Fe.identifierPrefix;if(Ne){var n=un,r=cn;n=(r&~(1<<32-zt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Po++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=GN++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},ZN={readContext:St,useCallback:Gg,useContext:St,useEffect:Pd,useImperativeHandle:Kg,useInsertionEffect:Vg,useLayoutEffect:Ug,useMemo:Yg,useReducer:oc,useRef:Bg,useState:function(){return oc(Mo)},useDebugValue:Md,useDeferredValue:function(e){var t=bt();return Xg(t,ze.memoizedState,e)},useTransition:function(){var e=oc(Mo)[0],t=bt().memoizedState;return[e,t]},useMutableSource:Ag,useSyncExternalStore:zg,useId:Qg,unstable_isNewReconciler:!1},JN={readContext:St,useCallback:Gg,useContext:St,useEffect:Pd,useImperativeHandle:Kg,useInsertionEffect:Vg,useLayoutEffect:Ug,useMemo:Yg,useReducer:ic,useRef:Bg,useState:function(){return ic(Mo)},useDebugValue:Md,useDeferredValue:function(e){var t=bt();return ze===null?t.memoizedState=e:Xg(t,ze.memoizedState,e)},useTransition:function(){var e=ic(Mo)[0],t=bt().memoizedState;return[e,t]},useMutableSource:Ag,useSyncExternalStore:zg,useId:Qg,unstable_isNewReconciler:!1};function Pt(e,t){if(e&&e.defaultProps){t=Ee({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function cu(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Ee({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var rl={isMounted:function(e){return(e=e._reactInternals)?_r(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=et(),s=Hn(e),o=fn(r,s);o.payload=t,n!=null&&(o.callback=n),t=On(e,o,s),t!==null&&(Dt(t,e,s,r),Wi(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=et(),s=Hn(e),o=fn(r,s);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=On(e,o,s),t!==null&&(Dt(t,e,s,r),Wi(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=et(),r=Hn(e),s=fn(n,r);s.tag=2,t!=null&&(s.callback=t),t=On(e,s,r),t!==null&&(Dt(t,e,r,n),Wi(t,e,r))}};function Eh(e,t,n,r,s,o,i){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,o,i):t.prototype&&t.prototype.isPureReactComponent?!So(n,r)||!So(s,o):!0}function ex(e,t,n){var r=!1,s=Wn,o=t.contextType;return typeof o=="object"&&o!==null?o=St(o):(s=lt(t)?gr:Qe.current,r=t.contextTypes,o=(r=r!=null)?cs(e,s):Wn),t=new t(n,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=rl,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=o),t}function _h(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&rl.enqueueReplaceState(t,t.state,null)}function uu(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},jd(e);var o=t.contextType;typeof o=="object"&&o!==null?s.context=St(o):(o=lt(t)?gr:Qe.current,s.context=cs(e,o)),s.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(cu(e,t,o,n),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&rl.enqueueReplaceState(s,s.state,null),Sa(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function hs(e,t){try{var n="",r=t;do n+=E1(r),r=r.return;while(r);var s=n}catch(o){s=`
|
|
39
|
-
Error generating stack: `+o.message+`
|
|
40
|
-
`+o.stack}return{value:e,source:t,stack:s,digest:null}}function ac(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function du(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var e2=typeof WeakMap=="function"?WeakMap:Map;function tx(e,t,n){n=fn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){_a||(_a=!0,Nu=r),du(e,t)},n}function nx(e,t,n){n=fn(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var s=t.value;n.payload=function(){return r(s)},n.callback=function(){du(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){du(e,t),typeof r!="function"&&(Fn===null?Fn=new Set([this]):Fn.add(this));var i=t.stack;this.componentDidCatch(t.value,{componentStack:i!==null?i:""})}),n}function Ph(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new e2;var s=new Set;r.set(t,s)}else s=r.get(t),s===void 0&&(s=new Set,r.set(t,s));s.has(n)||(s.add(n),e=m2.bind(null,e,t,n),t.then(e,e))}function Mh(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Ih(e,t,n,r,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=fn(-1,1),t.tag=2,On(n,t,1))),n.lanes|=1),e)}var t2=vn.ReactCurrentOwner,ot=!1;function qe(e,t,n,r){t.child=e===null?Ig(t,null,n,r):ds(t,e.child,n,r)}function Rh(e,t,n,r,s){n=n.render;var o=t.ref;return rs(t,s),r=Ed(e,t,n,r,o,s),n=_d(),e!==null&&!ot?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,xn(e,t,s)):(Ne&&n&&pd(t),t.flags|=1,qe(e,t,r,s),t.child)}function Th(e,t,n,r,s){if(e===null){var o=n.type;return typeof o=="function"&&!$d(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,rx(e,t,o,r,s)):(e=qi(n.type,null,r,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&s)){var i=o.memoizedProps;if(n=n.compare,n=n!==null?n:So,n(i,r)&&e.ref===t.ref)return xn(e,t,s)}return t.flags|=1,e=Bn(o,r),e.ref=t.ref,e.return=t,t.child=e}function rx(e,t,n,r,s){if(e!==null){var o=e.memoizedProps;if(So(o,r)&&e.ref===t.ref)if(ot=!1,t.pendingProps=r=o,(e.lanes&s)!==0)e.flags&131072&&(ot=!0);else return t.lanes=e.lanes,xn(e,t,s)}return fu(e,t,n,r,s)}function sx(e,t,n){var r=t.pendingProps,s=r.children,o=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},pe(Qr,ut),ut|=n;else{if(!(n&1073741824))return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,pe(Qr,ut),ut|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,pe(Qr,ut),ut|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,pe(Qr,ut),ut|=r;return qe(e,t,s,n),t.child}function ox(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function fu(e,t,n,r,s){var o=lt(n)?gr:Qe.current;return o=cs(t,o),rs(t,s),n=Ed(e,t,n,r,o,s),r=_d(),e!==null&&!ot?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,xn(e,t,s)):(Ne&&r&&pd(t),t.flags|=1,qe(e,t,n,s),t.child)}function Lh(e,t,n,r,s){if(lt(n)){var o=!0;ya(t)}else o=!1;if(rs(t,s),t.stateNode===null)Yi(e,t),ex(t,n,r),uu(t,n,r,s),r=!0;else if(e===null){var i=t.stateNode,l=t.memoizedProps;i.props=l;var c=i.context,u=n.contextType;typeof u=="object"&&u!==null?u=St(u):(u=lt(n)?gr:Qe.current,u=cs(t,u));var h=n.getDerivedStateFromProps,d=typeof h=="function"||typeof i.getSnapshotBeforeUpdate=="function";d||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l!==r||c!==u)&&_h(t,i,r,u),Pn=!1;var f=t.memoizedState;i.state=f,Sa(t,r,i,s),c=t.memoizedState,l!==r||f!==c||at.current||Pn?(typeof h=="function"&&(cu(t,n,h,r),c=t.memoizedState),(l=Pn||Eh(t,n,l,r,f,c,u))?(d||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),i.props=r,i.state=c,i.context=u,r=l):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,Tg(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:Pt(t.type,l),i.props=u,d=t.pendingProps,f=i.context,c=n.contextType,typeof c=="object"&&c!==null?c=St(c):(c=lt(n)?gr:Qe.current,c=cs(t,c));var g=n.getDerivedStateFromProps;(h=typeof g=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l!==d||f!==c)&&_h(t,i,r,c),Pn=!1,f=t.memoizedState,i.state=f,Sa(t,r,i,s);var x=t.memoizedState;l!==d||f!==x||at.current||Pn?(typeof g=="function"&&(cu(t,n,g,r),x=t.memoizedState),(u=Pn||Eh(t,n,u,r,f,x,c)||!1)?(h||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(r,x,c),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(r,x,c)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=x),i.props=r,i.state=x,i.context=c,r=u):(typeof i.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return hu(e,t,n,r,o,s)}function hu(e,t,n,r,s,o){ox(e,t);var i=(t.flags&128)!==0;if(!r&&!i)return s&&vh(t,n,!1),xn(e,t,o);r=t.stateNode,t2.current=t;var l=i&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&i?(t.child=ds(t,e.child,null,o),t.child=ds(t,null,l,o)):qe(e,t,l,o),t.memoizedState=r.state,s&&vh(t,n,!0),t.child}function ix(e){var t=e.stateNode;t.pendingContext?yh(e,t.pendingContext,t.pendingContext!==t.context):t.context&&yh(e,t.context,!1),Sd(e,t.containerInfo)}function Ah(e,t,n,r,s){return us(),xd(s),t.flags|=256,qe(e,t,n,r),t.child}var mu={dehydrated:null,treeContext:null,retryLane:0};function pu(e){return{baseLanes:e,cachePool:null,transitions:null}}function ax(e,t,n){var r=t.pendingProps,s=ke.current,o=!1,i=(t.flags&128)!==0,l;if((l=i)||(l=e!==null&&e.memoizedState===null?!1:(s&2)!==0),l?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),pe(ke,s&1),e===null)return au(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(i=r.children,e=r.fallback,o?(r=t.mode,o=t.child,i={mode:"hidden",children:i},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=i):o=il(i,r,0,null),e=hr(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=pu(n),t.memoizedState=mu,e):Id(t,i));if(s=e.memoizedState,s!==null&&(l=s.dehydrated,l!==null))return n2(e,t,i,r,l,s,n);if(o){o=r.fallback,i=t.mode,s=e.child,l=s.sibling;var c={mode:"hidden",children:r.children};return!(i&1)&&t.child!==s?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=Bn(s,c),r.subtreeFlags=s.subtreeFlags&14680064),l!==null?o=Bn(l,o):(o=hr(o,i,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,r=o,o=t.child,i=e.child.memoizedState,i=i===null?pu(n):{baseLanes:i.baseLanes|n,cachePool:null,transitions:i.transitions},o.memoizedState=i,o.childLanes=e.childLanes&~n,t.memoizedState=mu,r}return o=e.child,e=o.sibling,r=Bn(o,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Id(e,t){return t=il({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function vi(e,t,n,r){return r!==null&&xd(r),ds(t,e.child,null,n),e=Id(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function n2(e,t,n,r,s,o,i){if(n)return t.flags&256?(t.flags&=-257,r=ac(Error(H(422))),vi(e,t,i,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,s=t.mode,r=il({mode:"visible",children:r.children},s,0,null),o=hr(o,s,i,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&ds(t,e.child,null,i),t.child.memoizedState=pu(i),t.memoizedState=mu,o);if(!(t.mode&1))return vi(e,t,i,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var l=r.dgst;return r=l,o=Error(H(419)),r=ac(o,r,void 0),vi(e,t,i,r)}if(l=(i&e.childLanes)!==0,ot||l){if(r=Fe,r!==null){switch(i&-i){case 4:s=2;break;case 16:s=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(r.suspendedLanes|i)?0:s,s!==0&&s!==o.retryLane&&(o.retryLane=s,gn(e,s),Dt(r,e,s,-1))}return Dd(),r=ac(Error(H(421))),vi(e,t,i,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=p2.bind(null,e),s._reactRetry=t,null):(e=o.treeContext,ft=$n(s.nextSibling),ht=t,Ne=!0,Rt=null,e!==null&&(vt[wt++]=cn,vt[wt++]=un,vt[wt++]=xr,cn=e.id,un=e.overflow,xr=t),t=Id(t,r.children),t.flags|=4096,t)}function zh(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),lu(e.return,t,n)}function lc(e,t,n,r,s){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=s)}function lx(e,t,n){var r=t.pendingProps,s=r.revealOrder,o=r.tail;if(qe(e,t,r.children,n),r=ke.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&zh(e,n,t);else if(e.tag===19)zh(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(pe(ke,r),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&ba(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),lc(t,!1,s,n,o);break;case"backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&ba(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}lc(t,!0,n,null,o);break;case"together":lc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Yi(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function xn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),vr|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(H(153));if(t.child!==null){for(e=t.child,n=Bn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Bn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function r2(e,t,n){switch(t.tag){case 3:ix(t),us();break;case 5:Lg(t);break;case 1:lt(t.type)&&ya(t);break;case 4:Sd(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;pe(Na,r._currentValue),r._currentValue=s;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(pe(ke,ke.current&1),t.flags|=128,null):n&t.child.childLanes?ax(e,t,n):(pe(ke,ke.current&1),e=xn(e,t,n),e!==null?e.sibling:null);pe(ke,ke.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return lx(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),pe(ke,ke.current),r)break;return null;case 22:case 23:return t.lanes=0,sx(e,t,n)}return xn(e,t,n)}var cx,gu,ux,dx;cx=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};gu=function(){};ux=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,cr(Qt.current);var o=null;switch(n){case"input":s=$c(e,s),r=$c(e,r),o=[];break;case"select":s=Ee({},s,{value:void 0}),r=Ee({},r,{value:void 0}),o=[];break;case"textarea":s=Hc(e,s),r=Hc(e,r),o=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=ga)}Vc(n,r);var i;n=null;for(u in s)if(!r.hasOwnProperty(u)&&s.hasOwnProperty(u)&&s[u]!=null)if(u==="style"){var l=s[u];for(i in l)l.hasOwnProperty(i)&&(n||(n={}),n[i]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(go.hasOwnProperty(u)?o||(o=[]):(o=o||[]).push(u,null));for(u in r){var c=r[u];if(l=s!=null?s[u]:void 0,r.hasOwnProperty(u)&&c!==l&&(c!=null||l!=null))if(u==="style")if(l){for(i in l)!l.hasOwnProperty(i)||c&&c.hasOwnProperty(i)||(n||(n={}),n[i]="");for(i in c)c.hasOwnProperty(i)&&l[i]!==c[i]&&(n||(n={}),n[i]=c[i])}else n||(o||(o=[]),o.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(o=o||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(o=o||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(go.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&ye("scroll",e),o||l===c||(o=[])):(o=o||[]).push(u,c))}n&&(o=o||[]).push("style",n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}};dx=function(e,t,n,r){n!==r&&(t.flags|=4)};function Vs(e,t){if(!Ne)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Ge(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&14680064,r|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function s2(e,t,n){var r=t.pendingProps;switch(gd(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ge(t),null;case 1:return lt(t.type)&&xa(),Ge(t),null;case 3:return r=t.stateNode,fs(),ve(at),ve(Qe),kd(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(xi(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Rt!==null&&(bu(Rt),Rt=null))),gu(e,t),Ge(t),null;case 5:bd(t);var s=cr(_o.current);if(n=t.type,e!==null&&t.stateNode!=null)ux(e,t,n,r,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(H(166));return Ge(t),null}if(e=cr(Qt.current),xi(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[Gt]=t,r[Co]=o,e=(t.mode&1)!==0,n){case"dialog":ye("cancel",r),ye("close",r);break;case"iframe":case"object":case"embed":ye("load",r);break;case"video":case"audio":for(s=0;s<eo.length;s++)ye(eo[s],r);break;case"source":ye("error",r);break;case"img":case"image":case"link":ye("error",r),ye("load",r);break;case"details":ye("toggle",r);break;case"input":Wf(r,o),ye("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},ye("invalid",r);break;case"textarea":Gf(r,o),ye("invalid",r)}Vc(n,o),s=null;for(var i in o)if(o.hasOwnProperty(i)){var l=o[i];i==="children"?typeof l=="string"?r.textContent!==l&&(o.suppressHydrationWarning!==!0&&gi(r.textContent,l,e),s=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(o.suppressHydrationWarning!==!0&&gi(r.textContent,l,e),s=["children",""+l]):go.hasOwnProperty(i)&&l!=null&&i==="onScroll"&&ye("scroll",r)}switch(n){case"input":li(r),Kf(r,o,!0);break;case"textarea":li(r),Yf(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=ga)}r=s,t.updateQueue=r,r!==null&&(t.flags|=4)}else{i=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Op(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=i.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[Gt]=t,e[Co]=r,cx(e,t,!1,!1),t.stateNode=e;e:{switch(i=Uc(n,r),n){case"dialog":ye("cancel",e),ye("close",e),s=r;break;case"iframe":case"object":case"embed":ye("load",e),s=r;break;case"video":case"audio":for(s=0;s<eo.length;s++)ye(eo[s],e);s=r;break;case"source":ye("error",e),s=r;break;case"img":case"image":case"link":ye("error",e),ye("load",e),s=r;break;case"details":ye("toggle",e),s=r;break;case"input":Wf(e,r),s=$c(e,r),ye("invalid",e);break;case"option":s=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=Ee({},r,{value:void 0}),ye("invalid",e);break;case"textarea":Gf(e,r),s=Hc(e,r),ye("invalid",e);break;default:s=r}Vc(n,s),l=s;for(o in l)if(l.hasOwnProperty(o)){var c=l[o];o==="style"?Bp(e,c):o==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&Fp(e,c)):o==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&xo(e,c):typeof c=="number"&&xo(e,""+c):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(go.hasOwnProperty(o)?c!=null&&o==="onScroll"&&ye("scroll",e):c!=null&&td(e,o,c,i))}switch(n){case"input":li(e),Kf(e,r,!1);break;case"textarea":li(e),Yf(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Un(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?Jr(e,!!r.multiple,o,!1):r.defaultValue!=null&&Jr(e,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=ga)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Ge(t),null;case 6:if(e&&t.stateNode!=null)dx(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(H(166));if(n=cr(_o.current),cr(Qt.current),xi(t)){if(r=t.stateNode,n=t.memoizedProps,r[Gt]=t,(o=r.nodeValue!==n)&&(e=ht,e!==null))switch(e.tag){case 3:gi(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&gi(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Gt]=t,t.stateNode=r}return Ge(t),null;case 13:if(ve(ke),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ne&&ft!==null&&t.mode&1&&!(t.flags&128))Pg(),us(),t.flags|=98560,o=!1;else if(o=xi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(H(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(H(317));o[Gt]=t}else us(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ge(t),o=!1}else Rt!==null&&(bu(Rt),Rt=null),o=!0;if(!o)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||ke.current&1?De===0&&(De=3):Dd())),t.updateQueue!==null&&(t.flags|=4),Ge(t),null);case 4:return fs(),gu(e,t),e===null&&bo(t.stateNode.containerInfo),Ge(t),null;case 10:return wd(t.type._context),Ge(t),null;case 17:return lt(t.type)&&xa(),Ge(t),null;case 19:if(ve(ke),o=t.memoizedState,o===null)return Ge(t),null;if(r=(t.flags&128)!==0,i=o.rendering,i===null)if(r)Vs(o,!1);else{if(De!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=ba(e),i!==null){for(t.flags|=128,Vs(o,!1),r=i.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)o=n,e=r,o.flags&=14680066,i=o.alternate,i===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=i.childLanes,o.lanes=i.lanes,o.child=i.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=i.memoizedProps,o.memoizedState=i.memoizedState,o.updateQueue=i.updateQueue,o.type=i.type,e=i.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return pe(ke,ke.current&1|2),t.child}e=e.sibling}o.tail!==null&&Me()>ms&&(t.flags|=128,r=!0,Vs(o,!1),t.lanes=4194304)}else{if(!r)if(e=ba(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Vs(o,!0),o.tail===null&&o.tailMode==="hidden"&&!i.alternate&&!Ne)return Ge(t),null}else 2*Me()-o.renderingStartTime>ms&&n!==1073741824&&(t.flags|=128,r=!0,Vs(o,!1),t.lanes=4194304);o.isBackwards?(i.sibling=t.child,t.child=i):(n=o.last,n!==null?n.sibling=i:t.child=i,o.last=i)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Me(),t.sibling=null,n=ke.current,pe(ke,r?n&1|2:n&1),t):(Ge(t),null);case 22:case 23:return zd(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ut&1073741824&&(Ge(t),t.subtreeFlags&6&&(t.flags|=8192)):Ge(t),null;case 24:return null;case 25:return null}throw Error(H(156,t.tag))}function o2(e,t){switch(gd(t),t.tag){case 1:return lt(t.type)&&xa(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return fs(),ve(at),ve(Qe),kd(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return bd(t),null;case 13:if(ve(ke),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(H(340));us()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ve(ke),null;case 4:return fs(),null;case 10:return wd(t.type._context),null;case 22:case 23:return zd(),null;case 24:return null;default:return null}}var wi=!1,Xe=!1,i2=typeof WeakSet=="function"?WeakSet:Set,W=null;function Xr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){_e(e,t,r)}else n.current=null}function xu(e,t,n){try{n()}catch(r){_e(e,t,r)}}var Dh=!1;function a2(e,t){if(eu=ha,e=gg(),md(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var i=0,l=-1,c=-1,u=0,h=0,d=e,f=null;t:for(;;){for(var g;d!==n||s!==0&&d.nodeType!==3||(l=i+s),d!==o||r!==0&&d.nodeType!==3||(c=i+r),d.nodeType===3&&(i+=d.nodeValue.length),(g=d.firstChild)!==null;)f=d,d=g;for(;;){if(d===e)break t;if(f===n&&++u===s&&(l=i),f===o&&++h===r&&(c=i),(g=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=g}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(tu={focusedElem:e,selectionRange:n},ha=!1,W=t;W!==null;)if(t=W,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,W=e;else for(;W!==null;){t=W;try{var x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var w=x.memoizedProps,N=x.memoizedState,p=t.stateNode,v=p.getSnapshotBeforeUpdate(t.elementType===t.type?w:Pt(t.type,w),N);p.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(H(163))}}catch(j){_e(t,t.return,j)}if(e=t.sibling,e!==null){e.return=t.return,W=e;break}W=t.return}return x=Dh,Dh=!1,x}function co(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var o=s.destroy;s.destroy=void 0,o!==void 0&&xu(t,n,o)}s=s.next}while(s!==r)}}function sl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function yu(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function fx(e){var t=e.alternate;t!==null&&(e.alternate=null,fx(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Gt],delete t[Co],delete t[su],delete t[VN],delete t[UN])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function hx(e){return e.tag===5||e.tag===3||e.tag===4}function $h(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||hx(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function vu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=ga));else if(r!==4&&(e=e.child,e!==null))for(vu(e,t,n),e=e.sibling;e!==null;)vu(e,t,n),e=e.sibling}function wu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(wu(e,t,n),e=e.sibling;e!==null;)wu(e,t,n),e=e.sibling}var He=null,Mt=!1;function jn(e,t,n){for(n=n.child;n!==null;)mx(e,t,n),n=n.sibling}function mx(e,t,n){if(Xt&&typeof Xt.onCommitFiberUnmount=="function")try{Xt.onCommitFiberUnmount(Qa,n)}catch{}switch(n.tag){case 5:Xe||Xr(n,t);case 6:var r=He,s=Mt;He=null,jn(e,t,n),He=r,Mt=s,He!==null&&(Mt?(e=He,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):He.removeChild(n.stateNode));break;case 18:He!==null&&(Mt?(e=He,n=n.stateNode,e.nodeType===8?tc(e.parentNode,n):e.nodeType===1&&tc(e,n),No(e)):tc(He,n.stateNode));break;case 4:r=He,s=Mt,He=n.stateNode.containerInfo,Mt=!0,jn(e,t,n),He=r,Mt=s;break;case 0:case 11:case 14:case 15:if(!Xe&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var o=s,i=o.destroy;o=o.tag,i!==void 0&&(o&2||o&4)&&xu(n,t,i),s=s.next}while(s!==r)}jn(e,t,n);break;case 1:if(!Xe&&(Xr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){_e(n,t,l)}jn(e,t,n);break;case 21:jn(e,t,n);break;case 22:n.mode&1?(Xe=(r=Xe)||n.memoizedState!==null,jn(e,t,n),Xe=r):jn(e,t,n);break;default:jn(e,t,n)}}function Oh(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new i2),t.forEach(function(r){var s=g2.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function _t(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];try{var o=e,i=t,l=i;e:for(;l!==null;){switch(l.tag){case 5:He=l.stateNode,Mt=!1;break e;case 3:He=l.stateNode.containerInfo,Mt=!0;break e;case 4:He=l.stateNode.containerInfo,Mt=!0;break e}l=l.return}if(He===null)throw Error(H(160));mx(o,i,s),He=null,Mt=!1;var c=s.alternate;c!==null&&(c.return=null),s.return=null}catch(u){_e(s,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)px(t,e),t=t.sibling}function px(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(_t(t,e),Vt(e),r&4){try{co(3,e,e.return),sl(3,e)}catch(w){_e(e,e.return,w)}try{co(5,e,e.return)}catch(w){_e(e,e.return,w)}}break;case 1:_t(t,e),Vt(e),r&512&&n!==null&&Xr(n,n.return);break;case 5:if(_t(t,e),Vt(e),r&512&&n!==null&&Xr(n,n.return),e.flags&32){var s=e.stateNode;try{xo(s,"")}catch(w){_e(e,e.return,w)}}if(r&4&&(s=e.stateNode,s!=null)){var o=e.memoizedProps,i=n!==null?n.memoizedProps:o,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&o.type==="radio"&&o.name!=null&&Dp(s,o),Uc(l,i);var u=Uc(l,o);for(i=0;i<c.length;i+=2){var h=c[i],d=c[i+1];h==="style"?Bp(s,d):h==="dangerouslySetInnerHTML"?Fp(s,d):h==="children"?xo(s,d):td(s,h,d,u)}switch(l){case"input":Oc(s,o);break;case"textarea":$p(s,o);break;case"select":var f=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!o.multiple;var g=o.value;g!=null?Jr(s,!!o.multiple,g,!1):f!==!!o.multiple&&(o.defaultValue!=null?Jr(s,!!o.multiple,o.defaultValue,!0):Jr(s,!!o.multiple,o.multiple?[]:"",!1))}s[Co]=o}catch(w){_e(e,e.return,w)}}break;case 6:if(_t(t,e),Vt(e),r&4){if(e.stateNode===null)throw Error(H(162));s=e.stateNode,o=e.memoizedProps;try{s.nodeValue=o}catch(w){_e(e,e.return,w)}}break;case 3:if(_t(t,e),Vt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{No(t.containerInfo)}catch(w){_e(e,e.return,w)}break;case 4:_t(t,e),Vt(e);break;case 13:_t(t,e),Vt(e),s=e.child,s.flags&8192&&(o=s.memoizedState!==null,s.stateNode.isHidden=o,!o||s.alternate!==null&&s.alternate.memoizedState!==null||(Ld=Me())),r&4&&Oh(e);break;case 22:if(h=n!==null&&n.memoizedState!==null,e.mode&1?(Xe=(u=Xe)||h,_t(t,e),Xe=u):_t(t,e),Vt(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!h&&e.mode&1)for(W=e,h=e.child;h!==null;){for(d=W=h;W!==null;){switch(f=W,g=f.child,f.tag){case 0:case 11:case 14:case 15:co(4,f,f.return);break;case 1:Xr(f,f.return);var x=f.stateNode;if(typeof x.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,x.props=t.memoizedProps,x.state=t.memoizedState,x.componentWillUnmount()}catch(w){_e(r,n,w)}}break;case 5:Xr(f,f.return);break;case 22:if(f.memoizedState!==null){Hh(d);continue}}g!==null?(g.return=f,W=g):Hh(d)}h=h.sibling}e:for(h=null,d=e;;){if(d.tag===5){if(h===null){h=d;try{s=d.stateNode,u?(o=s.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(l=d.stateNode,c=d.memoizedProps.style,i=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=Hp("display",i))}catch(w){_e(e,e.return,w)}}}else if(d.tag===6){if(h===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(w){_e(e,e.return,w)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;h===d&&(h=null),d=d.return}h===d&&(h=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:_t(t,e),Vt(e),r&4&&Oh(e);break;case 21:break;default:_t(t,e),Vt(e)}}function Vt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(hx(n)){var r=n;break e}n=n.return}throw Error(H(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&(xo(s,""),r.flags&=-33);var o=$h(e);wu(e,o,s);break;case 3:case 4:var i=r.stateNode.containerInfo,l=$h(e);vu(e,l,i);break;default:throw Error(H(161))}}catch(c){_e(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function l2(e,t,n){W=e,gx(e)}function gx(e,t,n){for(var r=(e.mode&1)!==0;W!==null;){var s=W,o=s.child;if(s.tag===22&&r){var i=s.memoizedState!==null||wi;if(!i){var l=s.alternate,c=l!==null&&l.memoizedState!==null||Xe;l=wi;var u=Xe;if(wi=i,(Xe=c)&&!u)for(W=s;W!==null;)i=W,c=i.child,i.tag===22&&i.memoizedState!==null?Bh(s):c!==null?(c.return=i,W=c):Bh(s);for(;o!==null;)W=o,gx(o),o=o.sibling;W=s,wi=l,Xe=u}Fh(e)}else s.subtreeFlags&8772&&o!==null?(o.return=s,W=o):Fh(e)}}function Fh(e){for(;W!==null;){var t=W;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Xe||sl(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Xe)if(n===null)r.componentDidMount();else{var s=t.elementType===t.type?n.memoizedProps:Pt(t.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&bh(t,o,r);break;case 3:var i=t.updateQueue;if(i!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}bh(t,i,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var h=u.memoizedState;if(h!==null){var d=h.dehydrated;d!==null&&No(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(H(163))}Xe||t.flags&512&&yu(t)}catch(f){_e(t,t.return,f)}}if(t===e){W=null;break}if(n=t.sibling,n!==null){n.return=t.return,W=n;break}W=t.return}}function Hh(e){for(;W!==null;){var t=W;if(t===e){W=null;break}var n=t.sibling;if(n!==null){n.return=t.return,W=n;break}W=t.return}}function Bh(e){for(;W!==null;){var t=W;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{sl(4,t)}catch(c){_e(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var s=t.return;try{r.componentDidMount()}catch(c){_e(t,s,c)}}var o=t.return;try{yu(t)}catch(c){_e(t,o,c)}break;case 5:var i=t.return;try{yu(t)}catch(c){_e(t,i,c)}}}catch(c){_e(t,t.return,c)}if(t===e){W=null;break}var l=t.sibling;if(l!==null){l.return=t.return,W=l;break}W=t.return}}var c2=Math.ceil,Ea=vn.ReactCurrentDispatcher,Rd=vn.ReactCurrentOwner,jt=vn.ReactCurrentBatchConfig,ae=0,Fe=null,Le=null,Be=0,ut=0,Qr=Zn(0),De=0,Ro=null,vr=0,ol=0,Td=0,uo=null,st=null,Ld=0,ms=1/0,an=null,_a=!1,Nu=null,Fn=null,Ni=!1,Ln=null,Pa=0,fo=0,ju=null,Xi=-1,Qi=0;function et(){return ae&6?Me():Xi!==-1?Xi:Xi=Me()}function Hn(e){return e.mode&1?ae&2&&Be!==0?Be&-Be:KN.transition!==null?(Qi===0&&(Qi=eg()),Qi):(e=de,e!==0||(e=window.event,e=e===void 0?16:ag(e.type)),e):1}function Dt(e,t,n,r){if(50<fo)throw fo=0,ju=null,Error(H(185));Wo(e,n,r),(!(ae&2)||e!==Fe)&&(e===Fe&&(!(ae&2)&&(ol|=n),De===4&&In(e,Be)),ct(e,r),n===1&&ae===0&&!(t.mode&1)&&(ms=Me()+500,tl&&Jn()))}function ct(e,t){var n=e.callbackNode;K1(e,t);var r=fa(e,e===Fe?Be:0);if(r===0)n!==null&&qf(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&qf(n),t===1)e.tag===0?WN(Vh.bind(null,e)):Cg(Vh.bind(null,e)),HN(function(){!(ae&6)&&Jn()}),n=null;else{switch(tg(r)){case 1:n=id;break;case 4:n=Zp;break;case 16:n=da;break;case 536870912:n=Jp;break;default:n=da}n=bx(n,xx.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function xx(e,t){if(Xi=-1,Qi=0,ae&6)throw Error(H(327));var n=e.callbackNode;if(ss()&&e.callbackNode!==n)return null;var r=fa(e,e===Fe?Be:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Ma(e,r);else{t=r;var s=ae;ae|=2;var o=vx();(Fe!==e||Be!==t)&&(an=null,ms=Me()+500,fr(e,t));do try{f2();break}catch(l){yx(e,l)}while(!0);vd(),Ea.current=o,ae=s,Le!==null?t=0:(Fe=null,Be=0,t=De)}if(t!==0){if(t===2&&(s=Xc(e),s!==0&&(r=s,t=Su(e,s))),t===1)throw n=Ro,fr(e,0),In(e,r),ct(e,Me()),n;if(t===6)In(e,r);else{if(s=e.current.alternate,!(r&30)&&!u2(s)&&(t=Ma(e,r),t===2&&(o=Xc(e),o!==0&&(r=o,t=Su(e,o))),t===1))throw n=Ro,fr(e,0),In(e,r),ct(e,Me()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(H(345));case 2:or(e,st,an);break;case 3:if(In(e,r),(r&130023424)===r&&(t=Ld+500-Me(),10<t)){if(fa(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){et(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=ru(or.bind(null,e,st,an),t);break}or(e,st,an);break;case 4:if(In(e,r),(r&4194240)===r)break;for(t=e.eventTimes,s=-1;0<r;){var i=31-zt(r);o=1<<i,i=t[i],i>s&&(s=i),r&=~o}if(r=s,r=Me()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*c2(r/1960))-r,10<r){e.timeoutHandle=ru(or.bind(null,e,st,an),r);break}or(e,st,an);break;case 5:or(e,st,an);break;default:throw Error(H(329))}}}return ct(e,Me()),e.callbackNode===n?xx.bind(null,e):null}function Su(e,t){var n=uo;return e.current.memoizedState.isDehydrated&&(fr(e,t).flags|=256),e=Ma(e,t),e!==2&&(t=st,st=n,t!==null&&bu(t)),e}function bu(e){st===null?st=e:st.push.apply(st,e)}function u2(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var s=n[r],o=s.getSnapshot;s=s.value;try{if(!$t(o(),s))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function In(e,t){for(t&=~Td,t&=~ol,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-zt(t),r=1<<n;e[n]=-1,t&=~r}}function Vh(e){if(ae&6)throw Error(H(327));ss();var t=fa(e,0);if(!(t&1))return ct(e,Me()),null;var n=Ma(e,t);if(e.tag!==0&&n===2){var r=Xc(e);r!==0&&(t=r,n=Su(e,r))}if(n===1)throw n=Ro,fr(e,0),In(e,t),ct(e,Me()),n;if(n===6)throw Error(H(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,or(e,st,an),ct(e,Me()),null}function Ad(e,t){var n=ae;ae|=1;try{return e(t)}finally{ae=n,ae===0&&(ms=Me()+500,tl&&Jn())}}function wr(e){Ln!==null&&Ln.tag===0&&!(ae&6)&&ss();var t=ae;ae|=1;var n=jt.transition,r=de;try{if(jt.transition=null,de=1,e)return e()}finally{de=r,jt.transition=n,ae=t,!(ae&6)&&Jn()}}function zd(){ut=Qr.current,ve(Qr)}function fr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,FN(n)),Le!==null)for(n=Le.return;n!==null;){var r=n;switch(gd(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&xa();break;case 3:fs(),ve(at),ve(Qe),kd();break;case 5:bd(r);break;case 4:fs();break;case 13:ve(ke);break;case 19:ve(ke);break;case 10:wd(r.type._context);break;case 22:case 23:zd()}n=n.return}if(Fe=e,Le=e=Bn(e.current,null),Be=ut=t,De=0,Ro=null,Td=ol=vr=0,st=uo=null,lr!==null){for(t=0;t<lr.length;t++)if(n=lr[t],r=n.interleaved,r!==null){n.interleaved=null;var s=r.next,o=n.pending;if(o!==null){var i=o.next;o.next=s,r.next=i}n.pending=r}lr=null}return e}function yx(e,t){do{var n=Le;try{if(vd(),Ki.current=Ca,ka){for(var r=Ce.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}ka=!1}if(yr=0,Oe=ze=Ce=null,lo=!1,Po=0,Rd.current=null,n===null||n.return===null){De=1,Ro=t,Le=null;break}e:{var o=e,i=n.return,l=n,c=t;if(t=Be,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,h=l,d=h.tag;if(!(h.mode&1)&&(d===0||d===11||d===15)){var f=h.alternate;f?(h.updateQueue=f.updateQueue,h.memoizedState=f.memoizedState,h.lanes=f.lanes):(h.updateQueue=null,h.memoizedState=null)}var g=Mh(i);if(g!==null){g.flags&=-257,Ih(g,i,l,o,t),g.mode&1&&Ph(o,u,t),t=g,c=u;var x=t.updateQueue;if(x===null){var w=new Set;w.add(c),t.updateQueue=w}else x.add(c);break e}else{if(!(t&1)){Ph(o,u,t),Dd();break e}c=Error(H(426))}}else if(Ne&&l.mode&1){var N=Mh(i);if(N!==null){!(N.flags&65536)&&(N.flags|=256),Ih(N,i,l,o,t),xd(hs(c,l));break e}}o=c=hs(c,l),De!==4&&(De=2),uo===null?uo=[o]:uo.push(o),o=i;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var p=tx(o,c,t);Sh(o,p);break e;case 1:l=c;var v=o.type,y=o.stateNode;if(!(o.flags&128)&&(typeof v.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(Fn===null||!Fn.has(y)))){o.flags|=65536,t&=-t,o.lanes|=t;var j=nx(o,l,t);Sh(o,j);break e}}o=o.return}while(o!==null)}Nx(n)}catch(S){t=S,Le===n&&n!==null&&(Le=n=n.return);continue}break}while(!0)}function vx(){var e=Ea.current;return Ea.current=Ca,e===null?Ca:e}function Dd(){(De===0||De===3||De===2)&&(De=4),Fe===null||!(vr&268435455)&&!(ol&268435455)||In(Fe,Be)}function Ma(e,t){var n=ae;ae|=2;var r=vx();(Fe!==e||Be!==t)&&(an=null,fr(e,t));do try{d2();break}catch(s){yx(e,s)}while(!0);if(vd(),ae=n,Ea.current=r,Le!==null)throw Error(H(261));return Fe=null,Be=0,De}function d2(){for(;Le!==null;)wx(Le)}function f2(){for(;Le!==null&&!D1();)wx(Le)}function wx(e){var t=Sx(e.alternate,e,ut);e.memoizedProps=e.pendingProps,t===null?Nx(e):Le=t,Rd.current=null}function Nx(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=o2(n,t),n!==null){n.flags&=32767,Le=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{De=6,Le=null;return}}else if(n=s2(n,t,ut),n!==null){Le=n;return}if(t=t.sibling,t!==null){Le=t;return}Le=t=e}while(t!==null);De===0&&(De=5)}function or(e,t,n){var r=de,s=jt.transition;try{jt.transition=null,de=1,h2(e,t,n,r)}finally{jt.transition=s,de=r}return null}function h2(e,t,n,r){do ss();while(Ln!==null);if(ae&6)throw Error(H(327));n=e.finishedWork;var s=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(H(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(G1(e,o),e===Fe&&(Le=Fe=null,Be=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Ni||(Ni=!0,bx(da,function(){return ss(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=jt.transition,jt.transition=null;var i=de;de=1;var l=ae;ae|=4,Rd.current=null,a2(e,n),px(n,e),TN(tu),ha=!!eu,tu=eu=null,e.current=n,l2(n),$1(),ae=l,de=i,jt.transition=o}else e.current=n;if(Ni&&(Ni=!1,Ln=e,Pa=s),o=e.pendingLanes,o===0&&(Fn=null),H1(n.stateNode),ct(e,Me()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)s=t[n],r(s.value,{componentStack:s.stack,digest:s.digest});if(_a)throw _a=!1,e=Nu,Nu=null,e;return Pa&1&&e.tag!==0&&ss(),o=e.pendingLanes,o&1?e===ju?fo++:(fo=0,ju=e):fo=0,Jn(),null}function ss(){if(Ln!==null){var e=tg(Pa),t=jt.transition,n=de;try{if(jt.transition=null,de=16>e?16:e,Ln===null)var r=!1;else{if(e=Ln,Ln=null,Pa=0,ae&6)throw Error(H(331));var s=ae;for(ae|=4,W=e.current;W!==null;){var o=W,i=o.child;if(W.flags&16){var l=o.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(W=u;W!==null;){var h=W;switch(h.tag){case 0:case 11:case 15:co(8,h,o)}var d=h.child;if(d!==null)d.return=h,W=d;else for(;W!==null;){h=W;var f=h.sibling,g=h.return;if(fx(h),h===u){W=null;break}if(f!==null){f.return=g,W=f;break}W=g}}}var x=o.alternate;if(x!==null){var w=x.child;if(w!==null){x.child=null;do{var N=w.sibling;w.sibling=null,w=N}while(w!==null)}}W=o}}if(o.subtreeFlags&2064&&i!==null)i.return=o,W=i;else e:for(;W!==null;){if(o=W,o.flags&2048)switch(o.tag){case 0:case 11:case 15:co(9,o,o.return)}var p=o.sibling;if(p!==null){p.return=o.return,W=p;break e}W=o.return}}var v=e.current;for(W=v;W!==null;){i=W;var y=i.child;if(i.subtreeFlags&2064&&y!==null)y.return=i,W=y;else e:for(i=v;W!==null;){if(l=W,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:sl(9,l)}}catch(S){_e(l,l.return,S)}if(l===i){W=null;break e}var j=l.sibling;if(j!==null){j.return=l.return,W=j;break e}W=l.return}}if(ae=s,Jn(),Xt&&typeof Xt.onPostCommitFiberRoot=="function")try{Xt.onPostCommitFiberRoot(Qa,e)}catch{}r=!0}return r}finally{de=n,jt.transition=t}}return!1}function Uh(e,t,n){t=hs(n,t),t=tx(e,t,1),e=On(e,t,1),t=et(),e!==null&&(Wo(e,1,t),ct(e,t))}function _e(e,t,n){if(e.tag===3)Uh(e,e,n);else for(;t!==null;){if(t.tag===3){Uh(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Fn===null||!Fn.has(r))){e=hs(n,e),e=nx(t,e,1),t=On(t,e,1),e=et(),t!==null&&(Wo(t,1,e),ct(t,e));break}}t=t.return}}function m2(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=et(),e.pingedLanes|=e.suspendedLanes&n,Fe===e&&(Be&n)===n&&(De===4||De===3&&(Be&130023424)===Be&&500>Me()-Ld?fr(e,0):Td|=n),ct(e,t)}function jx(e,t){t===0&&(e.mode&1?(t=di,di<<=1,!(di&130023424)&&(di=4194304)):t=1);var n=et();e=gn(e,t),e!==null&&(Wo(e,t,n),ct(e,n))}function p2(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),jx(e,n)}function g2(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(H(314))}r!==null&&r.delete(t),jx(e,n)}var Sx;Sx=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||at.current)ot=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return ot=!1,r2(e,t,n);ot=!!(e.flags&131072)}else ot=!1,Ne&&t.flags&1048576&&Eg(t,wa,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Yi(e,t),e=t.pendingProps;var s=cs(t,Qe.current);rs(t,n),s=Ed(null,t,r,e,s,n);var o=_d();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,lt(r)?(o=!0,ya(t)):o=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,jd(t),s.updater=rl,t.stateNode=s,s._reactInternals=t,uu(t,r,e,n),t=hu(null,t,r,!0,o,n)):(t.tag=0,Ne&&o&&pd(t),qe(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Yi(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=y2(r),e=Pt(r,e),s){case 0:t=fu(null,t,r,e,n);break e;case 1:t=Lh(null,t,r,e,n);break e;case 11:t=Rh(null,t,r,e,n);break e;case 14:t=Th(null,t,r,Pt(r.type,e),n);break e}throw Error(H(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Pt(r,s),fu(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Pt(r,s),Lh(e,t,r,s,n);case 3:e:{if(ix(t),e===null)throw Error(H(387));r=t.pendingProps,o=t.memoizedState,s=o.element,Tg(e,t),Sa(t,r,null,n);var i=t.memoizedState;if(r=i.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){s=hs(Error(H(423)),t),t=Ah(e,t,r,n,s);break e}else if(r!==s){s=hs(Error(H(424)),t),t=Ah(e,t,r,n,s);break e}else for(ft=$n(t.stateNode.containerInfo.firstChild),ht=t,Ne=!0,Rt=null,n=Ig(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(us(),r===s){t=xn(e,t,n);break e}qe(e,t,r,n)}t=t.child}return t;case 5:return Lg(t),e===null&&au(t),r=t.type,s=t.pendingProps,o=e!==null?e.memoizedProps:null,i=s.children,nu(r,s)?i=null:o!==null&&nu(r,o)&&(t.flags|=32),ox(e,t),qe(e,t,i,n),t.child;case 6:return e===null&&au(t),null;case 13:return ax(e,t,n);case 4:return Sd(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ds(t,null,r,n):qe(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Pt(r,s),Rh(e,t,r,s,n);case 7:return qe(e,t,t.pendingProps,n),t.child;case 8:return qe(e,t,t.pendingProps.children,n),t.child;case 12:return qe(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,o=t.memoizedProps,i=s.value,pe(Na,r._currentValue),r._currentValue=i,o!==null)if($t(o.value,i)){if(o.children===s.children&&!at.current){t=xn(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var l=o.dependencies;if(l!==null){i=o.child;for(var c=l.firstContext;c!==null;){if(c.context===r){if(o.tag===1){c=fn(-1,n&-n),c.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var h=u.pending;h===null?c.next=c:(c.next=h.next,h.next=c),u.pending=c}}o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),lu(o.return,n,t),l.lanes|=n;break}c=c.next}}else if(o.tag===10)i=o.type===t.type?null:o.child;else if(o.tag===18){if(i=o.return,i===null)throw Error(H(341));i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),lu(i,n,t),i=o.sibling}else i=o.child;if(i!==null)i.return=o;else for(i=o;i!==null;){if(i===t){i=null;break}if(o=i.sibling,o!==null){o.return=i.return,i=o;break}i=i.return}o=i}qe(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,rs(t,n),s=St(s),r=r(s),t.flags|=1,qe(e,t,r,n),t.child;case 14:return r=t.type,s=Pt(r,t.pendingProps),s=Pt(r.type,s),Th(e,t,r,s,n);case 15:return rx(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Pt(r,s),Yi(e,t),t.tag=1,lt(r)?(e=!0,ya(t)):e=!1,rs(t,n),ex(t,r,s),uu(t,r,s,n),hu(null,t,r,!0,e,n);case 19:return lx(e,t,n);case 22:return sx(e,t,n)}throw Error(H(156,t.tag))};function bx(e,t){return qp(e,t)}function x2(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Nt(e,t,n,r){return new x2(e,t,n,r)}function $d(e){return e=e.prototype,!(!e||!e.isReactComponent)}function y2(e){if(typeof e=="function")return $d(e)?1:0;if(e!=null){if(e=e.$$typeof,e===rd)return 11;if(e===sd)return 14}return 2}function Bn(e,t){var n=e.alternate;return n===null?(n=Nt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function qi(e,t,n,r,s,o){var i=2;if(r=e,typeof e=="function")$d(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Fr:return hr(n.children,s,o,t);case nd:i=8,s|=8;break;case Lc:return e=Nt(12,n,t,s|2),e.elementType=Lc,e.lanes=o,e;case Ac:return e=Nt(13,n,t,s),e.elementType=Ac,e.lanes=o,e;case zc:return e=Nt(19,n,t,s),e.elementType=zc,e.lanes=o,e;case Lp:return il(n,s,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Rp:i=10;break e;case Tp:i=9;break e;case rd:i=11;break e;case sd:i=14;break e;case _n:i=16,r=null;break e}throw Error(H(130,e==null?e:typeof e,""))}return t=Nt(i,n,t,s),t.elementType=e,t.type=r,t.lanes=o,t}function hr(e,t,n,r){return e=Nt(7,e,r,t),e.lanes=n,e}function il(e,t,n,r){return e=Nt(22,e,r,t),e.elementType=Lp,e.lanes=n,e.stateNode={isHidden:!1},e}function cc(e,t,n){return e=Nt(6,e,null,t),e.lanes=n,e}function uc(e,t,n){return t=Nt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function v2(e,t,n,r,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ul(0),this.expirationTimes=Ul(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ul(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Od(e,t,n,r,s,o,i,l,c){return e=new v2(e,t,n,l,c),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Nt(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},jd(o),e}function w2(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Or,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function kx(e){if(!e)return Wn;e=e._reactInternals;e:{if(_r(e)!==e||e.tag!==1)throw Error(H(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(lt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(H(171))}if(e.tag===1){var n=e.type;if(lt(n))return kg(e,n,t)}return t}function Cx(e,t,n,r,s,o,i,l,c){return e=Od(n,r,!0,e,s,o,i,l,c),e.context=kx(null),n=e.current,r=et(),s=Hn(n),o=fn(r,s),o.callback=t??null,On(n,o,s),e.current.lanes=s,Wo(e,s,r),ct(e,r),e}function al(e,t,n,r){var s=t.current,o=et(),i=Hn(s);return n=kx(n),t.context===null?t.context=n:t.pendingContext=n,t=fn(o,i),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=On(s,t,i),e!==null&&(Dt(e,s,i,o),Wi(e,s,i)),i}function Ia(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Wh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Fd(e,t){Wh(e,t),(e=e.alternate)&&Wh(e,t)}function N2(){return null}var Ex=typeof reportError=="function"?reportError:function(e){console.error(e)};function Hd(e){this._internalRoot=e}ll.prototype.render=Hd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(H(409));al(e,t,null,null)};ll.prototype.unmount=Hd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;wr(function(){al(null,e,null,null)}),t[pn]=null}};function ll(e){this._internalRoot=e}ll.prototype.unstable_scheduleHydration=function(e){if(e){var t=sg();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Mn.length&&t!==0&&t<Mn[n].priority;n++);Mn.splice(n,0,e),n===0&&ig(e)}};function Bd(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function cl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Kh(){}function j2(e,t,n,r,s){if(s){if(typeof r=="function"){var o=r;r=function(){var u=Ia(i);o.call(u)}}var i=Cx(t,r,e,0,null,!1,!1,"",Kh);return e._reactRootContainer=i,e[pn]=i.current,bo(e.nodeType===8?e.parentNode:e),wr(),i}for(;s=e.lastChild;)e.removeChild(s);if(typeof r=="function"){var l=r;r=function(){var u=Ia(c);l.call(u)}}var c=Od(e,0,!1,null,null,!1,!1,"",Kh);return e._reactRootContainer=c,e[pn]=c.current,bo(e.nodeType===8?e.parentNode:e),wr(function(){al(t,c,n,r)}),c}function ul(e,t,n,r,s){var o=n._reactRootContainer;if(o){var i=o;if(typeof s=="function"){var l=s;s=function(){var c=Ia(i);l.call(c)}}al(t,i,e,s)}else i=j2(n,t,e,s,r);return Ia(i)}ng=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Js(t.pendingLanes);n!==0&&(ad(t,n|1),ct(t,Me()),!(ae&6)&&(ms=Me()+500,Jn()))}break;case 13:wr(function(){var r=gn(e,1);if(r!==null){var s=et();Dt(r,e,1,s)}}),Fd(e,1)}};ld=function(e){if(e.tag===13){var t=gn(e,134217728);if(t!==null){var n=et();Dt(t,e,134217728,n)}Fd(e,134217728)}};rg=function(e){if(e.tag===13){var t=Hn(e),n=gn(e,t);if(n!==null){var r=et();Dt(n,e,t,r)}Fd(e,t)}};sg=function(){return de};og=function(e,t){var n=de;try{return de=e,t()}finally{de=n}};Kc=function(e,t,n){switch(t){case"input":if(Oc(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var s=el(r);if(!s)throw Error(H(90));zp(r),Oc(r,s)}}}break;case"textarea":$p(e,n);break;case"select":t=n.value,t!=null&&Jr(e,!!n.multiple,t,!1)}};Wp=Ad;Kp=wr;var S2={usingClientEntryPoint:!1,Events:[Go,Ur,el,Vp,Up,Ad]},Us={findFiberByHostInstance:ar,bundleType:0,version:"18.3.0",rendererPackageName:"react-dom"},b2={bundleType:Us.bundleType,version:Us.version,rendererPackageName:Us.rendererPackageName,rendererConfig:Us.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:vn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Xp(e),e===null?null:e.stateNode},findFiberByHostInstance:Us.findFiberByHostInstance||N2,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.0-next-8a015b68cc-20240425"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ji=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ji.isDisabled&&ji.supportsFiber)try{Qa=ji.inject(b2),Xt=ji}catch{}}xt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=S2;xt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Bd(t))throw Error(H(200));return w2(e,t,null,n)};xt.createRoot=function(e,t){if(!Bd(e))throw Error(H(299));var n=!1,r="",s=Ex;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=Od(e,1,!1,null,null,n,!1,r,s),e[pn]=t.current,bo(e.nodeType===8?e.parentNode:e),new Hd(t)};xt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(H(188)):(e=Object.keys(e).join(","),Error(H(268,e)));return e=Xp(t),e=e===null?null:e.stateNode,e};xt.flushSync=function(e){return wr(e)};xt.hydrate=function(e,t,n){if(!cl(t))throw Error(H(200));return ul(null,e,t,!0,n)};xt.hydrateRoot=function(e,t,n){if(!Bd(e))throw Error(H(405));var r=n!=null&&n.hydratedSources||null,s=!1,o="",i=Ex;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(i=n.onRecoverableError)),t=Cx(t,null,e,1,n??null,s,!1,o,i),e[pn]=t.current,bo(e),r)for(e=0;e<r.length;e++)n=r[e],s=n._getVersion,s=s(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,s]:t.mutableSourceEagerHydrationData.push(n,s);return new ll(t)};xt.render=function(e,t,n){if(!cl(t))throw Error(H(200));return ul(null,e,t,!1,n)};xt.unmountComponentAtNode=function(e){if(!cl(e))throw Error(H(40));return e._reactRootContainer?(wr(function(){ul(null,null,e,!1,function(){e._reactRootContainer=null,e[pn]=null})}),!0):!1};xt.unstable_batchedUpdates=Ad;xt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!cl(n))throw Error(H(200));if(e==null||e._reactInternals===void 0)throw Error(H(38));return ul(e,t,n,!1,r)};xt.version="18.3.0-next-8a015b68cc-20240425";function _x(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(_x)}catch(e){console.error(e)}}_x(),_p.exports=xt;var dl=_p.exports;const k2=Yu(dl);var Gh=dl;Rc.createRoot=Gh.createRoot,Rc.hydrateRoot=Gh.hydrateRoot;/**
|
|
41
|
-
* react-router v7.1.0
|
|
42
|
-
*
|
|
43
|
-
* Copyright (c) Remix Software Inc.
|
|
44
|
-
*
|
|
45
|
-
* This source code is licensed under the MIT license found in the
|
|
46
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
47
|
-
*
|
|
48
|
-
* @license MIT
|
|
49
|
-
*/var Yh="popstate";function C2(e={}){function t(r,s){let{pathname:o,search:i,hash:l}=r.location;return ku("",{pathname:o,search:i,hash:l},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:To(s)}return _2(t,n,null,e)}function je(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function kt(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function E2(){return Math.random().toString(36).substring(2,10)}function Xh(e,t){return{usr:e.state,key:e.key,idx:t}}function ku(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?_s(t):t,state:n,key:t&&t.key||r||E2()}}function To({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function _s(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function _2(e,t,n,r={}){let{window:s=document.defaultView,v5Compat:o=!1}=r,i=s.history,l="POP",c=null,u=h();u==null&&(u=0,i.replaceState({...i.state,idx:u},""));function h(){return(i.state||{idx:null}).idx}function d(){l="POP";let N=h(),p=N==null?null:N-u;u=N,c&&c({action:l,location:w.location,delta:p})}function f(N,p){l="PUSH";let v=ku(w.location,N,p);u=h()+1;let y=Xh(v,u),j=w.createHref(v);try{i.pushState(y,"",j)}catch(S){if(S instanceof DOMException&&S.name==="DataCloneError")throw S;s.location.assign(j)}o&&c&&c({action:l,location:w.location,delta:1})}function g(N,p){l="REPLACE";let v=ku(w.location,N,p);u=h();let y=Xh(v,u),j=w.createHref(v);i.replaceState(y,"",j),o&&c&&c({action:l,location:w.location,delta:0})}function x(N){let p=s.location.origin!=="null"?s.location.origin:s.location.href,v=typeof N=="string"?N:To(N);return v=v.replace(/ $/,"%20"),je(p,`No window.location.(origin|href) available to create URL for href: ${v}`),new URL(v,p)}let w={get action(){return l},get location(){return e(s,i)},listen(N){if(c)throw new Error("A history only accepts one active listener");return s.addEventListener(Yh,d),c=N,()=>{s.removeEventListener(Yh,d),c=null}},createHref(N){return t(s,N)},createURL:x,encodeLocation(N){let p=x(N);return{pathname:p.pathname,search:p.search,hash:p.hash}},push:f,replace:g,go(N){return i.go(N)}};return w}function Px(e,t,n="/"){return P2(e,t,n,!1)}function P2(e,t,n,r){let s=typeof t=="string"?_s(t):t,o=Kn(s.pathname||"/",n);if(o==null)return null;let i=Mx(e);M2(i);let l=null;for(let c=0;l==null&&c<i.length;++c){let u=H2(o);l=O2(i[c],u,r)}return l}function Mx(e,t=[],n=[],r=""){let s=(o,i,l)=>{let c={relativePath:l===void 0?o.path||"":l,caseSensitive:o.caseSensitive===!0,childrenIndex:i,route:o};c.relativePath.startsWith("/")&&(je(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length));let u=hn([r,c.relativePath]),h=n.concat(c);o.children&&o.children.length>0&&(je(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${u}".`),Mx(o.children,t,h,u)),!(o.path==null&&!o.index)&&t.push({path:u,score:D2(u,o.index),routesMeta:h})};return e.forEach((o,i)=>{var l;if(o.path===""||!((l=o.path)!=null&&l.includes("?")))s(o,i);else for(let c of Ix(o.path))s(o,i,c)}),t}function Ix(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return s?[o,""]:[o];let i=Ix(r.join("/")),l=[];return l.push(...i.map(c=>c===""?o:[o,c].join("/"))),s&&l.push(...i),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function M2(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:$2(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var I2=/^:[\w-]+$/,R2=3,T2=2,L2=1,A2=10,z2=-2,Qh=e=>e==="*";function D2(e,t){let n=e.split("/"),r=n.length;return n.some(Qh)&&(r+=z2),t&&(r+=T2),n.filter(s=>!Qh(s)).reduce((s,o)=>s+(I2.test(o)?R2:o===""?L2:A2),r)}function $2(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function O2(e,t,n=!1){let{routesMeta:r}=e,s={},o="/",i=[];for(let l=0;l<r.length;++l){let c=r[l],u=l===r.length-1,h=o==="/"?t:t.slice(o.length)||"/",d=Ra({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},h),f=c.route;if(!d&&u&&n&&!r[r.length-1].route.index&&(d=Ra({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},h)),!d)return null;Object.assign(s,d.params),i.push({params:s,pathname:hn([o,d.pathname]),pathnameBase:W2(hn([o,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(o=hn([o,d.pathnameBase]))}return i}function Ra(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=F2(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let o=s[0],i=o.replace(/(.)\/+$/,"$1"),l=s.slice(1);return{params:r.reduce((u,{paramName:h,isOptional:d},f)=>{if(h==="*"){let x=l[f]||"";i=o.slice(0,o.length-x.length).replace(/(.)\/+$/,"$1")}const g=l[f];return d&&!g?u[h]=void 0:u[h]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:i,pattern:e}}function F2(e,t=!1,n=!0){kt(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,l,c)=>(r.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function H2(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return kt(!1,`The URL path "${e}" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Kn(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function B2(e,t="/"){let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?_s(e):e;return{pathname:n?n.startsWith("/")?n:V2(n,t):t,search:K2(r),hash:G2(s)}}function V2(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function dc(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function U2(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Vd(e){let t=U2(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Ud(e,t,n,r=!1){let s;typeof e=="string"?s=_s(e):(s={...e},je(!s.pathname||!s.pathname.includes("?"),dc("?","pathname","search",s)),je(!s.pathname||!s.pathname.includes("#"),dc("#","pathname","hash",s)),je(!s.search||!s.search.includes("#"),dc("#","search","hash",s)));let o=e===""||s.pathname==="",i=o?"/":s.pathname,l;if(i==null)l=n;else{let d=t.length-1;if(!r&&i.startsWith("..")){let f=i.split("/");for(;f[0]==="..";)f.shift(),d-=1;s.pathname=f.join("/")}l=d>=0?t[d]:"/"}let c=B2(s,l),u=i&&i!=="/"&&i.endsWith("/"),h=(o||i===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||h)&&(c.pathname+="/"),c}var hn=e=>e.join("/").replace(/\/\/+/g,"/"),W2=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),K2=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,G2=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Y2(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var Rx=["POST","PUT","PATCH","DELETE"];new Set(Rx);var X2=["GET",...Rx];new Set(X2);var Ps=m.createContext(null);Ps.displayName="DataRouter";var fl=m.createContext(null);fl.displayName="DataRouterState";var Tx=m.createContext({isTransitioning:!1});Tx.displayName="ViewTransition";var Q2=m.createContext(new Map);Q2.displayName="Fetchers";var q2=m.createContext(null);q2.displayName="Await";var Ft=m.createContext(null);Ft.displayName="Navigation";var Xo=m.createContext(null);Xo.displayName="Location";var Et=m.createContext({outlet:null,matches:[],isDataRoute:!1});Et.displayName="Route";var Wd=m.createContext(null);Wd.displayName="RouteError";function Z2(e,{relative:t}={}){je(Ms(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=m.useContext(Ft),{hash:s,pathname:o,search:i}=Qo(e,{relative:t}),l=o;return n!=="/"&&(l=o==="/"?n:hn([n,o])),r.createHref({pathname:l,search:i,hash:s})}function Ms(){return m.useContext(Xo)!=null}function tn(){return je(Ms(),"useLocation() may be used only in the context of a <Router> component."),m.useContext(Xo).location}var Lx="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Ax(e){m.useContext(Ft).static||m.useLayoutEffect(e)}function hl(){let{isDataRoute:e}=m.useContext(Et);return e?mj():J2()}function J2(){je(Ms(),"useNavigate() may be used only in the context of a <Router> component.");let e=m.useContext(Ps),{basename:t,navigator:n}=m.useContext(Ft),{matches:r}=m.useContext(Et),{pathname:s}=tn(),o=JSON.stringify(Vd(r)),i=m.useRef(!1);return Ax(()=>{i.current=!0}),m.useCallback((c,u={})=>{if(kt(i.current,Lx),!i.current)return;if(typeof c=="number"){n.go(c);return}let h=Ud(c,JSON.parse(o),s,u.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:hn([t,h.pathname])),(u.replace?n.replace:n.push)(h,u.state,u)},[t,n,o,s,e])}var ej=m.createContext(null);function tj(e){let t=m.useContext(Et).outlet;return t&&m.createElement(ej.Provider,{value:e},t)}function nj(){let{matches:e}=m.useContext(Et),t=e[e.length-1];return t?t.params:{}}function Qo(e,{relative:t}={}){let{matches:n}=m.useContext(Et),{pathname:r}=tn(),s=JSON.stringify(Vd(n));return m.useMemo(()=>Ud(e,JSON.parse(s),r,t==="path"),[e,s,r,t])}function rj(e,t){return zx(e,t)}function zx(e,t,n,r){var p;je(Ms(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=m.useContext(Ft),{matches:o}=m.useContext(Et),i=o[o.length-1],l=i?i.params:{},c=i?i.pathname:"/",u=i?i.pathnameBase:"/",h=i&&i.route;{let v=h&&h.path||"";Dx(c,!h||v.endsWith("*")||v.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${v}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
50
|
-
|
|
51
|
-
Please change the parent <Route path="${v}"> to <Route path="${v==="/"?"*":`${v}/*`}">.`)}let d=tn(),f;if(t){let v=typeof t=="string"?_s(t):t;je(u==="/"||((p=v.pathname)==null?void 0:p.startsWith(u)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${u}" but pathname "${v.pathname}" was given in the \`location\` prop.`),f=v}else f=d;let g=f.pathname||"/",x=g;if(u!=="/"){let v=u.replace(/^\//,"").split("/");x="/"+g.replace(/^\//,"").split("/").slice(v.length).join("/")}let w=Px(e,{pathname:x});kt(h||w!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),kt(w==null||w[w.length-1].route.element!==void 0||w[w.length-1].route.Component!==void 0||w[w.length-1].route.lazy!==void 0,`Matched leaf route at location "${f.pathname}${f.search}${f.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let N=lj(w&&w.map(v=>Object.assign({},v,{params:Object.assign({},l,v.params),pathname:hn([u,s.encodeLocation?s.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?u:hn([u,s.encodeLocation?s.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),o,n,r);return t&&N?m.createElement(Xo.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...f},navigationType:"POP"}},N):N}function sj(){let e=hj(),t=Y2(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:r},o={padding:"2px 4px",backgroundColor:r},i=null;return console.error("Error handled by React Router default ErrorBoundary:",e),i=m.createElement(m.Fragment,null,m.createElement("p",null,"💿 Hey developer 👋"),m.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",m.createElement("code",{style:o},"ErrorBoundary")," or"," ",m.createElement("code",{style:o},"errorElement")," prop on your route.")),m.createElement(m.Fragment,null,m.createElement("h2",null,"Unexpected Application Error!"),m.createElement("h3",{style:{fontStyle:"italic"}},t),n?m.createElement("pre",{style:s},n):null,i)}var oj=m.createElement(sj,null),ij=class extends m.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?m.createElement(Et.Provider,{value:this.props.routeContext},m.createElement(Wd.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function aj({routeContext:e,match:t,children:n}){let r=m.useContext(Ps);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),m.createElement(Et.Provider,{value:e},n)}function lj(e,t=[],n=null,r=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let s=e,o=n==null?void 0:n.errors;if(o!=null){let c=s.findIndex(u=>u.route.id&&(o==null?void 0:o[u.route.id])!==void 0);je(c>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),s=s.slice(0,Math.min(s.length,c+1))}let i=!1,l=-1;if(n)for(let c=0;c<s.length;c++){let u=s[c];if((u.route.HydrateFallback||u.route.hydrateFallbackElement)&&(l=c),u.route.id){let{loaderData:h,errors:d}=n,f=u.route.loader&&!h.hasOwnProperty(u.route.id)&&(!d||d[u.route.id]===void 0);if(u.route.lazy||f){i=!0,l>=0?s=s.slice(0,l+1):s=[s[0]];break}}}return s.reduceRight((c,u,h)=>{let d,f=!1,g=null,x=null;n&&(d=o&&u.route.id?o[u.route.id]:void 0,g=u.route.errorElement||oj,i&&(l<0&&h===0?(Dx("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),f=!0,x=null):l===h&&(f=!0,x=u.route.hydrateFallbackElement||null)));let w=t.concat(s.slice(0,h+1)),N=()=>{let p;return d?p=g:f?p=x:u.route.Component?p=m.createElement(u.route.Component,null):u.route.element?p=u.route.element:p=c,m.createElement(aj,{match:u,routeContext:{outlet:c,matches:w,isDataRoute:n!=null},children:p})};return n&&(u.route.ErrorBoundary||u.route.errorElement||h===0)?m.createElement(ij,{location:n.location,revalidation:n.revalidation,component:g,error:d,children:N(),routeContext:{outlet:null,matches:w,isDataRoute:!0}}):N()},null)}function Kd(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function cj(e){let t=m.useContext(Ps);return je(t,Kd(e)),t}function uj(e){let t=m.useContext(fl);return je(t,Kd(e)),t}function dj(e){let t=m.useContext(Et);return je(t,Kd(e)),t}function Gd(e){let t=dj(e),n=t.matches[t.matches.length-1];return je(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function fj(){return Gd("useRouteId")}function hj(){var r;let e=m.useContext(Wd),t=uj("useRouteError"),n=Gd("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function mj(){let{router:e}=cj("useNavigate"),t=Gd("useNavigate"),n=m.useRef(!1);return Ax(()=>{n.current=!0}),m.useCallback(async(s,o={})=>{kt(n.current,Lx),n.current&&(typeof s=="number"?e.navigate(s):await e.navigate(s,{fromRouteId:t,...o}))},[e,t])}var qh={};function Dx(e,t,n){!t&&!qh[e]&&(qh[e]=!0,kt(!1,n))}m.memo(pj);function pj({routes:e,future:t,state:n}){return zx(e,void 0,n,t)}function Cu({to:e,replace:t,state:n,relative:r}){je(Ms(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=m.useContext(Ft);kt(!s,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:o}=m.useContext(Et),{pathname:i}=tn(),l=hl(),c=Ud(e,Vd(o),i,r==="path"),u=JSON.stringify(c);return m.useEffect(()=>{l(JSON.parse(u),{replace:t,state:n,relative:r})},[l,u,r,t,n]),null}function gj(e){return tj(e.context)}function Ye(e){je(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function xj({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:s,static:o=!1}){je(!Ms(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let i=e.replace(/^\/*/,"/"),l=m.useMemo(()=>({basename:i,navigator:s,static:o,future:{}}),[i,s,o]);typeof n=="string"&&(n=_s(n));let{pathname:c="/",search:u="",hash:h="",state:d=null,key:f="default"}=n,g=m.useMemo(()=>{let x=Kn(c,i);return x==null?null:{location:{pathname:x,search:u,hash:h,state:d,key:f},navigationType:r}},[i,c,u,h,d,f,r]);return kt(g!=null,`<Router basename="${i}"> is not able to match the URL "${c}${u}${h}" because it does not start with the basename, so the <Router> won't render anything.`),g==null?null:m.createElement(Ft.Provider,{value:l},m.createElement(Xo.Provider,{children:t,value:g}))}function yj({children:e,location:t}){return rj(Eu(e),t)}function Eu(e,t=[]){let n=[];return m.Children.forEach(e,(r,s)=>{if(!m.isValidElement(r))return;let o=[...t,s];if(r.type===m.Fragment){n.push.apply(n,Eu(r.props.children,o));return}je(r.type===Ye,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),je(!r.props.index||!r.props.children,"An index route cannot have child routes.");let i={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(i.children=Eu(r.props.children,o)),n.push(i)}),n}var Zi="get",Ji="application/x-www-form-urlencoded";function ml(e){return e!=null&&typeof e.tagName=="string"}function vj(e){return ml(e)&&e.tagName.toLowerCase()==="button"}function wj(e){return ml(e)&&e.tagName.toLowerCase()==="form"}function Nj(e){return ml(e)&&e.tagName.toLowerCase()==="input"}function jj(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Sj(e,t){return e.button===0&&(!t||t==="_self")&&!jj(e)}function _u(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(s=>[n,s]):[[n,r]])},[]))}function bj(e,t){let n=_u(e);return t&&t.forEach((r,s)=>{n.has(s)||t.getAll(s).forEach(o=>{n.append(s,o)})}),n}var Si=null;function kj(){if(Si===null)try{new FormData(document.createElement("form"),0),Si=!1}catch{Si=!0}return Si}var Cj=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function fc(e){return e!=null&&!Cj.has(e)?(kt(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ji}"`),null):e}function Ej(e,t){let n,r,s,o,i;if(wj(e)){let l=e.getAttribute("action");r=l?Kn(l,t):null,n=e.getAttribute("method")||Zi,s=fc(e.getAttribute("enctype"))||Ji,o=new FormData(e)}else if(vj(e)||Nj(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let c=e.getAttribute("formaction")||l.getAttribute("action");if(r=c?Kn(c,t):null,n=e.getAttribute("formmethod")||l.getAttribute("method")||Zi,s=fc(e.getAttribute("formenctype"))||fc(l.getAttribute("enctype"))||Ji,o=new FormData(l,e),!kj()){let{name:u,type:h,value:d}=e;if(h==="image"){let f=u?`${u}.`:"";o.append(`${f}x`,"0"),o.append(`${f}y`,"0")}else u&&o.append(u,d)}}else{if(ml(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Zi,r=null,s=Ji,i=e}return o&&s==="text/plain"&&(i=o,o=void 0),{action:r,method:n.toLowerCase(),encType:s,formData:o,body:i}}function Yd(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}async function _j(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Pj(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function Mj(e,t,n){let r=await Promise.all(e.map(async s=>{let o=t.routes[s.route.id];if(o){let i=await _j(o,n);return i.links?i.links():[]}return[]}));return Lj(r.flat(1).filter(Pj).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function Zh(e,t,n,r,s,o){let i=(c,u)=>n[u]?c.route.id!==n[u].route.id:!0,l=(c,u)=>{var h;return n[u].pathname!==c.pathname||((h=n[u].route.path)==null?void 0:h.endsWith("*"))&&n[u].params["*"]!==c.params["*"]};return o==="assets"?t.filter((c,u)=>i(c,u)||l(c,u)):o==="data"?t.filter((c,u)=>{var d;let h=r.routes[c.route.id];if(!h||!h.hasLoader)return!1;if(i(c,u)||l(c,u))return!0;if(c.route.shouldRevalidate){let f=c.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:((d=n[0])==null?void 0:d.params)||{},nextUrl:new URL(e,window.origin),nextParams:c.params,defaultShouldRevalidate:!0});if(typeof f=="boolean")return f}return!0}):[]}function Ij(e,t){return Rj(e.map(n=>{let r=t.routes[n.route.id];if(!r)return[];let s=[r.module];return r.imports&&(s=s.concat(r.imports)),s}).flat(1))}function Rj(e){return[...new Set(e)]}function Tj(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Lj(e,t){let n=new Set;return new Set(t),e.reduce((r,s)=>{let o=JSON.stringify(Tj(s));return n.has(o)||(n.add(o),r.push({key:o,link:s})),r},[])}function Aj(e){let t=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return t.pathname==="/"?t.pathname="_root.data":t.pathname=`${t.pathname.replace(/\/$/,"")}.data`,t}function zj(){let e=m.useContext(Ps);return Yd(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Dj(){let e=m.useContext(fl);return Yd(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Xd=m.createContext(void 0);Xd.displayName="FrameworkContext";function $x(){let e=m.useContext(Xd);return Yd(e,"You must render this element inside a <HydratedRouter> element"),e}function $j(e,t){let n=m.useContext(Xd),[r,s]=m.useState(!1),[o,i]=m.useState(!1),{onFocus:l,onBlur:c,onMouseEnter:u,onMouseLeave:h,onTouchStart:d}=t,f=m.useRef(null);m.useEffect(()=>{if(e==="render"&&i(!0),e==="viewport"){let w=p=>{p.forEach(v=>{i(v.isIntersecting)})},N=new IntersectionObserver(w,{threshold:.5});return f.current&&N.observe(f.current),()=>{N.disconnect()}}},[e]),m.useEffect(()=>{if(r){let w=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(w)}}},[r]);let g=()=>{s(!0)},x=()=>{s(!1),i(!1)};return n?e!=="intent"?[o,f,{}]:[o,f,{onFocus:Ws(l,g),onBlur:Ws(c,x),onMouseEnter:Ws(u,g),onMouseLeave:Ws(h,x),onTouchStart:Ws(d,g)}]:[!1,f,{}]}function Ws(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Oj({page:e,...t}){let{router:n}=zj(),r=m.useMemo(()=>Px(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?m.createElement(Hj,{page:e,matches:r,...t}):null}function Fj(e){let{manifest:t,routeModules:n}=$x(),[r,s]=m.useState([]);return m.useEffect(()=>{let o=!1;return Mj(e,t,n).then(i=>{o||s(i)}),()=>{o=!0}},[e,t,n]),r}function Hj({page:e,matches:t,...n}){let r=tn(),{manifest:s,routeModules:o}=$x(),{loaderData:i,matches:l}=Dj(),c=m.useMemo(()=>Zh(e,t,l,s,r,"data"),[e,t,l,s,r]),u=m.useMemo(()=>Zh(e,t,l,s,r,"assets"),[e,t,l,s,r]),h=m.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let g=new Set,x=!1;if(t.forEach(N=>{var v;let p=s.routes[N.route.id];!p||!p.hasLoader||(!c.some(y=>y.route.id===N.route.id)&&N.route.id in i&&((v=o[N.route.id])!=null&&v.shouldRevalidate)||p.hasClientLoader?x=!0:g.add(N.route.id))}),g.size===0)return[];let w=Aj(e);return x&&g.size>0&&w.searchParams.set("_routes",t.filter(N=>g.has(N.route.id)).map(N=>N.route.id).join(",")),[w.pathname+w.search]},[i,r,s,c,t,e,o]),d=m.useMemo(()=>Ij(u,s),[u,s]),f=Fj(u);return m.createElement(m.Fragment,null,h.map(g=>m.createElement("link",{key:g,rel:"prefetch",as:"fetch",href:g,...n})),d.map(g=>m.createElement("link",{key:g,rel:"modulepreload",href:g,...n})),f.map(({key:g,link:x})=>m.createElement("link",{key:g,...x})))}function Bj(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var Ox=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Ox&&(window.__reactRouterVersion="7.1.0")}catch{}function Vj({basename:e,children:t,window:n}){let r=m.useRef();r.current==null&&(r.current=C2({window:n,v5Compat:!0}));let s=r.current,[o,i]=m.useState({action:s.action,location:s.location}),l=m.useCallback(c=>{m.startTransition(()=>i(c))},[i]);return m.useLayoutEffect(()=>s.listen(l),[s,l]),m.createElement(xj,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:s})}var Fx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Gn=m.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:s,reloadDocument:o,replace:i,state:l,target:c,to:u,preventScrollReset:h,viewTransition:d,...f},g){let{basename:x}=m.useContext(Ft),w=typeof u=="string"&&Fx.test(u),N,p=!1;if(typeof u=="string"&&w&&(N=u,Ox))try{let I=new URL(window.location.href),$=u.startsWith("//")?new URL(I.protocol+u):new URL(u),R=Kn($.pathname,x);$.origin===I.origin&&R!=null?u=R+$.search+$.hash:p=!0}catch{kt(!1,`<Link to="${u}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let v=Z2(u,{relative:s}),[y,j,S]=$j(r,f),C=Kj(u,{replace:i,state:l,target:c,preventScrollReset:h,relative:s,viewTransition:d});function b(I){t&&t(I),I.defaultPrevented||C(I)}let P=m.createElement("a",{...f,...S,href:N||v,onClick:p||o?t:b,ref:Bj(g,j),target:c,"data-discover":!w&&n==="render"?"true":void 0});return y&&!w?m.createElement(m.Fragment,null,P,m.createElement(Oj,{page:v})):P});Gn.displayName="Link";var Hx=m.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:s=!1,style:o,to:i,viewTransition:l,children:c,...u},h){let d=Qo(i,{relative:u.relative}),f=tn(),g=m.useContext(fl),{navigator:x,basename:w}=m.useContext(Ft),N=g!=null&&Zj(d)&&l===!0,p=x.encodeLocation?x.encodeLocation(d).pathname:d.pathname,v=f.pathname,y=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;n||(v=v.toLowerCase(),y=y?y.toLowerCase():null,p=p.toLowerCase()),y&&w&&(y=Kn(y,w)||y);const j=p!=="/"&&p.endsWith("/")?p.length-1:p.length;let S=v===p||!s&&v.startsWith(p)&&v.charAt(j)==="/",C=y!=null&&(y===p||!s&&y.startsWith(p)&&y.charAt(p.length)==="/"),b={isActive:S,isPending:C,isTransitioning:N},P=S?t:void 0,I;typeof r=="function"?I=r(b):I=[r,S?"active":null,C?"pending":null,N?"transitioning":null].filter(Boolean).join(" ");let $=typeof o=="function"?o(b):o;return m.createElement(Gn,{...u,"aria-current":P,className:I,ref:h,style:$,to:i,viewTransition:l},typeof c=="function"?c(b):c)});Hx.displayName="NavLink";var Uj=m.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:s,state:o,method:i=Zi,action:l,onSubmit:c,relative:u,preventScrollReset:h,viewTransition:d,...f},g)=>{let x=Qj(),w=qj(l,{relative:u}),N=i.toLowerCase()==="get"?"get":"post",p=typeof l=="string"&&Fx.test(l),v=y=>{if(c&&c(y),y.defaultPrevented)return;y.preventDefault();let j=y.nativeEvent.submitter,S=(j==null?void 0:j.getAttribute("formmethod"))||i;x(j||y.currentTarget,{fetcherKey:t,method:S,navigate:n,replace:s,state:o,relative:u,preventScrollReset:h,viewTransition:d})};return m.createElement("form",{ref:g,method:N,action:w,onSubmit:r?c:v,...f,"data-discover":!p&&e==="render"?"true":void 0})});Uj.displayName="Form";function Wj(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Bx(e){let t=m.useContext(Ps);return je(t,Wj(e)),t}function Kj(e,{target:t,replace:n,state:r,preventScrollReset:s,relative:o,viewTransition:i}={}){let l=hl(),c=tn(),u=Qo(e,{relative:o});return m.useCallback(h=>{if(Sj(h,t)){h.preventDefault();let d=n!==void 0?n:To(c)===To(u);l(e,{replace:d,state:r,preventScrollReset:s,relative:o,viewTransition:i})}},[c,l,u,n,r,t,e,s,o,i])}function Gj(e){kt(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=m.useRef(_u(e)),n=m.useRef(!1),r=tn(),s=m.useMemo(()=>bj(r.search,n.current?null:t.current),[r.search]),o=hl(),i=m.useCallback((l,c)=>{const u=_u(typeof l=="function"?l(s):l);n.current=!0,o("?"+u,c)},[o,s]);return[s,i]}var Yj=0,Xj=()=>`__${String(++Yj)}__`;function Qj(){let{router:e}=Bx("useSubmit"),{basename:t}=m.useContext(Ft),n=fj();return m.useCallback(async(r,s={})=>{let{action:o,method:i,encType:l,formData:c,body:u}=Ej(r,t);if(s.navigate===!1){let h=s.fetcherKey||Xj();await e.fetch(h,n,s.action||o,{preventScrollReset:s.preventScrollReset,formData:c,body:u,formMethod:s.method||i,formEncType:s.encType||l,flushSync:s.flushSync})}else await e.navigate(s.action||o,{preventScrollReset:s.preventScrollReset,formData:c,body:u,formMethod:s.method||i,formEncType:s.encType||l,replace:s.replace,state:s.state,fromRouteId:n,flushSync:s.flushSync,viewTransition:s.viewTransition})},[e,t,n])}function qj(e,{relative:t}={}){let{basename:n}=m.useContext(Ft),r=m.useContext(Et);je(r,"useFormAction must be used inside a RouteContext");let[s]=r.matches.slice(-1),o={...Qo(e||".",{relative:t})},i=tn();if(e==null){o.search=i.search;let l=new URLSearchParams(o.search),c=l.getAll("index");if(c.some(h=>h==="")){l.delete("index"),c.filter(d=>d).forEach(d=>l.append("index",d));let h=l.toString();o.search=h?`?${h}`:""}}return(!e||e===".")&&s.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:hn([n,o.pathname])),To(o)}function Zj(e,t={}){let n=m.useContext(Tx);je(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Bx("useViewTransitionState"),s=Qo(e,{relative:t.relative});if(!n.isTransitioning)return!1;let o=Kn(n.currentLocation.pathname,r)||n.currentLocation.pathname,i=Kn(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Ra(s.pathname,i)!=null||Ra(s.pathname,o)!=null}new TextEncoder;const Vx=m.createContext(null);function Jj({children:e}){const[t,n]=m.useState(()=>localStorage.getItem("opentrust_theme")||"dark"),r=s=>{n(s),localStorage.setItem("opentrust_theme",s)};return m.useEffect(()=>{const s=document.documentElement;if(s.classList.remove("light","dark"),t==="system"){const o=window.matchMedia("(prefers-color-scheme: dark)").matches;s.classList.add(o?"dark":"light")}else s.classList.add(t)},[t]),a.jsx(Vx.Provider,{value:{theme:t,setTheme:r},children:e})}function eS(){const e=m.useContext(Vx);if(!e)throw new Error("useTheme must be within ThemeProvider");return e}const Ux=m.createContext(null);function tS({children:e}){const[t,n]=m.useState(()=>{const l=localStorage.getItem("opentrust_user");return l?JSON.parse(l):null}),[r,s]=m.useState(!!localStorage.getItem("opentrust_user"));m.useEffect(()=>{if(!t){s(!1);return}let l=!1;return(async()=>{try{(await fetch("/api/auth/me",{headers:{Authorization:`Bearer ${t.apiKey}`}})).ok||l||(n(null),localStorage.removeItem("opentrust_user"))}catch{}finally{l||s(!1)}})(),()=>{l=!0}},[]);const o=m.useCallback(async(l,c)=>{const u=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:l,password:c})}),h=await u.json();if(!u.ok||!h.success)throw new Error(h.error??"Login failed");const d={email:h.email,apiKey:h.apiKey,name:h.name};n(d),localStorage.setItem("opentrust_user",JSON.stringify(d))},[]),i=m.useCallback(()=>{n(null),localStorage.removeItem("opentrust_user")},[]);return a.jsx(Ux.Provider,{value:{user:t,isAuthenticated:!!t,isLoading:r,login:o,logout:i},children:e})}function Qd(){const e=m.useContext(Ux);if(!e)throw new Error("useAuth must be within AuthProvider");return e}function Wx(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=Wx(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function nS(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=Wx(e))&&(r&&(r+=" "),r+=t);return r}const qd="-";function rS(e){const t=oS(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function s(i){const l=i.split(qd);return l[0]===""&&l.length!==1&&l.shift(),Kx(l,t)||sS(i)}function o(i,l){const c=n[i]||[];return l&&r[i]?[...c,...r[i]]:c}return{getClassGroupId:s,getConflictingClassGroupIds:o}}function Kx(e,t){var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?Kx(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const o=e.join(qd);return(i=t.validators.find(({validator:l})=>l(o)))==null?void 0:i.classGroupId}const Jh=/^\[(.+)\]$/;function sS(e){if(Jh.test(e)){const t=Jh.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function oS(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return aS(Object.entries(e.classGroups),n).forEach(([o,i])=>{Pu(i,r,o,t)}),r}function Pu(e,t,n,r){e.forEach(s=>{if(typeof s=="string"){const o=s===""?t:em(t,s);o.classGroupId=n;return}if(typeof s=="function"){if(iS(s)){Pu(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([o,i])=>{Pu(i,em(t,o),n,r)})})}function em(e,t){let n=e;return t.split(qd).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function iS(e){return e.isThemeGetter}function aS(e,t){return t?e.map(([n,r])=>{const s=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([i,l])=>[t+i,l])):o);return[n,s]}):e}function lS(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;function s(o,i){n.set(o,i),t++,t>e&&(t=0,r=n,n=new Map)}return{get(o){let i=n.get(o);if(i!==void 0)return i;if((i=r.get(o))!==void 0)return s(o,i),i},set(o,i){n.has(o)?n.set(o,i):s(o,i)}}}const Gx="!";function cS(e){const t=e.separator,n=t.length===1,r=t[0],s=t.length;return function(i){const l=[];let c=0,u=0,h;for(let w=0;w<i.length;w++){let N=i[w];if(c===0){if(N===r&&(n||i.slice(w,w+s)===t)){l.push(i.slice(u,w)),u=w+s;continue}if(N==="/"){h=w;continue}}N==="["?c++:N==="]"&&c--}const d=l.length===0?i:i.substring(u),f=d.startsWith(Gx),g=f?d.substring(1):d,x=h&&h>u?h-u:void 0;return{modifiers:l,hasImportantModifier:f,baseClassName:g,maybePostfixModifierPosition:x}}}function uS(e){if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t}function dS(e){return{cache:lS(e.cacheSize),splitModifiers:cS(e),...rS(e)}}const fS=/\s+/;function hS(e,t){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,o=new Set;return e.trim().split(fS).map(i=>{const{modifiers:l,hasImportantModifier:c,baseClassName:u,maybePostfixModifierPosition:h}=n(i);let d=r(h?u.substring(0,h):u),f=!!h;if(!d){if(!h)return{isTailwindClass:!1,originalClassName:i};if(d=r(u),!d)return{isTailwindClass:!1,originalClassName:i};f=!1}const g=uS(l).join(":");return{isTailwindClass:!0,modifierId:c?g+Gx:g,classGroupId:d,originalClassName:i,hasPostfixModifier:f}}).reverse().filter(i=>{if(!i.isTailwindClass)return!0;const{modifierId:l,classGroupId:c,hasPostfixModifier:u}=i,h=l+c;return o.has(h)?!1:(o.add(h),s(c,u).forEach(d=>o.add(l+d)),!0)}).reverse().map(i=>i.originalClassName).join(" ")}function mS(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Yx(t))&&(r&&(r+=" "),r+=n);return r}function Yx(e){if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Yx(e[r]))&&(n&&(n+=" "),n+=t);return n}function pS(e,...t){let n,r,s,o=i;function i(c){const u=t.reduce((h,d)=>d(h),e());return n=dS(u),r=n.cache.get,s=n.cache.set,o=l,l(c)}function l(c){const u=r(c);if(u)return u;const h=hS(c,n);return s(c,h),h}return function(){return o(mS.apply(null,arguments))}}function xe(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const Xx=/^\[(?:([a-z-]+):)?(.+)\]$/i,gS=/^\d+\/\d+$/,xS=new Set(["px","full","screen"]),yS=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,vS=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,wS=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,NS=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,jS=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function sn(e){return ur(e)||xS.has(e)||gS.test(e)}function Sn(e){return Is(e,"length",MS)}function ur(e){return!!e&&!Number.isNaN(Number(e))}function bi(e){return Is(e,"number",ur)}function Ks(e){return!!e&&Number.isInteger(Number(e))}function SS(e){return e.endsWith("%")&&ur(e.slice(0,-1))}function re(e){return Xx.test(e)}function bn(e){return yS.test(e)}const bS=new Set(["length","size","percentage"]);function kS(e){return Is(e,bS,Qx)}function CS(e){return Is(e,"position",Qx)}const ES=new Set(["image","url"]);function _S(e){return Is(e,ES,RS)}function PS(e){return Is(e,"",IS)}function Gs(){return!0}function Is(e,t,n){const r=Xx.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function MS(e){return vS.test(e)&&!wS.test(e)}function Qx(){return!1}function IS(e){return NS.test(e)}function RS(e){return jS.test(e)}function TS(){const e=xe("colors"),t=xe("spacing"),n=xe("blur"),r=xe("brightness"),s=xe("borderColor"),o=xe("borderRadius"),i=xe("borderSpacing"),l=xe("borderWidth"),c=xe("contrast"),u=xe("grayscale"),h=xe("hueRotate"),d=xe("invert"),f=xe("gap"),g=xe("gradientColorStops"),x=xe("gradientColorStopPositions"),w=xe("inset"),N=xe("margin"),p=xe("opacity"),v=xe("padding"),y=xe("saturate"),j=xe("scale"),S=xe("sepia"),C=xe("skew"),b=xe("space"),P=xe("translate"),I=()=>["auto","contain","none"],$=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto",re,t],T=()=>[re,t],D=()=>["",sn,Sn],E=()=>["auto",ur,re],L=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],k=()=>["solid","dashed","dotted","double","none"],z=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],_=()=>["start","end","center","between","around","evenly","stretch"],M=()=>["","0",re],A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],F=()=>[ur,bi],O=()=>[ur,re];return{cacheSize:500,separator:":",theme:{colors:[Gs],spacing:[sn,Sn],blur:["none","",bn,re],brightness:F(),borderColor:[e],borderRadius:["none","","full",bn,re],borderSpacing:T(),borderWidth:D(),contrast:F(),grayscale:M(),hueRotate:O(),invert:M(),gap:T(),gradientColorStops:[e],gradientColorStopPositions:[SS,Sn],inset:R(),margin:R(),opacity:F(),padding:T(),saturate:F(),scale:F(),sepia:M(),skew:O(),space:T(),translate:T()},classGroups:{aspect:[{aspect:["auto","square","video",re]}],container:["container"],columns:[{columns:[bn]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...L(),re]}],overflow:[{overflow:$()}],"overflow-x":[{"overflow-x":$()}],"overflow-y":[{"overflow-y":$()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[w]}],"inset-x":[{"inset-x":[w]}],"inset-y":[{"inset-y":[w]}],start:[{start:[w]}],end:[{end:[w]}],top:[{top:[w]}],right:[{right:[w]}],bottom:[{bottom:[w]}],left:[{left:[w]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ks,re]}],basis:[{basis:R()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",re]}],grow:[{grow:M()}],shrink:[{shrink:M()}],order:[{order:["first","last","none",Ks,re]}],"grid-cols":[{"grid-cols":[Gs]}],"col-start-end":[{col:["auto",{span:["full",Ks,re]},re]}],"col-start":[{"col-start":E()}],"col-end":[{"col-end":E()}],"grid-rows":[{"grid-rows":[Gs]}],"row-start-end":[{row:["auto",{span:[Ks,re]},re]}],"row-start":[{"row-start":E()}],"row-end":[{"row-end":E()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",re]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",re]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",..._()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",..._(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[..._(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[N]}],mx:[{mx:[N]}],my:[{my:[N]}],ms:[{ms:[N]}],me:[{me:[N]}],mt:[{mt:[N]}],mr:[{mr:[N]}],mb:[{mb:[N]}],ml:[{ml:[N]}],"space-x":[{"space-x":[b]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[b]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",re,t]}],"min-w":[{"min-w":[re,t,"min","max","fit"]}],"max-w":[{"max-w":[re,t,"none","full","min","max","fit","prose",{screen:[bn]},bn]}],h:[{h:[re,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[re,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[re,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[re,t,"auto","min","max","fit"]}],"font-size":[{text:["base",bn,Sn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",bi]}],"font-family":[{font:[Gs]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",re]}],"line-clamp":[{"line-clamp":["none",ur,bi]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",sn,re]}],"list-image":[{"list-image":["none",re]}],"list-style-type":[{list:["none","disc","decimal",re]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[p]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[p]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...k(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",sn,Sn]}],"underline-offset":[{"underline-offset":["auto",sn,re]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",re]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",re]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[p]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...L(),CS]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",kS]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},_S]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[x]}],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[p]}],"border-style":[{border:[...k(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[p]}],"divide-style":[{divide:k()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...k()]}],"outline-offset":[{"outline-offset":[sn,re]}],"outline-w":[{outline:[sn,Sn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:D()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[p]}],"ring-offset-w":[{"ring-offset":[sn,Sn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",bn,PS]}],"shadow-color":[{shadow:[Gs]}],opacity:[{opacity:[p]}],"mix-blend":[{"mix-blend":[...z(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":z()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",bn,re]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[d]}],saturate:[{saturate:[y]}],sepia:[{sepia:[S]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[p]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[S]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",re]}],duration:[{duration:O()}],ease:[{ease:["linear","in","out","in-out",re]}],delay:[{delay:O()}],animate:[{animate:["none","spin","ping","pulse","bounce",re]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[j]}],"scale-x":[{"scale-x":[j]}],"scale-y":[{"scale-y":[j]}],rotate:[{rotate:[Ks,re]}],"translate-x":[{"translate-x":[P]}],"translate-y":[{"translate-y":[P]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",re]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",re]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",re]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[sn,Sn,bi]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const LS=pS(TS);function Te(...e){return LS(nS(e))}/**
|
|
52
|
-
* @license lucide-react v0.400.0 - ISC
|
|
53
|
-
*
|
|
54
|
-
* This source code is licensed under the ISC license.
|
|
55
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
56
|
-
*/const AS=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),qx=(...e)=>e.filter((t,n,r)=>!!t&&r.indexOf(t)===n).join(" ");/**
|
|
57
|
-
* @license lucide-react v0.400.0 - ISC
|
|
58
|
-
*
|
|
59
|
-
* This source code is licensed under the ISC license.
|
|
60
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
61
|
-
*/var zS={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
62
|
-
* @license lucide-react v0.400.0 - ISC
|
|
63
|
-
*
|
|
64
|
-
* This source code is licensed under the ISC license.
|
|
65
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
66
|
-
*/const DS=m.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:o,iconNode:i,...l},c)=>m.createElement("svg",{ref:c,...zS,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:qx("lucide",s),...l},[...i.map(([u,h])=>m.createElement(u,h)),...Array.isArray(o)?o:[o]]));/**
|
|
67
|
-
* @license lucide-react v0.400.0 - ISC
|
|
68
|
-
*
|
|
69
|
-
* This source code is licensed under the ISC license.
|
|
70
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
71
|
-
*/const q=(e,t)=>{const n=m.forwardRef(({className:r,...s},o)=>m.createElement(DS,{ref:o,iconNode:t,className:qx(`lucide-${AS(e)}`,r),...s}));return n.displayName=`${e}`,n};/**
|
|
72
|
-
* @license lucide-react v0.400.0 - ISC
|
|
73
|
-
*
|
|
74
|
-
* This source code is licensed under the ISC license.
|
|
75
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
76
|
-
*/const $S=q("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
|
|
77
|
-
* @license lucide-react v0.400.0 - ISC
|
|
78
|
-
*
|
|
79
|
-
* This source code is licensed under the ISC license.
|
|
80
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
81
|
-
*/const OS=q("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
|
|
82
|
-
* @license lucide-react v0.400.0 - ISC
|
|
83
|
-
*
|
|
84
|
-
* This source code is licensed under the ISC license.
|
|
85
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
86
|
-
*/const FS=q("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
|
|
87
|
-
* @license lucide-react v0.400.0 - ISC
|
|
88
|
-
*
|
|
89
|
-
* This source code is licensed under the ISC license.
|
|
90
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
91
|
-
*/const HS=q("ArrowUpDown",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);/**
|
|
92
|
-
* @license lucide-react v0.400.0 - ISC
|
|
93
|
-
*
|
|
94
|
-
* This source code is licensed under the ISC license.
|
|
95
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
96
|
-
*/const Pr=q("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
|
|
97
|
-
* @license lucide-react v0.400.0 - ISC
|
|
98
|
-
*
|
|
99
|
-
* This source code is licensed under the ISC license.
|
|
100
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
101
|
-
*/const pl=q("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
102
|
-
* @license lucide-react v0.400.0 - ISC
|
|
103
|
-
*
|
|
104
|
-
* This source code is licensed under the ISC license.
|
|
105
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
106
|
-
*/const Zd=q("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
107
|
-
* @license lucide-react v0.400.0 - ISC
|
|
108
|
-
*
|
|
109
|
-
* This source code is licensed under the ISC license.
|
|
110
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
111
|
-
*/const BS=q("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
112
|
-
* @license lucide-react v0.400.0 - ISC
|
|
113
|
-
*
|
|
114
|
-
* This source code is licensed under the ISC license.
|
|
115
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
116
|
-
*/const Jd=q("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
|
|
117
|
-
* @license lucide-react v0.400.0 - ISC
|
|
118
|
-
*
|
|
119
|
-
* This source code is licensed under the ISC license.
|
|
120
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
121
|
-
*/const gl=q("CircleArrowUp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]]);/**
|
|
122
|
-
* @license lucide-react v0.400.0 - ISC
|
|
123
|
-
*
|
|
124
|
-
* This source code is licensed under the ISC license.
|
|
125
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
126
|
-
*/const Yn=q("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
127
|
-
* @license lucide-react v0.400.0 - ISC
|
|
128
|
-
*
|
|
129
|
-
* This source code is licensed under the ISC license.
|
|
130
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
131
|
-
*/const pt=q("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
|
132
|
-
* @license lucide-react v0.400.0 - ISC
|
|
133
|
-
*
|
|
134
|
-
* This source code is licensed under the ISC license.
|
|
135
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
136
|
-
*/const VS=q("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
137
|
-
* @license lucide-react v0.400.0 - ISC
|
|
138
|
-
*
|
|
139
|
-
* This source code is licensed under the ISC license.
|
|
140
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
141
|
-
*/const US=q("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
142
|
-
* @license lucide-react v0.400.0 - ISC
|
|
143
|
-
*
|
|
144
|
-
* This source code is licensed under the ISC license.
|
|
145
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
146
|
-
*/const WS=q("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
|
|
147
|
-
* @license lucide-react v0.400.0 - ISC
|
|
148
|
-
*
|
|
149
|
-
* This source code is licensed under the ISC license.
|
|
150
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
151
|
-
*/const KS=q("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
|
|
152
|
-
* @license lucide-react v0.400.0 - ISC
|
|
153
|
-
*
|
|
154
|
-
* This source code is licensed under the ISC license.
|
|
155
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
156
|
-
*/const Ct=q("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
|
|
157
|
-
* @license lucide-react v0.400.0 - ISC
|
|
158
|
-
*
|
|
159
|
-
* This source code is licensed under the ISC license.
|
|
160
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
161
|
-
*/const GS=q("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
|
|
162
|
-
* @license lucide-react v0.400.0 - ISC
|
|
163
|
-
*
|
|
164
|
-
* This source code is licensed under the ISC license.
|
|
165
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
166
|
-
*/const YS=q("EyeOff",[["path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24",key:"1jxqfv"}],["path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68",key:"9wicm4"}],["path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61",key:"1jreej"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]);/**
|
|
167
|
-
* @license lucide-react v0.400.0 - ISC
|
|
168
|
-
*
|
|
169
|
-
* This source code is licensed under the ISC license.
|
|
170
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
171
|
-
*/const XS=q("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
172
|
-
* @license lucide-react v0.400.0 - ISC
|
|
173
|
-
*
|
|
174
|
-
* This source code is licensed under the ISC license.
|
|
175
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
176
|
-
*/const Rs=q("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
|
|
177
|
-
* @license lucide-react v0.400.0 - ISC
|
|
178
|
-
*
|
|
179
|
-
* This source code is licensed under the ISC license.
|
|
180
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
181
|
-
*/const Zx=q("Fingerprint",[["path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4",key:"1nerag"}],["path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88",key:"o46ks0"}],["path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02",key:"ptglia"}],["path",{d:"M2 12a10 10 0 0 1 18-6",key:"ydlgp0"}],["path",{d:"M2 16h.01",key:"1gqxmh"}],["path",{d:"M21.8 16c.2-2 .131-5.354 0-6",key:"drycrb"}],["path",{d:"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2",key:"1tidbn"}],["path",{d:"M8.65 22c.21-.66.45-1.32.57-2",key:"13wd9y"}],["path",{d:"M9 6.8a6 6 0 0 1 9 5.2v2",key:"1fr1j5"}]]);/**
|
|
182
|
-
* @license lucide-react v0.400.0 - ISC
|
|
183
|
-
*
|
|
184
|
-
* This source code is licensed under the ISC license.
|
|
185
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
186
|
-
*/const Jx=q("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
|
|
187
|
-
* @license lucide-react v0.400.0 - ISC
|
|
188
|
-
*
|
|
189
|
-
* This source code is licensed under the ISC license.
|
|
190
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
191
|
-
*/const QS=q("KeyRound",[["path",{d:"M2 18v3c0 .6.4 1 1 1h4v-3h3v-3h2l1.4-1.4a6.5 6.5 0 1 0-4-4Z",key:"167ctg"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
|
|
192
|
-
* @license lucide-react v0.400.0 - ISC
|
|
193
|
-
*
|
|
194
|
-
* This source code is licensed under the ISC license.
|
|
195
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
196
|
-
*/const qS=q("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);/**
|
|
197
|
-
* @license lucide-react v0.400.0 - ISC
|
|
198
|
-
*
|
|
199
|
-
* This source code is licensed under the ISC license.
|
|
200
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
201
|
-
*/const $e=q("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
202
|
-
* @license lucide-react v0.400.0 - ISC
|
|
203
|
-
*
|
|
204
|
-
* This source code is licensed under the ISC license.
|
|
205
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
206
|
-
*/const ZS=q("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
|
|
207
|
-
* @license lucide-react v0.400.0 - ISC
|
|
208
|
-
*
|
|
209
|
-
* This source code is licensed under the ISC license.
|
|
210
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
211
|
-
*/const JS=q("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
|
|
212
|
-
* @license lucide-react v0.400.0 - ISC
|
|
213
|
-
*
|
|
214
|
-
* This source code is licensed under the ISC license.
|
|
215
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
216
|
-
*/const xl=q("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
|
|
217
|
-
* @license lucide-react v0.400.0 - ISC
|
|
218
|
-
*
|
|
219
|
-
* This source code is licensed under the ISC license.
|
|
220
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
221
|
-
*/const eb=q("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
222
|
-
* @license lucide-react v0.400.0 - ISC
|
|
223
|
-
*
|
|
224
|
-
* This source code is licensed under the ISC license.
|
|
225
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
226
|
-
*/const tb=q("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);/**
|
|
227
|
-
* @license lucide-react v0.400.0 - ISC
|
|
228
|
-
*
|
|
229
|
-
* This source code is licensed under the ISC license.
|
|
230
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
231
|
-
*/const Nr=q("Package",[["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/**
|
|
232
|
-
* @license lucide-react v0.400.0 - ISC
|
|
233
|
-
*
|
|
234
|
-
* This source code is licensed under the ISC license.
|
|
235
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
236
|
-
*/const nb=q("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/**
|
|
237
|
-
* @license lucide-react v0.400.0 - ISC
|
|
238
|
-
*
|
|
239
|
-
* This source code is licensed under the ISC license.
|
|
240
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
241
|
-
*/const Ta=q("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
242
|
-
* @license lucide-react v0.400.0 - ISC
|
|
243
|
-
*
|
|
244
|
-
* This source code is licensed under the ISC license.
|
|
245
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
246
|
-
*/const rb=q("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
247
|
-
* @license lucide-react v0.400.0 - ISC
|
|
248
|
-
*
|
|
249
|
-
* This source code is licensed under the ISC license.
|
|
250
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
251
|
-
*/const ea=q("Puzzle",[["path",{d:"M19.439 7.85c-.049.322.059.648.289.878l1.568 1.568c.47.47.706 1.087.706 1.704s-.235 1.233-.706 1.704l-1.611 1.611a.98.98 0 0 1-.837.276c-.47-.07-.802-.48-.968-.925a2.501 2.501 0 1 0-3.214 3.214c.446.166.855.497.925.968a.979.979 0 0 1-.276.837l-1.61 1.61a2.404 2.404 0 0 1-1.705.707 2.402 2.402 0 0 1-1.704-.706l-1.568-1.568a1.026 1.026 0 0 0-.877-.29c-.493.074-.84.504-1.02.968a2.5 2.5 0 1 1-3.237-3.237c.464-.18.894-.527.967-1.02a1.026 1.026 0 0 0-.289-.877l-1.568-1.568A2.402 2.402 0 0 1 1.998 12c0-.617.236-1.234.706-1.704L4.23 8.77c.24-.24.581-.353.917-.303.515.077.877.528 1.073 1.01a2.5 2.5 0 1 0 3.259-3.259c-.482-.196-.933-.558-1.01-1.073-.05-.336.062-.676.303-.917l1.525-1.525A2.402 2.402 0 0 1 12 1.998c.617 0 1.234.236 1.704.706l1.568 1.568c.23.23.556.338.877.29.493-.074.84-.504 1.02-.968a2.5 2.5 0 1 1 3.237 3.237c-.464.18-.894.527-.967 1.02Z",key:"i0oyt7"}]]);/**
|
|
252
|
-
* @license lucide-react v0.400.0 - ISC
|
|
253
|
-
*
|
|
254
|
-
* This source code is licensed under the ISC license.
|
|
255
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
256
|
-
*/const Xn=q("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
|
|
257
|
-
* @license lucide-react v0.400.0 - ISC
|
|
258
|
-
*
|
|
259
|
-
* This source code is licensed under the ISC license.
|
|
260
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
261
|
-
*/const La=q("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
|
|
262
|
-
* @license lucide-react v0.400.0 - ISC
|
|
263
|
-
*
|
|
264
|
-
* This source code is licensed under the ISC license.
|
|
265
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
266
|
-
*/const ef=q("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
|
|
267
|
-
* @license lucide-react v0.400.0 - ISC
|
|
268
|
-
*
|
|
269
|
-
* This source code is licensed under the ISC license.
|
|
270
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
271
|
-
*/const sb=q("ScrollText",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]);/**
|
|
272
|
-
* @license lucide-react v0.400.0 - ISC
|
|
273
|
-
*
|
|
274
|
-
* This source code is licensed under the ISC license.
|
|
275
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
276
|
-
*/const ey=q("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
277
|
-
* @license lucide-react v0.400.0 - ISC
|
|
278
|
-
*
|
|
279
|
-
* This source code is licensed under the ISC license.
|
|
280
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
281
|
-
*/const tf=q("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/**
|
|
282
|
-
* @license lucide-react v0.400.0 - ISC
|
|
283
|
-
*
|
|
284
|
-
* This source code is licensed under the ISC license.
|
|
285
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
286
|
-
*/const Zt=q("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
287
|
-
* @license lucide-react v0.400.0 - ISC
|
|
288
|
-
*
|
|
289
|
-
* This source code is licensed under the ISC license.
|
|
290
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
291
|
-
*/const ty=q("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
|
|
292
|
-
* @license lucide-react v0.400.0 - ISC
|
|
293
|
-
*
|
|
294
|
-
* This source code is licensed under the ISC license.
|
|
295
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
296
|
-
*/const tm=q("SquareCheckBig",[["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}],["path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11",key:"1jnkn4"}]]);/**
|
|
297
|
-
* @license lucide-react v0.400.0 - ISC
|
|
298
|
-
*
|
|
299
|
-
* This source code is licensed under the ISC license.
|
|
300
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
301
|
-
*/const Lo=q("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
302
|
-
* @license lucide-react v0.400.0 - ISC
|
|
303
|
-
*
|
|
304
|
-
* This source code is licensed under the ISC license.
|
|
305
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
306
|
-
*/const ob=q("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
|
|
307
|
-
* @license lucide-react v0.400.0 - ISC
|
|
308
|
-
*
|
|
309
|
-
* This source code is licensed under the ISC license.
|
|
310
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
311
|
-
*/const ps=q("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
|
|
312
|
-
* @license lucide-react v0.400.0 - ISC
|
|
313
|
-
*
|
|
314
|
-
* This source code is licensed under the ISC license.
|
|
315
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
316
|
-
*/const Ot=q("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
|
317
|
-
* @license lucide-react v0.400.0 - ISC
|
|
318
|
-
*
|
|
319
|
-
* This source code is licensed under the ISC license.
|
|
320
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
321
|
-
*/const nf=q("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
322
|
-
* @license lucide-react v0.400.0 - ISC
|
|
323
|
-
*
|
|
324
|
-
* This source code is licensed under the ISC license.
|
|
325
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
326
|
-
*/const ny=q("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
|
|
327
|
-
* @license lucide-react v0.400.0 - ISC
|
|
328
|
-
*
|
|
329
|
-
* This source code is licensed under the ISC license.
|
|
330
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
331
|
-
*/const ry=q("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),ib=[{label:"Discovery",items:[{to:"/inventory/hosts",label:"Hosts",icon:xl},{to:"/inventory/agents",label:"Agents",icon:Pr},{to:"/inventory/identities",label:"Identities",icon:Zx},{to:"/inventory/permissions",label:"Permissions",icon:QS}]},{label:"Secure",items:[{to:"/secure/risk",label:"Risk",icon:nf},{to:"/secure/graph",label:"Graph",icon:tb}]},{label:"Operations",items:[{to:"/ops/skills",label:"Skills",icon:ny},{to:"/ops/plugins",label:"Plugins",icon:ea}]},{label:"System",items:[{to:"/system/logs",label:"Logs",icon:sb},{to:"/system/settings",label:"Settings",icon:Zt}]}];function ab(){const e=tn(),[t,n]=m.useState("");return m.useEffect(()=>{fetch("/health").then(r=>r.json()).then(r=>n(r.version??"")).catch(()=>{})},[]),a.jsxs("aside",{className:"flex w-56 flex-col border-r border-border bg-card",children:[a.jsxs("div",{className:"flex h-14 items-center gap-2 border-b border-border px-4",children:[a.jsx("img",{src:"/dashboard/logo-512.png",alt:"OpenTrust",className:"h-6 w-6 dark:brightness-[1.8] dark:contrast-125"}),a.jsx("span",{className:"text-sm font-semibold tracking-tight text-foreground",children:"OpenTrust"})]}),a.jsx("nav",{className:"flex-1 space-y-6 px-3 py-4",children:ib.map(r=>a.jsxs("div",{children:[a.jsx("p",{className:"mb-2 px-2 text-[11px] font-medium uppercase tracking-wider text-muted-foreground",children:r.label}),a.jsx("div",{className:"space-y-0.5",children:r.items.map(s=>a.jsxs(Hx,{to:s.to,className:Te("flex items-center gap-2.5 rounded-md px-2 py-1.5 text-sm transition-colors",e.pathname.startsWith(s.to)?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[a.jsx(s.icon,{className:"h-4 w-4 shrink-0"}),s.label]},s.to))})]},r.label))}),a.jsx("div",{className:"border-t border-border px-4 py-3",children:a.jsx("p",{className:"text-[11px] text-muted-foreground",children:t?`v${t}`:""})})]})}function lb(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function sy(...e){return t=>e.forEach(n=>lb(n,t))}function Jt(...e){return m.useCallback(sy(...e),e)}var gs=m.forwardRef((e,t)=>{const{children:n,...r}=e,s=m.Children.toArray(n),o=s.find(ub);if(o){const i=o.props.children,l=s.map(c=>c===o?m.Children.count(i)>1?m.Children.only(null):m.isValidElement(i)?i.props.children:null:c);return a.jsx(Mu,{...r,ref:t,children:m.isValidElement(i)?m.cloneElement(i,void 0,l):null})}return a.jsx(Mu,{...r,ref:t,children:n})});gs.displayName="Slot";var Mu=m.forwardRef((e,t)=>{const{children:n,...r}=e;if(m.isValidElement(n)){const s=fb(n);return m.cloneElement(n,{...db(r,n.props),ref:t?sy(t,s):s})}return m.Children.count(n)>1?m.Children.only(null):null});Mu.displayName="SlotClone";var cb=({children:e})=>a.jsx(a.Fragment,{children:e});function ub(e){return m.isValidElement(e)&&e.type===cb}function db(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...l)=>{o(...l),s(...l)}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function fb(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function oy(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=oy(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function hb(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=oy(e))&&(r&&(r+=" "),r+=t);return r}const nm=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,rm=hb,mb=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return rm(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:o}=t,i=Object.keys(s).map(u=>{const h=n==null?void 0:n[u],d=o==null?void 0:o[u];if(h===null)return null;const f=nm(h)||nm(d);return s[u][f]}),l=n&&Object.entries(n).reduce((u,h)=>{let[d,f]=h;return f===void 0||(u[d]=f),u},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,h)=>{let{class:d,className:f,...g}=h;return Object.entries(g).every(x=>{let[w,N]=x;return Array.isArray(N)?N.includes({...o,...l}[w]):{...o,...l}[w]===N})?[...u,d,f]:u},[]);return rm(e,i,c,n==null?void 0:n.class,n==null?void 0:n.className)},pb=mb("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-border bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),K=m.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...s},o)=>{const i=r?gs:"button";return a.jsx(i,{className:Te(pb({variant:t,size:n,className:e})),ref:o,...s})});K.displayName="Button";function gb(){const{user:e,logout:t}=Qd(),{theme:n,setTheme:r}=eS();return a.jsxs("header",{className:"flex h-14 items-center justify-between border-b border-border bg-card px-6",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"h-2 w-2 rounded-full bg-success"}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"Connected"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[(e==null?void 0:e.email)&&a.jsx("span",{className:"text-xs text-muted-foreground",children:e.email}),a.jsx(K,{variant:"ghost",size:"icon",onClick:()=>r(n==="dark"?"light":"dark"),className:"h-8 w-8",children:n==="dark"?a.jsx(ob,{className:"h-4 w-4"}):a.jsx(eb,{className:"h-4 w-4"})}),a.jsx(K,{variant:"ghost",size:"icon",onClick:t,className:"h-8 w-8",children:a.jsx(JS,{className:"h-4 w-4"})})]})]})}function xb(){return a.jsxs("div",{className:"flex h-screen overflow-hidden bg-background",children:[a.jsx(ab,{}),a.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[a.jsx(gb,{}),a.jsx("main",{className:"flex-1 overflow-y-auto p-6",children:a.jsx(gj,{})})]})]})}const me=m.forwardRef(({className:e,type:t,...n},r)=>a.jsx("input",{type:t,className:Te("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors","file:border-0 file:bg-transparent file:text-sm file:font-medium","placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring","disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));me.displayName="Input";function yb(){const[e,t]=m.useState(""),[n,r]=m.useState(""),[s,o]=m.useState(""),[i,l]=m.useState(!1),[c,u]=m.useState(!1),{login:h,isAuthenticated:d,isLoading:f}=Qd(),g=hl();if(m.useEffect(()=>{d&&g("/inventory/agents",{replace:!0})},[d,g]),m.useEffect(()=>{fetch("/api/auth/config").then(w=>w.json()).then(w=>u(w.defaultPassword===!0)).catch(()=>{})},[]),f)return a.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:a.jsx("div",{className:"text-muted-foreground text-sm",children:"Loading..."})});const x=async w=>{w.preventDefault(),o(""),l(!0);try{await h(e,n),g("/inventory/agents",{replace:!0})}catch(N){o(N instanceof Error?N.message:"Login failed")}finally{l(!1)}};return a.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:a.jsxs("div",{className:"w-full max-w-sm space-y-8 px-4",children:[a.jsxs("div",{className:"flex flex-col items-center gap-3",children:[a.jsx("img",{src:"/dashboard/logo-512.png",alt:"OpenTrust",className:"h-12 w-12 dark:brightness-[1.8] dark:contrast-125"}),a.jsxs("div",{className:"text-center",children:[a.jsx("h1",{className:"text-lg font-semibold tracking-tight text-foreground",children:"OpenTrust"}),a.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Sign in to your dashboard"})]})]}),c&&a.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-amber-500/30 bg-amber-50 px-3 py-2.5 text-sm text-amber-800 dark:bg-amber-950 dark:text-amber-200",children:[a.jsx(nf,{className:"mt-0.5 h-4 w-4 shrink-0"}),a.jsxs("span",{children:["Default credentials: ",a.jsx("code",{className:"rounded bg-amber-100 px-1 py-0.5 text-xs dark:bg-amber-900",children:"admin"})," / ",a.jsx("code",{className:"rounded bg-amber-100 px-1 py-0.5 text-xs dark:bg-amber-900",children:"admin"}),". Please change after login."]})]}),a.jsxs("form",{onSubmit:x,className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-sm font-medium text-foreground",children:"Username"}),a.jsx(me,{type:"text",placeholder:"admin",value:e,onChange:w=>t(w.target.value),autoComplete:"username",required:!0})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-sm font-medium text-foreground",children:"Password"}),a.jsx(me,{type:"password",placeholder:"Password",value:n,onChange:w=>r(w.target.value),autoComplete:"current-password",required:!0})]}),s&&a.jsx("p",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:s}),a.jsx(K,{type:"submit",className:"w-full",disabled:i,children:i?"Signing in...":"Sign in"})]}),a.jsx("p",{className:"text-center text-xs text-muted-foreground",children:"Change the password in Settings after first login."})]})})}const vb="/api";async function ce(e,t){const n=localStorage.getItem("opentrust_user"),r=n?JSON.parse(n).apiKey:null,s=await fetch(`${vb}${e}`,{...t,headers:{"Content-Type":"application/json",...r&&{Authorization:`Bearer ${r}`},...t==null?void 0:t.headers}});if(!s.ok)throw new Error(`API ${s.status}: ${await s.text()}`);return s.json()}const te={agents:{list:()=>ce("/agents"),get:e=>ce(`/agents/${e}`),create:e=>ce("/agents",{method:"POST",body:JSON.stringify(e)}),update:(e,t)=>ce(`/agents/${e}`,{method:"PUT",body:JSON.stringify(t)}),delete:e=>ce(`/agents/${e}`,{method:"DELETE"})},discovery:{agents:()=>ce("/discovery/agents"),profile:e=>ce(`/discovery/agents/${e}/profile`)},observations:{recent:(e=50)=>ce(`/observations?limit=${e}`),permissions:()=>ce("/observations/permissions"),anomalies:()=>ce("/observations/anomalies"),summary:()=>ce("/observations/summary"),agentPermissions:e=>ce(`/observations/agents/${e}/permissions`)},commands:{list:e=>ce(`/commands?agentId=${e}`),create:e=>ce("/commands",{method:"POST",body:JSON.stringify(e)})},system:{services:()=>ce("/system/services"),logs:(e,t=200)=>ce(`/system/logs/${e}?lines=${t}`),clearLog:e=>ce(`/system/logs/${e}`,{method:"DELETE"})},hosts:{list:()=>ce("/hosts"),get:e=>ce(`/hosts/${e}`),remove:e=>ce(`/hosts/${e}`,{method:"DELETE"}),agents:e=>ce(`/hosts/${e}/agents`),sendCommand:(e,t,n)=>ce("/hosts/commands",{method:"POST",body:JSON.stringify({hostId:e,type:t,payload:n})}),commands:(e,t=50)=>ce(`/hosts/commands?hostId=${e}&limit=${t}`)},detect:e=>ce("/detect",{method:"POST",body:JSON.stringify(e)}),usage:{summary:(e=30)=>ce(`/usage/summary?days=${e}`),daily:(e=30)=>ce(`/usage/daily?days=${e}`)},settings:{get:()=>ce("/settings"),update:e=>ce("/settings",{method:"PUT",body:JSON.stringify(e)}),getApiKey:(e=!1)=>ce(`/settings/api-key${e?"?reveal=true":""}`),generateKey:()=>ce("/settings/generate-key",{method:"POST"}),getOpenclawConfig:()=>ce("/settings/openclaw-config"),saveOpenclawConfig:e=>ce("/settings/openclaw-config",{method:"PUT",body:JSON.stringify(e)})}};function he({className:e,variant:t="default",...n}){return a.jsx("div",{className:Te("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{"border-transparent bg-primary text-primary-foreground shadow":t==="default","border-transparent bg-secondary text-secondary-foreground":t==="secondary","border-transparent bg-destructive text-destructive-foreground shadow":t==="destructive","text-foreground":t==="outline","border-transparent bg-success/15 text-success":t==="success","border-transparent bg-warning/15 text-warning":t==="warning"},e),...n})}const Pe=m.forwardRef(({className:e,...t},n)=>a.jsx("label",{ref:n,className:Te("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...t}));Pe.displayName="Label";function Ve(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function wb(e,t){const n=m.createContext(t);function r(o){const{children:i,...l}=o,c=m.useMemo(()=>l,Object.values(l));return a.jsx(n.Provider,{value:c,children:i})}function s(o){const i=m.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return r.displayName=e+"Provider",[r,s]}function yl(e,t=[]){let n=[];function r(o,i){const l=m.createContext(i),c=n.length;n=[...n,i];function u(d){const{scope:f,children:g,...x}=d,w=(f==null?void 0:f[e][c])||l,N=m.useMemo(()=>x,Object.values(x));return a.jsx(w.Provider,{value:N,children:g})}function h(d,f){const g=(f==null?void 0:f[e][c])||l,x=m.useContext(g);if(x)return x;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${o}\``)}return u.displayName=o+"Provider",[u,h]}const s=()=>{const o=n.map(i=>m.createContext(i));return function(l){const c=(l==null?void 0:l[e])||o;return m.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return s.scopeName=e,[r,Nb(s,...t)]}function Nb(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const i=r.reduce((l,{useScope:c,scopeName:u})=>{const d=c(o)[`__scope${u}`];return{...l,...d}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var Aa=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},jb=m1.useId||(()=>{}),Sb=0;function ho(e){const[t,n]=m.useState(jb());return Aa(()=>{n(r=>r??String(Sb++))},[e]),t?`radix-${t}`:""}function Qn(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function rf({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,s]=bb({defaultProp:t,onChange:n}),o=e!==void 0,i=o?e:r,l=Qn(n),c=m.useCallback(u=>{if(o){const d=typeof u=="function"?u(e):u;d!==e&&l(d)}else s(u)},[o,e,s,l]);return[i,c]}function bb({defaultProp:e,onChange:t}){const n=m.useState(e),[r]=n,s=m.useRef(r),o=Qn(t);return m.useEffect(()=>{s.current!==r&&(o(r),s.current=r)},[r,s,o]),n}var kb=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],rt=kb.reduce((e,t)=>{const n=m.forwardRef((r,s)=>{const{asChild:o,...i}=r,l=o?gs:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(l,{...i,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Cb(e,t){e&&dl.flushSync(()=>e.dispatchEvent(t))}function Eb(e,t=globalThis==null?void 0:globalThis.document){const n=Qn(e);m.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var _b="DismissableLayer",Iu="dismissableLayer.update",Pb="dismissableLayer.pointerDownOutside",Mb="dismissableLayer.focusOutside",sm,iy=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ay=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:i,onDismiss:l,...c}=e,u=m.useContext(iy),[h,d]=m.useState(null),f=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=m.useState({}),x=Jt(t,b=>d(b)),w=Array.from(u.layers),[N]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),p=w.indexOf(N),v=h?w.indexOf(h):-1,y=u.layersWithOutsidePointerEventsDisabled.size>0,j=v>=p,S=Tb(b=>{const P=b.target,I=[...u.branches].some($=>$.contains(P));!j||I||(s==null||s(b),i==null||i(b),b.defaultPrevented||l==null||l())},f),C=Lb(b=>{const P=b.target;[...u.branches].some($=>$.contains(P))||(o==null||o(b),i==null||i(b),b.defaultPrevented||l==null||l())},f);return Eb(b=>{v===u.layers.size-1&&(r==null||r(b),!b.defaultPrevented&&l&&(b.preventDefault(),l()))},f),m.useEffect(()=>{if(h)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(sm=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(h)),u.layers.add(h),om(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=sm)}},[h,f,n,u]),m.useEffect(()=>()=>{h&&(u.layers.delete(h),u.layersWithOutsidePointerEventsDisabled.delete(h),om())},[h,u]),m.useEffect(()=>{const b=()=>g({});return document.addEventListener(Iu,b),()=>document.removeEventListener(Iu,b)},[]),a.jsx(rt.div,{...c,ref:x,style:{pointerEvents:y?j?"auto":"none":void 0,...e.style},onFocusCapture:Ve(e.onFocusCapture,C.onFocusCapture),onBlurCapture:Ve(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:Ve(e.onPointerDownCapture,S.onPointerDownCapture)})});ay.displayName=_b;var Ib="DismissableLayerBranch",Rb=m.forwardRef((e,t)=>{const n=m.useContext(iy),r=m.useRef(null),s=Jt(t,r);return m.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),a.jsx(rt.div,{...e,ref:s})});Rb.displayName=Ib;function Tb(e,t=globalThis==null?void 0:globalThis.document){const n=Qn(e),r=m.useRef(!1),s=m.useRef(()=>{});return m.useEffect(()=>{const o=l=>{if(l.target&&!r.current){let c=function(){ly(Pb,n,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=c,t.addEventListener("click",s.current,{once:!0})):c()}else t.removeEventListener("click",s.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Lb(e,t=globalThis==null?void 0:globalThis.document){const n=Qn(e),r=m.useRef(!1);return m.useEffect(()=>{const s=o=>{o.target&&!r.current&&ly(Mb,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function om(){const e=new CustomEvent(Iu);document.dispatchEvent(e)}function ly(e,t,n,{discrete:r}){const s=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?Cb(s,o):s.dispatchEvent(o)}var hc="focusScope.autoFocusOnMount",mc="focusScope.autoFocusOnUnmount",im={bubbles:!1,cancelable:!0},Ab="FocusScope",cy=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...i}=e,[l,c]=m.useState(null),u=Qn(s),h=Qn(o),d=m.useRef(null),f=Jt(t,w=>c(w)),g=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let w=function(y){if(g.paused||!l)return;const j=y.target;l.contains(j)?d.current=j:En(d.current,{select:!0})},N=function(y){if(g.paused||!l)return;const j=y.relatedTarget;j!==null&&(l.contains(j)||En(d.current,{select:!0}))},p=function(y){if(document.activeElement===document.body)for(const S of y)S.removedNodes.length>0&&En(l)};document.addEventListener("focusin",w),document.addEventListener("focusout",N);const v=new MutationObserver(p);return l&&v.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",N),v.disconnect()}}},[r,l,g.paused]),m.useEffect(()=>{if(l){lm.add(g);const w=document.activeElement;if(!l.contains(w)){const p=new CustomEvent(hc,im);l.addEventListener(hc,u),l.dispatchEvent(p),p.defaultPrevented||(zb(Hb(uy(l)),{select:!0}),document.activeElement===w&&En(l))}return()=>{l.removeEventListener(hc,u),setTimeout(()=>{const p=new CustomEvent(mc,im);l.addEventListener(mc,h),l.dispatchEvent(p),p.defaultPrevented||En(w??document.body,{select:!0}),l.removeEventListener(mc,h),lm.remove(g)},0)}}},[l,u,h,g]);const x=m.useCallback(w=>{if(!n&&!r||g.paused)return;const N=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,p=document.activeElement;if(N&&p){const v=w.currentTarget,[y,j]=Db(v);y&&j?!w.shiftKey&&p===j?(w.preventDefault(),n&&En(y,{select:!0})):w.shiftKey&&p===y&&(w.preventDefault(),n&&En(j,{select:!0})):p===v&&w.preventDefault()}},[n,r,g.paused]);return a.jsx(rt.div,{tabIndex:-1,...i,ref:f,onKeyDown:x})});cy.displayName=Ab;function zb(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(En(r,{select:t}),document.activeElement!==n)return}function Db(e){const t=uy(e),n=am(t,e),r=am(t.reverse(),e);return[n,r]}function uy(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function am(e,t){for(const n of e)if(!$b(n,{upTo:t}))return n}function $b(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Ob(e){return e instanceof HTMLInputElement&&"select"in e}function En(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Ob(e)&&t&&e.select()}}var lm=Fb();function Fb(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=cm(e,t),e.unshift(t)},remove(t){var n;e=cm(e,t),(n=e[0])==null||n.resume()}}}function cm(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Hb(e){return e.filter(t=>t.tagName!=="A")}var Bb="Portal",dy=m.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[s,o]=m.useState(!1);Aa(()=>o(!0),[]);const i=n||s&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return i?k2.createPortal(a.jsx(rt.div,{...r,ref:t}),i):null});dy.displayName=Bb;function Vb(e,t){return m.useReducer((n,r)=>t[n][r]??n,e)}var qo=e=>{const{present:t,children:n}=e,r=Ub(t),s=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),o=Jt(r.ref,Wb(s));return typeof n=="function"||r.isPresent?m.cloneElement(s,{ref:o}):null};qo.displayName="Presence";function Ub(e){const[t,n]=m.useState(),r=m.useRef({}),s=m.useRef(e),o=m.useRef("none"),i=e?"mounted":"unmounted",[l,c]=Vb(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const u=ki(r.current);o.current=l==="mounted"?u:"none"},[l]),Aa(()=>{const u=r.current,h=s.current;if(h!==e){const f=o.current,g=ki(u);e?c("MOUNT"):g==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(h&&f!==g?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,c]),Aa(()=>{if(t){const u=d=>{const g=ki(r.current).includes(d.animationName);d.target===t&&g&&dl.flushSync(()=>c("ANIMATION_END"))},h=d=>{d.target===t&&(o.current=ki(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:m.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function ki(e){return(e==null?void 0:e.animationName)||"none"}function Wb(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var pc=0;function Kb(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??um()),document.body.insertAdjacentElement("beforeend",e[1]??um()),pc++,()=>{pc===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),pc--}},[])}function um(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var Yt=function(){return Yt=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Yt.apply(this,arguments)};function fy(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function Gb(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,o;r<s;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var ta="right-scroll-bar-position",na="width-before-scroll-bar",Yb="with-scroll-bars-hidden",Xb="--removed-body-scroll-bar-size";function gc(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Qb(e,t){var n=m.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var qb=typeof window<"u"?m.useLayoutEffect:m.useEffect,dm=new WeakMap;function Zb(e,t){var n=Qb(null,function(r){return e.forEach(function(s){return gc(s,r)})});return qb(function(){var r=dm.get(n);if(r){var s=new Set(r),o=new Set(e),i=n.current;s.forEach(function(l){o.has(l)||gc(l,null)}),o.forEach(function(l){s.has(l)||gc(l,i)})}dm.set(n,e)},[e]),n}function Jb(e){return e}function ek(e,t){t===void 0&&(t=Jb);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var i=t(o,r);return n.push(i),function(){n=n.filter(function(l){return l!==i})}},assignSyncMedium:function(o){for(r=!0;n.length;){var i=n;n=[],i.forEach(o)}n={push:function(l){return o(l)},filter:function(){return n}}},assignMedium:function(o){r=!0;var i=[];if(n.length){var l=n;n=[],l.forEach(o),i=n}var c=function(){var h=i;i=[],h.forEach(o)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(h){i.push(h),u()},filter:function(h){return i=i.filter(h),n}}}};return s}function tk(e){e===void 0&&(e={});var t=ek(null);return t.options=Yt({async:!0,ssr:!1},e),t}var hy=function(e){var t=e.sideCar,n=fy(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return m.createElement(r,Yt({},n))};hy.isSideCarExport=!0;function nk(e,t){return e.useMedium(t),hy}var my=tk(),xc=function(){},vl=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:xc,onWheelCapture:xc,onTouchMoveCapture:xc}),s=r[0],o=r[1],i=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,h=e.enabled,d=e.shards,f=e.sideCar,g=e.noIsolation,x=e.inert,w=e.allowPinchZoom,N=e.as,p=N===void 0?"div":N,v=e.gapMode,y=fy(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),j=f,S=Zb([n,t]),C=Yt(Yt({},y),s);return m.createElement(m.Fragment,null,h&&m.createElement(j,{sideCar:my,removeScrollBar:u,shards:d,noIsolation:g,inert:x,setCallbacks:o,allowPinchZoom:!!w,lockRef:n,gapMode:v}),i?m.cloneElement(m.Children.only(l),Yt(Yt({},C),{ref:S})):m.createElement(p,Yt({},C,{className:c,ref:S}),l))});vl.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};vl.classNames={fullWidth:na,zeroRight:ta};var rk=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function sk(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=rk();return t&&e.setAttribute("nonce",t),e}function ok(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ik(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var ak=function(){var e=0,t=null;return{add:function(n){e==0&&(t=sk())&&(ok(t,n),ik(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},lk=function(){var e=ak();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},py=function(){var e=lk(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},ck={left:0,top:0,right:0,gap:0},yc=function(e){return parseInt(e||"",10)||0},uk=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[yc(n),yc(r),yc(s)]},dk=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return ck;var t=uk(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},fk=py(),os="data-scroll-locked",hk=function(e,t,n,r){var s=e.left,o=e.top,i=e.right,l=e.gap;return n===void 0&&(n="margin"),`
|
|
332
|
-
.`.concat(Yb,` {
|
|
333
|
-
overflow: hidden `).concat(r,`;
|
|
334
|
-
padding-right: `).concat(l,"px ").concat(r,`;
|
|
335
|
-
}
|
|
336
|
-
body[`).concat(os,`] {
|
|
337
|
-
overflow: hidden `).concat(r,`;
|
|
338
|
-
overscroll-behavior: contain;
|
|
339
|
-
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
340
|
-
padding-left: `.concat(s,`px;
|
|
341
|
-
padding-top: `).concat(o,`px;
|
|
342
|
-
padding-right: `).concat(i,`px;
|
|
343
|
-
margin-left:0;
|
|
344
|
-
margin-top:0;
|
|
345
|
-
margin-right: `).concat(l,"px ").concat(r,`;
|
|
346
|
-
`),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
.`).concat(ta,` {
|
|
350
|
-
right: `).concat(l,"px ").concat(r,`;
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
.`).concat(na,` {
|
|
354
|
-
margin-right: `).concat(l,"px ").concat(r,`;
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
.`).concat(ta," .").concat(ta,` {
|
|
358
|
-
right: 0 `).concat(r,`;
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
.`).concat(na," .").concat(na,` {
|
|
362
|
-
margin-right: 0 `).concat(r,`;
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
body[`).concat(os,`] {
|
|
366
|
-
`).concat(Xb,": ").concat(l,`px;
|
|
367
|
-
}
|
|
368
|
-
`)},fm=function(){var e=parseInt(document.body.getAttribute(os)||"0",10);return isFinite(e)?e:0},mk=function(){m.useEffect(function(){return document.body.setAttribute(os,(fm()+1).toString()),function(){var e=fm()-1;e<=0?document.body.removeAttribute(os):document.body.setAttribute(os,e.toString())}},[])},pk=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;mk();var o=m.useMemo(function(){return dk(s)},[s]);return m.createElement(fk,{styles:hk(o,!t,s,n?"":"!important")})},Ru=!1;if(typeof window<"u")try{var Ci=Object.defineProperty({},"passive",{get:function(){return Ru=!0,!0}});window.addEventListener("test",Ci,Ci),window.removeEventListener("test",Ci,Ci)}catch{Ru=!1}var Ar=Ru?{passive:!1}:!1,gk=function(e){return e.tagName==="TEXTAREA"},gy=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!gk(e)&&n[t]==="visible")},xk=function(e){return gy(e,"overflowY")},yk=function(e){return gy(e,"overflowX")},hm=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=xy(e,r);if(s){var o=yy(e,r),i=o[1],l=o[2];if(i>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},vk=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},wk=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},xy=function(e,t){return e==="v"?xk(t):yk(t)},yy=function(e,t){return e==="v"?vk(t):wk(t)},Nk=function(e,t){return e==="h"&&t==="rtl"?-1:1},jk=function(e,t,n,r,s){var o=Nk(e,window.getComputedStyle(t).direction),i=o*r,l=n.target,c=t.contains(l),u=!1,h=i>0,d=0,f=0;do{var g=yy(e,l),x=g[0],w=g[1],N=g[2],p=w-N-o*x;(x||p)&&xy(e,l)&&(d+=p,f+=x),l instanceof ShadowRoot?l=l.host:l=l.parentNode}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(h&&Math.abs(d)<1||!h&&Math.abs(f)<1)&&(u=!0),u},Ei=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},mm=function(e){return[e.deltaX,e.deltaY]},pm=function(e){return e&&"current"in e?e.current:e},Sk=function(e,t){return e[0]===t[0]&&e[1]===t[1]},bk=function(e){return`
|
|
369
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
370
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
371
|
-
`)},kk=0,zr=[];function Ck(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),s=m.useState(kk++)[0],o=m.useState(py)[0],i=m.useRef(e);m.useEffect(function(){i.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var w=Gb([e.lockRef.current],(e.shards||[]).map(pm),!0).filter(Boolean);return w.forEach(function(N){return N.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),w.forEach(function(N){return N.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var l=m.useCallback(function(w,N){if("touches"in w&&w.touches.length===2)return!i.current.allowPinchZoom;var p=Ei(w),v=n.current,y="deltaX"in w?w.deltaX:v[0]-p[0],j="deltaY"in w?w.deltaY:v[1]-p[1],S,C=w.target,b=Math.abs(y)>Math.abs(j)?"h":"v";if("touches"in w&&b==="h"&&C.type==="range")return!1;var P=hm(b,C);if(!P)return!0;if(P?S=b:(S=b==="v"?"h":"v",P=hm(b,C)),!P)return!1;if(!r.current&&"changedTouches"in w&&(y||j)&&(r.current=S),!S)return!0;var I=r.current||S;return jk(I,N,w,I==="h"?y:j)},[]),c=m.useCallback(function(w){var N=w;if(!(!zr.length||zr[zr.length-1]!==o)){var p="deltaY"in N?mm(N):Ei(N),v=t.current.filter(function(S){return S.name===N.type&&(S.target===N.target||N.target===S.shadowParent)&&Sk(S.delta,p)})[0];if(v&&v.should){N.cancelable&&N.preventDefault();return}if(!v){var y=(i.current.shards||[]).map(pm).filter(Boolean).filter(function(S){return S.contains(N.target)}),j=y.length>0?l(N,y[0]):!i.current.noIsolation;j&&N.cancelable&&N.preventDefault()}}},[]),u=m.useCallback(function(w,N,p,v){var y={name:w,delta:N,target:p,should:v,shadowParent:Ek(p)};t.current.push(y),setTimeout(function(){t.current=t.current.filter(function(j){return j!==y})},1)},[]),h=m.useCallback(function(w){n.current=Ei(w),r.current=void 0},[]),d=m.useCallback(function(w){u(w.type,mm(w),w.target,l(w,e.lockRef.current))},[]),f=m.useCallback(function(w){u(w.type,Ei(w),w.target,l(w,e.lockRef.current))},[]);m.useEffect(function(){return zr.push(o),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",c,Ar),document.addEventListener("touchmove",c,Ar),document.addEventListener("touchstart",h,Ar),function(){zr=zr.filter(function(w){return w!==o}),document.removeEventListener("wheel",c,Ar),document.removeEventListener("touchmove",c,Ar),document.removeEventListener("touchstart",h,Ar)}},[]);var g=e.removeScrollBar,x=e.inert;return m.createElement(m.Fragment,null,x?m.createElement(o,{styles:bk(s)}):null,g?m.createElement(pk,{gapMode:e.gapMode}):null)}function Ek(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const _k=nk(my,Ck);var vy=m.forwardRef(function(e,t){return m.createElement(vl,Yt({},e,{ref:t,sideCar:_k}))});vy.classNames=vl.classNames;var Pk=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Dr=new WeakMap,_i=new WeakMap,Pi={},vc=0,wy=function(e){return e&&(e.host||wy(e.parentNode))},Mk=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=wy(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Ik=function(e,t,n,r){var s=Mk(t,Array.isArray(e)?e:[e]);Pi[n]||(Pi[n]=new WeakMap);var o=Pi[n],i=[],l=new Set,c=new Set(s),u=function(d){!d||l.has(d)||(l.add(d),u(d.parentNode))};s.forEach(u);var h=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(f){if(l.has(f))h(f);else try{var g=f.getAttribute(r),x=g!==null&&g!=="false",w=(Dr.get(f)||0)+1,N=(o.get(f)||0)+1;Dr.set(f,w),o.set(f,N),i.push(f),w===1&&x&&_i.set(f,!0),N===1&&f.setAttribute(n,"true"),x||f.setAttribute(r,"true")}catch(p){console.error("aria-hidden: cannot operate on ",f,p)}})};return h(t),l.clear(),vc++,function(){i.forEach(function(d){var f=Dr.get(d)-1,g=o.get(d)-1;Dr.set(d,f),o.set(d,g),f||(_i.has(d)||d.removeAttribute(r),_i.delete(d)),g||d.removeAttribute(n)}),vc--,vc||(Dr=new WeakMap,Dr=new WeakMap,_i=new WeakMap,Pi={})}},Rk=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=Pk(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),Ik(r,s,n,"aria-hidden")):function(){return null}},sf="Dialog",[Ny]=yl(sf),[Tk,Ht]=Ny(sf),jy=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:o,modal:i=!0}=e,l=m.useRef(null),c=m.useRef(null),[u=!1,h]=rf({prop:r,defaultProp:s,onChange:o});return a.jsx(Tk,{scope:t,triggerRef:l,contentRef:c,contentId:ho(),titleId:ho(),descriptionId:ho(),open:u,onOpenChange:h,onOpenToggle:m.useCallback(()=>h(d=>!d),[h]),modal:i,children:n})};jy.displayName=sf;var Sy="DialogTrigger",Lk=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ht(Sy,n),o=Jt(t,s.triggerRef);return a.jsx(rt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":lf(s.open),...r,ref:o,onClick:Ve(e.onClick,s.onOpenToggle)})});Lk.displayName=Sy;var of="DialogPortal",[Ak,by]=Ny(of,{forceMount:void 0}),ky=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,o=Ht(of,t);return a.jsx(Ak,{scope:t,forceMount:n,children:m.Children.map(r,i=>a.jsx(qo,{present:n||o.open,children:a.jsx(dy,{asChild:!0,container:s,children:i})}))})};ky.displayName=of;var za="DialogOverlay",Cy=m.forwardRef((e,t)=>{const n=by(za,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=Ht(za,e.__scopeDialog);return o.modal?a.jsx(qo,{present:r||o.open,children:a.jsx(zk,{...s,ref:t})}):null});Cy.displayName=za;var zk=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ht(za,n);return a.jsx(vy,{as:gs,allowPinchZoom:!0,shards:[s.contentRef],children:a.jsx(rt.div,{"data-state":lf(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),jr="DialogContent",Ey=m.forwardRef((e,t)=>{const n=by(jr,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=Ht(jr,e.__scopeDialog);return a.jsx(qo,{present:r||o.open,children:o.modal?a.jsx(Dk,{...s,ref:t}):a.jsx($k,{...s,ref:t})})});Ey.displayName=jr;var Dk=m.forwardRef((e,t)=>{const n=Ht(jr,e.__scopeDialog),r=m.useRef(null),s=Jt(t,n.contentRef,r);return m.useEffect(()=>{const o=r.current;if(o)return Rk(o)},[]),a.jsx(_y,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ve(e.onCloseAutoFocus,o=>{var i;o.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:Ve(e.onPointerDownOutside,o=>{const i=o.detail.originalEvent,l=i.button===0&&i.ctrlKey===!0;(i.button===2||l)&&o.preventDefault()}),onFocusOutside:Ve(e.onFocusOutside,o=>o.preventDefault())})}),$k=m.forwardRef((e,t)=>{const n=Ht(jr,e.__scopeDialog),r=m.useRef(!1),s=m.useRef(!1);return a.jsx(_y,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var i,l;(i=e.onCloseAutoFocus)==null||i.call(e,o),o.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),o.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:o=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const i=o.target;((u=n.triggerRef.current)==null?void 0:u.contains(i))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),_y=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,...i}=e,l=Ht(jr,n),c=m.useRef(null),u=Jt(t,c);return Kb(),a.jsxs(a.Fragment,{children:[a.jsx(cy,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:a.jsx(ay,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":lf(l.open),...i,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(Ok,{titleId:l.titleId}),a.jsx(Hk,{contentRef:c,descriptionId:l.descriptionId})]})]})}),af="DialogTitle",Py=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ht(af,n);return a.jsx(rt.h2,{id:s.titleId,...r,ref:t})});Py.displayName=af;var My="DialogDescription",Iy=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ht(My,n);return a.jsx(rt.p,{id:s.descriptionId,...r,ref:t})});Iy.displayName=My;var Ry="DialogClose",Ty=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ht(Ry,n);return a.jsx(rt.button,{type:"button",...r,ref:t,onClick:Ve(e.onClick,()=>s.onOpenChange(!1))})});Ty.displayName=Ry;function lf(e){return e?"open":"closed"}var Ly="DialogTitleWarning",[PI,Ay]=wb(Ly,{contentName:jr,titleName:af,docsSlug:"dialog"}),Ok=({titleId:e})=>{const t=Ay(Ly),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
372
|
-
|
|
373
|
-
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
374
|
-
|
|
375
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return m.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Fk="DialogDescriptionWarning",Hk=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Ay(Fk).contentName}}.`;return m.useEffect(()=>{var o;const s=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Bk=jy,Vk=ky,zy=Cy,Dy=Ey,$y=Py,Oy=Iy,Uk=Ty;const Mr=Bk,Wk=Vk,Fy=m.forwardRef(({className:e,...t},n)=>a.jsx(zy,{ref:n,className:Te("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Fy.displayName=zy.displayName;const er=m.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(Wk,{children:[a.jsx(Fy,{}),a.jsxs(Dy,{ref:r,className:Te("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,a.jsxs(Uk,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[a.jsx(ry,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));er.displayName=Dy.displayName;const Ir=({className:e,...t})=>a.jsx("div",{className:Te("flex flex-col space-y-1.5 text-center sm:text-left",e),...t}),Rr=({className:e,...t})=>a.jsx("div",{className:Te("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t}),tr=m.forwardRef(({className:e,...t},n)=>a.jsx($y,{ref:n,className:Te("text-lg font-semibold leading-none tracking-tight",e),...t}));tr.displayName=$y.displayName;const nr=m.forwardRef(({className:e,...t},n)=>a.jsx(Oy,{ref:n,className:Te("text-sm text-muted-foreground",e),...t}));nr.displayName=Oy.displayName;function Kk(){const[e,t]=m.useState([]),[n,r]=m.useState([]),[s,o]=m.useState(""),[i,l]=m.useState(""),[c,u]=m.useState(""),[h,d]=m.useState(""),[f,g]=m.useState(!0),[x,w]=m.useState(new Set),[N,p]=m.useState(!1),[v,y]=m.useState(null),j=async()=>{g(!0);try{const[k,z]=await Promise.all([te.discovery.agents(),te.hosts.list()]);t(k.data??[]),r(z.data??[])}catch{}g(!1)};m.useEffect(()=>{j()},[]),m.useEffect(()=>{if(!v)return;const k=setTimeout(()=>y(null),4e3);return()=>clearTimeout(k)},[v]);const S=new Map(n.map(k=>[k.id,k])),C=[...new Set(e.map(k=>k.provider).filter(Boolean))].sort(),b=[...new Set(e.map(k=>k.status??"inactive").filter(Boolean))].sort(),P=e.filter(k=>{var z;if(s&&!((z=k.name)!=null&&z.toLowerCase().includes(s.toLowerCase())))return!1;if(i){if(i==="__none__"){if(k.hostId)return!1}else if(k.hostId!==i)return!1}return!(c&&k.provider!==c||h&&(k.status??"inactive")!==h)}),I=!!(i||c||h),$=k=>k==="active"?"success":k==="inactive"?"secondary":"warning",R=(k,z)=>{z.preventDefault(),z.stopPropagation(),w(_=>{const M=new Set(_);return M.has(k)?M.delete(k):M.add(k),M})},T=()=>{x.size===P.length?w(new Set):w(new Set(P.map(k=>k.registeredAgentId||k.id)))},D=()=>{l(""),u(""),d("")},E=e.filter(k=>x.has(k.registeredAgentId||k.id)),L=[...new Set(E.map(k=>k.hostId).filter(Boolean))];return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Agents"}),a.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:[e.length," agent",e.length!==1?"s":""," discovered",I&&` · ${P.length} shown`]})]}),a.jsxs(K,{variant:"outline",size:"sm",onClick:j,children:[a.jsx(Xn,{className:"h-3.5 w-3.5"}),"Scan"]})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsxs("div",{className:"relative max-w-xs flex-1 min-w-[180px]",children:[a.jsx(ey,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),a.jsx(me,{placeholder:"Search agents...",className:"pl-9 h-8 text-sm",value:s,onChange:k=>o(k.target.value)})]}),a.jsxs("select",{className:"h-8 rounded-md border border-input bg-background px-2 text-xs focus:outline-none focus:ring-1 focus:ring-ring",value:i,onChange:k=>l(k.target.value),children:[a.jsx("option",{value:"",children:"All Hosts"}),n.map(k=>a.jsx("option",{value:k.id,children:k.hostname},k.id)),a.jsx("option",{value:"__none__",children:"No Host"})]}),a.jsxs("select",{className:"h-8 rounded-md border border-input bg-background px-2 text-xs focus:outline-none focus:ring-1 focus:ring-ring",value:c,onChange:k=>u(k.target.value),children:[a.jsx("option",{value:"",children:"All Providers"}),C.map(k=>a.jsx("option",{value:k,children:k},k))]}),a.jsxs("select",{className:"h-8 rounded-md border border-input bg-background px-2 text-xs focus:outline-none focus:ring-1 focus:ring-ring",value:h,onChange:k=>d(k.target.value),children:[a.jsx("option",{value:"",children:"All Status"}),b.map(k=>a.jsx("option",{value:k,children:k},k))]}),I&&a.jsxs(K,{variant:"ghost",size:"sm",onClick:D,className:"h-8 text-xs px-2",children:[a.jsx(ry,{className:"h-3 w-3 mr-1"})," Clear"]}),P.length>0&&a.jsx(K,{variant:"ghost",size:"sm",onClick:T,className:"h-8 text-xs ml-auto",children:x.size===P.length?a.jsxs(a.Fragment,{children:[a.jsx(tm,{className:"h-3.5 w-3.5 mr-1"})," Deselect All"]}):a.jsxs(a.Fragment,{children:[a.jsx(Lo,{className:"h-3.5 w-3.5 mr-1"})," Select All"]})})]}),x.size>0&&a.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-primary/20 bg-primary/5 px-4 py-3",children:[a.jsxs("span",{className:"text-sm font-medium",children:[x.size," agent",x.size>1?"s":""," selected"]}),a.jsx("div",{className:"flex-1"}),a.jsxs(K,{size:"sm",onClick:()=>p(!0),children:[a.jsx(Ct,{className:"h-3.5 w-3.5 mr-1"})," Install Skill"]}),a.jsx(K,{size:"sm",variant:"ghost",onClick:()=>w(new Set),children:"Clear"})]}),f?a.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):P.length===0?a.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 rounded-lg border border-dashed border-border",children:[a.jsx(Pr,{className:"h-8 w-8 text-muted-foreground/50"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"No agents found"})]}):a.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:P.map(k=>{var M;const z=k.registeredAgentId||k.id,_=x.has(z);return a.jsxs("div",{className:"relative",children:[a.jsx("button",{onClick:A=>R(z,A),className:`absolute left-2 top-2 z-10 rounded p-0.5 transition-colors ${_?"text-primary":"text-muted-foreground/30 hover:text-muted-foreground/60"}`,children:_?a.jsx(tm,{className:"h-4 w-4"}):a.jsx(Lo,{className:"h-4 w-4"})}),a.jsxs(Gn,{to:`/inventory/agents/${k.id}`,className:`group flex flex-col gap-3 rounded-lg border bg-card p-4 pl-8 transition-colors hover:border-muted-foreground/30 ${_?"border-primary/40 bg-primary/5":"border-border"}`,children:[a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsx("span",{className:"text-xl",children:k.emoji||"🤖"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-foreground group-hover:text-foreground",children:k.name}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:[k.provider||"unknown",k.model?` · ${k.model}`:"",k.hostId&&S.has(k.hostId)&&a.jsxs("span",{className:"ml-1 text-muted-foreground/60",children:["@ ",S.get(k.hostId).hostname]})]})]})]}),a.jsx(he,{variant:$(k.status??"inactive"),className:"text-[10px]",children:k.status??"inactive"})]}),((M=k.skills)==null?void 0:M.length)>0&&a.jsxs("div",{className:"flex flex-wrap gap-1",children:[k.skills.slice(0,4).map(A=>a.jsx("span",{className:"rounded-md bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground",children:typeof A=="string"?A:A.name},A.name??A)),k.skills.length>4&&a.jsxs("span",{className:"rounded-md bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground",children:["+",k.skills.length-4]})]})]})]},k.id)})}),a.jsx(Gk,{open:N,onOpenChange:p,hostIds:L,agentCount:x.size,hostlessCount:E.filter(k=>!k.hostId).length,onDone:(k,z)=>{y({msg:k,type:z}),w(new Set)}}),v&&a.jsxs("div",{className:`fixed bottom-6 right-6 z-[100] flex items-center gap-2 rounded-lg border px-4 py-3 shadow-lg ${v.type==="success"?"border-emerald-500/30 bg-emerald-50 text-emerald-800 dark:bg-emerald-950 dark:text-emerald-200":"border-destructive/30 bg-red-50 text-red-800 dark:bg-red-950 dark:text-red-200"}`,children:[v.type==="success"?a.jsx(Yn,{className:"h-4 w-4"}):a.jsx(pt,{className:"h-4 w-4"}),a.jsx("span",{className:"text-sm",children:v.msg})]})]})}function Gk({open:e,onOpenChange:t,hostIds:n,agentCount:r,hostlessCount:s,onDone:o}){const[i,l]=m.useState(""),[c,u]=m.useState(!1),[h,d]=m.useState(""),f=()=>{l(""),d("")},g=async()=>{const x=i.trim();if(!x)return;if(n.length===0){d("None of the selected agents are associated with a host. Run 'opentrust connect' on their machines first.");return}u(!0),d("");let w=0,N=0;for(const p of n)try{await te.hosts.sendCommand(p,"install_skill",{skillName:x}),w++}catch{N++}u(!1),N===0?(f(),t(!1),o(`Skill "${x}" install sent to ${w} host${w>1?"s":""} (${r} agents)`,"success")):d(`${w} sent, ${N} failed`)};return a.jsx(Mr,{open:e,onOpenChange:x=>{x||f(),t(x)},children:a.jsxs(er,{className:"sm:max-w-[460px]",children:[a.jsxs(Ir,{children:[a.jsxs(tr,{className:"flex items-center gap-2",children:[a.jsx(Nr,{className:"h-4 w-4"})," Batch Install Skill"]}),a.jsxs(nr,{children:["Install a skill on ",r," selected agent",r>1?"s":""," across ",n.length," host",n.length>1?"s":"",".",s>0&&a.jsxs("span",{className:"text-amber-600 dark:text-amber-400",children:[" ","(",s," agent",s>1?"s":""," without host will be skipped)"]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"batch-skill-name",children:"Skill Name"}),a.jsx(me,{id:"batch-skill-name",placeholder:"e.g. self-improving-agent, web-search",value:i,onChange:x=>{l(x.target.value),d("")},onKeyDown:x=>x.key==="Enter"&&g()}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Runs ",a.jsx("code",{className:"rounded bg-muted px-1",children:"clawhub install <name> --force"})," on each host via CLI daemon. Same host won't receive duplicate commands."]})]}),h&&a.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:[a.jsx(pt,{className:"h-3.5 w-3.5 shrink-0"}),a.jsx("span",{children:h})]}),a.jsxs(Rr,{children:[a.jsx(K,{variant:"outline",onClick:()=>{f(),t(!1)},children:"Cancel"}),a.jsxs(K,{onClick:g,disabled:c||!i.trim(),children:[c?a.jsx($e,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):a.jsx(Ct,{className:"mr-1.5 h-3.5 w-3.5"}),"Install on ",n.length," host",n.length>1?"s":""]})]})]})})}const fe=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:Te("rounded-lg border border-border bg-card text-card-foreground shadow-sm",e),...t}));fe.displayName="Card";const Ie=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:Te("flex flex-col space-y-1.5 p-6",e),...t}));Ie.displayName="CardHeader";const Re=m.forwardRef(({className:e,...t},n)=>a.jsx("h3",{ref:n,className:Te("font-semibold leading-none tracking-tight",e),...t}));Re.displayName="CardTitle";const wl=m.forwardRef(({className:e,...t},n)=>a.jsx("p",{ref:n,className:Te("text-sm text-muted-foreground",e),...t}));wl.displayName="CardDescription";const we=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:Te("p-6 pt-0",e),...t}));we.displayName="CardContent";const Yk=["Profile","Tasks","Identities","Permissions"];function Xk(){const{id:e}=nj(),[t,n]=m.useState(null),[r,s]=m.useState([]),[o,i]=m.useState("Profile"),[l,c]=m.useState(!0),[u,h]=m.useState(null);return m.useEffect(()=>{e&&(c(!0),(async()=>{const d=await te.discovery.profile(e).catch(()=>null),f=(d==null?void 0:d.data)??null;n(f),f!=null&&f.hostId&&te.hosts.get(f.hostId).then(w=>h(w.data??null)).catch(()=>{});const g=(f==null?void 0:f.registeredAgentId)??e,x=await te.observations.agentPermissions(g).catch(()=>({data:[]}));s((x==null?void 0:x.data)??[]),c(!1)})())},[e]),l?a.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):t?a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(Gn,{to:"/inventory/agents",className:"rounded-md p-1.5 hover:bg-accent",children:a.jsx(FS,{className:"h-4 w-4"})}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("span",{className:"text-2xl",children:t.emoji||"🤖"}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-lg font-semibold",children:t.name||e}),a.jsxs("p",{className:"text-sm text-muted-foreground",children:[t.provider||"unknown",t.model?` / ${t.model}`:"",u&&t.hostId&&a.jsxs(Gn,{to:`/inventory/hosts?expand=${t.hostId}`,className:"ml-2 inline-flex items-center gap-1 text-xs text-primary hover:underline",children:[a.jsx(xl,{className:"h-3 w-3"})," ",u.hostname]})]})]})]})]}),a.jsx("div",{className:"flex gap-1 border-b border-border",children:Yk.map(d=>a.jsx("button",{onClick:()=>i(d),className:Te("border-b-2 px-4 py-2 text-sm font-medium transition-colors",o===d?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:d},d))}),o==="Profile"&&a.jsx(Qk,{profile:t}),o==="Tasks"&&a.jsx(qk,{profile:t}),o==="Identities"&&a.jsx(Zk,{profile:t}),o==="Permissions"&&a.jsx(Jk,{permissions:r})]}):a.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Agent not found"})}function Qk({profile:e}){const t=e.skills??[];return a.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[a.jsxs(fe,{children:[a.jsx(Ie,{children:a.jsx(Re,{className:"text-sm",children:"Info"})}),a.jsxs(we,{className:"space-y-2 text-sm",children:[a.jsx(Ys,{label:"Owner",value:e.ownerName||"—"}),a.jsx(Ys,{label:"Creature",value:e.creature||"—"}),a.jsx(Ys,{label:"Vibe",value:e.vibe||"—"}),a.jsx(Ys,{label:"Sessions",value:String(e.sessionCount??0)}),a.jsx(Ys,{label:"Last Active",value:e.lastActive??"never"})]})]}),a.jsxs(fe,{children:[a.jsx(Ie,{children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs(Re,{className:"flex items-center gap-2 text-sm",children:[a.jsx(ny,{className:"h-4 w-4"})," Skills (",t.length,")"]}),a.jsx(Gn,{to:"/ops/skills",children:a.jsxs(K,{size:"sm",variant:"ghost",className:"h-7 text-xs text-muted-foreground",children:["Manage ",a.jsx(GS,{className:"ml-1 h-3 w-3"})]})})]})}),a.jsx(we,{children:t.length===0?a.jsxs("div",{className:"flex flex-col items-center gap-2 py-4",children:[a.jsx(Nr,{className:"h-8 w-8 text-muted-foreground/30"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"No skills installed"}),a.jsx(Gn,{to:"/ops/skills",children:a.jsx(K,{size:"sm",variant:"ghost",className:"h-7 text-xs",children:"Go to Operations to install skills"})})]}):a.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.map(n=>a.jsxs(he,{variant:"secondary",className:"text-xs font-normal",children:[a.jsx(Nr,{className:"mr-1 h-3 w-3"})," ",n.name]},n.name))})})]}),a.jsxs(fe,{children:[a.jsx(Ie,{children:a.jsx(Re,{className:"text-sm",children:"Plugins"})}),a.jsx(we,{children:(e.plugins??[]).length===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"No plugins"}):a.jsx("div",{className:"space-y-1.5",children:(e.plugins??[]).map(n=>a.jsxs("div",{className:"flex items-center justify-between text-sm",children:[a.jsx("span",{children:n.name}),a.jsx(he,{variant:n.enabled?"success":"secondary",className:"text-[10px]",children:n.enabled?"on":"off"})]},n.name))})})]}),a.jsxs(fe,{children:[a.jsx(Ie,{children:a.jsx(Re,{className:"text-sm",children:"Connected Systems"})}),a.jsx(we,{children:(e.connectedSystems??[]).length===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"None"}):a.jsx("div",{className:"flex flex-wrap gap-1.5",children:(e.connectedSystems??[]).map(n=>a.jsx(he,{variant:"outline",className:"text-xs",children:n},n))})})]})]})}function qk({profile:e}){const t=e.cronJobs??[];return a.jsxs(fe,{children:[a.jsx(Ie,{children:a.jsxs(Re,{className:"flex items-center gap-2 text-sm",children:[a.jsx(US,{className:"h-4 w-4"})," Scheduled Tasks (",t.length,")"]})}),a.jsx(we,{children:t.length===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"No scheduled tasks"}):a.jsx("div",{className:"space-y-2",children:t.map((n,r)=>a.jsxs("div",{className:"flex items-center justify-between rounded-md border border-border px-3 py-2 text-sm",children:[a.jsxs("div",{children:[a.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:n.schedule}),a.jsx("span",{className:"ml-2",children:n.task??n.id})]}),a.jsx(he,{variant:n.enabled!==!1?"success":"secondary",className:"text-[10px]",children:n.enabled!==!1?"active":"paused"})]},r))})})]})}function Zk({profile:e}){const t=e.workspaceFiles??{},n=[{label:"SOUL.md",content:t.soul},{label:"IDENTITY.md",content:t.identity},{label:"USER.md",content:t.user}].filter(r=>r.content);return a.jsx("div",{className:"space-y-4",children:n.length===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"No identity files found"}):n.map(r=>a.jsxs(fe,{children:[a.jsx(Ie,{children:a.jsxs(Re,{className:"flex items-center gap-2 text-sm",children:[a.jsx(Rs,{className:"h-4 w-4"})," ",r.label]})}),a.jsx(we,{children:a.jsx("pre",{className:"max-h-60 overflow-auto whitespace-pre-wrap rounded-md bg-muted p-3 font-mono text-xs text-muted-foreground",children:r.content})})]},r.label))})}function Jk({permissions:e}){return e.length===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"No observed permissions"}):a.jsx("div",{className:"overflow-x-auto rounded-lg border border-border",children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border bg-muted/50",children:[a.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Tool"}),a.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Category"}),a.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Access"}),a.jsx("th",{className:"px-4 py-2.5 text-right font-medium text-muted-foreground",children:"Calls"}),a.jsx("th",{className:"px-4 py-2.5 text-right font-medium text-muted-foreground",children:"Errors"})]})}),a.jsx("tbody",{children:e.map(t=>a.jsxs("tr",{className:"border-b border-border last:border-0",children:[a.jsx("td",{className:"px-4 py-2.5 font-mono text-xs",children:t.toolName}),a.jsx("td",{className:"px-4 py-2.5",children:a.jsx(he,{variant:"outline",className:"text-[10px]",children:t.category??"—"})}),a.jsx("td",{className:"px-4 py-2.5",children:a.jsx(he,{variant:t.accessPattern==="write"?"warning":t.accessPattern==="admin"?"destructive":"secondary",className:"text-[10px]",children:t.accessPattern??"read"})}),a.jsx("td",{className:"px-4 py-2.5 text-right font-mono text-xs",children:t.callCount}),a.jsx("td",{className:"px-4 py-2.5 text-right font-mono text-xs text-destructive",children:t.errorCount||"—"})]},t.id))})]})})}function Ys({label:e,value:t}){return a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-muted-foreground",children:e}),a.jsx("span",{className:"font-medium",children:t})]})}function eC(){const[e,t]=m.useState([]),[n,r]=m.useState(!0),[s,o]=m.useState(new Set);m.useEffect(()=>{te.discovery.agents().then(c=>{t(c.data??[]),r(!1)}).catch(()=>r(!1))},[]);const i=[{category:"Agents",items:e.map(c=>({id:c.id,name:c.name,emoji:c.emoji,provider:c.provider,status:c.status}))},{category:"Owners",items:[...new Set(e.map(c=>c.ownerName).filter(Boolean))].map(c=>({id:c,name:c,type:"owner"}))},{category:"Connected Systems",items:[...new Set(e.flatMap(c=>c.connectedSystems??[]))].map(c=>({id:c,name:c,type:"system"}))}],l=c=>{o(u=>{const h=new Set(u);return h.has(c)?h.delete(c):h.add(c),h})};return n?a.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Identities"}),a.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Agents, owners, and connected systems"})]}),a.jsx("div",{className:"space-y-3",children:i.map(c=>a.jsxs(fe,{children:[a.jsxs("button",{onClick:()=>l(c.category),className:"flex w-full items-center justify-between p-4 text-left",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Zx,{className:"h-4 w-4 text-muted-foreground"}),a.jsx("span",{className:"text-sm font-medium",children:c.category}),a.jsx(he,{variant:"secondary",className:"text-[10px]",children:c.items.length})]}),s.has(c.category)?a.jsx(pl,{className:"h-4 w-4 text-muted-foreground"}):a.jsx(Zd,{className:"h-4 w-4 text-muted-foreground"})]}),s.has(c.category)&&a.jsx(we,{className:"border-t border-border pt-3",children:c.items.length===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"None"}):a.jsx("div",{className:"space-y-1.5",children:c.items.map(u=>a.jsxs("div",{className:"flex items-center justify-between rounded-md px-3 py-2 text-sm hover:bg-muted/50",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[u.emoji&&a.jsx("span",{className:"text-base",children:u.emoji}),a.jsx("span",{children:u.name})]}),u.status&&a.jsx(he,{variant:u.status==="active"?"success":"secondary",className:"text-[10px]",children:u.status}),u.type&&a.jsx(he,{variant:"outline",className:"text-[10px]",children:u.type})]},u.id))})})]},c.category))})]})}function tC(){const[e,t]=m.useState([]),[n,r]=m.useState(""),[s,o]=m.useState("callCount"),[i,l]=m.useState(!1),[c,u]=m.useState(!0);m.useEffect(()=>{te.observations.permissions().then(f=>{t(f.data??[]),u(!1)}).catch(()=>u(!1))},[]);const h=m.useMemo(()=>{let f=e;if(n){const g=n.toLowerCase();f=f.filter(x=>{var w,N;return((w=x.toolName)==null?void 0:w.toLowerCase().includes(g))||((N=x.category)==null?void 0:N.toLowerCase().includes(g))})}return[...f].sort((g,x)=>{const w=g[s]??0,N=x[s]??0;return typeof w=="string"?i?w.localeCompare(N):N.localeCompare(w):i?w-N:N-w})},[e,n,s,i]),d=f=>{s===f?l(!i):(o(f),l(!1))};return c?a.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Permissions"}),a.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:[e.length," observed tool permission",e.length!==1?"s":""]})]}),a.jsxs("div",{className:"relative max-w-sm",children:[a.jsx(ey,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),a.jsx(me,{placeholder:"Filter by tool or category...",className:"pl-9",value:n,onChange:f=>r(f.target.value)})]}),a.jsx("div",{className:"overflow-x-auto rounded-lg border border-border",children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border bg-muted/50",children:[a.jsx(wc,{label:"Tool",sortKey:"toolName",current:s,asc:i,onSort:d}),a.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Category"}),a.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Access"}),a.jsx(wc,{label:"Calls",sortKey:"callCount",current:s,asc:i,onSort:d,align:"right"}),a.jsx(wc,{label:"Errors",sortKey:"errorCount",current:s,asc:i,onSort:d,align:"right"})]})}),a.jsx("tbody",{children:h.length===0?a.jsx("tr",{children:a.jsx("td",{colSpan:5,className:"px-4 py-8 text-center text-muted-foreground",children:"No permissions"})}):h.map(f=>a.jsxs("tr",{className:"border-b border-border last:border-0 hover:bg-muted/30",children:[a.jsx("td",{className:"px-4 py-2.5 font-mono text-xs",children:f.toolName}),a.jsx("td",{className:"px-4 py-2.5",children:a.jsx(he,{variant:"outline",className:"text-[10px]",children:f.category??"—"})}),a.jsx("td",{className:"px-4 py-2.5",children:a.jsx(he,{variant:f.accessPattern==="write"?"warning":f.accessPattern==="admin"?"destructive":"secondary",className:"text-[10px]",children:f.accessPattern??"read"})}),a.jsx("td",{className:"px-4 py-2.5 text-right font-mono text-xs",children:f.callCount}),a.jsx("td",{className:"px-4 py-2.5 text-right font-mono text-xs text-destructive",children:f.errorCount||"—"})]},f.id))})]})})]})}function wc({label:e,sortKey:t,current:n,asc:r,onSort:s,align:o="left"}){return a.jsx("th",{className:`cursor-pointer px-4 py-2.5 font-medium text-muted-foreground hover:text-foreground ${o==="right"?"text-right":"text-left"}`,onClick:()=>s(t),children:a.jsxs("span",{className:"inline-flex items-center gap-1",children:[e,n===t&&a.jsx(HS,{className:"h-3 w-3"})]})})}function nC(){const[e,t]=m.useState([]),[n,r]=m.useState(!0);m.useEffect(()=>{te.observations.anomalies().then(i=>{t(i.data??[]),r(!1)}).catch(()=>r(!1))},[]);const s=i=>i.blocked||i.errorCount>3?"high":i.callCount===1||i.errorCount>0?"medium":"low",o=i=>i==="high"?"destructive":i==="medium"?"warning":"secondary";return n?a.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Risk Overview"}),a.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:[e.length," anomal",e.length!==1?"ies":"y"," detected"]})]}),e.length===0?a.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 rounded-lg border border-dashed border-border",children:[a.jsx(nf,{className:"h-8 w-8 text-muted-foreground/50"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"No anomalies detected"})]}):a.jsx("div",{className:"overflow-x-auto rounded-lg border border-border",children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border bg-muted/50",children:[a.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Tool"}),a.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Agent"}),a.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Risk"}),a.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Category"}),a.jsx("th",{className:"px-4 py-2.5 text-right font-medium text-muted-foreground",children:"First Seen"})]})}),a.jsx("tbody",{children:e.map(i=>{var c;const l=s(i);return a.jsxs("tr",{className:"border-b border-border last:border-0 hover:bg-muted/30",children:[a.jsx("td",{className:"px-4 py-2.5 font-mono text-xs",children:i.toolName}),a.jsx("td",{className:"px-4 py-2.5 text-xs text-muted-foreground",children:((c=i.agentId)==null?void 0:c.slice(0,8))??"—"}),a.jsx("td",{className:"px-4 py-2.5",children:a.jsx(he,{variant:o(l),className:"text-[10px]",children:l})}),a.jsx("td",{className:"px-4 py-2.5",children:a.jsx(he,{variant:"outline",className:"text-[10px]",children:i.category??"—"})}),a.jsx("td",{className:"px-4 py-2.5 text-right text-xs text-muted-foreground",children:i.firstSeen?new Date(i.firstSeen).toLocaleDateString():"—"})]},i.id)})})]})})]})}function Ae(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=Ae(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var rC={value:()=>{}};function Nl(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new ra(n)}function ra(e){this._=e}function sC(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",s=n.indexOf(".");if(s>=0&&(r=n.slice(s+1),n=n.slice(0,s)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}ra.prototype=Nl.prototype={constructor:ra,on:function(e,t){var n=this._,r=sC(e+"",n),s,o=-1,i=r.length;if(arguments.length<2){for(;++o<i;)if((s=(e=r[o]).type)&&(s=oC(n[s],e.name)))return s;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<i;)if(s=(e=r[o]).type)n[s]=gm(n[s],e.name,t);else if(t==null)for(s in n)n[s]=gm(n[s],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new ra(e)},call:function(e,t){if((s=arguments.length-2)>0)for(var n=new Array(s),r=0,s,o;r<s;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],r=0,s=o.length;r<s;++r)o[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],s=0,o=r.length;s<o;++s)r[s].value.apply(t,n)}};function oC(e,t){for(var n=0,r=e.length,s;n<r;++n)if((s=e[n]).name===t)return s.value}function gm(e,t,n){for(var r=0,s=e.length;r<s;++r)if(e[r].name===t){e[r]=rC,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Tu="http://www.w3.org/1999/xhtml";const xm={svg:"http://www.w3.org/2000/svg",xhtml:Tu,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function jl(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),xm.hasOwnProperty(t)?{space:xm[t],local:e}:e}function iC(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Tu&&t.documentElement.namespaceURI===Tu?t.createElement(e):t.createElementNS(n,e)}}function aC(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Hy(e){var t=jl(e);return(t.local?aC:iC)(t)}function lC(){}function cf(e){return e==null?lC:function(){return this.querySelector(e)}}function cC(e){typeof e!="function"&&(e=cf(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var o=t[s],i=o.length,l=r[s]=new Array(i),c,u,h=0;h<i;++h)(c=o[h])&&(u=e.call(c,c.__data__,h,o))&&("__data__"in c&&(u.__data__=c.__data__),l[h]=u);return new gt(r,this._parents)}function uC(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function dC(){return[]}function By(e){return e==null?dC:function(){return this.querySelectorAll(e)}}function fC(e){return function(){return uC(e.apply(this,arguments))}}function hC(e){typeof e=="function"?e=fC(e):e=By(e);for(var t=this._groups,n=t.length,r=[],s=[],o=0;o<n;++o)for(var i=t[o],l=i.length,c,u=0;u<l;++u)(c=i[u])&&(r.push(e.call(c,c.__data__,u,i)),s.push(c));return new gt(r,s)}function Vy(e){return function(){return this.matches(e)}}function Uy(e){return function(t){return t.matches(e)}}var mC=Array.prototype.find;function pC(e){return function(){return mC.call(this.children,e)}}function gC(){return this.firstElementChild}function xC(e){return this.select(e==null?gC:pC(typeof e=="function"?e:Uy(e)))}var yC=Array.prototype.filter;function vC(){return Array.from(this.children)}function wC(e){return function(){return yC.call(this.children,e)}}function NC(e){return this.selectAll(e==null?vC:wC(typeof e=="function"?e:Uy(e)))}function jC(e){typeof e!="function"&&(e=Vy(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var o=t[s],i=o.length,l=r[s]=[],c,u=0;u<i;++u)(c=o[u])&&e.call(c,c.__data__,u,o)&&l.push(c);return new gt(r,this._parents)}function Wy(e){return new Array(e.length)}function SC(){return new gt(this._enter||this._groups.map(Wy),this._parents)}function Da(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Da.prototype={constructor:Da,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function bC(e){return function(){return e}}function kC(e,t,n,r,s,o){for(var i=0,l,c=t.length,u=o.length;i<u;++i)(l=t[i])?(l.__data__=o[i],r[i]=l):n[i]=new Da(e,o[i]);for(;i<c;++i)(l=t[i])&&(s[i]=l)}function CC(e,t,n,r,s,o,i){var l,c,u=new Map,h=t.length,d=o.length,f=new Array(h),g;for(l=0;l<h;++l)(c=t[l])&&(f[l]=g=i.call(c,c.__data__,l,t)+"",u.has(g)?s[l]=c:u.set(g,c));for(l=0;l<d;++l)g=i.call(e,o[l],l,o)+"",(c=u.get(g))?(r[l]=c,c.__data__=o[l],u.delete(g)):n[l]=new Da(e,o[l]);for(l=0;l<h;++l)(c=t[l])&&u.get(f[l])===c&&(s[l]=c)}function EC(e){return e.__data__}function _C(e,t){if(!arguments.length)return Array.from(this,EC);var n=t?CC:kC,r=this._parents,s=this._groups;typeof e!="function"&&(e=bC(e));for(var o=s.length,i=new Array(o),l=new Array(o),c=new Array(o),u=0;u<o;++u){var h=r[u],d=s[u],f=d.length,g=PC(e.call(h,h&&h.__data__,u,r)),x=g.length,w=l[u]=new Array(x),N=i[u]=new Array(x),p=c[u]=new Array(f);n(h,d,w,N,p,g,t);for(var v=0,y=0,j,S;v<x;++v)if(j=w[v]){for(v>=y&&(y=v+1);!(S=N[y])&&++y<x;);j._next=S||null}}return i=new gt(i,r),i._enter=l,i._exit=c,i}function PC(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function MC(){return new gt(this._exit||this._groups.map(Wy),this._parents)}function IC(e,t,n){var r=this.enter(),s=this,o=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(s=t(s),s&&(s=s.selection())),n==null?o.remove():n(o),r&&s?r.merge(s).order():s}function RC(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,s=n.length,o=r.length,i=Math.min(s,o),l=new Array(s),c=0;c<i;++c)for(var u=n[c],h=r[c],d=u.length,f=l[c]=new Array(d),g,x=0;x<d;++x)(g=u[x]||h[x])&&(f[x]=g);for(;c<s;++c)l[c]=n[c];return new gt(l,this._parents)}function TC(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],s=r.length-1,o=r[s],i;--s>=0;)(i=r[s])&&(o&&i.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(i,o),o=i);return this}function LC(e){e||(e=AC);function t(d,f){return d&&f?e(d.__data__,f.__data__):!d-!f}for(var n=this._groups,r=n.length,s=new Array(r),o=0;o<r;++o){for(var i=n[o],l=i.length,c=s[o]=new Array(l),u,h=0;h<l;++h)(u=i[h])&&(c[h]=u);c.sort(t)}return new gt(s,this._parents).order()}function AC(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function zC(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function DC(){return Array.from(this)}function $C(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],s=0,o=r.length;s<o;++s){var i=r[s];if(i)return i}return null}function OC(){let e=0;for(const t of this)++e;return e}function FC(){return!this.node()}function HC(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var s=t[n],o=0,i=s.length,l;o<i;++o)(l=s[o])&&e.call(l,l.__data__,o,s);return this}function BC(e){return function(){this.removeAttribute(e)}}function VC(e){return function(){this.removeAttributeNS(e.space,e.local)}}function UC(e,t){return function(){this.setAttribute(e,t)}}function WC(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function KC(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function GC(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function YC(e,t){var n=jl(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?VC:BC:typeof t=="function"?n.local?GC:KC:n.local?WC:UC)(n,t))}function Ky(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function XC(e){return function(){this.style.removeProperty(e)}}function QC(e,t,n){return function(){this.style.setProperty(e,t,n)}}function qC(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function ZC(e,t,n){return arguments.length>1?this.each((t==null?XC:typeof t=="function"?qC:QC)(e,t,n??"")):xs(this.node(),e)}function xs(e,t){return e.style.getPropertyValue(t)||Ky(e).getComputedStyle(e,null).getPropertyValue(t)}function JC(e){return function(){delete this[e]}}function eE(e,t){return function(){this[e]=t}}function tE(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function nE(e,t){return arguments.length>1?this.each((t==null?JC:typeof t=="function"?tE:eE)(e,t)):this.node()[e]}function Gy(e){return e.trim().split(/^|\s+/)}function uf(e){return e.classList||new Yy(e)}function Yy(e){this._node=e,this._names=Gy(e.getAttribute("class")||"")}Yy.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Xy(e,t){for(var n=uf(e),r=-1,s=t.length;++r<s;)n.add(t[r])}function Qy(e,t){for(var n=uf(e),r=-1,s=t.length;++r<s;)n.remove(t[r])}function rE(e){return function(){Xy(this,e)}}function sE(e){return function(){Qy(this,e)}}function oE(e,t){return function(){(t.apply(this,arguments)?Xy:Qy)(this,e)}}function iE(e,t){var n=Gy(e+"");if(arguments.length<2){for(var r=uf(this.node()),s=-1,o=n.length;++s<o;)if(!r.contains(n[s]))return!1;return!0}return this.each((typeof t=="function"?oE:t?rE:sE)(n,t))}function aE(){this.textContent=""}function lE(e){return function(){this.textContent=e}}function cE(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function uE(e){return arguments.length?this.each(e==null?aE:(typeof e=="function"?cE:lE)(e)):this.node().textContent}function dE(){this.innerHTML=""}function fE(e){return function(){this.innerHTML=e}}function hE(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function mE(e){return arguments.length?this.each(e==null?dE:(typeof e=="function"?hE:fE)(e)):this.node().innerHTML}function pE(){this.nextSibling&&this.parentNode.appendChild(this)}function gE(){return this.each(pE)}function xE(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function yE(){return this.each(xE)}function vE(e){var t=typeof e=="function"?e:Hy(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function wE(){return null}function NE(e,t){var n=typeof e=="function"?e:Hy(e),r=t==null?wE:typeof t=="function"?t:cf(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function jE(){var e=this.parentNode;e&&e.removeChild(this)}function SE(){return this.each(jE)}function bE(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function kE(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function CE(e){return this.select(e?kE:bE)}function EE(e){return arguments.length?this.property("__data__",e):this.node().__data__}function _E(e){return function(t){e.call(this,t,this.__data__)}}function PE(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function ME(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,s=t.length,o;n<s;++n)o=t[n],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++r]=o;++r?t.length=r:delete this.__on}}}function IE(e,t,n){return function(){var r=this.__on,s,o=_E(t);if(r){for(var i=0,l=r.length;i<l;++i)if((s=r[i]).type===e.type&&s.name===e.name){this.removeEventListener(s.type,s.listener,s.options),this.addEventListener(s.type,s.listener=o,s.options=n),s.value=t;return}}this.addEventListener(e.type,o,n),s={type:e.type,name:e.name,value:t,listener:o,options:n},r?r.push(s):this.__on=[s]}}function RE(e,t,n){var r=PE(e+""),s,o=r.length,i;if(arguments.length<2){var l=this.node().__on;if(l){for(var c=0,u=l.length,h;c<u;++c)for(s=0,h=l[c];s<o;++s)if((i=r[s]).type===h.type&&i.name===h.name)return h.value}return}for(l=t?IE:ME,s=0;s<o;++s)this.each(l(r[s],t,n));return this}function qy(e,t,n){var r=Ky(e),s=r.CustomEvent;typeof s=="function"?s=new s(t,n):(s=r.document.createEvent("Event"),n?(s.initEvent(t,n.bubbles,n.cancelable),s.detail=n.detail):s.initEvent(t,!1,!1)),e.dispatchEvent(s)}function TE(e,t){return function(){return qy(this,e,t)}}function LE(e,t){return function(){return qy(this,e,t.apply(this,arguments))}}function AE(e,t){return this.each((typeof t=="function"?LE:TE)(e,t))}function*zE(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],s=0,o=r.length,i;s<o;++s)(i=r[s])&&(yield i)}var Zy=[null];function gt(e,t){this._groups=e,this._parents=t}function Zo(){return new gt([[document.documentElement]],Zy)}function DE(){return this}gt.prototype=Zo.prototype={constructor:gt,select:cC,selectAll:hC,selectChild:xC,selectChildren:NC,filter:jC,data:_C,enter:SC,exit:MC,join:IC,merge:RC,selection:DE,order:TC,sort:LC,call:zC,nodes:DC,node:$C,size:OC,empty:FC,each:HC,attr:YC,style:ZC,property:nE,classed:iE,text:uE,html:mE,raise:gE,lower:yE,append:vE,insert:NE,remove:SE,clone:CE,datum:EE,on:RE,dispatch:AE,[Symbol.iterator]:zE};function dt(e){return typeof e=="string"?new gt([[document.querySelector(e)]],[document.documentElement]):new gt([[e]],Zy)}function $E(e){let t;for(;t=e.sourceEvent;)e=t;return e}function It(e,t){if(e=$E(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var s=t.getBoundingClientRect();return[e.clientX-s.left-t.clientLeft,e.clientY-s.top-t.clientTop]}}return[e.pageX,e.pageY]}const OE={passive:!1},Ao={capture:!0,passive:!1};function Nc(e){e.stopImmediatePropagation()}function is(e){e.preventDefault(),e.stopImmediatePropagation()}function Jy(e){var t=e.document.documentElement,n=dt(e).on("dragstart.drag",is,Ao);"onselectstart"in t?n.on("selectstart.drag",is,Ao):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function e0(e,t){var n=e.document.documentElement,r=dt(e).on("dragstart.drag",null);t&&(r.on("click.drag",is,Ao),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Mi=e=>()=>e;function Lu(e,{sourceEvent:t,subject:n,target:r,identifier:s,active:o,x:i,y:l,dx:c,dy:u,dispatch:h}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:i,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:h}})}Lu.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function FE(e){return!e.ctrlKey&&!e.button}function HE(){return this.parentNode}function BE(e,t){return t??{x:e.x,y:e.y}}function VE(){return navigator.maxTouchPoints||"ontouchstart"in this}function t0(){var e=FE,t=HE,n=BE,r=VE,s={},o=Nl("start","drag","end"),i=0,l,c,u,h,d=0;function f(j){j.on("mousedown.drag",g).filter(r).on("touchstart.drag",N).on("touchmove.drag",p,OE).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(j,S){if(!(h||!e.call(this,j,S))){var C=y(this,t.call(this,j,S),j,S,"mouse");C&&(dt(j.view).on("mousemove.drag",x,Ao).on("mouseup.drag",w,Ao),Jy(j.view),Nc(j),u=!1,l=j.clientX,c=j.clientY,C("start",j))}}function x(j){if(is(j),!u){var S=j.clientX-l,C=j.clientY-c;u=S*S+C*C>d}s.mouse("drag",j)}function w(j){dt(j.view).on("mousemove.drag mouseup.drag",null),e0(j.view,u),is(j),s.mouse("end",j)}function N(j,S){if(e.call(this,j,S)){var C=j.changedTouches,b=t.call(this,j,S),P=C.length,I,$;for(I=0;I<P;++I)($=y(this,b,j,S,C[I].identifier,C[I]))&&(Nc(j),$("start",j,C[I]))}}function p(j){var S=j.changedTouches,C=S.length,b,P;for(b=0;b<C;++b)(P=s[S[b].identifier])&&(is(j),P("drag",j,S[b]))}function v(j){var S=j.changedTouches,C=S.length,b,P;for(h&&clearTimeout(h),h=setTimeout(function(){h=null},500),b=0;b<C;++b)(P=s[S[b].identifier])&&(Nc(j),P("end",j,S[b]))}function y(j,S,C,b,P,I){var $=o.copy(),R=It(I||C,S),T,D,E;if((E=n.call(j,new Lu("beforestart",{sourceEvent:C,target:f,identifier:P,active:i,x:R[0],y:R[1],dx:0,dy:0,dispatch:$}),b))!=null)return T=E.x-R[0]||0,D=E.y-R[1]||0,function L(k,z,_){var M=R,A;switch(k){case"start":s[P]=L,A=i++;break;case"end":delete s[P],--i;case"drag":R=It(_||z,S),A=i;break}$.call(k,j,new Lu(k,{sourceEvent:z,subject:E,target:f,identifier:P,active:A,x:R[0]+T,y:R[1]+D,dx:R[0]-M[0],dy:R[1]-M[1],dispatch:$}),b)}}return f.filter=function(j){return arguments.length?(e=typeof j=="function"?j:Mi(!!j),f):e},f.container=function(j){return arguments.length?(t=typeof j=="function"?j:Mi(j),f):t},f.subject=function(j){return arguments.length?(n=typeof j=="function"?j:Mi(j),f):n},f.touchable=function(j){return arguments.length?(r=typeof j=="function"?j:Mi(!!j),f):r},f.on=function(){var j=o.on.apply(o,arguments);return j===o?f:j},f.clickDistance=function(j){return arguments.length?(d=(j=+j)*j,f):Math.sqrt(d)},f}function df(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function n0(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Jo(){}var zo=.7,$a=1/zo,as="\\s*([+-]?\\d+)\\s*",Do="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",qt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",UE=/^#([0-9a-f]{3,8})$/,WE=new RegExp(`^rgb\\(${as},${as},${as}\\)$`),KE=new RegExp(`^rgb\\(${qt},${qt},${qt}\\)$`),GE=new RegExp(`^rgba\\(${as},${as},${as},${Do}\\)$`),YE=new RegExp(`^rgba\\(${qt},${qt},${qt},${Do}\\)$`),XE=new RegExp(`^hsl\\(${Do},${qt},${qt}\\)$`),QE=new RegExp(`^hsla\\(${Do},${qt},${qt},${Do}\\)$`),ym={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};df(Jo,Sr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:vm,formatHex:vm,formatHex8:qE,formatHsl:ZE,formatRgb:wm,toString:wm});function vm(){return this.rgb().formatHex()}function qE(){return this.rgb().formatHex8()}function ZE(){return r0(this).formatHsl()}function wm(){return this.rgb().formatRgb()}function Sr(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=UE.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Nm(t):n===3?new it(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Ii(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Ii(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=WE.exec(e))?new it(t[1],t[2],t[3],1):(t=KE.exec(e))?new it(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=GE.exec(e))?Ii(t[1],t[2],t[3],t[4]):(t=YE.exec(e))?Ii(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=XE.exec(e))?bm(t[1],t[2]/100,t[3]/100,1):(t=QE.exec(e))?bm(t[1],t[2]/100,t[3]/100,t[4]):ym.hasOwnProperty(e)?Nm(ym[e]):e==="transparent"?new it(NaN,NaN,NaN,0):null}function Nm(e){return new it(e>>16&255,e>>8&255,e&255,1)}function Ii(e,t,n,r){return r<=0&&(e=t=n=NaN),new it(e,t,n,r)}function JE(e){return e instanceof Jo||(e=Sr(e)),e?(e=e.rgb(),new it(e.r,e.g,e.b,e.opacity)):new it}function Au(e,t,n,r){return arguments.length===1?JE(e):new it(e,t,n,r??1)}function it(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}df(it,Au,n0(Jo,{brighter(e){return e=e==null?$a:Math.pow($a,e),new it(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?zo:Math.pow(zo,e),new it(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new it(mr(this.r),mr(this.g),mr(this.b),Oa(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:jm,formatHex:jm,formatHex8:e_,formatRgb:Sm,toString:Sm}));function jm(){return`#${dr(this.r)}${dr(this.g)}${dr(this.b)}`}function e_(){return`#${dr(this.r)}${dr(this.g)}${dr(this.b)}${dr((isNaN(this.opacity)?1:this.opacity)*255)}`}function Sm(){const e=Oa(this.opacity);return`${e===1?"rgb(":"rgba("}${mr(this.r)}, ${mr(this.g)}, ${mr(this.b)}${e===1?")":`, ${e})`}`}function Oa(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function mr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function dr(e){return e=mr(e),(e<16?"0":"")+e.toString(16)}function bm(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Tt(e,t,n,r)}function r0(e){if(e instanceof Tt)return new Tt(e.h,e.s,e.l,e.opacity);if(e instanceof Jo||(e=Sr(e)),!e)return new Tt;if(e instanceof Tt)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,s=Math.min(t,n,r),o=Math.max(t,n,r),i=NaN,l=o-s,c=(o+s)/2;return l?(t===o?i=(n-r)/l+(n<r)*6:n===o?i=(r-t)/l+2:i=(t-n)/l+4,l/=c<.5?o+s:2-o-s,i*=60):l=c>0&&c<1?0:i,new Tt(i,l,c,e.opacity)}function t_(e,t,n,r){return arguments.length===1?r0(e):new Tt(e,t,n,r??1)}function Tt(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}df(Tt,t_,n0(Jo,{brighter(e){return e=e==null?$a:Math.pow($a,e),new Tt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?zo:Math.pow(zo,e),new Tt(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,s=2*n-r;return new it(jc(e>=240?e-240:e+120,s,r),jc(e,s,r),jc(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new Tt(km(this.h),Ri(this.s),Ri(this.l),Oa(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=Oa(this.opacity);return`${e===1?"hsl(":"hsla("}${km(this.h)}, ${Ri(this.s)*100}%, ${Ri(this.l)*100}%${e===1?")":`, ${e})`}`}}));function km(e){return e=(e||0)%360,e<0?e+360:e}function Ri(e){return Math.max(0,Math.min(1,e||0))}function jc(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const ff=e=>()=>e;function n_(e,t){return function(n){return e+n*t}}function r_(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function s_(e){return(e=+e)==1?s0:function(t,n){return n-t?r_(t,n,e):ff(isNaN(t)?n:t)}}function s0(e,t){var n=t-e;return n?n_(e,n):ff(isNaN(e)?t:e)}const Fa=function e(t){var n=s_(t);function r(s,o){var i=n((s=Au(s)).r,(o=Au(o)).r),l=n(s.g,o.g),c=n(s.b,o.b),u=s0(s.opacity,o.opacity);return function(h){return s.r=i(h),s.g=l(h),s.b=c(h),s.opacity=u(h),s+""}}return r.gamma=e,r}(1);function o_(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),s;return function(o){for(s=0;s<n;++s)r[s]=e[s]*(1-o)+t[s]*o;return r}}function i_(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function a_(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,s=new Array(r),o=new Array(n),i;for(i=0;i<r;++i)s[i]=mo(e[i],t[i]);for(;i<n;++i)o[i]=t[i];return function(l){for(i=0;i<r;++i)o[i]=s[i](l);return o}}function l_(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Kt(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function c_(e,t){var n={},r={},s;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(s in t)s in e?n[s]=mo(e[s],t[s]):r[s]=t[s];return function(o){for(s in n)r[s]=n[s](o);return r}}var zu=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Sc=new RegExp(zu.source,"g");function u_(e){return function(){return e}}function d_(e){return function(t){return e(t)+""}}function o0(e,t){var n=zu.lastIndex=Sc.lastIndex=0,r,s,o,i=-1,l=[],c=[];for(e=e+"",t=t+"";(r=zu.exec(e))&&(s=Sc.exec(t));)(o=s.index)>n&&(o=t.slice(n,o),l[i]?l[i]+=o:l[++i]=o),(r=r[0])===(s=s[0])?l[i]?l[i]+=s:l[++i]=s:(l[++i]=null,c.push({i,x:Kt(r,s)})),n=Sc.lastIndex;return n<t.length&&(o=t.slice(n),l[i]?l[i]+=o:l[++i]=o),l.length<2?c[0]?d_(c[0].x):u_(t):(t=c.length,function(u){for(var h=0,d;h<t;++h)l[(d=c[h]).i]=d.x(u);return l.join("")})}function mo(e,t){var n=typeof t,r;return t==null||n==="boolean"?ff(t):(n==="number"?Kt:n==="string"?(r=Sr(t))?(t=r,Fa):o0:t instanceof Sr?Fa:t instanceof Date?l_:i_(t)?o_:Array.isArray(t)?a_:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?c_:Kt)(e,t)}var Cm=180/Math.PI,Du={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function i0(e,t,n,r,s,o){var i,l,c;return(i=Math.sqrt(e*e+t*t))&&(e/=i,t/=i),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,c/=l),e*r<t*n&&(e=-e,t=-t,c=-c,i=-i),{translateX:s,translateY:o,rotate:Math.atan2(t,e)*Cm,skewX:Math.atan(c)*Cm,scaleX:i,scaleY:l}}var Ti;function f_(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Du:i0(t.a,t.b,t.c,t.d,t.e,t.f)}function h_(e){return e==null||(Ti||(Ti=document.createElementNS("http://www.w3.org/2000/svg","g")),Ti.setAttribute("transform",e),!(e=Ti.transform.baseVal.consolidate()))?Du:(e=e.matrix,i0(e.a,e.b,e.c,e.d,e.e,e.f))}function a0(e,t,n,r){function s(u){return u.length?u.pop()+" ":""}function o(u,h,d,f,g,x){if(u!==d||h!==f){var w=g.push("translate(",null,t,null,n);x.push({i:w-4,x:Kt(u,d)},{i:w-2,x:Kt(h,f)})}else(d||f)&&g.push("translate("+d+t+f+n)}function i(u,h,d,f){u!==h?(u-h>180?h+=360:h-u>180&&(u+=360),f.push({i:d.push(s(d)+"rotate(",null,r)-2,x:Kt(u,h)})):h&&d.push(s(d)+"rotate("+h+r)}function l(u,h,d,f){u!==h?f.push({i:d.push(s(d)+"skewX(",null,r)-2,x:Kt(u,h)}):h&&d.push(s(d)+"skewX("+h+r)}function c(u,h,d,f,g,x){if(u!==d||h!==f){var w=g.push(s(g)+"scale(",null,",",null,")");x.push({i:w-4,x:Kt(u,d)},{i:w-2,x:Kt(h,f)})}else(d!==1||f!==1)&&g.push(s(g)+"scale("+d+","+f+")")}return function(u,h){var d=[],f=[];return u=e(u),h=e(h),o(u.translateX,u.translateY,h.translateX,h.translateY,d,f),i(u.rotate,h.rotate,d,f),l(u.skewX,h.skewX,d,f),c(u.scaleX,u.scaleY,h.scaleX,h.scaleY,d,f),u=h=null,function(g){for(var x=-1,w=f.length,N;++x<w;)d[(N=f[x]).i]=N.x(g);return d.join("")}}}var m_=a0(f_,"px, ","px)","deg)"),p_=a0(h_,", ",")",")"),g_=1e-12;function Em(e){return((e=Math.exp(e))+1/e)/2}function x_(e){return((e=Math.exp(e))-1/e)/2}function y_(e){return((e=Math.exp(2*e))-1)/(e+1)}const sa=function e(t,n,r){function s(o,i){var l=o[0],c=o[1],u=o[2],h=i[0],d=i[1],f=i[2],g=h-l,x=d-c,w=g*g+x*x,N,p;if(w<g_)p=Math.log(f/u)/t,N=function(b){return[l+b*g,c+b*x,u*Math.exp(t*b*p)]};else{var v=Math.sqrt(w),y=(f*f-u*u+r*w)/(2*u*n*v),j=(f*f-u*u-r*w)/(2*f*n*v),S=Math.log(Math.sqrt(y*y+1)-y),C=Math.log(Math.sqrt(j*j+1)-j);p=(C-S)/t,N=function(b){var P=b*p,I=Em(S),$=u/(n*v)*(I*y_(t*P+S)-x_(S));return[l+$*g,c+$*x,u*I/Em(t*P+S)]}}return N.duration=p*1e3*t/Math.SQRT2,N}return s.rho=function(o){var i=Math.max(.001,+o),l=i*i,c=l*l;return e(i,l,c)},s}(Math.SQRT2,2,4);var ys=0,to=0,Xs=0,l0=1e3,Ha,no,Ba=0,br=0,Sl=0,$o=typeof performance=="object"&&performance.now?performance:Date,c0=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function hf(){return br||(c0(v_),br=$o.now()+Sl)}function v_(){br=0}function Va(){this._call=this._time=this._next=null}Va.prototype=u0.prototype={constructor:Va,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?hf():+n)+(t==null?0:+t),!this._next&&no!==this&&(no?no._next=this:Ha=this,no=this),this._call=e,this._time=n,$u()},stop:function(){this._call&&(this._call=null,this._time=1/0,$u())}};function u0(e,t,n){var r=new Va;return r.restart(e,t,n),r}function w_(){hf(),++ys;for(var e=Ha,t;e;)(t=br-e._time)>=0&&e._call.call(void 0,t),e=e._next;--ys}function _m(){br=(Ba=$o.now())+Sl,ys=to=0;try{w_()}finally{ys=0,j_(),br=0}}function N_(){var e=$o.now(),t=e-Ba;t>l0&&(Sl-=t,Ba=e)}function j_(){for(var e,t=Ha,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Ha=n);no=e,$u(r)}function $u(e){if(!ys){to&&(to=clearTimeout(to));var t=e-br;t>24?(e<1/0&&(to=setTimeout(_m,e-$o.now()-Sl)),Xs&&(Xs=clearInterval(Xs))):(Xs||(Ba=$o.now(),Xs=setInterval(N_,l0)),ys=1,c0(_m))}}function Pm(e,t,n){var r=new Va;return t=t==null?0:+t,r.restart(s=>{r.stop(),e(s+t)},t,n),r}var S_=Nl("start","end","cancel","interrupt"),b_=[],d0=0,Mm=1,Ou=2,oa=3,Im=4,Fu=5,ia=6;function bl(e,t,n,r,s,o){var i=e.__transition;if(!i)e.__transition={};else if(n in i)return;k_(e,n,{name:t,index:r,group:s,on:S_,tween:b_,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:d0})}function mf(e,t){var n=Bt(e,t);if(n.state>d0)throw new Error("too late; already scheduled");return n}function nn(e,t){var n=Bt(e,t);if(n.state>oa)throw new Error("too late; already running");return n}function Bt(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function k_(e,t,n){var r=e.__transition,s;r[t]=n,n.timer=u0(o,0,n.time);function o(u){n.state=Mm,n.timer.restart(i,n.delay,n.time),n.delay<=u&&i(u-n.delay)}function i(u){var h,d,f,g;if(n.state!==Mm)return c();for(h in r)if(g=r[h],g.name===n.name){if(g.state===oa)return Pm(i);g.state===Im?(g.state=ia,g.timer.stop(),g.on.call("interrupt",e,e.__data__,g.index,g.group),delete r[h]):+h<t&&(g.state=ia,g.timer.stop(),g.on.call("cancel",e,e.__data__,g.index,g.group),delete r[h])}if(Pm(function(){n.state===oa&&(n.state=Im,n.timer.restart(l,n.delay,n.time),l(u))}),n.state=Ou,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Ou){for(n.state=oa,s=new Array(f=n.tween.length),h=0,d=-1;h<f;++h)(g=n.tween[h].value.call(e,e.__data__,n.index,n.group))&&(s[++d]=g);s.length=d+1}}function l(u){for(var h=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(c),n.state=Fu,1),d=-1,f=s.length;++d<f;)s[d].call(e,h);n.state===Fu&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=ia,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}}function aa(e,t){var n=e.__transition,r,s,o=!0,i;if(n){t=t==null?null:t+"";for(i in n){if((r=n[i]).name!==t){o=!1;continue}s=r.state>Ou&&r.state<Fu,r.state=ia,r.timer.stop(),r.on.call(s?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[i]}o&&delete e.__transition}}function C_(e){return this.each(function(){aa(this,e)})}function E_(e,t){var n,r;return function(){var s=nn(this,e),o=s.tween;if(o!==n){r=n=o;for(var i=0,l=r.length;i<l;++i)if(r[i].name===t){r=r.slice(),r.splice(i,1);break}}s.tween=r}}function __(e,t,n){var r,s;if(typeof n!="function")throw new Error;return function(){var o=nn(this,e),i=o.tween;if(i!==r){s=(r=i).slice();for(var l={name:t,value:n},c=0,u=s.length;c<u;++c)if(s[c].name===t){s[c]=l;break}c===u&&s.push(l)}o.tween=s}}function P_(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Bt(this.node(),n).tween,s=0,o=r.length,i;s<o;++s)if((i=r[s]).name===e)return i.value;return null}return this.each((t==null?E_:__)(n,e,t))}function pf(e,t,n){var r=e._id;return e.each(function(){var s=nn(this,r);(s.value||(s.value={}))[t]=n.apply(this,arguments)}),function(s){return Bt(s,r).value[t]}}function f0(e,t){var n;return(typeof t=="number"?Kt:t instanceof Sr?Fa:(n=Sr(t))?(t=n,Fa):o0)(e,t)}function M_(e){return function(){this.removeAttribute(e)}}function I_(e){return function(){this.removeAttributeNS(e.space,e.local)}}function R_(e,t,n){var r,s=n+"",o;return function(){var i=this.getAttribute(e);return i===s?null:i===r?o:o=t(r=i,n)}}function T_(e,t,n){var r,s=n+"",o;return function(){var i=this.getAttributeNS(e.space,e.local);return i===s?null:i===r?o:o=t(r=i,n)}}function L_(e,t,n){var r,s,o;return function(){var i,l=n(this),c;return l==null?void this.removeAttribute(e):(i=this.getAttribute(e),c=l+"",i===c?null:i===r&&c===s?o:(s=c,o=t(r=i,l)))}}function A_(e,t,n){var r,s,o;return function(){var i,l=n(this),c;return l==null?void this.removeAttributeNS(e.space,e.local):(i=this.getAttributeNS(e.space,e.local),c=l+"",i===c?null:i===r&&c===s?o:(s=c,o=t(r=i,l)))}}function z_(e,t){var n=jl(e),r=n==="transform"?p_:f0;return this.attrTween(e,typeof t=="function"?(n.local?A_:L_)(n,r,pf(this,"attr."+e,t)):t==null?(n.local?I_:M_)(n):(n.local?T_:R_)(n,r,t))}function D_(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function $_(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function O_(e,t){var n,r;function s(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&$_(e,o)),n}return s._value=t,s}function F_(e,t){var n,r;function s(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&D_(e,o)),n}return s._value=t,s}function H_(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=jl(e);return this.tween(n,(r.local?O_:F_)(r,t))}function B_(e,t){return function(){mf(this,e).delay=+t.apply(this,arguments)}}function V_(e,t){return t=+t,function(){mf(this,e).delay=t}}function U_(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?B_:V_)(t,e)):Bt(this.node(),t).delay}function W_(e,t){return function(){nn(this,e).duration=+t.apply(this,arguments)}}function K_(e,t){return t=+t,function(){nn(this,e).duration=t}}function G_(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?W_:K_)(t,e)):Bt(this.node(),t).duration}function Y_(e,t){if(typeof t!="function")throw new Error;return function(){nn(this,e).ease=t}}function X_(e){var t=this._id;return arguments.length?this.each(Y_(t,e)):Bt(this.node(),t).ease}function Q_(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;nn(this,e).ease=n}}function q_(e){if(typeof e!="function")throw new Error;return this.each(Q_(this._id,e))}function Z_(e){typeof e!="function"&&(e=Vy(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var o=t[s],i=o.length,l=r[s]=[],c,u=0;u<i;++u)(c=o[u])&&e.call(c,c.__data__,u,o)&&l.push(c);return new yn(r,this._parents,this._name,this._id)}function J_(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,s=n.length,o=Math.min(r,s),i=new Array(r),l=0;l<o;++l)for(var c=t[l],u=n[l],h=c.length,d=i[l]=new Array(h),f,g=0;g<h;++g)(f=c[g]||u[g])&&(d[g]=f);for(;l<r;++l)i[l]=t[l];return new yn(i,this._parents,this._name,this._id)}function e3(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function t3(e,t,n){var r,s,o=e3(t)?mf:nn;return function(){var i=o(this,e),l=i.on;l!==r&&(s=(r=l).copy()).on(t,n),i.on=s}}function n3(e,t){var n=this._id;return arguments.length<2?Bt(this.node(),n).on.on(e):this.each(t3(n,e,t))}function r3(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function s3(){return this.on("end.remove",r3(this._id))}function o3(e){var t=this._name,n=this._id;typeof e!="function"&&(e=cf(e));for(var r=this._groups,s=r.length,o=new Array(s),i=0;i<s;++i)for(var l=r[i],c=l.length,u=o[i]=new Array(c),h,d,f=0;f<c;++f)(h=l[f])&&(d=e.call(h,h.__data__,f,l))&&("__data__"in h&&(d.__data__=h.__data__),u[f]=d,bl(u[f],t,n,f,u,Bt(h,n)));return new yn(o,this._parents,t,n)}function i3(e){var t=this._name,n=this._id;typeof e!="function"&&(e=By(e));for(var r=this._groups,s=r.length,o=[],i=[],l=0;l<s;++l)for(var c=r[l],u=c.length,h,d=0;d<u;++d)if(h=c[d]){for(var f=e.call(h,h.__data__,d,c),g,x=Bt(h,n),w=0,N=f.length;w<N;++w)(g=f[w])&&bl(g,t,n,w,f,x);o.push(f),i.push(h)}return new yn(o,i,t,n)}var a3=Zo.prototype.constructor;function l3(){return new a3(this._groups,this._parents)}function c3(e,t){var n,r,s;return function(){var o=xs(this,e),i=(this.style.removeProperty(e),xs(this,e));return o===i?null:o===n&&i===r?s:s=t(n=o,r=i)}}function h0(e){return function(){this.style.removeProperty(e)}}function u3(e,t,n){var r,s=n+"",o;return function(){var i=xs(this,e);return i===s?null:i===r?o:o=t(r=i,n)}}function d3(e,t,n){var r,s,o;return function(){var i=xs(this,e),l=n(this),c=l+"";return l==null&&(c=l=(this.style.removeProperty(e),xs(this,e))),i===c?null:i===r&&c===s?o:(s=c,o=t(r=i,l))}}function f3(e,t){var n,r,s,o="style."+t,i="end."+o,l;return function(){var c=nn(this,e),u=c.on,h=c.value[o]==null?l||(l=h0(t)):void 0;(u!==n||s!==h)&&(r=(n=u).copy()).on(i,s=h),c.on=r}}function h3(e,t,n){var r=(e+="")=="transform"?m_:f0;return t==null?this.styleTween(e,c3(e,r)).on("end.style."+e,h0(e)):typeof t=="function"?this.styleTween(e,d3(e,r,pf(this,"style."+e,t))).each(f3(this._id,e)):this.styleTween(e,u3(e,r,t),n).on("end.style."+e,null)}function m3(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function p3(e,t,n){var r,s;function o(){var i=t.apply(this,arguments);return i!==s&&(r=(s=i)&&m3(e,i,n)),r}return o._value=t,o}function g3(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,p3(e,t,n??""))}function x3(e){return function(){this.textContent=e}}function y3(e){return function(){var t=e(this);this.textContent=t??""}}function v3(e){return this.tween("text",typeof e=="function"?y3(pf(this,"text",e)):x3(e==null?"":e+""))}function w3(e){return function(t){this.textContent=e.call(this,t)}}function N3(e){var t,n;function r(){var s=e.apply(this,arguments);return s!==n&&(t=(n=s)&&w3(s)),t}return r._value=e,r}function j3(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,N3(e))}function S3(){for(var e=this._name,t=this._id,n=m0(),r=this._groups,s=r.length,o=0;o<s;++o)for(var i=r[o],l=i.length,c,u=0;u<l;++u)if(c=i[u]){var h=Bt(c,t);bl(c,e,n,u,i,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new yn(r,this._parents,e,n)}function b3(){var e,t,n=this,r=n._id,s=n.size();return new Promise(function(o,i){var l={value:i},c={value:function(){--s===0&&o()}};n.each(function(){var u=nn(this,r),h=u.on;h!==e&&(t=(e=h).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(c)),u.on=t}),s===0&&o()})}var k3=0;function yn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function m0(){return++k3}var on=Zo.prototype;yn.prototype={constructor:yn,select:o3,selectAll:i3,selectChild:on.selectChild,selectChildren:on.selectChildren,filter:Z_,merge:J_,selection:l3,transition:S3,call:on.call,nodes:on.nodes,node:on.node,size:on.size,empty:on.empty,each:on.each,on:n3,attr:z_,attrTween:H_,style:h3,styleTween:g3,text:v3,textTween:j3,remove:s3,tween:P_,delay:U_,duration:G_,ease:X_,easeVarying:q_,end:b3,[Symbol.iterator]:on[Symbol.iterator]};function C3(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var E3={time:null,delay:0,duration:250,ease:C3};function _3(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function P3(e){var t,n;e instanceof yn?(t=e._id,e=e._name):(t=m0(),(n=E3).time=hf(),e=e==null?null:e+"");for(var r=this._groups,s=r.length,o=0;o<s;++o)for(var i=r[o],l=i.length,c,u=0;u<l;++u)(c=i[u])&&bl(c,e,t,u,i,n||_3(c,t));return new yn(r,this._parents,e,t)}Zo.prototype.interrupt=C_;Zo.prototype.transition=P3;const Li=e=>()=>e;function M3(e,{sourceEvent:t,target:n,transform:r,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:s}})}function dn(e,t,n){this.k=e,this.x=t,this.y=n}dn.prototype={constructor:dn,scale:function(e){return e===1?this:new dn(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new dn(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var kl=new dn(1,0,0);p0.prototype=dn.prototype;function p0(e){for(;!e.__zoom;)if(!(e=e.parentNode))return kl;return e.__zoom}function bc(e){e.stopImmediatePropagation()}function Qs(e){e.preventDefault(),e.stopImmediatePropagation()}function I3(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function R3(){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 Rm(){return this.__zoom||kl}function T3(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function L3(){return navigator.maxTouchPoints||"ontouchstart"in this}function A3(e,t,n){var r=e.invertX(t[0][0])-n[0][0],s=e.invertX(t[1][0])-n[1][0],o=e.invertY(t[0][1])-n[0][1],i=e.invertY(t[1][1])-n[1][1];return e.translate(s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s),i>o?(o+i)/2:Math.min(0,o)||Math.max(0,i))}function g0(){var e=I3,t=R3,n=A3,r=T3,s=L3,o=[0,1/0],i=[[-1/0,-1/0],[1/0,1/0]],l=250,c=sa,u=Nl("start","zoom","end"),h,d,f,g=500,x=150,w=0,N=10;function p(E){E.property("__zoom",Rm).on("wheel.zoom",P,{passive:!1}).on("mousedown.zoom",I).on("dblclick.zoom",$).filter(s).on("touchstart.zoom",R).on("touchmove.zoom",T).on("touchend.zoom touchcancel.zoom",D).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}p.transform=function(E,L,k,z){var _=E.selection?E.selection():E;_.property("__zoom",Rm),E!==_?S(E,L,k,z):_.interrupt().each(function(){C(this,arguments).event(z).start().zoom(null,typeof L=="function"?L.apply(this,arguments):L).end()})},p.scaleBy=function(E,L,k,z){p.scaleTo(E,function(){var _=this.__zoom.k,M=typeof L=="function"?L.apply(this,arguments):L;return _*M},k,z)},p.scaleTo=function(E,L,k,z){p.transform(E,function(){var _=t.apply(this,arguments),M=this.__zoom,A=k==null?j(_):typeof k=="function"?k.apply(this,arguments):k,F=M.invert(A),O=typeof L=="function"?L.apply(this,arguments):L;return n(y(v(M,O),A,F),_,i)},k,z)},p.translateBy=function(E,L,k,z){p.transform(E,function(){return n(this.__zoom.translate(typeof L=="function"?L.apply(this,arguments):L,typeof k=="function"?k.apply(this,arguments):k),t.apply(this,arguments),i)},null,z)},p.translateTo=function(E,L,k,z,_){p.transform(E,function(){var M=t.apply(this,arguments),A=this.__zoom,F=z==null?j(M):typeof z=="function"?z.apply(this,arguments):z;return n(kl.translate(F[0],F[1]).scale(A.k).translate(typeof L=="function"?-L.apply(this,arguments):-L,typeof k=="function"?-k.apply(this,arguments):-k),M,i)},z,_)};function v(E,L){return L=Math.max(o[0],Math.min(o[1],L)),L===E.k?E:new dn(L,E.x,E.y)}function y(E,L,k){var z=L[0]-k[0]*E.k,_=L[1]-k[1]*E.k;return z===E.x&&_===E.y?E:new dn(E.k,z,_)}function j(E){return[(+E[0][0]+ +E[1][0])/2,(+E[0][1]+ +E[1][1])/2]}function S(E,L,k,z){E.on("start.zoom",function(){C(this,arguments).event(z).start()}).on("interrupt.zoom end.zoom",function(){C(this,arguments).event(z).end()}).tween("zoom",function(){var _=this,M=arguments,A=C(_,M).event(z),F=t.apply(_,M),O=k==null?j(F):typeof k=="function"?k.apply(_,M):k,U=Math.max(F[1][0]-F[0][0],F[1][1]-F[0][1]),V=_.__zoom,G=typeof L=="function"?L.apply(_,M):L,Y=c(V.invert(O).concat(U/V.k),G.invert(O).concat(U/G.k));return function(X){if(X===1)X=G;else{var B=Y(X),Z=U/B[2];X=new dn(Z,O[0]-B[0]*Z,O[1]-B[1]*Z)}A.zoom(null,X)}})}function C(E,L,k){return!k&&E.__zooming||new b(E,L)}function b(E,L){this.that=E,this.args=L,this.active=0,this.sourceEvent=null,this.extent=t.apply(E,L),this.taps=0}b.prototype={event:function(E){return E&&(this.sourceEvent=E),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(E,L){return this.mouse&&E!=="mouse"&&(this.mouse[1]=L.invert(this.mouse[0])),this.touch0&&E!=="touch"&&(this.touch0[1]=L.invert(this.touch0[0])),this.touch1&&E!=="touch"&&(this.touch1[1]=L.invert(this.touch1[0])),this.that.__zoom=L,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(E){var L=dt(this.that).datum();u.call(E,this.that,new M3(E,{sourceEvent:this.sourceEvent,target:p,transform:this.that.__zoom,dispatch:u}),L)}};function P(E,...L){if(!e.apply(this,arguments))return;var k=C(this,L).event(E),z=this.__zoom,_=Math.max(o[0],Math.min(o[1],z.k*Math.pow(2,r.apply(this,arguments)))),M=It(E);if(k.wheel)(k.mouse[0][0]!==M[0]||k.mouse[0][1]!==M[1])&&(k.mouse[1]=z.invert(k.mouse[0]=M)),clearTimeout(k.wheel);else{if(z.k===_)return;k.mouse=[M,z.invert(M)],aa(this),k.start()}Qs(E),k.wheel=setTimeout(A,x),k.zoom("mouse",n(y(v(z,_),k.mouse[0],k.mouse[1]),k.extent,i));function A(){k.wheel=null,k.end()}}function I(E,...L){if(f||!e.apply(this,arguments))return;var k=E.currentTarget,z=C(this,L,!0).event(E),_=dt(E.view).on("mousemove.zoom",O,!0).on("mouseup.zoom",U,!0),M=It(E,k),A=E.clientX,F=E.clientY;Jy(E.view),bc(E),z.mouse=[M,this.__zoom.invert(M)],aa(this),z.start();function O(V){if(Qs(V),!z.moved){var G=V.clientX-A,Y=V.clientY-F;z.moved=G*G+Y*Y>w}z.event(V).zoom("mouse",n(y(z.that.__zoom,z.mouse[0]=It(V,k),z.mouse[1]),z.extent,i))}function U(V){_.on("mousemove.zoom mouseup.zoom",null),e0(V.view,z.moved),Qs(V),z.event(V).end()}}function $(E,...L){if(e.apply(this,arguments)){var k=this.__zoom,z=It(E.changedTouches?E.changedTouches[0]:E,this),_=k.invert(z),M=k.k*(E.shiftKey?.5:2),A=n(y(v(k,M),z,_),t.apply(this,L),i);Qs(E),l>0?dt(this).transition().duration(l).call(S,A,z,E):dt(this).call(p.transform,A,z,E)}}function R(E,...L){if(e.apply(this,arguments)){var k=E.touches,z=k.length,_=C(this,L,E.changedTouches.length===z).event(E),M,A,F,O;for(bc(E),A=0;A<z;++A)F=k[A],O=It(F,this),O=[O,this.__zoom.invert(O),F.identifier],_.touch0?!_.touch1&&_.touch0[2]!==O[2]&&(_.touch1=O,_.taps=0):(_.touch0=O,M=!0,_.taps=1+!!h);h&&(h=clearTimeout(h)),M&&(_.taps<2&&(d=O[0],h=setTimeout(function(){h=null},g)),aa(this),_.start())}}function T(E,...L){if(this.__zooming){var k=C(this,L).event(E),z=E.changedTouches,_=z.length,M,A,F,O;for(Qs(E),M=0;M<_;++M)A=z[M],F=It(A,this),k.touch0&&k.touch0[2]===A.identifier?k.touch0[0]=F:k.touch1&&k.touch1[2]===A.identifier&&(k.touch1[0]=F);if(A=k.that.__zoom,k.touch1){var U=k.touch0[0],V=k.touch0[1],G=k.touch1[0],Y=k.touch1[1],X=(X=G[0]-U[0])*X+(X=G[1]-U[1])*X,B=(B=Y[0]-V[0])*B+(B=Y[1]-V[1])*B;A=v(A,Math.sqrt(X/B)),F=[(U[0]+G[0])/2,(U[1]+G[1])/2],O=[(V[0]+Y[0])/2,(V[1]+Y[1])/2]}else if(k.touch0)F=k.touch0[0],O=k.touch0[1];else return;k.zoom("touch",n(y(A,F,O),k.extent,i))}}function D(E,...L){if(this.__zooming){var k=C(this,L).event(E),z=E.changedTouches,_=z.length,M,A;for(bc(E),f&&clearTimeout(f),f=setTimeout(function(){f=null},g),M=0;M<_;++M)A=z[M],k.touch0&&k.touch0[2]===A.identifier?delete k.touch0:k.touch1&&k.touch1[2]===A.identifier&&delete k.touch1;if(k.touch1&&!k.touch0&&(k.touch0=k.touch1,delete k.touch1),k.touch0)k.touch0[1]=this.__zoom.invert(k.touch0[0]);else if(k.end(),k.taps===2&&(A=It(A,this),Math.hypot(d[0]-A[0],d[1]-A[1])<N)){var F=dt(this).on("dblclick.zoom");F&&F.apply(this,arguments)}}}return p.wheelDelta=function(E){return arguments.length?(r=typeof E=="function"?E:Li(+E),p):r},p.filter=function(E){return arguments.length?(e=typeof E=="function"?E:Li(!!E),p):e},p.touchable=function(E){return arguments.length?(s=typeof E=="function"?E:Li(!!E),p):s},p.extent=function(E){return arguments.length?(t=typeof E=="function"?E:Li([[+E[0][0],+E[0][1]],[+E[1][0],+E[1][1]]]),p):t},p.scaleExtent=function(E){return arguments.length?(o[0]=+E[0],o[1]=+E[1],p):[o[0],o[1]]},p.translateExtent=function(E){return arguments.length?(i[0][0]=+E[0][0],i[1][0]=+E[1][0],i[0][1]=+E[0][1],i[1][1]=+E[1][1],p):[[i[0][0],i[0][1]],[i[1][0],i[1][1]]]},p.constrain=function(E){return arguments.length?(n=E,p):n},p.duration=function(E){return arguments.length?(l=+E,p):l},p.interpolate=function(E){return arguments.length?(c=E,p):c},p.on=function(){var E=u.on.apply(u,arguments);return E===u?p:E},p.clickDistance=function(E){return arguments.length?(w=(E=+E)*E,p):Math.sqrt(w)},p.tapDistance=function(E){return arguments.length?(N=+E,p):N},p}const en={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:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},Oo=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],x0=["Enter"," ","Escape"],y0={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var vs;(function(e){e.Strict="strict",e.Loose="loose"})(vs||(vs={}));var pr;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(pr||(pr={}));var Fo;(function(e){e.Partial="partial",e.Full="full"})(Fo||(Fo={}));const v0={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Rn;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Rn||(Rn={}));var Ua;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Ua||(Ua={}));var Q;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Q||(Q={}));const Tm={[Q.Left]:Q.Right,[Q.Right]:Q.Left,[Q.Top]:Q.Bottom,[Q.Bottom]:Q.Top};function w0(e){return e===null?null:e?"valid":"invalid"}const N0=e=>"id"in e&&"source"in e&&"target"in e,z3=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),gf=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),ei=(e,t=[0,0])=>{const{width:n,height:r}=wn(e),s=e.origin??t,o=n*s[0],i=r*s[1];return{x:e.position.x-o,y:e.position.y-i}},D3=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,s)=>{const o=typeof s=="string";let i=!t.nodeLookup&&!o?s:void 0;t.nodeLookup&&(i=o?t.nodeLookup.get(s):gf(s)?s:t.nodeLookup.get(s.id));const l=i?Wa(i,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Cl(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return El(n)},ti=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(s=>{(t.filter===void 0||t.filter(s))&&(n=Cl(n,Wa(s)),r=!0)}),r?El(n):{x:0,y:0,width:0,height:0}},xf=(e,t,[n,r,s]=[0,0,1],o=!1,i=!1)=>{const l={...ri(t,[n,r,s]),width:t.width/s,height:t.height/s},c=[];for(const u of e.values()){const{measured:h,selectable:d=!0,hidden:f=!1}=u;if(i&&!d||f)continue;const g=h.width??u.width??u.initialWidth??null,x=h.height??u.height??u.initialHeight??null,w=Ho(l,Ns(u)),N=(g??0)*(x??0),p=o&&w>0;(!u.internals.handleBounds||p||w>=N||u.dragging)&&c.push(u)}return c},$3=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function O3(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(s=>s.id)):null;return e.forEach(s=>{s.measured.width&&s.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!s.hidden)&&(!r||r.has(s.id))&&n.set(s.id,s)}),n}async function F3({nodes:e,width:t,height:n,panZoom:r,minZoom:s,maxZoom:o},i){if(e.size===0)return Promise.resolve(!0);const l=O3(e,i),c=ti(l),u=yf(c,t,n,(i==null?void 0:i.minZoom)??s,(i==null?void 0:i.maxZoom)??o,(i==null?void 0:i.padding)??.1);return await r.setViewport(u,{duration:i==null?void 0:i.duration,ease:i==null?void 0:i.ease,interpolate:i==null?void 0:i.interpolate}),Promise.resolve(!0)}function j0({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:s,onError:o}){const i=n.get(e),l=i.parentId?n.get(i.parentId):void 0,{x:c,y:u}=l?l.internals.positionAbsolute:{x:0,y:0},h=i.origin??r;let d=i.extent||s;if(i.extent==="parent"&&!i.expandParent)if(!l)o==null||o("005",en.error005());else{const g=l.measured.width,x=l.measured.height;g&&x&&(d=[[c,u],[c+g,u+x]])}else l&&js(i.extent)&&(d=[[i.extent[0][0]+c,i.extent[0][1]+u],[i.extent[1][0]+c,i.extent[1][1]+u]]);const f=js(d)?kr(t,d,i.measured):t;return(i.measured.width===void 0||i.measured.height===void 0)&&(o==null||o("015",en.error015())),{position:{x:f.x-c+(i.measured.width??0)*h[0],y:f.y-u+(i.measured.height??0)*h[1]},positionAbsolute:f}}async function H3({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:s}){const o=new Set(e.map(f=>f.id)),i=[];for(const f of n){if(f.deletable===!1)continue;const g=o.has(f.id),x=!g&&f.parentId&&i.find(w=>w.id===f.parentId);(g||x)&&i.push(f)}const l=new Set(t.map(f=>f.id)),c=r.filter(f=>f.deletable!==!1),h=$3(i,c);for(const f of c)l.has(f.id)&&!h.find(x=>x.id===f.id)&&h.push(f);if(!s)return{edges:h,nodes:i};const d=await s({nodes:i,edges:h});return typeof d=="boolean"?d?{edges:h,nodes:i}:{edges:[],nodes:[]}:d}const ws=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),kr=(e={x:0,y:0},t,n)=>({x:ws(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:ws(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function S0(e,t,n){const{width:r,height:s}=wn(n),{x:o,y:i}=n.internals.positionAbsolute;return kr(e,[[o,i],[o+r,i+s]],t)}const Lm=(e,t,n)=>e<t?ws(Math.abs(e-t),1,t)/t:e>n?-ws(Math.abs(e-n),1,t)/t:0,b0=(e,t,n=15,r=40)=>{const s=Lm(e.x,r,t.width-r)*n,o=Lm(e.y,r,t.height-r)*n;return[s,o]},Cl=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Hu=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),El=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Ns=(e,t=[0,0])=>{var s,o;const{x:n,y:r}=gf(e)?e.internals.positionAbsolute:ei(e,t);return{x:n,y:r,width:((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0,height:((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0}},Wa=(e,t=[0,0])=>{var s,o;const{x:n,y:r}=gf(e)?e.internals.positionAbsolute:ei(e,t);return{x:n,y:r,x2:n+(((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0),y2:r+(((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0)}},k0=(e,t)=>El(Cl(Hu(e),Hu(t))),Ho=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},Am=e=>Lt(e.width)&&Lt(e.height)&&Lt(e.x)&&Lt(e.y),Lt=e=>!isNaN(e)&&isFinite(e),B3=(e,t)=>{},ni=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),ri=({x:e,y:t},[n,r,s],o=!1,i=[1,1])=>{const l={x:(e-n)/s,y:(t-r)/s};return o?ni(l,i):l},Ka=({x:e,y:t},[n,r,s])=>({x:e*s+n,y:t*s+r});function $r(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.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 V3(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=$r(e,n),s=$r(e,t);return{top:r,right:s,bottom:r,left:s,x:s*2,y:r*2}}if(typeof e=="object"){const r=$r(e.top??e.y??0,n),s=$r(e.bottom??e.y??0,n),o=$r(e.left??e.x??0,t),i=$r(e.right??e.x??0,t);return{top:r,right:i,bottom:s,left:o,x:o+i,y:r+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function U3(e,t,n,r,s,o){const{x:i,y:l}=Ka(e,[t,n,r]),{x:c,y:u}=Ka({x:e.x+e.width,y:e.y+e.height},[t,n,r]),h=s-c,d=o-u;return{left:Math.floor(i),top:Math.floor(l),right:Math.floor(h),bottom:Math.floor(d)}}const yf=(e,t,n,r,s,o)=>{const i=V3(o,t,n),l=(t-i.x)/e.width,c=(n-i.y)/e.height,u=Math.min(l,c),h=ws(u,r,s),d=e.x+e.width/2,f=e.y+e.height/2,g=t/2-d*h,x=n/2-f*h,w=U3(e,g,x,h,t,n),N={left:Math.min(w.left-i.left,0),top:Math.min(w.top-i.top,0),right:Math.min(w.right-i.right,0),bottom:Math.min(w.bottom-i.bottom,0)};return{x:g-N.left+N.right,y:x-N.top+N.bottom,zoom:h}},Bo=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function js(e){return e!=null&&e!=="parent"}function wn(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function C0(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function E0(e,t={width:0,height:0},n,r,s){const o={...e},i=r.get(n);if(i){const l=i.origin||s;o.x+=i.internals.positionAbsolute.x-(t.width??0)*l[0],o.y+=i.internals.positionAbsolute.y-(t.height??0)*l[1]}return o}function zm(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function W3(){let e,t;return{promise:new Promise((r,s)=>{e=r,t=s}),resolve:e,reject:t}}function K3(e){return{...y0,...e||{}}}function po(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:s}){const{x:o,y:i}=At(e),l=ri({x:o-((s==null?void 0:s.left)??0),y:i-((s==null?void 0:s.top)??0)},r),{x:c,y:u}=n?ni(l,t):l;return{xSnapped:c,ySnapped:u,...l}}const vf=e=>({width:e.offsetWidth,height:e.offsetHeight}),_0=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},G3=["INPUT","SELECT","TEXTAREA"];function P0(e){var r,s;const t=((s=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:s[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:G3.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const M0=e=>"clientX"in e,At=(e,t)=>{var o,i;const n=M0(e),r=n?e.clientX:(o=e.touches)==null?void 0:o[0].clientX,s=n?e.clientY:(i=e.touches)==null?void 0:i[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:s-((t==null?void 0:t.top)??0)}},Dm=(e,t,n,r,s)=>{const o=t.querySelectorAll(`.${e}`);return!o||!o.length?null:Array.from(o).map(i=>{const l=i.getBoundingClientRect();return{id:i.getAttribute("data-handleid"),type:e,nodeId:s,position:i.getAttribute("data-handlepos"),x:(l.left-n.left)/r,y:(l.top-n.top)/r,...vf(i)}})};function I0({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:s,sourceControlY:o,targetControlX:i,targetControlY:l}){const c=e*.125+s*.375+i*.375+n*.125,u=t*.125+o*.375+l*.375+r*.125,h=Math.abs(c-e),d=Math.abs(u-t);return[c,u,h,d]}function Ai(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function $m({pos:e,x1:t,y1:n,x2:r,y2:s,c:o}){switch(e){case Q.Left:return[t-Ai(t-r,o),n];case Q.Right:return[t+Ai(r-t,o),n];case Q.Top:return[t,n-Ai(n-s,o)];case Q.Bottom:return[t,n+Ai(s-n,o)]}}function R0({sourceX:e,sourceY:t,sourcePosition:n=Q.Bottom,targetX:r,targetY:s,targetPosition:o=Q.Top,curvature:i=.25}){const[l,c]=$m({pos:n,x1:e,y1:t,x2:r,y2:s,c:i}),[u,h]=$m({pos:o,x1:r,y1:s,x2:e,y2:t,c:i}),[d,f,g,x]=I0({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:l,sourceControlY:c,targetControlX:u,targetControlY:h});return[`M${e},${t} C${l},${c} ${u},${h} ${r},${s}`,d,f,g,x]}function T0({sourceX:e,sourceY:t,targetX:n,targetY:r}){const s=Math.abs(n-e)/2,o=n<e?n+s:n-s,i=Math.abs(r-t)/2,l=r<t?r+i:r-i;return[o,l,s,i]}function Y3({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:s=!1,zIndexMode:o="basic"}){if(o==="manual")return r;const i=s&&n?r+1e3:r,l=Math.max(e.parentId||s&&e.selected?e.internals.z:0,t.parentId||s&&t.selected?t.internals.z:0);return i+l}function X3({sourceNode:e,targetNode:t,width:n,height:r,transform:s}){const o=Cl(Wa(e),Wa(t));o.x===o.x2&&(o.x2+=1),o.y===o.y2&&(o.y2+=1);const i={x:-s[0]/s[2],y:-s[1]/s[2],width:n/s[2],height:r/s[2]};return Ho(i,El(o))>0}const Q3=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,q3=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),Z3=(e,t,n={})=>{if(!e.source||!e.target)return t;const r=n.getEdgeId||Q3;let s;return N0(e)?s={...e}:s={...e,id:r(e)},q3(s,t)?t:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,t.concat(s))};function L0({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[s,o,i,l]=T0({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,s,o,i,l]}const Om={[Q.Left]:{x:-1,y:0},[Q.Right]:{x:1,y:0},[Q.Top]:{x:0,y:-1},[Q.Bottom]:{x:0,y:1}},J3=({source:e,sourcePosition:t=Q.Bottom,target:n})=>t===Q.Left||t===Q.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},Fm=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function e4({source:e,sourcePosition:t=Q.Bottom,target:n,targetPosition:r=Q.Top,center:s,offset:o,stepPosition:i}){const l=Om[t],c=Om[r],u={x:e.x+l.x*o,y:e.y+l.y*o},h={x:n.x+c.x*o,y:n.y+c.y*o},d=J3({source:u,sourcePosition:t,target:h}),f=d.x!==0?"x":"y",g=d[f];let x=[],w,N;const p={x:0,y:0},v={x:0,y:0},[,,y,j]=T0({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[f]*c[f]===-1){f==="x"?(w=s.x??u.x+(h.x-u.x)*i,N=s.y??(u.y+h.y)/2):(w=s.x??(u.x+h.x)/2,N=s.y??u.y+(h.y-u.y)*i);const C=[{x:w,y:u.y},{x:w,y:h.y}],b=[{x:u.x,y:N},{x:h.x,y:N}];l[f]===g?x=f==="x"?C:b:x=f==="x"?b:C}else{const C=[{x:u.x,y:h.y}],b=[{x:h.x,y:u.y}];if(f==="x"?x=l.x===g?b:C:x=l.y===g?C:b,t===r){const T=Math.abs(e[f]-n[f]);if(T<=o){const D=Math.min(o-1,o-T);l[f]===g?p[f]=(u[f]>e[f]?-1:1)*D:v[f]=(h[f]>n[f]?-1:1)*D}}if(t!==r){const T=f==="x"?"y":"x",D=l[f]===c[T],E=u[T]>h[T],L=u[T]<h[T];(l[f]===1&&(!D&&E||D&&L)||l[f]!==1&&(!D&&L||D&&E))&&(x=f==="x"?C:b)}const P={x:u.x+p.x,y:u.y+p.y},I={x:h.x+v.x,y:h.y+v.y},$=Math.max(Math.abs(P.x-x[0].x),Math.abs(I.x-x[0].x)),R=Math.max(Math.abs(P.y-x[0].y),Math.abs(I.y-x[0].y));$>=R?(w=(P.x+I.x)/2,N=x[0].y):(w=x[0].x,N=(P.y+I.y)/2)}return[[e,{x:u.x+p.x,y:u.y+p.y},...x,{x:h.x+v.x,y:h.y+v.y},n],w,N,y,j]}function t4(e,t,n,r){const s=Math.min(Fm(e,t)/2,Fm(t,n)/2,r),{x:o,y:i}=t;if(e.x===o&&o===n.x||e.y===i&&i===n.y)return`L${o} ${i}`;if(e.y===i){const u=e.x<n.x?-1:1,h=e.y<n.y?1:-1;return`L ${o+s*u},${i}Q ${o},${i} ${o},${i+s*h}`}const l=e.x<n.x?1:-1,c=e.y<n.y?-1:1;return`L ${o},${i+s*c}Q ${o},${i} ${o+s*l},${i}`}function Bu({sourceX:e,sourceY:t,sourcePosition:n=Q.Bottom,targetX:r,targetY:s,targetPosition:o=Q.Top,borderRadius:i=5,centerX:l,centerY:c,offset:u=20,stepPosition:h=.5}){const[d,f,g,x,w]=e4({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:s},targetPosition:o,center:{x:l,y:c},offset:u,stepPosition:h});return[d.reduce((p,v,y)=>{let j="";return y>0&&y<d.length-1?j=t4(d[y-1],v,d[y+1],i):j=`${y===0?"M":"L"}${v.x} ${v.y}`,p+=j,p},""),f,g,x,w]}function Hm(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function n4(e){var d;const{sourceNode:t,targetNode:n}=e;if(!Hm(t)||!Hm(n))return null;const r=t.internals.handleBounds||Bm(t.handles),s=n.internals.handleBounds||Bm(n.handles),o=Vm((r==null?void 0:r.source)??[],e.sourceHandle),i=Vm(e.connectionMode===vs.Strict?(s==null?void 0:s.target)??[]:((s==null?void 0:s.target)??[]).concat((s==null?void 0:s.source)??[]),e.targetHandle);if(!o||!i)return(d=e.onError)==null||d.call(e,"008",en.error008(o?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(o==null?void 0:o.position)||Q.Bottom,c=(i==null?void 0:i.position)||Q.Top,u=Cr(t,o,l),h=Cr(n,i,c);return{sourceX:u.x,sourceY:u.y,targetX:h.x,targetY:h.y,sourcePosition:l,targetPosition:c}}function Bm(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function Cr(e,t,n=Q.Left,r=!1){const s=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,o=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:i,height:l}=t??wn(e);if(r)return{x:s+i/2,y:o+l/2};switch((t==null?void 0:t.position)??n){case Q.Top:return{x:s+i/2,y:o};case Q.Right:return{x:s+i,y:o+l/2};case Q.Bottom:return{x:s+i/2,y:o+l};case Q.Left:return{x:s,y:o+l/2}}}function Vm(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Vu(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function r4(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:s}){const o=new Set;return e.reduce((i,l)=>([l.markerStart||r,l.markerEnd||s].forEach(c=>{if(c&&typeof c=="object"){const u=Vu(c,t);o.has(u)||(i.push({id:u,color:c.color||n,...c}),o.add(u))}}),i),[]).sort((i,l)=>i.id.localeCompare(l.id))}const A0=1e3,s4=10,wf={nodeOrigin:[0,0],nodeExtent:Oo,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},o4={...wf,checkEquality:!0};function Nf(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function i4(e,t,n){const r=Nf(wf,n);for(const s of e.values())if(s.parentId)Sf(s,e,t,r);else{const o=ei(s,r.nodeOrigin),i=js(s.extent)?s.extent:r.nodeExtent,l=kr(o,i,wn(s));s.internals.positionAbsolute=l}}function a4(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const s of e.handles){const o={id:s.id,width:s.width??1,height:s.height??1,nodeId:e.id,x:s.x,y:s.y,position:s.position,type:s.type};s.type==="source"?n.push(o):s.type==="target"&&r.push(o)}return{source:n,target:r}}function jf(e){return e==="manual"}function Uu(e,t,n,r={}){var u,h;const s=Nf(o4,r),o={i:0},i=new Map(t),l=s!=null&&s.elevateNodesOnSelect&&!jf(s.zIndexMode)?A0:0;let c=e.length>0;t.clear(),n.clear();for(const d of e){let f=i.get(d.id);if(s.checkEquality&&d===(f==null?void 0:f.internals.userNode))t.set(d.id,f);else{const g=ei(d,s.nodeOrigin),x=js(d.extent)?d.extent:s.nodeExtent,w=kr(g,x,wn(d));f={...s.defaults,...d,measured:{width:(u=d.measured)==null?void 0:u.width,height:(h=d.measured)==null?void 0:h.height},internals:{positionAbsolute:w,handleBounds:a4(d,f),z:z0(d,l,s.zIndexMode),userNode:d}},t.set(d.id,f)}(f.measured===void 0||f.measured.width===void 0||f.measured.height===void 0)&&!f.hidden&&(c=!1),d.parentId&&Sf(f,t,n,r,o)}return c}function l4(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Sf(e,t,n,r,s){const{elevateNodesOnSelect:o,nodeOrigin:i,nodeExtent:l,zIndexMode:c}=Nf(wf,r),u=e.parentId,h=t.get(u);if(!h){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}l4(e,n),s&&!h.parentId&&h.internals.rootParentIndex===void 0&&c==="auto"&&(h.internals.rootParentIndex=++s.i,h.internals.z=h.internals.z+s.i*s4),s&&h.internals.rootParentIndex!==void 0&&(s.i=h.internals.rootParentIndex);const d=o&&!jf(c)?A0:0,{x:f,y:g,z:x}=c4(e,h,i,l,d,c),{positionAbsolute:w}=e.internals,N=f!==w.x||g!==w.y;(N||x!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:N?{x:f,y:g}:w,z:x}})}function z0(e,t,n){const r=Lt(e.zIndex)?e.zIndex:0;return jf(n)?r:r+(e.selected?t:0)}function c4(e,t,n,r,s,o){const{x:i,y:l}=t.internals.positionAbsolute,c=wn(e),u=ei(e,n),h=js(e.extent)?kr(u,e.extent,c):u;let d=kr({x:i+h.x,y:l+h.y},r,c);e.extent==="parent"&&(d=S0(d,c,t));const f=z0(e,s,o),g=t.internals.z??0;return{x:d.x,y:d.y,z:g>=f?g+1:f}}function bf(e,t,n,r=[0,0]){var i;const s=[],o=new Map;for(const l of e){const c=t.get(l.parentId);if(!c)continue;const u=((i=o.get(l.parentId))==null?void 0:i.expandedRect)??Ns(c),h=k0(u,l.rect);o.set(l.parentId,{expandedRect:h,parent:c})}return o.size>0&&o.forEach(({expandedRect:l,parent:c},u)=>{var y;const h=c.internals.positionAbsolute,d=wn(c),f=c.origin??r,g=l.x<h.x?Math.round(Math.abs(h.x-l.x)):0,x=l.y<h.y?Math.round(Math.abs(h.y-l.y)):0,w=Math.max(d.width,Math.round(l.width)),N=Math.max(d.height,Math.round(l.height)),p=(w-d.width)*f[0],v=(N-d.height)*f[1];(g>0||x>0||p||v)&&(s.push({id:u,type:"position",position:{x:c.position.x-g+p,y:c.position.y-x+v}}),(y=n.get(u))==null||y.forEach(j=>{e.some(S=>S.id===j.id)||s.push({id:j.id,type:"position",position:{x:j.position.x+g,y:j.position.y+x}})})),(d.width<l.width||d.height<l.height||g||x)&&s.push({id:u,type:"dimensions",setAttributes:!0,dimensions:{width:w+(g?f[0]*g-p:0),height:N+(x?f[1]*x-v:0)}})}),s}function u4(e,t,n,r,s,o,i){const l=r==null?void 0:r.querySelector(".xyflow__viewport");let c=!1;if(!l)return{changes:[],updatedInternals:c};const u=[],h=window.getComputedStyle(l),{m22:d}=new window.DOMMatrixReadOnly(h.transform),f=[];for(const g of e.values()){const x=t.get(g.id);if(!x)continue;if(x.hidden){t.set(x.id,{...x,internals:{...x.internals,handleBounds:void 0}}),c=!0;continue}const w=vf(g.nodeElement),N=x.measured.width!==w.width||x.measured.height!==w.height;if(!!(w.width&&w.height&&(N||!x.internals.handleBounds||g.force))){const v=g.nodeElement.getBoundingClientRect(),y=js(x.extent)?x.extent:o;let{positionAbsolute:j}=x.internals;x.parentId&&x.extent==="parent"?j=S0(j,w,t.get(x.parentId)):y&&(j=kr(j,y,w));const S={...x,measured:w,internals:{...x.internals,positionAbsolute:j,handleBounds:{source:Dm("source",g.nodeElement,v,d,x.id),target:Dm("target",g.nodeElement,v,d,x.id)}}};t.set(x.id,S),x.parentId&&Sf(S,t,n,{nodeOrigin:s,zIndexMode:i}),c=!0,N&&(u.push({id:x.id,type:"dimensions",dimensions:w}),x.expandParent&&x.parentId&&f.push({id:x.id,parentId:x.parentId,rect:Ns(S,s)}))}}if(f.length>0){const g=bf(f,t,n,s);u.push(...g)}return{changes:u,updatedInternals:c}}async function d4({delta:e,panZoom:t,transform:n,translateExtent:r,width:s,height:o}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const i=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[s,o]],r),l=!!i&&(i.x!==n[0]||i.y!==n[1]||i.k!==n[2]);return Promise.resolve(l)}function Um(e,t,n,r,s,o){let i=s;const l=r.get(i)||new Map;r.set(i,l.set(n,t)),i=`${s}-${e}`;const c=r.get(i)||new Map;if(r.set(i,c.set(n,t)),o){i=`${s}-${e}-${o}`;const u=r.get(i)||new Map;r.set(i,u.set(n,t))}}function D0(e,t,n){e.clear(),t.clear();for(const r of n){const{source:s,target:o,sourceHandle:i=null,targetHandle:l=null}=r,c={edgeId:r.id,source:s,target:o,sourceHandle:i,targetHandle:l},u=`${s}-${i}--${o}-${l}`,h=`${o}-${l}--${s}-${i}`;Um("source",c,h,e,s,i),Um("target",c,u,e,o,l),t.set(r.id,r)}}function $0(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:$0(n,t):!1}function Wm(e,t,n){var s;let r=e;do{if((s=r==null?void 0:r.matches)!=null&&s.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function f4(e,t,n,r){const s=new Map;for(const[o,i]of e)if((i.selected||i.id===r)&&(!i.parentId||!$0(i,e))&&(i.draggable||t&&typeof i.draggable>"u")){const l=e.get(o);l&&s.set(o,{id:o,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return s}function kc({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var i,l,c;const s=[];for(const[u,h]of t){const d=(i=n.get(u))==null?void 0:i.internals.userNode;d&&s.push({...d,position:h.position,dragging:r})}if(!e)return[s[0],s];const o=(l=n.get(e))==null?void 0:l.internals.userNode;return[o?{...o,position:((c=t.get(e))==null?void 0:c.position)||o.position,dragging:r}:s[0],s]}function h4({dragItems:e,snapGrid:t,x:n,y:r}){const s=e.values().next().value;if(!s)return null;const o={x:n-s.distance.x,y:r-s.distance.y},i=ni(o,t);return{x:i.x-o.x,y:i.y-o.y}}function m4({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:s}){let o={x:null,y:null},i=0,l=new Map,c=!1,u={x:0,y:0},h=null,d=!1,f=null,g=!1,x=!1,w=null;function N({noDragClassName:v,handleSelector:y,domNode:j,isSelectable:S,nodeId:C,nodeClickDistance:b=0}){f=dt(j);function P({x:T,y:D}){const{nodeLookup:E,nodeExtent:L,snapGrid:k,snapToGrid:z,nodeOrigin:_,onNodeDrag:M,onSelectionDrag:A,onError:F,updateNodePositions:O}=t();o={x:T,y:D};let U=!1;const V=l.size>1,G=V&&L?Hu(ti(l)):null,Y=V&&z?h4({dragItems:l,snapGrid:k,x:T,y:D}):null;for(const[X,B]of l){if(!E.has(X))continue;let Z={x:T-B.distance.x,y:D-B.distance.y};z&&(Z=Y?{x:Math.round(Z.x+Y.x),y:Math.round(Z.y+Y.y)}:ni(Z,k));let se=null;if(V&&L&&!B.extent&&G){const{positionAbsolute:J}=B.internals,ue=J.x-G.x+L[0][0],ge=J.x+B.measured.width-G.x2+L[1][0],le=J.y-G.y+L[0][1],We=J.y+B.measured.height-G.y2+L[1][1];se=[[ue,le],[ge,We]]}const{position:ne,positionAbsolute:ee}=j0({nodeId:X,nextPosition:Z,nodeLookup:E,nodeExtent:se||L,nodeOrigin:_,onError:F});U=U||B.position.x!==ne.x||B.position.y!==ne.y,B.position=ne,B.internals.positionAbsolute=ee}if(x=x||U,!!U&&(O(l,!0),w&&(r||M||!C&&A))){const[X,B]=kc({nodeId:C,dragItems:l,nodeLookup:E});r==null||r(w,l,X,B),M==null||M(w,X,B),C||A==null||A(w,B)}}async function I(){if(!h)return;const{transform:T,panBy:D,autoPanSpeed:E,autoPanOnNodeDrag:L}=t();if(!L){c=!1,cancelAnimationFrame(i);return}const[k,z]=b0(u,h,E);(k!==0||z!==0)&&(o.x=(o.x??0)-k/T[2],o.y=(o.y??0)-z/T[2],await D({x:k,y:z})&&P(o)),i=requestAnimationFrame(I)}function $(T){var V;const{nodeLookup:D,multiSelectionActive:E,nodesDraggable:L,transform:k,snapGrid:z,snapToGrid:_,selectNodesOnDrag:M,onNodeDragStart:A,onSelectionDragStart:F,unselectNodesAndEdges:O}=t();d=!0,(!M||!S)&&!E&&C&&((V=D.get(C))!=null&&V.selected||O()),S&&M&&C&&(e==null||e(C));const U=po(T.sourceEvent,{transform:k,snapGrid:z,snapToGrid:_,containerBounds:h});if(o=U,l=f4(D,L,U,C),l.size>0&&(n||A||!C&&F)){const[G,Y]=kc({nodeId:C,dragItems:l,nodeLookup:D});n==null||n(T.sourceEvent,l,G,Y),A==null||A(T.sourceEvent,G,Y),C||F==null||F(T.sourceEvent,Y)}}const R=t0().clickDistance(b).on("start",T=>{const{domNode:D,nodeDragThreshold:E,transform:L,snapGrid:k,snapToGrid:z}=t();h=(D==null?void 0:D.getBoundingClientRect())||null,g=!1,x=!1,w=T.sourceEvent,E===0&&$(T),o=po(T.sourceEvent,{transform:L,snapGrid:k,snapToGrid:z,containerBounds:h}),u=At(T.sourceEvent,h)}).on("drag",T=>{const{autoPanOnNodeDrag:D,transform:E,snapGrid:L,snapToGrid:k,nodeDragThreshold:z,nodeLookup:_}=t(),M=po(T.sourceEvent,{transform:E,snapGrid:L,snapToGrid:k,containerBounds:h});if(w=T.sourceEvent,(T.sourceEvent.type==="touchmove"&&T.sourceEvent.touches.length>1||C&&!_.has(C))&&(g=!0),!g){if(!c&&D&&d&&(c=!0,I()),!d){const A=At(T.sourceEvent,h),F=A.x-u.x,O=A.y-u.y;Math.sqrt(F*F+O*O)>z&&$(T)}(o.x!==M.xSnapped||o.y!==M.ySnapped)&&l&&d&&(u=At(T.sourceEvent,h),P(M))}}).on("end",T=>{if(!(!d||g)&&(c=!1,d=!1,cancelAnimationFrame(i),l.size>0)){const{nodeLookup:D,updateNodePositions:E,onNodeDragStop:L,onSelectionDragStop:k}=t();if(x&&(E(l,!1),x=!1),s||L||!C&&k){const[z,_]=kc({nodeId:C,dragItems:l,nodeLookup:D,dragging:!1});s==null||s(T.sourceEvent,l,z,_),L==null||L(T.sourceEvent,z,_),C||k==null||k(T.sourceEvent,_)}}}).filter(T=>{const D=T.target;return!T.button&&(!v||!Wm(D,`.${v}`,j))&&(!y||Wm(D,y,j))});f.call(R)}function p(){f==null||f.on(".drag",null)}return{update:N,destroy:p}}function p4(e,t,n){const r=[],s={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const o of t.values())Ho(s,Ns(o))>0&&r.push(o);return r}const g4=250;function x4(e,t,n,r){var l,c;let s=[],o=1/0;const i=p4(e,n,t+g4);for(const u of i){const h=[...((l=u.internals.handleBounds)==null?void 0:l.source)??[],...((c=u.internals.handleBounds)==null?void 0:c.target)??[]];for(const d of h){if(r.nodeId===d.nodeId&&r.type===d.type&&r.id===d.id)continue;const{x:f,y:g}=Cr(u,d,d.position,!0),x=Math.sqrt(Math.pow(f-e.x,2)+Math.pow(g-e.y,2));x>t||(x<o?(s=[{...d,x:f,y:g}],o=x):x===o&&s.push({...d,x:f,y:g}))}}if(!s.length)return null;if(s.length>1){const u=r.type==="source"?"target":"source";return s.find(h=>h.type===u)??s[0]}return s[0]}function O0(e,t,n,r,s,o=!1){var u,h,d;const i=r.get(e);if(!i)return null;const l=s==="strict"?(u=i.internals.handleBounds)==null?void 0:u[t]:[...((h=i.internals.handleBounds)==null?void 0:h.source)??[],...((d=i.internals.handleBounds)==null?void 0:d.target)??[]],c=(n?l==null?void 0:l.find(f=>f.id===n):l==null?void 0:l[0])??null;return c&&o?{...c,...Cr(i,c,c.position,!0)}:c}function F0(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function y4(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const H0=()=>!0;function v4(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:s,edgeUpdaterType:o,isTarget:i,domNode:l,nodeLookup:c,lib:u,autoPanOnConnect:h,flowId:d,panBy:f,cancelConnection:g,onConnectStart:x,onConnect:w,onConnectEnd:N,isValidConnection:p=H0,onReconnectEnd:v,updateConnection:y,getTransform:j,getFromHandle:S,autoPanSpeed:C,dragThreshold:b=1,handleDomNode:P}){const I=_0(e.target);let $=0,R;const{x:T,y:D}=At(e),E=F0(o,P),L=l==null?void 0:l.getBoundingClientRect();let k=!1;if(!L||!E)return;const z=O0(s,E,r,c,t);if(!z)return;let _=At(e,L),M=!1,A=null,F=!1,O=null;function U(){if(!h||!L)return;const[ne,ee]=b0(_,L,C);f({x:ne,y:ee}),$=requestAnimationFrame(U)}const V={...z,nodeId:s,type:E,position:z.position},G=c.get(s);let X={inProgress:!0,isValid:null,from:Cr(G,V,Q.Left,!0),fromHandle:V,fromPosition:V.position,fromNode:G,to:_,toHandle:null,toPosition:Tm[V.position],toNode:null,pointer:_};function B(){k=!0,y(X),x==null||x(e,{nodeId:s,handleId:r,handleType:E})}b===0&&B();function Z(ne){if(!k){const{x:We,y:Nn}=At(ne),rn=We-T,rr=Nn-D;if(!(rn*rn+rr*rr>b*b))return;B()}if(!S()||!V){se(ne);return}const ee=j();_=At(ne,L),R=x4(ri(_,ee,!1,[1,1]),n,c,V),M||(U(),M=!0);const J=B0(ne,{handle:R,connectionMode:t,fromNodeId:s,fromHandleId:r,fromType:i?"target":"source",isValidConnection:p,doc:I,lib:u,flowId:d,nodeLookup:c});O=J.handleDomNode,A=J.connection,F=y4(!!R,J.isValid);const ue=c.get(s),ge=ue?Cr(ue,V,Q.Left,!0):X.from,le={...X,from:ge,isValid:F,to:J.toHandle&&F?Ka({x:J.toHandle.x,y:J.toHandle.y},ee):_,toHandle:J.toHandle,toPosition:F&&J.toHandle?J.toHandle.position:Tm[V.position],toNode:J.toHandle?c.get(J.toHandle.nodeId):null,pointer:_};y(le),X=le}function se(ne){if(!("touches"in ne&&ne.touches.length>0)){if(k){(R||O)&&A&&F&&(w==null||w(A));const{inProgress:ee,...J}=X,ue={...J,toPosition:X.toHandle?X.toPosition:null};N==null||N(ne,ue),o&&(v==null||v(ne,ue))}g(),cancelAnimationFrame($),M=!1,F=!1,A=null,O=null,I.removeEventListener("mousemove",Z),I.removeEventListener("mouseup",se),I.removeEventListener("touchmove",Z),I.removeEventListener("touchend",se)}}I.addEventListener("mousemove",Z),I.addEventListener("mouseup",se),I.addEventListener("touchmove",Z),I.addEventListener("touchend",se)}function B0(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:s,fromType:o,doc:i,lib:l,flowId:c,isValidConnection:u=H0,nodeLookup:h}){const d=o==="target",f=t?i.querySelector(`.${l}-flow__handle[data-id="${c}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:g,y:x}=At(e),w=i.elementFromPoint(g,x),N=w!=null&&w.classList.contains(`${l}-flow__handle`)?w:f,p={handleDomNode:N,isValid:!1,connection:null,toHandle:null};if(N){const v=F0(void 0,N),y=N.getAttribute("data-nodeid"),j=N.getAttribute("data-handleid"),S=N.classList.contains("connectable"),C=N.classList.contains("connectableend");if(!y||!v)return p;const b={source:d?y:r,sourceHandle:d?j:s,target:d?r:y,targetHandle:d?s:j};p.connection=b;const I=S&&C&&(n===vs.Strict?d&&v==="source"||!d&&v==="target":y!==r||j!==s);p.isValid=I&&u(b),p.toHandle=O0(y,v,j,h,n,!0)}return p}const Wu={onPointerDown:v4,isValid:B0};function w4({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const s=dt(e);function o({translateExtent:l,width:c,height:u,zoomStep:h=1,pannable:d=!0,zoomable:f=!0,inversePan:g=!1}){const x=y=>{if(y.sourceEvent.type!=="wheel"||!t)return;const j=n(),S=y.sourceEvent.ctrlKey&&Bo()?10:1,C=-y.sourceEvent.deltaY*(y.sourceEvent.deltaMode===1?.05:y.sourceEvent.deltaMode?1:.002)*h,b=j[2]*Math.pow(2,C*S);t.scaleTo(b)};let w=[0,0];const N=y=>{(y.sourceEvent.type==="mousedown"||y.sourceEvent.type==="touchstart")&&(w=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY])},p=y=>{const j=n();if(y.sourceEvent.type!=="mousemove"&&y.sourceEvent.type!=="touchmove"||!t)return;const S=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY],C=[S[0]-w[0],S[1]-w[1]];w=S;const b=r()*Math.max(j[2],Math.log(j[2]))*(g?-1:1),P={x:j[0]-C[0]*b,y:j[1]-C[1]*b},I=[[0,0],[c,u]];t.setViewportConstrained({x:P.x,y:P.y,zoom:j[2]},I,l)},v=g0().on("start",N).on("zoom",d?p:null).on("zoom.wheel",f?x:null);s.call(v,{})}function i(){s.on("zoom",null)}return{update:o,destroy:i,pointer:It}}const _l=e=>({x:e.x,y:e.y,zoom:e.k}),Cc=({x:e,y:t,zoom:n})=>kl.translate(e,t).scale(n),qr=(e,t)=>e.target.closest(`.${t}`),V0=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),N4=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Ec=(e,t=0,n=N4,r=()=>{})=>{const s=typeof t=="number"&&t>0;return s||r(),s?e.transition().duration(t).ease(n).on("end",r):e},U0=e=>{const t=e.ctrlKey&&Bo()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function j4({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:o,zoomOnPinch:i,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:u}){return h=>{if(qr(h,t))return h.ctrlKey&&h.preventDefault(),!1;h.preventDefault(),h.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(h.ctrlKey&&i){const N=It(h),p=U0(h),v=d*Math.pow(2,p);r.scaleTo(n,v,N,h);return}const f=h.deltaMode===1?20:1;let g=s===pr.Vertical?0:h.deltaX*f,x=s===pr.Horizontal?0:h.deltaY*f;!Bo()&&h.shiftKey&&s!==pr.Vertical&&(g=h.deltaY*f,x=0),r.translateBy(n,-(g/d)*o,-(x/d)*o,{internal:!0});const w=_l(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c==null||c(h,w),e.panScrollTimeout=setTimeout(()=>{u==null||u(h,w),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,l==null||l(h,w))}}function S4({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,s){const o=r.type==="wheel",i=!t&&o&&!r.ctrlKey,l=qr(r,e);if(r.ctrlKey&&o&&l&&r.preventDefault(),i||l)return null;r.preventDefault(),n.call(this,r,s)}}function b4({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var o,i,l;if((o=r.sourceEvent)!=null&&o.internal)return;const s=_l(r.transform);e.mouseButton=((i=r.sourceEvent)==null?void 0:i.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,((l=r.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,s))}}function k4({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:s}){return o=>{var i,l;e.usedRightMouseButton=!!(n&&V0(t,e.mouseButton??0)),(i=o.sourceEvent)!=null&&i.sync||r([o.transform.x,o.transform.y,o.transform.k]),s&&!((l=o.sourceEvent)!=null&&l.internal)&&(s==null||s(o.sourceEvent,_l(o.transform)))}}function C4({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:s,onPaneContextMenu:o}){return i=>{var l;if(!((l=i.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,o&&V0(t,e.mouseButton??0)&&!e.usedRightMouseButton&&i.sourceEvent&&o(i.sourceEvent),e.usedRightMouseButton=!1,r(!1),s)){const c=_l(i.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(i.sourceEvent,c)},n?150:0)}}}function E4({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:o,userSelectionActive:i,noWheelClassName:l,noPanClassName:c,lib:u,connectionInProgress:h}){return d=>{var N;const f=e||t,g=n&&d.ctrlKey,x=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(qr(d,`${u}-flow__node`)||qr(d,`${u}-flow__edge`)))return!0;if(!r&&!f&&!s&&!o&&!n||i||h&&!x||qr(d,l)&&x||qr(d,c)&&(!x||s&&x&&!e)||!n&&d.ctrlKey&&x)return!1;if(!n&&d.type==="touchstart"&&((N=d.touches)==null?void 0:N.length)>1)return d.preventDefault(),!1;if(!f&&!s&&!g&&x||!r&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(r)&&!r.includes(d.button)&&d.type==="mousedown")return!1;const w=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||x)&&w}}function _4({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:s,onPanZoom:o,onPanZoomStart:i,onPanZoomEnd:l,onDraggingChange:c}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},h=e.getBoundingClientRect(),d=g0().scaleExtent([t,n]).translateExtent(r),f=dt(e).call(d);v({x:s.x,y:s.y,zoom:ws(s.zoom,t,n)},[[0,0],[h.width,h.height]],r);const g=f.on("wheel.zoom"),x=f.on("dblclick.zoom");d.wheelDelta(U0);function w(R,T){return f?new Promise(D=>{d==null||d.interpolate((T==null?void 0:T.interpolate)==="linear"?mo:sa).transform(Ec(f,T==null?void 0:T.duration,T==null?void 0:T.ease,()=>D(!0)),R)}):Promise.resolve(!1)}function N({noWheelClassName:R,noPanClassName:T,onPaneContextMenu:D,userSelectionActive:E,panOnScroll:L,panOnDrag:k,panOnScrollMode:z,panOnScrollSpeed:_,preventScrolling:M,zoomOnPinch:A,zoomOnScroll:F,zoomOnDoubleClick:O,zoomActivationKeyPressed:U,lib:V,onTransformChange:G,connectionInProgress:Y,paneClickDistance:X,selectionOnDrag:B}){E&&!u.isZoomingOrPanning&&p();const Z=L&&!U&&!E;d.clickDistance(B?1/0:!Lt(X)||X<0?0:X);const se=Z?j4({zoomPanValues:u,noWheelClassName:R,d3Selection:f,d3Zoom:d,panOnScrollMode:z,panOnScrollSpeed:_,zoomOnPinch:A,onPanZoomStart:i,onPanZoom:o,onPanZoomEnd:l}):S4({noWheelClassName:R,preventScrolling:M,d3ZoomHandler:g});if(f.on("wheel.zoom",se,{passive:!1}),!E){const ee=b4({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:i});d.on("start",ee);const J=k4({zoomPanValues:u,panOnDrag:k,onPaneContextMenu:!!D,onPanZoom:o,onTransformChange:G});d.on("zoom",J);const ue=C4({zoomPanValues:u,panOnDrag:k,panOnScroll:L,onPaneContextMenu:D,onPanZoomEnd:l,onDraggingChange:c});d.on("end",ue)}const ne=E4({zoomActivationKeyPressed:U,panOnDrag:k,zoomOnScroll:F,panOnScroll:L,zoomOnDoubleClick:O,zoomOnPinch:A,userSelectionActive:E,noPanClassName:T,noWheelClassName:R,lib:V,connectionInProgress:Y});d.filter(ne),O?f.on("dblclick.zoom",x):f.on("dblclick.zoom",null)}function p(){d.on("zoom",null)}async function v(R,T,D){const E=Cc(R),L=d==null?void 0:d.constrain()(E,T,D);return L&&await w(L),new Promise(k=>k(L))}async function y(R,T){const D=Cc(R);return await w(D,T),new Promise(E=>E(D))}function j(R){if(f){const T=Cc(R),D=f.property("__zoom");(D.k!==R.zoom||D.x!==R.x||D.y!==R.y)&&(d==null||d.transform(f,T,null,{sync:!0}))}}function S(){const R=f?p0(f.node()):{x:0,y:0,k:1};return{x:R.x,y:R.y,zoom:R.k}}function C(R,T){return f?new Promise(D=>{d==null||d.interpolate((T==null?void 0:T.interpolate)==="linear"?mo:sa).scaleTo(Ec(f,T==null?void 0:T.duration,T==null?void 0:T.ease,()=>D(!0)),R)}):Promise.resolve(!1)}function b(R,T){return f?new Promise(D=>{d==null||d.interpolate((T==null?void 0:T.interpolate)==="linear"?mo:sa).scaleBy(Ec(f,T==null?void 0:T.duration,T==null?void 0:T.ease,()=>D(!0)),R)}):Promise.resolve(!1)}function P(R){d==null||d.scaleExtent(R)}function I(R){d==null||d.translateExtent(R)}function $(R){const T=!Lt(R)||R<0?0:R;d==null||d.clickDistance(T)}return{update:N,destroy:p,setViewport:y,setViewportConstrained:v,getViewport:S,scaleTo:C,scaleBy:b,setScaleExtent:P,setTranslateExtent:I,syncViewport:j,setClickDistance:$}}var Ss;(function(e){e.Line="line",e.Handle="handle"})(Ss||(Ss={}));function P4({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:s,affectsY:o}){const i=e-t,l=n-r,c=[i>0?1:i<0?-1:0,l>0?1:l<0?-1:0];return i&&s&&(c[0]=c[0]*-1),l&&o&&(c[1]=c[1]*-1),c}function Km(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),s=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:s}}function kn(e,t){return Math.max(0,t-e)}function Cn(e,t){return Math.max(0,e-t)}function zi(e,t,n){return Math.max(0,t-e,e-n)}function Gm(e,t){return e?!t:t}function M4(e,t,n,r,s,o,i,l){let{affectsX:c,affectsY:u}=t;const{isHorizontal:h,isVertical:d}=t,f=h&&d,{xSnapped:g,ySnapped:x}=n,{minWidth:w,maxWidth:N,minHeight:p,maxHeight:v}=r,{x:y,y:j,width:S,height:C,aspectRatio:b}=e;let P=Math.floor(h?g-e.pointerX:0),I=Math.floor(d?x-e.pointerY:0);const $=S+(c?-P:P),R=C+(u?-I:I),T=-o[0]*S,D=-o[1]*C;let E=zi($,w,N),L=zi(R,p,v);if(i){let _=0,M=0;c&&P<0?_=kn(y+P+T,i[0][0]):!c&&P>0&&(_=Cn(y+$+T,i[1][0])),u&&I<0?M=kn(j+I+D,i[0][1]):!u&&I>0&&(M=Cn(j+R+D,i[1][1])),E=Math.max(E,_),L=Math.max(L,M)}if(l){let _=0,M=0;c&&P>0?_=Cn(y+P,l[0][0]):!c&&P<0&&(_=kn(y+$,l[1][0])),u&&I>0?M=Cn(j+I,l[0][1]):!u&&I<0&&(M=kn(j+R,l[1][1])),E=Math.max(E,_),L=Math.max(L,M)}if(s){if(h){const _=zi($/b,p,v)*b;if(E=Math.max(E,_),i){let M=0;!c&&!u||c&&!u&&f?M=Cn(j+D+$/b,i[1][1])*b:M=kn(j+D+(c?P:-P)/b,i[0][1])*b,E=Math.max(E,M)}if(l){let M=0;!c&&!u||c&&!u&&f?M=kn(j+$/b,l[1][1])*b:M=Cn(j+(c?P:-P)/b,l[0][1])*b,E=Math.max(E,M)}}if(d){const _=zi(R*b,w,N)/b;if(L=Math.max(L,_),i){let M=0;!c&&!u||u&&!c&&f?M=Cn(y+R*b+T,i[1][0])/b:M=kn(y+(u?I:-I)*b+T,i[0][0])/b,L=Math.max(L,M)}if(l){let M=0;!c&&!u||u&&!c&&f?M=kn(y+R*b,l[1][0])/b:M=Cn(y+(u?I:-I)*b,l[0][0])/b,L=Math.max(L,M)}}}I=I+(I<0?L:-L),P=P+(P<0?E:-E),s&&(f?$>R*b?I=(Gm(c,u)?-P:P)/b:P=(Gm(c,u)?-I:I)*b:h?(I=P/b,u=c):(P=I*b,c=u));const k=c?y+P:y,z=u?j+I:j;return{width:S+(c?-P:P),height:C+(u?-I:I),x:o[0]*P*(c?-1:1)+k,y:o[1]*I*(u?-1:1)+z}}const W0={width:0,height:0,x:0,y:0},I4={...W0,pointerX:0,pointerY:0,aspectRatio:1};function R4(e){return[[0,0],[e.measured.width,e.measured.height]]}function T4(e,t,n){const r=t.position.x+e.position.x,s=t.position.y+e.position.y,o=e.measured.width??0,i=e.measured.height??0,l=n[0]*o,c=n[1]*i;return[[r-l,s-c],[r+o-l,s+i-c]]}function L4({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:s}){const o=dt(e);let i={controlDirection:Km("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:u,boundaries:h,keepAspectRatio:d,resizeDirection:f,onResizeStart:g,onResize:x,onResizeEnd:w,shouldResize:N}){let p={...W0},v={...I4};i={boundaries:h,resizeDirection:f,keepAspectRatio:d,controlDirection:Km(u)};let y,j=null,S=[],C,b,P,I=!1;const $=t0().on("start",R=>{const{nodeLookup:T,transform:D,snapGrid:E,snapToGrid:L,nodeOrigin:k,paneDomNode:z}=n();if(y=T.get(t),!y)return;j=(z==null?void 0:z.getBoundingClientRect())??null;const{xSnapped:_,ySnapped:M}=po(R.sourceEvent,{transform:D,snapGrid:E,snapToGrid:L,containerBounds:j});p={width:y.measured.width??0,height:y.measured.height??0,x:y.position.x??0,y:y.position.y??0},v={...p,pointerX:_,pointerY:M,aspectRatio:p.width/p.height},C=void 0,y.parentId&&(y.extent==="parent"||y.expandParent)&&(C=T.get(y.parentId),b=C&&y.extent==="parent"?R4(C):void 0),S=[],P=void 0;for(const[A,F]of T)if(F.parentId===t&&(S.push({id:A,position:{...F.position},extent:F.extent}),F.extent==="parent"||F.expandParent)){const O=T4(F,y,F.origin??k);P?P=[[Math.min(O[0][0],P[0][0]),Math.min(O[0][1],P[0][1])],[Math.max(O[1][0],P[1][0]),Math.max(O[1][1],P[1][1])]]:P=O}g==null||g(R,{...p})}).on("drag",R=>{const{transform:T,snapGrid:D,snapToGrid:E,nodeOrigin:L}=n(),k=po(R.sourceEvent,{transform:T,snapGrid:D,snapToGrid:E,containerBounds:j}),z=[];if(!y)return;const{x:_,y:M,width:A,height:F}=p,O={},U=y.origin??L,{width:V,height:G,x:Y,y:X}=M4(v,i.controlDirection,k,i.boundaries,i.keepAspectRatio,U,b,P),B=V!==A,Z=G!==F,se=Y!==_&&B,ne=X!==M&&Z;if(!se&&!ne&&!B&&!Z)return;if((se||ne||U[0]===1||U[1]===1)&&(O.x=se?Y:p.x,O.y=ne?X:p.y,p.x=O.x,p.y=O.y,S.length>0)){const ge=Y-_,le=X-M;for(const We of S)We.position={x:We.position.x-ge+U[0]*(V-A),y:We.position.y-le+U[1]*(G-F)},z.push(We)}if((B||Z)&&(O.width=B&&(!i.resizeDirection||i.resizeDirection==="horizontal")?V:p.width,O.height=Z&&(!i.resizeDirection||i.resizeDirection==="vertical")?G:p.height,p.width=O.width,p.height=O.height),C&&y.expandParent){const ge=U[0]*(O.width??0);O.x&&O.x<ge&&(p.x=ge,v.x=v.x-(O.x-ge));const le=U[1]*(O.height??0);O.y&&O.y<le&&(p.y=le,v.y=v.y-(O.y-le))}const ee=P4({width:p.width,prevWidth:A,height:p.height,prevHeight:F,affectsX:i.controlDirection.affectsX,affectsY:i.controlDirection.affectsY}),J={...p,direction:ee};(N==null?void 0:N(R,J))!==!1&&(I=!0,x==null||x(R,J),r(O,z))}).on("end",R=>{I&&(w==null||w(R,{...p}),s==null||s({...p}),I=!1)});o.call($)}function c(){o.on(".drag",null)}return{update:l,destroy:c}}var K0={exports:{}},G0={},Y0={exports:{}},X0={};/**
|
|
376
|
-
* @license React
|
|
377
|
-
* use-sync-external-store-shim.production.js
|
|
378
|
-
*
|
|
379
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
380
|
-
*
|
|
381
|
-
* This source code is licensed under the MIT license found in the
|
|
382
|
-
* LICENSE file in the root directory of this source tree.
|
|
383
|
-
*/var bs=m;function A4(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var z4=typeof Object.is=="function"?Object.is:A4,D4=bs.useState,$4=bs.useEffect,O4=bs.useLayoutEffect,F4=bs.useDebugValue;function H4(e,t){var n=t(),r=D4({inst:{value:n,getSnapshot:t}}),s=r[0].inst,o=r[1];return O4(function(){s.value=n,s.getSnapshot=t,_c(s)&&o({inst:s})},[e,n,t]),$4(function(){return _c(s)&&o({inst:s}),e(function(){_c(s)&&o({inst:s})})},[e]),F4(n),n}function _c(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!z4(e,n)}catch{return!0}}function B4(e,t){return t()}var V4=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?B4:H4;X0.useSyncExternalStore=bs.useSyncExternalStore!==void 0?bs.useSyncExternalStore:V4;Y0.exports=X0;var U4=Y0.exports;/**
|
|
384
|
-
* @license React
|
|
385
|
-
* use-sync-external-store-shim/with-selector.production.js
|
|
386
|
-
*
|
|
387
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
388
|
-
*
|
|
389
|
-
* This source code is licensed under the MIT license found in the
|
|
390
|
-
* LICENSE file in the root directory of this source tree.
|
|
391
|
-
*/var Pl=m,W4=U4;function K4(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var G4=typeof Object.is=="function"?Object.is:K4,Y4=W4.useSyncExternalStore,X4=Pl.useRef,Q4=Pl.useEffect,q4=Pl.useMemo,Z4=Pl.useDebugValue;G0.useSyncExternalStoreWithSelector=function(e,t,n,r,s){var o=X4(null);if(o.current===null){var i={hasValue:!1,value:null};o.current=i}else i=o.current;o=q4(function(){function c(g){if(!u){if(u=!0,h=g,g=r(g),s!==void 0&&i.hasValue){var x=i.value;if(s(x,g))return d=x}return d=g}if(x=d,G4(h,g))return x;var w=r(g);return s!==void 0&&s(x,w)?(h=g,x):(h=g,d=w)}var u=!1,h,d,f=n===void 0?null:n;return[function(){return c(t())},f===null?void 0:function(){return c(f())}]},[t,n,r,s]);var l=Y4(e,o[0],o[1]);return Q4(function(){i.hasValue=!0,i.value=l},[l]),Z4(l),l};K0.exports=G0;var J4=K0.exports;const e5=Yu(J4),t5={},Ym=e=>{let t;const n=new Set,r=(h,d)=>{const f=typeof h=="function"?h(t):h;if(!Object.is(f,t)){const g=t;t=d??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(x=>x(t,g))}},s=()=>t,c={setState:r,getState:s,getInitialState:()=>u,subscribe:h=>(n.add(h),()=>n.delete(h)),destroy:()=>{(t5?"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."),n.clear()}},u=t=e(r,s,c);return c},n5=e=>e?Ym(e):Ym,{useDebugValue:r5}=Wt,{useSyncExternalStoreWithSelector:s5}=e5,o5=e=>e;function Q0(e,t=o5,n){const r=s5(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return r5(r),r}const Xm=(e,t)=>{const n=n5(e),r=(s,o=t)=>Q0(n,s,o);return Object.assign(r,n),r},i5=(e,t)=>e?Xm(e,t):Xm;function Se(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,s]of e)if(!Object.is(s,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}const Ml=m.createContext(null),a5=Ml.Provider,q0=en.error001();function ie(e,t){const n=m.useContext(Ml);if(n===null)throw new Error(q0);return Q0(n,e,t)}function be(){const e=m.useContext(Ml);if(e===null)throw new Error(q0);return m.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Qm={display:"none"},l5={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Z0="react-flow__node-desc",J0="react-flow__edge-desc",c5="react-flow__aria-live",u5=e=>e.ariaLiveMessage,d5=e=>e.ariaLabelConfig;function f5({rfId:e}){const t=ie(u5);return a.jsx("div",{id:`${c5}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:l5,children:t})}function h5({rfId:e,disableKeyboardA11y:t}){const n=ie(d5);return a.jsxs(a.Fragment,{children:[a.jsx("div",{id:`${Z0}-${e}`,style:Qm,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),a.jsx("div",{id:`${J0}-${e}`,style:Qm,children:n["edge.a11yDescription.default"]}),!t&&a.jsx(f5,{rfId:e})]})}const Il=m.forwardRef(({position:e="top-left",children:t,className:n,style:r,...s},o)=>{const i=`${e}`.split("-");return a.jsx("div",{className:Ae(["react-flow__panel",n,...i]),style:r,ref:o,...s,children:t})});Il.displayName="Panel";function m5({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:a.jsx(Il,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:a.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const p5=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},Di=e=>e.id;function g5(e,t){return Se(e.selectedNodes.map(Di),t.selectedNodes.map(Di))&&Se(e.selectedEdges.map(Di),t.selectedEdges.map(Di))}function x5({onSelectionChange:e}){const t=be(),{selectedNodes:n,selectedEdges:r}=ie(p5,g5);return m.useEffect(()=>{const s={nodes:n,edges:r};e==null||e(s),t.getState().onSelectionChangeHandlers.forEach(o=>o(s))},[n,r,e]),null}const y5=e=>!!e.onSelectionChangeHandlers;function v5({onSelectionChange:e}){const t=ie(y5);return e||t?a.jsx(x5,{onSelectionChange:e}):null}const ev=[0,0],w5={x:0,y:0,zoom:1},N5=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],qm=[...N5,"rfId"],j5=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}),Zm={translateExtent:Oo,nodeOrigin:ev,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function S5(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:s,setTranslateExtent:o,setNodeExtent:i,reset:l,setDefaultNodesAndEdges:c}=ie(j5,Se),u=be();m.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{h.current=Zm,l()}),[]);const h=m.useRef(Zm);return m.useEffect(()=>{for(const d of qm){const f=e[d],g=h.current[d];f!==g&&(typeof e[d]>"u"||(d==="nodes"?t(f):d==="edges"?n(f):d==="minZoom"?r(f):d==="maxZoom"?s(f):d==="translateExtent"?o(f):d==="nodeExtent"?i(f):d==="ariaLabelConfig"?u.setState({ariaLabelConfig:K3(f)}):d==="fitView"?u.setState({fitViewQueued:f}):d==="fitViewOptions"?u.setState({fitViewOptions:f}):u.setState({[d]:f})))}h.current=e},qm.map(d=>e[d])),null}function Jm(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function b5(e){var r;const[t,n]=m.useState(e==="system"?null:e);return m.useEffect(()=>{if(e!=="system"){n(e);return}const s=Jm(),o=()=>n(s!=null&&s.matches?"dark":"light");return o(),s==null||s.addEventListener("change",o),()=>{s==null||s.removeEventListener("change",o)}},[e]),t!==null?t:(r=Jm())!=null&&r.matches?"dark":"light"}const ep=typeof document<"u"?document:null;function Vo(e=null,t={target:ep,actInsideInputWithModifier:!0}){const[n,r]=m.useState(!1),s=m.useRef(!1),o=m.useRef(new Set([])),[i,l]=m.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.replace("+",`
|
|
392
|
-
`).replace(`
|
|
393
|
-
|
|
394
|
-
`,`
|
|
395
|
-
+`).split(`
|
|
396
|
-
`)),h=u.reduce((d,f)=>d.concat(...f),[]);return[u,h]}return[[],[]]},[e]);return m.useEffect(()=>{const c=(t==null?void 0:t.target)??ep,u=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const h=g=>{var N,p;if(s.current=g.ctrlKey||g.metaKey||g.shiftKey||g.altKey,(!s.current||s.current&&!u)&&P0(g))return!1;const w=np(g.code,l);if(o.current.add(g[w]),tp(i,o.current,!1)){const v=((p=(N=g.composedPath)==null?void 0:N.call(g))==null?void 0:p[0])||g.target,y=(v==null?void 0:v.nodeName)==="BUTTON"||(v==null?void 0:v.nodeName)==="A";t.preventDefault!==!1&&(s.current||!y)&&g.preventDefault(),r(!0)}},d=g=>{const x=np(g.code,l);tp(i,o.current,!0)?(r(!1),o.current.clear()):o.current.delete(g[x]),g.key==="Meta"&&o.current.clear(),s.current=!1},f=()=>{o.current.clear(),r(!1)};return c==null||c.addEventListener("keydown",h),c==null||c.addEventListener("keyup",d),window.addEventListener("blur",f),window.addEventListener("contextmenu",f),()=>{c==null||c.removeEventListener("keydown",h),c==null||c.removeEventListener("keyup",d),window.removeEventListener("blur",f),window.removeEventListener("contextmenu",f)}}},[e,r]),n}function tp(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(s=>t.has(s)))}function np(e,t){return t.includes(e)?"code":"key"}const k5=()=>{const e=be();return m.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,s,o],panZoom:i}=e.getState();return i?(await i.setViewport({x:t.x??r,y:t.y??s,zoom:t.zoom??o},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:s,minZoom:o,maxZoom:i,panZoom:l}=e.getState(),c=yf(t,r,s,o,i,(n==null?void 0:n.padding)??.1);return l?(await l.setViewport(c,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:s,snapToGrid:o,domNode:i}=e.getState();if(!i)return t;const{x:l,y:c}=i.getBoundingClientRect(),u={x:t.x-l,y:t.y-c},h=n.snapGrid??s,d=n.snapToGrid??o;return ri(u,r,d,h)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:s,y:o}=r.getBoundingClientRect(),i=Ka(t,n);return{x:i.x+s,y:i.y+o}}}),[])};function tv(e,t){const n=[],r=new Map,s=[];for(const o of e)if(o.type==="add"){s.push(o);continue}else if(o.type==="remove"||o.type==="replace")r.set(o.id,[o]);else{const i=r.get(o.id);i?i.push(o):r.set(o.id,[o])}for(const o of t){const i=r.get(o.id);if(!i){n.push(o);continue}if(i[0].type==="remove")continue;if(i[0].type==="replace"){n.push({...i[0].item});continue}const l={...o};for(const c of i)C5(c,l);n.push(l)}return s.length&&s.forEach(o=>{o.index!==void 0?n.splice(o.index,0,{...o.item}):n.push({...o.item})}),n}function C5(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function E5(e,t){return tv(e,t)}function _5(e,t){return tv(e,t)}function ir(e,t){return{id:e,type:"select",selected:t}}function Zr(e,t=new Set,n=!1){const r=[];for(const[s,o]of e){const i=t.has(s);!(o.selected===void 0&&!i)&&o.selected!==i&&(n&&(o.selected=i),r.push(ir(o.id,i)))}return r}function rp({items:e=[],lookup:t}){var s;const n=[],r=new Map(e.map(o=>[o.id,o]));for(const[o,i]of e.entries()){const l=t.get(i.id),c=((s=l==null?void 0:l.internals)==null?void 0:s.userNode)??l;c!==void 0&&c!==i&&n.push({id:i.id,item:i,type:"replace"}),c===void 0&&n.push({item:i,type:"add",index:o})}for(const[o]of t)r.get(o)===void 0&&n.push({id:o,type:"remove"});return n}function sp(e){return{id:e.id,type:"remove"}}const op=e=>z3(e),P5=e=>N0(e);function nv(e){return m.forwardRef(e)}const M5=typeof window<"u"?m.useLayoutEffect:m.useEffect;function ip(e){const[t,n]=m.useState(BigInt(0)),[r]=m.useState(()=>I5(()=>n(s=>s+BigInt(1))));return M5(()=>{const s=r.get();s.length&&(e(s),r.reset())},[t]),r}function I5(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const rv=m.createContext(null);function R5({children:e}){const t=be(),n=m.useCallback(l=>{const{nodes:c=[],setNodes:u,hasDefaultNodes:h,onNodesChange:d,nodeLookup:f,fitViewQueued:g,onNodesChangeMiddlewareMap:x}=t.getState();let w=c;for(const p of l)w=typeof p=="function"?p(w):p;let N=rp({items:w,lookup:f});for(const p of x.values())N=p(N);h&&u(w),N.length>0?d==null||d(N):g&&window.requestAnimationFrame(()=>{const{fitViewQueued:p,nodes:v,setNodes:y}=t.getState();p&&y(v)})},[]),r=ip(n),s=m.useCallback(l=>{const{edges:c=[],setEdges:u,hasDefaultEdges:h,onEdgesChange:d,edgeLookup:f}=t.getState();let g=c;for(const x of l)g=typeof x=="function"?x(g):x;h?u(g):d&&d(rp({items:g,lookup:f}))},[]),o=ip(s),i=m.useMemo(()=>({nodeQueue:r,edgeQueue:o}),[]);return a.jsx(rv.Provider,{value:i,children:e})}function T5(){const e=m.useContext(rv);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const L5=e=>!!e.panZoom;function kf(){const e=k5(),t=be(),n=T5(),r=ie(L5),s=m.useMemo(()=>{const o=d=>t.getState().nodeLookup.get(d),i=d=>{n.nodeQueue.push(d)},l=d=>{n.edgeQueue.push(d)},c=d=>{var p,v;const{nodeLookup:f,nodeOrigin:g}=t.getState(),x=op(d)?d:f.get(d.id),w=x.parentId?E0(x.position,x.measured,x.parentId,f,g):x.position,N={...x,position:w,width:((p=x.measured)==null?void 0:p.width)??x.width,height:((v=x.measured)==null?void 0:v.height)??x.height};return Ns(N)},u=(d,f,g={replace:!1})=>{i(x=>x.map(w=>{if(w.id===d){const N=typeof f=="function"?f(w):f;return g.replace&&op(N)?N:{...w,...N}}return w}))},h=(d,f,g={replace:!1})=>{l(x=>x.map(w=>{if(w.id===d){const N=typeof f=="function"?f(w):f;return g.replace&&P5(N)?N:{...w,...N}}return w}))};return{getNodes:()=>t.getState().nodes.map(d=>({...d})),getNode:d=>{var f;return(f=o(d))==null?void 0:f.internals.userNode},getInternalNode:o,getEdges:()=>{const{edges:d=[]}=t.getState();return d.map(f=>({...f}))},getEdge:d=>t.getState().edgeLookup.get(d),setNodes:i,setEdges:l,addNodes:d=>{const f=Array.isArray(d)?d:[d];n.nodeQueue.push(g=>[...g,...f])},addEdges:d=>{const f=Array.isArray(d)?d:[d];n.edgeQueue.push(g=>[...g,...f])},toObject:()=>{const{nodes:d=[],edges:f=[],transform:g}=t.getState(),[x,w,N]=g;return{nodes:d.map(p=>({...p})),edges:f.map(p=>({...p})),viewport:{x,y:w,zoom:N}}},deleteElements:async({nodes:d=[],edges:f=[]})=>{const{nodes:g,edges:x,onNodesDelete:w,onEdgesDelete:N,triggerNodeChanges:p,triggerEdgeChanges:v,onDelete:y,onBeforeDelete:j}=t.getState(),{nodes:S,edges:C}=await H3({nodesToRemove:d,edgesToRemove:f,nodes:g,edges:x,onBeforeDelete:j}),b=C.length>0,P=S.length>0;if(b){const I=C.map(sp);N==null||N(C),v(I)}if(P){const I=S.map(sp);w==null||w(S),p(I)}return(P||b)&&(y==null||y({nodes:S,edges:C})),{deletedNodes:S,deletedEdges:C}},getIntersectingNodes:(d,f=!0,g)=>{const x=Am(d),w=x?d:c(d),N=g!==void 0;return w?(g||t.getState().nodes).filter(p=>{const v=t.getState().nodeLookup.get(p.id);if(v&&!x&&(p.id===d.id||!v.internals.positionAbsolute))return!1;const y=Ns(N?p:v),j=Ho(y,w);return f&&j>0||j>=y.width*y.height||j>=w.width*w.height}):[]},isNodeIntersecting:(d,f,g=!0)=>{const w=Am(d)?d:c(d);if(!w)return!1;const N=Ho(w,f);return g&&N>0||N>=f.width*f.height||N>=w.width*w.height},updateNode:u,updateNodeData:(d,f,g={replace:!1})=>{u(d,x=>{const w=typeof f=="function"?f(x):f;return g.replace?{...x,data:w}:{...x,data:{...x.data,...w}}},g)},updateEdge:h,updateEdgeData:(d,f,g={replace:!1})=>{h(d,x=>{const w=typeof f=="function"?f(x):f;return g.replace?{...x,data:w}:{...x,data:{...x.data,...w}}},g)},getNodesBounds:d=>{const{nodeLookup:f,nodeOrigin:g}=t.getState();return D3(d,{nodeLookup:f,nodeOrigin:g})},getHandleConnections:({type:d,id:f,nodeId:g})=>{var x;return Array.from(((x=t.getState().connectionLookup.get(`${g}-${d}${f?`-${f}`:""}`))==null?void 0:x.values())??[])},getNodeConnections:({type:d,handleId:f,nodeId:g})=>{var x;return Array.from(((x=t.getState().connectionLookup.get(`${g}${d?f?`-${d}-${f}`:`-${d}`:""}`))==null?void 0:x.values())??[])},fitView:async d=>{const f=t.getState().fitViewResolver??W3();return t.setState({fitViewQueued:!0,fitViewOptions:d,fitViewResolver:f}),n.nodeQueue.push(g=>[...g]),f.promise}}},[]);return m.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const ap=e=>e.selected,A5=typeof window<"u"?window:void 0;function z5({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=be(),{deleteElements:r}=kf(),s=Vo(e,{actInsideInputWithModifier:!1}),o=Vo(t,{target:A5});m.useEffect(()=>{if(s){const{edges:i,nodes:l}=n.getState();r({nodes:l.filter(ap),edges:i.filter(ap)}),n.setState({nodesSelectionActive:!1})}},[s]),m.useEffect(()=>{n.setState({multiSelectionActive:o})},[o])}function D5(e){const t=be();m.useEffect(()=>{const n=()=>{var s,o,i,l;if(!e.current||!(((o=(s=e.current).checkVisibility)==null?void 0:o.call(s))??!0))return!1;const r=vf(e.current);(r.height===0||r.width===0)&&((l=(i=t.getState()).onError)==null||l.call(i,"004",en.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const Rl={position:"absolute",width:"100%",height:"100%",top:0,left:0},$5=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function O5({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:s=.5,panOnScrollMode:o=pr.Free,zoomOnDoubleClick:i=!0,panOnDrag:l=!0,defaultViewport:c,translateExtent:u,minZoom:h,maxZoom:d,zoomActivationKeyCode:f,preventScrolling:g=!0,children:x,noWheelClassName:w,noPanClassName:N,onViewportChange:p,isControlledViewport:v,paneClickDistance:y,selectionOnDrag:j}){const S=be(),C=m.useRef(null),{userSelectionActive:b,lib:P,connectionInProgress:I}=ie($5,Se),$=Vo(f),R=m.useRef();D5(C);const T=m.useCallback(D=>{p==null||p({x:D[0],y:D[1],zoom:D[2]}),v||S.setState({transform:D})},[p,v]);return m.useEffect(()=>{if(C.current){R.current=_4({domNode:C.current,minZoom:h,maxZoom:d,translateExtent:u,viewport:c,onDraggingChange:k=>S.setState({paneDragging:k}),onPanZoomStart:(k,z)=>{const{onViewportChangeStart:_,onMoveStart:M}=S.getState();M==null||M(k,z),_==null||_(z)},onPanZoom:(k,z)=>{const{onViewportChange:_,onMove:M}=S.getState();M==null||M(k,z),_==null||_(z)},onPanZoomEnd:(k,z)=>{const{onViewportChangeEnd:_,onMoveEnd:M}=S.getState();M==null||M(k,z),_==null||_(z)}});const{x:D,y:E,zoom:L}=R.current.getViewport();return S.setState({panZoom:R.current,transform:[D,E,L],domNode:C.current.closest(".react-flow")}),()=>{var k;(k=R.current)==null||k.destroy()}}},[]),m.useEffect(()=>{var D;(D=R.current)==null||D.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:o,zoomOnDoubleClick:i,panOnDrag:l,zoomActivationKeyPressed:$,preventScrolling:g,noPanClassName:N,userSelectionActive:b,noWheelClassName:w,lib:P,onTransformChange:T,connectionInProgress:I,selectionOnDrag:j,paneClickDistance:y})},[e,t,n,r,s,o,i,l,$,g,N,b,w,P,T,I,j,y]),a.jsx("div",{className:"react-flow__renderer",ref:C,style:Rl,children:x})}const F5=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function H5(){const{userSelectionActive:e,userSelectionRect:t}=ie(F5,Se);return e&&t?a.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const Pc=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},B5=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function V5({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Fo.Full,panOnDrag:r,paneClickDistance:s,selectionOnDrag:o,onSelectionStart:i,onSelectionEnd:l,onPaneClick:c,onPaneContextMenu:u,onPaneScroll:h,onPaneMouseEnter:d,onPaneMouseMove:f,onPaneMouseLeave:g,children:x}){const w=be(),{userSelectionActive:N,elementsSelectable:p,dragging:v,connectionInProgress:y}=ie(B5,Se),j=p&&(e||N),S=m.useRef(null),C=m.useRef(),b=m.useRef(new Set),P=m.useRef(new Set),I=m.useRef(!1),$=_=>{if(I.current||y){I.current=!1;return}c==null||c(_),w.getState().resetSelectedElements(),w.setState({nodesSelectionActive:!1})},R=_=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){_.preventDefault();return}u==null||u(_)},T=h?_=>h(_):void 0,D=_=>{I.current&&(_.stopPropagation(),I.current=!1)},E=_=>{var G,Y;const{domNode:M}=w.getState();if(C.current=M==null?void 0:M.getBoundingClientRect(),!C.current)return;const A=_.target===S.current;if(!A&&!!_.target.closest(".nokey")||!e||!(o&&A||t)||_.button!==0||!_.isPrimary)return;(Y=(G=_.target)==null?void 0:G.setPointerCapture)==null||Y.call(G,_.pointerId),I.current=!1;const{x:U,y:V}=At(_.nativeEvent,C.current);w.setState({userSelectionRect:{width:0,height:0,startX:U,startY:V,x:U,y:V}}),A||(_.stopPropagation(),_.preventDefault())},L=_=>{const{userSelectionRect:M,transform:A,nodeLookup:F,edgeLookup:O,connectionLookup:U,triggerNodeChanges:V,triggerEdgeChanges:G,defaultEdgeOptions:Y,resetSelectedElements:X}=w.getState();if(!C.current||!M)return;const{x:B,y:Z}=At(_.nativeEvent,C.current),{startX:se,startY:ne}=M;if(!I.current){const le=t?0:s;if(Math.hypot(B-se,Z-ne)<=le)return;X(),i==null||i(_)}I.current=!0;const ee={startX:se,startY:ne,x:B<se?B:se,y:Z<ne?Z:ne,width:Math.abs(B-se),height:Math.abs(Z-ne)},J=b.current,ue=P.current;b.current=new Set(xf(F,ee,A,n===Fo.Partial,!0).map(le=>le.id)),P.current=new Set;const ge=(Y==null?void 0:Y.selectable)??!0;for(const le of b.current){const We=U.get(le);if(We)for(const{edgeId:Nn}of We.values()){const rn=O.get(Nn);rn&&(rn.selectable??ge)&&P.current.add(Nn)}}if(!zm(J,b.current)){const le=Zr(F,b.current,!0);V(le)}if(!zm(ue,P.current)){const le=Zr(O,P.current);G(le)}w.setState({userSelectionRect:ee,userSelectionActive:!0,nodesSelectionActive:!1})},k=_=>{var M,A;_.button===0&&((A=(M=_.target)==null?void 0:M.releasePointerCapture)==null||A.call(M,_.pointerId),!N&&_.target===S.current&&w.getState().userSelectionRect&&($==null||$(_)),w.setState({userSelectionActive:!1,userSelectionRect:null}),I.current&&(l==null||l(_),w.setState({nodesSelectionActive:b.current.size>0})))},z=r===!0||Array.isArray(r)&&r.includes(0);return a.jsxs("div",{className:Ae(["react-flow__pane",{draggable:z,dragging:v,selection:e}]),onClick:j?void 0:Pc($,S),onContextMenu:Pc(R,S),onWheel:Pc(T,S),onPointerEnter:j?void 0:d,onPointerMove:j?L:f,onPointerUp:j?k:void 0,onPointerDownCapture:j?E:void 0,onClickCapture:j?D:void 0,onPointerLeave:g,ref:S,style:Rl,children:[x,a.jsx(H5,{})]})}function Ku({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:o,multiSelectionActive:i,nodeLookup:l,onError:c}=t.getState(),u=l.get(e);if(!u){c==null||c("012",en.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&i)&&(o({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var h;return(h=r==null?void 0:r.current)==null?void 0:h.blur()})):s([e])}function sv({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:s,isSelectable:o,nodeClickDistance:i}){const l=be(),[c,u]=m.useState(!1),h=m.useRef();return m.useEffect(()=>{h.current=m4({getStoreItems:()=>l.getState(),onNodeMouseDown:d=>{Ku({id:d,store:l,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),m.useEffect(()=>{var d,f;if(t)(d=h.current)==null||d.destroy();else if(e.current)return(f=h.current)==null||f.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:o,nodeId:s,nodeClickDistance:i}),()=>{var g;(g=h.current)==null||g.destroy()}},[n,r,t,o,e,s]),c}const U5=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function ov(){const e=be();return m.useCallback(n=>{const{nodeExtent:r,snapToGrid:s,snapGrid:o,nodesDraggable:i,onError:l,updateNodePositions:c,nodeLookup:u,nodeOrigin:h}=e.getState(),d=new Map,f=U5(i),g=s?o[0]:5,x=s?o[1]:5,w=n.direction.x*g*n.factor,N=n.direction.y*x*n.factor;for(const[,p]of u){if(!f(p))continue;let v={x:p.internals.positionAbsolute.x+w,y:p.internals.positionAbsolute.y+N};s&&(v=ni(v,o));const{position:y,positionAbsolute:j}=j0({nodeId:p.id,nextPosition:v,nodeLookup:u,nodeExtent:r,nodeOrigin:h,onError:l});p.position=y,p.internals.positionAbsolute=j,d.set(p.id,p)}c(d)},[])}const Cf=m.createContext(null),W5=Cf.Provider;Cf.Consumer;const iv=()=>m.useContext(Cf),K5=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),G5=(e,t,n)=>r=>{const{connectionClickStartHandle:s,connectionMode:o,connection:i}=r,{fromHandle:l,toHandle:c,isValid:u}=i,h=(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n;return{connectingFrom:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n,connectingTo:h,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.id)===t&&(s==null?void 0:s.type)===n,isPossibleEndHandle:o===vs.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,clickConnectionInProcess:!!s,valid:h&&u}};function Y5({type:e="source",position:t=Q.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:o=!0,id:i,onConnect:l,children:c,className:u,onMouseDown:h,onTouchStart:d,...f},g){var L,k;const x=i||null,w=e==="target",N=be(),p=iv(),{connectOnClick:v,noPanClassName:y,rfId:j}=ie(K5,Se),{connectingFrom:S,connectingTo:C,clickConnecting:b,isPossibleEndHandle:P,connectionInProcess:I,clickConnectionInProcess:$,valid:R}=ie(G5(p,x,e),Se);p||(k=(L=N.getState()).onError)==null||k.call(L,"010",en.error010());const T=z=>{const{defaultEdgeOptions:_,onConnect:M,hasDefaultEdges:A}=N.getState(),F={..._,...z};if(A){const{edges:O,setEdges:U}=N.getState();U(Z3(F,O))}M==null||M(F),l==null||l(F)},D=z=>{if(!p)return;const _=M0(z.nativeEvent);if(s&&(_&&z.button===0||!_)){const M=N.getState();Wu.onPointerDown(z.nativeEvent,{handleDomNode:z.currentTarget,autoPanOnConnect:M.autoPanOnConnect,connectionMode:M.connectionMode,connectionRadius:M.connectionRadius,domNode:M.domNode,nodeLookup:M.nodeLookup,lib:M.lib,isTarget:w,handleId:x,nodeId:p,flowId:M.rfId,panBy:M.panBy,cancelConnection:M.cancelConnection,onConnectStart:M.onConnectStart,onConnectEnd:M.onConnectEnd,updateConnection:M.updateConnection,onConnect:T,isValidConnection:n||M.isValidConnection,getTransform:()=>N.getState().transform,getFromHandle:()=>N.getState().connection.fromHandle,autoPanSpeed:M.autoPanSpeed,dragThreshold:M.connectionDragThreshold})}_?h==null||h(z):d==null||d(z)},E=z=>{const{onClickConnectStart:_,onClickConnectEnd:M,connectionClickStartHandle:A,connectionMode:F,isValidConnection:O,lib:U,rfId:V,nodeLookup:G,connection:Y}=N.getState();if(!p||!A&&!s)return;if(!A){_==null||_(z.nativeEvent,{nodeId:p,handleId:x,handleType:e}),N.setState({connectionClickStartHandle:{nodeId:p,type:e,id:x}});return}const X=_0(z.target),B=n||O,{connection:Z,isValid:se}=Wu.isValid(z.nativeEvent,{handle:{nodeId:p,id:x,type:e},connectionMode:F,fromNodeId:A.nodeId,fromHandleId:A.id||null,fromType:A.type,isValidConnection:B,flowId:V,doc:X,lib:U,nodeLookup:G});se&&Z&&T(Z);const ne=structuredClone(Y);delete ne.inProgress,ne.toPosition=ne.toHandle?ne.toHandle.position:null,M==null||M(z,ne),N.setState({connectionClickStartHandle:null})};return a.jsx("div",{"data-handleid":x,"data-nodeid":p,"data-handlepos":t,"data-id":`${j}-${p}-${x}-${e}`,className:Ae(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",y,u,{source:!w,target:w,connectable:r,connectablestart:s,connectableend:o,clickconnecting:b,connectingfrom:S,connectingto:C,valid:R,connectionindicator:r&&(!I||P)&&(I||$?o:s)}]),onMouseDown:D,onTouchStart:D,onClick:v?E:void 0,ref:g,...f,children:c})}const Ga=m.memo(nv(Y5));function X5({data:e,isConnectable:t,sourcePosition:n=Q.Bottom}){return a.jsxs(a.Fragment,{children:[e==null?void 0:e.label,a.jsx(Ga,{type:"source",position:n,isConnectable:t})]})}function Q5({data:e,isConnectable:t,targetPosition:n=Q.Top,sourcePosition:r=Q.Bottom}){return a.jsxs(a.Fragment,{children:[a.jsx(Ga,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,a.jsx(Ga,{type:"source",position:r,isConnectable:t})]})}function q5(){return null}function Z5({data:e,isConnectable:t,targetPosition:n=Q.Top}){return a.jsxs(a.Fragment,{children:[a.jsx(Ga,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Ya={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},lp={input:X5,default:Q5,output:Z5,group:q5};function J5(e){var t,n,r,s;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((s=e.style)==null?void 0:s.height)}}const eP=e=>{const{width:t,height:n,x:r,y:s}=ti(e.nodeLookup,{filter:o=>!!o.selected});return{width:Lt(t)?t:null,height:Lt(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${s}px)`}};function tP({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=be(),{width:s,height:o,transformString:i,userSelectionActive:l}=ie(eP,Se),c=ov(),u=m.useRef(null);if(m.useEffect(()=>{var f;n||(f=u.current)==null||f.focus({preventScroll:!0})},[n]),sv({nodeRef:u}),l||!s||!o)return null;const h=e?f=>{const g=r.getState().nodes.filter(x=>x.selected);e(f,g)}:void 0,d=f=>{Object.prototype.hasOwnProperty.call(Ya,f.key)&&(f.preventDefault(),c({direction:Ya[f.key],factor:f.shiftKey?4:1}))};return a.jsx("div",{className:Ae(["react-flow__nodesselection","react-flow__container",t]),style:{transform:i},children:a.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:h,tabIndex:n?void 0:-1,onKeyDown:n?void 0:d,style:{width:s,height:o}})})}const cp=typeof window<"u"?window:void 0,nP=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function av({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:i,paneClickDistance:l,deleteKeyCode:c,selectionKeyCode:u,selectionOnDrag:h,selectionMode:d,onSelectionStart:f,onSelectionEnd:g,multiSelectionKeyCode:x,panActivationKeyCode:w,zoomActivationKeyCode:N,elementsSelectable:p,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:j,panOnScrollSpeed:S,panOnScrollMode:C,zoomOnDoubleClick:b,panOnDrag:P,defaultViewport:I,translateExtent:$,minZoom:R,maxZoom:T,preventScrolling:D,onSelectionContextMenu:E,noWheelClassName:L,noPanClassName:k,disableKeyboardA11y:z,onViewportChange:_,isControlledViewport:M}){const{nodesSelectionActive:A,userSelectionActive:F}=ie(nP,Se),O=Vo(u,{target:cp}),U=Vo(w,{target:cp}),V=U||P,G=U||j,Y=h&&V!==!0,X=O||F||Y;return z5({deleteKeyCode:c,multiSelectionKeyCode:x}),a.jsx(O5,{onPaneContextMenu:o,elementsSelectable:p,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:G,panOnScrollSpeed:S,panOnScrollMode:C,zoomOnDoubleClick:b,panOnDrag:!O&&V,defaultViewport:I,translateExtent:$,minZoom:R,maxZoom:T,zoomActivationKeyCode:N,preventScrolling:D,noWheelClassName:L,noPanClassName:k,onViewportChange:_,isControlledViewport:M,paneClickDistance:l,selectionOnDrag:Y,children:a.jsxs(V5,{onSelectionStart:f,onSelectionEnd:g,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:i,panOnDrag:V,isSelecting:!!X,selectionMode:d,selectionKeyPressed:O,paneClickDistance:l,selectionOnDrag:Y,children:[e,A&&a.jsx(tP,{onSelectionContextMenu:E,noPanClassName:k,disableKeyboardA11y:z})]})})}av.displayName="FlowRenderer";const rP=m.memo(av),sP=e=>t=>e?xf(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function oP(e){return ie(m.useCallback(sP(e),[e]),Se)}const iP=e=>e.updateNodeInternals;function aP(){const e=ie(iP),[t]=m.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(s=>{const o=s.target.getAttribute("data-id");r.set(o,{id:o,nodeElement:s.target,force:!0})}),e(r)}));return m.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function lP({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const s=be(),o=m.useRef(null),i=m.useRef(null),l=m.useRef(e.sourcePosition),c=m.useRef(e.targetPosition),u=m.useRef(t),h=n&&!!e.internals.handleBounds;return m.useEffect(()=>{o.current&&!e.hidden&&(!h||i.current!==o.current)&&(i.current&&(r==null||r.unobserve(i.current)),r==null||r.observe(o.current),i.current=o.current)},[h,e.hidden]),m.useEffect(()=>()=>{i.current&&(r==null||r.unobserve(i.current),i.current=null)},[]),m.useEffect(()=>{if(o.current){const d=u.current!==t,f=l.current!==e.sourcePosition,g=c.current!==e.targetPosition;(d||f||g)&&(u.current=t,l.current=e.sourcePosition,c.current=e.targetPosition,s.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:o.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),o}function cP({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:s,onContextMenu:o,onDoubleClick:i,nodesDraggable:l,elementsSelectable:c,nodesConnectable:u,nodesFocusable:h,resizeObserver:d,noDragClassName:f,noPanClassName:g,disableKeyboardA11y:x,rfId:w,nodeTypes:N,nodeClickDistance:p,onError:v}){const{node:y,internals:j,isParent:S}=ie(B=>{const Z=B.nodeLookup.get(e),se=B.parentLookup.has(e);return{node:Z,internals:Z.internals,isParent:se}},Se);let C=y.type||"default",b=(N==null?void 0:N[C])||lp[C];b===void 0&&(v==null||v("003",en.error003(C)),C="default",b=(N==null?void 0:N.default)||lp.default);const P=!!(y.draggable||l&&typeof y.draggable>"u"),I=!!(y.selectable||c&&typeof y.selectable>"u"),$=!!(y.connectable||u&&typeof y.connectable>"u"),R=!!(y.focusable||h&&typeof y.focusable>"u"),T=be(),D=C0(y),E=lP({node:y,nodeType:C,hasDimensions:D,resizeObserver:d}),L=sv({nodeRef:E,disabled:y.hidden||!P,noDragClassName:f,handleSelector:y.dragHandle,nodeId:e,isSelectable:I,nodeClickDistance:p}),k=ov();if(y.hidden)return null;const z=wn(y),_=J5(y),M=I||P||t||n||r||s,A=n?B=>n(B,{...j.userNode}):void 0,F=r?B=>r(B,{...j.userNode}):void 0,O=s?B=>s(B,{...j.userNode}):void 0,U=o?B=>o(B,{...j.userNode}):void 0,V=i?B=>i(B,{...j.userNode}):void 0,G=B=>{const{selectNodesOnDrag:Z,nodeDragThreshold:se}=T.getState();I&&(!Z||!P||se>0)&&Ku({id:e,store:T,nodeRef:E}),t&&t(B,{...j.userNode})},Y=B=>{if(!(P0(B.nativeEvent)||x)){if(x0.includes(B.key)&&I){const Z=B.key==="Escape";Ku({id:e,store:T,unselect:Z,nodeRef:E})}else if(P&&y.selected&&Object.prototype.hasOwnProperty.call(Ya,B.key)){B.preventDefault();const{ariaLabelConfig:Z}=T.getState();T.setState({ariaLiveMessage:Z["node.a11yDescription.ariaLiveMessage"]({direction:B.key.replace("Arrow","").toLowerCase(),x:~~j.positionAbsolute.x,y:~~j.positionAbsolute.y})}),k({direction:Ya[B.key],factor:B.shiftKey?4:1})}}},X=()=>{var ue;if(x||!((ue=E.current)!=null&&ue.matches(":focus-visible")))return;const{transform:B,width:Z,height:se,autoPanOnNodeFocus:ne,setCenter:ee}=T.getState();if(!ne)return;xf(new Map([[e,y]]),{x:0,y:0,width:Z,height:se},B,!0).length>0||ee(y.position.x+z.width/2,y.position.y+z.height/2,{zoom:B[2]})};return a.jsx("div",{className:Ae(["react-flow__node",`react-flow__node-${C}`,{[g]:P},y.className,{selected:y.selected,selectable:I,parent:S,draggable:P,dragging:L}]),ref:E,style:{zIndex:j.z,transform:`translate(${j.positionAbsolute.x}px,${j.positionAbsolute.y}px)`,pointerEvents:M?"all":"none",visibility:D?"visible":"hidden",...y.style,..._},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:A,onMouseMove:F,onMouseLeave:O,onContextMenu:U,onClick:G,onDoubleClick:V,onKeyDown:R?Y:void 0,tabIndex:R?0:void 0,onFocus:R?X:void 0,role:y.ariaRole??(R?"group":void 0),"aria-roledescription":"node","aria-describedby":x?void 0:`${Z0}-${w}`,"aria-label":y.ariaLabel,...y.domAttributes,children:a.jsx(W5,{value:e,children:a.jsx(b,{id:e,data:y.data,type:C,positionAbsoluteX:j.positionAbsolute.x,positionAbsoluteY:j.positionAbsolute.y,selected:y.selected??!1,selectable:I,draggable:P,deletable:y.deletable??!0,isConnectable:$,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:L,dragHandle:y.dragHandle,zIndex:j.z,parentId:y.parentId,...z})})})}var uP=m.memo(cP);const dP=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function lv(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,onError:o}=ie(dP,Se),i=oP(e.onlyRenderVisibleElements),l=aP();return a.jsx("div",{className:"react-flow__nodes",style:Rl,children:i.map(c=>a.jsx(uP,{id:c,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:l,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:o},c))})}lv.displayName="NodeRenderer";const fP=m.memo(lv);function hP(e){return ie(m.useCallback(n=>{if(!e)return n.edges.map(s=>s.id);const r=[];if(n.width&&n.height)for(const s of n.edges){const o=n.nodeLookup.get(s.source),i=n.nodeLookup.get(s.target);o&&i&&X3({sourceNode:o,targetNode:i,width:n.width,height:n.height,transform:n.transform})&&r.push(s.id)}return r},[e]),Se)}const mP=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return a.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},pP=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return a.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},up={[Ua.Arrow]:mP,[Ua.ArrowClosed]:pP};function gP(e){const t=be();return m.useMemo(()=>{var s,o;return Object.prototype.hasOwnProperty.call(up,e)?up[e]:((o=(s=t.getState()).onError)==null||o.call(s,"009",en.error009(e)),null)},[e])}const xP=({id:e,type:t,color:n,width:r=12.5,height:s=12.5,markerUnits:o="strokeWidth",strokeWidth:i,orient:l="auto-start-reverse"})=>{const c=gP(t);return c?a.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:l,refX:"0",refY:"0",children:a.jsx(c,{color:n,strokeWidth:i})}):null},cv=({defaultColor:e,rfId:t})=>{const n=ie(o=>o.edges),r=ie(o=>o.defaultEdgeOptions),s=m.useMemo(()=>r4(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return s.length?a.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:a.jsx("defs",{children:s.map(o=>a.jsx(xP,{id:o.id,type:o.type,color:o.color,width:o.width,height:o.height,markerUnits:o.markerUnits,strokeWidth:o.strokeWidth,orient:o.orient},o.id))})}):null};cv.displayName="MarkerDefinitions";var yP=m.memo(cv);function uv({x:e,y:t,label:n,labelStyle:r,labelShowBg:s=!0,labelBgStyle:o,labelBgPadding:i=[2,4],labelBgBorderRadius:l=2,children:c,className:u,...h}){const[d,f]=m.useState({x:1,y:0,width:0,height:0}),g=Ae(["react-flow__edge-textwrapper",u]),x=m.useRef(null);return m.useEffect(()=>{if(x.current){const w=x.current.getBBox();f({x:w.x,y:w.y,width:w.width,height:w.height})}},[n]),n?a.jsxs("g",{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:g,visibility:d.width?"visible":"hidden",...h,children:[s&&a.jsx("rect",{width:d.width+2*i[0],x:-i[0],y:-i[1],height:d.height+2*i[1],className:"react-flow__edge-textbg",style:o,rx:l,ry:l}),a.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:x,style:r,children:n}),c]}):null}uv.displayName="EdgeText";const vP=m.memo(uv);function Tl({path:e,labelX:t,labelY:n,label:r,labelStyle:s,labelShowBg:o,labelBgStyle:i,labelBgPadding:l,labelBgBorderRadius:c,interactionWidth:u=20,...h}){return a.jsxs(a.Fragment,{children:[a.jsx("path",{...h,d:e,fill:"none",className:Ae(["react-flow__edge-path",h.className])}),u?a.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&&Lt(t)&&Lt(n)?a.jsx(vP,{x:t,y:n,label:r,labelStyle:s,labelShowBg:o,labelBgStyle:i,labelBgPadding:l,labelBgBorderRadius:c}):null]})}function dp({pos:e,x1:t,y1:n,x2:r,y2:s}){return e===Q.Left||e===Q.Right?[.5*(t+r),n]:[t,.5*(n+s)]}function dv({sourceX:e,sourceY:t,sourcePosition:n=Q.Bottom,targetX:r,targetY:s,targetPosition:o=Q.Top}){const[i,l]=dp({pos:n,x1:e,y1:t,x2:r,y2:s}),[c,u]=dp({pos:o,x1:r,y1:s,x2:e,y2:t}),[h,d,f,g]=I0({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:i,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${i},${l} ${c},${u} ${r},${s}`,h,d,f,g]}function fv(e){return m.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,sourcePosition:i,targetPosition:l,label:c,labelStyle:u,labelShowBg:h,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:g,style:x,markerEnd:w,markerStart:N,interactionWidth:p})=>{const[v,y,j]=dv({sourceX:n,sourceY:r,sourcePosition:i,targetX:s,targetY:o,targetPosition:l}),S=e.isInternal?void 0:t;return a.jsx(Tl,{id:S,path:v,labelX:y,labelY:j,label:c,labelStyle:u,labelShowBg:h,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:g,style:x,markerEnd:w,markerStart:N,interactionWidth:p})})}const wP=fv({isInternal:!1}),hv=fv({isInternal:!0});wP.displayName="SimpleBezierEdge";hv.displayName="SimpleBezierEdgeInternal";function mv(e){return m.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,label:i,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:d,style:f,sourcePosition:g=Q.Bottom,targetPosition:x=Q.Top,markerEnd:w,markerStart:N,pathOptions:p,interactionWidth:v})=>{const[y,j,S]=Bu({sourceX:n,sourceY:r,sourcePosition:g,targetX:s,targetY:o,targetPosition:x,borderRadius:p==null?void 0:p.borderRadius,offset:p==null?void 0:p.offset,stepPosition:p==null?void 0:p.stepPosition}),C=e.isInternal?void 0:t;return a.jsx(Tl,{id:C,path:y,labelX:j,labelY:S,label:i,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:d,style:f,markerEnd:w,markerStart:N,interactionWidth:v})})}const pv=mv({isInternal:!1}),gv=mv({isInternal:!0});pv.displayName="SmoothStepEdge";gv.displayName="SmoothStepEdgeInternal";function xv(e){return m.memo(({id:t,...n})=>{var s;const r=e.isInternal?void 0:t;return a.jsx(pv,{...n,id:r,pathOptions:m.useMemo(()=>{var o;return{borderRadius:0,offset:(o=n.pathOptions)==null?void 0:o.offset}},[(s=n.pathOptions)==null?void 0:s.offset])})})}const NP=xv({isInternal:!1}),yv=xv({isInternal:!0});NP.displayName="StepEdge";yv.displayName="StepEdgeInternal";function vv(e){return m.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,label:i,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:d,style:f,markerEnd:g,markerStart:x,interactionWidth:w})=>{const[N,p,v]=L0({sourceX:n,sourceY:r,targetX:s,targetY:o}),y=e.isInternal?void 0:t;return a.jsx(Tl,{id:y,path:N,labelX:p,labelY:v,label:i,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:d,style:f,markerEnd:g,markerStart:x,interactionWidth:w})})}const jP=vv({isInternal:!1}),wv=vv({isInternal:!0});jP.displayName="StraightEdge";wv.displayName="StraightEdgeInternal";function Nv(e){return m.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,sourcePosition:i=Q.Bottom,targetPosition:l=Q.Top,label:c,labelStyle:u,labelShowBg:h,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:g,style:x,markerEnd:w,markerStart:N,pathOptions:p,interactionWidth:v})=>{const[y,j,S]=R0({sourceX:n,sourceY:r,sourcePosition:i,targetX:s,targetY:o,targetPosition:l,curvature:p==null?void 0:p.curvature}),C=e.isInternal?void 0:t;return a.jsx(Tl,{id:C,path:y,labelX:j,labelY:S,label:c,labelStyle:u,labelShowBg:h,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:g,style:x,markerEnd:w,markerStart:N,interactionWidth:v})})}const SP=Nv({isInternal:!1}),jv=Nv({isInternal:!0});SP.displayName="BezierEdge";jv.displayName="BezierEdgeInternal";const fp={default:jv,straight:wv,step:yv,smoothstep:gv,simplebezier:hv},hp={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},bP=(e,t,n)=>n===Q.Left?e-t:n===Q.Right?e+t:e,kP=(e,t,n)=>n===Q.Top?e-t:n===Q.Bottom?e+t:e,mp="react-flow__edgeupdater";function pp({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:s,onMouseEnter:o,onMouseOut:i,type:l}){return a.jsx("circle",{onMouseDown:s,onMouseEnter:o,onMouseOut:i,className:Ae([mp,`${mp}-${l}`]),cx:bP(t,r,e),cy:kP(n,r,e),r,stroke:"transparent",fill:"transparent"})}function CP({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:s,targetX:o,targetY:i,sourcePosition:l,targetPosition:c,onReconnect:u,onReconnectStart:h,onReconnectEnd:d,setReconnecting:f,setUpdateHover:g}){const x=be(),w=(j,S)=>{if(j.button!==0)return;const{autoPanOnConnect:C,domNode:b,isValidConnection:P,connectionMode:I,connectionRadius:$,lib:R,onConnectStart:T,onConnectEnd:D,cancelConnection:E,nodeLookup:L,rfId:k,panBy:z,updateConnection:_}=x.getState(),M=S.type==="target",A=(U,V)=>{f(!1),d==null||d(U,n,S.type,V)},F=U=>u==null?void 0:u(n,U),O=(U,V)=>{f(!0),h==null||h(j,n,S.type),T==null||T(U,V)};Wu.onPointerDown(j.nativeEvent,{autoPanOnConnect:C,connectionMode:I,connectionRadius:$,domNode:b,handleId:S.id,nodeId:S.nodeId,nodeLookup:L,isTarget:M,edgeUpdaterType:S.type,lib:R,flowId:k,cancelConnection:E,panBy:z,isValidConnection:P,onConnect:F,onConnectStart:O,onConnectEnd:D,onReconnectEnd:A,updateConnection:_,getTransform:()=>x.getState().transform,getFromHandle:()=>x.getState().connection.fromHandle,dragThreshold:x.getState().connectionDragThreshold,handleDomNode:j.currentTarget})},N=j=>w(j,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),p=j=>w(j,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),v=()=>g(!0),y=()=>g(!1);return a.jsxs(a.Fragment,{children:[(e===!0||e==="source")&&a.jsx(pp,{position:l,centerX:r,centerY:s,radius:t,onMouseDown:N,onMouseEnter:v,onMouseOut:y,type:"source"}),(e===!0||e==="target")&&a.jsx(pp,{position:c,centerX:o,centerY:i,radius:t,onMouseDown:p,onMouseEnter:v,onMouseOut:y,type:"target"})]})}function EP({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:s,onDoubleClick:o,onContextMenu:i,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,reconnectRadius:h,onReconnect:d,onReconnectStart:f,onReconnectEnd:g,rfId:x,edgeTypes:w,noPanClassName:N,onError:p,disableKeyboardA11y:v}){let y=ie(ee=>ee.edgeLookup.get(e));const j=ie(ee=>ee.defaultEdgeOptions);y=j?{...j,...y}:y;let S=y.type||"default",C=(w==null?void 0:w[S])||fp[S];C===void 0&&(p==null||p("011",en.error011(S)),S="default",C=(w==null?void 0:w.default)||fp.default);const b=!!(y.focusable||t&&typeof y.focusable>"u"),P=typeof d<"u"&&(y.reconnectable||n&&typeof y.reconnectable>"u"),I=!!(y.selectable||r&&typeof y.selectable>"u"),$=m.useRef(null),[R,T]=m.useState(!1),[D,E]=m.useState(!1),L=be(),{zIndex:k,sourceX:z,sourceY:_,targetX:M,targetY:A,sourcePosition:F,targetPosition:O}=ie(m.useCallback(ee=>{const J=ee.nodeLookup.get(y.source),ue=ee.nodeLookup.get(y.target);if(!J||!ue)return{zIndex:y.zIndex,...hp};const ge=n4({id:e,sourceNode:J,targetNode:ue,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:ee.connectionMode,onError:p});return{zIndex:Y3({selected:y.selected,zIndex:y.zIndex,sourceNode:J,targetNode:ue,elevateOnSelect:ee.elevateEdgesOnSelect,zIndexMode:ee.zIndexMode}),...ge||hp}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),Se),U=m.useMemo(()=>y.markerStart?`url('#${Vu(y.markerStart,x)}')`:void 0,[y.markerStart,x]),V=m.useMemo(()=>y.markerEnd?`url('#${Vu(y.markerEnd,x)}')`:void 0,[y.markerEnd,x]);if(y.hidden||z===null||_===null||M===null||A===null)return null;const G=ee=>{var le;const{addSelectedEdges:J,unselectNodesAndEdges:ue,multiSelectionActive:ge}=L.getState();I&&(L.setState({nodesSelectionActive:!1}),y.selected&&ge?(ue({nodes:[],edges:[y]}),(le=$.current)==null||le.blur()):J([e])),s&&s(ee,y)},Y=o?ee=>{o(ee,{...y})}:void 0,X=i?ee=>{i(ee,{...y})}:void 0,B=l?ee=>{l(ee,{...y})}:void 0,Z=c?ee=>{c(ee,{...y})}:void 0,se=u?ee=>{u(ee,{...y})}:void 0,ne=ee=>{var J;if(!v&&x0.includes(ee.key)&&I){const{unselectNodesAndEdges:ue,addSelectedEdges:ge}=L.getState();ee.key==="Escape"?((J=$.current)==null||J.blur(),ue({edges:[y]})):ge([e])}};return a.jsx("svg",{style:{zIndex:k},children:a.jsxs("g",{className:Ae(["react-flow__edge",`react-flow__edge-${S}`,y.className,N,{selected:y.selected,animated:y.animated,inactive:!I&&!s,updating:R,selectable:I}]),onClick:G,onDoubleClick:Y,onContextMenu:X,onMouseEnter:B,onMouseMove:Z,onMouseLeave:se,onKeyDown:b?ne:void 0,tabIndex:b?0:void 0,role:y.ariaRole??(b?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":y.ariaLabel===null?void 0:y.ariaLabel||`Edge from ${y.source} to ${y.target}`,"aria-describedby":b?`${J0}-${x}`:void 0,ref:$,...y.domAttributes,children:[!D&&a.jsx(C,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:I,deletable:y.deletable??!0,label:y.label,labelStyle:y.labelStyle,labelShowBg:y.labelShowBg,labelBgStyle:y.labelBgStyle,labelBgPadding:y.labelBgPadding,labelBgBorderRadius:y.labelBgBorderRadius,sourceX:z,sourceY:_,targetX:M,targetY:A,sourcePosition:F,targetPosition:O,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:U,markerEnd:V,pathOptions:"pathOptions"in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),P&&a.jsx(CP,{edge:y,isReconnectable:P,reconnectRadius:h,onReconnect:d,onReconnectStart:f,onReconnectEnd:g,sourceX:z,sourceY:_,targetX:M,targetY:A,sourcePosition:F,targetPosition:O,setUpdateHover:T,setReconnecting:E})]})})}var _P=m.memo(EP);const PP=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Sv({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:s,onReconnect:o,onEdgeContextMenu:i,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:h,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:g,onReconnectEnd:x,disableKeyboardA11y:w}){const{edgesFocusable:N,edgesReconnectable:p,elementsSelectable:v,onError:y}=ie(PP,Se),j=hP(t);return a.jsxs("div",{className:"react-flow__edges",children:[a.jsx(yP,{defaultColor:e,rfId:n}),j.map(S=>a.jsx(_P,{id:S,edgesFocusable:N,edgesReconnectable:p,elementsSelectable:v,noPanClassName:s,onReconnect:o,onContextMenu:i,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:h,reconnectRadius:d,onDoubleClick:f,onReconnectStart:g,onReconnectEnd:x,rfId:n,onError:y,edgeTypes:r,disableKeyboardA11y:w},S))]})}Sv.displayName="EdgeRenderer";const MP=m.memo(Sv),IP=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function RP({children:e}){const t=ie(IP);return a.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function TP(e){const t=kf(),n=m.useRef(!1);m.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const LP=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function AP(e){const t=ie(LP),n=be();return m.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function zP(e){return e.connection.inProgress?{...e.connection,to:ri(e.connection.to,e.transform)}:{...e.connection}}function DP(e){return zP}function $P(e){const t=DP();return ie(t,Se)}const OP=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function FP({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:s,width:o,height:i,isValid:l,inProgress:c}=ie(OP,Se);return!(o&&s&&c)?null:a.jsx("svg",{style:e,width:o,height:i,className:"react-flow__connectionline react-flow__container",children:a.jsx("g",{className:Ae(["react-flow__connection",w0(l)]),children:a.jsx(bv,{style:t,type:n,CustomComponent:r,isValid:l})})})}const bv=({style:e,type:t=Rn.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:s,from:o,fromNode:i,fromHandle:l,fromPosition:c,to:u,toNode:h,toHandle:d,toPosition:f,pointer:g}=$P();if(!s)return;if(n)return a.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:i,fromHandle:l,fromX:o.x,fromY:o.y,toX:u.x,toY:u.y,fromPosition:c,toPosition:f,connectionStatus:w0(r),toNode:h,toHandle:d,pointer:g});let x="";const w={sourceX:o.x,sourceY:o.y,sourcePosition:c,targetX:u.x,targetY:u.y,targetPosition:f};switch(t){case Rn.Bezier:[x]=R0(w);break;case Rn.SimpleBezier:[x]=dv(w);break;case Rn.Step:[x]=Bu({...w,borderRadius:0});break;case Rn.SmoothStep:[x]=Bu(w);break;default:[x]=L0(w)}return a.jsx("path",{d:x,fill:"none",className:"react-flow__connection-path",style:e})};bv.displayName="ConnectionLine";const HP={};function gp(e=HP){m.useRef(e),be(),m.useEffect(()=>{},[e])}function BP(){be(),m.useRef(!1),m.useEffect(()=>{},[])}function kv({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:o,onEdgeDoubleClick:i,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:h,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:g,connectionLineType:x,connectionLineStyle:w,connectionLineComponent:N,connectionLineContainerStyle:p,selectionKeyCode:v,selectionOnDrag:y,selectionMode:j,multiSelectionKeyCode:S,panActivationKeyCode:C,zoomActivationKeyCode:b,deleteKeyCode:P,onlyRenderVisibleElements:I,elementsSelectable:$,defaultViewport:R,translateExtent:T,minZoom:D,maxZoom:E,preventScrolling:L,defaultMarkerColor:k,zoomOnScroll:z,zoomOnPinch:_,panOnScroll:M,panOnScrollSpeed:A,panOnScrollMode:F,zoomOnDoubleClick:O,panOnDrag:U,onPaneClick:V,onPaneMouseEnter:G,onPaneMouseMove:Y,onPaneMouseLeave:X,onPaneScroll:B,onPaneContextMenu:Z,paneClickDistance:se,nodeClickDistance:ne,onEdgeContextMenu:ee,onEdgeMouseEnter:J,onEdgeMouseMove:ue,onEdgeMouseLeave:ge,reconnectRadius:le,onReconnect:We,onReconnectStart:Nn,onReconnectEnd:rn,noDragClassName:rr,noWheelClassName:Ts,noPanClassName:Ls,disableKeyboardA11y:As,nodeExtent:zl,rfId:si,viewport:Tr,onViewportChange:zs}){return gp(e),gp(t),BP(),TP(n),AP(Tr),a.jsx(rP,{onPaneClick:V,onPaneMouseEnter:G,onPaneMouseMove:Y,onPaneMouseLeave:X,onPaneContextMenu:Z,onPaneScroll:B,paneClickDistance:se,deleteKeyCode:P,selectionKeyCode:v,selectionOnDrag:y,selectionMode:j,onSelectionStart:f,onSelectionEnd:g,multiSelectionKeyCode:S,panActivationKeyCode:C,zoomActivationKeyCode:b,elementsSelectable:$,zoomOnScroll:z,zoomOnPinch:_,zoomOnDoubleClick:O,panOnScroll:M,panOnScrollSpeed:A,panOnScrollMode:F,panOnDrag:U,defaultViewport:R,translateExtent:T,minZoom:D,maxZoom:E,onSelectionContextMenu:d,preventScrolling:L,noDragClassName:rr,noWheelClassName:Ts,noPanClassName:Ls,disableKeyboardA11y:As,onViewportChange:zs,isControlledViewport:!!Tr,children:a.jsxs(RP,{children:[a.jsx(MP,{edgeTypes:t,onEdgeClick:s,onEdgeDoubleClick:i,onReconnect:We,onReconnectStart:Nn,onReconnectEnd:rn,onlyRenderVisibleElements:I,onEdgeContextMenu:ee,onEdgeMouseEnter:J,onEdgeMouseMove:ue,onEdgeMouseLeave:ge,reconnectRadius:le,defaultMarkerColor:k,noPanClassName:Ls,disableKeyboardA11y:As,rfId:si}),a.jsx(FP,{style:w,type:x,component:N,containerStyle:p}),a.jsx("div",{className:"react-flow__edgelabel-renderer"}),a.jsx(fP,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:o,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:h,nodeClickDistance:ne,onlyRenderVisibleElements:I,noPanClassName:Ls,noDragClassName:rr,disableKeyboardA11y:As,nodeExtent:zl,rfId:si}),a.jsx("div",{className:"react-flow__viewport-portal"})]})})}kv.displayName="GraphView";const VP=m.memo(kv),xp=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:i,fitViewOptions:l,minZoom:c=.5,maxZoom:u=2,nodeOrigin:h,nodeExtent:d,zIndexMode:f="basic"}={})=>{const g=new Map,x=new Map,w=new Map,N=new Map,p=r??t??[],v=n??e??[],y=h??[0,0],j=d??Oo;D0(w,N,p);const S=Uu(v,g,x,{nodeOrigin:y,nodeExtent:j,zIndexMode:f});let C=[0,0,1];if(i&&s&&o){const b=ti(g,{filter:R=>!!((R.width||R.initialWidth)&&(R.height||R.initialHeight))}),{x:P,y:I,zoom:$}=yf(b,s,o,c,u,(l==null?void 0:l.padding)??.1);C=[P,I,$]}return{rfId:"1",width:s??0,height:o??0,transform:C,nodes:v,nodesInitialized:S,nodeLookup:g,parentLookup:x,edges:p,edgeLookup:N,connectionLookup:w,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:u,translateExtent:Oo,nodeExtent:j,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:vs.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:y,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:i??!1,fitViewOptions:l,fitViewResolver:null,connection:{...v0},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:B3,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:y0,zIndexMode:f,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},UP=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:i,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:h,nodeExtent:d,zIndexMode:f})=>i5((g,x)=>{async function w(){const{nodeLookup:N,panZoom:p,fitViewOptions:v,fitViewResolver:y,width:j,height:S,minZoom:C,maxZoom:b}=x();p&&(await F3({nodes:N,width:j,height:S,panZoom:p,minZoom:C,maxZoom:b},v),y==null||y.resolve(!0),g({fitViewResolver:null}))}return{...xp({nodes:e,edges:t,width:s,height:o,fitView:i,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:h,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:f}),setNodes:N=>{const{nodeLookup:p,parentLookup:v,nodeOrigin:y,elevateNodesOnSelect:j,fitViewQueued:S,zIndexMode:C}=x(),b=Uu(N,p,v,{nodeOrigin:y,nodeExtent:d,elevateNodesOnSelect:j,checkEquality:!0,zIndexMode:C});S&&b?(w(),g({nodes:N,nodesInitialized:b,fitViewQueued:!1,fitViewOptions:void 0})):g({nodes:N,nodesInitialized:b})},setEdges:N=>{const{connectionLookup:p,edgeLookup:v}=x();D0(p,v,N),g({edges:N})},setDefaultNodesAndEdges:(N,p)=>{if(N){const{setNodes:v}=x();v(N),g({hasDefaultNodes:!0})}if(p){const{setEdges:v}=x();v(p),g({hasDefaultEdges:!0})}},updateNodeInternals:N=>{const{triggerNodeChanges:p,nodeLookup:v,parentLookup:y,domNode:j,nodeOrigin:S,nodeExtent:C,debug:b,fitViewQueued:P,zIndexMode:I}=x(),{changes:$,updatedInternals:R}=u4(N,v,y,j,S,C,I);R&&(i4(v,y,{nodeOrigin:S,nodeExtent:C,zIndexMode:I}),P?(w(),g({fitViewQueued:!1,fitViewOptions:void 0})):g({}),($==null?void 0:$.length)>0&&(b&&console.log("React Flow: trigger node changes",$),p==null||p($)))},updateNodePositions:(N,p=!1)=>{const v=[];let y=[];const{nodeLookup:j,triggerNodeChanges:S,connection:C,updateConnection:b,onNodesChangeMiddlewareMap:P}=x();for(const[I,$]of N){const R=j.get(I),T=!!(R!=null&&R.expandParent&&(R!=null&&R.parentId)&&($!=null&&$.position)),D={id:I,type:"position",position:T?{x:Math.max(0,$.position.x),y:Math.max(0,$.position.y)}:$.position,dragging:p};if(R&&C.inProgress&&C.fromNode.id===R.id){const E=Cr(R,C.fromHandle,Q.Left,!0);b({...C,from:E})}T&&R.parentId&&v.push({id:I,parentId:R.parentId,rect:{...$.internals.positionAbsolute,width:$.measured.width??0,height:$.measured.height??0}}),y.push(D)}if(v.length>0){const{parentLookup:I,nodeOrigin:$}=x(),R=bf(v,j,I,$);y.push(...R)}for(const I of P.values())y=I(y);S(y)},triggerNodeChanges:N=>{const{onNodesChange:p,setNodes:v,nodes:y,hasDefaultNodes:j,debug:S}=x();if(N!=null&&N.length){if(j){const C=E5(N,y);v(C)}S&&console.log("React Flow: trigger node changes",N),p==null||p(N)}},triggerEdgeChanges:N=>{const{onEdgesChange:p,setEdges:v,edges:y,hasDefaultEdges:j,debug:S}=x();if(N!=null&&N.length){if(j){const C=_5(N,y);v(C)}S&&console.log("React Flow: trigger edge changes",N),p==null||p(N)}},addSelectedNodes:N=>{const{multiSelectionActive:p,edgeLookup:v,nodeLookup:y,triggerNodeChanges:j,triggerEdgeChanges:S}=x();if(p){const C=N.map(b=>ir(b,!0));j(C);return}j(Zr(y,new Set([...N]),!0)),S(Zr(v))},addSelectedEdges:N=>{const{multiSelectionActive:p,edgeLookup:v,nodeLookup:y,triggerNodeChanges:j,triggerEdgeChanges:S}=x();if(p){const C=N.map(b=>ir(b,!0));S(C);return}S(Zr(v,new Set([...N]))),j(Zr(y,new Set,!0))},unselectNodesAndEdges:({nodes:N,edges:p}={})=>{const{edges:v,nodes:y,nodeLookup:j,triggerNodeChanges:S,triggerEdgeChanges:C}=x(),b=N||y,P=p||v,I=b.map(R=>{const T=j.get(R.id);return T&&(T.selected=!1),ir(R.id,!1)}),$=P.map(R=>ir(R.id,!1));S(I),C($)},setMinZoom:N=>{const{panZoom:p,maxZoom:v}=x();p==null||p.setScaleExtent([N,v]),g({minZoom:N})},setMaxZoom:N=>{const{panZoom:p,minZoom:v}=x();p==null||p.setScaleExtent([v,N]),g({maxZoom:N})},setTranslateExtent:N=>{var p;(p=x().panZoom)==null||p.setTranslateExtent(N),g({translateExtent:N})},resetSelectedElements:()=>{const{edges:N,nodes:p,triggerNodeChanges:v,triggerEdgeChanges:y,elementsSelectable:j}=x();if(!j)return;const S=p.reduce((b,P)=>P.selected?[...b,ir(P.id,!1)]:b,[]),C=N.reduce((b,P)=>P.selected?[...b,ir(P.id,!1)]:b,[]);v(S),y(C)},setNodeExtent:N=>{const{nodes:p,nodeLookup:v,parentLookup:y,nodeOrigin:j,elevateNodesOnSelect:S,nodeExtent:C,zIndexMode:b}=x();N[0][0]===C[0][0]&&N[0][1]===C[0][1]&&N[1][0]===C[1][0]&&N[1][1]===C[1][1]||(Uu(p,v,y,{nodeOrigin:j,nodeExtent:N,elevateNodesOnSelect:S,checkEquality:!1,zIndexMode:b}),g({nodeExtent:N}))},panBy:N=>{const{transform:p,width:v,height:y,panZoom:j,translateExtent:S}=x();return d4({delta:N,panZoom:j,transform:p,translateExtent:S,width:v,height:y})},setCenter:async(N,p,v)=>{const{width:y,height:j,maxZoom:S,panZoom:C}=x();if(!C)return Promise.resolve(!1);const b=typeof(v==null?void 0:v.zoom)<"u"?v.zoom:S;return await C.setViewport({x:y/2-N*b,y:j/2-p*b,zoom:b},{duration:v==null?void 0:v.duration,ease:v==null?void 0:v.ease,interpolate:v==null?void 0:v.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{g({connection:{...v0}})},updateConnection:N=>{g({connection:N})},reset:()=>g({...xp()})}},Object.is);function WP({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:s,initialHeight:o,initialMinZoom:i,initialMaxZoom:l,initialFitViewOptions:c,fitView:u,nodeOrigin:h,nodeExtent:d,zIndexMode:f,children:g}){const[x]=m.useState(()=>UP({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:u,minZoom:i,maxZoom:l,fitViewOptions:c,nodeOrigin:h,nodeExtent:d,zIndexMode:f}));return a.jsx(a5,{value:x,children:a.jsx(R5,{children:g})})}function KP({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:s,width:o,height:i,fitView:l,fitViewOptions:c,minZoom:u,maxZoom:h,nodeOrigin:d,nodeExtent:f,zIndexMode:g}){return m.useContext(Ml)?a.jsx(a.Fragment,{children:e}):a.jsx(WP,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:s,initialWidth:o,initialHeight:i,fitView:l,initialFitViewOptions:c,initialMinZoom:u,initialMaxZoom:h,nodeOrigin:d,nodeExtent:f,zIndexMode:g,children:e})}const GP={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function YP({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:s,nodeTypes:o,edgeTypes:i,onNodeClick:l,onEdgeClick:c,onInit:u,onMove:h,onMoveStart:d,onMoveEnd:f,onConnect:g,onConnectStart:x,onConnectEnd:w,onClickConnectStart:N,onClickConnectEnd:p,onNodeMouseEnter:v,onNodeMouseMove:y,onNodeMouseLeave:j,onNodeContextMenu:S,onNodeDoubleClick:C,onNodeDragStart:b,onNodeDrag:P,onNodeDragStop:I,onNodesDelete:$,onEdgesDelete:R,onDelete:T,onSelectionChange:D,onSelectionDragStart:E,onSelectionDrag:L,onSelectionDragStop:k,onSelectionContextMenu:z,onSelectionStart:_,onSelectionEnd:M,onBeforeDelete:A,connectionMode:F,connectionLineType:O=Rn.Bezier,connectionLineStyle:U,connectionLineComponent:V,connectionLineContainerStyle:G,deleteKeyCode:Y="Backspace",selectionKeyCode:X="Shift",selectionOnDrag:B=!1,selectionMode:Z=Fo.Full,panActivationKeyCode:se="Space",multiSelectionKeyCode:ne=Bo()?"Meta":"Control",zoomActivationKeyCode:ee=Bo()?"Meta":"Control",snapToGrid:J,snapGrid:ue,onlyRenderVisibleElements:ge=!1,selectNodesOnDrag:le,nodesDraggable:We,autoPanOnNodeFocus:Nn,nodesConnectable:rn,nodesFocusable:rr,nodeOrigin:Ts=ev,edgesFocusable:Ls,edgesReconnectable:As,elementsSelectable:zl=!0,defaultViewport:si=w5,minZoom:Tr=.5,maxZoom:zs=2,translateExtent:If=Oo,preventScrolling:Xv=!0,nodeExtent:Dl,defaultMarkerColor:Qv="#b1b1b7",zoomOnScroll:qv=!0,zoomOnPinch:Zv=!0,panOnScroll:Jv=!1,panOnScrollSpeed:ew=.5,panOnScrollMode:tw=pr.Free,zoomOnDoubleClick:nw=!0,panOnDrag:rw=!0,onPaneClick:sw,onPaneMouseEnter:ow,onPaneMouseMove:iw,onPaneMouseLeave:aw,onPaneScroll:lw,onPaneContextMenu:cw,paneClickDistance:uw=1,nodeClickDistance:dw=0,children:fw,onReconnect:hw,onReconnectStart:mw,onReconnectEnd:pw,onEdgeContextMenu:gw,onEdgeDoubleClick:xw,onEdgeMouseEnter:yw,onEdgeMouseMove:vw,onEdgeMouseLeave:ww,reconnectRadius:Nw=10,onNodesChange:jw,onEdgesChange:Sw,noDragClassName:bw="nodrag",noWheelClassName:kw="nowheel",noPanClassName:Rf="nopan",fitView:Tf,fitViewOptions:Lf,connectOnClick:Cw,attributionPosition:Ew,proOptions:_w,defaultEdgeOptions:Pw,elevateNodesOnSelect:Mw=!0,elevateEdgesOnSelect:Iw=!1,disableKeyboardA11y:Af=!1,autoPanOnConnect:Rw,autoPanOnNodeDrag:Tw,autoPanSpeed:Lw,connectionRadius:Aw,isValidConnection:zw,onError:Dw,style:$w,id:zf,nodeDragThreshold:Ow,connectionDragThreshold:Fw,viewport:Hw,onViewportChange:Bw,width:Vw,height:Uw,colorMode:Ww="light",debug:Kw,onScroll:oi,ariaLabelConfig:Gw,zIndexMode:Df="basic",...Yw},Xw){const $l=zf||"1",Qw=b5(Ww),qw=m.useCallback($f=>{$f.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),oi==null||oi($f)},[oi]);return a.jsx("div",{"data-testid":"rf__wrapper",...Yw,onScroll:qw,style:{...$w,...GP},ref:Xw,className:Ae(["react-flow",s,Qw]),id:zf,role:"application",children:a.jsxs(KP,{nodes:e,edges:t,width:Vw,height:Uw,fitView:Tf,fitViewOptions:Lf,minZoom:Tr,maxZoom:zs,nodeOrigin:Ts,nodeExtent:Dl,zIndexMode:Df,children:[a.jsx(VP,{onInit:u,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:v,onNodeMouseMove:y,onNodeMouseLeave:j,onNodeContextMenu:S,onNodeDoubleClick:C,nodeTypes:o,edgeTypes:i,connectionLineType:O,connectionLineStyle:U,connectionLineComponent:V,connectionLineContainerStyle:G,selectionKeyCode:X,selectionOnDrag:B,selectionMode:Z,deleteKeyCode:Y,multiSelectionKeyCode:ne,panActivationKeyCode:se,zoomActivationKeyCode:ee,onlyRenderVisibleElements:ge,defaultViewport:si,translateExtent:If,minZoom:Tr,maxZoom:zs,preventScrolling:Xv,zoomOnScroll:qv,zoomOnPinch:Zv,zoomOnDoubleClick:nw,panOnScroll:Jv,panOnScrollSpeed:ew,panOnScrollMode:tw,panOnDrag:rw,onPaneClick:sw,onPaneMouseEnter:ow,onPaneMouseMove:iw,onPaneMouseLeave:aw,onPaneScroll:lw,onPaneContextMenu:cw,paneClickDistance:uw,nodeClickDistance:dw,onSelectionContextMenu:z,onSelectionStart:_,onSelectionEnd:M,onReconnect:hw,onReconnectStart:mw,onReconnectEnd:pw,onEdgeContextMenu:gw,onEdgeDoubleClick:xw,onEdgeMouseEnter:yw,onEdgeMouseMove:vw,onEdgeMouseLeave:ww,reconnectRadius:Nw,defaultMarkerColor:Qv,noDragClassName:bw,noWheelClassName:kw,noPanClassName:Rf,rfId:$l,disableKeyboardA11y:Af,nodeExtent:Dl,viewport:Hw,onViewportChange:Bw}),a.jsx(S5,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:g,onConnectStart:x,onConnectEnd:w,onClickConnectStart:N,onClickConnectEnd:p,nodesDraggable:We,autoPanOnNodeFocus:Nn,nodesConnectable:rn,nodesFocusable:rr,edgesFocusable:Ls,edgesReconnectable:As,elementsSelectable:zl,elevateNodesOnSelect:Mw,elevateEdgesOnSelect:Iw,minZoom:Tr,maxZoom:zs,nodeExtent:Dl,onNodesChange:jw,onEdgesChange:Sw,snapToGrid:J,snapGrid:ue,connectionMode:F,translateExtent:If,connectOnClick:Cw,defaultEdgeOptions:Pw,fitView:Tf,fitViewOptions:Lf,onNodesDelete:$,onEdgesDelete:R,onDelete:T,onNodeDragStart:b,onNodeDrag:P,onNodeDragStop:I,onSelectionDrag:L,onSelectionDragStart:E,onSelectionDragStop:k,onMove:h,onMoveStart:d,onMoveEnd:f,noPanClassName:Rf,nodeOrigin:Ts,rfId:$l,autoPanOnConnect:Rw,autoPanOnNodeDrag:Tw,autoPanSpeed:Lw,onError:Dw,connectionRadius:Aw,isValidConnection:zw,selectNodesOnDrag:le,nodeDragThreshold:Ow,connectionDragThreshold:Fw,onBeforeDelete:A,debug:Kw,ariaLabelConfig:Gw,zIndexMode:Df}),a.jsx(v5,{onSelectionChange:D}),fw,a.jsx(m5,{proOptions:_w,position:Ew}),a.jsx(h5,{rfId:$l,disableKeyboardA11y:Af})]})})}var XP=nv(YP);function QP({dimensions:e,lineWidth:t,variant:n,className:r}){return a.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Ae(["react-flow__background-pattern",n,r])})}function qP({radius:e,className:t}){return a.jsx("circle",{cx:e,cy:e,r:e,className:Ae(["react-flow__background-pattern","dots",t])})}var Vn;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Vn||(Vn={}));const ZP={[Vn.Dots]:1,[Vn.Lines]:1,[Vn.Cross]:6},JP=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Cv({id:e,variant:t=Vn.Dots,gap:n=20,size:r,lineWidth:s=1,offset:o=0,color:i,bgColor:l,style:c,className:u,patternClassName:h}){const d=m.useRef(null),{transform:f,patternId:g}=ie(JP,Se),x=r||ZP[t],w=t===Vn.Dots,N=t===Vn.Cross,p=Array.isArray(n)?n:[n,n],v=[p[0]*f[2]||1,p[1]*f[2]||1],y=x*f[2],j=Array.isArray(o)?o:[o,o],S=N?[y,y]:v,C=[j[0]*f[2]||1+S[0]/2,j[1]*f[2]||1+S[1]/2],b=`${g}${e||""}`;return a.jsxs("svg",{className:Ae(["react-flow__background",u]),style:{...c,...Rl,"--xy-background-color-props":l,"--xy-background-pattern-color-props":i},ref:d,"data-testid":"rf__background",children:[a.jsx("pattern",{id:b,x:f[0]%v[0],y:f[1]%v[1],width:v[0],height:v[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${C[0]},-${C[1]})`,children:w?a.jsx(qP,{radius:y/2,className:h}):a.jsx(QP,{dimensions:S,lineWidth:s,variant:t,className:h})}),a.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${b})`})]})}Cv.displayName="Background";const eM=m.memo(Cv);function tM(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:a.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function nM(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:a.jsx("path",{d:"M0 0h32v4.2H0z"})})}function rM(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:a.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 sM(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:a.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 oM(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:a.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 $i({children:e,className:t,...n}){return a.jsx("button",{type:"button",className:Ae(["react-flow__controls-button",t]),...n,children:e})}const iM=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function Ev({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:o,onZoomOut:i,onFitView:l,onInteractiveChange:c,className:u,children:h,position:d="bottom-left",orientation:f="vertical","aria-label":g}){const x=be(),{isInteractive:w,minZoomReached:N,maxZoomReached:p,ariaLabelConfig:v}=ie(iM,Se),{zoomIn:y,zoomOut:j,fitView:S}=kf(),C=()=>{y(),o==null||o()},b=()=>{j(),i==null||i()},P=()=>{S(s),l==null||l()},I=()=>{x.setState({nodesDraggable:!w,nodesConnectable:!w,elementsSelectable:!w}),c==null||c(!w)},$=f==="horizontal"?"horizontal":"vertical";return a.jsxs(Il,{className:Ae(["react-flow__controls",$,u]),position:d,style:e,"data-testid":"rf__controls","aria-label":g??v["controls.ariaLabel"],children:[t&&a.jsxs(a.Fragment,{children:[a.jsx($i,{onClick:C,className:"react-flow__controls-zoomin",title:v["controls.zoomIn.ariaLabel"],"aria-label":v["controls.zoomIn.ariaLabel"],disabled:p,children:a.jsx(tM,{})}),a.jsx($i,{onClick:b,className:"react-flow__controls-zoomout",title:v["controls.zoomOut.ariaLabel"],"aria-label":v["controls.zoomOut.ariaLabel"],disabled:N,children:a.jsx(nM,{})})]}),n&&a.jsx($i,{className:"react-flow__controls-fitview",onClick:P,title:v["controls.fitView.ariaLabel"],"aria-label":v["controls.fitView.ariaLabel"],children:a.jsx(rM,{})}),r&&a.jsx($i,{className:"react-flow__controls-interactive",onClick:I,title:v["controls.interactive.ariaLabel"],"aria-label":v["controls.interactive.ariaLabel"],children:w?a.jsx(oM,{}):a.jsx(sM,{})}),h]})}Ev.displayName="Controls";const aM=m.memo(Ev);function lM({id:e,x:t,y:n,width:r,height:s,style:o,color:i,strokeColor:l,strokeWidth:c,className:u,borderRadius:h,shapeRendering:d,selected:f,onClick:g}){const{background:x,backgroundColor:w}=o||{},N=i||x||w;return a.jsx("rect",{className:Ae(["react-flow__minimap-node",{selected:f},u]),x:t,y:n,rx:h,ry:h,width:r,height:s,style:{fill:N,stroke:l,strokeWidth:c},shapeRendering:d,onClick:g?p=>g(p,e):void 0})}const cM=m.memo(lM),uM=e=>e.nodes.map(t=>t.id),Mc=e=>e instanceof Function?e:()=>e;function dM({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:o=cM,onClick:i}){const l=ie(uM,Se),c=Mc(t),u=Mc(e),h=Mc(n),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return a.jsx(a.Fragment,{children:l.map(f=>a.jsx(hM,{id:f,nodeColorFunc:c,nodeStrokeColorFunc:u,nodeClassNameFunc:h,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:o,onClick:i,shapeRendering:d},f))})}function fM({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:o,shapeRendering:i,NodeComponent:l,onClick:c}){const{node:u,x:h,y:d,width:f,height:g}=ie(x=>{const{internals:w}=x.nodeLookup.get(e),N=w.userNode,{x:p,y:v}=w.positionAbsolute,{width:y,height:j}=wn(N);return{node:N,x:p,y:v,width:y,height:j}},Se);return!u||u.hidden||!C0(u)?null:a.jsx(l,{x:h,y:d,width:f,height:g,style:u.style,selected:!!u.selected,className:r(u),color:t(u),borderRadius:s,strokeColor:n(u),strokeWidth:o,shapeRendering:i,onClick:c,id:u.id})}const hM=m.memo(fM);var mM=m.memo(dM);const pM=200,gM=150,xM=e=>!e.hidden,yM=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?k0(ti(e.nodeLookup,{filter:xM}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},vM="react-flow__minimap-desc";function _v({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:s="",nodeBorderRadius:o=5,nodeStrokeWidth:i,nodeComponent:l,bgColor:c,maskColor:u,maskStrokeColor:h,maskStrokeWidth:d,position:f="bottom-right",onClick:g,onNodeClick:x,pannable:w=!1,zoomable:N=!1,ariaLabel:p,inversePan:v,zoomStep:y=1,offsetScale:j=5}){const S=be(),C=m.useRef(null),{boundingRect:b,viewBB:P,rfId:I,panZoom:$,translateExtent:R,flowWidth:T,flowHeight:D,ariaLabelConfig:E}=ie(yM,Se),L=(e==null?void 0:e.width)??pM,k=(e==null?void 0:e.height)??gM,z=b.width/L,_=b.height/k,M=Math.max(z,_),A=M*L,F=M*k,O=j*M,U=b.x-(A-b.width)/2-O,V=b.y-(F-b.height)/2-O,G=A+O*2,Y=F+O*2,X=`${vM}-${I}`,B=m.useRef(0),Z=m.useRef();B.current=M,m.useEffect(()=>{if(C.current&&$)return Z.current=w4({domNode:C.current,panZoom:$,getTransform:()=>S.getState().transform,getViewScale:()=>B.current}),()=>{var J;(J=Z.current)==null||J.destroy()}},[$]),m.useEffect(()=>{var J;(J=Z.current)==null||J.update({translateExtent:R,width:T,height:D,inversePan:v,pannable:w,zoomStep:y,zoomable:N})},[w,N,v,y,R,T,D]);const se=g?J=>{var le;const[ue,ge]=((le=Z.current)==null?void 0:le.pointer(J))||[0,0];g(J,{x:ue,y:ge})}:void 0,ne=x?m.useCallback((J,ue)=>{const ge=S.getState().nodeLookup.get(ue).internals.userNode;x(J,ge)},[]):void 0,ee=p??E["minimap.ariaLabel"];return a.jsx(Il,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-stroke-width-props":typeof d=="number"?d*M:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof i=="number"?i:void 0},className:Ae(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:a.jsxs("svg",{width:L,height:k,viewBox:`${U} ${V} ${G} ${Y}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":X,ref:C,onClick:se,children:[ee&&a.jsx("title",{id:X,children:ee}),a.jsx(mM,{onClick:ne,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:o,nodeClassName:s,nodeStrokeWidth:i,nodeComponent:l}),a.jsx("path",{className:"react-flow__minimap-mask",d:`M${U-O},${V-O}h${G+O*2}v${Y+O*2}h${-G-O*2}z
|
|
397
|
-
M${P.x},${P.y}h${P.width}v${P.height}h${-P.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}_v.displayName="MiniMap";m.memo(_v);const wM=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,NM={[Ss.Line]:"right",[Ss.Handle]:"bottom-right"};function jM({nodeId:e,position:t,variant:n=Ss.Handle,className:r,style:s=void 0,children:o,color:i,minWidth:l=10,minHeight:c=10,maxWidth:u=Number.MAX_VALUE,maxHeight:h=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:f,autoScale:g=!0,shouldResize:x,onResizeStart:w,onResize:N,onResizeEnd:p}){const v=iv(),y=typeof e=="string"?e:v,j=be(),S=m.useRef(null),C=n===Ss.Handle,b=ie(m.useCallback(wM(C&&g),[C,g]),Se),P=m.useRef(null),I=t??NM[n];m.useEffect(()=>{if(!(!S.current||!y))return P.current||(P.current=L4({domNode:S.current,nodeId:y,getStoreItems:()=>{const{nodeLookup:R,transform:T,snapGrid:D,snapToGrid:E,nodeOrigin:L,domNode:k}=j.getState();return{nodeLookup:R,transform:T,snapGrid:D,snapToGrid:E,nodeOrigin:L,paneDomNode:k}},onChange:(R,T)=>{const{triggerNodeChanges:D,nodeLookup:E,parentLookup:L,nodeOrigin:k}=j.getState(),z=[],_={x:R.x,y:R.y},M=E.get(y);if(M&&M.expandParent&&M.parentId){const A=M.origin??k,F=R.width??M.measured.width??0,O=R.height??M.measured.height??0,U={id:M.id,parentId:M.parentId,rect:{width:F,height:O,...E0({x:R.x??M.position.x,y:R.y??M.position.y},{width:F,height:O},M.parentId,E,A)}},V=bf([U],E,L,k);z.push(...V),_.x=R.x?Math.max(A[0]*F,R.x):void 0,_.y=R.y?Math.max(A[1]*O,R.y):void 0}if(_.x!==void 0&&_.y!==void 0){const A={id:y,type:"position",position:{..._}};z.push(A)}if(R.width!==void 0&&R.height!==void 0){const F={id:y,type:"dimensions",resizing:!0,setAttributes:f?f==="horizontal"?"width":"height":!0,dimensions:{width:R.width,height:R.height}};z.push(F)}for(const A of T){const F={...A,type:"position"};z.push(F)}D(z)},onEnd:({width:R,height:T})=>{const D={id:y,type:"dimensions",resizing:!1,dimensions:{width:R,height:T}};j.getState().triggerNodeChanges([D])}})),P.current.update({controlPosition:I,boundaries:{minWidth:l,minHeight:c,maxWidth:u,maxHeight:h},keepAspectRatio:d,resizeDirection:f,onResizeStart:w,onResize:N,onResizeEnd:p,shouldResize:x}),()=>{var R;(R=P.current)==null||R.destroy()}},[I,l,c,u,h,d,w,N,p,x]);const $=I.split("-");return a.jsx("div",{className:Ae(["react-flow__resize-control","nodrag",...$,n,r]),ref:S,style:{...s,scale:b,...i&&{[C?"backgroundColor":"borderColor"]:i}},children:o})}m.memo(jM);function SM(){const[e,t]=m.useState(()=>document.documentElement.classList.contains("dark"));return m.useEffect(()=>{const n=new MutationObserver(()=>t(document.documentElement.classList.contains("dark")));return n.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>n.disconnect()},[]),e}function bM(){const[e,t]=m.useState([]),[n,r]=m.useState([]),[s,o]=m.useState(!0),i=SM();m.useEffect(()=>{Promise.all([te.discovery.agents(),te.observations.permissions()]).then(([u,h])=>{t(u.data??[]),r(h.data??[]),o(!1)}).catch(()=>o(!1))},[]);const{nodes:l,edges:c}=m.useMemo(()=>{const u=[],h=[],d=new Set,f=new Map,g=i?{background:"#18181b",color:"#fafafa",border:"1px solid #3f3f46"}:{background:"#ffffff",color:"#09090b",border:"1px solid #e4e4e7"},x=i?{background:"#09090b",color:"#a1a1aa",border:"1px solid #3f3f46"}:{background:"#f4f4f5",color:"#52525b",border:"1px solid #d4d4d8"},w=i?"#52525b":"#a1a1aa",N=i?"#27272a":"#e4e4e7";return e.forEach((p,v)=>{const y=`agent-${p.id}`;p.registeredAgentId&&f.set(p.registeredAgentId,y),f.set(p.id,y),u.push({id:y,position:{x:100,y:v*120},data:{label:`${p.emoji||"🤖"} ${p.name}`},style:{...g,borderRadius:"8px",padding:"8px 16px",fontSize:"13px"}})}),n.forEach(p=>{const v=`tool-${p.toolName}`;d.has(p.toolName)||(d.add(p.toolName),u.push({id:v,position:{x:400,y:d.size*80},data:{label:`🔧 ${p.toolName}`},style:{...x,borderRadius:"8px",padding:"6px 12px",fontSize:"12px"}}));const y=f.get(p.agentId)??`agent-${p.agentId}`;h.push({id:`e-${p.agentId}-${p.toolName}`,source:y,target:v,animated:p.accessPattern==="write",style:{stroke:p.accessPattern==="write"?"#eab308":w}})}),{nodes:u,edges:h,bgColor:N}},[e,n,i]);return s?a.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Identity Graph"}),a.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Agent-to-tool relationship visualization"})]}),a.jsx("div",{className:"h-[600px] rounded-lg border border-border bg-card",children:a.jsxs(XP,{nodes:l,edges:c,fitView:!0,proOptions:{hideAttribution:!0},children:[a.jsx(eM,{color:i?"#27272a":"#e4e4e7",gap:20}),a.jsx(aM,{})]})})]})}const Ef=m.forwardRef(({className:e,...t},n)=>a.jsx("textarea",{className:Te("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...t}));Ef.displayName="Textarea";function kM(e){const t=e+"CollectionProvider",[n,r]=yl(t),[s,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=g=>{const{scope:x,children:w}=g,N=Wt.useRef(null),p=Wt.useRef(new Map).current;return a.jsx(s,{scope:x,itemMap:p,collectionRef:N,children:w})};i.displayName=t;const l=e+"CollectionSlot",c=Wt.forwardRef((g,x)=>{const{scope:w,children:N}=g,p=o(l,w),v=Jt(x,p.collectionRef);return a.jsx(gs,{ref:v,children:N})});c.displayName=l;const u=e+"CollectionItemSlot",h="data-radix-collection-item",d=Wt.forwardRef((g,x)=>{const{scope:w,children:N,...p}=g,v=Wt.useRef(null),y=Jt(x,v),j=o(u,w);return Wt.useEffect(()=>(j.itemMap.set(v,{ref:v,...p}),()=>void j.itemMap.delete(v))),a.jsx(gs,{[h]:"",ref:y,children:N})});d.displayName=u;function f(g){const x=o(e+"CollectionConsumer",g);return Wt.useCallback(()=>{const N=x.collectionRef.current;if(!N)return[];const p=Array.from(N.querySelectorAll(`[${h}]`));return Array.from(x.itemMap.values()).sort((j,S)=>p.indexOf(j.ref.current)-p.indexOf(S.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:i,Slot:c,ItemSlot:d},f,r]}var CM=m.createContext(void 0);function Pv(e){const t=m.useContext(CM);return e||t||"ltr"}var Ic="rovingFocusGroup.onEntryFocus",EM={bubbles:!1,cancelable:!0},Ll="RovingFocusGroup",[Gu,Mv,_M]=kM(Ll),[PM,Iv]=yl(Ll,[_M]),[MM,IM]=PM(Ll),Rv=m.forwardRef((e,t)=>a.jsx(Gu.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(Gu.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx(RM,{...e,ref:t})})}));Rv.displayName=Ll;var RM=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:o,currentTabStopId:i,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:h=!1,...d}=e,f=m.useRef(null),g=Jt(t,f),x=Pv(o),[w=null,N]=rf({prop:i,defaultProp:l,onChange:c}),[p,v]=m.useState(!1),y=Qn(u),j=Mv(n),S=m.useRef(!1),[C,b]=m.useState(0);return m.useEffect(()=>{const P=f.current;if(P)return P.addEventListener(Ic,y),()=>P.removeEventListener(Ic,y)},[y]),a.jsx(MM,{scope:n,orientation:r,dir:x,loop:s,currentTabStopId:w,onItemFocus:m.useCallback(P=>N(P),[N]),onItemShiftTab:m.useCallback(()=>v(!0),[]),onFocusableItemAdd:m.useCallback(()=>b(P=>P+1),[]),onFocusableItemRemove:m.useCallback(()=>b(P=>P-1),[]),children:a.jsx(rt.div,{tabIndex:p||C===0?-1:0,"data-orientation":r,...d,ref:g,style:{outline:"none",...e.style},onMouseDown:Ve(e.onMouseDown,()=>{S.current=!0}),onFocus:Ve(e.onFocus,P=>{const I=!S.current;if(P.target===P.currentTarget&&I&&!p){const $=new CustomEvent(Ic,EM);if(P.currentTarget.dispatchEvent($),!$.defaultPrevented){const R=j().filter(k=>k.focusable),T=R.find(k=>k.active),D=R.find(k=>k.id===w),L=[T,D,...R].filter(Boolean).map(k=>k.ref.current);Av(L,h)}}S.current=!1}),onBlur:Ve(e.onBlur,()=>v(!1))})})}),Tv="RovingFocusGroupItem",Lv=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:o,...i}=e,l=ho(),c=o||l,u=IM(Tv,n),h=u.currentTabStopId===c,d=Mv(n),{onFocusableItemAdd:f,onFocusableItemRemove:g}=u;return m.useEffect(()=>{if(r)return f(),()=>g()},[r,f,g]),a.jsx(Gu.ItemSlot,{scope:n,id:c,focusable:r,active:s,children:a.jsx(rt.span,{tabIndex:h?0:-1,"data-orientation":u.orientation,...i,ref:t,onMouseDown:Ve(e.onMouseDown,x=>{r?u.onItemFocus(c):x.preventDefault()}),onFocus:Ve(e.onFocus,()=>u.onItemFocus(c)),onKeyDown:Ve(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){u.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const w=AM(x,u.orientation,u.dir);if(w!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let p=d().filter(v=>v.focusable).map(v=>v.ref.current);if(w==="last")p.reverse();else if(w==="prev"||w==="next"){w==="prev"&&p.reverse();const v=p.indexOf(x.currentTarget);p=u.loop?zM(p,v+1):p.slice(v+1)}setTimeout(()=>Av(p))}})})})});Lv.displayName=Tv;var TM={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function LM(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function AM(e,t,n){const r=LM(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return TM[r]}function Av(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function zM(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var DM=Rv,$M=Lv,_f="Tabs",[OM]=yl(_f,[Iv]),zv=Iv(),[FM,Pf]=OM(_f),Dv=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:o,orientation:i="horizontal",dir:l,activationMode:c="automatic",...u}=e,h=Pv(l),[d,f]=rf({prop:r,onChange:s,defaultProp:o});return a.jsx(FM,{scope:n,baseId:ho(),value:d,onValueChange:f,orientation:i,dir:h,activationMode:c,children:a.jsx(rt.div,{dir:h,"data-orientation":i,...u,ref:t})})});Dv.displayName=_f;var $v="TabsList",Ov=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,o=Pf($v,n),i=zv(n);return a.jsx(DM,{asChild:!0,...i,orientation:o.orientation,dir:o.dir,loop:r,children:a.jsx(rt.div,{role:"tablist","aria-orientation":o.orientation,...s,ref:t})})});Ov.displayName=$v;var Fv="TabsTrigger",Hv=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...o}=e,i=Pf(Fv,n),l=zv(n),c=Uv(i.baseId,r),u=Wv(i.baseId,r),h=r===i.value;return a.jsx($M,{asChild:!0,...l,focusable:!s,active:h,children:a.jsx(rt.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":u,"data-state":h?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:c,...o,ref:t,onMouseDown:Ve(e.onMouseDown,d=>{!s&&d.button===0&&d.ctrlKey===!1?i.onValueChange(r):d.preventDefault()}),onKeyDown:Ve(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&i.onValueChange(r)}),onFocus:Ve(e.onFocus,()=>{const d=i.activationMode!=="manual";!h&&!s&&d&&i.onValueChange(r)})})})});Hv.displayName=Fv;var Bv="TabsContent",Vv=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:o,...i}=e,l=Pf(Bv,n),c=Uv(l.baseId,r),u=Wv(l.baseId,r),h=r===l.value,d=m.useRef(h);return m.useEffect(()=>{const f=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(f)},[]),a.jsx(qo,{present:s||h,children:({present:f})=>a.jsx(rt.div,{"data-state":h?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!f,id:u,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:f&&o})})});Vv.displayName=Bv;function Uv(e,t){return`${e}-trigger-${t}`}function Wv(e,t){return`${e}-content-${t}`}var HM=Dv,Kv=Ov,Gv=Hv,Yv=Vv;const Mf=HM,Al=m.forwardRef(({className:e,...t},n)=>a.jsx(Kv,{ref:n,className:Te("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));Al.displayName=Kv.displayName;const Ze=m.forwardRef(({className:e,...t},n)=>a.jsx(Gv,{ref:n,className:Te("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...t}));Ze.displayName=Gv.displayName;const Je=m.forwardRef(({className:e,...t},n)=>a.jsx(Yv,{ref:n,className:Te("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Je.displayName=Yv.displayName;function BM({message:e,type:t,onClose:n}){return m.useEffect(()=>{const r=setTimeout(n,4e3);return()=>clearTimeout(r)},[n]),a.jsxs("div",{className:`fixed bottom-6 right-6 z-[100] flex items-center gap-2 rounded-lg border px-4 py-3 shadow-lg transition-all animate-in slide-in-from-bottom-4 ${t==="success"?"border-emerald-500/30 bg-emerald-50 text-emerald-800 dark:bg-emerald-950 dark:text-emerald-200":"border-destructive/30 bg-red-50 text-red-800 dark:bg-red-950 dark:text-red-200"}`,children:[t==="success"?a.jsx(Yn,{className:"h-4 w-4"}):a.jsx(pt,{className:"h-4 w-4"}),a.jsx("span",{className:"text-sm",children:e}),a.jsx("button",{onClick:n,className:"ml-2 text-current/50 hover:text-current",children:"×"})]})}function VM(){const[e,t]=m.useState([]),[n,r]=m.useState(""),[s,o]=m.useState(!0),[i,l]=m.useState("skills"),[c,u]=m.useState(null),h=m.useRef(null),d=m.useCallback((x,w="success")=>{u({message:x,type:w})},[]),f=m.useCallback(()=>{d("Command sent to host"),l("commands"),setTimeout(()=>{var x;return(x=h.current)==null?void 0:x.call(h)},300)},[d]),g=m.useCallback(x=>{const w=x instanceof Error?x.message:"Failed to send command";d(w,"error")},[d]);return m.useEffect(()=>{te.hosts.list().then(x=>{const w=(x.data??[]).filter(N=>N.status==="online");t(w),w.length>0&&!n&&r(w[0].id)}).catch(()=>{}).finally(()=>o(!1))},[]),s?a.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading hosts..."}):e.length===0?a.jsxs("div",{className:"space-y-6",children:[a.jsx("h1",{className:"text-lg font-semibold",children:"Operations"}),a.jsxs("div",{className:"flex h-60 flex-col items-center justify-center gap-3 rounded-lg border border-dashed border-border",children:[a.jsx(Pr,{className:"h-10 w-10 text-muted-foreground/30"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"No hosts connected"}),a.jsxs("p",{className:"text-xs text-muted-foreground/70",children:["Run ",a.jsx("code",{className:"rounded bg-muted px-1",children:"opentrust connect --dashboard-url ... --api-key ..."})," on a host"]})]})]}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h1",{className:"text-lg font-semibold",children:"Operations"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-xs text-muted-foreground",children:"Host:"}),a.jsx("select",{className:"h-8 rounded-md border border-input bg-background px-2 text-sm focus:outline-none focus:ring-1 focus:ring-ring",value:n,onChange:x=>r(x.target.value),children:e.map(x=>a.jsxs("option",{value:x.id,children:[x.hostname," (",x.ip||"local",")"]},x.id))})]})]}),n&&a.jsxs(Mf,{value:i,onValueChange:l,className:"w-full",children:[a.jsxs(Al,{children:[a.jsxs(Ze,{value:"skills",children:[a.jsx(Nr,{className:"mr-1.5 h-3.5 w-3.5"})," Skills"]}),a.jsxs(Ze,{value:"commands",children:[a.jsx(ps,{className:"mr-1.5 h-3.5 w-3.5"})," Commands"]}),a.jsxs(Ze,{value:"config",children:[a.jsx(Zt,{className:"mr-1.5 h-3.5 w-3.5"})," Config"]})]}),a.jsx(Je,{value:"skills",children:a.jsx(UM,{hostId:n,onCommandSent:f,onCommandError:g})}),a.jsx(Je,{value:"commands",children:a.jsx(WM,{hostId:n,refreshRef:h})}),a.jsx(Je,{value:"config",children:a.jsx(KM,{hostId:n,onCommandSent:f,onCommandError:g})})]}),c&&a.jsx(BM,{message:c.message,type:c.type,onClose:()=>u(null)})]})}function UM({hostId:e,onCommandSent:t,onCommandError:n}){const[r,s]=m.useState(!1),[o,i]=m.useState(null),[l,c]=m.useState([]);m.useEffect(()=>{te.hosts.agents(e).then(h=>c(h.data??[])).catch(()=>c([]))},[e]);const u=l.flatMap(h=>((h.metadata??{}).skills??[]).map(f=>({...f,agentName:h.name})));return a.jsxs("div",{className:"space-y-4 pt-4",children:[a.jsx("div",{className:"flex gap-2",children:a.jsxs(K,{size:"sm",onClick:()=>s(!0),children:[a.jsx(Ct,{className:"mr-1.5 h-3.5 w-3.5"})," Install Skill"]})}),u.length>0&&a.jsxs(fe,{children:[a.jsx(Ie,{children:a.jsxs(Re,{className:"flex items-center gap-2 text-sm",children:[a.jsx(Nr,{className:"h-4 w-4"})," Installed Skills (",u.length,")"]})}),a.jsx(we,{children:a.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:u.map((h,d)=>a.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-border p-3 transition-colors hover:bg-muted/30",children:[a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-md bg-muted",children:a.jsx(Nr,{className:"h-4 w-4 text-muted-foreground"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium",children:h.name}),h.description&&a.jsx("p",{className:"text-[11px] text-muted-foreground line-clamp-1",children:h.description}),l.length>1&&a.jsx("p",{className:"text-[10px] text-muted-foreground/60",children:h.agentName})]})]}),a.jsx(K,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive",onClick:()=>i(h.name),children:a.jsx(Ot,{className:"h-3.5 w-3.5"})})]},`${h.name}-${d}`))})})]}),l.length>0&&a.jsxs(fe,{children:[a.jsx(Ie,{children:a.jsxs(Re,{className:"flex items-center gap-2 text-sm",children:[a.jsx(Pr,{className:"h-4 w-4"})," Agents on this Host (",l.length,")"]})}),a.jsx(we,{children:a.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:l.map(h=>{const d=h.metadata??{};return a.jsxs("div",{className:"flex items-center gap-2.5 rounded-lg border border-border p-3",children:[a.jsx("span",{className:"text-lg",children:d.emoji||"🤖"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium",children:h.name}),a.jsxs("p",{className:"text-[11px] text-muted-foreground",children:[(d.skills??[]).length," skills · ",h.status]})]})]},h.id)})})})]}),a.jsxs(fe,{children:[a.jsx(Ie,{children:a.jsx(Re,{className:"text-sm",children:"How Skills Work"})}),a.jsxs(we,{className:"text-xs text-muted-foreground space-y-2",children:[a.jsxs("p",{children:["Skills are ",a.jsx("a",{href:"https://agentskills.io",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"AgentSkills"}),"-compatible folders containing a ",a.jsx("code",{className:"rounded bg-muted px-1",children:"SKILL.md"})," with YAML frontmatter and instructions."]}),a.jsxs("p",{children:["Browse and discover skills at ",a.jsx("a",{href:"https://clawhub.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"clawhub.com"}),". Commands are executed by the CLI on the selected host via ",a.jsx("code",{className:"rounded bg-muted px-1",children:"clawhub install <slug>"}),"."]})]})]}),a.jsx(GM,{open:r,onOpenChange:s,hostId:e,onSuccess:t,onError:n}),a.jsx(YM,{open:o!==null,onOpenChange:h=>{h||i(null)},hostId:e,initialName:o??"",onSuccess:t,onError:n})]})}function WM({hostId:e,refreshRef:t}){const[n,r]=m.useState([]),[s,o]=m.useState(!0),[i,l]=m.useState(null),c=m.useCallback(()=>{te.hosts.commands(e).then(f=>r(f.data??[])).catch(()=>{}).finally(()=>o(!1))},[e]);m.useEffect(()=>(t&&(t.current=c),()=>{t&&(t.current=null)}),[c,t]),m.useEffect(()=>{c()},[c]),m.useEffect(()=>{if(!n.some(x=>x.status==="pending"||x.status==="running"))return;const g=setInterval(c,5e3);return()=>clearInterval(g)},[n,c]);const u=f=>f==="completed"?a.jsx(Yn,{className:"h-3.5 w-3.5 text-emerald-500"}):f==="failed"?a.jsx(pt,{className:"h-3.5 w-3.5 text-destructive"}):f==="running"?a.jsx($e,{className:"h-3.5 w-3.5 animate-spin text-amber-500"}):a.jsx(Jd,{className:"h-3.5 w-3.5 text-muted-foreground"}),h=f=>f==="completed"?"success":f==="failed"?"destructive":f==="running"?"warning":"secondary",d=f=>({install_skill:{icon:a.jsx(Ct,{className:"h-3 w-3"}),label:"Install Skill"},install_custom_skill:{icon:a.jsx(Rs,{className:"h-3 w-3"}),label:"Custom Skill"},uninstall_skill:{icon:a.jsx(Ot,{className:"h-3 w-3"}),label:"Uninstall Skill"},install_plugin:{icon:a.jsx(Ct,{className:"h-3 w-3"}),label:"Install Plugin"},uninstall_plugin:{icon:a.jsx(Ot,{className:"h-3 w-3"}),label:"Uninstall Plugin"},update_config:{icon:a.jsx(Zt,{className:"h-3 w-3"}),label:"Update Config"}})[f]??{icon:a.jsx(ps,{className:"h-3 w-3"}),label:f};return s?a.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):a.jsxs("div",{className:"space-y-4 pt-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"Command history for this host"}),a.jsxs(K,{size:"sm",variant:"ghost",onClick:c,children:[a.jsx(Xn,{className:"mr-1.5 h-3.5 w-3.5"})," Refresh"]})]}),n.length===0?a.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-3 rounded-lg border border-dashed border-border",children:[a.jsx(ps,{className:"h-8 w-8 text-muted-foreground/30"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"No commands sent yet"})]}):a.jsx("div",{className:"space-y-2",children:n.map(f=>{var N,p,v;const g=d(f.type),x=i===f.id,w=f.result||f.type==="install_custom_skill"&&((N=f.payload)==null?void 0:N.content);return a.jsxs("div",{className:"rounded-lg border border-border transition-colors hover:bg-muted/20",children:[a.jsxs("div",{className:"flex cursor-pointer items-center gap-3 px-4 py-3",onClick:()=>w&&l(x?null:f.id),children:[u(f.status),a.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium",children:[g.icon," ",a.jsx("span",{children:g.label})]}),a.jsxs("span",{className:"text-xs text-muted-foreground",children:[((p=f.payload)==null?void 0:p.skillName)&&`"${f.payload.skillName}"`,f.type==="update_config"&&f.payload&&!f.payload.skillName&&Object.keys(f.payload).join(", ")]}),a.jsx("div",{className:"flex-1"}),a.jsx(he,{variant:h(f.status),className:"text-[10px]",children:f.status}),a.jsx("span",{className:"text-[11px] text-muted-foreground",children:QM(f.createdAt)}),w&&(x?a.jsx(pl,{className:"h-3.5 w-3.5 text-muted-foreground"}):a.jsx(Zd,{className:"h-3.5 w-3.5 text-muted-foreground"}))]}),x&&w&&a.jsxs("div",{className:"border-t border-border bg-muted/30 px-4 py-3 text-xs",children:[f.result&&a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"font-medium text-muted-foreground",children:"Result"}),a.jsx("pre",{className:"max-h-40 overflow-auto whitespace-pre-wrap rounded-md bg-background p-2.5 font-mono text-[11px] text-muted-foreground",children:typeof f.result=="string"?f.result:JSON.stringify(f.result,null,2)})]}),f.type==="install_custom_skill"&&((v=f.payload)==null?void 0:v.content)&&a.jsxs("div",{className:"mt-2 space-y-1",children:[a.jsx("p",{className:"font-medium text-muted-foreground",children:"Skill Content"}),a.jsx("pre",{className:"max-h-40 overflow-auto whitespace-pre-wrap rounded-md bg-background p-2.5 font-mono text-[11px] text-muted-foreground",children:f.payload.content})]})]})]},f.id)})})]})}function KM({hostId:e,onCommandSent:t,onCommandError:n}){const[r,s]=m.useState(!1);return a.jsxs("div",{className:"space-y-4 pt-4",children:[a.jsxs(fe,{children:[a.jsx(Ie,{children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs(Re,{className:"flex items-center gap-2 text-sm",children:[a.jsx(Zt,{className:"h-4 w-4"})," Guards Configuration"]}),a.jsxs(K,{size:"sm",variant:"outline",onClick:()=>s(!0),children:[a.jsx(Zt,{className:"mr-1.5 h-3.5 w-3.5"})," Update Config"]})]})}),a.jsxs(we,{className:"text-xs text-muted-foreground space-y-3",children:[a.jsxs("p",{children:["Send configuration updates to the Guards plugin on the host. The CLI updates ",a.jsx("code",{className:"rounded bg-muted px-1",children:"~/.openclaw/openclaw.json"})," on the target machine."]}),a.jsxs("div",{className:"rounded-md bg-muted p-3 space-y-1.5",children:[a.jsx("p",{className:"font-medium text-foreground text-xs",children:"Available settings:"}),a.jsxs("div",{className:"grid gap-1",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("code",{className:"rounded bg-background px-1.5 py-0.5 text-[11px]",children:"blockOnRisk"}),a.jsx("span",{children:"Block tool calls when risk is detected"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("code",{className:"rounded bg-background px-1.5 py-0.5 text-[11px]",children:"logLevel"}),a.jsx("span",{children:"Logging verbosity (debug, info, warn, error)"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("code",{className:"rounded bg-background px-1.5 py-0.5 text-[11px]",children:"timeoutMs"}),a.jsx("span",{children:"Request timeout in milliseconds"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("code",{className:"rounded bg-background px-1.5 py-0.5 text-[11px]",children:"enabled"}),a.jsx("span",{children:"Enable/disable the Guards plugin"})]})]})]})]})]}),a.jsx(XM,{open:r,onOpenChange:s,hostId:e,onSuccess:t,onError:n})]})}function GM({open:e,onOpenChange:t,hostId:n,onSuccess:r,onError:s}){const[o,i]=m.useState("registry"),[l,c]=m.useState(""),[u,h]=m.useState(""),[d,f]=m.useState(!1),[g,x]=m.useState(""),w=()=>{c(""),h(""),i("registry"),x("")},N=async()=>{if(!(o==="registry"&&!l.trim())&&!(o==="custom"&&(!l.trim()||!u.trim()))){f(!0),x("");try{o==="registry"?await te.hosts.sendCommand(n,"install_skill",{skillName:l.trim()}):await te.hosts.sendCommand(n,"install_custom_skill",{skillName:l.trim(),content:u}),w(),t(!1),r==null||r()}catch(p){const v=p instanceof Error?p.message:"Failed to send command";x(v),s==null||s(p)}finally{f(!1)}}};return a.jsx(Mr,{open:e,onOpenChange:p=>{p||w(),t(p)},children:a.jsxs(er,{className:"sm:max-w-[560px]",children:[a.jsxs(Ir,{children:[a.jsxs(tr,{className:"flex items-center gap-2",children:[a.jsx(Ct,{className:"h-4 w-4"})," Install Skill"]}),a.jsxs(nr,{children:["Install from ",a.jsx("a",{href:"https://clawhub.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"ClawHub"})," registry or provide custom SKILL.md content."]})]}),a.jsxs(Mf,{value:o,onValueChange:p=>{i(p),x("")},children:[a.jsxs(Al,{className:"w-full",children:[a.jsxs(Ze,{value:"registry",className:"flex-1",children:[a.jsx(Nr,{className:"mr-1.5 h-3.5 w-3.5"})," ClawHub Registry"]}),a.jsxs(Ze,{value:"custom",className:"flex-1",children:[a.jsx(Rs,{className:"mr-1.5 h-3.5 w-3.5"})," Custom SKILL.md"]})]}),a.jsx(Je,{value:"registry",className:"space-y-4 pt-2",children:a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"reg-skill-name",children:"Skill Slug"}),a.jsx(me,{id:"reg-skill-name",placeholder:"e.g. web-search, code-review, self-improving-agent...",value:l,onChange:p=>{c(p.target.value),x("")},onKeyDown:p=>p.key==="Enter"&&N()}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Executes ",a.jsx("code",{className:"rounded bg-muted px-1",children:"clawhub install <slug>"})," on the host via CLI. Browse available skills at ",a.jsx("a",{href:"https://clawhub.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"clawhub.com"}),"."]})]})}),a.jsxs(Je,{value:"custom",className:"space-y-4 pt-2",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"custom-skill-name",children:"Skill Name"}),a.jsx(me,{id:"custom-skill-name",placeholder:"my-custom-skill",value:l,onChange:p=>{c(p.target.value),x("")}})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"custom-skill-content",children:"SKILL.md Content"}),a.jsx(Ef,{id:"custom-skill-content",placeholder:`---
|
|
398
|
-
name: my-custom-skill
|
|
399
|
-
description: My custom skill
|
|
400
|
-
---
|
|
401
|
-
|
|
402
|
-
Instructions for the agent...
|
|
403
|
-
|
|
404
|
-
Use {baseDir} to reference the skill folder path.`,value:u,onChange:p=>{h(p.target.value),x("")},className:"min-h-[200px] font-mono text-xs"}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["The content will be saved as ",a.jsx("code",{className:"rounded bg-muted px-1",children:"~/.openclaw/workspace/skills/<name>/SKILL.md"}),". Use YAML frontmatter with ",a.jsx("code",{className:"rounded bg-muted px-1",children:"name"})," and ",a.jsx("code",{className:"rounded bg-muted px-1",children:"description"})," fields."]})]})]})]}),g&&a.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:[a.jsx(pt,{className:"h-3.5 w-3.5 shrink-0"}),a.jsx("span",{children:g})]}),a.jsxs(Rr,{children:[a.jsx(K,{variant:"outline",onClick:()=>{w(),t(!1)},children:"Cancel"}),a.jsxs(K,{onClick:N,disabled:d||!l.trim()||o==="custom"&&!u.trim(),children:[d?a.jsx($e,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):a.jsx(Ct,{className:"mr-1.5 h-3.5 w-3.5"}),"Install"]})]})]})})}function YM({open:e,onOpenChange:t,hostId:n,initialName:r,onSuccess:s,onError:o}){const[i,l]=m.useState(r??""),[c,u]=m.useState(!1),[h,d]=m.useState("");m.useEffect(()=>{r&&l(r)},[r]);const f=async()=>{if(i.trim()){u(!0),d("");try{await te.hosts.sendCommand(n,"uninstall_skill",{skillName:i.trim()}),l(""),t(!1),s==null||s()}catch(g){const x=g instanceof Error?g.message:"Failed to send command";d(x),o==null||o(g)}finally{u(!1)}}};return a.jsx(Mr,{open:e,onOpenChange:t,children:a.jsxs(er,{className:"sm:max-w-[400px]",children:[a.jsxs(Ir,{children:[a.jsxs(tr,{className:"flex items-center gap-2",children:[a.jsx(Ot,{className:"h-4 w-4"})," Uninstall Skill"]}),a.jsx(nr,{children:"This will send a command to the host CLI to remove the skill."})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"uninstall-name",children:"Skill Name"}),a.jsx(me,{id:"uninstall-name",placeholder:"Skill name to uninstall...",value:i,onChange:g=>{l(g.target.value),d("")},onKeyDown:g=>g.key==="Enter"&&f()})]}),h&&a.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:[a.jsx(pt,{className:"h-3.5 w-3.5 shrink-0"}),a.jsx("span",{children:h})]}),a.jsxs(Rr,{children:[a.jsx(K,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),a.jsxs(K,{variant:"destructive",onClick:f,disabled:c||!i.trim(),children:[c?a.jsx($e,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):a.jsx(Ot,{className:"mr-1.5 h-3.5 w-3.5"}),"Uninstall"]})]})]})})}function XM({open:e,onOpenChange:t,hostId:n,onSuccess:r,onError:s}){const[o,i]=m.useState(`{
|
|
405
|
-
"blockOnRisk": false
|
|
406
|
-
}`),[l,c]=m.useState(""),[u,h]=m.useState(!1),d=async()=>{c("");let f;try{f=JSON.parse(o)}catch{c("Invalid JSON");return}if(typeof f!="object"||f===null||Array.isArray(f)){c("Must be a JSON object");return}h(!0);try{await te.hosts.sendCommand(n,"update_config",f),t(!1),r==null||r()}catch(g){const x=g instanceof Error?g.message:"Failed to send command";c(x),s==null||s(g)}finally{h(!1)}};return a.jsx(Mr,{open:e,onOpenChange:t,children:a.jsxs(er,{className:"sm:max-w-[460px]",children:[a.jsxs(Ir,{children:[a.jsxs(tr,{className:"flex items-center gap-2",children:[a.jsx(Zt,{className:"h-4 w-4"})," Update Guards Config"]}),a.jsx(nr,{children:"Values will be merged into the existing Guards plugin configuration."})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"config-json",children:"Config JSON"}),a.jsx(Ef,{id:"config-json",value:o,onChange:f=>{i(f.target.value),c("")},className:"min-h-[120px] font-mono text-xs"}),l&&a.jsx("p",{className:"text-xs text-destructive",children:l})]}),a.jsxs(Rr,{children:[a.jsx(K,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),a.jsxs(K,{onClick:d,disabled:u,children:[u?a.jsx($e,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):a.jsx(Zt,{className:"mr-1.5 h-3.5 w-3.5"}),"Update"]})]})]})})}function QM(e){const t=Date.now()-new Date(e).getTime(),n=Math.floor(t/1e3);if(n<60)return"just now";const r=Math.floor(n/60);if(r<60)return`${r}m ago`;const s=Math.floor(r/60);return s<24?`${s}h ago`:`${Math.floor(s/24)}d ago`}function qM(){const[e,t]=m.useState([]),[n,r]=m.useState(""),[s,o]=m.useState(null),[i,l]=m.useState(!0),[c,u]=m.useState(null),h=m.useCallback((g,x="success")=>{u({msg:g,type:x}),setTimeout(()=>u(null),4e3)},[]);if(m.useEffect(()=>{te.discovery.agents().then(g=>{const x=g.data??[];t(x),x.length>0&&!n&&r(x[0].registeredAgentId||x[0].id)}).catch(()=>{}).finally(()=>l(!1))},[]),m.useEffect(()=>{if(!n){o(null);return}const g=e.find(x=>(x.registeredAgentId||x.id)===n);o(g??null)},[n,e]),i)return a.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading agents..."});if(e.length===0)return a.jsxs("div",{className:"space-y-6",children:[a.jsx("h1",{className:"text-lg font-semibold",children:"Plugins"}),a.jsxs("div",{className:"flex h-60 flex-col items-center justify-center gap-3 rounded-lg border border-dashed border-border",children:[a.jsx(Pr,{className:"h-10 w-10 text-muted-foreground/30"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"No agents discovered"}),a.jsx("p",{className:"text-xs text-muted-foreground/70",children:"Start an OpenClaw agent with the Guards plugin to see it here"})]})]});const d=s==null?void 0:s.hostId,f=(s==null?void 0:s.plugins)??[];return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-lg font-semibold",children:"Plugins"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage OpenClaw plugins per agent"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-xs text-muted-foreground",children:"Agent:"}),a.jsx("select",{className:"h-8 rounded-md border border-input bg-background px-2 text-sm focus:outline-none focus:ring-1 focus:ring-ring",value:n,onChange:g=>r(g.target.value),children:e.map(g=>a.jsx("option",{value:g.registeredAgentId||g.id,children:g.name},g.registeredAgentId||g.id))})]})]}),s&&a.jsxs(a.Fragment,{children:[a.jsx(ZM,{plugins:f}),d?a.jsxs(a.Fragment,{children:[a.jsx(JM,{hostId:d,showToast:h}),a.jsx(eI,{hostId:d})]}):a.jsx(fe,{className:"border-dashed",children:a.jsxs(we,{className:"flex flex-col items-center gap-2 py-6",children:[a.jsx(Jd,{className:"h-6 w-6 text-muted-foreground/40"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"This agent is not associated with a host. Plugin install/uninstall commands require a connected host."}),a.jsxs("p",{className:"text-xs text-muted-foreground/70",children:["Run ",a.jsx("code",{className:"rounded bg-muted px-1",children:"opentrust connect"})," on the agent's machine to link it."]})]})}),a.jsx(tI,{})]}),c&&a.jsxs("div",{className:`fixed bottom-6 right-6 z-[100] flex items-center gap-2 rounded-lg border px-4 py-3 shadow-lg animate-in slide-in-from-bottom-4 ${c.type==="success"?"border-emerald-500/30 bg-emerald-50 text-emerald-800 dark:bg-emerald-950 dark:text-emerald-200":"border-destructive/30 bg-red-50 text-red-800 dark:bg-red-950 dark:text-red-200"}`,children:[c.type==="success"?a.jsx(Yn,{className:"h-4 w-4"}):a.jsx(pt,{className:"h-4 w-4"}),a.jsx("span",{className:"text-sm",children:c.msg}),a.jsx("button",{onClick:()=>u(null),className:"ml-2 text-current/50 hover:text-current",children:"×"})]})]})}function ZM({plugins:e}){return e.length===0?a.jsx(fe,{className:"border-dashed",children:a.jsxs(we,{className:"flex flex-col items-center gap-2 py-6",children:[a.jsx(ea,{className:"h-8 w-8 text-muted-foreground/30"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"No plugins reported by this agent"})]})}):a.jsxs(fe,{children:[a.jsx(Ie,{children:a.jsxs(Re,{className:"flex items-center gap-2 text-sm",children:[a.jsx(ea,{className:"h-4 w-4"})," Installed Plugins (",e.length,")"]})}),a.jsx(we,{className:"space-y-2",children:e.map(t=>a.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-border px-4 py-2.5",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ea,{className:"h-3.5 w-3.5 text-muted-foreground"}),a.jsx("span",{className:"text-sm font-medium",children:t.name||t.id}),t.version&&a.jsxs("span",{className:"text-xs text-muted-foreground",children:["v",t.version]})]}),a.jsx(he,{variant:t.enabled!==!1?"default":"secondary",className:"text-[10px]",children:t.enabled!==!1?"enabled":"disabled"})]},t.name||t.id))})]})}function JM({hostId:e,showToast:t}){const[n,r]=m.useState(!1),[s,o]=m.useState(!1);return a.jsxs("div",{className:"flex gap-2",children:[a.jsxs(K,{size:"sm",onClick:()=>r(!0),children:[a.jsx(Ct,{className:"mr-1.5 h-3.5 w-3.5"})," Install Plugin"]}),a.jsxs(K,{size:"sm",variant:"outline",onClick:()=>o(!0),children:[a.jsx(Ot,{className:"mr-1.5 h-3.5 w-3.5"})," Uninstall Plugin"]}),a.jsx(nI,{open:n,onOpenChange:r,hostId:e,showToast:t}),a.jsx(rI,{open:s,onOpenChange:o,hostId:e,showToast:t})]})}function eI({hostId:e}){const[t,n]=m.useState([]),[r,s]=m.useState(!0),[o,i]=m.useState(null),l=m.useCallback(()=>{te.hosts.commands(e).then(u=>{const h=(u.data??[]).filter(d=>d.type==="install_plugin"||d.type==="uninstall_plugin");n(h)}).catch(()=>{}).finally(()=>s(!1))},[e]);m.useEffect(()=>{l()},[l]),m.useEffect(()=>{if(!t.some(d=>d.status==="pending"||d.status==="running"))return;const h=setInterval(l,5e3);return()=>clearInterval(h)},[t,l]);const c=u=>u==="completed"?a.jsx(Yn,{className:"h-3.5 w-3.5 text-emerald-500"}):u==="failed"?a.jsx(pt,{className:"h-3.5 w-3.5 text-destructive"}):u==="running"?a.jsx($e,{className:"h-3.5 w-3.5 animate-spin text-amber-500"}):a.jsx(Jd,{className:"h-3.5 w-3.5 text-muted-foreground"});return r||t.length===0?null:a.jsxs(fe,{children:[a.jsx(Ie,{children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs(Re,{className:"flex items-center gap-2 text-sm",children:[a.jsx(ps,{className:"h-4 w-4"})," Plugin Command History"]}),a.jsxs(K,{size:"sm",variant:"ghost",onClick:l,children:[a.jsx(Xn,{className:"mr-1.5 h-3.5 w-3.5"})," Refresh"]})]})}),a.jsx(we,{className:"space-y-2",children:t.map(u=>{var g,x;const h=o===u.id,d=u.type==="install_plugin"?"Install Plugin":"Uninstall Plugin",f=((g=u.payload)==null?void 0:g.spec)||((x=u.payload)==null?void 0:x.pluginId)||"";return a.jsxs("div",{className:"rounded-lg border border-border transition-colors hover:bg-muted/20",children:[a.jsxs("div",{className:"flex cursor-pointer items-center gap-3 px-4 py-3",onClick:()=>u.result&&i(h?null:u.id),children:[c(u.status),a.jsx("span",{className:"text-xs font-medium",children:d}),f&&a.jsxs("span",{className:"text-xs text-muted-foreground",children:['"',f,'"']}),a.jsx("div",{className:"flex-1"}),a.jsx(he,{variant:u.status==="completed"?"default":u.status==="failed"?"destructive":"secondary",className:"text-[10px]",children:u.status}),a.jsx("span",{className:"text-[11px] text-muted-foreground",children:sI(u.createdAt)}),u.result&&(h?a.jsx(pl,{className:"h-3.5 w-3.5 text-muted-foreground"}):a.jsx(Zd,{className:"h-3.5 w-3.5 text-muted-foreground"}))]}),h&&u.result&&a.jsx("div",{className:"border-t border-border bg-muted/30 px-4 py-3",children:a.jsx("pre",{className:"max-h-40 overflow-auto whitespace-pre-wrap rounded-md bg-background p-2.5 font-mono text-[11px] text-muted-foreground",children:typeof u.result=="string"?u.result:JSON.stringify(u.result,null,2)})})]},u.id)})})]})}function tI(){return a.jsxs(fe,{children:[a.jsx(Ie,{children:a.jsx(Re,{className:"text-sm",children:"How Plugins Work"})}),a.jsxs(we,{className:"text-xs text-muted-foreground space-y-2",children:[a.jsx("p",{children:"OpenClaw plugins extend agent capabilities. They can be installed from npm or local paths."}),a.jsx("p",{children:"Common plugin specs:"}),a.jsxs("ul",{className:"list-inside list-disc space-y-0.5 pl-2",children:[a.jsxs("li",{children:[a.jsx("code",{className:"rounded bg-muted px-1",children:"@openclaw/voice-call"})," — Voice calling plugin"]}),a.jsxs("li",{children:[a.jsx("code",{className:"rounded bg-muted px-1",children:"@opentrust/guards"})," — Security guard plugin"]}),a.jsxs("li",{children:[a.jsx("code",{className:"rounded bg-muted px-1",children:"/path/to/plugin"})," — Local plugin path"]})]}),a.jsxs("p",{children:["Commands are sent to the agent's host CLI which executes ",a.jsx("code",{className:"rounded bg-muted px-1",children:"openclaw plugins install/uninstall"}),"."]})]})]})}function nI({open:e,onOpenChange:t,hostId:n,showToast:r}){const[s,o]=m.useState(""),[i,l]=m.useState(!1),[c,u]=m.useState(""),h=()=>{o(""),u("")},d=async()=>{if(s.trim()){l(!0),u("");try{await te.hosts.sendCommand(n,"install_plugin",{spec:s.trim()}),h(),t(!1),r("Plugin install command sent","success")}catch(f){const g=f instanceof Error?f.message:"Failed to send command";u(g)}finally{l(!1)}}};return a.jsx(Mr,{open:e,onOpenChange:f=>{f||h(),t(f)},children:a.jsxs(er,{className:"sm:max-w-[480px]",children:[a.jsxs(Ir,{children:[a.jsxs(tr,{className:"flex items-center gap-2",children:[a.jsx(Ct,{className:"h-4 w-4"})," Install Plugin"]}),a.jsx(nr,{children:"Install an OpenClaw plugin via npm package name or local path."})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"plugin-spec",children:"Plugin Spec"}),a.jsx(me,{id:"plugin-spec",placeholder:"e.g. @openclaw/voice-call, @opentrust/guards, /path/to/plugin",value:s,onChange:f=>{o(f.target.value),u("")},onKeyDown:f=>f.key==="Enter"&&d()}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Executes ",a.jsx("code",{className:"rounded bg-muted px-1",children:"openclaw plugins install <spec>"})," on the agent's host via CLI."]})]}),c&&a.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:[a.jsx(pt,{className:"h-3.5 w-3.5 shrink-0"}),a.jsx("span",{children:c})]}),a.jsxs(Rr,{children:[a.jsx(K,{variant:"outline",onClick:()=>{h(),t(!1)},children:"Cancel"}),a.jsxs(K,{onClick:d,disabled:i||!s.trim(),children:[i?a.jsx($e,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):a.jsx(Ct,{className:"mr-1.5 h-3.5 w-3.5"}),"Install"]})]})]})})}function rI({open:e,onOpenChange:t,hostId:n,showToast:r,initialId:s}){const[o,i]=m.useState(s??""),[l,c]=m.useState(!1),[u,h]=m.useState("");m.useEffect(()=>{s&&i(s)},[s]);const d=async()=>{if(o.trim()){c(!0),h("");try{await te.hosts.sendCommand(n,"uninstall_plugin",{pluginId:o.trim()}),i(""),t(!1),r("Plugin uninstall command sent","success")}catch(f){const g=f instanceof Error?f.message:"Failed to send command";h(g)}finally{c(!1)}}};return a.jsx(Mr,{open:e,onOpenChange:t,children:a.jsxs(er,{className:"sm:max-w-[400px]",children:[a.jsxs(Ir,{children:[a.jsxs(tr,{className:"flex items-center gap-2",children:[a.jsx(Ot,{className:"h-4 w-4"})," Uninstall Plugin"]}),a.jsx(nr,{children:"Remove an OpenClaw plugin from the agent's host."})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"plugin-id",children:"Plugin ID"}),a.jsx(me,{id:"plugin-id",placeholder:"e.g. voice-call, opentrust-guard",value:o,onChange:f=>{i(f.target.value),h("")},onKeyDown:f=>f.key==="Enter"&&d()}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Executes ",a.jsx("code",{className:"rounded bg-muted px-1",children:"openclaw plugins uninstall <id> --force"})," on the host via CLI."]})]}),u&&a.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:[a.jsx(pt,{className:"h-3.5 w-3.5 shrink-0"}),a.jsx("span",{children:u})]}),a.jsxs(Rr,{children:[a.jsx(K,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),a.jsxs(K,{variant:"destructive",onClick:d,disabled:l||!o.trim(),children:[l?a.jsx($e,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):a.jsx(Ot,{className:"mr-1.5 h-3.5 w-3.5"}),"Uninstall"]})]})]})})}function sI(e){const t=Date.now()-new Date(e).getTime(),n=Math.floor(t/1e3);if(n<60)return"just now";const r=Math.floor(n/60);if(r<60)return`${r}m ago`;const s=Math.floor(r/60);return s<24?`${s}h ago`:`${Math.floor(s/24)}d ago`}function oI(e){if(e===0)return"0 B";const t=1024,n=["B","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return`${(e/Math.pow(t,r)).toFixed(1)} ${n[r]}`}function iI(){const[e,t]=m.useState([]),[n,r]=m.useState(!0),[s,o]=m.useState("dashboard"),i=m.useCallback(()=>{te.system.services().then(l=>t(l.data??[])).catch(()=>{}).finally(()=>r(!1))},[]);return m.useEffect(()=>{i()},[i]),m.useEffect(()=>{const l=setInterval(i,1e4);return()=>clearInterval(l)},[i]),n?a.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h1",{className:"text-lg font-semibold",children:"System"}),a.jsxs(K,{size:"sm",variant:"ghost",onClick:i,children:[a.jsx(Xn,{className:"mr-1.5 h-3.5 w-3.5"})," Refresh"]})]}),a.jsx("div",{className:"grid gap-3 sm:grid-cols-3",children:e.map(l=>a.jsx(fe,{className:`cursor-pointer transition-all ${s===l.key?"ring-2 ring-primary shadow-sm":"hover:bg-muted/30"}`,onClick:()=>o(l.key),children:a.jsxs(we,{className:"flex items-center gap-3 p-4",children:[a.jsx("div",{className:`flex h-10 w-10 items-center justify-center rounded-lg ${l.healthy?"bg-emerald-100 dark:bg-emerald-950":l.running?"bg-amber-100 dark:bg-amber-950":"bg-muted"}`,children:a.jsx(tf,{className:`h-5 w-5 ${l.healthy?"text-emerald-600 dark:text-emerald-400":l.running?"text-amber-600 dark:text-amber-400":"text-muted-foreground"}`})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("p",{className:"text-sm font-medium",children:l.name}),a.jsx(VS,{className:`h-2 w-2 fill-current ${l.healthy?"text-emerald-500":l.running?"text-amber-500":"text-muted-foreground/40"}`})]}),a.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-muted-foreground",children:[a.jsxs("span",{children:[":",l.port]}),l.pid&&a.jsxs("span",{children:["PID ",l.pid]}),l.logSize>0&&a.jsx("span",{children:oI(l.logSize)})]})]}),a.jsx(he,{variant:l.healthy?"default":l.running?"secondary":"outline",className:`text-[10px] ${l.healthy?"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-500/20":""}`,children:l.healthy?"Healthy":l.running?"Running":"Stopped"})]})},l.key))}),s&&a.jsx(aI,{service:s})]})}function aI({service:e}){const[t,n]=m.useState([]),[r,s]=m.useState(0),[o,i]=m.useState(""),[l,c]=m.useState(!0),[u,h]=m.useState(!0),[d,f]=m.useState(!0),[g,x]=m.useState(200),w=m.useRef(null),N=m.useRef(null),p=m.useCallback(S=>{const C=S??g;te.system.logs(e,C).then(b=>{n(b.data.lines),s(b.data.total),i(b.data.lastModified)}).catch(()=>{}).finally(()=>c(!1))},[e,g]);m.useEffect(()=>{c(!0),n([]),p()},[e]),m.useEffect(()=>{p()},[g]),m.useEffect(()=>{u&&w.current&&(w.current.scrollTop=w.current.scrollHeight)},[t,u]),m.useEffect(()=>(d?N.current=setInterval(()=>p(),3e3):N.current&&(clearInterval(N.current),N.current=null),()=>{N.current&&clearInterval(N.current)}),[d,p]);const v=async()=>{try{await te.system.clearLog(e),n([]),s(0)}catch{}},y=()=>{x(S=>Math.min(S+500,2e3))},j=e.charAt(0).toUpperCase()+e.slice(1);return a.jsxs(fe,{children:[a.jsx(Ie,{className:"pb-3",children:a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[a.jsxs(Re,{className:"flex items-center gap-2 text-sm",children:[a.jsx(Rs,{className:"h-4 w-4"})," ",j," Logs",a.jsxs(he,{variant:"outline",className:"text-[10px] font-normal",children:[r.toLocaleString()," lines"]}),o&&a.jsxs("span",{className:"text-[11px] font-normal text-muted-foreground",children:["Updated ",new Date(o).toLocaleTimeString()]})]}),a.jsxs("div",{className:"flex items-center gap-1.5",children:[r>g&&a.jsx(K,{size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:y,children:"Load more"}),a.jsxs(K,{size:"sm",variant:d?"default":"outline",className:"h-7 text-xs",onClick:()=>{f(!d),h(!d)},children:[d?a.jsx(nb,{className:"mr-1 h-3 w-3"}):a.jsx(Ta,{className:"mr-1 h-3 w-3"}),d?"Pause":"Tail"]}),a.jsxs(K,{size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:()=>{var S;h(!0),(S=w.current)==null||S.scrollTo({top:w.current.scrollHeight,behavior:"smooth"})},children:[a.jsx(OS,{className:"mr-1 h-3 w-3"})," Bottom"]}),a.jsxs(K,{size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:()=>p(),children:[a.jsx(Xn,{className:"mr-1 h-3 w-3"})," Refresh"]}),a.jsxs(K,{size:"sm",variant:"ghost",className:"h-7 text-xs text-destructive hover:text-destructive",onClick:v,children:[a.jsx(Ot,{className:"mr-1 h-3 w-3"})," Clear"]})]})]})}),a.jsx(we,{className:"p-0",children:l?a.jsx("div",{className:"flex h-60 items-center justify-center",children:a.jsx($e,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):t.length===0?a.jsxs("div",{className:"flex h-60 flex-col items-center justify-center gap-2",children:[a.jsx($S,{className:"h-8 w-8 text-muted-foreground/20"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"No log output"})]}):a.jsx("div",{ref:w,className:"h-[calc(100vh-420px)] min-h-[300px] overflow-auto border-t border-border bg-zinc-950 dark:bg-zinc-950",onScroll:()=>{if(!w.current)return;const{scrollTop:S,scrollHeight:C,clientHeight:b}=w.current,P=C-S-b<40;h(P)},children:a.jsx("pre",{className:"p-4 text-xs leading-5 font-mono text-zinc-300",children:t.map((S,C)=>a.jsx(lI,{line:S,lineNum:r-t.length+C+1},C))})})})]})}function lI({line:e,lineNum:t}){const n=cI(e);return a.jsxs("div",{className:"group flex hover:bg-white/5",children:[a.jsx("span",{className:"mr-3 inline-block w-10 select-none text-right text-zinc-600 group-hover:text-zinc-500",children:t}),a.jsx("span",{className:n,children:e}),`
|
|
407
|
-
`]})}function cI(e){const t=e.toLowerCase();return t.includes("error")||t.includes("err ")||t.includes("fatal")?"text-red-400":t.includes("warn")||t.includes("warning")?"text-amber-400":t.includes("debug")||t.includes("dbg ")?"text-zinc-500":/\b(get|post|put|delete|patch)\b/i.test(e)?"text-sky-400":t.includes("info")||t.includes("listening")||t.includes("started")||t.includes("running")?"text-emerald-400":"text-zinc-300"}const uI=[{key:"og_core_url",label:"Core API URL",icon:tf,placeholder:"http://localhost:53666",description:"OpenTrust Core service endpoint"},{key:"gateway_url",label:"Gateway URL",icon:Jx,placeholder:"http://localhost:8900",description:"AI Gateway proxy endpoint"},{key:"dashboard_mode",label:"Dashboard Mode",icon:ty,placeholder:"selfhosted",description:"Deployment mode: selfhosted or embedded"},{key:"database_url",label:"Database URL",icon:KS,placeholder:"file:./data/dashboard.db",description:"Database connection string",sensitive:!0}];function dI(){const[e,t]=m.useState({}),[n,r]=m.useState({}),[s,o]=m.useState(!0),[i,l]=m.useState(!1),[c,u]=m.useState(null),[h,d]=m.useState(null),[f,g]=m.useState(!1),[x,w]=m.useState(""),[N,p]=m.useState(""),[v,y]=m.useState(!1),[j,S]=m.useState(!1),C=m.useCallback(()=>{te.settings.getApiKey(!1).then(D=>{w(D.data.key),p(""),y(!1)}).catch(()=>{})},[]),b=()=>{o(!0),te.settings.get().then(D=>{const E=D.data??{};t(E),r(E)}).catch(()=>{}).finally(()=>o(!1))};m.useEffect(()=>{b(),C()},[C]);const P=()=>Object.keys(e).some(D=>e[D]!==n[D]),I=async()=>{l(!0);try{const D={};for(const[E,L]of Object.entries(e))L!==n[E]&&(D[E]=L);Object.keys(D).length>0&&(await te.settings.update(D),r({...e}),R("Settings saved","success"))}catch(D){R(D instanceof Error?D.message:"Failed to save","error")}finally{l(!1)}},$=async()=>{g(!0),d(null);try{const E=await(await fetch("/api/settings/test-connection",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${JSON.parse(localStorage.getItem("opentrust_user")||"{}").apiKey||""}`}})).json();E.success&&d(E.data)}catch{d({connected:!1,message:"Request failed"})}finally{g(!1)}},R=(D,E)=>{u({msg:D,type:E}),setTimeout(()=>u(null),3e3)},T=(D,E)=>{t(L=>({...L,[D]:E}))};return s?a.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading settings..."}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-lg font-semibold",children:"Settings"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Configure OpenTrust system settings"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(K,{size:"sm",variant:"ghost",onClick:b,children:[a.jsx(Xn,{className:"mr-1.5 h-3.5 w-3.5"})," Reload"]}),a.jsxs(K,{size:"sm",onClick:I,disabled:i||!P(),children:[i?a.jsx($e,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):a.jsx(ef,{className:"mr-1.5 h-3.5 w-3.5"}),"Save Changes"]})]})]}),a.jsxs(fe,{children:[a.jsxs(Ie,{children:[a.jsxs(Re,{className:"flex items-center gap-2 text-sm",children:[a.jsx(qS,{className:"h-4 w-4"})," System API Key"]}),a.jsx(wl,{className:"text-xs",children:"Unified key for CLI, Guards, Gateway, and Dashboard inter-component authentication"})]}),a.jsxs(we,{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(me,{readOnly:!0,value:v?N:x,className:"font-mono text-sm",placeholder:"Loading..."}),a.jsx(K,{size:"icon",variant:"outline",title:v?"Hide":"Reveal",onClick:async()=>{if(v)y(!1);else try{const D=await te.settings.getApiKey(!0);p(D.data.key),y(!0)}catch{R("Failed to reveal key","error")}},children:v?a.jsx(YS,{className:"h-4 w-4"}):a.jsx(XS,{className:"h-4 w-4"})}),a.jsx(K,{size:"icon",variant:"outline",title:"Copy to clipboard",onClick:async()=>{try{const D=await te.settings.getApiKey(!0);await navigator.clipboard.writeText(D.data.key),R("API key copied","success")}catch{R("Failed to copy","error")}},children:a.jsx(WS,{className:"h-4 w-4"})}),a.jsx(K,{size:"icon",variant:"outline",title:"Regenerate key",disabled:j,onClick:async()=>{if(window.confirm("Regenerating will invalidate the current key. All connected components must update their configuration. Continue?")){S(!0);try{const D=await te.settings.generateKey();p(D.data.key),w(D.data.key.slice(0,12)+"..."+D.data.key.slice(-4)),y(!0),R("New API key generated","success")}catch{R("Failed to generate key","error")}finally{S(!1)}}},children:j?a.jsx($e,{className:"h-4 w-4 animate-spin"}):a.jsx(La,{className:"h-4 w-4"})})]}),a.jsxs("div",{className:"rounded-md border border-border bg-muted/50 p-3",children:[a.jsxs("p",{className:"mb-2 flex items-center gap-1.5 text-xs font-medium",children:[a.jsx(ps,{className:"h-3.5 w-3.5"})," Connection Guide"]}),a.jsxs("div",{className:"space-y-1.5 text-[11px] font-mono text-muted-foreground",children:[a.jsxs("p",{children:[a.jsx("span",{className:"text-foreground font-semibold",children:"CLI:"})," opentrust connect --dashboard-url http://<host>:53667 --api-key <key>"]}),a.jsxs("p",{children:[a.jsx("span",{className:"text-foreground font-semibold",children:"Guards:"})," Set ",a.jsx("code",{className:"rounded bg-muted px-1",children:"apiKey"})," in openclaw.json plugin config"]}),a.jsxs("p",{children:[a.jsx("span",{className:"text-foreground font-semibold",children:"Gateway:"})," Set env ",a.jsx("code",{className:"rounded bg-muted px-1",children:"OT_API_KEY=<key>"})]})]})]})]})]}),a.jsx(fI,{showToast:R}),a.jsxs(fe,{children:[a.jsx(Ie,{children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs(Re,{className:"flex items-center gap-2 text-sm",children:[a.jsx(tf,{className:"h-4 w-4"})," Service Connection"]}),a.jsxs(K,{size:"sm",variant:"outline",onClick:$,disabled:f,children:[f?a.jsx($e,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):a.jsx(Xn,{className:"mr-1.5 h-3.5 w-3.5"}),"Test Connection"]})]})}),a.jsx(we,{children:h?a.jsxs("div",{className:`flex items-center gap-2 rounded-md border px-3 py-2 text-sm ${h.connected?"border-emerald-500/30 bg-emerald-50 text-emerald-800 dark:bg-emerald-950 dark:text-emerald-200":"border-destructive/30 bg-red-50 text-red-800 dark:bg-red-950 dark:text-red-200"}`,children:[h.connected?a.jsx(Yn,{className:"h-4 w-4"}):a.jsx(pt,{className:"h-4 w-4"}),a.jsx("span",{children:h.message}),h.url&&a.jsx(he,{variant:"outline",className:"ml-auto text-[10px]",children:h.url})]}):a.jsx("p",{className:"text-xs text-muted-foreground",children:'Click "Test Connection" to verify Core service connectivity'})})]}),a.jsxs(fe,{children:[a.jsx(Ie,{children:a.jsxs(Re,{className:"flex items-center gap-2 text-sm",children:[a.jsx(Zt,{className:"h-4 w-4"})," Configuration"]})}),a.jsx(we,{className:"space-y-5",children:uI.map(D=>{const E=D.icon,L=e[D.key]!==n[D.key];return a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(E,{className:"h-3.5 w-3.5 text-muted-foreground"}),a.jsx(Pe,{htmlFor:D.key,className:"text-sm font-medium",children:D.label}),L&&a.jsx(he,{variant:"secondary",className:"text-[10px]",children:"Modified"})]}),a.jsx(me,{id:D.key,value:e[D.key]??"",onChange:k=>T(D.key,k.target.value),placeholder:D.placeholder,className:"font-mono text-sm"}),a.jsx("p",{className:"text-[11px] text-muted-foreground",children:D.description})]},D.key)})})]}),a.jsx(mI,{showToast:R}),a.jsxs(fe,{children:[a.jsx(Ie,{children:a.jsx(Re,{className:"text-sm",children:"Environment"})}),a.jsx(we,{children:a.jsxs("div",{className:"grid gap-3 text-xs sm:grid-cols-2",children:[a.jsx(Oi,{label:"Dashboard Mode",value:e.dashboard_mode||"selfhosted"}),a.jsx(Oi,{label:"Core URL",value:e.og_core_url||"http://localhost:53666"}),a.jsx(Oi,{label:"Gateway URL",value:e.gateway_url||"http://localhost:8900"}),a.jsx(Oi,{label:"Database",value:e.database_url?"Custom":"SQLite (default)"})]})})]}),c&&a.jsxs("div",{className:`fixed bottom-6 right-6 z-[100] flex items-center gap-2 rounded-lg border px-4 py-3 shadow-lg animate-in slide-in-from-bottom-4 ${c.type==="success"?"border-emerald-500/30 bg-emerald-50 text-emerald-800 dark:bg-emerald-950 dark:text-emerald-200":"border-destructive/30 bg-red-50 text-red-800 dark:bg-red-950 dark:text-red-200"}`,children:[c.type==="success"?a.jsx(Yn,{className:"h-4 w-4"}):a.jsx(pt,{className:"h-4 w-4"}),a.jsx("span",{className:"text-sm",children:c.msg})]})]})}function fI({showToast:e}){const[t,n]=m.useState(""),[r,s]=m.useState(""),[o,i]=m.useState(""),[l,c]=m.useState(!1),u=async h=>{if(h.preventDefault(),r!==o){e("Passwords do not match","error");return}if(r.length<4){e("Password must be at least 4 characters","error");return}c(!0);try{const d=localStorage.getItem("opentrust_user"),f=d?JSON.parse(d).apiKey:null,g=await fetch("/api/auth/change-password",{method:"POST",headers:{"Content-Type":"application/json",...f&&{Authorization:`Bearer ${f}`}},body:JSON.stringify({currentPassword:t,newPassword:r})}),x=await g.json();if(!g.ok||!x.success)throw new Error(x.error||"Failed");e("Password changed successfully","success"),n(""),s(""),i("")}catch(d){e(d instanceof Error?d.message:"Failed to change password","error")}finally{c(!1)}};return a.jsxs(fe,{children:[a.jsxs(Ie,{children:[a.jsxs(Re,{className:"flex items-center gap-2 text-sm",children:[a.jsx(ZS,{className:"h-4 w-4"})," Change Password"]}),a.jsx(wl,{className:"text-xs",children:"Update the admin login password"})]}),a.jsx(we,{children:a.jsxs("form",{onSubmit:u,className:"space-y-3",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx(Pe,{className:"text-xs",children:"Current Password"}),a.jsx(me,{type:"password",value:t,onChange:h=>n(h.target.value),required:!0,className:"text-sm"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx(Pe,{className:"text-xs",children:"New Password"}),a.jsx(me,{type:"password",value:r,onChange:h=>s(h.target.value),required:!0,className:"text-sm"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx(Pe,{className:"text-xs",children:"Confirm New Password"}),a.jsx(me,{type:"password",value:o,onChange:h=>i(h.target.value),required:!0,className:"text-sm"})]}),a.jsxs(K,{type:"submit",size:"sm",disabled:l,children:[l?a.jsx($e,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):a.jsx(ef,{className:"mr-1.5 h-3.5 w-3.5"}),"Update Password"]})]})})]})}const hI={provider:{name:"",baseUrl:"",apiKey:"",apiType:"openai-completions"},models:[],defaultModel:""};function mI({showToast:e}){const[t,n]=m.useState(hI),[r,s]=m.useState(!0),[o,i]=m.useState(!1);m.useEffect(()=>{te.settings.getOpenclawConfig().then(d=>{d.data&&n(d.data)}).catch(()=>{}).finally(()=>s(!1))},[]);const l=d=>{n(f=>{const g=JSON.parse(JSON.stringify(f));return d(g),g})},c=()=>{l(d=>d.models.push({id:"",name:""}))},u=d=>{l(f=>f.models.splice(d,1))},h=async()=>{if(!t.provider.name||!t.provider.baseUrl){e("Provider name and base URL are required","error");return}i(!0);try{await te.settings.saveOpenclawConfig(t),e("OpenClaw config saved","success")}catch(d){e(d instanceof Error?d.message:"Failed to save","error")}finally{i(!1)}};return r?null:a.jsxs(fe,{children:[a.jsx(Ie,{children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsxs(Re,{className:"flex items-center gap-2 text-sm",children:[a.jsx(Pr,{className:"h-4 w-4"})," OpenClaw Config Template"]}),a.jsx(wl,{className:"text-xs mt-1",children:"Configure the default openclaw.json template used when installing OpenClaw on hosts"})]}),a.jsxs(K,{size:"sm",onClick:h,disabled:o,children:[o?a.jsx($e,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):a.jsx(ef,{className:"mr-1.5 h-3.5 w-3.5"}),"Save Config"]})]})}),a.jsxs(we,{className:"space-y-5",children:[a.jsxs("div",{className:"space-y-3 rounded-md border border-border p-4",children:[a.jsx("h4",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider",children:"Model Provider"}),a.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx(Pe,{className:"text-xs",children:"Provider Name"}),a.jsx(me,{value:t.provider.name,onChange:d=>l(f=>{f.provider.name=d.target.value}),placeholder:"e.g. bailian",className:"text-sm"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx(Pe,{className:"text-xs",children:"API Type"}),a.jsx(me,{value:t.provider.apiType,onChange:d=>l(f=>{f.provider.apiType=d.target.value}),placeholder:"openai-completions",className:"text-sm"})]}),a.jsxs("div",{className:"space-y-1 sm:col-span-2",children:[a.jsx(Pe,{className:"text-xs",children:"Base URL"}),a.jsx(me,{value:t.provider.baseUrl,onChange:d=>l(f=>{f.provider.baseUrl=d.target.value}),placeholder:"https://coding.dashscope.aliyuncs.com/v1",className:"text-sm font-mono"})]}),a.jsxs("div",{className:"space-y-1 sm:col-span-2",children:[a.jsx(Pe,{className:"text-xs",children:"API Key"}),a.jsx(me,{type:"password",value:t.provider.apiKey,onChange:d=>l(f=>{f.provider.apiKey=d.target.value}),placeholder:"sk-xxx",className:"text-sm font-mono"})]})]})]}),a.jsxs("div",{className:"space-y-3 rounded-md border border-border p-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h4",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider",children:"Models"}),a.jsxs(K,{size:"sm",variant:"outline",onClick:c,children:[a.jsx(rb,{className:"mr-1 h-3 w-3"})," Add Model"]})]}),t.models.length===0&&a.jsx("p",{className:"text-xs text-muted-foreground",children:'No models configured. Click "Add Model" to start.'}),t.models.map((d,f)=>a.jsxs("div",{className:"flex items-end gap-2",children:[a.jsxs("div",{className:"flex-1 space-y-1",children:[a.jsx(Pe,{className:"text-xs",children:"Model ID"}),a.jsx(me,{value:d.id,onChange:g=>l(x=>{x.models[f].id=g.target.value}),placeholder:"provider/model-name",className:"text-sm font-mono"})]}),a.jsxs("div",{className:"flex-1 space-y-1",children:[a.jsx(Pe,{className:"text-xs",children:"Display Name"}),a.jsx(me,{value:d.name,onChange:g=>l(x=>{x.models[f].name=g.target.value}),placeholder:"Model Name",className:"text-sm"})]}),a.jsx(K,{size:"icon",variant:"ghost",className:"shrink-0 text-destructive hover:text-destructive",onClick:()=>u(f),children:a.jsx(Ot,{className:"h-4 w-4"})})]},f))]}),a.jsxs("div",{className:"space-y-2 rounded-md border border-border p-4",children:[a.jsx("h4",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider",children:"Default Model"}),t.models.length>0?a.jsxs("select",{className:"w-full rounded-md border bg-background px-3 py-2 text-sm",value:t.defaultModel,onChange:d=>l(f=>{f.defaultModel=d.target.value}),children:[a.jsx("option",{value:"",children:"-- Select default model --"}),t.models.map(d=>a.jsx("option",{value:d.id,children:d.name||d.id},d.id))]}):a.jsx("p",{className:"text-xs text-muted-foreground",children:"Add models first to select a default."})]}),a.jsx("div",{className:"rounded-md border border-border bg-muted/50 p-3",children:a.jsxs("p",{className:"text-[11px] text-muted-foreground",children:[a.jsx("strong",{children:"Note:"})," When installing OpenClaw on a host, the Guards plugin section (API Key, Dashboard URL, Core URL) will be auto-injected from system settings."]})})]})]})}function Oi({label:e,value:t}){return a.jsxs("div",{className:"flex items-center justify-between rounded-md border border-border px-3 py-2",children:[a.jsx("span",{className:"text-muted-foreground",children:e}),a.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 text-[11px]",children:t})]})}function pI(){const[e,t]=Gj(),[n,r]=m.useState([]),[s,o]=m.useState(!0),[i,l]=m.useState(e.get("expand")),[c,u]=m.useState(null),h=m.useCallback(async()=>{try{const g=await te.hosts.list();r(g.data)}catch{}finally{o(!1)}},[]);m.useEffect(()=>{h();const g=setInterval(h,15e3);return()=>clearInterval(g)},[h]),m.useEffect(()=>{if(!c)return;const g=setTimeout(()=>u(null),4e3);return()=>clearTimeout(g)},[c]);const d=(g,x)=>u({msg:g,type:x}),f=async g=>{try{await te.hosts.remove(g),r(x=>x.filter(w=>w.id!==g)),d("Host removed","success")}catch{d("Failed to remove host","error")}};return s?a.jsx("div",{className:"flex items-center justify-center py-24",children:a.jsx($e,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):a.jsxs("div",{className:"space-y-6 p-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-bold",children:"Hosts"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Manage machines running OpenTrust CLI"})]}),a.jsxs(K,{variant:"outline",size:"sm",onClick:h,children:[a.jsx(Xn,{className:"h-4 w-4 mr-1"})," Refresh"]})]}),n.length===0?a.jsxs(fe,{className:"p-8 text-center",children:[a.jsx(xl,{className:"h-12 w-12 mx-auto text-muted-foreground mb-4"}),a.jsx("h3",{className:"text-lg font-medium mb-2",children:"No hosts connected"}),a.jsx("p",{className:"text-sm text-muted-foreground mb-4 max-w-md mx-auto",children:"Use the CLI to connect a host to this Dashboard:"}),a.jsx("code",{className:"block bg-muted rounded px-3 py-2 text-xs font-mono max-w-lg mx-auto",children:"opentrust connect --dashboard-url http://this-host:53667 --api-key sk-og-xxx"})]}):a.jsx("div",{className:"space-y-3",children:n.map(g=>a.jsx("div",{children:a.jsx(gI,{host:g,expanded:i===g.id,onToggle:()=>{const x=i===g.id?null:g.id;l(x),x?t({expand:x},{replace:!0}):t({},{replace:!0})},onRemove:()=>f(g.id),showToast:d})},g.id))}),c&&a.jsxs("div",{className:`fixed bottom-6 right-6 z-50 flex items-center gap-2 rounded-lg px-4 py-3 text-sm shadow-lg ${c.type==="success"?"bg-green-600 text-white":"bg-red-600 text-white"}`,children:[c.type==="success"?a.jsx(Yn,{className:"h-4 w-4"}):a.jsx(pt,{className:"h-4 w-4"}),c.msg]})]})}function gI({host:e,expanded:t,onToggle:n,onRemove:r,showToast:s}){const o=e.status==="online",i=e.services??{},l=Object.values(i).filter(d=>d.running).length,c=Object.keys(i).length;e.metadata;const[u,h]=m.useState(0);return m.useEffect(()=>{te.hosts.agents(e.id).then(d=>h((d.data??[]).length)).catch(()=>{})},[e.id]),a.jsxs(fe,{className:"overflow-hidden",children:[a.jsxs("button",{onClick:n,className:"w-full flex items-center gap-4 p-4 hover:bg-accent/30 transition-colors text-left",children:[a.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[a.jsx("div",{className:`h-2.5 w-2.5 rounded-full shrink-0 ${o?"bg-green-500":"bg-gray-400"}`}),a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"font-medium truncate",children:e.hostname}),a.jsx(he,{variant:o?"default":"secondary",className:"text-[10px] px-1.5",children:o?"online":"offline"})]}),a.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground mt-0.5",children:[a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(Jx,{className:"h-3 w-3"})," ",e.ip]}),a.jsxs("span",{children:[e.os," / ",e.arch]}),a.jsxs("span",{children:["CLI v",e.cliVersion]}),a.jsxs("span",{children:[l,"/",c," services"]}),u>0&&a.jsxs("span",{children:[u," agent",u>1?"s":""]})]})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"flex gap-1",children:Object.entries(i).map(([d,f])=>a.jsx("span",{title:`${f.name}: ${f.running?f.healthy?"healthy":"running":"stopped"}`,className:`inline-block h-4 w-4 rounded text-[8px] font-bold flex items-center justify-center ${f.running?f.healthy?"bg-green-500/20 text-green-700 dark:text-green-400":"bg-yellow-500/20 text-yellow-700 dark:text-yellow-400":"bg-gray-500/20 text-gray-500"}`,children:d[0].toUpperCase()},d))}),t?a.jsx(BS,{className:"h-4 w-4 text-muted-foreground"}):a.jsx(pl,{className:"h-4 w-4 text-muted-foreground"})]})]}),t&&a.jsx("div",{className:"border-t border-border",children:a.jsx(xI,{host:e,onRemove:r,showToast:s})})]})}function xI({host:e,onRemove:t,showToast:n}){const[r,s]=m.useState("agents");return a.jsxs(Mf,{value:r,onValueChange:s,className:"w-full",children:[a.jsxs(Al,{className:"w-full justify-start rounded-none border-b bg-transparent px-4 pt-2",children:[a.jsx(Ze,{value:"agents",children:"Agents"}),a.jsx(Ze,{value:"services",children:"Services"}),a.jsx(Ze,{value:"guards",children:"Guards"}),a.jsx(Ze,{value:"openclaw",children:"OpenClaw"}),a.jsx(Ze,{value:"logs",children:"Logs"}),a.jsx(Ze,{value:"upgrade",children:"Upgrade"}),a.jsx(Ze,{value:"config",children:"Config"}),a.jsx(Ze,{value:"commands",children:"Commands"}),a.jsx(Ze,{value:"info",children:"Info"})]}),a.jsxs("div",{className:"p-4",children:[a.jsx(Je,{value:"agents",className:"mt-0",children:a.jsx(yI,{hostId:e.id})}),a.jsx(Je,{value:"services",className:"mt-0",children:a.jsx(vI,{host:e,showToast:n})}),a.jsx(Je,{value:"guards",className:"mt-0",children:a.jsx(wI,{host:e,showToast:n})}),a.jsx(Je,{value:"openclaw",className:"mt-0",children:a.jsx(NI,{host:e,showToast:n})}),a.jsx(Je,{value:"logs",className:"mt-0",children:a.jsx(jI,{host:e,showToast:n})}),a.jsx(Je,{value:"upgrade",className:"mt-0",children:a.jsx(SI,{host:e,showToast:n})}),a.jsx(Je,{value:"config",className:"mt-0",children:a.jsx(bI,{host:e,showToast:n})}),a.jsx(Je,{value:"commands",className:"mt-0",children:a.jsx(kI,{hostId:e.id})}),a.jsx(Je,{value:"info",className:"mt-0",children:a.jsx(CI,{host:e,onRemove:t})})]})]})}function yI({hostId:e}){const[t,n]=m.useState([]),[r,s]=m.useState(!0);return m.useEffect(()=>{te.hosts.agents(e).then(o=>n(o.data??[])).catch(()=>{}).finally(()=>s(!1))},[e]),r?a.jsx("div",{className:"flex items-center justify-center py-8",children:a.jsx($e,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):t.length===0?a.jsxs("div",{className:"flex flex-col items-center gap-3 py-8 text-center",children:[a.jsx(xl,{className:"h-8 w-8 text-muted-foreground/30"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"No agents associated with this host"}),a.jsx("p",{className:"text-xs text-muted-foreground/70",children:"Agents are auto-linked when the Guards plugin reports the same hostname"})]}):a.jsxs("div",{className:"space-y-2",children:[a.jsxs("p",{className:"text-sm text-muted-foreground mb-3",children:[t.length," agent",t.length>1?"s":""," running on this host"]}),t.map(o=>{const i=o.metadata??{},l=i.emoji||"🤖",c=i.openclawId||o.id;return a.jsxs(Gn,{to:`/inventory/agents/${c}`,className:"flex items-center gap-3 rounded-lg border border-border p-3 transition-colors hover:bg-muted/30",children:[a.jsx("span",{className:"text-lg",children:l}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-sm font-medium truncate",children:o.name}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:[o.provider!=="custom"?o.provider:""," ",a.jsx(he,{variant:o.status==="active"?"default":"secondary",className:"text-[10px] ml-1",children:o.status})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[o.lastSeenAt&&a.jsx("span",{className:"text-[11px] text-muted-foreground",children:new Date(o.lastSeenAt).toLocaleString()}),a.jsx(gl,{className:"h-3.5 w-3.5 text-muted-foreground/50 rotate-90"})]})]},o.id)})]})}function vI({host:e,showToast:t}){const n=e.services??{},[r,s]=m.useState(null),o=async(i,l)=>{s(`${i}-${l}`);try{await te.hosts.sendCommand(e.id,i,{service:l}),t(`${i.replace("_"," ")} "${l}" sent`,"success")}catch{t(`Failed to send ${i}`,"error")}finally{s(null)}};return a.jsxs("div",{className:"space-y-2",children:[Object.entries(n).map(([i,l])=>a.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-border px-4 py-3",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:`h-2 w-2 rounded-full ${l.running?l.healthy?"bg-green-500":"bg-yellow-500":"bg-gray-400"}`}),a.jsxs("div",{children:[a.jsx("span",{className:"font-medium text-sm",children:l.name}),a.jsxs("span",{className:"text-xs text-muted-foreground ml-2",children:[":",l.port]}),l.pid&&a.jsxs("span",{className:"text-xs text-muted-foreground ml-2",children:["PID ",l.pid]})]})]}),a.jsx("div",{className:"flex items-center gap-1",children:l.running?a.jsxs(a.Fragment,{children:[a.jsxs(K,{variant:"outline",size:"sm",disabled:r!==null,onClick:()=>o("restart_service",i),children:[a.jsx(La,{className:"h-3 w-3 mr-1"})," Restart"]}),a.jsxs(K,{variant:"outline",size:"sm",disabled:r!==null,onClick:()=>o("stop_service",i),children:[a.jsx(Lo,{className:"h-3 w-3 mr-1"})," Stop"]})]}):a.jsxs(K,{variant:"outline",size:"sm",disabled:r!==null,onClick:()=>o("start_service",i),children:[a.jsx(Ta,{className:"h-3 w-3 mr-1"})," Start"]})})]},i)),a.jsxs("div",{className:"flex gap-2 pt-2",children:[a.jsxs(K,{variant:"outline",size:"sm",disabled:r!==null,onClick:()=>o("start_service","all"),children:[a.jsx(Ta,{className:"h-3 w-3 mr-1"})," Start All"]}),a.jsxs(K,{variant:"outline",size:"sm",disabled:r!==null,onClick:()=>o("stop_service","all"),children:[a.jsx(Lo,{className:"h-3 w-3 mr-1"})," Stop All"]}),a.jsxs(K,{variant:"outline",size:"sm",disabled:r!==null,onClick:()=>o("restart_service","all"),children:[a.jsx(La,{className:"h-3 w-3 mr-1"})," Restart All"]})]})]})}function wI({host:e,showToast:t}){const[n,r]=m.useState(""),[s,o]=m.useState(null),l=(e.metadata??{}).guards,c=async u=>{o(u);try{await te.hosts.sendCommand(e.id,u,n?{version:n}:{}),t(u==="install_guards"?"Guards install command sent":"Guards upgrade command sent","success")}catch{t(`Failed to send ${u.replace("_"," ")} command`,"error")}finally{o(null)}};return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(ty,{className:"h-5 w-5 text-primary"}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-medium",children:"OpenTrust Guards Plugin"}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Install or upgrade the ",a.jsx("code",{children:"@opentrust/guards"})," security plugin for OpenClaw on this host"]})]})]}),(l==null?void 0:l.installed)&&a.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[a.jsx(he,{variant:"default",className:"text-xs",children:"Installed"}),l.version&&a.jsxs("span",{className:"text-muted-foreground",children:["v",l.version]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(me,{placeholder:"Version (empty = latest)",value:n,onChange:u=>r(u.target.value),className:"max-w-xs"}),a.jsxs(K,{onClick:()=>c("install_guards"),disabled:s!==null,variant:"default",children:[s==="install_guards"?a.jsx($e,{className:"h-4 w-4 mr-1 animate-spin"}):a.jsx(Ct,{className:"h-4 w-4 mr-1"}),"Install"]}),a.jsxs(K,{onClick:()=>c("upgrade_guards"),disabled:s!==null,variant:"outline",children:[s==="upgrade_guards"?a.jsx($e,{className:"h-4 w-4 mr-1 animate-spin"}):a.jsx(gl,{className:"h-4 w-4 mr-1"}),"Upgrade"]})]}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:[a.jsx("strong",{children:"Install"}),": runs ",a.jsx("code",{children:"openclaw plugins install @opentrust/guards"})," on the remote host.",a.jsx("br",{}),a.jsx("strong",{children:"Upgrade"}),": uninstalls the current version then installs the specified (or latest) version.",a.jsx("br",{}),"Check the ",a.jsx("strong",{children:"Commands"})," tab to see execution results."]})]})}function NI({host:e,showToast:t}){const[n,r]=m.useState(!1),o=(e.metadata??{}).openclaw,i=async()=>{r(!0);try{await te.hosts.sendCommand(e.id,"install_openclaw",{}),t("Install OpenClaw command sent. Check Commands tab for progress.","success")}catch(l){const c=(l==null?void 0:l.message)||"Failed to send install command";t(c,"error")}finally{r(!1)}};return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(Pr,{className:"h-5 w-5 text-primary"}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-medium",children:"OpenClaw"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Install OpenClaw AI agent runtime on this host"})]})]}),a.jsx("div",{className:"flex items-center gap-2 text-sm",children:o!=null&&o.installed?a.jsxs(a.Fragment,{children:[a.jsx(he,{variant:"default",className:"text-xs",children:"Installed"}),o.version&&a.jsx("span",{className:"text-muted-foreground",children:o.version})]}):a.jsx(he,{variant:"secondary",className:"text-xs",children:"Not installed"})}),a.jsxs(K,{onClick:i,disabled:n,children:[n?a.jsx($e,{className:"h-4 w-4 mr-1 animate-spin"}):a.jsx(Ct,{className:"h-4 w-4 mr-1"}),o!=null&&o.installed?"Reinstall OpenClaw":"Install OpenClaw"]}),a.jsxs("div",{className:"rounded-md border border-border bg-muted/50 p-3 space-y-1.5",children:[a.jsx("p",{className:"text-xs text-muted-foreground",children:a.jsx("strong",{children:"What this does:"})}),a.jsxs("ol",{className:"list-decimal list-inside text-xs text-muted-foreground space-y-0.5",children:[a.jsxs("li",{children:["Runs ",a.jsx("code",{children:"curl -fsSL https://openclaw.ai/install.sh | bash"})," to install OpenClaw"]}),a.jsxs("li",{children:["Writes ",a.jsx("code",{children:"~/.openclaw/openclaw.json"})," with the config template from Settings"]}),a.jsx("li",{children:"Auto-injects Guards plugin config (API Key, Dashboard URL, Core URL)"})]}),a.jsxs("p",{className:"text-[11px] text-muted-foreground mt-2",children:[a.jsx("strong",{children:"Prerequisite:"})," Configure the OpenClaw Config Template in"," ",a.jsx("a",{href:"/system/settings",className:"text-primary underline",children:"Settings"})," first."]})]})]})}function jI({host:e,showToast:t}){const n=Object.keys(e.services??{}),[r,s]=m.useState(n[0]??"core"),[o,i]=m.useState(null),[l,c]=m.useState(!1),u=async()=>{c(!0);try{await te.hosts.sendCommand(e.id,"fetch_logs",{service:r,lines:200}),t("Log fetch command sent. Check Commands tab for result.","success")}catch{t("Failed to send fetch_logs command","error")}finally{c(!1)}};return a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Pe,{children:"Service:"}),a.jsx("select",{className:"rounded border border-border bg-background px-2 py-1 text-sm",value:r,onChange:h=>s(h.target.value),children:n.map(h=>a.jsx("option",{value:h,children:h},h))}),a.jsxs(K,{variant:"outline",size:"sm",onClick:u,disabled:l,children:[a.jsx(Rs,{className:"h-3 w-3 mr-1"})," Fetch Logs"]})]}),a.jsx("p",{className:"text-xs text-muted-foreground",children:'The fetch_logs command is sent to the host CLI daemon. View the result in the "Commands" tab once completed.'})]})}function SI({host:e,showToast:t}){const[n,r]=m.useState(""),[s,o]=m.useState(!1),i=async()=>{o(!0);try{await te.hosts.sendCommand(e.id,"upgrade",n?{version:n}:{}),t("Upgrade command sent","success")}catch{t("Failed to send upgrade command","error")}finally{o(!1)}};return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center gap-4 text-sm",children:[a.jsxs("span",{children:["Current CLI version: ",a.jsxs("strong",{children:["v",e.cliVersion]})]}),a.jsxs("span",{children:["Project mode: ",a.jsx(he,{variant:"secondary",children:e.projectMode})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(me,{placeholder:"Target version (empty = latest)",value:n,onChange:l=>r(l.target.value),className:"max-w-xs"}),a.jsxs(K,{onClick:i,disabled:s,children:[a.jsx(gl,{className:"h-4 w-4 mr-1"})," Upgrade"]})]}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Runs ",a.jsx("code",{children:"npm install -g @opentrust/cli@version"})," and upgrades project packages on the remote host."]})]})}function bI({host:e,showToast:t}){const[n,r]=m.useState(""),[s,o]=m.useState(""),[i,l]=m.useState(!1),c=async()=>{if(n){l(!0);try{await te.hosts.sendCommand(e.id,"update_env",{key:n,value:s}),t(`ENV update sent: ${n}`,"success"),r(""),o("")}catch{t("Failed to send config update","error")}finally{l(!1)}}};return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("p",{className:"text-sm text-muted-foreground",children:["Update environment variables in the remote host's ",a.jsx("code",{children:".env"})," file."]}),a.jsxs("div",{className:"grid grid-cols-2 gap-2 max-w-lg",children:[a.jsxs("div",{children:[a.jsx(Pe,{className:"text-xs",children:"Key"}),a.jsx(me,{placeholder:"e.g. CORE_API_KEY",value:n,onChange:u=>r(u.target.value)})]}),a.jsxs("div",{children:[a.jsx(Pe,{className:"text-xs",children:"Value"}),a.jsx(me,{placeholder:"Value",value:s,onChange:u=>o(u.target.value)})]})]}),a.jsxs(K,{size:"sm",onClick:c,disabled:i||!n,children:[a.jsx(Zt,{className:"h-3 w-3 mr-1"})," Update .env"]})]})}function kI({hostId:e}){const[t,n]=m.useState([]),[r,s]=m.useState(!0),o=m.useCallback(async()=>{try{const c=await te.hosts.commands(e);n(c.data)}catch{}s(!1)},[e]);m.useEffect(()=>{o();const c=setInterval(o,8e3);return()=>clearInterval(c)},[o]);const i=c=>{const u={pending:"bg-yellow-500/20 text-yellow-700 dark:text-yellow-400",running:"bg-blue-500/20 text-blue-700 dark:text-blue-400",completed:"bg-green-500/20 text-green-700 dark:text-green-400",failed:"bg-red-500/20 text-red-700 dark:text-red-400"};return a.jsx("span",{className:`inline-flex items-center rounded px-1.5 py-0.5 text-[10px] font-medium ${u[c]??"bg-gray-500/20 text-gray-500"}`,children:c})},l=c=>({start_service:a.jsx(Ta,{className:"h-3 w-3"}),stop_service:a.jsx(Lo,{className:"h-3 w-3"}),restart_service:a.jsx(La,{className:"h-3 w-3"}),upgrade:a.jsx(gl,{className:"h-3 w-3"}),fetch_logs:a.jsx(Rs,{className:"h-3 w-3"}),update_env:a.jsx(Zt,{className:"h-3 w-3"})})[c]??a.jsx(ps,{className:"h-3 w-3"});return r?a.jsx("div",{className:"text-sm text-muted-foreground py-4",children:"Loading..."}):t.length===0?a.jsx("div",{className:"text-sm text-muted-foreground py-4",children:"No commands yet."}):a.jsx("div",{className:"space-y-2 max-h-[400px] overflow-y-auto",children:t.map(c=>a.jsxs("div",{className:"rounded border border-border p-3 text-sm",children:[a.jsxs("div",{className:"flex items-center justify-between mb-1",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[l(c.type),a.jsx("span",{className:"font-medium",children:c.type.replace(/_/g," ")}),i(c.status)]}),a.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(c.createdAt).toLocaleString()})]}),c.payload&&a.jsx("pre",{className:"text-xs bg-muted rounded px-2 py-1 mt-1 overflow-x-auto",children:JSON.stringify(c.payload,null,2)}),c.result&&a.jsx("pre",{className:`text-xs rounded px-2 py-1 mt-1 overflow-x-auto ${c.status==="failed"?"bg-red-500/10":"bg-green-500/10"}`,children:JSON.stringify(c.result,null,2)})]},c.id))})}function CI({host:e,onRemove:t}){const n=e.metadata??{},[r,s]=m.useState(!1),o=[{label:"Host ID",value:e.id},{label:"Hostname",value:e.hostname},{label:"OS",value:`${e.os} (${e.arch})`},{label:"IP",value:e.ip},{label:"CLI Version",value:e.cliVersion},{label:"Project Mode",value:e.projectMode},{label:"Project Root",value:e.projectRoot},{label:"CPU",value:`${n.cpuModel} (${n.cpuCount} cores)`},{label:"Memory",value:`${n.freeMemMB} MB free / ${n.totalMemMB} MB total`},{label:"Node.js",value:String(n.nodeVersion??"")},{label:"Uptime",value:n.uptime?`${Math.round(Number(n.uptime)/3600)} hours`:""},{label:"Last Seen",value:new Date(e.lastSeenAt).toLocaleString()},{label:"Connected Since",value:new Date(e.createdAt).toLocaleString()}];return a.jsxs("div",{className:"space-y-4",children:[a.jsx("div",{className:"grid grid-cols-2 gap-x-6 gap-y-2",children:o.filter(i=>i.value).map(i=>a.jsxs("div",{className:"flex gap-2 text-sm py-1",children:[a.jsxs("span",{className:"text-muted-foreground min-w-[120px]",children:[i.label,":"]}),a.jsx("span",{className:"font-mono text-xs break-all",children:i.value})]},i.label))}),a.jsx("div",{className:"border-t border-border pt-4",children:a.jsxs(K,{variant:"destructive",size:"sm",onClick:()=>s(!0),children:[a.jsx(Ot,{className:"h-3 w-3 mr-1"})," Remove Host"]})}),a.jsx(Mr,{open:r,onOpenChange:s,children:a.jsxs(er,{children:[a.jsxs(Ir,{children:[a.jsx(tr,{children:"Remove Host"}),a.jsxs(nr,{children:["Remove ",a.jsx("strong",{children:e.hostname})," from the Dashboard? The host will need to run"," ",a.jsx("code",{children:"opentrust connect"})," again to re-register."]})]}),a.jsxs(Rr,{children:[a.jsx(K,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),a.jsx(K,{variant:"destructive",onClick:()=>{s(!1),t()},children:"Remove"})]})]})})]})}function EI({children:e}){const{isAuthenticated:t,isLoading:n}=Qd();return n?a.jsx("div",{className:"flex min-h-screen items-center justify-center",children:a.jsx("div",{className:"text-muted-foreground text-sm",children:"Loading..."})}):t?a.jsx(a.Fragment,{children:e}):a.jsx(Cu,{to:"/login",replace:!0})}function _I(){return a.jsxs(yj,{children:[a.jsx(Ye,{path:"/login",element:a.jsx(yb,{})}),a.jsxs(Ye,{element:a.jsx(EI,{children:a.jsx(xb,{})}),children:[a.jsx(Ye,{index:!0,element:a.jsx(Cu,{to:"/inventory/agents",replace:!0})}),a.jsx(Ye,{path:"/inventory/agents",element:a.jsx(Kk,{})}),a.jsx(Ye,{path:"/inventory/agents/:id",element:a.jsx(Xk,{})}),a.jsx(Ye,{path:"/inventory/identities",element:a.jsx(eC,{})}),a.jsx(Ye,{path:"/inventory/permissions",element:a.jsx(tC,{})}),a.jsx(Ye,{path:"/secure/risk",element:a.jsx(nC,{})}),a.jsx(Ye,{path:"/secure/graph",element:a.jsx(bM,{})}),a.jsx(Ye,{path:"/ops/skills",element:a.jsx(VM,{})}),a.jsx(Ye,{path:"/ops/plugins",element:a.jsx(qM,{})}),a.jsx(Ye,{path:"/inventory/hosts",element:a.jsx(pI,{})}),a.jsx(Ye,{path:"/system/logs",element:a.jsx(iI,{})}),a.jsx(Ye,{path:"/system/settings",element:a.jsx(dI,{})})]}),a.jsx(Ye,{path:"*",element:a.jsx(Cu,{to:"/inventory/agents",replace:!0})})]})}Rc.createRoot(document.getElementById("root")).render(a.jsx(Wt.StrictMode,{children:a.jsx(Vj,{basename:"/dashboard",children:a.jsx(Jj,{children:a.jsx(tS,{children:a.jsx(_I,{})})})})}));
|
|
408
|
-
//# sourceMappingURL=index-2q5MJOn_.js.map
|