@opentrust/dashboard 7.3.11 → 7.3.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,277 +0,0 @@
1
- function Dw(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in e)){const i=Object.getOwnPropertyDescriptor(r,o);i&&Object.defineProperty(e,o,i.get?i:{enumerable:!0,get:()=>r[o]})}}}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 o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();function jc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var qp={exports:{}},_l={},Zp={exports:{}},ne={};/**
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 ki=Symbol.for("react.element"),zw=Symbol.for("react.portal"),$w=Symbol.for("react.fragment"),Ow=Symbol.for("react.strict_mode"),Fw=Symbol.for("react.profiler"),Bw=Symbol.for("react.provider"),Vw=Symbol.for("react.context"),Hw=Symbol.for("react.forward_ref"),Uw=Symbol.for("react.suspense"),Ww=Symbol.for("react.memo"),Yw=Symbol.for("react.lazy"),vf=Symbol.iterator;function Xw(e){return e===null||typeof e!="object"?null:(e=vf&&e[vf]||e["@@iterator"],typeof e=="function"?e:null)}var Jp={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},em=Object.assign,tm={};function so(e,t,n){this.props=e,this.context=t,this.refs=tm,this.updater=n||Jp}so.prototype.isReactComponent={};so.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")};so.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function nm(){}nm.prototype=so.prototype;function Mc(e,t,n){this.props=e,this.context=t,this.refs=tm,this.updater=n||Jp}var Rc=Mc.prototype=new nm;Rc.constructor=Mc;em(Rc,so.prototype);Rc.isPureReactComponent=!0;var xf=Array.isArray,rm=Object.prototype.hasOwnProperty,Tc={current:null},om={key:!0,ref:!0,__self:!0,__source:!0};function im(e,t,n){var r,o={},i=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)rm.call(t,r)&&!om.hasOwnProperty(r)&&(o[r]=t[r]);var l=arguments.length-2;if(l===1)o.children=n;else if(1<l){for(var a=Array(l),u=0;u<l;u++)a[u]=arguments[u+2];o.children=a}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)o[r]===void 0&&(o[r]=l[r]);return{$$typeof:ki,type:e,key:i,ref:s,props:o,_owner:Tc.current}}function Gw(e,t){return{$$typeof:ki,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Ic(e){return typeof e=="object"&&e!==null&&e.$$typeof===ki}function Kw(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var wf=/\/+/g;function ya(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Kw(""+e.key):t.toString(36)}function xs(e,t,n,r,o){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(i){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case ki:case zw:s=!0}}if(s)return s=e,o=o(s),e=r===""?"."+ya(s,0):r,xf(o)?(n="",e!=null&&(n=e.replace(wf,"$&/")+"/"),xs(o,t,n,"",function(u){return u})):o!=null&&(Ic(o)&&(o=Gw(o,n+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(wf,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=r===""?".":r+":",xf(e))for(var l=0;l<e.length;l++){i=e[l];var a=r+ya(i,l);s+=xs(i,t,n,a,o)}else if(a=Xw(e),typeof a=="function")for(e=a.call(e),l=0;!(i=e.next()).done;)i=i.value,a=r+ya(i,l++),s+=xs(i,t,n,a,o);else if(i==="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 s}function Fi(e,t,n){if(e==null)return e;var r=[],o=0;return xs(e,r,"","",function(i){return t.call(n,i,o++)}),r}function Qw(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 He={current:null},ws={transition:null},qw={ReactCurrentDispatcher:He,ReactCurrentBatchConfig:ws,ReactCurrentOwner:Tc};ne.Children={map:Fi,forEach:function(e,t,n){Fi(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Fi(e,function(){t++}),t},toArray:function(e){return Fi(e,function(t){return t})||[]},only:function(e){if(!Ic(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ne.Component=so;ne.Fragment=$w;ne.Profiler=Fw;ne.PureComponent=Mc;ne.StrictMode=Ow;ne.Suspense=Uw;ne.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=qw;ne.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=em({},e.props),o=e.key,i=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,s=Tc.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(a in t)rm.call(t,a)&&!om.hasOwnProperty(a)&&(r[a]=t[a]===void 0&&l!==void 0?l[a]:t[a])}var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){l=Array(a);for(var u=0;u<a;u++)l[u]=arguments[u+2];r.children=l}return{$$typeof:ki,type:e.type,key:o,ref:i,props:r,_owner:s}};ne.createContext=function(e){return e={$$typeof:Vw,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Bw,_context:e},e.Consumer=e};ne.createElement=im;ne.createFactory=function(e){var t=im.bind(null,e);return t.type=e,t};ne.createRef=function(){return{current:null}};ne.forwardRef=function(e){return{$$typeof:Hw,render:e}};ne.isValidElement=Ic;ne.lazy=function(e){return{$$typeof:Yw,_payload:{_status:-1,_result:e},_init:Qw}};ne.memo=function(e,t){return{$$typeof:Ww,type:e,compare:t===void 0?null:t}};ne.startTransition=function(e){var t=ws.transition;ws.transition={};try{e()}finally{ws.transition=t}};ne.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};ne.useCallback=function(e,t){return He.current.useCallback(e,t)};ne.useContext=function(e){return He.current.useContext(e)};ne.useDebugValue=function(){};ne.useDeferredValue=function(e){return He.current.useDeferredValue(e)};ne.useEffect=function(e,t){return He.current.useEffect(e,t)};ne.useId=function(){return He.current.useId()};ne.useImperativeHandle=function(e,t,n){return He.current.useImperativeHandle(e,t,n)};ne.useInsertionEffect=function(e,t){return He.current.useInsertionEffect(e,t)};ne.useLayoutEffect=function(e,t){return He.current.useLayoutEffect(e,t)};ne.useMemo=function(e,t){return He.current.useMemo(e,t)};ne.useReducer=function(e,t,n){return He.current.useReducer(e,t,n)};ne.useRef=function(e){return He.current.useRef(e)};ne.useState=function(e){return He.current.useState(e)};ne.useSyncExternalStore=function(e,t,n){return He.current.useSyncExternalStore(e,t,n)};ne.useTransition=function(){return He.current.useTransition()};ne.version="18.3.0";Zp.exports=ne;var v=Zp.exports;const It=jc(v),Zw=Dw({__proto__:null,default:It},[v]);/**
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 Jw=v,e1=Symbol.for("react.element"),t1=Symbol.for("react.fragment"),n1=Object.prototype.hasOwnProperty,r1=Jw.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o1={key:!0,ref:!0,__self:!0,__source:!0};function sm(e,t,n){var r,o={},i=null,s=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)n1.call(t,r)&&!o1.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:e1,type:e,key:i,ref:s,props:o,_owner:r1.current}}_l.Fragment=t1;_l.jsx=sm;_l.jsxs=sm;qp.exports=_l;var h=qp.exports,cu={},lm={exports:{}},st={},am={exports:{}},um={};/**
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(b,j){var L=b.length;b.push(j);e:for(;0<L;){var O=L-1>>>1,$=b[O];if(0<o($,j))b[O]=j,b[L]=$,L=O;else break e}}function n(b){return b.length===0?null:b[0]}function r(b){if(b.length===0)return null;var j=b[0],L=b.pop();if(L!==j){b[0]=L;e:for(var O=0,$=b.length,U=$>>>1;O<U;){var H=2*(O+1)-1,Y=b[H],X=H+1,G=b[X];if(0>o(Y,L))X<$&&0>o(G,Y)?(b[O]=G,b[X]=L,O=X):(b[O]=Y,b[H]=L,O=H);else if(X<$&&0>o(G,L))b[O]=G,b[X]=L,O=X;else break e}}return j}function o(b,j){var L=b.sortIndex-j.sortIndex;return L!==0?L:b.id-j.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,l=s.now();e.unstable_now=function(){return s.now()-l}}var a=[],u=[],d=1,c=null,f=3,y=!1,x=!1,w=!1,S=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function m(b){for(var j=n(u);j!==null;){if(j.callback===null)r(u);else if(j.startTime<=b)r(u),j.sortIndex=j.expirationTime,t(a,j);else break;j=n(u)}}function E(b){if(w=!1,m(b),!x)if(n(a)!==null)x=!0,M(N);else{var j=n(u);j!==null&&D(E,j.startTime-b)}}function N(b,j){x=!1,w&&(w=!1,p(P),P=-1),y=!0;var L=f;try{for(m(j),c=n(a);c!==null&&(!(c.expirationTime>j)||b&&!I());){var O=c.callback;if(typeof O=="function"){c.callback=null,f=c.priorityLevel;var $=O(c.expirationTime<=j);j=e.unstable_now(),typeof $=="function"?c.callback=$:c===n(a)&&r(a),m(j)}else r(a);c=n(a)}if(c!==null)var U=!0;else{var H=n(u);H!==null&&D(E,H.startTime-j),U=!1}return U}finally{c=null,f=L,y=!1}}var C=!1,k=null,P=-1,R=5,z=-1;function I(){return!(e.unstable_now()-z<R)}function T(){if(k!==null){var b=e.unstable_now();z=b;var j=!0;try{j=k(!0,b)}finally{j?F():(C=!1,k=null)}}else C=!1}var F;if(typeof g=="function")F=function(){g(T)};else if(typeof MessageChannel<"u"){var _=new MessageChannel,A=_.port2;_.port1.onmessage=T,F=function(){A.postMessage(null)}}else F=function(){S(T,0)};function M(b){k=b,C||(C=!0,F())}function D(b,j){P=S(function(){b(e.unstable_now())},j)}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(b){b.callback=null},e.unstable_continueExecution=function(){x||y||(x=!0,M(N))},e.unstable_forceFrameRate=function(b){0>b||125<b?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<b?Math.floor(1e3/b):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(a)},e.unstable_next=function(b){switch(f){case 1:case 2:case 3:var j=3;break;default:j=f}var L=f;f=j;try{return b()}finally{f=L}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(b,j){switch(b){case 1:case 2:case 3:case 4:case 5:break;default:b=3}var L=f;f=b;try{return j()}finally{f=L}},e.unstable_scheduleCallback=function(b,j,L){var O=e.unstable_now();switch(typeof L=="object"&&L!==null?(L=L.delay,L=typeof L=="number"&&0<L?O+L:O):L=O,b){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=L+$,b={id:d++,callback:j,priorityLevel:b,startTime:L,expirationTime:$,sortIndex:-1},L>O?(b.sortIndex=L,t(u,b),n(a)===null&&b===n(u)&&(w?(p(P),P=-1):w=!0,D(E,L-O))):(b.sortIndex=$,t(a,b),x||y||(x=!0,M(N))),b},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(b){var j=f;return function(){var L=f;f=j;try{return b.apply(this,arguments)}finally{f=L}}}})(um);am.exports=um;var i1=am.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 s1=v,rt=i1;function B(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 cm=new Set,Qo={};function fr(e,t){Ur(e,t),Ur(e+"Capture",t)}function Ur(e,t){for(Qo[e]=t,e=0;e<t.length;e++)cm.add(t[e])}var en=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),du=Object.prototype.hasOwnProperty,l1=/^[: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]*$/,Sf={},Ef={};function a1(e){return du.call(Ef,e)?!0:du.call(Sf,e)?!1:l1.test(e)?Ef[e]=!0:(Sf[e]=!0,!1)}function u1(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function c1(e,t,n,r){if(t===null||typeof t>"u"||u1(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 Ue(e,t,n,r,o,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var Ae={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ae[e]=new Ue(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ae[t]=new Ue(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ae[e]=new Ue(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ae[e]=new Ue(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){Ae[e]=new Ue(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ae[e]=new Ue(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ae[e]=new Ue(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ae[e]=new Ue(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ae[e]=new Ue(e,5,!1,e.toLowerCase(),null,!1,!1)});var Lc=/[\-:]([a-z])/g;function Ac(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(Lc,Ac);Ae[t]=new Ue(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(Lc,Ac);Ae[t]=new Ue(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(Lc,Ac);Ae[t]=new Ue(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ae[e]=new Ue(e,1,!1,e.toLowerCase(),null,!1,!1)});Ae.xlinkHref=new Ue("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ae[e]=new Ue(e,1,!1,e.toLowerCase(),null,!0,!0)});function Dc(e,t,n,r){var o=Ae.hasOwnProperty(t)?Ae[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(c1(t,n,o,r)&&(n=null),r||o===null?a1(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,r=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var sn=s1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Bi=Symbol.for("react.element"),wr=Symbol.for("react.portal"),Sr=Symbol.for("react.fragment"),zc=Symbol.for("react.strict_mode"),fu=Symbol.for("react.profiler"),dm=Symbol.for("react.provider"),fm=Symbol.for("react.context"),$c=Symbol.for("react.forward_ref"),hu=Symbol.for("react.suspense"),pu=Symbol.for("react.suspense_list"),Oc=Symbol.for("react.memo"),mn=Symbol.for("react.lazy"),hm=Symbol.for("react.offscreen"),Nf=Symbol.iterator;function vo(e){return e===null||typeof e!="object"?null:(e=Nf&&e[Nf]||e["@@iterator"],typeof e=="function"?e:null)}var we=Object.assign,va;function To(e){if(va===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);va=t&&t[1]||""}return`
34
- `+va+e}var xa=!1;function wa(e,t){if(!e||xa)return"";xa=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var o=u.stack.split(`
35
- `),i=r.stack.split(`
36
- `),s=o.length-1,l=i.length-1;1<=s&&0<=l&&o[s]!==i[l];)l--;for(;1<=s&&0<=l;s--,l--)if(o[s]!==i[l]){if(s!==1||l!==1)do if(s--,l--,0>l||o[s]!==i[l]){var a=`
37
- `+o[s].replace(" at new "," at ");return e.displayName&&a.includes("<anonymous>")&&(a=a.replace("<anonymous>",e.displayName)),a}while(1<=s&&0<=l);break}}}finally{xa=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?To(e):""}function d1(e){switch(e.tag){case 5:return To(e.type);case 16:return To("Lazy");case 13:return To("Suspense");case 19:return To("SuspenseList");case 0:case 2:case 15:return e=wa(e.type,!1),e;case 11:return e=wa(e.type.render,!1),e;case 1:return e=wa(e.type,!0),e;default:return""}}function mu(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 Sr:return"Fragment";case wr:return"Portal";case fu:return"Profiler";case zc:return"StrictMode";case hu:return"Suspense";case pu:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case fm:return(e.displayName||"Context")+".Consumer";case dm:return(e._context.displayName||"Context")+".Provider";case $c:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Oc:return t=e.displayName||null,t!==null?t:mu(e.type)||"Memo";case mn:t=e._payload,e=e._init;try{return mu(e(t))}catch{}}return null}function f1(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 mu(t);case 8:return t===zc?"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 In(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function pm(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function h1(e){var t=pm(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 o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Vi(e){e._valueTracker||(e._valueTracker=h1(e))}function mm(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=pm(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Fs(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 gu(e,t){var n=t.checked;return we({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function kf(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=In(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 gm(e,t){t=t.checked,t!=null&&Dc(e,"checked",t,!1)}function yu(e,t){gm(e,t);var n=In(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")?vu(e,t.type,n):t.hasOwnProperty("defaultValue")&&vu(e,t.type,In(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Cf(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 vu(e,t,n){(t!=="number"||Fs(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Io=Array.isArray;function Lr(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+In(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function xu(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(B(91));return we({},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(B(92));if(Io(n)){if(1<n.length)throw Error(B(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:In(n)}}function ym(e,t){var n=In(t.value),r=In(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 _f(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function vm(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 wu(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?vm(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Hi,xm=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Hi=Hi||document.createElement("div"),Hi.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Hi.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function qo(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var $o={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},p1=["Webkit","ms","Moz","O"];Object.keys($o).forEach(function(e){p1.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),$o[t]=$o[e]})});function wm(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||$o.hasOwnProperty(e)&&$o[e]?(""+t).trim():t+"px"}function Sm(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=wm(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var m1=we({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 Su(e,t){if(t){if(m1[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(B(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(B(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(B(61))}if(t.style!=null&&typeof t.style!="object")throw Error(B(62))}}function Eu(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 Nu=null;function Fc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ku=null,Ar=null,Dr=null;function Pf(e){if(e=_i(e)){if(typeof ku!="function")throw Error(B(280));var t=e.stateNode;t&&(t=Tl(t),ku(e.stateNode,e.type,t))}}function Em(e){Ar?Dr?Dr.push(e):Dr=[e]:Ar=e}function Nm(){if(Ar){var e=Ar,t=Dr;if(Dr=Ar=null,Pf(e),t)for(e=0;e<t.length;e++)Pf(t[e])}}function km(e,t){return e(t)}function Cm(){}var Sa=!1;function bm(e,t,n){if(Sa)return e(t,n);Sa=!0;try{return km(e,t,n)}finally{Sa=!1,(Ar!==null||Dr!==null)&&(Cm(),Nm())}}function Zo(e,t){var n=e.stateNode;if(n===null)return null;var r=Tl(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(B(231,t,typeof n));return n}var Cu=!1;if(en)try{var xo={};Object.defineProperty(xo,"passive",{get:function(){Cu=!0}}),window.addEventListener("test",xo,xo),window.removeEventListener("test",xo,xo)}catch{Cu=!1}function g1(e,t,n,r,o,i,s,l,a){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(d){this.onError(d)}}var Oo=!1,Bs=null,Vs=!1,bu=null,y1={onError:function(e){Oo=!0,Bs=e}};function v1(e,t,n,r,o,i,s,l,a){Oo=!1,Bs=null,g1.apply(y1,arguments)}function x1(e,t,n,r,o,i,s,l,a){if(v1.apply(this,arguments),Oo){if(Oo){var u=Bs;Oo=!1,Bs=null}else throw Error(B(198));Vs||(Vs=!0,bu=u)}}function hr(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 _m(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 jf(e){if(hr(e)!==e)throw Error(B(188))}function w1(e){var t=e.alternate;if(!t){if(t=hr(e),t===null)throw Error(B(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var i=o.alternate;if(i===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return jf(o),e;if(i===r)return jf(o),t;i=i.sibling}throw Error(B(188))}if(n.return!==r.return)n=o,r=i;else{for(var s=!1,l=o.child;l;){if(l===n){s=!0,n=o,r=i;break}if(l===r){s=!0,r=o,n=i;break}l=l.sibling}if(!s){for(l=i.child;l;){if(l===n){s=!0,n=i,r=o;break}if(l===r){s=!0,r=i,n=o;break}l=l.sibling}if(!s)throw Error(B(189))}}if(n.alternate!==r)throw Error(B(190))}if(n.tag!==3)throw Error(B(188));return n.stateNode.current===n?e:t}function Pm(e){return e=w1(e),e!==null?jm(e):null}function jm(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=jm(e);if(t!==null)return t;e=e.sibling}return null}var Mm=rt.unstable_scheduleCallback,Mf=rt.unstable_cancelCallback,S1=rt.unstable_shouldYield,E1=rt.unstable_requestPaint,Ee=rt.unstable_now,N1=rt.unstable_getCurrentPriorityLevel,Bc=rt.unstable_ImmediatePriority,Rm=rt.unstable_UserBlockingPriority,Hs=rt.unstable_NormalPriority,k1=rt.unstable_LowPriority,Tm=rt.unstable_IdlePriority,Pl=null,zt=null;function C1(e){if(zt&&typeof zt.onCommitFiberRoot=="function")try{zt.onCommitFiberRoot(Pl,e,void 0,(e.current.flags&128)===128)}catch{}}var Ct=Math.clz32?Math.clz32:P1,b1=Math.log,_1=Math.LN2;function P1(e){return e>>>=0,e===0?32:31-(b1(e)/_1|0)|0}var Ui=64,Wi=4194304;function Lo(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 Us(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var l=s&~o;l!==0?r=Lo(l):(i&=s,i!==0&&(r=Lo(i)))}else s=n&~o,s!==0?r=Lo(s):i!==0&&(r=Lo(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&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-Ct(t),o=1<<n,r|=e[n],t&=~o;return r}function j1(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 M1(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var s=31-Ct(i),l=1<<s,a=o[s];a===-1?(!(l&n)||l&r)&&(o[s]=j1(l,t)):a<=t&&(e.expiredLanes|=l),i&=~l}}function _u(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Im(){var e=Ui;return Ui<<=1,!(Ui&4194240)&&(Ui=64),e}function Ea(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ci(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ct(t),e[t]=n}function R1(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 o=31-Ct(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function Vc(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ct(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var le=0;function Lm(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Am,Hc,Dm,zm,$m,Pu=!1,Yi=[],kn=null,Cn=null,bn=null,Jo=new Map,ei=new Map,yn=[],T1="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 Rf(e,t){switch(e){case"focusin":case"focusout":kn=null;break;case"dragenter":case"dragleave":Cn=null;break;case"mouseover":case"mouseout":bn=null;break;case"pointerover":case"pointerout":Jo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ei.delete(t.pointerId)}}function wo(e,t,n,r,o,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},t!==null&&(t=_i(t),t!==null&&Hc(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function I1(e,t,n,r,o){switch(t){case"focusin":return kn=wo(kn,e,t,n,r,o),!0;case"dragenter":return Cn=wo(Cn,e,t,n,r,o),!0;case"mouseover":return bn=wo(bn,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return Jo.set(i,wo(Jo.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,ei.set(i,wo(ei.get(i)||null,e,t,n,r,o)),!0}return!1}function Om(e){var t=Wn(e.target);if(t!==null){var n=hr(t);if(n!==null){if(t=n.tag,t===13){if(t=_m(n),t!==null){e.blockedOn=t,$m(e.priority,function(){Dm(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 Ss(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=ju(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Nu=r,n.target.dispatchEvent(r),Nu=null}else return t=_i(n),t!==null&&Hc(t),e.blockedOn=n,!1;t.shift()}return!0}function Tf(e,t,n){Ss(e)&&n.delete(t)}function L1(){Pu=!1,kn!==null&&Ss(kn)&&(kn=null),Cn!==null&&Ss(Cn)&&(Cn=null),bn!==null&&Ss(bn)&&(bn=null),Jo.forEach(Tf),ei.forEach(Tf)}function So(e,t){e.blockedOn===t&&(e.blockedOn=null,Pu||(Pu=!0,rt.unstable_scheduleCallback(rt.unstable_NormalPriority,L1)))}function ti(e){function t(o){return So(o,e)}if(0<Yi.length){So(Yi[0],e);for(var n=1;n<Yi.length;n++){var r=Yi[n];r.blockedOn===e&&(r.blockedOn=null)}}for(kn!==null&&So(kn,e),Cn!==null&&So(Cn,e),bn!==null&&So(bn,e),Jo.forEach(t),ei.forEach(t),n=0;n<yn.length;n++)r=yn[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<yn.length&&(n=yn[0],n.blockedOn===null);)Om(n),n.blockedOn===null&&yn.shift()}var zr=sn.ReactCurrentBatchConfig,Ws=!0;function A1(e,t,n,r){var o=le,i=zr.transition;zr.transition=null;try{le=1,Uc(e,t,n,r)}finally{le=o,zr.transition=i}}function D1(e,t,n,r){var o=le,i=zr.transition;zr.transition=null;try{le=4,Uc(e,t,n,r)}finally{le=o,zr.transition=i}}function Uc(e,t,n,r){if(Ws){var o=ju(e,t,n,r);if(o===null)Ta(e,t,r,Ys,n),Rf(e,r);else if(I1(o,e,t,n,r))r.stopPropagation();else if(Rf(e,r),t&4&&-1<T1.indexOf(e)){for(;o!==null;){var i=_i(o);if(i!==null&&Am(i),i=ju(e,t,n,r),i===null&&Ta(e,t,r,Ys,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else Ta(e,t,r,null,n)}}var Ys=null;function ju(e,t,n,r){if(Ys=null,e=Fc(r),e=Wn(e),e!==null)if(t=hr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=_m(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 Ys=e,null}function Fm(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(N1()){case Bc:return 1;case Rm:return 4;case Hs:case k1:return 16;case Tm:return 536870912;default:return 16}default:return 16}}var wn=null,Wc=null,Es=null;function Bm(){if(Es)return Es;var e,t=Wc,n=t.length,r,o="value"in wn?wn.value:wn.textContent,i=o.length;for(e=0;e<n&&t[e]===o[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===o[i-r];r++);return Es=o.slice(e,1<r?1-r:void 0)}function Ns(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 Xi(){return!0}function If(){return!1}function lt(e){function t(n,r,o,i,s){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=i,this.target=s,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Xi:If,this.isPropagationStopped=If,this}return we(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=Xi)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Xi)},persist:function(){},isPersistent:Xi}),t}var lo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Yc=lt(lo),bi=we({},lo,{view:0,detail:0}),z1=lt(bi),Na,ka,Eo,jl=we({},bi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Xc,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!==Eo&&(Eo&&e.type==="mousemove"?(Na=e.screenX-Eo.screenX,ka=e.screenY-Eo.screenY):ka=Na=0,Eo=e),Na)},movementY:function(e){return"movementY"in e?e.movementY:ka}}),Lf=lt(jl),$1=we({},jl,{dataTransfer:0}),O1=lt($1),F1=we({},bi,{relatedTarget:0}),Ca=lt(F1),B1=we({},lo,{animationName:0,elapsedTime:0,pseudoElement:0}),V1=lt(B1),H1=we({},lo,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),U1=lt(H1),W1=we({},lo,{data:0}),Af=lt(W1),Y1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},X1={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"},G1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function K1(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=G1[e])?!!t[e]:!1}function Xc(){return K1}var Q1=we({},bi,{key:function(e){if(e.key){var t=Y1[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ns(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?X1[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Xc,charCode:function(e){return e.type==="keypress"?Ns(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ns(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),q1=lt(Q1),Z1=we({},jl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Df=lt(Z1),J1=we({},bi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Xc}),eS=lt(J1),tS=we({},lo,{propertyName:0,elapsedTime:0,pseudoElement:0}),nS=lt(tS),rS=we({},jl,{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}),oS=lt(rS),iS=[9,13,27,32],Gc=en&&"CompositionEvent"in window,Fo=null;en&&"documentMode"in document&&(Fo=document.documentMode);var sS=en&&"TextEvent"in window&&!Fo,Vm=en&&(!Gc||Fo&&8<Fo&&11>=Fo),zf=" ",$f=!1;function Hm(e,t){switch(e){case"keyup":return iS.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Um(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Er=!1;function lS(e,t){switch(e){case"compositionend":return Um(t);case"keypress":return t.which!==32?null:($f=!0,zf);case"textInput":return e=t.data,e===zf&&$f?null:e;default:return null}}function aS(e,t){if(Er)return e==="compositionend"||!Gc&&Hm(e,t)?(e=Bm(),Es=Wc=wn=null,Er=!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 Vm&&t.locale!=="ko"?null:t.data;default:return null}}var uS={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 Of(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!uS[e.type]:t==="textarea"}function Wm(e,t,n,r){Em(r),t=Xs(t,"onChange"),0<t.length&&(n=new Yc("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Bo=null,ni=null;function cS(e){ng(e,0)}function Ml(e){var t=Cr(e);if(mm(t))return e}function dS(e,t){if(e==="change")return t}var Ym=!1;if(en){var ba;if(en){var _a="oninput"in document;if(!_a){var Ff=document.createElement("div");Ff.setAttribute("oninput","return;"),_a=typeof Ff.oninput=="function"}ba=_a}else ba=!1;Ym=ba&&(!document.documentMode||9<document.documentMode)}function Bf(){Bo&&(Bo.detachEvent("onpropertychange",Xm),ni=Bo=null)}function Xm(e){if(e.propertyName==="value"&&Ml(ni)){var t=[];Wm(t,ni,e,Fc(e)),bm(cS,t)}}function fS(e,t,n){e==="focusin"?(Bf(),Bo=t,ni=n,Bo.attachEvent("onpropertychange",Xm)):e==="focusout"&&Bf()}function hS(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ml(ni)}function pS(e,t){if(e==="click")return Ml(t)}function mS(e,t){if(e==="input"||e==="change")return Ml(t)}function gS(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var _t=typeof Object.is=="function"?Object.is:gS;function ri(e,t){if(_t(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!du.call(t,o)||!_t(e[o],t[o]))return!1}return!0}function Vf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Hf(e,t){var n=Vf(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=Vf(n)}}function Gm(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Gm(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Km(){for(var e=window,t=Fs();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Fs(e.document)}return t}function Kc(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 yS(e){var t=Km(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Gm(n.ownerDocument.documentElement,n)){if(r!==null&&Kc(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 o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=Hf(n,i);var s=Hf(n,r);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.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 vS=en&&"documentMode"in document&&11>=document.documentMode,Nr=null,Mu=null,Vo=null,Ru=!1;function Uf(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ru||Nr==null||Nr!==Fs(r)||(r=Nr,"selectionStart"in r&&Kc(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}),Vo&&ri(Vo,r)||(Vo=r,r=Xs(Mu,"onSelect"),0<r.length&&(t=new Yc("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Nr)))}function Gi(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var kr={animationend:Gi("Animation","AnimationEnd"),animationiteration:Gi("Animation","AnimationIteration"),animationstart:Gi("Animation","AnimationStart"),transitionend:Gi("Transition","TransitionEnd")},Pa={},Qm={};en&&(Qm=document.createElement("div").style,"AnimationEvent"in window||(delete kr.animationend.animation,delete kr.animationiteration.animation,delete kr.animationstart.animation),"TransitionEvent"in window||delete kr.transitionend.transition);function Rl(e){if(Pa[e])return Pa[e];if(!kr[e])return e;var t=kr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Qm)return Pa[e]=t[n];return e}var qm=Rl("animationend"),Zm=Rl("animationiteration"),Jm=Rl("animationstart"),eg=Rl("transitionend"),tg=new Map,Wf="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 $n(e,t){tg.set(e,t),fr(t,[e])}for(var ja=0;ja<Wf.length;ja++){var Ma=Wf[ja],xS=Ma.toLowerCase(),wS=Ma[0].toUpperCase()+Ma.slice(1);$n(xS,"on"+wS)}$n(qm,"onAnimationEnd");$n(Zm,"onAnimationIteration");$n(Jm,"onAnimationStart");$n("dblclick","onDoubleClick");$n("focusin","onFocus");$n("focusout","onBlur");$n(eg,"onTransitionEnd");Ur("onMouseEnter",["mouseout","mouseover"]);Ur("onMouseLeave",["mouseout","mouseover"]);Ur("onPointerEnter",["pointerout","pointerover"]);Ur("onPointerLeave",["pointerout","pointerover"]);fr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));fr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));fr("onBeforeInput",["compositionend","keypress","textInput","paste"]);fr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));fr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));fr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ao="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(" "),SS=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ao));function Yf(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,x1(r,t,void 0,e),e.currentTarget=null}function ng(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var s=r.length-1;0<=s;s--){var l=r[s],a=l.instance,u=l.currentTarget;if(l=l.listener,a!==i&&o.isPropagationStopped())break e;Yf(o,l,u),i=a}else for(s=0;s<r.length;s++){if(l=r[s],a=l.instance,u=l.currentTarget,l=l.listener,a!==i&&o.isPropagationStopped())break e;Yf(o,l,u),i=a}}}if(Vs)throw e=bu,Vs=!1,bu=null,e}function fe(e,t){var n=t[Du];n===void 0&&(n=t[Du]=new Set);var r=e+"__bubble";n.has(r)||(rg(t,e,2,!1),n.add(r))}function Ra(e,t,n){var r=0;t&&(r|=4),rg(n,e,r,t)}var Ki="_reactListening"+Math.random().toString(36).slice(2);function oi(e){if(!e[Ki]){e[Ki]=!0,cm.forEach(function(n){n!=="selectionchange"&&(SS.has(n)||Ra(n,!1,e),Ra(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ki]||(t[Ki]=!0,Ra("selectionchange",!1,t))}}function rg(e,t,n,r){switch(Fm(t)){case 1:var o=A1;break;case 4:o=D1;break;default:o=Uc}n=o.bind(null,t,n,e),o=void 0,!Cu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function Ta(e,t,n,r,o){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var l=r.stateNode.containerInfo;if(l===o||l.nodeType===8&&l.parentNode===o)break;if(s===4)for(s=r.return;s!==null;){var a=s.tag;if((a===3||a===4)&&(a=s.stateNode.containerInfo,a===o||a.nodeType===8&&a.parentNode===o))return;s=s.return}for(;l!==null;){if(s=Wn(l),s===null)return;if(a=s.tag,a===5||a===6){r=i=s;continue e}l=l.parentNode}}r=r.return}bm(function(){var u=i,d=Fc(n),c=[];e:{var f=tg.get(e);if(f!==void 0){var y=Yc,x=e;switch(e){case"keypress":if(Ns(n)===0)break e;case"keydown":case"keyup":y=q1;break;case"focusin":x="focus",y=Ca;break;case"focusout":x="blur",y=Ca;break;case"beforeblur":case"afterblur":y=Ca;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":y=Lf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":y=O1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":y=eS;break;case qm:case Zm:case Jm:y=V1;break;case eg:y=nS;break;case"scroll":y=z1;break;case"wheel":y=oS;break;case"copy":case"cut":case"paste":y=U1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":y=Df}var w=(t&4)!==0,S=!w&&e==="scroll",p=w?f!==null?f+"Capture":null:f;w=[];for(var g=u,m;g!==null;){m=g;var E=m.stateNode;if(m.tag===5&&E!==null&&(m=E,p!==null&&(E=Zo(g,p),E!=null&&w.push(ii(g,E,m)))),S)break;g=g.return}0<w.length&&(f=new y(f,x,null,n,d),c.push({event:f,listeners:w}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",y=e==="mouseout"||e==="pointerout",f&&n!==Nu&&(x=n.relatedTarget||n.fromElement)&&(Wn(x)||x[tn]))break e;if((y||f)&&(f=d.window===d?d:(f=d.ownerDocument)?f.defaultView||f.parentWindow:window,y?(x=n.relatedTarget||n.toElement,y=u,x=x?Wn(x):null,x!==null&&(S=hr(x),x!==S||x.tag!==5&&x.tag!==6)&&(x=null)):(y=null,x=u),y!==x)){if(w=Lf,E="onMouseLeave",p="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(w=Df,E="onPointerLeave",p="onPointerEnter",g="pointer"),S=y==null?f:Cr(y),m=x==null?f:Cr(x),f=new w(E,g+"leave",y,n,d),f.target=S,f.relatedTarget=m,E=null,Wn(d)===u&&(w=new w(p,g+"enter",x,n,d),w.target=m,w.relatedTarget=S,E=w),S=E,y&&x)t:{for(w=y,p=x,g=0,m=w;m;m=mr(m))g++;for(m=0,E=p;E;E=mr(E))m++;for(;0<g-m;)w=mr(w),g--;for(;0<m-g;)p=mr(p),m--;for(;g--;){if(w===p||p!==null&&w===p.alternate)break t;w=mr(w),p=mr(p)}w=null}else w=null;y!==null&&Xf(c,f,y,w,!1),x!==null&&S!==null&&Xf(c,S,x,w,!0)}}e:{if(f=u?Cr(u):window,y=f.nodeName&&f.nodeName.toLowerCase(),y==="select"||y==="input"&&f.type==="file")var N=dS;else if(Of(f))if(Ym)N=mS;else{N=hS;var C=fS}else(y=f.nodeName)&&y.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(N=pS);if(N&&(N=N(e,u))){Wm(c,N,n,d);break e}C&&C(e,f,u),e==="focusout"&&(C=f._wrapperState)&&C.controlled&&f.type==="number"&&vu(f,"number",f.value)}switch(C=u?Cr(u):window,e){case"focusin":(Of(C)||C.contentEditable==="true")&&(Nr=C,Mu=u,Vo=null);break;case"focusout":Vo=Mu=Nr=null;break;case"mousedown":Ru=!0;break;case"contextmenu":case"mouseup":case"dragend":Ru=!1,Uf(c,n,d);break;case"selectionchange":if(vS)break;case"keydown":case"keyup":Uf(c,n,d)}var k;if(Gc)e:{switch(e){case"compositionstart":var P="onCompositionStart";break e;case"compositionend":P="onCompositionEnd";break e;case"compositionupdate":P="onCompositionUpdate";break e}P=void 0}else Er?Hm(e,n)&&(P="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(P="onCompositionStart");P&&(Vm&&n.locale!=="ko"&&(Er||P!=="onCompositionStart"?P==="onCompositionEnd"&&Er&&(k=Bm()):(wn=d,Wc="value"in wn?wn.value:wn.textContent,Er=!0)),C=Xs(u,P),0<C.length&&(P=new Af(P,e,null,n,d),c.push({event:P,listeners:C}),k?P.data=k:(k=Um(n),k!==null&&(P.data=k)))),(k=sS?lS(e,n):aS(e,n))&&(u=Xs(u,"onBeforeInput"),0<u.length&&(d=new Af("onBeforeInput","beforeinput",null,n,d),c.push({event:d,listeners:u}),d.data=k))}ng(c,t)})}function ii(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Xs(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=Zo(e,n),i!=null&&r.unshift(ii(e,i,o)),i=Zo(e,t),i!=null&&r.push(ii(e,i,o))),e=e.return}return r}function mr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Xf(e,t,n,r,o){for(var i=t._reactName,s=[];n!==null&&n!==r;){var l=n,a=l.alternate,u=l.stateNode;if(a!==null&&a===r)break;l.tag===5&&u!==null&&(l=u,o?(a=Zo(n,i),a!=null&&s.unshift(ii(n,a,l))):o||(a=Zo(n,i),a!=null&&s.push(ii(n,a,l)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var ES=/\r\n?/g,NS=/\u0000|\uFFFD/g;function Gf(e){return(typeof e=="string"?e:""+e).replace(ES,`
38
- `).replace(NS,"")}function Qi(e,t,n){if(t=Gf(t),Gf(e)!==t&&n)throw Error(B(425))}function Gs(){}var Tu=null,Iu=null;function Lu(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 Au=typeof setTimeout=="function"?setTimeout:void 0,kS=typeof clearTimeout=="function"?clearTimeout:void 0,Kf=typeof Promise=="function"?Promise:void 0,CS=typeof queueMicrotask=="function"?queueMicrotask:typeof Kf<"u"?function(e){return Kf.resolve(null).then(e).catch(bS)}:Au;function bS(e){setTimeout(function(){throw e})}function Ia(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),ti(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);ti(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 Qf(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 ao=Math.random().toString(36).slice(2),At="__reactFiber$"+ao,si="__reactProps$"+ao,tn="__reactContainer$"+ao,Du="__reactEvents$"+ao,_S="__reactListeners$"+ao,PS="__reactHandles$"+ao;function Wn(e){var t=e[At];if(t)return t;for(var n=e.parentNode;n;){if(t=n[tn]||n[At]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Qf(e);e!==null;){if(n=e[At])return n;e=Qf(e)}return t}e=n,n=e.parentNode}return null}function _i(e){return e=e[At]||e[tn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Cr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(B(33))}function Tl(e){return e[si]||null}var zu=[],br=-1;function On(e){return{current:e}}function he(e){0>br||(e.current=zu[br],zu[br]=null,br--)}function ue(e,t){br++,zu[br]=e.current,e.current=t}var Ln={},Fe=On(Ln),Ke=On(!1),nr=Ln;function Wr(e,t){var n=e.type.contextTypes;if(!n)return Ln;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Qe(e){return e=e.childContextTypes,e!=null}function Ks(){he(Ke),he(Fe)}function qf(e,t,n){if(Fe.current!==Ln)throw Error(B(168));ue(Fe,t),ue(Ke,n)}function og(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(B(108,f1(e)||"Unknown",o));return we({},n,r)}function Qs(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ln,nr=Fe.current,ue(Fe,e),ue(Ke,Ke.current),!0}function Zf(e,t,n){var r=e.stateNode;if(!r)throw Error(B(169));n?(e=og(e,t,nr),r.__reactInternalMemoizedMergedChildContext=e,he(Ke),he(Fe),ue(Fe,e)):he(Ke),ue(Ke,n)}var Gt=null,Il=!1,La=!1;function ig(e){Gt===null?Gt=[e]:Gt.push(e)}function jS(e){Il=!0,ig(e)}function Fn(){if(!La&&Gt!==null){La=!0;var e=0,t=le;try{var n=Gt;for(le=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Gt=null,Il=!1}catch(o){throw Gt!==null&&(Gt=Gt.slice(e+1)),Mm(Bc,Fn),o}finally{le=t,La=!1}}return null}var _r=[],Pr=0,qs=null,Zs=0,at=[],ut=0,rr=null,Kt=1,Qt="";function Vn(e,t){_r[Pr++]=Zs,_r[Pr++]=qs,qs=e,Zs=t}function sg(e,t,n){at[ut++]=Kt,at[ut++]=Qt,at[ut++]=rr,rr=e;var r=Kt;e=Qt;var o=32-Ct(r)-1;r&=~(1<<o),n+=1;var i=32-Ct(t)+o;if(30<i){var s=o-o%5;i=(r&(1<<s)-1).toString(32),r>>=s,o-=s,Kt=1<<32-Ct(t)+o|n<<o|r,Qt=i+e}else Kt=1<<i|n<<o|r,Qt=e}function Qc(e){e.return!==null&&(Vn(e,1),sg(e,1,0))}function qc(e){for(;e===qs;)qs=_r[--Pr],_r[Pr]=null,Zs=_r[--Pr],_r[Pr]=null;for(;e===rr;)rr=at[--ut],at[ut]=null,Qt=at[--ut],at[ut]=null,Kt=at[--ut],at[ut]=null}var nt=null,tt=null,pe=!1,St=null;function lg(e,t){var n=ct(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 Jf(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,nt=e,tt=_n(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,nt=e,tt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=rr!==null?{id:Kt,overflow:Qt}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=ct(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,nt=e,tt=null,!0):!1;default:return!1}}function $u(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Ou(e){if(pe){var t=tt;if(t){var n=t;if(!Jf(e,t)){if($u(e))throw Error(B(418));t=_n(n.nextSibling);var r=nt;t&&Jf(e,t)?lg(r,n):(e.flags=e.flags&-4097|2,pe=!1,nt=e)}}else{if($u(e))throw Error(B(418));e.flags=e.flags&-4097|2,pe=!1,nt=e}}}function eh(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;nt=e}function qi(e){if(e!==nt)return!1;if(!pe)return eh(e),pe=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Lu(e.type,e.memoizedProps)),t&&(t=tt)){if($u(e))throw ag(),Error(B(418));for(;t;)lg(e,t),t=_n(t.nextSibling)}if(eh(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(B(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){tt=_n(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}tt=null}}else tt=nt?_n(e.stateNode.nextSibling):null;return!0}function ag(){for(var e=tt;e;)e=_n(e.nextSibling)}function Yr(){tt=nt=null,pe=!1}function Zc(e){St===null?St=[e]:St.push(e)}var MS=sn.ReactCurrentBatchConfig;function No(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(B(309));var r=n.stateNode}if(!r)throw Error(B(147,e));var o=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(s){var l=o.refs;s===null?delete l[i]:l[i]=s},t._stringRef=i,t)}if(typeof e!="string")throw Error(B(284));if(!n._owner)throw Error(B(290,e))}return e}function Zi(e,t){throw e=Object.prototype.toString.call(t),Error(B(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function th(e){var t=e._init;return t(e._payload)}function ug(e){function t(p,g){if(e){var m=p.deletions;m===null?(p.deletions=[g],p.flags|=16):m.push(g)}}function n(p,g){if(!e)return null;for(;g!==null;)t(p,g),g=g.sibling;return null}function r(p,g){for(p=new Map;g!==null;)g.key!==null?p.set(g.key,g):p.set(g.index,g),g=g.sibling;return p}function o(p,g){return p=Rn(p,g),p.index=0,p.sibling=null,p}function i(p,g,m){return p.index=m,e?(m=p.alternate,m!==null?(m=m.index,m<g?(p.flags|=2,g):m):(p.flags|=2,g)):(p.flags|=1048576,g)}function s(p){return e&&p.alternate===null&&(p.flags|=2),p}function l(p,g,m,E){return g===null||g.tag!==6?(g=Ba(m,p.mode,E),g.return=p,g):(g=o(g,m),g.return=p,g)}function a(p,g,m,E){var N=m.type;return N===Sr?d(p,g,m.props.children,E,m.key):g!==null&&(g.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===mn&&th(N)===g.type)?(E=o(g,m.props),E.ref=No(p,g,m),E.return=p,E):(E=Ms(m.type,m.key,m.props,null,p.mode,E),E.ref=No(p,g,m),E.return=p,E)}function u(p,g,m,E){return g===null||g.tag!==4||g.stateNode.containerInfo!==m.containerInfo||g.stateNode.implementation!==m.implementation?(g=Va(m,p.mode,E),g.return=p,g):(g=o(g,m.children||[]),g.return=p,g)}function d(p,g,m,E,N){return g===null||g.tag!==7?(g=Jn(m,p.mode,E,N),g.return=p,g):(g=o(g,m),g.return=p,g)}function c(p,g,m){if(typeof g=="string"&&g!==""||typeof g=="number")return g=Ba(""+g,p.mode,m),g.return=p,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case Bi:return m=Ms(g.type,g.key,g.props,null,p.mode,m),m.ref=No(p,null,g),m.return=p,m;case wr:return g=Va(g,p.mode,m),g.return=p,g;case mn:var E=g._init;return c(p,E(g._payload),m)}if(Io(g)||vo(g))return g=Jn(g,p.mode,m,null),g.return=p,g;Zi(p,g)}return null}function f(p,g,m,E){var N=g!==null?g.key:null;if(typeof m=="string"&&m!==""||typeof m=="number")return N!==null?null:l(p,g,""+m,E);if(typeof m=="object"&&m!==null){switch(m.$$typeof){case Bi:return m.key===N?a(p,g,m,E):null;case wr:return m.key===N?u(p,g,m,E):null;case mn:return N=m._init,f(p,g,N(m._payload),E)}if(Io(m)||vo(m))return N!==null?null:d(p,g,m,E,null);Zi(p,m)}return null}function y(p,g,m,E,N){if(typeof E=="string"&&E!==""||typeof E=="number")return p=p.get(m)||null,l(g,p,""+E,N);if(typeof E=="object"&&E!==null){switch(E.$$typeof){case Bi:return p=p.get(E.key===null?m:E.key)||null,a(g,p,E,N);case wr:return p=p.get(E.key===null?m:E.key)||null,u(g,p,E,N);case mn:var C=E._init;return y(p,g,m,C(E._payload),N)}if(Io(E)||vo(E))return p=p.get(m)||null,d(g,p,E,N,null);Zi(g,E)}return null}function x(p,g,m,E){for(var N=null,C=null,k=g,P=g=0,R=null;k!==null&&P<m.length;P++){k.index>P?(R=k,k=null):R=k.sibling;var z=f(p,k,m[P],E);if(z===null){k===null&&(k=R);break}e&&k&&z.alternate===null&&t(p,k),g=i(z,g,P),C===null?N=z:C.sibling=z,C=z,k=R}if(P===m.length)return n(p,k),pe&&Vn(p,P),N;if(k===null){for(;P<m.length;P++)k=c(p,m[P],E),k!==null&&(g=i(k,g,P),C===null?N=k:C.sibling=k,C=k);return pe&&Vn(p,P),N}for(k=r(p,k);P<m.length;P++)R=y(k,p,P,m[P],E),R!==null&&(e&&R.alternate!==null&&k.delete(R.key===null?P:R.key),g=i(R,g,P),C===null?N=R:C.sibling=R,C=R);return e&&k.forEach(function(I){return t(p,I)}),pe&&Vn(p,P),N}function w(p,g,m,E){var N=vo(m);if(typeof N!="function")throw Error(B(150));if(m=N.call(m),m==null)throw Error(B(151));for(var C=N=null,k=g,P=g=0,R=null,z=m.next();k!==null&&!z.done;P++,z=m.next()){k.index>P?(R=k,k=null):R=k.sibling;var I=f(p,k,z.value,E);if(I===null){k===null&&(k=R);break}e&&k&&I.alternate===null&&t(p,k),g=i(I,g,P),C===null?N=I:C.sibling=I,C=I,k=R}if(z.done)return n(p,k),pe&&Vn(p,P),N;if(k===null){for(;!z.done;P++,z=m.next())z=c(p,z.value,E),z!==null&&(g=i(z,g,P),C===null?N=z:C.sibling=z,C=z);return pe&&Vn(p,P),N}for(k=r(p,k);!z.done;P++,z=m.next())z=y(k,p,P,z.value,E),z!==null&&(e&&z.alternate!==null&&k.delete(z.key===null?P:z.key),g=i(z,g,P),C===null?N=z:C.sibling=z,C=z);return e&&k.forEach(function(T){return t(p,T)}),pe&&Vn(p,P),N}function S(p,g,m,E){if(typeof m=="object"&&m!==null&&m.type===Sr&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case Bi:e:{for(var N=m.key,C=g;C!==null;){if(C.key===N){if(N=m.type,N===Sr){if(C.tag===7){n(p,C.sibling),g=o(C,m.props.children),g.return=p,p=g;break e}}else if(C.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===mn&&th(N)===C.type){n(p,C.sibling),g=o(C,m.props),g.ref=No(p,C,m),g.return=p,p=g;break e}n(p,C);break}else t(p,C);C=C.sibling}m.type===Sr?(g=Jn(m.props.children,p.mode,E,m.key),g.return=p,p=g):(E=Ms(m.type,m.key,m.props,null,p.mode,E),E.ref=No(p,g,m),E.return=p,p=E)}return s(p);case wr:e:{for(C=m.key;g!==null;){if(g.key===C)if(g.tag===4&&g.stateNode.containerInfo===m.containerInfo&&g.stateNode.implementation===m.implementation){n(p,g.sibling),g=o(g,m.children||[]),g.return=p,p=g;break e}else{n(p,g);break}else t(p,g);g=g.sibling}g=Va(m,p.mode,E),g.return=p,p=g}return s(p);case mn:return C=m._init,S(p,g,C(m._payload),E)}if(Io(m))return x(p,g,m,E);if(vo(m))return w(p,g,m,E);Zi(p,m)}return typeof m=="string"&&m!==""||typeof m=="number"?(m=""+m,g!==null&&g.tag===6?(n(p,g.sibling),g=o(g,m),g.return=p,p=g):(n(p,g),g=Ba(m,p.mode,E),g.return=p,p=g),s(p)):n(p,g)}return S}var Xr=ug(!0),cg=ug(!1),Js=On(null),el=null,jr=null,Jc=null;function ed(){Jc=jr=el=null}function td(e){var t=Js.current;he(Js),e._currentValue=t}function Fu(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 $r(e,t){el=e,Jc=jr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Xe=!0),e.firstContext=null)}function ft(e){var t=e._currentValue;if(Jc!==e)if(e={context:e,memoizedValue:t,next:null},jr===null){if(el===null)throw Error(B(308));jr=e,el.dependencies={lanes:0,firstContext:e}}else jr=jr.next=e;return t}var Yn=null;function nd(e){Yn===null?Yn=[e]:Yn.push(e)}function dg(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,nd(t)):(n.next=o.next,o.next=n),t.interleaved=n,nn(e,r)}function nn(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 gn=!1;function rd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function fg(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 Zt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Pn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,oe&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,nn(e,n)}return o=r.interleaved,o===null?(t.next=t,nd(r)):(t.next=o.next,o.next=t),r.interleaved=t,nn(e,n)}function ks(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,Vc(e,n)}}function nh(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,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 tl(e,t,n,r){var o=e.updateQueue;gn=!1;var i=o.firstBaseUpdate,s=o.lastBaseUpdate,l=o.shared.pending;if(l!==null){o.shared.pending=null;var a=l,u=a.next;a.next=null,s===null?i=u:s.next=u,s=a;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==s&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=a))}if(i!==null){var c=o.baseState;s=0,d=u=a=null,l=i;do{var f=l.lane,y=l.eventTime;if((r&f)===f){d!==null&&(d=d.next={eventTime:y,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var x=e,w=l;switch(f=t,y=n,w.tag){case 1:if(x=w.payload,typeof x=="function"){c=x.call(y,c,f);break e}c=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=w.payload,f=typeof x=="function"?x.call(y,c,f):x,f==null)break e;c=we({},c,f);break e;case 2:gn=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,f=o.effects,f===null?o.effects=[l]:f.push(l))}else y={eventTime:y,lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=y,a=c):d=d.next=y,s|=f;if(l=l.next,l===null){if(l=o.shared.pending,l===null)break;f=l,l=f.next,f.next=null,o.lastBaseUpdate=f,o.shared.pending=null}}while(!0);if(d===null&&(a=c),o.baseState=a,o.firstBaseUpdate=u,o.lastBaseUpdate=d,t=o.shared.interleaved,t!==null){o=t;do s|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);ir|=s,e.lanes=s,e.memoizedState=c}}function rh(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(B(191,o));o.call(r)}}}var Pi={},$t=On(Pi),li=On(Pi),ai=On(Pi);function Xn(e){if(e===Pi)throw Error(B(174));return e}function od(e,t){switch(ue(ai,t),ue(li,e),ue($t,Pi),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:wu(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=wu(t,e)}he($t),ue($t,t)}function Gr(){he($t),he(li),he(ai)}function hg(e){Xn(ai.current);var t=Xn($t.current),n=wu(t,e.type);t!==n&&(ue(li,e),ue($t,n))}function id(e){li.current===e&&(he($t),he(li))}var ve=On(0);function nl(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 Aa=[];function sd(){for(var e=0;e<Aa.length;e++)Aa[e]._workInProgressVersionPrimary=null;Aa.length=0}var Cs=sn.ReactCurrentDispatcher,Da=sn.ReactCurrentBatchConfig,or=0,xe=null,_e=null,je=null,rl=!1,Ho=!1,ui=0,RS=0;function ze(){throw Error(B(321))}function ld(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!_t(e[n],t[n]))return!1;return!0}function ad(e,t,n,r,o,i){if(or=i,xe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Cs.current=e===null||e.memoizedState===null?AS:DS,e=n(r,o),Ho){i=0;do{if(Ho=!1,ui=0,25<=i)throw Error(B(301));i+=1,je=_e=null,t.updateQueue=null,Cs.current=zS,e=n(r,o)}while(Ho)}if(Cs.current=ol,t=_e!==null&&_e.next!==null,or=0,je=_e=xe=null,rl=!1,t)throw Error(B(300));return e}function ud(){var e=ui!==0;return ui=0,e}function Tt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return je===null?xe.memoizedState=je=e:je=je.next=e,je}function ht(){if(_e===null){var e=xe.alternate;e=e!==null?e.memoizedState:null}else e=_e.next;var t=je===null?xe.memoizedState:je.next;if(t!==null)je=t,_e=e;else{if(e===null)throw Error(B(310));_e=e,e={memoizedState:_e.memoizedState,baseState:_e.baseState,baseQueue:_e.baseQueue,queue:_e.queue,next:null},je===null?xe.memoizedState=je=e:je=je.next=e}return je}function ci(e,t){return typeof t=="function"?t(e):t}function za(e){var t=ht(),n=t.queue;if(n===null)throw Error(B(311));n.lastRenderedReducer=e;var r=_e,o=r.baseQueue,i=n.pending;if(i!==null){if(o!==null){var s=o.next;o.next=i.next,i.next=s}r.baseQueue=o=i,n.pending=null}if(o!==null){i=o.next,r=r.baseState;var l=s=null,a=null,u=i;do{var d=u.lane;if((or&d)===d)a!==null&&(a=a.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var c={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};a===null?(l=a=c,s=r):a=a.next=c,xe.lanes|=d,ir|=d}u=u.next}while(u!==null&&u!==i);a===null?s=r:a.next=l,_t(r,t.memoizedState)||(Xe=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=a,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do i=o.lane,xe.lanes|=i,ir|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function $a(e){var t=ht(),n=t.queue;if(n===null)throw Error(B(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(o!==null){n.pending=null;var s=o=o.next;do i=e(i,s.action),s=s.next;while(s!==o);_t(i,t.memoizedState)||(Xe=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function pg(){}function mg(e,t){var n=xe,r=ht(),o=t(),i=!_t(r.memoizedState,o);if(i&&(r.memoizedState=o,Xe=!0),r=r.queue,cd(vg.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||je!==null&&je.memoizedState.tag&1){if(n.flags|=2048,di(9,yg.bind(null,n,r,o,t),void 0,null),Re===null)throw Error(B(349));or&30||gg(n,t,o)}return o}function gg(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=xe.updateQueue,t===null?(t={lastEffect:null,stores:null},xe.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function yg(e,t,n,r){t.value=n,t.getSnapshot=r,xg(t)&&wg(e)}function vg(e,t,n){return n(function(){xg(t)&&wg(e)})}function xg(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!_t(e,n)}catch{return!0}}function wg(e){var t=nn(e,1);t!==null&&bt(t,e,1,-1)}function oh(e){var t=Tt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ci,lastRenderedState:e},t.queue=e,e=e.dispatch=LS.bind(null,xe,e),[t.memoizedState,e]}function di(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=xe.updateQueue,t===null?(t={lastEffect:null,stores:null},xe.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 Sg(){return ht().memoizedState}function bs(e,t,n,r){var o=Tt();xe.flags|=e,o.memoizedState=di(1|t,n,void 0,r===void 0?null:r)}function Ll(e,t,n,r){var o=ht();r=r===void 0?null:r;var i=void 0;if(_e!==null){var s=_e.memoizedState;if(i=s.destroy,r!==null&&ld(r,s.deps)){o.memoizedState=di(t,n,i,r);return}}xe.flags|=e,o.memoizedState=di(1|t,n,i,r)}function ih(e,t){return bs(8390656,8,e,t)}function cd(e,t){return Ll(2048,8,e,t)}function Eg(e,t){return Ll(4,2,e,t)}function Ng(e,t){return Ll(4,4,e,t)}function kg(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 Cg(e,t,n){return n=n!=null?n.concat([e]):null,Ll(4,4,kg.bind(null,t,e),n)}function dd(){}function bg(e,t){var n=ht();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&ld(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function _g(e,t){var n=ht();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&ld(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Pg(e,t,n){return or&21?(_t(n,t)||(n=Im(),xe.lanes|=n,ir|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Xe=!0),e.memoizedState=n)}function TS(e,t){var n=le;le=n!==0&&4>n?n:4,e(!0);var r=Da.transition;Da.transition={};try{e(!1),t()}finally{le=n,Da.transition=r}}function jg(){return ht().memoizedState}function IS(e,t,n){var r=Mn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Mg(e))Rg(t,n);else if(n=dg(e,t,n,r),n!==null){var o=Ve();bt(n,e,r,o),Tg(n,t,r)}}function LS(e,t,n){var r=Mn(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Mg(e))Rg(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,l=i(s,n);if(o.hasEagerState=!0,o.eagerState=l,_t(l,s)){var a=t.interleaved;a===null?(o.next=o,nd(t)):(o.next=a.next,a.next=o),t.interleaved=o;return}}catch{}finally{}n=dg(e,t,o,r),n!==null&&(o=Ve(),bt(n,e,r,o),Tg(n,t,r))}}function Mg(e){var t=e.alternate;return e===xe||t!==null&&t===xe}function Rg(e,t){Ho=rl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Tg(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Vc(e,n)}}var ol={readContext:ft,useCallback:ze,useContext:ze,useEffect:ze,useImperativeHandle:ze,useInsertionEffect:ze,useLayoutEffect:ze,useMemo:ze,useReducer:ze,useRef:ze,useState:ze,useDebugValue:ze,useDeferredValue:ze,useTransition:ze,useMutableSource:ze,useSyncExternalStore:ze,useId:ze,unstable_isNewReconciler:!1},AS={readContext:ft,useCallback:function(e,t){return Tt().memoizedState=[e,t===void 0?null:t],e},useContext:ft,useEffect:ih,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,bs(4194308,4,kg.bind(null,t,e),n)},useLayoutEffect:function(e,t){return bs(4194308,4,e,t)},useInsertionEffect:function(e,t){return bs(4,2,e,t)},useMemo:function(e,t){var n=Tt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Tt();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=IS.bind(null,xe,e),[r.memoizedState,e]},useRef:function(e){var t=Tt();return e={current:e},t.memoizedState=e},useState:oh,useDebugValue:dd,useDeferredValue:function(e){return Tt().memoizedState=e},useTransition:function(){var e=oh(!1),t=e[0];return e=TS.bind(null,e[1]),Tt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=xe,o=Tt();if(pe){if(n===void 0)throw Error(B(407));n=n()}else{if(n=t(),Re===null)throw Error(B(349));or&30||gg(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,ih(vg.bind(null,r,i,e),[e]),r.flags|=2048,di(9,yg.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Tt(),t=Re.identifierPrefix;if(pe){var n=Qt,r=Kt;n=(r&~(1<<32-Ct(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ui++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=RS++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},DS={readContext:ft,useCallback:bg,useContext:ft,useEffect:cd,useImperativeHandle:Cg,useInsertionEffect:Eg,useLayoutEffect:Ng,useMemo:_g,useReducer:za,useRef:Sg,useState:function(){return za(ci)},useDebugValue:dd,useDeferredValue:function(e){var t=ht();return Pg(t,_e.memoizedState,e)},useTransition:function(){var e=za(ci)[0],t=ht().memoizedState;return[e,t]},useMutableSource:pg,useSyncExternalStore:mg,useId:jg,unstable_isNewReconciler:!1},zS={readContext:ft,useCallback:bg,useContext:ft,useEffect:cd,useImperativeHandle:Cg,useInsertionEffect:Eg,useLayoutEffect:Ng,useMemo:_g,useReducer:$a,useRef:Sg,useState:function(){return $a(ci)},useDebugValue:dd,useDeferredValue:function(e){var t=ht();return _e===null?t.memoizedState=e:Pg(t,_e.memoizedState,e)},useTransition:function(){var e=$a(ci)[0],t=ht().memoizedState;return[e,t]},useMutableSource:pg,useSyncExternalStore:mg,useId:jg,unstable_isNewReconciler:!1};function vt(e,t){if(e&&e.defaultProps){t=we({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Bu(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:we({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Al={isMounted:function(e){return(e=e._reactInternals)?hr(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ve(),o=Mn(e),i=Zt(r,o);i.payload=t,n!=null&&(i.callback=n),t=Pn(e,i,o),t!==null&&(bt(t,e,o,r),ks(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ve(),o=Mn(e),i=Zt(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Pn(e,i,o),t!==null&&(bt(t,e,o,r),ks(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ve(),r=Mn(e),o=Zt(n,r);o.tag=2,t!=null&&(o.callback=t),t=Pn(e,o,r),t!==null&&(bt(t,e,r,n),ks(t,e,r))}};function sh(e,t,n,r,o,i,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,s):t.prototype&&t.prototype.isPureReactComponent?!ri(n,r)||!ri(o,i):!0}function Ig(e,t,n){var r=!1,o=Ln,i=t.contextType;return typeof i=="object"&&i!==null?i=ft(i):(o=Qe(t)?nr:Fe.current,r=t.contextTypes,i=(r=r!=null)?Wr(e,o):Ln),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Al,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function lh(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&&Al.enqueueReplaceState(t,t.state,null)}function Vu(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},rd(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=ft(i):(i=Qe(t)?nr:Fe.current,o.context=Wr(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Bu(e,t,i,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&Al.enqueueReplaceState(o,o.state,null),tl(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function Kr(e,t){try{var n="",r=t;do n+=d1(r),r=r.return;while(r);var o=n}catch(i){o=`
39
- Error generating stack: `+i.message+`
40
- `+i.stack}return{value:e,source:t,stack:o,digest:null}}function Oa(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Hu(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var $S=typeof WeakMap=="function"?WeakMap:Map;function Lg(e,t,n){n=Zt(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){sl||(sl=!0,Ju=r),Hu(e,t)},n}function Ag(e,t,n){n=Zt(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){Hu(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Hu(e,t),typeof r!="function"&&(jn===null?jn=new Set([this]):jn.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function ah(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new $S;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=ZS.bind(null,e,t,n),t.then(e,e))}function uh(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 ch(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,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=Zt(-1,1),t.tag=2,Pn(n,t,1))),n.lanes|=1),e)}var OS=sn.ReactCurrentOwner,Xe=!1;function Be(e,t,n,r){t.child=e===null?cg(t,null,n,r):Xr(t,e.child,n,r)}function dh(e,t,n,r,o){n=n.render;var i=t.ref;return $r(t,o),r=ad(e,t,n,r,i,o),n=ud(),e!==null&&!Xe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,rn(e,t,o)):(pe&&n&&Qc(t),t.flags|=1,Be(e,t,r,o),t.child)}function fh(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!xd(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,Dg(e,t,i,r,o)):(e=Ms(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&o)){var s=i.memoizedProps;if(n=n.compare,n=n!==null?n:ri,n(s,r)&&e.ref===t.ref)return rn(e,t,o)}return t.flags|=1,e=Rn(i,r),e.ref=t.ref,e.return=t,t.child=e}function Dg(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(ri(i,r)&&e.ref===t.ref)if(Xe=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(Xe=!0);else return t.lanes=e.lanes,rn(e,t,o)}return Uu(e,t,n,r,o)}function zg(e,t,n){var r=t.pendingProps,o=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ue(Rr,Je),Je|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ue(Rr,Je),Je|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,ue(Rr,Je),Je|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,ue(Rr,Je),Je|=r;return Be(e,t,o,n),t.child}function $g(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Uu(e,t,n,r,o){var i=Qe(n)?nr:Fe.current;return i=Wr(t,i),$r(t,o),n=ad(e,t,n,r,i,o),r=ud(),e!==null&&!Xe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,rn(e,t,o)):(pe&&r&&Qc(t),t.flags|=1,Be(e,t,n,o),t.child)}function hh(e,t,n,r,o){if(Qe(n)){var i=!0;Qs(t)}else i=!1;if($r(t,o),t.stateNode===null)_s(e,t),Ig(t,n,r),Vu(t,n,r,o),r=!0;else if(e===null){var s=t.stateNode,l=t.memoizedProps;s.props=l;var a=s.context,u=n.contextType;typeof u=="object"&&u!==null?u=ft(u):(u=Qe(n)?nr:Fe.current,u=Wr(t,u));var d=n.getDerivedStateFromProps,c=typeof d=="function"||typeof s.getSnapshotBeforeUpdate=="function";c||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==r||a!==u)&&lh(t,s,r,u),gn=!1;var f=t.memoizedState;s.state=f,tl(t,r,s,o),a=t.memoizedState,l!==r||f!==a||Ke.current||gn?(typeof d=="function"&&(Bu(t,n,d,r),a=t.memoizedState),(l=gn||sh(t,n,l,r,f,a,u))?(c||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=a),s.props=r,s.state=a,s.context=u,r=l):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,fg(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:vt(t.type,l),s.props=u,c=t.pendingProps,f=s.context,a=n.contextType,typeof a=="object"&&a!==null?a=ft(a):(a=Qe(n)?nr:Fe.current,a=Wr(t,a));var y=n.getDerivedStateFromProps;(d=typeof y=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==c||f!==a)&&lh(t,s,r,a),gn=!1,f=t.memoizedState,s.state=f,tl(t,r,s,o);var x=t.memoizedState;l!==c||f!==x||Ke.current||gn?(typeof y=="function"&&(Bu(t,n,y,r),x=t.memoizedState),(u=gn||sh(t,n,u,r,f,x,a)||!1)?(d||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,x,a),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,x,a)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=x),s.props=r,s.state=x,s.context=a,r=u):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Wu(e,t,n,r,i,o)}function Wu(e,t,n,r,o,i){$g(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&Zf(t,n,!1),rn(e,t,i);r=t.stateNode,OS.current=t;var l=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=Xr(t,e.child,null,i),t.child=Xr(t,null,l,i)):Be(e,t,l,i),t.memoizedState=r.state,o&&Zf(t,n,!0),t.child}function Og(e){var t=e.stateNode;t.pendingContext?qf(e,t.pendingContext,t.pendingContext!==t.context):t.context&&qf(e,t.context,!1),od(e,t.containerInfo)}function ph(e,t,n,r,o){return Yr(),Zc(o),t.flags|=256,Be(e,t,n,r),t.child}var Yu={dehydrated:null,treeContext:null,retryLane:0};function Xu(e){return{baseLanes:e,cachePool:null,transitions:null}}function Fg(e,t,n){var r=t.pendingProps,o=ve.current,i=!1,s=(t.flags&128)!==0,l;if((l=s)||(l=e!==null&&e.memoizedState===null?!1:(o&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),ue(ve,o&1),e===null)return Ou(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):(s=r.children,e=r.fallback,i?(r=t.mode,i=t.child,s={mode:"hidden",children:s},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=s):i=$l(s,r,0,null),e=Jn(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Xu(n),t.memoizedState=Yu,e):fd(t,s));if(o=e.memoizedState,o!==null&&(l=o.dehydrated,l!==null))return FS(e,t,s,r,l,o,n);if(i){i=r.fallback,s=t.mode,o=e.child,l=o.sibling;var a={mode:"hidden",children:r.children};return!(s&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=a,t.deletions=null):(r=Rn(o,a),r.subtreeFlags=o.subtreeFlags&14680064),l!==null?i=Rn(l,i):(i=Jn(i,s,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,s=e.child.memoizedState,s=s===null?Xu(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~n,t.memoizedState=Yu,r}return i=e.child,e=i.sibling,r=Rn(i,{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 fd(e,t){return t=$l({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Ji(e,t,n,r){return r!==null&&Zc(r),Xr(t,e.child,null,n),e=fd(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function FS(e,t,n,r,o,i,s){if(n)return t.flags&256?(t.flags&=-257,r=Oa(Error(B(422))),Ji(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=$l({mode:"visible",children:r.children},o,0,null),i=Jn(i,o,s,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&Xr(t,e.child,null,s),t.child.memoizedState=Xu(s),t.memoizedState=Yu,i);if(!(t.mode&1))return Ji(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,i=Error(B(419)),r=Oa(i,r,void 0),Ji(e,t,s,r)}if(l=(s&e.childLanes)!==0,Xe||l){if(r=Re,r!==null){switch(s&-s){case 4:o=2;break;case 16:o=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:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(r.suspendedLanes|s)?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,nn(e,o),bt(r,e,o,-1))}return vd(),r=Oa(Error(B(421))),Ji(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=JS.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,tt=_n(o.nextSibling),nt=t,pe=!0,St=null,e!==null&&(at[ut++]=Kt,at[ut++]=Qt,at[ut++]=rr,Kt=e.id,Qt=e.overflow,rr=t),t=fd(t,r.children),t.flags|=4096,t)}function mh(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Fu(e.return,t,n)}function Fa(e,t,n,r,o){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function Bg(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(Be(e,t,r.children,n),r=ve.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&&mh(e,n,t);else if(e.tag===19)mh(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(ue(ve,r),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&nl(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Fa(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&nl(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Fa(t,!0,n,null,i);break;case"together":Fa(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function _s(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function rn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ir|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(B(153));if(t.child!==null){for(e=t.child,n=Rn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Rn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function BS(e,t,n){switch(t.tag){case 3:Og(t),Yr();break;case 5:hg(t);break;case 1:Qe(t.type)&&Qs(t);break;case 4:od(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;ue(Js,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ue(ve,ve.current&1),t.flags|=128,null):n&t.child.childLanes?Fg(e,t,n):(ue(ve,ve.current&1),e=rn(e,t,n),e!==null?e.sibling:null);ue(ve,ve.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Bg(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),ue(ve,ve.current),r)break;return null;case 22:case 23:return t.lanes=0,zg(e,t,n)}return rn(e,t,n)}var Vg,Gu,Hg,Ug;Vg=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Gu=function(){};Hg=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,Xn($t.current);var i=null;switch(n){case"input":o=gu(e,o),r=gu(e,r),i=[];break;case"select":o=we({},o,{value:void 0}),r=we({},r,{value:void 0}),i=[];break;case"textarea":o=xu(e,o),r=xu(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Gs)}Su(n,r);var s;n=null;for(u in o)if(!r.hasOwnProperty(u)&&o.hasOwnProperty(u)&&o[u]!=null)if(u==="style"){var l=o[u];for(s in l)l.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Qo.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var a=r[u];if(l=o!=null?o[u]:void 0,r.hasOwnProperty(u)&&a!==l&&(a!=null||l!=null))if(u==="style")if(l){for(s in l)!l.hasOwnProperty(s)||a&&a.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in a)a.hasOwnProperty(s)&&l[s]!==a[s]&&(n||(n={}),n[s]=a[s])}else n||(i||(i=[]),i.push(u,n)),n=a;else u==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,l=l?l.__html:void 0,a!=null&&l!==a&&(i=i||[]).push(u,a)):u==="children"?typeof a!="string"&&typeof a!="number"||(i=i||[]).push(u,""+a):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Qo.hasOwnProperty(u)?(a!=null&&u==="onScroll"&&fe("scroll",e),i||l===a||(i=[])):(i=i||[]).push(u,a))}n&&(i=i||[]).push("style",n);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};Ug=function(e,t,n,r){n!==r&&(t.flags|=4)};function ko(e,t){if(!pe)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 $e(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function VS(e,t,n){var r=t.pendingProps;switch(qc(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return $e(t),null;case 1:return Qe(t.type)&&Ks(),$e(t),null;case 3:return r=t.stateNode,Gr(),he(Ke),he(Fe),sd(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(qi(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,St!==null&&(nc(St),St=null))),Gu(e,t),$e(t),null;case 5:id(t);var o=Xn(ai.current);if(n=t.type,e!==null&&t.stateNode!=null)Hg(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(B(166));return $e(t),null}if(e=Xn($t.current),qi(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[At]=t,r[si]=i,e=(t.mode&1)!==0,n){case"dialog":fe("cancel",r),fe("close",r);break;case"iframe":case"object":case"embed":fe("load",r);break;case"video":case"audio":for(o=0;o<Ao.length;o++)fe(Ao[o],r);break;case"source":fe("error",r);break;case"img":case"image":case"link":fe("error",r),fe("load",r);break;case"details":fe("toggle",r);break;case"input":kf(r,i),fe("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},fe("invalid",r);break;case"textarea":bf(r,i),fe("invalid",r)}Su(n,i),o=null;for(var s in i)if(i.hasOwnProperty(s)){var l=i[s];s==="children"?typeof l=="string"?r.textContent!==l&&(i.suppressHydrationWarning!==!0&&Qi(r.textContent,l,e),o=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&Qi(r.textContent,l,e),o=["children",""+l]):Qo.hasOwnProperty(s)&&l!=null&&s==="onScroll"&&fe("scroll",r)}switch(n){case"input":Vi(r),Cf(r,i,!0);break;case"textarea":Vi(r),_f(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=Gs)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=vm(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[At]=t,e[si]=r,Vg(e,t,!1,!1),t.stateNode=e;e:{switch(s=Eu(n,r),n){case"dialog":fe("cancel",e),fe("close",e),o=r;break;case"iframe":case"object":case"embed":fe("load",e),o=r;break;case"video":case"audio":for(o=0;o<Ao.length;o++)fe(Ao[o],e);o=r;break;case"source":fe("error",e),o=r;break;case"img":case"image":case"link":fe("error",e),fe("load",e),o=r;break;case"details":fe("toggle",e),o=r;break;case"input":kf(e,r),o=gu(e,r),fe("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=we({},r,{value:void 0}),fe("invalid",e);break;case"textarea":bf(e,r),o=xu(e,r),fe("invalid",e);break;default:o=r}Su(n,o),l=o;for(i in l)if(l.hasOwnProperty(i)){var a=l[i];i==="style"?Sm(e,a):i==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&xm(e,a)):i==="children"?typeof a=="string"?(n!=="textarea"||a!=="")&&qo(e,a):typeof a=="number"&&qo(e,""+a):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Qo.hasOwnProperty(i)?a!=null&&i==="onScroll"&&fe("scroll",e):a!=null&&Dc(e,i,a,s))}switch(n){case"input":Vi(e),Cf(e,r,!1);break;case"textarea":Vi(e),_f(e);break;case"option":r.value!=null&&e.setAttribute("value",""+In(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?Lr(e,!!r.multiple,i,!1):r.defaultValue!=null&&Lr(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Gs)}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 $e(t),null;case 6:if(e&&t.stateNode!=null)Ug(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(B(166));if(n=Xn(ai.current),Xn($t.current),qi(t)){if(r=t.stateNode,n=t.memoizedProps,r[At]=t,(i=r.nodeValue!==n)&&(e=nt,e!==null))switch(e.tag){case 3:Qi(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Qi(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[At]=t,t.stateNode=r}return $e(t),null;case 13:if(he(ve),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(pe&&tt!==null&&t.mode&1&&!(t.flags&128))ag(),Yr(),t.flags|=98560,i=!1;else if(i=qi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(B(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(B(317));i[At]=t}else Yr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;$e(t),i=!1}else St!==null&&(nc(St),St=null),i=!0;if(!i)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||ve.current&1?Pe===0&&(Pe=3):vd())),t.updateQueue!==null&&(t.flags|=4),$e(t),null);case 4:return Gr(),Gu(e,t),e===null&&oi(t.stateNode.containerInfo),$e(t),null;case 10:return td(t.type._context),$e(t),null;case 17:return Qe(t.type)&&Ks(),$e(t),null;case 19:if(he(ve),i=t.memoizedState,i===null)return $e(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)ko(i,!1);else{if(Pe!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=nl(e),s!==null){for(t.flags|=128,ko(i,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,s=i.alternate,s===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,e=s.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ue(ve,ve.current&1|2),t.child}e=e.sibling}i.tail!==null&&Ee()>Qr&&(t.flags|=128,r=!0,ko(i,!1),t.lanes=4194304)}else{if(!r)if(e=nl(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ko(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!pe)return $e(t),null}else 2*Ee()-i.renderingStartTime>Qr&&n!==1073741824&&(t.flags|=128,r=!0,ko(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Ee(),t.sibling=null,n=ve.current,ue(ve,r?n&1|2:n&1),t):($e(t),null);case 22:case 23:return yd(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Je&1073741824&&($e(t),t.subtreeFlags&6&&(t.flags|=8192)):$e(t),null;case 24:return null;case 25:return null}throw Error(B(156,t.tag))}function HS(e,t){switch(qc(t),t.tag){case 1:return Qe(t.type)&&Ks(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Gr(),he(Ke),he(Fe),sd(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return id(t),null;case 13:if(he(ve),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(B(340));Yr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return he(ve),null;case 4:return Gr(),null;case 10:return td(t.type._context),null;case 22:case 23:return yd(),null;case 24:return null;default:return null}}var es=!1,Oe=!1,US=typeof WeakSet=="function"?WeakSet:Set,W=null;function Mr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Se(e,t,r)}else n.current=null}function Ku(e,t,n){try{n()}catch(r){Se(e,t,r)}}var gh=!1;function WS(e,t){if(Tu=Ws,e=Km(),Kc(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 o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,l=-1,a=-1,u=0,d=0,c=e,f=null;t:for(;;){for(var y;c!==n||o!==0&&c.nodeType!==3||(l=s+o),c!==i||r!==0&&c.nodeType!==3||(a=s+r),c.nodeType===3&&(s+=c.nodeValue.length),(y=c.firstChild)!==null;)f=c,c=y;for(;;){if(c===e)break t;if(f===n&&++u===o&&(l=s),f===i&&++d===r&&(a=s),(y=c.nextSibling)!==null)break;c=f,f=c.parentNode}c=y}n=l===-1||a===-1?null:{start:l,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(Iu={focusedElem:e,selectionRange:n},Ws=!1,W=t;W!==null;)if(t=W,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,W=e;else for(;W!==null;){t=W;try{var x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var w=x.memoizedProps,S=x.memoizedState,p=t.stateNode,g=p.getSnapshotBeforeUpdate(t.elementType===t.type?w:vt(t.type,w),S);p.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var m=t.stateNode.containerInfo;m.nodeType===1?m.textContent="":m.nodeType===9&&m.documentElement&&m.removeChild(m.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(B(163))}}catch(E){Se(t,t.return,E)}if(e=t.sibling,e!==null){e.return=t.return,W=e;break}W=t.return}return x=gh,gh=!1,x}function Uo(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&Ku(t,n,i)}o=o.next}while(o!==r)}}function Dl(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 Qu(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 Wg(e){var t=e.alternate;t!==null&&(e.alternate=null,Wg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[At],delete t[si],delete t[Du],delete t[_S],delete t[PS])),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 Yg(e){return e.tag===5||e.tag===3||e.tag===4}function yh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Yg(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 qu(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=Gs));else if(r!==4&&(e=e.child,e!==null))for(qu(e,t,n),e=e.sibling;e!==null;)qu(e,t,n),e=e.sibling}function Zu(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(Zu(e,t,n),e=e.sibling;e!==null;)Zu(e,t,n),e=e.sibling}var Te=null,xt=!1;function un(e,t,n){for(n=n.child;n!==null;)Xg(e,t,n),n=n.sibling}function Xg(e,t,n){if(zt&&typeof zt.onCommitFiberUnmount=="function")try{zt.onCommitFiberUnmount(Pl,n)}catch{}switch(n.tag){case 5:Oe||Mr(n,t);case 6:var r=Te,o=xt;Te=null,un(e,t,n),Te=r,xt=o,Te!==null&&(xt?(e=Te,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Te.removeChild(n.stateNode));break;case 18:Te!==null&&(xt?(e=Te,n=n.stateNode,e.nodeType===8?Ia(e.parentNode,n):e.nodeType===1&&Ia(e,n),ti(e)):Ia(Te,n.stateNode));break;case 4:r=Te,o=xt,Te=n.stateNode.containerInfo,xt=!0,un(e,t,n),Te=r,xt=o;break;case 0:case 11:case 14:case 15:if(!Oe&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&Ku(n,t,s),o=o.next}while(o!==r)}un(e,t,n);break;case 1:if(!Oe&&(Mr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Se(n,t,l)}un(e,t,n);break;case 21:un(e,t,n);break;case 22:n.mode&1?(Oe=(r=Oe)||n.memoizedState!==null,un(e,t,n),Oe=r):un(e,t,n);break;default:un(e,t,n)}}function vh(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new US),t.forEach(function(r){var o=eE.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function gt(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var i=e,s=t,l=s;e:for(;l!==null;){switch(l.tag){case 5:Te=l.stateNode,xt=!1;break e;case 3:Te=l.stateNode.containerInfo,xt=!0;break e;case 4:Te=l.stateNode.containerInfo,xt=!0;break e}l=l.return}if(Te===null)throw Error(B(160));Xg(i,s,o),Te=null,xt=!1;var a=o.alternate;a!==null&&(a.return=null),o.return=null}catch(u){Se(o,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Gg(t,e),t=t.sibling}function Gg(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(gt(t,e),Rt(e),r&4){try{Uo(3,e,e.return),Dl(3,e)}catch(w){Se(e,e.return,w)}try{Uo(5,e,e.return)}catch(w){Se(e,e.return,w)}}break;case 1:gt(t,e),Rt(e),r&512&&n!==null&&Mr(n,n.return);break;case 5:if(gt(t,e),Rt(e),r&512&&n!==null&&Mr(n,n.return),e.flags&32){var o=e.stateNode;try{qo(o,"")}catch(w){Se(e,e.return,w)}}if(r&4&&(o=e.stateNode,o!=null)){var i=e.memoizedProps,s=n!==null?n.memoizedProps:i,l=e.type,a=e.updateQueue;if(e.updateQueue=null,a!==null)try{l==="input"&&i.type==="radio"&&i.name!=null&&gm(o,i),Eu(l,s);var u=Eu(l,i);for(s=0;s<a.length;s+=2){var d=a[s],c=a[s+1];d==="style"?Sm(o,c):d==="dangerouslySetInnerHTML"?xm(o,c):d==="children"?qo(o,c):Dc(o,d,c,u)}switch(l){case"input":yu(o,i);break;case"textarea":ym(o,i);break;case"select":var f=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var y=i.value;y!=null?Lr(o,!!i.multiple,y,!1):f!==!!i.multiple&&(i.defaultValue!=null?Lr(o,!!i.multiple,i.defaultValue,!0):Lr(o,!!i.multiple,i.multiple?[]:"",!1))}o[si]=i}catch(w){Se(e,e.return,w)}}break;case 6:if(gt(t,e),Rt(e),r&4){if(e.stateNode===null)throw Error(B(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(w){Se(e,e.return,w)}}break;case 3:if(gt(t,e),Rt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{ti(t.containerInfo)}catch(w){Se(e,e.return,w)}break;case 4:gt(t,e),Rt(e);break;case 13:gt(t,e),Rt(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(md=Ee())),r&4&&vh(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(Oe=(u=Oe)||d,gt(t,e),Oe=u):gt(t,e),Rt(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(W=e,d=e.child;d!==null;){for(c=W=d;W!==null;){switch(f=W,y=f.child,f.tag){case 0:case 11:case 14:case 15:Uo(4,f,f.return);break;case 1:Mr(f,f.return);var x=f.stateNode;if(typeof x.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,x.props=t.memoizedProps,x.state=t.memoizedState,x.componentWillUnmount()}catch(w){Se(r,n,w)}}break;case 5:Mr(f,f.return);break;case 22:if(f.memoizedState!==null){wh(c);continue}}y!==null?(y.return=f,W=y):wh(c)}d=d.sibling}e:for(d=null,c=e;;){if(c.tag===5){if(d===null){d=c;try{o=c.stateNode,u?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=c.stateNode,a=c.memoizedProps.style,s=a!=null&&a.hasOwnProperty("display")?a.display:null,l.style.display=wm("display",s))}catch(w){Se(e,e.return,w)}}}else if(c.tag===6){if(d===null)try{c.stateNode.nodeValue=u?"":c.memoizedProps}catch(w){Se(e,e.return,w)}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===e)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===e)break e;for(;c.sibling===null;){if(c.return===null||c.return===e)break e;d===c&&(d=null),c=c.return}d===c&&(d=null),c.sibling.return=c.return,c=c.sibling}}break;case 19:gt(t,e),Rt(e),r&4&&vh(e);break;case 21:break;default:gt(t,e),Rt(e)}}function Rt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Yg(n)){var r=n;break e}n=n.return}throw Error(B(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(qo(o,""),r.flags&=-33);var i=yh(e);Zu(e,i,o);break;case 3:case 4:var s=r.stateNode.containerInfo,l=yh(e);qu(e,l,s);break;default:throw Error(B(161))}}catch(a){Se(e,e.return,a)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function YS(e,t,n){W=e,Kg(e)}function Kg(e,t,n){for(var r=(e.mode&1)!==0;W!==null;){var o=W,i=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||es;if(!s){var l=o.alternate,a=l!==null&&l.memoizedState!==null||Oe;l=es;var u=Oe;if(es=s,(Oe=a)&&!u)for(W=o;W!==null;)s=W,a=s.child,s.tag===22&&s.memoizedState!==null?Sh(o):a!==null?(a.return=s,W=a):Sh(o);for(;i!==null;)W=i,Kg(i),i=i.sibling;W=o,es=l,Oe=u}xh(e)}else o.subtreeFlags&8772&&i!==null?(i.return=o,W=i):xh(e)}}function xh(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:Oe||Dl(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Oe)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:vt(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&rh(t,i,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}rh(t,s,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var a=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break;case"img":a.src&&(n.src=a.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var c=d.dehydrated;c!==null&&ti(c)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(B(163))}Oe||t.flags&512&&Qu(t)}catch(f){Se(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 wh(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 Sh(e){for(;W!==null;){var t=W;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Dl(4,t)}catch(a){Se(t,n,a)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(a){Se(t,o,a)}}var i=t.return;try{Qu(t)}catch(a){Se(t,i,a)}break;case 5:var s=t.return;try{Qu(t)}catch(a){Se(t,s,a)}}}catch(a){Se(t,t.return,a)}if(t===e){W=null;break}var l=t.sibling;if(l!==null){l.return=t.return,W=l;break}W=t.return}}var XS=Math.ceil,il=sn.ReactCurrentDispatcher,hd=sn.ReactCurrentOwner,dt=sn.ReactCurrentBatchConfig,oe=0,Re=null,ke=null,Ie=0,Je=0,Rr=On(0),Pe=0,fi=null,ir=0,zl=0,pd=0,Wo=null,Ye=null,md=0,Qr=1/0,Xt=null,sl=!1,Ju=null,jn=null,ts=!1,Sn=null,ll=0,Yo=0,ec=null,Ps=-1,js=0;function Ve(){return oe&6?Ee():Ps!==-1?Ps:Ps=Ee()}function Mn(e){return e.mode&1?oe&2&&Ie!==0?Ie&-Ie:MS.transition!==null?(js===0&&(js=Im()),js):(e=le,e!==0||(e=window.event,e=e===void 0?16:Fm(e.type)),e):1}function bt(e,t,n,r){if(50<Yo)throw Yo=0,ec=null,Error(B(185));Ci(e,n,r),(!(oe&2)||e!==Re)&&(e===Re&&(!(oe&2)&&(zl|=n),Pe===4&&vn(e,Ie)),qe(e,r),n===1&&oe===0&&!(t.mode&1)&&(Qr=Ee()+500,Il&&Fn()))}function qe(e,t){var n=e.callbackNode;M1(e,t);var r=Us(e,e===Re?Ie:0);if(r===0)n!==null&&Mf(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Mf(n),t===1)e.tag===0?jS(Eh.bind(null,e)):ig(Eh.bind(null,e)),CS(function(){!(oe&6)&&Fn()}),n=null;else{switch(Lm(r)){case 1:n=Bc;break;case 4:n=Rm;break;case 16:n=Hs;break;case 536870912:n=Tm;break;default:n=Hs}n=ry(n,Qg.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Qg(e,t){if(Ps=-1,js=0,oe&6)throw Error(B(327));var n=e.callbackNode;if(Or()&&e.callbackNode!==n)return null;var r=Us(e,e===Re?Ie:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=al(e,r);else{t=r;var o=oe;oe|=2;var i=Zg();(Re!==e||Ie!==t)&&(Xt=null,Qr=Ee()+500,Zn(e,t));do try{QS();break}catch(l){qg(e,l)}while(!0);ed(),il.current=i,oe=o,ke!==null?t=0:(Re=null,Ie=0,t=Pe)}if(t!==0){if(t===2&&(o=_u(e),o!==0&&(r=o,t=tc(e,o))),t===1)throw n=fi,Zn(e,0),vn(e,r),qe(e,Ee()),n;if(t===6)vn(e,r);else{if(o=e.current.alternate,!(r&30)&&!GS(o)&&(t=al(e,r),t===2&&(i=_u(e),i!==0&&(r=i,t=tc(e,i))),t===1))throw n=fi,Zn(e,0),vn(e,r),qe(e,Ee()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(B(345));case 2:Hn(e,Ye,Xt);break;case 3:if(vn(e,r),(r&130023424)===r&&(t=md+500-Ee(),10<t)){if(Us(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){Ve(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Au(Hn.bind(null,e,Ye,Xt),t);break}Hn(e,Ye,Xt);break;case 4:if(vn(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-Ct(r);i=1<<s,s=t[s],s>o&&(o=s),r&=~i}if(r=o,r=Ee()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*XS(r/1960))-r,10<r){e.timeoutHandle=Au(Hn.bind(null,e,Ye,Xt),r);break}Hn(e,Ye,Xt);break;case 5:Hn(e,Ye,Xt);break;default:throw Error(B(329))}}}return qe(e,Ee()),e.callbackNode===n?Qg.bind(null,e):null}function tc(e,t){var n=Wo;return e.current.memoizedState.isDehydrated&&(Zn(e,t).flags|=256),e=al(e,t),e!==2&&(t=Ye,Ye=n,t!==null&&nc(t)),e}function nc(e){Ye===null?Ye=e:Ye.push.apply(Ye,e)}function GS(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 o=n[r],i=o.getSnapshot;o=o.value;try{if(!_t(i(),o))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 vn(e,t){for(t&=~pd,t&=~zl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Ct(t),r=1<<n;e[n]=-1,t&=~r}}function Eh(e){if(oe&6)throw Error(B(327));Or();var t=Us(e,0);if(!(t&1))return qe(e,Ee()),null;var n=al(e,t);if(e.tag!==0&&n===2){var r=_u(e);r!==0&&(t=r,n=tc(e,r))}if(n===1)throw n=fi,Zn(e,0),vn(e,t),qe(e,Ee()),n;if(n===6)throw Error(B(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Hn(e,Ye,Xt),qe(e,Ee()),null}function gd(e,t){var n=oe;oe|=1;try{return e(t)}finally{oe=n,oe===0&&(Qr=Ee()+500,Il&&Fn())}}function sr(e){Sn!==null&&Sn.tag===0&&!(oe&6)&&Or();var t=oe;oe|=1;var n=dt.transition,r=le;try{if(dt.transition=null,le=1,e)return e()}finally{le=r,dt.transition=n,oe=t,!(oe&6)&&Fn()}}function yd(){Je=Rr.current,he(Rr)}function Zn(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,kS(n)),ke!==null)for(n=ke.return;n!==null;){var r=n;switch(qc(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Ks();break;case 3:Gr(),he(Ke),he(Fe),sd();break;case 5:id(r);break;case 4:Gr();break;case 13:he(ve);break;case 19:he(ve);break;case 10:td(r.type._context);break;case 22:case 23:yd()}n=n.return}if(Re=e,ke=e=Rn(e.current,null),Ie=Je=t,Pe=0,fi=null,pd=zl=ir=0,Ye=Wo=null,Yn!==null){for(t=0;t<Yn.length;t++)if(n=Yn[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,i=n.pending;if(i!==null){var s=i.next;i.next=o,r.next=s}n.pending=r}Yn=null}return e}function qg(e,t){do{var n=ke;try{if(ed(),Cs.current=ol,rl){for(var r=xe.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}rl=!1}if(or=0,je=_e=xe=null,Ho=!1,ui=0,hd.current=null,n===null||n.return===null){Pe=1,fi=t,ke=null;break}e:{var i=e,s=n.return,l=n,a=t;if(t=Ie,l.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){var u=a,d=l,c=d.tag;if(!(d.mode&1)&&(c===0||c===11||c===15)){var f=d.alternate;f?(d.updateQueue=f.updateQueue,d.memoizedState=f.memoizedState,d.lanes=f.lanes):(d.updateQueue=null,d.memoizedState=null)}var y=uh(s);if(y!==null){y.flags&=-257,ch(y,s,l,i,t),y.mode&1&&ah(i,u,t),t=y,a=u;var x=t.updateQueue;if(x===null){var w=new Set;w.add(a),t.updateQueue=w}else x.add(a);break e}else{if(!(t&1)){ah(i,u,t),vd();break e}a=Error(B(426))}}else if(pe&&l.mode&1){var S=uh(s);if(S!==null){!(S.flags&65536)&&(S.flags|=256),ch(S,s,l,i,t),Zc(Kr(a,l));break e}}i=a=Kr(a,l),Pe!==4&&(Pe=2),Wo===null?Wo=[i]:Wo.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var p=Lg(i,a,t);nh(i,p);break e;case 1:l=a;var g=i.type,m=i.stateNode;if(!(i.flags&128)&&(typeof g.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(jn===null||!jn.has(m)))){i.flags|=65536,t&=-t,i.lanes|=t;var E=Ag(i,l,t);nh(i,E);break e}}i=i.return}while(i!==null)}ey(n)}catch(N){t=N,ke===n&&n!==null&&(ke=n=n.return);continue}break}while(!0)}function Zg(){var e=il.current;return il.current=ol,e===null?ol:e}function vd(){(Pe===0||Pe===3||Pe===2)&&(Pe=4),Re===null||!(ir&268435455)&&!(zl&268435455)||vn(Re,Ie)}function al(e,t){var n=oe;oe|=2;var r=Zg();(Re!==e||Ie!==t)&&(Xt=null,Zn(e,t));do try{KS();break}catch(o){qg(e,o)}while(!0);if(ed(),oe=n,il.current=r,ke!==null)throw Error(B(261));return Re=null,Ie=0,Pe}function KS(){for(;ke!==null;)Jg(ke)}function QS(){for(;ke!==null&&!S1();)Jg(ke)}function Jg(e){var t=ny(e.alternate,e,Je);e.memoizedProps=e.pendingProps,t===null?ey(e):ke=t,hd.current=null}function ey(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=HS(n,t),n!==null){n.flags&=32767,ke=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Pe=6,ke=null;return}}else if(n=VS(n,t,Je),n!==null){ke=n;return}if(t=t.sibling,t!==null){ke=t;return}ke=t=e}while(t!==null);Pe===0&&(Pe=5)}function Hn(e,t,n){var r=le,o=dt.transition;try{dt.transition=null,le=1,qS(e,t,n,r)}finally{dt.transition=o,le=r}return null}function qS(e,t,n,r){do Or();while(Sn!==null);if(oe&6)throw Error(B(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(B(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(R1(e,i),e===Re&&(ke=Re=null,Ie=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||ts||(ts=!0,ry(Hs,function(){return Or(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=dt.transition,dt.transition=null;var s=le;le=1;var l=oe;oe|=4,hd.current=null,WS(e,n),Gg(n,e),yS(Iu),Ws=!!Tu,Iu=Tu=null,e.current=n,YS(n),E1(),oe=l,le=s,dt.transition=i}else e.current=n;if(ts&&(ts=!1,Sn=e,ll=o),i=e.pendingLanes,i===0&&(jn=null),C1(n.stateNode),qe(e,Ee()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(sl)throw sl=!1,e=Ju,Ju=null,e;return ll&1&&e.tag!==0&&Or(),i=e.pendingLanes,i&1?e===ec?Yo++:(Yo=0,ec=e):Yo=0,Fn(),null}function Or(){if(Sn!==null){var e=Lm(ll),t=dt.transition,n=le;try{if(dt.transition=null,le=16>e?16:e,Sn===null)var r=!1;else{if(e=Sn,Sn=null,ll=0,oe&6)throw Error(B(331));var o=oe;for(oe|=4,W=e.current;W!==null;){var i=W,s=i.child;if(W.flags&16){var l=i.deletions;if(l!==null){for(var a=0;a<l.length;a++){var u=l[a];for(W=u;W!==null;){var d=W;switch(d.tag){case 0:case 11:case 15:Uo(8,d,i)}var c=d.child;if(c!==null)c.return=d,W=c;else for(;W!==null;){d=W;var f=d.sibling,y=d.return;if(Wg(d),d===u){W=null;break}if(f!==null){f.return=y,W=f;break}W=y}}}var x=i.alternate;if(x!==null){var w=x.child;if(w!==null){x.child=null;do{var S=w.sibling;w.sibling=null,w=S}while(w!==null)}}W=i}}if(i.subtreeFlags&2064&&s!==null)s.return=i,W=s;else e:for(;W!==null;){if(i=W,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Uo(9,i,i.return)}var p=i.sibling;if(p!==null){p.return=i.return,W=p;break e}W=i.return}}var g=e.current;for(W=g;W!==null;){s=W;var m=s.child;if(s.subtreeFlags&2064&&m!==null)m.return=s,W=m;else e:for(s=g;W!==null;){if(l=W,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Dl(9,l)}}catch(N){Se(l,l.return,N)}if(l===s){W=null;break e}var E=l.sibling;if(E!==null){E.return=l.return,W=E;break e}W=l.return}}if(oe=o,Fn(),zt&&typeof zt.onPostCommitFiberRoot=="function")try{zt.onPostCommitFiberRoot(Pl,e)}catch{}r=!0}return r}finally{le=n,dt.transition=t}}return!1}function Nh(e,t,n){t=Kr(n,t),t=Lg(e,t,1),e=Pn(e,t,1),t=Ve(),e!==null&&(Ci(e,1,t),qe(e,t))}function Se(e,t,n){if(e.tag===3)Nh(e,e,n);else for(;t!==null;){if(t.tag===3){Nh(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(jn===null||!jn.has(r))){e=Kr(n,e),e=Ag(t,e,1),t=Pn(t,e,1),e=Ve(),t!==null&&(Ci(t,1,e),qe(t,e));break}}t=t.return}}function ZS(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Ve(),e.pingedLanes|=e.suspendedLanes&n,Re===e&&(Ie&n)===n&&(Pe===4||Pe===3&&(Ie&130023424)===Ie&&500>Ee()-md?Zn(e,0):pd|=n),qe(e,t)}function ty(e,t){t===0&&(e.mode&1?(t=Wi,Wi<<=1,!(Wi&130023424)&&(Wi=4194304)):t=1);var n=Ve();e=nn(e,t),e!==null&&(Ci(e,t,n),qe(e,n))}function JS(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ty(e,n)}function eE(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(B(314))}r!==null&&r.delete(t),ty(e,n)}var ny;ny=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ke.current)Xe=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Xe=!1,BS(e,t,n);Xe=!!(e.flags&131072)}else Xe=!1,pe&&t.flags&1048576&&sg(t,Zs,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;_s(e,t),e=t.pendingProps;var o=Wr(t,Fe.current);$r(t,n),o=ad(null,t,r,e,o,n);var i=ud();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Qe(r)?(i=!0,Qs(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,rd(t),o.updater=Al,t.stateNode=o,o._reactInternals=t,Vu(t,r,e,n),t=Wu(null,t,r,!0,i,n)):(t.tag=0,pe&&i&&Qc(t),Be(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(_s(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=nE(r),e=vt(r,e),o){case 0:t=Uu(null,t,r,e,n);break e;case 1:t=hh(null,t,r,e,n);break e;case 11:t=dh(null,t,r,e,n);break e;case 14:t=fh(null,t,r,vt(r.type,e),n);break e}throw Error(B(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:vt(r,o),Uu(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:vt(r,o),hh(e,t,r,o,n);case 3:e:{if(Og(t),e===null)throw Error(B(387));r=t.pendingProps,i=t.memoizedState,o=i.element,fg(e,t),tl(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=Kr(Error(B(423)),t),t=ph(e,t,r,n,o);break e}else if(r!==o){o=Kr(Error(B(424)),t),t=ph(e,t,r,n,o);break e}else for(tt=_n(t.stateNode.containerInfo.firstChild),nt=t,pe=!0,St=null,n=cg(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Yr(),r===o){t=rn(e,t,n);break e}Be(e,t,r,n)}t=t.child}return t;case 5:return hg(t),e===null&&Ou(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,Lu(r,o)?s=null:i!==null&&Lu(r,i)&&(t.flags|=32),$g(e,t),Be(e,t,s,n),t.child;case 6:return e===null&&Ou(t),null;case 13:return Fg(e,t,n);case 4:return od(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Xr(t,null,r,n):Be(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:vt(r,o),dh(e,t,r,o,n);case 7:return Be(e,t,t.pendingProps,n),t.child;case 8:return Be(e,t,t.pendingProps.children,n),t.child;case 12:return Be(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,ue(Js,r._currentValue),r._currentValue=s,i!==null)if(_t(i.value,s)){if(i.children===o.children&&!Ke.current){t=rn(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){s=i.child;for(var a=l.firstContext;a!==null;){if(a.context===r){if(i.tag===1){a=Zt(-1,n&-n),a.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?a.next=a:(a.next=d.next,d.next=a),u.pending=a}}i.lanes|=n,a=i.alternate,a!==null&&(a.lanes|=n),Fu(i.return,n,t),l.lanes|=n;break}a=a.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(B(341));s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),Fu(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}Be(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,$r(t,n),o=ft(o),r=r(o),t.flags|=1,Be(e,t,r,n),t.child;case 14:return r=t.type,o=vt(r,t.pendingProps),o=vt(r.type,o),fh(e,t,r,o,n);case 15:return Dg(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:vt(r,o),_s(e,t),t.tag=1,Qe(r)?(e=!0,Qs(t)):e=!1,$r(t,n),Ig(t,r,o),Vu(t,r,o,n),Wu(null,t,r,!0,e,n);case 19:return Bg(e,t,n);case 22:return zg(e,t,n)}throw Error(B(156,t.tag))};function ry(e,t){return Mm(e,t)}function tE(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 ct(e,t,n,r){return new tE(e,t,n,r)}function xd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function nE(e){if(typeof e=="function")return xd(e)?1:0;if(e!=null){if(e=e.$$typeof,e===$c)return 11;if(e===Oc)return 14}return 2}function Rn(e,t){var n=e.alternate;return n===null?(n=ct(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 Ms(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")xd(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Sr:return Jn(n.children,o,i,t);case zc:s=8,o|=8;break;case fu:return e=ct(12,n,t,o|2),e.elementType=fu,e.lanes=i,e;case hu:return e=ct(13,n,t,o),e.elementType=hu,e.lanes=i,e;case pu:return e=ct(19,n,t,o),e.elementType=pu,e.lanes=i,e;case hm:return $l(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case dm:s=10;break e;case fm:s=9;break e;case $c:s=11;break e;case Oc:s=14;break e;case mn:s=16,r=null;break e}throw Error(B(130,e==null?e:typeof e,""))}return t=ct(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function Jn(e,t,n,r){return e=ct(7,e,r,t),e.lanes=n,e}function $l(e,t,n,r){return e=ct(22,e,r,t),e.elementType=hm,e.lanes=n,e.stateNode={isHidden:!1},e}function Ba(e,t,n){return e=ct(6,e,null,t),e.lanes=n,e}function Va(e,t,n){return t=ct(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function rE(e,t,n,r,o){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=Ea(0),this.expirationTimes=Ea(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ea(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function wd(e,t,n,r,o,i,s,l,a){return e=new rE(e,t,n,l,a),t===1?(t=1,i===!0&&(t|=8)):t=0,i=ct(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},rd(i),e}function oE(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:wr,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function oy(e){if(!e)return Ln;e=e._reactInternals;e:{if(hr(e)!==e||e.tag!==1)throw Error(B(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Qe(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(B(171))}if(e.tag===1){var n=e.type;if(Qe(n))return og(e,n,t)}return t}function iy(e,t,n,r,o,i,s,l,a){return e=wd(n,r,!0,e,o,i,s,l,a),e.context=oy(null),n=e.current,r=Ve(),o=Mn(n),i=Zt(r,o),i.callback=t??null,Pn(n,i,o),e.current.lanes=o,Ci(e,o,r),qe(e,r),e}function Ol(e,t,n,r){var o=t.current,i=Ve(),s=Mn(o);return n=oy(n),t.context===null?t.context=n:t.pendingContext=n,t=Zt(i,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Pn(o,t,s),e!==null&&(bt(e,o,s,i),ks(e,o,s)),s}function ul(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 kh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Sd(e,t){kh(e,t),(e=e.alternate)&&kh(e,t)}function iE(){return null}var sy=typeof reportError=="function"?reportError:function(e){console.error(e)};function Ed(e){this._internalRoot=e}Fl.prototype.render=Ed.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(B(409));Ol(e,t,null,null)};Fl.prototype.unmount=Ed.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;sr(function(){Ol(null,e,null,null)}),t[tn]=null}};function Fl(e){this._internalRoot=e}Fl.prototype.unstable_scheduleHydration=function(e){if(e){var t=zm();e={blockedOn:null,target:e,priority:t};for(var n=0;n<yn.length&&t!==0&&t<yn[n].priority;n++);yn.splice(n,0,e),n===0&&Om(e)}};function Nd(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Bl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Ch(){}function sE(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var u=ul(s);i.call(u)}}var s=iy(t,r,e,0,null,!1,!1,"",Ch);return e._reactRootContainer=s,e[tn]=s.current,oi(e.nodeType===8?e.parentNode:e),sr(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var l=r;r=function(){var u=ul(a);l.call(u)}}var a=wd(e,0,!1,null,null,!1,!1,"",Ch);return e._reactRootContainer=a,e[tn]=a.current,oi(e.nodeType===8?e.parentNode:e),sr(function(){Ol(t,a,n,r)}),a}function Vl(e,t,n,r,o){var i=n._reactRootContainer;if(i){var s=i;if(typeof o=="function"){var l=o;o=function(){var a=ul(s);l.call(a)}}Ol(t,s,e,o)}else s=sE(n,t,e,o,r);return ul(s)}Am=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Lo(t.pendingLanes);n!==0&&(Vc(t,n|1),qe(t,Ee()),!(oe&6)&&(Qr=Ee()+500,Fn()))}break;case 13:sr(function(){var r=nn(e,1);if(r!==null){var o=Ve();bt(r,e,1,o)}}),Sd(e,1)}};Hc=function(e){if(e.tag===13){var t=nn(e,134217728);if(t!==null){var n=Ve();bt(t,e,134217728,n)}Sd(e,134217728)}};Dm=function(e){if(e.tag===13){var t=Mn(e),n=nn(e,t);if(n!==null){var r=Ve();bt(n,e,t,r)}Sd(e,t)}};zm=function(){return le};$m=function(e,t){var n=le;try{return le=e,t()}finally{le=n}};ku=function(e,t,n){switch(t){case"input":if(yu(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 o=Tl(r);if(!o)throw Error(B(90));mm(r),yu(r,o)}}}break;case"textarea":ym(e,n);break;case"select":t=n.value,t!=null&&Lr(e,!!n.multiple,t,!1)}};km=gd;Cm=sr;var lE={usingClientEntryPoint:!1,Events:[_i,Cr,Tl,Em,Nm,gd]},Co={findFiberByHostInstance:Wn,bundleType:0,version:"18.3.0",rendererPackageName:"react-dom"},aE={bundleType:Co.bundleType,version:Co.version,rendererPackageName:Co.rendererPackageName,rendererConfig:Co.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:sn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Pm(e),e===null?null:e.stateNode},findFiberByHostInstance:Co.findFiberByHostInstance||iE,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 ns=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ns.isDisabled&&ns.supportsFiber)try{Pl=ns.inject(aE),zt=ns}catch{}}st.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=lE;st.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Nd(t))throw Error(B(200));return oE(e,t,null,n)};st.createRoot=function(e,t){if(!Nd(e))throw Error(B(299));var n=!1,r="",o=sy;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=wd(e,1,!1,null,null,n,!1,r,o),e[tn]=t.current,oi(e.nodeType===8?e.parentNode:e),new Ed(t)};st.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(B(188)):(e=Object.keys(e).join(","),Error(B(268,e)));return e=Pm(t),e=e===null?null:e.stateNode,e};st.flushSync=function(e){return sr(e)};st.hydrate=function(e,t,n){if(!Bl(t))throw Error(B(200));return Vl(null,e,t,!0,n)};st.hydrateRoot=function(e,t,n){if(!Nd(e))throw Error(B(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",s=sy;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=iy(t,null,e,1,n??null,o,!1,i,s),e[tn]=t.current,oi(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new Fl(t)};st.render=function(e,t,n){if(!Bl(t))throw Error(B(200));return Vl(null,e,t,!1,n)};st.unmountComponentAtNode=function(e){if(!Bl(e))throw Error(B(40));return e._reactRootContainer?(sr(function(){Vl(null,null,e,!1,function(){e._reactRootContainer=null,e[tn]=null})}),!0):!1};st.unstable_batchedUpdates=gd;st.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Bl(n))throw Error(B(200));if(e==null||e._reactInternals===void 0)throw Error(B(38));return Vl(e,t,n,!1,r)};st.version="18.3.0-next-8a015b68cc-20240425";function ly(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(ly)}catch(e){console.error(e)}}ly(),lm.exports=st;var Hl=lm.exports;const uE=jc(Hl);var bh=Hl;cu.createRoot=bh.createRoot,cu.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 _h="popstate";function cE(e={}){function t(r,o){let{pathname:i,search:s,hash:l}=r.location;return rc("",{pathname:i,search:s,hash:l},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(r,o){return typeof o=="string"?o:hi(o)}return fE(t,n,null,e)}function me(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function pt(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function dE(){return Math.random().toString(36).substring(2,10)}function Ph(e,t){return{usr:e.state,key:e.key,idx:t}}function rc(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?uo(t):t,state:n,key:t&&t.key||r||dE()}}function hi({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 uo(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 fE(e,t,n,r={}){let{window:o=document.defaultView,v5Compat:i=!1}=r,s=o.history,l="POP",a=null,u=d();u==null&&(u=0,s.replaceState({...s.state,idx:u},""));function d(){return(s.state||{idx:null}).idx}function c(){l="POP";let S=d(),p=S==null?null:S-u;u=S,a&&a({action:l,location:w.location,delta:p})}function f(S,p){l="PUSH";let g=rc(w.location,S,p);u=d()+1;let m=Ph(g,u),E=w.createHref(g);try{s.pushState(m,"",E)}catch(N){if(N instanceof DOMException&&N.name==="DataCloneError")throw N;o.location.assign(E)}i&&a&&a({action:l,location:w.location,delta:1})}function y(S,p){l="REPLACE";let g=rc(w.location,S,p);u=d();let m=Ph(g,u),E=w.createHref(g);s.replaceState(m,"",E),i&&a&&a({action:l,location:w.location,delta:0})}function x(S){let p=o.location.origin!=="null"?o.location.origin:o.location.href,g=typeof S=="string"?S:hi(S);return g=g.replace(/ $/,"%20"),me(p,`No window.location.(origin|href) available to create URL for href: ${g}`),new URL(g,p)}let w={get action(){return l},get location(){return e(o,s)},listen(S){if(a)throw new Error("A history only accepts one active listener");return o.addEventListener(_h,c),a=S,()=>{o.removeEventListener(_h,c),a=null}},createHref(S){return t(o,S)},createURL:x,encodeLocation(S){let p=x(S);return{pathname:p.pathname,search:p.search,hash:p.hash}},push:f,replace:y,go(S){return s.go(S)}};return w}function ay(e,t,n="/"){return hE(e,t,n,!1)}function hE(e,t,n,r){let o=typeof t=="string"?uo(t):t,i=An(o.pathname||"/",n);if(i==null)return null;let s=uy(e);pE(s);let l=null;for(let a=0;l==null&&a<s.length;++a){let u=CE(i);l=NE(s[a],u,r)}return l}function uy(e,t=[],n=[],r=""){let o=(i,s,l)=>{let a={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:s,route:i};a.relativePath.startsWith("/")&&(me(a.relativePath.startsWith(r),`Absolute route path "${a.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),a.relativePath=a.relativePath.slice(r.length));let u=Jt([r,a.relativePath]),d=n.concat(a);i.children&&i.children.length>0&&(me(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${u}".`),uy(i.children,t,d,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:SE(u,i.index),routesMeta:d})};return e.forEach((i,s)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))o(i,s);else for(let a of cy(i.path))o(i,s,a)}),t}function cy(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return o?[i,""]:[i];let s=cy(r.join("/")),l=[];return l.push(...s.map(a=>a===""?i:[i,a].join("/"))),o&&l.push(...s),l.map(a=>e.startsWith("/")&&a===""?"/":a)}function pE(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:EE(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var mE=/^:[\w-]+$/,gE=3,yE=2,vE=1,xE=10,wE=-2,jh=e=>e==="*";function SE(e,t){let n=e.split("/"),r=n.length;return n.some(jh)&&(r+=wE),t&&(r+=yE),n.filter(o=>!jh(o)).reduce((o,i)=>o+(mE.test(i)?gE:i===""?vE:xE),r)}function EE(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function NE(e,t,n=!1){let{routesMeta:r}=e,o={},i="/",s=[];for(let l=0;l<r.length;++l){let a=r[l],u=l===r.length-1,d=i==="/"?t:t.slice(i.length)||"/",c=cl({path:a.relativePath,caseSensitive:a.caseSensitive,end:u},d),f=a.route;if(!c&&u&&n&&!r[r.length-1].route.index&&(c=cl({path:a.relativePath,caseSensitive:a.caseSensitive,end:!1},d)),!c)return null;Object.assign(o,c.params),s.push({params:o,pathname:Jt([i,c.pathname]),pathnameBase:jE(Jt([i,c.pathnameBase])),route:f}),c.pathnameBase!=="/"&&(i=Jt([i,c.pathnameBase]))}return s}function cl(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=kE(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let i=o[0],s=i.replace(/(.)\/+$/,"$1"),l=o.slice(1);return{params:r.reduce((u,{paramName:d,isOptional:c},f)=>{if(d==="*"){let x=l[f]||"";s=i.slice(0,i.length-x.length).replace(/(.)\/+$/,"$1")}const y=l[f];return c&&!y?u[d]=void 0:u[d]=(y||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:s,pattern:e}}function kE(e,t=!1,n=!0){pt(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=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,l,a)=>(r.push({paramName:l,isOptional:a!=null}),a?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function CE(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return pt(!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 An(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 bE(e,t="/"){let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?uo(e):e;return{pathname:n?n.startsWith("/")?n:_E(n,t):t,search:ME(r),hash:RE(o)}}function _E(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function Ha(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 PE(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function kd(e){let t=PE(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Cd(e,t,n,r=!1){let o;typeof e=="string"?o=uo(e):(o={...e},me(!o.pathname||!o.pathname.includes("?"),Ha("?","pathname","search",o)),me(!o.pathname||!o.pathname.includes("#"),Ha("#","pathname","hash",o)),me(!o.search||!o.search.includes("#"),Ha("#","search","hash",o)));let i=e===""||o.pathname==="",s=i?"/":o.pathname,l;if(s==null)l=n;else{let c=t.length-1;if(!r&&s.startsWith("..")){let f=s.split("/");for(;f[0]==="..";)f.shift(),c-=1;o.pathname=f.join("/")}l=c>=0?t[c]:"/"}let a=bE(o,l),u=s&&s!=="/"&&s.endsWith("/"),d=(i||s===".")&&n.endsWith("/");return!a.pathname.endsWith("/")&&(u||d)&&(a.pathname+="/"),a}var Jt=e=>e.join("/").replace(/\/\/+/g,"/"),jE=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),ME=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,RE=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function TE(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var dy=["POST","PUT","PATCH","DELETE"];new Set(dy);var IE=["GET",...dy];new Set(IE);var co=v.createContext(null);co.displayName="DataRouter";var Ul=v.createContext(null);Ul.displayName="DataRouterState";var fy=v.createContext({isTransitioning:!1});fy.displayName="ViewTransition";var LE=v.createContext(new Map);LE.displayName="Fetchers";var AE=v.createContext(null);AE.displayName="Await";var Pt=v.createContext(null);Pt.displayName="Navigation";var ji=v.createContext(null);ji.displayName="Location";var mt=v.createContext({outlet:null,matches:[],isDataRoute:!1});mt.displayName="Route";var bd=v.createContext(null);bd.displayName="RouteError";function DE(e,{relative:t}={}){me(fo(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=v.useContext(Pt),{hash:o,pathname:i,search:s}=Mi(e,{relative:t}),l=i;return n!=="/"&&(l=i==="/"?n:Jt([n,i])),r.createHref({pathname:l,search:s,hash:o})}function fo(){return v.useContext(ji)!=null}function Vt(){return me(fo(),"useLocation() may be used only in the context of a <Router> component."),v.useContext(ji).location}var hy="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function py(e){v.useContext(Pt).static||v.useLayoutEffect(e)}function Wl(){let{isDataRoute:e}=v.useContext(mt);return e?ZE():zE()}function zE(){me(fo(),"useNavigate() may be used only in the context of a <Router> component.");let e=v.useContext(co),{basename:t,navigator:n}=v.useContext(Pt),{matches:r}=v.useContext(mt),{pathname:o}=Vt(),i=JSON.stringify(kd(r)),s=v.useRef(!1);return py(()=>{s.current=!0}),v.useCallback((a,u={})=>{if(pt(s.current,hy),!s.current)return;if(typeof a=="number"){n.go(a);return}let d=Cd(a,JSON.parse(i),o,u.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Jt([t,d.pathname])),(u.replace?n.replace:n.push)(d,u.state,u)},[t,n,i,o,e])}var $E=v.createContext(null);function OE(e){let t=v.useContext(mt).outlet;return t&&v.createElement($E.Provider,{value:e},t)}function FE(){let{matches:e}=v.useContext(mt),t=e[e.length-1];return t?t.params:{}}function Mi(e,{relative:t}={}){let{matches:n}=v.useContext(mt),{pathname:r}=Vt(),o=JSON.stringify(kd(n));return v.useMemo(()=>Cd(e,JSON.parse(o),r,t==="path"),[e,o,r,t])}function BE(e,t){return my(e,t)}function my(e,t,n,r){var p;me(fo(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=v.useContext(Pt),{matches:i}=v.useContext(mt),s=i[i.length-1],l=s?s.params:{},a=s?s.pathname:"/",u=s?s.pathnameBase:"/",d=s&&s.route;{let g=d&&d.path||"";gy(a,!d||g.endsWith("*")||g.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${a}" (under <Route path="${g}">) 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="${g}"> to <Route path="${g==="/"?"*":`${g}/*`}">.`)}let c=Vt(),f;if(t){let g=typeof t=="string"?uo(t):t;me(u==="/"||((p=g.pathname)==null?void 0:p.startsWith(u)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${u}" but pathname "${g.pathname}" was given in the \`location\` prop.`),f=g}else f=c;let y=f.pathname||"/",x=y;if(u!=="/"){let g=u.replace(/^\//,"").split("/");x="/"+y.replace(/^\//,"").split("/").slice(g.length).join("/")}let w=ay(e,{pathname:x});pt(d||w!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),pt(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 S=YE(w&&w.map(g=>Object.assign({},g,{params:Object.assign({},l,g.params),pathname:Jt([u,o.encodeLocation?o.encodeLocation(g.pathname).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?u:Jt([u,o.encodeLocation?o.encodeLocation(g.pathnameBase).pathname:g.pathnameBase])})),i,n,r);return t&&S?v.createElement(ji.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...f},navigationType:"POP"}},S):S}function VE(){let e=qE(),t=TE(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)",o={padding:"0.5rem",backgroundColor:r},i={padding:"2px 4px",backgroundColor:r},s=null;return console.error("Error handled by React Router default ErrorBoundary:",e),s=v.createElement(v.Fragment,null,v.createElement("p",null,"💿 Hey developer 👋"),v.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",v.createElement("code",{style:i},"ErrorBoundary")," or"," ",v.createElement("code",{style:i},"errorElement")," prop on your route.")),v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},t),n?v.createElement("pre",{style:o},n):null,s)}var HE=v.createElement(VE,null),UE=class extends v.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?v.createElement(mt.Provider,{value:this.props.routeContext},v.createElement(bd.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function WE({routeContext:e,match:t,children:n}){let r=v.useContext(co);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),v.createElement(mt.Provider,{value:e},n)}function YE(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 o=e,i=n==null?void 0:n.errors;if(i!=null){let a=o.findIndex(u=>u.route.id&&(i==null?void 0:i[u.route.id])!==void 0);me(a>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),o=o.slice(0,Math.min(o.length,a+1))}let s=!1,l=-1;if(n)for(let a=0;a<o.length;a++){let u=o[a];if((u.route.HydrateFallback||u.route.hydrateFallbackElement)&&(l=a),u.route.id){let{loaderData:d,errors:c}=n,f=u.route.loader&&!d.hasOwnProperty(u.route.id)&&(!c||c[u.route.id]===void 0);if(u.route.lazy||f){s=!0,l>=0?o=o.slice(0,l+1):o=[o[0]];break}}}return o.reduceRight((a,u,d)=>{let c,f=!1,y=null,x=null;n&&(c=i&&u.route.id?i[u.route.id]:void 0,y=u.route.errorElement||HE,s&&(l<0&&d===0?(gy("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),f=!0,x=null):l===d&&(f=!0,x=u.route.hydrateFallbackElement||null)));let w=t.concat(o.slice(0,d+1)),S=()=>{let p;return c?p=y:f?p=x:u.route.Component?p=v.createElement(u.route.Component,null):u.route.element?p=u.route.element:p=a,v.createElement(WE,{match:u,routeContext:{outlet:a,matches:w,isDataRoute:n!=null},children:p})};return n&&(u.route.ErrorBoundary||u.route.errorElement||d===0)?v.createElement(UE,{location:n.location,revalidation:n.revalidation,component:y,error:c,children:S(),routeContext:{outlet:null,matches:w,isDataRoute:!0}}):S()},null)}function _d(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function XE(e){let t=v.useContext(co);return me(t,_d(e)),t}function GE(e){let t=v.useContext(Ul);return me(t,_d(e)),t}function KE(e){let t=v.useContext(mt);return me(t,_d(e)),t}function Pd(e){let t=KE(e),n=t.matches[t.matches.length-1];return me(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function QE(){return Pd("useRouteId")}function qE(){var r;let e=v.useContext(bd),t=GE("useRouteError"),n=Pd("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function ZE(){let{router:e}=XE("useNavigate"),t=Pd("useNavigate"),n=v.useRef(!1);return py(()=>{n.current=!0}),v.useCallback(async(o,i={})=>{pt(n.current,hy),n.current&&(typeof o=="number"?e.navigate(o):await e.navigate(o,{fromRouteId:t,...i}))},[e,t])}var Mh={};function gy(e,t,n){!t&&!Mh[e]&&(Mh[e]=!0,pt(!1,n))}v.memo(JE);function JE({routes:e,future:t,state:n}){return my(e,void 0,n,t)}function oc({to:e,replace:t,state:n,relative:r}){me(fo(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=v.useContext(Pt);pt(!o,"<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:i}=v.useContext(mt),{pathname:s}=Vt(),l=Wl(),a=Cd(e,kd(i),s,r==="path"),u=JSON.stringify(a);return v.useEffect(()=>{l(JSON.parse(u),{replace:t,state:n,relative:r})},[l,u,r,t,n]),null}function e2(e){return OE(e.context)}function yt(e){me(!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 t2({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:o,static:i=!1}){me(!fo(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let s=e.replace(/^\/*/,"/"),l=v.useMemo(()=>({basename:s,navigator:o,static:i,future:{}}),[s,o,i]);typeof n=="string"&&(n=uo(n));let{pathname:a="/",search:u="",hash:d="",state:c=null,key:f="default"}=n,y=v.useMemo(()=>{let x=An(a,s);return x==null?null:{location:{pathname:x,search:u,hash:d,state:c,key:f},navigationType:r}},[s,a,u,d,c,f,r]);return pt(y!=null,`<Router basename="${s}"> is not able to match the URL "${a}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),y==null?null:v.createElement(Pt.Provider,{value:l},v.createElement(ji.Provider,{children:t,value:y}))}function n2({children:e,location:t}){return BE(ic(e),t)}function ic(e,t=[]){let n=[];return v.Children.forEach(e,(r,o)=>{if(!v.isValidElement(r))return;let i=[...t,o];if(r.type===v.Fragment){n.push.apply(n,ic(r.props.children,i));return}me(r.type===yt,`[${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>`),me(!r.props.index||!r.props.children,"An index route cannot have child routes.");let s={id:r.props.id||i.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&&(s.children=ic(r.props.children,i)),n.push(s)}),n}var Rs="get",Ts="application/x-www-form-urlencoded";function Yl(e){return e!=null&&typeof e.tagName=="string"}function r2(e){return Yl(e)&&e.tagName.toLowerCase()==="button"}function o2(e){return Yl(e)&&e.tagName.toLowerCase()==="form"}function i2(e){return Yl(e)&&e.tagName.toLowerCase()==="input"}function s2(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function l2(e,t){return e.button===0&&(!t||t==="_self")&&!s2(e)}function sc(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(o=>[n,o]):[[n,r]])},[]))}function a2(e,t){let n=sc(e);return t&&t.forEach((r,o)=>{n.has(o)||t.getAll(o).forEach(i=>{n.append(o,i)})}),n}var rs=null;function u2(){if(rs===null)try{new FormData(document.createElement("form"),0),rs=!1}catch{rs=!0}return rs}var c2=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Ua(e){return e!=null&&!c2.has(e)?(pt(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ts}"`),null):e}function d2(e,t){let n,r,o,i,s;if(o2(e)){let l=e.getAttribute("action");r=l?An(l,t):null,n=e.getAttribute("method")||Rs,o=Ua(e.getAttribute("enctype"))||Ts,i=new FormData(e)}else if(r2(e)||i2(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 a=e.getAttribute("formaction")||l.getAttribute("action");if(r=a?An(a,t):null,n=e.getAttribute("formmethod")||l.getAttribute("method")||Rs,o=Ua(e.getAttribute("formenctype"))||Ua(l.getAttribute("enctype"))||Ts,i=new FormData(l,e),!u2()){let{name:u,type:d,value:c}=e;if(d==="image"){let f=u?`${u}.`:"";i.append(`${f}x`,"0"),i.append(`${f}y`,"0")}else u&&i.append(u,c)}}else{if(Yl(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Rs,r=null,o=Ts,s=e}return i&&o==="text/plain"&&(s=i,i=void 0),{action:r,method:n.toLowerCase(),encType:o,formData:i,body:s}}function jd(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}async function f2(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 h2(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 p2(e,t,n){let r=await Promise.all(e.map(async o=>{let i=t.routes[o.route.id];if(i){let s=await f2(i,n);return s.links?s.links():[]}return[]}));return v2(r.flat(1).filter(h2).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function Rh(e,t,n,r,o,i){let s=(a,u)=>n[u]?a.route.id!==n[u].route.id:!0,l=(a,u)=>{var d;return n[u].pathname!==a.pathname||((d=n[u].route.path)==null?void 0:d.endsWith("*"))&&n[u].params["*"]!==a.params["*"]};return i==="assets"?t.filter((a,u)=>s(a,u)||l(a,u)):i==="data"?t.filter((a,u)=>{var c;let d=r.routes[a.route.id];if(!d||!d.hasLoader)return!1;if(s(a,u)||l(a,u))return!0;if(a.route.shouldRevalidate){let f=a.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:((c=n[0])==null?void 0:c.params)||{},nextUrl:new URL(e,window.origin),nextParams:a.params,defaultShouldRevalidate:!0});if(typeof f=="boolean")return f}return!0}):[]}function m2(e,t){return g2(e.map(n=>{let r=t.routes[n.route.id];if(!r)return[];let o=[r.module];return r.imports&&(o=o.concat(r.imports)),o}).flat(1))}function g2(e){return[...new Set(e)]}function y2(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function v2(e,t){let n=new Set;return new Set(t),e.reduce((r,o)=>{let i=JSON.stringify(y2(o));return n.has(i)||(n.add(i),r.push({key:i,link:o})),r},[])}function x2(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 w2(){let e=v.useContext(co);return jd(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function S2(){let e=v.useContext(Ul);return jd(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Md=v.createContext(void 0);Md.displayName="FrameworkContext";function yy(){let e=v.useContext(Md);return jd(e,"You must render this element inside a <HydratedRouter> element"),e}function E2(e,t){let n=v.useContext(Md),[r,o]=v.useState(!1),[i,s]=v.useState(!1),{onFocus:l,onBlur:a,onMouseEnter:u,onMouseLeave:d,onTouchStart:c}=t,f=v.useRef(null);v.useEffect(()=>{if(e==="render"&&s(!0),e==="viewport"){let w=p=>{p.forEach(g=>{s(g.isIntersecting)})},S=new IntersectionObserver(w,{threshold:.5});return f.current&&S.observe(f.current),()=>{S.disconnect()}}},[e]),v.useEffect(()=>{if(r){let w=setTimeout(()=>{s(!0)},100);return()=>{clearTimeout(w)}}},[r]);let y=()=>{o(!0)},x=()=>{o(!1),s(!1)};return n?e!=="intent"?[i,f,{}]:[i,f,{onFocus:bo(l,y),onBlur:bo(a,x),onMouseEnter:bo(u,y),onMouseLeave:bo(d,x),onTouchStart:bo(c,y)}]:[!1,f,{}]}function bo(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function N2({page:e,...t}){let{router:n}=w2(),r=v.useMemo(()=>ay(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?v.createElement(C2,{page:e,matches:r,...t}):null}function k2(e){let{manifest:t,routeModules:n}=yy(),[r,o]=v.useState([]);return v.useEffect(()=>{let i=!1;return p2(e,t,n).then(s=>{i||o(s)}),()=>{i=!0}},[e,t,n]),r}function C2({page:e,matches:t,...n}){let r=Vt(),{manifest:o,routeModules:i}=yy(),{loaderData:s,matches:l}=S2(),a=v.useMemo(()=>Rh(e,t,l,o,r,"data"),[e,t,l,o,r]),u=v.useMemo(()=>Rh(e,t,l,o,r,"assets"),[e,t,l,o,r]),d=v.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let y=new Set,x=!1;if(t.forEach(S=>{var g;let p=o.routes[S.route.id];!p||!p.hasLoader||(!a.some(m=>m.route.id===S.route.id)&&S.route.id in s&&((g=i[S.route.id])!=null&&g.shouldRevalidate)||p.hasClientLoader?x=!0:y.add(S.route.id))}),y.size===0)return[];let w=x2(e);return x&&y.size>0&&w.searchParams.set("_routes",t.filter(S=>y.has(S.route.id)).map(S=>S.route.id).join(",")),[w.pathname+w.search]},[s,r,o,a,t,e,i]),c=v.useMemo(()=>m2(u,o),[u,o]),f=k2(u);return v.createElement(v.Fragment,null,d.map(y=>v.createElement("link",{key:y,rel:"prefetch",as:"fetch",href:y,...n})),c.map(y=>v.createElement("link",{key:y,rel:"modulepreload",href:y,...n})),f.map(({key:y,link:x})=>v.createElement("link",{key:y,...x})))}function b2(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var vy=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{vy&&(window.__reactRouterVersion="7.1.0")}catch{}function _2({basename:e,children:t,window:n}){let r=v.useRef();r.current==null&&(r.current=cE({window:n,v5Compat:!0}));let o=r.current,[i,s]=v.useState({action:o.action,location:o.location}),l=v.useCallback(a=>{v.startTransition(()=>s(a))},[s]);return v.useLayoutEffect(()=>o.listen(l),[o,l]),v.createElement(t2,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:o})}var xy=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Xl=v.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:o,reloadDocument:i,replace:s,state:l,target:a,to:u,preventScrollReset:d,viewTransition:c,...f},y){let{basename:x}=v.useContext(Pt),w=typeof u=="string"&&xy.test(u),S,p=!1;if(typeof u=="string"&&w&&(S=u,vy))try{let R=new URL(window.location.href),z=u.startsWith("//")?new URL(R.protocol+u):new URL(u),I=An(z.pathname,x);z.origin===R.origin&&I!=null?u=I+z.search+z.hash:p=!0}catch{pt(!1,`<Link to="${u}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let g=DE(u,{relative:o}),[m,E,N]=E2(r,f),C=M2(u,{replace:s,state:l,target:a,preventScrollReset:d,relative:o,viewTransition:c});function k(R){t&&t(R),R.defaultPrevented||C(R)}let P=v.createElement("a",{...f,...N,href:S||g,onClick:p||i?t:k,ref:b2(y,E),target:a,"data-discover":!w&&n==="render"?"true":void 0});return m&&!w?v.createElement(v.Fragment,null,P,v.createElement(N2,{page:g})):P});Xl.displayName="Link";var wy=v.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:o=!1,style:i,to:s,viewTransition:l,children:a,...u},d){let c=Mi(s,{relative:u.relative}),f=Vt(),y=v.useContext(Ul),{navigator:x,basename:w}=v.useContext(Pt),S=y!=null&&D2(c)&&l===!0,p=x.encodeLocation?x.encodeLocation(c).pathname:c.pathname,g=f.pathname,m=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;n||(g=g.toLowerCase(),m=m?m.toLowerCase():null,p=p.toLowerCase()),m&&w&&(m=An(m,w)||m);const E=p!=="/"&&p.endsWith("/")?p.length-1:p.length;let N=g===p||!o&&g.startsWith(p)&&g.charAt(E)==="/",C=m!=null&&(m===p||!o&&m.startsWith(p)&&m.charAt(p.length)==="/"),k={isActive:N,isPending:C,isTransitioning:S},P=N?t:void 0,R;typeof r=="function"?R=r(k):R=[r,N?"active":null,C?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let z=typeof i=="function"?i(k):i;return v.createElement(Xl,{...u,"aria-current":P,className:R,ref:d,style:z,to:s,viewTransition:l},typeof a=="function"?a(k):a)});wy.displayName="NavLink";var P2=v.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:o,state:i,method:s=Rs,action:l,onSubmit:a,relative:u,preventScrollReset:d,viewTransition:c,...f},y)=>{let x=L2(),w=A2(l,{relative:u}),S=s.toLowerCase()==="get"?"get":"post",p=typeof l=="string"&&xy.test(l),g=m=>{if(a&&a(m),m.defaultPrevented)return;m.preventDefault();let E=m.nativeEvent.submitter,N=(E==null?void 0:E.getAttribute("formmethod"))||s;x(E||m.currentTarget,{fetcherKey:t,method:N,navigate:n,replace:o,state:i,relative:u,preventScrollReset:d,viewTransition:c})};return v.createElement("form",{ref:y,method:S,action:w,onSubmit:r?a:g,...f,"data-discover":!p&&e==="render"?"true":void 0})});P2.displayName="Form";function j2(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Sy(e){let t=v.useContext(co);return me(t,j2(e)),t}function M2(e,{target:t,replace:n,state:r,preventScrollReset:o,relative:i,viewTransition:s}={}){let l=Wl(),a=Vt(),u=Mi(e,{relative:i});return v.useCallback(d=>{if(l2(d,t)){d.preventDefault();let c=n!==void 0?n:hi(a)===hi(u);l(e,{replace:c,state:r,preventScrollReset:o,relative:i,viewTransition:s})}},[a,l,u,n,r,t,e,o,i,s])}function R2(e){pt(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=v.useRef(sc(e)),n=v.useRef(!1),r=Vt(),o=v.useMemo(()=>a2(r.search,n.current?null:t.current),[r.search]),i=Wl(),s=v.useCallback((l,a)=>{const u=sc(typeof l=="function"?l(o):l);n.current=!0,i("?"+u,a)},[i,o]);return[o,s]}var T2=0,I2=()=>`__${String(++T2)}__`;function L2(){let{router:e}=Sy("useSubmit"),{basename:t}=v.useContext(Pt),n=QE();return v.useCallback(async(r,o={})=>{let{action:i,method:s,encType:l,formData:a,body:u}=d2(r,t);if(o.navigate===!1){let d=o.fetcherKey||I2();await e.fetch(d,n,o.action||i,{preventScrollReset:o.preventScrollReset,formData:a,body:u,formMethod:o.method||s,formEncType:o.encType||l,flushSync:o.flushSync})}else await e.navigate(o.action||i,{preventScrollReset:o.preventScrollReset,formData:a,body:u,formMethod:o.method||s,formEncType:o.encType||l,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})},[e,t,n])}function A2(e,{relative:t}={}){let{basename:n}=v.useContext(Pt),r=v.useContext(mt);me(r,"useFormAction must be used inside a RouteContext");let[o]=r.matches.slice(-1),i={...Mi(e||".",{relative:t})},s=Vt();if(e==null){i.search=s.search;let l=new URLSearchParams(i.search),a=l.getAll("index");if(a.some(d=>d==="")){l.delete("index"),a.filter(c=>c).forEach(c=>l.append("index",c));let d=l.toString();i.search=d?`?${d}`:""}}return(!e||e===".")&&o.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(i.pathname=i.pathname==="/"?n:Jt([n,i.pathname])),hi(i)}function D2(e,t={}){let n=v.useContext(fy);me(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Sy("useViewTransitionState"),o=Mi(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=An(n.currentLocation.pathname,r)||n.currentLocation.pathname,s=An(n.nextLocation.pathname,r)||n.nextLocation.pathname;return cl(o.pathname,s)!=null||cl(o.pathname,i)!=null}new TextEncoder;const Ey=v.createContext(null);function z2({children:e}){const[t,n]=v.useState(()=>localStorage.getItem("opentrust_theme")||"dark"),r=o=>{n(o),localStorage.setItem("opentrust_theme",o)};return v.useEffect(()=>{const o=document.documentElement;if(o.classList.remove("light","dark"),t==="system"){const i=window.matchMedia("(prefers-color-scheme: dark)").matches;o.classList.add(i?"dark":"light")}else o.classList.add(t)},[t]),h.jsx(Ey.Provider,{value:{theme:t,setTheme:r},children:e})}function $2(){const e=v.useContext(Ey);if(!e)throw new Error("useTheme must be within ThemeProvider");return e}const O2={email:"dev@localhost",apiKey:"sk-og-dev"},Ny=v.createContext(null);function F2({children:e}){const[t,n]=v.useState(()=>{const l=localStorage.getItem("opentrust_user");return l?JSON.parse(l):null}),[r,o]=v.useState(!localStorage.getItem("opentrust_user"));v.useEffect(()=>{if(t){o(!1);return}let l=!1;return(async()=>{try{const a=await fetch("/api/auth/config");if(!a.ok)return;const u=await a.json();!l&&u.devMode&&n(O2)}catch{}finally{l||o(!1)}})(),()=>{l=!0}},[t]);const i=v.useCallback(async(l,a)=>{const u=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:l,apiKey:a})});if(!u.ok)throw new Error("Login failed");const d=await u.json();if(!d.success)throw new Error(d.error??"Login failed");const c={email:l,apiKey:a};n(c),localStorage.setItem("opentrust_user",JSON.stringify(c))},[]),s=v.useCallback(()=>{n(null),localStorage.removeItem("opentrust_user")},[]);return h.jsx(Ny.Provider,{value:{user:t,isAuthenticated:!!t,isLoading:r,login:i,logout:s},children:e})}function Rd(){const e=v.useContext(Ny);if(!e)throw new Error("useAuth must be within AuthProvider");return e}function ky(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=ky(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function B2(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=ky(e))&&(r&&(r+=" "),r+=t);return r}const Td="-";function V2(e){const t=U2(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function o(s){const l=s.split(Td);return l[0]===""&&l.length!==1&&l.shift(),Cy(l,t)||H2(s)}function i(s,l){const a=n[s]||[];return l&&r[s]?[...a,...r[s]]:a}return{getClassGroupId:o,getConflictingClassGroupIds:i}}function Cy(e,t){var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Cy(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(Td);return(s=t.validators.find(({validator:l})=>l(i)))==null?void 0:s.classGroupId}const Th=/^\[(.+)\]$/;function H2(e){if(Th.test(e)){const t=Th.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function U2(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Y2(Object.entries(e.classGroups),n).forEach(([i,s])=>{lc(s,r,i,t)}),r}function lc(e,t,n,r){e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:Ih(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(W2(o)){lc(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{lc(s,Ih(t,i),n,r)})})}function Ih(e,t){let n=e;return t.split(Td).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function W2(e){return e.isThemeGetter}function Y2(e,t){return t?e.map(([n,r])=>{const o=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,l])=>[t+s,l])):i);return[n,o]}):e}function X2(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;function o(i,s){n.set(i,s),t++,t>e&&(t=0,r=n,n=new Map)}return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=r.get(i))!==void 0)return o(i,s),s},set(i,s){n.has(i)?n.set(i,s):o(i,s)}}}const by="!";function G2(e){const t=e.separator,n=t.length===1,r=t[0],o=t.length;return function(s){const l=[];let a=0,u=0,d;for(let w=0;w<s.length;w++){let S=s[w];if(a===0){if(S===r&&(n||s.slice(w,w+o)===t)){l.push(s.slice(u,w)),u=w+o;continue}if(S==="/"){d=w;continue}}S==="["?a++:S==="]"&&a--}const c=l.length===0?s:s.substring(u),f=c.startsWith(by),y=f?c.substring(1):c,x=d&&d>u?d-u:void 0;return{modifiers:l,hasImportantModifier:f,baseClassName:y,maybePostfixModifierPosition:x}}}function K2(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 Q2(e){return{cache:X2(e.cacheSize),splitModifiers:G2(e),...V2(e)}}const q2=/\s+/;function Z2(e,t){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=new Set;return e.trim().split(q2).map(s=>{const{modifiers:l,hasImportantModifier:a,baseClassName:u,maybePostfixModifierPosition:d}=n(s);let c=r(d?u.substring(0,d):u),f=!!d;if(!c){if(!d)return{isTailwindClass:!1,originalClassName:s};if(c=r(u),!c)return{isTailwindClass:!1,originalClassName:s};f=!1}const y=K2(l).join(":");return{isTailwindClass:!0,modifierId:a?y+by:y,classGroupId:c,originalClassName:s,hasPostfixModifier:f}}).reverse().filter(s=>{if(!s.isTailwindClass)return!0;const{modifierId:l,classGroupId:a,hasPostfixModifier:u}=s,d=l+a;return i.has(d)?!1:(i.add(d),o(a,u).forEach(c=>i.add(l+c)),!0)}).reverse().map(s=>s.originalClassName).join(" ")}function J2(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=_y(t))&&(r&&(r+=" "),r+=n);return r}function _y(e){if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=_y(e[r]))&&(n&&(n+=" "),n+=t);return n}function eN(e,...t){let n,r,o,i=s;function s(a){const u=t.reduce((d,c)=>c(d),e());return n=Q2(u),r=n.cache.get,o=n.cache.set,i=l,l(a)}function l(a){const u=r(a);if(u)return u;const d=Z2(a,n);return o(a,d),d}return function(){return i(J2.apply(null,arguments))}}function de(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const Py=/^\[(?:([a-z-]+):)?(.+)\]$/i,tN=/^\d+\/\d+$/,nN=new Set(["px","full","screen"]),rN=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,oN=/\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$/,iN=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,sN=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,lN=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function Wt(e){return Gn(e)||nN.has(e)||tN.test(e)}function cn(e){return ho(e,"length",mN)}function Gn(e){return!!e&&!Number.isNaN(Number(e))}function os(e){return ho(e,"number",Gn)}function _o(e){return!!e&&Number.isInteger(Number(e))}function aN(e){return e.endsWith("%")&&Gn(e.slice(0,-1))}function ee(e){return Py.test(e)}function dn(e){return rN.test(e)}const uN=new Set(["length","size","percentage"]);function cN(e){return ho(e,uN,jy)}function dN(e){return ho(e,"position",jy)}const fN=new Set(["image","url"]);function hN(e){return ho(e,fN,yN)}function pN(e){return ho(e,"",gN)}function Po(){return!0}function ho(e,t,n){const r=Py.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function mN(e){return oN.test(e)&&!iN.test(e)}function jy(){return!1}function gN(e){return sN.test(e)}function yN(e){return lN.test(e)}function vN(){const e=de("colors"),t=de("spacing"),n=de("blur"),r=de("brightness"),o=de("borderColor"),i=de("borderRadius"),s=de("borderSpacing"),l=de("borderWidth"),a=de("contrast"),u=de("grayscale"),d=de("hueRotate"),c=de("invert"),f=de("gap"),y=de("gradientColorStops"),x=de("gradientColorStopPositions"),w=de("inset"),S=de("margin"),p=de("opacity"),g=de("padding"),m=de("saturate"),E=de("scale"),N=de("sepia"),C=de("skew"),k=de("space"),P=de("translate"),R=()=>["auto","contain","none"],z=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto",ee,t],T=()=>[ee,t],F=()=>["",Wt,cn],_=()=>["auto",Gn,ee],A=()=>["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"],b=()=>["start","end","center","between","around","evenly","stretch"],j=()=>["","0",ee],L=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>[Gn,os],$=()=>[Gn,ee];return{cacheSize:500,separator:":",theme:{colors:[Po],spacing:[Wt,cn],blur:["none","",dn,ee],brightness:O(),borderColor:[e],borderRadius:["none","","full",dn,ee],borderSpacing:T(),borderWidth:F(),contrast:O(),grayscale:j(),hueRotate:$(),invert:j(),gap:T(),gradientColorStops:[e],gradientColorStopPositions:[aN,cn],inset:I(),margin:I(),opacity:O(),padding:T(),saturate:O(),scale:O(),sepia:j(),skew:$(),space:T(),translate:T()},classGroups:{aspect:[{aspect:["auto","square","video",ee]}],container:["container"],columns:[{columns:[dn]}],"break-after":[{"break-after":L()}],"break-before":[{"break-before":L()}],"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:[...A(),ee]}],overflow:[{overflow:z()}],"overflow-x":[{"overflow-x":z()}],"overflow-y":[{"overflow-y":z()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],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",_o,ee]}],basis:[{basis:I()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ee]}],grow:[{grow:j()}],shrink:[{shrink:j()}],order:[{order:["first","last","none",_o,ee]}],"grid-cols":[{"grid-cols":[Po]}],"col-start-end":[{col:["auto",{span:["full",_o,ee]},ee]}],"col-start":[{"col-start":_()}],"col-end":[{"col-end":_()}],"grid-rows":[{"grid-rows":[Po]}],"row-start-end":[{row:["auto",{span:[_o,ee]},ee]}],"row-start":[{"row-start":_()}],"row-end":[{"row-end":_()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ee]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ee]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...b()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...b(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...b(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[g]}],px:[{px:[g]}],py:[{py:[g]}],ps:[{ps:[g]}],pe:[{pe:[g]}],pt:[{pt:[g]}],pr:[{pr:[g]}],pb:[{pb:[g]}],pl:[{pl:[g]}],m:[{m:[S]}],mx:[{mx:[S]}],my:[{my:[S]}],ms:[{ms:[S]}],me:[{me:[S]}],mt:[{mt:[S]}],mr:[{mr:[S]}],mb:[{mb:[S]}],ml:[{ml:[S]}],"space-x":[{"space-x":[k]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[k]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ee,t]}],"min-w":[{"min-w":[ee,t,"min","max","fit"]}],"max-w":[{"max-w":[ee,t,"none","full","min","max","fit","prose",{screen:[dn]},dn]}],h:[{h:[ee,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ee,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ee,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ee,t,"auto","min","max","fit"]}],"font-size":[{text:["base",dn,cn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",os]}],"font-family":[{font:[Po]}],"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",ee]}],"line-clamp":[{"line-clamp":["none",Gn,os]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Wt,ee]}],"list-image":[{"list-image":["none",ee]}],"list-style-type":[{list:["none","disc","decimal",ee]}],"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",Wt,cn]}],"underline-offset":[{"underline-offset":["auto",Wt,ee]}],"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",ee]}],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",ee]}],"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:[...A(),dN]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",cN]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},hN]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[x]}],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[y]}],"gradient-via":[{via:[y]}],"gradient-to":[{to:[y]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"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:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...M()]}],"outline-offset":[{"outline-offset":[Wt,ee]}],"outline-w":[{outline:[Wt,cn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:F()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[p]}],"ring-offset-w":[{"ring-offset":[Wt,cn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",dn,pN]}],"shadow-color":[{shadow:[Po]}],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:[a]}],"drop-shadow":[{"drop-shadow":["","none",dn,ee]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[c]}],saturate:[{saturate:[m]}],sepia:[{sepia:[N]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[a]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[c]}],"backdrop-opacity":[{"backdrop-opacity":[p]}],"backdrop-saturate":[{"backdrop-saturate":[m]}],"backdrop-sepia":[{"backdrop-sepia":[N]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ee]}],duration:[{duration:$()}],ease:[{ease:["linear","in","out","in-out",ee]}],delay:[{delay:$()}],animate:[{animate:["none","spin","ping","pulse","bounce",ee]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[_o,ee]}],"translate-x":[{"translate-x":[P]}],"translate-y":[{"translate-y":[P]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ee]}],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",ee]}],"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",ee]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Wt,cn,os]}],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 xN=eN(vN);function Ne(...e){return xN(B2(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 wN=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),My=(...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 SN={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 EN=v.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:s,...l},a)=>v.createElement("svg",{ref:a,...SN,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:My("lucide",o),...l},[...s.map(([u,d])=>v.createElement(u,d)),...Array.isArray(i)?i:[i]]));/**
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 ae=(e,t)=>{const n=v.forwardRef(({className:r,...o},i)=>v.createElement(EN,{ref:i,iconNode:t,className:My(`lucide-${wN(e)}`,r),...o}));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 NN=ae("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
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 kN=ae("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"}]]);/**
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 Ry=ae("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"}]]);/**
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 Ty=ae("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
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 Iy=ae("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
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 CN=ae("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"}]]);/**
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 bN=ae("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
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 _N=ae("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"}]]);/**
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 PN=ae("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
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 pi=ae("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"}]]);/**
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 Id=ae("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"}]]);/**
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 Ly=ae("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"}]]);/**
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 jN=ae("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"}]]);/**
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 Gl=ae("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
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 MN=ae("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"}]]);/**
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 RN=ae("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
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 TN=ae("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"}]]);/**
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 ac=ae("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"}]]);/**
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 Ay=ae("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"}]]);/**
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 Dy=ae("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
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 dl=ae("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"}]]);/**
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 IN=ae("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"}]]);/**
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 Lh=ae("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
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 fl=ae("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"}]]);/**
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 zy=ae("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"}]]);/**
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 LN=ae("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"}]]);/**
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 $y=ae("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),AN=[{label:"Discovery",items:[{to:"/inventory/agents",label:"Agents",icon:Ry},{to:"/inventory/identities",label:"Identities",icon:Ly},{to:"/inventory/permissions",label:"Permissions",icon:jN}]},{label:"Secure",items:[{to:"/secure/risk",label:"Risk",icon:zy},{to:"/secure/graph",label:"Graph",icon:TN}]}];function DN(){const e=Vt(),[t,n]=v.useState("");return v.useEffect(()=>{fetch("/health").then(r=>r.json()).then(r=>n(r.version??"")).catch(()=>{})},[]),h.jsxs("aside",{className:"flex w-56 flex-col border-r border-border bg-card",children:[h.jsxs("div",{className:"flex h-14 items-center gap-2 border-b border-border px-4",children:[h.jsx("img",{src:"/dashboard/logo-512.png",alt:"OpenTrust",className:"h-6 w-6 dark:brightness-[1.8] dark:contrast-125"}),h.jsx("span",{className:"text-sm font-semibold tracking-tight text-foreground",children:"OpenTrust"})]}),h.jsx("nav",{className:"flex-1 space-y-6 px-3 py-4",children:AN.map(r=>h.jsxs("div",{children:[h.jsx("p",{className:"mb-2 px-2 text-[11px] font-medium uppercase tracking-wider text-muted-foreground",children:r.label}),h.jsx("div",{className:"space-y-0.5",children:r.items.map(o=>h.jsxs(wy,{to:o.to,className:Ne("flex items-center gap-2.5 rounded-md px-2 py-1.5 text-sm transition-colors",e.pathname.startsWith(o.to)?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[h.jsx(o.icon,{className:"h-4 w-4 shrink-0"}),o.label]},o.to))})]},r.label))}),h.jsx("div",{className:"border-t border-border px-4 py-3",children:h.jsx("p",{className:"text-[11px] text-muted-foreground",children:t?`v${t}`:""})})]})}function zN(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Oy(...e){return t=>e.forEach(n=>zN(n,t))}function Ft(...e){return v.useCallback(Oy(...e),e)}var qr=v.forwardRef((e,t)=>{const{children:n,...r}=e,o=v.Children.toArray(n),i=o.find(ON);if(i){const s=i.props.children,l=o.map(a=>a===i?v.Children.count(s)>1?v.Children.only(null):v.isValidElement(s)?s.props.children:null:a);return h.jsx(uc,{...r,ref:t,children:v.isValidElement(s)?v.cloneElement(s,void 0,l):null})}return h.jsx(uc,{...r,ref:t,children:n})});qr.displayName="Slot";var uc=v.forwardRef((e,t)=>{const{children:n,...r}=e;if(v.isValidElement(n)){const o=BN(n);return v.cloneElement(n,{...FN(r,n.props),ref:t?Oy(t,o):o})}return v.Children.count(n)>1?v.Children.only(null):null});uc.displayName="SlotClone";var $N=({children:e})=>h.jsx(h.Fragment,{children:e});function ON(e){return v.isValidElement(e)&&e.type===$N}function FN(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...l)=>{i(...l),o(...l)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function BN(e){var r,o;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=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Fy(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=Fy(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function VN(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=Fy(e))&&(r&&(r+=" "),r+=t);return r}const Ah=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,Dh=VN,HN=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Dh(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(u=>{const d=n==null?void 0:n[u],c=i==null?void 0:i[u];if(d===null)return null;const f=Ah(d)||Ah(c);return o[u][f]}),l=n&&Object.entries(n).reduce((u,d)=>{let[c,f]=d;return f===void 0||(u[c]=f),u},{}),a=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:c,className:f,...y}=d;return Object.entries(y).every(x=>{let[w,S]=x;return Array.isArray(S)?S.includes({...i,...l}[w]):{...i,...l}[w]===S})?[...u,c,f]:u},[]);return Dh(e,s,a,n==null?void 0:n.class,n==null?void 0:n.className)},UN=HN("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"}}),Me=v.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},i)=>{const s=r?qr:"button";return h.jsx(s,{className:Ne(UN({variant:t,size:n,className:e})),ref:i,...o})});Me.displayName="Button";function WN(){const{user:e,logout:t}=Rd(),{theme:n,setTheme:r}=$2();return h.jsxs("header",{className:"flex h-14 items-center justify-between border-b border-border bg-card px-6",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("div",{className:"h-2 w-2 rounded-full bg-success"}),h.jsx("span",{className:"text-xs text-muted-foreground",children:"Connected"})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[(e==null?void 0:e.email)&&h.jsx("span",{className:"text-xs text-muted-foreground",children:e.email}),h.jsx(Me,{variant:"ghost",size:"icon",onClick:()=>r(n==="dark"?"light":"dark"),className:"h-8 w-8",children:n==="dark"?h.jsx(IN,{className:"h-4 w-4"}):h.jsx(RN,{className:"h-4 w-4"})}),h.jsx(Me,{variant:"ghost",size:"icon",onClick:t,className:"h-8 w-8",children:h.jsx(MN,{className:"h-4 w-4"})})]})]})}function YN(){return h.jsxs("div",{className:"flex h-screen overflow-hidden bg-background",children:[h.jsx(DN,{}),h.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[h.jsx(WN,{}),h.jsx("main",{className:"flex-1 overflow-y-auto p-6",children:h.jsx(e2,{})})]})]})}const Dn=v.forwardRef(({className:e,type:t,...n},r)=>h.jsx("input",{type:t,className:Ne("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}));Dn.displayName="Input";function XN(){const[e]=R2(),[t,n]=v.useState(e.get("email")??""),[r,o]=v.useState(e.get("key")??""),[i,s]=v.useState(""),[l,a]=v.useState(!1),{login:u,isAuthenticated:d,isLoading:c}=Rd(),f=Wl();if(v.useEffect(()=>{d&&f("/inventory/agents",{replace:!0})},[d,f]),c)return h.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:h.jsx("div",{className:"text-muted-foreground text-sm",children:"Loading..."})});const y=async x=>{x.preventDefault(),s(""),a(!0);try{await u(t,r),f("/inventory/agents",{replace:!0})}catch(w){s(w instanceof Error?w.message:"Login failed")}finally{a(!1)}};return h.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:h.jsxs("div",{className:"w-full max-w-sm space-y-8 px-4",children:[h.jsxs("div",{className:"flex flex-col items-center gap-3",children:[h.jsx("img",{src:"/dashboard/logo-512.png",alt:"OpenTrust",className:"h-12 w-12 dark:brightness-[1.8] dark:contrast-125"}),h.jsxs("div",{className:"text-center",children:[h.jsx("h1",{className:"text-lg font-semibold tracking-tight text-foreground",children:"OpenTrust"}),h.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Sign in to your dashboard"})]})]}),h.jsxs("form",{onSubmit:y,className:"space-y-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx("label",{className:"text-sm font-medium text-foreground",children:"Email"}),h.jsx(Dn,{type:"email",placeholder:"you@example.com",value:t,onChange:x=>n(x.target.value),required:!0})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx("label",{className:"text-sm font-medium text-foreground",children:"API Key"}),h.jsx(Dn,{type:"password",placeholder:"sk-og-...",value:r,onChange:x=>o(x.target.value),required:!0})]}),i&&h.jsx("p",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:i}),h.jsx(Me,{type:"submit",className:"w-full",disabled:l,children:l?"Signing in...":"Sign in"})]}),h.jsx("p",{className:"text-center text-xs text-muted-foreground",children:"API Key is generated when registering an agent with the Core API."})]})})}const GN="/api";async function be(e,t){const n=localStorage.getItem("opentrust_user"),r=n?JSON.parse(n).apiKey:null,o=await fetch(`${GN}${e}`,{...t,headers:{"Content-Type":"application/json",...r&&{Authorization:`Bearer ${r}`},...t==null?void 0:t.headers}});if(!o.ok)throw new Error(`API ${o.status}: ${await o.text()}`);return o.json()}const ot={agents:{list:()=>be("/agents"),get:e=>be(`/agents/${e}`),create:e=>be("/agents",{method:"POST",body:JSON.stringify(e)}),update:(e,t)=>be(`/agents/${e}`,{method:"PUT",body:JSON.stringify(t)}),delete:e=>be(`/agents/${e}`,{method:"DELETE"})},discovery:{agents:()=>be("/discovery/agents"),profile:e=>be(`/discovery/agents/${e}/profile`)},observations:{recent:(e=50)=>be(`/observations?limit=${e}`),permissions:()=>be("/observations/permissions"),anomalies:()=>be("/observations/anomalies"),summary:()=>be("/observations/summary"),agentPermissions:e=>be(`/observations/agents/${e}/permissions`)},commands:{list:e=>be(`/commands?agentId=${e}`),create:e=>be("/commands",{method:"POST",body:JSON.stringify(e)})},detect:e=>be("/detect",{method:"POST",body:JSON.stringify(e)}),usage:{summary:(e=30)=>be(`/usage/summary?days=${e}`),daily:(e=30)=>be(`/usage/daily?days=${e}`)},settings:{get:()=>be("/settings"),update:e=>be("/settings",{method:"PUT",body:JSON.stringify(e)})}};function Ze({className:e,variant:t="default",...n}){return h.jsx("div",{className:Ne("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 KN(){const[e,t]=v.useState([]),[n,r]=v.useState(""),[o,i]=v.useState(!0),s=async()=>{i(!0);try{const u=await ot.discovery.agents();t(u.data??[])}catch{}i(!1)};v.useEffect(()=>{s()},[]);const l=e.filter(u=>{var d;return!n||((d=u.name)==null?void 0:d.toLowerCase().includes(n.toLowerCase()))}),a=u=>u==="active"?"success":u==="inactive"?"secondary":"warning";return h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Agents"}),h.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:[e.length," agent",e.length!==1?"s":""," discovered"]})]}),h.jsxs(Me,{variant:"outline",size:"sm",onClick:s,children:[h.jsx(Ay,{className:"h-3.5 w-3.5"}),"Scan"]})]}),h.jsxs("div",{className:"relative max-w-sm",children:[h.jsx(Dy,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),h.jsx(Dn,{placeholder:"Search agents...",className:"pl-9",value:n,onChange:u=>r(u.target.value)})]}),o?h.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):l.length===0?h.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 rounded-lg border border-dashed border-border",children:[h.jsx(Ry,{className:"h-8 w-8 text-muted-foreground/50"}),h.jsx("p",{className:"text-sm text-muted-foreground",children:"No agents found"})]}):h.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:l.map(u=>{var d;return h.jsxs(Xl,{to:`/inventory/agents/${u.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:[h.jsxs("div",{className:"flex items-start justify-between",children:[h.jsxs("div",{className:"flex items-center gap-2.5",children:[h.jsx("span",{className:"text-xl",children:u.emoji||"🤖"}),h.jsxs("div",{children:[h.jsx("p",{className:"text-sm font-medium text-foreground group-hover:text-foreground",children:u.name}),h.jsxs("p",{className:"text-xs text-muted-foreground",children:[u.provider||"unknown",u.model?` · ${u.model}`:""]})]})]}),h.jsx(Ze,{variant:a(u.status??"inactive"),className:"text-[10px]",children:u.status??"inactive"})]}),((d=u.skills)==null?void 0:d.length)>0&&h.jsxs("div",{className:"flex flex-wrap gap-1",children:[u.skills.slice(0,4).map(c=>h.jsx("span",{className:"rounded-md bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground",children:typeof c=="string"?c:c.name},c.name??c)),u.skills.length>4&&h.jsxs("span",{className:"rounded-md bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground",children:["+",u.skills.length-4]})]})]},u.id)})})]})}const En=v.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:Ne("rounded-lg border border-border bg-card text-card-foreground shadow-sm",e),...t}));En.displayName="Card";const Kn=v.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:Ne("flex flex-col space-y-1.5 p-6",e),...t}));Kn.displayName="CardHeader";const Qn=v.forwardRef(({className:e,...t},n)=>h.jsx("h3",{ref:n,className:Ne("font-semibold leading-none tracking-tight",e),...t}));Qn.displayName="CardTitle";const QN=v.forwardRef(({className:e,...t},n)=>h.jsx("p",{ref:n,className:Ne("text-sm text-muted-foreground",e),...t}));QN.displayName="CardDescription";const Nn=v.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:Ne("p-6 pt-0",e),...t}));Nn.displayName="CardContent";const Ld=v.forwardRef(({className:e,...t},n)=>h.jsx("textarea",{className:Ne("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}));Ld.displayName="Textarea";const Fr=v.forwardRef(({className:e,...t},n)=>h.jsx("label",{ref:n,className:Ne("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...t}));Fr.displayName="Label";function Le(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function qN(e,t){const n=v.createContext(t);function r(i){const{children:s,...l}=i,a=v.useMemo(()=>l,Object.values(l));return h.jsx(n.Provider,{value:a,children:s})}function o(i){const s=v.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return r.displayName=e+"Provider",[r,o]}function Kl(e,t=[]){let n=[];function r(i,s){const l=v.createContext(s),a=n.length;n=[...n,s];function u(c){const{scope:f,children:y,...x}=c,w=(f==null?void 0:f[e][a])||l,S=v.useMemo(()=>x,Object.values(x));return h.jsx(w.Provider,{value:S,children:y})}function d(c,f){const y=(f==null?void 0:f[e][a])||l,x=v.useContext(y);if(x)return x;if(s!==void 0)return s;throw new Error(`\`${c}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,d]}const o=()=>{const i=n.map(s=>v.createContext(s));return function(l){const a=(l==null?void 0:l[e])||i;return v.useMemo(()=>({[`__scope${e}`]:{...l,[e]:a}}),[l,a])}};return o.scopeName=e,[r,ZN(o,...t)]}function ZN(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((l,{useScope:a,scopeName:u})=>{const c=a(i)[`__scope${u}`];return{...l,...c}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function JN(e){const t=e+"CollectionProvider",[n,r]=Kl(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=y=>{const{scope:x,children:w}=y,S=It.useRef(null),p=It.useRef(new Map).current;return h.jsx(o,{scope:x,itemMap:p,collectionRef:S,children:w})};s.displayName=t;const l=e+"CollectionSlot",a=It.forwardRef((y,x)=>{const{scope:w,children:S}=y,p=i(l,w),g=Ft(x,p.collectionRef);return h.jsx(qr,{ref:g,children:S})});a.displayName=l;const u=e+"CollectionItemSlot",d="data-radix-collection-item",c=It.forwardRef((y,x)=>{const{scope:w,children:S,...p}=y,g=It.useRef(null),m=Ft(x,g),E=i(u,w);return It.useEffect(()=>(E.itemMap.set(g,{ref:g,...p}),()=>void E.itemMap.delete(g))),h.jsx(qr,{[d]:"",ref:m,children:S})});c.displayName=u;function f(y){const x=i(e+"CollectionConsumer",y);return It.useCallback(()=>{const S=x.collectionRef.current;if(!S)return[];const p=Array.from(S.querySelectorAll(`[${d}]`));return Array.from(x.itemMap.values()).sort((E,N)=>p.indexOf(E.ref.current)-p.indexOf(N.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:s,Slot:a,ItemSlot:c},f,r]}var hl=globalThis!=null&&globalThis.document?v.useLayoutEffect:()=>{},ek=Zw.useId||(()=>{}),tk=0;function Xo(e){const[t,n]=v.useState(ek());return hl(()=>{n(r=>r??String(tk++))},[e]),t?`radix-${t}`:""}var nk=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],We=nk.reduce((e,t)=>{const n=v.forwardRef((r,o)=>{const{asChild:i,...s}=r,l=i?qr:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(l,{...s,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function rk(e,t){e&&Hl.flushSync(()=>e.dispatchEvent(t))}function zn(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Ad({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=ok({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,l=zn(n),a=v.useCallback(u=>{if(i){const c=typeof u=="function"?u(e):u;c!==e&&l(c)}else o(u)},[i,e,o,l]);return[s,a]}function ok({defaultProp:e,onChange:t}){const n=v.useState(e),[r]=n,o=v.useRef(r),i=zn(t);return v.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}var ik=v.createContext(void 0);function By(e){const t=v.useContext(ik);return e||t||"ltr"}var Wa="rovingFocusGroup.onEntryFocus",sk={bubbles:!1,cancelable:!0},Ql="RovingFocusGroup",[cc,Vy,lk]=JN(Ql),[ak,Hy]=Kl(Ql,[lk]),[uk,ck]=ak(Ql),Uy=v.forwardRef((e,t)=>h.jsx(cc.Provider,{scope:e.__scopeRovingFocusGroup,children:h.jsx(cc.Slot,{scope:e.__scopeRovingFocusGroup,children:h.jsx(dk,{...e,ref:t})})}));Uy.displayName=Ql;var dk=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:a,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...c}=e,f=v.useRef(null),y=Ft(t,f),x=By(i),[w=null,S]=Ad({prop:s,defaultProp:l,onChange:a}),[p,g]=v.useState(!1),m=zn(u),E=Vy(n),N=v.useRef(!1),[C,k]=v.useState(0);return v.useEffect(()=>{const P=f.current;if(P)return P.addEventListener(Wa,m),()=>P.removeEventListener(Wa,m)},[m]),h.jsx(uk,{scope:n,orientation:r,dir:x,loop:o,currentTabStopId:w,onItemFocus:v.useCallback(P=>S(P),[S]),onItemShiftTab:v.useCallback(()=>g(!0),[]),onFocusableItemAdd:v.useCallback(()=>k(P=>P+1),[]),onFocusableItemRemove:v.useCallback(()=>k(P=>P-1),[]),children:h.jsx(We.div,{tabIndex:p||C===0?-1:0,"data-orientation":r,...c,ref:y,style:{outline:"none",...e.style},onMouseDown:Le(e.onMouseDown,()=>{N.current=!0}),onFocus:Le(e.onFocus,P=>{const R=!N.current;if(P.target===P.currentTarget&&R&&!p){const z=new CustomEvent(Wa,sk);if(P.currentTarget.dispatchEvent(z),!z.defaultPrevented){const I=E().filter(M=>M.focusable),T=I.find(M=>M.active),F=I.find(M=>M.id===w),A=[T,F,...I].filter(Boolean).map(M=>M.ref.current);Xy(A,d)}}N.current=!1}),onBlur:Le(e.onBlur,()=>g(!1))})})}),Wy="RovingFocusGroupItem",Yy=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,l=Xo(),a=i||l,u=ck(Wy,n),d=u.currentTabStopId===a,c=Vy(n),{onFocusableItemAdd:f,onFocusableItemRemove:y}=u;return v.useEffect(()=>{if(r)return f(),()=>y()},[r,f,y]),h.jsx(cc.ItemSlot,{scope:n,id:a,focusable:r,active:o,children:h.jsx(We.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:Le(e.onMouseDown,x=>{r?u.onItemFocus(a):x.preventDefault()}),onFocus:Le(e.onFocus,()=>u.onItemFocus(a)),onKeyDown:Le(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){u.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const w=pk(x,u.orientation,u.dir);if(w!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let p=c().filter(g=>g.focusable).map(g=>g.ref.current);if(w==="last")p.reverse();else if(w==="prev"||w==="next"){w==="prev"&&p.reverse();const g=p.indexOf(x.currentTarget);p=u.loop?mk(p,g+1):p.slice(g+1)}setTimeout(()=>Xy(p))}})})})});Yy.displayName=Wy;var fk={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function hk(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function pk(e,t,n){const r=hk(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return fk[r]}function Xy(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function mk(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var gk=Uy,yk=Yy;function vk(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var Ri=e=>{const{present:t,children:n}=e,r=xk(t),o=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),i=Ft(r.ref,wk(o));return typeof n=="function"||r.isPresent?v.cloneElement(o,{ref:i}):null};Ri.displayName="Presence";function xk(e){const[t,n]=v.useState(),r=v.useRef({}),o=v.useRef(e),i=v.useRef("none"),s=e?"mounted":"unmounted",[l,a]=vk(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const u=is(r.current);i.current=l==="mounted"?u:"none"},[l]),hl(()=>{const u=r.current,d=o.current;if(d!==e){const f=i.current,y=is(u);e?a("MOUNT"):y==="none"||(u==null?void 0:u.display)==="none"?a("UNMOUNT"):a(d&&f!==y?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,a]),hl(()=>{if(t){const u=c=>{const y=is(r.current).includes(c.animationName);c.target===t&&y&&Hl.flushSync(()=>a("ANIMATION_END"))},d=c=>{c.target===t&&(i.current=is(r.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else a("ANIMATION_END")},[t,a]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:v.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function is(e){return(e==null?void 0:e.animationName)||"none"}function wk(e){var r,o;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=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Dd="Tabs",[Sk]=Kl(Dd,[Hy]),Gy=Hy(),[Ek,zd]=Sk(Dd),Ky=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:l,activationMode:a="automatic",...u}=e,d=By(l),[c,f]=Ad({prop:r,onChange:o,defaultProp:i});return h.jsx(Ek,{scope:n,baseId:Xo(),value:c,onValueChange:f,orientation:s,dir:d,activationMode:a,children:h.jsx(We.div,{dir:d,"data-orientation":s,...u,ref:t})})});Ky.displayName=Dd;var Qy="TabsList",qy=v.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=zd(Qy,n),s=Gy(n);return h.jsx(gk,{asChild:!0,...s,orientation:i.orientation,dir:i.dir,loop:r,children:h.jsx(We.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});qy.displayName=Qy;var Zy="TabsTrigger",Jy=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,s=zd(Zy,n),l=Gy(n),a=nv(s.baseId,r),u=rv(s.baseId,r),d=r===s.value;return h.jsx(yk,{asChild:!0,...l,focusable:!o,active:d,children:h.jsx(We.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:a,...i,ref:t,onMouseDown:Le(e.onMouseDown,c=>{!o&&c.button===0&&c.ctrlKey===!1?s.onValueChange(r):c.preventDefault()}),onKeyDown:Le(e.onKeyDown,c=>{[" ","Enter"].includes(c.key)&&s.onValueChange(r)}),onFocus:Le(e.onFocus,()=>{const c=s.activationMode!=="manual";!d&&!o&&c&&s.onValueChange(r)})})})});Jy.displayName=Zy;var ev="TabsContent",tv=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...s}=e,l=zd(ev,n),a=nv(l.baseId,r),u=rv(l.baseId,r),d=r===l.value,c=v.useRef(d);return v.useEffect(()=>{const f=requestAnimationFrame(()=>c.current=!1);return()=>cancelAnimationFrame(f)},[]),h.jsx(Ri,{present:o||d,children:({present:f})=>h.jsx(We.div,{"data-state":d?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":a,hidden:!f,id:u,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:c.current?"0s":void 0},children:f&&i})})});tv.displayName=ev;function nv(e,t){return`${e}-trigger-${t}`}function rv(e,t){return`${e}-content-${t}`}var Nk=Ky,ov=qy,iv=Jy,sv=tv;const kk=Nk,lv=v.forwardRef(({className:e,...t},n)=>h.jsx(ov,{ref:n,className:Ne("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));lv.displayName=ov.displayName;const dc=v.forwardRef(({className:e,...t},n)=>h.jsx(iv,{ref:n,className:Ne("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}));dc.displayName=iv.displayName;const fc=v.forwardRef(({className:e,...t},n)=>h.jsx(sv,{ref:n,className:Ne("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));fc.displayName=sv.displayName;function Ck(e,t=globalThis==null?void 0:globalThis.document){const n=zn(e);v.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var bk="DismissableLayer",hc="dismissableLayer.update",_k="dismissableLayer.pointerDownOutside",Pk="dismissableLayer.focusOutside",zh,av=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),uv=v.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:l,...a}=e,u=v.useContext(av),[d,c]=v.useState(null),f=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=v.useState({}),x=Ft(t,k=>c(k)),w=Array.from(u.layers),[S]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),p=w.indexOf(S),g=d?w.indexOf(d):-1,m=u.layersWithOutsidePointerEventsDisabled.size>0,E=g>=p,N=Rk(k=>{const P=k.target,R=[...u.branches].some(z=>z.contains(P));!E||R||(o==null||o(k),s==null||s(k),k.defaultPrevented||l==null||l())},f),C=Tk(k=>{const P=k.target;[...u.branches].some(z=>z.contains(P))||(i==null||i(k),s==null||s(k),k.defaultPrevented||l==null||l())},f);return Ck(k=>{g===u.layers.size-1&&(r==null||r(k),!k.defaultPrevented&&l&&(k.preventDefault(),l()))},f),v.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(zh=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),$h(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=zh)}},[d,f,n,u]),v.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),$h())},[d,u]),v.useEffect(()=>{const k=()=>y({});return document.addEventListener(hc,k),()=>document.removeEventListener(hc,k)},[]),h.jsx(We.div,{...a,ref:x,style:{pointerEvents:m?E?"auto":"none":void 0,...e.style},onFocusCapture:Le(e.onFocusCapture,C.onFocusCapture),onBlurCapture:Le(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:Le(e.onPointerDownCapture,N.onPointerDownCapture)})});uv.displayName=bk;var jk="DismissableLayerBranch",Mk=v.forwardRef((e,t)=>{const n=v.useContext(av),r=v.useRef(null),o=Ft(t,r);return v.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),h.jsx(We.div,{...e,ref:o})});Mk.displayName=jk;function Rk(e,t=globalThis==null?void 0:globalThis.document){const n=zn(e),r=v.useRef(!1),o=v.useRef(()=>{});return v.useEffect(()=>{const i=l=>{if(l.target&&!r.current){let a=function(){cv(_k,n,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=a,t.addEventListener("click",o.current,{once:!0})):a()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Tk(e,t=globalThis==null?void 0:globalThis.document){const n=zn(e),r=v.useRef(!1);return v.useEffect(()=>{const o=i=>{i.target&&!r.current&&cv(Pk,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function $h(){const e=new CustomEvent(hc);document.dispatchEvent(e)}function cv(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?rk(o,i):o.dispatchEvent(i)}var Ya="focusScope.autoFocusOnMount",Xa="focusScope.autoFocusOnUnmount",Oh={bubbles:!1,cancelable:!0},Ik="FocusScope",dv=v.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[l,a]=v.useState(null),u=zn(o),d=zn(i),c=v.useRef(null),f=Ft(t,w=>a(w)),y=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let w=function(m){if(y.paused||!l)return;const E=m.target;l.contains(E)?c.current=E:pn(c.current,{select:!0})},S=function(m){if(y.paused||!l)return;const E=m.relatedTarget;E!==null&&(l.contains(E)||pn(c.current,{select:!0}))},p=function(m){if(document.activeElement===document.body)for(const N of m)N.removedNodes.length>0&&pn(l)};document.addEventListener("focusin",w),document.addEventListener("focusout",S);const g=new MutationObserver(p);return l&&g.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",S),g.disconnect()}}},[r,l,y.paused]),v.useEffect(()=>{if(l){Bh.add(y);const w=document.activeElement;if(!l.contains(w)){const p=new CustomEvent(Ya,Oh);l.addEventListener(Ya,u),l.dispatchEvent(p),p.defaultPrevented||(Lk(Ok(fv(l)),{select:!0}),document.activeElement===w&&pn(l))}return()=>{l.removeEventListener(Ya,u),setTimeout(()=>{const p=new CustomEvent(Xa,Oh);l.addEventListener(Xa,d),l.dispatchEvent(p),p.defaultPrevented||pn(w??document.body,{select:!0}),l.removeEventListener(Xa,d),Bh.remove(y)},0)}}},[l,u,d,y]);const x=v.useCallback(w=>{if(!n&&!r||y.paused)return;const S=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,p=document.activeElement;if(S&&p){const g=w.currentTarget,[m,E]=Ak(g);m&&E?!w.shiftKey&&p===E?(w.preventDefault(),n&&pn(m,{select:!0})):w.shiftKey&&p===m&&(w.preventDefault(),n&&pn(E,{select:!0})):p===g&&w.preventDefault()}},[n,r,y.paused]);return h.jsx(We.div,{tabIndex:-1,...s,ref:f,onKeyDown:x})});dv.displayName=Ik;function Lk(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(pn(r,{select:t}),document.activeElement!==n)return}function Ak(e){const t=fv(e),n=Fh(t,e),r=Fh(t.reverse(),e);return[n,r]}function fv(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Fh(e,t){for(const n of e)if(!Dk(n,{upTo:t}))return n}function Dk(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 zk(e){return e instanceof HTMLInputElement&&"select"in e}function pn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&zk(e)&&t&&e.select()}}var Bh=$k();function $k(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Vh(e,t),e.unshift(t)},remove(t){var n;e=Vh(e,t),(n=e[0])==null||n.resume()}}}function Vh(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Ok(e){return e.filter(t=>t.tagName!=="A")}var Fk="Portal",hv=v.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[o,i]=v.useState(!1);hl(()=>i(!0),[]);const s=n||o&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return s?uE.createPortal(h.jsx(We.div,{...r,ref:t}),s):null});hv.displayName=Fk;var Ga=0;function Bk(){v.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Hh()),document.body.insertAdjacentElement("beforeend",e[1]??Hh()),Ga++,()=>{Ga===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ga--}},[])}function Hh(){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 Dt=function(){return Dt=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Dt.apply(this,arguments)};function pv(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 o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function Vk(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var Is="right-scroll-bar-position",Ls="width-before-scroll-bar",Hk="with-scroll-bars-hidden",Uk="--removed-body-scroll-bar-size";function Ka(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Wk(e,t){var n=v.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var Yk=typeof window<"u"?v.useLayoutEffect:v.useEffect,Uh=new WeakMap;function Xk(e,t){var n=Wk(null,function(r){return e.forEach(function(o){return Ka(o,r)})});return Yk(function(){var r=Uh.get(n);if(r){var o=new Set(r),i=new Set(e),s=n.current;o.forEach(function(l){i.has(l)||Ka(l,null)}),i.forEach(function(l){o.has(l)||Ka(l,s)})}Uh.set(n,e)},[e]),n}function Gk(e){return e}function Kk(e,t){t===void 0&&(t=Gk);var n=[],r=!1,o={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(i){var s=t(i,r);return n.push(s),function(){n=n.filter(function(l){return l!==s})}},assignSyncMedium:function(i){for(r=!0;n.length;){var s=n;n=[],s.forEach(i)}n={push:function(l){return i(l)},filter:function(){return n}}},assignMedium:function(i){r=!0;var s=[];if(n.length){var l=n;n=[],l.forEach(i),s=n}var a=function(){var d=s;s=[],d.forEach(i)},u=function(){return Promise.resolve().then(a)};u(),n={push:function(d){s.push(d),u()},filter:function(d){return s=s.filter(d),n}}}};return o}function Qk(e){e===void 0&&(e={});var t=Kk(null);return t.options=Dt({async:!0,ssr:!1},e),t}var mv=function(e){var t=e.sideCar,n=pv(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 v.createElement(r,Dt({},n))};mv.isSideCarExport=!0;function qk(e,t){return e.useMedium(t),mv}var gv=Qk(),Qa=function(){},ql=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:Qa,onWheelCapture:Qa,onTouchMoveCapture:Qa}),o=r[0],i=r[1],s=e.forwardProps,l=e.children,a=e.className,u=e.removeScrollBar,d=e.enabled,c=e.shards,f=e.sideCar,y=e.noIsolation,x=e.inert,w=e.allowPinchZoom,S=e.as,p=S===void 0?"div":S,g=e.gapMode,m=pv(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=f,N=Xk([n,t]),C=Dt(Dt({},m),o);return v.createElement(v.Fragment,null,d&&v.createElement(E,{sideCar:gv,removeScrollBar:u,shards:c,noIsolation:y,inert:x,setCallbacks:i,allowPinchZoom:!!w,lockRef:n,gapMode:g}),s?v.cloneElement(v.Children.only(l),Dt(Dt({},C),{ref:N})):v.createElement(p,Dt({},C,{className:a,ref:N}),l))});ql.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ql.classNames={fullWidth:Ls,zeroRight:Is};var Zk=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Jk(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Zk();return t&&e.setAttribute("nonce",t),e}function eC(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function tC(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var nC=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Jk())&&(eC(t,n),tC(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},rC=function(){var e=nC();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},yv=function(){var e=rC(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},oC={left:0,top:0,right:0,gap:0},qa=function(e){return parseInt(e||"",10)||0},iC=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[qa(n),qa(r),qa(o)]},sC=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return oC;var t=iC(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])}},lC=yv(),Br="data-scroll-locked",aC=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,l=e.gap;return n===void 0&&(n="margin"),`
207
- .`.concat(Hk,` {
208
- overflow: hidden `).concat(r,`;
209
- padding-right: `).concat(l,"px ").concat(r,`;
210
- }
211
- body[`).concat(Br,`] {
212
- overflow: hidden `).concat(r,`;
213
- overscroll-behavior: contain;
214
- `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
215
- padding-left: `.concat(o,`px;
216
- padding-top: `).concat(i,`px;
217
- padding-right: `).concat(s,`px;
218
- margin-left:0;
219
- margin-top:0;
220
- margin-right: `).concat(l,"px ").concat(r,`;
221
- `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
222
- }
223
-
224
- .`).concat(Is,` {
225
- right: `).concat(l,"px ").concat(r,`;
226
- }
227
-
228
- .`).concat(Ls,` {
229
- margin-right: `).concat(l,"px ").concat(r,`;
230
- }
231
-
232
- .`).concat(Is," .").concat(Is,` {
233
- right: 0 `).concat(r,`;
234
- }
235
-
236
- .`).concat(Ls," .").concat(Ls,` {
237
- margin-right: 0 `).concat(r,`;
238
- }
239
-
240
- body[`).concat(Br,`] {
241
- `).concat(Uk,": ").concat(l,`px;
242
- }
243
- `)},Wh=function(){var e=parseInt(document.body.getAttribute(Br)||"0",10);return isFinite(e)?e:0},uC=function(){v.useEffect(function(){return document.body.setAttribute(Br,(Wh()+1).toString()),function(){var e=Wh()-1;e<=0?document.body.removeAttribute(Br):document.body.setAttribute(Br,e.toString())}},[])},cC=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;uC();var i=v.useMemo(function(){return sC(o)},[o]);return v.createElement(lC,{styles:aC(i,!t,o,n?"":"!important")})},pc=!1;if(typeof window<"u")try{var ss=Object.defineProperty({},"passive",{get:function(){return pc=!0,!0}});window.addEventListener("test",ss,ss),window.removeEventListener("test",ss,ss)}catch{pc=!1}var gr=pc?{passive:!1}:!1,dC=function(e){return e.tagName==="TEXTAREA"},vv=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!dC(e)&&n[t]==="visible")},fC=function(e){return vv(e,"overflowY")},hC=function(e){return vv(e,"overflowX")},Yh=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=xv(e,r);if(o){var i=wv(e,r),s=i[1],l=i[2];if(s>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},pC=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},mC=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},xv=function(e,t){return e==="v"?fC(t):hC(t)},wv=function(e,t){return e==="v"?pC(t):mC(t)},gC=function(e,t){return e==="h"&&t==="rtl"?-1:1},yC=function(e,t,n,r,o){var i=gC(e,window.getComputedStyle(t).direction),s=i*r,l=n.target,a=t.contains(l),u=!1,d=s>0,c=0,f=0;do{var y=wv(e,l),x=y[0],w=y[1],S=y[2],p=w-S-i*x;(x||p)&&xv(e,l)&&(c+=p,f+=x),l instanceof ShadowRoot?l=l.host:l=l.parentNode}while(!a&&l!==document.body||a&&(t.contains(l)||t===l));return(d&&Math.abs(c)<1||!d&&Math.abs(f)<1)&&(u=!0),u},ls=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Xh=function(e){return[e.deltaX,e.deltaY]},Gh=function(e){return e&&"current"in e?e.current:e},vC=function(e,t){return e[0]===t[0]&&e[1]===t[1]},xC=function(e){return`
244
- .block-interactivity-`.concat(e,` {pointer-events: none;}
245
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
246
- `)},wC=0,yr=[];function SC(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),o=v.useState(wC++)[0],i=v.useState(yv)[0],s=v.useRef(e);v.useEffect(function(){s.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var w=Vk([e.lockRef.current],(e.shards||[]).map(Gh),!0).filter(Boolean);return w.forEach(function(S){return S.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),w.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=v.useCallback(function(w,S){if("touches"in w&&w.touches.length===2)return!s.current.allowPinchZoom;var p=ls(w),g=n.current,m="deltaX"in w?w.deltaX:g[0]-p[0],E="deltaY"in w?w.deltaY:g[1]-p[1],N,C=w.target,k=Math.abs(m)>Math.abs(E)?"h":"v";if("touches"in w&&k==="h"&&C.type==="range")return!1;var P=Yh(k,C);if(!P)return!0;if(P?N=k:(N=k==="v"?"h":"v",P=Yh(k,C)),!P)return!1;if(!r.current&&"changedTouches"in w&&(m||E)&&(r.current=N),!N)return!0;var R=r.current||N;return yC(R,S,w,R==="h"?m:E)},[]),a=v.useCallback(function(w){var S=w;if(!(!yr.length||yr[yr.length-1]!==i)){var p="deltaY"in S?Xh(S):ls(S),g=t.current.filter(function(N){return N.name===S.type&&(N.target===S.target||S.target===N.shadowParent)&&vC(N.delta,p)})[0];if(g&&g.should){S.cancelable&&S.preventDefault();return}if(!g){var m=(s.current.shards||[]).map(Gh).filter(Boolean).filter(function(N){return N.contains(S.target)}),E=m.length>0?l(S,m[0]):!s.current.noIsolation;E&&S.cancelable&&S.preventDefault()}}},[]),u=v.useCallback(function(w,S,p,g){var m={name:w,delta:S,target:p,should:g,shadowParent:EC(p)};t.current.push(m),setTimeout(function(){t.current=t.current.filter(function(E){return E!==m})},1)},[]),d=v.useCallback(function(w){n.current=ls(w),r.current=void 0},[]),c=v.useCallback(function(w){u(w.type,Xh(w),w.target,l(w,e.lockRef.current))},[]),f=v.useCallback(function(w){u(w.type,ls(w),w.target,l(w,e.lockRef.current))},[]);v.useEffect(function(){return yr.push(i),e.setCallbacks({onScrollCapture:c,onWheelCapture:c,onTouchMoveCapture:f}),document.addEventListener("wheel",a,gr),document.addEventListener("touchmove",a,gr),document.addEventListener("touchstart",d,gr),function(){yr=yr.filter(function(w){return w!==i}),document.removeEventListener("wheel",a,gr),document.removeEventListener("touchmove",a,gr),document.removeEventListener("touchstart",d,gr)}},[]);var y=e.removeScrollBar,x=e.inert;return v.createElement(v.Fragment,null,x?v.createElement(i,{styles:xC(o)}):null,y?v.createElement(cC,{gapMode:e.gapMode}):null)}function EC(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const NC=qk(gv,SC);var Sv=v.forwardRef(function(e,t){return v.createElement(ql,Dt({},e,{ref:t,sideCar:NC}))});Sv.classNames=ql.classNames;var kC=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},vr=new WeakMap,as=new WeakMap,us={},Za=0,Ev=function(e){return e&&(e.host||Ev(e.parentNode))},CC=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Ev(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})},bC=function(e,t,n,r){var o=CC(t,Array.isArray(e)?e:[e]);us[n]||(us[n]=new WeakMap);var i=us[n],s=[],l=new Set,a=new Set(o),u=function(c){!c||l.has(c)||(l.add(c),u(c.parentNode))};o.forEach(u);var d=function(c){!c||a.has(c)||Array.prototype.forEach.call(c.children,function(f){if(l.has(f))d(f);else try{var y=f.getAttribute(r),x=y!==null&&y!=="false",w=(vr.get(f)||0)+1,S=(i.get(f)||0)+1;vr.set(f,w),i.set(f,S),s.push(f),w===1&&x&&as.set(f,!0),S===1&&f.setAttribute(n,"true"),x||f.setAttribute(r,"true")}catch(p){console.error("aria-hidden: cannot operate on ",f,p)}})};return d(t),l.clear(),Za++,function(){s.forEach(function(c){var f=vr.get(c)-1,y=i.get(c)-1;vr.set(c,f),i.set(c,y),f||(as.has(c)||c.removeAttribute(r),as.delete(c)),y||c.removeAttribute(n)}),Za--,Za||(vr=new WeakMap,vr=new WeakMap,as=new WeakMap,us={})}},_C=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=kC(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),bC(r,o,n,"aria-hidden")):function(){return null}},$d="Dialog",[Nv]=Kl($d),[PC,jt]=Nv($d),kv=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,l=v.useRef(null),a=v.useRef(null),[u=!1,d]=Ad({prop:r,defaultProp:o,onChange:i});return h.jsx(PC,{scope:t,triggerRef:l,contentRef:a,contentId:Xo(),titleId:Xo(),descriptionId:Xo(),open:u,onOpenChange:d,onOpenToggle:v.useCallback(()=>d(c=>!c),[d]),modal:s,children:n})};kv.displayName=$d;var Cv="DialogTrigger",jC=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=jt(Cv,n),i=Ft(t,o.triggerRef);return h.jsx(We.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Bd(o.open),...r,ref:i,onClick:Le(e.onClick,o.onOpenToggle)})});jC.displayName=Cv;var Od="DialogPortal",[MC,bv]=Nv(Od,{forceMount:void 0}),_v=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=jt(Od,t);return h.jsx(MC,{scope:t,forceMount:n,children:v.Children.map(r,s=>h.jsx(Ri,{present:n||i.open,children:h.jsx(hv,{asChild:!0,container:o,children:s})}))})};_v.displayName=Od;var pl="DialogOverlay",Pv=v.forwardRef((e,t)=>{const n=bv(pl,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=jt(pl,e.__scopeDialog);return i.modal?h.jsx(Ri,{present:r||i.open,children:h.jsx(RC,{...o,ref:t})}):null});Pv.displayName=pl;var RC=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=jt(pl,n);return h.jsx(Sv,{as:qr,allowPinchZoom:!0,shards:[o.contentRef],children:h.jsx(We.div,{"data-state":Bd(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),lr="DialogContent",jv=v.forwardRef((e,t)=>{const n=bv(lr,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=jt(lr,e.__scopeDialog);return h.jsx(Ri,{present:r||i.open,children:i.modal?h.jsx(TC,{...o,ref:t}):h.jsx(IC,{...o,ref:t})})});jv.displayName=lr;var TC=v.forwardRef((e,t)=>{const n=jt(lr,e.__scopeDialog),r=v.useRef(null),o=Ft(t,n.contentRef,r);return v.useEffect(()=>{const i=r.current;if(i)return _C(i)},[]),h.jsx(Mv,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Le(e.onCloseAutoFocus,i=>{var s;i.preventDefault(),(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:Le(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,l=s.button===0&&s.ctrlKey===!0;(s.button===2||l)&&i.preventDefault()}),onFocusOutside:Le(e.onFocusOutside,i=>i.preventDefault())})}),IC=v.forwardRef((e,t)=>{const n=jt(lr,e.__scopeDialog),r=v.useRef(!1),o=v.useRef(!1);return h.jsx(Mv,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s,l;(s=e.onCloseAutoFocus)==null||s.call(e,i),i.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{var a,u;(a=e.onInteractOutside)==null||a.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(s))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),Mv=v.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,l=jt(lr,n),a=v.useRef(null),u=Ft(t,a);return Bk(),h.jsxs(h.Fragment,{children:[h.jsx(dv,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:h.jsx(uv,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Bd(l.open),...s,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),h.jsxs(h.Fragment,{children:[h.jsx(LC,{titleId:l.titleId}),h.jsx(DC,{contentRef:a,descriptionId:l.descriptionId})]})]})}),Fd="DialogTitle",Rv=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=jt(Fd,n);return h.jsx(We.h2,{id:o.titleId,...r,ref:t})});Rv.displayName=Fd;var Tv="DialogDescription",Iv=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=jt(Tv,n);return h.jsx(We.p,{id:o.descriptionId,...r,ref:t})});Iv.displayName=Tv;var Lv="DialogClose",Av=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=jt(Lv,n);return h.jsx(We.button,{type:"button",...r,ref:t,onClick:Le(e.onClick,()=>o.onOpenChange(!1))})});Av.displayName=Lv;function Bd(e){return e?"open":"closed"}var Dv="DialogTitleWarning",[N4,zv]=qN(Dv,{contentName:lr,titleName:Fd,docsSlug:"dialog"}),LC=({titleId:e})=>{const t=zv(Dv),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
247
-
248
- If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
249
-
250
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return v.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},AC="DialogDescriptionWarning",DC=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${zv(AC).contentName}}.`;return v.useEffect(()=>{var i;const o=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},zC=kv,$C=_v,$v=Pv,Ov=jv,Fv=Rv,Bv=Iv,OC=Av;const Vd=zC,FC=$C,Vv=v.forwardRef(({className:e,...t},n)=>h.jsx($v,{ref:n,className:Ne("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}));Vv.displayName=$v.displayName;const Zl=v.forwardRef(({className:e,children:t,...n},r)=>h.jsxs(FC,{children:[h.jsx(Vv,{}),h.jsxs(Ov,{ref:r,className:Ne("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,h.jsxs(OC,{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:[h.jsx($y,{className:"h-4 w-4"}),h.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Zl.displayName=Ov.displayName;const Hd=({className:e,...t})=>h.jsx("div",{className:Ne("flex flex-col space-y-1.5 text-center sm:text-left",e),...t}),Ud=({className:e,...t})=>h.jsx("div",{className:Ne("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t}),Jl=v.forwardRef(({className:e,...t},n)=>h.jsx(Fv,{ref:n,className:Ne("text-lg font-semibold leading-none tracking-tight",e),...t}));Jl.displayName=Fv.displayName;const ea=v.forwardRef(({className:e,...t},n)=>h.jsx(Bv,{ref:n,className:Ne("text-sm text-muted-foreground",e),...t}));ea.displayName=Bv.displayName;const BC=["Profile","Tasks","Identities","Permissions","Commands"];function VC(){const{id:e}=FE(),[t,n]=v.useState(null),[r,o]=v.useState([]),[i,s]=v.useState("Profile"),[l,a]=v.useState(!0);if(v.useEffect(()=>{e&&(a(!0),(async()=>{const d=await ot.discovery.profile(e).catch(()=>null),c=(d==null?void 0:d.data)??null;n(c);const f=(c==null?void 0:c.registeredAgentId)??e,y=await ot.observations.agentPermissions(f).catch(()=>({data:[]}));o((y==null?void 0:y.data)??[]),a(!1)})())},[e]),l)return h.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."});if(!t)return h.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Agent not found"});const u=t.registeredAgentId??e;return h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx(Xl,{to:"/inventory/agents",className:"rounded-md p-1.5 hover:bg-accent",children:h.jsx(NN,{className:"h-4 w-4"})}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("span",{className:"text-2xl",children:t.emoji||"🤖"}),h.jsxs("div",{children:[h.jsx("h1",{className:"text-lg font-semibold",children:t.name||e}),h.jsxs("p",{className:"text-sm text-muted-foreground",children:[t.provider||"unknown",t.model?` / ${t.model}`:""]})]})]})]}),h.jsx("div",{className:"flex gap-1 border-b border-border",children:BC.map(d=>h.jsx("button",{onClick:()=>s(d),className:Ne("border-b-2 px-4 py-2 text-sm font-medium transition-colors",i===d?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:d},d))}),i==="Profile"&&h.jsx(UC,{profile:t,agentId:u}),i==="Tasks"&&h.jsx(YC,{profile:t}),i==="Identities"&&h.jsx(XC,{profile:t}),i==="Permissions"&&h.jsx(GC,{permissions:r}),i==="Commands"&&h.jsx(WC,{agentId:u})]})}function Hv({open:e,onOpenChange:t,agentId:n,onSuccess:r}){const[o,i]=v.useState("registry"),[s,l]=v.useState(""),[a,u]=v.useState(""),[d,c]=v.useState(!1),f=()=>{l(""),u(""),i("registry")},y=async()=>{c(!0);try{if(o==="registry"){if(!s.trim())return;await ot.commands.create({agentId:n,type:"install_skill",payload:{skillName:s.trim()}})}else{if(!s.trim()||!a.trim())return;await ot.commands.create({agentId:n,type:"install_custom_skill",payload:{skillName:s.trim(),content:a}})}f(),t(!1),r==null||r()}catch{}c(!1)};return h.jsx(Vd,{open:e,onOpenChange:x=>{x||f(),t(x)},children:h.jsxs(Zl,{className:"sm:max-w-[520px]",children:[h.jsxs(Hd,{children:[h.jsxs(Jl,{className:"flex items-center gap-2",children:[h.jsx(pi,{className:"h-4 w-4"})," Install Skill"]}),h.jsx(ea,{children:"Install a skill from the registry or provide custom skill content."})]}),h.jsxs(kk,{value:o,onValueChange:x=>i(x),children:[h.jsxs(lv,{className:"w-full",children:[h.jsxs(dc,{value:"registry",className:"flex-1",children:[h.jsx(ac,{className:"mr-1.5 h-3.5 w-3.5"})," Registry"]}),h.jsxs(dc,{value:"custom",className:"flex-1",children:[h.jsx(Id,{className:"mr-1.5 h-3.5 w-3.5"})," Custom"]})]}),h.jsx(fc,{value:"registry",className:"space-y-4 pt-2",children:h.jsxs("div",{className:"space-y-2",children:[h.jsx(Fr,{htmlFor:"reg-skill-name",children:"Skill Name"}),h.jsx(Dn,{id:"reg-skill-name",placeholder:"e.g. web-search, code-review...",value:s,onChange:x=>l(x.target.value),onKeyDown:x=>x.key==="Enter"&&y()}),h.jsxs("p",{className:"text-xs text-muted-foreground",children:["The skill will be installed via ",h.jsx("code",{className:"rounded bg-muted px-1",children:"openclaw skills install <name>"})]})]})}),h.jsxs(fc,{value:"custom",className:"space-y-4 pt-2",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(Fr,{htmlFor:"custom-skill-name",children:"Skill Name"}),h.jsx(Dn,{id:"custom-skill-name",placeholder:"my-custom-skill",value:s,onChange:x=>l(x.target.value)})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(Fr,{htmlFor:"custom-skill-content",children:"Skill Content"}),h.jsx(Ld,{id:"custom-skill-content",placeholder:`Paste your skill definition here...
251
-
252
- Supports JSON, YAML, or Markdown format.`,value:a,onChange:x=>u(x.target.value),className:"min-h-[180px] font-mono text-xs"}),h.jsx("p",{className:"text-xs text-muted-foreground",children:"The content will be saved to the agent's skills directory and installed locally."})]})]})]}),h.jsxs(Ud,{children:[h.jsx(Me,{variant:"outline",onClick:()=>{f(),t(!1)},children:"Cancel"}),h.jsxs(Me,{onClick:y,disabled:d||!s.trim()||o==="custom"&&!a.trim(),children:[d?h.jsx(Gl,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):h.jsx(pi,{className:"mr-1.5 h-3.5 w-3.5"}),"Install"]})]})]})})}function Uv({open:e,onOpenChange:t,agentId:n,initialName:r,onSuccess:o}){const[i,s]=v.useState(r??""),[l,a]=v.useState(!1);v.useEffect(()=>{r&&s(r)},[r]);const u=async()=>{if(i.trim()){a(!0);try{await ot.commands.create({agentId:n,type:"uninstall_skill",payload:{skillName:i.trim()}}),s(""),t(!1),o==null||o()}catch{}a(!1)}};return h.jsx(Vd,{open:e,onOpenChange:t,children:h.jsxs(Zl,{className:"sm:max-w-[400px]",children:[h.jsxs(Hd,{children:[h.jsxs(Jl,{className:"flex items-center gap-2",children:[h.jsx(fl,{className:"h-4 w-4"})," Uninstall Skill"]}),h.jsx(ea,{children:"This will send a command to remove the skill from the agent."})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(Fr,{htmlFor:"uninstall-name",children:"Skill Name"}),h.jsx(Dn,{id:"uninstall-name",placeholder:"Skill name to uninstall...",value:i,onChange:d=>s(d.target.value),onKeyDown:d=>d.key==="Enter"&&u()})]}),h.jsxs(Ud,{children:[h.jsx(Me,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),h.jsxs(Me,{variant:"destructive",onClick:u,disabled:l||!i.trim(),children:[l?h.jsx(Gl,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):h.jsx(fl,{className:"mr-1.5 h-3.5 w-3.5"}),"Uninstall"]})]})]})})}function HC({open:e,onOpenChange:t,agentId:n,onSuccess:r}){const[o,i]=v.useState(`{
253
- "blockOnRisk": false
254
- }`),[s,l]=v.useState(""),[a,u]=v.useState(!1),d=async()=>{l("");let c;try{c=JSON.parse(o)}catch{l("Invalid JSON");return}if(typeof c!="object"||c===null||Array.isArray(c)){l("Must be a JSON object");return}u(!0);try{await ot.commands.create({agentId:n,type:"update_config",payload:c}),t(!1),r==null||r()}catch{}u(!1)};return h.jsx(Vd,{open:e,onOpenChange:t,children:h.jsxs(Zl,{className:"sm:max-w-[460px]",children:[h.jsxs(Hd,{children:[h.jsxs(Jl,{className:"flex items-center gap-2",children:[h.jsx(dl,{className:"h-4 w-4"})," Update Guards Config"]}),h.jsx(ea,{children:"Send a configuration update to the Guards plugin. Values will be merged with the existing config."})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(Fr,{htmlFor:"config-json",children:"Config JSON"}),h.jsx(Ld,{id:"config-json",value:o,onChange:c=>{i(c.target.value),l("")},className:"min-h-[120px] font-mono text-xs"}),s&&h.jsx("p",{className:"text-xs text-destructive",children:s}),h.jsxs("p",{className:"text-xs text-muted-foreground",children:["Supported keys: ",h.jsx("code",{className:"rounded bg-muted px-1",children:"blockOnRisk"}),", ",h.jsx("code",{className:"rounded bg-muted px-1",children:"logLevel"}),", ",h.jsx("code",{className:"rounded bg-muted px-1",children:"timeoutMs"}),", etc."]})]}),h.jsxs(Ud,{children:[h.jsx(Me,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),h.jsxs(Me,{onClick:d,disabled:a,children:[a?h.jsx(Gl,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):h.jsx(dl,{className:"mr-1.5 h-3.5 w-3.5"}),"Update"]})]})]})})}function UC({profile:e,agentId:t}){const n=e.skills??[],[r,o]=v.useState(!1),[i,s]=v.useState(null);return h.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[h.jsxs(En,{children:[h.jsx(Kn,{children:h.jsx(Qn,{className:"text-sm",children:"Info"})}),h.jsxs(Nn,{className:"space-y-2 text-sm",children:[h.jsx(jo,{label:"Owner",value:e.ownerName||"—"}),h.jsx(jo,{label:"Creature",value:e.creature||"—"}),h.jsx(jo,{label:"Vibe",value:e.vibe||"—"}),h.jsx(jo,{label:"Sessions",value:String(e.sessionCount??0)}),h.jsx(jo,{label:"Last Active",value:e.lastActive??"never"})]})]}),h.jsxs(En,{children:[h.jsx(Kn,{children:h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs(Qn,{className:"flex items-center gap-2 text-sm",children:[h.jsx(LN,{className:"h-4 w-4"})," Skills (",n.length,")"]}),h.jsxs(Me,{size:"sm",variant:"outline",className:"h-7 text-xs",onClick:()=>o(!0),children:[h.jsx(pi,{className:"mr-1 h-3 w-3"})," Install"]})]})}),h.jsx(Nn,{children:n.length===0?h.jsxs("div",{className:"flex flex-col items-center gap-2 py-4",children:[h.jsx(ac,{className:"h-8 w-8 text-muted-foreground/30"}),h.jsx("p",{className:"text-sm text-muted-foreground",children:"No skills installed"}),h.jsx(Me,{size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:()=>o(!0),children:"Install your first skill"})]}):h.jsx("div",{className:"space-y-1.5",children:n.map(l=>h.jsxs("div",{className:"flex items-center justify-between rounded-md border border-border px-2.5 py-1.5",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(ac,{className:"h-3.5 w-3.5 text-muted-foreground"}),h.jsx("span",{className:"text-sm",children:l.name})]}),h.jsx(Me,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0 text-muted-foreground hover:text-destructive",onClick:()=>s(l.name),children:h.jsx($y,{className:"h-3 w-3"})})]},l.name))})})]}),h.jsxs(En,{children:[h.jsx(Kn,{children:h.jsx(Qn,{className:"text-sm",children:"Plugins"})}),h.jsx(Nn,{children:(e.plugins??[]).length===0?h.jsx("p",{className:"text-sm text-muted-foreground",children:"No plugins"}):h.jsx("div",{className:"space-y-1.5",children:(e.plugins??[]).map(l=>h.jsxs("div",{className:"flex items-center justify-between text-sm",children:[h.jsx("span",{children:l.name}),h.jsx(Ze,{variant:l.enabled?"success":"secondary",className:"text-[10px]",children:l.enabled?"on":"off"})]},l.name))})})]}),h.jsxs(En,{children:[h.jsx(Kn,{children:h.jsx(Qn,{className:"text-sm",children:"Connected Systems"})}),h.jsx(Nn,{children:(e.connectedSystems??[]).length===0?h.jsx("p",{className:"text-sm text-muted-foreground",children:"None"}):h.jsx("div",{className:"flex flex-wrap gap-1.5",children:(e.connectedSystems??[]).map(l=>h.jsx(Ze,{variant:"outline",className:"text-xs",children:l},l))})})]}),h.jsx(Hv,{open:r,onOpenChange:o,agentId:t}),h.jsx(Uv,{open:i!==null,onOpenChange:l=>{l||s(null)},agentId:t,initialName:i??""})]})}function WC({agentId:e}){const[t,n]=v.useState([]),[r,o]=v.useState(!0),[i,s]=v.useState(null),[l,a]=v.useState(!1),[u,d]=v.useState(!1),[c,f]=v.useState(!1),y=v.useCallback(()=>{ot.commands.list(e).then(p=>n(p.data??[])).catch(()=>{}).finally(()=>o(!1))},[e]);v.useEffect(()=>{y()},[y]),v.useEffect(()=>{if(!t.some(m=>m.status==="pending"||m.status==="running"))return;const g=setInterval(y,5e3);return()=>clearInterval(g)},[t,y]);const x=p=>p==="completed"?h.jsx(bN,{className:"h-3.5 w-3.5 text-emerald-500"}):p==="failed"?h.jsx(_N,{className:"h-3.5 w-3.5 text-destructive"}):p==="running"?h.jsx(Gl,{className:"h-3.5 w-3.5 animate-spin text-amber-500"}):h.jsx(CN,{className:"h-3.5 w-3.5 text-muted-foreground"}),w=p=>p==="completed"?"success":p==="failed"?"destructive":p==="running"?"warning":"secondary",S=p=>({install_skill:{icon:h.jsx(pi,{className:"h-3 w-3"}),label:"Install Skill"},install_custom_skill:{icon:h.jsx(Id,{className:"h-3 w-3"}),label:"Custom Skill"},uninstall_skill:{icon:h.jsx(fl,{className:"h-3 w-3"}),label:"Uninstall Skill"},update_config:{icon:h.jsx(dl,{className:"h-3 w-3"}),label:"Update Config"}})[p]??{icon:h.jsx(Lh,{className:"h-3 w-3"}),label:p};return r?h.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"flex flex-wrap gap-2",children:[h.jsxs(Me,{size:"sm",variant:"outline",onClick:()=>a(!0),children:[h.jsx(pi,{className:"mr-1.5 h-3.5 w-3.5"})," Install Skill"]}),h.jsxs(Me,{size:"sm",variant:"outline",onClick:()=>d(!0),children:[h.jsx(fl,{className:"mr-1.5 h-3.5 w-3.5"})," Uninstall Skill"]}),h.jsxs(Me,{size:"sm",variant:"outline",onClick:()=>f(!0),children:[h.jsx(dl,{className:"mr-1.5 h-3.5 w-3.5"})," Update Config"]}),h.jsx("div",{className:"flex-1"}),h.jsxs(Me,{size:"sm",variant:"ghost",onClick:y,children:[h.jsx(Ay,{className:"mr-1.5 h-3.5 w-3.5"})," Refresh"]})]}),t.length===0?h.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-3 rounded-lg border border-dashed border-border",children:[h.jsx(Lh,{className:"h-8 w-8 text-muted-foreground/30"}),h.jsxs("div",{className:"text-center",children:[h.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"No commands sent yet"}),h.jsx("p",{className:"text-xs text-muted-foreground/70",children:"Use the buttons above to send commands to this agent"})]})]}):h.jsx("div",{className:"space-y-2",children:t.map(p=>{var N,C,k;const g=S(p.type),m=i===p.id,E=p.result||p.type==="install_custom_skill"&&((N=p.payload)==null?void 0:N.content);return h.jsxs("div",{className:"rounded-lg border border-border transition-colors hover:bg-muted/20",children:[h.jsxs("div",{className:"flex cursor-pointer items-center gap-3 px-4 py-3",onClick:()=>E&&s(m?null:p.id),children:[x(p.status),h.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium",children:[g.icon,h.jsx("span",{children:g.label})]}),h.jsxs("span",{className:"text-xs text-muted-foreground",children:[((C=p.payload)==null?void 0:C.skillName)&&`"${p.payload.skillName}"`,p.type==="update_config"&&p.payload&&!p.payload.skillName&&Object.keys(p.payload).join(", ")]}),h.jsx("div",{className:"flex-1"}),h.jsx(Ze,{variant:w(p.status),className:"text-[10px]",children:p.status}),h.jsx("span",{className:"text-[11px] text-muted-foreground",children:KC(p.createdAt)}),E&&(m?h.jsx(Ty,{className:"h-3.5 w-3.5 text-muted-foreground"}):h.jsx(Iy,{className:"h-3.5 w-3.5 text-muted-foreground"}))]}),m&&E&&h.jsxs("div",{className:"border-t border-border bg-muted/30 px-4 py-3 text-xs",children:[p.result&&h.jsxs("div",{className:"space-y-1",children:[h.jsx("p",{className:"font-medium text-muted-foreground",children:"Result"}),h.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 p.result=="string"?p.result:JSON.stringify(p.result,null,2)})]}),p.type==="install_custom_skill"&&((k=p.payload)==null?void 0:k.content)&&h.jsxs("div",{className:"mt-2 space-y-1",children:[h.jsx("p",{className:"font-medium text-muted-foreground",children:"Skill Content"}),h.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:p.payload.content})]})]})]},p.id)})}),h.jsx(Hv,{open:l,onOpenChange:a,agentId:e,onSuccess:y}),h.jsx(Uv,{open:u,onOpenChange:d,agentId:e,onSuccess:y}),h.jsx(HC,{open:c,onOpenChange:f,agentId:e,onSuccess:y})]})}function YC({profile:e}){const t=e.cronJobs??[];return h.jsxs(En,{children:[h.jsx(Kn,{children:h.jsxs(Qn,{className:"flex items-center gap-2 text-sm",children:[h.jsx(PN,{className:"h-4 w-4"})," Scheduled Tasks (",t.length,")"]})}),h.jsx(Nn,{children:t.length===0?h.jsx("p",{className:"text-sm text-muted-foreground",children:"No scheduled tasks"}):h.jsx("div",{className:"space-y-2",children:t.map((n,r)=>h.jsxs("div",{className:"flex items-center justify-between rounded-md border border-border px-3 py-2 text-sm",children:[h.jsxs("div",{children:[h.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:n.schedule}),h.jsx("span",{className:"ml-2",children:n.task??n.id})]}),h.jsx(Ze,{variant:n.enabled!==!1?"success":"secondary",className:"text-[10px]",children:n.enabled!==!1?"active":"paused"})]},r))})})]})}function XC({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 h.jsx("div",{className:"space-y-4",children:n.length===0?h.jsx("p",{className:"text-sm text-muted-foreground",children:"No identity files found"}):n.map(r=>h.jsxs(En,{children:[h.jsx(Kn,{children:h.jsxs(Qn,{className:"flex items-center gap-2 text-sm",children:[h.jsx(Id,{className:"h-4 w-4"})," ",r.label]})}),h.jsx(Nn,{children:h.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 GC({permissions:e}){return e.length===0?h.jsx("p",{className:"text-sm text-muted-foreground",children:"No observed permissions"}):h.jsx("div",{className:"overflow-x-auto rounded-lg border border-border",children:h.jsxs("table",{className:"w-full text-sm",children:[h.jsx("thead",{children:h.jsxs("tr",{className:"border-b border-border bg-muted/50",children:[h.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Tool"}),h.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Category"}),h.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Access"}),h.jsx("th",{className:"px-4 py-2.5 text-right font-medium text-muted-foreground",children:"Calls"}),h.jsx("th",{className:"px-4 py-2.5 text-right font-medium text-muted-foreground",children:"Errors"})]})}),h.jsx("tbody",{children:e.map(t=>h.jsxs("tr",{className:"border-b border-border last:border-0",children:[h.jsx("td",{className:"px-4 py-2.5 font-mono text-xs",children:t.toolName}),h.jsx("td",{className:"px-4 py-2.5",children:h.jsx(Ze,{variant:"outline",className:"text-[10px]",children:t.category??"—"})}),h.jsx("td",{className:"px-4 py-2.5",children:h.jsx(Ze,{variant:t.accessPattern==="write"?"warning":t.accessPattern==="admin"?"destructive":"secondary",className:"text-[10px]",children:t.accessPattern??"read"})}),h.jsx("td",{className:"px-4 py-2.5 text-right font-mono text-xs",children:t.callCount}),h.jsx("td",{className:"px-4 py-2.5 text-right font-mono text-xs text-destructive",children:t.errorCount||"—"})]},t.id))})]})})}function jo({label:e,value:t}){return h.jsxs("div",{className:"flex justify-between",children:[h.jsx("span",{className:"text-muted-foreground",children:e}),h.jsx("span",{className:"font-medium",children:t})]})}function KC(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 o=Math.floor(r/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}function QC(){const[e,t]=v.useState([]),[n,r]=v.useState(!0),[o,i]=v.useState(new Set);v.useEffect(()=>{ot.discovery.agents().then(a=>{t(a.data??[]),r(!1)}).catch(()=>r(!1))},[]);const s=[{category:"Agents",items:e.map(a=>({id:a.id,name:a.name,emoji:a.emoji,provider:a.provider,status:a.status}))},{category:"Owners",items:[...new Set(e.map(a=>a.ownerName).filter(Boolean))].map(a=>({id:a,name:a,type:"owner"}))},{category:"Connected Systems",items:[...new Set(e.flatMap(a=>a.connectedSystems??[]))].map(a=>({id:a,name:a,type:"system"}))}],l=a=>{i(u=>{const d=new Set(u);return d.has(a)?d.delete(a):d.add(a),d})};return n?h.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Identities"}),h.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Agents, owners, and connected systems"})]}),h.jsx("div",{className:"space-y-3",children:s.map(a=>h.jsxs(En,{children:[h.jsxs("button",{onClick:()=>l(a.category),className:"flex w-full items-center justify-between p-4 text-left",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Ly,{className:"h-4 w-4 text-muted-foreground"}),h.jsx("span",{className:"text-sm font-medium",children:a.category}),h.jsx(Ze,{variant:"secondary",className:"text-[10px]",children:a.items.length})]}),o.has(a.category)?h.jsx(Ty,{className:"h-4 w-4 text-muted-foreground"}):h.jsx(Iy,{className:"h-4 w-4 text-muted-foreground"})]}),o.has(a.category)&&h.jsx(Nn,{className:"border-t border-border pt-3",children:a.items.length===0?h.jsx("p",{className:"text-sm text-muted-foreground",children:"None"}):h.jsx("div",{className:"space-y-1.5",children:a.items.map(u=>h.jsxs("div",{className:"flex items-center justify-between rounded-md px-3 py-2 text-sm hover:bg-muted/50",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[u.emoji&&h.jsx("span",{className:"text-base",children:u.emoji}),h.jsx("span",{children:u.name})]}),u.status&&h.jsx(Ze,{variant:u.status==="active"?"success":"secondary",className:"text-[10px]",children:u.status}),u.type&&h.jsx(Ze,{variant:"outline",className:"text-[10px]",children:u.type})]},u.id))})})]},a.category))})]})}function qC(){const[e,t]=v.useState([]),[n,r]=v.useState(""),[o,i]=v.useState("callCount"),[s,l]=v.useState(!1),[a,u]=v.useState(!0);v.useEffect(()=>{ot.observations.permissions().then(f=>{t(f.data??[]),u(!1)}).catch(()=>u(!1))},[]);const d=v.useMemo(()=>{let f=e;if(n){const y=n.toLowerCase();f=f.filter(x=>{var w,S;return((w=x.toolName)==null?void 0:w.toLowerCase().includes(y))||((S=x.category)==null?void 0:S.toLowerCase().includes(y))})}return[...f].sort((y,x)=>{const w=y[o]??0,S=x[o]??0;return typeof w=="string"?s?w.localeCompare(S):S.localeCompare(w):s?w-S:S-w})},[e,n,o,s]),c=f=>{o===f?l(!s):(i(f),l(!1))};return a?h.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Permissions"}),h.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:[e.length," observed tool permission",e.length!==1?"s":""]})]}),h.jsxs("div",{className:"relative max-w-sm",children:[h.jsx(Dy,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),h.jsx(Dn,{placeholder:"Filter by tool or category...",className:"pl-9",value:n,onChange:f=>r(f.target.value)})]}),h.jsx("div",{className:"overflow-x-auto rounded-lg border border-border",children:h.jsxs("table",{className:"w-full text-sm",children:[h.jsx("thead",{children:h.jsxs("tr",{className:"border-b border-border bg-muted/50",children:[h.jsx(Ja,{label:"Tool",sortKey:"toolName",current:o,asc:s,onSort:c}),h.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Category"}),h.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Access"}),h.jsx(Ja,{label:"Calls",sortKey:"callCount",current:o,asc:s,onSort:c,align:"right"}),h.jsx(Ja,{label:"Errors",sortKey:"errorCount",current:o,asc:s,onSort:c,align:"right"})]})}),h.jsx("tbody",{children:d.length===0?h.jsx("tr",{children:h.jsx("td",{colSpan:5,className:"px-4 py-8 text-center text-muted-foreground",children:"No permissions"})}):d.map(f=>h.jsxs("tr",{className:"border-b border-border last:border-0 hover:bg-muted/30",children:[h.jsx("td",{className:"px-4 py-2.5 font-mono text-xs",children:f.toolName}),h.jsx("td",{className:"px-4 py-2.5",children:h.jsx(Ze,{variant:"outline",className:"text-[10px]",children:f.category??"—"})}),h.jsx("td",{className:"px-4 py-2.5",children:h.jsx(Ze,{variant:f.accessPattern==="write"?"warning":f.accessPattern==="admin"?"destructive":"secondary",className:"text-[10px]",children:f.accessPattern??"read"})}),h.jsx("td",{className:"px-4 py-2.5 text-right font-mono text-xs",children:f.callCount}),h.jsx("td",{className:"px-4 py-2.5 text-right font-mono text-xs text-destructive",children:f.errorCount||"—"})]},f.id))})]})})]})}function Ja({label:e,sortKey:t,current:n,asc:r,onSort:o,align:i="left"}){return h.jsx("th",{className:`cursor-pointer px-4 py-2.5 font-medium text-muted-foreground hover:text-foreground ${i==="right"?"text-right":"text-left"}`,onClick:()=>o(t),children:h.jsxs("span",{className:"inline-flex items-center gap-1",children:[e,n===t&&h.jsx(kN,{className:"h-3 w-3"})]})})}function ZC(){const[e,t]=v.useState([]),[n,r]=v.useState(!0);v.useEffect(()=>{ot.observations.anomalies().then(s=>{t(s.data??[]),r(!1)}).catch(()=>r(!1))},[]);const o=s=>s.blocked||s.errorCount>3?"high":s.callCount===1||s.errorCount>0?"medium":"low",i=s=>s==="high"?"destructive":s==="medium"?"warning":"secondary";return n?h.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Risk Overview"}),h.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:[e.length," anomal",e.length!==1?"ies":"y"," detected"]})]}),e.length===0?h.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 rounded-lg border border-dashed border-border",children:[h.jsx(zy,{className:"h-8 w-8 text-muted-foreground/50"}),h.jsx("p",{className:"text-sm text-muted-foreground",children:"No anomalies detected"})]}):h.jsx("div",{className:"overflow-x-auto rounded-lg border border-border",children:h.jsxs("table",{className:"w-full text-sm",children:[h.jsx("thead",{children:h.jsxs("tr",{className:"border-b border-border bg-muted/50",children:[h.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Tool"}),h.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Agent"}),h.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Risk"}),h.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Category"}),h.jsx("th",{className:"px-4 py-2.5 text-right font-medium text-muted-foreground",children:"First Seen"})]})}),h.jsx("tbody",{children:e.map(s=>{var a;const l=o(s);return h.jsxs("tr",{className:"border-b border-border last:border-0 hover:bg-muted/30",children:[h.jsx("td",{className:"px-4 py-2.5 font-mono text-xs",children:s.toolName}),h.jsx("td",{className:"px-4 py-2.5 text-xs text-muted-foreground",children:((a=s.agentId)==null?void 0:a.slice(0,8))??"—"}),h.jsx("td",{className:"px-4 py-2.5",children:h.jsx(Ze,{variant:i(l),className:"text-[10px]",children:l})}),h.jsx("td",{className:"px-4 py-2.5",children:h.jsx(Ze,{variant:"outline",className:"text-[10px]",children:s.category??"—"})}),h.jsx("td",{className:"px-4 py-2.5 text-right text-xs text-muted-foreground",children:s.firstSeen?new Date(s.firstSeen).toLocaleDateString():"—"})]},s.id)})})]})})]})}function Ce(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=Ce(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var JC={value:()=>{}};function ta(){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 As(n)}function As(e){this._=e}function eb(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",o=n.indexOf(".");if(o>=0&&(r=n.slice(o+1),n=n.slice(0,o)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}As.prototype=ta.prototype={constructor:As,on:function(e,t){var n=this._,r=eb(e+"",n),o,i=-1,s=r.length;if(arguments.length<2){for(;++i<s;)if((o=(e=r[i]).type)&&(o=tb(n[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<s;)if(o=(e=r[i]).type)n[o]=Kh(n[o],e.name,t);else if(t==null)for(o in n)n[o]=Kh(n[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new As(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var n=new Array(o),r=0,o,i;r<o;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],r=0,o=i.length;r<o;++r)i[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],o=0,i=r.length;o<i;++o)r[o].value.apply(t,n)}};function tb(e,t){for(var n=0,r=e.length,o;n<r;++n)if((o=e[n]).name===t)return o.value}function Kh(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=JC,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var mc="http://www.w3.org/1999/xhtml";const Qh={svg:"http://www.w3.org/2000/svg",xhtml:mc,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function na(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Qh.hasOwnProperty(t)?{space:Qh[t],local:e}:e}function nb(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===mc&&t.documentElement.namespaceURI===mc?t.createElement(e):t.createElementNS(n,e)}}function rb(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Wv(e){var t=na(e);return(t.local?rb:nb)(t)}function ob(){}function Wd(e){return e==null?ob:function(){return this.querySelector(e)}}function ib(e){typeof e!="function"&&(e=Wd(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,l=r[o]=new Array(s),a,u,d=0;d<s;++d)(a=i[d])&&(u=e.call(a,a.__data__,d,i))&&("__data__"in a&&(u.__data__=a.__data__),l[d]=u);return new it(r,this._parents)}function sb(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function lb(){return[]}function Yv(e){return e==null?lb:function(){return this.querySelectorAll(e)}}function ab(e){return function(){return sb(e.apply(this,arguments))}}function ub(e){typeof e=="function"?e=ab(e):e=Yv(e);for(var t=this._groups,n=t.length,r=[],o=[],i=0;i<n;++i)for(var s=t[i],l=s.length,a,u=0;u<l;++u)(a=s[u])&&(r.push(e.call(a,a.__data__,u,s)),o.push(a));return new it(r,o)}function Xv(e){return function(){return this.matches(e)}}function Gv(e){return function(t){return t.matches(e)}}var cb=Array.prototype.find;function db(e){return function(){return cb.call(this.children,e)}}function fb(){return this.firstElementChild}function hb(e){return this.select(e==null?fb:db(typeof e=="function"?e:Gv(e)))}var pb=Array.prototype.filter;function mb(){return Array.from(this.children)}function gb(e){return function(){return pb.call(this.children,e)}}function yb(e){return this.selectAll(e==null?mb:gb(typeof e=="function"?e:Gv(e)))}function vb(e){typeof e!="function"&&(e=Xv(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,l=r[o]=[],a,u=0;u<s;++u)(a=i[u])&&e.call(a,a.__data__,u,i)&&l.push(a);return new it(r,this._parents)}function Kv(e){return new Array(e.length)}function xb(){return new it(this._enter||this._groups.map(Kv),this._parents)}function ml(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}ml.prototype={constructor:ml,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 wb(e){return function(){return e}}function Sb(e,t,n,r,o,i){for(var s=0,l,a=t.length,u=i.length;s<u;++s)(l=t[s])?(l.__data__=i[s],r[s]=l):n[s]=new ml(e,i[s]);for(;s<a;++s)(l=t[s])&&(o[s]=l)}function Eb(e,t,n,r,o,i,s){var l,a,u=new Map,d=t.length,c=i.length,f=new Array(d),y;for(l=0;l<d;++l)(a=t[l])&&(f[l]=y=s.call(a,a.__data__,l,t)+"",u.has(y)?o[l]=a:u.set(y,a));for(l=0;l<c;++l)y=s.call(e,i[l],l,i)+"",(a=u.get(y))?(r[l]=a,a.__data__=i[l],u.delete(y)):n[l]=new ml(e,i[l]);for(l=0;l<d;++l)(a=t[l])&&u.get(f[l])===a&&(o[l]=a)}function Nb(e){return e.__data__}function kb(e,t){if(!arguments.length)return Array.from(this,Nb);var n=t?Eb:Sb,r=this._parents,o=this._groups;typeof e!="function"&&(e=wb(e));for(var i=o.length,s=new Array(i),l=new Array(i),a=new Array(i),u=0;u<i;++u){var d=r[u],c=o[u],f=c.length,y=Cb(e.call(d,d&&d.__data__,u,r)),x=y.length,w=l[u]=new Array(x),S=s[u]=new Array(x),p=a[u]=new Array(f);n(d,c,w,S,p,y,t);for(var g=0,m=0,E,N;g<x;++g)if(E=w[g]){for(g>=m&&(m=g+1);!(N=S[m])&&++m<x;);E._next=N||null}}return s=new it(s,r),s._enter=l,s._exit=a,s}function Cb(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function bb(){return new it(this._exit||this._groups.map(Kv),this._parents)}function _b(e,t,n){var r=this.enter(),o=this,i=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),n==null?i.remove():n(i),r&&o?r.merge(o).order():o}function Pb(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,o=n.length,i=r.length,s=Math.min(o,i),l=new Array(o),a=0;a<s;++a)for(var u=n[a],d=r[a],c=u.length,f=l[a]=new Array(c),y,x=0;x<c;++x)(y=u[x]||d[x])&&(f[x]=y);for(;a<o;++a)l[a]=n[a];return new it(l,this._parents)}function jb(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],o=r.length-1,i=r[o],s;--o>=0;)(s=r[o])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function Mb(e){e||(e=Rb);function t(c,f){return c&&f?e(c.__data__,f.__data__):!c-!f}for(var n=this._groups,r=n.length,o=new Array(r),i=0;i<r;++i){for(var s=n[i],l=s.length,a=o[i]=new Array(l),u,d=0;d<l;++d)(u=s[d])&&(a[d]=u);a.sort(t)}return new it(o,this._parents).order()}function Rb(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Tb(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Ib(){return Array.from(this)}function Lb(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length;o<i;++o){var s=r[o];if(s)return s}return null}function Ab(){let e=0;for(const t of this)++e;return e}function Db(){return!this.node()}function zb(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var o=t[n],i=0,s=o.length,l;i<s;++i)(l=o[i])&&e.call(l,l.__data__,i,o);return this}function $b(e){return function(){this.removeAttribute(e)}}function Ob(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Fb(e,t){return function(){this.setAttribute(e,t)}}function Bb(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Vb(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Hb(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 Ub(e,t){var n=na(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?Ob:$b:typeof t=="function"?n.local?Hb:Vb:n.local?Bb:Fb)(n,t))}function Qv(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Wb(e){return function(){this.style.removeProperty(e)}}function Yb(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Xb(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Gb(e,t,n){return arguments.length>1?this.each((t==null?Wb:typeof t=="function"?Xb:Yb)(e,t,n??"")):Zr(this.node(),e)}function Zr(e,t){return e.style.getPropertyValue(t)||Qv(e).getComputedStyle(e,null).getPropertyValue(t)}function Kb(e){return function(){delete this[e]}}function Qb(e,t){return function(){this[e]=t}}function qb(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Zb(e,t){return arguments.length>1?this.each((t==null?Kb:typeof t=="function"?qb:Qb)(e,t)):this.node()[e]}function qv(e){return e.trim().split(/^|\s+/)}function Yd(e){return e.classList||new Zv(e)}function Zv(e){this._node=e,this._names=qv(e.getAttribute("class")||"")}Zv.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 Jv(e,t){for(var n=Yd(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function e0(e,t){for(var n=Yd(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function Jb(e){return function(){Jv(this,e)}}function e_(e){return function(){e0(this,e)}}function t_(e,t){return function(){(t.apply(this,arguments)?Jv:e0)(this,e)}}function n_(e,t){var n=qv(e+"");if(arguments.length<2){for(var r=Yd(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each((typeof t=="function"?t_:t?Jb:e_)(n,t))}function r_(){this.textContent=""}function o_(e){return function(){this.textContent=e}}function i_(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function s_(e){return arguments.length?this.each(e==null?r_:(typeof e=="function"?i_:o_)(e)):this.node().textContent}function l_(){this.innerHTML=""}function a_(e){return function(){this.innerHTML=e}}function u_(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function c_(e){return arguments.length?this.each(e==null?l_:(typeof e=="function"?u_:a_)(e)):this.node().innerHTML}function d_(){this.nextSibling&&this.parentNode.appendChild(this)}function f_(){return this.each(d_)}function h_(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function p_(){return this.each(h_)}function m_(e){var t=typeof e=="function"?e:Wv(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function g_(){return null}function y_(e,t){var n=typeof e=="function"?e:Wv(e),r=t==null?g_:typeof t=="function"?t:Wd(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function v_(){var e=this.parentNode;e&&e.removeChild(this)}function x_(){return this.each(v_)}function w_(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function S_(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function E_(e){return this.select(e?S_:w_)}function N_(e){return arguments.length?this.property("__data__",e):this.node().__data__}function k_(e){return function(t){e.call(this,t,this.__data__)}}function C_(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 b_(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,o=t.length,i;n<o;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++r]=i;++r?t.length=r:delete this.__on}}}function __(e,t,n){return function(){var r=this.__on,o,i=k_(t);if(r){for(var s=0,l=r.length;s<l;++s)if((o=r[s]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=i,o.options=n),o.value=t;return}}this.addEventListener(e.type,i,n),o={type:e.type,name:e.name,value:t,listener:i,options:n},r?r.push(o):this.__on=[o]}}function P_(e,t,n){var r=C_(e+""),o,i=r.length,s;if(arguments.length<2){var l=this.node().__on;if(l){for(var a=0,u=l.length,d;a<u;++a)for(o=0,d=l[a];o<i;++o)if((s=r[o]).type===d.type&&s.name===d.name)return d.value}return}for(l=t?__:b_,o=0;o<i;++o)this.each(l(r[o],t,n));return this}function t0(e,t,n){var r=Qv(e),o=r.CustomEvent;typeof o=="function"?o=new o(t,n):(o=r.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function j_(e,t){return function(){return t0(this,e,t)}}function M_(e,t){return function(){return t0(this,e,t.apply(this,arguments))}}function R_(e,t){return this.each((typeof t=="function"?M_:j_)(e,t))}function*T_(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length,s;o<i;++o)(s=r[o])&&(yield s)}var n0=[null];function it(e,t){this._groups=e,this._parents=t}function Ti(){return new it([[document.documentElement]],n0)}function I_(){return this}it.prototype=Ti.prototype={constructor:it,select:ib,selectAll:ub,selectChild:hb,selectChildren:yb,filter:vb,data:kb,enter:xb,exit:bb,join:_b,merge:Pb,selection:I_,order:jb,sort:Mb,call:Tb,nodes:Ib,node:Lb,size:Ab,empty:Db,each:zb,attr:Ub,style:Gb,property:Zb,classed:n_,text:s_,html:c_,raise:f_,lower:p_,append:m_,insert:y_,remove:x_,clone:E_,datum:N_,on:P_,dispatch:R_,[Symbol.iterator]:T_};function et(e){return typeof e=="string"?new it([[document.querySelector(e)]],[document.documentElement]):new it([[e]],n0)}function L_(e){let t;for(;t=e.sourceEvent;)e=t;return e}function wt(e,t){if(e=L_(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 o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}const A_={passive:!1},mi={capture:!0,passive:!1};function eu(e){e.stopImmediatePropagation()}function Vr(e){e.preventDefault(),e.stopImmediatePropagation()}function r0(e){var t=e.document.documentElement,n=et(e).on("dragstart.drag",Vr,mi);"onselectstart"in t?n.on("selectstart.drag",Vr,mi):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function o0(e,t){var n=e.document.documentElement,r=et(e).on("dragstart.drag",null);t&&(r.on("click.drag",Vr,mi),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 cs=e=>()=>e;function gc(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:i,x:s,y:l,dx:a,dy:u,dispatch:d}){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:o,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:a,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}gc.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function D_(e){return!e.ctrlKey&&!e.button}function z_(){return this.parentNode}function $_(e,t){return t??{x:e.x,y:e.y}}function O_(){return navigator.maxTouchPoints||"ontouchstart"in this}function i0(){var e=D_,t=z_,n=$_,r=O_,o={},i=ta("start","drag","end"),s=0,l,a,u,d,c=0;function f(E){E.on("mousedown.drag",y).filter(r).on("touchstart.drag",S).on("touchmove.drag",p,A_).on("touchend.drag touchcancel.drag",g).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function y(E,N){if(!(d||!e.call(this,E,N))){var C=m(this,t.call(this,E,N),E,N,"mouse");C&&(et(E.view).on("mousemove.drag",x,mi).on("mouseup.drag",w,mi),r0(E.view),eu(E),u=!1,l=E.clientX,a=E.clientY,C("start",E))}}function x(E){if(Vr(E),!u){var N=E.clientX-l,C=E.clientY-a;u=N*N+C*C>c}o.mouse("drag",E)}function w(E){et(E.view).on("mousemove.drag mouseup.drag",null),o0(E.view,u),Vr(E),o.mouse("end",E)}function S(E,N){if(e.call(this,E,N)){var C=E.changedTouches,k=t.call(this,E,N),P=C.length,R,z;for(R=0;R<P;++R)(z=m(this,k,E,N,C[R].identifier,C[R]))&&(eu(E),z("start",E,C[R]))}}function p(E){var N=E.changedTouches,C=N.length,k,P;for(k=0;k<C;++k)(P=o[N[k].identifier])&&(Vr(E),P("drag",E,N[k]))}function g(E){var N=E.changedTouches,C=N.length,k,P;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),k=0;k<C;++k)(P=o[N[k].identifier])&&(eu(E),P("end",E,N[k]))}function m(E,N,C,k,P,R){var z=i.copy(),I=wt(R||C,N),T,F,_;if((_=n.call(E,new gc("beforestart",{sourceEvent:C,target:f,identifier:P,active:s,x:I[0],y:I[1],dx:0,dy:0,dispatch:z}),k))!=null)return T=_.x-I[0]||0,F=_.y-I[1]||0,function A(M,D,b){var j=I,L;switch(M){case"start":o[P]=A,L=s++;break;case"end":delete o[P],--s;case"drag":I=wt(b||D,N),L=s;break}z.call(M,E,new gc(M,{sourceEvent:D,subject:_,target:f,identifier:P,active:L,x:I[0]+T,y:I[1]+F,dx:I[0]-j[0],dy:I[1]-j[1],dispatch:z}),k)}}return f.filter=function(E){return arguments.length?(e=typeof E=="function"?E:cs(!!E),f):e},f.container=function(E){return arguments.length?(t=typeof E=="function"?E:cs(E),f):t},f.subject=function(E){return arguments.length?(n=typeof E=="function"?E:cs(E),f):n},f.touchable=function(E){return arguments.length?(r=typeof E=="function"?E:cs(!!E),f):r},f.on=function(){var E=i.on.apply(i,arguments);return E===i?f:E},f.clickDistance=function(E){return arguments.length?(c=(E=+E)*E,f):Math.sqrt(c)},f}function Xd(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function s0(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ii(){}var gi=.7,gl=1/gi,Hr="\\s*([+-]?\\d+)\\s*",yi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ot="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",F_=/^#([0-9a-f]{3,8})$/,B_=new RegExp(`^rgb\\(${Hr},${Hr},${Hr}\\)$`),V_=new RegExp(`^rgb\\(${Ot},${Ot},${Ot}\\)$`),H_=new RegExp(`^rgba\\(${Hr},${Hr},${Hr},${yi}\\)$`),U_=new RegExp(`^rgba\\(${Ot},${Ot},${Ot},${yi}\\)$`),W_=new RegExp(`^hsl\\(${yi},${Ot},${Ot}\\)$`),Y_=new RegExp(`^hsla\\(${yi},${Ot},${Ot},${yi}\\)$`),qh={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};Xd(Ii,ar,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Zh,formatHex:Zh,formatHex8:X_,formatHsl:G_,formatRgb:Jh,toString:Jh});function Zh(){return this.rgb().formatHex()}function X_(){return this.rgb().formatHex8()}function G_(){return l0(this).formatHsl()}function Jh(){return this.rgb().formatRgb()}function ar(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=F_.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?ep(t):n===3?new Ge(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?ds(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?ds(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=B_.exec(e))?new Ge(t[1],t[2],t[3],1):(t=V_.exec(e))?new Ge(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=H_.exec(e))?ds(t[1],t[2],t[3],t[4]):(t=U_.exec(e))?ds(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=W_.exec(e))?rp(t[1],t[2]/100,t[3]/100,1):(t=Y_.exec(e))?rp(t[1],t[2]/100,t[3]/100,t[4]):qh.hasOwnProperty(e)?ep(qh[e]):e==="transparent"?new Ge(NaN,NaN,NaN,0):null}function ep(e){return new Ge(e>>16&255,e>>8&255,e&255,1)}function ds(e,t,n,r){return r<=0&&(e=t=n=NaN),new Ge(e,t,n,r)}function K_(e){return e instanceof Ii||(e=ar(e)),e?(e=e.rgb(),new Ge(e.r,e.g,e.b,e.opacity)):new Ge}function yc(e,t,n,r){return arguments.length===1?K_(e):new Ge(e,t,n,r??1)}function Ge(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Xd(Ge,yc,s0(Ii,{brighter(e){return e=e==null?gl:Math.pow(gl,e),new Ge(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?gi:Math.pow(gi,e),new Ge(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ge(er(this.r),er(this.g),er(this.b),yl(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:tp,formatHex:tp,formatHex8:Q_,formatRgb:np,toString:np}));function tp(){return`#${qn(this.r)}${qn(this.g)}${qn(this.b)}`}function Q_(){return`#${qn(this.r)}${qn(this.g)}${qn(this.b)}${qn((isNaN(this.opacity)?1:this.opacity)*255)}`}function np(){const e=yl(this.opacity);return`${e===1?"rgb(":"rgba("}${er(this.r)}, ${er(this.g)}, ${er(this.b)}${e===1?")":`, ${e})`}`}function yl(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function er(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function qn(e){return e=er(e),(e<16?"0":"")+e.toString(16)}function rp(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Et(e,t,n,r)}function l0(e){if(e instanceof Et)return new Et(e.h,e.s,e.l,e.opacity);if(e instanceof Ii||(e=ar(e)),!e)return new Et;if(e instanceof Et)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),s=NaN,l=i-o,a=(i+o)/2;return l?(t===i?s=(n-r)/l+(n<r)*6:n===i?s=(r-t)/l+2:s=(t-n)/l+4,l/=a<.5?i+o:2-i-o,s*=60):l=a>0&&a<1?0:s,new Et(s,l,a,e.opacity)}function q_(e,t,n,r){return arguments.length===1?l0(e):new Et(e,t,n,r??1)}function Et(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Xd(Et,q_,s0(Ii,{brighter(e){return e=e==null?gl:Math.pow(gl,e),new Et(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?gi:Math.pow(gi,e),new Et(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,o=2*n-r;return new Ge(tu(e>=240?e-240:e+120,o,r),tu(e,o,r),tu(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new Et(op(this.h),fs(this.s),fs(this.l),yl(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=yl(this.opacity);return`${e===1?"hsl(":"hsla("}${op(this.h)}, ${fs(this.s)*100}%, ${fs(this.l)*100}%${e===1?")":`, ${e})`}`}}));function op(e){return e=(e||0)%360,e<0?e+360:e}function fs(e){return Math.max(0,Math.min(1,e||0))}function tu(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 Gd=e=>()=>e;function Z_(e,t){return function(n){return e+n*t}}function J_(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 eP(e){return(e=+e)==1?a0:function(t,n){return n-t?J_(t,n,e):Gd(isNaN(t)?n:t)}}function a0(e,t){var n=t-e;return n?Z_(e,n):Gd(isNaN(e)?t:e)}const vl=function e(t){var n=eP(t);function r(o,i){var s=n((o=yc(o)).r,(i=yc(i)).r),l=n(o.g,i.g),a=n(o.b,i.b),u=a0(o.opacity,i.opacity);return function(d){return o.r=s(d),o.g=l(d),o.b=a(d),o.opacity=u(d),o+""}}return r.gamma=e,r}(1);function tP(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),o;return function(i){for(o=0;o<n;++o)r[o]=e[o]*(1-i)+t[o]*i;return r}}function nP(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function rP(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,o=new Array(r),i=new Array(n),s;for(s=0;s<r;++s)o[s]=Go(e[s],t[s]);for(;s<n;++s)i[s]=t[s];return function(l){for(s=0;s<r;++s)i[s]=o[s](l);return i}}function oP(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Lt(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function iP(e,t){var n={},r={},o;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(o in t)o in e?n[o]=Go(e[o],t[o]):r[o]=t[o];return function(i){for(o in n)r[o]=n[o](i);return r}}var vc=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,nu=new RegExp(vc.source,"g");function sP(e){return function(){return e}}function lP(e){return function(t){return e(t)+""}}function u0(e,t){var n=vc.lastIndex=nu.lastIndex=0,r,o,i,s=-1,l=[],a=[];for(e=e+"",t=t+"";(r=vc.exec(e))&&(o=nu.exec(t));)(i=o.index)>n&&(i=t.slice(n,i),l[s]?l[s]+=i:l[++s]=i),(r=r[0])===(o=o[0])?l[s]?l[s]+=o:l[++s]=o:(l[++s]=null,a.push({i:s,x:Lt(r,o)})),n=nu.lastIndex;return n<t.length&&(i=t.slice(n),l[s]?l[s]+=i:l[++s]=i),l.length<2?a[0]?lP(a[0].x):sP(t):(t=a.length,function(u){for(var d=0,c;d<t;++d)l[(c=a[d]).i]=c.x(u);return l.join("")})}function Go(e,t){var n=typeof t,r;return t==null||n==="boolean"?Gd(t):(n==="number"?Lt:n==="string"?(r=ar(t))?(t=r,vl):u0:t instanceof ar?vl:t instanceof Date?oP:nP(t)?tP:Array.isArray(t)?rP:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?iP:Lt)(e,t)}var ip=180/Math.PI,xc={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function c0(e,t,n,r,o,i){var s,l,a;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(a=e*n+t*r)&&(n-=e*a,r-=t*a),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,a/=l),e*r<t*n&&(e=-e,t=-t,a=-a,s=-s),{translateX:o,translateY:i,rotate:Math.atan2(t,e)*ip,skewX:Math.atan(a)*ip,scaleX:s,scaleY:l}}var hs;function aP(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?xc:c0(t.a,t.b,t.c,t.d,t.e,t.f)}function uP(e){return e==null||(hs||(hs=document.createElementNS("http://www.w3.org/2000/svg","g")),hs.setAttribute("transform",e),!(e=hs.transform.baseVal.consolidate()))?xc:(e=e.matrix,c0(e.a,e.b,e.c,e.d,e.e,e.f))}function d0(e,t,n,r){function o(u){return u.length?u.pop()+" ":""}function i(u,d,c,f,y,x){if(u!==c||d!==f){var w=y.push("translate(",null,t,null,n);x.push({i:w-4,x:Lt(u,c)},{i:w-2,x:Lt(d,f)})}else(c||f)&&y.push("translate("+c+t+f+n)}function s(u,d,c,f){u!==d?(u-d>180?d+=360:d-u>180&&(u+=360),f.push({i:c.push(o(c)+"rotate(",null,r)-2,x:Lt(u,d)})):d&&c.push(o(c)+"rotate("+d+r)}function l(u,d,c,f){u!==d?f.push({i:c.push(o(c)+"skewX(",null,r)-2,x:Lt(u,d)}):d&&c.push(o(c)+"skewX("+d+r)}function a(u,d,c,f,y,x){if(u!==c||d!==f){var w=y.push(o(y)+"scale(",null,",",null,")");x.push({i:w-4,x:Lt(u,c)},{i:w-2,x:Lt(d,f)})}else(c!==1||f!==1)&&y.push(o(y)+"scale("+c+","+f+")")}return function(u,d){var c=[],f=[];return u=e(u),d=e(d),i(u.translateX,u.translateY,d.translateX,d.translateY,c,f),s(u.rotate,d.rotate,c,f),l(u.skewX,d.skewX,c,f),a(u.scaleX,u.scaleY,d.scaleX,d.scaleY,c,f),u=d=null,function(y){for(var x=-1,w=f.length,S;++x<w;)c[(S=f[x]).i]=S.x(y);return c.join("")}}}var cP=d0(aP,"px, ","px)","deg)"),dP=d0(uP,", ",")",")"),fP=1e-12;function sp(e){return((e=Math.exp(e))+1/e)/2}function hP(e){return((e=Math.exp(e))-1/e)/2}function pP(e){return((e=Math.exp(2*e))-1)/(e+1)}const Ds=function e(t,n,r){function o(i,s){var l=i[0],a=i[1],u=i[2],d=s[0],c=s[1],f=s[2],y=d-l,x=c-a,w=y*y+x*x,S,p;if(w<fP)p=Math.log(f/u)/t,S=function(k){return[l+k*y,a+k*x,u*Math.exp(t*k*p)]};else{var g=Math.sqrt(w),m=(f*f-u*u+r*w)/(2*u*n*g),E=(f*f-u*u-r*w)/(2*f*n*g),N=Math.log(Math.sqrt(m*m+1)-m),C=Math.log(Math.sqrt(E*E+1)-E);p=(C-N)/t,S=function(k){var P=k*p,R=sp(N),z=u/(n*g)*(R*pP(t*P+N)-hP(N));return[l+z*y,a+z*x,u*R/sp(t*P+N)]}}return S.duration=p*1e3*t/Math.SQRT2,S}return o.rho=function(i){var s=Math.max(.001,+i),l=s*s,a=l*l;return e(s,l,a)},o}(Math.SQRT2,2,4);var Jr=0,Do=0,Mo=0,f0=1e3,xl,zo,wl=0,ur=0,ra=0,vi=typeof performance=="object"&&performance.now?performance:Date,h0=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Kd(){return ur||(h0(mP),ur=vi.now()+ra)}function mP(){ur=0}function Sl(){this._call=this._time=this._next=null}Sl.prototype=p0.prototype={constructor:Sl,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Kd():+n)+(t==null?0:+t),!this._next&&zo!==this&&(zo?zo._next=this:xl=this,zo=this),this._call=e,this._time=n,wc()},stop:function(){this._call&&(this._call=null,this._time=1/0,wc())}};function p0(e,t,n){var r=new Sl;return r.restart(e,t,n),r}function gP(){Kd(),++Jr;for(var e=xl,t;e;)(t=ur-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Jr}function lp(){ur=(wl=vi.now())+ra,Jr=Do=0;try{gP()}finally{Jr=0,vP(),ur=0}}function yP(){var e=vi.now(),t=e-wl;t>f0&&(ra-=t,wl=e)}function vP(){for(var e,t=xl,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:xl=n);zo=e,wc(r)}function wc(e){if(!Jr){Do&&(Do=clearTimeout(Do));var t=e-ur;t>24?(e<1/0&&(Do=setTimeout(lp,e-vi.now()-ra)),Mo&&(Mo=clearInterval(Mo))):(Mo||(wl=vi.now(),Mo=setInterval(yP,f0)),Jr=1,h0(lp))}}function ap(e,t,n){var r=new Sl;return t=t==null?0:+t,r.restart(o=>{r.stop(),e(o+t)},t,n),r}var xP=ta("start","end","cancel","interrupt"),wP=[],m0=0,up=1,Sc=2,zs=3,cp=4,Ec=5,$s=6;function oa(e,t,n,r,o,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;SP(e,n,{name:t,index:r,group:o,on:xP,tween:wP,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:m0})}function Qd(e,t){var n=Mt(e,t);if(n.state>m0)throw new Error("too late; already scheduled");return n}function Ht(e,t){var n=Mt(e,t);if(n.state>zs)throw new Error("too late; already running");return n}function Mt(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function SP(e,t,n){var r=e.__transition,o;r[t]=n,n.timer=p0(i,0,n.time);function i(u){n.state=up,n.timer.restart(s,n.delay,n.time),n.delay<=u&&s(u-n.delay)}function s(u){var d,c,f,y;if(n.state!==up)return a();for(d in r)if(y=r[d],y.name===n.name){if(y.state===zs)return ap(s);y.state===cp?(y.state=$s,y.timer.stop(),y.on.call("interrupt",e,e.__data__,y.index,y.group),delete r[d]):+d<t&&(y.state=$s,y.timer.stop(),y.on.call("cancel",e,e.__data__,y.index,y.group),delete r[d])}if(ap(function(){n.state===zs&&(n.state=cp,n.timer.restart(l,n.delay,n.time),l(u))}),n.state=Sc,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Sc){for(n.state=zs,o=new Array(f=n.tween.length),d=0,c=-1;d<f;++d)(y=n.tween[d].value.call(e,e.__data__,n.index,n.group))&&(o[++c]=y);o.length=c+1}}function l(u){for(var d=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(a),n.state=Ec,1),c=-1,f=o.length;++c<f;)o[c].call(e,d);n.state===Ec&&(n.on.call("end",e,e.__data__,n.index,n.group),a())}function a(){n.state=$s,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}}function Os(e,t){var n=e.__transition,r,o,i=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((r=n[s]).name!==t){i=!1;continue}o=r.state>Sc&&r.state<Ec,r.state=$s,r.timer.stop(),r.on.call(o?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}i&&delete e.__transition}}function EP(e){return this.each(function(){Os(this,e)})}function NP(e,t){var n,r;return function(){var o=Ht(this,e),i=o.tween;if(i!==n){r=n=i;for(var s=0,l=r.length;s<l;++s)if(r[s].name===t){r=r.slice(),r.splice(s,1);break}}o.tween=r}}function kP(e,t,n){var r,o;if(typeof n!="function")throw new Error;return function(){var i=Ht(this,e),s=i.tween;if(s!==r){o=(r=s).slice();for(var l={name:t,value:n},a=0,u=o.length;a<u;++a)if(o[a].name===t){o[a]=l;break}a===u&&o.push(l)}i.tween=o}}function CP(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Mt(this.node(),n).tween,o=0,i=r.length,s;o<i;++o)if((s=r[o]).name===e)return s.value;return null}return this.each((t==null?NP:kP)(n,e,t))}function qd(e,t,n){var r=e._id;return e.each(function(){var o=Ht(this,r);(o.value||(o.value={}))[t]=n.apply(this,arguments)}),function(o){return Mt(o,r).value[t]}}function g0(e,t){var n;return(typeof t=="number"?Lt:t instanceof ar?vl:(n=ar(t))?(t=n,vl):u0)(e,t)}function bP(e){return function(){this.removeAttribute(e)}}function _P(e){return function(){this.removeAttributeNS(e.space,e.local)}}function PP(e,t,n){var r,o=n+"",i;return function(){var s=this.getAttribute(e);return s===o?null:s===r?i:i=t(r=s,n)}}function jP(e,t,n){var r,o=n+"",i;return function(){var s=this.getAttributeNS(e.space,e.local);return s===o?null:s===r?i:i=t(r=s,n)}}function MP(e,t,n){var r,o,i;return function(){var s,l=n(this),a;return l==null?void this.removeAttribute(e):(s=this.getAttribute(e),a=l+"",s===a?null:s===r&&a===o?i:(o=a,i=t(r=s,l)))}}function RP(e,t,n){var r,o,i;return function(){var s,l=n(this),a;return l==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),a=l+"",s===a?null:s===r&&a===o?i:(o=a,i=t(r=s,l)))}}function TP(e,t){var n=na(e),r=n==="transform"?dP:g0;return this.attrTween(e,typeof t=="function"?(n.local?RP:MP)(n,r,qd(this,"attr."+e,t)):t==null?(n.local?_P:bP)(n):(n.local?jP:PP)(n,r,t))}function IP(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function LP(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function AP(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&LP(e,i)),n}return o._value=t,o}function DP(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&IP(e,i)),n}return o._value=t,o}function zP(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=na(e);return this.tween(n,(r.local?AP:DP)(r,t))}function $P(e,t){return function(){Qd(this,e).delay=+t.apply(this,arguments)}}function OP(e,t){return t=+t,function(){Qd(this,e).delay=t}}function FP(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?$P:OP)(t,e)):Mt(this.node(),t).delay}function BP(e,t){return function(){Ht(this,e).duration=+t.apply(this,arguments)}}function VP(e,t){return t=+t,function(){Ht(this,e).duration=t}}function HP(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?BP:VP)(t,e)):Mt(this.node(),t).duration}function UP(e,t){if(typeof t!="function")throw new Error;return function(){Ht(this,e).ease=t}}function WP(e){var t=this._id;return arguments.length?this.each(UP(t,e)):Mt(this.node(),t).ease}function YP(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Ht(this,e).ease=n}}function XP(e){if(typeof e!="function")throw new Error;return this.each(YP(this._id,e))}function GP(e){typeof e!="function"&&(e=Xv(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,l=r[o]=[],a,u=0;u<s;++u)(a=i[u])&&e.call(a,a.__data__,u,i)&&l.push(a);return new on(r,this._parents,this._name,this._id)}function KP(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,o=n.length,i=Math.min(r,o),s=new Array(r),l=0;l<i;++l)for(var a=t[l],u=n[l],d=a.length,c=s[l]=new Array(d),f,y=0;y<d;++y)(f=a[y]||u[y])&&(c[y]=f);for(;l<r;++l)s[l]=t[l];return new on(s,this._parents,this._name,this._id)}function QP(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 qP(e,t,n){var r,o,i=QP(t)?Qd:Ht;return function(){var s=i(this,e),l=s.on;l!==r&&(o=(r=l).copy()).on(t,n),s.on=o}}function ZP(e,t){var n=this._id;return arguments.length<2?Mt(this.node(),n).on.on(e):this.each(qP(n,e,t))}function JP(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function ej(){return this.on("end.remove",JP(this._id))}function tj(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Wd(e));for(var r=this._groups,o=r.length,i=new Array(o),s=0;s<o;++s)for(var l=r[s],a=l.length,u=i[s]=new Array(a),d,c,f=0;f<a;++f)(d=l[f])&&(c=e.call(d,d.__data__,f,l))&&("__data__"in d&&(c.__data__=d.__data__),u[f]=c,oa(u[f],t,n,f,u,Mt(d,n)));return new on(i,this._parents,t,n)}function nj(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Yv(e));for(var r=this._groups,o=r.length,i=[],s=[],l=0;l<o;++l)for(var a=r[l],u=a.length,d,c=0;c<u;++c)if(d=a[c]){for(var f=e.call(d,d.__data__,c,a),y,x=Mt(d,n),w=0,S=f.length;w<S;++w)(y=f[w])&&oa(y,t,n,w,f,x);i.push(f),s.push(d)}return new on(i,s,t,n)}var rj=Ti.prototype.constructor;function oj(){return new rj(this._groups,this._parents)}function ij(e,t){var n,r,o;return function(){var i=Zr(this,e),s=(this.style.removeProperty(e),Zr(this,e));return i===s?null:i===n&&s===r?o:o=t(n=i,r=s)}}function y0(e){return function(){this.style.removeProperty(e)}}function sj(e,t,n){var r,o=n+"",i;return function(){var s=Zr(this,e);return s===o?null:s===r?i:i=t(r=s,n)}}function lj(e,t,n){var r,o,i;return function(){var s=Zr(this,e),l=n(this),a=l+"";return l==null&&(a=l=(this.style.removeProperty(e),Zr(this,e))),s===a?null:s===r&&a===o?i:(o=a,i=t(r=s,l))}}function aj(e,t){var n,r,o,i="style."+t,s="end."+i,l;return function(){var a=Ht(this,e),u=a.on,d=a.value[i]==null?l||(l=y0(t)):void 0;(u!==n||o!==d)&&(r=(n=u).copy()).on(s,o=d),a.on=r}}function uj(e,t,n){var r=(e+="")=="transform"?cP:g0;return t==null?this.styleTween(e,ij(e,r)).on("end.style."+e,y0(e)):typeof t=="function"?this.styleTween(e,lj(e,r,qd(this,"style."+e,t))).each(aj(this._id,e)):this.styleTween(e,sj(e,r,t),n).on("end.style."+e,null)}function cj(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function dj(e,t,n){var r,o;function i(){var s=t.apply(this,arguments);return s!==o&&(r=(o=s)&&cj(e,s,n)),r}return i._value=t,i}function fj(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,dj(e,t,n??""))}function hj(e){return function(){this.textContent=e}}function pj(e){return function(){var t=e(this);this.textContent=t??""}}function mj(e){return this.tween("text",typeof e=="function"?pj(qd(this,"text",e)):hj(e==null?"":e+""))}function gj(e){return function(t){this.textContent=e.call(this,t)}}function yj(e){var t,n;function r(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&gj(o)),t}return r._value=e,r}function vj(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,yj(e))}function xj(){for(var e=this._name,t=this._id,n=v0(),r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],l=s.length,a,u=0;u<l;++u)if(a=s[u]){var d=Mt(a,t);oa(a,e,n,u,s,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new on(r,this._parents,e,n)}function wj(){var e,t,n=this,r=n._id,o=n.size();return new Promise(function(i,s){var l={value:s},a={value:function(){--o===0&&i()}};n.each(function(){var u=Ht(this,r),d=u.on;d!==e&&(t=(e=d).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(a)),u.on=t}),o===0&&i()})}var Sj=0;function on(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function v0(){return++Sj}var Yt=Ti.prototype;on.prototype={constructor:on,select:tj,selectAll:nj,selectChild:Yt.selectChild,selectChildren:Yt.selectChildren,filter:GP,merge:KP,selection:oj,transition:xj,call:Yt.call,nodes:Yt.nodes,node:Yt.node,size:Yt.size,empty:Yt.empty,each:Yt.each,on:ZP,attr:TP,attrTween:zP,style:uj,styleTween:fj,text:mj,textTween:vj,remove:ej,tween:CP,delay:FP,duration:HP,ease:WP,easeVarying:XP,end:wj,[Symbol.iterator]:Yt[Symbol.iterator]};function Ej(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Nj={time:null,delay:0,duration:250,ease:Ej};function kj(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 Cj(e){var t,n;e instanceof on?(t=e._id,e=e._name):(t=v0(),(n=Nj).time=Kd(),e=e==null?null:e+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],l=s.length,a,u=0;u<l;++u)(a=s[u])&&oa(a,e,t,u,s,n||kj(a,t));return new on(r,this._parents,e,t)}Ti.prototype.interrupt=EP;Ti.prototype.transition=Cj;const ps=e=>()=>e;function bj(e,{sourceEvent:t,target:n,transform:r,dispatch:o}){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:o}})}function qt(e,t,n){this.k=e,this.x=t,this.y=n}qt.prototype={constructor:qt,scale:function(e){return e===1?this:new qt(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new qt(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 ia=new qt(1,0,0);x0.prototype=qt.prototype;function x0(e){for(;!e.__zoom;)if(!(e=e.parentNode))return ia;return e.__zoom}function ru(e){e.stopImmediatePropagation()}function Ro(e){e.preventDefault(),e.stopImmediatePropagation()}function _j(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Pj(){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 dp(){return this.__zoom||ia}function jj(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Mj(){return navigator.maxTouchPoints||"ontouchstart"in this}function Rj(e,t,n){var r=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function w0(){var e=_j,t=Pj,n=Rj,r=jj,o=Mj,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],l=250,a=Ds,u=ta("start","zoom","end"),d,c,f,y=500,x=150,w=0,S=10;function p(_){_.property("__zoom",dp).on("wheel.zoom",P,{passive:!1}).on("mousedown.zoom",R).on("dblclick.zoom",z).filter(o).on("touchstart.zoom",I).on("touchmove.zoom",T).on("touchend.zoom touchcancel.zoom",F).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}p.transform=function(_,A,M,D){var b=_.selection?_.selection():_;b.property("__zoom",dp),_!==b?N(_,A,M,D):b.interrupt().each(function(){C(this,arguments).event(D).start().zoom(null,typeof A=="function"?A.apply(this,arguments):A).end()})},p.scaleBy=function(_,A,M,D){p.scaleTo(_,function(){var b=this.__zoom.k,j=typeof A=="function"?A.apply(this,arguments):A;return b*j},M,D)},p.scaleTo=function(_,A,M,D){p.transform(_,function(){var b=t.apply(this,arguments),j=this.__zoom,L=M==null?E(b):typeof M=="function"?M.apply(this,arguments):M,O=j.invert(L),$=typeof A=="function"?A.apply(this,arguments):A;return n(m(g(j,$),L,O),b,s)},M,D)},p.translateBy=function(_,A,M,D){p.transform(_,function(){return n(this.__zoom.translate(typeof A=="function"?A.apply(this,arguments):A,typeof M=="function"?M.apply(this,arguments):M),t.apply(this,arguments),s)},null,D)},p.translateTo=function(_,A,M,D,b){p.transform(_,function(){var j=t.apply(this,arguments),L=this.__zoom,O=D==null?E(j):typeof D=="function"?D.apply(this,arguments):D;return n(ia.translate(O[0],O[1]).scale(L.k).translate(typeof A=="function"?-A.apply(this,arguments):-A,typeof M=="function"?-M.apply(this,arguments):-M),j,s)},D,b)};function g(_,A){return A=Math.max(i[0],Math.min(i[1],A)),A===_.k?_:new qt(A,_.x,_.y)}function m(_,A,M){var D=A[0]-M[0]*_.k,b=A[1]-M[1]*_.k;return D===_.x&&b===_.y?_:new qt(_.k,D,b)}function E(_){return[(+_[0][0]+ +_[1][0])/2,(+_[0][1]+ +_[1][1])/2]}function N(_,A,M,D){_.on("start.zoom",function(){C(this,arguments).event(D).start()}).on("interrupt.zoom end.zoom",function(){C(this,arguments).event(D).end()}).tween("zoom",function(){var b=this,j=arguments,L=C(b,j).event(D),O=t.apply(b,j),$=M==null?E(O):typeof M=="function"?M.apply(b,j):M,U=Math.max(O[1][0]-O[0][0],O[1][1]-O[0][1]),H=b.__zoom,Y=typeof A=="function"?A.apply(b,j):A,X=a(H.invert($).concat(U/H.k),Y.invert($).concat(U/Y.k));return function(G){if(G===1)G=Y;else{var V=X(G),Q=U/V[2];G=new qt(Q,$[0]-V[0]*Q,$[1]-V[1]*Q)}L.zoom(null,G)}})}function C(_,A,M){return!M&&_.__zooming||new k(_,A)}function k(_,A){this.that=_,this.args=A,this.active=0,this.sourceEvent=null,this.extent=t.apply(_,A),this.taps=0}k.prototype={event:function(_){return _&&(this.sourceEvent=_),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(_,A){return this.mouse&&_!=="mouse"&&(this.mouse[1]=A.invert(this.mouse[0])),this.touch0&&_!=="touch"&&(this.touch0[1]=A.invert(this.touch0[0])),this.touch1&&_!=="touch"&&(this.touch1[1]=A.invert(this.touch1[0])),this.that.__zoom=A,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(_){var A=et(this.that).datum();u.call(_,this.that,new bj(_,{sourceEvent:this.sourceEvent,target:p,transform:this.that.__zoom,dispatch:u}),A)}};function P(_,...A){if(!e.apply(this,arguments))return;var M=C(this,A).event(_),D=this.__zoom,b=Math.max(i[0],Math.min(i[1],D.k*Math.pow(2,r.apply(this,arguments)))),j=wt(_);if(M.wheel)(M.mouse[0][0]!==j[0]||M.mouse[0][1]!==j[1])&&(M.mouse[1]=D.invert(M.mouse[0]=j)),clearTimeout(M.wheel);else{if(D.k===b)return;M.mouse=[j,D.invert(j)],Os(this),M.start()}Ro(_),M.wheel=setTimeout(L,x),M.zoom("mouse",n(m(g(D,b),M.mouse[0],M.mouse[1]),M.extent,s));function L(){M.wheel=null,M.end()}}function R(_,...A){if(f||!e.apply(this,arguments))return;var M=_.currentTarget,D=C(this,A,!0).event(_),b=et(_.view).on("mousemove.zoom",$,!0).on("mouseup.zoom",U,!0),j=wt(_,M),L=_.clientX,O=_.clientY;r0(_.view),ru(_),D.mouse=[j,this.__zoom.invert(j)],Os(this),D.start();function $(H){if(Ro(H),!D.moved){var Y=H.clientX-L,X=H.clientY-O;D.moved=Y*Y+X*X>w}D.event(H).zoom("mouse",n(m(D.that.__zoom,D.mouse[0]=wt(H,M),D.mouse[1]),D.extent,s))}function U(H){b.on("mousemove.zoom mouseup.zoom",null),o0(H.view,D.moved),Ro(H),D.event(H).end()}}function z(_,...A){if(e.apply(this,arguments)){var M=this.__zoom,D=wt(_.changedTouches?_.changedTouches[0]:_,this),b=M.invert(D),j=M.k*(_.shiftKey?.5:2),L=n(m(g(M,j),D,b),t.apply(this,A),s);Ro(_),l>0?et(this).transition().duration(l).call(N,L,D,_):et(this).call(p.transform,L,D,_)}}function I(_,...A){if(e.apply(this,arguments)){var M=_.touches,D=M.length,b=C(this,A,_.changedTouches.length===D).event(_),j,L,O,$;for(ru(_),L=0;L<D;++L)O=M[L],$=wt(O,this),$=[$,this.__zoom.invert($),O.identifier],b.touch0?!b.touch1&&b.touch0[2]!==$[2]&&(b.touch1=$,b.taps=0):(b.touch0=$,j=!0,b.taps=1+!!d);d&&(d=clearTimeout(d)),j&&(b.taps<2&&(c=$[0],d=setTimeout(function(){d=null},y)),Os(this),b.start())}}function T(_,...A){if(this.__zooming){var M=C(this,A).event(_),D=_.changedTouches,b=D.length,j,L,O,$;for(Ro(_),j=0;j<b;++j)L=D[j],O=wt(L,this),M.touch0&&M.touch0[2]===L.identifier?M.touch0[0]=O:M.touch1&&M.touch1[2]===L.identifier&&(M.touch1[0]=O);if(L=M.that.__zoom,M.touch1){var U=M.touch0[0],H=M.touch0[1],Y=M.touch1[0],X=M.touch1[1],G=(G=Y[0]-U[0])*G+(G=Y[1]-U[1])*G,V=(V=X[0]-H[0])*V+(V=X[1]-H[1])*V;L=g(L,Math.sqrt(G/V)),O=[(U[0]+Y[0])/2,(U[1]+Y[1])/2],$=[(H[0]+X[0])/2,(H[1]+X[1])/2]}else if(M.touch0)O=M.touch0[0],$=M.touch0[1];else return;M.zoom("touch",n(m(L,O,$),M.extent,s))}}function F(_,...A){if(this.__zooming){var M=C(this,A).event(_),D=_.changedTouches,b=D.length,j,L;for(ru(_),f&&clearTimeout(f),f=setTimeout(function(){f=null},y),j=0;j<b;++j)L=D[j],M.touch0&&M.touch0[2]===L.identifier?delete M.touch0:M.touch1&&M.touch1[2]===L.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&&(L=wt(L,this),Math.hypot(c[0]-L[0],c[1]-L[1])<S)){var O=et(this).on("dblclick.zoom");O&&O.apply(this,arguments)}}}return p.wheelDelta=function(_){return arguments.length?(r=typeof _=="function"?_:ps(+_),p):r},p.filter=function(_){return arguments.length?(e=typeof _=="function"?_:ps(!!_),p):e},p.touchable=function(_){return arguments.length?(o=typeof _=="function"?_:ps(!!_),p):o},p.extent=function(_){return arguments.length?(t=typeof _=="function"?_:ps([[+_[0][0],+_[0][1]],[+_[1][0],+_[1][1]]]),p):t},p.scaleExtent=function(_){return arguments.length?(i[0]=+_[0],i[1]=+_[1],p):[i[0],i[1]]},p.translateExtent=function(_){return arguments.length?(s[0][0]=+_[0][0],s[1][0]=+_[1][0],s[0][1]=+_[0][1],s[1][1]=+_[1][1],p):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},p.constrain=function(_){return arguments.length?(n=_,p):n},p.duration=function(_){return arguments.length?(l=+_,p):l},p.interpolate=function(_){return arguments.length?(a=_,p):a},p.on=function(){var _=u.on.apply(u,arguments);return _===u?p:_},p.clickDistance=function(_){return arguments.length?(w=(_=+_)*_,p):Math.sqrt(w)},p.tapDistance=function(_){return arguments.length?(S=+_,p):S},p}const Bt={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."},xi=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],S0=["Enter"," ","Escape"],E0={"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 eo;(function(e){e.Strict="strict",e.Loose="loose"})(eo||(eo={}));var tr;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(tr||(tr={}));var wi;(function(e){e.Partial="partial",e.Full="full"})(wi||(wi={}));const N0={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var xn;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(xn||(xn={}));var El;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(El||(El={}));var K;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(K||(K={}));const fp={[K.Left]:K.Right,[K.Right]:K.Left,[K.Top]:K.Bottom,[K.Bottom]:K.Top};function k0(e){return e===null?null:e?"valid":"invalid"}const C0=e=>"id"in e&&"source"in e&&"target"in e,Tj=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Zd=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Li=(e,t=[0,0])=>{const{width:n,height:r}=ln(e),o=e.origin??t,i=n*o[0],s=r*o[1];return{x:e.position.x-i,y:e.position.y-s}},Ij=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,o)=>{const i=typeof o=="string";let s=!t.nodeLookup&&!i?o:void 0;t.nodeLookup&&(s=i?t.nodeLookup.get(o):Zd(o)?o:t.nodeLookup.get(o.id));const l=s?Nl(s,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return sa(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return la(n)},Ai=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(o=>{(t.filter===void 0||t.filter(o))&&(n=sa(n,Nl(o)),r=!0)}),r?la(n):{x:0,y:0,width:0,height:0}},Jd=(e,t,[n,r,o]=[0,0,1],i=!1,s=!1)=>{const l={...zi(t,[n,r,o]),width:t.width/o,height:t.height/o},a=[];for(const u of e.values()){const{measured:d,selectable:c=!0,hidden:f=!1}=u;if(s&&!c||f)continue;const y=d.width??u.width??u.initialWidth??null,x=d.height??u.height??u.initialHeight??null,w=Si(l,no(u)),S=(y??0)*(x??0),p=i&&w>0;(!u.internals.handleBounds||p||w>=S||u.dragging)&&a.push(u)}return a},Lj=(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 Aj(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(o=>o.id)):null;return e.forEach(o=>{o.measured.width&&o.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!o.hidden)&&(!r||r.has(o.id))&&n.set(o.id,o)}),n}async function Dj({nodes:e,width:t,height:n,panZoom:r,minZoom:o,maxZoom:i},s){if(e.size===0)return Promise.resolve(!0);const l=Aj(e,s),a=Ai(l),u=ef(a,t,n,(s==null?void 0:s.minZoom)??o,(s==null?void 0:s.maxZoom)??i,(s==null?void 0:s.padding)??.1);return await r.setViewport(u,{duration:s==null?void 0:s.duration,ease:s==null?void 0:s.ease,interpolate:s==null?void 0:s.interpolate}),Promise.resolve(!0)}function b0({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:o,onError:i}){const s=n.get(e),l=s.parentId?n.get(s.parentId):void 0,{x:a,y:u}=l?l.internals.positionAbsolute:{x:0,y:0},d=s.origin??r;let c=s.extent||o;if(s.extent==="parent"&&!s.expandParent)if(!l)i==null||i("005",Bt.error005());else{const y=l.measured.width,x=l.measured.height;y&&x&&(c=[[a,u],[a+y,u+x]])}else l&&ro(s.extent)&&(c=[[s.extent[0][0]+a,s.extent[0][1]+u],[s.extent[1][0]+a,s.extent[1][1]+u]]);const f=ro(c)?cr(t,c,s.measured):t;return(s.measured.width===void 0||s.measured.height===void 0)&&(i==null||i("015",Bt.error015())),{position:{x:f.x-a+(s.measured.width??0)*d[0],y:f.y-u+(s.measured.height??0)*d[1]},positionAbsolute:f}}async function zj({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:o}){const i=new Set(e.map(f=>f.id)),s=[];for(const f of n){if(f.deletable===!1)continue;const y=i.has(f.id),x=!y&&f.parentId&&s.find(w=>w.id===f.parentId);(y||x)&&s.push(f)}const l=new Set(t.map(f=>f.id)),a=r.filter(f=>f.deletable!==!1),d=Lj(s,a);for(const f of a)l.has(f.id)&&!d.find(x=>x.id===f.id)&&d.push(f);if(!o)return{edges:d,nodes:s};const c=await o({nodes:s,edges:d});return typeof c=="boolean"?c?{edges:d,nodes:s}:{edges:[],nodes:[]}:c}const to=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),cr=(e={x:0,y:0},t,n)=>({x:to(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:to(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function _0(e,t,n){const{width:r,height:o}=ln(n),{x:i,y:s}=n.internals.positionAbsolute;return cr(e,[[i,s],[i+r,s+o]],t)}const hp=(e,t,n)=>e<t?to(Math.abs(e-t),1,t)/t:e>n?-to(Math.abs(e-n),1,t)/t:0,P0=(e,t,n=15,r=40)=>{const o=hp(e.x,r,t.width-r)*n,i=hp(e.y,r,t.height-r)*n;return[o,i]},sa=(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)}),Nc=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),la=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),no=(e,t=[0,0])=>{var o,i;const{x:n,y:r}=Zd(e)?e.internals.positionAbsolute:Li(e,t);return{x:n,y:r,width:((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},Nl=(e,t=[0,0])=>{var o,i;const{x:n,y:r}=Zd(e)?e.internals.positionAbsolute:Li(e,t);return{x:n,y:r,x2:n+(((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0),y2:r+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},j0=(e,t)=>la(sa(Nc(e),Nc(t))),Si=(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)},pp=e=>Nt(e.width)&&Nt(e.height)&&Nt(e.x)&&Nt(e.y),Nt=e=>!isNaN(e)&&isFinite(e),$j=(e,t)=>{},Di=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),zi=({x:e,y:t},[n,r,o],i=!1,s=[1,1])=>{const l={x:(e-n)/o,y:(t-r)/o};return i?Di(l,s):l},kl=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r});function xr(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 Oj(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=xr(e,n),o=xr(e,t);return{top:r,right:o,bottom:r,left:o,x:o*2,y:r*2}}if(typeof e=="object"){const r=xr(e.top??e.y??0,n),o=xr(e.bottom??e.y??0,n),i=xr(e.left??e.x??0,t),s=xr(e.right??e.x??0,t);return{top:r,right:s,bottom:o,left:i,x:i+s,y:r+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Fj(e,t,n,r,o,i){const{x:s,y:l}=kl(e,[t,n,r]),{x:a,y:u}=kl({x:e.x+e.width,y:e.y+e.height},[t,n,r]),d=o-a,c=i-u;return{left:Math.floor(s),top:Math.floor(l),right:Math.floor(d),bottom:Math.floor(c)}}const ef=(e,t,n,r,o,i)=>{const s=Oj(i,t,n),l=(t-s.x)/e.width,a=(n-s.y)/e.height,u=Math.min(l,a),d=to(u,r,o),c=e.x+e.width/2,f=e.y+e.height/2,y=t/2-c*d,x=n/2-f*d,w=Fj(e,y,x,d,t,n),S={left:Math.min(w.left-s.left,0),top:Math.min(w.top-s.top,0),right:Math.min(w.right-s.right,0),bottom:Math.min(w.bottom-s.bottom,0)};return{x:y-S.left+S.right,y:x-S.top+S.bottom,zoom:d}},Ei=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function ro(e){return e!=null&&e!=="parent"}function ln(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 M0(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 R0(e,t={width:0,height:0},n,r,o){const i={...e},s=r.get(n);if(s){const l=s.origin||o;i.x+=s.internals.positionAbsolute.x-(t.width??0)*l[0],i.y+=s.internals.positionAbsolute.y-(t.height??0)*l[1]}return i}function mp(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Bj(){let e,t;return{promise:new Promise((r,o)=>{e=r,t=o}),resolve:e,reject:t}}function Vj(e){return{...E0,...e||{}}}function Ko(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:o}){const{x:i,y:s}=kt(e),l=zi({x:i-((o==null?void 0:o.left)??0),y:s-((o==null?void 0:o.top)??0)},r),{x:a,y:u}=n?Di(l,t):l;return{xSnapped:a,ySnapped:u,...l}}const tf=e=>({width:e.offsetWidth,height:e.offsetHeight}),T0=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},Hj=["INPUT","SELECT","TEXTAREA"];function I0(e){var r,o;const t=((o=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:o[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:Hj.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const L0=e=>"clientX"in e,kt=(e,t)=>{var i,s;const n=L0(e),r=n?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,o=n?e.clientY:(s=e.touches)==null?void 0:s[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:o-((t==null?void 0:t.top)??0)}},gp=(e,t,n,r,o)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(s=>{const l=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:o,position:s.getAttribute("data-handlepos"),x:(l.left-n.left)/r,y:(l.top-n.top)/r,...tf(s)}})};function A0({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:i,targetControlX:s,targetControlY:l}){const a=e*.125+o*.375+s*.375+n*.125,u=t*.125+i*.375+l*.375+r*.125,d=Math.abs(a-e),c=Math.abs(u-t);return[a,u,d,c]}function ms(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function yp({pos:e,x1:t,y1:n,x2:r,y2:o,c:i}){switch(e){case K.Left:return[t-ms(t-r,i),n];case K.Right:return[t+ms(r-t,i),n];case K.Top:return[t,n-ms(n-o,i)];case K.Bottom:return[t,n+ms(o-n,i)]}}function D0({sourceX:e,sourceY:t,sourcePosition:n=K.Bottom,targetX:r,targetY:o,targetPosition:i=K.Top,curvature:s=.25}){const[l,a]=yp({pos:n,x1:e,y1:t,x2:r,y2:o,c:s}),[u,d]=yp({pos:i,x1:r,y1:o,x2:e,y2:t,c:s}),[c,f,y,x]=A0({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:l,sourceControlY:a,targetControlX:u,targetControlY:d});return[`M${e},${t} C${l},${a} ${u},${d} ${r},${o}`,c,f,y,x]}function z0({sourceX:e,sourceY:t,targetX:n,targetY:r}){const o=Math.abs(n-e)/2,i=n<e?n+o:n-o,s=Math.abs(r-t)/2,l=r<t?r+s:r-s;return[i,l,o,s]}function Uj({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:o=!1,zIndexMode:i="basic"}){if(i==="manual")return r;const s=o&&n?r+1e3:r,l=Math.max(e.parentId||o&&e.selected?e.internals.z:0,t.parentId||o&&t.selected?t.internals.z:0);return s+l}function Wj({sourceNode:e,targetNode:t,width:n,height:r,transform:o}){const i=sa(Nl(e),Nl(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const s={x:-o[0]/o[2],y:-o[1]/o[2],width:n/o[2],height:r/o[2]};return Si(s,la(i))>0}const Yj=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,Xj=(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)),Gj=(e,t,n={})=>{if(!e.source||!e.target)return t;const r=n.getEdgeId||Yj;let o;return C0(e)?o={...e}:o={...e,id:r(e)},Xj(o,t)?t:(o.sourceHandle===null&&delete o.sourceHandle,o.targetHandle===null&&delete o.targetHandle,t.concat(o))};function $0({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[o,i,s,l]=z0({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,i,s,l]}const vp={[K.Left]:{x:-1,y:0},[K.Right]:{x:1,y:0},[K.Top]:{x:0,y:-1},[K.Bottom]:{x:0,y:1}},Kj=({source:e,sourcePosition:t=K.Bottom,target:n})=>t===K.Left||t===K.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},xp=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Qj({source:e,sourcePosition:t=K.Bottom,target:n,targetPosition:r=K.Top,center:o,offset:i,stepPosition:s}){const l=vp[t],a=vp[r],u={x:e.x+l.x*i,y:e.y+l.y*i},d={x:n.x+a.x*i,y:n.y+a.y*i},c=Kj({source:u,sourcePosition:t,target:d}),f=c.x!==0?"x":"y",y=c[f];let x=[],w,S;const p={x:0,y:0},g={x:0,y:0},[,,m,E]=z0({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[f]*a[f]===-1){f==="x"?(w=o.x??u.x+(d.x-u.x)*s,S=o.y??(u.y+d.y)/2):(w=o.x??(u.x+d.x)/2,S=o.y??u.y+(d.y-u.y)*s);const C=[{x:w,y:u.y},{x:w,y:d.y}],k=[{x:u.x,y:S},{x:d.x,y:S}];l[f]===y?x=f==="x"?C:k:x=f==="x"?k:C}else{const C=[{x:u.x,y:d.y}],k=[{x:d.x,y:u.y}];if(f==="x"?x=l.x===y?k:C:x=l.y===y?C:k,t===r){const T=Math.abs(e[f]-n[f]);if(T<=i){const F=Math.min(i-1,i-T);l[f]===y?p[f]=(u[f]>e[f]?-1:1)*F:g[f]=(d[f]>n[f]?-1:1)*F}}if(t!==r){const T=f==="x"?"y":"x",F=l[f]===a[T],_=u[T]>d[T],A=u[T]<d[T];(l[f]===1&&(!F&&_||F&&A)||l[f]!==1&&(!F&&A||F&&_))&&(x=f==="x"?C:k)}const P={x:u.x+p.x,y:u.y+p.y},R={x:d.x+g.x,y:d.y+g.y},z=Math.max(Math.abs(P.x-x[0].x),Math.abs(R.x-x[0].x)),I=Math.max(Math.abs(P.y-x[0].y),Math.abs(R.y-x[0].y));z>=I?(w=(P.x+R.x)/2,S=x[0].y):(w=x[0].x,S=(P.y+R.y)/2)}return[[e,{x:u.x+p.x,y:u.y+p.y},...x,{x:d.x+g.x,y:d.y+g.y},n],w,S,m,E]}function qj(e,t,n,r){const o=Math.min(xp(e,t)/2,xp(t,n)/2,r),{x:i,y:s}=t;if(e.x===i&&i===n.x||e.y===s&&s===n.y)return`L${i} ${s}`;if(e.y===s){const u=e.x<n.x?-1:1,d=e.y<n.y?1:-1;return`L ${i+o*u},${s}Q ${i},${s} ${i},${s+o*d}`}const l=e.x<n.x?1:-1,a=e.y<n.y?-1:1;return`L ${i},${s+o*a}Q ${i},${s} ${i+o*l},${s}`}function kc({sourceX:e,sourceY:t,sourcePosition:n=K.Bottom,targetX:r,targetY:o,targetPosition:i=K.Top,borderRadius:s=5,centerX:l,centerY:a,offset:u=20,stepPosition:d=.5}){const[c,f,y,x,w]=Qj({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:i,center:{x:l,y:a},offset:u,stepPosition:d});return[c.reduce((p,g,m)=>{let E="";return m>0&&m<c.length-1?E=qj(c[m-1],g,c[m+1],s):E=`${m===0?"M":"L"}${g.x} ${g.y}`,p+=E,p},""),f,y,x,w]}function wp(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function Zj(e){var c;const{sourceNode:t,targetNode:n}=e;if(!wp(t)||!wp(n))return null;const r=t.internals.handleBounds||Sp(t.handles),o=n.internals.handleBounds||Sp(n.handles),i=Ep((r==null?void 0:r.source)??[],e.sourceHandle),s=Ep(e.connectionMode===eo.Strict?(o==null?void 0:o.target)??[]:((o==null?void 0:o.target)??[]).concat((o==null?void 0:o.source)??[]),e.targetHandle);if(!i||!s)return(c=e.onError)==null||c.call(e,"008",Bt.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(i==null?void 0:i.position)||K.Bottom,a=(s==null?void 0:s.position)||K.Top,u=dr(t,i,l),d=dr(n,s,a);return{sourceX:u.x,sourceY:u.y,targetX:d.x,targetY:d.y,sourcePosition:l,targetPosition:a}}function Sp(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 dr(e,t,n=K.Left,r=!1){const o=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,i=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:s,height:l}=t??ln(e);if(r)return{x:o+s/2,y:i+l/2};switch((t==null?void 0:t.position)??n){case K.Top:return{x:o+s/2,y:i};case K.Right:return{x:o+s,y:i+l/2};case K.Bottom:return{x:o+s/2,y:i+l};case K.Left:return{x:o,y:i+l/2}}}function Ep(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Cc(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function Jj(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:o}){const i=new Set;return e.reduce((s,l)=>([l.markerStart||r,l.markerEnd||o].forEach(a=>{if(a&&typeof a=="object"){const u=Cc(a,t);i.has(u)||(s.push({id:u,color:a.color||n,...a}),i.add(u))}}),s),[]).sort((s,l)=>s.id.localeCompare(l.id))}const O0=1e3,eM=10,nf={nodeOrigin:[0,0],nodeExtent:xi,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},tM={...nf,checkEquality:!0};function rf(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function nM(e,t,n){const r=rf(nf,n);for(const o of e.values())if(o.parentId)sf(o,e,t,r);else{const i=Li(o,r.nodeOrigin),s=ro(o.extent)?o.extent:r.nodeExtent,l=cr(i,s,ln(o));o.internals.positionAbsolute=l}}function rM(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const o of e.handles){const i={id:o.id,width:o.width??1,height:o.height??1,nodeId:e.id,x:o.x,y:o.y,position:o.position,type:o.type};o.type==="source"?n.push(i):o.type==="target"&&r.push(i)}return{source:n,target:r}}function of(e){return e==="manual"}function bc(e,t,n,r={}){var u,d;const o=rf(tM,r),i={i:0},s=new Map(t),l=o!=null&&o.elevateNodesOnSelect&&!of(o.zIndexMode)?O0:0;let a=e.length>0;t.clear(),n.clear();for(const c of e){let f=s.get(c.id);if(o.checkEquality&&c===(f==null?void 0:f.internals.userNode))t.set(c.id,f);else{const y=Li(c,o.nodeOrigin),x=ro(c.extent)?c.extent:o.nodeExtent,w=cr(y,x,ln(c));f={...o.defaults,...c,measured:{width:(u=c.measured)==null?void 0:u.width,height:(d=c.measured)==null?void 0:d.height},internals:{positionAbsolute:w,handleBounds:rM(c,f),z:F0(c,l,o.zIndexMode),userNode:c}},t.set(c.id,f)}(f.measured===void 0||f.measured.width===void 0||f.measured.height===void 0)&&!f.hidden&&(a=!1),c.parentId&&sf(f,t,n,r,i)}return a}function oM(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function sf(e,t,n,r,o){const{elevateNodesOnSelect:i,nodeOrigin:s,nodeExtent:l,zIndexMode:a}=rf(nf,r),u=e.parentId,d=t.get(u);if(!d){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}oM(e,n),o&&!d.parentId&&d.internals.rootParentIndex===void 0&&a==="auto"&&(d.internals.rootParentIndex=++o.i,d.internals.z=d.internals.z+o.i*eM),o&&d.internals.rootParentIndex!==void 0&&(o.i=d.internals.rootParentIndex);const c=i&&!of(a)?O0:0,{x:f,y,z:x}=iM(e,d,s,l,c,a),{positionAbsolute:w}=e.internals,S=f!==w.x||y!==w.y;(S||x!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:S?{x:f,y}:w,z:x}})}function F0(e,t,n){const r=Nt(e.zIndex)?e.zIndex:0;return of(n)?r:r+(e.selected?t:0)}function iM(e,t,n,r,o,i){const{x:s,y:l}=t.internals.positionAbsolute,a=ln(e),u=Li(e,n),d=ro(e.extent)?cr(u,e.extent,a):u;let c=cr({x:s+d.x,y:l+d.y},r,a);e.extent==="parent"&&(c=_0(c,a,t));const f=F0(e,o,i),y=t.internals.z??0;return{x:c.x,y:c.y,z:y>=f?y+1:f}}function lf(e,t,n,r=[0,0]){var s;const o=[],i=new Map;for(const l of e){const a=t.get(l.parentId);if(!a)continue;const u=((s=i.get(l.parentId))==null?void 0:s.expandedRect)??no(a),d=j0(u,l.rect);i.set(l.parentId,{expandedRect:d,parent:a})}return i.size>0&&i.forEach(({expandedRect:l,parent:a},u)=>{var m;const d=a.internals.positionAbsolute,c=ln(a),f=a.origin??r,y=l.x<d.x?Math.round(Math.abs(d.x-l.x)):0,x=l.y<d.y?Math.round(Math.abs(d.y-l.y)):0,w=Math.max(c.width,Math.round(l.width)),S=Math.max(c.height,Math.round(l.height)),p=(w-c.width)*f[0],g=(S-c.height)*f[1];(y>0||x>0||p||g)&&(o.push({id:u,type:"position",position:{x:a.position.x-y+p,y:a.position.y-x+g}}),(m=n.get(u))==null||m.forEach(E=>{e.some(N=>N.id===E.id)||o.push({id:E.id,type:"position",position:{x:E.position.x+y,y:E.position.y+x}})})),(c.width<l.width||c.height<l.height||y||x)&&o.push({id:u,type:"dimensions",setAttributes:!0,dimensions:{width:w+(y?f[0]*y-p:0),height:S+(x?f[1]*x-g:0)}})}),o}function sM(e,t,n,r,o,i,s){const l=r==null?void 0:r.querySelector(".xyflow__viewport");let a=!1;if(!l)return{changes:[],updatedInternals:a};const u=[],d=window.getComputedStyle(l),{m22:c}=new window.DOMMatrixReadOnly(d.transform),f=[];for(const y of e.values()){const x=t.get(y.id);if(!x)continue;if(x.hidden){t.set(x.id,{...x,internals:{...x.internals,handleBounds:void 0}}),a=!0;continue}const w=tf(y.nodeElement),S=x.measured.width!==w.width||x.measured.height!==w.height;if(!!(w.width&&w.height&&(S||!x.internals.handleBounds||y.force))){const g=y.nodeElement.getBoundingClientRect(),m=ro(x.extent)?x.extent:i;let{positionAbsolute:E}=x.internals;x.parentId&&x.extent==="parent"?E=_0(E,w,t.get(x.parentId)):m&&(E=cr(E,m,w));const N={...x,measured:w,internals:{...x.internals,positionAbsolute:E,handleBounds:{source:gp("source",y.nodeElement,g,c,x.id),target:gp("target",y.nodeElement,g,c,x.id)}}};t.set(x.id,N),x.parentId&&sf(N,t,n,{nodeOrigin:o,zIndexMode:s}),a=!0,S&&(u.push({id:x.id,type:"dimensions",dimensions:w}),x.expandParent&&x.parentId&&f.push({id:x.id,parentId:x.parentId,rect:no(N,o)}))}}if(f.length>0){const y=lf(f,t,n,o);u.push(...y)}return{changes:u,updatedInternals:a}}async function lM({delta:e,panZoom:t,transform:n,translateExtent:r,width:o,height:i}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const s=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[o,i]],r),l=!!s&&(s.x!==n[0]||s.y!==n[1]||s.k!==n[2]);return Promise.resolve(l)}function Np(e,t,n,r,o,i){let s=o;const l=r.get(s)||new Map;r.set(s,l.set(n,t)),s=`${o}-${e}`;const a=r.get(s)||new Map;if(r.set(s,a.set(n,t)),i){s=`${o}-${e}-${i}`;const u=r.get(s)||new Map;r.set(s,u.set(n,t))}}function B0(e,t,n){e.clear(),t.clear();for(const r of n){const{source:o,target:i,sourceHandle:s=null,targetHandle:l=null}=r,a={edgeId:r.id,source:o,target:i,sourceHandle:s,targetHandle:l},u=`${o}-${s}--${i}-${l}`,d=`${i}-${l}--${o}-${s}`;Np("source",a,d,e,o,s),Np("target",a,u,e,i,l),t.set(r.id,r)}}function V0(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:V0(n,t):!1}function kp(e,t,n){var o;let r=e;do{if((o=r==null?void 0:r.matches)!=null&&o.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function aM(e,t,n,r){const o=new Map;for(const[i,s]of e)if((s.selected||s.id===r)&&(!s.parentId||!V0(s,e))&&(s.draggable||t&&typeof s.draggable>"u")){const l=e.get(i);l&&o.set(i,{id:i,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 o}function ou({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var s,l,a;const o=[];for(const[u,d]of t){const c=(s=n.get(u))==null?void 0:s.internals.userNode;c&&o.push({...c,position:d.position,dragging:r})}if(!e)return[o[0],o];const i=(l=n.get(e))==null?void 0:l.internals.userNode;return[i?{...i,position:((a=t.get(e))==null?void 0:a.position)||i.position,dragging:r}:o[0],o]}function uM({dragItems:e,snapGrid:t,x:n,y:r}){const o=e.values().next().value;if(!o)return null;const i={x:n-o.distance.x,y:r-o.distance.y},s=Di(i,t);return{x:s.x-i.x,y:s.y-i.y}}function cM({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:o}){let i={x:null,y:null},s=0,l=new Map,a=!1,u={x:0,y:0},d=null,c=!1,f=null,y=!1,x=!1,w=null;function S({noDragClassName:g,handleSelector:m,domNode:E,isSelectable:N,nodeId:C,nodeClickDistance:k=0}){f=et(E);function P({x:T,y:F}){const{nodeLookup:_,nodeExtent:A,snapGrid:M,snapToGrid:D,nodeOrigin:b,onNodeDrag:j,onSelectionDrag:L,onError:O,updateNodePositions:$}=t();i={x:T,y:F};let U=!1;const H=l.size>1,Y=H&&A?Nc(Ai(l)):null,X=H&&D?uM({dragItems:l,snapGrid:M,x:T,y:F}):null;for(const[G,V]of l){if(!_.has(G))continue;let Q={x:T-V.distance.x,y:F-V.distance.y};D&&(Q=X?{x:Math.round(Q.x+X.x),y:Math.round(Q.y+X.y)}:Di(Q,M));let te=null;if(H&&A&&!V.extent&&Y){const{positionAbsolute:q}=V.internals,se=q.x-Y.x+A[0][0],ce=q.x+V.measured.width-Y.x2+A[1][0],ie=q.y-Y.y+A[0][1],De=q.y+V.measured.height-Y.y2+A[1][1];te=[[se,ie],[ce,De]]}const{position:J,positionAbsolute:Z}=b0({nodeId:G,nextPosition:Q,nodeLookup:_,nodeExtent:te||A,nodeOrigin:b,onError:O});U=U||V.position.x!==J.x||V.position.y!==J.y,V.position=J,V.internals.positionAbsolute=Z}if(x=x||U,!!U&&($(l,!0),w&&(r||j||!C&&L))){const[G,V]=ou({nodeId:C,dragItems:l,nodeLookup:_});r==null||r(w,l,G,V),j==null||j(w,G,V),C||L==null||L(w,V)}}async function R(){if(!d)return;const{transform:T,panBy:F,autoPanSpeed:_,autoPanOnNodeDrag:A}=t();if(!A){a=!1,cancelAnimationFrame(s);return}const[M,D]=P0(u,d,_);(M!==0||D!==0)&&(i.x=(i.x??0)-M/T[2],i.y=(i.y??0)-D/T[2],await F({x:M,y:D})&&P(i)),s=requestAnimationFrame(R)}function z(T){var H;const{nodeLookup:F,multiSelectionActive:_,nodesDraggable:A,transform:M,snapGrid:D,snapToGrid:b,selectNodesOnDrag:j,onNodeDragStart:L,onSelectionDragStart:O,unselectNodesAndEdges:$}=t();c=!0,(!j||!N)&&!_&&C&&((H=F.get(C))!=null&&H.selected||$()),N&&j&&C&&(e==null||e(C));const U=Ko(T.sourceEvent,{transform:M,snapGrid:D,snapToGrid:b,containerBounds:d});if(i=U,l=aM(F,A,U,C),l.size>0&&(n||L||!C&&O)){const[Y,X]=ou({nodeId:C,dragItems:l,nodeLookup:F});n==null||n(T.sourceEvent,l,Y,X),L==null||L(T.sourceEvent,Y,X),C||O==null||O(T.sourceEvent,X)}}const I=i0().clickDistance(k).on("start",T=>{const{domNode:F,nodeDragThreshold:_,transform:A,snapGrid:M,snapToGrid:D}=t();d=(F==null?void 0:F.getBoundingClientRect())||null,y=!1,x=!1,w=T.sourceEvent,_===0&&z(T),i=Ko(T.sourceEvent,{transform:A,snapGrid:M,snapToGrid:D,containerBounds:d}),u=kt(T.sourceEvent,d)}).on("drag",T=>{const{autoPanOnNodeDrag:F,transform:_,snapGrid:A,snapToGrid:M,nodeDragThreshold:D,nodeLookup:b}=t(),j=Ko(T.sourceEvent,{transform:_,snapGrid:A,snapToGrid:M,containerBounds:d});if(w=T.sourceEvent,(T.sourceEvent.type==="touchmove"&&T.sourceEvent.touches.length>1||C&&!b.has(C))&&(y=!0),!y){if(!a&&F&&c&&(a=!0,R()),!c){const L=kt(T.sourceEvent,d),O=L.x-u.x,$=L.y-u.y;Math.sqrt(O*O+$*$)>D&&z(T)}(i.x!==j.xSnapped||i.y!==j.ySnapped)&&l&&c&&(u=kt(T.sourceEvent,d),P(j))}}).on("end",T=>{if(!(!c||y)&&(a=!1,c=!1,cancelAnimationFrame(s),l.size>0)){const{nodeLookup:F,updateNodePositions:_,onNodeDragStop:A,onSelectionDragStop:M}=t();if(x&&(_(l,!1),x=!1),o||A||!C&&M){const[D,b]=ou({nodeId:C,dragItems:l,nodeLookup:F,dragging:!1});o==null||o(T.sourceEvent,l,D,b),A==null||A(T.sourceEvent,D,b),C||M==null||M(T.sourceEvent,b)}}}).filter(T=>{const F=T.target;return!T.button&&(!g||!kp(F,`.${g}`,E))&&(!m||kp(F,m,E))});f.call(I)}function p(){f==null||f.on(".drag",null)}return{update:S,destroy:p}}function dM(e,t,n){const r=[],o={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())Si(o,no(i))>0&&r.push(i);return r}const fM=250;function hM(e,t,n,r){var l,a;let o=[],i=1/0;const s=dM(e,n,t+fM);for(const u of s){const d=[...((l=u.internals.handleBounds)==null?void 0:l.source)??[],...((a=u.internals.handleBounds)==null?void 0:a.target)??[]];for(const c of d){if(r.nodeId===c.nodeId&&r.type===c.type&&r.id===c.id)continue;const{x:f,y}=dr(u,c,c.position,!0),x=Math.sqrt(Math.pow(f-e.x,2)+Math.pow(y-e.y,2));x>t||(x<i?(o=[{...c,x:f,y}],i=x):x===i&&o.push({...c,x:f,y}))}}if(!o.length)return null;if(o.length>1){const u=r.type==="source"?"target":"source";return o.find(d=>d.type===u)??o[0]}return o[0]}function H0(e,t,n,r,o,i=!1){var u,d,c;const s=r.get(e);if(!s)return null;const l=o==="strict"?(u=s.internals.handleBounds)==null?void 0:u[t]:[...((d=s.internals.handleBounds)==null?void 0:d.source)??[],...((c=s.internals.handleBounds)==null?void 0:c.target)??[]],a=(n?l==null?void 0:l.find(f=>f.id===n):l==null?void 0:l[0])??null;return a&&i?{...a,...dr(s,a,a.position,!0)}:a}function U0(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function pM(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const W0=()=>!0;function mM(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:o,edgeUpdaterType:i,isTarget:s,domNode:l,nodeLookup:a,lib:u,autoPanOnConnect:d,flowId:c,panBy:f,cancelConnection:y,onConnectStart:x,onConnect:w,onConnectEnd:S,isValidConnection:p=W0,onReconnectEnd:g,updateConnection:m,getTransform:E,getFromHandle:N,autoPanSpeed:C,dragThreshold:k=1,handleDomNode:P}){const R=T0(e.target);let z=0,I;const{x:T,y:F}=kt(e),_=U0(i,P),A=l==null?void 0:l.getBoundingClientRect();let M=!1;if(!A||!_)return;const D=H0(o,_,r,a,t);if(!D)return;let b=kt(e,A),j=!1,L=null,O=!1,$=null;function U(){if(!d||!A)return;const[J,Z]=P0(b,A,C);f({x:J,y:Z}),z=requestAnimationFrame(U)}const H={...D,nodeId:o,type:_,position:D.position},Y=a.get(o);let G={inProgress:!0,isValid:null,from:dr(Y,H,K.Left,!0),fromHandle:H,fromPosition:H.position,fromNode:Y,to:b,toHandle:null,toPosition:fp[H.position],toNode:null,pointer:b};function V(){M=!0,m(G),x==null||x(e,{nodeId:o,handleId:r,handleType:_})}k===0&&V();function Q(J){if(!M){const{x:De,y:an}=kt(J),Ut=De-T,Bn=an-F;if(!(Ut*Ut+Bn*Bn>k*k))return;V()}if(!N()||!H){te(J);return}const Z=E();b=kt(J,A),I=hM(zi(b,Z,!1,[1,1]),n,a,H),j||(U(),j=!0);const q=Y0(J,{handle:I,connectionMode:t,fromNodeId:o,fromHandleId:r,fromType:s?"target":"source",isValidConnection:p,doc:R,lib:u,flowId:c,nodeLookup:a});$=q.handleDomNode,L=q.connection,O=pM(!!I,q.isValid);const se=a.get(o),ce=se?dr(se,H,K.Left,!0):G.from,ie={...G,from:ce,isValid:O,to:q.toHandle&&O?kl({x:q.toHandle.x,y:q.toHandle.y},Z):b,toHandle:q.toHandle,toPosition:O&&q.toHandle?q.toHandle.position:fp[H.position],toNode:q.toHandle?a.get(q.toHandle.nodeId):null,pointer:b};m(ie),G=ie}function te(J){if(!("touches"in J&&J.touches.length>0)){if(M){(I||$)&&L&&O&&(w==null||w(L));const{inProgress:Z,...q}=G,se={...q,toPosition:G.toHandle?G.toPosition:null};S==null||S(J,se),i&&(g==null||g(J,se))}y(),cancelAnimationFrame(z),j=!1,O=!1,L=null,$=null,R.removeEventListener("mousemove",Q),R.removeEventListener("mouseup",te),R.removeEventListener("touchmove",Q),R.removeEventListener("touchend",te)}}R.addEventListener("mousemove",Q),R.addEventListener("mouseup",te),R.addEventListener("touchmove",Q),R.addEventListener("touchend",te)}function Y0(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:o,fromType:i,doc:s,lib:l,flowId:a,isValidConnection:u=W0,nodeLookup:d}){const c=i==="target",f=t?s.querySelector(`.${l}-flow__handle[data-id="${a}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:y,y:x}=kt(e),w=s.elementFromPoint(y,x),S=w!=null&&w.classList.contains(`${l}-flow__handle`)?w:f,p={handleDomNode:S,isValid:!1,connection:null,toHandle:null};if(S){const g=U0(void 0,S),m=S.getAttribute("data-nodeid"),E=S.getAttribute("data-handleid"),N=S.classList.contains("connectable"),C=S.classList.contains("connectableend");if(!m||!g)return p;const k={source:c?m:r,sourceHandle:c?E:o,target:c?r:m,targetHandle:c?o:E};p.connection=k;const R=N&&C&&(n===eo.Strict?c&&g==="source"||!c&&g==="target":m!==r||E!==o);p.isValid=R&&u(k),p.toHandle=H0(m,g,E,d,n,!0)}return p}const _c={onPointerDown:mM,isValid:Y0};function gM({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const o=et(e);function i({translateExtent:l,width:a,height:u,zoomStep:d=1,pannable:c=!0,zoomable:f=!0,inversePan:y=!1}){const x=m=>{if(m.sourceEvent.type!=="wheel"||!t)return;const E=n(),N=m.sourceEvent.ctrlKey&&Ei()?10:1,C=-m.sourceEvent.deltaY*(m.sourceEvent.deltaMode===1?.05:m.sourceEvent.deltaMode?1:.002)*d,k=E[2]*Math.pow(2,C*N);t.scaleTo(k)};let w=[0,0];const S=m=>{(m.sourceEvent.type==="mousedown"||m.sourceEvent.type==="touchstart")&&(w=[m.sourceEvent.clientX??m.sourceEvent.touches[0].clientX,m.sourceEvent.clientY??m.sourceEvent.touches[0].clientY])},p=m=>{const E=n();if(m.sourceEvent.type!=="mousemove"&&m.sourceEvent.type!=="touchmove"||!t)return;const N=[m.sourceEvent.clientX??m.sourceEvent.touches[0].clientX,m.sourceEvent.clientY??m.sourceEvent.touches[0].clientY],C=[N[0]-w[0],N[1]-w[1]];w=N;const k=r()*Math.max(E[2],Math.log(E[2]))*(y?-1:1),P={x:E[0]-C[0]*k,y:E[1]-C[1]*k},R=[[0,0],[a,u]];t.setViewportConstrained({x:P.x,y:P.y,zoom:E[2]},R,l)},g=w0().on("start",S).on("zoom",c?p:null).on("zoom.wheel",f?x:null);o.call(g,{})}function s(){o.on("zoom",null)}return{update:i,destroy:s,pointer:wt}}const aa=e=>({x:e.x,y:e.y,zoom:e.k}),iu=({x:e,y:t,zoom:n})=>ia.translate(e,t).scale(n),Tr=(e,t)=>e.target.closest(`.${t}`),X0=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),yM=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,su=(e,t=0,n=yM,r=()=>{})=>{const o=typeof t=="number"&&t>0;return o||r(),o?e.transition().duration(t).ease(n).on("end",r):e},G0=e=>{const t=e.ctrlKey&&Ei()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function vM({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:o,panOnScrollSpeed:i,zoomOnPinch:s,onPanZoomStart:l,onPanZoom:a,onPanZoomEnd:u}){return d=>{if(Tr(d,t))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();const c=n.property("__zoom").k||1;if(d.ctrlKey&&s){const S=wt(d),p=G0(d),g=c*Math.pow(2,p);r.scaleTo(n,g,S,d);return}const f=d.deltaMode===1?20:1;let y=o===tr.Vertical?0:d.deltaX*f,x=o===tr.Horizontal?0:d.deltaY*f;!Ei()&&d.shiftKey&&o!==tr.Vertical&&(y=d.deltaY*f,x=0),r.translateBy(n,-(y/c)*i,-(x/c)*i,{internal:!0});const w=aa(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(a==null||a(d,w),e.panScrollTimeout=setTimeout(()=>{u==null||u(d,w),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,l==null||l(d,w))}}function xM({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,o){const i=r.type==="wheel",s=!t&&i&&!r.ctrlKey,l=Tr(r,e);if(r.ctrlKey&&i&&l&&r.preventDefault(),s||l)return null;r.preventDefault(),n.call(this,r,o)}}function wM({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var i,s,l;if((i=r.sourceEvent)!=null&&i.internal)return;const o=aa(r.transform);e.mouseButton=((s=r.sourceEvent)==null?void 0:s.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=o,((l=r.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,o))}}function SM({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:o}){return i=>{var s,l;e.usedRightMouseButton=!!(n&&X0(t,e.mouseButton??0)),(s=i.sourceEvent)!=null&&s.sync||r([i.transform.x,i.transform.y,i.transform.k]),o&&!((l=i.sourceEvent)!=null&&l.internal)&&(o==null||o(i.sourceEvent,aa(i.transform)))}}function EM({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:o,onPaneContextMenu:i}){return s=>{var l;if(!((l=s.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,i&&X0(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&i(s.sourceEvent),e.usedRightMouseButton=!1,r(!1),o)){const a=aa(s.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o==null||o(s.sourceEvent,a)},n?150:0)}}}function NM({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:o,zoomOnDoubleClick:i,userSelectionActive:s,noWheelClassName:l,noPanClassName:a,lib:u,connectionInProgress:d}){return c=>{var S;const f=e||t,y=n&&c.ctrlKey,x=c.type==="wheel";if(c.button===1&&c.type==="mousedown"&&(Tr(c,`${u}-flow__node`)||Tr(c,`${u}-flow__edge`)))return!0;if(!r&&!f&&!o&&!i&&!n||s||d&&!x||Tr(c,l)&&x||Tr(c,a)&&(!x||o&&x&&!e)||!n&&c.ctrlKey&&x)return!1;if(!n&&c.type==="touchstart"&&((S=c.touches)==null?void 0:S.length)>1)return c.preventDefault(),!1;if(!f&&!o&&!y&&x||!r&&(c.type==="mousedown"||c.type==="touchstart")||Array.isArray(r)&&!r.includes(c.button)&&c.type==="mousedown")return!1;const w=Array.isArray(r)&&r.includes(c.button)||!c.button||c.button<=1;return(!c.ctrlKey||x)&&w}}function kM({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:o,onPanZoom:i,onPanZoomStart:s,onPanZoomEnd:l,onDraggingChange:a}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),c=w0().scaleExtent([t,n]).translateExtent(r),f=et(e).call(c);g({x:o.x,y:o.y,zoom:to(o.zoom,t,n)},[[0,0],[d.width,d.height]],r);const y=f.on("wheel.zoom"),x=f.on("dblclick.zoom");c.wheelDelta(G0);function w(I,T){return f?new Promise(F=>{c==null||c.interpolate((T==null?void 0:T.interpolate)==="linear"?Go:Ds).transform(su(f,T==null?void 0:T.duration,T==null?void 0:T.ease,()=>F(!0)),I)}):Promise.resolve(!1)}function S({noWheelClassName:I,noPanClassName:T,onPaneContextMenu:F,userSelectionActive:_,panOnScroll:A,panOnDrag:M,panOnScrollMode:D,panOnScrollSpeed:b,preventScrolling:j,zoomOnPinch:L,zoomOnScroll:O,zoomOnDoubleClick:$,zoomActivationKeyPressed:U,lib:H,onTransformChange:Y,connectionInProgress:X,paneClickDistance:G,selectionOnDrag:V}){_&&!u.isZoomingOrPanning&&p();const Q=A&&!U&&!_;c.clickDistance(V?1/0:!Nt(G)||G<0?0:G);const te=Q?vM({zoomPanValues:u,noWheelClassName:I,d3Selection:f,d3Zoom:c,panOnScrollMode:D,panOnScrollSpeed:b,zoomOnPinch:L,onPanZoomStart:s,onPanZoom:i,onPanZoomEnd:l}):xM({noWheelClassName:I,preventScrolling:j,d3ZoomHandler:y});if(f.on("wheel.zoom",te,{passive:!1}),!_){const Z=wM({zoomPanValues:u,onDraggingChange:a,onPanZoomStart:s});c.on("start",Z);const q=SM({zoomPanValues:u,panOnDrag:M,onPaneContextMenu:!!F,onPanZoom:i,onTransformChange:Y});c.on("zoom",q);const se=EM({zoomPanValues:u,panOnDrag:M,panOnScroll:A,onPaneContextMenu:F,onPanZoomEnd:l,onDraggingChange:a});c.on("end",se)}const J=NM({zoomActivationKeyPressed:U,panOnDrag:M,zoomOnScroll:O,panOnScroll:A,zoomOnDoubleClick:$,zoomOnPinch:L,userSelectionActive:_,noPanClassName:T,noWheelClassName:I,lib:H,connectionInProgress:X});c.filter(J),$?f.on("dblclick.zoom",x):f.on("dblclick.zoom",null)}function p(){c.on("zoom",null)}async function g(I,T,F){const _=iu(I),A=c==null?void 0:c.constrain()(_,T,F);return A&&await w(A),new Promise(M=>M(A))}async function m(I,T){const F=iu(I);return await w(F,T),new Promise(_=>_(F))}function E(I){if(f){const T=iu(I),F=f.property("__zoom");(F.k!==I.zoom||F.x!==I.x||F.y!==I.y)&&(c==null||c.transform(f,T,null,{sync:!0}))}}function N(){const I=f?x0(f.node()):{x:0,y:0,k:1};return{x:I.x,y:I.y,zoom:I.k}}function C(I,T){return f?new Promise(F=>{c==null||c.interpolate((T==null?void 0:T.interpolate)==="linear"?Go:Ds).scaleTo(su(f,T==null?void 0:T.duration,T==null?void 0:T.ease,()=>F(!0)),I)}):Promise.resolve(!1)}function k(I,T){return f?new Promise(F=>{c==null||c.interpolate((T==null?void 0:T.interpolate)==="linear"?Go:Ds).scaleBy(su(f,T==null?void 0:T.duration,T==null?void 0:T.ease,()=>F(!0)),I)}):Promise.resolve(!1)}function P(I){c==null||c.scaleExtent(I)}function R(I){c==null||c.translateExtent(I)}function z(I){const T=!Nt(I)||I<0?0:I;c==null||c.clickDistance(T)}return{update:S,destroy:p,setViewport:m,setViewportConstrained:g,getViewport:N,scaleTo:C,scaleBy:k,setScaleExtent:P,setTranslateExtent:R,syncViewport:E,setClickDistance:z}}var oo;(function(e){e.Line="line",e.Handle="handle"})(oo||(oo={}));function CM({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:o,affectsY:i}){const s=e-t,l=n-r,a=[s>0?1:s<0?-1:0,l>0?1:l<0?-1:0];return s&&o&&(a[0]=a[0]*-1),l&&i&&(a[1]=a[1]*-1),a}function Cp(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),o=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:o}}function fn(e,t){return Math.max(0,t-e)}function hn(e,t){return Math.max(0,e-t)}function gs(e,t,n){return Math.max(0,t-e,e-n)}function bp(e,t){return e?!t:t}function bM(e,t,n,r,o,i,s,l){let{affectsX:a,affectsY:u}=t;const{isHorizontal:d,isVertical:c}=t,f=d&&c,{xSnapped:y,ySnapped:x}=n,{minWidth:w,maxWidth:S,minHeight:p,maxHeight:g}=r,{x:m,y:E,width:N,height:C,aspectRatio:k}=e;let P=Math.floor(d?y-e.pointerX:0),R=Math.floor(c?x-e.pointerY:0);const z=N+(a?-P:P),I=C+(u?-R:R),T=-i[0]*N,F=-i[1]*C;let _=gs(z,w,S),A=gs(I,p,g);if(s){let b=0,j=0;a&&P<0?b=fn(m+P+T,s[0][0]):!a&&P>0&&(b=hn(m+z+T,s[1][0])),u&&R<0?j=fn(E+R+F,s[0][1]):!u&&R>0&&(j=hn(E+I+F,s[1][1])),_=Math.max(_,b),A=Math.max(A,j)}if(l){let b=0,j=0;a&&P>0?b=hn(m+P,l[0][0]):!a&&P<0&&(b=fn(m+z,l[1][0])),u&&R>0?j=hn(E+R,l[0][1]):!u&&R<0&&(j=fn(E+I,l[1][1])),_=Math.max(_,b),A=Math.max(A,j)}if(o){if(d){const b=gs(z/k,p,g)*k;if(_=Math.max(_,b),s){let j=0;!a&&!u||a&&!u&&f?j=hn(E+F+z/k,s[1][1])*k:j=fn(E+F+(a?P:-P)/k,s[0][1])*k,_=Math.max(_,j)}if(l){let j=0;!a&&!u||a&&!u&&f?j=fn(E+z/k,l[1][1])*k:j=hn(E+(a?P:-P)/k,l[0][1])*k,_=Math.max(_,j)}}if(c){const b=gs(I*k,w,S)/k;if(A=Math.max(A,b),s){let j=0;!a&&!u||u&&!a&&f?j=hn(m+I*k+T,s[1][0])/k:j=fn(m+(u?R:-R)*k+T,s[0][0])/k,A=Math.max(A,j)}if(l){let j=0;!a&&!u||u&&!a&&f?j=fn(m+I*k,l[1][0])/k:j=hn(m+(u?R:-R)*k,l[0][0])/k,A=Math.max(A,j)}}}R=R+(R<0?A:-A),P=P+(P<0?_:-_),o&&(f?z>I*k?R=(bp(a,u)?-P:P)/k:P=(bp(a,u)?-R:R)*k:d?(R=P/k,u=a):(P=R*k,a=u));const M=a?m+P:m,D=u?E+R:E;return{width:N+(a?-P:P),height:C+(u?-R:R),x:i[0]*P*(a?-1:1)+M,y:i[1]*R*(u?-1:1)+D}}const K0={width:0,height:0,x:0,y:0},_M={...K0,pointerX:0,pointerY:0,aspectRatio:1};function PM(e){return[[0,0],[e.measured.width,e.measured.height]]}function jM(e,t,n){const r=t.position.x+e.position.x,o=t.position.y+e.position.y,i=e.measured.width??0,s=e.measured.height??0,l=n[0]*i,a=n[1]*s;return[[r-l,o-a],[r+i-l,o+s-a]]}function MM({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:o}){const i=et(e);let s={controlDirection:Cp("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:u,boundaries:d,keepAspectRatio:c,resizeDirection:f,onResizeStart:y,onResize:x,onResizeEnd:w,shouldResize:S}){let p={...K0},g={..._M};s={boundaries:d,resizeDirection:f,keepAspectRatio:c,controlDirection:Cp(u)};let m,E=null,N=[],C,k,P,R=!1;const z=i0().on("start",I=>{const{nodeLookup:T,transform:F,snapGrid:_,snapToGrid:A,nodeOrigin:M,paneDomNode:D}=n();if(m=T.get(t),!m)return;E=(D==null?void 0:D.getBoundingClientRect())??null;const{xSnapped:b,ySnapped:j}=Ko(I.sourceEvent,{transform:F,snapGrid:_,snapToGrid:A,containerBounds:E});p={width:m.measured.width??0,height:m.measured.height??0,x:m.position.x??0,y:m.position.y??0},g={...p,pointerX:b,pointerY:j,aspectRatio:p.width/p.height},C=void 0,m.parentId&&(m.extent==="parent"||m.expandParent)&&(C=T.get(m.parentId),k=C&&m.extent==="parent"?PM(C):void 0),N=[],P=void 0;for(const[L,O]of T)if(O.parentId===t&&(N.push({id:L,position:{...O.position},extent:O.extent}),O.extent==="parent"||O.expandParent)){const $=jM(O,m,O.origin??M);P?P=[[Math.min($[0][0],P[0][0]),Math.min($[0][1],P[0][1])],[Math.max($[1][0],P[1][0]),Math.max($[1][1],P[1][1])]]:P=$}y==null||y(I,{...p})}).on("drag",I=>{const{transform:T,snapGrid:F,snapToGrid:_,nodeOrigin:A}=n(),M=Ko(I.sourceEvent,{transform:T,snapGrid:F,snapToGrid:_,containerBounds:E}),D=[];if(!m)return;const{x:b,y:j,width:L,height:O}=p,$={},U=m.origin??A,{width:H,height:Y,x:X,y:G}=bM(g,s.controlDirection,M,s.boundaries,s.keepAspectRatio,U,k,P),V=H!==L,Q=Y!==O,te=X!==b&&V,J=G!==j&&Q;if(!te&&!J&&!V&&!Q)return;if((te||J||U[0]===1||U[1]===1)&&($.x=te?X:p.x,$.y=J?G:p.y,p.x=$.x,p.y=$.y,N.length>0)){const ce=X-b,ie=G-j;for(const De of N)De.position={x:De.position.x-ce+U[0]*(H-L),y:De.position.y-ie+U[1]*(Y-O)},D.push(De)}if((V||Q)&&($.width=V&&(!s.resizeDirection||s.resizeDirection==="horizontal")?H:p.width,$.height=Q&&(!s.resizeDirection||s.resizeDirection==="vertical")?Y:p.height,p.width=$.width,p.height=$.height),C&&m.expandParent){const ce=U[0]*($.width??0);$.x&&$.x<ce&&(p.x=ce,g.x=g.x-($.x-ce));const ie=U[1]*($.height??0);$.y&&$.y<ie&&(p.y=ie,g.y=g.y-($.y-ie))}const Z=CM({width:p.width,prevWidth:L,height:p.height,prevHeight:O,affectsX:s.controlDirection.affectsX,affectsY:s.controlDirection.affectsY}),q={...p,direction:Z};(S==null?void 0:S(I,q))!==!1&&(R=!0,x==null||x(I,q),r($,D))}).on("end",I=>{R&&(w==null||w(I,{...p}),o==null||o({...p}),R=!1)});i.call(z)}function a(){i.on(".drag",null)}return{update:l,destroy:a}}var Q0={exports:{}},q0={},Z0={exports:{}},J0={};/**
255
- * @license React
256
- * use-sync-external-store-shim.production.js
257
- *
258
- * Copyright (c) Meta Platforms, Inc. and affiliates.
259
- *
260
- * This source code is licensed under the MIT license found in the
261
- * LICENSE file in the root directory of this source tree.
262
- */var io=v;function RM(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var TM=typeof Object.is=="function"?Object.is:RM,IM=io.useState,LM=io.useEffect,AM=io.useLayoutEffect,DM=io.useDebugValue;function zM(e,t){var n=t(),r=IM({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return AM(function(){o.value=n,o.getSnapshot=t,lu(o)&&i({inst:o})},[e,n,t]),LM(function(){return lu(o)&&i({inst:o}),e(function(){lu(o)&&i({inst:o})})},[e]),DM(n),n}function lu(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!TM(e,n)}catch{return!0}}function $M(e,t){return t()}var OM=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?$M:zM;J0.useSyncExternalStore=io.useSyncExternalStore!==void 0?io.useSyncExternalStore:OM;Z0.exports=J0;var FM=Z0.exports;/**
263
- * @license React
264
- * use-sync-external-store-shim/with-selector.production.js
265
- *
266
- * Copyright (c) Meta Platforms, Inc. and affiliates.
267
- *
268
- * This source code is licensed under the MIT license found in the
269
- * LICENSE file in the root directory of this source tree.
270
- */var ua=v,BM=FM;function VM(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var HM=typeof Object.is=="function"?Object.is:VM,UM=BM.useSyncExternalStore,WM=ua.useRef,YM=ua.useEffect,XM=ua.useMemo,GM=ua.useDebugValue;q0.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=WM(null);if(i.current===null){var s={hasValue:!1,value:null};i.current=s}else s=i.current;i=XM(function(){function a(y){if(!u){if(u=!0,d=y,y=r(y),o!==void 0&&s.hasValue){var x=s.value;if(o(x,y))return c=x}return c=y}if(x=c,HM(d,y))return x;var w=r(y);return o!==void 0&&o(x,w)?(d=y,x):(d=y,c=w)}var u=!1,d,c,f=n===void 0?null:n;return[function(){return a(t())},f===null?void 0:function(){return a(f())}]},[t,n,r,o]);var l=UM(e,i[0],i[1]);return YM(function(){s.hasValue=!0,s.value=l},[l]),GM(l),l};Q0.exports=q0;var KM=Q0.exports;const QM=jc(KM),qM={},_p=e=>{let t;const n=new Set,r=(d,c)=>{const f=typeof d=="function"?d(t):d;if(!Object.is(f,t)){const y=t;t=c??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(x=>x(t,y))}},o=()=>t,a={setState:r,getState:o,getInitialState:()=>u,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(qM?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},u=t=e(r,o,a);return a},ZM=e=>e?_p(e):_p,{useDebugValue:JM}=It,{useSyncExternalStoreWithSelector:e3}=QM,t3=e=>e;function ex(e,t=t3,n){const r=e3(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return JM(r),r}const Pp=(e,t)=>{const n=ZM(e),r=(o,i=t)=>ex(n,o,i);return Object.assign(r,n),r},n3=(e,t)=>e?Pp(e,t):Pp;function ge(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,o]of e)if(!Object.is(o,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 ca=v.createContext(null),r3=ca.Provider,tx=Bt.error001();function re(e,t){const n=v.useContext(ca);if(n===null)throw new Error(tx);return ex(n,e,t)}function ye(){const e=v.useContext(ca);if(e===null)throw new Error(tx);return v.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const jp={display:"none"},o3={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},nx="react-flow__node-desc",rx="react-flow__edge-desc",i3="react-flow__aria-live",s3=e=>e.ariaLiveMessage,l3=e=>e.ariaLabelConfig;function a3({rfId:e}){const t=re(s3);return h.jsx("div",{id:`${i3}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:o3,children:t})}function u3({rfId:e,disableKeyboardA11y:t}){const n=re(l3);return h.jsxs(h.Fragment,{children:[h.jsx("div",{id:`${nx}-${e}`,style:jp,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),h.jsx("div",{id:`${rx}-${e}`,style:jp,children:n["edge.a11yDescription.default"]}),!t&&h.jsx(a3,{rfId:e})]})}const da=v.forwardRef(({position:e="top-left",children:t,className:n,style:r,...o},i)=>{const s=`${e}`.split("-");return h.jsx("div",{className:Ce(["react-flow__panel",n,...s]),style:r,ref:i,...o,children:t})});da.displayName="Panel";function c3({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:h.jsx(da,{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:h.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}},ys=e=>e.id;function f3(e,t){return ge(e.selectedNodes.map(ys),t.selectedNodes.map(ys))&&ge(e.selectedEdges.map(ys),t.selectedEdges.map(ys))}function h3({onSelectionChange:e}){const t=ye(),{selectedNodes:n,selectedEdges:r}=re(d3,f3);return v.useEffect(()=>{const o={nodes:n,edges:r};e==null||e(o),t.getState().onSelectionChangeHandlers.forEach(i=>i(o))},[n,r,e]),null}const p3=e=>!!e.onSelectionChangeHandlers;function m3({onSelectionChange:e}){const t=re(p3);return e||t?h.jsx(h3,{onSelectionChange:e}):null}const ox=[0,0],g3={x:0,y:0,zoom:1},y3=["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"],Mp=[...y3,"rfId"],v3=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}),Rp={translateExtent:xi,nodeOrigin:ox,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function x3(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:o,setTranslateExtent:i,setNodeExtent:s,reset:l,setDefaultNodesAndEdges:a}=re(v3,ge),u=ye();v.useEffect(()=>(a(e.defaultNodes,e.defaultEdges),()=>{d.current=Rp,l()}),[]);const d=v.useRef(Rp);return v.useEffect(()=>{for(const c of Mp){const f=e[c],y=d.current[c];f!==y&&(typeof e[c]>"u"||(c==="nodes"?t(f):c==="edges"?n(f):c==="minZoom"?r(f):c==="maxZoom"?o(f):c==="translateExtent"?i(f):c==="nodeExtent"?s(f):c==="ariaLabelConfig"?u.setState({ariaLabelConfig:Vj(f)}):c==="fitView"?u.setState({fitViewQueued:f}):c==="fitViewOptions"?u.setState({fitViewOptions:f}):u.setState({[c]:f})))}d.current=e},Mp.map(c=>e[c])),null}function Tp(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function w3(e){var r;const[t,n]=v.useState(e==="system"?null:e);return v.useEffect(()=>{if(e!=="system"){n(e);return}const o=Tp(),i=()=>n(o!=null&&o.matches?"dark":"light");return i(),o==null||o.addEventListener("change",i),()=>{o==null||o.removeEventListener("change",i)}},[e]),t!==null?t:(r=Tp())!=null&&r.matches?"dark":"light"}const Ip=typeof document<"u"?document:null;function Ni(e=null,t={target:Ip,actInsideInputWithModifier:!0}){const[n,r]=v.useState(!1),o=v.useRef(!1),i=v.useRef(new Set([])),[s,l]=v.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(c=>typeof c=="string").map(c=>c.replace("+",`
271
- `).replace(`
272
-
273
- `,`
274
- +`).split(`
275
- `)),d=u.reduce((c,f)=>c.concat(...f),[]);return[u,d]}return[[],[]]},[e]);return v.useEffect(()=>{const a=(t==null?void 0:t.target)??Ip,u=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const d=y=>{var S,p;if(o.current=y.ctrlKey||y.metaKey||y.shiftKey||y.altKey,(!o.current||o.current&&!u)&&I0(y))return!1;const w=Ap(y.code,l);if(i.current.add(y[w]),Lp(s,i.current,!1)){const g=((p=(S=y.composedPath)==null?void 0:S.call(y))==null?void 0:p[0])||y.target,m=(g==null?void 0:g.nodeName)==="BUTTON"||(g==null?void 0:g.nodeName)==="A";t.preventDefault!==!1&&(o.current||!m)&&y.preventDefault(),r(!0)}},c=y=>{const x=Ap(y.code,l);Lp(s,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(y[x]),y.key==="Meta"&&i.current.clear(),o.current=!1},f=()=>{i.current.clear(),r(!1)};return a==null||a.addEventListener("keydown",d),a==null||a.addEventListener("keyup",c),window.addEventListener("blur",f),window.addEventListener("contextmenu",f),()=>{a==null||a.removeEventListener("keydown",d),a==null||a.removeEventListener("keyup",c),window.removeEventListener("blur",f),window.removeEventListener("contextmenu",f)}}},[e,r]),n}function Lp(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(o=>t.has(o)))}function Ap(e,t){return t.includes(e)?"code":"key"}const S3=()=>{const e=ye();return v.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,o,i],panZoom:s}=e.getState();return s?(await s.setViewport({x:t.x??r,y:t.y??o,zoom:t.zoom??i},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:o,minZoom:i,maxZoom:s,panZoom:l}=e.getState(),a=ef(t,r,o,i,s,(n==null?void 0:n.padding)??.1);return l?(await l.setViewport(a,{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:o,snapToGrid:i,domNode:s}=e.getState();if(!s)return t;const{x:l,y:a}=s.getBoundingClientRect(),u={x:t.x-l,y:t.y-a},d=n.snapGrid??o,c=n.snapToGrid??i;return zi(u,r,c,d)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:o,y:i}=r.getBoundingClientRect(),s=kl(t,n);return{x:s.x+o,y:s.y+i}}}),[])};function ix(e,t){const n=[],r=new Map,o=[];for(const i of e)if(i.type==="add"){o.push(i);continue}else if(i.type==="remove"||i.type==="replace")r.set(i.id,[i]);else{const s=r.get(i.id);s?s.push(i):r.set(i.id,[i])}for(const i of t){const s=r.get(i.id);if(!s){n.push(i);continue}if(s[0].type==="remove")continue;if(s[0].type==="replace"){n.push({...s[0].item});continue}const l={...i};for(const a of s)E3(a,l);n.push(l)}return o.length&&o.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function E3(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 N3(e,t){return ix(e,t)}function k3(e,t){return ix(e,t)}function Un(e,t){return{id:e,type:"select",selected:t}}function Ir(e,t=new Set,n=!1){const r=[];for(const[o,i]of e){const s=t.has(o);!(i.selected===void 0&&!s)&&i.selected!==s&&(n&&(i.selected=s),r.push(Un(i.id,s)))}return r}function Dp({items:e=[],lookup:t}){var o;const n=[],r=new Map(e.map(i=>[i.id,i]));for(const[i,s]of e.entries()){const l=t.get(s.id),a=((o=l==null?void 0:l.internals)==null?void 0:o.userNode)??l;a!==void 0&&a!==s&&n.push({id:s.id,item:s,type:"replace"}),a===void 0&&n.push({item:s,type:"add",index:i})}for(const[i]of t)r.get(i)===void 0&&n.push({id:i,type:"remove"});return n}function zp(e){return{id:e.id,type:"remove"}}const $p=e=>Tj(e),C3=e=>C0(e);function sx(e){return v.forwardRef(e)}const b3=typeof window<"u"?v.useLayoutEffect:v.useEffect;function Op(e){const[t,n]=v.useState(BigInt(0)),[r]=v.useState(()=>_3(()=>n(o=>o+BigInt(1))));return b3(()=>{const o=r.get();o.length&&(e(o),r.reset())},[t]),r}function _3(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const lx=v.createContext(null);function P3({children:e}){const t=ye(),n=v.useCallback(l=>{const{nodes:a=[],setNodes:u,hasDefaultNodes:d,onNodesChange:c,nodeLookup:f,fitViewQueued:y,onNodesChangeMiddlewareMap:x}=t.getState();let w=a;for(const p of l)w=typeof p=="function"?p(w):p;let S=Dp({items:w,lookup:f});for(const p of x.values())S=p(S);d&&u(w),S.length>0?c==null||c(S):y&&window.requestAnimationFrame(()=>{const{fitViewQueued:p,nodes:g,setNodes:m}=t.getState();p&&m(g)})},[]),r=Op(n),o=v.useCallback(l=>{const{edges:a=[],setEdges:u,hasDefaultEdges:d,onEdgesChange:c,edgeLookup:f}=t.getState();let y=a;for(const x of l)y=typeof x=="function"?x(y):x;d?u(y):c&&c(Dp({items:y,lookup:f}))},[]),i=Op(o),s=v.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return h.jsx(lx.Provider,{value:s,children:e})}function j3(){const e=v.useContext(lx);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const M3=e=>!!e.panZoom;function af(){const e=S3(),t=ye(),n=j3(),r=re(M3),o=v.useMemo(()=>{const i=c=>t.getState().nodeLookup.get(c),s=c=>{n.nodeQueue.push(c)},l=c=>{n.edgeQueue.push(c)},a=c=>{var p,g;const{nodeLookup:f,nodeOrigin:y}=t.getState(),x=$p(c)?c:f.get(c.id),w=x.parentId?R0(x.position,x.measured,x.parentId,f,y):x.position,S={...x,position:w,width:((p=x.measured)==null?void 0:p.width)??x.width,height:((g=x.measured)==null?void 0:g.height)??x.height};return no(S)},u=(c,f,y={replace:!1})=>{s(x=>x.map(w=>{if(w.id===c){const S=typeof f=="function"?f(w):f;return y.replace&&$p(S)?S:{...w,...S}}return w}))},d=(c,f,y={replace:!1})=>{l(x=>x.map(w=>{if(w.id===c){const S=typeof f=="function"?f(w):f;return y.replace&&C3(S)?S:{...w,...S}}return w}))};return{getNodes:()=>t.getState().nodes.map(c=>({...c})),getNode:c=>{var f;return(f=i(c))==null?void 0:f.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:c=[]}=t.getState();return c.map(f=>({...f}))},getEdge:c=>t.getState().edgeLookup.get(c),setNodes:s,setEdges:l,addNodes:c=>{const f=Array.isArray(c)?c:[c];n.nodeQueue.push(y=>[...y,...f])},addEdges:c=>{const f=Array.isArray(c)?c:[c];n.edgeQueue.push(y=>[...y,...f])},toObject:()=>{const{nodes:c=[],edges:f=[],transform:y}=t.getState(),[x,w,S]=y;return{nodes:c.map(p=>({...p})),edges:f.map(p=>({...p})),viewport:{x,y:w,zoom:S}}},deleteElements:async({nodes:c=[],edges:f=[]})=>{const{nodes:y,edges:x,onNodesDelete:w,onEdgesDelete:S,triggerNodeChanges:p,triggerEdgeChanges:g,onDelete:m,onBeforeDelete:E}=t.getState(),{nodes:N,edges:C}=await zj({nodesToRemove:c,edgesToRemove:f,nodes:y,edges:x,onBeforeDelete:E}),k=C.length>0,P=N.length>0;if(k){const R=C.map(zp);S==null||S(C),g(R)}if(P){const R=N.map(zp);w==null||w(N),p(R)}return(P||k)&&(m==null||m({nodes:N,edges:C})),{deletedNodes:N,deletedEdges:C}},getIntersectingNodes:(c,f=!0,y)=>{const x=pp(c),w=x?c:a(c),S=y!==void 0;return w?(y||t.getState().nodes).filter(p=>{const g=t.getState().nodeLookup.get(p.id);if(g&&!x&&(p.id===c.id||!g.internals.positionAbsolute))return!1;const m=no(S?p:g),E=Si(m,w);return f&&E>0||E>=m.width*m.height||E>=w.width*w.height}):[]},isNodeIntersecting:(c,f,y=!0)=>{const w=pp(c)?c:a(c);if(!w)return!1;const S=Si(w,f);return y&&S>0||S>=f.width*f.height||S>=w.width*w.height},updateNode:u,updateNodeData:(c,f,y={replace:!1})=>{u(c,x=>{const w=typeof f=="function"?f(x):f;return y.replace?{...x,data:w}:{...x,data:{...x.data,...w}}},y)},updateEdge:d,updateEdgeData:(c,f,y={replace:!1})=>{d(c,x=>{const w=typeof f=="function"?f(x):f;return y.replace?{...x,data:w}:{...x,data:{...x.data,...w}}},y)},getNodesBounds:c=>{const{nodeLookup:f,nodeOrigin:y}=t.getState();return Ij(c,{nodeLookup:f,nodeOrigin:y})},getHandleConnections:({type:c,id:f,nodeId:y})=>{var x;return Array.from(((x=t.getState().connectionLookup.get(`${y}-${c}${f?`-${f}`:""}`))==null?void 0:x.values())??[])},getNodeConnections:({type:c,handleId:f,nodeId:y})=>{var x;return Array.from(((x=t.getState().connectionLookup.get(`${y}${c?f?`-${c}-${f}`:`-${c}`:""}`))==null?void 0:x.values())??[])},fitView:async c=>{const f=t.getState().fitViewResolver??Bj();return t.setState({fitViewQueued:!0,fitViewOptions:c,fitViewResolver:f}),n.nodeQueue.push(y=>[...y]),f.promise}}},[]);return v.useMemo(()=>({...o,...e,viewportInitialized:r}),[r])}const Fp=e=>e.selected,R3=typeof window<"u"?window:void 0;function T3({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=ye(),{deleteElements:r}=af(),o=Ni(e,{actInsideInputWithModifier:!1}),i=Ni(t,{target:R3});v.useEffect(()=>{if(o){const{edges:s,nodes:l}=n.getState();r({nodes:l.filter(Fp),edges:s.filter(Fp)}),n.setState({nodesSelectionActive:!1})}},[o]),v.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function I3(e){const t=ye();v.useEffect(()=>{const n=()=>{var o,i,s,l;if(!e.current||!(((i=(o=e.current).checkVisibility)==null?void 0:i.call(o))??!0))return!1;const r=tf(e.current);(r.height===0||r.width===0)&&((l=(s=t.getState()).onError)==null||l.call(s,"004",Bt.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 fa={position:"absolute",width:"100%",height:"100%",top:0,left:0},L3=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function A3({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:o=.5,panOnScrollMode:i=tr.Free,zoomOnDoubleClick:s=!0,panOnDrag:l=!0,defaultViewport:a,translateExtent:u,minZoom:d,maxZoom:c,zoomActivationKeyCode:f,preventScrolling:y=!0,children:x,noWheelClassName:w,noPanClassName:S,onViewportChange:p,isControlledViewport:g,paneClickDistance:m,selectionOnDrag:E}){const N=ye(),C=v.useRef(null),{userSelectionActive:k,lib:P,connectionInProgress:R}=re(L3,ge),z=Ni(f),I=v.useRef();I3(C);const T=v.useCallback(F=>{p==null||p({x:F[0],y:F[1],zoom:F[2]}),g||N.setState({transform:F})},[p,g]);return v.useEffect(()=>{if(C.current){I.current=kM({domNode:C.current,minZoom:d,maxZoom:c,translateExtent:u,viewport:a,onDraggingChange:M=>N.setState({paneDragging:M}),onPanZoomStart:(M,D)=>{const{onViewportChangeStart:b,onMoveStart:j}=N.getState();j==null||j(M,D),b==null||b(D)},onPanZoom:(M,D)=>{const{onViewportChange:b,onMove:j}=N.getState();j==null||j(M,D),b==null||b(D)},onPanZoomEnd:(M,D)=>{const{onViewportChangeEnd:b,onMoveEnd:j}=N.getState();j==null||j(M,D),b==null||b(D)}});const{x:F,y:_,zoom:A}=I.current.getViewport();return N.setState({panZoom:I.current,transform:[F,_,A],domNode:C.current.closest(".react-flow")}),()=>{var M;(M=I.current)==null||M.destroy()}}},[]),v.useEffect(()=>{var F;(F=I.current)==null||F.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:o,panOnScrollMode:i,zoomOnDoubleClick:s,panOnDrag:l,zoomActivationKeyPressed:z,preventScrolling:y,noPanClassName:S,userSelectionActive:k,noWheelClassName:w,lib:P,onTransformChange:T,connectionInProgress:R,selectionOnDrag:E,paneClickDistance:m})},[e,t,n,r,o,i,s,l,z,y,S,k,w,P,T,R,E,m]),h.jsx("div",{className:"react-flow__renderer",ref:C,style:fa,children:x})}const D3=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function z3(){const{userSelectionActive:e,userSelectionRect:t}=re(D3,ge);return e&&t?h.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 au=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},$3=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function O3({isSelecting:e,selectionKeyPressed:t,selectionMode:n=wi.Full,panOnDrag:r,paneClickDistance:o,selectionOnDrag:i,onSelectionStart:s,onSelectionEnd:l,onPaneClick:a,onPaneContextMenu:u,onPaneScroll:d,onPaneMouseEnter:c,onPaneMouseMove:f,onPaneMouseLeave:y,children:x}){const w=ye(),{userSelectionActive:S,elementsSelectable:p,dragging:g,connectionInProgress:m}=re($3,ge),E=p&&(e||S),N=v.useRef(null),C=v.useRef(),k=v.useRef(new Set),P=v.useRef(new Set),R=v.useRef(!1),z=b=>{if(R.current||m){R.current=!1;return}a==null||a(b),w.getState().resetSelectedElements(),w.setState({nodesSelectionActive:!1})},I=b=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){b.preventDefault();return}u==null||u(b)},T=d?b=>d(b):void 0,F=b=>{R.current&&(b.stopPropagation(),R.current=!1)},_=b=>{var Y,X;const{domNode:j}=w.getState();if(C.current=j==null?void 0:j.getBoundingClientRect(),!C.current)return;const L=b.target===N.current;if(!L&&!!b.target.closest(".nokey")||!e||!(i&&L||t)||b.button!==0||!b.isPrimary)return;(X=(Y=b.target)==null?void 0:Y.setPointerCapture)==null||X.call(Y,b.pointerId),R.current=!1;const{x:U,y:H}=kt(b.nativeEvent,C.current);w.setState({userSelectionRect:{width:0,height:0,startX:U,startY:H,x:U,y:H}}),L||(b.stopPropagation(),b.preventDefault())},A=b=>{const{userSelectionRect:j,transform:L,nodeLookup:O,edgeLookup:$,connectionLookup:U,triggerNodeChanges:H,triggerEdgeChanges:Y,defaultEdgeOptions:X,resetSelectedElements:G}=w.getState();if(!C.current||!j)return;const{x:V,y:Q}=kt(b.nativeEvent,C.current),{startX:te,startY:J}=j;if(!R.current){const ie=t?0:o;if(Math.hypot(V-te,Q-J)<=ie)return;G(),s==null||s(b)}R.current=!0;const Z={startX:te,startY:J,x:V<te?V:te,y:Q<J?Q:J,width:Math.abs(V-te),height:Math.abs(Q-J)},q=k.current,se=P.current;k.current=new Set(Jd(O,Z,L,n===wi.Partial,!0).map(ie=>ie.id)),P.current=new Set;const ce=(X==null?void 0:X.selectable)??!0;for(const ie of k.current){const De=U.get(ie);if(De)for(const{edgeId:an}of De.values()){const Ut=$.get(an);Ut&&(Ut.selectable??ce)&&P.current.add(an)}}if(!mp(q,k.current)){const ie=Ir(O,k.current,!0);H(ie)}if(!mp(se,P.current)){const ie=Ir($,P.current);Y(ie)}w.setState({userSelectionRect:Z,userSelectionActive:!0,nodesSelectionActive:!1})},M=b=>{var j,L;b.button===0&&((L=(j=b.target)==null?void 0:j.releasePointerCapture)==null||L.call(j,b.pointerId),!S&&b.target===N.current&&w.getState().userSelectionRect&&(z==null||z(b)),w.setState({userSelectionActive:!1,userSelectionRect:null}),R.current&&(l==null||l(b),w.setState({nodesSelectionActive:k.current.size>0})))},D=r===!0||Array.isArray(r)&&r.includes(0);return h.jsxs("div",{className:Ce(["react-flow__pane",{draggable:D,dragging:g,selection:e}]),onClick:E?void 0:au(z,N),onContextMenu:au(I,N),onWheel:au(T,N),onPointerEnter:E?void 0:c,onPointerMove:E?A:f,onPointerUp:E?M:void 0,onPointerDownCapture:E?_:void 0,onClickCapture:E?F:void 0,onPointerLeave:y,ref:N,style:fa,children:[x,h.jsx(z3,{})]})}function Pc({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:o,unselectNodesAndEdges:i,multiSelectionActive:s,nodeLookup:l,onError:a}=t.getState(),u=l.get(e);if(!u){a==null||a("012",Bt.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&s)&&(i({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var d;return(d=r==null?void 0:r.current)==null?void 0:d.blur()})):o([e])}function ax({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:o,isSelectable:i,nodeClickDistance:s}){const l=ye(),[a,u]=v.useState(!1),d=v.useRef();return v.useEffect(()=>{d.current=cM({getStoreItems:()=>l.getState(),onNodeMouseDown:c=>{Pc({id:c,store:l,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),v.useEffect(()=>{var c,f;if(t)(c=d.current)==null||c.destroy();else if(e.current)return(f=d.current)==null||f.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:i,nodeId:o,nodeClickDistance:s}),()=>{var y;(y=d.current)==null||y.destroy()}},[n,r,t,i,e,o]),a}const F3=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function ux(){const e=ye();return v.useCallback(n=>{const{nodeExtent:r,snapToGrid:o,snapGrid:i,nodesDraggable:s,onError:l,updateNodePositions:a,nodeLookup:u,nodeOrigin:d}=e.getState(),c=new Map,f=F3(s),y=o?i[0]:5,x=o?i[1]:5,w=n.direction.x*y*n.factor,S=n.direction.y*x*n.factor;for(const[,p]of u){if(!f(p))continue;let g={x:p.internals.positionAbsolute.x+w,y:p.internals.positionAbsolute.y+S};o&&(g=Di(g,i));const{position:m,positionAbsolute:E}=b0({nodeId:p.id,nextPosition:g,nodeLookup:u,nodeExtent:r,nodeOrigin:d,onError:l});p.position=m,p.internals.positionAbsolute=E,c.set(p.id,p)}a(c)},[])}const uf=v.createContext(null),B3=uf.Provider;uf.Consumer;const cx=()=>v.useContext(uf),V3=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),H3=(e,t,n)=>r=>{const{connectionClickStartHandle:o,connectionMode:i,connection:s}=r,{fromHandle:l,toHandle:a,isValid:u}=s,d=(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===t&&(a==null?void 0:a.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:d,clickConnecting:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===t&&(o==null?void 0:o.type)===n,isPossibleEndHandle:i===eo.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:!!o,valid:d&&u}};function U3({type:e="source",position:t=K.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:o=!0,isConnectableEnd:i=!0,id:s,onConnect:l,children:a,className:u,onMouseDown:d,onTouchStart:c,...f},y){var A,M;const x=s||null,w=e==="target",S=ye(),p=cx(),{connectOnClick:g,noPanClassName:m,rfId:E}=re(V3,ge),{connectingFrom:N,connectingTo:C,clickConnecting:k,isPossibleEndHandle:P,connectionInProcess:R,clickConnectionInProcess:z,valid:I}=re(H3(p,x,e),ge);p||(M=(A=S.getState()).onError)==null||M.call(A,"010",Bt.error010());const T=D=>{const{defaultEdgeOptions:b,onConnect:j,hasDefaultEdges:L}=S.getState(),O={...b,...D};if(L){const{edges:$,setEdges:U}=S.getState();U(Gj(O,$))}j==null||j(O),l==null||l(O)},F=D=>{if(!p)return;const b=L0(D.nativeEvent);if(o&&(b&&D.button===0||!b)){const j=S.getState();_c.onPointerDown(D.nativeEvent,{handleDomNode:D.currentTarget,autoPanOnConnect:j.autoPanOnConnect,connectionMode:j.connectionMode,connectionRadius:j.connectionRadius,domNode:j.domNode,nodeLookup:j.nodeLookup,lib:j.lib,isTarget:w,handleId:x,nodeId:p,flowId:j.rfId,panBy:j.panBy,cancelConnection:j.cancelConnection,onConnectStart:j.onConnectStart,onConnectEnd:j.onConnectEnd,updateConnection:j.updateConnection,onConnect:T,isValidConnection:n||j.isValidConnection,getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,autoPanSpeed:j.autoPanSpeed,dragThreshold:j.connectionDragThreshold})}b?d==null||d(D):c==null||c(D)},_=D=>{const{onClickConnectStart:b,onClickConnectEnd:j,connectionClickStartHandle:L,connectionMode:O,isValidConnection:$,lib:U,rfId:H,nodeLookup:Y,connection:X}=S.getState();if(!p||!L&&!o)return;if(!L){b==null||b(D.nativeEvent,{nodeId:p,handleId:x,handleType:e}),S.setState({connectionClickStartHandle:{nodeId:p,type:e,id:x}});return}const G=T0(D.target),V=n||$,{connection:Q,isValid:te}=_c.isValid(D.nativeEvent,{handle:{nodeId:p,id:x,type:e},connectionMode:O,fromNodeId:L.nodeId,fromHandleId:L.id||null,fromType:L.type,isValidConnection:V,flowId:H,doc:G,lib:U,nodeLookup:Y});te&&Q&&T(Q);const J=structuredClone(X);delete J.inProgress,J.toPosition=J.toHandle?J.toHandle.position:null,j==null||j(D,J),S.setState({connectionClickStartHandle:null})};return h.jsx("div",{"data-handleid":x,"data-nodeid":p,"data-handlepos":t,"data-id":`${E}-${p}-${x}-${e}`,className:Ce(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",m,u,{source:!w,target:w,connectable:r,connectablestart:o,connectableend:i,clickconnecting:k,connectingfrom:N,connectingto:C,valid:I,connectionindicator:r&&(!R||P)&&(R||z?i:o)}]),onMouseDown:F,onTouchStart:F,onClick:g?_:void 0,ref:y,...f,children:a})}const Cl=v.memo(sx(U3));function W3({data:e,isConnectable:t,sourcePosition:n=K.Bottom}){return h.jsxs(h.Fragment,{children:[e==null?void 0:e.label,h.jsx(Cl,{type:"source",position:n,isConnectable:t})]})}function Y3({data:e,isConnectable:t,targetPosition:n=K.Top,sourcePosition:r=K.Bottom}){return h.jsxs(h.Fragment,{children:[h.jsx(Cl,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,h.jsx(Cl,{type:"source",position:r,isConnectable:t})]})}function X3(){return null}function G3({data:e,isConnectable:t,targetPosition:n=K.Top}){return h.jsxs(h.Fragment,{children:[h.jsx(Cl,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const bl={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Bp={input:W3,default:Y3,output:G3,group:X3};function K3(e){var t,n,r,o;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??((o=e.style)==null?void 0:o.height)}}const Q3=e=>{const{width:t,height:n,x:r,y:o}=Ai(e.nodeLookup,{filter:i=>!!i.selected});return{width:Nt(t)?t:null,height:Nt(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${o}px)`}};function q3({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=ye(),{width:o,height:i,transformString:s,userSelectionActive:l}=re(Q3,ge),a=ux(),u=v.useRef(null);if(v.useEffect(()=>{var f;n||(f=u.current)==null||f.focus({preventScroll:!0})},[n]),ax({nodeRef:u}),l||!o||!i)return null;const d=e?f=>{const y=r.getState().nodes.filter(x=>x.selected);e(f,y)}:void 0,c=f=>{Object.prototype.hasOwnProperty.call(bl,f.key)&&(f.preventDefault(),a({direction:bl[f.key],factor:f.shiftKey?4:1}))};return h.jsx("div",{className:Ce(["react-flow__nodesselection","react-flow__container",t]),style:{transform:s},children:h.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:c,style:{width:o,height:i}})})}const Vp=typeof window<"u"?window:void 0,Z3=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function dx({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,paneClickDistance:l,deleteKeyCode:a,selectionKeyCode:u,selectionOnDrag:d,selectionMode:c,onSelectionStart:f,onSelectionEnd:y,multiSelectionKeyCode:x,panActivationKeyCode:w,zoomActivationKeyCode:S,elementsSelectable:p,zoomOnScroll:g,zoomOnPinch:m,panOnScroll:E,panOnScrollSpeed:N,panOnScrollMode:C,zoomOnDoubleClick:k,panOnDrag:P,defaultViewport:R,translateExtent:z,minZoom:I,maxZoom:T,preventScrolling:F,onSelectionContextMenu:_,noWheelClassName:A,noPanClassName:M,disableKeyboardA11y:D,onViewportChange:b,isControlledViewport:j}){const{nodesSelectionActive:L,userSelectionActive:O}=re(Z3,ge),$=Ni(u,{target:Vp}),U=Ni(w,{target:Vp}),H=U||P,Y=U||E,X=d&&H!==!0,G=$||O||X;return T3({deleteKeyCode:a,multiSelectionKeyCode:x}),h.jsx(A3,{onPaneContextMenu:i,elementsSelectable:p,zoomOnScroll:g,zoomOnPinch:m,panOnScroll:Y,panOnScrollSpeed:N,panOnScrollMode:C,zoomOnDoubleClick:k,panOnDrag:!$&&H,defaultViewport:R,translateExtent:z,minZoom:I,maxZoom:T,zoomActivationKeyCode:S,preventScrolling:F,noWheelClassName:A,noPanClassName:M,onViewportChange:b,isControlledViewport:j,paneClickDistance:l,selectionOnDrag:X,children:h.jsxs(O3,{onSelectionStart:f,onSelectionEnd:y,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,panOnDrag:H,isSelecting:!!G,selectionMode:c,selectionKeyPressed:$,paneClickDistance:l,selectionOnDrag:X,children:[e,L&&h.jsx(q3,{onSelectionContextMenu:_,noPanClassName:M,disableKeyboardA11y:D})]})})}dx.displayName="FlowRenderer";const J3=v.memo(dx),eR=e=>t=>e?Jd(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 tR(e){return re(v.useCallback(eR(e),[e]),ge)}const nR=e=>e.updateNodeInternals;function rR(){const e=re(nR),[t]=v.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(o=>{const i=o.target.getAttribute("data-id");r.set(i,{id:i,nodeElement:o.target,force:!0})}),e(r)}));return v.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function oR({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const o=ye(),i=v.useRef(null),s=v.useRef(null),l=v.useRef(e.sourcePosition),a=v.useRef(e.targetPosition),u=v.useRef(t),d=n&&!!e.internals.handleBounds;return v.useEffect(()=>{i.current&&!e.hidden&&(!d||s.current!==i.current)&&(s.current&&(r==null||r.unobserve(s.current)),r==null||r.observe(i.current),s.current=i.current)},[d,e.hidden]),v.useEffect(()=>()=>{s.current&&(r==null||r.unobserve(s.current),s.current=null)},[]),v.useEffect(()=>{if(i.current){const c=u.current!==t,f=l.current!==e.sourcePosition,y=a.current!==e.targetPosition;(c||f||y)&&(u.current=t,l.current=e.sourcePosition,a.current=e.targetPosition,o.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),i}function iR({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:o,onContextMenu:i,onDoubleClick:s,nodesDraggable:l,elementsSelectable:a,nodesConnectable:u,nodesFocusable:d,resizeObserver:c,noDragClassName:f,noPanClassName:y,disableKeyboardA11y:x,rfId:w,nodeTypes:S,nodeClickDistance:p,onError:g}){const{node:m,internals:E,isParent:N}=re(V=>{const Q=V.nodeLookup.get(e),te=V.parentLookup.has(e);return{node:Q,internals:Q.internals,isParent:te}},ge);let C=m.type||"default",k=(S==null?void 0:S[C])||Bp[C];k===void 0&&(g==null||g("003",Bt.error003(C)),C="default",k=(S==null?void 0:S.default)||Bp.default);const P=!!(m.draggable||l&&typeof m.draggable>"u"),R=!!(m.selectable||a&&typeof m.selectable>"u"),z=!!(m.connectable||u&&typeof m.connectable>"u"),I=!!(m.focusable||d&&typeof m.focusable>"u"),T=ye(),F=M0(m),_=oR({node:m,nodeType:C,hasDimensions:F,resizeObserver:c}),A=ax({nodeRef:_,disabled:m.hidden||!P,noDragClassName:f,handleSelector:m.dragHandle,nodeId:e,isSelectable:R,nodeClickDistance:p}),M=ux();if(m.hidden)return null;const D=ln(m),b=K3(m),j=R||P||t||n||r||o,L=n?V=>n(V,{...E.userNode}):void 0,O=r?V=>r(V,{...E.userNode}):void 0,$=o?V=>o(V,{...E.userNode}):void 0,U=i?V=>i(V,{...E.userNode}):void 0,H=s?V=>s(V,{...E.userNode}):void 0,Y=V=>{const{selectNodesOnDrag:Q,nodeDragThreshold:te}=T.getState();R&&(!Q||!P||te>0)&&Pc({id:e,store:T,nodeRef:_}),t&&t(V,{...E.userNode})},X=V=>{if(!(I0(V.nativeEvent)||x)){if(S0.includes(V.key)&&R){const Q=V.key==="Escape";Pc({id:e,store:T,unselect:Q,nodeRef:_})}else if(P&&m.selected&&Object.prototype.hasOwnProperty.call(bl,V.key)){V.preventDefault();const{ariaLabelConfig:Q}=T.getState();T.setState({ariaLiveMessage:Q["node.a11yDescription.ariaLiveMessage"]({direction:V.key.replace("Arrow","").toLowerCase(),x:~~E.positionAbsolute.x,y:~~E.positionAbsolute.y})}),M({direction:bl[V.key],factor:V.shiftKey?4:1})}}},G=()=>{var se;if(x||!((se=_.current)!=null&&se.matches(":focus-visible")))return;const{transform:V,width:Q,height:te,autoPanOnNodeFocus:J,setCenter:Z}=T.getState();if(!J)return;Jd(new Map([[e,m]]),{x:0,y:0,width:Q,height:te},V,!0).length>0||Z(m.position.x+D.width/2,m.position.y+D.height/2,{zoom:V[2]})};return h.jsx("div",{className:Ce(["react-flow__node",`react-flow__node-${C}`,{[y]:P},m.className,{selected:m.selected,selectable:R,parent:N,draggable:P,dragging:A}]),ref:_,style:{zIndex:E.z,transform:`translate(${E.positionAbsolute.x}px,${E.positionAbsolute.y}px)`,pointerEvents:j?"all":"none",visibility:F?"visible":"hidden",...m.style,...b},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:L,onMouseMove:O,onMouseLeave:$,onContextMenu:U,onClick:Y,onDoubleClick:H,onKeyDown:I?X:void 0,tabIndex:I?0:void 0,onFocus:I?G:void 0,role:m.ariaRole??(I?"group":void 0),"aria-roledescription":"node","aria-describedby":x?void 0:`${nx}-${w}`,"aria-label":m.ariaLabel,...m.domAttributes,children:h.jsx(B3,{value:e,children:h.jsx(k,{id:e,data:m.data,type:C,positionAbsoluteX:E.positionAbsolute.x,positionAbsoluteY:E.positionAbsolute.y,selected:m.selected??!1,selectable:R,draggable:P,deletable:m.deletable??!0,isConnectable:z,sourcePosition:m.sourcePosition,targetPosition:m.targetPosition,dragging:A,dragHandle:m.dragHandle,zIndex:E.z,parentId:m.parentId,...D})})})}var sR=v.memo(iR);const lR=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function fx(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:o,onError:i}=re(lR,ge),s=tR(e.onlyRenderVisibleElements),l=rR();return h.jsx("div",{className:"react-flow__nodes",style:fa,children:s.map(a=>h.jsx(sR,{id:a,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:o,nodeClickDistance:e.nodeClickDistance,onError:i},a))})}fx.displayName="NodeRenderer";const aR=v.memo(fx);function uR(e){return re(v.useCallback(n=>{if(!e)return n.edges.map(o=>o.id);const r=[];if(n.width&&n.height)for(const o of n.edges){const i=n.nodeLookup.get(o.source),s=n.nodeLookup.get(o.target);i&&s&&Wj({sourceNode:i,targetNode:s,width:n.width,height:n.height,transform:n.transform})&&r.push(o.id)}return r},[e]),ge)}const cR=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return h.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},dR=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return h.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Hp={[El.Arrow]:cR,[El.ArrowClosed]:dR};function fR(e){const t=ye();return v.useMemo(()=>{var o,i;return Object.prototype.hasOwnProperty.call(Hp,e)?Hp[e]:((i=(o=t.getState()).onError)==null||i.call(o,"009",Bt.error009(e)),null)},[e])}const hR=({id:e,type:t,color:n,width:r=12.5,height:o=12.5,markerUnits:i="strokeWidth",strokeWidth:s,orient:l="auto-start-reverse"})=>{const a=fR(t);return a?h.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:l,refX:"0",refY:"0",children:h.jsx(a,{color:n,strokeWidth:s})}):null},hx=({defaultColor:e,rfId:t})=>{const n=re(i=>i.edges),r=re(i=>i.defaultEdgeOptions),o=v.useMemo(()=>Jj(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return o.length?h.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:h.jsx("defs",{children:o.map(i=>h.jsx(hR,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};hx.displayName="MarkerDefinitions";var pR=v.memo(hx);function px({x:e,y:t,label:n,labelStyle:r,labelShowBg:o=!0,labelBgStyle:i,labelBgPadding:s=[2,4],labelBgBorderRadius:l=2,children:a,className:u,...d}){const[c,f]=v.useState({x:1,y:0,width:0,height:0}),y=Ce(["react-flow__edge-textwrapper",u]),x=v.useRef(null);return v.useEffect(()=>{if(x.current){const w=x.current.getBBox();f({x:w.x,y:w.y,width:w.width,height:w.height})}},[n]),n?h.jsxs("g",{transform:`translate(${e-c.width/2} ${t-c.height/2})`,className:y,visibility:c.width?"visible":"hidden",...d,children:[o&&h.jsx("rect",{width:c.width+2*s[0],x:-s[0],y:-s[1],height:c.height+2*s[1],className:"react-flow__edge-textbg",style:i,rx:l,ry:l}),h.jsx("text",{className:"react-flow__edge-text",y:c.height/2,dy:"0.3em",ref:x,style:r,children:n}),a]}):null}px.displayName="EdgeText";const mR=v.memo(px);function ha({path:e,labelX:t,labelY:n,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:a,interactionWidth:u=20,...d}){return h.jsxs(h.Fragment,{children:[h.jsx("path",{...d,d:e,fill:"none",className:Ce(["react-flow__edge-path",d.className])}),u?h.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&&Nt(t)&&Nt(n)?h.jsx(mR,{x:t,y:n,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:a}):null]})}function Up({pos:e,x1:t,y1:n,x2:r,y2:o}){return e===K.Left||e===K.Right?[.5*(t+r),n]:[t,.5*(n+o)]}function mx({sourceX:e,sourceY:t,sourcePosition:n=K.Bottom,targetX:r,targetY:o,targetPosition:i=K.Top}){const[s,l]=Up({pos:n,x1:e,y1:t,x2:r,y2:o}),[a,u]=Up({pos:i,x1:r,y1:o,x2:e,y2:t}),[d,c,f,y]=A0({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:s,sourceControlY:l,targetControlX:a,targetControlY:u});return[`M${e},${t} C${s},${l} ${a},${u} ${r},${o}`,d,c,f,y]}function gx(e){return v.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,sourcePosition:s,targetPosition:l,label:a,labelStyle:u,labelShowBg:d,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:y,style:x,markerEnd:w,markerStart:S,interactionWidth:p})=>{const[g,m,E]=mx({sourceX:n,sourceY:r,sourcePosition:s,targetX:o,targetY:i,targetPosition:l}),N=e.isInternal?void 0:t;return h.jsx(ha,{id:N,path:g,labelX:m,labelY:E,label:a,labelStyle:u,labelShowBg:d,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:y,style:x,markerEnd:w,markerStart:S,interactionWidth:p})})}const gR=gx({isInternal:!1}),yx=gx({isInternal:!0});gR.displayName="SimpleBezierEdge";yx.displayName="SimpleBezierEdgeInternal";function vx(e){return v.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,label:s,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:c,style:f,sourcePosition:y=K.Bottom,targetPosition:x=K.Top,markerEnd:w,markerStart:S,pathOptions:p,interactionWidth:g})=>{const[m,E,N]=kc({sourceX:n,sourceY:r,sourcePosition:y,targetX:o,targetY:i,targetPosition:x,borderRadius:p==null?void 0:p.borderRadius,offset:p==null?void 0:p.offset,stepPosition:p==null?void 0:p.stepPosition}),C=e.isInternal?void 0:t;return h.jsx(ha,{id:C,path:m,labelX:E,labelY:N,label:s,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:c,style:f,markerEnd:w,markerStart:S,interactionWidth:g})})}const xx=vx({isInternal:!1}),wx=vx({isInternal:!0});xx.displayName="SmoothStepEdge";wx.displayName="SmoothStepEdgeInternal";function Sx(e){return v.memo(({id:t,...n})=>{var o;const r=e.isInternal?void 0:t;return h.jsx(xx,{...n,id:r,pathOptions:v.useMemo(()=>{var i;return{borderRadius:0,offset:(i=n.pathOptions)==null?void 0:i.offset}},[(o=n.pathOptions)==null?void 0:o.offset])})})}const yR=Sx({isInternal:!1}),Ex=Sx({isInternal:!0});yR.displayName="StepEdge";Ex.displayName="StepEdgeInternal";function Nx(e){return v.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,label:s,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:c,style:f,markerEnd:y,markerStart:x,interactionWidth:w})=>{const[S,p,g]=$0({sourceX:n,sourceY:r,targetX:o,targetY:i}),m=e.isInternal?void 0:t;return h.jsx(ha,{id:m,path:S,labelX:p,labelY:g,label:s,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:c,style:f,markerEnd:y,markerStart:x,interactionWidth:w})})}const vR=Nx({isInternal:!1}),kx=Nx({isInternal:!0});vR.displayName="StraightEdge";kx.displayName="StraightEdgeInternal";function Cx(e){return v.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,sourcePosition:s=K.Bottom,targetPosition:l=K.Top,label:a,labelStyle:u,labelShowBg:d,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:y,style:x,markerEnd:w,markerStart:S,pathOptions:p,interactionWidth:g})=>{const[m,E,N]=D0({sourceX:n,sourceY:r,sourcePosition:s,targetX:o,targetY:i,targetPosition:l,curvature:p==null?void 0:p.curvature}),C=e.isInternal?void 0:t;return h.jsx(ha,{id:C,path:m,labelX:E,labelY:N,label:a,labelStyle:u,labelShowBg:d,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:y,style:x,markerEnd:w,markerStart:S,interactionWidth:g})})}const xR=Cx({isInternal:!1}),bx=Cx({isInternal:!0});xR.displayName="BezierEdge";bx.displayName="BezierEdgeInternal";const Wp={default:bx,straight:kx,step:Ex,smoothstep:wx,simplebezier:yx},Yp={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},wR=(e,t,n)=>n===K.Left?e-t:n===K.Right?e+t:e,SR=(e,t,n)=>n===K.Top?e-t:n===K.Bottom?e+t:e,Xp="react-flow__edgeupdater";function Gp({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:o,onMouseEnter:i,onMouseOut:s,type:l}){return h.jsx("circle",{onMouseDown:o,onMouseEnter:i,onMouseOut:s,className:Ce([Xp,`${Xp}-${l}`]),cx:wR(t,r,e),cy:SR(n,r,e),r,stroke:"transparent",fill:"transparent"})}function ER({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:o,targetX:i,targetY:s,sourcePosition:l,targetPosition:a,onReconnect:u,onReconnectStart:d,onReconnectEnd:c,setReconnecting:f,setUpdateHover:y}){const x=ye(),w=(E,N)=>{if(E.button!==0)return;const{autoPanOnConnect:C,domNode:k,isValidConnection:P,connectionMode:R,connectionRadius:z,lib:I,onConnectStart:T,onConnectEnd:F,cancelConnection:_,nodeLookup:A,rfId:M,panBy:D,updateConnection:b}=x.getState(),j=N.type==="target",L=(U,H)=>{f(!1),c==null||c(U,n,N.type,H)},O=U=>u==null?void 0:u(n,U),$=(U,H)=>{f(!0),d==null||d(E,n,N.type),T==null||T(U,H)};_c.onPointerDown(E.nativeEvent,{autoPanOnConnect:C,connectionMode:R,connectionRadius:z,domNode:k,handleId:N.id,nodeId:N.nodeId,nodeLookup:A,isTarget:j,edgeUpdaterType:N.type,lib:I,flowId:M,cancelConnection:_,panBy:D,isValidConnection:P,onConnect:O,onConnectStart:$,onConnectEnd:F,onReconnectEnd:L,updateConnection:b,getTransform:()=>x.getState().transform,getFromHandle:()=>x.getState().connection.fromHandle,dragThreshold:x.getState().connectionDragThreshold,handleDomNode:E.currentTarget})},S=E=>w(E,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),p=E=>w(E,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),g=()=>y(!0),m=()=>y(!1);return h.jsxs(h.Fragment,{children:[(e===!0||e==="source")&&h.jsx(Gp,{position:l,centerX:r,centerY:o,radius:t,onMouseDown:S,onMouseEnter:g,onMouseOut:m,type:"source"}),(e===!0||e==="target")&&h.jsx(Gp,{position:a,centerX:i,centerY:s,radius:t,onMouseDown:p,onMouseEnter:g,onMouseOut:m,type:"target"})]})}function NR({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:o,onDoubleClick:i,onContextMenu:s,onMouseEnter:l,onMouseMove:a,onMouseLeave:u,reconnectRadius:d,onReconnect:c,onReconnectStart:f,onReconnectEnd:y,rfId:x,edgeTypes:w,noPanClassName:S,onError:p,disableKeyboardA11y:g}){let m=re(Z=>Z.edgeLookup.get(e));const E=re(Z=>Z.defaultEdgeOptions);m=E?{...E,...m}:m;let N=m.type||"default",C=(w==null?void 0:w[N])||Wp[N];C===void 0&&(p==null||p("011",Bt.error011(N)),N="default",C=(w==null?void 0:w.default)||Wp.default);const k=!!(m.focusable||t&&typeof m.focusable>"u"),P=typeof c<"u"&&(m.reconnectable||n&&typeof m.reconnectable>"u"),R=!!(m.selectable||r&&typeof m.selectable>"u"),z=v.useRef(null),[I,T]=v.useState(!1),[F,_]=v.useState(!1),A=ye(),{zIndex:M,sourceX:D,sourceY:b,targetX:j,targetY:L,sourcePosition:O,targetPosition:$}=re(v.useCallback(Z=>{const q=Z.nodeLookup.get(m.source),se=Z.nodeLookup.get(m.target);if(!q||!se)return{zIndex:m.zIndex,...Yp};const ce=Zj({id:e,sourceNode:q,targetNode:se,sourceHandle:m.sourceHandle||null,targetHandle:m.targetHandle||null,connectionMode:Z.connectionMode,onError:p});return{zIndex:Uj({selected:m.selected,zIndex:m.zIndex,sourceNode:q,targetNode:se,elevateOnSelect:Z.elevateEdgesOnSelect,zIndexMode:Z.zIndexMode}),...ce||Yp}},[m.source,m.target,m.sourceHandle,m.targetHandle,m.selected,m.zIndex]),ge),U=v.useMemo(()=>m.markerStart?`url('#${Cc(m.markerStart,x)}')`:void 0,[m.markerStart,x]),H=v.useMemo(()=>m.markerEnd?`url('#${Cc(m.markerEnd,x)}')`:void 0,[m.markerEnd,x]);if(m.hidden||D===null||b===null||j===null||L===null)return null;const Y=Z=>{var ie;const{addSelectedEdges:q,unselectNodesAndEdges:se,multiSelectionActive:ce}=A.getState();R&&(A.setState({nodesSelectionActive:!1}),m.selected&&ce?(se({nodes:[],edges:[m]}),(ie=z.current)==null||ie.blur()):q([e])),o&&o(Z,m)},X=i?Z=>{i(Z,{...m})}:void 0,G=s?Z=>{s(Z,{...m})}:void 0,V=l?Z=>{l(Z,{...m})}:void 0,Q=a?Z=>{a(Z,{...m})}:void 0,te=u?Z=>{u(Z,{...m})}:void 0,J=Z=>{var q;if(!g&&S0.includes(Z.key)&&R){const{unselectNodesAndEdges:se,addSelectedEdges:ce}=A.getState();Z.key==="Escape"?((q=z.current)==null||q.blur(),se({edges:[m]})):ce([e])}};return h.jsx("svg",{style:{zIndex:M},children:h.jsxs("g",{className:Ce(["react-flow__edge",`react-flow__edge-${N}`,m.className,S,{selected:m.selected,animated:m.animated,inactive:!R&&!o,updating:I,selectable:R}]),onClick:Y,onDoubleClick:X,onContextMenu:G,onMouseEnter:V,onMouseMove:Q,onMouseLeave:te,onKeyDown:k?J:void 0,tabIndex:k?0:void 0,role:m.ariaRole??(k?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":m.ariaLabel===null?void 0:m.ariaLabel||`Edge from ${m.source} to ${m.target}`,"aria-describedby":k?`${rx}-${x}`:void 0,ref:z,...m.domAttributes,children:[!F&&h.jsx(C,{id:e,source:m.source,target:m.target,type:m.type,selected:m.selected,animated:m.animated,selectable:R,deletable:m.deletable??!0,label:m.label,labelStyle:m.labelStyle,labelShowBg:m.labelShowBg,labelBgStyle:m.labelBgStyle,labelBgPadding:m.labelBgPadding,labelBgBorderRadius:m.labelBgBorderRadius,sourceX:D,sourceY:b,targetX:j,targetY:L,sourcePosition:O,targetPosition:$,data:m.data,style:m.style,sourceHandleId:m.sourceHandle,targetHandleId:m.targetHandle,markerStart:U,markerEnd:H,pathOptions:"pathOptions"in m?m.pathOptions:void 0,interactionWidth:m.interactionWidth}),P&&h.jsx(ER,{edge:m,isReconnectable:P,reconnectRadius:d,onReconnect:c,onReconnectStart:f,onReconnectEnd:y,sourceX:D,sourceY:b,targetX:j,targetY:L,sourcePosition:O,targetPosition:$,setUpdateHover:T,setReconnecting:_})]})})}var kR=v.memo(NR);const CR=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function _x({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:o,onReconnect:i,onEdgeContextMenu:s,onEdgeMouseEnter:l,onEdgeMouseMove:a,onEdgeMouseLeave:u,onEdgeClick:d,reconnectRadius:c,onEdgeDoubleClick:f,onReconnectStart:y,onReconnectEnd:x,disableKeyboardA11y:w}){const{edgesFocusable:S,edgesReconnectable:p,elementsSelectable:g,onError:m}=re(CR,ge),E=uR(t);return h.jsxs("div",{className:"react-flow__edges",children:[h.jsx(pR,{defaultColor:e,rfId:n}),E.map(N=>h.jsx(kR,{id:N,edgesFocusable:S,edgesReconnectable:p,elementsSelectable:g,noPanClassName:o,onReconnect:i,onContextMenu:s,onMouseEnter:l,onMouseMove:a,onMouseLeave:u,onClick:d,reconnectRadius:c,onDoubleClick:f,onReconnectStart:y,onReconnectEnd:x,rfId:n,onError:m,edgeTypes:r,disableKeyboardA11y:w},N))]})}_x.displayName="EdgeRenderer";const bR=v.memo(_x),_R=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function PR({children:e}){const t=re(_R);return h.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function jR(e){const t=af(),n=v.useRef(!1);v.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const MR=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function RR(e){const t=re(MR),n=ye();return v.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function TR(e){return e.connection.inProgress?{...e.connection,to:zi(e.connection.to,e.transform)}:{...e.connection}}function IR(e){return TR}function LR(e){const t=IR();return re(t,ge)}const AR=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function DR({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:o,width:i,height:s,isValid:l,inProgress:a}=re(AR,ge);return!(i&&o&&a)?null:h.jsx("svg",{style:e,width:i,height:s,className:"react-flow__connectionline react-flow__container",children:h.jsx("g",{className:Ce(["react-flow__connection",k0(l)]),children:h.jsx(Px,{style:t,type:n,CustomComponent:r,isValid:l})})})}const Px=({style:e,type:t=xn.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:o,from:i,fromNode:s,fromHandle:l,fromPosition:a,to:u,toNode:d,toHandle:c,toPosition:f,pointer:y}=LR();if(!o)return;if(n)return h.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:s,fromHandle:l,fromX:i.x,fromY:i.y,toX:u.x,toY:u.y,fromPosition:a,toPosition:f,connectionStatus:k0(r),toNode:d,toHandle:c,pointer:y});let x="";const w={sourceX:i.x,sourceY:i.y,sourcePosition:a,targetX:u.x,targetY:u.y,targetPosition:f};switch(t){case xn.Bezier:[x]=D0(w);break;case xn.SimpleBezier:[x]=mx(w);break;case xn.Step:[x]=kc({...w,borderRadius:0});break;case xn.SmoothStep:[x]=kc(w);break;default:[x]=$0(w)}return h.jsx("path",{d:x,fill:"none",className:"react-flow__connection-path",style:e})};Px.displayName="ConnectionLine";const zR={};function Kp(e=zR){v.useRef(e),ye(),v.useEffect(()=>{},[e])}function $R(){ye(),v.useRef(!1),v.useEffect(()=>{},[])}function jx({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:o,onNodeDoubleClick:i,onEdgeDoubleClick:s,onNodeMouseEnter:l,onNodeMouseMove:a,onNodeMouseLeave:u,onNodeContextMenu:d,onSelectionContextMenu:c,onSelectionStart:f,onSelectionEnd:y,connectionLineType:x,connectionLineStyle:w,connectionLineComponent:S,connectionLineContainerStyle:p,selectionKeyCode:g,selectionOnDrag:m,selectionMode:E,multiSelectionKeyCode:N,panActivationKeyCode:C,zoomActivationKeyCode:k,deleteKeyCode:P,onlyRenderVisibleElements:R,elementsSelectable:z,defaultViewport:I,translateExtent:T,minZoom:F,maxZoom:_,preventScrolling:A,defaultMarkerColor:M,zoomOnScroll:D,zoomOnPinch:b,panOnScroll:j,panOnScrollSpeed:L,panOnScrollMode:O,zoomOnDoubleClick:$,panOnDrag:U,onPaneClick:H,onPaneMouseEnter:Y,onPaneMouseMove:X,onPaneMouseLeave:G,onPaneScroll:V,onPaneContextMenu:Q,paneClickDistance:te,nodeClickDistance:J,onEdgeContextMenu:Z,onEdgeMouseEnter:q,onEdgeMouseMove:se,onEdgeMouseLeave:ce,reconnectRadius:ie,onReconnect:De,onReconnectStart:an,onReconnectEnd:Ut,noDragClassName:Bn,noWheelClassName:po,noPanClassName:mo,disableKeyboardA11y:go,nodeExtent:pa,rfId:$i,viewport:pr,onViewportChange:yo}){return Kp(e),Kp(t),$R(),jR(n),RR(pr),h.jsx(J3,{onPaneClick:H,onPaneMouseEnter:Y,onPaneMouseMove:X,onPaneMouseLeave:G,onPaneContextMenu:Q,onPaneScroll:V,paneClickDistance:te,deleteKeyCode:P,selectionKeyCode:g,selectionOnDrag:m,selectionMode:E,onSelectionStart:f,onSelectionEnd:y,multiSelectionKeyCode:N,panActivationKeyCode:C,zoomActivationKeyCode:k,elementsSelectable:z,zoomOnScroll:D,zoomOnPinch:b,zoomOnDoubleClick:$,panOnScroll:j,panOnScrollSpeed:L,panOnScrollMode:O,panOnDrag:U,defaultViewport:I,translateExtent:T,minZoom:F,maxZoom:_,onSelectionContextMenu:c,preventScrolling:A,noDragClassName:Bn,noWheelClassName:po,noPanClassName:mo,disableKeyboardA11y:go,onViewportChange:yo,isControlledViewport:!!pr,children:h.jsxs(PR,{children:[h.jsx(bR,{edgeTypes:t,onEdgeClick:o,onEdgeDoubleClick:s,onReconnect:De,onReconnectStart:an,onReconnectEnd:Ut,onlyRenderVisibleElements:R,onEdgeContextMenu:Z,onEdgeMouseEnter:q,onEdgeMouseMove:se,onEdgeMouseLeave:ce,reconnectRadius:ie,defaultMarkerColor:M,noPanClassName:mo,disableKeyboardA11y:go,rfId:$i}),h.jsx(DR,{style:w,type:x,component:S,containerStyle:p}),h.jsx("div",{className:"react-flow__edgelabel-renderer"}),h.jsx(aR,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:l,onNodeMouseMove:a,onNodeMouseLeave:u,onNodeContextMenu:d,nodeClickDistance:J,onlyRenderVisibleElements:R,noPanClassName:mo,noDragClassName:Bn,disableKeyboardA11y:go,nodeExtent:pa,rfId:$i}),h.jsx("div",{className:"react-flow__viewport-portal"})]})})}jx.displayName="GraphView";const OR=v.memo(jx),Qp=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:s,fitViewOptions:l,minZoom:a=.5,maxZoom:u=2,nodeOrigin:d,nodeExtent:c,zIndexMode:f="basic"}={})=>{const y=new Map,x=new Map,w=new Map,S=new Map,p=r??t??[],g=n??e??[],m=d??[0,0],E=c??xi;B0(w,S,p);const N=bc(g,y,x,{nodeOrigin:m,nodeExtent:E,zIndexMode:f});let C=[0,0,1];if(s&&o&&i){const k=Ai(y,{filter:I=>!!((I.width||I.initialWidth)&&(I.height||I.initialHeight))}),{x:P,y:R,zoom:z}=ef(k,o,i,a,u,(l==null?void 0:l.padding)??.1);C=[P,R,z]}return{rfId:"1",width:o??0,height:i??0,transform:C,nodes:g,nodesInitialized:N,nodeLookup:y,parentLookup:x,edges:p,edgeLookup:S,connectionLookup:w,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:a,maxZoom:u,translateExtent:xi,nodeExtent:E,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:eo.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:m,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:s??!1,fitViewOptions:l,fitViewResolver:null,connection:{...N0},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:$j,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:E0,zIndexMode:f,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},FR=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:s,fitViewOptions:l,minZoom:a,maxZoom:u,nodeOrigin:d,nodeExtent:c,zIndexMode:f})=>n3((y,x)=>{async function w(){const{nodeLookup:S,panZoom:p,fitViewOptions:g,fitViewResolver:m,width:E,height:N,minZoom:C,maxZoom:k}=x();p&&(await Dj({nodes:S,width:E,height:N,panZoom:p,minZoom:C,maxZoom:k},g),m==null||m.resolve(!0),y({fitViewResolver:null}))}return{...Qp({nodes:e,edges:t,width:o,height:i,fitView:s,fitViewOptions:l,minZoom:a,maxZoom:u,nodeOrigin:d,nodeExtent:c,defaultNodes:n,defaultEdges:r,zIndexMode:f}),setNodes:S=>{const{nodeLookup:p,parentLookup:g,nodeOrigin:m,elevateNodesOnSelect:E,fitViewQueued:N,zIndexMode:C}=x(),k=bc(S,p,g,{nodeOrigin:m,nodeExtent:c,elevateNodesOnSelect:E,checkEquality:!0,zIndexMode:C});N&&k?(w(),y({nodes:S,nodesInitialized:k,fitViewQueued:!1,fitViewOptions:void 0})):y({nodes:S,nodesInitialized:k})},setEdges:S=>{const{connectionLookup:p,edgeLookup:g}=x();B0(p,g,S),y({edges:S})},setDefaultNodesAndEdges:(S,p)=>{if(S){const{setNodes:g}=x();g(S),y({hasDefaultNodes:!0})}if(p){const{setEdges:g}=x();g(p),y({hasDefaultEdges:!0})}},updateNodeInternals:S=>{const{triggerNodeChanges:p,nodeLookup:g,parentLookup:m,domNode:E,nodeOrigin:N,nodeExtent:C,debug:k,fitViewQueued:P,zIndexMode:R}=x(),{changes:z,updatedInternals:I}=sM(S,g,m,E,N,C,R);I&&(nM(g,m,{nodeOrigin:N,nodeExtent:C,zIndexMode:R}),P?(w(),y({fitViewQueued:!1,fitViewOptions:void 0})):y({}),(z==null?void 0:z.length)>0&&(k&&console.log("React Flow: trigger node changes",z),p==null||p(z)))},updateNodePositions:(S,p=!1)=>{const g=[];let m=[];const{nodeLookup:E,triggerNodeChanges:N,connection:C,updateConnection:k,onNodesChangeMiddlewareMap:P}=x();for(const[R,z]of S){const I=E.get(R),T=!!(I!=null&&I.expandParent&&(I!=null&&I.parentId)&&(z!=null&&z.position)),F={id:R,type:"position",position:T?{x:Math.max(0,z.position.x),y:Math.max(0,z.position.y)}:z.position,dragging:p};if(I&&C.inProgress&&C.fromNode.id===I.id){const _=dr(I,C.fromHandle,K.Left,!0);k({...C,from:_})}T&&I.parentId&&g.push({id:R,parentId:I.parentId,rect:{...z.internals.positionAbsolute,width:z.measured.width??0,height:z.measured.height??0}}),m.push(F)}if(g.length>0){const{parentLookup:R,nodeOrigin:z}=x(),I=lf(g,E,R,z);m.push(...I)}for(const R of P.values())m=R(m);N(m)},triggerNodeChanges:S=>{const{onNodesChange:p,setNodes:g,nodes:m,hasDefaultNodes:E,debug:N}=x();if(S!=null&&S.length){if(E){const C=N3(S,m);g(C)}N&&console.log("React Flow: trigger node changes",S),p==null||p(S)}},triggerEdgeChanges:S=>{const{onEdgesChange:p,setEdges:g,edges:m,hasDefaultEdges:E,debug:N}=x();if(S!=null&&S.length){if(E){const C=k3(S,m);g(C)}N&&console.log("React Flow: trigger edge changes",S),p==null||p(S)}},addSelectedNodes:S=>{const{multiSelectionActive:p,edgeLookup:g,nodeLookup:m,triggerNodeChanges:E,triggerEdgeChanges:N}=x();if(p){const C=S.map(k=>Un(k,!0));E(C);return}E(Ir(m,new Set([...S]),!0)),N(Ir(g))},addSelectedEdges:S=>{const{multiSelectionActive:p,edgeLookup:g,nodeLookup:m,triggerNodeChanges:E,triggerEdgeChanges:N}=x();if(p){const C=S.map(k=>Un(k,!0));N(C);return}N(Ir(g,new Set([...S]))),E(Ir(m,new Set,!0))},unselectNodesAndEdges:({nodes:S,edges:p}={})=>{const{edges:g,nodes:m,nodeLookup:E,triggerNodeChanges:N,triggerEdgeChanges:C}=x(),k=S||m,P=p||g,R=k.map(I=>{const T=E.get(I.id);return T&&(T.selected=!1),Un(I.id,!1)}),z=P.map(I=>Un(I.id,!1));N(R),C(z)},setMinZoom:S=>{const{panZoom:p,maxZoom:g}=x();p==null||p.setScaleExtent([S,g]),y({minZoom:S})},setMaxZoom:S=>{const{panZoom:p,minZoom:g}=x();p==null||p.setScaleExtent([g,S]),y({maxZoom:S})},setTranslateExtent:S=>{var p;(p=x().panZoom)==null||p.setTranslateExtent(S),y({translateExtent:S})},resetSelectedElements:()=>{const{edges:S,nodes:p,triggerNodeChanges:g,triggerEdgeChanges:m,elementsSelectable:E}=x();if(!E)return;const N=p.reduce((k,P)=>P.selected?[...k,Un(P.id,!1)]:k,[]),C=S.reduce((k,P)=>P.selected?[...k,Un(P.id,!1)]:k,[]);g(N),m(C)},setNodeExtent:S=>{const{nodes:p,nodeLookup:g,parentLookup:m,nodeOrigin:E,elevateNodesOnSelect:N,nodeExtent:C,zIndexMode:k}=x();S[0][0]===C[0][0]&&S[0][1]===C[0][1]&&S[1][0]===C[1][0]&&S[1][1]===C[1][1]||(bc(p,g,m,{nodeOrigin:E,nodeExtent:S,elevateNodesOnSelect:N,checkEquality:!1,zIndexMode:k}),y({nodeExtent:S}))},panBy:S=>{const{transform:p,width:g,height:m,panZoom:E,translateExtent:N}=x();return lM({delta:S,panZoom:E,transform:p,translateExtent:N,width:g,height:m})},setCenter:async(S,p,g)=>{const{width:m,height:E,maxZoom:N,panZoom:C}=x();if(!C)return Promise.resolve(!1);const k=typeof(g==null?void 0:g.zoom)<"u"?g.zoom:N;return await C.setViewport({x:m/2-S*k,y:E/2-p*k,zoom:k},{duration:g==null?void 0:g.duration,ease:g==null?void 0:g.ease,interpolate:g==null?void 0:g.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{y({connection:{...N0}})},updateConnection:S=>{y({connection:S})},reset:()=>y({...Qp()})}},Object.is);function BR({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:o,initialHeight:i,initialMinZoom:s,initialMaxZoom:l,initialFitViewOptions:a,fitView:u,nodeOrigin:d,nodeExtent:c,zIndexMode:f,children:y}){const[x]=v.useState(()=>FR({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:u,minZoom:s,maxZoom:l,fitViewOptions:a,nodeOrigin:d,nodeExtent:c,zIndexMode:f}));return h.jsx(r3,{value:x,children:h.jsx(P3,{children:y})})}function VR({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:o,width:i,height:s,fitView:l,fitViewOptions:a,minZoom:u,maxZoom:d,nodeOrigin:c,nodeExtent:f,zIndexMode:y}){return v.useContext(ca)?h.jsx(h.Fragment,{children:e}):h.jsx(BR,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:o,initialWidth:i,initialHeight:s,fitView:l,initialFitViewOptions:a,initialMinZoom:u,initialMaxZoom:d,nodeOrigin:c,nodeExtent:f,zIndexMode:y,children:e})}const HR={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function UR({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:o,nodeTypes:i,edgeTypes:s,onNodeClick:l,onEdgeClick:a,onInit:u,onMove:d,onMoveStart:c,onMoveEnd:f,onConnect:y,onConnectStart:x,onConnectEnd:w,onClickConnectStart:S,onClickConnectEnd:p,onNodeMouseEnter:g,onNodeMouseMove:m,onNodeMouseLeave:E,onNodeContextMenu:N,onNodeDoubleClick:C,onNodeDragStart:k,onNodeDrag:P,onNodeDragStop:R,onNodesDelete:z,onEdgesDelete:I,onDelete:T,onSelectionChange:F,onSelectionDragStart:_,onSelectionDrag:A,onSelectionDragStop:M,onSelectionContextMenu:D,onSelectionStart:b,onSelectionEnd:j,onBeforeDelete:L,connectionMode:O,connectionLineType:$=xn.Bezier,connectionLineStyle:U,connectionLineComponent:H,connectionLineContainerStyle:Y,deleteKeyCode:X="Backspace",selectionKeyCode:G="Shift",selectionOnDrag:V=!1,selectionMode:Q=wi.Full,panActivationKeyCode:te="Space",multiSelectionKeyCode:J=Ei()?"Meta":"Control",zoomActivationKeyCode:Z=Ei()?"Meta":"Control",snapToGrid:q,snapGrid:se,onlyRenderVisibleElements:ce=!1,selectNodesOnDrag:ie,nodesDraggable:De,autoPanOnNodeFocus:an,nodesConnectable:Ut,nodesFocusable:Bn,nodeOrigin:po=ox,edgesFocusable:mo,edgesReconnectable:go,elementsSelectable:pa=!0,defaultViewport:$i=g3,minZoom:pr=.5,maxZoom:yo=2,translateExtent:cf=xi,preventScrolling:Ix=!0,nodeExtent:ma,defaultMarkerColor:Lx="#b1b1b7",zoomOnScroll:Ax=!0,zoomOnPinch:Dx=!0,panOnScroll:zx=!1,panOnScrollSpeed:$x=.5,panOnScrollMode:Ox=tr.Free,zoomOnDoubleClick:Fx=!0,panOnDrag:Bx=!0,onPaneClick:Vx,onPaneMouseEnter:Hx,onPaneMouseMove:Ux,onPaneMouseLeave:Wx,onPaneScroll:Yx,onPaneContextMenu:Xx,paneClickDistance:Gx=1,nodeClickDistance:Kx=0,children:Qx,onReconnect:qx,onReconnectStart:Zx,onReconnectEnd:Jx,onEdgeContextMenu:ew,onEdgeDoubleClick:tw,onEdgeMouseEnter:nw,onEdgeMouseMove:rw,onEdgeMouseLeave:ow,reconnectRadius:iw=10,onNodesChange:sw,onEdgesChange:lw,noDragClassName:aw="nodrag",noWheelClassName:uw="nowheel",noPanClassName:df="nopan",fitView:ff,fitViewOptions:hf,connectOnClick:cw,attributionPosition:dw,proOptions:fw,defaultEdgeOptions:hw,elevateNodesOnSelect:pw=!0,elevateEdgesOnSelect:mw=!1,disableKeyboardA11y:pf=!1,autoPanOnConnect:gw,autoPanOnNodeDrag:yw,autoPanSpeed:vw,connectionRadius:xw,isValidConnection:ww,onError:Sw,style:Ew,id:mf,nodeDragThreshold:Nw,connectionDragThreshold:kw,viewport:Cw,onViewportChange:bw,width:_w,height:Pw,colorMode:jw="light",debug:Mw,onScroll:Oi,ariaLabelConfig:Rw,zIndexMode:gf="basic",...Tw},Iw){const ga=mf||"1",Lw=w3(jw),Aw=v.useCallback(yf=>{yf.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Oi==null||Oi(yf)},[Oi]);return h.jsx("div",{"data-testid":"rf__wrapper",...Tw,onScroll:Aw,style:{...Ew,...HR},ref:Iw,className:Ce(["react-flow",o,Lw]),id:mf,role:"application",children:h.jsxs(VR,{nodes:e,edges:t,width:_w,height:Pw,fitView:ff,fitViewOptions:hf,minZoom:pr,maxZoom:yo,nodeOrigin:po,nodeExtent:ma,zIndexMode:gf,children:[h.jsx(OR,{onInit:u,onNodeClick:l,onEdgeClick:a,onNodeMouseEnter:g,onNodeMouseMove:m,onNodeMouseLeave:E,onNodeContextMenu:N,onNodeDoubleClick:C,nodeTypes:i,edgeTypes:s,connectionLineType:$,connectionLineStyle:U,connectionLineComponent:H,connectionLineContainerStyle:Y,selectionKeyCode:G,selectionOnDrag:V,selectionMode:Q,deleteKeyCode:X,multiSelectionKeyCode:J,panActivationKeyCode:te,zoomActivationKeyCode:Z,onlyRenderVisibleElements:ce,defaultViewport:$i,translateExtent:cf,minZoom:pr,maxZoom:yo,preventScrolling:Ix,zoomOnScroll:Ax,zoomOnPinch:Dx,zoomOnDoubleClick:Fx,panOnScroll:zx,panOnScrollSpeed:$x,panOnScrollMode:Ox,panOnDrag:Bx,onPaneClick:Vx,onPaneMouseEnter:Hx,onPaneMouseMove:Ux,onPaneMouseLeave:Wx,onPaneScroll:Yx,onPaneContextMenu:Xx,paneClickDistance:Gx,nodeClickDistance:Kx,onSelectionContextMenu:D,onSelectionStart:b,onSelectionEnd:j,onReconnect:qx,onReconnectStart:Zx,onReconnectEnd:Jx,onEdgeContextMenu:ew,onEdgeDoubleClick:tw,onEdgeMouseEnter:nw,onEdgeMouseMove:rw,onEdgeMouseLeave:ow,reconnectRadius:iw,defaultMarkerColor:Lx,noDragClassName:aw,noWheelClassName:uw,noPanClassName:df,rfId:ga,disableKeyboardA11y:pf,nodeExtent:ma,viewport:Cw,onViewportChange:bw}),h.jsx(x3,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:y,onConnectStart:x,onConnectEnd:w,onClickConnectStart:S,onClickConnectEnd:p,nodesDraggable:De,autoPanOnNodeFocus:an,nodesConnectable:Ut,nodesFocusable:Bn,edgesFocusable:mo,edgesReconnectable:go,elementsSelectable:pa,elevateNodesOnSelect:pw,elevateEdgesOnSelect:mw,minZoom:pr,maxZoom:yo,nodeExtent:ma,onNodesChange:sw,onEdgesChange:lw,snapToGrid:q,snapGrid:se,connectionMode:O,translateExtent:cf,connectOnClick:cw,defaultEdgeOptions:hw,fitView:ff,fitViewOptions:hf,onNodesDelete:z,onEdgesDelete:I,onDelete:T,onNodeDragStart:k,onNodeDrag:P,onNodeDragStop:R,onSelectionDrag:A,onSelectionDragStart:_,onSelectionDragStop:M,onMove:d,onMoveStart:c,onMoveEnd:f,noPanClassName:df,nodeOrigin:po,rfId:ga,autoPanOnConnect:gw,autoPanOnNodeDrag:yw,autoPanSpeed:vw,onError:Sw,connectionRadius:xw,isValidConnection:ww,selectNodesOnDrag:ie,nodeDragThreshold:Nw,connectionDragThreshold:kw,onBeforeDelete:L,debug:Mw,ariaLabelConfig:Rw,zIndexMode:gf}),h.jsx(m3,{onSelectionChange:F}),Qx,h.jsx(c3,{proOptions:fw,position:dw}),h.jsx(u3,{rfId:ga,disableKeyboardA11y:pf})]})})}var WR=sx(UR);function YR({dimensions:e,lineWidth:t,variant:n,className:r}){return h.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Ce(["react-flow__background-pattern",n,r])})}function XR({radius:e,className:t}){return h.jsx("circle",{cx:e,cy:e,r:e,className:Ce(["react-flow__background-pattern","dots",t])})}var Tn;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Tn||(Tn={}));const GR={[Tn.Dots]:1,[Tn.Lines]:1,[Tn.Cross]:6},KR=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Mx({id:e,variant:t=Tn.Dots,gap:n=20,size:r,lineWidth:o=1,offset:i=0,color:s,bgColor:l,style:a,className:u,patternClassName:d}){const c=v.useRef(null),{transform:f,patternId:y}=re(KR,ge),x=r||GR[t],w=t===Tn.Dots,S=t===Tn.Cross,p=Array.isArray(n)?n:[n,n],g=[p[0]*f[2]||1,p[1]*f[2]||1],m=x*f[2],E=Array.isArray(i)?i:[i,i],N=S?[m,m]:g,C=[E[0]*f[2]||1+N[0]/2,E[1]*f[2]||1+N[1]/2],k=`${y}${e||""}`;return h.jsxs("svg",{className:Ce(["react-flow__background",u]),style:{...a,...fa,"--xy-background-color-props":l,"--xy-background-pattern-color-props":s},ref:c,"data-testid":"rf__background",children:[h.jsx("pattern",{id:k,x:f[0]%g[0],y:f[1]%g[1],width:g[0],height:g[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${C[0]},-${C[1]})`,children:w?h.jsx(XR,{radius:m/2,className:d}):h.jsx(YR,{dimensions:N,lineWidth:o,variant:t,className:d})}),h.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${k})`})]})}Mx.displayName="Background";const QR=v.memo(Mx);function qR(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:h.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function ZR(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:h.jsx("path",{d:"M0 0h32v4.2H0z"})})}function JR(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:h.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 e4(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:h.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 t4(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:h.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 vs({children:e,className:t,...n}){return h.jsx("button",{type:"button",className:Ce(["react-flow__controls-button",t]),...n,children:e})}const n4=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function Rx({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:o,onZoomIn:i,onZoomOut:s,onFitView:l,onInteractiveChange:a,className:u,children:d,position:c="bottom-left",orientation:f="vertical","aria-label":y}){const x=ye(),{isInteractive:w,minZoomReached:S,maxZoomReached:p,ariaLabelConfig:g}=re(n4,ge),{zoomIn:m,zoomOut:E,fitView:N}=af(),C=()=>{m(),i==null||i()},k=()=>{E(),s==null||s()},P=()=>{N(o),l==null||l()},R=()=>{x.setState({nodesDraggable:!w,nodesConnectable:!w,elementsSelectable:!w}),a==null||a(!w)},z=f==="horizontal"?"horizontal":"vertical";return h.jsxs(da,{className:Ce(["react-flow__controls",z,u]),position:c,style:e,"data-testid":"rf__controls","aria-label":y??g["controls.ariaLabel"],children:[t&&h.jsxs(h.Fragment,{children:[h.jsx(vs,{onClick:C,className:"react-flow__controls-zoomin",title:g["controls.zoomIn.ariaLabel"],"aria-label":g["controls.zoomIn.ariaLabel"],disabled:p,children:h.jsx(qR,{})}),h.jsx(vs,{onClick:k,className:"react-flow__controls-zoomout",title:g["controls.zoomOut.ariaLabel"],"aria-label":g["controls.zoomOut.ariaLabel"],disabled:S,children:h.jsx(ZR,{})})]}),n&&h.jsx(vs,{className:"react-flow__controls-fitview",onClick:P,title:g["controls.fitView.ariaLabel"],"aria-label":g["controls.fitView.ariaLabel"],children:h.jsx(JR,{})}),r&&h.jsx(vs,{className:"react-flow__controls-interactive",onClick:R,title:g["controls.interactive.ariaLabel"],"aria-label":g["controls.interactive.ariaLabel"],children:w?h.jsx(t4,{}):h.jsx(e4,{})}),d]})}Rx.displayName="Controls";const r4=v.memo(Rx);function o4({id:e,x:t,y:n,width:r,height:o,style:i,color:s,strokeColor:l,strokeWidth:a,className:u,borderRadius:d,shapeRendering:c,selected:f,onClick:y}){const{background:x,backgroundColor:w}=i||{},S=s||x||w;return h.jsx("rect",{className:Ce(["react-flow__minimap-node",{selected:f},u]),x:t,y:n,rx:d,ry:d,width:r,height:o,style:{fill:S,stroke:l,strokeWidth:a},shapeRendering:c,onClick:y?p=>y(p,e):void 0})}const i4=v.memo(o4),s4=e=>e.nodes.map(t=>t.id),uu=e=>e instanceof Function?e:()=>e;function l4({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:o,nodeComponent:i=i4,onClick:s}){const l=re(s4,ge),a=uu(t),u=uu(e),d=uu(n),c=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return h.jsx(h.Fragment,{children:l.map(f=>h.jsx(u4,{id:f,nodeColorFunc:a,nodeStrokeColorFunc:u,nodeClassNameFunc:d,nodeBorderRadius:r,nodeStrokeWidth:o,NodeComponent:i,onClick:s,shapeRendering:c},f))})}function a4({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:o,nodeStrokeWidth:i,shapeRendering:s,NodeComponent:l,onClick:a}){const{node:u,x:d,y:c,width:f,height:y}=re(x=>{const{internals:w}=x.nodeLookup.get(e),S=w.userNode,{x:p,y:g}=w.positionAbsolute,{width:m,height:E}=ln(S);return{node:S,x:p,y:g,width:m,height:E}},ge);return!u||u.hidden||!M0(u)?null:h.jsx(l,{x:d,y:c,width:f,height:y,style:u.style,selected:!!u.selected,className:r(u),color:t(u),borderRadius:o,strokeColor:n(u),strokeWidth:i,shapeRendering:s,onClick:a,id:u.id})}const u4=v.memo(a4);var c4=v.memo(l4);const d4=200,f4=150,h4=e=>!e.hidden,p4=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?j0(Ai(e.nodeLookup,{filter:h4}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},m4="react-flow__minimap-desc";function Tx({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:o="",nodeBorderRadius:i=5,nodeStrokeWidth:s,nodeComponent:l,bgColor:a,maskColor:u,maskStrokeColor:d,maskStrokeWidth:c,position:f="bottom-right",onClick:y,onNodeClick:x,pannable:w=!1,zoomable:S=!1,ariaLabel:p,inversePan:g,zoomStep:m=1,offsetScale:E=5}){const N=ye(),C=v.useRef(null),{boundingRect:k,viewBB:P,rfId:R,panZoom:z,translateExtent:I,flowWidth:T,flowHeight:F,ariaLabelConfig:_}=re(p4,ge),A=(e==null?void 0:e.width)??d4,M=(e==null?void 0:e.height)??f4,D=k.width/A,b=k.height/M,j=Math.max(D,b),L=j*A,O=j*M,$=E*j,U=k.x-(L-k.width)/2-$,H=k.y-(O-k.height)/2-$,Y=L+$*2,X=O+$*2,G=`${m4}-${R}`,V=v.useRef(0),Q=v.useRef();V.current=j,v.useEffect(()=>{if(C.current&&z)return Q.current=gM({domNode:C.current,panZoom:z,getTransform:()=>N.getState().transform,getViewScale:()=>V.current}),()=>{var q;(q=Q.current)==null||q.destroy()}},[z]),v.useEffect(()=>{var q;(q=Q.current)==null||q.update({translateExtent:I,width:T,height:F,inversePan:g,pannable:w,zoomStep:m,zoomable:S})},[w,S,g,m,I,T,F]);const te=y?q=>{var ie;const[se,ce]=((ie=Q.current)==null?void 0:ie.pointer(q))||[0,0];y(q,{x:se,y:ce})}:void 0,J=x?v.useCallback((q,se)=>{const ce=N.getState().nodeLookup.get(se).internals.userNode;x(q,ce)},[]):void 0,Z=p??_["minimap.ariaLabel"];return h.jsx(da,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof a=="string"?a:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-width-props":typeof c=="number"?c*j: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 s=="number"?s:void 0},className:Ce(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:h.jsxs("svg",{width:A,height:M,viewBox:`${U} ${H} ${Y} ${X}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":G,ref:C,onClick:te,children:[Z&&h.jsx("title",{id:G,children:Z}),h.jsx(c4,{onClick:J,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:o,nodeStrokeWidth:s,nodeComponent:l}),h.jsx("path",{className:"react-flow__minimap-mask",d:`M${U-$},${H-$}h${Y+$*2}v${X+$*2}h${-Y-$*2}z
276
- M${P.x},${P.y}h${P.width}v${P.height}h${-P.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Tx.displayName="MiniMap";v.memo(Tx);const g4=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,y4={[oo.Line]:"right",[oo.Handle]:"bottom-right"};function v4({nodeId:e,position:t,variant:n=oo.Handle,className:r,style:o=void 0,children:i,color:s,minWidth:l=10,minHeight:a=10,maxWidth:u=Number.MAX_VALUE,maxHeight:d=Number.MAX_VALUE,keepAspectRatio:c=!1,resizeDirection:f,autoScale:y=!0,shouldResize:x,onResizeStart:w,onResize:S,onResizeEnd:p}){const g=cx(),m=typeof e=="string"?e:g,E=ye(),N=v.useRef(null),C=n===oo.Handle,k=re(v.useCallback(g4(C&&y),[C,y]),ge),P=v.useRef(null),R=t??y4[n];v.useEffect(()=>{if(!(!N.current||!m))return P.current||(P.current=MM({domNode:N.current,nodeId:m,getStoreItems:()=>{const{nodeLookup:I,transform:T,snapGrid:F,snapToGrid:_,nodeOrigin:A,domNode:M}=E.getState();return{nodeLookup:I,transform:T,snapGrid:F,snapToGrid:_,nodeOrigin:A,paneDomNode:M}},onChange:(I,T)=>{const{triggerNodeChanges:F,nodeLookup:_,parentLookup:A,nodeOrigin:M}=E.getState(),D=[],b={x:I.x,y:I.y},j=_.get(m);if(j&&j.expandParent&&j.parentId){const L=j.origin??M,O=I.width??j.measured.width??0,$=I.height??j.measured.height??0,U={id:j.id,parentId:j.parentId,rect:{width:O,height:$,...R0({x:I.x??j.position.x,y:I.y??j.position.y},{width:O,height:$},j.parentId,_,L)}},H=lf([U],_,A,M);D.push(...H),b.x=I.x?Math.max(L[0]*O,I.x):void 0,b.y=I.y?Math.max(L[1]*$,I.y):void 0}if(b.x!==void 0&&b.y!==void 0){const L={id:m,type:"position",position:{...b}};D.push(L)}if(I.width!==void 0&&I.height!==void 0){const O={id:m,type:"dimensions",resizing:!0,setAttributes:f?f==="horizontal"?"width":"height":!0,dimensions:{width:I.width,height:I.height}};D.push(O)}for(const L of T){const O={...L,type:"position"};D.push(O)}F(D)},onEnd:({width:I,height:T})=>{const F={id:m,type:"dimensions",resizing:!1,dimensions:{width:I,height:T}};E.getState().triggerNodeChanges([F])}})),P.current.update({controlPosition:R,boundaries:{minWidth:l,minHeight:a,maxWidth:u,maxHeight:d},keepAspectRatio:c,resizeDirection:f,onResizeStart:w,onResize:S,onResizeEnd:p,shouldResize:x}),()=>{var I;(I=P.current)==null||I.destroy()}},[R,l,a,u,d,c,w,S,p,x]);const z=R.split("-");return h.jsx("div",{className:Ce(["react-flow__resize-control","nodrag",...z,n,r]),ref:N,style:{...o,scale:k,...s&&{[C?"backgroundColor":"borderColor"]:s}},children:i})}v.memo(v4);function x4(){const[e,t]=v.useState(()=>document.documentElement.classList.contains("dark"));return v.useEffect(()=>{const n=new MutationObserver(()=>t(document.documentElement.classList.contains("dark")));return n.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>n.disconnect()},[]),e}function w4(){const[e,t]=v.useState([]),[n,r]=v.useState([]),[o,i]=v.useState(!0),s=x4();v.useEffect(()=>{Promise.all([ot.discovery.agents(),ot.observations.permissions()]).then(([u,d])=>{t(u.data??[]),r(d.data??[]),i(!1)}).catch(()=>i(!1))},[]);const{nodes:l,edges:a}=v.useMemo(()=>{const u=[],d=[],c=new Set,f=new Map,y=s?{background:"#18181b",color:"#fafafa",border:"1px solid #3f3f46"}:{background:"#ffffff",color:"#09090b",border:"1px solid #e4e4e7"},x=s?{background:"#09090b",color:"#a1a1aa",border:"1px solid #3f3f46"}:{background:"#f4f4f5",color:"#52525b",border:"1px solid #d4d4d8"},w=s?"#52525b":"#a1a1aa",S=s?"#27272a":"#e4e4e7";return e.forEach((p,g)=>{const m=`agent-${p.id}`;p.registeredAgentId&&f.set(p.registeredAgentId,m),f.set(p.id,m),u.push({id:m,position:{x:100,y:g*120},data:{label:`${p.emoji||"🤖"} ${p.name}`},style:{...y,borderRadius:"8px",padding:"8px 16px",fontSize:"13px"}})}),n.forEach(p=>{const g=`tool-${p.toolName}`;c.has(p.toolName)||(c.add(p.toolName),u.push({id:g,position:{x:400,y:c.size*80},data:{label:`🔧 ${p.toolName}`},style:{...x,borderRadius:"8px",padding:"6px 12px",fontSize:"12px"}}));const m=f.get(p.agentId)??`agent-${p.agentId}`;d.push({id:`e-${p.agentId}-${p.toolName}`,source:m,target:g,animated:p.accessPattern==="write",style:{stroke:p.accessPattern==="write"?"#eab308":w}})}),{nodes:u,edges:d,bgColor:S}},[e,n,s]);return o?h.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Identity Graph"}),h.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Agent-to-tool relationship visualization"})]}),h.jsx("div",{className:"h-[600px] rounded-lg border border-border bg-card",children:h.jsxs(WR,{nodes:l,edges:a,fitView:!0,proOptions:{hideAttribution:!0},children:[h.jsx(QR,{color:s?"#27272a":"#e4e4e7",gap:20}),h.jsx(r4,{})]})})]})}function S4({children:e}){const{isAuthenticated:t,isLoading:n}=Rd();return n?h.jsx("div",{className:"flex min-h-screen items-center justify-center",children:h.jsx("div",{className:"text-muted-foreground text-sm",children:"Loading..."})}):t?h.jsx(h.Fragment,{children:e}):h.jsx(oc,{to:"/login",replace:!0})}function E4(){return h.jsxs(n2,{children:[h.jsx(yt,{path:"/login",element:h.jsx(XN,{})}),h.jsxs(yt,{element:h.jsx(S4,{children:h.jsx(YN,{})}),children:[h.jsx(yt,{index:!0,element:h.jsx(oc,{to:"/inventory/agents",replace:!0})}),h.jsx(yt,{path:"/inventory/agents",element:h.jsx(KN,{})}),h.jsx(yt,{path:"/inventory/agents/:id",element:h.jsx(VC,{})}),h.jsx(yt,{path:"/inventory/identities",element:h.jsx(QC,{})}),h.jsx(yt,{path:"/inventory/permissions",element:h.jsx(qC,{})}),h.jsx(yt,{path:"/secure/risk",element:h.jsx(ZC,{})}),h.jsx(yt,{path:"/secure/graph",element:h.jsx(w4,{})})]}),h.jsx(yt,{path:"*",element:h.jsx(oc,{to:"/inventory/agents",replace:!0})})]})}cu.createRoot(document.getElementById("root")).render(h.jsx(It.StrictMode,{children:h.jsx(_2,{basename:"/dashboard",children:h.jsx(z2,{children:h.jsx(F2,{children:h.jsx(E4,{})})})})}));
277
- //# sourceMappingURL=index-ehTaEgPE.js.map