@opentrust/dashboard 7.3.25 → 7.3.26
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.
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
function Y1(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 Bc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var hp={exports:{}},Ga={},mp={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 Vo=Symbol.for("react.element"),X1=Symbol.for("react.portal"),Q1=Symbol.for("react.fragment"),q1=Symbol.for("react.strict_mode"),Z1=Symbol.for("react.profiler"),J1=Symbol.for("react.provider"),ew=Symbol.for("react.context"),tw=Symbol.for("react.forward_ref"),nw=Symbol.for("react.suspense"),rw=Symbol.for("react.memo"),sw=Symbol.for("react.lazy"),Af=Symbol.iterator;function ow(e){return e===null||typeof e!="object"?null:(e=Af&&e[Af]||e["@@iterator"],typeof e=="function"?e:null)}var pp={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},gp=Object.assign,xp={};function Ns(e,t,n){this.props=e,this.context=t,this.refs=xp,this.updater=n||pp}Ns.prototype.isReactComponent={};Ns.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")};Ns.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function yp(){}yp.prototype=Ns.prototype;function Uc(e,t,n){this.props=e,this.context=t,this.refs=xp,this.updater=n||pp}var Wc=Uc.prototype=new yp;Wc.constructor=Uc;gp(Wc,Ns.prototype);Wc.isPureReactComponent=!0;var zf=Array.isArray,vp=Object.prototype.hasOwnProperty,Kc={current:null},wp={key:!0,ref:!0,__self:!0,__source:!0};function Np(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)vp.call(t,r)&&!wp.hasOwnProperty(r)&&(s[r]=t[r]);var l=arguments.length-2;if(l===1)s.children=n;else if(1<l){for(var u=Array(l),c=0;c<l;c++)u[c]=arguments[c+2];s.children=u}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)s[r]===void 0&&(s[r]=l[r]);return{$$typeof:Vo,type:e,key:o,ref:i,props:s,_owner:Kc.current}}function iw(e,t){return{$$typeof:Vo,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Gc(e){return typeof e=="object"&&e!==null&&e.$$typeof===Vo}function aw(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Df=/\/+/g;function Ll(e,t){return typeof e=="object"&&e!==null&&e.key!=null?aw(""+e.key):t.toString(36)}function Oi(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 Vo:case X1:i=!0}}if(i)return i=e,s=s(i),e=r===""?"."+Ll(i,0):r,zf(s)?(n="",e!=null&&(n=e.replace(Df,"$&/")+"/"),Oi(s,t,n,"",function(c){return c})):s!=null&&(Gc(s)&&(s=iw(s,n+(!s.key||i&&i.key===s.key?"":(""+s.key).replace(Df,"$&/")+"/")+e)),t.push(s)),1;if(i=0,r=r===""?".":r+":",zf(e))for(var l=0;l<e.length;l++){o=e[l];var u=r+Ll(o,l);i+=Oi(o,t,n,u,s)}else if(u=ow(e),typeof u=="function")for(e=u.call(e),l=0;!(o=e.next()).done;)o=o.value,u=r+Ll(o,l++),i+=Oi(o,t,n,u,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 oi(e,t,n){if(e==null)return e;var r=[],s=0;return Oi(e,r,"","",function(o){return t.call(n,o,s++)}),r}function lw(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 Je={current:null},Fi={transition:null},uw={ReactCurrentDispatcher:Je,ReactCurrentBatchConfig:Fi,ReactCurrentOwner:Kc};oe.Children={map:oi,forEach:function(e,t,n){oi(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return oi(e,function(){t++}),t},toArray:function(e){return oi(e,function(t){return t})||[]},only:function(e){if(!Gc(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};oe.Component=Ns;oe.Fragment=Q1;oe.Profiler=Z1;oe.PureComponent=Uc;oe.StrictMode=q1;oe.Suspense=nw;oe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=uw;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=gp({},e.props),s=e.key,o=e.ref,i=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,i=Kc.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(u in t)vp.call(t,u)&&!wp.hasOwnProperty(u)&&(r[u]=t[u]===void 0&&l!==void 0?l[u]:t[u])}var u=arguments.length-2;if(u===1)r.children=n;else if(1<u){l=Array(u);for(var c=0;c<u;c++)l[c]=arguments[c+2];r.children=l}return{$$typeof:Vo,type:e.type,key:s,ref:o,props:r,_owner:i}};oe.createContext=function(e){return e={$$typeof:ew,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:J1,_context:e},e.Consumer=e};oe.createElement=Np;oe.createFactory=function(e){var t=Np.bind(null,e);return t.type=e,t};oe.createRef=function(){return{current:null}};oe.forwardRef=function(e){return{$$typeof:tw,render:e}};oe.isValidElement=Gc;oe.lazy=function(e){return{$$typeof:sw,_payload:{_status:-1,_result:e},_init:lw}};oe.memo=function(e,t){return{$$typeof:rw,type:e,compare:t===void 0?null:t}};oe.startTransition=function(e){var t=Fi.transition;Fi.transition={};try{e()}finally{Fi.transition=t}};oe.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};oe.useCallback=function(e,t){return Je.current.useCallback(e,t)};oe.useContext=function(e){return Je.current.useContext(e)};oe.useDebugValue=function(){};oe.useDeferredValue=function(e){return Je.current.useDeferredValue(e)};oe.useEffect=function(e,t){return Je.current.useEffect(e,t)};oe.useId=function(){return Je.current.useId()};oe.useImperativeHandle=function(e,t,n){return Je.current.useImperativeHandle(e,t,n)};oe.useInsertionEffect=function(e,t){return Je.current.useInsertionEffect(e,t)};oe.useLayoutEffect=function(e,t){return Je.current.useLayoutEffect(e,t)};oe.useMemo=function(e,t){return Je.current.useMemo(e,t)};oe.useReducer=function(e,t,n){return Je.current.useReducer(e,t,n)};oe.useRef=function(e){return Je.current.useRef(e)};oe.useState=function(e){return Je.current.useState(e)};oe.useSyncExternalStore=function(e,t,n){return Je.current.useSyncExternalStore(e,t,n)};oe.useTransition=function(){return Je.current.useTransition()};oe.version="18.3.0";mp.exports=oe;var m=mp.exports;const Bt=Bc(m),cw=Y1({__proto__:null,default:Bt},[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 dw=m,fw=Symbol.for("react.element"),hw=Symbol.for("react.fragment"),mw=Object.prototype.hasOwnProperty,pw=dw.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,gw={key:!0,ref:!0,__self:!0,__source:!0};function Sp(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)mw.call(t,r)&&!gw.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:fw,type:e,key:o,ref:i,props:s,_owner:pw.current}}Ga.Fragment=hw;Ga.jsx=Sp;Ga.jsxs=Sp;hp.exports=Ga;var a=hp.exports,Eu={},bp={exports:{}},gt={},jp={exports:{}},kp={};/**
|
|
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(E,P){var z=E.length;E.push(P);e:for(;0<z;){var F=z-1>>>1,O=E[F];if(0<s(O,P))E[F]=P,E[z]=O,z=F;else break e}}function n(E){return E.length===0?null:E[0]}function r(E){if(E.length===0)return null;var P=E[0],z=E.pop();if(z!==P){E[0]=z;e:for(var F=0,O=E.length,U=O>>>1;F<U;){var B=2*(F+1)-1,K=E[B],G=B+1,Y=E[G];if(0>s(K,z))G<O&&0>s(Y,K)?(E[F]=Y,E[G]=z,F=G):(E[F]=K,E[B]=z,F=B);else if(G<O&&0>s(Y,z))E[F]=Y,E[G]=z,F=G;else break e}}return P}function s(E,P){var z=E.sortIndex-P.sortIndex;return z!==0?z:E.id-P.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 u=[],c=[],h=1,d=null,f=3,x=!1,y=!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 g(E){for(var P=n(c);P!==null;){if(P.callback===null)r(c);else if(P.startTime<=E)r(c),P.sortIndex=P.expirationTime,t(u,P);else break;P=n(c)}}function S(E){if(w=!1,g(E),!y)if(n(u)!==null)y=!0,M(b);else{var P=n(c);P!==null&&D(S,P.startTime-E)}}function b(E,P){y=!1,w&&(w=!1,p(_),_=-1),x=!0;var z=f;try{for(g(P),d=n(u);d!==null&&(!(d.expirationTime>P)||E&&!R());){var F=d.callback;if(typeof F=="function"){d.callback=null,f=d.priorityLevel;var O=F(d.expirationTime<=P);P=e.unstable_now(),typeof O=="function"?d.callback=O:d===n(u)&&r(u),g(P)}else r(u);d=n(u)}if(d!==null)var U=!0;else{var B=n(c);B!==null&&D(S,B.startTime-P),U=!1}return U}finally{d=null,f=z,x=!1}}var k=!1,j=null,_=-1,I=5,$=-1;function R(){return!(e.unstable_now()-$<I)}function T(){if(j!==null){var E=e.unstable_now();$=E;var P=!0;try{P=j(!0,E)}finally{P?A():(k=!1,j=null)}}else k=!1}var A;if(typeof v=="function")A=function(){v(T)};else if(typeof MessageChannel<"u"){var C=new MessageChannel,L=C.port2;C.port1.onmessage=T,A=function(){L.postMessage(null)}}else A=function(){N(T,0)};function M(E){j=E,k||(k=!0,A())}function D(E,P){_=N(function(){E(e.unstable_now())},P)}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(E){E.callback=null},e.unstable_continueExecution=function(){y||x||(y=!0,M(b))},e.unstable_forceFrameRate=function(E){0>E||125<E?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<E?Math.floor(1e3/E):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(E){switch(f){case 1:case 2:case 3:var P=3;break;default:P=f}var z=f;f=P;try{return E()}finally{f=z}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(E,P){switch(E){case 1:case 2:case 3:case 4:case 5:break;default:E=3}var z=f;f=E;try{return P()}finally{f=z}},e.unstable_scheduleCallback=function(E,P,z){var F=e.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?F+z:F):z=F,E){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=z+O,E={id:h++,callback:P,priorityLevel:E,startTime:z,expirationTime:O,sortIndex:-1},z>F?(E.sortIndex=z,t(c,E),n(u)===null&&E===n(c)&&(w?(p(_),_=-1):w=!0,D(S,z-F))):(E.sortIndex=O,t(u,E),y||x||(y=!0,M(b))),E},e.unstable_shouldYield=R,e.unstable_wrapCallback=function(E){var P=f;return function(){var z=f;f=P;try{return E.apply(this,arguments)}finally{f=z}}}})(kp);jp.exports=kp;var xw=jp.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 yw=m,mt=xw;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 Cp=new Set,po={};function br(e,t){rs(e,t),rs(e+"Capture",t)}function rs(e,t){for(po[e]=t,e=0;e<t.length;e++)Cp.add(t[e])}var fn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_u=Object.prototype.hasOwnProperty,vw=/^[: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]*$/,$f={},Of={};function ww(e){return _u.call(Of,e)?!0:_u.call($f,e)?!1:vw.test(e)?Of[e]=!0:($f[e]=!0,!1)}function Nw(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 Sw(e,t,n,r){if(t===null||typeof t>"u"||Nw(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 et(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 Ve={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ve[e]=new et(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ve[t]=new et(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ve[e]=new et(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ve[e]=new et(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){Ve[e]=new et(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ve[e]=new et(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ve[e]=new et(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ve[e]=new et(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ve[e]=new et(e,5,!1,e.toLowerCase(),null,!1,!1)});var Yc=/[\-:]([a-z])/g;function Xc(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(Yc,Xc);Ve[t]=new et(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(Yc,Xc);Ve[t]=new et(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(Yc,Xc);Ve[t]=new et(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ve[e]=new et(e,1,!1,e.toLowerCase(),null,!1,!1)});Ve.xlinkHref=new et("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ve[e]=new et(e,1,!1,e.toLowerCase(),null,!0,!0)});function Qc(e,t,n,r){var s=Ve.hasOwnProperty(t)?Ve[t]:null;(s!==null?s.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Sw(t,n,s,r)&&(n=null),r||s===null?ww(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 yn=yw.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,ii=Symbol.for("react.element"),Lr=Symbol.for("react.portal"),Ar=Symbol.for("react.fragment"),qc=Symbol.for("react.strict_mode"),Pu=Symbol.for("react.profiler"),Ep=Symbol.for("react.provider"),_p=Symbol.for("react.context"),Zc=Symbol.for("react.forward_ref"),Mu=Symbol.for("react.suspense"),Iu=Symbol.for("react.suspense_list"),Jc=Symbol.for("react.memo"),_n=Symbol.for("react.lazy"),Pp=Symbol.for("react.offscreen"),Ff=Symbol.iterator;function zs(e){return e===null||typeof e!="object"?null:(e=Ff&&e[Ff]||e["@@iterator"],typeof e=="function"?e:null)}var ke=Object.assign,Al;function Qs(e){if(Al===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Al=t&&t[1]||""}return`
|
|
34
|
+
`+Al+e}var zl=!1;function Dl(e,t){if(!e||zl)return"";zl=!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(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var s=c.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 u=`
|
|
37
|
+
`+s[i].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=i&&0<=l);break}}}finally{zl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Qs(e):""}function bw(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=Dl(e.type,!1),e;case 11:return e=Dl(e.type.render,!1),e;case 1:return e=Dl(e.type,!0),e;default:return""}}function Ru(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 Ar:return"Fragment";case Lr:return"Portal";case Pu:return"Profiler";case qc:return"StrictMode";case Mu:return"Suspense";case Iu:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case _p:return(e.displayName||"Context")+".Consumer";case Ep:return(e._context.displayName||"Context")+".Provider";case Zc:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Jc:return t=e.displayName||null,t!==null?t:Ru(e.type)||"Memo";case _n:t=e._payload,e=e._init;try{return Ru(e(t))}catch{}}return null}function jw(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 Ru(t);case 8:return t===qc?"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 Mp(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function kw(e){var t=Mp(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 ai(e){e._valueTracker||(e._valueTracker=kw(e))}function Ip(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Mp(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ia(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 Tu(e,t){var n=t.checked;return ke({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Hf(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 Rp(e,t){t=t.checked,t!=null&&Qc(e,"checked",t,!1)}function Lu(e,t){Rp(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")?Au(e,t.type,n):t.hasOwnProperty("defaultValue")&&Au(e,t.type,Un(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Vf(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 Au(e,t,n){(t!=="number"||ia(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var qs=Array.isArray;function Yr(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 zu(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(H(91));return ke({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Bf(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(qs(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 Tp(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 Uf(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Lp(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 Du(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Lp(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var li,Ap=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(li=li||document.createElement("div"),li.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=li.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function go(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var no={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},Cw=["Webkit","ms","Moz","O"];Object.keys(no).forEach(function(e){Cw.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),no[t]=no[e]})});function zp(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||no.hasOwnProperty(e)&&no[e]?(""+t).trim():t+"px"}function Dp(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=zp(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var Ew=ke({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 $u(e,t){if(t){if(Ew[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 Ou(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 Fu=null;function ed(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Hu=null,Xr=null,Qr=null;function Wf(e){if(e=Wo(e)){if(typeof Hu!="function")throw Error(H(280));var t=e.stateNode;t&&(t=Za(t),Hu(e.stateNode,e.type,t))}}function $p(e){Xr?Qr?Qr.push(e):Qr=[e]:Xr=e}function Op(){if(Xr){var e=Xr,t=Qr;if(Qr=Xr=null,Wf(e),t)for(e=0;e<t.length;e++)Wf(t[e])}}function Fp(e,t){return e(t)}function Hp(){}var $l=!1;function Vp(e,t,n){if($l)return e(t,n);$l=!0;try{return Fp(e,t,n)}finally{$l=!1,(Xr!==null||Qr!==null)&&(Hp(),Op())}}function xo(e,t){var n=e.stateNode;if(n===null)return null;var r=Za(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 Vu=!1;if(fn)try{var Ds={};Object.defineProperty(Ds,"passive",{get:function(){Vu=!0}}),window.addEventListener("test",Ds,Ds),window.removeEventListener("test",Ds,Ds)}catch{Vu=!1}function _w(e,t,n,r,s,o,i,l,u){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(h){this.onError(h)}}var ro=!1,aa=null,la=!1,Bu=null,Pw={onError:function(e){ro=!0,aa=e}};function Mw(e,t,n,r,s,o,i,l,u){ro=!1,aa=null,_w.apply(Pw,arguments)}function Iw(e,t,n,r,s,o,i,l,u){if(Mw.apply(this,arguments),ro){if(ro){var c=aa;ro=!1,aa=null}else throw Error(H(198));la||(la=!0,Bu=c)}}function jr(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 Bp(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 Kf(e){if(jr(e)!==e)throw Error(H(188))}function Rw(e){var t=e.alternate;if(!t){if(t=jr(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 Kf(s),e;if(o===r)return Kf(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 Up(e){return e=Rw(e),e!==null?Wp(e):null}function Wp(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Wp(e);if(t!==null)return t;e=e.sibling}return null}var Kp=mt.unstable_scheduleCallback,Gf=mt.unstable_cancelCallback,Tw=mt.unstable_shouldYield,Lw=mt.unstable_requestPaint,Ee=mt.unstable_now,Aw=mt.unstable_getCurrentPriorityLevel,td=mt.unstable_ImmediatePriority,Gp=mt.unstable_UserBlockingPriority,ua=mt.unstable_NormalPriority,zw=mt.unstable_LowPriority,Yp=mt.unstable_IdlePriority,Ya=null,Gt=null;function Dw(e){if(Gt&&typeof Gt.onCommitFiberRoot=="function")try{Gt.onCommitFiberRoot(Ya,e,void 0,(e.current.flags&128)===128)}catch{}}var Tt=Math.clz32?Math.clz32:Fw,$w=Math.log,Ow=Math.LN2;function Fw(e){return e>>>=0,e===0?32:31-($w(e)/Ow|0)|0}var ui=64,ci=4194304;function Zs(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 ca(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=Zs(l):(o&=i,o!==0&&(r=Zs(o)))}else i=n&~s,i!==0?r=Zs(i):o!==0&&(r=Zs(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-Tt(t),s=1<<n,r|=e[n],t&=~s;return r}function Hw(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 Vw(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,o=e.pendingLanes;0<o;){var i=31-Tt(o),l=1<<i,u=s[i];u===-1?(!(l&n)||l&r)&&(s[i]=Hw(l,t)):u<=t&&(e.expiredLanes|=l),o&=~l}}function Uu(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Xp(){var e=ui;return ui<<=1,!(ui&4194240)&&(ui=64),e}function Ol(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Bo(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Tt(t),e[t]=n}function Bw(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-Tt(n),o=1<<s;t[s]=0,r[s]=-1,e[s]=-1,n&=~o}}function nd(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Tt(n),s=1<<r;s&t|e[r]&t&&(e[r]|=t),n&=~s}}var de=0;function Qp(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var qp,rd,Zp,Jp,eg,Wu=!1,di=[],An=null,zn=null,Dn=null,yo=new Map,vo=new Map,Mn=[],Uw="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 Yf(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":yo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":vo.delete(t.pointerId)}}function $s(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=Wo(t),t!==null&&rd(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function Ww(e,t,n,r,s){switch(t){case"focusin":return An=$s(An,e,t,n,r,s),!0;case"dragenter":return zn=$s(zn,e,t,n,r,s),!0;case"mouseover":return Dn=$s(Dn,e,t,n,r,s),!0;case"pointerover":var o=s.pointerId;return yo.set(o,$s(yo.get(o)||null,e,t,n,r,s)),!0;case"gotpointercapture":return o=s.pointerId,vo.set(o,$s(vo.get(o)||null,e,t,n,r,s)),!0}return!1}function tg(e){var t=nr(e.target);if(t!==null){var n=jr(t);if(n!==null){if(t=n.tag,t===13){if(t=Bp(n),t!==null){e.blockedOn=t,eg(e.priority,function(){Zp(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 Hi(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Ku(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Fu=r,n.target.dispatchEvent(r),Fu=null}else return t=Wo(n),t!==null&&rd(t),e.blockedOn=n,!1;t.shift()}return!0}function Xf(e,t,n){Hi(e)&&n.delete(t)}function Kw(){Wu=!1,An!==null&&Hi(An)&&(An=null),zn!==null&&Hi(zn)&&(zn=null),Dn!==null&&Hi(Dn)&&(Dn=null),yo.forEach(Xf),vo.forEach(Xf)}function Os(e,t){e.blockedOn===t&&(e.blockedOn=null,Wu||(Wu=!0,mt.unstable_scheduleCallback(mt.unstable_NormalPriority,Kw)))}function wo(e){function t(s){return Os(s,e)}if(0<di.length){Os(di[0],e);for(var n=1;n<di.length;n++){var r=di[n];r.blockedOn===e&&(r.blockedOn=null)}}for(An!==null&&Os(An,e),zn!==null&&Os(zn,e),Dn!==null&&Os(Dn,e),yo.forEach(t),vo.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);)tg(n),n.blockedOn===null&&Mn.shift()}var qr=yn.ReactCurrentBatchConfig,da=!0;function Gw(e,t,n,r){var s=de,o=qr.transition;qr.transition=null;try{de=1,sd(e,t,n,r)}finally{de=s,qr.transition=o}}function Yw(e,t,n,r){var s=de,o=qr.transition;qr.transition=null;try{de=4,sd(e,t,n,r)}finally{de=s,qr.transition=o}}function sd(e,t,n,r){if(da){var s=Ku(e,t,n,r);if(s===null)Xl(e,t,r,fa,n),Yf(e,r);else if(Ww(s,e,t,n,r))r.stopPropagation();else if(Yf(e,r),t&4&&-1<Uw.indexOf(e)){for(;s!==null;){var o=Wo(s);if(o!==null&&qp(o),o=Ku(e,t,n,r),o===null&&Xl(e,t,r,fa,n),o===s)break;s=o}s!==null&&r.stopPropagation()}else Xl(e,t,r,null,n)}}var fa=null;function Ku(e,t,n,r){if(fa=null,e=ed(r),e=nr(e),e!==null)if(t=jr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Bp(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 fa=e,null}function ng(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(Aw()){case td:return 1;case Gp:return 4;case ua:case zw:return 16;case Yp:return 536870912;default:return 16}default:return 16}}var Tn=null,od=null,Vi=null;function rg(){if(Vi)return Vi;var e,t=od,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 Bi(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 fi(){return!0}function Qf(){return!1}function xt(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)?fi:Qf,this.isPropagationStopped=Qf,this}return ke(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=fi)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=fi)},persist:function(){},isPersistent:fi}),t}var Ss={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},id=xt(Ss),Uo=ke({},Ss,{view:0,detail:0}),Xw=xt(Uo),Fl,Hl,Fs,Xa=ke({},Uo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ad,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!==Fs&&(Fs&&e.type==="mousemove"?(Fl=e.screenX-Fs.screenX,Hl=e.screenY-Fs.screenY):Hl=Fl=0,Fs=e),Fl)},movementY:function(e){return"movementY"in e?e.movementY:Hl}}),qf=xt(Xa),Qw=ke({},Xa,{dataTransfer:0}),qw=xt(Qw),Zw=ke({},Uo,{relatedTarget:0}),Vl=xt(Zw),Jw=ke({},Ss,{animationName:0,elapsedTime:0,pseudoElement:0}),eN=xt(Jw),tN=ke({},Ss,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),nN=xt(tN),rN=ke({},Ss,{data:0}),Zf=xt(rN),sN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},oN={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"},iN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function aN(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=iN[e])?!!t[e]:!1}function ad(){return aN}var lN=ke({},Uo,{key:function(e){if(e.key){var t=sN[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Bi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?oN[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ad,charCode:function(e){return e.type==="keypress"?Bi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Bi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),uN=xt(lN),cN=ke({},Xa,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Jf=xt(cN),dN=ke({},Uo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ad}),fN=xt(dN),hN=ke({},Ss,{propertyName:0,elapsedTime:0,pseudoElement:0}),mN=xt(hN),pN=ke({},Xa,{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}),gN=xt(pN),xN=[9,13,27,32],ld=fn&&"CompositionEvent"in window,so=null;fn&&"documentMode"in document&&(so=document.documentMode);var yN=fn&&"TextEvent"in window&&!so,sg=fn&&(!ld||so&&8<so&&11>=so),eh=" ",th=!1;function og(e,t){switch(e){case"keyup":return xN.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ig(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var zr=!1;function vN(e,t){switch(e){case"compositionend":return ig(t);case"keypress":return t.which!==32?null:(th=!0,eh);case"textInput":return e=t.data,e===eh&&th?null:e;default:return null}}function wN(e,t){if(zr)return e==="compositionend"||!ld&&og(e,t)?(e=rg(),Vi=od=Tn=null,zr=!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 sg&&t.locale!=="ko"?null:t.data;default:return null}}var NN={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 nh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!NN[e.type]:t==="textarea"}function ag(e,t,n,r){$p(r),t=ha(t,"onChange"),0<t.length&&(n=new id("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var oo=null,No=null;function SN(e){yg(e,0)}function Qa(e){var t=Or(e);if(Ip(t))return e}function bN(e,t){if(e==="change")return t}var lg=!1;if(fn){var Bl;if(fn){var Ul="oninput"in document;if(!Ul){var rh=document.createElement("div");rh.setAttribute("oninput","return;"),Ul=typeof rh.oninput=="function"}Bl=Ul}else Bl=!1;lg=Bl&&(!document.documentMode||9<document.documentMode)}function sh(){oo&&(oo.detachEvent("onpropertychange",ug),No=oo=null)}function ug(e){if(e.propertyName==="value"&&Qa(No)){var t=[];ag(t,No,e,ed(e)),Vp(SN,t)}}function jN(e,t,n){e==="focusin"?(sh(),oo=t,No=n,oo.attachEvent("onpropertychange",ug)):e==="focusout"&&sh()}function kN(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Qa(No)}function CN(e,t){if(e==="click")return Qa(t)}function EN(e,t){if(e==="input"||e==="change")return Qa(t)}function _N(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var At=typeof Object.is=="function"?Object.is:_N;function So(e,t){if(At(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(!_u.call(t,s)||!At(e[s],t[s]))return!1}return!0}function oh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ih(e,t){var n=oh(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=oh(n)}}function cg(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?cg(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function dg(){for(var e=window,t=ia();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ia(e.document)}return t}function ud(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 PN(e){var t=dg(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&cg(n.ownerDocument.documentElement,n)){if(r!==null&&ud(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=ih(n,o);var i=ih(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 MN=fn&&"documentMode"in document&&11>=document.documentMode,Dr=null,Gu=null,io=null,Yu=!1;function ah(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Yu||Dr==null||Dr!==ia(r)||(r=Dr,"selectionStart"in r&&ud(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}),io&&So(io,r)||(io=r,r=ha(Gu,"onSelect"),0<r.length&&(t=new id("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Dr)))}function hi(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var $r={animationend:hi("Animation","AnimationEnd"),animationiteration:hi("Animation","AnimationIteration"),animationstart:hi("Animation","AnimationStart"),transitionend:hi("Transition","TransitionEnd")},Wl={},fg={};fn&&(fg=document.createElement("div").style,"AnimationEvent"in window||(delete $r.animationend.animation,delete $r.animationiteration.animation,delete $r.animationstart.animation),"TransitionEvent"in window||delete $r.transitionend.transition);function qa(e){if(Wl[e])return Wl[e];if(!$r[e])return e;var t=$r[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in fg)return Wl[e]=t[n];return e}var hg=qa("animationend"),mg=qa("animationiteration"),pg=qa("animationstart"),gg=qa("transitionend"),xg=new Map,lh="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 Xn(e,t){xg.set(e,t),br(t,[e])}for(var Kl=0;Kl<lh.length;Kl++){var Gl=lh[Kl],IN=Gl.toLowerCase(),RN=Gl[0].toUpperCase()+Gl.slice(1);Xn(IN,"on"+RN)}Xn(hg,"onAnimationEnd");Xn(mg,"onAnimationIteration");Xn(pg,"onAnimationStart");Xn("dblclick","onDoubleClick");Xn("focusin","onFocus");Xn("focusout","onBlur");Xn(gg,"onTransitionEnd");rs("onMouseEnter",["mouseout","mouseover"]);rs("onMouseLeave",["mouseout","mouseover"]);rs("onPointerEnter",["pointerout","pointerover"]);rs("onPointerLeave",["pointerout","pointerover"]);br("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));br("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));br("onBeforeInput",["compositionend","keypress","textInput","paste"]);br("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));br("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));br("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Js="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(" "),TN=new Set("cancel close invalid load scroll toggle".split(" ").concat(Js));function uh(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,Iw(r,t,void 0,e),e.currentTarget=null}function yg(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],u=l.instance,c=l.currentTarget;if(l=l.listener,u!==o&&s.isPropagationStopped())break e;uh(s,l,c),o=u}else for(i=0;i<r.length;i++){if(l=r[i],u=l.instance,c=l.currentTarget,l=l.listener,u!==o&&s.isPropagationStopped())break e;uh(s,l,c),o=u}}}if(la)throw e=Bu,la=!1,Bu=null,e}function pe(e,t){var n=t[Ju];n===void 0&&(n=t[Ju]=new Set);var r=e+"__bubble";n.has(r)||(vg(t,e,2,!1),n.add(r))}function Yl(e,t,n){var r=0;t&&(r|=4),vg(n,e,r,t)}var mi="_reactListening"+Math.random().toString(36).slice(2);function bo(e){if(!e[mi]){e[mi]=!0,Cp.forEach(function(n){n!=="selectionchange"&&(TN.has(n)||Yl(n,!1,e),Yl(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[mi]||(t[mi]=!0,Yl("selectionchange",!1,t))}}function vg(e,t,n,r){switch(ng(t)){case 1:var s=Gw;break;case 4:s=Yw;break;default:s=sd}n=s.bind(null,t,n,e),s=void 0,!Vu||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 Xl(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 u=i.tag;if((u===3||u===4)&&(u=i.stateNode.containerInfo,u===s||u.nodeType===8&&u.parentNode===s))return;i=i.return}for(;l!==null;){if(i=nr(l),i===null)return;if(u=i.tag,u===5||u===6){r=o=i;continue e}l=l.parentNode}}r=r.return}Vp(function(){var c=o,h=ed(n),d=[];e:{var f=xg.get(e);if(f!==void 0){var x=id,y=e;switch(e){case"keypress":if(Bi(n)===0)break e;case"keydown":case"keyup":x=uN;break;case"focusin":y="focus",x=Vl;break;case"focusout":y="blur",x=Vl;break;case"beforeblur":case"afterblur":x=Vl;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":x=qf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":x=qw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":x=fN;break;case hg:case mg:case pg:x=eN;break;case gg:x=mN;break;case"scroll":x=Xw;break;case"wheel":x=gN;break;case"copy":case"cut":case"paste":x=nN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":x=Jf}var w=(t&4)!==0,N=!w&&e==="scroll",p=w?f!==null?f+"Capture":null:f;w=[];for(var v=c,g;v!==null;){g=v;var S=g.stateNode;if(g.tag===5&&S!==null&&(g=S,p!==null&&(S=xo(v,p),S!=null&&w.push(jo(v,S,g)))),N)break;v=v.return}0<w.length&&(f=new x(f,y,null,n,h),d.push({event:f,listeners:w}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",x=e==="mouseout"||e==="pointerout",f&&n!==Fu&&(y=n.relatedTarget||n.fromElement)&&(nr(y)||y[hn]))break e;if((x||f)&&(f=h.window===h?h:(f=h.ownerDocument)?f.defaultView||f.parentWindow:window,x?(y=n.relatedTarget||n.toElement,x=c,y=y?nr(y):null,y!==null&&(N=jr(y),y!==N||y.tag!==5&&y.tag!==6)&&(y=null)):(x=null,y=c),x!==y)){if(w=qf,S="onMouseLeave",p="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(w=Jf,S="onPointerLeave",p="onPointerEnter",v="pointer"),N=x==null?f:Or(x),g=y==null?f:Or(y),f=new w(S,v+"leave",x,n,h),f.target=N,f.relatedTarget=g,S=null,nr(h)===c&&(w=new w(p,v+"enter",y,n,h),w.target=g,w.relatedTarget=N,S=w),N=S,x&&y)t:{for(w=x,p=y,v=0,g=w;g;g=Pr(g))v++;for(g=0,S=p;S;S=Pr(S))g++;for(;0<v-g;)w=Pr(w),v--;for(;0<g-v;)p=Pr(p),g--;for(;v--;){if(w===p||p!==null&&w===p.alternate)break t;w=Pr(w),p=Pr(p)}w=null}else w=null;x!==null&&ch(d,f,x,w,!1),y!==null&&N!==null&&ch(d,N,y,w,!0)}}e:{if(f=c?Or(c):window,x=f.nodeName&&f.nodeName.toLowerCase(),x==="select"||x==="input"&&f.type==="file")var b=bN;else if(nh(f))if(lg)b=EN;else{b=kN;var k=jN}else(x=f.nodeName)&&x.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(b=CN);if(b&&(b=b(e,c))){ag(d,b,n,h);break e}k&&k(e,f,c),e==="focusout"&&(k=f._wrapperState)&&k.controlled&&f.type==="number"&&Au(f,"number",f.value)}switch(k=c?Or(c):window,e){case"focusin":(nh(k)||k.contentEditable==="true")&&(Dr=k,Gu=c,io=null);break;case"focusout":io=Gu=Dr=null;break;case"mousedown":Yu=!0;break;case"contextmenu":case"mouseup":case"dragend":Yu=!1,ah(d,n,h);break;case"selectionchange":if(MN)break;case"keydown":case"keyup":ah(d,n,h)}var j;if(ld)e:{switch(e){case"compositionstart":var _="onCompositionStart";break e;case"compositionend":_="onCompositionEnd";break e;case"compositionupdate":_="onCompositionUpdate";break e}_=void 0}else zr?og(e,n)&&(_="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(_="onCompositionStart");_&&(sg&&n.locale!=="ko"&&(zr||_!=="onCompositionStart"?_==="onCompositionEnd"&&zr&&(j=rg()):(Tn=h,od="value"in Tn?Tn.value:Tn.textContent,zr=!0)),k=ha(c,_),0<k.length&&(_=new Zf(_,e,null,n,h),d.push({event:_,listeners:k}),j?_.data=j:(j=ig(n),j!==null&&(_.data=j)))),(j=yN?vN(e,n):wN(e,n))&&(c=ha(c,"onBeforeInput"),0<c.length&&(h=new Zf("onBeforeInput","beforeinput",null,n,h),d.push({event:h,listeners:c}),h.data=j))}yg(d,t)})}function jo(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ha(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,o=s.stateNode;s.tag===5&&o!==null&&(s=o,o=xo(e,n),o!=null&&r.unshift(jo(e,o,s)),o=xo(e,t),o!=null&&r.push(jo(e,o,s))),e=e.return}return r}function Pr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function ch(e,t,n,r,s){for(var o=t._reactName,i=[];n!==null&&n!==r;){var l=n,u=l.alternate,c=l.stateNode;if(u!==null&&u===r)break;l.tag===5&&c!==null&&(l=c,s?(u=xo(n,o),u!=null&&i.unshift(jo(n,u,l))):s||(u=xo(n,o),u!=null&&i.push(jo(n,u,l)))),n=n.return}i.length!==0&&e.push({event:t,listeners:i})}var LN=/\r\n?/g,AN=/\u0000|\uFFFD/g;function dh(e){return(typeof e=="string"?e:""+e).replace(LN,`
|
|
38
|
+
`).replace(AN,"")}function pi(e,t,n){if(t=dh(t),dh(e)!==t&&n)throw Error(H(425))}function ma(){}var Xu=null,Qu=null;function qu(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 Zu=typeof setTimeout=="function"?setTimeout:void 0,zN=typeof clearTimeout=="function"?clearTimeout:void 0,fh=typeof Promise=="function"?Promise:void 0,DN=typeof queueMicrotask=="function"?queueMicrotask:typeof fh<"u"?function(e){return fh.resolve(null).then(e).catch($N)}:Zu;function $N(e){setTimeout(function(){throw e})}function Ql(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),wo(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);wo(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 hh(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 bs=Math.random().toString(36).slice(2),Wt="__reactFiber$"+bs,ko="__reactProps$"+bs,hn="__reactContainer$"+bs,Ju="__reactEvents$"+bs,ON="__reactListeners$"+bs,FN="__reactHandles$"+bs;function nr(e){var t=e[Wt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[hn]||n[Wt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=hh(e);e!==null;){if(n=e[Wt])return n;e=hh(e)}return t}e=n,n=e.parentNode}return null}function Wo(e){return e=e[Wt]||e[hn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Or(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(H(33))}function Za(e){return e[ko]||null}var ec=[],Fr=-1;function Qn(e){return{current:e}}function ge(e){0>Fr||(e.current=ec[Fr],ec[Fr]=null,Fr--)}function fe(e,t){Fr++,ec[Fr]=e.current,e.current=t}var Wn={},Xe=Qn(Wn),at=Qn(!1),dr=Wn;function ss(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 pa(){ge(at),ge(Xe)}function mh(e,t,n){if(Xe.current!==Wn)throw Error(H(168));fe(Xe,t),fe(at,n)}function wg(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,jw(e)||"Unknown",s));return ke({},n,r)}function ga(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Wn,dr=Xe.current,fe(Xe,e),fe(at,at.current),!0}function ph(e,t,n){var r=e.stateNode;if(!r)throw Error(H(169));n?(e=wg(e,t,dr),r.__reactInternalMemoizedMergedChildContext=e,ge(at),ge(Xe),fe(Xe,e)):ge(at),fe(at,n)}var on=null,Ja=!1,ql=!1;function Ng(e){on===null?on=[e]:on.push(e)}function HN(e){Ja=!0,Ng(e)}function qn(){if(!ql&&on!==null){ql=!0;var e=0,t=de;try{var n=on;for(de=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}on=null,Ja=!1}catch(s){throw on!==null&&(on=on.slice(e+1)),Kp(td,qn),s}finally{de=t,ql=!1}}return null}var Hr=[],Vr=0,xa=null,ya=0,yt=[],vt=0,fr=null,an=1,ln="";function Jn(e,t){Hr[Vr++]=ya,Hr[Vr++]=xa,xa=e,ya=t}function Sg(e,t,n){yt[vt++]=an,yt[vt++]=ln,yt[vt++]=fr,fr=e;var r=an;e=ln;var s=32-Tt(r)-1;r&=~(1<<s),n+=1;var o=32-Tt(t)+s;if(30<o){var i=s-s%5;o=(r&(1<<i)-1).toString(32),r>>=i,s-=i,an=1<<32-Tt(t)+s|n<<s|r,ln=o+e}else an=1<<o|n<<s|r,ln=e}function cd(e){e.return!==null&&(Jn(e,1),Sg(e,1,0))}function dd(e){for(;e===xa;)xa=Hr[--Vr],Hr[Vr]=null,ya=Hr[--Vr],Hr[Vr]=null;for(;e===fr;)fr=yt[--vt],yt[vt]=null,ln=yt[--vt],yt[vt]=null,an=yt[--vt],yt[vt]=null}var ht=null,ft=null,xe=!1,Pt=null;function bg(e,t){var n=wt(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 gh(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=fr!==null?{id:an,overflow:ln}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=wt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,ht=e,ft=null,!0):!1;default:return!1}}function tc(e){return(e.mode&1)!==0&&(e.flags&128)===0}function nc(e){if(xe){var t=ft;if(t){var n=t;if(!gh(e,t)){if(tc(e))throw Error(H(418));t=$n(n.nextSibling);var r=ht;t&&gh(e,t)?bg(r,n):(e.flags=e.flags&-4097|2,xe=!1,ht=e)}}else{if(tc(e))throw Error(H(418));e.flags=e.flags&-4097|2,xe=!1,ht=e}}}function xh(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;ht=e}function gi(e){if(e!==ht)return!1;if(!xe)return xh(e),xe=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!qu(e.type,e.memoizedProps)),t&&(t=ft)){if(tc(e))throw jg(),Error(H(418));for(;t;)bg(e,t),t=$n(t.nextSibling)}if(xh(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 jg(){for(var e=ft;e;)e=$n(e.nextSibling)}function os(){ft=ht=null,xe=!1}function fd(e){Pt===null?Pt=[e]:Pt.push(e)}var VN=yn.ReactCurrentBatchConfig;function Hs(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 xi(e,t){throw e=Object.prototype.toString.call(t),Error(H(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function yh(e){var t=e._init;return t(e._payload)}function kg(e){function t(p,v){if(e){var g=p.deletions;g===null?(p.deletions=[v],p.flags|=16):g.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=Vn(p,v),p.index=0,p.sibling=null,p}function o(p,v,g){return p.index=g,e?(g=p.alternate,g!==null?(g=g.index,g<v?(p.flags|=2,v):g):(p.flags|=2,v)):(p.flags|=1048576,v)}function i(p){return e&&p.alternate===null&&(p.flags|=2),p}function l(p,v,g,S){return v===null||v.tag!==6?(v=su(g,p.mode,S),v.return=p,v):(v=s(v,g),v.return=p,v)}function u(p,v,g,S){var b=g.type;return b===Ar?h(p,v,g.props.children,S,g.key):v!==null&&(v.elementType===b||typeof b=="object"&&b!==null&&b.$$typeof===_n&&yh(b)===v.type)?(S=s(v,g.props),S.ref=Hs(p,v,g),S.return=p,S):(S=Qi(g.type,g.key,g.props,null,p.mode,S),S.ref=Hs(p,v,g),S.return=p,S)}function c(p,v,g,S){return v===null||v.tag!==4||v.stateNode.containerInfo!==g.containerInfo||v.stateNode.implementation!==g.implementation?(v=ou(g,p.mode,S),v.return=p,v):(v=s(v,g.children||[]),v.return=p,v)}function h(p,v,g,S,b){return v===null||v.tag!==7?(v=lr(g,p.mode,S,b),v.return=p,v):(v=s(v,g),v.return=p,v)}function d(p,v,g){if(typeof v=="string"&&v!==""||typeof v=="number")return v=su(""+v,p.mode,g),v.return=p,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case ii:return g=Qi(v.type,v.key,v.props,null,p.mode,g),g.ref=Hs(p,null,v),g.return=p,g;case Lr:return v=ou(v,p.mode,g),v.return=p,v;case _n:var S=v._init;return d(p,S(v._payload),g)}if(qs(v)||zs(v))return v=lr(v,p.mode,g,null),v.return=p,v;xi(p,v)}return null}function f(p,v,g,S){var b=v!==null?v.key:null;if(typeof g=="string"&&g!==""||typeof g=="number")return b!==null?null:l(p,v,""+g,S);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case ii:return g.key===b?u(p,v,g,S):null;case Lr:return g.key===b?c(p,v,g,S):null;case _n:return b=g._init,f(p,v,b(g._payload),S)}if(qs(g)||zs(g))return b!==null?null:h(p,v,g,S,null);xi(p,g)}return null}function x(p,v,g,S,b){if(typeof S=="string"&&S!==""||typeof S=="number")return p=p.get(g)||null,l(v,p,""+S,b);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case ii:return p=p.get(S.key===null?g:S.key)||null,u(v,p,S,b);case Lr:return p=p.get(S.key===null?g:S.key)||null,c(v,p,S,b);case _n:var k=S._init;return x(p,v,g,k(S._payload),b)}if(qs(S)||zs(S))return p=p.get(g)||null,h(v,p,S,b,null);xi(v,S)}return null}function y(p,v,g,S){for(var b=null,k=null,j=v,_=v=0,I=null;j!==null&&_<g.length;_++){j.index>_?(I=j,j=null):I=j.sibling;var $=f(p,j,g[_],S);if($===null){j===null&&(j=I);break}e&&j&&$.alternate===null&&t(p,j),v=o($,v,_),k===null?b=$:k.sibling=$,k=$,j=I}if(_===g.length)return n(p,j),xe&&Jn(p,_),b;if(j===null){for(;_<g.length;_++)j=d(p,g[_],S),j!==null&&(v=o(j,v,_),k===null?b=j:k.sibling=j,k=j);return xe&&Jn(p,_),b}for(j=r(p,j);_<g.length;_++)I=x(j,p,_,g[_],S),I!==null&&(e&&I.alternate!==null&&j.delete(I.key===null?_:I.key),v=o(I,v,_),k===null?b=I:k.sibling=I,k=I);return e&&j.forEach(function(R){return t(p,R)}),xe&&Jn(p,_),b}function w(p,v,g,S){var b=zs(g);if(typeof b!="function")throw Error(H(150));if(g=b.call(g),g==null)throw Error(H(151));for(var k=b=null,j=v,_=v=0,I=null,$=g.next();j!==null&&!$.done;_++,$=g.next()){j.index>_?(I=j,j=null):I=j.sibling;var R=f(p,j,$.value,S);if(R===null){j===null&&(j=I);break}e&&j&&R.alternate===null&&t(p,j),v=o(R,v,_),k===null?b=R:k.sibling=R,k=R,j=I}if($.done)return n(p,j),xe&&Jn(p,_),b;if(j===null){for(;!$.done;_++,$=g.next())$=d(p,$.value,S),$!==null&&(v=o($,v,_),k===null?b=$:k.sibling=$,k=$);return xe&&Jn(p,_),b}for(j=r(p,j);!$.done;_++,$=g.next())$=x(j,p,_,$.value,S),$!==null&&(e&&$.alternate!==null&&j.delete($.key===null?_:$.key),v=o($,v,_),k===null?b=$:k.sibling=$,k=$);return e&&j.forEach(function(T){return t(p,T)}),xe&&Jn(p,_),b}function N(p,v,g,S){if(typeof g=="object"&&g!==null&&g.type===Ar&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case ii:e:{for(var b=g.key,k=v;k!==null;){if(k.key===b){if(b=g.type,b===Ar){if(k.tag===7){n(p,k.sibling),v=s(k,g.props.children),v.return=p,p=v;break e}}else if(k.elementType===b||typeof b=="object"&&b!==null&&b.$$typeof===_n&&yh(b)===k.type){n(p,k.sibling),v=s(k,g.props),v.ref=Hs(p,k,g),v.return=p,p=v;break e}n(p,k);break}else t(p,k);k=k.sibling}g.type===Ar?(v=lr(g.props.children,p.mode,S,g.key),v.return=p,p=v):(S=Qi(g.type,g.key,g.props,null,p.mode,S),S.ref=Hs(p,v,g),S.return=p,p=S)}return i(p);case Lr:e:{for(k=g.key;v!==null;){if(v.key===k)if(v.tag===4&&v.stateNode.containerInfo===g.containerInfo&&v.stateNode.implementation===g.implementation){n(p,v.sibling),v=s(v,g.children||[]),v.return=p,p=v;break e}else{n(p,v);break}else t(p,v);v=v.sibling}v=ou(g,p.mode,S),v.return=p,p=v}return i(p);case _n:return k=g._init,N(p,v,k(g._payload),S)}if(qs(g))return y(p,v,g,S);if(zs(g))return w(p,v,g,S);xi(p,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,v!==null&&v.tag===6?(n(p,v.sibling),v=s(v,g),v.return=p,p=v):(n(p,v),v=su(g,p.mode,S),v.return=p,p=v),i(p)):n(p,v)}return N}var is=kg(!0),Cg=kg(!1),va=Qn(null),wa=null,Br=null,hd=null;function md(){hd=Br=wa=null}function pd(e){var t=va.current;ge(va),e._currentValue=t}function rc(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 Zr(e,t){wa=e,hd=Br=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(hd!==e)if(e={context:e,memoizedValue:t,next:null},Br===null){if(wa===null)throw Error(H(308));Br=e,wa.dependencies={lanes:0,firstContext:e}}else Br=Br.next=e;return t}var rr=null;function gd(e){rr===null?rr=[e]:rr.push(e)}function Eg(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,gd(t)):(n.next=s.next,s.next=n),t.interleaved=n,mn(e,r)}function mn(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 xd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function _g(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 cn(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,mn(e,n)}return s=r.interleaved,s===null?(t.next=t,gd(r)):(t.next=s.next,s.next=t),r.interleaved=t,mn(e,n)}function Ui(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,nd(e,n)}}function vh(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 Na(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 u=l,c=u.next;u.next=null,i===null?o=c:i.next=c,i=u;var h=e.alternate;h!==null&&(h=h.updateQueue,l=h.lastBaseUpdate,l!==i&&(l===null?h.firstBaseUpdate=c:l.next=c,h.lastBaseUpdate=u))}if(o!==null){var d=s.baseState;i=0,h=c=u=null,l=o;do{var f=l.lane,x=l.eventTime;if((r&f)===f){h!==null&&(h=h.next={eventTime:x,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var y=e,w=l;switch(f=t,x=n,w.tag){case 1:if(y=w.payload,typeof y=="function"){d=y.call(x,d,f);break e}d=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=w.payload,f=typeof y=="function"?y.call(x,d,f):y,f==null)break e;d=ke({},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 x={eventTime:x,lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},h===null?(c=h=x,u=d):h=h.next=x,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&&(u=d),s.baseState=u,s.firstBaseUpdate=c,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);mr|=i,e.lanes=i,e.memoizedState=d}}function wh(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 Ko={},Yt=Qn(Ko),Co=Qn(Ko),Eo=Qn(Ko);function sr(e){if(e===Ko)throw Error(H(174));return e}function yd(e,t){switch(fe(Eo,t),fe(Co,e),fe(Yt,Ko),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Du(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Du(t,e)}ge(Yt),fe(Yt,t)}function as(){ge(Yt),ge(Co),ge(Eo)}function Pg(e){sr(Eo.current);var t=sr(Yt.current),n=Du(t,e.type);t!==n&&(fe(Co,e),fe(Yt,n))}function vd(e){Co.current===e&&(ge(Yt),ge(Co))}var Se=Qn(0);function Sa(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 Zl=[];function wd(){for(var e=0;e<Zl.length;e++)Zl[e]._workInProgressVersionPrimary=null;Zl.length=0}var Wi=yn.ReactCurrentDispatcher,Jl=yn.ReactCurrentBatchConfig,hr=0,je=null,Re=null,De=null,ba=!1,ao=!1,_o=0,BN=0;function Ue(){throw Error(H(321))}function Nd(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!At(e[n],t[n]))return!1;return!0}function Sd(e,t,n,r,s,o){if(hr=o,je=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Wi.current=e===null||e.memoizedState===null?GN:YN,e=n(r,s),ao){o=0;do{if(ao=!1,_o=0,25<=o)throw Error(H(301));o+=1,De=Re=null,t.updateQueue=null,Wi.current=XN,e=n(r,s)}while(ao)}if(Wi.current=ja,t=Re!==null&&Re.next!==null,hr=0,De=Re=je=null,ba=!1,t)throw Error(H(300));return e}function bd(){var e=_o!==0;return _o=0,e}function Vt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return De===null?je.memoizedState=De=e:De=De.next=e,De}function bt(){if(Re===null){var e=je.alternate;e=e!==null?e.memoizedState:null}else e=Re.next;var t=De===null?je.memoizedState:De.next;if(t!==null)De=t,Re=e;else{if(e===null)throw Error(H(310));Re=e,e={memoizedState:Re.memoizedState,baseState:Re.baseState,baseQueue:Re.baseQueue,queue:Re.queue,next:null},De===null?je.memoizedState=De=e:De=De.next=e}return De}function Po(e,t){return typeof t=="function"?t(e):t}function eu(e){var t=bt(),n=t.queue;if(n===null)throw Error(H(311));n.lastRenderedReducer=e;var r=Re,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,u=null,c=o;do{var h=c.lane;if((hr&h)===h)u!==null&&(u=u.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var d={lane:h,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};u===null?(l=u=d,i=r):u=u.next=d,je.lanes|=h,mr|=h}c=c.next}while(c!==null&&c!==o);u===null?i=r:u.next=l,At(r,t.memoizedState)||(ot=!0),t.memoizedState=r,t.baseState=i,t.baseQueue=u,n.lastRenderedState=r}if(e=n.interleaved,e!==null){s=e;do o=s.lane,je.lanes|=o,mr|=o,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function tu(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);At(o,t.memoizedState)||(ot=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Mg(){}function Ig(e,t){var n=je,r=bt(),s=t(),o=!At(r.memoizedState,s);if(o&&(r.memoizedState=s,ot=!0),r=r.queue,jd(Lg.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||De!==null&&De.memoizedState.tag&1){if(n.flags|=2048,Mo(9,Tg.bind(null,n,r,s,t),void 0,null),$e===null)throw Error(H(349));hr&30||Rg(n,t,s)}return s}function Rg(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=je.updateQueue,t===null?(t={lastEffect:null,stores:null},je.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Tg(e,t,n,r){t.value=n,t.getSnapshot=r,Ag(t)&&zg(e)}function Lg(e,t,n){return n(function(){Ag(t)&&zg(e)})}function Ag(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!At(e,n)}catch{return!0}}function zg(e){var t=mn(e,1);t!==null&&Lt(t,e,1,-1)}function Nh(e){var t=Vt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Po,lastRenderedState:e},t.queue=e,e=e.dispatch=KN.bind(null,je,e),[t.memoizedState,e]}function Mo(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=je.updateQueue,t===null?(t={lastEffect:null,stores:null},je.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 Dg(){return bt().memoizedState}function Ki(e,t,n,r){var s=Vt();je.flags|=e,s.memoizedState=Mo(1|t,n,void 0,r===void 0?null:r)}function el(e,t,n,r){var s=bt();r=r===void 0?null:r;var o=void 0;if(Re!==null){var i=Re.memoizedState;if(o=i.destroy,r!==null&&Nd(r,i.deps)){s.memoizedState=Mo(t,n,o,r);return}}je.flags|=e,s.memoizedState=Mo(1|t,n,o,r)}function Sh(e,t){return Ki(8390656,8,e,t)}function jd(e,t){return el(2048,8,e,t)}function $g(e,t){return el(4,2,e,t)}function Og(e,t){return el(4,4,e,t)}function Fg(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 Hg(e,t,n){return n=n!=null?n.concat([e]):null,el(4,4,Fg.bind(null,t,e),n)}function kd(){}function Vg(e,t){var n=bt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Nd(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Bg(e,t){var n=bt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Nd(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Ug(e,t,n){return hr&21?(At(n,t)||(n=Xp(),je.lanes|=n,mr|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,ot=!0),e.memoizedState=n)}function UN(e,t){var n=de;de=n!==0&&4>n?n:4,e(!0);var r=Jl.transition;Jl.transition={};try{e(!1),t()}finally{de=n,Jl.transition=r}}function Wg(){return bt().memoizedState}function WN(e,t,n){var r=Hn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Kg(e))Gg(t,n);else if(n=Eg(e,t,n,r),n!==null){var s=qe();Lt(n,e,r,s),Yg(n,t,r)}}function KN(e,t,n){var r=Hn(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Kg(e))Gg(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,At(l,i)){var u=t.interleaved;u===null?(s.next=s,gd(t)):(s.next=u.next,u.next=s),t.interleaved=s;return}}catch{}finally{}n=Eg(e,t,s,r),n!==null&&(s=qe(),Lt(n,e,r,s),Yg(n,t,r))}}function Kg(e){var t=e.alternate;return e===je||t!==null&&t===je}function Gg(e,t){ao=ba=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Yg(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,nd(e,n)}}var ja={readContext:St,useCallback:Ue,useContext:Ue,useEffect:Ue,useImperativeHandle:Ue,useInsertionEffect:Ue,useLayoutEffect:Ue,useMemo:Ue,useReducer:Ue,useRef:Ue,useState:Ue,useDebugValue:Ue,useDeferredValue:Ue,useTransition:Ue,useMutableSource:Ue,useSyncExternalStore:Ue,useId:Ue,unstable_isNewReconciler:!1},GN={readContext:St,useCallback:function(e,t){return Vt().memoizedState=[e,t===void 0?null:t],e},useContext:St,useEffect:Sh,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Ki(4194308,4,Fg.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ki(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ki(4,2,e,t)},useMemo:function(e,t){var n=Vt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Vt();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=WN.bind(null,je,e),[r.memoizedState,e]},useRef:function(e){var t=Vt();return e={current:e},t.memoizedState=e},useState:Nh,useDebugValue:kd,useDeferredValue:function(e){return Vt().memoizedState=e},useTransition:function(){var e=Nh(!1),t=e[0];return e=UN.bind(null,e[1]),Vt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=je,s=Vt();if(xe){if(n===void 0)throw Error(H(407));n=n()}else{if(n=t(),$e===null)throw Error(H(349));hr&30||Rg(r,t,n)}s.memoizedState=n;var o={value:n,getSnapshot:t};return s.queue=o,Sh(Lg.bind(null,r,o,e),[e]),r.flags|=2048,Mo(9,Tg.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Vt(),t=$e.identifierPrefix;if(xe){var n=ln,r=an;n=(r&~(1<<32-Tt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=_o++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=BN++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},YN={readContext:St,useCallback:Vg,useContext:St,useEffect:jd,useImperativeHandle:Hg,useInsertionEffect:$g,useLayoutEffect:Og,useMemo:Bg,useReducer:eu,useRef:Dg,useState:function(){return eu(Po)},useDebugValue:kd,useDeferredValue:function(e){var t=bt();return Ug(t,Re.memoizedState,e)},useTransition:function(){var e=eu(Po)[0],t=bt().memoizedState;return[e,t]},useMutableSource:Mg,useSyncExternalStore:Ig,useId:Wg,unstable_isNewReconciler:!1},XN={readContext:St,useCallback:Vg,useContext:St,useEffect:jd,useImperativeHandle:Hg,useInsertionEffect:$g,useLayoutEffect:Og,useMemo:Bg,useReducer:tu,useRef:Dg,useState:function(){return tu(Po)},useDebugValue:kd,useDeferredValue:function(e){var t=bt();return Re===null?t.memoizedState=e:Ug(t,Re.memoizedState,e)},useTransition:function(){var e=tu(Po)[0],t=bt().memoizedState;return[e,t]},useMutableSource:Mg,useSyncExternalStore:Ig,useId:Wg,unstable_isNewReconciler:!1};function Ct(e,t){if(e&&e.defaultProps){t=ke({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function sc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:ke({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var tl={isMounted:function(e){return(e=e._reactInternals)?jr(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=qe(),s=Hn(e),o=cn(r,s);o.payload=t,n!=null&&(o.callback=n),t=On(e,o,s),t!==null&&(Lt(t,e,s,r),Ui(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=qe(),s=Hn(e),o=cn(r,s);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=On(e,o,s),t!==null&&(Lt(t,e,s,r),Ui(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=qe(),r=Hn(e),s=cn(n,r);s.tag=2,t!=null&&(s.callback=t),t=On(e,s,r),t!==null&&(Lt(t,e,r,n),Ui(t,e,r))}};function bh(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 Xg(e,t,n){var r=!1,s=Wn,o=t.contextType;return typeof o=="object"&&o!==null?o=St(o):(s=lt(t)?dr:Xe.current,r=t.contextTypes,o=(r=r!=null)?ss(e,s):Wn),t=new t(n,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=tl,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=o),t}function jh(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&&tl.enqueueReplaceState(t,t.state,null)}function oc(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},xd(e);var o=t.contextType;typeof o=="object"&&o!==null?s.context=St(o):(o=lt(t)?dr:Xe.current,s.context=ss(e,o)),s.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(sc(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&&tl.enqueueReplaceState(s,s.state,null),Na(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function ls(e,t){try{var n="",r=t;do n+=bw(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 nu(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function ic(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var QN=typeof WeakMap=="function"?WeakMap:Map;function Qg(e,t,n){n=cn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Ca||(Ca=!0,gc=r),ic(e,t)},n}function qg(e,t,n){n=cn(-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(){ic(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){ic(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 kh(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new QN;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=c2.bind(null,e,t,n),t.then(e,e))}function Ch(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 Eh(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=cn(-1,1),t.tag=2,On(n,t,1))),n.lanes|=1),e)}var qN=yn.ReactCurrentOwner,ot=!1;function Qe(e,t,n,r){t.child=e===null?Cg(t,null,n,r):is(t,e.child,n,r)}function _h(e,t,n,r,s){n=n.render;var o=t.ref;return Zr(t,s),r=Sd(e,t,n,r,o,s),n=bd(),e!==null&&!ot?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,pn(e,t,s)):(xe&&n&&cd(t),t.flags|=1,Qe(e,t,r,s),t.child)}function Ph(e,t,n,r,s){if(e===null){var o=n.type;return typeof o=="function"&&!Td(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,Zg(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 pn(e,t,s)}return t.flags|=1,e=Vn(o,r),e.ref=t.ref,e.return=t,t.child=e}function Zg(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,pn(e,t,s)}return ac(e,t,n,r,s)}function Jg(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},fe(Wr,ct),ct|=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,fe(Wr,ct),ct|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,fe(Wr,ct),ct|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,fe(Wr,ct),ct|=r;return Qe(e,t,s,n),t.child}function ex(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function ac(e,t,n,r,s){var o=lt(n)?dr:Xe.current;return o=ss(t,o),Zr(t,s),n=Sd(e,t,n,r,o,s),r=bd(),e!==null&&!ot?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,pn(e,t,s)):(xe&&r&&cd(t),t.flags|=1,Qe(e,t,n,s),t.child)}function Mh(e,t,n,r,s){if(lt(n)){var o=!0;ga(t)}else o=!1;if(Zr(t,s),t.stateNode===null)Gi(e,t),Xg(t,n,r),oc(t,n,r,s),r=!0;else if(e===null){var i=t.stateNode,l=t.memoizedProps;i.props=l;var u=i.context,c=n.contextType;typeof c=="object"&&c!==null?c=St(c):(c=lt(n)?dr:Xe.current,c=ss(t,c));var h=n.getDerivedStateFromProps,d=typeof h=="function"||typeof i.getSnapshotBeforeUpdate=="function";d||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l!==r||u!==c)&&jh(t,i,r,c),Pn=!1;var f=t.memoizedState;i.state=f,Na(t,r,i,s),u=t.memoizedState,l!==r||f!==u||at.current||Pn?(typeof h=="function"&&(sc(t,n,h,r),u=t.memoizedState),(l=Pn||bh(t,n,l,r,f,u,c))?(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=u),i.props=r,i.state=u,i.context=c,r=l):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,_g(e,t),l=t.memoizedProps,c=t.type===t.elementType?l:Ct(t.type,l),i.props=c,d=t.pendingProps,f=i.context,u=n.contextType,typeof u=="object"&&u!==null?u=St(u):(u=lt(n)?dr:Xe.current,u=ss(t,u));var x=n.getDerivedStateFromProps;(h=typeof x=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l!==d||f!==u)&&jh(t,i,r,u),Pn=!1,f=t.memoizedState,i.state=f,Na(t,r,i,s);var y=t.memoizedState;l!==d||f!==y||at.current||Pn?(typeof x=="function"&&(sc(t,n,x,r),y=t.memoizedState),(c=Pn||bh(t,n,c,r,f,y,u)||!1)?(h||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(r,y,u),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(r,y,u)),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=y),i.props=r,i.state=y,i.context=u,r=c):(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 lc(e,t,n,r,o,s)}function lc(e,t,n,r,s,o){ex(e,t);var i=(t.flags&128)!==0;if(!r&&!i)return s&&ph(t,n,!1),pn(e,t,o);r=t.stateNode,qN.current=t;var l=i&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&i?(t.child=is(t,e.child,null,o),t.child=is(t,null,l,o)):Qe(e,t,l,o),t.memoizedState=r.state,s&&ph(t,n,!0),t.child}function tx(e){var t=e.stateNode;t.pendingContext?mh(e,t.pendingContext,t.pendingContext!==t.context):t.context&&mh(e,t.context,!1),yd(e,t.containerInfo)}function Ih(e,t,n,r,s){return os(),fd(s),t.flags|=256,Qe(e,t,n,r),t.child}var uc={dehydrated:null,treeContext:null,retryLane:0};function cc(e){return{baseLanes:e,cachePool:null,transitions:null}}function nx(e,t,n){var r=t.pendingProps,s=Se.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),fe(Se,s&1),e===null)return nc(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=sl(i,r,0,null),e=lr(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=cc(n),t.memoizedState=uc,e):Cd(t,i));if(s=e.memoizedState,s!==null&&(l=s.dehydrated,l!==null))return ZN(e,t,i,r,l,s,n);if(o){o=r.fallback,i=t.mode,s=e.child,l=s.sibling;var u={mode:"hidden",children:r.children};return!(i&1)&&t.child!==s?(r=t.child,r.childLanes=0,r.pendingProps=u,t.deletions=null):(r=Vn(s,u),r.subtreeFlags=s.subtreeFlags&14680064),l!==null?o=Vn(l,o):(o=lr(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?cc(n):{baseLanes:i.baseLanes|n,cachePool:null,transitions:i.transitions},o.memoizedState=i,o.childLanes=e.childLanes&~n,t.memoizedState=uc,r}return o=e.child,e=o.sibling,r=Vn(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 Cd(e,t){return t=sl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function yi(e,t,n,r){return r!==null&&fd(r),is(t,e.child,null,n),e=Cd(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function ZN(e,t,n,r,s,o,i){if(n)return t.flags&256?(t.flags&=-257,r=nu(Error(H(422))),yi(e,t,i,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,s=t.mode,r=sl({mode:"visible",children:r.children},s,0,null),o=lr(o,s,i,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&is(t,e.child,null,i),t.child.memoizedState=cc(i),t.memoizedState=uc,o);if(!(t.mode&1))return yi(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=nu(o,r,void 0),yi(e,t,i,r)}if(l=(i&e.childLanes)!==0,ot||l){if(r=$e,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,mn(e,s),Lt(r,e,s,-1))}return Rd(),r=nu(Error(H(421))),yi(e,t,i,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=d2.bind(null,e),s._reactRetry=t,null):(e=o.treeContext,ft=$n(s.nextSibling),ht=t,xe=!0,Pt=null,e!==null&&(yt[vt++]=an,yt[vt++]=ln,yt[vt++]=fr,an=e.id,ln=e.overflow,fr=t),t=Cd(t,r.children),t.flags|=4096,t)}function Rh(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),rc(e.return,t,n)}function ru(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 rx(e,t,n){var r=t.pendingProps,s=r.revealOrder,o=r.tail;if(Qe(e,t,r.children,n),r=Se.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&&Rh(e,n,t);else if(e.tag===19)Rh(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(fe(Se,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&&Sa(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),ru(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&&Sa(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}ru(t,!0,n,null,o);break;case"together":ru(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Gi(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function pn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),mr|=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=Vn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Vn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function JN(e,t,n){switch(t.tag){case 3:tx(t),os();break;case 5:Pg(t);break;case 1:lt(t.type)&&ga(t);break;case 4:yd(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;fe(va,r._currentValue),r._currentValue=s;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(fe(Se,Se.current&1),t.flags|=128,null):n&t.child.childLanes?nx(e,t,n):(fe(Se,Se.current&1),e=pn(e,t,n),e!==null?e.sibling:null);fe(Se,Se.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return rx(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),fe(Se,Se.current),r)break;return null;case 22:case 23:return t.lanes=0,Jg(e,t,n)}return pn(e,t,n)}var sx,dc,ox,ix;sx=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}};dc=function(){};ox=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,sr(Yt.current);var o=null;switch(n){case"input":s=Tu(e,s),r=Tu(e,r),o=[];break;case"select":s=ke({},s,{value:void 0}),r=ke({},r,{value:void 0}),o=[];break;case"textarea":s=zu(e,s),r=zu(e,r),o=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=ma)}$u(n,r);var i;n=null;for(c in s)if(!r.hasOwnProperty(c)&&s.hasOwnProperty(c)&&s[c]!=null)if(c==="style"){var l=s[c];for(i in l)l.hasOwnProperty(i)&&(n||(n={}),n[i]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(po.hasOwnProperty(c)?o||(o=[]):(o=o||[]).push(c,null));for(c in r){var u=r[c];if(l=s!=null?s[c]:void 0,r.hasOwnProperty(c)&&u!==l&&(u!=null||l!=null))if(c==="style")if(l){for(i in l)!l.hasOwnProperty(i)||u&&u.hasOwnProperty(i)||(n||(n={}),n[i]="");for(i in u)u.hasOwnProperty(i)&&l[i]!==u[i]&&(n||(n={}),n[i]=u[i])}else n||(o||(o=[]),o.push(c,n)),n=u;else c==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,l=l?l.__html:void 0,u!=null&&l!==u&&(o=o||[]).push(c,u)):c==="children"?typeof u!="string"&&typeof u!="number"||(o=o||[]).push(c,""+u):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(po.hasOwnProperty(c)?(u!=null&&c==="onScroll"&&pe("scroll",e),o||l===u||(o=[])):(o=o||[]).push(c,u))}n&&(o=o||[]).push("style",n);var c=o;(t.updateQueue=c)&&(t.flags|=4)}};ix=function(e,t,n,r){n!==r&&(t.flags|=4)};function Vs(e,t){if(!xe)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 We(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 e2(e,t,n){var r=t.pendingProps;switch(dd(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return We(t),null;case 1:return lt(t.type)&&pa(),We(t),null;case 3:return r=t.stateNode,as(),ge(at),ge(Xe),wd(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(gi(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Pt!==null&&(vc(Pt),Pt=null))),dc(e,t),We(t),null;case 5:vd(t);var s=sr(Eo.current);if(n=t.type,e!==null&&t.stateNode!=null)ox(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 We(t),null}if(e=sr(Yt.current),gi(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[Wt]=t,r[ko]=o,e=(t.mode&1)!==0,n){case"dialog":pe("cancel",r),pe("close",r);break;case"iframe":case"object":case"embed":pe("load",r);break;case"video":case"audio":for(s=0;s<Js.length;s++)pe(Js[s],r);break;case"source":pe("error",r);break;case"img":case"image":case"link":pe("error",r),pe("load",r);break;case"details":pe("toggle",r);break;case"input":Hf(r,o),pe("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},pe("invalid",r);break;case"textarea":Bf(r,o),pe("invalid",r)}$u(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&&pi(r.textContent,l,e),s=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(o.suppressHydrationWarning!==!0&&pi(r.textContent,l,e),s=["children",""+l]):po.hasOwnProperty(i)&&l!=null&&i==="onScroll"&&pe("scroll",r)}switch(n){case"input":ai(r),Vf(r,o,!0);break;case"textarea":ai(r),Uf(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=ma)}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=Lp(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[Wt]=t,e[ko]=r,sx(e,t,!1,!1),t.stateNode=e;e:{switch(i=Ou(n,r),n){case"dialog":pe("cancel",e),pe("close",e),s=r;break;case"iframe":case"object":case"embed":pe("load",e),s=r;break;case"video":case"audio":for(s=0;s<Js.length;s++)pe(Js[s],e);s=r;break;case"source":pe("error",e),s=r;break;case"img":case"image":case"link":pe("error",e),pe("load",e),s=r;break;case"details":pe("toggle",e),s=r;break;case"input":Hf(e,r),s=Tu(e,r),pe("invalid",e);break;case"option":s=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=ke({},r,{value:void 0}),pe("invalid",e);break;case"textarea":Bf(e,r),s=zu(e,r),pe("invalid",e);break;default:s=r}$u(n,s),l=s;for(o in l)if(l.hasOwnProperty(o)){var u=l[o];o==="style"?Dp(e,u):o==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&Ap(e,u)):o==="children"?typeof u=="string"?(n!=="textarea"||u!=="")&&go(e,u):typeof u=="number"&&go(e,""+u):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(po.hasOwnProperty(o)?u!=null&&o==="onScroll"&&pe("scroll",e):u!=null&&Qc(e,o,u,i))}switch(n){case"input":ai(e),Vf(e,r,!1);break;case"textarea":ai(e),Uf(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?Yr(e,!!r.multiple,o,!1):r.defaultValue!=null&&Yr(e,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=ma)}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 We(t),null;case 6:if(e&&t.stateNode!=null)ix(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(H(166));if(n=sr(Eo.current),sr(Yt.current),gi(t)){if(r=t.stateNode,n=t.memoizedProps,r[Wt]=t,(o=r.nodeValue!==n)&&(e=ht,e!==null))switch(e.tag){case 3:pi(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&pi(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Wt]=t,t.stateNode=r}return We(t),null;case 13:if(ge(Se),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(xe&&ft!==null&&t.mode&1&&!(t.flags&128))jg(),os(),t.flags|=98560,o=!1;else if(o=gi(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[Wt]=t}else os(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;We(t),o=!1}else Pt!==null&&(vc(Pt),Pt=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||Se.current&1?Te===0&&(Te=3):Rd())),t.updateQueue!==null&&(t.flags|=4),We(t),null);case 4:return as(),dc(e,t),e===null&&bo(t.stateNode.containerInfo),We(t),null;case 10:return pd(t.type._context),We(t),null;case 17:return lt(t.type)&&pa(),We(t),null;case 19:if(ge(Se),o=t.memoizedState,o===null)return We(t),null;if(r=(t.flags&128)!==0,i=o.rendering,i===null)if(r)Vs(o,!1);else{if(Te!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=Sa(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 fe(Se,Se.current&1|2),t.child}e=e.sibling}o.tail!==null&&Ee()>us&&(t.flags|=128,r=!0,Vs(o,!1),t.lanes=4194304)}else{if(!r)if(e=Sa(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&&!xe)return We(t),null}else 2*Ee()-o.renderingStartTime>us&&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=Ee(),t.sibling=null,n=Se.current,fe(Se,r?n&1|2:n&1),t):(We(t),null);case 22:case 23:return Id(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ct&1073741824&&(We(t),t.subtreeFlags&6&&(t.flags|=8192)):We(t),null;case 24:return null;case 25:return null}throw Error(H(156,t.tag))}function t2(e,t){switch(dd(t),t.tag){case 1:return lt(t.type)&&pa(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return as(),ge(at),ge(Xe),wd(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return vd(t),null;case 13:if(ge(Se),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(H(340));os()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ge(Se),null;case 4:return as(),null;case 10:return pd(t.type._context),null;case 22:case 23:return Id(),null;case 24:return null;default:return null}}var vi=!1,Ge=!1,n2=typeof WeakSet=="function"?WeakSet:Set,W=null;function Ur(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ce(e,t,r)}else n.current=null}function fc(e,t,n){try{n()}catch(r){Ce(e,t,r)}}var Th=!1;function r2(e,t){if(Xu=da,e=dg(),ud(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,u=-1,c=0,h=0,d=e,f=null;t:for(;;){for(var x;d!==n||s!==0&&d.nodeType!==3||(l=i+s),d!==o||r!==0&&d.nodeType!==3||(u=i+r),d.nodeType===3&&(i+=d.nodeValue.length),(x=d.firstChild)!==null;)f=d,d=x;for(;;){if(d===e)break t;if(f===n&&++c===s&&(l=i),f===o&&++h===r&&(u=i),(x=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=x}n=l===-1||u===-1?null:{start:l,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(Qu={focusedElem:e,selectionRange:n},da=!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 y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var w=y.memoizedProps,N=y.memoizedState,p=t.stateNode,v=p.getSnapshotBeforeUpdate(t.elementType===t.type?w:Ct(t.type,w),N);p.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var g=t.stateNode.containerInfo;g.nodeType===1?g.textContent="":g.nodeType===9&&g.documentElement&&g.removeChild(g.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(H(163))}}catch(S){Ce(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,W=e;break}W=t.return}return y=Th,Th=!1,y}function lo(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&&fc(t,n,o)}s=s.next}while(s!==r)}}function nl(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 hc(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 ax(e){var t=e.alternate;t!==null&&(e.alternate=null,ax(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Wt],delete t[ko],delete t[Ju],delete t[ON],delete t[FN])),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 lx(e){return e.tag===5||e.tag===3||e.tag===4}function Lh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||lx(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 mc(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=ma));else if(r!==4&&(e=e.child,e!==null))for(mc(e,t,n),e=e.sibling;e!==null;)mc(e,t,n),e=e.sibling}function pc(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(pc(e,t,n),e=e.sibling;e!==null;)pc(e,t,n),e=e.sibling}var Oe=null,Et=!1;function Sn(e,t,n){for(n=n.child;n!==null;)ux(e,t,n),n=n.sibling}function ux(e,t,n){if(Gt&&typeof Gt.onCommitFiberUnmount=="function")try{Gt.onCommitFiberUnmount(Ya,n)}catch{}switch(n.tag){case 5:Ge||Ur(n,t);case 6:var r=Oe,s=Et;Oe=null,Sn(e,t,n),Oe=r,Et=s,Oe!==null&&(Et?(e=Oe,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Oe.removeChild(n.stateNode));break;case 18:Oe!==null&&(Et?(e=Oe,n=n.stateNode,e.nodeType===8?Ql(e.parentNode,n):e.nodeType===1&&Ql(e,n),wo(e)):Ql(Oe,n.stateNode));break;case 4:r=Oe,s=Et,Oe=n.stateNode.containerInfo,Et=!0,Sn(e,t,n),Oe=r,Et=s;break;case 0:case 11:case 14:case 15:if(!Ge&&(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)&&fc(n,t,i),s=s.next}while(s!==r)}Sn(e,t,n);break;case 1:if(!Ge&&(Ur(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Ce(n,t,l)}Sn(e,t,n);break;case 21:Sn(e,t,n);break;case 22:n.mode&1?(Ge=(r=Ge)||n.memoizedState!==null,Sn(e,t,n),Ge=r):Sn(e,t,n);break;default:Sn(e,t,n)}}function Ah(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new n2),t.forEach(function(r){var s=f2.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function kt(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:Oe=l.stateNode,Et=!1;break e;case 3:Oe=l.stateNode.containerInfo,Et=!0;break e;case 4:Oe=l.stateNode.containerInfo,Et=!0;break e}l=l.return}if(Oe===null)throw Error(H(160));ux(o,i,s),Oe=null,Et=!1;var u=s.alternate;u!==null&&(u.return=null),s.return=null}catch(c){Ce(s,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)cx(t,e),t=t.sibling}function cx(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(kt(t,e),Ht(e),r&4){try{lo(3,e,e.return),nl(3,e)}catch(w){Ce(e,e.return,w)}try{lo(5,e,e.return)}catch(w){Ce(e,e.return,w)}}break;case 1:kt(t,e),Ht(e),r&512&&n!==null&&Ur(n,n.return);break;case 5:if(kt(t,e),Ht(e),r&512&&n!==null&&Ur(n,n.return),e.flags&32){var s=e.stateNode;try{go(s,"")}catch(w){Ce(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,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{l==="input"&&o.type==="radio"&&o.name!=null&&Rp(s,o),Ou(l,i);var c=Ou(l,o);for(i=0;i<u.length;i+=2){var h=u[i],d=u[i+1];h==="style"?Dp(s,d):h==="dangerouslySetInnerHTML"?Ap(s,d):h==="children"?go(s,d):Qc(s,h,d,c)}switch(l){case"input":Lu(s,o);break;case"textarea":Tp(s,o);break;case"select":var f=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!o.multiple;var x=o.value;x!=null?Yr(s,!!o.multiple,x,!1):f!==!!o.multiple&&(o.defaultValue!=null?Yr(s,!!o.multiple,o.defaultValue,!0):Yr(s,!!o.multiple,o.multiple?[]:"",!1))}s[ko]=o}catch(w){Ce(e,e.return,w)}}break;case 6:if(kt(t,e),Ht(e),r&4){if(e.stateNode===null)throw Error(H(162));s=e.stateNode,o=e.memoizedProps;try{s.nodeValue=o}catch(w){Ce(e,e.return,w)}}break;case 3:if(kt(t,e),Ht(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{wo(t.containerInfo)}catch(w){Ce(e,e.return,w)}break;case 4:kt(t,e),Ht(e);break;case 13:kt(t,e),Ht(e),s=e.child,s.flags&8192&&(o=s.memoizedState!==null,s.stateNode.isHidden=o,!o||s.alternate!==null&&s.alternate.memoizedState!==null||(Pd=Ee())),r&4&&Ah(e);break;case 22:if(h=n!==null&&n.memoizedState!==null,e.mode&1?(Ge=(c=Ge)||h,kt(t,e),Ge=c):kt(t,e),Ht(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!h&&e.mode&1)for(W=e,h=e.child;h!==null;){for(d=W=h;W!==null;){switch(f=W,x=f.child,f.tag){case 0:case 11:case 14:case 15:lo(4,f,f.return);break;case 1:Ur(f,f.return);var y=f.stateNode;if(typeof y.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(w){Ce(r,n,w)}}break;case 5:Ur(f,f.return);break;case 22:if(f.memoizedState!==null){Dh(d);continue}}x!==null?(x.return=f,W=x):Dh(d)}h=h.sibling}e:for(h=null,d=e;;){if(d.tag===5){if(h===null){h=d;try{s=d.stateNode,c?(o=s.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(l=d.stateNode,u=d.memoizedProps.style,i=u!=null&&u.hasOwnProperty("display")?u.display:null,l.style.display=zp("display",i))}catch(w){Ce(e,e.return,w)}}}else if(d.tag===6){if(h===null)try{d.stateNode.nodeValue=c?"":d.memoizedProps}catch(w){Ce(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:kt(t,e),Ht(e),r&4&&Ah(e);break;case 21:break;default:kt(t,e),Ht(e)}}function Ht(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(lx(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&&(go(s,""),r.flags&=-33);var o=Lh(e);pc(e,o,s);break;case 3:case 4:var i=r.stateNode.containerInfo,l=Lh(e);mc(e,l,i);break;default:throw Error(H(161))}}catch(u){Ce(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function s2(e,t,n){W=e,dx(e)}function dx(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||vi;if(!i){var l=s.alternate,u=l!==null&&l.memoizedState!==null||Ge;l=vi;var c=Ge;if(vi=i,(Ge=u)&&!c)for(W=s;W!==null;)i=W,u=i.child,i.tag===22&&i.memoizedState!==null?$h(s):u!==null?(u.return=i,W=u):$h(s);for(;o!==null;)W=o,dx(o),o=o.sibling;W=s,vi=l,Ge=c}zh(e)}else s.subtreeFlags&8772&&o!==null?(o.return=s,W=o):zh(e)}}function zh(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:Ge||nl(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Ge)if(n===null)r.componentDidMount();else{var s=t.elementType===t.type?n.memoizedProps:Ct(t.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&wh(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}wh(t,i,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&n.focus();break;case"img":u.src&&(n.src=u.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var h=c.memoizedState;if(h!==null){var d=h.dehydrated;d!==null&&wo(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(H(163))}Ge||t.flags&512&&hc(t)}catch(f){Ce(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 Dh(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 $h(e){for(;W!==null;){var t=W;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{nl(4,t)}catch(u){Ce(t,n,u)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var s=t.return;try{r.componentDidMount()}catch(u){Ce(t,s,u)}}var o=t.return;try{hc(t)}catch(u){Ce(t,o,u)}break;case 5:var i=t.return;try{hc(t)}catch(u){Ce(t,i,u)}}}catch(u){Ce(t,t.return,u)}if(t===e){W=null;break}var l=t.sibling;if(l!==null){l.return=t.return,W=l;break}W=t.return}}var o2=Math.ceil,ka=yn.ReactCurrentDispatcher,Ed=yn.ReactCurrentOwner,Nt=yn.ReactCurrentBatchConfig,ae=0,$e=null,Me=null,Fe=0,ct=0,Wr=Qn(0),Te=0,Io=null,mr=0,rl=0,_d=0,uo=null,st=null,Pd=0,us=1/0,sn=null,Ca=!1,gc=null,Fn=null,wi=!1,Ln=null,Ea=0,co=0,xc=null,Yi=-1,Xi=0;function qe(){return ae&6?Ee():Yi!==-1?Yi:Yi=Ee()}function Hn(e){return e.mode&1?ae&2&&Fe!==0?Fe&-Fe:VN.transition!==null?(Xi===0&&(Xi=Xp()),Xi):(e=de,e!==0||(e=window.event,e=e===void 0?16:ng(e.type)),e):1}function Lt(e,t,n,r){if(50<co)throw co=0,xc=null,Error(H(185));Bo(e,n,r),(!(ae&2)||e!==$e)&&(e===$e&&(!(ae&2)&&(rl|=n),Te===4&&In(e,Fe)),ut(e,r),n===1&&ae===0&&!(t.mode&1)&&(us=Ee()+500,Ja&&qn()))}function ut(e,t){var n=e.callbackNode;Vw(e,t);var r=ca(e,e===$e?Fe:0);if(r===0)n!==null&&Gf(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Gf(n),t===1)e.tag===0?HN(Oh.bind(null,e)):Ng(Oh.bind(null,e)),DN(function(){!(ae&6)&&qn()}),n=null;else{switch(Qp(r)){case 1:n=td;break;case 4:n=Gp;break;case 16:n=ua;break;case 536870912:n=Yp;break;default:n=ua}n=vx(n,fx.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function fx(e,t){if(Yi=-1,Xi=0,ae&6)throw Error(H(327));var n=e.callbackNode;if(Jr()&&e.callbackNode!==n)return null;var r=ca(e,e===$e?Fe:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=_a(e,r);else{t=r;var s=ae;ae|=2;var o=mx();($e!==e||Fe!==t)&&(sn=null,us=Ee()+500,ar(e,t));do try{l2();break}catch(l){hx(e,l)}while(!0);md(),ka.current=o,ae=s,Me!==null?t=0:($e=null,Fe=0,t=Te)}if(t!==0){if(t===2&&(s=Uu(e),s!==0&&(r=s,t=yc(e,s))),t===1)throw n=Io,ar(e,0),In(e,r),ut(e,Ee()),n;if(t===6)In(e,r);else{if(s=e.current.alternate,!(r&30)&&!i2(s)&&(t=_a(e,r),t===2&&(o=Uu(e),o!==0&&(r=o,t=yc(e,o))),t===1))throw n=Io,ar(e,0),In(e,r),ut(e,Ee()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(H(345));case 2:er(e,st,sn);break;case 3:if(In(e,r),(r&130023424)===r&&(t=Pd+500-Ee(),10<t)){if(ca(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){qe(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=Zu(er.bind(null,e,st,sn),t);break}er(e,st,sn);break;case 4:if(In(e,r),(r&4194240)===r)break;for(t=e.eventTimes,s=-1;0<r;){var i=31-Tt(r);o=1<<i,i=t[i],i>s&&(s=i),r&=~o}if(r=s,r=Ee()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*o2(r/1960))-r,10<r){e.timeoutHandle=Zu(er.bind(null,e,st,sn),r);break}er(e,st,sn);break;case 5:er(e,st,sn);break;default:throw Error(H(329))}}}return ut(e,Ee()),e.callbackNode===n?fx.bind(null,e):null}function yc(e,t){var n=uo;return e.current.memoizedState.isDehydrated&&(ar(e,t).flags|=256),e=_a(e,t),e!==2&&(t=st,st=n,t!==null&&vc(t)),e}function vc(e){st===null?st=e:st.push.apply(st,e)}function i2(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(!At(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&=~_d,t&=~rl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Tt(t),r=1<<n;e[n]=-1,t&=~r}}function Oh(e){if(ae&6)throw Error(H(327));Jr();var t=ca(e,0);if(!(t&1))return ut(e,Ee()),null;var n=_a(e,t);if(e.tag!==0&&n===2){var r=Uu(e);r!==0&&(t=r,n=yc(e,r))}if(n===1)throw n=Io,ar(e,0),In(e,t),ut(e,Ee()),n;if(n===6)throw Error(H(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,er(e,st,sn),ut(e,Ee()),null}function Md(e,t){var n=ae;ae|=1;try{return e(t)}finally{ae=n,ae===0&&(us=Ee()+500,Ja&&qn())}}function pr(e){Ln!==null&&Ln.tag===0&&!(ae&6)&&Jr();var t=ae;ae|=1;var n=Nt.transition,r=de;try{if(Nt.transition=null,de=1,e)return e()}finally{de=r,Nt.transition=n,ae=t,!(ae&6)&&qn()}}function Id(){ct=Wr.current,ge(Wr)}function ar(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,zN(n)),Me!==null)for(n=Me.return;n!==null;){var r=n;switch(dd(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&pa();break;case 3:as(),ge(at),ge(Xe),wd();break;case 5:vd(r);break;case 4:as();break;case 13:ge(Se);break;case 19:ge(Se);break;case 10:pd(r.type._context);break;case 22:case 23:Id()}n=n.return}if($e=e,Me=e=Vn(e.current,null),Fe=ct=t,Te=0,Io=null,_d=rl=mr=0,st=uo=null,rr!==null){for(t=0;t<rr.length;t++)if(n=rr[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}rr=null}return e}function hx(e,t){do{var n=Me;try{if(md(),Wi.current=ja,ba){for(var r=je.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}ba=!1}if(hr=0,De=Re=je=null,ao=!1,_o=0,Ed.current=null,n===null||n.return===null){Te=1,Io=t,Me=null;break}e:{var o=e,i=n.return,l=n,u=t;if(t=Fe,l.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var c=u,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 x=Ch(i);if(x!==null){x.flags&=-257,Eh(x,i,l,o,t),x.mode&1&&kh(o,c,t),t=x,u=c;var y=t.updateQueue;if(y===null){var w=new Set;w.add(u),t.updateQueue=w}else y.add(u);break e}else{if(!(t&1)){kh(o,c,t),Rd();break e}u=Error(H(426))}}else if(xe&&l.mode&1){var N=Ch(i);if(N!==null){!(N.flags&65536)&&(N.flags|=256),Eh(N,i,l,o,t),fd(ls(u,l));break e}}o=u=ls(u,l),Te!==4&&(Te=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=Qg(o,u,t);vh(o,p);break e;case 1:l=u;var v=o.type,g=o.stateNode;if(!(o.flags&128)&&(typeof v.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(Fn===null||!Fn.has(g)))){o.flags|=65536,t&=-t,o.lanes|=t;var S=qg(o,l,t);vh(o,S);break e}}o=o.return}while(o!==null)}gx(n)}catch(b){t=b,Me===n&&n!==null&&(Me=n=n.return);continue}break}while(!0)}function mx(){var e=ka.current;return ka.current=ja,e===null?ja:e}function Rd(){(Te===0||Te===3||Te===2)&&(Te=4),$e===null||!(mr&268435455)&&!(rl&268435455)||In($e,Fe)}function _a(e,t){var n=ae;ae|=2;var r=mx();($e!==e||Fe!==t)&&(sn=null,ar(e,t));do try{a2();break}catch(s){hx(e,s)}while(!0);if(md(),ae=n,ka.current=r,Me!==null)throw Error(H(261));return $e=null,Fe=0,Te}function a2(){for(;Me!==null;)px(Me)}function l2(){for(;Me!==null&&!Tw();)px(Me)}function px(e){var t=yx(e.alternate,e,ct);e.memoizedProps=e.pendingProps,t===null?gx(e):Me=t,Ed.current=null}function gx(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=t2(n,t),n!==null){n.flags&=32767,Me=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Te=6,Me=null;return}}else if(n=e2(n,t,ct),n!==null){Me=n;return}if(t=t.sibling,t!==null){Me=t;return}Me=t=e}while(t!==null);Te===0&&(Te=5)}function er(e,t,n){var r=de,s=Nt.transition;try{Nt.transition=null,de=1,u2(e,t,n,r)}finally{Nt.transition=s,de=r}return null}function u2(e,t,n,r){do Jr();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(Bw(e,o),e===$e&&(Me=$e=null,Fe=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||wi||(wi=!0,vx(ua,function(){return Jr(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=Nt.transition,Nt.transition=null;var i=de;de=1;var l=ae;ae|=4,Ed.current=null,r2(e,n),cx(n,e),PN(Qu),da=!!Xu,Qu=Xu=null,e.current=n,s2(n),Lw(),ae=l,de=i,Nt.transition=o}else e.current=n;if(wi&&(wi=!1,Ln=e,Ea=s),o=e.pendingLanes,o===0&&(Fn=null),Dw(n.stateNode),ut(e,Ee()),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(Ca)throw Ca=!1,e=gc,gc=null,e;return Ea&1&&e.tag!==0&&Jr(),o=e.pendingLanes,o&1?e===xc?co++:(co=0,xc=e):co=0,qn(),null}function Jr(){if(Ln!==null){var e=Qp(Ea),t=Nt.transition,n=de;try{if(Nt.transition=null,de=16>e?16:e,Ln===null)var r=!1;else{if(e=Ln,Ln=null,Ea=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 u=0;u<l.length;u++){var c=l[u];for(W=c;W!==null;){var h=W;switch(h.tag){case 0:case 11:case 15:lo(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,x=h.return;if(ax(h),h===c){W=null;break}if(f!==null){f.return=x,W=f;break}W=x}}}var y=o.alternate;if(y!==null){var w=y.child;if(w!==null){y.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:lo(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 g=i.child;if(i.subtreeFlags&2064&&g!==null)g.return=i,W=g;else e:for(i=v;W!==null;){if(l=W,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:nl(9,l)}}catch(b){Ce(l,l.return,b)}if(l===i){W=null;break e}var S=l.sibling;if(S!==null){S.return=l.return,W=S;break e}W=l.return}}if(ae=s,qn(),Gt&&typeof Gt.onPostCommitFiberRoot=="function")try{Gt.onPostCommitFiberRoot(Ya,e)}catch{}r=!0}return r}finally{de=n,Nt.transition=t}}return!1}function Fh(e,t,n){t=ls(n,t),t=Qg(e,t,1),e=On(e,t,1),t=qe(),e!==null&&(Bo(e,1,t),ut(e,t))}function Ce(e,t,n){if(e.tag===3)Fh(e,e,n);else for(;t!==null;){if(t.tag===3){Fh(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=ls(n,e),e=qg(t,e,1),t=On(t,e,1),e=qe(),t!==null&&(Bo(t,1,e),ut(t,e));break}}t=t.return}}function c2(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=qe(),e.pingedLanes|=e.suspendedLanes&n,$e===e&&(Fe&n)===n&&(Te===4||Te===3&&(Fe&130023424)===Fe&&500>Ee()-Pd?ar(e,0):_d|=n),ut(e,t)}function xx(e,t){t===0&&(e.mode&1?(t=ci,ci<<=1,!(ci&130023424)&&(ci=4194304)):t=1);var n=qe();e=mn(e,t),e!==null&&(Bo(e,t,n),ut(e,n))}function d2(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),xx(e,n)}function f2(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),xx(e,n)}var yx;yx=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,JN(e,t,n);ot=!!(e.flags&131072)}else ot=!1,xe&&t.flags&1048576&&Sg(t,ya,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Gi(e,t),e=t.pendingProps;var s=ss(t,Xe.current);Zr(t,n),s=Sd(null,t,r,e,s,n);var o=bd();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,ga(t)):o=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,xd(t),s.updater=tl,t.stateNode=s,s._reactInternals=t,oc(t,r,e,n),t=lc(null,t,r,!0,o,n)):(t.tag=0,xe&&o&&cd(t),Qe(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Gi(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=m2(r),e=Ct(r,e),s){case 0:t=ac(null,t,r,e,n);break e;case 1:t=Mh(null,t,r,e,n);break e;case 11:t=_h(null,t,r,e,n);break e;case 14:t=Ph(null,t,r,Ct(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:Ct(r,s),ac(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Ct(r,s),Mh(e,t,r,s,n);case 3:e:{if(tx(t),e===null)throw Error(H(387));r=t.pendingProps,o=t.memoizedState,s=o.element,_g(e,t),Na(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=ls(Error(H(423)),t),t=Ih(e,t,r,n,s);break e}else if(r!==s){s=ls(Error(H(424)),t),t=Ih(e,t,r,n,s);break e}else for(ft=$n(t.stateNode.containerInfo.firstChild),ht=t,xe=!0,Pt=null,n=Cg(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(os(),r===s){t=pn(e,t,n);break e}Qe(e,t,r,n)}t=t.child}return t;case 5:return Pg(t),e===null&&nc(t),r=t.type,s=t.pendingProps,o=e!==null?e.memoizedProps:null,i=s.children,qu(r,s)?i=null:o!==null&&qu(r,o)&&(t.flags|=32),ex(e,t),Qe(e,t,i,n),t.child;case 6:return e===null&&nc(t),null;case 13:return nx(e,t,n);case 4:return yd(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=is(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:Ct(r,s),_h(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,fe(va,r._currentValue),r._currentValue=i,o!==null)if(At(o.value,i)){if(o.children===s.children&&!at.current){t=pn(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 u=l.firstContext;u!==null;){if(u.context===r){if(o.tag===1){u=cn(-1,n&-n),u.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var h=c.pending;h===null?u.next=u:(u.next=h.next,h.next=u),c.pending=u}}o.lanes|=n,u=o.alternate,u!==null&&(u.lanes|=n),rc(o.return,n,t),l.lanes|=n;break}u=u.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),rc(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,Zr(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=Ct(r,t.pendingProps),s=Ct(r.type,s),Ph(e,t,r,s,n);case 15:return Zg(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Ct(r,s),Gi(e,t),t.tag=1,lt(r)?(e=!0,ga(t)):e=!1,Zr(t,n),Xg(t,r,s),oc(t,r,s,n),lc(null,t,r,!0,e,n);case 19:return rx(e,t,n);case 22:return Jg(e,t,n)}throw Error(H(156,t.tag))};function vx(e,t){return Kp(e,t)}function h2(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 wt(e,t,n,r){return new h2(e,t,n,r)}function Td(e){return e=e.prototype,!(!e||!e.isReactComponent)}function m2(e){if(typeof e=="function")return Td(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Zc)return 11;if(e===Jc)return 14}return 2}function Vn(e,t){var n=e.alternate;return n===null?(n=wt(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")Td(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Ar:return lr(n.children,s,o,t);case qc:i=8,s|=8;break;case Pu:return e=wt(12,n,t,s|2),e.elementType=Pu,e.lanes=o,e;case Mu:return e=wt(13,n,t,s),e.elementType=Mu,e.lanes=o,e;case Iu:return e=wt(19,n,t,s),e.elementType=Iu,e.lanes=o,e;case Pp:return sl(n,s,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Ep:i=10;break e;case _p:i=9;break e;case Zc:i=11;break e;case Jc:i=14;break e;case _n:i=16,r=null;break e}throw Error(H(130,e==null?e:typeof e,""))}return t=wt(i,n,t,s),t.elementType=e,t.type=r,t.lanes=o,t}function lr(e,t,n,r){return e=wt(7,e,r,t),e.lanes=n,e}function sl(e,t,n,r){return e=wt(22,e,r,t),e.elementType=Pp,e.lanes=n,e.stateNode={isHidden:!1},e}function su(e,t,n){return e=wt(6,e,null,t),e.lanes=n,e}function ou(e,t,n){return t=wt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function p2(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=Ol(0),this.expirationTimes=Ol(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ol(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Ld(e,t,n,r,s,o,i,l,u){return e=new p2(e,t,n,l,u),t===1?(t=1,o===!0&&(t|=8)):t=0,o=wt(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},xd(o),e}function g2(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Lr,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function wx(e){if(!e)return Wn;e=e._reactInternals;e:{if(jr(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 wg(e,n,t)}return t}function Nx(e,t,n,r,s,o,i,l,u){return e=Ld(n,r,!0,e,s,o,i,l,u),e.context=wx(null),n=e.current,r=qe(),s=Hn(n),o=cn(r,s),o.callback=t??null,On(n,o,s),e.current.lanes=s,Bo(e,s,r),ut(e,r),e}function ol(e,t,n,r){var s=t.current,o=qe(),i=Hn(s);return n=wx(n),t.context===null?t.context=n:t.pendingContext=n,t=cn(o,i),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=On(s,t,i),e!==null&&(Lt(e,s,i,o),Ui(e,s,i)),i}function Pa(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 Hh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Ad(e,t){Hh(e,t),(e=e.alternate)&&Hh(e,t)}function x2(){return null}var Sx=typeof reportError=="function"?reportError:function(e){console.error(e)};function zd(e){this._internalRoot=e}il.prototype.render=zd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(H(409));ol(e,t,null,null)};il.prototype.unmount=zd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;pr(function(){ol(null,e,null,null)}),t[hn]=null}};function il(e){this._internalRoot=e}il.prototype.unstable_scheduleHydration=function(e){if(e){var t=Jp();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&&tg(e)}};function Dd(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function al(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Vh(){}function y2(e,t,n,r,s){if(s){if(typeof r=="function"){var o=r;r=function(){var c=Pa(i);o.call(c)}}var i=Nx(t,r,e,0,null,!1,!1,"",Vh);return e._reactRootContainer=i,e[hn]=i.current,bo(e.nodeType===8?e.parentNode:e),pr(),i}for(;s=e.lastChild;)e.removeChild(s);if(typeof r=="function"){var l=r;r=function(){var c=Pa(u);l.call(c)}}var u=Ld(e,0,!1,null,null,!1,!1,"",Vh);return e._reactRootContainer=u,e[hn]=u.current,bo(e.nodeType===8?e.parentNode:e),pr(function(){ol(t,u,n,r)}),u}function ll(e,t,n,r,s){var o=n._reactRootContainer;if(o){var i=o;if(typeof s=="function"){var l=s;s=function(){var u=Pa(i);l.call(u)}}ol(t,i,e,s)}else i=y2(n,t,e,s,r);return Pa(i)}qp=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Zs(t.pendingLanes);n!==0&&(nd(t,n|1),ut(t,Ee()),!(ae&6)&&(us=Ee()+500,qn()))}break;case 13:pr(function(){var r=mn(e,1);if(r!==null){var s=qe();Lt(r,e,1,s)}}),Ad(e,1)}};rd=function(e){if(e.tag===13){var t=mn(e,134217728);if(t!==null){var n=qe();Lt(t,e,134217728,n)}Ad(e,134217728)}};Zp=function(e){if(e.tag===13){var t=Hn(e),n=mn(e,t);if(n!==null){var r=qe();Lt(n,e,t,r)}Ad(e,t)}};Jp=function(){return de};eg=function(e,t){var n=de;try{return de=e,t()}finally{de=n}};Hu=function(e,t,n){switch(t){case"input":if(Lu(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=Za(r);if(!s)throw Error(H(90));Ip(r),Lu(r,s)}}}break;case"textarea":Tp(e,n);break;case"select":t=n.value,t!=null&&Yr(e,!!n.multiple,t,!1)}};Fp=Md;Hp=pr;var v2={usingClientEntryPoint:!1,Events:[Wo,Or,Za,$p,Op,Md]},Bs={findFiberByHostInstance:nr,bundleType:0,version:"18.3.0",rendererPackageName:"react-dom"},w2={bundleType:Bs.bundleType,version:Bs.version,rendererPackageName:Bs.rendererPackageName,rendererConfig:Bs.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:yn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Up(e),e===null?null:e.stateNode},findFiberByHostInstance:Bs.findFiberByHostInstance||x2,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 Ni=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ni.isDisabled&&Ni.supportsFiber)try{Ya=Ni.inject(w2),Gt=Ni}catch{}}gt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=v2;gt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Dd(t))throw Error(H(200));return g2(e,t,null,n)};gt.createRoot=function(e,t){if(!Dd(e))throw Error(H(299));var n=!1,r="",s=Sx;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=Ld(e,1,!1,null,null,n,!1,r,s),e[hn]=t.current,bo(e.nodeType===8?e.parentNode:e),new zd(t)};gt.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=Up(t),e=e===null?null:e.stateNode,e};gt.flushSync=function(e){return pr(e)};gt.hydrate=function(e,t,n){if(!al(t))throw Error(H(200));return ll(null,e,t,!0,n)};gt.hydrateRoot=function(e,t,n){if(!Dd(e))throw Error(H(405));var r=n!=null&&n.hydratedSources||null,s=!1,o="",i=Sx;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(i=n.onRecoverableError)),t=Nx(t,null,e,1,n??null,s,!1,o,i),e[hn]=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 il(t)};gt.render=function(e,t,n){if(!al(t))throw Error(H(200));return ll(null,e,t,!1,n)};gt.unmountComponentAtNode=function(e){if(!al(e))throw Error(H(40));return e._reactRootContainer?(pr(function(){ll(null,null,e,!1,function(){e._reactRootContainer=null,e[hn]=null})}),!0):!1};gt.unstable_batchedUpdates=Md;gt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!al(n))throw Error(H(200));if(e==null||e._reactInternals===void 0)throw Error(H(38));return ll(e,t,n,!1,r)};gt.version="18.3.0-next-8a015b68cc-20240425";function bx(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(bx)}catch(e){console.error(e)}}bx(),bp.exports=gt;var ul=bp.exports;const N2=Bc(ul);var Bh=ul;Eu.createRoot=Bh.createRoot,Eu.hydrateRoot=Bh.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 Uh="popstate";function S2(e={}){function t(r,s){let{pathname:o,search:i,hash:l}=r.location;return wc("",{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:Ro(s)}return j2(t,n,null,e)}function ye(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function zt(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function b2(){return Math.random().toString(36).substring(2,10)}function Wh(e,t){return{usr:e.state,key:e.key,idx:t}}function wc(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?js(t):t,state:n,key:t&&t.key||r||b2()}}function Ro({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 js(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 j2(e,t,n,r={}){let{window:s=document.defaultView,v5Compat:o=!1}=r,i=s.history,l="POP",u=null,c=h();c==null&&(c=0,i.replaceState({...i.state,idx:c},""));function h(){return(i.state||{idx:null}).idx}function d(){l="POP";let N=h(),p=N==null?null:N-c;c=N,u&&u({action:l,location:w.location,delta:p})}function f(N,p){l="PUSH";let v=wc(w.location,N,p);c=h()+1;let g=Wh(v,c),S=w.createHref(v);try{i.pushState(g,"",S)}catch(b){if(b instanceof DOMException&&b.name==="DataCloneError")throw b;s.location.assign(S)}o&&u&&u({action:l,location:w.location,delta:1})}function x(N,p){l="REPLACE";let v=wc(w.location,N,p);c=h();let g=Wh(v,c),S=w.createHref(v);i.replaceState(g,"",S),o&&u&&u({action:l,location:w.location,delta:0})}function y(N){let p=s.location.origin!=="null"?s.location.origin:s.location.href,v=typeof N=="string"?N:Ro(N);return v=v.replace(/ $/,"%20"),ye(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(u)throw new Error("A history only accepts one active listener");return s.addEventListener(Uh,d),u=N,()=>{s.removeEventListener(Uh,d),u=null}},createHref(N){return t(s,N)},createURL:y,encodeLocation(N){let p=y(N);return{pathname:p.pathname,search:p.search,hash:p.hash}},push:f,replace:x,go(N){return i.go(N)}};return w}function jx(e,t,n="/"){return k2(e,t,n,!1)}function k2(e,t,n,r){let s=typeof t=="string"?js(t):t,o=Kn(s.pathname||"/",n);if(o==null)return null;let i=kx(e);C2(i);let l=null;for(let u=0;l==null&&u<i.length;++u){let c=D2(o);l=A2(i[u],c,r)}return l}function kx(e,t=[],n=[],r=""){let s=(o,i,l)=>{let u={relativePath:l===void 0?o.path||"":l,caseSensitive:o.caseSensitive===!0,childrenIndex:i,route:o};u.relativePath.startsWith("/")&&(ye(u.relativePath.startsWith(r),`Absolute route path "${u.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),u.relativePath=u.relativePath.slice(r.length));let c=dn([r,u.relativePath]),h=n.concat(u);o.children&&o.children.length>0&&(ye(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${c}".`),kx(o.children,t,h,c)),!(o.path==null&&!o.index)&&t.push({path:c,score:T2(c,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 u of Cx(o.path))s(o,i,u)}),t}function Cx(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=Cx(r.join("/")),l=[];return l.push(...i.map(u=>u===""?o:[o,u].join("/"))),s&&l.push(...i),l.map(u=>e.startsWith("/")&&u===""?"/":u)}function C2(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:L2(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var E2=/^:[\w-]+$/,_2=3,P2=2,M2=1,I2=10,R2=-2,Kh=e=>e==="*";function T2(e,t){let n=e.split("/"),r=n.length;return n.some(Kh)&&(r+=R2),t&&(r+=P2),n.filter(s=>!Kh(s)).reduce((s,o)=>s+(E2.test(o)?_2:o===""?M2:I2),r)}function L2(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 A2(e,t,n=!1){let{routesMeta:r}=e,s={},o="/",i=[];for(let l=0;l<r.length;++l){let u=r[l],c=l===r.length-1,h=o==="/"?t:t.slice(o.length)||"/",d=Ma({path:u.relativePath,caseSensitive:u.caseSensitive,end:c},h),f=u.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=Ma({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},h)),!d)return null;Object.assign(s,d.params),i.push({params:s,pathname:dn([o,d.pathname]),pathnameBase:H2(dn([o,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(o=dn([o,d.pathnameBase]))}return i}function Ma(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=z2(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((c,{paramName:h,isOptional:d},f)=>{if(h==="*"){let y=l[f]||"";i=o.slice(0,o.length-y.length).replace(/(.)\/+$/,"$1")}const x=l[f];return d&&!x?c[h]=void 0:c[h]=(x||"").replace(/%2F/g,"/"),c},{}),pathname:o,pathnameBase:i,pattern:e}}function z2(e,t=!1,n=!0){zt(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,u)=>(r.push({paramName:l,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function D2(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return zt(!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 $2(e,t="/"){let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?js(e):e;return{pathname:n?n.startsWith("/")?n:O2(n,t):t,search:V2(r),hash:B2(s)}}function O2(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 iu(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 F2(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function $d(e){let t=F2(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Od(e,t,n,r=!1){let s;typeof e=="string"?s=js(e):(s={...e},ye(!s.pathname||!s.pathname.includes("?"),iu("?","pathname","search",s)),ye(!s.pathname||!s.pathname.includes("#"),iu("#","pathname","hash",s)),ye(!s.search||!s.search.includes("#"),iu("#","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 u=$2(s,l),c=i&&i!=="/"&&i.endsWith("/"),h=(o||i===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(c||h)&&(u.pathname+="/"),u}var dn=e=>e.join("/").replace(/\/\/+/g,"/"),H2=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),V2=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,B2=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function U2(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var Ex=["POST","PUT","PATCH","DELETE"];new Set(Ex);var W2=["GET",...Ex];new Set(W2);var ks=m.createContext(null);ks.displayName="DataRouter";var cl=m.createContext(null);cl.displayName="DataRouterState";var _x=m.createContext({isTransitioning:!1});_x.displayName="ViewTransition";var K2=m.createContext(new Map);K2.displayName="Fetchers";var G2=m.createContext(null);G2.displayName="Await";var $t=m.createContext(null);$t.displayName="Navigation";var Go=m.createContext(null);Go.displayName="Location";var jt=m.createContext({outlet:null,matches:[],isDataRoute:!1});jt.displayName="Route";var Fd=m.createContext(null);Fd.displayName="RouteError";function Y2(e,{relative:t}={}){ye(Cs(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=m.useContext($t),{hash:s,pathname:o,search:i}=Yo(e,{relative:t}),l=o;return n!=="/"&&(l=o==="/"?n:dn([n,o])),r.createHref({pathname:l,search:i,hash:s})}function Cs(){return m.useContext(Go)!=null}function vn(){return ye(Cs(),"useLocation() may be used only in the context of a <Router> component."),m.useContext(Go).location}var Px="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Mx(e){m.useContext($t).static||m.useLayoutEffect(e)}function Hd(){let{isDataRoute:e}=m.useContext(jt);return e?cS():X2()}function X2(){ye(Cs(),"useNavigate() may be used only in the context of a <Router> component.");let e=m.useContext(ks),{basename:t,navigator:n}=m.useContext($t),{matches:r}=m.useContext(jt),{pathname:s}=vn(),o=JSON.stringify($d(r)),i=m.useRef(!1);return Mx(()=>{i.current=!0}),m.useCallback((u,c={})=>{if(zt(i.current,Px),!i.current)return;if(typeof u=="number"){n.go(u);return}let h=Od(u,JSON.parse(o),s,c.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:dn([t,h.pathname])),(c.replace?n.replace:n.push)(h,c.state,c)},[t,n,o,s,e])}var Q2=m.createContext(null);function q2(e){let t=m.useContext(jt).outlet;return t&&m.createElement(Q2.Provider,{value:e},t)}function Z2(){let{matches:e}=m.useContext(jt),t=e[e.length-1];return t?t.params:{}}function Yo(e,{relative:t}={}){let{matches:n}=m.useContext(jt),{pathname:r}=vn(),s=JSON.stringify($d(n));return m.useMemo(()=>Od(e,JSON.parse(s),r,t==="path"),[e,s,r,t])}function J2(e,t){return Ix(e,t)}function Ix(e,t,n,r){var p;ye(Cs(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=m.useContext($t),{matches:o}=m.useContext(jt),i=o[o.length-1],l=i?i.params:{},u=i?i.pathname:"/",c=i?i.pathnameBase:"/",h=i&&i.route;{let v=h&&h.path||"";Rx(u,!h||v.endsWith("*")||v.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (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=vn(),f;if(t){let v=typeof t=="string"?js(t):t;ye(c==="/"||((p=v.pathname)==null?void 0:p.startsWith(c)),`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 "${c}" but pathname "${v.pathname}" was given in the \`location\` prop.`),f=v}else f=d;let x=f.pathname||"/",y=x;if(c!=="/"){let v=c.replace(/^\//,"").split("/");y="/"+x.replace(/^\//,"").split("/").slice(v.length).join("/")}let w=jx(e,{pathname:y});zt(h||w!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),zt(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=sS(w&&w.map(v=>Object.assign({},v,{params:Object.assign({},l,v.params),pathname:dn([c,s.encodeLocation?s.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?c:dn([c,s.encodeLocation?s.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),o,n,r);return t&&N?m.createElement(Go.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...f},navigationType:"POP"}},N):N}function eS(){let e=uS(),t=U2(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 tS=m.createElement(eS,null),nS=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(jt.Provider,{value:this.props.routeContext},m.createElement(Fd.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function rS({routeContext:e,match:t,children:n}){let r=m.useContext(ks);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),m.createElement(jt.Provider,{value:e},n)}function sS(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 u=s.findIndex(c=>c.route.id&&(o==null?void 0:o[c.route.id])!==void 0);ye(u>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),s=s.slice(0,Math.min(s.length,u+1))}let i=!1,l=-1;if(n)for(let u=0;u<s.length;u++){let c=s[u];if((c.route.HydrateFallback||c.route.hydrateFallbackElement)&&(l=u),c.route.id){let{loaderData:h,errors:d}=n,f=c.route.loader&&!h.hasOwnProperty(c.route.id)&&(!d||d[c.route.id]===void 0);if(c.route.lazy||f){i=!0,l>=0?s=s.slice(0,l+1):s=[s[0]];break}}}return s.reduceRight((u,c,h)=>{let d,f=!1,x=null,y=null;n&&(d=o&&c.route.id?o[c.route.id]:void 0,x=c.route.errorElement||tS,i&&(l<0&&h===0?(Rx("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),f=!0,y=null):l===h&&(f=!0,y=c.route.hydrateFallbackElement||null)));let w=t.concat(s.slice(0,h+1)),N=()=>{let p;return d?p=x:f?p=y:c.route.Component?p=m.createElement(c.route.Component,null):c.route.element?p=c.route.element:p=u,m.createElement(rS,{match:c,routeContext:{outlet:u,matches:w,isDataRoute:n!=null},children:p})};return n&&(c.route.ErrorBoundary||c.route.errorElement||h===0)?m.createElement(nS,{location:n.location,revalidation:n.revalidation,component:x,error:d,children:N(),routeContext:{outlet:null,matches:w,isDataRoute:!0}}):N()},null)}function Vd(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function oS(e){let t=m.useContext(ks);return ye(t,Vd(e)),t}function iS(e){let t=m.useContext(cl);return ye(t,Vd(e)),t}function aS(e){let t=m.useContext(jt);return ye(t,Vd(e)),t}function Bd(e){let t=aS(e),n=t.matches[t.matches.length-1];return ye(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function lS(){return Bd("useRouteId")}function uS(){var r;let e=m.useContext(Fd),t=iS("useRouteError"),n=Bd("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function cS(){let{router:e}=oS("useNavigate"),t=Bd("useNavigate"),n=m.useRef(!1);return Mx(()=>{n.current=!0}),m.useCallback(async(s,o={})=>{zt(n.current,Px),n.current&&(typeof s=="number"?e.navigate(s):await e.navigate(s,{fromRouteId:t,...o}))},[e,t])}var Gh={};function Rx(e,t,n){!t&&!Gh[e]&&(Gh[e]=!0,zt(!1,n))}m.memo(dS);function dS({routes:e,future:t,state:n}){return Ix(e,void 0,n,t)}function Nc({to:e,replace:t,state:n,relative:r}){ye(Cs(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=m.useContext($t);zt(!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(jt),{pathname:i}=vn(),l=Hd(),u=Od(e,$d(o),i,r==="path"),c=JSON.stringify(u);return m.useEffect(()=>{l(JSON.parse(c),{replace:t,state:n,relative:r})},[l,c,r,t,n]),null}function fS(e){return q2(e.context)}function Ke(e){ye(!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 hS({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:s,static:o=!1}){ye(!Cs(),"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=js(n));let{pathname:u="/",search:c="",hash:h="",state:d=null,key:f="default"}=n,x=m.useMemo(()=>{let y=Kn(u,i);return y==null?null:{location:{pathname:y,search:c,hash:h,state:d,key:f},navigationType:r}},[i,u,c,h,d,f,r]);return zt(x!=null,`<Router basename="${i}"> is not able to match the URL "${u}${c}${h}" because it does not start with the basename, so the <Router> won't render anything.`),x==null?null:m.createElement($t.Provider,{value:l},m.createElement(Go.Provider,{children:t,value:x}))}function mS({children:e,location:t}){return J2(Sc(e),t)}function Sc(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,Sc(r.props.children,o));return}ye(r.type===Ke,`[${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>`),ye(!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=Sc(r.props.children,o)),n.push(i)}),n}var qi="get",Zi="application/x-www-form-urlencoded";function dl(e){return e!=null&&typeof e.tagName=="string"}function pS(e){return dl(e)&&e.tagName.toLowerCase()==="button"}function gS(e){return dl(e)&&e.tagName.toLowerCase()==="form"}function xS(e){return dl(e)&&e.tagName.toLowerCase()==="input"}function yS(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function vS(e,t){return e.button===0&&(!t||t==="_self")&&!yS(e)}var Si=null;function wS(){if(Si===null)try{new FormData(document.createElement("form"),0),Si=!1}catch{Si=!0}return Si}var NS=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function au(e){return e!=null&&!NS.has(e)?(zt(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Zi}"`),null):e}function SS(e,t){let n,r,s,o,i;if(gS(e)){let l=e.getAttribute("action");r=l?Kn(l,t):null,n=e.getAttribute("method")||qi,s=au(e.getAttribute("enctype"))||Zi,o=new FormData(e)}else if(pS(e)||xS(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 u=e.getAttribute("formaction")||l.getAttribute("action");if(r=u?Kn(u,t):null,n=e.getAttribute("formmethod")||l.getAttribute("method")||qi,s=au(e.getAttribute("formenctype"))||au(l.getAttribute("enctype"))||Zi,o=new FormData(l,e),!wS()){let{name:c,type:h,value:d}=e;if(h==="image"){let f=c?`${c}.`:"";o.append(`${f}x`,"0"),o.append(`${f}y`,"0")}else c&&o.append(c,d)}}else{if(dl(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=qi,r=null,s=Zi,i=e}return o&&s==="text/plain"&&(i=o,o=void 0),{action:r,method:n.toLowerCase(),encType:s,formData:o,body:i}}function Ud(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}async function bS(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 jS(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 kS(e,t,n){let r=await Promise.all(e.map(async s=>{let o=t.routes[s.route.id];if(o){let i=await bS(o,n);return i.links?i.links():[]}return[]}));return PS(r.flat(1).filter(jS).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function Yh(e,t,n,r,s,o){let i=(u,c)=>n[c]?u.route.id!==n[c].route.id:!0,l=(u,c)=>{var h;return n[c].pathname!==u.pathname||((h=n[c].route.path)==null?void 0:h.endsWith("*"))&&n[c].params["*"]!==u.params["*"]};return o==="assets"?t.filter((u,c)=>i(u,c)||l(u,c)):o==="data"?t.filter((u,c)=>{var d;let h=r.routes[u.route.id];if(!h||!h.hasLoader)return!1;if(i(u,c)||l(u,c))return!0;if(u.route.shouldRevalidate){let f=u.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:u.params,defaultShouldRevalidate:!0});if(typeof f=="boolean")return f}return!0}):[]}function CS(e,t){return ES(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 ES(e){return[...new Set(e)]}function _S(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function PS(e,t){let n=new Set;return new Set(t),e.reduce((r,s)=>{let o=JSON.stringify(_S(s));return n.has(o)||(n.add(o),r.push({key:o,link:s})),r},[])}function MS(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 IS(){let e=m.useContext(ks);return Ud(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function RS(){let e=m.useContext(cl);return Ud(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Wd=m.createContext(void 0);Wd.displayName="FrameworkContext";function Tx(){let e=m.useContext(Wd);return Ud(e,"You must render this element inside a <HydratedRouter> element"),e}function TS(e,t){let n=m.useContext(Wd),[r,s]=m.useState(!1),[o,i]=m.useState(!1),{onFocus:l,onBlur:u,onMouseEnter:c,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 x=()=>{s(!0)},y=()=>{s(!1),i(!1)};return n?e!=="intent"?[o,f,{}]:[o,f,{onFocus:Us(l,x),onBlur:Us(u,y),onMouseEnter:Us(c,x),onMouseLeave:Us(h,y),onTouchStart:Us(d,x)}]:[!1,f,{}]}function Us(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function LS({page:e,...t}){let{router:n}=IS(),r=m.useMemo(()=>jx(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?m.createElement(zS,{page:e,matches:r,...t}):null}function AS(e){let{manifest:t,routeModules:n}=Tx(),[r,s]=m.useState([]);return m.useEffect(()=>{let o=!1;return kS(e,t,n).then(i=>{o||s(i)}),()=>{o=!0}},[e,t,n]),r}function zS({page:e,matches:t,...n}){let r=vn(),{manifest:s,routeModules:o}=Tx(),{loaderData:i,matches:l}=RS(),u=m.useMemo(()=>Yh(e,t,l,s,r,"data"),[e,t,l,s,r]),c=m.useMemo(()=>Yh(e,t,l,s,r,"assets"),[e,t,l,s,r]),h=m.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let x=new Set,y=!1;if(t.forEach(N=>{var v;let p=s.routes[N.route.id];!p||!p.hasLoader||(!u.some(g=>g.route.id===N.route.id)&&N.route.id in i&&((v=o[N.route.id])!=null&&v.shouldRevalidate)||p.hasClientLoader?y=!0:x.add(N.route.id))}),x.size===0)return[];let w=MS(e);return y&&x.size>0&&w.searchParams.set("_routes",t.filter(N=>x.has(N.route.id)).map(N=>N.route.id).join(",")),[w.pathname+w.search]},[i,r,s,u,t,e,o]),d=m.useMemo(()=>CS(c,s),[c,s]),f=AS(c);return m.createElement(m.Fragment,null,h.map(x=>m.createElement("link",{key:x,rel:"prefetch",as:"fetch",href:x,...n})),d.map(x=>m.createElement("link",{key:x,rel:"modulepreload",href:x,...n})),f.map(({key:x,link:y})=>m.createElement("link",{key:x,...y})))}function DS(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var Lx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Lx&&(window.__reactRouterVersion="7.1.0")}catch{}function $S({basename:e,children:t,window:n}){let r=m.useRef();r.current==null&&(r.current=S2({window:n,v5Compat:!0}));let s=r.current,[o,i]=m.useState({action:s.action,location:s.location}),l=m.useCallback(u=>{m.startTransition(()=>i(u))},[i]);return m.useLayoutEffect(()=>s.listen(l),[s,l]),m.createElement(hS,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:s})}var Ax=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,gr=m.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:s,reloadDocument:o,replace:i,state:l,target:u,to:c,preventScrollReset:h,viewTransition:d,...f},x){let{basename:y}=m.useContext($t),w=typeof c=="string"&&Ax.test(c),N,p=!1;if(typeof c=="string"&&w&&(N=c,Lx))try{let I=new URL(window.location.href),$=c.startsWith("//")?new URL(I.protocol+c):new URL(c),R=Kn($.pathname,y);$.origin===I.origin&&R!=null?c=R+$.search+$.hash:p=!0}catch{zt(!1,`<Link to="${c}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let v=Y2(c,{relative:s}),[g,S,b]=TS(r,f),k=HS(c,{replace:i,state:l,target:u,preventScrollReset:h,relative:s,viewTransition:d});function j(I){t&&t(I),I.defaultPrevented||k(I)}let _=m.createElement("a",{...f,...b,href:N||v,onClick:p||o?t:j,ref:DS(x,S),target:u,"data-discover":!w&&n==="render"?"true":void 0});return g&&!w?m.createElement(m.Fragment,null,_,m.createElement(LS,{page:v})):_});gr.displayName="Link";var zx=m.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:s=!1,style:o,to:i,viewTransition:l,children:u,...c},h){let d=Yo(i,{relative:c.relative}),f=vn(),x=m.useContext(cl),{navigator:y,basename:w}=m.useContext($t),N=x!=null&&KS(d)&&l===!0,p=y.encodeLocation?y.encodeLocation(d).pathname:d.pathname,v=f.pathname,g=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;n||(v=v.toLowerCase(),g=g?g.toLowerCase():null,p=p.toLowerCase()),g&&w&&(g=Kn(g,w)||g);const S=p!=="/"&&p.endsWith("/")?p.length-1:p.length;let b=v===p||!s&&v.startsWith(p)&&v.charAt(S)==="/",k=g!=null&&(g===p||!s&&g.startsWith(p)&&g.charAt(p.length)==="/"),j={isActive:b,isPending:k,isTransitioning:N},_=b?t:void 0,I;typeof r=="function"?I=r(j):I=[r,b?"active":null,k?"pending":null,N?"transitioning":null].filter(Boolean).join(" ");let $=typeof o=="function"?o(j):o;return m.createElement(gr,{...c,"aria-current":_,className:I,ref:h,style:$,to:i,viewTransition:l},typeof u=="function"?u(j):u)});zx.displayName="NavLink";var OS=m.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:s,state:o,method:i=qi,action:l,onSubmit:u,relative:c,preventScrollReset:h,viewTransition:d,...f},x)=>{let y=US(),w=WS(l,{relative:c}),N=i.toLowerCase()==="get"?"get":"post",p=typeof l=="string"&&Ax.test(l),v=g=>{if(u&&u(g),g.defaultPrevented)return;g.preventDefault();let S=g.nativeEvent.submitter,b=(S==null?void 0:S.getAttribute("formmethod"))||i;y(S||g.currentTarget,{fetcherKey:t,method:b,navigate:n,replace:s,state:o,relative:c,preventScrollReset:h,viewTransition:d})};return m.createElement("form",{ref:x,method:N,action:w,onSubmit:r?u:v,...f,"data-discover":!p&&e==="render"?"true":void 0})});OS.displayName="Form";function FS(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Dx(e){let t=m.useContext(ks);return ye(t,FS(e)),t}function HS(e,{target:t,replace:n,state:r,preventScrollReset:s,relative:o,viewTransition:i}={}){let l=Hd(),u=vn(),c=Yo(e,{relative:o});return m.useCallback(h=>{if(vS(h,t)){h.preventDefault();let d=n!==void 0?n:Ro(u)===Ro(c);l(e,{replace:d,state:r,preventScrollReset:s,relative:o,viewTransition:i})}},[u,l,c,n,r,t,e,s,o,i])}var VS=0,BS=()=>`__${String(++VS)}__`;function US(){let{router:e}=Dx("useSubmit"),{basename:t}=m.useContext($t),n=lS();return m.useCallback(async(r,s={})=>{let{action:o,method:i,encType:l,formData:u,body:c}=SS(r,t);if(s.navigate===!1){let h=s.fetcherKey||BS();await e.fetch(h,n,s.action||o,{preventScrollReset:s.preventScrollReset,formData:u,body:c,formMethod:s.method||i,formEncType:s.encType||l,flushSync:s.flushSync})}else await e.navigate(s.action||o,{preventScrollReset:s.preventScrollReset,formData:u,body:c,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 WS(e,{relative:t}={}){let{basename:n}=m.useContext($t),r=m.useContext(jt);ye(r,"useFormAction must be used inside a RouteContext");let[s]=r.matches.slice(-1),o={...Yo(e||".",{relative:t})},i=vn();if(e==null){o.search=i.search;let l=new URLSearchParams(o.search),u=l.getAll("index");if(u.some(h=>h==="")){l.delete("index"),u.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:dn([n,o.pathname])),Ro(o)}function KS(e,t={}){let n=m.useContext(_x);ye(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Dx("useViewTransitionState"),s=Yo(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 Ma(s.pathname,i)!=null||Ma(s.pathname,o)!=null}new TextEncoder;const $x=m.createContext(null);function GS({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($x.Provider,{value:{theme:t,setTheme:r},children:e})}function YS(){const e=m.useContext($x);if(!e)throw new Error("useTheme must be within ThemeProvider");return e}const Ox=m.createContext(null);function XS({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,u)=>{const c=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:l,password:u})}),h=await c.json();if(!c.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(Ox.Provider,{value:{user:t,isAuthenticated:!!t,isLoading:r,login:o,logout:i},children:e})}function Kd(){const e=m.useContext(Ox);if(!e)throw new Error("useAuth must be within AuthProvider");return e}function Fx(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=Fx(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function QS(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=Fx(e))&&(r&&(r+=" "),r+=t);return r}const Gd="-";function qS(e){const t=JS(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function s(i){const l=i.split(Gd);return l[0]===""&&l.length!==1&&l.shift(),Hx(l,t)||ZS(i)}function o(i,l){const u=n[i]||[];return l&&r[i]?[...u,...r[i]]:u}return{getClassGroupId:s,getConflictingClassGroupIds:o}}function Hx(e,t){var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?Hx(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const o=e.join(Gd);return(i=t.validators.find(({validator:l})=>l(o)))==null?void 0:i.classGroupId}const Xh=/^\[(.+)\]$/;function ZS(e){if(Xh.test(e)){const t=Xh.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function JS(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return tb(Object.entries(e.classGroups),n).forEach(([o,i])=>{bc(i,r,o,t)}),r}function bc(e,t,n,r){e.forEach(s=>{if(typeof s=="string"){const o=s===""?t:Qh(t,s);o.classGroupId=n;return}if(typeof s=="function"){if(eb(s)){bc(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([o,i])=>{bc(i,Qh(t,o),n,r)})})}function Qh(e,t){let n=e;return t.split(Gd).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function eb(e){return e.isThemeGetter}function tb(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 nb(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 Vx="!";function rb(e){const t=e.separator,n=t.length===1,r=t[0],s=t.length;return function(i){const l=[];let u=0,c=0,h;for(let w=0;w<i.length;w++){let N=i[w];if(u===0){if(N===r&&(n||i.slice(w,w+s)===t)){l.push(i.slice(c,w)),c=w+s;continue}if(N==="/"){h=w;continue}}N==="["?u++:N==="]"&&u--}const d=l.length===0?i:i.substring(c),f=d.startsWith(Vx),x=f?d.substring(1):d,y=h&&h>c?h-c:void 0;return{modifiers:l,hasImportantModifier:f,baseClassName:x,maybePostfixModifierPosition:y}}}function sb(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 ob(e){return{cache:nb(e.cacheSize),splitModifiers:rb(e),...qS(e)}}const ib=/\s+/;function ab(e,t){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,o=new Set;return e.trim().split(ib).map(i=>{const{modifiers:l,hasImportantModifier:u,baseClassName:c,maybePostfixModifierPosition:h}=n(i);let d=r(h?c.substring(0,h):c),f=!!h;if(!d){if(!h)return{isTailwindClass:!1,originalClassName:i};if(d=r(c),!d)return{isTailwindClass:!1,originalClassName:i};f=!1}const x=sb(l).join(":");return{isTailwindClass:!0,modifierId:u?x+Vx:x,classGroupId:d,originalClassName:i,hasPostfixModifier:f}}).reverse().filter(i=>{if(!i.isTailwindClass)return!0;const{modifierId:l,classGroupId:u,hasPostfixModifier:c}=i,h=l+u;return o.has(h)?!1:(o.add(h),s(u,c).forEach(d=>o.add(l+d)),!0)}).reverse().map(i=>i.originalClassName).join(" ")}function lb(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Bx(t))&&(r&&(r+=" "),r+=n);return r}function Bx(e){if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Bx(e[r]))&&(n&&(n+=" "),n+=t);return n}function ub(e,...t){let n,r,s,o=i;function i(u){const c=t.reduce((h,d)=>d(h),e());return n=ob(c),r=n.cache.get,s=n.cache.set,o=l,l(u)}function l(u){const c=r(u);if(c)return c;const h=ab(u,n);return s(u,h),h}return function(){return o(lb.apply(null,arguments))}}function me(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const Ux=/^\[(?:([a-z-]+):)?(.+)\]$/i,cb=/^\d+\/\d+$/,db=new Set(["px","full","screen"]),fb=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,hb=/\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$/,mb=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,pb=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,gb=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function nn(e){return or(e)||db.has(e)||cb.test(e)}function bn(e){return Es(e,"length",jb)}function or(e){return!!e&&!Number.isNaN(Number(e))}function bi(e){return Es(e,"number",or)}function Ws(e){return!!e&&Number.isInteger(Number(e))}function xb(e){return e.endsWith("%")&&or(e.slice(0,-1))}function ne(e){return Ux.test(e)}function jn(e){return fb.test(e)}const yb=new Set(["length","size","percentage"]);function vb(e){return Es(e,yb,Wx)}function wb(e){return Es(e,"position",Wx)}const Nb=new Set(["image","url"]);function Sb(e){return Es(e,Nb,Cb)}function bb(e){return Es(e,"",kb)}function Ks(){return!0}function Es(e,t,n){const r=Ux.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function jb(e){return hb.test(e)&&!mb.test(e)}function Wx(){return!1}function kb(e){return pb.test(e)}function Cb(e){return gb.test(e)}function Eb(){const e=me("colors"),t=me("spacing"),n=me("blur"),r=me("brightness"),s=me("borderColor"),o=me("borderRadius"),i=me("borderSpacing"),l=me("borderWidth"),u=me("contrast"),c=me("grayscale"),h=me("hueRotate"),d=me("invert"),f=me("gap"),x=me("gradientColorStops"),y=me("gradientColorStopPositions"),w=me("inset"),N=me("margin"),p=me("opacity"),v=me("padding"),g=me("saturate"),S=me("scale"),b=me("sepia"),k=me("skew"),j=me("space"),_=me("translate"),I=()=>["auto","contain","none"],$=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto",ne,t],T=()=>[ne,t],A=()=>["",nn,bn],C=()=>["auto",or,ne],L=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],M=()=>["solid","dashed","dotted","double","none"],D=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],E=()=>["start","end","center","between","around","evenly","stretch"],P=()=>["","0",ne],z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],F=()=>[or,bi],O=()=>[or,ne];return{cacheSize:500,separator:":",theme:{colors:[Ks],spacing:[nn,bn],blur:["none","",jn,ne],brightness:F(),borderColor:[e],borderRadius:["none","","full",jn,ne],borderSpacing:T(),borderWidth:A(),contrast:F(),grayscale:P(),hueRotate:O(),invert:P(),gap:T(),gradientColorStops:[e],gradientColorStopPositions:[xb,bn],inset:R(),margin:R(),opacity:F(),padding:T(),saturate:F(),scale:F(),sepia:P(),skew:O(),space:T(),translate:T()},classGroups:{aspect:[{aspect:["auto","square","video",ne]}],container:["container"],columns:[{columns:[jn]}],"break-after":[{"break-after":z()}],"break-before":[{"break-before":z()}],"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(),ne]}],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",Ws,ne]}],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",ne]}],grow:[{grow:P()}],shrink:[{shrink:P()}],order:[{order:["first","last","none",Ws,ne]}],"grid-cols":[{"grid-cols":[Ks]}],"col-start-end":[{col:["auto",{span:["full",Ws,ne]},ne]}],"col-start":[{"col-start":C()}],"col-end":[{"col-end":C()}],"grid-rows":[{"grid-rows":[Ks]}],"row-start-end":[{row:["auto",{span:[Ws,ne]},ne]}],"row-start":[{"row-start":C()}],"row-end":[{"row-end":C()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ne]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ne]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...E()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...E(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...E(),"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":[j]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[j]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ne,t]}],"min-w":[{"min-w":[ne,t,"min","max","fit"]}],"max-w":[{"max-w":[ne,t,"none","full","min","max","fit","prose",{screen:[jn]},jn]}],h:[{h:[ne,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ne,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ne,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ne,t,"auto","min","max","fit"]}],"font-size":[{text:["base",jn,bn]}],"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:[Ks]}],"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",ne]}],"line-clamp":[{"line-clamp":["none",or,bi]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",nn,ne]}],"list-image":[{"list-image":["none",ne]}],"list-style-type":[{list:["none","disc","decimal",ne]}],"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:[...M(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",nn,bn]}],"underline-offset":[{"underline-offset":["auto",nn,ne]}],"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",ne]}],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",ne]}],"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(),wb]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",vb]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Sb]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[x]}],"gradient-via":[{via:[x]}],"gradient-to":[{to:[x]}],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:[...M(),"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:M()}],"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:["",...M()]}],"outline-offset":[{"outline-offset":[nn,ne]}],"outline-w":[{outline:[nn,bn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:A()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[p]}],"ring-offset-w":[{"ring-offset":[nn,bn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",jn,bb]}],"shadow-color":[{shadow:[Ks]}],opacity:[{opacity:[p]}],"mix-blend":[{"mix-blend":[...D(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":D()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",jn,ne]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[d]}],saturate:[{saturate:[g]}],sepia:[{sepia:[b]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[p]}],"backdrop-saturate":[{"backdrop-saturate":[g]}],"backdrop-sepia":[{"backdrop-sepia":[b]}],"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",ne]}],duration:[{duration:O()}],ease:[{ease:["linear","in","out","in-out",ne]}],delay:[{delay:O()}],animate:[{animate:["none","spin","ping","pulse","bounce",ne]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[Ws,ne]}],"translate-x":[{"translate-x":[_]}],"translate-y":[{"translate-y":[_]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ne]}],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",ne]}],"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",ne]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[nn,bn,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 _b=ub(Eb);function Pe(...e){return _b(QS(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 Pb=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Kx=(...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 Mb={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 Ib=m.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:o,iconNode:i,...l},u)=>m.createElement("svg",{ref:u,...Mb,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Kx("lucide",s),...l},[...i.map(([c,h])=>m.createElement(c,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 J=(e,t)=>{const n=m.forwardRef(({className:r,...s},o)=>m.createElement(Ib,{ref:o,iconNode:t,className:Kx(`lucide-${Pb(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 Rb=J("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 Tb=J("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 Lb=J("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 Ab=J("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 fl=J("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 hl=J("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 Yd=J("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 zb=J("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 Gx=J("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 Xd=J("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 xr=J("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 Dt=J("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 Db=J("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 $b=J("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 Ob=J("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 Fb=J("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 gn=J("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 Hb=J("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 Vb=J("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 Bb=J("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 _s=J("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 Yx=J("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 Xx=J("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 Ub=J("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 Wb=J("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 Ye=J("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 Kb=J("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 Gb=J("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 Xo=J("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 Yb=J("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 Xb=J("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 cs=J("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 Qb=J("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 Ia=J("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 qb=J("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"}]]);/**
|
|
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 Gn=J("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"}]]);/**
|
|
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 Ra=J("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"}]]);/**
|
|
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 Qx=J("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"}]]);/**
|
|
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 Zb=J("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"}]]);/**
|
|
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 qx=J("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
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 Qd=J("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"}]]);/**
|
|
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 Qt=J("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"}]]);/**
|
|
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 Zx=J("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"}]]);/**
|
|
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 jc=J("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
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 Jb=J("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"}]]);/**
|
|
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 ds=J("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
|
|
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 qt=J("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"}]]);/**
|
|
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 qd=J("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"}]]);/**
|
|
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 Jx=J("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"}]]);/**
|
|
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 ej=J("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),tj=[{label:"Discovery",items:[{to:"/inventory/agents",label:"Agents",icon:fl},{to:"/inventory/identities",label:"Identities",icon:Yx},{to:"/inventory/permissions",label:"Permissions",icon:Ub},{to:"/inventory/hosts",label:"Hosts",icon:Xo}]},{label:"Secure",items:[{to:"/secure/risk",label:"Risk",icon:qd},{to:"/secure/graph",label:"Graph",icon:Xb}]},{label:"Operations",items:[{to:"/ops/skills",label:"Skills",icon:Jx},{to:"/ops/plugins",label:"Plugins",icon:qb}]},{label:"System",items:[{to:"/system/logs",label:"Logs",icon:Zb},{to:"/system/settings",label:"Settings",icon:Qt}]}];function nj(){const e=vn(),[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:tj.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(zx,{to:s.to,className:Pe("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 rj(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function ey(...e){return t=>e.forEach(n=>rj(n,t))}function Zt(...e){return m.useCallback(ey(...e),e)}var fs=m.forwardRef((e,t)=>{const{children:n,...r}=e,s=m.Children.toArray(n),o=s.find(oj);if(o){const i=o.props.children,l=s.map(u=>u===o?m.Children.count(i)>1?m.Children.only(null):m.isValidElement(i)?i.props.children:null:u);return a.jsx(kc,{...r,ref:t,children:m.isValidElement(i)?m.cloneElement(i,void 0,l):null})}return a.jsx(kc,{...r,ref:t,children:n})});fs.displayName="Slot";var kc=m.forwardRef((e,t)=>{const{children:n,...r}=e;if(m.isValidElement(n)){const s=aj(n);return m.cloneElement(n,{...ij(r,n.props),ref:t?ey(t,s):s})}return m.Children.count(n)>1?m.Children.only(null):null});kc.displayName="SlotClone";var sj=({children:e})=>a.jsx(a.Fragment,{children:e});function oj(e){return m.isValidElement(e)&&e.type===sj}function ij(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 aj(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 ty(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=ty(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function lj(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=ty(e))&&(r&&(r+=" "),r+=t);return r}const qh=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,Zh=lj,uj=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Zh(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:o}=t,i=Object.keys(s).map(c=>{const h=n==null?void 0:n[c],d=o==null?void 0:o[c];if(h===null)return null;const f=qh(h)||qh(d);return s[c][f]}),l=n&&Object.entries(n).reduce((c,h)=>{let[d,f]=h;return f===void 0||(c[d]=f),c},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,h)=>{let{class:d,className:f,...x}=h;return Object.entries(x).every(y=>{let[w,N]=y;return Array.isArray(N)?N.includes({...o,...l}[w]):{...o,...l}[w]===N})?[...c,d,f]:c},[]);return Zh(e,i,u,n==null?void 0:n.class,n==null?void 0:n.className)},cj=uj("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"}}),Q=m.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...s},o)=>{const i=r?fs:"button";return a.jsx(i,{className:Pe(cj({variant:t,size:n,className:e})),ref:o,...s})});Q.displayName="Button";function dj(){const{user:e,logout:t}=Kd(),{theme:n,setTheme:r}=YS();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(Q,{variant:"ghost",size:"icon",onClick:()=>r(n==="dark"?"light":"dark"),className:"h-8 w-8",children:n==="dark"?a.jsx(Jb,{className:"h-4 w-4"}):a.jsx(Yb,{className:"h-4 w-4"})}),a.jsx(Q,{variant:"ghost",size:"icon",onClick:t,className:"h-8 w-8",children:a.jsx(Gb,{className:"h-4 w-4"})})]})]})}function fj(){return a.jsxs("div",{className:"flex h-screen overflow-hidden bg-background",children:[a.jsx(nj,{}),a.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[a.jsx(dj,{}),a.jsx("main",{className:"flex-1 overflow-y-auto p-6",children:a.jsx(fS,{})})]})]})}const ze=m.forwardRef(({className:e,type:t,...n},r)=>a.jsx("input",{type:t,className:Pe("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}));ze.displayName="Input";function hj(){const[e,t]=m.useState(""),[n,r]=m.useState(""),[s,o]=m.useState(""),[i,l]=m.useState(!1),[u,c]=m.useState(!1),{login:h,isAuthenticated:d,isLoading:f}=Kd(),x=Hd();if(m.useEffect(()=>{d&&x("/inventory/agents",{replace:!0})},[d,x]),m.useEffect(()=>{fetch("/api/auth/config").then(w=>w.json()).then(w=>c(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 y=async w=>{w.preventDefault(),o(""),l(!0);try{await h(e,n),x("/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"})]})]}),u&&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(qd,{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:y,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(ze,{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(ze,{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(Q,{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 mj="/api";async function ce(e,t){const n=localStorage.getItem("opentrust_user"),r=n?JSON.parse(n).apiKey:null,s=await fetch(`${mj}${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 re={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"})}};function ve({className:e,variant:t="default",...n}){return a.jsx("div",{className:Pe("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})}function pj(){const[e,t]=m.useState([]),[n,r]=m.useState(""),[s,o]=m.useState(!0),i=async()=>{o(!0);try{const c=await re.discovery.agents();t(c.data??[])}catch{}o(!1)};m.useEffect(()=>{i()},[]);const l=e.filter(c=>{var h;return!n||((h=c.name)==null?void 0:h.toLowerCase().includes(n.toLowerCase()))}),u=c=>c==="active"?"success":c==="inactive"?"secondary":"warning";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"]})]}),a.jsxs(Q,{variant:"outline",size:"sm",onClick:i,children:[a.jsx(Gn,{className:"h-3.5 w-3.5"}),"Scan"]})]}),a.jsxs("div",{className:"relative max-w-sm",children:[a.jsx(qx,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),a.jsx(ze,{placeholder:"Search agents...",className:"pl-9",value:n,onChange:c=>r(c.target.value)})]}),s?a.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):l.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(fl,{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:l.map(c=>{var h;return a.jsxs(gr,{to:`/inventory/agents/${c.id}`,className:"group flex flex-col gap-3 rounded-lg border border-border bg-card p-4 transition-colors hover:border-muted-foreground/30",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:c.emoji||"🤖"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-foreground group-hover:text-foreground",children:c.name}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:[c.provider||"unknown",c.model?` · ${c.model}`:""]})]})]}),a.jsx(ve,{variant:u(c.status??"inactive"),className:"text-[10px]",children:c.status??"inactive"})]}),((h=c.skills)==null?void 0:h.length)>0&&a.jsxs("div",{className:"flex flex-wrap gap-1",children:[c.skills.slice(0,4).map(d=>a.jsx("span",{className:"rounded-md bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground",children:typeof d=="string"?d:d.name},d.name??d)),c.skills.length>4&&a.jsxs("span",{className:"rounded-md bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground",children:["+",c.skills.length-4]})]})]},c.id)})})]})}const be=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:Pe("rounded-lg border border-border bg-card text-card-foreground shadow-sm",e),...t}));be.displayName="Card";const Le=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:Pe("flex flex-col space-y-1.5 p-6",e),...t}));Le.displayName="CardHeader";const Ae=m.forwardRef(({className:e,...t},n)=>a.jsx("h3",{ref:n,className:Pe("font-semibold leading-none tracking-tight",e),...t}));Ae.displayName="CardTitle";const Zd=m.forwardRef(({className:e,...t},n)=>a.jsx("p",{ref:n,className:Pe("text-sm text-muted-foreground",e),...t}));Zd.displayName="CardDescription";const _e=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:Pe("p-6 pt-0",e),...t}));_e.displayName="CardContent";const gj=["Profile","Tasks","Identities","Permissions"];function xj(){const{id:e}=Z2(),[t,n]=m.useState(null),[r,s]=m.useState([]),[o,i]=m.useState("Profile"),[l,u]=m.useState(!0),[c,h]=m.useState(null);return m.useEffect(()=>{e&&(u(!0),(async()=>{const d=await re.discovery.profile(e).catch(()=>null),f=(d==null?void 0:d.data)??null;n(f),f!=null&&f.hostId&&re.hosts.get(f.hostId).then(w=>h(w.data??null)).catch(()=>{});const x=(f==null?void 0:f.registeredAgentId)??e,y=await re.observations.agentPermissions(x).catch(()=>({data:[]}));s((y==null?void 0:y.data)??[]),u(!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(gr,{to:"/inventory/agents",className:"rounded-md p-1.5 hover:bg-accent",children:a.jsx(Lb,{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}`:"",c&&a.jsxs(gr,{to:"/inventory/hosts",className:"ml-2 inline-flex items-center gap-1 text-xs text-primary hover:underline",children:[a.jsx(Xo,{className:"h-3 w-3"})," ",c.hostname]})]})]})]})]}),a.jsx("div",{className:"flex gap-1 border-b border-border",children:gj.map(d=>a.jsx("button",{onClick:()=>i(d),className:Pe("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(yj,{profile:t}),o==="Tasks"&&a.jsx(vj,{profile:t}),o==="Identities"&&a.jsx(wj,{profile:t}),o==="Permissions"&&a.jsx(Nj,{permissions:r})]}):a.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Agent not found"})}function yj({profile:e}){const t=e.skills??[];return a.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[a.jsxs(be,{children:[a.jsx(Le,{children:a.jsx(Ae,{className:"text-sm",children:"Info"})}),a.jsxs(_e,{className:"space-y-2 text-sm",children:[a.jsx(Gs,{label:"Owner",value:e.ownerName||"—"}),a.jsx(Gs,{label:"Creature",value:e.creature||"—"}),a.jsx(Gs,{label:"Vibe",value:e.vibe||"—"}),a.jsx(Gs,{label:"Sessions",value:String(e.sessionCount??0)}),a.jsx(Gs,{label:"Last Active",value:e.lastActive??"never"})]})]}),a.jsxs(be,{children:[a.jsx(Le,{children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs(Ae,{className:"flex items-center gap-2 text-sm",children:[a.jsx(Jx,{className:"h-4 w-4"})," Skills (",t.length,")"]}),a.jsx(gr,{to:"/ops/skills",children:a.jsxs(Q,{size:"sm",variant:"ghost",className:"h-7 text-xs text-muted-foreground",children:["Manage ",a.jsx(Hb,{className:"ml-1 h-3 w-3"})]})})]})}),a.jsx(_e,{children:t.length===0?a.jsxs("div",{className:"flex flex-col items-center gap-2 py-4",children:[a.jsx(cs,{className:"h-8 w-8 text-muted-foreground/30"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"No skills installed"}),a.jsx(gr,{to:"/ops/skills",children:a.jsx(Q,{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(ve,{variant:"secondary",className:"text-xs font-normal",children:[a.jsx(cs,{className:"mr-1 h-3 w-3"})," ",n.name]},n.name))})})]}),a.jsxs(be,{children:[a.jsx(Le,{children:a.jsx(Ae,{className:"text-sm",children:"Plugins"})}),a.jsx(_e,{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(ve,{variant:n.enabled?"success":"secondary",className:"text-[10px]",children:n.enabled?"on":"off"})]},n.name))})})]}),a.jsxs(be,{children:[a.jsx(Le,{children:a.jsx(Ae,{className:"text-sm",children:"Connected Systems"})}),a.jsx(_e,{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(ve,{variant:"outline",className:"text-xs",children:n},n))})})]})]})}function vj({profile:e}){const t=e.cronJobs??[];return a.jsxs(be,{children:[a.jsx(Le,{children:a.jsxs(Ae,{className:"flex items-center gap-2 text-sm",children:[a.jsx($b,{className:"h-4 w-4"})," Scheduled Tasks (",t.length,")"]})}),a.jsx(_e,{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(ve,{variant:n.enabled!==!1?"success":"secondary",className:"text-[10px]",children:n.enabled!==!1?"active":"paused"})]},r))})})]})}function wj({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(be,{children:[a.jsx(Le,{children:a.jsxs(Ae,{className:"flex items-center gap-2 text-sm",children:[a.jsx(_s,{className:"h-4 w-4"})," ",r.label]})}),a.jsx(_e,{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 Nj({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(ve,{variant:"outline",className:"text-[10px]",children:t.category??"—"})}),a.jsx("td",{className:"px-4 py-2.5",children:a.jsx(ve,{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 Gs({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 Sj(){const[e,t]=m.useState([]),[n,r]=m.useState(!0),[s,o]=m.useState(new Set);m.useEffect(()=>{re.discovery.agents().then(u=>{t(u.data??[]),r(!1)}).catch(()=>r(!1))},[]);const i=[{category:"Agents",items:e.map(u=>({id:u.id,name:u.name,emoji:u.emoji,provider:u.provider,status:u.status}))},{category:"Owners",items:[...new Set(e.map(u=>u.ownerName).filter(Boolean))].map(u=>({id:u,name:u,type:"owner"}))},{category:"Connected Systems",items:[...new Set(e.flatMap(u=>u.connectedSystems??[]))].map(u=>({id:u,name:u,type:"system"}))}],l=u=>{o(c=>{const h=new Set(c);return h.has(u)?h.delete(u):h.add(u),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(u=>a.jsxs(be,{children:[a.jsxs("button",{onClick:()=>l(u.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(Yx,{className:"h-4 w-4 text-muted-foreground"}),a.jsx("span",{className:"text-sm font-medium",children:u.category}),a.jsx(ve,{variant:"secondary",className:"text-[10px]",children:u.items.length})]}),s.has(u.category)?a.jsx(hl,{className:"h-4 w-4 text-muted-foreground"}):a.jsx(Yd,{className:"h-4 w-4 text-muted-foreground"})]}),s.has(u.category)&&a.jsx(_e,{className:"border-t border-border pt-3",children:u.items.length===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"None"}):a.jsx("div",{className:"space-y-1.5",children:u.items.map(c=>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:[c.emoji&&a.jsx("span",{className:"text-base",children:c.emoji}),a.jsx("span",{children:c.name})]}),c.status&&a.jsx(ve,{variant:c.status==="active"?"success":"secondary",className:"text-[10px]",children:c.status}),c.type&&a.jsx(ve,{variant:"outline",className:"text-[10px]",children:c.type})]},c.id))})})]},u.category))})]})}function bj(){const[e,t]=m.useState([]),[n,r]=m.useState(""),[s,o]=m.useState("callCount"),[i,l]=m.useState(!1),[u,c]=m.useState(!0);m.useEffect(()=>{re.observations.permissions().then(f=>{t(f.data??[]),c(!1)}).catch(()=>c(!1))},[]);const h=m.useMemo(()=>{let f=e;if(n){const x=n.toLowerCase();f=f.filter(y=>{var w,N;return((w=y.toolName)==null?void 0:w.toLowerCase().includes(x))||((N=y.category)==null?void 0:N.toLowerCase().includes(x))})}return[...f].sort((x,y)=>{const w=x[s]??0,N=y[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 u?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(qx,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),a.jsx(ze,{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(lu,{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(lu,{label:"Calls",sortKey:"callCount",current:s,asc:i,onSort:d,align:"right"}),a.jsx(lu,{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(ve,{variant:"outline",className:"text-[10px]",children:f.category??"—"})}),a.jsx("td",{className:"px-4 py-2.5",children:a.jsx(ve,{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 lu({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(Ab,{className:"h-3 w-3"})]})})}function jj(){const[e,t]=m.useState([]),[n,r]=m.useState(!0);m.useEffect(()=>{re.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(qd,{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 u;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:((u=i.agentId)==null?void 0:u.slice(0,8))??"—"}),a.jsx("td",{className:"px-4 py-2.5",children:a.jsx(ve,{variant:o(l),className:"text-[10px]",children:l})}),a.jsx("td",{className:"px-4 py-2.5",children:a.jsx(ve,{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 Ie(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=Ie(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var kj={value:()=>{}};function ml(){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 Ji(n)}function Ji(e){this._=e}function Cj(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}})}Ji.prototype=ml.prototype={constructor:Ji,on:function(e,t){var n=this._,r=Cj(e+"",n),s,o=-1,i=r.length;if(arguments.length<2){for(;++o<i;)if((s=(e=r[o]).type)&&(s=Ej(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]=Jh(n[s],e.name,t);else if(t==null)for(s in n)n[s]=Jh(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 Ji(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 Ej(e,t){for(var n=0,r=e.length,s;n<r;++n)if((s=e[n]).name===t)return s.value}function Jh(e,t,n){for(var r=0,s=e.length;r<s;++r)if(e[r].name===t){e[r]=kj,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Cc="http://www.w3.org/1999/xhtml";const em={svg:"http://www.w3.org/2000/svg",xhtml:Cc,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function pl(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),em.hasOwnProperty(t)?{space:em[t],local:e}:e}function _j(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Cc&&t.documentElement.namespaceURI===Cc?t.createElement(e):t.createElementNS(n,e)}}function Pj(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function ny(e){var t=pl(e);return(t.local?Pj:_j)(t)}function Mj(){}function Jd(e){return e==null?Mj:function(){return this.querySelector(e)}}function Ij(e){typeof e!="function"&&(e=Jd(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),u,c,h=0;h<i;++h)(u=o[h])&&(c=e.call(u,u.__data__,h,o))&&("__data__"in u&&(c.__data__=u.__data__),l[h]=c);return new pt(r,this._parents)}function Rj(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Tj(){return[]}function ry(e){return e==null?Tj:function(){return this.querySelectorAll(e)}}function Lj(e){return function(){return Rj(e.apply(this,arguments))}}function Aj(e){typeof e=="function"?e=Lj(e):e=ry(e);for(var t=this._groups,n=t.length,r=[],s=[],o=0;o<n;++o)for(var i=t[o],l=i.length,u,c=0;c<l;++c)(u=i[c])&&(r.push(e.call(u,u.__data__,c,i)),s.push(u));return new pt(r,s)}function sy(e){return function(){return this.matches(e)}}function oy(e){return function(t){return t.matches(e)}}var zj=Array.prototype.find;function Dj(e){return function(){return zj.call(this.children,e)}}function $j(){return this.firstElementChild}function Oj(e){return this.select(e==null?$j:Dj(typeof e=="function"?e:oy(e)))}var Fj=Array.prototype.filter;function Hj(){return Array.from(this.children)}function Vj(e){return function(){return Fj.call(this.children,e)}}function Bj(e){return this.selectAll(e==null?Hj:Vj(typeof e=="function"?e:oy(e)))}function Uj(e){typeof e!="function"&&(e=sy(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]=[],u,c=0;c<i;++c)(u=o[c])&&e.call(u,u.__data__,c,o)&&l.push(u);return new pt(r,this._parents)}function iy(e){return new Array(e.length)}function Wj(){return new pt(this._enter||this._groups.map(iy),this._parents)}function Ta(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Ta.prototype={constructor:Ta,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 Kj(e){return function(){return e}}function Gj(e,t,n,r,s,o){for(var i=0,l,u=t.length,c=o.length;i<c;++i)(l=t[i])?(l.__data__=o[i],r[i]=l):n[i]=new Ta(e,o[i]);for(;i<u;++i)(l=t[i])&&(s[i]=l)}function Yj(e,t,n,r,s,o,i){var l,u,c=new Map,h=t.length,d=o.length,f=new Array(h),x;for(l=0;l<h;++l)(u=t[l])&&(f[l]=x=i.call(u,u.__data__,l,t)+"",c.has(x)?s[l]=u:c.set(x,u));for(l=0;l<d;++l)x=i.call(e,o[l],l,o)+"",(u=c.get(x))?(r[l]=u,u.__data__=o[l],c.delete(x)):n[l]=new Ta(e,o[l]);for(l=0;l<h;++l)(u=t[l])&&c.get(f[l])===u&&(s[l]=u)}function Xj(e){return e.__data__}function Qj(e,t){if(!arguments.length)return Array.from(this,Xj);var n=t?Yj:Gj,r=this._parents,s=this._groups;typeof e!="function"&&(e=Kj(e));for(var o=s.length,i=new Array(o),l=new Array(o),u=new Array(o),c=0;c<o;++c){var h=r[c],d=s[c],f=d.length,x=qj(e.call(h,h&&h.__data__,c,r)),y=x.length,w=l[c]=new Array(y),N=i[c]=new Array(y),p=u[c]=new Array(f);n(h,d,w,N,p,x,t);for(var v=0,g=0,S,b;v<y;++v)if(S=w[v]){for(v>=g&&(g=v+1);!(b=N[g])&&++g<y;);S._next=b||null}}return i=new pt(i,r),i._enter=l,i._exit=u,i}function qj(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Zj(){return new pt(this._exit||this._groups.map(iy),this._parents)}function Jj(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 ek(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),u=0;u<i;++u)for(var c=n[u],h=r[u],d=c.length,f=l[u]=new Array(d),x,y=0;y<d;++y)(x=c[y]||h[y])&&(f[y]=x);for(;u<s;++u)l[u]=n[u];return new pt(l,this._parents)}function tk(){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 nk(e){e||(e=rk);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,u=s[o]=new Array(l),c,h=0;h<l;++h)(c=i[h])&&(u[h]=c);u.sort(t)}return new pt(s,this._parents).order()}function rk(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function sk(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function ok(){return Array.from(this)}function ik(){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 ak(){let e=0;for(const t of this)++e;return e}function lk(){return!this.node()}function uk(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 ck(e){return function(){this.removeAttribute(e)}}function dk(e){return function(){this.removeAttributeNS(e.space,e.local)}}function fk(e,t){return function(){this.setAttribute(e,t)}}function hk(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function mk(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function pk(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 gk(e,t){var n=pl(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?dk:ck:typeof t=="function"?n.local?pk:mk:n.local?hk:fk)(n,t))}function ay(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function xk(e){return function(){this.style.removeProperty(e)}}function yk(e,t,n){return function(){this.style.setProperty(e,t,n)}}function vk(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function wk(e,t,n){return arguments.length>1?this.each((t==null?xk:typeof t=="function"?vk:yk)(e,t,n??"")):hs(this.node(),e)}function hs(e,t){return e.style.getPropertyValue(t)||ay(e).getComputedStyle(e,null).getPropertyValue(t)}function Nk(e){return function(){delete this[e]}}function Sk(e,t){return function(){this[e]=t}}function bk(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function jk(e,t){return arguments.length>1?this.each((t==null?Nk:typeof t=="function"?bk:Sk)(e,t)):this.node()[e]}function ly(e){return e.trim().split(/^|\s+/)}function ef(e){return e.classList||new uy(e)}function uy(e){this._node=e,this._names=ly(e.getAttribute("class")||"")}uy.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 cy(e,t){for(var n=ef(e),r=-1,s=t.length;++r<s;)n.add(t[r])}function dy(e,t){for(var n=ef(e),r=-1,s=t.length;++r<s;)n.remove(t[r])}function kk(e){return function(){cy(this,e)}}function Ck(e){return function(){dy(this,e)}}function Ek(e,t){return function(){(t.apply(this,arguments)?cy:dy)(this,e)}}function _k(e,t){var n=ly(e+"");if(arguments.length<2){for(var r=ef(this.node()),s=-1,o=n.length;++s<o;)if(!r.contains(n[s]))return!1;return!0}return this.each((typeof t=="function"?Ek:t?kk:Ck)(n,t))}function Pk(){this.textContent=""}function Mk(e){return function(){this.textContent=e}}function Ik(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Rk(e){return arguments.length?this.each(e==null?Pk:(typeof e=="function"?Ik:Mk)(e)):this.node().textContent}function Tk(){this.innerHTML=""}function Lk(e){return function(){this.innerHTML=e}}function Ak(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function zk(e){return arguments.length?this.each(e==null?Tk:(typeof e=="function"?Ak:Lk)(e)):this.node().innerHTML}function Dk(){this.nextSibling&&this.parentNode.appendChild(this)}function $k(){return this.each(Dk)}function Ok(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Fk(){return this.each(Ok)}function Hk(e){var t=typeof e=="function"?e:ny(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Vk(){return null}function Bk(e,t){var n=typeof e=="function"?e:ny(e),r=t==null?Vk:typeof t=="function"?t:Jd(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Uk(){var e=this.parentNode;e&&e.removeChild(this)}function Wk(){return this.each(Uk)}function Kk(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Gk(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Yk(e){return this.select(e?Gk:Kk)}function Xk(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Qk(e){return function(t){e.call(this,t,this.__data__)}}function qk(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 Zk(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 Jk(e,t,n){return function(){var r=this.__on,s,o=Qk(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 eC(e,t,n){var r=qk(e+""),s,o=r.length,i;if(arguments.length<2){var l=this.node().__on;if(l){for(var u=0,c=l.length,h;u<c;++u)for(s=0,h=l[u];s<o;++s)if((i=r[s]).type===h.type&&i.name===h.name)return h.value}return}for(l=t?Jk:Zk,s=0;s<o;++s)this.each(l(r[s],t,n));return this}function fy(e,t,n){var r=ay(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 tC(e,t){return function(){return fy(this,e,t)}}function nC(e,t){return function(){return fy(this,e,t.apply(this,arguments))}}function rC(e,t){return this.each((typeof t=="function"?nC:tC)(e,t))}function*sC(){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 hy=[null];function pt(e,t){this._groups=e,this._parents=t}function Qo(){return new pt([[document.documentElement]],hy)}function oC(){return this}pt.prototype=Qo.prototype={constructor:pt,select:Ij,selectAll:Aj,selectChild:Oj,selectChildren:Bj,filter:Uj,data:Qj,enter:Wj,exit:Zj,join:Jj,merge:ek,selection:oC,order:tk,sort:nk,call:sk,nodes:ok,node:ik,size:ak,empty:lk,each:uk,attr:gk,style:wk,property:jk,classed:_k,text:Rk,html:zk,raise:$k,lower:Fk,append:Hk,insert:Bk,remove:Wk,clone:Yk,datum:Xk,on:eC,dispatch:rC,[Symbol.iterator]:sC};function dt(e){return typeof e=="string"?new pt([[document.querySelector(e)]],[document.documentElement]):new pt([[e]],hy)}function iC(e){let t;for(;t=e.sourceEvent;)e=t;return e}function _t(e,t){if(e=iC(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 aC={passive:!1},To={capture:!0,passive:!1};function uu(e){e.stopImmediatePropagation()}function es(e){e.preventDefault(),e.stopImmediatePropagation()}function my(e){var t=e.document.documentElement,n=dt(e).on("dragstart.drag",es,To);"onselectstart"in t?n.on("selectstart.drag",es,To):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function py(e,t){var n=e.document.documentElement,r=dt(e).on("dragstart.drag",null);t&&(r.on("click.drag",es,To),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 ji=e=>()=>e;function Ec(e,{sourceEvent:t,subject:n,target:r,identifier:s,active:o,x:i,y:l,dx:u,dy:c,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:u,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:h}})}Ec.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function lC(e){return!e.ctrlKey&&!e.button}function uC(){return this.parentNode}function cC(e,t){return t??{x:e.x,y:e.y}}function dC(){return navigator.maxTouchPoints||"ontouchstart"in this}function gy(){var e=lC,t=uC,n=cC,r=dC,s={},o=ml("start","drag","end"),i=0,l,u,c,h,d=0;function f(S){S.on("mousedown.drag",x).filter(r).on("touchstart.drag",N).on("touchmove.drag",p,aC).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function x(S,b){if(!(h||!e.call(this,S,b))){var k=g(this,t.call(this,S,b),S,b,"mouse");k&&(dt(S.view).on("mousemove.drag",y,To).on("mouseup.drag",w,To),my(S.view),uu(S),c=!1,l=S.clientX,u=S.clientY,k("start",S))}}function y(S){if(es(S),!c){var b=S.clientX-l,k=S.clientY-u;c=b*b+k*k>d}s.mouse("drag",S)}function w(S){dt(S.view).on("mousemove.drag mouseup.drag",null),py(S.view,c),es(S),s.mouse("end",S)}function N(S,b){if(e.call(this,S,b)){var k=S.changedTouches,j=t.call(this,S,b),_=k.length,I,$;for(I=0;I<_;++I)($=g(this,j,S,b,k[I].identifier,k[I]))&&(uu(S),$("start",S,k[I]))}}function p(S){var b=S.changedTouches,k=b.length,j,_;for(j=0;j<k;++j)(_=s[b[j].identifier])&&(es(S),_("drag",S,b[j]))}function v(S){var b=S.changedTouches,k=b.length,j,_;for(h&&clearTimeout(h),h=setTimeout(function(){h=null},500),j=0;j<k;++j)(_=s[b[j].identifier])&&(uu(S),_("end",S,b[j]))}function g(S,b,k,j,_,I){var $=o.copy(),R=_t(I||k,b),T,A,C;if((C=n.call(S,new Ec("beforestart",{sourceEvent:k,target:f,identifier:_,active:i,x:R[0],y:R[1],dx:0,dy:0,dispatch:$}),j))!=null)return T=C.x-R[0]||0,A=C.y-R[1]||0,function L(M,D,E){var P=R,z;switch(M){case"start":s[_]=L,z=i++;break;case"end":delete s[_],--i;case"drag":R=_t(E||D,b),z=i;break}$.call(M,S,new Ec(M,{sourceEvent:D,subject:C,target:f,identifier:_,active:z,x:R[0]+T,y:R[1]+A,dx:R[0]-P[0],dy:R[1]-P[1],dispatch:$}),j)}}return f.filter=function(S){return arguments.length?(e=typeof S=="function"?S:ji(!!S),f):e},f.container=function(S){return arguments.length?(t=typeof S=="function"?S:ji(S),f):t},f.subject=function(S){return arguments.length?(n=typeof S=="function"?S:ji(S),f):n},f.touchable=function(S){return arguments.length?(r=typeof S=="function"?S:ji(!!S),f):r},f.on=function(){var S=o.on.apply(o,arguments);return S===o?f:S},f.clickDistance=function(S){return arguments.length?(d=(S=+S)*S,f):Math.sqrt(d)},f}function tf(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function xy(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function qo(){}var Lo=.7,La=1/Lo,ts="\\s*([+-]?\\d+)\\s*",Ao="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Xt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",fC=/^#([0-9a-f]{3,8})$/,hC=new RegExp(`^rgb\\(${ts},${ts},${ts}\\)$`),mC=new RegExp(`^rgb\\(${Xt},${Xt},${Xt}\\)$`),pC=new RegExp(`^rgba\\(${ts},${ts},${ts},${Ao}\\)$`),gC=new RegExp(`^rgba\\(${Xt},${Xt},${Xt},${Ao}\\)$`),xC=new RegExp(`^hsl\\(${Ao},${Xt},${Xt}\\)$`),yC=new RegExp(`^hsla\\(${Ao},${Xt},${Xt},${Ao}\\)$`),tm={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};tf(qo,yr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:nm,formatHex:nm,formatHex8:vC,formatHsl:wC,formatRgb:rm,toString:rm});function nm(){return this.rgb().formatHex()}function vC(){return this.rgb().formatHex8()}function wC(){return yy(this).formatHsl()}function rm(){return this.rgb().formatRgb()}function yr(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=fC.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?sm(t):n===3?new it(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?ki(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?ki(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=hC.exec(e))?new it(t[1],t[2],t[3],1):(t=mC.exec(e))?new it(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=pC.exec(e))?ki(t[1],t[2],t[3],t[4]):(t=gC.exec(e))?ki(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=xC.exec(e))?am(t[1],t[2]/100,t[3]/100,1):(t=yC.exec(e))?am(t[1],t[2]/100,t[3]/100,t[4]):tm.hasOwnProperty(e)?sm(tm[e]):e==="transparent"?new it(NaN,NaN,NaN,0):null}function sm(e){return new it(e>>16&255,e>>8&255,e&255,1)}function ki(e,t,n,r){return r<=0&&(e=t=n=NaN),new it(e,t,n,r)}function NC(e){return e instanceof qo||(e=yr(e)),e?(e=e.rgb(),new it(e.r,e.g,e.b,e.opacity)):new it}function _c(e,t,n,r){return arguments.length===1?NC(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}tf(it,_c,xy(qo,{brighter(e){return e=e==null?La:Math.pow(La,e),new it(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Lo:Math.pow(Lo,e),new it(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new it(ur(this.r),ur(this.g),ur(this.b),Aa(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:om,formatHex:om,formatHex8:SC,formatRgb:im,toString:im}));function om(){return`#${ir(this.r)}${ir(this.g)}${ir(this.b)}`}function SC(){return`#${ir(this.r)}${ir(this.g)}${ir(this.b)}${ir((isNaN(this.opacity)?1:this.opacity)*255)}`}function im(){const e=Aa(this.opacity);return`${e===1?"rgb(":"rgba("}${ur(this.r)}, ${ur(this.g)}, ${ur(this.b)}${e===1?")":`, ${e})`}`}function Aa(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ur(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ir(e){return e=ur(e),(e<16?"0":"")+e.toString(16)}function am(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Mt(e,t,n,r)}function yy(e){if(e instanceof Mt)return new Mt(e.h,e.s,e.l,e.opacity);if(e instanceof qo||(e=yr(e)),!e)return new Mt;if(e instanceof Mt)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,u=(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/=u<.5?o+s:2-o-s,i*=60):l=u>0&&u<1?0:i,new Mt(i,l,u,e.opacity)}function bC(e,t,n,r){return arguments.length===1?yy(e):new Mt(e,t,n,r??1)}function Mt(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}tf(Mt,bC,xy(qo,{brighter(e){return e=e==null?La:Math.pow(La,e),new Mt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Lo:Math.pow(Lo,e),new Mt(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(cu(e>=240?e-240:e+120,s,r),cu(e,s,r),cu(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new Mt(lm(this.h),Ci(this.s),Ci(this.l),Aa(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=Aa(this.opacity);return`${e===1?"hsl(":"hsla("}${lm(this.h)}, ${Ci(this.s)*100}%, ${Ci(this.l)*100}%${e===1?")":`, ${e})`}`}}));function lm(e){return e=(e||0)%360,e<0?e+360:e}function Ci(e){return Math.max(0,Math.min(1,e||0))}function cu(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 nf=e=>()=>e;function jC(e,t){return function(n){return e+n*t}}function kC(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 CC(e){return(e=+e)==1?vy:function(t,n){return n-t?kC(t,n,e):nf(isNaN(t)?n:t)}}function vy(e,t){var n=t-e;return n?jC(e,n):nf(isNaN(e)?t:e)}const za=function e(t){var n=CC(t);function r(s,o){var i=n((s=_c(s)).r,(o=_c(o)).r),l=n(s.g,o.g),u=n(s.b,o.b),c=vy(s.opacity,o.opacity);return function(h){return s.r=i(h),s.g=l(h),s.b=u(h),s.opacity=c(h),s+""}}return r.gamma=e,r}(1);function EC(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 _C(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function PC(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]=fo(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 MC(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Ut(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function IC(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]=fo(e[s],t[s]):r[s]=t[s];return function(o){for(s in n)r[s]=n[s](o);return r}}var Pc=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,du=new RegExp(Pc.source,"g");function RC(e){return function(){return e}}function TC(e){return function(t){return e(t)+""}}function wy(e,t){var n=Pc.lastIndex=du.lastIndex=0,r,s,o,i=-1,l=[],u=[];for(e=e+"",t=t+"";(r=Pc.exec(e))&&(s=du.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,u.push({i,x:Ut(r,s)})),n=du.lastIndex;return n<t.length&&(o=t.slice(n),l[i]?l[i]+=o:l[++i]=o),l.length<2?u[0]?TC(u[0].x):RC(t):(t=u.length,function(c){for(var h=0,d;h<t;++h)l[(d=u[h]).i]=d.x(c);return l.join("")})}function fo(e,t){var n=typeof t,r;return t==null||n==="boolean"?nf(t):(n==="number"?Ut:n==="string"?(r=yr(t))?(t=r,za):wy:t instanceof yr?za:t instanceof Date?MC:_C(t)?EC:Array.isArray(t)?PC:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?IC:Ut)(e,t)}var um=180/Math.PI,Mc={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ny(e,t,n,r,s,o){var i,l,u;return(i=Math.sqrt(e*e+t*t))&&(e/=i,t/=i),(u=e*n+t*r)&&(n-=e*u,r-=t*u),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,u/=l),e*r<t*n&&(e=-e,t=-t,u=-u,i=-i),{translateX:s,translateY:o,rotate:Math.atan2(t,e)*um,skewX:Math.atan(u)*um,scaleX:i,scaleY:l}}var Ei;function LC(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Mc:Ny(t.a,t.b,t.c,t.d,t.e,t.f)}function AC(e){return e==null||(Ei||(Ei=document.createElementNS("http://www.w3.org/2000/svg","g")),Ei.setAttribute("transform",e),!(e=Ei.transform.baseVal.consolidate()))?Mc:(e=e.matrix,Ny(e.a,e.b,e.c,e.d,e.e,e.f))}function Sy(e,t,n,r){function s(c){return c.length?c.pop()+" ":""}function o(c,h,d,f,x,y){if(c!==d||h!==f){var w=x.push("translate(",null,t,null,n);y.push({i:w-4,x:Ut(c,d)},{i:w-2,x:Ut(h,f)})}else(d||f)&&x.push("translate("+d+t+f+n)}function i(c,h,d,f){c!==h?(c-h>180?h+=360:h-c>180&&(c+=360),f.push({i:d.push(s(d)+"rotate(",null,r)-2,x:Ut(c,h)})):h&&d.push(s(d)+"rotate("+h+r)}function l(c,h,d,f){c!==h?f.push({i:d.push(s(d)+"skewX(",null,r)-2,x:Ut(c,h)}):h&&d.push(s(d)+"skewX("+h+r)}function u(c,h,d,f,x,y){if(c!==d||h!==f){var w=x.push(s(x)+"scale(",null,",",null,")");y.push({i:w-4,x:Ut(c,d)},{i:w-2,x:Ut(h,f)})}else(d!==1||f!==1)&&x.push(s(x)+"scale("+d+","+f+")")}return function(c,h){var d=[],f=[];return c=e(c),h=e(h),o(c.translateX,c.translateY,h.translateX,h.translateY,d,f),i(c.rotate,h.rotate,d,f),l(c.skewX,h.skewX,d,f),u(c.scaleX,c.scaleY,h.scaleX,h.scaleY,d,f),c=h=null,function(x){for(var y=-1,w=f.length,N;++y<w;)d[(N=f[y]).i]=N.x(x);return d.join("")}}}var zC=Sy(LC,"px, ","px)","deg)"),DC=Sy(AC,", ",")",")"),$C=1e-12;function cm(e){return((e=Math.exp(e))+1/e)/2}function OC(e){return((e=Math.exp(e))-1/e)/2}function FC(e){return((e=Math.exp(2*e))-1)/(e+1)}const ea=function e(t,n,r){function s(o,i){var l=o[0],u=o[1],c=o[2],h=i[0],d=i[1],f=i[2],x=h-l,y=d-u,w=x*x+y*y,N,p;if(w<$C)p=Math.log(f/c)/t,N=function(j){return[l+j*x,u+j*y,c*Math.exp(t*j*p)]};else{var v=Math.sqrt(w),g=(f*f-c*c+r*w)/(2*c*n*v),S=(f*f-c*c-r*w)/(2*f*n*v),b=Math.log(Math.sqrt(g*g+1)-g),k=Math.log(Math.sqrt(S*S+1)-S);p=(k-b)/t,N=function(j){var _=j*p,I=cm(b),$=c/(n*v)*(I*FC(t*_+b)-OC(b));return[l+$*x,u+$*y,c*I/cm(t*_+b)]}}return N.duration=p*1e3*t/Math.SQRT2,N}return s.rho=function(o){var i=Math.max(.001,+o),l=i*i,u=l*l;return e(i,l,u)},s}(Math.SQRT2,2,4);var ms=0,eo=0,Ys=0,by=1e3,Da,to,$a=0,vr=0,gl=0,zo=typeof performance=="object"&&performance.now?performance:Date,jy=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function rf(){return vr||(jy(HC),vr=zo.now()+gl)}function HC(){vr=0}function Oa(){this._call=this._time=this._next=null}Oa.prototype=ky.prototype={constructor:Oa,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?rf():+n)+(t==null?0:+t),!this._next&&to!==this&&(to?to._next=this:Da=this,to=this),this._call=e,this._time=n,Ic()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ic())}};function ky(e,t,n){var r=new Oa;return r.restart(e,t,n),r}function VC(){rf(),++ms;for(var e=Da,t;e;)(t=vr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--ms}function dm(){vr=($a=zo.now())+gl,ms=eo=0;try{VC()}finally{ms=0,UC(),vr=0}}function BC(){var e=zo.now(),t=e-$a;t>by&&(gl-=t,$a=e)}function UC(){for(var e,t=Da,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:Da=n);to=e,Ic(r)}function Ic(e){if(!ms){eo&&(eo=clearTimeout(eo));var t=e-vr;t>24?(e<1/0&&(eo=setTimeout(dm,e-zo.now()-gl)),Ys&&(Ys=clearInterval(Ys))):(Ys||($a=zo.now(),Ys=setInterval(BC,by)),ms=1,jy(dm))}}function fm(e,t,n){var r=new Oa;return t=t==null?0:+t,r.restart(s=>{r.stop(),e(s+t)},t,n),r}var WC=ml("start","end","cancel","interrupt"),KC=[],Cy=0,hm=1,Rc=2,ta=3,mm=4,Tc=5,na=6;function xl(e,t,n,r,s,o){var i=e.__transition;if(!i)e.__transition={};else if(n in i)return;GC(e,n,{name:t,index:r,group:s,on:WC,tween:KC,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:Cy})}function sf(e,t){var n=Ot(e,t);if(n.state>Cy)throw new Error("too late; already scheduled");return n}function en(e,t){var n=Ot(e,t);if(n.state>ta)throw new Error("too late; already running");return n}function Ot(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function GC(e,t,n){var r=e.__transition,s;r[t]=n,n.timer=ky(o,0,n.time);function o(c){n.state=hm,n.timer.restart(i,n.delay,n.time),n.delay<=c&&i(c-n.delay)}function i(c){var h,d,f,x;if(n.state!==hm)return u();for(h in r)if(x=r[h],x.name===n.name){if(x.state===ta)return fm(i);x.state===mm?(x.state=na,x.timer.stop(),x.on.call("interrupt",e,e.__data__,x.index,x.group),delete r[h]):+h<t&&(x.state=na,x.timer.stop(),x.on.call("cancel",e,e.__data__,x.index,x.group),delete r[h])}if(fm(function(){n.state===ta&&(n.state=mm,n.timer.restart(l,n.delay,n.time),l(c))}),n.state=Rc,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Rc){for(n.state=ta,s=new Array(f=n.tween.length),h=0,d=-1;h<f;++h)(x=n.tween[h].value.call(e,e.__data__,n.index,n.group))&&(s[++d]=x);s.length=d+1}}function l(c){for(var h=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(u),n.state=Tc,1),d=-1,f=s.length;++d<f;)s[d].call(e,h);n.state===Tc&&(n.on.call("end",e,e.__data__,n.index,n.group),u())}function u(){n.state=na,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function ra(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>Rc&&r.state<Tc,r.state=na,r.timer.stop(),r.on.call(s?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[i]}o&&delete e.__transition}}function YC(e){return this.each(function(){ra(this,e)})}function XC(e,t){var n,r;return function(){var s=en(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 QC(e,t,n){var r,s;if(typeof n!="function")throw new Error;return function(){var o=en(this,e),i=o.tween;if(i!==r){s=(r=i).slice();for(var l={name:t,value:n},u=0,c=s.length;u<c;++u)if(s[u].name===t){s[u]=l;break}u===c&&s.push(l)}o.tween=s}}function qC(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Ot(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?XC:QC)(n,e,t))}function of(e,t,n){var r=e._id;return e.each(function(){var s=en(this,r);(s.value||(s.value={}))[t]=n.apply(this,arguments)}),function(s){return Ot(s,r).value[t]}}function Ey(e,t){var n;return(typeof t=="number"?Ut:t instanceof yr?za:(n=yr(t))?(t=n,za):wy)(e,t)}function ZC(e){return function(){this.removeAttribute(e)}}function JC(e){return function(){this.removeAttributeNS(e.space,e.local)}}function eE(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 tE(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 nE(e,t,n){var r,s,o;return function(){var i,l=n(this),u;return l==null?void this.removeAttribute(e):(i=this.getAttribute(e),u=l+"",i===u?null:i===r&&u===s?o:(s=u,o=t(r=i,l)))}}function rE(e,t,n){var r,s,o;return function(){var i,l=n(this),u;return l==null?void this.removeAttributeNS(e.space,e.local):(i=this.getAttributeNS(e.space,e.local),u=l+"",i===u?null:i===r&&u===s?o:(s=u,o=t(r=i,l)))}}function sE(e,t){var n=pl(e),r=n==="transform"?DC:Ey;return this.attrTween(e,typeof t=="function"?(n.local?rE:nE)(n,r,of(this,"attr."+e,t)):t==null?(n.local?JC:ZC)(n):(n.local?tE:eE)(n,r,t))}function oE(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function iE(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function aE(e,t){var n,r;function s(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&iE(e,o)),n}return s._value=t,s}function lE(e,t){var n,r;function s(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&oE(e,o)),n}return s._value=t,s}function uE(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=pl(e);return this.tween(n,(r.local?aE:lE)(r,t))}function cE(e,t){return function(){sf(this,e).delay=+t.apply(this,arguments)}}function dE(e,t){return t=+t,function(){sf(this,e).delay=t}}function fE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?cE:dE)(t,e)):Ot(this.node(),t).delay}function hE(e,t){return function(){en(this,e).duration=+t.apply(this,arguments)}}function mE(e,t){return t=+t,function(){en(this,e).duration=t}}function pE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?hE:mE)(t,e)):Ot(this.node(),t).duration}function gE(e,t){if(typeof t!="function")throw new Error;return function(){en(this,e).ease=t}}function xE(e){var t=this._id;return arguments.length?this.each(gE(t,e)):Ot(this.node(),t).ease}function yE(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;en(this,e).ease=n}}function vE(e){if(typeof e!="function")throw new Error;return this.each(yE(this._id,e))}function wE(e){typeof e!="function"&&(e=sy(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]=[],u,c=0;c<i;++c)(u=o[c])&&e.call(u,u.__data__,c,o)&&l.push(u);return new xn(r,this._parents,this._name,this._id)}function NE(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 u=t[l],c=n[l],h=u.length,d=i[l]=new Array(h),f,x=0;x<h;++x)(f=u[x]||c[x])&&(d[x]=f);for(;l<r;++l)i[l]=t[l];return new xn(i,this._parents,this._name,this._id)}function SE(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 bE(e,t,n){var r,s,o=SE(t)?sf:en;return function(){var i=o(this,e),l=i.on;l!==r&&(s=(r=l).copy()).on(t,n),i.on=s}}function jE(e,t){var n=this._id;return arguments.length<2?Ot(this.node(),n).on.on(e):this.each(bE(n,e,t))}function kE(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function CE(){return this.on("end.remove",kE(this._id))}function EE(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Jd(e));for(var r=this._groups,s=r.length,o=new Array(s),i=0;i<s;++i)for(var l=r[i],u=l.length,c=o[i]=new Array(u),h,d,f=0;f<u;++f)(h=l[f])&&(d=e.call(h,h.__data__,f,l))&&("__data__"in h&&(d.__data__=h.__data__),c[f]=d,xl(c[f],t,n,f,c,Ot(h,n)));return new xn(o,this._parents,t,n)}function _E(e){var t=this._name,n=this._id;typeof e!="function"&&(e=ry(e));for(var r=this._groups,s=r.length,o=[],i=[],l=0;l<s;++l)for(var u=r[l],c=u.length,h,d=0;d<c;++d)if(h=u[d]){for(var f=e.call(h,h.__data__,d,u),x,y=Ot(h,n),w=0,N=f.length;w<N;++w)(x=f[w])&&xl(x,t,n,w,f,y);o.push(f),i.push(h)}return new xn(o,i,t,n)}var PE=Qo.prototype.constructor;function ME(){return new PE(this._groups,this._parents)}function IE(e,t){var n,r,s;return function(){var o=hs(this,e),i=(this.style.removeProperty(e),hs(this,e));return o===i?null:o===n&&i===r?s:s=t(n=o,r=i)}}function _y(e){return function(){this.style.removeProperty(e)}}function RE(e,t,n){var r,s=n+"",o;return function(){var i=hs(this,e);return i===s?null:i===r?o:o=t(r=i,n)}}function TE(e,t,n){var r,s,o;return function(){var i=hs(this,e),l=n(this),u=l+"";return l==null&&(u=l=(this.style.removeProperty(e),hs(this,e))),i===u?null:i===r&&u===s?o:(s=u,o=t(r=i,l))}}function LE(e,t){var n,r,s,o="style."+t,i="end."+o,l;return function(){var u=en(this,e),c=u.on,h=u.value[o]==null?l||(l=_y(t)):void 0;(c!==n||s!==h)&&(r=(n=c).copy()).on(i,s=h),u.on=r}}function AE(e,t,n){var r=(e+="")=="transform"?zC:Ey;return t==null?this.styleTween(e,IE(e,r)).on("end.style."+e,_y(e)):typeof t=="function"?this.styleTween(e,TE(e,r,of(this,"style."+e,t))).each(LE(this._id,e)):this.styleTween(e,RE(e,r,t),n).on("end.style."+e,null)}function zE(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function DE(e,t,n){var r,s;function o(){var i=t.apply(this,arguments);return i!==s&&(r=(s=i)&&zE(e,i,n)),r}return o._value=t,o}function $E(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,DE(e,t,n??""))}function OE(e){return function(){this.textContent=e}}function FE(e){return function(){var t=e(this);this.textContent=t??""}}function HE(e){return this.tween("text",typeof e=="function"?FE(of(this,"text",e)):OE(e==null?"":e+""))}function VE(e){return function(t){this.textContent=e.call(this,t)}}function BE(e){var t,n;function r(){var s=e.apply(this,arguments);return s!==n&&(t=(n=s)&&VE(s)),t}return r._value=e,r}function UE(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,BE(e))}function WE(){for(var e=this._name,t=this._id,n=Py(),r=this._groups,s=r.length,o=0;o<s;++o)for(var i=r[o],l=i.length,u,c=0;c<l;++c)if(u=i[c]){var h=Ot(u,t);xl(u,e,n,c,i,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new xn(r,this._parents,e,n)}function KE(){var e,t,n=this,r=n._id,s=n.size();return new Promise(function(o,i){var l={value:i},u={value:function(){--s===0&&o()}};n.each(function(){var c=en(this,r),h=c.on;h!==e&&(t=(e=h).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(u)),c.on=t}),s===0&&o()})}var GE=0;function xn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Py(){return++GE}var rn=Qo.prototype;xn.prototype={constructor:xn,select:EE,selectAll:_E,selectChild:rn.selectChild,selectChildren:rn.selectChildren,filter:wE,merge:NE,selection:ME,transition:WE,call:rn.call,nodes:rn.nodes,node:rn.node,size:rn.size,empty:rn.empty,each:rn.each,on:jE,attr:sE,attrTween:uE,style:AE,styleTween:$E,text:HE,textTween:UE,remove:CE,tween:qC,delay:fE,duration:pE,ease:xE,easeVarying:vE,end:KE,[Symbol.iterator]:rn[Symbol.iterator]};function YE(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var XE={time:null,delay:0,duration:250,ease:YE};function QE(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 qE(e){var t,n;e instanceof xn?(t=e._id,e=e._name):(t=Py(),(n=XE).time=rf(),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,u,c=0;c<l;++c)(u=i[c])&&xl(u,e,t,c,i,n||QE(u,t));return new xn(r,this._parents,e,t)}Qo.prototype.interrupt=YC;Qo.prototype.transition=qE;const _i=e=>()=>e;function ZE(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 un(e,t,n){this.k=e,this.x=t,this.y=n}un.prototype={constructor:un,scale:function(e){return e===1?this:new un(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new un(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 yl=new un(1,0,0);My.prototype=un.prototype;function My(e){for(;!e.__zoom;)if(!(e=e.parentNode))return yl;return e.__zoom}function fu(e){e.stopImmediatePropagation()}function Xs(e){e.preventDefault(),e.stopImmediatePropagation()}function JE(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function e_(){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 pm(){return this.__zoom||yl}function t_(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function n_(){return navigator.maxTouchPoints||"ontouchstart"in this}function r_(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 Iy(){var e=JE,t=e_,n=r_,r=t_,s=n_,o=[0,1/0],i=[[-1/0,-1/0],[1/0,1/0]],l=250,u=ea,c=ml("start","zoom","end"),h,d,f,x=500,y=150,w=0,N=10;function p(C){C.property("__zoom",pm).on("wheel.zoom",_,{passive:!1}).on("mousedown.zoom",I).on("dblclick.zoom",$).filter(s).on("touchstart.zoom",R).on("touchmove.zoom",T).on("touchend.zoom touchcancel.zoom",A).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}p.transform=function(C,L,M,D){var E=C.selection?C.selection():C;E.property("__zoom",pm),C!==E?b(C,L,M,D):E.interrupt().each(function(){k(this,arguments).event(D).start().zoom(null,typeof L=="function"?L.apply(this,arguments):L).end()})},p.scaleBy=function(C,L,M,D){p.scaleTo(C,function(){var E=this.__zoom.k,P=typeof L=="function"?L.apply(this,arguments):L;return E*P},M,D)},p.scaleTo=function(C,L,M,D){p.transform(C,function(){var E=t.apply(this,arguments),P=this.__zoom,z=M==null?S(E):typeof M=="function"?M.apply(this,arguments):M,F=P.invert(z),O=typeof L=="function"?L.apply(this,arguments):L;return n(g(v(P,O),z,F),E,i)},M,D)},p.translateBy=function(C,L,M,D){p.transform(C,function(){return n(this.__zoom.translate(typeof L=="function"?L.apply(this,arguments):L,typeof M=="function"?M.apply(this,arguments):M),t.apply(this,arguments),i)},null,D)},p.translateTo=function(C,L,M,D,E){p.transform(C,function(){var P=t.apply(this,arguments),z=this.__zoom,F=D==null?S(P):typeof D=="function"?D.apply(this,arguments):D;return n(yl.translate(F[0],F[1]).scale(z.k).translate(typeof L=="function"?-L.apply(this,arguments):-L,typeof M=="function"?-M.apply(this,arguments):-M),P,i)},D,E)};function v(C,L){return L=Math.max(o[0],Math.min(o[1],L)),L===C.k?C:new un(L,C.x,C.y)}function g(C,L,M){var D=L[0]-M[0]*C.k,E=L[1]-M[1]*C.k;return D===C.x&&E===C.y?C:new un(C.k,D,E)}function S(C){return[(+C[0][0]+ +C[1][0])/2,(+C[0][1]+ +C[1][1])/2]}function b(C,L,M,D){C.on("start.zoom",function(){k(this,arguments).event(D).start()}).on("interrupt.zoom end.zoom",function(){k(this,arguments).event(D).end()}).tween("zoom",function(){var E=this,P=arguments,z=k(E,P).event(D),F=t.apply(E,P),O=M==null?S(F):typeof M=="function"?M.apply(E,P):M,U=Math.max(F[1][0]-F[0][0],F[1][1]-F[0][1]),B=E.__zoom,K=typeof L=="function"?L.apply(E,P):L,G=u(B.invert(O).concat(U/B.k),K.invert(O).concat(U/K.k));return function(Y){if(Y===1)Y=K;else{var V=G(Y),q=U/V[2];Y=new un(q,O[0]-V[0]*q,O[1]-V[1]*q)}z.zoom(null,Y)}})}function k(C,L,M){return!M&&C.__zooming||new j(C,L)}function j(C,L){this.that=C,this.args=L,this.active=0,this.sourceEvent=null,this.extent=t.apply(C,L),this.taps=0}j.prototype={event:function(C){return C&&(this.sourceEvent=C),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(C,L){return this.mouse&&C!=="mouse"&&(this.mouse[1]=L.invert(this.mouse[0])),this.touch0&&C!=="touch"&&(this.touch0[1]=L.invert(this.touch0[0])),this.touch1&&C!=="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(C){var L=dt(this.that).datum();c.call(C,this.that,new ZE(C,{sourceEvent:this.sourceEvent,target:p,transform:this.that.__zoom,dispatch:c}),L)}};function _(C,...L){if(!e.apply(this,arguments))return;var M=k(this,L).event(C),D=this.__zoom,E=Math.max(o[0],Math.min(o[1],D.k*Math.pow(2,r.apply(this,arguments)))),P=_t(C);if(M.wheel)(M.mouse[0][0]!==P[0]||M.mouse[0][1]!==P[1])&&(M.mouse[1]=D.invert(M.mouse[0]=P)),clearTimeout(M.wheel);else{if(D.k===E)return;M.mouse=[P,D.invert(P)],ra(this),M.start()}Xs(C),M.wheel=setTimeout(z,y),M.zoom("mouse",n(g(v(D,E),M.mouse[0],M.mouse[1]),M.extent,i));function z(){M.wheel=null,M.end()}}function I(C,...L){if(f||!e.apply(this,arguments))return;var M=C.currentTarget,D=k(this,L,!0).event(C),E=dt(C.view).on("mousemove.zoom",O,!0).on("mouseup.zoom",U,!0),P=_t(C,M),z=C.clientX,F=C.clientY;my(C.view),fu(C),D.mouse=[P,this.__zoom.invert(P)],ra(this),D.start();function O(B){if(Xs(B),!D.moved){var K=B.clientX-z,G=B.clientY-F;D.moved=K*K+G*G>w}D.event(B).zoom("mouse",n(g(D.that.__zoom,D.mouse[0]=_t(B,M),D.mouse[1]),D.extent,i))}function U(B){E.on("mousemove.zoom mouseup.zoom",null),py(B.view,D.moved),Xs(B),D.event(B).end()}}function $(C,...L){if(e.apply(this,arguments)){var M=this.__zoom,D=_t(C.changedTouches?C.changedTouches[0]:C,this),E=M.invert(D),P=M.k*(C.shiftKey?.5:2),z=n(g(v(M,P),D,E),t.apply(this,L),i);Xs(C),l>0?dt(this).transition().duration(l).call(b,z,D,C):dt(this).call(p.transform,z,D,C)}}function R(C,...L){if(e.apply(this,arguments)){var M=C.touches,D=M.length,E=k(this,L,C.changedTouches.length===D).event(C),P,z,F,O;for(fu(C),z=0;z<D;++z)F=M[z],O=_t(F,this),O=[O,this.__zoom.invert(O),F.identifier],E.touch0?!E.touch1&&E.touch0[2]!==O[2]&&(E.touch1=O,E.taps=0):(E.touch0=O,P=!0,E.taps=1+!!h);h&&(h=clearTimeout(h)),P&&(E.taps<2&&(d=O[0],h=setTimeout(function(){h=null},x)),ra(this),E.start())}}function T(C,...L){if(this.__zooming){var M=k(this,L).event(C),D=C.changedTouches,E=D.length,P,z,F,O;for(Xs(C),P=0;P<E;++P)z=D[P],F=_t(z,this),M.touch0&&M.touch0[2]===z.identifier?M.touch0[0]=F:M.touch1&&M.touch1[2]===z.identifier&&(M.touch1[0]=F);if(z=M.that.__zoom,M.touch1){var U=M.touch0[0],B=M.touch0[1],K=M.touch1[0],G=M.touch1[1],Y=(Y=K[0]-U[0])*Y+(Y=K[1]-U[1])*Y,V=(V=G[0]-B[0])*V+(V=G[1]-B[1])*V;z=v(z,Math.sqrt(Y/V)),F=[(U[0]+K[0])/2,(U[1]+K[1])/2],O=[(B[0]+G[0])/2,(B[1]+G[1])/2]}else if(M.touch0)F=M.touch0[0],O=M.touch0[1];else return;M.zoom("touch",n(g(z,F,O),M.extent,i))}}function A(C,...L){if(this.__zooming){var M=k(this,L).event(C),D=C.changedTouches,E=D.length,P,z;for(fu(C),f&&clearTimeout(f),f=setTimeout(function(){f=null},x),P=0;P<E;++P)z=D[P],M.touch0&&M.touch0[2]===z.identifier?delete M.touch0:M.touch1&&M.touch1[2]===z.identifier&&delete M.touch1;if(M.touch1&&!M.touch0&&(M.touch0=M.touch1,delete M.touch1),M.touch0)M.touch0[1]=this.__zoom.invert(M.touch0[0]);else if(M.end(),M.taps===2&&(z=_t(z,this),Math.hypot(d[0]-z[0],d[1]-z[1])<N)){var F=dt(this).on("dblclick.zoom");F&&F.apply(this,arguments)}}}return p.wheelDelta=function(C){return arguments.length?(r=typeof C=="function"?C:_i(+C),p):r},p.filter=function(C){return arguments.length?(e=typeof C=="function"?C:_i(!!C),p):e},p.touchable=function(C){return arguments.length?(s=typeof C=="function"?C:_i(!!C),p):s},p.extent=function(C){return arguments.length?(t=typeof C=="function"?C:_i([[+C[0][0],+C[0][1]],[+C[1][0],+C[1][1]]]),p):t},p.scaleExtent=function(C){return arguments.length?(o[0]=+C[0],o[1]=+C[1],p):[o[0],o[1]]},p.translateExtent=function(C){return arguments.length?(i[0][0]=+C[0][0],i[1][0]=+C[1][0],i[0][1]=+C[0][1],i[1][1]=+C[1][1],p):[[i[0][0],i[0][1]],[i[1][0],i[1][1]]]},p.constrain=function(C){return arguments.length?(n=C,p):n},p.duration=function(C){return arguments.length?(l=+C,p):l},p.interpolate=function(C){return arguments.length?(u=C,p):u},p.on=function(){var C=c.on.apply(c,arguments);return C===c?p:C},p.clickDistance=function(C){return arguments.length?(w=(C=+C)*C,p):Math.sqrt(w)},p.tapDistance=function(C){return arguments.length?(N=+C,p):N},p}const Jt={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."},Do=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Ry=["Enter"," ","Escape"],Ty={"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 ps;(function(e){e.Strict="strict",e.Loose="loose"})(ps||(ps={}));var cr;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(cr||(cr={}));var $o;(function(e){e.Partial="partial",e.Full="full"})($o||($o={}));const Ly={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 Fa;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Fa||(Fa={}));var X;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(X||(X={}));const gm={[X.Left]:X.Right,[X.Right]:X.Left,[X.Top]:X.Bottom,[X.Bottom]:X.Top};function Ay(e){return e===null?null:e?"valid":"invalid"}const zy=e=>"id"in e&&"source"in e&&"target"in e,s_=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),af=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Zo=(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}},o_=(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):af(s)?s:t.nodeLookup.get(s.id));const l=i?Ha(i,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return vl(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return wl(n)},Jo=(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=vl(n,Ha(s)),r=!0)}),r?wl(n):{x:0,y:0,width:0,height:0}},lf=(e,t,[n,r,s]=[0,0,1],o=!1,i=!1)=>{const l={...ti(t,[n,r,s]),width:t.width/s,height:t.height/s},u=[];for(const c of e.values()){const{measured:h,selectable:d=!0,hidden:f=!1}=c;if(i&&!d||f)continue;const x=h.width??c.width??c.initialWidth??null,y=h.height??c.height??c.initialHeight??null,w=Oo(l,xs(c)),N=(x??0)*(y??0),p=o&&w>0;(!c.internals.handleBounds||p||w>=N||c.dragging)&&u.push(c)}return u},i_=(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 a_(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 l_({nodes:e,width:t,height:n,panZoom:r,minZoom:s,maxZoom:o},i){if(e.size===0)return Promise.resolve(!0);const l=a_(e,i),u=Jo(l),c=uf(u,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(c,{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 Dy({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:u,y:c}=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",Jt.error005());else{const x=l.measured.width,y=l.measured.height;x&&y&&(d=[[u,c],[u+x,c+y]])}else l&&ys(i.extent)&&(d=[[i.extent[0][0]+u,i.extent[0][1]+c],[i.extent[1][0]+u,i.extent[1][1]+c]]);const f=ys(d)?wr(t,d,i.measured):t;return(i.measured.width===void 0||i.measured.height===void 0)&&(o==null||o("015",Jt.error015())),{position:{x:f.x-u+(i.measured.width??0)*h[0],y:f.y-c+(i.measured.height??0)*h[1]},positionAbsolute:f}}async function u_({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 x=o.has(f.id),y=!x&&f.parentId&&i.find(w=>w.id===f.parentId);(x||y)&&i.push(f)}const l=new Set(t.map(f=>f.id)),u=r.filter(f=>f.deletable!==!1),h=i_(i,u);for(const f of u)l.has(f.id)&&!h.find(y=>y.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 gs=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),wr=(e={x:0,y:0},t,n)=>({x:gs(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:gs(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function $y(e,t,n){const{width:r,height:s}=wn(n),{x:o,y:i}=n.internals.positionAbsolute;return wr(e,[[o,i],[o+r,i+s]],t)}const xm=(e,t,n)=>e<t?gs(Math.abs(e-t),1,t)/t:e>n?-gs(Math.abs(e-n),1,t)/t:0,Oy=(e,t,n=15,r=40)=>{const s=xm(e.x,r,t.width-r)*n,o=xm(e.y,r,t.height-r)*n;return[s,o]},vl=(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)}),Lc=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),wl=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),xs=(e,t=[0,0])=>{var s,o;const{x:n,y:r}=af(e)?e.internals.positionAbsolute:Zo(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}},Ha=(e,t=[0,0])=>{var s,o;const{x:n,y:r}=af(e)?e.internals.positionAbsolute:Zo(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)}},Fy=(e,t)=>wl(vl(Lc(e),Lc(t))),Oo=(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)},ym=e=>It(e.width)&&It(e.height)&&It(e.x)&&It(e.y),It=e=>!isNaN(e)&&isFinite(e),c_=(e,t)=>{},ei=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),ti=({x:e,y:t},[n,r,s],o=!1,i=[1,1])=>{const l={x:(e-n)/s,y:(t-r)/s};return o?ei(l,i):l},Va=({x:e,y:t},[n,r,s])=>({x:e*s+n,y:t*s+r});function Mr(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 d_(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=Mr(e,n),s=Mr(e,t);return{top:r,right:s,bottom:r,left:s,x:s*2,y:r*2}}if(typeof e=="object"){const r=Mr(e.top??e.y??0,n),s=Mr(e.bottom??e.y??0,n),o=Mr(e.left??e.x??0,t),i=Mr(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 f_(e,t,n,r,s,o){const{x:i,y:l}=Va(e,[t,n,r]),{x:u,y:c}=Va({x:e.x+e.width,y:e.y+e.height},[t,n,r]),h=s-u,d=o-c;return{left:Math.floor(i),top:Math.floor(l),right:Math.floor(h),bottom:Math.floor(d)}}const uf=(e,t,n,r,s,o)=>{const i=d_(o,t,n),l=(t-i.x)/e.width,u=(n-i.y)/e.height,c=Math.min(l,u),h=gs(c,r,s),d=e.x+e.width/2,f=e.y+e.height/2,x=t/2-d*h,y=n/2-f*h,w=f_(e,x,y,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:x-N.left+N.right,y:y-N.top+N.bottom,zoom:h}},Fo=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function ys(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 Hy(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 Vy(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 vm(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function h_(){let e,t;return{promise:new Promise((r,s)=>{e=r,t=s}),resolve:e,reject:t}}function m_(e){return{...Ty,...e||{}}}function ho(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:s}){const{x:o,y:i}=Rt(e),l=ti({x:o-((s==null?void 0:s.left)??0),y:i-((s==null?void 0:s.top)??0)},r),{x:u,y:c}=n?ei(l,t):l;return{xSnapped:u,ySnapped:c,...l}}const cf=e=>({width:e.offsetWidth,height:e.offsetHeight}),By=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},p_=["INPUT","SELECT","TEXTAREA"];function Uy(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:p_.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const Wy=e=>"clientX"in e,Rt=(e,t)=>{var o,i;const n=Wy(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)}},wm=(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,...cf(i)}})};function Ky({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:s,sourceControlY:o,targetControlX:i,targetControlY:l}){const u=e*.125+s*.375+i*.375+n*.125,c=t*.125+o*.375+l*.375+r*.125,h=Math.abs(u-e),d=Math.abs(c-t);return[u,c,h,d]}function Pi(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Nm({pos:e,x1:t,y1:n,x2:r,y2:s,c:o}){switch(e){case X.Left:return[t-Pi(t-r,o),n];case X.Right:return[t+Pi(r-t,o),n];case X.Top:return[t,n-Pi(n-s,o)];case X.Bottom:return[t,n+Pi(s-n,o)]}}function Gy({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:r,targetY:s,targetPosition:o=X.Top,curvature:i=.25}){const[l,u]=Nm({pos:n,x1:e,y1:t,x2:r,y2:s,c:i}),[c,h]=Nm({pos:o,x1:r,y1:s,x2:e,y2:t,c:i}),[d,f,x,y]=Ky({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:l,sourceControlY:u,targetControlX:c,targetControlY:h});return[`M${e},${t} C${l},${u} ${c},${h} ${r},${s}`,d,f,x,y]}function Yy({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 g_({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 x_({sourceNode:e,targetNode:t,width:n,height:r,transform:s}){const o=vl(Ha(e),Ha(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 Oo(i,wl(o))>0}const y_=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,v_=(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)),w_=(e,t,n={})=>{if(!e.source||!e.target)return t;const r=n.getEdgeId||y_;let s;return zy(e)?s={...e}:s={...e,id:r(e)},v_(s,t)?t:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,t.concat(s))};function Xy({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[s,o,i,l]=Yy({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,s,o,i,l]}const Sm={[X.Left]:{x:-1,y:0},[X.Right]:{x:1,y:0},[X.Top]:{x:0,y:-1},[X.Bottom]:{x:0,y:1}},N_=({source:e,sourcePosition:t=X.Bottom,target:n})=>t===X.Left||t===X.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},bm=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function S_({source:e,sourcePosition:t=X.Bottom,target:n,targetPosition:r=X.Top,center:s,offset:o,stepPosition:i}){const l=Sm[t],u=Sm[r],c={x:e.x+l.x*o,y:e.y+l.y*o},h={x:n.x+u.x*o,y:n.y+u.y*o},d=N_({source:c,sourcePosition:t,target:h}),f=d.x!==0?"x":"y",x=d[f];let y=[],w,N;const p={x:0,y:0},v={x:0,y:0},[,,g,S]=Yy({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[f]*u[f]===-1){f==="x"?(w=s.x??c.x+(h.x-c.x)*i,N=s.y??(c.y+h.y)/2):(w=s.x??(c.x+h.x)/2,N=s.y??c.y+(h.y-c.y)*i);const k=[{x:w,y:c.y},{x:w,y:h.y}],j=[{x:c.x,y:N},{x:h.x,y:N}];l[f]===x?y=f==="x"?k:j:y=f==="x"?j:k}else{const k=[{x:c.x,y:h.y}],j=[{x:h.x,y:c.y}];if(f==="x"?y=l.x===x?j:k:y=l.y===x?k:j,t===r){const T=Math.abs(e[f]-n[f]);if(T<=o){const A=Math.min(o-1,o-T);l[f]===x?p[f]=(c[f]>e[f]?-1:1)*A:v[f]=(h[f]>n[f]?-1:1)*A}}if(t!==r){const T=f==="x"?"y":"x",A=l[f]===u[T],C=c[T]>h[T],L=c[T]<h[T];(l[f]===1&&(!A&&C||A&&L)||l[f]!==1&&(!A&&L||A&&C))&&(y=f==="x"?k:j)}const _={x:c.x+p.x,y:c.y+p.y},I={x:h.x+v.x,y:h.y+v.y},$=Math.max(Math.abs(_.x-y[0].x),Math.abs(I.x-y[0].x)),R=Math.max(Math.abs(_.y-y[0].y),Math.abs(I.y-y[0].y));$>=R?(w=(_.x+I.x)/2,N=y[0].y):(w=y[0].x,N=(_.y+I.y)/2)}return[[e,{x:c.x+p.x,y:c.y+p.y},...y,{x:h.x+v.x,y:h.y+v.y},n],w,N,g,S]}function b_(e,t,n,r){const s=Math.min(bm(e,t)/2,bm(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 c=e.x<n.x?-1:1,h=e.y<n.y?1:-1;return`L ${o+s*c},${i}Q ${o},${i} ${o},${i+s*h}`}const l=e.x<n.x?1:-1,u=e.y<n.y?-1:1;return`L ${o},${i+s*u}Q ${o},${i} ${o+s*l},${i}`}function Ac({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:r,targetY:s,targetPosition:o=X.Top,borderRadius:i=5,centerX:l,centerY:u,offset:c=20,stepPosition:h=.5}){const[d,f,x,y,w]=S_({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:s},targetPosition:o,center:{x:l,y:u},offset:c,stepPosition:h});return[d.reduce((p,v,g)=>{let S="";return g>0&&g<d.length-1?S=b_(d[g-1],v,d[g+1],i):S=`${g===0?"M":"L"}${v.x} ${v.y}`,p+=S,p},""),f,x,y,w]}function jm(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function j_(e){var d;const{sourceNode:t,targetNode:n}=e;if(!jm(t)||!jm(n))return null;const r=t.internals.handleBounds||km(t.handles),s=n.internals.handleBounds||km(n.handles),o=Cm((r==null?void 0:r.source)??[],e.sourceHandle),i=Cm(e.connectionMode===ps.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",Jt.error008(o?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(o==null?void 0:o.position)||X.Bottom,u=(i==null?void 0:i.position)||X.Top,c=Nr(t,o,l),h=Nr(n,i,u);return{sourceX:c.x,sourceY:c.y,targetX:h.x,targetY:h.y,sourcePosition:l,targetPosition:u}}function km(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 Nr(e,t,n=X.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 X.Top:return{x:s+i/2,y:o};case X.Right:return{x:s+i,y:o+l/2};case X.Bottom:return{x:s+i/2,y:o+l};case X.Left:return{x:s,y:o+l/2}}}function Cm(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function zc(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function k_(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(u=>{if(u&&typeof u=="object"){const c=zc(u,t);o.has(c)||(i.push({id:c,color:u.color||n,...u}),o.add(c))}}),i),[]).sort((i,l)=>i.id.localeCompare(l.id))}const Qy=1e3,C_=10,df={nodeOrigin:[0,0],nodeExtent:Do,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},E_={...df,checkEquality:!0};function ff(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function __(e,t,n){const r=ff(df,n);for(const s of e.values())if(s.parentId)mf(s,e,t,r);else{const o=Zo(s,r.nodeOrigin),i=ys(s.extent)?s.extent:r.nodeExtent,l=wr(o,i,wn(s));s.internals.positionAbsolute=l}}function P_(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 hf(e){return e==="manual"}function Dc(e,t,n,r={}){var c,h;const s=ff(E_,r),o={i:0},i=new Map(t),l=s!=null&&s.elevateNodesOnSelect&&!hf(s.zIndexMode)?Qy:0;let u=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 x=Zo(d,s.nodeOrigin),y=ys(d.extent)?d.extent:s.nodeExtent,w=wr(x,y,wn(d));f={...s.defaults,...d,measured:{width:(c=d.measured)==null?void 0:c.width,height:(h=d.measured)==null?void 0:h.height},internals:{positionAbsolute:w,handleBounds:P_(d,f),z:qy(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&&(u=!1),d.parentId&&mf(f,t,n,r,o)}return u}function M_(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 mf(e,t,n,r,s){const{elevateNodesOnSelect:o,nodeOrigin:i,nodeExtent:l,zIndexMode:u}=ff(df,r),c=e.parentId,h=t.get(c);if(!h){console.warn(`Parent node ${c} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}M_(e,n),s&&!h.parentId&&h.internals.rootParentIndex===void 0&&u==="auto"&&(h.internals.rootParentIndex=++s.i,h.internals.z=h.internals.z+s.i*C_),s&&h.internals.rootParentIndex!==void 0&&(s.i=h.internals.rootParentIndex);const d=o&&!hf(u)?Qy:0,{x:f,y:x,z:y}=I_(e,h,i,l,d,u),{positionAbsolute:w}=e.internals,N=f!==w.x||x!==w.y;(N||y!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:N?{x:f,y:x}:w,z:y}})}function qy(e,t,n){const r=It(e.zIndex)?e.zIndex:0;return hf(n)?r:r+(e.selected?t:0)}function I_(e,t,n,r,s,o){const{x:i,y:l}=t.internals.positionAbsolute,u=wn(e),c=Zo(e,n),h=ys(e.extent)?wr(c,e.extent,u):c;let d=wr({x:i+h.x,y:l+h.y},r,u);e.extent==="parent"&&(d=$y(d,u,t));const f=qy(e,s,o),x=t.internals.z??0;return{x:d.x,y:d.y,z:x>=f?x+1:f}}function pf(e,t,n,r=[0,0]){var i;const s=[],o=new Map;for(const l of e){const u=t.get(l.parentId);if(!u)continue;const c=((i=o.get(l.parentId))==null?void 0:i.expandedRect)??xs(u),h=Fy(c,l.rect);o.set(l.parentId,{expandedRect:h,parent:u})}return o.size>0&&o.forEach(({expandedRect:l,parent:u},c)=>{var g;const h=u.internals.positionAbsolute,d=wn(u),f=u.origin??r,x=l.x<h.x?Math.round(Math.abs(h.x-l.x)):0,y=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];(x>0||y>0||p||v)&&(s.push({id:c,type:"position",position:{x:u.position.x-x+p,y:u.position.y-y+v}}),(g=n.get(c))==null||g.forEach(S=>{e.some(b=>b.id===S.id)||s.push({id:S.id,type:"position",position:{x:S.position.x+x,y:S.position.y+y}})})),(d.width<l.width||d.height<l.height||x||y)&&s.push({id:c,type:"dimensions",setAttributes:!0,dimensions:{width:w+(x?f[0]*x-p:0),height:N+(y?f[1]*y-v:0)}})}),s}function R_(e,t,n,r,s,o,i){const l=r==null?void 0:r.querySelector(".xyflow__viewport");let u=!1;if(!l)return{changes:[],updatedInternals:u};const c=[],h=window.getComputedStyle(l),{m22:d}=new window.DOMMatrixReadOnly(h.transform),f=[];for(const x of e.values()){const y=t.get(x.id);if(!y)continue;if(y.hidden){t.set(y.id,{...y,internals:{...y.internals,handleBounds:void 0}}),u=!0;continue}const w=cf(x.nodeElement),N=y.measured.width!==w.width||y.measured.height!==w.height;if(!!(w.width&&w.height&&(N||!y.internals.handleBounds||x.force))){const v=x.nodeElement.getBoundingClientRect(),g=ys(y.extent)?y.extent:o;let{positionAbsolute:S}=y.internals;y.parentId&&y.extent==="parent"?S=$y(S,w,t.get(y.parentId)):g&&(S=wr(S,g,w));const b={...y,measured:w,internals:{...y.internals,positionAbsolute:S,handleBounds:{source:wm("source",x.nodeElement,v,d,y.id),target:wm("target",x.nodeElement,v,d,y.id)}}};t.set(y.id,b),y.parentId&&mf(b,t,n,{nodeOrigin:s,zIndexMode:i}),u=!0,N&&(c.push({id:y.id,type:"dimensions",dimensions:w}),y.expandParent&&y.parentId&&f.push({id:y.id,parentId:y.parentId,rect:xs(b,s)}))}}if(f.length>0){const x=pf(f,t,n,s);c.push(...x)}return{changes:c,updatedInternals:u}}async function T_({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 Em(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 u=r.get(i)||new Map;if(r.set(i,u.set(n,t)),o){i=`${s}-${e}-${o}`;const c=r.get(i)||new Map;r.set(i,c.set(n,t))}}function Zy(e,t,n){e.clear(),t.clear();for(const r of n){const{source:s,target:o,sourceHandle:i=null,targetHandle:l=null}=r,u={edgeId:r.id,source:s,target:o,sourceHandle:i,targetHandle:l},c=`${s}-${i}--${o}-${l}`,h=`${o}-${l}--${s}-${i}`;Em("source",u,h,e,s,i),Em("target",u,c,e,o,l),t.set(r.id,r)}}function Jy(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:Jy(n,t):!1}function _m(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 L_(e,t,n,r){const s=new Map;for(const[o,i]of e)if((i.selected||i.id===r)&&(!i.parentId||!Jy(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 hu({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var i,l,u;const s=[];for(const[c,h]of t){const d=(i=n.get(c))==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:((u=t.get(e))==null?void 0:u.position)||o.position,dragging:r}:s[0],s]}function A_({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=ei(o,t);return{x:i.x-o.x,y:i.y-o.y}}function z_({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:s}){let o={x:null,y:null},i=0,l=new Map,u=!1,c={x:0,y:0},h=null,d=!1,f=null,x=!1,y=!1,w=null;function N({noDragClassName:v,handleSelector:g,domNode:S,isSelectable:b,nodeId:k,nodeClickDistance:j=0}){f=dt(S);function _({x:T,y:A}){const{nodeLookup:C,nodeExtent:L,snapGrid:M,snapToGrid:D,nodeOrigin:E,onNodeDrag:P,onSelectionDrag:z,onError:F,updateNodePositions:O}=t();o={x:T,y:A};let U=!1;const B=l.size>1,K=B&&L?Lc(Jo(l)):null,G=B&&D?A_({dragItems:l,snapGrid:M,x:T,y:A}):null;for(const[Y,V]of l){if(!C.has(Y))continue;let q={x:T-V.distance.x,y:A-V.distance.y};D&&(q=G?{x:Math.round(q.x+G.x),y:Math.round(q.y+G.y)}:ei(q,M));let se=null;if(B&&L&&!V.extent&&K){const{positionAbsolute:Z}=V.internals,ue=Z.x-K.x+L[0][0],he=Z.x+V.measured.width-K.x2+L[1][0],le=Z.y-K.y+L[0][1],Be=Z.y+V.measured.height-K.y2+L[1][1];se=[[ue,le],[he,Be]]}const{position:te,positionAbsolute:ee}=Dy({nodeId:Y,nextPosition:q,nodeLookup:C,nodeExtent:se||L,nodeOrigin:E,onError:F});U=U||V.position.x!==te.x||V.position.y!==te.y,V.position=te,V.internals.positionAbsolute=ee}if(y=y||U,!!U&&(O(l,!0),w&&(r||P||!k&&z))){const[Y,V]=hu({nodeId:k,dragItems:l,nodeLookup:C});r==null||r(w,l,Y,V),P==null||P(w,Y,V),k||z==null||z(w,V)}}async function I(){if(!h)return;const{transform:T,panBy:A,autoPanSpeed:C,autoPanOnNodeDrag:L}=t();if(!L){u=!1,cancelAnimationFrame(i);return}const[M,D]=Oy(c,h,C);(M!==0||D!==0)&&(o.x=(o.x??0)-M/T[2],o.y=(o.y??0)-D/T[2],await A({x:M,y:D})&&_(o)),i=requestAnimationFrame(I)}function $(T){var B;const{nodeLookup:A,multiSelectionActive:C,nodesDraggable:L,transform:M,snapGrid:D,snapToGrid:E,selectNodesOnDrag:P,onNodeDragStart:z,onSelectionDragStart:F,unselectNodesAndEdges:O}=t();d=!0,(!P||!b)&&!C&&k&&((B=A.get(k))!=null&&B.selected||O()),b&&P&&k&&(e==null||e(k));const U=ho(T.sourceEvent,{transform:M,snapGrid:D,snapToGrid:E,containerBounds:h});if(o=U,l=L_(A,L,U,k),l.size>0&&(n||z||!k&&F)){const[K,G]=hu({nodeId:k,dragItems:l,nodeLookup:A});n==null||n(T.sourceEvent,l,K,G),z==null||z(T.sourceEvent,K,G),k||F==null||F(T.sourceEvent,G)}}const R=gy().clickDistance(j).on("start",T=>{const{domNode:A,nodeDragThreshold:C,transform:L,snapGrid:M,snapToGrid:D}=t();h=(A==null?void 0:A.getBoundingClientRect())||null,x=!1,y=!1,w=T.sourceEvent,C===0&&$(T),o=ho(T.sourceEvent,{transform:L,snapGrid:M,snapToGrid:D,containerBounds:h}),c=Rt(T.sourceEvent,h)}).on("drag",T=>{const{autoPanOnNodeDrag:A,transform:C,snapGrid:L,snapToGrid:M,nodeDragThreshold:D,nodeLookup:E}=t(),P=ho(T.sourceEvent,{transform:C,snapGrid:L,snapToGrid:M,containerBounds:h});if(w=T.sourceEvent,(T.sourceEvent.type==="touchmove"&&T.sourceEvent.touches.length>1||k&&!E.has(k))&&(x=!0),!x){if(!u&&A&&d&&(u=!0,I()),!d){const z=Rt(T.sourceEvent,h),F=z.x-c.x,O=z.y-c.y;Math.sqrt(F*F+O*O)>D&&$(T)}(o.x!==P.xSnapped||o.y!==P.ySnapped)&&l&&d&&(c=Rt(T.sourceEvent,h),_(P))}}).on("end",T=>{if(!(!d||x)&&(u=!1,d=!1,cancelAnimationFrame(i),l.size>0)){const{nodeLookup:A,updateNodePositions:C,onNodeDragStop:L,onSelectionDragStop:M}=t();if(y&&(C(l,!1),y=!1),s||L||!k&&M){const[D,E]=hu({nodeId:k,dragItems:l,nodeLookup:A,dragging:!1});s==null||s(T.sourceEvent,l,D,E),L==null||L(T.sourceEvent,D,E),k||M==null||M(T.sourceEvent,E)}}}).filter(T=>{const A=T.target;return!T.button&&(!v||!_m(A,`.${v}`,S))&&(!g||_m(A,g,S))});f.call(R)}function p(){f==null||f.on(".drag",null)}return{update:N,destroy:p}}function D_(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())Oo(s,xs(o))>0&&r.push(o);return r}const $_=250;function O_(e,t,n,r){var l,u;let s=[],o=1/0;const i=D_(e,n,t+$_);for(const c of i){const h=[...((l=c.internals.handleBounds)==null?void 0:l.source)??[],...((u=c.internals.handleBounds)==null?void 0:u.target)??[]];for(const d of h){if(r.nodeId===d.nodeId&&r.type===d.type&&r.id===d.id)continue;const{x:f,y:x}=Nr(c,d,d.position,!0),y=Math.sqrt(Math.pow(f-e.x,2)+Math.pow(x-e.y,2));y>t||(y<o?(s=[{...d,x:f,y:x}],o=y):y===o&&s.push({...d,x:f,y:x}))}}if(!s.length)return null;if(s.length>1){const c=r.type==="source"?"target":"source";return s.find(h=>h.type===c)??s[0]}return s[0]}function e0(e,t,n,r,s,o=!1){var c,h,d;const i=r.get(e);if(!i)return null;const l=s==="strict"?(c=i.internals.handleBounds)==null?void 0:c[t]:[...((h=i.internals.handleBounds)==null?void 0:h.source)??[],...((d=i.internals.handleBounds)==null?void 0:d.target)??[]],u=(n?l==null?void 0:l.find(f=>f.id===n):l==null?void 0:l[0])??null;return u&&o?{...u,...Nr(i,u,u.position,!0)}:u}function t0(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function F_(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const n0=()=>!0;function H_(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:s,edgeUpdaterType:o,isTarget:i,domNode:l,nodeLookup:u,lib:c,autoPanOnConnect:h,flowId:d,panBy:f,cancelConnection:x,onConnectStart:y,onConnect:w,onConnectEnd:N,isValidConnection:p=n0,onReconnectEnd:v,updateConnection:g,getTransform:S,getFromHandle:b,autoPanSpeed:k,dragThreshold:j=1,handleDomNode:_}){const I=By(e.target);let $=0,R;const{x:T,y:A}=Rt(e),C=t0(o,_),L=l==null?void 0:l.getBoundingClientRect();let M=!1;if(!L||!C)return;const D=e0(s,C,r,u,t);if(!D)return;let E=Rt(e,L),P=!1,z=null,F=!1,O=null;function U(){if(!h||!L)return;const[te,ee]=Oy(E,L,k);f({x:te,y:ee}),$=requestAnimationFrame(U)}const B={...D,nodeId:s,type:C,position:D.position},K=u.get(s);let Y={inProgress:!0,isValid:null,from:Nr(K,B,X.Left,!0),fromHandle:B,fromPosition:B.position,fromNode:K,to:E,toHandle:null,toPosition:gm[B.position],toNode:null,pointer:E};function V(){M=!0,g(Y),y==null||y(e,{nodeId:s,handleId:r,handleType:C})}j===0&&V();function q(te){if(!M){const{x:Be,y:Nn}=Rt(te),tn=Be-T,Zn=Nn-A;if(!(tn*tn+Zn*Zn>j*j))return;V()}if(!b()||!B){se(te);return}const ee=S();E=Rt(te,L),R=O_(ti(E,ee,!1,[1,1]),n,u,B),P||(U(),P=!0);const Z=r0(te,{handle:R,connectionMode:t,fromNodeId:s,fromHandleId:r,fromType:i?"target":"source",isValidConnection:p,doc:I,lib:c,flowId:d,nodeLookup:u});O=Z.handleDomNode,z=Z.connection,F=F_(!!R,Z.isValid);const ue=u.get(s),he=ue?Nr(ue,B,X.Left,!0):Y.from,le={...Y,from:he,isValid:F,to:Z.toHandle&&F?Va({x:Z.toHandle.x,y:Z.toHandle.y},ee):E,toHandle:Z.toHandle,toPosition:F&&Z.toHandle?Z.toHandle.position:gm[B.position],toNode:Z.toHandle?u.get(Z.toHandle.nodeId):null,pointer:E};g(le),Y=le}function se(te){if(!("touches"in te&&te.touches.length>0)){if(M){(R||O)&&z&&F&&(w==null||w(z));const{inProgress:ee,...Z}=Y,ue={...Z,toPosition:Y.toHandle?Y.toPosition:null};N==null||N(te,ue),o&&(v==null||v(te,ue))}x(),cancelAnimationFrame($),P=!1,F=!1,z=null,O=null,I.removeEventListener("mousemove",q),I.removeEventListener("mouseup",se),I.removeEventListener("touchmove",q),I.removeEventListener("touchend",se)}}I.addEventListener("mousemove",q),I.addEventListener("mouseup",se),I.addEventListener("touchmove",q),I.addEventListener("touchend",se)}function r0(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:s,fromType:o,doc:i,lib:l,flowId:u,isValidConnection:c=n0,nodeLookup:h}){const d=o==="target",f=t?i.querySelector(`.${l}-flow__handle[data-id="${u}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x,y}=Rt(e),w=i.elementFromPoint(x,y),N=w!=null&&w.classList.contains(`${l}-flow__handle`)?w:f,p={handleDomNode:N,isValid:!1,connection:null,toHandle:null};if(N){const v=t0(void 0,N),g=N.getAttribute("data-nodeid"),S=N.getAttribute("data-handleid"),b=N.classList.contains("connectable"),k=N.classList.contains("connectableend");if(!g||!v)return p;const j={source:d?g:r,sourceHandle:d?S:s,target:d?r:g,targetHandle:d?s:S};p.connection=j;const I=b&&k&&(n===ps.Strict?d&&v==="source"||!d&&v==="target":g!==r||S!==s);p.isValid=I&&c(j),p.toHandle=e0(g,v,S,h,n,!0)}return p}const $c={onPointerDown:H_,isValid:r0};function V_({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const s=dt(e);function o({translateExtent:l,width:u,height:c,zoomStep:h=1,pannable:d=!0,zoomable:f=!0,inversePan:x=!1}){const y=g=>{if(g.sourceEvent.type!=="wheel"||!t)return;const S=n(),b=g.sourceEvent.ctrlKey&&Fo()?10:1,k=-g.sourceEvent.deltaY*(g.sourceEvent.deltaMode===1?.05:g.sourceEvent.deltaMode?1:.002)*h,j=S[2]*Math.pow(2,k*b);t.scaleTo(j)};let w=[0,0];const N=g=>{(g.sourceEvent.type==="mousedown"||g.sourceEvent.type==="touchstart")&&(w=[g.sourceEvent.clientX??g.sourceEvent.touches[0].clientX,g.sourceEvent.clientY??g.sourceEvent.touches[0].clientY])},p=g=>{const S=n();if(g.sourceEvent.type!=="mousemove"&&g.sourceEvent.type!=="touchmove"||!t)return;const b=[g.sourceEvent.clientX??g.sourceEvent.touches[0].clientX,g.sourceEvent.clientY??g.sourceEvent.touches[0].clientY],k=[b[0]-w[0],b[1]-w[1]];w=b;const j=r()*Math.max(S[2],Math.log(S[2]))*(x?-1:1),_={x:S[0]-k[0]*j,y:S[1]-k[1]*j},I=[[0,0],[u,c]];t.setViewportConstrained({x:_.x,y:_.y,zoom:S[2]},I,l)},v=Iy().on("start",N).on("zoom",d?p:null).on("zoom.wheel",f?y:null);s.call(v,{})}function i(){s.on("zoom",null)}return{update:o,destroy:i,pointer:_t}}const Nl=e=>({x:e.x,y:e.y,zoom:e.k}),mu=({x:e,y:t,zoom:n})=>yl.translate(e,t).scale(n),Kr=(e,t)=>e.target.closest(`.${t}`),s0=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),B_=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,pu=(e,t=0,n=B_,r=()=>{})=>{const s=typeof t=="number"&&t>0;return s||r(),s?e.transition().duration(t).ease(n).on("end",r):e},o0=e=>{const t=e.ctrlKey&&Fo()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function U_({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:o,zoomOnPinch:i,onPanZoomStart:l,onPanZoom:u,onPanZoomEnd:c}){return h=>{if(Kr(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=_t(h),p=o0(h),v=d*Math.pow(2,p);r.scaleTo(n,v,N,h);return}const f=h.deltaMode===1?20:1;let x=s===cr.Vertical?0:h.deltaX*f,y=s===cr.Horizontal?0:h.deltaY*f;!Fo()&&h.shiftKey&&s!==cr.Vertical&&(x=h.deltaY*f,y=0),r.translateBy(n,-(x/d)*o,-(y/d)*o,{internal:!0});const w=Nl(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(u==null||u(h,w),e.panScrollTimeout=setTimeout(()=>{c==null||c(h,w),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,l==null||l(h,w))}}function W_({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,s){const o=r.type==="wheel",i=!t&&o&&!r.ctrlKey,l=Kr(r,e);if(r.ctrlKey&&o&&l&&r.preventDefault(),i||l)return null;r.preventDefault(),n.call(this,r,s)}}function K_({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var o,i,l;if((o=r.sourceEvent)!=null&&o.internal)return;const s=Nl(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 G_({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:s}){return o=>{var i,l;e.usedRightMouseButton=!!(n&&s0(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,Nl(o.transform)))}}function Y_({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&&s0(t,e.mouseButton??0)&&!e.usedRightMouseButton&&i.sourceEvent&&o(i.sourceEvent),e.usedRightMouseButton=!1,r(!1),s)){const u=Nl(i.transform);e.prevViewport=u,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(i.sourceEvent,u)},n?150:0)}}}function X_({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:o,userSelectionActive:i,noWheelClassName:l,noPanClassName:u,lib:c,connectionInProgress:h}){return d=>{var N;const f=e||t,x=n&&d.ctrlKey,y=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(Kr(d,`${c}-flow__node`)||Kr(d,`${c}-flow__edge`)))return!0;if(!r&&!f&&!s&&!o&&!n||i||h&&!y||Kr(d,l)&&y||Kr(d,u)&&(!y||s&&y&&!e)||!n&&d.ctrlKey&&y)return!1;if(!n&&d.type==="touchstart"&&((N=d.touches)==null?void 0:N.length)>1)return d.preventDefault(),!1;if(!f&&!s&&!x&&y||!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||y)&&w}}function Q_({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:s,onPanZoom:o,onPanZoomStart:i,onPanZoomEnd:l,onDraggingChange:u}){const c={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},h=e.getBoundingClientRect(),d=Iy().scaleExtent([t,n]).translateExtent(r),f=dt(e).call(d);v({x:s.x,y:s.y,zoom:gs(s.zoom,t,n)},[[0,0],[h.width,h.height]],r);const x=f.on("wheel.zoom"),y=f.on("dblclick.zoom");d.wheelDelta(o0);function w(R,T){return f?new Promise(A=>{d==null||d.interpolate((T==null?void 0:T.interpolate)==="linear"?fo:ea).transform(pu(f,T==null?void 0:T.duration,T==null?void 0:T.ease,()=>A(!0)),R)}):Promise.resolve(!1)}function N({noWheelClassName:R,noPanClassName:T,onPaneContextMenu:A,userSelectionActive:C,panOnScroll:L,panOnDrag:M,panOnScrollMode:D,panOnScrollSpeed:E,preventScrolling:P,zoomOnPinch:z,zoomOnScroll:F,zoomOnDoubleClick:O,zoomActivationKeyPressed:U,lib:B,onTransformChange:K,connectionInProgress:G,paneClickDistance:Y,selectionOnDrag:V}){C&&!c.isZoomingOrPanning&&p();const q=L&&!U&&!C;d.clickDistance(V?1/0:!It(Y)||Y<0?0:Y);const se=q?U_({zoomPanValues:c,noWheelClassName:R,d3Selection:f,d3Zoom:d,panOnScrollMode:D,panOnScrollSpeed:E,zoomOnPinch:z,onPanZoomStart:i,onPanZoom:o,onPanZoomEnd:l}):W_({noWheelClassName:R,preventScrolling:P,d3ZoomHandler:x});if(f.on("wheel.zoom",se,{passive:!1}),!C){const ee=K_({zoomPanValues:c,onDraggingChange:u,onPanZoomStart:i});d.on("start",ee);const Z=G_({zoomPanValues:c,panOnDrag:M,onPaneContextMenu:!!A,onPanZoom:o,onTransformChange:K});d.on("zoom",Z);const ue=Y_({zoomPanValues:c,panOnDrag:M,panOnScroll:L,onPaneContextMenu:A,onPanZoomEnd:l,onDraggingChange:u});d.on("end",ue)}const te=X_({zoomActivationKeyPressed:U,panOnDrag:M,zoomOnScroll:F,panOnScroll:L,zoomOnDoubleClick:O,zoomOnPinch:z,userSelectionActive:C,noPanClassName:T,noWheelClassName:R,lib:B,connectionInProgress:G});d.filter(te),O?f.on("dblclick.zoom",y):f.on("dblclick.zoom",null)}function p(){d.on("zoom",null)}async function v(R,T,A){const C=mu(R),L=d==null?void 0:d.constrain()(C,T,A);return L&&await w(L),new Promise(M=>M(L))}async function g(R,T){const A=mu(R);return await w(A,T),new Promise(C=>C(A))}function S(R){if(f){const T=mu(R),A=f.property("__zoom");(A.k!==R.zoom||A.x!==R.x||A.y!==R.y)&&(d==null||d.transform(f,T,null,{sync:!0}))}}function b(){const R=f?My(f.node()):{x:0,y:0,k:1};return{x:R.x,y:R.y,zoom:R.k}}function k(R,T){return f?new Promise(A=>{d==null||d.interpolate((T==null?void 0:T.interpolate)==="linear"?fo:ea).scaleTo(pu(f,T==null?void 0:T.duration,T==null?void 0:T.ease,()=>A(!0)),R)}):Promise.resolve(!1)}function j(R,T){return f?new Promise(A=>{d==null||d.interpolate((T==null?void 0:T.interpolate)==="linear"?fo:ea).scaleBy(pu(f,T==null?void 0:T.duration,T==null?void 0:T.ease,()=>A(!0)),R)}):Promise.resolve(!1)}function _(R){d==null||d.scaleExtent(R)}function I(R){d==null||d.translateExtent(R)}function $(R){const T=!It(R)||R<0?0:R;d==null||d.clickDistance(T)}return{update:N,destroy:p,setViewport:g,setViewportConstrained:v,getViewport:b,scaleTo:k,scaleBy:j,setScaleExtent:_,setTranslateExtent:I,syncViewport:S,setClickDistance:$}}var vs;(function(e){e.Line="line",e.Handle="handle"})(vs||(vs={}));function q_({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:s,affectsY:o}){const i=e-t,l=n-r,u=[i>0?1:i<0?-1:0,l>0?1:l<0?-1:0];return i&&s&&(u[0]=u[0]*-1),l&&o&&(u[1]=u[1]*-1),u}function Pm(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 Mi(e,t,n){return Math.max(0,t-e,e-n)}function Mm(e,t){return e?!t:t}function Z_(e,t,n,r,s,o,i,l){let{affectsX:u,affectsY:c}=t;const{isHorizontal:h,isVertical:d}=t,f=h&&d,{xSnapped:x,ySnapped:y}=n,{minWidth:w,maxWidth:N,minHeight:p,maxHeight:v}=r,{x:g,y:S,width:b,height:k,aspectRatio:j}=e;let _=Math.floor(h?x-e.pointerX:0),I=Math.floor(d?y-e.pointerY:0);const $=b+(u?-_:_),R=k+(c?-I:I),T=-o[0]*b,A=-o[1]*k;let C=Mi($,w,N),L=Mi(R,p,v);if(i){let E=0,P=0;u&&_<0?E=kn(g+_+T,i[0][0]):!u&&_>0&&(E=Cn(g+$+T,i[1][0])),c&&I<0?P=kn(S+I+A,i[0][1]):!c&&I>0&&(P=Cn(S+R+A,i[1][1])),C=Math.max(C,E),L=Math.max(L,P)}if(l){let E=0,P=0;u&&_>0?E=Cn(g+_,l[0][0]):!u&&_<0&&(E=kn(g+$,l[1][0])),c&&I>0?P=Cn(S+I,l[0][1]):!c&&I<0&&(P=kn(S+R,l[1][1])),C=Math.max(C,E),L=Math.max(L,P)}if(s){if(h){const E=Mi($/j,p,v)*j;if(C=Math.max(C,E),i){let P=0;!u&&!c||u&&!c&&f?P=Cn(S+A+$/j,i[1][1])*j:P=kn(S+A+(u?_:-_)/j,i[0][1])*j,C=Math.max(C,P)}if(l){let P=0;!u&&!c||u&&!c&&f?P=kn(S+$/j,l[1][1])*j:P=Cn(S+(u?_:-_)/j,l[0][1])*j,C=Math.max(C,P)}}if(d){const E=Mi(R*j,w,N)/j;if(L=Math.max(L,E),i){let P=0;!u&&!c||c&&!u&&f?P=Cn(g+R*j+T,i[1][0])/j:P=kn(g+(c?I:-I)*j+T,i[0][0])/j,L=Math.max(L,P)}if(l){let P=0;!u&&!c||c&&!u&&f?P=kn(g+R*j,l[1][0])/j:P=Cn(g+(c?I:-I)*j,l[0][0])/j,L=Math.max(L,P)}}}I=I+(I<0?L:-L),_=_+(_<0?C:-C),s&&(f?$>R*j?I=(Mm(u,c)?-_:_)/j:_=(Mm(u,c)?-I:I)*j:h?(I=_/j,c=u):(_=I*j,u=c));const M=u?g+_:g,D=c?S+I:S;return{width:b+(u?-_:_),height:k+(c?-I:I),x:o[0]*_*(u?-1:1)+M,y:o[1]*I*(c?-1:1)+D}}const i0={width:0,height:0,x:0,y:0},J_={...i0,pointerX:0,pointerY:0,aspectRatio:1};function e3(e){return[[0,0],[e.measured.width,e.measured.height]]}function t3(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,u=n[1]*i;return[[r-l,s-u],[r+o-l,s+i-u]]}function n3({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:s}){const o=dt(e);let i={controlDirection:Pm("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:c,boundaries:h,keepAspectRatio:d,resizeDirection:f,onResizeStart:x,onResize:y,onResizeEnd:w,shouldResize:N}){let p={...i0},v={...J_};i={boundaries:h,resizeDirection:f,keepAspectRatio:d,controlDirection:Pm(c)};let g,S=null,b=[],k,j,_,I=!1;const $=gy().on("start",R=>{const{nodeLookup:T,transform:A,snapGrid:C,snapToGrid:L,nodeOrigin:M,paneDomNode:D}=n();if(g=T.get(t),!g)return;S=(D==null?void 0:D.getBoundingClientRect())??null;const{xSnapped:E,ySnapped:P}=ho(R.sourceEvent,{transform:A,snapGrid:C,snapToGrid:L,containerBounds:S});p={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},v={...p,pointerX:E,pointerY:P,aspectRatio:p.width/p.height},k=void 0,g.parentId&&(g.extent==="parent"||g.expandParent)&&(k=T.get(g.parentId),j=k&&g.extent==="parent"?e3(k):void 0),b=[],_=void 0;for(const[z,F]of T)if(F.parentId===t&&(b.push({id:z,position:{...F.position},extent:F.extent}),F.extent==="parent"||F.expandParent)){const O=t3(F,g,F.origin??M);_?_=[[Math.min(O[0][0],_[0][0]),Math.min(O[0][1],_[0][1])],[Math.max(O[1][0],_[1][0]),Math.max(O[1][1],_[1][1])]]:_=O}x==null||x(R,{...p})}).on("drag",R=>{const{transform:T,snapGrid:A,snapToGrid:C,nodeOrigin:L}=n(),M=ho(R.sourceEvent,{transform:T,snapGrid:A,snapToGrid:C,containerBounds:S}),D=[];if(!g)return;const{x:E,y:P,width:z,height:F}=p,O={},U=g.origin??L,{width:B,height:K,x:G,y:Y}=Z_(v,i.controlDirection,M,i.boundaries,i.keepAspectRatio,U,j,_),V=B!==z,q=K!==F,se=G!==E&&V,te=Y!==P&&q;if(!se&&!te&&!V&&!q)return;if((se||te||U[0]===1||U[1]===1)&&(O.x=se?G:p.x,O.y=te?Y:p.y,p.x=O.x,p.y=O.y,b.length>0)){const he=G-E,le=Y-P;for(const Be of b)Be.position={x:Be.position.x-he+U[0]*(B-z),y:Be.position.y-le+U[1]*(K-F)},D.push(Be)}if((V||q)&&(O.width=V&&(!i.resizeDirection||i.resizeDirection==="horizontal")?B:p.width,O.height=q&&(!i.resizeDirection||i.resizeDirection==="vertical")?K:p.height,p.width=O.width,p.height=O.height),k&&g.expandParent){const he=U[0]*(O.width??0);O.x&&O.x<he&&(p.x=he,v.x=v.x-(O.x-he));const le=U[1]*(O.height??0);O.y&&O.y<le&&(p.y=le,v.y=v.y-(O.y-le))}const ee=q_({width:p.width,prevWidth:z,height:p.height,prevHeight:F,affectsX:i.controlDirection.affectsX,affectsY:i.controlDirection.affectsY}),Z={...p,direction:ee};(N==null?void 0:N(R,Z))!==!1&&(I=!0,y==null||y(R,Z),r(O,D))}).on("end",R=>{I&&(w==null||w(R,{...p}),s==null||s({...p}),I=!1)});o.call($)}function u(){o.on(".drag",null)}return{update:l,destroy:u}}var a0={exports:{}},l0={},u0={exports:{}},c0={};/**
|
|
322
|
+
* @license React
|
|
323
|
+
* use-sync-external-store-shim.production.js
|
|
324
|
+
*
|
|
325
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
326
|
+
*
|
|
327
|
+
* This source code is licensed under the MIT license found in the
|
|
328
|
+
* LICENSE file in the root directory of this source tree.
|
|
329
|
+
*/var ws=m;function r3(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var s3=typeof Object.is=="function"?Object.is:r3,o3=ws.useState,i3=ws.useEffect,a3=ws.useLayoutEffect,l3=ws.useDebugValue;function u3(e,t){var n=t(),r=o3({inst:{value:n,getSnapshot:t}}),s=r[0].inst,o=r[1];return a3(function(){s.value=n,s.getSnapshot=t,gu(s)&&o({inst:s})},[e,n,t]),i3(function(){return gu(s)&&o({inst:s}),e(function(){gu(s)&&o({inst:s})})},[e]),l3(n),n}function gu(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!s3(e,n)}catch{return!0}}function c3(e,t){return t()}var d3=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c3:u3;c0.useSyncExternalStore=ws.useSyncExternalStore!==void 0?ws.useSyncExternalStore:d3;u0.exports=c0;var f3=u0.exports;/**
|
|
330
|
+
* @license React
|
|
331
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
332
|
+
*
|
|
333
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
334
|
+
*
|
|
335
|
+
* This source code is licensed under the MIT license found in the
|
|
336
|
+
* LICENSE file in the root directory of this source tree.
|
|
337
|
+
*/var Sl=m,h3=f3;function m3(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var p3=typeof Object.is=="function"?Object.is:m3,g3=h3.useSyncExternalStore,x3=Sl.useRef,y3=Sl.useEffect,v3=Sl.useMemo,w3=Sl.useDebugValue;l0.useSyncExternalStoreWithSelector=function(e,t,n,r,s){var o=x3(null);if(o.current===null){var i={hasValue:!1,value:null};o.current=i}else i=o.current;o=v3(function(){function u(x){if(!c){if(c=!0,h=x,x=r(x),s!==void 0&&i.hasValue){var y=i.value;if(s(y,x))return d=y}return d=x}if(y=d,p3(h,x))return y;var w=r(x);return s!==void 0&&s(y,w)?(h=x,y):(h=x,d=w)}var c=!1,h,d,f=n===void 0?null:n;return[function(){return u(t())},f===null?void 0:function(){return u(f())}]},[t,n,r,s]);var l=g3(e,o[0],o[1]);return y3(function(){i.hasValue=!0,i.value=l},[l]),w3(l),l};a0.exports=l0;var N3=a0.exports;const S3=Bc(N3),b3={},Im=e=>{let t;const n=new Set,r=(h,d)=>{const f=typeof h=="function"?h(t):h;if(!Object.is(f,t)){const x=t;t=d??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(y=>y(t,x))}},s=()=>t,u={setState:r,getState:s,getInitialState:()=>c,subscribe:h=>(n.add(h),()=>n.delete(h)),destroy:()=>{(b3?"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()}},c=t=e(r,s,u);return u},j3=e=>e?Im(e):Im,{useDebugValue:k3}=Bt,{useSyncExternalStoreWithSelector:C3}=S3,E3=e=>e;function d0(e,t=E3,n){const r=C3(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return k3(r),r}const Rm=(e,t)=>{const n=j3(e),r=(s,o=t)=>d0(n,s,o);return Object.assign(r,n),r},_3=(e,t)=>e?Rm(e,t):Rm;function we(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 bl=m.createContext(null),P3=bl.Provider,f0=Jt.error001();function ie(e,t){const n=m.useContext(bl);if(n===null)throw new Error(f0);return d0(n,e,t)}function Ne(){const e=m.useContext(bl);if(e===null)throw new Error(f0);return m.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Tm={display:"none"},M3={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},h0="react-flow__node-desc",m0="react-flow__edge-desc",I3="react-flow__aria-live",R3=e=>e.ariaLiveMessage,T3=e=>e.ariaLabelConfig;function L3({rfId:e}){const t=ie(R3);return a.jsx("div",{id:`${I3}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:M3,children:t})}function A3({rfId:e,disableKeyboardA11y:t}){const n=ie(T3);return a.jsxs(a.Fragment,{children:[a.jsx("div",{id:`${h0}-${e}`,style:Tm,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),a.jsx("div",{id:`${m0}-${e}`,style:Tm,children:n["edge.a11yDescription.default"]}),!t&&a.jsx(L3,{rfId:e})]})}const jl=m.forwardRef(({position:e="top-left",children:t,className:n,style:r,...s},o)=>{const i=`${e}`.split("-");return a.jsx("div",{className:Ie(["react-flow__panel",n,...i]),style:r,ref:o,...s,children:t})});jl.displayName="Panel";function z3({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:a.jsx(jl,{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 D3=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}},Ii=e=>e.id;function $3(e,t){return we(e.selectedNodes.map(Ii),t.selectedNodes.map(Ii))&&we(e.selectedEdges.map(Ii),t.selectedEdges.map(Ii))}function O3({onSelectionChange:e}){const t=Ne(),{selectedNodes:n,selectedEdges:r}=ie(D3,$3);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 F3=e=>!!e.onSelectionChangeHandlers;function H3({onSelectionChange:e}){const t=ie(F3);return e||t?a.jsx(O3,{onSelectionChange:e}):null}const p0=[0,0],V3={x:0,y:0,zoom:1},B3=["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"],Lm=[...B3,"rfId"],U3=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}),Am={translateExtent:Do,nodeOrigin:p0,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function W3(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:s,setTranslateExtent:o,setNodeExtent:i,reset:l,setDefaultNodesAndEdges:u}=ie(U3,we),c=Ne();m.useEffect(()=>(u(e.defaultNodes,e.defaultEdges),()=>{h.current=Am,l()}),[]);const h=m.useRef(Am);return m.useEffect(()=>{for(const d of Lm){const f=e[d],x=h.current[d];f!==x&&(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"?c.setState({ariaLabelConfig:m_(f)}):d==="fitView"?c.setState({fitViewQueued:f}):d==="fitViewOptions"?c.setState({fitViewOptions:f}):c.setState({[d]:f})))}h.current=e},Lm.map(d=>e[d])),null}function zm(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function K3(e){var r;const[t,n]=m.useState(e==="system"?null:e);return m.useEffect(()=>{if(e!=="system"){n(e);return}const s=zm(),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=zm())!=null&&r.matches?"dark":"light"}const Dm=typeof document<"u"?document:null;function Ho(e=null,t={target:Dm,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 c=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.replace("+",`
|
|
338
|
+
`).replace(`
|
|
339
|
+
|
|
340
|
+
`,`
|
|
341
|
+
+`).split(`
|
|
342
|
+
`)),h=c.reduce((d,f)=>d.concat(...f),[]);return[c,h]}return[[],[]]},[e]);return m.useEffect(()=>{const u=(t==null?void 0:t.target)??Dm,c=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const h=x=>{var N,p;if(s.current=x.ctrlKey||x.metaKey||x.shiftKey||x.altKey,(!s.current||s.current&&!c)&&Uy(x))return!1;const w=Om(x.code,l);if(o.current.add(x[w]),$m(i,o.current,!1)){const v=((p=(N=x.composedPath)==null?void 0:N.call(x))==null?void 0:p[0])||x.target,g=(v==null?void 0:v.nodeName)==="BUTTON"||(v==null?void 0:v.nodeName)==="A";t.preventDefault!==!1&&(s.current||!g)&&x.preventDefault(),r(!0)}},d=x=>{const y=Om(x.code,l);$m(i,o.current,!0)?(r(!1),o.current.clear()):o.current.delete(x[y]),x.key==="Meta"&&o.current.clear(),s.current=!1},f=()=>{o.current.clear(),r(!1)};return u==null||u.addEventListener("keydown",h),u==null||u.addEventListener("keyup",d),window.addEventListener("blur",f),window.addEventListener("contextmenu",f),()=>{u==null||u.removeEventListener("keydown",h),u==null||u.removeEventListener("keyup",d),window.removeEventListener("blur",f),window.removeEventListener("contextmenu",f)}}},[e,r]),n}function $m(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(s=>t.has(s)))}function Om(e,t){return t.includes(e)?"code":"key"}const G3=()=>{const e=Ne();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(),u=uf(t,r,s,o,i,(n==null?void 0:n.padding)??.1);return l?(await l.setViewport(u,{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:u}=i.getBoundingClientRect(),c={x:t.x-l,y:t.y-u},h=n.snapGrid??s,d=n.snapToGrid??o;return ti(c,r,d,h)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:s,y:o}=r.getBoundingClientRect(),i=Va(t,n);return{x:i.x+s,y:i.y+o}}}),[])};function g0(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 u of i)Y3(u,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 Y3(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 X3(e,t){return g0(e,t)}function Q3(e,t){return g0(e,t)}function tr(e,t){return{id:e,type:"select",selected:t}}function Gr(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(tr(o.id,i)))}return r}function Fm({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),u=((s=l==null?void 0:l.internals)==null?void 0:s.userNode)??l;u!==void 0&&u!==i&&n.push({id:i.id,item:i,type:"replace"}),u===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 Hm(e){return{id:e.id,type:"remove"}}const Vm=e=>s_(e),q3=e=>zy(e);function x0(e){return m.forwardRef(e)}const Z3=typeof window<"u"?m.useLayoutEffect:m.useEffect;function Bm(e){const[t,n]=m.useState(BigInt(0)),[r]=m.useState(()=>J3(()=>n(s=>s+BigInt(1))));return Z3(()=>{const s=r.get();s.length&&(e(s),r.reset())},[t]),r}function J3(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const y0=m.createContext(null);function e4({children:e}){const t=Ne(),n=m.useCallback(l=>{const{nodes:u=[],setNodes:c,hasDefaultNodes:h,onNodesChange:d,nodeLookup:f,fitViewQueued:x,onNodesChangeMiddlewareMap:y}=t.getState();let w=u;for(const p of l)w=typeof p=="function"?p(w):p;let N=Fm({items:w,lookup:f});for(const p of y.values())N=p(N);h&&c(w),N.length>0?d==null||d(N):x&&window.requestAnimationFrame(()=>{const{fitViewQueued:p,nodes:v,setNodes:g}=t.getState();p&&g(v)})},[]),r=Bm(n),s=m.useCallback(l=>{const{edges:u=[],setEdges:c,hasDefaultEdges:h,onEdgesChange:d,edgeLookup:f}=t.getState();let x=u;for(const y of l)x=typeof y=="function"?y(x):y;h?c(x):d&&d(Fm({items:x,lookup:f}))},[]),o=Bm(s),i=m.useMemo(()=>({nodeQueue:r,edgeQueue:o}),[]);return a.jsx(y0.Provider,{value:i,children:e})}function t4(){const e=m.useContext(y0);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const n4=e=>!!e.panZoom;function gf(){const e=G3(),t=Ne(),n=t4(),r=ie(n4),s=m.useMemo(()=>{const o=d=>t.getState().nodeLookup.get(d),i=d=>{n.nodeQueue.push(d)},l=d=>{n.edgeQueue.push(d)},u=d=>{var p,v;const{nodeLookup:f,nodeOrigin:x}=t.getState(),y=Vm(d)?d:f.get(d.id),w=y.parentId?Vy(y.position,y.measured,y.parentId,f,x):y.position,N={...y,position:w,width:((p=y.measured)==null?void 0:p.width)??y.width,height:((v=y.measured)==null?void 0:v.height)??y.height};return xs(N)},c=(d,f,x={replace:!1})=>{i(y=>y.map(w=>{if(w.id===d){const N=typeof f=="function"?f(w):f;return x.replace&&Vm(N)?N:{...w,...N}}return w}))},h=(d,f,x={replace:!1})=>{l(y=>y.map(w=>{if(w.id===d){const N=typeof f=="function"?f(w):f;return x.replace&&q3(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(x=>[...x,...f])},addEdges:d=>{const f=Array.isArray(d)?d:[d];n.edgeQueue.push(x=>[...x,...f])},toObject:()=>{const{nodes:d=[],edges:f=[],transform:x}=t.getState(),[y,w,N]=x;return{nodes:d.map(p=>({...p})),edges:f.map(p=>({...p})),viewport:{x:y,y:w,zoom:N}}},deleteElements:async({nodes:d=[],edges:f=[]})=>{const{nodes:x,edges:y,onNodesDelete:w,onEdgesDelete:N,triggerNodeChanges:p,triggerEdgeChanges:v,onDelete:g,onBeforeDelete:S}=t.getState(),{nodes:b,edges:k}=await u_({nodesToRemove:d,edgesToRemove:f,nodes:x,edges:y,onBeforeDelete:S}),j=k.length>0,_=b.length>0;if(j){const I=k.map(Hm);N==null||N(k),v(I)}if(_){const I=b.map(Hm);w==null||w(b),p(I)}return(_||j)&&(g==null||g({nodes:b,edges:k})),{deletedNodes:b,deletedEdges:k}},getIntersectingNodes:(d,f=!0,x)=>{const y=ym(d),w=y?d:u(d),N=x!==void 0;return w?(x||t.getState().nodes).filter(p=>{const v=t.getState().nodeLookup.get(p.id);if(v&&!y&&(p.id===d.id||!v.internals.positionAbsolute))return!1;const g=xs(N?p:v),S=Oo(g,w);return f&&S>0||S>=g.width*g.height||S>=w.width*w.height}):[]},isNodeIntersecting:(d,f,x=!0)=>{const w=ym(d)?d:u(d);if(!w)return!1;const N=Oo(w,f);return x&&N>0||N>=f.width*f.height||N>=w.width*w.height},updateNode:c,updateNodeData:(d,f,x={replace:!1})=>{c(d,y=>{const w=typeof f=="function"?f(y):f;return x.replace?{...y,data:w}:{...y,data:{...y.data,...w}}},x)},updateEdge:h,updateEdgeData:(d,f,x={replace:!1})=>{h(d,y=>{const w=typeof f=="function"?f(y):f;return x.replace?{...y,data:w}:{...y,data:{...y.data,...w}}},x)},getNodesBounds:d=>{const{nodeLookup:f,nodeOrigin:x}=t.getState();return o_(d,{nodeLookup:f,nodeOrigin:x})},getHandleConnections:({type:d,id:f,nodeId:x})=>{var y;return Array.from(((y=t.getState().connectionLookup.get(`${x}-${d}${f?`-${f}`:""}`))==null?void 0:y.values())??[])},getNodeConnections:({type:d,handleId:f,nodeId:x})=>{var y;return Array.from(((y=t.getState().connectionLookup.get(`${x}${d?f?`-${d}-${f}`:`-${d}`:""}`))==null?void 0:y.values())??[])},fitView:async d=>{const f=t.getState().fitViewResolver??h_();return t.setState({fitViewQueued:!0,fitViewOptions:d,fitViewResolver:f}),n.nodeQueue.push(x=>[...x]),f.promise}}},[]);return m.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const Um=e=>e.selected,r4=typeof window<"u"?window:void 0;function s4({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Ne(),{deleteElements:r}=gf(),s=Ho(e,{actInsideInputWithModifier:!1}),o=Ho(t,{target:r4});m.useEffect(()=>{if(s){const{edges:i,nodes:l}=n.getState();r({nodes:l.filter(Um),edges:i.filter(Um)}),n.setState({nodesSelectionActive:!1})}},[s]),m.useEffect(()=>{n.setState({multiSelectionActive:o})},[o])}function o4(e){const t=Ne();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=cf(e.current);(r.height===0||r.width===0)&&((l=(i=t.getState()).onError)==null||l.call(i,"004",Jt.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 kl={position:"absolute",width:"100%",height:"100%",top:0,left:0},i4=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function a4({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:s=.5,panOnScrollMode:o=cr.Free,zoomOnDoubleClick:i=!0,panOnDrag:l=!0,defaultViewport:u,translateExtent:c,minZoom:h,maxZoom:d,zoomActivationKeyCode:f,preventScrolling:x=!0,children:y,noWheelClassName:w,noPanClassName:N,onViewportChange:p,isControlledViewport:v,paneClickDistance:g,selectionOnDrag:S}){const b=Ne(),k=m.useRef(null),{userSelectionActive:j,lib:_,connectionInProgress:I}=ie(i4,we),$=Ho(f),R=m.useRef();o4(k);const T=m.useCallback(A=>{p==null||p({x:A[0],y:A[1],zoom:A[2]}),v||b.setState({transform:A})},[p,v]);return m.useEffect(()=>{if(k.current){R.current=Q_({domNode:k.current,minZoom:h,maxZoom:d,translateExtent:c,viewport:u,onDraggingChange:M=>b.setState({paneDragging:M}),onPanZoomStart:(M,D)=>{const{onViewportChangeStart:E,onMoveStart:P}=b.getState();P==null||P(M,D),E==null||E(D)},onPanZoom:(M,D)=>{const{onViewportChange:E,onMove:P}=b.getState();P==null||P(M,D),E==null||E(D)},onPanZoomEnd:(M,D)=>{const{onViewportChangeEnd:E,onMoveEnd:P}=b.getState();P==null||P(M,D),E==null||E(D)}});const{x:A,y:C,zoom:L}=R.current.getViewport();return b.setState({panZoom:R.current,transform:[A,C,L],domNode:k.current.closest(".react-flow")}),()=>{var M;(M=R.current)==null||M.destroy()}}},[]),m.useEffect(()=>{var A;(A=R.current)==null||A.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:o,zoomOnDoubleClick:i,panOnDrag:l,zoomActivationKeyPressed:$,preventScrolling:x,noPanClassName:N,userSelectionActive:j,noWheelClassName:w,lib:_,onTransformChange:T,connectionInProgress:I,selectionOnDrag:S,paneClickDistance:g})},[e,t,n,r,s,o,i,l,$,x,N,j,w,_,T,I,S,g]),a.jsx("div",{className:"react-flow__renderer",ref:k,style:kl,children:y})}const l4=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function u4(){const{userSelectionActive:e,userSelectionRect:t}=ie(l4,we);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 xu=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},c4=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function d4({isSelecting:e,selectionKeyPressed:t,selectionMode:n=$o.Full,panOnDrag:r,paneClickDistance:s,selectionOnDrag:o,onSelectionStart:i,onSelectionEnd:l,onPaneClick:u,onPaneContextMenu:c,onPaneScroll:h,onPaneMouseEnter:d,onPaneMouseMove:f,onPaneMouseLeave:x,children:y}){const w=Ne(),{userSelectionActive:N,elementsSelectable:p,dragging:v,connectionInProgress:g}=ie(c4,we),S=p&&(e||N),b=m.useRef(null),k=m.useRef(),j=m.useRef(new Set),_=m.useRef(new Set),I=m.useRef(!1),$=E=>{if(I.current||g){I.current=!1;return}u==null||u(E),w.getState().resetSelectedElements(),w.setState({nodesSelectionActive:!1})},R=E=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){E.preventDefault();return}c==null||c(E)},T=h?E=>h(E):void 0,A=E=>{I.current&&(E.stopPropagation(),I.current=!1)},C=E=>{var K,G;const{domNode:P}=w.getState();if(k.current=P==null?void 0:P.getBoundingClientRect(),!k.current)return;const z=E.target===b.current;if(!z&&!!E.target.closest(".nokey")||!e||!(o&&z||t)||E.button!==0||!E.isPrimary)return;(G=(K=E.target)==null?void 0:K.setPointerCapture)==null||G.call(K,E.pointerId),I.current=!1;const{x:U,y:B}=Rt(E.nativeEvent,k.current);w.setState({userSelectionRect:{width:0,height:0,startX:U,startY:B,x:U,y:B}}),z||(E.stopPropagation(),E.preventDefault())},L=E=>{const{userSelectionRect:P,transform:z,nodeLookup:F,edgeLookup:O,connectionLookup:U,triggerNodeChanges:B,triggerEdgeChanges:K,defaultEdgeOptions:G,resetSelectedElements:Y}=w.getState();if(!k.current||!P)return;const{x:V,y:q}=Rt(E.nativeEvent,k.current),{startX:se,startY:te}=P;if(!I.current){const le=t?0:s;if(Math.hypot(V-se,q-te)<=le)return;Y(),i==null||i(E)}I.current=!0;const ee={startX:se,startY:te,x:V<se?V:se,y:q<te?q:te,width:Math.abs(V-se),height:Math.abs(q-te)},Z=j.current,ue=_.current;j.current=new Set(lf(F,ee,z,n===$o.Partial,!0).map(le=>le.id)),_.current=new Set;const he=(G==null?void 0:G.selectable)??!0;for(const le of j.current){const Be=U.get(le);if(Be)for(const{edgeId:Nn}of Be.values()){const tn=O.get(Nn);tn&&(tn.selectable??he)&&_.current.add(Nn)}}if(!vm(Z,j.current)){const le=Gr(F,j.current,!0);B(le)}if(!vm(ue,_.current)){const le=Gr(O,_.current);K(le)}w.setState({userSelectionRect:ee,userSelectionActive:!0,nodesSelectionActive:!1})},M=E=>{var P,z;E.button===0&&((z=(P=E.target)==null?void 0:P.releasePointerCapture)==null||z.call(P,E.pointerId),!N&&E.target===b.current&&w.getState().userSelectionRect&&($==null||$(E)),w.setState({userSelectionActive:!1,userSelectionRect:null}),I.current&&(l==null||l(E),w.setState({nodesSelectionActive:j.current.size>0})))},D=r===!0||Array.isArray(r)&&r.includes(0);return a.jsxs("div",{className:Ie(["react-flow__pane",{draggable:D,dragging:v,selection:e}]),onClick:S?void 0:xu($,b),onContextMenu:xu(R,b),onWheel:xu(T,b),onPointerEnter:S?void 0:d,onPointerMove:S?L:f,onPointerUp:S?M:void 0,onPointerDownCapture:S?C:void 0,onClickCapture:S?A:void 0,onPointerLeave:x,ref:b,style:kl,children:[y,a.jsx(u4,{})]})}function Oc({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:o,multiSelectionActive:i,nodeLookup:l,onError:u}=t.getState(),c=l.get(e);if(!c){u==null||u("012",Jt.error012(e));return}t.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&i)&&(o({nodes:[c],edges:[]}),requestAnimationFrame(()=>{var h;return(h=r==null?void 0:r.current)==null?void 0:h.blur()})):s([e])}function v0({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:s,isSelectable:o,nodeClickDistance:i}){const l=Ne(),[u,c]=m.useState(!1),h=m.useRef();return m.useEffect(()=>{h.current=z_({getStoreItems:()=>l.getState(),onNodeMouseDown:d=>{Oc({id:d,store:l,nodeRef:e})},onDragStart:()=>{c(!0)},onDragStop:()=>{c(!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 x;(x=h.current)==null||x.destroy()}},[n,r,t,o,e,s]),u}const f4=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function w0(){const e=Ne();return m.useCallback(n=>{const{nodeExtent:r,snapToGrid:s,snapGrid:o,nodesDraggable:i,onError:l,updateNodePositions:u,nodeLookup:c,nodeOrigin:h}=e.getState(),d=new Map,f=f4(i),x=s?o[0]:5,y=s?o[1]:5,w=n.direction.x*x*n.factor,N=n.direction.y*y*n.factor;for(const[,p]of c){if(!f(p))continue;let v={x:p.internals.positionAbsolute.x+w,y:p.internals.positionAbsolute.y+N};s&&(v=ei(v,o));const{position:g,positionAbsolute:S}=Dy({nodeId:p.id,nextPosition:v,nodeLookup:c,nodeExtent:r,nodeOrigin:h,onError:l});p.position=g,p.internals.positionAbsolute=S,d.set(p.id,p)}u(d)},[])}const xf=m.createContext(null),h4=xf.Provider;xf.Consumer;const N0=()=>m.useContext(xf),m4=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),p4=(e,t,n)=>r=>{const{connectionClickStartHandle:s,connectionMode:o,connection:i}=r,{fromHandle:l,toHandle:u,isValid:c}=i,h=(u==null?void 0:u.nodeId)===e&&(u==null?void 0:u.id)===t&&(u==null?void 0:u.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===ps.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&&c}};function g4({type:e="source",position:t=X.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:o=!0,id:i,onConnect:l,children:u,className:c,onMouseDown:h,onTouchStart:d,...f},x){var L,M;const y=i||null,w=e==="target",N=Ne(),p=N0(),{connectOnClick:v,noPanClassName:g,rfId:S}=ie(m4,we),{connectingFrom:b,connectingTo:k,clickConnecting:j,isPossibleEndHandle:_,connectionInProcess:I,clickConnectionInProcess:$,valid:R}=ie(p4(p,y,e),we);p||(M=(L=N.getState()).onError)==null||M.call(L,"010",Jt.error010());const T=D=>{const{defaultEdgeOptions:E,onConnect:P,hasDefaultEdges:z}=N.getState(),F={...E,...D};if(z){const{edges:O,setEdges:U}=N.getState();U(w_(F,O))}P==null||P(F),l==null||l(F)},A=D=>{if(!p)return;const E=Wy(D.nativeEvent);if(s&&(E&&D.button===0||!E)){const P=N.getState();$c.onPointerDown(D.nativeEvent,{handleDomNode:D.currentTarget,autoPanOnConnect:P.autoPanOnConnect,connectionMode:P.connectionMode,connectionRadius:P.connectionRadius,domNode:P.domNode,nodeLookup:P.nodeLookup,lib:P.lib,isTarget:w,handleId:y,nodeId:p,flowId:P.rfId,panBy:P.panBy,cancelConnection:P.cancelConnection,onConnectStart:P.onConnectStart,onConnectEnd:P.onConnectEnd,updateConnection:P.updateConnection,onConnect:T,isValidConnection:n||P.isValidConnection,getTransform:()=>N.getState().transform,getFromHandle:()=>N.getState().connection.fromHandle,autoPanSpeed:P.autoPanSpeed,dragThreshold:P.connectionDragThreshold})}E?h==null||h(D):d==null||d(D)},C=D=>{const{onClickConnectStart:E,onClickConnectEnd:P,connectionClickStartHandle:z,connectionMode:F,isValidConnection:O,lib:U,rfId:B,nodeLookup:K,connection:G}=N.getState();if(!p||!z&&!s)return;if(!z){E==null||E(D.nativeEvent,{nodeId:p,handleId:y,handleType:e}),N.setState({connectionClickStartHandle:{nodeId:p,type:e,id:y}});return}const Y=By(D.target),V=n||O,{connection:q,isValid:se}=$c.isValid(D.nativeEvent,{handle:{nodeId:p,id:y,type:e},connectionMode:F,fromNodeId:z.nodeId,fromHandleId:z.id||null,fromType:z.type,isValidConnection:V,flowId:B,doc:Y,lib:U,nodeLookup:K});se&&q&&T(q);const te=structuredClone(G);delete te.inProgress,te.toPosition=te.toHandle?te.toHandle.position:null,P==null||P(D,te),N.setState({connectionClickStartHandle:null})};return a.jsx("div",{"data-handleid":y,"data-nodeid":p,"data-handlepos":t,"data-id":`${S}-${p}-${y}-${e}`,className:Ie(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",g,c,{source:!w,target:w,connectable:r,connectablestart:s,connectableend:o,clickconnecting:j,connectingfrom:b,connectingto:k,valid:R,connectionindicator:r&&(!I||_)&&(I||$?o:s)}]),onMouseDown:A,onTouchStart:A,onClick:v?C:void 0,ref:x,...f,children:u})}const Ba=m.memo(x0(g4));function x4({data:e,isConnectable:t,sourcePosition:n=X.Bottom}){return a.jsxs(a.Fragment,{children:[e==null?void 0:e.label,a.jsx(Ba,{type:"source",position:n,isConnectable:t})]})}function y4({data:e,isConnectable:t,targetPosition:n=X.Top,sourcePosition:r=X.Bottom}){return a.jsxs(a.Fragment,{children:[a.jsx(Ba,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,a.jsx(Ba,{type:"source",position:r,isConnectable:t})]})}function v4(){return null}function w4({data:e,isConnectable:t,targetPosition:n=X.Top}){return a.jsxs(a.Fragment,{children:[a.jsx(Ba,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Ua={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Wm={input:x4,default:y4,output:w4,group:v4};function N4(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 S4=e=>{const{width:t,height:n,x:r,y:s}=Jo(e.nodeLookup,{filter:o=>!!o.selected});return{width:It(t)?t:null,height:It(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 b4({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Ne(),{width:s,height:o,transformString:i,userSelectionActive:l}=ie(S4,we),u=w0(),c=m.useRef(null);if(m.useEffect(()=>{var f;n||(f=c.current)==null||f.focus({preventScroll:!0})},[n]),v0({nodeRef:c}),l||!s||!o)return null;const h=e?f=>{const x=r.getState().nodes.filter(y=>y.selected);e(f,x)}:void 0,d=f=>{Object.prototype.hasOwnProperty.call(Ua,f.key)&&(f.preventDefault(),u({direction:Ua[f.key],factor:f.shiftKey?4:1}))};return a.jsx("div",{className:Ie(["react-flow__nodesselection","react-flow__container",t]),style:{transform:i},children:a.jsx("div",{ref:c,className:"react-flow__nodesselection-rect",onContextMenu:h,tabIndex:n?void 0:-1,onKeyDown:n?void 0:d,style:{width:s,height:o}})})}const Km=typeof window<"u"?window:void 0,j4=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function S0({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:i,paneClickDistance:l,deleteKeyCode:u,selectionKeyCode:c,selectionOnDrag:h,selectionMode:d,onSelectionStart:f,onSelectionEnd:x,multiSelectionKeyCode:y,panActivationKeyCode:w,zoomActivationKeyCode:N,elementsSelectable:p,zoomOnScroll:v,zoomOnPinch:g,panOnScroll:S,panOnScrollSpeed:b,panOnScrollMode:k,zoomOnDoubleClick:j,panOnDrag:_,defaultViewport:I,translateExtent:$,minZoom:R,maxZoom:T,preventScrolling:A,onSelectionContextMenu:C,noWheelClassName:L,noPanClassName:M,disableKeyboardA11y:D,onViewportChange:E,isControlledViewport:P}){const{nodesSelectionActive:z,userSelectionActive:F}=ie(j4,we),O=Ho(c,{target:Km}),U=Ho(w,{target:Km}),B=U||_,K=U||S,G=h&&B!==!0,Y=O||F||G;return s4({deleteKeyCode:u,multiSelectionKeyCode:y}),a.jsx(a4,{onPaneContextMenu:o,elementsSelectable:p,zoomOnScroll:v,zoomOnPinch:g,panOnScroll:K,panOnScrollSpeed:b,panOnScrollMode:k,zoomOnDoubleClick:j,panOnDrag:!O&&B,defaultViewport:I,translateExtent:$,minZoom:R,maxZoom:T,zoomActivationKeyCode:N,preventScrolling:A,noWheelClassName:L,noPanClassName:M,onViewportChange:E,isControlledViewport:P,paneClickDistance:l,selectionOnDrag:G,children:a.jsxs(d4,{onSelectionStart:f,onSelectionEnd:x,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:i,panOnDrag:B,isSelecting:!!Y,selectionMode:d,selectionKeyPressed:O,paneClickDistance:l,selectionOnDrag:G,children:[e,z&&a.jsx(b4,{onSelectionContextMenu:C,noPanClassName:M,disableKeyboardA11y:D})]})})}S0.displayName="FlowRenderer";const k4=m.memo(S0),C4=e=>t=>e?lf(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 E4(e){return ie(m.useCallback(C4(e),[e]),we)}const _4=e=>e.updateNodeInternals;function P4(){const e=ie(_4),[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 M4({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const s=Ne(),o=m.useRef(null),i=m.useRef(null),l=m.useRef(e.sourcePosition),u=m.useRef(e.targetPosition),c=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=c.current!==t,f=l.current!==e.sourcePosition,x=u.current!==e.targetPosition;(d||f||x)&&(c.current=t,l.current=e.sourcePosition,u.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 I4({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:s,onContextMenu:o,onDoubleClick:i,nodesDraggable:l,elementsSelectable:u,nodesConnectable:c,nodesFocusable:h,resizeObserver:d,noDragClassName:f,noPanClassName:x,disableKeyboardA11y:y,rfId:w,nodeTypes:N,nodeClickDistance:p,onError:v}){const{node:g,internals:S,isParent:b}=ie(V=>{const q=V.nodeLookup.get(e),se=V.parentLookup.has(e);return{node:q,internals:q.internals,isParent:se}},we);let k=g.type||"default",j=(N==null?void 0:N[k])||Wm[k];j===void 0&&(v==null||v("003",Jt.error003(k)),k="default",j=(N==null?void 0:N.default)||Wm.default);const _=!!(g.draggable||l&&typeof g.draggable>"u"),I=!!(g.selectable||u&&typeof g.selectable>"u"),$=!!(g.connectable||c&&typeof g.connectable>"u"),R=!!(g.focusable||h&&typeof g.focusable>"u"),T=Ne(),A=Hy(g),C=M4({node:g,nodeType:k,hasDimensions:A,resizeObserver:d}),L=v0({nodeRef:C,disabled:g.hidden||!_,noDragClassName:f,handleSelector:g.dragHandle,nodeId:e,isSelectable:I,nodeClickDistance:p}),M=w0();if(g.hidden)return null;const D=wn(g),E=N4(g),P=I||_||t||n||r||s,z=n?V=>n(V,{...S.userNode}):void 0,F=r?V=>r(V,{...S.userNode}):void 0,O=s?V=>s(V,{...S.userNode}):void 0,U=o?V=>o(V,{...S.userNode}):void 0,B=i?V=>i(V,{...S.userNode}):void 0,K=V=>{const{selectNodesOnDrag:q,nodeDragThreshold:se}=T.getState();I&&(!q||!_||se>0)&&Oc({id:e,store:T,nodeRef:C}),t&&t(V,{...S.userNode})},G=V=>{if(!(Uy(V.nativeEvent)||y)){if(Ry.includes(V.key)&&I){const q=V.key==="Escape";Oc({id:e,store:T,unselect:q,nodeRef:C})}else if(_&&g.selected&&Object.prototype.hasOwnProperty.call(Ua,V.key)){V.preventDefault();const{ariaLabelConfig:q}=T.getState();T.setState({ariaLiveMessage:q["node.a11yDescription.ariaLiveMessage"]({direction:V.key.replace("Arrow","").toLowerCase(),x:~~S.positionAbsolute.x,y:~~S.positionAbsolute.y})}),M({direction:Ua[V.key],factor:V.shiftKey?4:1})}}},Y=()=>{var ue;if(y||!((ue=C.current)!=null&&ue.matches(":focus-visible")))return;const{transform:V,width:q,height:se,autoPanOnNodeFocus:te,setCenter:ee}=T.getState();if(!te)return;lf(new Map([[e,g]]),{x:0,y:0,width:q,height:se},V,!0).length>0||ee(g.position.x+D.width/2,g.position.y+D.height/2,{zoom:V[2]})};return a.jsx("div",{className:Ie(["react-flow__node",`react-flow__node-${k}`,{[x]:_},g.className,{selected:g.selected,selectable:I,parent:b,draggable:_,dragging:L}]),ref:C,style:{zIndex:S.z,transform:`translate(${S.positionAbsolute.x}px,${S.positionAbsolute.y}px)`,pointerEvents:P?"all":"none",visibility:A?"visible":"hidden",...g.style,...E},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:z,onMouseMove:F,onMouseLeave:O,onContextMenu:U,onClick:K,onDoubleClick:B,onKeyDown:R?G:void 0,tabIndex:R?0:void 0,onFocus:R?Y:void 0,role:g.ariaRole??(R?"group":void 0),"aria-roledescription":"node","aria-describedby":y?void 0:`${h0}-${w}`,"aria-label":g.ariaLabel,...g.domAttributes,children:a.jsx(h4,{value:e,children:a.jsx(j,{id:e,data:g.data,type:k,positionAbsoluteX:S.positionAbsolute.x,positionAbsoluteY:S.positionAbsolute.y,selected:g.selected??!1,selectable:I,draggable:_,deletable:g.deletable??!0,isConnectable:$,sourcePosition:g.sourcePosition,targetPosition:g.targetPosition,dragging:L,dragHandle:g.dragHandle,zIndex:S.z,parentId:g.parentId,...D})})})}var R4=m.memo(I4);const T4=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function b0(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,onError:o}=ie(T4,we),i=E4(e.onlyRenderVisibleElements),l=P4();return a.jsx("div",{className:"react-flow__nodes",style:kl,children:i.map(u=>a.jsx(R4,{id:u,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},u))})}b0.displayName="NodeRenderer";const L4=m.memo(b0);function A4(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&&x_({sourceNode:o,targetNode:i,width:n.width,height:n.height,transform:n.transform})&&r.push(s.id)}return r},[e]),we)}const z4=({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"})},D4=({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"})},Gm={[Fa.Arrow]:z4,[Fa.ArrowClosed]:D4};function $4(e){const t=Ne();return m.useMemo(()=>{var s,o;return Object.prototype.hasOwnProperty.call(Gm,e)?Gm[e]:((o=(s=t.getState()).onError)==null||o.call(s,"009",Jt.error009(e)),null)},[e])}const O4=({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 u=$4(t);return u?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(u,{color:n,strokeWidth:i})}):null},j0=({defaultColor:e,rfId:t})=>{const n=ie(o=>o.edges),r=ie(o=>o.defaultEdgeOptions),s=m.useMemo(()=>k_(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(O4,{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};j0.displayName="MarkerDefinitions";var F4=m.memo(j0);function k0({x:e,y:t,label:n,labelStyle:r,labelShowBg:s=!0,labelBgStyle:o,labelBgPadding:i=[2,4],labelBgBorderRadius:l=2,children:u,className:c,...h}){const[d,f]=m.useState({x:1,y:0,width:0,height:0}),x=Ie(["react-flow__edge-textwrapper",c]),y=m.useRef(null);return m.useEffect(()=>{if(y.current){const w=y.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:x,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:y,style:r,children:n}),u]}):null}k0.displayName="EdgeText";const H4=m.memo(k0);function Cl({path:e,labelX:t,labelY:n,label:r,labelStyle:s,labelShowBg:o,labelBgStyle:i,labelBgPadding:l,labelBgBorderRadius:u,interactionWidth:c=20,...h}){return a.jsxs(a.Fragment,{children:[a.jsx("path",{...h,d:e,fill:"none",className:Ie(["react-flow__edge-path",h.className])}),c?a.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:c,className:"react-flow__edge-interaction"}):null,r&&It(t)&&It(n)?a.jsx(H4,{x:t,y:n,label:r,labelStyle:s,labelShowBg:o,labelBgStyle:i,labelBgPadding:l,labelBgBorderRadius:u}):null]})}function Ym({pos:e,x1:t,y1:n,x2:r,y2:s}){return e===X.Left||e===X.Right?[.5*(t+r),n]:[t,.5*(n+s)]}function C0({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:r,targetY:s,targetPosition:o=X.Top}){const[i,l]=Ym({pos:n,x1:e,y1:t,x2:r,y2:s}),[u,c]=Ym({pos:o,x1:r,y1:s,x2:e,y2:t}),[h,d,f,x]=Ky({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:i,sourceControlY:l,targetControlX:u,targetControlY:c});return[`M${e},${t} C${i},${l} ${u},${c} ${r},${s}`,h,d,f,x]}function E0(e){return m.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,sourcePosition:i,targetPosition:l,label:u,labelStyle:c,labelShowBg:h,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:x,style:y,markerEnd:w,markerStart:N,interactionWidth:p})=>{const[v,g,S]=C0({sourceX:n,sourceY:r,sourcePosition:i,targetX:s,targetY:o,targetPosition:l}),b=e.isInternal?void 0:t;return a.jsx(Cl,{id:b,path:v,labelX:g,labelY:S,label:u,labelStyle:c,labelShowBg:h,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:x,style:y,markerEnd:w,markerStart:N,interactionWidth:p})})}const V4=E0({isInternal:!1}),_0=E0({isInternal:!0});V4.displayName="SimpleBezierEdge";_0.displayName="SimpleBezierEdgeInternal";function P0(e){return m.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,label:i,labelStyle:l,labelShowBg:u,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:d,style:f,sourcePosition:x=X.Bottom,targetPosition:y=X.Top,markerEnd:w,markerStart:N,pathOptions:p,interactionWidth:v})=>{const[g,S,b]=Ac({sourceX:n,sourceY:r,sourcePosition:x,targetX:s,targetY:o,targetPosition:y,borderRadius:p==null?void 0:p.borderRadius,offset:p==null?void 0:p.offset,stepPosition:p==null?void 0:p.stepPosition}),k=e.isInternal?void 0:t;return a.jsx(Cl,{id:k,path:g,labelX:S,labelY:b,label:i,labelStyle:l,labelShowBg:u,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:d,style:f,markerEnd:w,markerStart:N,interactionWidth:v})})}const M0=P0({isInternal:!1}),I0=P0({isInternal:!0});M0.displayName="SmoothStepEdge";I0.displayName="SmoothStepEdgeInternal";function R0(e){return m.memo(({id:t,...n})=>{var s;const r=e.isInternal?void 0:t;return a.jsx(M0,{...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 B4=R0({isInternal:!1}),T0=R0({isInternal:!0});B4.displayName="StepEdge";T0.displayName="StepEdgeInternal";function L0(e){return m.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,label:i,labelStyle:l,labelShowBg:u,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:d,style:f,markerEnd:x,markerStart:y,interactionWidth:w})=>{const[N,p,v]=Xy({sourceX:n,sourceY:r,targetX:s,targetY:o}),g=e.isInternal?void 0:t;return a.jsx(Cl,{id:g,path:N,labelX:p,labelY:v,label:i,labelStyle:l,labelShowBg:u,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:d,style:f,markerEnd:x,markerStart:y,interactionWidth:w})})}const U4=L0({isInternal:!1}),A0=L0({isInternal:!0});U4.displayName="StraightEdge";A0.displayName="StraightEdgeInternal";function z0(e){return m.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,sourcePosition:i=X.Bottom,targetPosition:l=X.Top,label:u,labelStyle:c,labelShowBg:h,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:x,style:y,markerEnd:w,markerStart:N,pathOptions:p,interactionWidth:v})=>{const[g,S,b]=Gy({sourceX:n,sourceY:r,sourcePosition:i,targetX:s,targetY:o,targetPosition:l,curvature:p==null?void 0:p.curvature}),k=e.isInternal?void 0:t;return a.jsx(Cl,{id:k,path:g,labelX:S,labelY:b,label:u,labelStyle:c,labelShowBg:h,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:x,style:y,markerEnd:w,markerStart:N,interactionWidth:v})})}const W4=z0({isInternal:!1}),D0=z0({isInternal:!0});W4.displayName="BezierEdge";D0.displayName="BezierEdgeInternal";const Xm={default:D0,straight:A0,step:T0,smoothstep:I0,simplebezier:_0},Qm={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},K4=(e,t,n)=>n===X.Left?e-t:n===X.Right?e+t:e,G4=(e,t,n)=>n===X.Top?e-t:n===X.Bottom?e+t:e,qm="react-flow__edgeupdater";function Zm({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:Ie([qm,`${qm}-${l}`]),cx:K4(t,r,e),cy:G4(n,r,e),r,stroke:"transparent",fill:"transparent"})}function Y4({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:s,targetX:o,targetY:i,sourcePosition:l,targetPosition:u,onReconnect:c,onReconnectStart:h,onReconnectEnd:d,setReconnecting:f,setUpdateHover:x}){const y=Ne(),w=(S,b)=>{if(S.button!==0)return;const{autoPanOnConnect:k,domNode:j,isValidConnection:_,connectionMode:I,connectionRadius:$,lib:R,onConnectStart:T,onConnectEnd:A,cancelConnection:C,nodeLookup:L,rfId:M,panBy:D,updateConnection:E}=y.getState(),P=b.type==="target",z=(U,B)=>{f(!1),d==null||d(U,n,b.type,B)},F=U=>c==null?void 0:c(n,U),O=(U,B)=>{f(!0),h==null||h(S,n,b.type),T==null||T(U,B)};$c.onPointerDown(S.nativeEvent,{autoPanOnConnect:k,connectionMode:I,connectionRadius:$,domNode:j,handleId:b.id,nodeId:b.nodeId,nodeLookup:L,isTarget:P,edgeUpdaterType:b.type,lib:R,flowId:M,cancelConnection:C,panBy:D,isValidConnection:_,onConnect:F,onConnectStart:O,onConnectEnd:A,onReconnectEnd:z,updateConnection:E,getTransform:()=>y.getState().transform,getFromHandle:()=>y.getState().connection.fromHandle,dragThreshold:y.getState().connectionDragThreshold,handleDomNode:S.currentTarget})},N=S=>w(S,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),p=S=>w(S,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),v=()=>x(!0),g=()=>x(!1);return a.jsxs(a.Fragment,{children:[(e===!0||e==="source")&&a.jsx(Zm,{position:l,centerX:r,centerY:s,radius:t,onMouseDown:N,onMouseEnter:v,onMouseOut:g,type:"source"}),(e===!0||e==="target")&&a.jsx(Zm,{position:u,centerX:o,centerY:i,radius:t,onMouseDown:p,onMouseEnter:v,onMouseOut:g,type:"target"})]})}function X4({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:s,onDoubleClick:o,onContextMenu:i,onMouseEnter:l,onMouseMove:u,onMouseLeave:c,reconnectRadius:h,onReconnect:d,onReconnectStart:f,onReconnectEnd:x,rfId:y,edgeTypes:w,noPanClassName:N,onError:p,disableKeyboardA11y:v}){let g=ie(ee=>ee.edgeLookup.get(e));const S=ie(ee=>ee.defaultEdgeOptions);g=S?{...S,...g}:g;let b=g.type||"default",k=(w==null?void 0:w[b])||Xm[b];k===void 0&&(p==null||p("011",Jt.error011(b)),b="default",k=(w==null?void 0:w.default)||Xm.default);const j=!!(g.focusable||t&&typeof g.focusable>"u"),_=typeof d<"u"&&(g.reconnectable||n&&typeof g.reconnectable>"u"),I=!!(g.selectable||r&&typeof g.selectable>"u"),$=m.useRef(null),[R,T]=m.useState(!1),[A,C]=m.useState(!1),L=Ne(),{zIndex:M,sourceX:D,sourceY:E,targetX:P,targetY:z,sourcePosition:F,targetPosition:O}=ie(m.useCallback(ee=>{const Z=ee.nodeLookup.get(g.source),ue=ee.nodeLookup.get(g.target);if(!Z||!ue)return{zIndex:g.zIndex,...Qm};const he=j_({id:e,sourceNode:Z,targetNode:ue,sourceHandle:g.sourceHandle||null,targetHandle:g.targetHandle||null,connectionMode:ee.connectionMode,onError:p});return{zIndex:g_({selected:g.selected,zIndex:g.zIndex,sourceNode:Z,targetNode:ue,elevateOnSelect:ee.elevateEdgesOnSelect,zIndexMode:ee.zIndexMode}),...he||Qm}},[g.source,g.target,g.sourceHandle,g.targetHandle,g.selected,g.zIndex]),we),U=m.useMemo(()=>g.markerStart?`url('#${zc(g.markerStart,y)}')`:void 0,[g.markerStart,y]),B=m.useMemo(()=>g.markerEnd?`url('#${zc(g.markerEnd,y)}')`:void 0,[g.markerEnd,y]);if(g.hidden||D===null||E===null||P===null||z===null)return null;const K=ee=>{var le;const{addSelectedEdges:Z,unselectNodesAndEdges:ue,multiSelectionActive:he}=L.getState();I&&(L.setState({nodesSelectionActive:!1}),g.selected&&he?(ue({nodes:[],edges:[g]}),(le=$.current)==null||le.blur()):Z([e])),s&&s(ee,g)},G=o?ee=>{o(ee,{...g})}:void 0,Y=i?ee=>{i(ee,{...g})}:void 0,V=l?ee=>{l(ee,{...g})}:void 0,q=u?ee=>{u(ee,{...g})}:void 0,se=c?ee=>{c(ee,{...g})}:void 0,te=ee=>{var Z;if(!v&&Ry.includes(ee.key)&&I){const{unselectNodesAndEdges:ue,addSelectedEdges:he}=L.getState();ee.key==="Escape"?((Z=$.current)==null||Z.blur(),ue({edges:[g]})):he([e])}};return a.jsx("svg",{style:{zIndex:M},children:a.jsxs("g",{className:Ie(["react-flow__edge",`react-flow__edge-${b}`,g.className,N,{selected:g.selected,animated:g.animated,inactive:!I&&!s,updating:R,selectable:I}]),onClick:K,onDoubleClick:G,onContextMenu:Y,onMouseEnter:V,onMouseMove:q,onMouseLeave:se,onKeyDown:j?te:void 0,tabIndex:j?0:void 0,role:g.ariaRole??(j?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":g.ariaLabel===null?void 0:g.ariaLabel||`Edge from ${g.source} to ${g.target}`,"aria-describedby":j?`${m0}-${y}`:void 0,ref:$,...g.domAttributes,children:[!A&&a.jsx(k,{id:e,source:g.source,target:g.target,type:g.type,selected:g.selected,animated:g.animated,selectable:I,deletable:g.deletable??!0,label:g.label,labelStyle:g.labelStyle,labelShowBg:g.labelShowBg,labelBgStyle:g.labelBgStyle,labelBgPadding:g.labelBgPadding,labelBgBorderRadius:g.labelBgBorderRadius,sourceX:D,sourceY:E,targetX:P,targetY:z,sourcePosition:F,targetPosition:O,data:g.data,style:g.style,sourceHandleId:g.sourceHandle,targetHandleId:g.targetHandle,markerStart:U,markerEnd:B,pathOptions:"pathOptions"in g?g.pathOptions:void 0,interactionWidth:g.interactionWidth}),_&&a.jsx(Y4,{edge:g,isReconnectable:_,reconnectRadius:h,onReconnect:d,onReconnectStart:f,onReconnectEnd:x,sourceX:D,sourceY:E,targetX:P,targetY:z,sourcePosition:F,targetPosition:O,setUpdateHover:T,setReconnecting:C})]})})}var Q4=m.memo(X4);const q4=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function $0({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:s,onReconnect:o,onEdgeContextMenu:i,onEdgeMouseEnter:l,onEdgeMouseMove:u,onEdgeMouseLeave:c,onEdgeClick:h,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:x,onReconnectEnd:y,disableKeyboardA11y:w}){const{edgesFocusable:N,edgesReconnectable:p,elementsSelectable:v,onError:g}=ie(q4,we),S=A4(t);return a.jsxs("div",{className:"react-flow__edges",children:[a.jsx(F4,{defaultColor:e,rfId:n}),S.map(b=>a.jsx(Q4,{id:b,edgesFocusable:N,edgesReconnectable:p,elementsSelectable:v,noPanClassName:s,onReconnect:o,onContextMenu:i,onMouseEnter:l,onMouseMove:u,onMouseLeave:c,onClick:h,reconnectRadius:d,onDoubleClick:f,onReconnectStart:x,onReconnectEnd:y,rfId:n,onError:g,edgeTypes:r,disableKeyboardA11y:w},b))]})}$0.displayName="EdgeRenderer";const Z4=m.memo($0),J4=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function eP({children:e}){const t=ie(J4);return a.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function tP(e){const t=gf(),n=m.useRef(!1);m.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const nP=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function rP(e){const t=ie(nP),n=Ne();return m.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function sP(e){return e.connection.inProgress?{...e.connection,to:ti(e.connection.to,e.transform)}:{...e.connection}}function oP(e){return sP}function iP(e){const t=oP();return ie(t,we)}const aP=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function lP({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:s,width:o,height:i,isValid:l,inProgress:u}=ie(aP,we);return!(o&&s&&u)?null:a.jsx("svg",{style:e,width:o,height:i,className:"react-flow__connectionline react-flow__container",children:a.jsx("g",{className:Ie(["react-flow__connection",Ay(l)]),children:a.jsx(O0,{style:t,type:n,CustomComponent:r,isValid:l})})})}const O0=({style:e,type:t=Rn.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:s,from:o,fromNode:i,fromHandle:l,fromPosition:u,to:c,toNode:h,toHandle:d,toPosition:f,pointer:x}=iP();if(!s)return;if(n)return a.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:i,fromHandle:l,fromX:o.x,fromY:o.y,toX:c.x,toY:c.y,fromPosition:u,toPosition:f,connectionStatus:Ay(r),toNode:h,toHandle:d,pointer:x});let y="";const w={sourceX:o.x,sourceY:o.y,sourcePosition:u,targetX:c.x,targetY:c.y,targetPosition:f};switch(t){case Rn.Bezier:[y]=Gy(w);break;case Rn.SimpleBezier:[y]=C0(w);break;case Rn.Step:[y]=Ac({...w,borderRadius:0});break;case Rn.SmoothStep:[y]=Ac(w);break;default:[y]=Xy(w)}return a.jsx("path",{d:y,fill:"none",className:"react-flow__connection-path",style:e})};O0.displayName="ConnectionLine";const uP={};function Jm(e=uP){m.useRef(e),Ne(),m.useEffect(()=>{},[e])}function cP(){Ne(),m.useRef(!1),m.useEffect(()=>{},[])}function F0({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:o,onEdgeDoubleClick:i,onNodeMouseEnter:l,onNodeMouseMove:u,onNodeMouseLeave:c,onNodeContextMenu:h,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:x,connectionLineType:y,connectionLineStyle:w,connectionLineComponent:N,connectionLineContainerStyle:p,selectionKeyCode:v,selectionOnDrag:g,selectionMode:S,multiSelectionKeyCode:b,panActivationKeyCode:k,zoomActivationKeyCode:j,deleteKeyCode:_,onlyRenderVisibleElements:I,elementsSelectable:$,defaultViewport:R,translateExtent:T,minZoom:A,maxZoom:C,preventScrolling:L,defaultMarkerColor:M,zoomOnScroll:D,zoomOnPinch:E,panOnScroll:P,panOnScrollSpeed:z,panOnScrollMode:F,zoomOnDoubleClick:O,panOnDrag:U,onPaneClick:B,onPaneMouseEnter:K,onPaneMouseMove:G,onPaneMouseLeave:Y,onPaneScroll:V,onPaneContextMenu:q,paneClickDistance:se,nodeClickDistance:te,onEdgeContextMenu:ee,onEdgeMouseEnter:Z,onEdgeMouseMove:ue,onEdgeMouseLeave:he,reconnectRadius:le,onReconnect:Be,onReconnectStart:Nn,onReconnectEnd:tn,noDragClassName:Zn,noWheelClassName:Rs,noPanClassName:Ts,disableKeyboardA11y:Ls,nodeExtent:Il,rfId:ri,viewport:_r,onViewportChange:As}){return Jm(e),Jm(t),cP(),tP(n),rP(_r),a.jsx(k4,{onPaneClick:B,onPaneMouseEnter:K,onPaneMouseMove:G,onPaneMouseLeave:Y,onPaneContextMenu:q,onPaneScroll:V,paneClickDistance:se,deleteKeyCode:_,selectionKeyCode:v,selectionOnDrag:g,selectionMode:S,onSelectionStart:f,onSelectionEnd:x,multiSelectionKeyCode:b,panActivationKeyCode:k,zoomActivationKeyCode:j,elementsSelectable:$,zoomOnScroll:D,zoomOnPinch:E,zoomOnDoubleClick:O,panOnScroll:P,panOnScrollSpeed:z,panOnScrollMode:F,panOnDrag:U,defaultViewport:R,translateExtent:T,minZoom:A,maxZoom:C,onSelectionContextMenu:d,preventScrolling:L,noDragClassName:Zn,noWheelClassName:Rs,noPanClassName:Ts,disableKeyboardA11y:Ls,onViewportChange:As,isControlledViewport:!!_r,children:a.jsxs(eP,{children:[a.jsx(Z4,{edgeTypes:t,onEdgeClick:s,onEdgeDoubleClick:i,onReconnect:Be,onReconnectStart:Nn,onReconnectEnd:tn,onlyRenderVisibleElements:I,onEdgeContextMenu:ee,onEdgeMouseEnter:Z,onEdgeMouseMove:ue,onEdgeMouseLeave:he,reconnectRadius:le,defaultMarkerColor:M,noPanClassName:Ts,disableKeyboardA11y:Ls,rfId:ri}),a.jsx(lP,{style:w,type:y,component:N,containerStyle:p}),a.jsx("div",{className:"react-flow__edgelabel-renderer"}),a.jsx(L4,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:o,onNodeMouseEnter:l,onNodeMouseMove:u,onNodeMouseLeave:c,onNodeContextMenu:h,nodeClickDistance:te,onlyRenderVisibleElements:I,noPanClassName:Ts,noDragClassName:Zn,disableKeyboardA11y:Ls,nodeExtent:Il,rfId:ri}),a.jsx("div",{className:"react-flow__viewport-portal"})]})})}F0.displayName="GraphView";const dP=m.memo(F0),ep=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:i,fitViewOptions:l,minZoom:u=.5,maxZoom:c=2,nodeOrigin:h,nodeExtent:d,zIndexMode:f="basic"}={})=>{const x=new Map,y=new Map,w=new Map,N=new Map,p=r??t??[],v=n??e??[],g=h??[0,0],S=d??Do;Zy(w,N,p);const b=Dc(v,x,y,{nodeOrigin:g,nodeExtent:S,zIndexMode:f});let k=[0,0,1];if(i&&s&&o){const j=Jo(x,{filter:R=>!!((R.width||R.initialWidth)&&(R.height||R.initialHeight))}),{x:_,y:I,zoom:$}=uf(j,s,o,u,c,(l==null?void 0:l.padding)??.1);k=[_,I,$]}return{rfId:"1",width:s??0,height:o??0,transform:k,nodes:v,nodesInitialized:b,nodeLookup:x,parentLookup:y,edges:p,edgeLookup:N,connectionLookup:w,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:u,maxZoom:c,translateExtent:Do,nodeExtent:S,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:ps.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:g,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:{...Ly},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:c_,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Ty,zIndexMode:f,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},fP=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:i,fitViewOptions:l,minZoom:u,maxZoom:c,nodeOrigin:h,nodeExtent:d,zIndexMode:f})=>_3((x,y)=>{async function w(){const{nodeLookup:N,panZoom:p,fitViewOptions:v,fitViewResolver:g,width:S,height:b,minZoom:k,maxZoom:j}=y();p&&(await l_({nodes:N,width:S,height:b,panZoom:p,minZoom:k,maxZoom:j},v),g==null||g.resolve(!0),x({fitViewResolver:null}))}return{...ep({nodes:e,edges:t,width:s,height:o,fitView:i,fitViewOptions:l,minZoom:u,maxZoom:c,nodeOrigin:h,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:f}),setNodes:N=>{const{nodeLookup:p,parentLookup:v,nodeOrigin:g,elevateNodesOnSelect:S,fitViewQueued:b,zIndexMode:k}=y(),j=Dc(N,p,v,{nodeOrigin:g,nodeExtent:d,elevateNodesOnSelect:S,checkEquality:!0,zIndexMode:k});b&&j?(w(),x({nodes:N,nodesInitialized:j,fitViewQueued:!1,fitViewOptions:void 0})):x({nodes:N,nodesInitialized:j})},setEdges:N=>{const{connectionLookup:p,edgeLookup:v}=y();Zy(p,v,N),x({edges:N})},setDefaultNodesAndEdges:(N,p)=>{if(N){const{setNodes:v}=y();v(N),x({hasDefaultNodes:!0})}if(p){const{setEdges:v}=y();v(p),x({hasDefaultEdges:!0})}},updateNodeInternals:N=>{const{triggerNodeChanges:p,nodeLookup:v,parentLookup:g,domNode:S,nodeOrigin:b,nodeExtent:k,debug:j,fitViewQueued:_,zIndexMode:I}=y(),{changes:$,updatedInternals:R}=R_(N,v,g,S,b,k,I);R&&(__(v,g,{nodeOrigin:b,nodeExtent:k,zIndexMode:I}),_?(w(),x({fitViewQueued:!1,fitViewOptions:void 0})):x({}),($==null?void 0:$.length)>0&&(j&&console.log("React Flow: trigger node changes",$),p==null||p($)))},updateNodePositions:(N,p=!1)=>{const v=[];let g=[];const{nodeLookup:S,triggerNodeChanges:b,connection:k,updateConnection:j,onNodesChangeMiddlewareMap:_}=y();for(const[I,$]of N){const R=S.get(I),T=!!(R!=null&&R.expandParent&&(R!=null&&R.parentId)&&($!=null&&$.position)),A={id:I,type:"position",position:T?{x:Math.max(0,$.position.x),y:Math.max(0,$.position.y)}:$.position,dragging:p};if(R&&k.inProgress&&k.fromNode.id===R.id){const C=Nr(R,k.fromHandle,X.Left,!0);j({...k,from:C})}T&&R.parentId&&v.push({id:I,parentId:R.parentId,rect:{...$.internals.positionAbsolute,width:$.measured.width??0,height:$.measured.height??0}}),g.push(A)}if(v.length>0){const{parentLookup:I,nodeOrigin:$}=y(),R=pf(v,S,I,$);g.push(...R)}for(const I of _.values())g=I(g);b(g)},triggerNodeChanges:N=>{const{onNodesChange:p,setNodes:v,nodes:g,hasDefaultNodes:S,debug:b}=y();if(N!=null&&N.length){if(S){const k=X3(N,g);v(k)}b&&console.log("React Flow: trigger node changes",N),p==null||p(N)}},triggerEdgeChanges:N=>{const{onEdgesChange:p,setEdges:v,edges:g,hasDefaultEdges:S,debug:b}=y();if(N!=null&&N.length){if(S){const k=Q3(N,g);v(k)}b&&console.log("React Flow: trigger edge changes",N),p==null||p(N)}},addSelectedNodes:N=>{const{multiSelectionActive:p,edgeLookup:v,nodeLookup:g,triggerNodeChanges:S,triggerEdgeChanges:b}=y();if(p){const k=N.map(j=>tr(j,!0));S(k);return}S(Gr(g,new Set([...N]),!0)),b(Gr(v))},addSelectedEdges:N=>{const{multiSelectionActive:p,edgeLookup:v,nodeLookup:g,triggerNodeChanges:S,triggerEdgeChanges:b}=y();if(p){const k=N.map(j=>tr(j,!0));b(k);return}b(Gr(v,new Set([...N]))),S(Gr(g,new Set,!0))},unselectNodesAndEdges:({nodes:N,edges:p}={})=>{const{edges:v,nodes:g,nodeLookup:S,triggerNodeChanges:b,triggerEdgeChanges:k}=y(),j=N||g,_=p||v,I=j.map(R=>{const T=S.get(R.id);return T&&(T.selected=!1),tr(R.id,!1)}),$=_.map(R=>tr(R.id,!1));b(I),k($)},setMinZoom:N=>{const{panZoom:p,maxZoom:v}=y();p==null||p.setScaleExtent([N,v]),x({minZoom:N})},setMaxZoom:N=>{const{panZoom:p,minZoom:v}=y();p==null||p.setScaleExtent([v,N]),x({maxZoom:N})},setTranslateExtent:N=>{var p;(p=y().panZoom)==null||p.setTranslateExtent(N),x({translateExtent:N})},resetSelectedElements:()=>{const{edges:N,nodes:p,triggerNodeChanges:v,triggerEdgeChanges:g,elementsSelectable:S}=y();if(!S)return;const b=p.reduce((j,_)=>_.selected?[...j,tr(_.id,!1)]:j,[]),k=N.reduce((j,_)=>_.selected?[...j,tr(_.id,!1)]:j,[]);v(b),g(k)},setNodeExtent:N=>{const{nodes:p,nodeLookup:v,parentLookup:g,nodeOrigin:S,elevateNodesOnSelect:b,nodeExtent:k,zIndexMode:j}=y();N[0][0]===k[0][0]&&N[0][1]===k[0][1]&&N[1][0]===k[1][0]&&N[1][1]===k[1][1]||(Dc(p,v,g,{nodeOrigin:S,nodeExtent:N,elevateNodesOnSelect:b,checkEquality:!1,zIndexMode:j}),x({nodeExtent:N}))},panBy:N=>{const{transform:p,width:v,height:g,panZoom:S,translateExtent:b}=y();return T_({delta:N,panZoom:S,transform:p,translateExtent:b,width:v,height:g})},setCenter:async(N,p,v)=>{const{width:g,height:S,maxZoom:b,panZoom:k}=y();if(!k)return Promise.resolve(!1);const j=typeof(v==null?void 0:v.zoom)<"u"?v.zoom:b;return await k.setViewport({x:g/2-N*j,y:S/2-p*j,zoom:j},{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:()=>{x({connection:{...Ly}})},updateConnection:N=>{x({connection:N})},reset:()=>x({...ep()})}},Object.is);function hP({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:s,initialHeight:o,initialMinZoom:i,initialMaxZoom:l,initialFitViewOptions:u,fitView:c,nodeOrigin:h,nodeExtent:d,zIndexMode:f,children:x}){const[y]=m.useState(()=>fP({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:c,minZoom:i,maxZoom:l,fitViewOptions:u,nodeOrigin:h,nodeExtent:d,zIndexMode:f}));return a.jsx(P3,{value:y,children:a.jsx(e4,{children:x})})}function mP({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:s,width:o,height:i,fitView:l,fitViewOptions:u,minZoom:c,maxZoom:h,nodeOrigin:d,nodeExtent:f,zIndexMode:x}){return m.useContext(bl)?a.jsx(a.Fragment,{children:e}):a.jsx(hP,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:s,initialWidth:o,initialHeight:i,fitView:l,initialFitViewOptions:u,initialMinZoom:c,initialMaxZoom:h,nodeOrigin:d,nodeExtent:f,zIndexMode:x,children:e})}const pP={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function gP({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:s,nodeTypes:o,edgeTypes:i,onNodeClick:l,onEdgeClick:u,onInit:c,onMove:h,onMoveStart:d,onMoveEnd:f,onConnect:x,onConnectStart:y,onConnectEnd:w,onClickConnectStart:N,onClickConnectEnd:p,onNodeMouseEnter:v,onNodeMouseMove:g,onNodeMouseLeave:S,onNodeContextMenu:b,onNodeDoubleClick:k,onNodeDragStart:j,onNodeDrag:_,onNodeDragStop:I,onNodesDelete:$,onEdgesDelete:R,onDelete:T,onSelectionChange:A,onSelectionDragStart:C,onSelectionDrag:L,onSelectionDragStop:M,onSelectionContextMenu:D,onSelectionStart:E,onSelectionEnd:P,onBeforeDelete:z,connectionMode:F,connectionLineType:O=Rn.Bezier,connectionLineStyle:U,connectionLineComponent:B,connectionLineContainerStyle:K,deleteKeyCode:G="Backspace",selectionKeyCode:Y="Shift",selectionOnDrag:V=!1,selectionMode:q=$o.Full,panActivationKeyCode:se="Space",multiSelectionKeyCode:te=Fo()?"Meta":"Control",zoomActivationKeyCode:ee=Fo()?"Meta":"Control",snapToGrid:Z,snapGrid:ue,onlyRenderVisibleElements:he=!1,selectNodesOnDrag:le,nodesDraggable:Be,autoPanOnNodeFocus:Nn,nodesConnectable:tn,nodesFocusable:Zn,nodeOrigin:Rs=p0,edgesFocusable:Ts,edgesReconnectable:Ls,elementsSelectable:Il=!0,defaultViewport:ri=V3,minZoom:_r=.5,maxZoom:As=2,translateExtent:Ef=Do,preventScrolling:Wv=!0,nodeExtent:Rl,defaultMarkerColor:Kv="#b1b1b7",zoomOnScroll:Gv=!0,zoomOnPinch:Yv=!0,panOnScroll:Xv=!1,panOnScrollSpeed:Qv=.5,panOnScrollMode:qv=cr.Free,zoomOnDoubleClick:Zv=!0,panOnDrag:Jv=!0,onPaneClick:e1,onPaneMouseEnter:t1,onPaneMouseMove:n1,onPaneMouseLeave:r1,onPaneScroll:s1,onPaneContextMenu:o1,paneClickDistance:i1=1,nodeClickDistance:a1=0,children:l1,onReconnect:u1,onReconnectStart:c1,onReconnectEnd:d1,onEdgeContextMenu:f1,onEdgeDoubleClick:h1,onEdgeMouseEnter:m1,onEdgeMouseMove:p1,onEdgeMouseLeave:g1,reconnectRadius:x1=10,onNodesChange:y1,onEdgesChange:v1,noDragClassName:w1="nodrag",noWheelClassName:N1="nowheel",noPanClassName:_f="nopan",fitView:Pf,fitViewOptions:Mf,connectOnClick:S1,attributionPosition:b1,proOptions:j1,defaultEdgeOptions:k1,elevateNodesOnSelect:C1=!0,elevateEdgesOnSelect:E1=!1,disableKeyboardA11y:If=!1,autoPanOnConnect:_1,autoPanOnNodeDrag:P1,autoPanSpeed:M1,connectionRadius:I1,isValidConnection:R1,onError:T1,style:L1,id:Rf,nodeDragThreshold:A1,connectionDragThreshold:z1,viewport:D1,onViewportChange:$1,width:O1,height:F1,colorMode:H1="light",debug:V1,onScroll:si,ariaLabelConfig:B1,zIndexMode:Tf="basic",...U1},W1){const Tl=Rf||"1",K1=K3(H1),G1=m.useCallback(Lf=>{Lf.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),si==null||si(Lf)},[si]);return a.jsx("div",{"data-testid":"rf__wrapper",...U1,onScroll:G1,style:{...L1,...pP},ref:W1,className:Ie(["react-flow",s,K1]),id:Rf,role:"application",children:a.jsxs(mP,{nodes:e,edges:t,width:O1,height:F1,fitView:Pf,fitViewOptions:Mf,minZoom:_r,maxZoom:As,nodeOrigin:Rs,nodeExtent:Rl,zIndexMode:Tf,children:[a.jsx(dP,{onInit:c,onNodeClick:l,onEdgeClick:u,onNodeMouseEnter:v,onNodeMouseMove:g,onNodeMouseLeave:S,onNodeContextMenu:b,onNodeDoubleClick:k,nodeTypes:o,edgeTypes:i,connectionLineType:O,connectionLineStyle:U,connectionLineComponent:B,connectionLineContainerStyle:K,selectionKeyCode:Y,selectionOnDrag:V,selectionMode:q,deleteKeyCode:G,multiSelectionKeyCode:te,panActivationKeyCode:se,zoomActivationKeyCode:ee,onlyRenderVisibleElements:he,defaultViewport:ri,translateExtent:Ef,minZoom:_r,maxZoom:As,preventScrolling:Wv,zoomOnScroll:Gv,zoomOnPinch:Yv,zoomOnDoubleClick:Zv,panOnScroll:Xv,panOnScrollSpeed:Qv,panOnScrollMode:qv,panOnDrag:Jv,onPaneClick:e1,onPaneMouseEnter:t1,onPaneMouseMove:n1,onPaneMouseLeave:r1,onPaneScroll:s1,onPaneContextMenu:o1,paneClickDistance:i1,nodeClickDistance:a1,onSelectionContextMenu:D,onSelectionStart:E,onSelectionEnd:P,onReconnect:u1,onReconnectStart:c1,onReconnectEnd:d1,onEdgeContextMenu:f1,onEdgeDoubleClick:h1,onEdgeMouseEnter:m1,onEdgeMouseMove:p1,onEdgeMouseLeave:g1,reconnectRadius:x1,defaultMarkerColor:Kv,noDragClassName:w1,noWheelClassName:N1,noPanClassName:_f,rfId:Tl,disableKeyboardA11y:If,nodeExtent:Rl,viewport:D1,onViewportChange:$1}),a.jsx(W3,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:x,onConnectStart:y,onConnectEnd:w,onClickConnectStart:N,onClickConnectEnd:p,nodesDraggable:Be,autoPanOnNodeFocus:Nn,nodesConnectable:tn,nodesFocusable:Zn,edgesFocusable:Ts,edgesReconnectable:Ls,elementsSelectable:Il,elevateNodesOnSelect:C1,elevateEdgesOnSelect:E1,minZoom:_r,maxZoom:As,nodeExtent:Rl,onNodesChange:y1,onEdgesChange:v1,snapToGrid:Z,snapGrid:ue,connectionMode:F,translateExtent:Ef,connectOnClick:S1,defaultEdgeOptions:k1,fitView:Pf,fitViewOptions:Mf,onNodesDelete:$,onEdgesDelete:R,onDelete:T,onNodeDragStart:j,onNodeDrag:_,onNodeDragStop:I,onSelectionDrag:L,onSelectionDragStart:C,onSelectionDragStop:M,onMove:h,onMoveStart:d,onMoveEnd:f,noPanClassName:_f,nodeOrigin:Rs,rfId:Tl,autoPanOnConnect:_1,autoPanOnNodeDrag:P1,autoPanSpeed:M1,onError:T1,connectionRadius:I1,isValidConnection:R1,selectNodesOnDrag:le,nodeDragThreshold:A1,connectionDragThreshold:z1,onBeforeDelete:z,debug:V1,ariaLabelConfig:B1,zIndexMode:Tf}),a.jsx(H3,{onSelectionChange:A}),l1,a.jsx(z3,{proOptions:j1,position:b1}),a.jsx(A3,{rfId:Tl,disableKeyboardA11y:If})]})})}var xP=x0(gP);function yP({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:Ie(["react-flow__background-pattern",n,r])})}function vP({radius:e,className:t}){return a.jsx("circle",{cx:e,cy:e,r:e,className:Ie(["react-flow__background-pattern","dots",t])})}var Bn;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Bn||(Bn={}));const wP={[Bn.Dots]:1,[Bn.Lines]:1,[Bn.Cross]:6},NP=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function H0({id:e,variant:t=Bn.Dots,gap:n=20,size:r,lineWidth:s=1,offset:o=0,color:i,bgColor:l,style:u,className:c,patternClassName:h}){const d=m.useRef(null),{transform:f,patternId:x}=ie(NP,we),y=r||wP[t],w=t===Bn.Dots,N=t===Bn.Cross,p=Array.isArray(n)?n:[n,n],v=[p[0]*f[2]||1,p[1]*f[2]||1],g=y*f[2],S=Array.isArray(o)?o:[o,o],b=N?[g,g]:v,k=[S[0]*f[2]||1+b[0]/2,S[1]*f[2]||1+b[1]/2],j=`${x}${e||""}`;return a.jsxs("svg",{className:Ie(["react-flow__background",c]),style:{...u,...kl,"--xy-background-color-props":l,"--xy-background-pattern-color-props":i},ref:d,"data-testid":"rf__background",children:[a.jsx("pattern",{id:j,x:f[0]%v[0],y:f[1]%v[1],width:v[0],height:v[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${k[0]},-${k[1]})`,children:w?a.jsx(vP,{radius:g/2,className:h}):a.jsx(yP,{dimensions:b,lineWidth:s,variant:t,className:h})}),a.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${j})`})]})}H0.displayName="Background";const SP=m.memo(H0);function bP(){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 jP(){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 kP(){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 CP(){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 EP(){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 Ri({children:e,className:t,...n}){return a.jsx("button",{type:"button",className:Ie(["react-flow__controls-button",t]),...n,children:e})}const _P=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function V0({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:o,onZoomOut:i,onFitView:l,onInteractiveChange:u,className:c,children:h,position:d="bottom-left",orientation:f="vertical","aria-label":x}){const y=Ne(),{isInteractive:w,minZoomReached:N,maxZoomReached:p,ariaLabelConfig:v}=ie(_P,we),{zoomIn:g,zoomOut:S,fitView:b}=gf(),k=()=>{g(),o==null||o()},j=()=>{S(),i==null||i()},_=()=>{b(s),l==null||l()},I=()=>{y.setState({nodesDraggable:!w,nodesConnectable:!w,elementsSelectable:!w}),u==null||u(!w)},$=f==="horizontal"?"horizontal":"vertical";return a.jsxs(jl,{className:Ie(["react-flow__controls",$,c]),position:d,style:e,"data-testid":"rf__controls","aria-label":x??v["controls.ariaLabel"],children:[t&&a.jsxs(a.Fragment,{children:[a.jsx(Ri,{onClick:k,className:"react-flow__controls-zoomin",title:v["controls.zoomIn.ariaLabel"],"aria-label":v["controls.zoomIn.ariaLabel"],disabled:p,children:a.jsx(bP,{})}),a.jsx(Ri,{onClick:j,className:"react-flow__controls-zoomout",title:v["controls.zoomOut.ariaLabel"],"aria-label":v["controls.zoomOut.ariaLabel"],disabled:N,children:a.jsx(jP,{})})]}),n&&a.jsx(Ri,{className:"react-flow__controls-fitview",onClick:_,title:v["controls.fitView.ariaLabel"],"aria-label":v["controls.fitView.ariaLabel"],children:a.jsx(kP,{})}),r&&a.jsx(Ri,{className:"react-flow__controls-interactive",onClick:I,title:v["controls.interactive.ariaLabel"],"aria-label":v["controls.interactive.ariaLabel"],children:w?a.jsx(EP,{}):a.jsx(CP,{})}),h]})}V0.displayName="Controls";const PP=m.memo(V0);function MP({id:e,x:t,y:n,width:r,height:s,style:o,color:i,strokeColor:l,strokeWidth:u,className:c,borderRadius:h,shapeRendering:d,selected:f,onClick:x}){const{background:y,backgroundColor:w}=o||{},N=i||y||w;return a.jsx("rect",{className:Ie(["react-flow__minimap-node",{selected:f},c]),x:t,y:n,rx:h,ry:h,width:r,height:s,style:{fill:N,stroke:l,strokeWidth:u},shapeRendering:d,onClick:x?p=>x(p,e):void 0})}const IP=m.memo(MP),RP=e=>e.nodes.map(t=>t.id),yu=e=>e instanceof Function?e:()=>e;function TP({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:o=IP,onClick:i}){const l=ie(RP,we),u=yu(t),c=yu(e),h=yu(n),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return a.jsx(a.Fragment,{children:l.map(f=>a.jsx(AP,{id:f,nodeColorFunc:u,nodeStrokeColorFunc:c,nodeClassNameFunc:h,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:o,onClick:i,shapeRendering:d},f))})}function LP({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:o,shapeRendering:i,NodeComponent:l,onClick:u}){const{node:c,x:h,y:d,width:f,height:x}=ie(y=>{const{internals:w}=y.nodeLookup.get(e),N=w.userNode,{x:p,y:v}=w.positionAbsolute,{width:g,height:S}=wn(N);return{node:N,x:p,y:v,width:g,height:S}},we);return!c||c.hidden||!Hy(c)?null:a.jsx(l,{x:h,y:d,width:f,height:x,style:c.style,selected:!!c.selected,className:r(c),color:t(c),borderRadius:s,strokeColor:n(c),strokeWidth:o,shapeRendering:i,onClick:u,id:c.id})}const AP=m.memo(LP);var zP=m.memo(TP);const DP=200,$P=150,OP=e=>!e.hidden,FP=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?Fy(Jo(e.nodeLookup,{filter:OP}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},HP="react-flow__minimap-desc";function B0({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:s="",nodeBorderRadius:o=5,nodeStrokeWidth:i,nodeComponent:l,bgColor:u,maskColor:c,maskStrokeColor:h,maskStrokeWidth:d,position:f="bottom-right",onClick:x,onNodeClick:y,pannable:w=!1,zoomable:N=!1,ariaLabel:p,inversePan:v,zoomStep:g=1,offsetScale:S=5}){const b=Ne(),k=m.useRef(null),{boundingRect:j,viewBB:_,rfId:I,panZoom:$,translateExtent:R,flowWidth:T,flowHeight:A,ariaLabelConfig:C}=ie(FP,we),L=(e==null?void 0:e.width)??DP,M=(e==null?void 0:e.height)??$P,D=j.width/L,E=j.height/M,P=Math.max(D,E),z=P*L,F=P*M,O=S*P,U=j.x-(z-j.width)/2-O,B=j.y-(F-j.height)/2-O,K=z+O*2,G=F+O*2,Y=`${HP}-${I}`,V=m.useRef(0),q=m.useRef();V.current=P,m.useEffect(()=>{if(k.current&&$)return q.current=V_({domNode:k.current,panZoom:$,getTransform:()=>b.getState().transform,getViewScale:()=>V.current}),()=>{var Z;(Z=q.current)==null||Z.destroy()}},[$]),m.useEffect(()=>{var Z;(Z=q.current)==null||Z.update({translateExtent:R,width:T,height:A,inversePan:v,pannable:w,zoomStep:g,zoomable:N})},[w,N,v,g,R,T,A]);const se=x?Z=>{var le;const[ue,he]=((le=q.current)==null?void 0:le.pointer(Z))||[0,0];x(Z,{x:ue,y:he})}:void 0,te=y?m.useCallback((Z,ue)=>{const he=b.getState().nodeLookup.get(ue).internals.userNode;y(Z,he)},[]):void 0,ee=p??C["minimap.ariaLabel"];return a.jsx(jl,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-stroke-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-stroke-width-props":typeof d=="number"?d*P: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:Ie(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:a.jsxs("svg",{width:L,height:M,viewBox:`${U} ${B} ${K} ${G}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":Y,ref:k,onClick:se,children:[ee&&a.jsx("title",{id:Y,children:ee}),a.jsx(zP,{onClick:te,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:o,nodeClassName:s,nodeStrokeWidth:i,nodeComponent:l}),a.jsx("path",{className:"react-flow__minimap-mask",d:`M${U-O},${B-O}h${K+O*2}v${G+O*2}h${-K-O*2}z
|
|
343
|
+
M${_.x},${_.y}h${_.width}v${_.height}h${-_.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}B0.displayName="MiniMap";m.memo(B0);const VP=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,BP={[vs.Line]:"right",[vs.Handle]:"bottom-right"};function UP({nodeId:e,position:t,variant:n=vs.Handle,className:r,style:s=void 0,children:o,color:i,minWidth:l=10,minHeight:u=10,maxWidth:c=Number.MAX_VALUE,maxHeight:h=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:f,autoScale:x=!0,shouldResize:y,onResizeStart:w,onResize:N,onResizeEnd:p}){const v=N0(),g=typeof e=="string"?e:v,S=Ne(),b=m.useRef(null),k=n===vs.Handle,j=ie(m.useCallback(VP(k&&x),[k,x]),we),_=m.useRef(null),I=t??BP[n];m.useEffect(()=>{if(!(!b.current||!g))return _.current||(_.current=n3({domNode:b.current,nodeId:g,getStoreItems:()=>{const{nodeLookup:R,transform:T,snapGrid:A,snapToGrid:C,nodeOrigin:L,domNode:M}=S.getState();return{nodeLookup:R,transform:T,snapGrid:A,snapToGrid:C,nodeOrigin:L,paneDomNode:M}},onChange:(R,T)=>{const{triggerNodeChanges:A,nodeLookup:C,parentLookup:L,nodeOrigin:M}=S.getState(),D=[],E={x:R.x,y:R.y},P=C.get(g);if(P&&P.expandParent&&P.parentId){const z=P.origin??M,F=R.width??P.measured.width??0,O=R.height??P.measured.height??0,U={id:P.id,parentId:P.parentId,rect:{width:F,height:O,...Vy({x:R.x??P.position.x,y:R.y??P.position.y},{width:F,height:O},P.parentId,C,z)}},B=pf([U],C,L,M);D.push(...B),E.x=R.x?Math.max(z[0]*F,R.x):void 0,E.y=R.y?Math.max(z[1]*O,R.y):void 0}if(E.x!==void 0&&E.y!==void 0){const z={id:g,type:"position",position:{...E}};D.push(z)}if(R.width!==void 0&&R.height!==void 0){const F={id:g,type:"dimensions",resizing:!0,setAttributes:f?f==="horizontal"?"width":"height":!0,dimensions:{width:R.width,height:R.height}};D.push(F)}for(const z of T){const F={...z,type:"position"};D.push(F)}A(D)},onEnd:({width:R,height:T})=>{const A={id:g,type:"dimensions",resizing:!1,dimensions:{width:R,height:T}};S.getState().triggerNodeChanges([A])}})),_.current.update({controlPosition:I,boundaries:{minWidth:l,minHeight:u,maxWidth:c,maxHeight:h},keepAspectRatio:d,resizeDirection:f,onResizeStart:w,onResize:N,onResizeEnd:p,shouldResize:y}),()=>{var R;(R=_.current)==null||R.destroy()}},[I,l,u,c,h,d,w,N,p,y]);const $=I.split("-");return a.jsx("div",{className:Ie(["react-flow__resize-control","nodrag",...$,n,r]),ref:b,style:{...s,scale:j,...i&&{[k?"backgroundColor":"borderColor"]:i}},children:o})}m.memo(UP);function WP(){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 KP(){const[e,t]=m.useState([]),[n,r]=m.useState([]),[s,o]=m.useState(!0),i=WP();m.useEffect(()=>{Promise.all([re.discovery.agents(),re.observations.permissions()]).then(([c,h])=>{t(c.data??[]),r(h.data??[]),o(!1)}).catch(()=>o(!1))},[]);const{nodes:l,edges:u}=m.useMemo(()=>{const c=[],h=[],d=new Set,f=new Map,x=i?{background:"#18181b",color:"#fafafa",border:"1px solid #3f3f46"}:{background:"#ffffff",color:"#09090b",border:"1px solid #e4e4e7"},y=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 g=`agent-${p.id}`;p.registeredAgentId&&f.set(p.registeredAgentId,g),f.set(p.id,g),c.push({id:g,position:{x:100,y:v*120},data:{label:`${p.emoji||"🤖"} ${p.name}`},style:{...x,borderRadius:"8px",padding:"8px 16px",fontSize:"13px"}})}),n.forEach(p=>{const v=`tool-${p.toolName}`;d.has(p.toolName)||(d.add(p.toolName),c.push({id:v,position:{x:400,y:d.size*80},data:{label:`🔧 ${p.toolName}`},style:{...y,borderRadius:"8px",padding:"6px 12px",fontSize:"12px"}}));const g=f.get(p.agentId)??`agent-${p.agentId}`;h.push({id:`e-${p.agentId}-${p.toolName}`,source:g,target:v,animated:p.accessPattern==="write",style:{stroke:p.accessPattern==="write"?"#eab308":w}})}),{nodes:c,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:u,fitView:!0,proOptions:{hideAttribution:!0},children:[a.jsx(SP,{color:i?"#27272a":"#e4e4e7",gap:20}),a.jsx(PP,{})]})})]})}const yf=m.forwardRef(({className:e,...t},n)=>a.jsx("textarea",{className:Pe("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}));yf.displayName="Textarea";const Ze=m.forwardRef(({className:e,...t},n)=>a.jsx("label",{ref:n,className:Pe("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...t}));Ze.displayName="Label";function He(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 GP(e,t){const n=m.createContext(t);function r(o){const{children:i,...l}=o,u=m.useMemo(()=>l,Object.values(l));return a.jsx(n.Provider,{value:u,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 El(e,t=[]){let n=[];function r(o,i){const l=m.createContext(i),u=n.length;n=[...n,i];function c(d){const{scope:f,children:x,...y}=d,w=(f==null?void 0:f[e][u])||l,N=m.useMemo(()=>y,Object.values(y));return a.jsx(w.Provider,{value:N,children:x})}function h(d,f){const x=(f==null?void 0:f[e][u])||l,y=m.useContext(x);if(y)return y;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${o}\``)}return c.displayName=o+"Provider",[c,h]}const s=()=>{const o=n.map(i=>m.createContext(i));return function(l){const u=(l==null?void 0:l[e])||o;return m.useMemo(()=>({[`__scope${e}`]:{...l,[e]:u}}),[l,u])}};return s.scopeName=e,[r,YP(s,...t)]}function YP(...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:u,scopeName:c})=>{const d=u(o)[`__scope${c}`];return{...l,...d}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function XP(e){const t=e+"CollectionProvider",[n,r]=El(t),[s,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=x=>{const{scope:y,children:w}=x,N=Bt.useRef(null),p=Bt.useRef(new Map).current;return a.jsx(s,{scope:y,itemMap:p,collectionRef:N,children:w})};i.displayName=t;const l=e+"CollectionSlot",u=Bt.forwardRef((x,y)=>{const{scope:w,children:N}=x,p=o(l,w),v=Zt(y,p.collectionRef);return a.jsx(fs,{ref:v,children:N})});u.displayName=l;const c=e+"CollectionItemSlot",h="data-radix-collection-item",d=Bt.forwardRef((x,y)=>{const{scope:w,children:N,...p}=x,v=Bt.useRef(null),g=Zt(y,v),S=o(c,w);return Bt.useEffect(()=>(S.itemMap.set(v,{ref:v,...p}),()=>void S.itemMap.delete(v))),a.jsx(fs,{[h]:"",ref:g,children:N})});d.displayName=c;function f(x){const y=o(e+"CollectionConsumer",x);return Bt.useCallback(()=>{const N=y.collectionRef.current;if(!N)return[];const p=Array.from(N.querySelectorAll(`[${h}]`));return Array.from(y.itemMap.values()).sort((S,b)=>p.indexOf(S.ref.current)-p.indexOf(b.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:i,Slot:u,ItemSlot:d},f,r]}var Wa=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},QP=cw.useId||(()=>{}),qP=0;function mo(e){const[t,n]=m.useState(QP());return Wa(()=>{n(r=>r??String(qP++))},[e]),t?`radix-${t}`:""}var ZP=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],tt=ZP.reduce((e,t)=>{const n=m.forwardRef((r,s)=>{const{asChild:o,...i}=r,l=o?fs: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 JP(e,t){e&&ul.flushSync(()=>e.dispatchEvent(t))}function Yn(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 vf({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,s]=e5({defaultProp:t,onChange:n}),o=e!==void 0,i=o?e:r,l=Yn(n),u=m.useCallback(c=>{if(o){const d=typeof c=="function"?c(e):c;d!==e&&l(d)}else s(c)},[o,e,s,l]);return[i,u]}function e5({defaultProp:e,onChange:t}){const n=m.useState(e),[r]=n,s=m.useRef(r),o=Yn(t);return m.useEffect(()=>{s.current!==r&&(o(r),s.current=r)},[r,s,o]),n}var t5=m.createContext(void 0);function U0(e){const t=m.useContext(t5);return e||t||"ltr"}var vu="rovingFocusGroup.onEntryFocus",n5={bubbles:!1,cancelable:!0},_l="RovingFocusGroup",[Fc,W0,r5]=XP(_l),[s5,K0]=El(_l,[r5]),[o5,i5]=s5(_l),G0=m.forwardRef((e,t)=>a.jsx(Fc.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(Fc.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx(a5,{...e,ref:t})})}));G0.displayName=_l;var a5=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:o,currentTabStopId:i,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:c,preventScrollOnEntryFocus:h=!1,...d}=e,f=m.useRef(null),x=Zt(t,f),y=U0(o),[w=null,N]=vf({prop:i,defaultProp:l,onChange:u}),[p,v]=m.useState(!1),g=Yn(c),S=W0(n),b=m.useRef(!1),[k,j]=m.useState(0);return m.useEffect(()=>{const _=f.current;if(_)return _.addEventListener(vu,g),()=>_.removeEventListener(vu,g)},[g]),a.jsx(o5,{scope:n,orientation:r,dir:y,loop:s,currentTabStopId:w,onItemFocus:m.useCallback(_=>N(_),[N]),onItemShiftTab:m.useCallback(()=>v(!0),[]),onFocusableItemAdd:m.useCallback(()=>j(_=>_+1),[]),onFocusableItemRemove:m.useCallback(()=>j(_=>_-1),[]),children:a.jsx(tt.div,{tabIndex:p||k===0?-1:0,"data-orientation":r,...d,ref:x,style:{outline:"none",...e.style},onMouseDown:He(e.onMouseDown,()=>{b.current=!0}),onFocus:He(e.onFocus,_=>{const I=!b.current;if(_.target===_.currentTarget&&I&&!p){const $=new CustomEvent(vu,n5);if(_.currentTarget.dispatchEvent($),!$.defaultPrevented){const R=S().filter(M=>M.focusable),T=R.find(M=>M.active),A=R.find(M=>M.id===w),L=[T,A,...R].filter(Boolean).map(M=>M.ref.current);Q0(L,h)}}b.current=!1}),onBlur:He(e.onBlur,()=>v(!1))})})}),Y0="RovingFocusGroupItem",X0=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:o,...i}=e,l=mo(),u=o||l,c=i5(Y0,n),h=c.currentTabStopId===u,d=W0(n),{onFocusableItemAdd:f,onFocusableItemRemove:x}=c;return m.useEffect(()=>{if(r)return f(),()=>x()},[r,f,x]),a.jsx(Fc.ItemSlot,{scope:n,id:u,focusable:r,active:s,children:a.jsx(tt.span,{tabIndex:h?0:-1,"data-orientation":c.orientation,...i,ref:t,onMouseDown:He(e.onMouseDown,y=>{r?c.onItemFocus(u):y.preventDefault()}),onFocus:He(e.onFocus,()=>c.onItemFocus(u)),onKeyDown:He(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){c.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const w=c5(y,c.orientation,c.dir);if(w!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.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(y.currentTarget);p=c.loop?d5(p,v+1):p.slice(v+1)}setTimeout(()=>Q0(p))}})})})});X0.displayName=Y0;var l5={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function u5(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function c5(e,t,n){const r=u5(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return l5[r]}function Q0(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function d5(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var f5=G0,h5=X0;function m5(e,t){return m.useReducer((n,r)=>t[n][r]??n,e)}var ni=e=>{const{present:t,children:n}=e,r=p5(t),s=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),o=Zt(r.ref,g5(s));return typeof n=="function"||r.isPresent?m.cloneElement(s,{ref:o}):null};ni.displayName="Presence";function p5(e){const[t,n]=m.useState(),r=m.useRef({}),s=m.useRef(e),o=m.useRef("none"),i=e?"mounted":"unmounted",[l,u]=m5(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const c=Ti(r.current);o.current=l==="mounted"?c:"none"},[l]),Wa(()=>{const c=r.current,h=s.current;if(h!==e){const f=o.current,x=Ti(c);e?u("MOUNT"):x==="none"||(c==null?void 0:c.display)==="none"?u("UNMOUNT"):u(h&&f!==x?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,u]),Wa(()=>{if(t){const c=d=>{const x=Ti(r.current).includes(d.animationName);d.target===t&&x&&ul.flushSync(()=>u("ANIMATION_END"))},h=d=>{d.target===t&&(o.current=Ti(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:m.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Ti(e){return(e==null?void 0:e.animationName)||"none"}function g5(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 wf="Tabs",[x5]=El(wf,[K0]),q0=K0(),[y5,Nf]=x5(wf),Z0=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:o,orientation:i="horizontal",dir:l,activationMode:u="automatic",...c}=e,h=U0(l),[d,f]=vf({prop:r,onChange:s,defaultProp:o});return a.jsx(y5,{scope:n,baseId:mo(),value:d,onValueChange:f,orientation:i,dir:h,activationMode:u,children:a.jsx(tt.div,{dir:h,"data-orientation":i,...c,ref:t})})});Z0.displayName=wf;var J0="TabsList",ev=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,o=Nf(J0,n),i=q0(n);return a.jsx(f5,{asChild:!0,...i,orientation:o.orientation,dir:o.dir,loop:r,children:a.jsx(tt.div,{role:"tablist","aria-orientation":o.orientation,...s,ref:t})})});ev.displayName=J0;var tv="TabsTrigger",nv=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...o}=e,i=Nf(tv,n),l=q0(n),u=ov(i.baseId,r),c=iv(i.baseId,r),h=r===i.value;return a.jsx(h5,{asChild:!0,...l,focusable:!s,active:h,children:a.jsx(tt.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":c,"data-state":h?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:u,...o,ref:t,onMouseDown:He(e.onMouseDown,d=>{!s&&d.button===0&&d.ctrlKey===!1?i.onValueChange(r):d.preventDefault()}),onKeyDown:He(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&i.onValueChange(r)}),onFocus:He(e.onFocus,()=>{const d=i.activationMode!=="manual";!h&&!s&&d&&i.onValueChange(r)})})})});nv.displayName=tv;var rv="TabsContent",sv=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:o,...i}=e,l=Nf(rv,n),u=ov(l.baseId,r),c=iv(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(ni,{present:s||h,children:({present:f})=>a.jsx(tt.div,{"data-state":h?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":u,hidden:!f,id:c,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:f&&o})})});sv.displayName=rv;function ov(e,t){return`${e}-trigger-${t}`}function iv(e,t){return`${e}-content-${t}`}var v5=Z0,av=ev,lv=nv,uv=sv;const Sf=v5,Pl=m.forwardRef(({className:e,...t},n)=>a.jsx(av,{ref:n,className:Pe("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));Pl.displayName=av.displayName;const nt=m.forwardRef(({className:e,...t},n)=>a.jsx(lv,{ref:n,className:Pe("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}));nt.displayName=lv.displayName;const rt=m.forwardRef(({className:e,...t},n)=>a.jsx(uv,{ref:n,className:Pe("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));rt.displayName=uv.displayName;function w5(e,t=globalThis==null?void 0:globalThis.document){const n=Yn(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 N5="DismissableLayer",Hc="dismissableLayer.update",S5="dismissableLayer.pointerDownOutside",b5="dismissableLayer.focusOutside",tp,cv=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),dv=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:i,onDismiss:l,...u}=e,c=m.useContext(cv),[h,d]=m.useState(null),f=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,x]=m.useState({}),y=Zt(t,j=>d(j)),w=Array.from(c.layers),[N]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),p=w.indexOf(N),v=h?w.indexOf(h):-1,g=c.layersWithOutsidePointerEventsDisabled.size>0,S=v>=p,b=C5(j=>{const _=j.target,I=[...c.branches].some($=>$.contains(_));!S||I||(s==null||s(j),i==null||i(j),j.defaultPrevented||l==null||l())},f),k=E5(j=>{const _=j.target;[...c.branches].some($=>$.contains(_))||(o==null||o(j),i==null||i(j),j.defaultPrevented||l==null||l())},f);return w5(j=>{v===c.layers.size-1&&(r==null||r(j),!j.defaultPrevented&&l&&(j.preventDefault(),l()))},f),m.useEffect(()=>{if(h)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(tp=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(h)),c.layers.add(h),np(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=tp)}},[h,f,n,c]),m.useEffect(()=>()=>{h&&(c.layers.delete(h),c.layersWithOutsidePointerEventsDisabled.delete(h),np())},[h,c]),m.useEffect(()=>{const j=()=>x({});return document.addEventListener(Hc,j),()=>document.removeEventListener(Hc,j)},[]),a.jsx(tt.div,{...u,ref:y,style:{pointerEvents:g?S?"auto":"none":void 0,...e.style},onFocusCapture:He(e.onFocusCapture,k.onFocusCapture),onBlurCapture:He(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:He(e.onPointerDownCapture,b.onPointerDownCapture)})});dv.displayName=N5;var j5="DismissableLayerBranch",k5=m.forwardRef((e,t)=>{const n=m.useContext(cv),r=m.useRef(null),s=Zt(t,r);return m.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),a.jsx(tt.div,{...e,ref:s})});k5.displayName=j5;function C5(e,t=globalThis==null?void 0:globalThis.document){const n=Yn(e),r=m.useRef(!1),s=m.useRef(()=>{});return m.useEffect(()=>{const o=l=>{if(l.target&&!r.current){let u=function(){fv(S5,n,c,{discrete:!0})};const c={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=u,t.addEventListener("click",s.current,{once:!0})):u()}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 E5(e,t=globalThis==null?void 0:globalThis.document){const n=Yn(e),r=m.useRef(!1);return m.useEffect(()=>{const s=o=>{o.target&&!r.current&&fv(b5,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 np(){const e=new CustomEvent(Hc);document.dispatchEvent(e)}function fv(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?JP(s,o):s.dispatchEvent(o)}var wu="focusScope.autoFocusOnMount",Nu="focusScope.autoFocusOnUnmount",rp={bubbles:!1,cancelable:!0},_5="FocusScope",hv=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...i}=e,[l,u]=m.useState(null),c=Yn(s),h=Yn(o),d=m.useRef(null),f=Zt(t,w=>u(w)),x=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let w=function(g){if(x.paused||!l)return;const S=g.target;l.contains(S)?d.current=S:En(d.current,{select:!0})},N=function(g){if(x.paused||!l)return;const S=g.relatedTarget;S!==null&&(l.contains(S)||En(d.current,{select:!0}))},p=function(g){if(document.activeElement===document.body)for(const b of g)b.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,x.paused]),m.useEffect(()=>{if(l){op.add(x);const w=document.activeElement;if(!l.contains(w)){const p=new CustomEvent(wu,rp);l.addEventListener(wu,c),l.dispatchEvent(p),p.defaultPrevented||(P5(L5(mv(l)),{select:!0}),document.activeElement===w&&En(l))}return()=>{l.removeEventListener(wu,c),setTimeout(()=>{const p=new CustomEvent(Nu,rp);l.addEventListener(Nu,h),l.dispatchEvent(p),p.defaultPrevented||En(w??document.body,{select:!0}),l.removeEventListener(Nu,h),op.remove(x)},0)}}},[l,c,h,x]);const y=m.useCallback(w=>{if(!n&&!r||x.paused)return;const N=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,p=document.activeElement;if(N&&p){const v=w.currentTarget,[g,S]=M5(v);g&&S?!w.shiftKey&&p===S?(w.preventDefault(),n&&En(g,{select:!0})):w.shiftKey&&p===g&&(w.preventDefault(),n&&En(S,{select:!0})):p===v&&w.preventDefault()}},[n,r,x.paused]);return a.jsx(tt.div,{tabIndex:-1,...i,ref:f,onKeyDown:y})});hv.displayName=_5;function P5(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(En(r,{select:t}),document.activeElement!==n)return}function M5(e){const t=mv(e),n=sp(t,e),r=sp(t.reverse(),e);return[n,r]}function mv(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 sp(e,t){for(const n of e)if(!I5(n,{upTo:t}))return n}function I5(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 R5(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&&R5(e)&&t&&e.select()}}var op=T5();function T5(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=ip(e,t),e.unshift(t)},remove(t){var n;e=ip(e,t),(n=e[0])==null||n.resume()}}}function ip(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function L5(e){return e.filter(t=>t.tagName!=="A")}var A5="Portal",pv=m.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[s,o]=m.useState(!1);Wa(()=>o(!0),[]);const i=n||s&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return i?N2.createPortal(a.jsx(tt.div,{...r,ref:t}),i):null});pv.displayName=A5;var Su=0;function z5(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ap()),document.body.insertAdjacentElement("beforeend",e[1]??ap()),Su++,()=>{Su===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Su--}},[])}function ap(){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 Kt=function(){return Kt=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},Kt.apply(this,arguments)};function gv(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 D5(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 sa="right-scroll-bar-position",oa="width-before-scroll-bar",$5="with-scroll-bars-hidden",O5="--removed-body-scroll-bar-size";function bu(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function F5(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 H5=typeof window<"u"?m.useLayoutEffect:m.useEffect,lp=new WeakMap;function V5(e,t){var n=F5(null,function(r){return e.forEach(function(s){return bu(s,r)})});return H5(function(){var r=lp.get(n);if(r){var s=new Set(r),o=new Set(e),i=n.current;s.forEach(function(l){o.has(l)||bu(l,null)}),o.forEach(function(l){s.has(l)||bu(l,i)})}lp.set(n,e)},[e]),n}function B5(e){return e}function U5(e,t){t===void 0&&(t=B5);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 u=function(){var h=i;i=[],h.forEach(o)},c=function(){return Promise.resolve().then(u)};c(),n={push:function(h){i.push(h),c()},filter:function(h){return i=i.filter(h),n}}}};return s}function W5(e){e===void 0&&(e={});var t=U5(null);return t.options=Kt({async:!0,ssr:!1},e),t}var xv=function(e){var t=e.sideCar,n=gv(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,Kt({},n))};xv.isSideCarExport=!0;function K5(e,t){return e.useMedium(t),xv}var yv=W5(),ju=function(){},Ml=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:ju,onWheelCapture:ju,onTouchMoveCapture:ju}),s=r[0],o=r[1],i=e.forwardProps,l=e.children,u=e.className,c=e.removeScrollBar,h=e.enabled,d=e.shards,f=e.sideCar,x=e.noIsolation,y=e.inert,w=e.allowPinchZoom,N=e.as,p=N===void 0?"div":N,v=e.gapMode,g=gv(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=f,b=V5([n,t]),k=Kt(Kt({},g),s);return m.createElement(m.Fragment,null,h&&m.createElement(S,{sideCar:yv,removeScrollBar:c,shards:d,noIsolation:x,inert:y,setCallbacks:o,allowPinchZoom:!!w,lockRef:n,gapMode:v}),i?m.cloneElement(m.Children.only(l),Kt(Kt({},k),{ref:b})):m.createElement(p,Kt({},k,{className:u,ref:b}),l))});Ml.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ml.classNames={fullWidth:oa,zeroRight:sa};var G5=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Y5(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=G5();return t&&e.setAttribute("nonce",t),e}function X5(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Q5(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var q5=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Y5())&&(X5(t,n),Q5(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Z5=function(){var e=q5();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},vv=function(){var e=Z5(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},J5={left:0,top:0,right:0,gap:0},ku=function(e){return parseInt(e||"",10)||0},eM=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[ku(n),ku(r),ku(s)]},tM=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return J5;var t=eM(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])}},nM=vv(),ns="data-scroll-locked",rM=function(e,t,n,r){var s=e.left,o=e.top,i=e.right,l=e.gap;return n===void 0&&(n="margin"),`
|
|
344
|
+
.`.concat($5,` {
|
|
345
|
+
overflow: hidden `).concat(r,`;
|
|
346
|
+
padding-right: `).concat(l,"px ").concat(r,`;
|
|
347
|
+
}
|
|
348
|
+
body[`).concat(ns,`] {
|
|
349
|
+
overflow: hidden `).concat(r,`;
|
|
350
|
+
overscroll-behavior: contain;
|
|
351
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
352
|
+
padding-left: `.concat(s,`px;
|
|
353
|
+
padding-top: `).concat(o,`px;
|
|
354
|
+
padding-right: `).concat(i,`px;
|
|
355
|
+
margin-left:0;
|
|
356
|
+
margin-top:0;
|
|
357
|
+
margin-right: `).concat(l,"px ").concat(r,`;
|
|
358
|
+
`),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
.`).concat(sa,` {
|
|
362
|
+
right: `).concat(l,"px ").concat(r,`;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
.`).concat(oa,` {
|
|
366
|
+
margin-right: `).concat(l,"px ").concat(r,`;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
.`).concat(sa," .").concat(sa,` {
|
|
370
|
+
right: 0 `).concat(r,`;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
.`).concat(oa," .").concat(oa,` {
|
|
374
|
+
margin-right: 0 `).concat(r,`;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
body[`).concat(ns,`] {
|
|
378
|
+
`).concat(O5,": ").concat(l,`px;
|
|
379
|
+
}
|
|
380
|
+
`)},up=function(){var e=parseInt(document.body.getAttribute(ns)||"0",10);return isFinite(e)?e:0},sM=function(){m.useEffect(function(){return document.body.setAttribute(ns,(up()+1).toString()),function(){var e=up()-1;e<=0?document.body.removeAttribute(ns):document.body.setAttribute(ns,e.toString())}},[])},oM=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;sM();var o=m.useMemo(function(){return tM(s)},[s]);return m.createElement(nM,{styles:rM(o,!t,s,n?"":"!important")})},Vc=!1;if(typeof window<"u")try{var Li=Object.defineProperty({},"passive",{get:function(){return Vc=!0,!0}});window.addEventListener("test",Li,Li),window.removeEventListener("test",Li,Li)}catch{Vc=!1}var Ir=Vc?{passive:!1}:!1,iM=function(e){return e.tagName==="TEXTAREA"},wv=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!iM(e)&&n[t]==="visible")},aM=function(e){return wv(e,"overflowY")},lM=function(e){return wv(e,"overflowX")},cp=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=Nv(e,r);if(s){var o=Sv(e,r),i=o[1],l=o[2];if(i>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},uM=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},cM=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Nv=function(e,t){return e==="v"?aM(t):lM(t)},Sv=function(e,t){return e==="v"?uM(t):cM(t)},dM=function(e,t){return e==="h"&&t==="rtl"?-1:1},fM=function(e,t,n,r,s){var o=dM(e,window.getComputedStyle(t).direction),i=o*r,l=n.target,u=t.contains(l),c=!1,h=i>0,d=0,f=0;do{var x=Sv(e,l),y=x[0],w=x[1],N=x[2],p=w-N-o*y;(y||p)&&Nv(e,l)&&(d+=p,f+=y),l instanceof ShadowRoot?l=l.host:l=l.parentNode}while(!u&&l!==document.body||u&&(t.contains(l)||t===l));return(h&&Math.abs(d)<1||!h&&Math.abs(f)<1)&&(c=!0),c},Ai=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},dp=function(e){return[e.deltaX,e.deltaY]},fp=function(e){return e&&"current"in e?e.current:e},hM=function(e,t){return e[0]===t[0]&&e[1]===t[1]},mM=function(e){return`
|
|
381
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
382
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
383
|
+
`)},pM=0,Rr=[];function gM(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),s=m.useState(pM++)[0],o=m.useState(vv)[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=D5([e.lockRef.current],(e.shards||[]).map(fp),!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=Ai(w),v=n.current,g="deltaX"in w?w.deltaX:v[0]-p[0],S="deltaY"in w?w.deltaY:v[1]-p[1],b,k=w.target,j=Math.abs(g)>Math.abs(S)?"h":"v";if("touches"in w&&j==="h"&&k.type==="range")return!1;var _=cp(j,k);if(!_)return!0;if(_?b=j:(b=j==="v"?"h":"v",_=cp(j,k)),!_)return!1;if(!r.current&&"changedTouches"in w&&(g||S)&&(r.current=b),!b)return!0;var I=r.current||b;return fM(I,N,w,I==="h"?g:S)},[]),u=m.useCallback(function(w){var N=w;if(!(!Rr.length||Rr[Rr.length-1]!==o)){var p="deltaY"in N?dp(N):Ai(N),v=t.current.filter(function(b){return b.name===N.type&&(b.target===N.target||N.target===b.shadowParent)&&hM(b.delta,p)})[0];if(v&&v.should){N.cancelable&&N.preventDefault();return}if(!v){var g=(i.current.shards||[]).map(fp).filter(Boolean).filter(function(b){return b.contains(N.target)}),S=g.length>0?l(N,g[0]):!i.current.noIsolation;S&&N.cancelable&&N.preventDefault()}}},[]),c=m.useCallback(function(w,N,p,v){var g={name:w,delta:N,target:p,should:v,shadowParent:xM(p)};t.current.push(g),setTimeout(function(){t.current=t.current.filter(function(S){return S!==g})},1)},[]),h=m.useCallback(function(w){n.current=Ai(w),r.current=void 0},[]),d=m.useCallback(function(w){c(w.type,dp(w),w.target,l(w,e.lockRef.current))},[]),f=m.useCallback(function(w){c(w.type,Ai(w),w.target,l(w,e.lockRef.current))},[]);m.useEffect(function(){return Rr.push(o),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",u,Ir),document.addEventListener("touchmove",u,Ir),document.addEventListener("touchstart",h,Ir),function(){Rr=Rr.filter(function(w){return w!==o}),document.removeEventListener("wheel",u,Ir),document.removeEventListener("touchmove",u,Ir),document.removeEventListener("touchstart",h,Ir)}},[]);var x=e.removeScrollBar,y=e.inert;return m.createElement(m.Fragment,null,y?m.createElement(o,{styles:mM(s)}):null,x?m.createElement(oM,{gapMode:e.gapMode}):null)}function xM(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const yM=K5(yv,gM);var bv=m.forwardRef(function(e,t){return m.createElement(Ml,Kt({},e,{ref:t,sideCar:yM}))});bv.classNames=Ml.classNames;var vM=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Tr=new WeakMap,zi=new WeakMap,Di={},Cu=0,jv=function(e){return e&&(e.host||jv(e.parentNode))},wM=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=jv(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})},NM=function(e,t,n,r){var s=wM(t,Array.isArray(e)?e:[e]);Di[n]||(Di[n]=new WeakMap);var o=Di[n],i=[],l=new Set,u=new Set(s),c=function(d){!d||l.has(d)||(l.add(d),c(d.parentNode))};s.forEach(c);var h=function(d){!d||u.has(d)||Array.prototype.forEach.call(d.children,function(f){if(l.has(f))h(f);else try{var x=f.getAttribute(r),y=x!==null&&x!=="false",w=(Tr.get(f)||0)+1,N=(o.get(f)||0)+1;Tr.set(f,w),o.set(f,N),i.push(f),w===1&&y&&zi.set(f,!0),N===1&&f.setAttribute(n,"true"),y||f.setAttribute(r,"true")}catch(p){console.error("aria-hidden: cannot operate on ",f,p)}})};return h(t),l.clear(),Cu++,function(){i.forEach(function(d){var f=Tr.get(d)-1,x=o.get(d)-1;Tr.set(d,f),o.set(d,x),f||(zi.has(d)||d.removeAttribute(r),zi.delete(d)),x||d.removeAttribute(n)}),Cu--,Cu||(Tr=new WeakMap,Tr=new WeakMap,zi=new WeakMap,Di={})}},SM=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=vM(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),NM(r,s,n,"aria-hidden")):function(){return null}},bf="Dialog",[kv]=El(bf),[bM,Ft]=kv(bf),Cv=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:o,modal:i=!0}=e,l=m.useRef(null),u=m.useRef(null),[c=!1,h]=vf({prop:r,defaultProp:s,onChange:o});return a.jsx(bM,{scope:t,triggerRef:l,contentRef:u,contentId:mo(),titleId:mo(),descriptionId:mo(),open:c,onOpenChange:h,onOpenToggle:m.useCallback(()=>h(d=>!d),[h]),modal:i,children:n})};Cv.displayName=bf;var Ev="DialogTrigger",jM=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ft(Ev,n),o=Zt(t,s.triggerRef);return a.jsx(tt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Cf(s.open),...r,ref:o,onClick:He(e.onClick,s.onOpenToggle)})});jM.displayName=Ev;var jf="DialogPortal",[kM,_v]=kv(jf,{forceMount:void 0}),Pv=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,o=Ft(jf,t);return a.jsx(kM,{scope:t,forceMount:n,children:m.Children.map(r,i=>a.jsx(ni,{present:n||o.open,children:a.jsx(pv,{asChild:!0,container:s,children:i})}))})};Pv.displayName=jf;var Ka="DialogOverlay",Mv=m.forwardRef((e,t)=>{const n=_v(Ka,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=Ft(Ka,e.__scopeDialog);return o.modal?a.jsx(ni,{present:r||o.open,children:a.jsx(CM,{...s,ref:t})}):null});Mv.displayName=Ka;var CM=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ft(Ka,n);return a.jsx(bv,{as:fs,allowPinchZoom:!0,shards:[s.contentRef],children:a.jsx(tt.div,{"data-state":Cf(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Sr="DialogContent",Iv=m.forwardRef((e,t)=>{const n=_v(Sr,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=Ft(Sr,e.__scopeDialog);return a.jsx(ni,{present:r||o.open,children:o.modal?a.jsx(EM,{...s,ref:t}):a.jsx(_M,{...s,ref:t})})});Iv.displayName=Sr;var EM=m.forwardRef((e,t)=>{const n=Ft(Sr,e.__scopeDialog),r=m.useRef(null),s=Zt(t,n.contentRef,r);return m.useEffect(()=>{const o=r.current;if(o)return SM(o)},[]),a.jsx(Rv,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:He(e.onCloseAutoFocus,o=>{var i;o.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:He(e.onPointerDownOutside,o=>{const i=o.detail.originalEvent,l=i.button===0&&i.ctrlKey===!0;(i.button===2||l)&&o.preventDefault()}),onFocusOutside:He(e.onFocusOutside,o=>o.preventDefault())})}),_M=m.forwardRef((e,t)=>{const n=Ft(Sr,e.__scopeDialog),r=m.useRef(!1),s=m.useRef(!1);return a.jsx(Rv,{...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 u,c;(u=e.onInteractOutside)==null||u.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const i=o.target;((c=n.triggerRef.current)==null?void 0:c.contains(i))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),Rv=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,...i}=e,l=Ft(Sr,n),u=m.useRef(null),c=Zt(t,u);return z5(),a.jsxs(a.Fragment,{children:[a.jsx(hv,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:a.jsx(dv,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Cf(l.open),...i,ref:c,onDismiss:()=>l.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(PM,{titleId:l.titleId}),a.jsx(IM,{contentRef:u,descriptionId:l.descriptionId})]})]})}),kf="DialogTitle",Tv=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ft(kf,n);return a.jsx(tt.h2,{id:s.titleId,...r,ref:t})});Tv.displayName=kf;var Lv="DialogDescription",Av=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ft(Lv,n);return a.jsx(tt.p,{id:s.descriptionId,...r,ref:t})});Av.displayName=Lv;var zv="DialogClose",Dv=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ft(zv,n);return a.jsx(tt.button,{type:"button",...r,ref:t,onClick:He(e.onClick,()=>s.onOpenChange(!1))})});Dv.displayName=zv;function Cf(e){return e?"open":"closed"}var $v="DialogTitleWarning",[vI,Ov]=GP($v,{contentName:Sr,titleName:kf,docsSlug:"dialog"}),PM=({titleId:e})=>{const t=Ov($v),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
384
|
+
|
|
385
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
386
|
+
|
|
387
|
+
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},MM="DialogDescriptionWarning",IM=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Ov(MM).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},RM=Cv,TM=Pv,Fv=Mv,Hv=Iv,Vv=Tv,Bv=Av,LM=Dv;const Ps=RM,AM=TM,Uv=m.forwardRef(({className:e,...t},n)=>a.jsx(Fv,{ref:n,className:Pe("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}));Uv.displayName=Fv.displayName;const kr=m.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(AM,{children:[a.jsx(Uv,{}),a.jsxs(Hv,{ref:r,className:Pe("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(LM,{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(ej,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));kr.displayName=Hv.displayName;const Ms=({className:e,...t})=>a.jsx("div",{className:Pe("flex flex-col space-y-1.5 text-center sm:text-left",e),...t}),Is=({className:e,...t})=>a.jsx("div",{className:Pe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t}),Cr=m.forwardRef(({className:e,...t},n)=>a.jsx(Vv,{ref:n,className:Pe("text-lg font-semibold leading-none tracking-tight",e),...t}));Cr.displayName=Vv.displayName;const Er=m.forwardRef(({className:e,...t},n)=>a.jsx(Bv,{ref:n,className:Pe("text-sm text-muted-foreground",e),...t}));Er.displayName=Bv.displayName;function zM({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(xr,{className:"h-4 w-4"}):a.jsx(Dt,{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 DM(){const[e,t]=m.useState([]),[n,r]=m.useState(""),[s,o]=m.useState(!0),[i,l]=m.useState("skills"),[u,c]=m.useState(null),h=m.useRef(null),d=m.useCallback((y,w="success")=>{c({message:y,type:w})},[]),f=m.useCallback(()=>{d("Command sent to host"),l("commands"),setTimeout(()=>{var y;return(y=h.current)==null?void 0:y.call(h)},300)},[d]),x=m.useCallback(y=>{const w=y instanceof Error?y.message:"Failed to send command";d(w,"error")},[d]);return m.useEffect(()=>{re.hosts.list().then(y=>{const w=(y.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(fl,{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:y=>r(y.target.value),children:e.map(y=>a.jsxs("option",{value:y.id,children:[y.hostname," (",y.ip||"local",")"]},y.id))})]})]}),n&&a.jsxs(Sf,{value:i,onValueChange:l,className:"w-full",children:[a.jsxs(Pl,{children:[a.jsxs(nt,{value:"skills",children:[a.jsx(cs,{className:"mr-1.5 h-3.5 w-3.5"})," Skills"]}),a.jsxs(nt,{value:"commands",children:[a.jsx(ds,{className:"mr-1.5 h-3.5 w-3.5"})," Commands"]}),a.jsxs(nt,{value:"config",children:[a.jsx(Qt,{className:"mr-1.5 h-3.5 w-3.5"})," Config"]})]}),a.jsx(rt,{value:"skills",children:a.jsx($M,{hostId:n,onCommandSent:f,onCommandError:x})}),a.jsx(rt,{value:"commands",children:a.jsx(OM,{hostId:n,refreshRef:h})}),a.jsx(rt,{value:"config",children:a.jsx(FM,{hostId:n,onCommandSent:f,onCommandError:x})})]}),u&&a.jsx(zM,{message:u.message,type:u.type,onClose:()=>c(null)})]})}function $M({hostId:e,onCommandSent:t,onCommandError:n}){const[r,s]=m.useState(!1),[o,i]=m.useState(null),[l,u]=m.useState([]);m.useEffect(()=>{re.hosts.agents(e).then(h=>u(h.data??[])).catch(()=>u([]))},[e]);const c=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(Q,{size:"sm",onClick:()=>s(!0),children:[a.jsx(gn,{className:"mr-1.5 h-3.5 w-3.5"})," Install Skill"]})}),c.length>0&&a.jsxs(be,{children:[a.jsx(Le,{children:a.jsxs(Ae,{className:"flex items-center gap-2 text-sm",children:[a.jsx(cs,{className:"h-4 w-4"})," Installed Skills (",c.length,")"]})}),a.jsx(_e,{children:a.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:c.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(cs,{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(Q,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive",onClick:()=>i(h.name),children:a.jsx(qt,{className:"h-3.5 w-3.5"})})]},`${h.name}-${d}`))})})]}),l.length>0&&a.jsxs(be,{children:[a.jsx(Le,{children:a.jsxs(Ae,{className:"flex items-center gap-2 text-sm",children:[a.jsx(fl,{className:"h-4 w-4"})," Agents on this Host (",l.length,")"]})}),a.jsx(_e,{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(be,{children:[a.jsx(Le,{children:a.jsx(Ae,{className:"text-sm",children:"How Skills Work"})}),a.jsxs(_e,{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(HM,{open:r,onOpenChange:s,hostId:e,onSuccess:t,onError:n}),a.jsx(VM,{open:o!==null,onOpenChange:h=>{h||i(null)},hostId:e,initialName:o??"",onSuccess:t,onError:n})]})}function OM({hostId:e,refreshRef:t}){const[n,r]=m.useState([]),[s,o]=m.useState(!0),[i,l]=m.useState(null),u=m.useCallback(()=>{re.hosts.commands(e).then(f=>r(f.data??[])).catch(()=>{}).finally(()=>o(!1))},[e]);m.useEffect(()=>(t&&(t.current=u),()=>{t&&(t.current=null)}),[u,t]),m.useEffect(()=>{u()},[u]),m.useEffect(()=>{if(!n.some(y=>y.status==="pending"||y.status==="running"))return;const x=setInterval(u,5e3);return()=>clearInterval(x)},[n,u]);const c=f=>f==="completed"?a.jsx(xr,{className:"h-3.5 w-3.5 text-emerald-500"}):f==="failed"?a.jsx(Dt,{className:"h-3.5 w-3.5 text-destructive"}):f==="running"?a.jsx(Ye,{className:"h-3.5 w-3.5 animate-spin text-amber-500"}):a.jsx(Gx,{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(gn,{className:"h-3 w-3"}),label:"Install Skill"},install_custom_skill:{icon:a.jsx(_s,{className:"h-3 w-3"}),label:"Custom Skill"},uninstall_skill:{icon:a.jsx(qt,{className:"h-3 w-3"}),label:"Uninstall Skill"},install_plugin:{icon:a.jsx(gn,{className:"h-3 w-3"}),label:"Install Plugin"},uninstall_plugin:{icon:a.jsx(qt,{className:"h-3 w-3"}),label:"Uninstall Plugin"},update_config:{icon:a.jsx(Qt,{className:"h-3 w-3"}),label:"Update Config"}})[f]??{icon:a.jsx(ds,{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(Q,{size:"sm",variant:"ghost",onClick:u,children:[a.jsx(Gn,{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(ds,{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 x=d(f.type),y=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(y?null:f.id),children:[c(f.status),a.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium",children:[x.icon," ",a.jsx("span",{children:x.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(ve,{variant:h(f.status),className:"text-[10px]",children:f.status}),a.jsx("span",{className:"text-[11px] text-muted-foreground",children:UM(f.createdAt)}),w&&(y?a.jsx(hl,{className:"h-3.5 w-3.5 text-muted-foreground"}):a.jsx(Yd,{className:"h-3.5 w-3.5 text-muted-foreground"}))]}),y&&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 FM({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(be,{children:[a.jsx(Le,{children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs(Ae,{className:"flex items-center gap-2 text-sm",children:[a.jsx(Qt,{className:"h-4 w-4"})," Guards Configuration"]}),a.jsxs(Q,{size:"sm",variant:"outline",onClick:()=>s(!0),children:[a.jsx(Qt,{className:"mr-1.5 h-3.5 w-3.5"})," Update Config"]})]})}),a.jsxs(_e,{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(BM,{open:r,onOpenChange:s,hostId:e,onSuccess:t,onError:n})]})}function HM({open:e,onOpenChange:t,hostId:n,onSuccess:r,onError:s}){const[o,i]=m.useState("registry"),[l,u]=m.useState(""),[c,h]=m.useState(""),[d,f]=m.useState(!1),[x,y]=m.useState(""),w=()=>{u(""),h(""),i("registry"),y("")},N=async()=>{if(!(o==="registry"&&!l.trim())&&!(o==="custom"&&(!l.trim()||!c.trim()))){f(!0),y("");try{o==="registry"?await re.hosts.sendCommand(n,"install_skill",{skillName:l.trim()}):await re.hosts.sendCommand(n,"install_custom_skill",{skillName:l.trim(),content:c}),w(),t(!1),r==null||r()}catch(p){const v=p instanceof Error?p.message:"Failed to send command";y(v),s==null||s(p)}finally{f(!1)}}};return a.jsx(Ps,{open:e,onOpenChange:p=>{p||w(),t(p)},children:a.jsxs(kr,{className:"sm:max-w-[560px]",children:[a.jsxs(Ms,{children:[a.jsxs(Cr,{className:"flex items-center gap-2",children:[a.jsx(gn,{className:"h-4 w-4"})," Install Skill"]}),a.jsxs(Er,{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(Sf,{value:o,onValueChange:p=>{i(p),y("")},children:[a.jsxs(Pl,{className:"w-full",children:[a.jsxs(nt,{value:"registry",className:"flex-1",children:[a.jsx(cs,{className:"mr-1.5 h-3.5 w-3.5"})," ClawHub Registry"]}),a.jsxs(nt,{value:"custom",className:"flex-1",children:[a.jsx(_s,{className:"mr-1.5 h-3.5 w-3.5"})," Custom SKILL.md"]})]}),a.jsx(rt,{value:"registry",className:"space-y-4 pt-2",children:a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ze,{htmlFor:"reg-skill-name",children:"Skill Slug"}),a.jsx(ze,{id:"reg-skill-name",placeholder:"e.g. web-search, code-review, self-improving-agent...",value:l,onChange:p=>{u(p.target.value),y("")},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(rt,{value:"custom",className:"space-y-4 pt-2",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ze,{htmlFor:"custom-skill-name",children:"Skill Name"}),a.jsx(ze,{id:"custom-skill-name",placeholder:"my-custom-skill",value:l,onChange:p=>{u(p.target.value),y("")}})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ze,{htmlFor:"custom-skill-content",children:"SKILL.md Content"}),a.jsx(yf,{id:"custom-skill-content",placeholder:`---
|
|
388
|
+
name: my-custom-skill
|
|
389
|
+
description: My custom skill
|
|
390
|
+
---
|
|
391
|
+
|
|
392
|
+
Instructions for the agent...
|
|
393
|
+
|
|
394
|
+
Use {baseDir} to reference the skill folder path.`,value:c,onChange:p=>{h(p.target.value),y("")},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."]})]})]})]}),x&&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(Dt,{className:"h-3.5 w-3.5 shrink-0"}),a.jsx("span",{children:x})]}),a.jsxs(Is,{children:[a.jsx(Q,{variant:"outline",onClick:()=>{w(),t(!1)},children:"Cancel"}),a.jsxs(Q,{onClick:N,disabled:d||!l.trim()||o==="custom"&&!c.trim(),children:[d?a.jsx(Ye,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):a.jsx(gn,{className:"mr-1.5 h-3.5 w-3.5"}),"Install"]})]})]})})}function VM({open:e,onOpenChange:t,hostId:n,initialName:r,onSuccess:s,onError:o}){const[i,l]=m.useState(r??""),[u,c]=m.useState(!1),[h,d]=m.useState("");m.useEffect(()=>{r&&l(r)},[r]);const f=async()=>{if(i.trim()){c(!0),d("");try{await re.hosts.sendCommand(n,"uninstall_skill",{skillName:i.trim()}),l(""),t(!1),s==null||s()}catch(x){const y=x instanceof Error?x.message:"Failed to send command";d(y),o==null||o(x)}finally{c(!1)}}};return a.jsx(Ps,{open:e,onOpenChange:t,children:a.jsxs(kr,{className:"sm:max-w-[400px]",children:[a.jsxs(Ms,{children:[a.jsxs(Cr,{className:"flex items-center gap-2",children:[a.jsx(qt,{className:"h-4 w-4"})," Uninstall Skill"]}),a.jsx(Er,{children:"This will send a command to the host CLI to remove the skill."})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ze,{htmlFor:"uninstall-name",children:"Skill Name"}),a.jsx(ze,{id:"uninstall-name",placeholder:"Skill name to uninstall...",value:i,onChange:x=>{l(x.target.value),d("")},onKeyDown:x=>x.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(Dt,{className:"h-3.5 w-3.5 shrink-0"}),a.jsx("span",{children:h})]}),a.jsxs(Is,{children:[a.jsx(Q,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),a.jsxs(Q,{variant:"destructive",onClick:f,disabled:u||!i.trim(),children:[u?a.jsx(Ye,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):a.jsx(qt,{className:"mr-1.5 h-3.5 w-3.5"}),"Uninstall"]})]})]})})}function BM({open:e,onOpenChange:t,hostId:n,onSuccess:r,onError:s}){const[o,i]=m.useState(`{
|
|
395
|
+
"blockOnRisk": false
|
|
396
|
+
}`),[l,u]=m.useState(""),[c,h]=m.useState(!1),d=async()=>{u("");let f;try{f=JSON.parse(o)}catch{u("Invalid JSON");return}if(typeof f!="object"||f===null||Array.isArray(f)){u("Must be a JSON object");return}h(!0);try{await re.hosts.sendCommand(n,"update_config",f),t(!1),r==null||r()}catch(x){const y=x instanceof Error?x.message:"Failed to send command";u(y),s==null||s(x)}finally{h(!1)}};return a.jsx(Ps,{open:e,onOpenChange:t,children:a.jsxs(kr,{className:"sm:max-w-[460px]",children:[a.jsxs(Ms,{children:[a.jsxs(Cr,{className:"flex items-center gap-2",children:[a.jsx(Qt,{className:"h-4 w-4"})," Update Guards Config"]}),a.jsx(Er,{children:"Values will be merged into the existing Guards plugin configuration."})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ze,{htmlFor:"config-json",children:"Config JSON"}),a.jsx(yf,{id:"config-json",value:o,onChange:f=>{i(f.target.value),u("")},className:"min-h-[120px] font-mono text-xs"}),l&&a.jsx("p",{className:"text-xs text-destructive",children:l})]}),a.jsxs(Is,{children:[a.jsx(Q,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),a.jsxs(Q,{onClick:d,disabled:c,children:[c?a.jsx(Ye,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):a.jsx(Qt,{className:"mr-1.5 h-3.5 w-3.5"}),"Update"]})]})]})})}function UM(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 WM(){const[e,t]=m.useState([]),[n,r]=m.useState(""),[s,o]=m.useState(!0),[i,l]=m.useState(null),u=m.useCallback((c,h="success")=>{l({msg:c,type:h}),setTimeout(()=>l(null),4e3)},[]);return m.useEffect(()=>{re.hosts.list().then(c=>{const h=(c.data??[]).filter(d=>d.status==="online");t(h),h.length>0&&!n&&r(h[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:"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(Xo,{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.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 on remote hosts"})]}),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:c=>r(c.target.value),children:e.map(c=>a.jsxs("option",{value:c.id,children:[c.hostname," (",c.ip||"local",")"]},c.id))})]})]}),n&&a.jsxs(a.Fragment,{children:[a.jsx(KM,{hostId:n,showToast:u}),a.jsx(GM,{hostId:n}),a.jsx(YM,{})]}),i&&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 ${i.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:[i.type==="success"?a.jsx(xr,{className:"h-4 w-4"}):a.jsx(Dt,{className:"h-4 w-4"}),a.jsx("span",{className:"text-sm",children:i.msg}),a.jsx("button",{onClick:()=>l(null),className:"ml-2 text-current/50 hover:text-current",children:"×"})]})]})}function KM({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(Q,{size:"sm",onClick:()=>r(!0),children:[a.jsx(gn,{className:"mr-1.5 h-3.5 w-3.5"})," Install Plugin"]}),a.jsxs(Q,{size:"sm",variant:"outline",onClick:()=>o(!0),children:[a.jsx(qt,{className:"mr-1.5 h-3.5 w-3.5"})," Uninstall Plugin"]}),a.jsx(XM,{open:n,onOpenChange:r,hostId:e,showToast:t}),a.jsx(QM,{open:s,onOpenChange:o,hostId:e,showToast:t})]})}function GM({hostId:e}){const[t,n]=m.useState([]),[r,s]=m.useState(!0),[o,i]=m.useState(null),l=m.useCallback(()=>{re.hosts.commands(e).then(c=>{const h=(c.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 u=c=>c==="completed"?a.jsx(xr,{className:"h-3.5 w-3.5 text-emerald-500"}):c==="failed"?a.jsx(Dt,{className:"h-3.5 w-3.5 text-destructive"}):c==="running"?a.jsx(Ye,{className:"h-3.5 w-3.5 animate-spin text-amber-500"}):a.jsx(Gx,{className:"h-3.5 w-3.5 text-muted-foreground"});return r||t.length===0?null:a.jsxs(be,{children:[a.jsx(Le,{children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs(Ae,{className:"flex items-center gap-2 text-sm",children:[a.jsx(ds,{className:"h-4 w-4"})," Plugin Command History"]}),a.jsxs(Q,{size:"sm",variant:"ghost",onClick:l,children:[a.jsx(Gn,{className:"mr-1.5 h-3.5 w-3.5"})," Refresh"]})]})}),a.jsx(_e,{className:"space-y-2",children:t.map(c=>{var x,y;const h=o===c.id,d=c.type==="install_plugin"?"Install Plugin":"Uninstall Plugin",f=((x=c.payload)==null?void 0:x.spec)||((y=c.payload)==null?void 0:y.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:()=>c.result&&i(h?null:c.id),children:[u(c.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(ve,{variant:c.status==="completed"?"default":c.status==="failed"?"destructive":"secondary",className:"text-[10px]",children:c.status}),a.jsx("span",{className:"text-[11px] text-muted-foreground",children:qM(c.createdAt)}),c.result&&(h?a.jsx(hl,{className:"h-3.5 w-3.5 text-muted-foreground"}):a.jsx(Yd,{className:"h-3.5 w-3.5 text-muted-foreground"}))]}),h&&c.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 c.result=="string"?c.result:JSON.stringify(c.result,null,2)})})]},c.id)})})]})}function YM(){return a.jsxs(be,{children:[a.jsx(Le,{children:a.jsx(Ae,{className:"text-sm",children:"How Plugins Work"})}),a.jsxs(_e,{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 host CLI which executes ",a.jsx("code",{className:"rounded bg-muted px-1",children:"openclaw plugins install/uninstall"}),". See ",a.jsx("a",{href:"https://docs.openclaw.ai/cli/plugins",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"OpenClaw Plugins docs"}),"."]})]})]})}function XM({open:e,onOpenChange:t,hostId:n,showToast:r}){const[s,o]=m.useState(""),[i,l]=m.useState(!1),[u,c]=m.useState(""),h=()=>{o(""),c("")},d=async()=>{if(s.trim()){l(!0),c("");try{await re.hosts.sendCommand(n,"install_plugin",{spec:s.trim()}),h(),t(!1),r("Plugin install command sent","success")}catch(f){const x=f instanceof Error?f.message:"Failed to send command";c(x)}finally{l(!1)}}};return a.jsx(Ps,{open:e,onOpenChange:f=>{f||h(),t(f)},children:a.jsxs(kr,{className:"sm:max-w-[480px]",children:[a.jsxs(Ms,{children:[a.jsxs(Cr,{className:"flex items-center gap-2",children:[a.jsx(gn,{className:"h-4 w-4"})," Install Plugin"]}),a.jsx(Er,{children:"Install an OpenClaw plugin via npm package name or local path."})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ze,{htmlFor:"plugin-spec",children:"Plugin Spec"}),a.jsx(ze,{id:"plugin-spec",placeholder:"e.g. @openclaw/voice-call, @opentrust/guards, /path/to/plugin",value:s,onChange:f=>{o(f.target.value),c("")},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 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(Dt,{className:"h-3.5 w-3.5 shrink-0"}),a.jsx("span",{children:u})]}),a.jsxs(Is,{children:[a.jsx(Q,{variant:"outline",onClick:()=>{h(),t(!1)},children:"Cancel"}),a.jsxs(Q,{onClick:d,disabled:i||!s.trim(),children:[i?a.jsx(Ye,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):a.jsx(gn,{className:"mr-1.5 h-3.5 w-3.5"}),"Install"]})]})]})})}function QM({open:e,onOpenChange:t,hostId:n,showToast:r,initialId:s}){const[o,i]=m.useState(s??""),[l,u]=m.useState(!1),[c,h]=m.useState("");m.useEffect(()=>{s&&i(s)},[s]);const d=async()=>{if(o.trim()){u(!0),h("");try{await re.hosts.sendCommand(n,"uninstall_plugin",{pluginId:o.trim()}),i(""),t(!1),r("Plugin uninstall command sent","success")}catch(f){const x=f instanceof Error?f.message:"Failed to send command";h(x)}finally{u(!1)}}};return a.jsx(Ps,{open:e,onOpenChange:t,children:a.jsxs(kr,{className:"sm:max-w-[400px]",children:[a.jsxs(Ms,{children:[a.jsxs(Cr,{className:"flex items-center gap-2",children:[a.jsx(qt,{className:"h-4 w-4"})," Uninstall Plugin"]}),a.jsx(Er,{children:"Remove an OpenClaw plugin from the host."})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ze,{htmlFor:"plugin-id",children:"Plugin ID"}),a.jsx(ze,{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."]})]}),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(Dt,{className:"h-3.5 w-3.5 shrink-0"}),a.jsx("span",{children:c})]}),a.jsxs(Is,{children:[a.jsx(Q,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),a.jsxs(Q,{variant:"destructive",onClick:d,disabled:l||!o.trim(),children:[l?a.jsx(Ye,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):a.jsx(qt,{className:"mr-1.5 h-3.5 w-3.5"}),"Uninstall"]})]})]})})}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 ZM(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 JM(){const[e,t]=m.useState([]),[n,r]=m.useState(!0),[s,o]=m.useState("dashboard"),i=m.useCallback(()=>{re.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(Q,{size:"sm",variant:"ghost",onClick:i,children:[a.jsx(Gn,{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(be,{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(_e,{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(Qd,{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(Db,{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:ZM(l.logSize)})]})]}),a.jsx(ve,{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(eI,{service:s})]})}function eI({service:e}){const[t,n]=m.useState([]),[r,s]=m.useState(0),[o,i]=m.useState(""),[l,u]=m.useState(!0),[c,h]=m.useState(!0),[d,f]=m.useState(!0),[x,y]=m.useState(200),w=m.useRef(null),N=m.useRef(null),p=m.useCallback(b=>{const k=b??x;re.system.logs(e,k).then(j=>{n(j.data.lines),s(j.data.total),i(j.data.lastModified)}).catch(()=>{}).finally(()=>u(!1))},[e,x]);m.useEffect(()=>{u(!0),n([]),p()},[e]),m.useEffect(()=>{p()},[x]),m.useEffect(()=>{c&&w.current&&(w.current.scrollTop=w.current.scrollHeight)},[t,c]),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 re.system.clearLog(e),n([]),s(0)}catch{}},g=()=>{y(b=>Math.min(b+500,2e3))},S=e.charAt(0).toUpperCase()+e.slice(1);return a.jsxs(be,{children:[a.jsx(Le,{className:"pb-3",children:a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[a.jsxs(Ae,{className:"flex items-center gap-2 text-sm",children:[a.jsx(_s,{className:"h-4 w-4"})," ",S," Logs",a.jsxs(ve,{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>x&&a.jsx(Q,{size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:g,children:"Load more"}),a.jsxs(Q,{size:"sm",variant:d?"default":"outline",className:"h-7 text-xs",onClick:()=>{f(!d),h(!d)},children:[d?a.jsx(Qb,{className:"mr-1 h-3 w-3"}):a.jsx(Ia,{className:"mr-1 h-3 w-3"}),d?"Pause":"Tail"]}),a.jsxs(Q,{size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:()=>{var b;h(!0),(b=w.current)==null||b.scrollTo({top:w.current.scrollHeight,behavior:"smooth"})},children:[a.jsx(Tb,{className:"mr-1 h-3 w-3"})," Bottom"]}),a.jsxs(Q,{size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:()=>p(),children:[a.jsx(Gn,{className:"mr-1 h-3 w-3"})," Refresh"]}),a.jsxs(Q,{size:"sm",variant:"ghost",className:"h-7 text-xs text-destructive hover:text-destructive",onClick:v,children:[a.jsx(qt,{className:"mr-1 h-3 w-3"})," Clear"]})]})]})}),a.jsx(_e,{className:"p-0",children:l?a.jsx("div",{className:"flex h-60 items-center justify-center",children:a.jsx(Ye,{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(Rb,{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:b,scrollHeight:k,clientHeight:j}=w.current,_=k-b-j<40;h(_)},children:a.jsx("pre",{className:"p-4 text-xs leading-5 font-mono text-zinc-300",children:t.map((b,k)=>a.jsx(tI,{line:b,lineNum:r-t.length+k+1},k))})})})]})}function tI({line:e,lineNum:t}){const n=nI(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}),`
|
|
397
|
+
`]})}function nI(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 rI=[{key:"og_core_url",label:"Core API URL",icon:Qd,placeholder:"http://localhost:53666",description:"OpenTrust Core service endpoint"},{key:"gateway_url",label:"Gateway URL",icon:Xx,placeholder:"http://localhost:8900",description:"AI Gateway proxy endpoint"},{key:"dashboard_mode",label:"Dashboard Mode",icon:Zx,placeholder:"selfhosted",description:"Deployment mode: selfhosted or embedded"},{key:"database_url",label:"Database URL",icon:Fb,placeholder:"file:./data/dashboard.db",description:"Database connection string",sensitive:!0}];function sI(){const[e,t]=m.useState({}),[n,r]=m.useState({}),[s,o]=m.useState(!0),[i,l]=m.useState(!1),[u,c]=m.useState(null),[h,d]=m.useState(null),[f,x]=m.useState(!1),[y,w]=m.useState(""),[N,p]=m.useState(""),[v,g]=m.useState(!1),[S,b]=m.useState(!1),k=m.useCallback(()=>{re.settings.getApiKey(!1).then(A=>{w(A.data.key),p(""),g(!1)}).catch(()=>{})},[]),j=()=>{o(!0),re.settings.get().then(A=>{const C=A.data??{};t(C),r(C)}).catch(()=>{}).finally(()=>o(!1))};m.useEffect(()=>{j(),k()},[k]);const _=()=>Object.keys(e).some(A=>e[A]!==n[A]),I=async()=>{l(!0);try{const A={};for(const[C,L]of Object.entries(e))L!==n[C]&&(A[C]=L);Object.keys(A).length>0&&(await re.settings.update(A),r({...e}),R("Settings saved","success"))}catch(A){R(A instanceof Error?A.message:"Failed to save","error")}finally{l(!1)}},$=async()=>{x(!0),d(null);try{const C=await(await fetch("/api/settings/test-connection",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${JSON.parse(localStorage.getItem("opentrust_user")||"{}").apiKey||""}`}})).json();C.success&&d(C.data)}catch{d({connected:!1,message:"Request failed"})}finally{x(!1)}},R=(A,C)=>{c({msg:A,type:C}),setTimeout(()=>c(null),3e3)},T=(A,C)=>{t(L=>({...L,[A]:C}))};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(Q,{size:"sm",variant:"ghost",onClick:j,children:[a.jsx(Gn,{className:"mr-1.5 h-3.5 w-3.5"})," Reload"]}),a.jsxs(Q,{size:"sm",onClick:I,disabled:i||!_(),children:[i?a.jsx(Ye,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):a.jsx(Qx,{className:"mr-1.5 h-3.5 w-3.5"}),"Save Changes"]})]})]}),a.jsxs(be,{children:[a.jsxs(Le,{children:[a.jsxs(Ae,{className:"flex items-center gap-2 text-sm",children:[a.jsx(Wb,{className:"h-4 w-4"})," System API Key"]}),a.jsx(Zd,{className:"text-xs",children:"Unified key for CLI, Guards, Gateway, and Dashboard inter-component authentication"})]}),a.jsxs(_e,{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ze,{readOnly:!0,value:v?N:y,className:"font-mono text-sm",placeholder:"Loading..."}),a.jsx(Q,{size:"icon",variant:"outline",title:v?"Hide":"Reveal",onClick:async()=>{if(v)g(!1);else try{const A=await re.settings.getApiKey(!0);p(A.data.key),g(!0)}catch{R("Failed to reveal key","error")}},children:v?a.jsx(Vb,{className:"h-4 w-4"}):a.jsx(Bb,{className:"h-4 w-4"})}),a.jsx(Q,{size:"icon",variant:"outline",title:"Copy to clipboard",onClick:async()=>{try{const A=await re.settings.getApiKey(!0);await navigator.clipboard.writeText(A.data.key),R("API key copied","success")}catch{R("Failed to copy","error")}},children:a.jsx(Ob,{className:"h-4 w-4"})}),a.jsx(Q,{size:"icon",variant:"outline",title:"Regenerate key",disabled:S,onClick:async()=>{if(window.confirm("Regenerating will invalidate the current key. All connected components must update their configuration. Continue?")){b(!0);try{const A=await re.settings.generateKey();p(A.data.key),w(A.data.key.slice(0,12)+"..."+A.data.key.slice(-4)),g(!0),R("New API key generated","success")}catch{R("Failed to generate key","error")}finally{b(!1)}}},children:S?a.jsx(Ye,{className:"h-4 w-4 animate-spin"}):a.jsx(Ra,{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(ds,{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(oI,{showToast:R}),a.jsxs(be,{children:[a.jsx(Le,{children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs(Ae,{className:"flex items-center gap-2 text-sm",children:[a.jsx(Qd,{className:"h-4 w-4"})," Service Connection"]}),a.jsxs(Q,{size:"sm",variant:"outline",onClick:$,disabled:f,children:[f?a.jsx(Ye,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):a.jsx(Gn,{className:"mr-1.5 h-3.5 w-3.5"}),"Test Connection"]})]})}),a.jsx(_e,{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(xr,{className:"h-4 w-4"}):a.jsx(Dt,{className:"h-4 w-4"}),a.jsx("span",{children:h.message}),h.url&&a.jsx(ve,{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(be,{children:[a.jsx(Le,{children:a.jsxs(Ae,{className:"flex items-center gap-2 text-sm",children:[a.jsx(Qt,{className:"h-4 w-4"})," Configuration"]})}),a.jsx(_e,{className:"space-y-5",children:rI.map(A=>{const C=A.icon,L=e[A.key]!==n[A.key];return a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(C,{className:"h-3.5 w-3.5 text-muted-foreground"}),a.jsx(Ze,{htmlFor:A.key,className:"text-sm font-medium",children:A.label}),L&&a.jsx(ve,{variant:"secondary",className:"text-[10px]",children:"Modified"})]}),a.jsx(ze,{id:A.key,value:e[A.key]??"",onChange:M=>T(A.key,M.target.value),placeholder:A.placeholder,className:"font-mono text-sm"}),a.jsx("p",{className:"text-[11px] text-muted-foreground",children:A.description})]},A.key)})})]}),a.jsxs(be,{children:[a.jsx(Le,{children:a.jsx(Ae,{className:"text-sm",children:"Environment"})}),a.jsx(_e,{children:a.jsxs("div",{className:"grid gap-3 text-xs sm:grid-cols-2",children:[a.jsx($i,{label:"Dashboard Mode",value:e.dashboard_mode||"selfhosted"}),a.jsx($i,{label:"Core URL",value:e.og_core_url||"http://localhost:53666"}),a.jsx($i,{label:"Gateway URL",value:e.gateway_url||"http://localhost:8900"}),a.jsx($i,{label:"Database",value:e.database_url?"Custom":"SQLite (default)"})]})})]}),u&&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 ${u.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:[u.type==="success"?a.jsx(xr,{className:"h-4 w-4"}):a.jsx(Dt,{className:"h-4 w-4"}),a.jsx("span",{className:"text-sm",children:u.msg})]})]})}function oI({showToast:e}){const[t,n]=m.useState(""),[r,s]=m.useState(""),[o,i]=m.useState(""),[l,u]=m.useState(!1),c=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}u(!0);try{const d=localStorage.getItem("opentrust_user"),f=d?JSON.parse(d).apiKey:null,x=await fetch("/api/auth/change-password",{method:"POST",headers:{"Content-Type":"application/json",...f&&{Authorization:`Bearer ${f}`}},body:JSON.stringify({currentPassword:t,newPassword:r})}),y=await x.json();if(!x.ok||!y.success)throw new Error(y.error||"Failed");e("Password changed successfully","success"),n(""),s(""),i("")}catch(d){e(d instanceof Error?d.message:"Failed to change password","error")}finally{u(!1)}};return a.jsxs(be,{children:[a.jsxs(Le,{children:[a.jsxs(Ae,{className:"flex items-center gap-2 text-sm",children:[a.jsx(Kb,{className:"h-4 w-4"})," Change Password"]}),a.jsx(Zd,{className:"text-xs",children:"Update the admin login password"})]}),a.jsx(_e,{children:a.jsxs("form",{onSubmit:c,className:"space-y-3",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx(Ze,{className:"text-xs",children:"Current Password"}),a.jsx(ze,{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(Ze,{className:"text-xs",children:"New Password"}),a.jsx(ze,{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(Ze,{className:"text-xs",children:"Confirm New Password"}),a.jsx(ze,{type:"password",value:o,onChange:h=>i(h.target.value),required:!0,className:"text-sm"})]}),a.jsxs(Q,{type:"submit",size:"sm",disabled:l,children:[l?a.jsx(Ye,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):a.jsx(Qx,{className:"mr-1.5 h-3.5 w-3.5"}),"Update Password"]})]})})]})}function $i({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 iI(){const[e,t]=m.useState([]),[n,r]=m.useState(!0),[s,o]=m.useState(null),[i,l]=m.useState(null),u=m.useCallback(async()=>{try{const d=await re.hosts.list();t(d.data)}catch{}finally{r(!1)}},[]);m.useEffect(()=>{u();const d=setInterval(u,15e3);return()=>clearInterval(d)},[u]),m.useEffect(()=>{if(!i)return;const d=setTimeout(()=>l(null),4e3);return()=>clearTimeout(d)},[i]);const c=(d,f)=>l({msg:d,type:f}),h=async d=>{try{await re.hosts.remove(d),t(f=>f.filter(x=>x.id!==d)),c("Host removed","success")}catch{c("Failed to remove host","error")}};return n?a.jsx("div",{className:"flex items-center justify-center py-24",children:a.jsx(Ye,{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(Q,{variant:"outline",size:"sm",onClick:u,children:[a.jsx(Gn,{className:"h-4 w-4 mr-1"})," Refresh"]})]}),e.length===0?a.jsxs(be,{className:"p-8 text-center",children:[a.jsx(Xo,{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:e.map(d=>a.jsx("div",{children:a.jsx(aI,{host:d,expanded:s===d.id,onToggle:()=>o(s===d.id?null:d.id),onRemove:()=>h(d.id),showToast:c})},d.id))}),i&&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 ${i.type==="success"?"bg-green-600 text-white":"bg-red-600 text-white"}`,children:[i.type==="success"?a.jsx(xr,{className:"h-4 w-4"}):a.jsx(Dt,{className:"h-4 w-4"}),i.msg]})]})}function aI({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,u=Object.keys(i).length;e.metadata;const[c,h]=m.useState(0);return m.useEffect(()=>{re.hosts.agents(e.id).then(d=>h((d.data??[]).length)).catch(()=>{})},[e.id]),a.jsxs(be,{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(ve,{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(Xx,{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,"/",u," services"]}),c>0&&a.jsxs("span",{children:[c," agent",c>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(zb,{className:"h-4 w-4 text-muted-foreground"}):a.jsx(hl,{className:"h-4 w-4 text-muted-foreground"})]})]}),t&&a.jsx("div",{className:"border-t border-border",children:a.jsx(lI,{host:e,onRemove:r,showToast:s})})]})}function lI({host:e,onRemove:t,showToast:n}){const[r,s]=m.useState("agents");return a.jsxs(Sf,{value:r,onValueChange:s,className:"w-full",children:[a.jsxs(Pl,{className:"w-full justify-start rounded-none border-b bg-transparent px-4 pt-2",children:[a.jsx(nt,{value:"agents",children:"Agents"}),a.jsx(nt,{value:"services",children:"Services"}),a.jsx(nt,{value:"guards",children:"Guards"}),a.jsx(nt,{value:"logs",children:"Logs"}),a.jsx(nt,{value:"upgrade",children:"Upgrade"}),a.jsx(nt,{value:"config",children:"Config"}),a.jsx(nt,{value:"commands",children:"Commands"}),a.jsx(nt,{value:"info",children:"Info"})]}),a.jsxs("div",{className:"p-4",children:[a.jsx(rt,{value:"agents",className:"mt-0",children:a.jsx(uI,{hostId:e.id})}),a.jsx(rt,{value:"services",className:"mt-0",children:a.jsx(cI,{host:e,showToast:n})}),a.jsx(rt,{value:"guards",className:"mt-0",children:a.jsx(dI,{host:e,showToast:n})}),a.jsx(rt,{value:"logs",className:"mt-0",children:a.jsx(fI,{host:e,showToast:n})}),a.jsx(rt,{value:"upgrade",className:"mt-0",children:a.jsx(hI,{host:e,showToast:n})}),a.jsx(rt,{value:"config",className:"mt-0",children:a.jsx(mI,{host:e,showToast:n})}),a.jsx(rt,{value:"commands",className:"mt-0",children:a.jsx(pI,{hostId:e.id})}),a.jsx(rt,{value:"info",className:"mt-0",children:a.jsx(gI,{host:e,onRemove:t})})]})]})}function uI({hostId:e}){const[t,n]=m.useState([]),[r,s]=m.useState(!0);return m.useEffect(()=>{re.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(Ye,{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(Xo,{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 l=(o.metadata??{}).emoji||"🤖";return a.jsxs("div",{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(ve,{variant:o.status==="active"?"default":"secondary",className:"text-[10px] ml-1",children:o.status})]})]}),o.lastSeenAt&&a.jsx("span",{className:"text-[11px] text-muted-foreground",children:new Date(o.lastSeenAt).toLocaleString()})]},o.id)})]})}function cI({host:e,showToast:t}){const n=e.services??{},[r,s]=m.useState(null),o=async(i,l)=>{s(`${i}-${l}`);try{await re.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(Q,{variant:"outline",size:"sm",disabled:r!==null,onClick:()=>o("restart_service",i),children:[a.jsx(Ra,{className:"h-3 w-3 mr-1"})," Restart"]}),a.jsxs(Q,{variant:"outline",size:"sm",disabled:r!==null,onClick:()=>o("stop_service",i),children:[a.jsx(jc,{className:"h-3 w-3 mr-1"})," Stop"]})]}):a.jsxs(Q,{variant:"outline",size:"sm",disabled:r!==null,onClick:()=>o("start_service",i),children:[a.jsx(Ia,{className:"h-3 w-3 mr-1"})," Start"]})})]},i)),a.jsxs("div",{className:"flex gap-2 pt-2",children:[a.jsxs(Q,{variant:"outline",size:"sm",disabled:r!==null,onClick:()=>o("start_service","all"),children:[a.jsx(Ia,{className:"h-3 w-3 mr-1"})," Start All"]}),a.jsxs(Q,{variant:"outline",size:"sm",disabled:r!==null,onClick:()=>o("stop_service","all"),children:[a.jsx(jc,{className:"h-3 w-3 mr-1"})," Stop All"]}),a.jsxs(Q,{variant:"outline",size:"sm",disabled:r!==null,onClick:()=>o("restart_service","all"),children:[a.jsx(Ra,{className:"h-3 w-3 mr-1"})," Restart All"]})]})]})}function dI({host:e,showToast:t}){const[n,r]=m.useState(""),[s,o]=m.useState(null),l=(e.metadata??{}).guards,u=async c=>{o(c);try{await re.hosts.sendCommand(e.id,c,n?{version:n}:{}),t(c==="install_guards"?"Guards install command sent":"Guards upgrade command sent","success")}catch{t(`Failed to send ${c.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(Zx,{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(ve,{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(ze,{placeholder:"Version (empty = latest)",value:n,onChange:c=>r(c.target.value),className:"max-w-xs"}),a.jsxs(Q,{onClick:()=>u("install_guards"),disabled:s!==null,variant:"default",children:[s==="install_guards"?a.jsx(Ye,{className:"h-4 w-4 mr-1 animate-spin"}):a.jsx(gn,{className:"h-4 w-4 mr-1"}),"Install"]}),a.jsxs(Q,{onClick:()=>u("upgrade_guards"),disabled:s!==null,variant:"outline",children:[s==="upgrade_guards"?a.jsx(Ye,{className:"h-4 w-4 mr-1 animate-spin"}):a.jsx(Xd,{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 fI({host:e,showToast:t}){const n=Object.keys(e.services??{}),[r,s]=m.useState(n[0]??"core"),[o,i]=m.useState(null),[l,u]=m.useState(!1),c=async()=>{u(!0);try{await re.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{u(!1)}};return a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ze,{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(Q,{variant:"outline",size:"sm",onClick:c,disabled:l,children:[a.jsx(_s,{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 hI({host:e,showToast:t}){const[n,r]=m.useState(""),[s,o]=m.useState(!1),i=async()=>{o(!0);try{await re.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(ve,{variant:"secondary",children:e.projectMode})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ze,{placeholder:"Target version (empty = latest)",value:n,onChange:l=>r(l.target.value),className:"max-w-xs"}),a.jsxs(Q,{onClick:i,disabled:s,children:[a.jsx(Xd,{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 mI({host:e,showToast:t}){const[n,r]=m.useState(""),[s,o]=m.useState(""),[i,l]=m.useState(!1),u=async()=>{if(n){l(!0);try{await re.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(Ze,{className:"text-xs",children:"Key"}),a.jsx(ze,{placeholder:"e.g. CORE_API_KEY",value:n,onChange:c=>r(c.target.value)})]}),a.jsxs("div",{children:[a.jsx(Ze,{className:"text-xs",children:"Value"}),a.jsx(ze,{placeholder:"Value",value:s,onChange:c=>o(c.target.value)})]})]}),a.jsxs(Q,{size:"sm",onClick:u,disabled:i||!n,children:[a.jsx(Qt,{className:"h-3 w-3 mr-1"})," Update .env"]})]})}function pI({hostId:e}){const[t,n]=m.useState([]),[r,s]=m.useState(!0),o=m.useCallback(async()=>{try{const u=await re.hosts.commands(e);n(u.data)}catch{}s(!1)},[e]);m.useEffect(()=>{o();const u=setInterval(o,8e3);return()=>clearInterval(u)},[o]);const i=u=>{const c={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 ${c[u]??"bg-gray-500/20 text-gray-500"}`,children:u})},l=u=>({start_service:a.jsx(Ia,{className:"h-3 w-3"}),stop_service:a.jsx(jc,{className:"h-3 w-3"}),restart_service:a.jsx(Ra,{className:"h-3 w-3"}),upgrade:a.jsx(Xd,{className:"h-3 w-3"}),fetch_logs:a.jsx(_s,{className:"h-3 w-3"}),update_env:a.jsx(Qt,{className:"h-3 w-3"})})[u]??a.jsx(ds,{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(u=>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(u.type),a.jsx("span",{className:"font-medium",children:u.type.replace(/_/g," ")}),i(u.status)]}),a.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(u.createdAt).toLocaleString()})]}),u.payload&&a.jsx("pre",{className:"text-xs bg-muted rounded px-2 py-1 mt-1 overflow-x-auto",children:JSON.stringify(u.payload,null,2)}),u.result&&a.jsx("pre",{className:`text-xs rounded px-2 py-1 mt-1 overflow-x-auto ${u.status==="failed"?"bg-red-500/10":"bg-green-500/10"}`,children:JSON.stringify(u.result,null,2)})]},u.id))})}function gI({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(Q,{variant:"destructive",size:"sm",onClick:()=>s(!0),children:[a.jsx(qt,{className:"h-3 w-3 mr-1"})," Remove Host"]})}),a.jsx(Ps,{open:r,onOpenChange:s,children:a.jsxs(kr,{children:[a.jsxs(Ms,{children:[a.jsx(Cr,{children:"Remove Host"}),a.jsxs(Er,{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(Is,{children:[a.jsx(Q,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),a.jsx(Q,{variant:"destructive",onClick:()=>{s(!1),t()},children:"Remove"})]})]})})]})}function xI({children:e}){const{isAuthenticated:t,isLoading:n}=Kd();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(Nc,{to:"/login",replace:!0})}function yI(){return a.jsxs(mS,{children:[a.jsx(Ke,{path:"/login",element:a.jsx(hj,{})}),a.jsxs(Ke,{element:a.jsx(xI,{children:a.jsx(fj,{})}),children:[a.jsx(Ke,{index:!0,element:a.jsx(Nc,{to:"/inventory/agents",replace:!0})}),a.jsx(Ke,{path:"/inventory/agents",element:a.jsx(pj,{})}),a.jsx(Ke,{path:"/inventory/agents/:id",element:a.jsx(xj,{})}),a.jsx(Ke,{path:"/inventory/identities",element:a.jsx(Sj,{})}),a.jsx(Ke,{path:"/inventory/permissions",element:a.jsx(bj,{})}),a.jsx(Ke,{path:"/secure/risk",element:a.jsx(jj,{})}),a.jsx(Ke,{path:"/secure/graph",element:a.jsx(KP,{})}),a.jsx(Ke,{path:"/ops/skills",element:a.jsx(DM,{})}),a.jsx(Ke,{path:"/ops/plugins",element:a.jsx(WM,{})}),a.jsx(Ke,{path:"/inventory/hosts",element:a.jsx(iI,{})}),a.jsx(Ke,{path:"/system/logs",element:a.jsx(JM,{})}),a.jsx(Ke,{path:"/system/settings",element:a.jsx(sI,{})})]}),a.jsx(Ke,{path:"*",element:a.jsx(Nc,{to:"/inventory/agents",replace:!0})})]})}Eu.createRoot(document.getElementById("root")).render(a.jsx(Bt.StrictMode,{children:a.jsx($S,{basename:"/dashboard",children:a.jsx(GS,{children:a.jsx(XS,{children:a.jsx(yI,{})})})})}));
|
|
398
|
+
//# sourceMappingURL=index-BxX_pffc.js.map
|