jetic-cli 0.2.4 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -12
- package/dist/dashboard/assets/index-BxpFwhwt.css +1 -0
- package/dist/dashboard/assets/index-CBkHSFmz.js +409 -0
- package/dist/dashboard/index.html +3 -3
- package/dist/dashboard/jetic_logo.png +0 -0
- package/dist/index.js +9333 -5006
- package/package.json +67 -60
- package/dist/dashboard/assets/index-B7pzujvn.js +0 -404
- package/dist/dashboard/assets/index-CAj2uFAP.css +0 -1
- package/dist/dashboard/jetic.png +0 -0
- package/dist/dashboard/jetic.svg +0 -4
- package/dist/dashboard/jetic_dot.png +0 -0
- package/dist/dashboard/jetic_light.png +0 -0
- package/dist/dashboard/jetic_logo.svg +0 -10
- package/dist/dashboard/jetic_white_bg.png +0 -0
- package/dist/dashboard/jetic_white_no_edges.png +0 -0
|
@@ -1,404 +0,0 @@
|
|
|
1
|
-
(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))i(u);new MutationObserver(u=>{for(const f of u)if(f.type==="childList")for(const h of f.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&i(h)}).observe(document,{childList:!0,subtree:!0});function o(u){const f={};return u.integrity&&(f.integrity=u.integrity),u.referrerPolicy&&(f.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?f.credentials="include":u.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function i(u){if(u.ep)return;u.ep=!0;const f=o(u);fetch(u.href,f)}})();function S0(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var sd={exports:{}},br={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Meta Platforms, Inc. and 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 em;function Sv(){if(em)return br;em=1;var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function o(i,u,f){var h=null;if(f!==void 0&&(h=""+f),u.key!==void 0&&(h=""+u.key),"key"in u){f={};for(var g in u)g!=="key"&&(f[g]=u[g])}else f=u;return u=f.ref,{$$typeof:n,type:i,key:h,ref:u!==void 0?u:null,props:f}}return br.Fragment=r,br.jsx=o,br.jsxs=o,br}var tm;function Ev(){return tm||(tm=1,sd.exports=Sv()),sd.exports}var s=Ev(),ld={exports:{}},De={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react.production.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Meta Platforms, Inc. and 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 nm;function kv(){if(nm)return De;nm=1;var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),h=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),b=Symbol.iterator;function v(E){return E===null||typeof E!="object"?null:(E=b&&E[b]||E["@@iterator"],typeof E=="function"?E:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,_={};function M(E,$,W){this.props=E,this.context=$,this.refs=_,this.updater=W||N}M.prototype.isReactComponent={},M.prototype.setState=function(E,$){if(typeof E!="object"&&typeof E!="function"&&E!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,E,$,"setState")},M.prototype.forceUpdate=function(E){this.updater.enqueueForceUpdate(this,E,"forceUpdate")};function A(){}A.prototype=M.prototype;function Y(E,$,W){this.props=E,this.context=$,this.refs=_,this.updater=W||N}var L=Y.prototype=new A;L.constructor=Y,C(L,M.prototype),L.isPureReactComponent=!0;var T=Array.isArray,R={H:null,A:null,T:null,S:null,V:null},G=Object.prototype.hasOwnProperty;function X(E,$,W,ae,ie,he){return W=he.ref,{$$typeof:n,type:E,key:$,ref:W!==void 0?W:null,props:he}}function le(E,$){return X(E.type,$,void 0,void 0,void 0,E.props)}function I(E){return typeof E=="object"&&E!==null&&E.$$typeof===n}function K(E){var $={"=":"=0",":":"=2"};return"$"+E.replace(/[=:]/g,function(W){return $[W]})}var ne=/\/+/g;function ee(E,$){return typeof E=="object"&&E!==null&&E.key!=null?K(""+E.key):$.toString(36)}function se(){}function S(E){switch(E.status){case"fulfilled":return E.value;case"rejected":throw E.reason;default:switch(typeof E.status=="string"?E.then(se,se):(E.status="pending",E.then(function($){E.status==="pending"&&(E.status="fulfilled",E.value=$)},function($){E.status==="pending"&&(E.status="rejected",E.reason=$)})),E.status){case"fulfilled":return E.value;case"rejected":throw E.reason}}throw E}function U(E,$,W,ae,ie){var he=typeof E;(he==="undefined"||he==="boolean")&&(E=null);var xe=!1;if(E===null)xe=!0;else switch(he){case"bigint":case"string":case"number":xe=!0;break;case"object":switch(E.$$typeof){case n:case r:xe=!0;break;case m:return xe=E._init,U(xe(E._payload),$,W,ae,ie)}}if(xe)return ie=ie(E),xe=ae===""?"."+ee(E,0):ae,T(ie)?(W="",xe!=null&&(W=xe.replace(ne,"$&/")+"/"),U(ie,$,W,"",function(Ae){return Ae})):ie!=null&&(I(ie)&&(ie=le(ie,W+(ie.key==null||E&&E.key===ie.key?"":(""+ie.key).replace(ne,"$&/")+"/")+xe)),$.push(ie)),1;xe=0;var Se=ae===""?".":ae+":";if(T(E))for(var ve=0;ve<E.length;ve++)ae=E[ve],he=Se+ee(ae,ve),xe+=U(ae,$,W,he,ie);else if(ve=v(E),typeof ve=="function")for(E=ve.call(E),ve=0;!(ae=E.next()).done;)ae=ae.value,he=Se+ee(ae,ve++),xe+=U(ae,$,W,he,ie);else if(he==="object"){if(typeof E.then=="function")return U(S(E),$,W,ae,ie);throw $=String(E),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(E).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return xe}function k(E,$,W){if(E==null)return E;var ae=[],ie=0;return U(E,ae,"","",function(he){return $.call(W,he,ie++)}),ae}function H(E){if(E._status===-1){var $=E._result;$=$(),$.then(function(W){(E._status===0||E._status===-1)&&(E._status=1,E._result=W)},function(W){(E._status===0||E._status===-1)&&(E._status=2,E._result=W)}),E._status===-1&&(E._status=0,E._result=$)}if(E._status===1)return E._result.default;throw E._result}var D=typeof reportError=="function"?reportError:function(E){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof E=="object"&&E!==null&&typeof E.message=="string"?String(E.message):String(E),error:E});if(!window.dispatchEvent($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",E);return}console.error(E)};function O(){}return De.Children={map:k,forEach:function(E,$,W){k(E,function(){$.apply(this,arguments)},W)},count:function(E){var $=0;return k(E,function(){$++}),$},toArray:function(E){return k(E,function($){return $})||[]},only:function(E){if(!I(E))throw Error("React.Children.only expected to receive a single React element child.");return E}},De.Component=M,De.Fragment=o,De.Profiler=u,De.PureComponent=Y,De.StrictMode=i,De.Suspense=p,De.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=R,De.__COMPILER_RUNTIME={__proto__:null,c:function(E){return R.H.useMemoCache(E)}},De.cache=function(E){return function(){return E.apply(null,arguments)}},De.cloneElement=function(E,$,W){if(E==null)throw Error("The argument must be a React element, but you passed "+E+".");var ae=C({},E.props),ie=E.key,he=void 0;if($!=null)for(xe in $.ref!==void 0&&(he=void 0),$.key!==void 0&&(ie=""+$.key),$)!G.call($,xe)||xe==="key"||xe==="__self"||xe==="__source"||xe==="ref"&&$.ref===void 0||(ae[xe]=$[xe]);var xe=arguments.length-2;if(xe===1)ae.children=W;else if(1<xe){for(var Se=Array(xe),ve=0;ve<xe;ve++)Se[ve]=arguments[ve+2];ae.children=Se}return X(E.type,ie,void 0,void 0,he,ae)},De.createContext=function(E){return E={$$typeof:h,_currentValue:E,_currentValue2:E,_threadCount:0,Provider:null,Consumer:null},E.Provider=E,E.Consumer={$$typeof:f,_context:E},E},De.createElement=function(E,$,W){var ae,ie={},he=null;if($!=null)for(ae in $.key!==void 0&&(he=""+$.key),$)G.call($,ae)&&ae!=="key"&&ae!=="__self"&&ae!=="__source"&&(ie[ae]=$[ae]);var xe=arguments.length-2;if(xe===1)ie.children=W;else if(1<xe){for(var Se=Array(xe),ve=0;ve<xe;ve++)Se[ve]=arguments[ve+2];ie.children=Se}if(E&&E.defaultProps)for(ae in xe=E.defaultProps,xe)ie[ae]===void 0&&(ie[ae]=xe[ae]);return X(E,he,void 0,void 0,null,ie)},De.createRef=function(){return{current:null}},De.forwardRef=function(E){return{$$typeof:g,render:E}},De.isValidElement=I,De.lazy=function(E){return{$$typeof:m,_payload:{_status:-1,_result:E},_init:H}},De.memo=function(E,$){return{$$typeof:x,type:E,compare:$===void 0?null:$}},De.startTransition=function(E){var $=R.T,W={};R.T=W;try{var ae=E(),ie=R.S;ie!==null&&ie(W,ae),typeof ae=="object"&&ae!==null&&typeof ae.then=="function"&&ae.then(O,D)}catch(he){D(he)}finally{R.T=$}},De.unstable_useCacheRefresh=function(){return R.H.useCacheRefresh()},De.use=function(E){return R.H.use(E)},De.useActionState=function(E,$,W){return R.H.useActionState(E,$,W)},De.useCallback=function(E,$){return R.H.useCallback(E,$)},De.useContext=function(E){return R.H.useContext(E)},De.useDebugValue=function(){},De.useDeferredValue=function(E,$){return R.H.useDeferredValue(E,$)},De.useEffect=function(E,$,W){var ae=R.H;if(typeof W=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return ae.useEffect(E,$)},De.useId=function(){return R.H.useId()},De.useImperativeHandle=function(E,$,W){return R.H.useImperativeHandle(E,$,W)},De.useInsertionEffect=function(E,$){return R.H.useInsertionEffect(E,$)},De.useLayoutEffect=function(E,$){return R.H.useLayoutEffect(E,$)},De.useMemo=function(E,$){return R.H.useMemo(E,$)},De.useOptimistic=function(E,$){return R.H.useOptimistic(E,$)},De.useReducer=function(E,$,W){return R.H.useReducer(E,$,W)},De.useRef=function(E){return R.H.useRef(E)},De.useState=function(E){return R.H.useState(E)},De.useSyncExternalStore=function(E,$,W){return R.H.useSyncExternalStore(E,$,W)},De.useTransition=function(){return R.H.useTransition()},De.version="19.1.1",De}var am;function Yr(){return am||(am=1,ld.exports=kv()),ld.exports}var j=Yr();const re=S0(j);var rd={exports:{}},vr={},od={exports:{}},id={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* scheduler.production.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Meta Platforms, Inc. and 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
|
-
*/var sm;function _v(){return sm||(sm=1,(function(n){function r(k,H){var D=k.length;k.push(H);e:for(;0<D;){var O=D-1>>>1,E=k[O];if(0<u(E,H))k[O]=H,k[D]=E,D=O;else break e}}function o(k){return k.length===0?null:k[0]}function i(k){if(k.length===0)return null;var H=k[0],D=k.pop();if(D!==H){k[0]=D;e:for(var O=0,E=k.length,$=E>>>1;O<$;){var W=2*(O+1)-1,ae=k[W],ie=W+1,he=k[ie];if(0>u(ae,D))ie<E&&0>u(he,ae)?(k[O]=he,k[ie]=D,O=ie):(k[O]=ae,k[W]=D,O=W);else if(ie<E&&0>u(he,D))k[O]=he,k[ie]=D,O=ie;else break e}}return H}function u(k,H){var D=k.sortIndex-H.sortIndex;return D!==0?D:k.id-H.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;n.unstable_now=function(){return f.now()}}else{var h=Date,g=h.now();n.unstable_now=function(){return h.now()-g}}var p=[],x=[],m=1,b=null,v=3,N=!1,C=!1,_=!1,M=!1,A=typeof setTimeout=="function"?setTimeout:null,Y=typeof clearTimeout=="function"?clearTimeout:null,L=typeof setImmediate<"u"?setImmediate:null;function T(k){for(var H=o(x);H!==null;){if(H.callback===null)i(x);else if(H.startTime<=k)i(x),H.sortIndex=H.expirationTime,r(p,H);else break;H=o(x)}}function R(k){if(_=!1,T(k),!C)if(o(p)!==null)C=!0,G||(G=!0,ee());else{var H=o(x);H!==null&&U(R,H.startTime-k)}}var G=!1,X=-1,le=5,I=-1;function K(){return M?!0:!(n.unstable_now()-I<le)}function ne(){if(M=!1,G){var k=n.unstable_now();I=k;var H=!0;try{e:{C=!1,_&&(_=!1,Y(X),X=-1),N=!0;var D=v;try{t:{for(T(k),b=o(p);b!==null&&!(b.expirationTime>k&&K());){var O=b.callback;if(typeof O=="function"){b.callback=null,v=b.priorityLevel;var E=O(b.expirationTime<=k);if(k=n.unstable_now(),typeof E=="function"){b.callback=E,T(k),H=!0;break t}b===o(p)&&i(p),T(k)}else i(p);b=o(p)}if(b!==null)H=!0;else{var $=o(x);$!==null&&U(R,$.startTime-k),H=!1}}break e}finally{b=null,v=D,N=!1}H=void 0}}finally{H?ee():G=!1}}}var ee;if(typeof L=="function")ee=function(){L(ne)};else if(typeof MessageChannel<"u"){var se=new MessageChannel,S=se.port2;se.port1.onmessage=ne,ee=function(){S.postMessage(null)}}else ee=function(){A(ne,0)};function U(k,H){X=A(function(){k(n.unstable_now())},H)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(k){k.callback=null},n.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):le=0<k?Math.floor(1e3/k):5},n.unstable_getCurrentPriorityLevel=function(){return v},n.unstable_next=function(k){switch(v){case 1:case 2:case 3:var H=3;break;default:H=v}var D=v;v=H;try{return k()}finally{v=D}},n.unstable_requestPaint=function(){M=!0},n.unstable_runWithPriority=function(k,H){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var D=v;v=k;try{return H()}finally{v=D}},n.unstable_scheduleCallback=function(k,H,D){var O=n.unstable_now();switch(typeof D=="object"&&D!==null?(D=D.delay,D=typeof D=="number"&&0<D?O+D:O):D=O,k){case 1:var E=-1;break;case 2:E=250;break;case 5:E=1073741823;break;case 4:E=1e4;break;default:E=5e3}return E=D+E,k={id:m++,callback:H,priorityLevel:k,startTime:D,expirationTime:E,sortIndex:-1},D>O?(k.sortIndex=D,r(x,k),o(p)===null&&k===o(x)&&(_?(Y(X),X=-1):_=!0,U(R,D-O))):(k.sortIndex=E,r(p,k),C||N||(C=!0,G||(G=!0,ee()))),k},n.unstable_shouldYield=K,n.unstable_wrapCallback=function(k){var H=v;return function(){var D=v;v=H;try{return k.apply(this,arguments)}finally{v=D}}}})(id)),id}var lm;function Cv(){return lm||(lm=1,od.exports=_v()),od.exports}var cd={exports:{}},qt={};/**
|
|
26
|
-
* @license React
|
|
27
|
-
* react-dom.production.js
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Meta Platforms, Inc. and 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 rm;function Tv(){if(rm)return qt;rm=1;var n=Yr();function r(p){var x="https://react.dev/errors/"+p;if(1<arguments.length){x+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)x+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+p+"; visit "+x+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(){}var i={d:{f:o,r:function(){throw Error(r(522))},D:o,C:o,L:o,m:o,X:o,S:o,M:o},p:0,findDOMNode:null},u=Symbol.for("react.portal");function f(p,x,m){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:b==null?null:""+b,children:p,containerInfo:x,implementation:m}}var h=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function g(p,x){if(p==="font")return"";if(typeof x=="string")return x==="use-credentials"?x:""}return qt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,qt.createPortal=function(p,x){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!x||x.nodeType!==1&&x.nodeType!==9&&x.nodeType!==11)throw Error(r(299));return f(p,x,null,m)},qt.flushSync=function(p){var x=h.T,m=i.p;try{if(h.T=null,i.p=2,p)return p()}finally{h.T=x,i.p=m,i.d.f()}},qt.preconnect=function(p,x){typeof p=="string"&&(x?(x=x.crossOrigin,x=typeof x=="string"?x==="use-credentials"?x:"":void 0):x=null,i.d.C(p,x))},qt.prefetchDNS=function(p){typeof p=="string"&&i.d.D(p)},qt.preinit=function(p,x){if(typeof p=="string"&&x&&typeof x.as=="string"){var m=x.as,b=g(m,x.crossOrigin),v=typeof x.integrity=="string"?x.integrity:void 0,N=typeof x.fetchPriority=="string"?x.fetchPriority:void 0;m==="style"?i.d.S(p,typeof x.precedence=="string"?x.precedence:void 0,{crossOrigin:b,integrity:v,fetchPriority:N}):m==="script"&&i.d.X(p,{crossOrigin:b,integrity:v,fetchPriority:N,nonce:typeof x.nonce=="string"?x.nonce:void 0})}},qt.preinitModule=function(p,x){if(typeof p=="string")if(typeof x=="object"&&x!==null){if(x.as==null||x.as==="script"){var m=g(x.as,x.crossOrigin);i.d.M(p,{crossOrigin:m,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0})}}else x==null&&i.d.M(p)},qt.preload=function(p,x){if(typeof p=="string"&&typeof x=="object"&&x!==null&&typeof x.as=="string"){var m=x.as,b=g(m,x.crossOrigin);i.d.L(p,m,{crossOrigin:b,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0,type:typeof x.type=="string"?x.type:void 0,fetchPriority:typeof x.fetchPriority=="string"?x.fetchPriority:void 0,referrerPolicy:typeof x.referrerPolicy=="string"?x.referrerPolicy:void 0,imageSrcSet:typeof x.imageSrcSet=="string"?x.imageSrcSet:void 0,imageSizes:typeof x.imageSizes=="string"?x.imageSizes:void 0,media:typeof x.media=="string"?x.media:void 0})}},qt.preloadModule=function(p,x){if(typeof p=="string")if(x){var m=g(x.as,x.crossOrigin);i.d.m(p,{as:typeof x.as=="string"&&x.as!=="script"?x.as:void 0,crossOrigin:m,integrity:typeof x.integrity=="string"?x.integrity:void 0})}else i.d.m(p)},qt.requestFormReset=function(p){i.d.r(p)},qt.unstable_batchedUpdates=function(p,x){return p(x)},qt.useFormState=function(p,x,m){return h.H.useFormState(p,x,m)},qt.useFormStatus=function(){return h.H.useHostTransitionStatus()},qt.version="19.1.1",qt}var om;function E0(){if(om)return cd.exports;om=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),cd.exports=Tv(),cd.exports}/**
|
|
34
|
-
* @license React
|
|
35
|
-
* react-dom-client.production.js
|
|
36
|
-
*
|
|
37
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
-
*
|
|
39
|
-
* This source code is licensed under the MIT license found in the
|
|
40
|
-
* LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/var im;function Mv(){if(im)return vr;im=1;var n=Cv(),r=Yr(),o=E0();function i(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}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."}function u(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function h(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 g(e){if(f(e)!==e)throw Error(i(188))}function p(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(i(188));return t!==e?null:e}for(var a=e,l=t;;){var c=a.return;if(c===null)break;var d=c.alternate;if(d===null){if(l=c.return,l!==null){a=l;continue}break}if(c.child===d.child){for(d=c.child;d;){if(d===a)return g(c),e;if(d===l)return g(c),t;d=d.sibling}throw Error(i(188))}if(a.return!==l.return)a=c,l=d;else{for(var y=!1,w=c.child;w;){if(w===a){y=!0,a=c,l=d;break}if(w===l){y=!0,l=c,a=d;break}w=w.sibling}if(!y){for(w=d.child;w;){if(w===a){y=!0,a=d,l=c;break}if(w===l){y=!0,l=d,a=c;break}w=w.sibling}if(!y)throw Error(i(189))}}if(a.alternate!==l)throw Error(i(190))}if(a.tag!==3)throw Error(i(188));return a.stateNode.current===a?e:t}function x(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=x(e),t!==null)return t;e=e.sibling}return null}var m=Object.assign,b=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),A=Symbol.for("react.provider"),Y=Symbol.for("react.consumer"),L=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),G=Symbol.for("react.suspense_list"),X=Symbol.for("react.memo"),le=Symbol.for("react.lazy"),I=Symbol.for("react.activity"),K=Symbol.for("react.memo_cache_sentinel"),ne=Symbol.iterator;function ee(e){return e===null||typeof e!="object"?null:(e=ne&&e[ne]||e["@@iterator"],typeof e=="function"?e:null)}var se=Symbol.for("react.client.reference");function S(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===se?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case C:return"Fragment";case M:return"Profiler";case _:return"StrictMode";case R:return"Suspense";case G:return"SuspenseList";case I:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case N:return"Portal";case L:return(e.displayName||"Context")+".Provider";case Y:return(e._context.displayName||"Context")+".Consumer";case T:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case X:return t=e.displayName||null,t!==null?t:S(e.type)||"Memo";case le:t=e._payload,e=e._init;try{return S(e(t))}catch{}}return null}var U=Array.isArray,k=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,D={pending:!1,data:null,method:null,action:null},O=[],E=-1;function $(e){return{current:e}}function W(e){0>E||(e.current=O[E],O[E]=null,E--)}function ae(e,t){E++,O[E]=e.current,e.current=t}var ie=$(null),he=$(null),xe=$(null),Se=$(null);function ve(e,t){switch(ae(xe,t),ae(he,e),ae(ie,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Cp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Cp(t),e=Tp(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}W(ie),ae(ie,e)}function Ae(){W(ie),W(he),W(xe)}function Re(e){e.memoizedState!==null&&ae(Se,e);var t=ie.current,a=Tp(t,e.type);t!==a&&(ae(he,e),ae(ie,a))}function We(e){he.current===e&&(W(ie),W(he)),Se.current===e&&(W(Se),xr._currentValue=D)}var Te=Object.prototype.hasOwnProperty,be=n.unstable_scheduleCallback,q=n.unstable_cancelCallback,V=n.unstable_shouldYield,ue=n.unstable_requestPaint,oe=n.unstable_now,P=n.unstable_getCurrentPriorityLevel,Ee=n.unstable_ImmediatePriority,ge=n.unstable_UserBlockingPriority,ke=n.unstable_NormalPriority,Oe=n.unstable_LowPriority,ze=n.unstable_IdlePriority,Mt=n.log,At=n.unstable_setDisableYieldValue,dt=null,nt=null;function pt(e){if(typeof Mt=="function"&&At(e),nt&&typeof nt.setStrictMode=="function")try{nt.setStrictMode(dt,e)}catch{}}var at=Math.clz32?Math.clz32:je,pe=Math.log,Ve=Math.LN2;function je(e){return e>>>=0,e===0?32:31-(pe(e)/Ve|0)|0}var Le=256,Ge=4194304;function Rt(e){var t=e&42;if(t!==0)return t;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Vt(e,t,a){var l=e.pendingLanes;if(l===0)return 0;var c=0,d=e.suspendedLanes,y=e.pingedLanes;e=e.warmLanes;var w=l&134217727;return w!==0?(l=w&~d,l!==0?c=Rt(l):(y&=w,y!==0?c=Rt(y):a||(a=w&~e,a!==0&&(c=Rt(a))))):(w=l&~d,w!==0?c=Rt(w):y!==0?c=Rt(y):a||(a=l&~e,a!==0&&(c=Rt(a)))),c===0?0:t!==0&&t!==c&&(t&d)===0&&(d=c&-c,a=t&-t,d>=a||d===32&&(a&4194048)!==0)?t:c}function Jt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function jl(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ys(){var e=Le;return Le<<=1,(Le&4194048)===0&&(Le=256),e}function ra(){var e=Ge;return Ge<<=1,(Ge&62914560)===0&&(Ge=4194304),e}function Va(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function oa(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Dn(e,t,a,l,c,d){var y=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var w=e.entanglements,z=e.expirationTimes,J=e.hiddenUpdates;for(a=y&~a;0<a;){var ce=31-at(a),fe=1<<ce;w[ce]=0,z[ce]=-1;var F=J[ce];if(F!==null)for(J[ce]=null,ce=0;ce<F.length;ce++){var te=F[ce];te!==null&&(te.lane&=-536870913)}a&=~fe}l!==0&&Qr(e,l,0),d!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=d&~(y&~t))}function Qr(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-at(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|a&4194090}function Kr(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var l=31-at(a),c=1<<l;c&t|e[l]&t&&(e[l]|=t),a&=~c}}function Nl(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function wl(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Jr(){var e=H.p;return e!==0?e:(e=window.event,e===void 0?32:Qp(e.type))}function Ii(e,t){var a=H.p;try{return H.p=e,t()}finally{H.p=a}}var _n=Math.random().toString(36).slice(2),wt="__reactFiber$"+_n,Ut="__reactProps$"+_n,ia="__reactContainer$"+_n,Sl="__reactEvents$"+_n,Fi="__reactListeners$"+_n,Pi="__reactHandles$"+_n,Ir="__reactResources$"+_n,Ga="__reactMarker$"+_n;function El(e){delete e[wt],delete e[Ut],delete e[Sl],delete e[Fi],delete e[Pi]}function Hn(e){var t=e[wt];if(t)return t;for(var a=e.parentNode;a;){if(t=a[ia]||a[wt]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=zp(e);e!==null;){if(a=e[wt])return a;e=zp(e)}return t}e=a,a=e.parentNode}return null}function ca(e){if(e=e[wt]||e[ia]){var t=e.tag;if(t===5||t===6||t===13||t===26||t===27||t===3)return e}return null}function Xa(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function ua(e){var t=e[Ir];return t||(t=e[Ir]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function mt(e){e[Ga]=!0}var Fr=new Set,Pr={};function $n(e,t){da(e,t),da(e+"Capture",t)}function da(e,t){for(Pr[e]=t,e=0;e<t.length;e++)Fr.add(t[e])}var eo=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),to={},no={};function ec(e){return Te.call(no,e)?!0:Te.call(to,e)?!1:eo.test(e)?no[e]=!0:(to[e]=!0,!1)}function bs(e,t,a){if(ec(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function vs(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function bn(e,t,a,l){if(l===null)e.removeAttribute(a);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+l)}}var js,ao;function fa(e){if(js===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);js=t&&t[1]||"",ao=-1<a.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+js+e+ao}var kl=!1;function Za(e,t){if(!e||kl)return"";kl=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var fe=function(){throw Error()};if(Object.defineProperty(fe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(fe,[])}catch(te){var F=te}Reflect.construct(e,[],fe)}else{try{fe.call()}catch(te){F=te}e.call(fe.prototype)}}else{try{throw Error()}catch(te){F=te}(fe=e())&&typeof fe.catch=="function"&&fe.catch(function(){})}}catch(te){if(te&&F&&typeof te.stack=="string")return[te.stack,F.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var d=l.DetermineComponentFrameRoot(),y=d[0],w=d[1];if(y&&w){var z=y.split(`
|
|
44
|
-
`),J=w.split(`
|
|
45
|
-
`);for(c=l=0;l<z.length&&!z[l].includes("DetermineComponentFrameRoot");)l++;for(;c<J.length&&!J[c].includes("DetermineComponentFrameRoot");)c++;if(l===z.length||c===J.length)for(l=z.length-1,c=J.length-1;1<=l&&0<=c&&z[l]!==J[c];)c--;for(;1<=l&&0<=c;l--,c--)if(z[l]!==J[c]){if(l!==1||c!==1)do if(l--,c--,0>c||z[l]!==J[c]){var ce=`
|
|
46
|
-
`+z[l].replace(" at new "," at ");return e.displayName&&ce.includes("<anonymous>")&&(ce=ce.replace("<anonymous>",e.displayName)),ce}while(1<=l&&0<=c);break}}}finally{kl=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?fa(a):""}function yy(e){switch(e.tag){case 26:case 27:case 5:return fa(e.type);case 16:return fa("Lazy");case 13:return fa("Suspense");case 19:return fa("SuspenseList");case 0:case 15:return Za(e.type,!1);case 11:return Za(e.type.render,!1);case 1:return Za(e.type,!0);case 31:return fa("Activity");default:return""}}function Nf(e){try{var t="";do t+=yy(e),e=e.return;while(e);return t}catch(a){return`
|
|
47
|
-
Error generating stack: `+a.message+`
|
|
48
|
-
`+a.stack}}function on(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function wf(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function by(e){var t=wf(e)?"checked":"value",a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),l=""+e[t];if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var c=a.get,d=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(y){l=""+y,d.call(this,y)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return l},setValue:function(y){l=""+y},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function so(e){e._valueTracker||(e._valueTracker=by(e))}function Sf(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),l="";return e&&(l=wf(e)?e.checked?"true":"false":e.value),e=l,e!==a?(t.setValue(e),!0):!1}function lo(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}}var vy=/[\n"\\]/g;function cn(e){return e.replace(vy,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function tc(e,t,a,l,c,d,y,w){e.name="",y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?e.type=y:e.removeAttribute("type"),t!=null?y==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+on(t)):e.value!==""+on(t)&&(e.value=""+on(t)):y!=="submit"&&y!=="reset"||e.removeAttribute("value"),t!=null?nc(e,y,on(t)):a!=null?nc(e,y,on(a)):l!=null&&e.removeAttribute("value"),c==null&&d!=null&&(e.defaultChecked=!!d),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?e.name=""+on(w):e.removeAttribute("name")}function Ef(e,t,a,l,c,d,y,w){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.type=d),t!=null||a!=null){if(!(d!=="submit"&&d!=="reset"||t!=null))return;a=a!=null?""+on(a):"",t=t!=null?""+on(t):a,w||t===e.value||(e.value=t),e.defaultValue=t}l=l??c,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=w?e.checked:!!l,e.defaultChecked=!!l,y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(e.name=y)}function nc(e,t,a){t==="number"&&lo(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Ns(e,t,a,l){if(e=e.options,t){t={};for(var c=0;c<a.length;c++)t["$"+a[c]]=!0;for(a=0;a<e.length;a++)c=t.hasOwnProperty("$"+e[a].value),e[a].selected!==c&&(e[a].selected=c),c&&l&&(e[a].defaultSelected=!0)}else{for(a=""+on(a),t=null,c=0;c<e.length;c++){if(e[c].value===a){e[c].selected=!0,l&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function kf(e,t,a){if(t!=null&&(t=""+on(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+on(a):""}function _f(e,t,a,l){if(t==null){if(l!=null){if(a!=null)throw Error(i(92));if(U(l)){if(1<l.length)throw Error(i(93));l=l[0]}a=l}a==null&&(a=""),t=a}a=on(t),e.defaultValue=a,l=e.textContent,l===a&&l!==""&&l!==null&&(e.value=l)}function ws(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var jy=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Cf(e,t,a){var l=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,a):typeof a!="number"||a===0||jy.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function Tf(e,t,a){if(t!=null&&typeof t!="object")throw Error(i(62));if(e=e.style,a!=null){for(var l in a)!a.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var c in t)l=t[c],t.hasOwnProperty(c)&&a[c]!==l&&Cf(e,c,l)}else for(var d in t)t.hasOwnProperty(d)&&Cf(e,d,t[d])}function ac(e){if(e.indexOf("-")===-1)return!1;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 Ny=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),wy=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function ro(e){return wy.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var sc=null;function lc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ss=null,Es=null;function Mf(e){var t=ca(e);if(t&&(e=t.stateNode)){var a=e[Ut]||null;e:switch(e=t.stateNode,t.type){case"input":if(tc(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+cn(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var l=a[t];if(l!==e&&l.form===e.form){var c=l[Ut]||null;if(!c)throw Error(i(90));tc(l,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<a.length;t++)l=a[t],l.form===e.form&&Sf(l)}break e;case"textarea":kf(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&Ns(e,!!a.multiple,t,!1)}}}var rc=!1;function Af(e,t,a){if(rc)return e(t,a);rc=!0;try{var l=e(t);return l}finally{if(rc=!1,(Ss!==null||Es!==null)&&(Zo(),Ss&&(t=Ss,e=Es,Es=Ss=null,Mf(t),e)))for(t=0;t<e.length;t++)Mf(e[t])}}function _l(e,t){var a=e.stateNode;if(a===null)return null;var l=a[Ut]||null;if(l===null)return null;a=l[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":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(i(231,t,typeof a));return a}var Un=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),oc=!1;if(Un)try{var Cl={};Object.defineProperty(Cl,"passive",{get:function(){oc=!0}}),window.addEventListener("test",Cl,Cl),window.removeEventListener("test",Cl,Cl)}catch{oc=!1}var ha=null,ic=null,oo=null;function Rf(){if(oo)return oo;var e,t=ic,a=t.length,l,c="value"in ha?ha.value:ha.textContent,d=c.length;for(e=0;e<a&&t[e]===c[e];e++);var y=a-e;for(l=1;l<=y&&t[a-l]===c[d-l];l++);return oo=c.slice(e,1<l?1-l:void 0)}function io(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 co(){return!0}function zf(){return!1}function Xt(e){function t(a,l,c,d,y){this._reactName=a,this._targetInst=c,this.type=l,this.nativeEvent=d,this.target=y,this.currentTarget=null;for(var w in e)e.hasOwnProperty(w)&&(a=e[w],this[w]=a?a(d):d[w]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?co:zf,this.isPropagationStopped=zf,this}return m(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=co)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=co)},persist:function(){},isPersistent:co}),t}var Wa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},uo=Xt(Wa),Tl=m({},Wa,{view:0,detail:0}),Sy=Xt(Tl),cc,uc,Ml,fo=m({},Tl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:fc,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!==Ml&&(Ml&&e.type==="mousemove"?(cc=e.screenX-Ml.screenX,uc=e.screenY-Ml.screenY):uc=cc=0,Ml=e),cc)},movementY:function(e){return"movementY"in e?e.movementY:uc}}),Of=Xt(fo),Ey=m({},fo,{dataTransfer:0}),ky=Xt(Ey),_y=m({},Tl,{relatedTarget:0}),dc=Xt(_y),Cy=m({},Wa,{animationName:0,elapsedTime:0,pseudoElement:0}),Ty=Xt(Cy),My=m({},Wa,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Ay=Xt(My),Ry=m({},Wa,{data:0}),Df=Xt(Ry),zy={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Oy={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"},Dy={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Hy(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Dy[e])?!!t[e]:!1}function fc(){return Hy}var $y=m({},Tl,{key:function(e){if(e.key){var t=zy[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=io(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Oy[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:fc,charCode:function(e){return e.type==="keypress"?io(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?io(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Uy=Xt($y),By=m({},fo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Hf=Xt(By),qy=m({},Tl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:fc}),Ly=Xt(qy),Yy=m({},Wa,{propertyName:0,elapsedTime:0,pseudoElement:0}),Vy=Xt(Yy),Gy=m({},fo,{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}),Xy=Xt(Gy),Zy=m({},Wa,{newState:0,oldState:0}),Wy=Xt(Zy),Qy=[9,13,27,32],hc=Un&&"CompositionEvent"in window,Al=null;Un&&"documentMode"in document&&(Al=document.documentMode);var Ky=Un&&"TextEvent"in window&&!Al,$f=Un&&(!hc||Al&&8<Al&&11>=Al),Uf=" ",Bf=!1;function qf(e,t){switch(e){case"keyup":return Qy.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Lf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ks=!1;function Jy(e,t){switch(e){case"compositionend":return Lf(t);case"keypress":return t.which!==32?null:(Bf=!0,Uf);case"textInput":return e=t.data,e===Uf&&Bf?null:e;default:return null}}function Iy(e,t){if(ks)return e==="compositionend"||!hc&&qf(e,t)?(e=Rf(),oo=ic=ha=null,ks=!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 $f&&t.locale!=="ko"?null:t.data;default:return null}}var Fy={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 Yf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Fy[e.type]:t==="textarea"}function Vf(e,t,a,l){Ss?Es?Es.push(l):Es=[l]:Ss=l,t=Fo(t,"onChange"),0<t.length&&(a=new uo("onChange","change",null,a,l),e.push({event:a,listeners:t}))}var Rl=null,zl=null;function Py(e){wp(e,0)}function ho(e){var t=Xa(e);if(Sf(t))return e}function Gf(e,t){if(e==="change")return t}var Xf=!1;if(Un){var xc;if(Un){var pc="oninput"in document;if(!pc){var Zf=document.createElement("div");Zf.setAttribute("oninput","return;"),pc=typeof Zf.oninput=="function"}xc=pc}else xc=!1;Xf=xc&&(!document.documentMode||9<document.documentMode)}function Wf(){Rl&&(Rl.detachEvent("onpropertychange",Qf),zl=Rl=null)}function Qf(e){if(e.propertyName==="value"&&ho(zl)){var t=[];Vf(t,zl,e,lc(e)),Af(Py,t)}}function eb(e,t,a){e==="focusin"?(Wf(),Rl=t,zl=a,Rl.attachEvent("onpropertychange",Qf)):e==="focusout"&&Wf()}function tb(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ho(zl)}function nb(e,t){if(e==="click")return ho(t)}function ab(e,t){if(e==="input"||e==="change")return ho(t)}function sb(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var It=typeof Object.is=="function"?Object.is:sb;function Ol(e,t){if(It(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),l=Object.keys(t);if(a.length!==l.length)return!1;for(l=0;l<a.length;l++){var c=a[l];if(!Te.call(t,c)||!It(e[c],t[c]))return!1}return!0}function Kf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Jf(e,t){var a=Kf(e);e=0;for(var l;a;){if(a.nodeType===3){if(l=e+a.textContent.length,e<=t&&l>=t)return{node:a,offset:t-e};e=l}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Kf(a)}}function If(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?If(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ff(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=lo(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=lo(e.document)}return t}function mc(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")}var lb=Un&&"documentMode"in document&&11>=document.documentMode,_s=null,gc=null,Dl=null,yc=!1;function Pf(e,t,a){var l=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;yc||_s==null||_s!==lo(l)||(l=_s,"selectionStart"in l&&mc(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Dl&&Ol(Dl,l)||(Dl=l,l=Fo(gc,"onSelect"),0<l.length&&(t=new uo("onSelect","select",null,t,a),e.push({event:t,listeners:l}),t.target=_s)))}function Qa(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Cs={animationend:Qa("Animation","AnimationEnd"),animationiteration:Qa("Animation","AnimationIteration"),animationstart:Qa("Animation","AnimationStart"),transitionrun:Qa("Transition","TransitionRun"),transitionstart:Qa("Transition","TransitionStart"),transitioncancel:Qa("Transition","TransitionCancel"),transitionend:Qa("Transition","TransitionEnd")},bc={},eh={};Un&&(eh=document.createElement("div").style,"AnimationEvent"in window||(delete Cs.animationend.animation,delete Cs.animationiteration.animation,delete Cs.animationstart.animation),"TransitionEvent"in window||delete Cs.transitionend.transition);function Ka(e){if(bc[e])return bc[e];if(!Cs[e])return e;var t=Cs[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in eh)return bc[e]=t[a];return e}var th=Ka("animationend"),nh=Ka("animationiteration"),ah=Ka("animationstart"),rb=Ka("transitionrun"),ob=Ka("transitionstart"),ib=Ka("transitioncancel"),sh=Ka("transitionend"),lh=new Map,vc="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");vc.push("scrollEnd");function vn(e,t){lh.set(e,t),$n(t,[e])}var rh=new WeakMap;function un(e,t){if(typeof e=="object"&&e!==null){var a=rh.get(e);return a!==void 0?a:(t={value:e,source:t,stack:Nf(t)},rh.set(e,t),t)}return{value:e,source:t,stack:Nf(t)}}var dn=[],Ts=0,jc=0;function xo(){for(var e=Ts,t=jc=Ts=0;t<e;){var a=dn[t];dn[t++]=null;var l=dn[t];dn[t++]=null;var c=dn[t];dn[t++]=null;var d=dn[t];if(dn[t++]=null,l!==null&&c!==null){var y=l.pending;y===null?c.next=c:(c.next=y.next,y.next=c),l.pending=c}d!==0&&oh(a,c,d)}}function po(e,t,a,l){dn[Ts++]=e,dn[Ts++]=t,dn[Ts++]=a,dn[Ts++]=l,jc|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function Nc(e,t,a,l){return po(e,t,a,l),mo(e)}function Ms(e,t){return po(e,null,null,t),mo(e)}function oh(e,t,a){e.lanes|=a;var l=e.alternate;l!==null&&(l.lanes|=a);for(var c=!1,d=e.return;d!==null;)d.childLanes|=a,l=d.alternate,l!==null&&(l.childLanes|=a),d.tag===22&&(e=d.stateNode,e===null||e._visibility&1||(c=!0)),e=d,d=d.return;return e.tag===3?(d=e.stateNode,c&&t!==null&&(c=31-at(a),e=d.hiddenUpdates,l=e[c],l===null?e[c]=[t]:l.push(t),t.lane=a|536870912),d):null}function mo(e){if(50<rr)throw rr=0,Cu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var As={};function cb(e,t,a,l){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ft(e,t,a,l){return new cb(e,t,a,l)}function wc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Bn(e,t){var a=e.alternate;return a===null?(a=Ft(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function ih(e,t){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function go(e,t,a,l,c,d){var y=0;if(l=e,typeof e=="function")wc(e)&&(y=1);else if(typeof e=="string")y=dv(e,a,ie.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case I:return e=Ft(31,a,t,c),e.elementType=I,e.lanes=d,e;case C:return Ja(a.children,c,d,t);case _:y=8,c|=24;break;case M:return e=Ft(12,a,t,c|2),e.elementType=M,e.lanes=d,e;case R:return e=Ft(13,a,t,c),e.elementType=R,e.lanes=d,e;case G:return e=Ft(19,a,t,c),e.elementType=G,e.lanes=d,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case A:case L:y=10;break e;case Y:y=9;break e;case T:y=11;break e;case X:y=14;break e;case le:y=16,l=null;break e}y=29,a=Error(i(130,e===null?"null":typeof e,"")),l=null}return t=Ft(y,a,t,c),t.elementType=e,t.type=l,t.lanes=d,t}function Ja(e,t,a,l){return e=Ft(7,e,l,t),e.lanes=a,e}function Sc(e,t,a){return e=Ft(6,e,null,t),e.lanes=a,e}function Ec(e,t,a){return t=Ft(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Rs=[],zs=0,yo=null,bo=0,fn=[],hn=0,Ia=null,qn=1,Ln="";function Fa(e,t){Rs[zs++]=bo,Rs[zs++]=yo,yo=e,bo=t}function ch(e,t,a){fn[hn++]=qn,fn[hn++]=Ln,fn[hn++]=Ia,Ia=e;var l=qn;e=Ln;var c=32-at(l)-1;l&=~(1<<c),a+=1;var d=32-at(t)+c;if(30<d){var y=c-c%5;d=(l&(1<<y)-1).toString(32),l>>=y,c-=y,qn=1<<32-at(t)+c|a<<c|l,Ln=d+e}else qn=1<<d|a<<c|l,Ln=e}function kc(e){e.return!==null&&(Fa(e,1),ch(e,1,0))}function _c(e){for(;e===yo;)yo=Rs[--zs],Rs[zs]=null,bo=Rs[--zs],Rs[zs]=null;for(;e===Ia;)Ia=fn[--hn],fn[hn]=null,Ln=fn[--hn],fn[hn]=null,qn=fn[--hn],fn[hn]=null}var Gt=null,it=null,Ze=!1,Pa=null,Cn=!1,Cc=Error(i(519));function es(e){var t=Error(i(418,""));throw Ul(un(t,e)),Cc}function uh(e){var t=e.stateNode,a=e.type,l=e.memoizedProps;switch(t[wt]=e,t[Ut]=l,a){case"dialog":qe("cancel",t),qe("close",t);break;case"iframe":case"object":case"embed":qe("load",t);break;case"video":case"audio":for(a=0;a<ir.length;a++)qe(ir[a],t);break;case"source":qe("error",t);break;case"img":case"image":case"link":qe("error",t),qe("load",t);break;case"details":qe("toggle",t);break;case"input":qe("invalid",t),Ef(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0),so(t);break;case"select":qe("invalid",t);break;case"textarea":qe("invalid",t),_f(t,l.value,l.defaultValue,l.children),so(t)}a=l.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||l.suppressHydrationWarning===!0||_p(t.textContent,a)?(l.popover!=null&&(qe("beforetoggle",t),qe("toggle",t)),l.onScroll!=null&&qe("scroll",t),l.onScrollEnd!=null&&qe("scrollend",t),l.onClick!=null&&(t.onclick=Po),t=!0):t=!1,t||es(e)}function dh(e){for(Gt=e.return;Gt;)switch(Gt.tag){case 5:case 13:Cn=!1;return;case 27:case 3:Cn=!0;return;default:Gt=Gt.return}}function Hl(e){if(e!==Gt)return!1;if(!Ze)return dh(e),Ze=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Gu(e.type,e.memoizedProps)),a=!a),a&&it&&es(e),dh(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8)if(a=e.data,a==="/$"){if(t===0){it=Nn(e.nextSibling);break e}t--}else a!=="$"&&a!=="$!"&&a!=="$?"||t++;e=e.nextSibling}it=null}}else t===27?(t=it,Ta(e.type)?(e=Qu,Qu=null,it=e):it=t):it=Gt?Nn(e.stateNode.nextSibling):null;return!0}function $l(){it=Gt=null,Ze=!1}function fh(){var e=Pa;return e!==null&&(Qt===null?Qt=e:Qt.push.apply(Qt,e),Pa=null),e}function Ul(e){Pa===null?Pa=[e]:Pa.push(e)}var Tc=$(null),ts=null,Yn=null;function xa(e,t,a){ae(Tc,t._currentValue),t._currentValue=a}function Vn(e){e._currentValue=Tc.current,W(Tc)}function Mc(e,t,a){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===a)break;e=e.return}}function Ac(e,t,a,l){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var d=c.dependencies;if(d!==null){var y=c.child;d=d.firstContext;e:for(;d!==null;){var w=d;d=c;for(var z=0;z<t.length;z++)if(w.context===t[z]){d.lanes|=a,w=d.alternate,w!==null&&(w.lanes|=a),Mc(d.return,a,e),l||(y=null);break e}d=w.next}}else if(c.tag===18){if(y=c.return,y===null)throw Error(i(341));y.lanes|=a,d=y.alternate,d!==null&&(d.lanes|=a),Mc(y,a,e),y=null}else y=c.child;if(y!==null)y.return=c;else for(y=c;y!==null;){if(y===e){y=null;break}if(c=y.sibling,c!==null){c.return=y.return,y=c;break}y=y.return}c=y}}function Bl(e,t,a,l){e=null;for(var c=t,d=!1;c!==null;){if(!d){if((c.flags&524288)!==0)d=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var y=c.alternate;if(y===null)throw Error(i(387));if(y=y.memoizedProps,y!==null){var w=c.type;It(c.pendingProps.value,y.value)||(e!==null?e.push(w):e=[w])}}else if(c===Se.current){if(y=c.alternate,y===null)throw Error(i(387));y.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(xr):e=[xr])}c=c.return}e!==null&&Ac(t,e,a,l),t.flags|=262144}function vo(e){for(e=e.firstContext;e!==null;){if(!It(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ns(e){ts=e,Yn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Bt(e){return hh(ts,e)}function jo(e,t){return ts===null&&ns(e),hh(e,t)}function hh(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},Yn===null){if(e===null)throw Error(i(308));Yn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Yn=Yn.next=t;return a}var ub=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},db=n.unstable_scheduleCallback,fb=n.unstable_NormalPriority,bt={$$typeof:L,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Rc(){return{controller:new ub,data:new Map,refCount:0}}function ql(e){e.refCount--,e.refCount===0&&db(fb,function(){e.controller.abort()})}var Ll=null,zc=0,Os=0,Ds=null;function hb(e,t){if(Ll===null){var a=Ll=[];zc=0,Os=Du(),Ds={status:"pending",value:void 0,then:function(l){a.push(l)}}}return zc++,t.then(xh,xh),t}function xh(){if(--zc===0&&Ll!==null){Ds!==null&&(Ds.status="fulfilled");var e=Ll;Ll=null,Os=0,Ds=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function xb(e,t){var a=[],l={status:"pending",value:null,reason:null,then:function(c){a.push(c)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var c=0;c<a.length;c++)(0,a[c])(t)},function(c){for(l.status="rejected",l.reason=c,c=0;c<a.length;c++)(0,a[c])(void 0)}),l}var ph=k.S;k.S=function(e,t){typeof t=="object"&&t!==null&&typeof t.then=="function"&&hb(e,t),ph!==null&&ph(e,t)};var as=$(null);function Oc(){var e=as.current;return e!==null?e:et.pooledCache}function No(e,t){t===null?ae(as,as.current):ae(as,t.pool)}function mh(){var e=Oc();return e===null?null:{parent:bt._currentValue,pool:e}}var Yl=Error(i(460)),gh=Error(i(474)),wo=Error(i(542)),Dc={then:function(){}};function yh(e){return e=e.status,e==="fulfilled"||e==="rejected"}function So(){}function bh(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(So,So),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,jh(e),e;default:if(typeof t.status=="string")t.then(So,So);else{if(e=et,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var c=t;c.status="fulfilled",c.value=l}},function(l){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,jh(e),e}throw Vl=t,Yl}}var Vl=null;function vh(){if(Vl===null)throw Error(i(459));var e=Vl;return Vl=null,e}function jh(e){if(e===Yl||e===wo)throw Error(i(483))}var pa=!1;function Hc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function $c(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ma(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ga(e,t,a){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Qe&2)!==0){var c=l.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),l.pending=t,t=mo(e),oh(e,null,a),t}return po(e,l,t,a),mo(e)}function Gl(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,a|=l,t.lanes=a,Kr(e,a)}}function Uc(e,t){var a=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,a===l)){var c=null,d=null;if(a=a.firstBaseUpdate,a!==null){do{var y={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};d===null?c=d=y:d=d.next=y,a=a.next}while(a!==null);d===null?c=d=t:d=d.next=t}else c=d=t;a={baseState:l.baseState,firstBaseUpdate:c,lastBaseUpdate:d,shared:l.shared,callbacks:l.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var Bc=!1;function Xl(){if(Bc){var e=Ds;if(e!==null)throw e}}function Zl(e,t,a,l){Bc=!1;var c=e.updateQueue;pa=!1;var d=c.firstBaseUpdate,y=c.lastBaseUpdate,w=c.shared.pending;if(w!==null){c.shared.pending=null;var z=w,J=z.next;z.next=null,y===null?d=J:y.next=J,y=z;var ce=e.alternate;ce!==null&&(ce=ce.updateQueue,w=ce.lastBaseUpdate,w!==y&&(w===null?ce.firstBaseUpdate=J:w.next=J,ce.lastBaseUpdate=z))}if(d!==null){var fe=c.baseState;y=0,ce=J=z=null,w=d;do{var F=w.lane&-536870913,te=F!==w.lane;if(te?(Ye&F)===F:(l&F)===F){F!==0&&F===Os&&(Bc=!0),ce!==null&&(ce=ce.next={lane:0,tag:w.tag,payload:w.payload,callback:null,next:null});e:{var Me=e,_e=w;F=t;var Fe=a;switch(_e.tag){case 1:if(Me=_e.payload,typeof Me=="function"){fe=Me.call(Fe,fe,F);break e}fe=Me;break e;case 3:Me.flags=Me.flags&-65537|128;case 0:if(Me=_e.payload,F=typeof Me=="function"?Me.call(Fe,fe,F):Me,F==null)break e;fe=m({},fe,F);break e;case 2:pa=!0}}F=w.callback,F!==null&&(e.flags|=64,te&&(e.flags|=8192),te=c.callbacks,te===null?c.callbacks=[F]:te.push(F))}else te={lane:F,tag:w.tag,payload:w.payload,callback:w.callback,next:null},ce===null?(J=ce=te,z=fe):ce=ce.next=te,y|=F;if(w=w.next,w===null){if(w=c.shared.pending,w===null)break;te=w,w=te.next,te.next=null,c.lastBaseUpdate=te,c.shared.pending=null}}while(!0);ce===null&&(z=fe),c.baseState=z,c.firstBaseUpdate=J,c.lastBaseUpdate=ce,d===null&&(c.shared.lanes=0),Ea|=y,e.lanes=y,e.memoizedState=fe}}function Nh(e,t){if(typeof e!="function")throw Error(i(191,e));e.call(t)}function wh(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)Nh(a[e],t)}var Hs=$(null),Eo=$(0);function Sh(e,t){e=Jn,ae(Eo,e),ae(Hs,t),Jn=e|t.baseLanes}function qc(){ae(Eo,Jn),ae(Hs,Hs.current)}function Lc(){Jn=Eo.current,W(Hs),W(Eo)}var ya=0,He=null,Je=null,gt=null,ko=!1,$s=!1,ss=!1,_o=0,Wl=0,Us=null,pb=0;function ft(){throw Error(i(321))}function Yc(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!It(e[a],t[a]))return!1;return!0}function Vc(e,t,a,l,c,d){return ya=d,He=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,k.H=e===null||e.memoizedState===null?ox:ix,ss=!1,d=a(l,c),ss=!1,$s&&(d=kh(t,a,l,c)),Eh(e),d}function Eh(e){k.H=zo;var t=Je!==null&&Je.next!==null;if(ya=0,gt=Je=He=null,ko=!1,Wl=0,Us=null,t)throw Error(i(300));e===null||St||(e=e.dependencies,e!==null&&vo(e)&&(St=!0))}function kh(e,t,a,l){He=e;var c=0;do{if($s&&(Us=null),Wl=0,$s=!1,25<=c)throw Error(i(301));if(c+=1,gt=Je=null,e.updateQueue!=null){var d=e.updateQueue;d.lastEffect=null,d.events=null,d.stores=null,d.memoCache!=null&&(d.memoCache.index=0)}k.H=Nb,d=t(a,l)}while($s);return d}function mb(){var e=k.H,t=e.useState()[0];return t=typeof t.then=="function"?Ql(t):t,e=e.useState()[0],(Je!==null?Je.memoizedState:null)!==e&&(He.flags|=1024),t}function Gc(){var e=_o!==0;return _o=0,e}function Xc(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function Zc(e){if(ko){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ko=!1}ya=0,gt=Je=He=null,$s=!1,Wl=_o=0,Us=null}function Zt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return gt===null?He.memoizedState=gt=e:gt=gt.next=e,gt}function yt(){if(Je===null){var e=He.alternate;e=e!==null?e.memoizedState:null}else e=Je.next;var t=gt===null?He.memoizedState:gt.next;if(t!==null)gt=t,Je=e;else{if(e===null)throw He.alternate===null?Error(i(467)):Error(i(310));Je=e,e={memoizedState:Je.memoizedState,baseState:Je.baseState,baseQueue:Je.baseQueue,queue:Je.queue,next:null},gt===null?He.memoizedState=gt=e:gt=gt.next=e}return gt}function Wc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ql(e){var t=Wl;return Wl+=1,Us===null&&(Us=[]),e=bh(Us,e,t),t=He,(gt===null?t.memoizedState:gt.next)===null&&(t=t.alternate,k.H=t===null||t.memoizedState===null?ox:ix),e}function Co(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ql(e);if(e.$$typeof===L)return Bt(e)}throw Error(i(438,String(e)))}function Qc(e){var t=null,a=He.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var l=He.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=Wc(),He.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),l=0;l<e;l++)a[l]=K;return t.index++,a}function Gn(e,t){return typeof t=="function"?t(e):t}function To(e){var t=yt();return Kc(t,Je,e)}function Kc(e,t,a){var l=e.queue;if(l===null)throw Error(i(311));l.lastRenderedReducer=a;var c=e.baseQueue,d=l.pending;if(d!==null){if(c!==null){var y=c.next;c.next=d.next,d.next=y}t.baseQueue=c=d,l.pending=null}if(d=e.baseState,c===null)e.memoizedState=d;else{t=c.next;var w=y=null,z=null,J=t,ce=!1;do{var fe=J.lane&-536870913;if(fe!==J.lane?(Ye&fe)===fe:(ya&fe)===fe){var F=J.revertLane;if(F===0)z!==null&&(z=z.next={lane:0,revertLane:0,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null}),fe===Os&&(ce=!0);else if((ya&F)===F){J=J.next,F===Os&&(ce=!0);continue}else fe={lane:0,revertLane:J.revertLane,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},z===null?(w=z=fe,y=d):z=z.next=fe,He.lanes|=F,Ea|=F;fe=J.action,ss&&a(d,fe),d=J.hasEagerState?J.eagerState:a(d,fe)}else F={lane:fe,revertLane:J.revertLane,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},z===null?(w=z=F,y=d):z=z.next=F,He.lanes|=fe,Ea|=fe;J=J.next}while(J!==null&&J!==t);if(z===null?y=d:z.next=w,!It(d,e.memoizedState)&&(St=!0,ce&&(a=Ds,a!==null)))throw a;e.memoizedState=d,e.baseState=y,e.baseQueue=z,l.lastRenderedState=d}return c===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function Jc(e){var t=yt(),a=t.queue;if(a===null)throw Error(i(311));a.lastRenderedReducer=e;var l=a.dispatch,c=a.pending,d=t.memoizedState;if(c!==null){a.pending=null;var y=c=c.next;do d=e(d,y.action),y=y.next;while(y!==c);It(d,t.memoizedState)||(St=!0),t.memoizedState=d,t.baseQueue===null&&(t.baseState=d),a.lastRenderedState=d}return[d,l]}function _h(e,t,a){var l=He,c=yt(),d=Ze;if(d){if(a===void 0)throw Error(i(407));a=a()}else a=t();var y=!It((Je||c).memoizedState,a);y&&(c.memoizedState=a,St=!0),c=c.queue;var w=Mh.bind(null,l,c,e);if(Kl(2048,8,w,[e]),c.getSnapshot!==t||y||gt!==null&>.memoizedState.tag&1){if(l.flags|=2048,Bs(9,Mo(),Th.bind(null,l,c,a,t),null),et===null)throw Error(i(349));d||(ya&124)!==0||Ch(l,t,a)}return a}function Ch(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=He.updateQueue,t===null?(t=Wc(),He.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function Th(e,t,a,l){t.value=a,t.getSnapshot=l,Ah(t)&&Rh(e)}function Mh(e,t,a){return a(function(){Ah(t)&&Rh(e)})}function Ah(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!It(e,a)}catch{return!0}}function Rh(e){var t=Ms(e,2);t!==null&&an(t,e,2)}function Ic(e){var t=Zt();if(typeof e=="function"){var a=e;if(e=a(),ss){pt(!0);try{a()}finally{pt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gn,lastRenderedState:e},t}function zh(e,t,a,l){return e.baseState=a,Kc(e,Je,typeof l=="function"?l:Gn)}function gb(e,t,a,l,c){if(Ro(e))throw Error(i(485));if(e=t.action,e!==null){var d={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(y){d.listeners.push(y)}};k.T!==null?a(!0):d.isTransition=!1,l(d),a=t.pending,a===null?(d.next=t.pending=d,Oh(t,d)):(d.next=a.next,t.pending=a.next=d)}}function Oh(e,t){var a=t.action,l=t.payload,c=e.state;if(t.isTransition){var d=k.T,y={};k.T=y;try{var w=a(c,l),z=k.S;z!==null&&z(y,w),Dh(e,t,w)}catch(J){Fc(e,t,J)}finally{k.T=d}}else try{d=a(c,l),Dh(e,t,d)}catch(J){Fc(e,t,J)}}function Dh(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(l){Hh(e,t,l)},function(l){return Fc(e,t,l)}):Hh(e,t,a)}function Hh(e,t,a){t.status="fulfilled",t.value=a,$h(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,Oh(e,a)))}function Fc(e,t,a){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=a,$h(t),t=t.next;while(t!==l)}e.action=null}function $h(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Uh(e,t){return t}function Bh(e,t){if(Ze){var a=et.formState;if(a!==null){e:{var l=He;if(Ze){if(it){t:{for(var c=it,d=Cn;c.nodeType!==8;){if(!d){c=null;break t}if(c=Nn(c.nextSibling),c===null){c=null;break t}}d=c.data,c=d==="F!"||d==="F"?c:null}if(c){it=Nn(c.nextSibling),l=c.data==="F!";break e}}es(l)}l=!1}l&&(t=a[0])}}return a=Zt(),a.memoizedState=a.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Uh,lastRenderedState:t},a.queue=l,a=sx.bind(null,He,l),l.dispatch=a,l=Ic(!1),d=au.bind(null,He,!1,l.queue),l=Zt(),c={state:t,dispatch:null,action:e,pending:null},l.queue=c,a=gb.bind(null,He,c,d,a),c.dispatch=a,l.memoizedState=e,[t,a,!1]}function qh(e){var t=yt();return Lh(t,Je,e)}function Lh(e,t,a){if(t=Kc(e,t,Uh)[0],e=To(Gn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=Ql(t)}catch(y){throw y===Yl?wo:y}else l=t;t=yt();var c=t.queue,d=c.dispatch;return a!==t.memoizedState&&(He.flags|=2048,Bs(9,Mo(),yb.bind(null,c,a),null)),[l,d,e]}function yb(e,t){e.action=t}function Yh(e){var t=yt(),a=Je;if(a!==null)return Lh(t,a,e);yt(),t=t.memoizedState,a=yt();var l=a.queue.dispatch;return a.memoizedState=e,[t,l,!1]}function Bs(e,t,a,l){return e={tag:e,create:a,deps:l,inst:t,next:null},t=He.updateQueue,t===null&&(t=Wc(),He.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(l=a.next,a.next=e,e.next=l,t.lastEffect=e),e}function Mo(){return{destroy:void 0,resource:void 0}}function Vh(){return yt().memoizedState}function Ao(e,t,a,l){var c=Zt();l=l===void 0?null:l,He.flags|=e,c.memoizedState=Bs(1|t,Mo(),a,l)}function Kl(e,t,a,l){var c=yt();l=l===void 0?null:l;var d=c.memoizedState.inst;Je!==null&&l!==null&&Yc(l,Je.memoizedState.deps)?c.memoizedState=Bs(t,d,a,l):(He.flags|=e,c.memoizedState=Bs(1|t,d,a,l))}function Gh(e,t){Ao(8390656,8,e,t)}function Xh(e,t){Kl(2048,8,e,t)}function Zh(e,t){return Kl(4,2,e,t)}function Wh(e,t){return Kl(4,4,e,t)}function Qh(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Kh(e,t,a){a=a!=null?a.concat([e]):null,Kl(4,4,Qh.bind(null,t,e),a)}function Pc(){}function Jh(e,t){var a=yt();t=t===void 0?null:t;var l=a.memoizedState;return t!==null&&Yc(t,l[1])?l[0]:(a.memoizedState=[e,t],e)}function Ih(e,t){var a=yt();t=t===void 0?null:t;var l=a.memoizedState;if(t!==null&&Yc(t,l[1]))return l[0];if(l=e(),ss){pt(!0);try{e()}finally{pt(!1)}}return a.memoizedState=[l,t],l}function eu(e,t,a){return a===void 0||(ya&1073741824)!==0?e.memoizedState=t:(e.memoizedState=a,e=ep(),He.lanes|=e,Ea|=e,a)}function Fh(e,t,a,l){return It(a,t)?a:Hs.current!==null?(e=eu(e,a,l),It(e,t)||(St=!0),e):(ya&42)===0?(St=!0,e.memoizedState=a):(e=ep(),He.lanes|=e,Ea|=e,t)}function Ph(e,t,a,l,c){var d=H.p;H.p=d!==0&&8>d?d:8;var y=k.T,w={};k.T=w,au(e,!1,t,a);try{var z=c(),J=k.S;if(J!==null&&J(w,z),z!==null&&typeof z=="object"&&typeof z.then=="function"){var ce=xb(z,l);Jl(e,t,ce,nn(e))}else Jl(e,t,l,nn(e))}catch(fe){Jl(e,t,{then:function(){},status:"rejected",reason:fe},nn())}finally{H.p=d,k.T=y}}function bb(){}function tu(e,t,a,l){if(e.tag!==5)throw Error(i(476));var c=ex(e).queue;Ph(e,c,t,D,a===null?bb:function(){return tx(e),a(l)})}function ex(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:D,baseState:D,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gn,lastRenderedState:D},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gn,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function tx(e){var t=ex(e).next.queue;Jl(e,t,{},nn())}function nu(){return Bt(xr)}function nx(){return yt().memoizedState}function ax(){return yt().memoizedState}function vb(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=nn();e=ma(a);var l=ga(t,e,a);l!==null&&(an(l,t,a),Gl(l,t,a)),t={cache:Rc()},e.payload=t;return}t=t.return}}function jb(e,t,a){var l=nn();a={lane:l,revertLane:0,action:a,hasEagerState:!1,eagerState:null,next:null},Ro(e)?lx(t,a):(a=Nc(e,t,a,l),a!==null&&(an(a,e,l),rx(a,t,l)))}function sx(e,t,a){var l=nn();Jl(e,t,a,l)}function Jl(e,t,a,l){var c={lane:l,revertLane:0,action:a,hasEagerState:!1,eagerState:null,next:null};if(Ro(e))lx(t,c);else{var d=e.alternate;if(e.lanes===0&&(d===null||d.lanes===0)&&(d=t.lastRenderedReducer,d!==null))try{var y=t.lastRenderedState,w=d(y,a);if(c.hasEagerState=!0,c.eagerState=w,It(w,y))return po(e,t,c,0),et===null&&xo(),!1}catch{}finally{}if(a=Nc(e,t,c,l),a!==null)return an(a,e,l),rx(a,t,l),!0}return!1}function au(e,t,a,l){if(l={lane:2,revertLane:Du(),action:l,hasEagerState:!1,eagerState:null,next:null},Ro(e)){if(t)throw Error(i(479))}else t=Nc(e,a,l,2),t!==null&&an(t,e,2)}function Ro(e){var t=e.alternate;return e===He||t!==null&&t===He}function lx(e,t){$s=ko=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function rx(e,t,a){if((a&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,a|=l,t.lanes=a,Kr(e,a)}}var zo={readContext:Bt,use:Co,useCallback:ft,useContext:ft,useEffect:ft,useImperativeHandle:ft,useLayoutEffect:ft,useInsertionEffect:ft,useMemo:ft,useReducer:ft,useRef:ft,useState:ft,useDebugValue:ft,useDeferredValue:ft,useTransition:ft,useSyncExternalStore:ft,useId:ft,useHostTransitionStatus:ft,useFormState:ft,useActionState:ft,useOptimistic:ft,useMemoCache:ft,useCacheRefresh:ft},ox={readContext:Bt,use:Co,useCallback:function(e,t){return Zt().memoizedState=[e,t===void 0?null:t],e},useContext:Bt,useEffect:Gh,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,Ao(4194308,4,Qh.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Ao(4194308,4,e,t)},useInsertionEffect:function(e,t){Ao(4,2,e,t)},useMemo:function(e,t){var a=Zt();t=t===void 0?null:t;var l=e();if(ss){pt(!0);try{e()}finally{pt(!1)}}return a.memoizedState=[l,t],l},useReducer:function(e,t,a){var l=Zt();if(a!==void 0){var c=a(t);if(ss){pt(!0);try{a(t)}finally{pt(!1)}}}else c=t;return l.memoizedState=l.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},l.queue=e,e=e.dispatch=jb.bind(null,He,e),[l.memoizedState,e]},useRef:function(e){var t=Zt();return e={current:e},t.memoizedState=e},useState:function(e){e=Ic(e);var t=e.queue,a=sx.bind(null,He,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Pc,useDeferredValue:function(e,t){var a=Zt();return eu(a,e,t)},useTransition:function(){var e=Ic(!1);return e=Ph.bind(null,He,e.queue,!0,!1),Zt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var l=He,c=Zt();if(Ze){if(a===void 0)throw Error(i(407));a=a()}else{if(a=t(),et===null)throw Error(i(349));(Ye&124)!==0||Ch(l,t,a)}c.memoizedState=a;var d={value:a,getSnapshot:t};return c.queue=d,Gh(Mh.bind(null,l,d,e),[e]),l.flags|=2048,Bs(9,Mo(),Th.bind(null,l,d,a,t),null),a},useId:function(){var e=Zt(),t=et.identifierPrefix;if(Ze){var a=Ln,l=qn;a=(l&~(1<<32-at(l)-1)).toString(32)+a,t="«"+t+"R"+a,a=_o++,0<a&&(t+="H"+a.toString(32)),t+="»"}else a=pb++,t="«"+t+"r"+a.toString(32)+"»";return e.memoizedState=t},useHostTransitionStatus:nu,useFormState:Bh,useActionState:Bh,useOptimistic:function(e){var t=Zt();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=au.bind(null,He,!0,a),a.dispatch=t,[e,t]},useMemoCache:Qc,useCacheRefresh:function(){return Zt().memoizedState=vb.bind(null,He)}},ix={readContext:Bt,use:Co,useCallback:Jh,useContext:Bt,useEffect:Xh,useImperativeHandle:Kh,useInsertionEffect:Zh,useLayoutEffect:Wh,useMemo:Ih,useReducer:To,useRef:Vh,useState:function(){return To(Gn)},useDebugValue:Pc,useDeferredValue:function(e,t){var a=yt();return Fh(a,Je.memoizedState,e,t)},useTransition:function(){var e=To(Gn)[0],t=yt().memoizedState;return[typeof e=="boolean"?e:Ql(e),t]},useSyncExternalStore:_h,useId:nx,useHostTransitionStatus:nu,useFormState:qh,useActionState:qh,useOptimistic:function(e,t){var a=yt();return zh(a,Je,e,t)},useMemoCache:Qc,useCacheRefresh:ax},Nb={readContext:Bt,use:Co,useCallback:Jh,useContext:Bt,useEffect:Xh,useImperativeHandle:Kh,useInsertionEffect:Zh,useLayoutEffect:Wh,useMemo:Ih,useReducer:Jc,useRef:Vh,useState:function(){return Jc(Gn)},useDebugValue:Pc,useDeferredValue:function(e,t){var a=yt();return Je===null?eu(a,e,t):Fh(a,Je.memoizedState,e,t)},useTransition:function(){var e=Jc(Gn)[0],t=yt().memoizedState;return[typeof e=="boolean"?e:Ql(e),t]},useSyncExternalStore:_h,useId:nx,useHostTransitionStatus:nu,useFormState:Yh,useActionState:Yh,useOptimistic:function(e,t){var a=yt();return Je!==null?zh(a,Je,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Qc,useCacheRefresh:ax},qs=null,Il=0;function Oo(e){var t=Il;return Il+=1,qs===null&&(qs=[]),bh(qs,e,t)}function Fl(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Do(e,t){throw t.$$typeof===b?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function cx(e){var t=e._init;return t(e._payload)}function ux(e){function t(Z,B){if(e){var Q=Z.deletions;Q===null?(Z.deletions=[B],Z.flags|=16):Q.push(B)}}function a(Z,B){if(!e)return null;for(;B!==null;)t(Z,B),B=B.sibling;return null}function l(Z){for(var B=new Map;Z!==null;)Z.key!==null?B.set(Z.key,Z):B.set(Z.index,Z),Z=Z.sibling;return B}function c(Z,B){return Z=Bn(Z,B),Z.index=0,Z.sibling=null,Z}function d(Z,B,Q){return Z.index=Q,e?(Q=Z.alternate,Q!==null?(Q=Q.index,Q<B?(Z.flags|=67108866,B):Q):(Z.flags|=67108866,B)):(Z.flags|=1048576,B)}function y(Z){return e&&Z.alternate===null&&(Z.flags|=67108866),Z}function w(Z,B,Q,de){return B===null||B.tag!==6?(B=Sc(Q,Z.mode,de),B.return=Z,B):(B=c(B,Q),B.return=Z,B)}function z(Z,B,Q,de){var ye=Q.type;return ye===C?ce(Z,B,Q.props.children,de,Q.key):B!==null&&(B.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===le&&cx(ye)===B.type)?(B=c(B,Q.props),Fl(B,Q),B.return=Z,B):(B=go(Q.type,Q.key,Q.props,null,Z.mode,de),Fl(B,Q),B.return=Z,B)}function J(Z,B,Q,de){return B===null||B.tag!==4||B.stateNode.containerInfo!==Q.containerInfo||B.stateNode.implementation!==Q.implementation?(B=Ec(Q,Z.mode,de),B.return=Z,B):(B=c(B,Q.children||[]),B.return=Z,B)}function ce(Z,B,Q,de,ye){return B===null||B.tag!==7?(B=Ja(Q,Z.mode,de,ye),B.return=Z,B):(B=c(B,Q),B.return=Z,B)}function fe(Z,B,Q){if(typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint")return B=Sc(""+B,Z.mode,Q),B.return=Z,B;if(typeof B=="object"&&B!==null){switch(B.$$typeof){case v:return Q=go(B.type,B.key,B.props,null,Z.mode,Q),Fl(Q,B),Q.return=Z,Q;case N:return B=Ec(B,Z.mode,Q),B.return=Z,B;case le:var de=B._init;return B=de(B._payload),fe(Z,B,Q)}if(U(B)||ee(B))return B=Ja(B,Z.mode,Q,null),B.return=Z,B;if(typeof B.then=="function")return fe(Z,Oo(B),Q);if(B.$$typeof===L)return fe(Z,jo(Z,B),Q);Do(Z,B)}return null}function F(Z,B,Q,de){var ye=B!==null?B.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return ye!==null?null:w(Z,B,""+Q,de);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case v:return Q.key===ye?z(Z,B,Q,de):null;case N:return Q.key===ye?J(Z,B,Q,de):null;case le:return ye=Q._init,Q=ye(Q._payload),F(Z,B,Q,de)}if(U(Q)||ee(Q))return ye!==null?null:ce(Z,B,Q,de,null);if(typeof Q.then=="function")return F(Z,B,Oo(Q),de);if(Q.$$typeof===L)return F(Z,B,jo(Z,Q),de);Do(Z,Q)}return null}function te(Z,B,Q,de,ye){if(typeof de=="string"&&de!==""||typeof de=="number"||typeof de=="bigint")return Z=Z.get(Q)||null,w(B,Z,""+de,ye);if(typeof de=="object"&&de!==null){switch(de.$$typeof){case v:return Z=Z.get(de.key===null?Q:de.key)||null,z(B,Z,de,ye);case N:return Z=Z.get(de.key===null?Q:de.key)||null,J(B,Z,de,ye);case le:var $e=de._init;return de=$e(de._payload),te(Z,B,Q,de,ye)}if(U(de)||ee(de))return Z=Z.get(Q)||null,ce(B,Z,de,ye,null);if(typeof de.then=="function")return te(Z,B,Q,Oo(de),ye);if(de.$$typeof===L)return te(Z,B,Q,jo(B,de),ye);Do(B,de)}return null}function Me(Z,B,Q,de){for(var ye=null,$e=null,Ne=B,Ce=B=0,kt=null;Ne!==null&&Ce<Q.length;Ce++){Ne.index>Ce?(kt=Ne,Ne=null):kt=Ne.sibling;var Xe=F(Z,Ne,Q[Ce],de);if(Xe===null){Ne===null&&(Ne=kt);break}e&&Ne&&Xe.alternate===null&&t(Z,Ne),B=d(Xe,B,Ce),$e===null?ye=Xe:$e.sibling=Xe,$e=Xe,Ne=kt}if(Ce===Q.length)return a(Z,Ne),Ze&&Fa(Z,Ce),ye;if(Ne===null){for(;Ce<Q.length;Ce++)Ne=fe(Z,Q[Ce],de),Ne!==null&&(B=d(Ne,B,Ce),$e===null?ye=Ne:$e.sibling=Ne,$e=Ne);return Ze&&Fa(Z,Ce),ye}for(Ne=l(Ne);Ce<Q.length;Ce++)kt=te(Ne,Z,Ce,Q[Ce],de),kt!==null&&(e&&kt.alternate!==null&&Ne.delete(kt.key===null?Ce:kt.key),B=d(kt,B,Ce),$e===null?ye=kt:$e.sibling=kt,$e=kt);return e&&Ne.forEach(function(Oa){return t(Z,Oa)}),Ze&&Fa(Z,Ce),ye}function _e(Z,B,Q,de){if(Q==null)throw Error(i(151));for(var ye=null,$e=null,Ne=B,Ce=B=0,kt=null,Xe=Q.next();Ne!==null&&!Xe.done;Ce++,Xe=Q.next()){Ne.index>Ce?(kt=Ne,Ne=null):kt=Ne.sibling;var Oa=F(Z,Ne,Xe.value,de);if(Oa===null){Ne===null&&(Ne=kt);break}e&&Ne&&Oa.alternate===null&&t(Z,Ne),B=d(Oa,B,Ce),$e===null?ye=Oa:$e.sibling=Oa,$e=Oa,Ne=kt}if(Xe.done)return a(Z,Ne),Ze&&Fa(Z,Ce),ye;if(Ne===null){for(;!Xe.done;Ce++,Xe=Q.next())Xe=fe(Z,Xe.value,de),Xe!==null&&(B=d(Xe,B,Ce),$e===null?ye=Xe:$e.sibling=Xe,$e=Xe);return Ze&&Fa(Z,Ce),ye}for(Ne=l(Ne);!Xe.done;Ce++,Xe=Q.next())Xe=te(Ne,Z,Ce,Xe.value,de),Xe!==null&&(e&&Xe.alternate!==null&&Ne.delete(Xe.key===null?Ce:Xe.key),B=d(Xe,B,Ce),$e===null?ye=Xe:$e.sibling=Xe,$e=Xe);return e&&Ne.forEach(function(wv){return t(Z,wv)}),Ze&&Fa(Z,Ce),ye}function Fe(Z,B,Q,de){if(typeof Q=="object"&&Q!==null&&Q.type===C&&Q.key===null&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case v:e:{for(var ye=Q.key;B!==null;){if(B.key===ye){if(ye=Q.type,ye===C){if(B.tag===7){a(Z,B.sibling),de=c(B,Q.props.children),de.return=Z,Z=de;break e}}else if(B.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===le&&cx(ye)===B.type){a(Z,B.sibling),de=c(B,Q.props),Fl(de,Q),de.return=Z,Z=de;break e}a(Z,B);break}else t(Z,B);B=B.sibling}Q.type===C?(de=Ja(Q.props.children,Z.mode,de,Q.key),de.return=Z,Z=de):(de=go(Q.type,Q.key,Q.props,null,Z.mode,de),Fl(de,Q),de.return=Z,Z=de)}return y(Z);case N:e:{for(ye=Q.key;B!==null;){if(B.key===ye)if(B.tag===4&&B.stateNode.containerInfo===Q.containerInfo&&B.stateNode.implementation===Q.implementation){a(Z,B.sibling),de=c(B,Q.children||[]),de.return=Z,Z=de;break e}else{a(Z,B);break}else t(Z,B);B=B.sibling}de=Ec(Q,Z.mode,de),de.return=Z,Z=de}return y(Z);case le:return ye=Q._init,Q=ye(Q._payload),Fe(Z,B,Q,de)}if(U(Q))return Me(Z,B,Q,de);if(ee(Q)){if(ye=ee(Q),typeof ye!="function")throw Error(i(150));return Q=ye.call(Q),_e(Z,B,Q,de)}if(typeof Q.then=="function")return Fe(Z,B,Oo(Q),de);if(Q.$$typeof===L)return Fe(Z,B,jo(Z,Q),de);Do(Z,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,B!==null&&B.tag===6?(a(Z,B.sibling),de=c(B,Q),de.return=Z,Z=de):(a(Z,B),de=Sc(Q,Z.mode,de),de.return=Z,Z=de),y(Z)):a(Z,B)}return function(Z,B,Q,de){try{Il=0;var ye=Fe(Z,B,Q,de);return qs=null,ye}catch(Ne){if(Ne===Yl||Ne===wo)throw Ne;var $e=Ft(29,Ne,null,Z.mode);return $e.lanes=de,$e.return=Z,$e}finally{}}}var Ls=ux(!0),dx=ux(!1),xn=$(null),Tn=null;function ba(e){var t=e.alternate;ae(vt,vt.current&1),ae(xn,e),Tn===null&&(t===null||Hs.current!==null||t.memoizedState!==null)&&(Tn=e)}function fx(e){if(e.tag===22){if(ae(vt,vt.current),ae(xn,e),Tn===null){var t=e.alternate;t!==null&&t.memoizedState!==null&&(Tn=e)}}else va()}function va(){ae(vt,vt.current),ae(xn,xn.current)}function Xn(e){W(xn),Tn===e&&(Tn=null),W(vt)}var vt=$(0);function Ho(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||a.data==="$?"||Wu(a)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)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}function su(e,t,a,l){t=e.memoizedState,a=a(l,t),a=a==null?t:m({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var lu={enqueueSetState:function(e,t,a){e=e._reactInternals;var l=nn(),c=ma(l);c.payload=t,a!=null&&(c.callback=a),t=ga(e,c,l),t!==null&&(an(t,e,l),Gl(t,e,l))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var l=nn(),c=ma(l);c.tag=1,c.payload=t,a!=null&&(c.callback=a),t=ga(e,c,l),t!==null&&(an(t,e,l),Gl(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=nn(),l=ma(a);l.tag=2,t!=null&&(l.callback=t),t=ga(e,l,a),t!==null&&(an(t,e,a),Gl(t,e,a))}};function hx(e,t,a,l,c,d,y){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,d,y):t.prototype&&t.prototype.isPureReactComponent?!Ol(a,l)||!Ol(c,d):!0}function xx(e,t,a,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,l),t.state!==e&&lu.enqueueReplaceState(t,t.state,null)}function ls(e,t){var a=t;if("ref"in t){a={};for(var l in t)l!=="ref"&&(a[l]=t[l])}if(e=e.defaultProps){a===t&&(a=m({},a));for(var c in e)a[c]===void 0&&(a[c]=e[c])}return a}var $o=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function px(e){$o(e)}function mx(e){console.error(e)}function gx(e){$o(e)}function Uo(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function yx(e,t,a){try{var l=e.onCaughtError;l(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function ru(e,t,a){return a=ma(a),a.tag=3,a.payload={element:null},a.callback=function(){Uo(e,t)},a}function bx(e){return e=ma(e),e.tag=3,e}function vx(e,t,a,l){var c=a.type.getDerivedStateFromError;if(typeof c=="function"){var d=l.value;e.payload=function(){return c(d)},e.callback=function(){yx(t,a,l)}}var y=a.stateNode;y!==null&&typeof y.componentDidCatch=="function"&&(e.callback=function(){yx(t,a,l),typeof c!="function"&&(ka===null?ka=new Set([this]):ka.add(this));var w=l.stack;this.componentDidCatch(l.value,{componentStack:w!==null?w:""})})}function wb(e,t,a,l,c){if(a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=a.alternate,t!==null&&Bl(t,a,c,!0),a=xn.current,a!==null){switch(a.tag){case 13:return Tn===null?Mu():a.alternate===null&&ct===0&&(ct=3),a.flags&=-257,a.flags|=65536,a.lanes=c,l===Dc?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([l]):t.add(l),Ru(e,l,c)),!1;case 22:return a.flags|=65536,l===Dc?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([l]):a.add(l)),Ru(e,l,c)),!1}throw Error(i(435,a.tag))}return Ru(e,l,c),Mu(),!1}if(Ze)return t=xn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,l!==Cc&&(e=Error(i(422),{cause:l}),Ul(un(e,a)))):(l!==Cc&&(t=Error(i(423),{cause:l}),Ul(un(t,a))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,l=un(l,a),c=ru(e.stateNode,l,c),Uc(e,c),ct!==4&&(ct=2)),!1;var d=Error(i(520),{cause:l});if(d=un(d,a),lr===null?lr=[d]:lr.push(d),ct!==4&&(ct=2),t===null)return!0;l=un(l,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=c&-c,a.lanes|=e,e=ru(a.stateNode,l,e),Uc(a,e),!1;case 1:if(t=a.type,d=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(ka===null||!ka.has(d))))return a.flags|=65536,c&=-c,a.lanes|=c,c=bx(c),vx(c,e,a,l),Uc(a,c),!1}a=a.return}while(a!==null);return!1}var jx=Error(i(461)),St=!1;function zt(e,t,a,l){t.child=e===null?dx(t,null,a,l):Ls(t,e.child,a,l)}function Nx(e,t,a,l,c){a=a.render;var d=t.ref;if("ref"in l){var y={};for(var w in l)w!=="ref"&&(y[w]=l[w])}else y=l;return ns(t),l=Vc(e,t,a,y,d,c),w=Gc(),e!==null&&!St?(Xc(e,t,c),Zn(e,t,c)):(Ze&&w&&kc(t),t.flags|=1,zt(e,t,l,c),t.child)}function wx(e,t,a,l,c){if(e===null){var d=a.type;return typeof d=="function"&&!wc(d)&&d.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=d,Sx(e,t,d,l,c)):(e=go(a.type,null,l,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(d=e.child,!xu(e,c)){var y=d.memoizedProps;if(a=a.compare,a=a!==null?a:Ol,a(y,l)&&e.ref===t.ref)return Zn(e,t,c)}return t.flags|=1,e=Bn(d,l),e.ref=t.ref,e.return=t,t.child=e}function Sx(e,t,a,l,c){if(e!==null){var d=e.memoizedProps;if(Ol(d,l)&&e.ref===t.ref)if(St=!1,t.pendingProps=l=d,xu(e,c))(e.flags&131072)!==0&&(St=!0);else return t.lanes=e.lanes,Zn(e,t,c)}return ou(e,t,a,l,c)}function Ex(e,t,a){var l=t.pendingProps,c=l.children,d=e!==null?e.memoizedState:null;if(l.mode==="hidden"){if((t.flags&128)!==0){if(l=d!==null?d.baseLanes|a:a,e!==null){for(c=t.child=e.child,d=0;c!==null;)d=d|c.lanes|c.childLanes,c=c.sibling;t.childLanes=d&~l}else t.childLanes=0,t.child=null;return kx(e,t,l,a)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&No(t,d!==null?d.cachePool:null),d!==null?Sh(t,d):qc(),fx(t);else return t.lanes=t.childLanes=536870912,kx(e,t,d!==null?d.baseLanes|a:a,a)}else d!==null?(No(t,d.cachePool),Sh(t,d),va(),t.memoizedState=null):(e!==null&&No(t,null),qc(),va());return zt(e,t,c,a),t.child}function kx(e,t,a,l){var c=Oc();return c=c===null?null:{parent:bt._currentValue,pool:c},t.memoizedState={baseLanes:a,cachePool:c},e!==null&&No(t,null),qc(),fx(t),e!==null&&Bl(e,t,l,!0),null}function Bo(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(i(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function ou(e,t,a,l,c){return ns(t),a=Vc(e,t,a,l,void 0,c),l=Gc(),e!==null&&!St?(Xc(e,t,c),Zn(e,t,c)):(Ze&&l&&kc(t),t.flags|=1,zt(e,t,a,c),t.child)}function _x(e,t,a,l,c,d){return ns(t),t.updateQueue=null,a=kh(t,l,a,c),Eh(e),l=Gc(),e!==null&&!St?(Xc(e,t,d),Zn(e,t,d)):(Ze&&l&&kc(t),t.flags|=1,zt(e,t,a,d),t.child)}function Cx(e,t,a,l,c){if(ns(t),t.stateNode===null){var d=As,y=a.contextType;typeof y=="object"&&y!==null&&(d=Bt(y)),d=new a(l,d),t.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=lu,t.stateNode=d,d._reactInternals=t,d=t.stateNode,d.props=l,d.state=t.memoizedState,d.refs={},Hc(t),y=a.contextType,d.context=typeof y=="object"&&y!==null?Bt(y):As,d.state=t.memoizedState,y=a.getDerivedStateFromProps,typeof y=="function"&&(su(t,a,y,l),d.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(y=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),y!==d.state&&lu.enqueueReplaceState(d,d.state,null),Zl(t,l,d,c),Xl(),d.state=t.memoizedState),typeof d.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){d=t.stateNode;var w=t.memoizedProps,z=ls(a,w);d.props=z;var J=d.context,ce=a.contextType;y=As,typeof ce=="object"&&ce!==null&&(y=Bt(ce));var fe=a.getDerivedStateFromProps;ce=typeof fe=="function"||typeof d.getSnapshotBeforeUpdate=="function",w=t.pendingProps!==w,ce||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(w||J!==y)&&xx(t,d,l,y),pa=!1;var F=t.memoizedState;d.state=F,Zl(t,l,d,c),Xl(),J=t.memoizedState,w||F!==J||pa?(typeof fe=="function"&&(su(t,a,fe,l),J=t.memoizedState),(z=pa||hx(t,a,z,l,F,J,y))?(ce||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount()),typeof d.componentDidMount=="function"&&(t.flags|=4194308)):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=J),d.props=l,d.state=J,d.context=y,l=z):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{d=t.stateNode,$c(e,t),y=t.memoizedProps,ce=ls(a,y),d.props=ce,fe=t.pendingProps,F=d.context,J=a.contextType,z=As,typeof J=="object"&&J!==null&&(z=Bt(J)),w=a.getDerivedStateFromProps,(J=typeof w=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(y!==fe||F!==z)&&xx(t,d,l,z),pa=!1,F=t.memoizedState,d.state=F,Zl(t,l,d,c),Xl();var te=t.memoizedState;y!==fe||F!==te||pa||e!==null&&e.dependencies!==null&&vo(e.dependencies)?(typeof w=="function"&&(su(t,a,w,l),te=t.memoizedState),(ce=pa||hx(t,a,ce,l,F,te,z)||e!==null&&e.dependencies!==null&&vo(e.dependencies))?(J||typeof d.UNSAFE_componentWillUpdate!="function"&&typeof d.componentWillUpdate!="function"||(typeof d.componentWillUpdate=="function"&&d.componentWillUpdate(l,te,z),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(l,te,z)),typeof d.componentDidUpdate=="function"&&(t.flags|=4),typeof d.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof d.componentDidUpdate!="function"||y===e.memoizedProps&&F===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&F===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=te),d.props=l,d.state=te,d.context=z,l=ce):(typeof d.componentDidUpdate!="function"||y===e.memoizedProps&&F===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&F===e.memoizedState||(t.flags|=1024),l=!1)}return d=l,Bo(e,t),l=(t.flags&128)!==0,d||l?(d=t.stateNode,a=l&&typeof a.getDerivedStateFromError!="function"?null:d.render(),t.flags|=1,e!==null&&l?(t.child=Ls(t,e.child,null,c),t.child=Ls(t,null,a,c)):zt(e,t,a,c),t.memoizedState=d.state,e=t.child):e=Zn(e,t,c),e}function Tx(e,t,a,l){return $l(),t.flags|=256,zt(e,t,a,l),t.child}var iu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function cu(e){return{baseLanes:e,cachePool:mh()}}function uu(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=pn),e}function Mx(e,t,a){var l=t.pendingProps,c=!1,d=(t.flags&128)!==0,y;if((y=d)||(y=e!==null&&e.memoizedState===null?!1:(vt.current&2)!==0),y&&(c=!0,t.flags&=-129),y=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ze){if(c?ba(t):va(),Ze){var w=it,z;if(z=w){e:{for(z=w,w=Cn;z.nodeType!==8;){if(!w){w=null;break e}if(z=Nn(z.nextSibling),z===null){w=null;break e}}w=z}w!==null?(t.memoizedState={dehydrated:w,treeContext:Ia!==null?{id:qn,overflow:Ln}:null,retryLane:536870912,hydrationErrors:null},z=Ft(18,null,null,0),z.stateNode=w,z.return=t,t.child=z,Gt=t,it=null,z=!0):z=!1}z||es(t)}if(w=t.memoizedState,w!==null&&(w=w.dehydrated,w!==null))return Wu(w)?t.lanes=32:t.lanes=536870912,null;Xn(t)}return w=l.children,l=l.fallback,c?(va(),c=t.mode,w=qo({mode:"hidden",children:w},c),l=Ja(l,c,a,null),w.return=t,l.return=t,w.sibling=l,t.child=w,c=t.child,c.memoizedState=cu(a),c.childLanes=uu(e,y,a),t.memoizedState=iu,l):(ba(t),du(t,w))}if(z=e.memoizedState,z!==null&&(w=z.dehydrated,w!==null)){if(d)t.flags&256?(ba(t),t.flags&=-257,t=fu(e,t,a)):t.memoizedState!==null?(va(),t.child=e.child,t.flags|=128,t=null):(va(),c=l.fallback,w=t.mode,l=qo({mode:"visible",children:l.children},w),c=Ja(c,w,a,null),c.flags|=2,l.return=t,c.return=t,l.sibling=c,t.child=l,Ls(t,e.child,null,a),l=t.child,l.memoizedState=cu(a),l.childLanes=uu(e,y,a),t.memoizedState=iu,t=c);else if(ba(t),Wu(w)){if(y=w.nextSibling&&w.nextSibling.dataset,y)var J=y.dgst;y=J,l=Error(i(419)),l.stack="",l.digest=y,Ul({value:l,source:null,stack:null}),t=fu(e,t,a)}else if(St||Bl(e,t,a,!1),y=(a&e.childLanes)!==0,St||y){if(y=et,y!==null&&(l=a&-a,l=(l&42)!==0?1:Nl(l),l=(l&(y.suspendedLanes|a))!==0?0:l,l!==0&&l!==z.retryLane))throw z.retryLane=l,Ms(e,l),an(y,e,l),jx;w.data==="$?"||Mu(),t=fu(e,t,a)}else w.data==="$?"?(t.flags|=192,t.child=e.child,t=null):(e=z.treeContext,it=Nn(w.nextSibling),Gt=t,Ze=!0,Pa=null,Cn=!1,e!==null&&(fn[hn++]=qn,fn[hn++]=Ln,fn[hn++]=Ia,qn=e.id,Ln=e.overflow,Ia=t),t=du(t,l.children),t.flags|=4096);return t}return c?(va(),c=l.fallback,w=t.mode,z=e.child,J=z.sibling,l=Bn(z,{mode:"hidden",children:l.children}),l.subtreeFlags=z.subtreeFlags&65011712,J!==null?c=Bn(J,c):(c=Ja(c,w,a,null),c.flags|=2),c.return=t,l.return=t,l.sibling=c,t.child=l,l=c,c=t.child,w=e.child.memoizedState,w===null?w=cu(a):(z=w.cachePool,z!==null?(J=bt._currentValue,z=z.parent!==J?{parent:J,pool:J}:z):z=mh(),w={baseLanes:w.baseLanes|a,cachePool:z}),c.memoizedState=w,c.childLanes=uu(e,y,a),t.memoizedState=iu,l):(ba(t),a=e.child,e=a.sibling,a=Bn(a,{mode:"visible",children:l.children}),a.return=t,a.sibling=null,e!==null&&(y=t.deletions,y===null?(t.deletions=[e],t.flags|=16):y.push(e)),t.child=a,t.memoizedState=null,a)}function du(e,t){return t=qo({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function qo(e,t){return e=Ft(22,e,null,t),e.lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function fu(e,t,a){return Ls(t,e.child,null,a),e=du(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Ax(e,t,a){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),Mc(e.return,t,a)}function hu(e,t,a,l,c){var d=e.memoizedState;d===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:a,tailMode:c}:(d.isBackwards=t,d.rendering=null,d.renderingStartTime=0,d.last=l,d.tail=a,d.tailMode=c)}function Rx(e,t,a){var l=t.pendingProps,c=l.revealOrder,d=l.tail;if(zt(e,t,l.children,a),l=vt.current,(l&2)!==0)l=l&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ax(e,a,t);else if(e.tag===19)Ax(e,a,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}l&=1}switch(ae(vt,l),c){case"forwards":for(a=t.child,c=null;a!==null;)e=a.alternate,e!==null&&Ho(e)===null&&(c=a),a=a.sibling;a=c,a===null?(c=t.child,t.child=null):(c=a.sibling,a.sibling=null),hu(t,!1,c,a,d);break;case"backwards":for(a=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&Ho(e)===null){t.child=c;break}e=c.sibling,c.sibling=a,a=c,c=e}hu(t,!0,a,null,d);break;case"together":hu(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Zn(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Ea|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(Bl(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,a=Bn(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Bn(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function xu(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&vo(e)))}function Sb(e,t,a){switch(t.tag){case 3:ve(t,t.stateNode.containerInfo),xa(t,bt,e.memoizedState.cache),$l();break;case 27:case 5:Re(t);break;case 4:ve(t,t.stateNode.containerInfo);break;case 10:xa(t,t.type,t.memoizedProps.value);break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(ba(t),t.flags|=128,null):(a&t.child.childLanes)!==0?Mx(e,t,a):(ba(t),e=Zn(e,t,a),e!==null?e.sibling:null);ba(t);break;case 19:var c=(e.flags&128)!==0;if(l=(a&t.childLanes)!==0,l||(Bl(e,t,a,!1),l=(a&t.childLanes)!==0),c){if(l)return Rx(e,t,a);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),ae(vt,vt.current),l)break;return null;case 22:case 23:return t.lanes=0,Ex(e,t,a);case 24:xa(t,bt,e.memoizedState.cache)}return Zn(e,t,a)}function zx(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)St=!0;else{if(!xu(e,a)&&(t.flags&128)===0)return St=!1,Sb(e,t,a);St=(e.flags&131072)!==0}else St=!1,Ze&&(t.flags&1048576)!==0&&ch(t,bo,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var l=t.elementType,c=l._init;if(l=c(l._payload),t.type=l,typeof l=="function")wc(l)?(e=ls(l,e),t.tag=1,t=Cx(null,t,l,e,a)):(t.tag=0,t=ou(null,t,l,e,a));else{if(l!=null){if(c=l.$$typeof,c===T){t.tag=11,t=Nx(null,t,l,e,a);break e}else if(c===X){t.tag=14,t=wx(null,t,l,e,a);break e}}throw t=S(l)||l,Error(i(306,t,""))}}return t;case 0:return ou(e,t,t.type,t.pendingProps,a);case 1:return l=t.type,c=ls(l,t.pendingProps),Cx(e,t,l,c,a);case 3:e:{if(ve(t,t.stateNode.containerInfo),e===null)throw Error(i(387));l=t.pendingProps;var d=t.memoizedState;c=d.element,$c(e,t),Zl(t,l,null,a);var y=t.memoizedState;if(l=y.cache,xa(t,bt,l),l!==d.cache&&Ac(t,[bt],a,!0),Xl(),l=y.element,d.isDehydrated)if(d={element:l,isDehydrated:!1,cache:y.cache},t.updateQueue.baseState=d,t.memoizedState=d,t.flags&256){t=Tx(e,t,l,a);break e}else if(l!==c){c=un(Error(i(424)),t),Ul(c),t=Tx(e,t,l,a);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(it=Nn(e.firstChild),Gt=t,Ze=!0,Pa=null,Cn=!0,a=dx(t,null,l,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if($l(),l===c){t=Zn(e,t,a);break e}zt(e,t,l,a)}t=t.child}return t;case 26:return Bo(e,t),e===null?(a=$p(t.type,null,t.pendingProps,null))?t.memoizedState=a:Ze||(a=t.type,e=t.pendingProps,l=ei(xe.current).createElement(a),l[wt]=t,l[Ut]=e,Dt(l,a,e),mt(l),t.stateNode=l):t.memoizedState=$p(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Re(t),e===null&&Ze&&(l=t.stateNode=Op(t.type,t.pendingProps,xe.current),Gt=t,Cn=!0,c=it,Ta(t.type)?(Qu=c,it=Nn(l.firstChild)):it=c),zt(e,t,t.pendingProps.children,a),Bo(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ze&&((c=l=it)&&(l=Fb(l,t.type,t.pendingProps,Cn),l!==null?(t.stateNode=l,Gt=t,it=Nn(l.firstChild),Cn=!1,c=!0):c=!1),c||es(t)),Re(t),c=t.type,d=t.pendingProps,y=e!==null?e.memoizedProps:null,l=d.children,Gu(c,d)?l=null:y!==null&&Gu(c,y)&&(t.flags|=32),t.memoizedState!==null&&(c=Vc(e,t,mb,null,null,a),xr._currentValue=c),Bo(e,t),zt(e,t,l,a),t.child;case 6:return e===null&&Ze&&((e=a=it)&&(a=Pb(a,t.pendingProps,Cn),a!==null?(t.stateNode=a,Gt=t,it=null,e=!0):e=!1),e||es(t)),null;case 13:return Mx(e,t,a);case 4:return ve(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=Ls(t,null,l,a):zt(e,t,l,a),t.child;case 11:return Nx(e,t,t.type,t.pendingProps,a);case 7:return zt(e,t,t.pendingProps,a),t.child;case 8:return zt(e,t,t.pendingProps.children,a),t.child;case 12:return zt(e,t,t.pendingProps.children,a),t.child;case 10:return l=t.pendingProps,xa(t,t.type,l.value),zt(e,t,l.children,a),t.child;case 9:return c=t.type._context,l=t.pendingProps.children,ns(t),c=Bt(c),l=l(c),t.flags|=1,zt(e,t,l,a),t.child;case 14:return wx(e,t,t.type,t.pendingProps,a);case 15:return Sx(e,t,t.type,t.pendingProps,a);case 19:return Rx(e,t,a);case 31:return l=t.pendingProps,a=t.mode,l={mode:l.mode,children:l.children},e===null?(a=qo(l,a),a.ref=t.ref,t.child=a,a.return=t,t=a):(a=Bn(e.child,l),a.ref=t.ref,t.child=a,a.return=t,t=a),t;case 22:return Ex(e,t,a);case 24:return ns(t),l=Bt(bt),e===null?(c=Oc(),c===null&&(c=et,d=Rc(),c.pooledCache=d,d.refCount++,d!==null&&(c.pooledCacheLanes|=a),c=d),t.memoizedState={parent:l,cache:c},Hc(t),xa(t,bt,c)):((e.lanes&a)!==0&&($c(e,t),Zl(t,null,null,a),Xl()),c=e.memoizedState,d=t.memoizedState,c.parent!==l?(c={parent:l,cache:l},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),xa(t,bt,l)):(l=d.cache,xa(t,bt,l),l!==c.cache&&Ac(t,[bt],a,!0))),zt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Wn(e){e.flags|=4}function Ox(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Yp(t)){if(t=xn.current,t!==null&&((Ye&4194048)===Ye?Tn!==null:(Ye&62914560)!==Ye&&(Ye&536870912)===0||t!==Tn))throw Vl=Dc,gh;e.flags|=8192}}function Lo(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?ra():536870912,e.lanes|=t,Xs|=t)}function Pl(e,t){if(!Ze)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var l=null;a!==null;)a.alternate!==null&&(l=a),a=a.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function rt(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,l=0;if(t)for(var c=e.child;c!==null;)a|=c.lanes|c.childLanes,l|=c.subtreeFlags&65011712,l|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)a|=c.lanes|c.childLanes,l|=c.subtreeFlags,l|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=l,e.childLanes=a,t}function Eb(e,t,a){var l=t.pendingProps;switch(_c(t),t.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return rt(t),null;case 1:return rt(t),null;case 3:return a=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Vn(bt),Ae(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Hl(t)?Wn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,fh())),rt(t),null;case 26:return a=t.memoizedState,e===null?(Wn(t),a!==null?(rt(t),Ox(t,a)):(rt(t),t.flags&=-16777217)):a?a!==e.memoizedState?(Wn(t),rt(t),Ox(t,a)):(rt(t),t.flags&=-16777217):(e.memoizedProps!==l&&Wn(t),rt(t),t.flags&=-16777217),null;case 27:We(t),a=xe.current;var c=t.type;if(e!==null&&t.stateNode!=null)e.memoizedProps!==l&&Wn(t);else{if(!l){if(t.stateNode===null)throw Error(i(166));return rt(t),null}e=ie.current,Hl(t)?uh(t):(e=Op(c,l,a),t.stateNode=e,Wn(t))}return rt(t),null;case 5:if(We(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&Wn(t);else{if(!l){if(t.stateNode===null)throw Error(i(166));return rt(t),null}if(e=ie.current,Hl(t))uh(t);else{switch(c=ei(xe.current),e){case 1:e=c.createElementNS("http://www.w3.org/2000/svg",a);break;case 2:e=c.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;default:switch(a){case"svg":e=c.createElementNS("http://www.w3.org/2000/svg",a);break;case"math":e=c.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;case"script":e=c.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild);break;case"select":e=typeof l.is=="string"?c.createElement("select",{is:l.is}):c.createElement("select"),l.multiple?e.multiple=!0:l.size&&(e.size=l.size);break;default:e=typeof l.is=="string"?c.createElement(a,{is:l.is}):c.createElement(a)}}e[wt]=t,e[Ut]=l;e:for(c=t.child;c!==null;){if(c.tag===5||c.tag===6)e.appendChild(c.stateNode);else if(c.tag!==4&&c.tag!==27&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===t)break e;for(;c.sibling===null;){if(c.return===null||c.return===t)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}t.stateNode=e;e:switch(Dt(e,a,l),a){case"button":case"input":case"select":case"textarea":e=!!l.autoFocus;break e;case"img":e=!0;break e;default:e=!1}e&&Wn(t)}}return rt(t),t.flags&=-16777217,null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&Wn(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(i(166));if(e=xe.current,Hl(t)){if(e=t.stateNode,a=t.memoizedProps,l=null,c=Gt,c!==null)switch(c.tag){case 27:case 5:l=c.memoizedProps}e[wt]=t,e=!!(e.nodeValue===a||l!==null&&l.suppressHydrationWarning===!0||_p(e.nodeValue,a)),e||es(t)}else e=ei(e).createTextNode(l),e[wt]=t,t.stateNode=e}return rt(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=Hl(t),l!==null&&l.dehydrated!==null){if(e===null){if(!c)throw Error(i(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(i(317));c[wt]=t}else $l(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;rt(t),c=!1}else c=fh(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(Xn(t),t):(Xn(t),null)}if(Xn(t),(t.flags&128)!==0)return t.lanes=a,t;if(a=l!==null,e=e!==null&&e.memoizedState!==null,a){l=t.child,c=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(c=l.alternate.memoizedState.cachePool.pool);var d=null;l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(d=l.memoizedState.cachePool.pool),d!==c&&(l.flags|=2048)}return a!==e&&a&&(t.child.flags|=8192),Lo(t,t.updateQueue),rt(t),null;case 4:return Ae(),e===null&&Bu(t.stateNode.containerInfo),rt(t),null;case 10:return Vn(t.type),rt(t),null;case 19:if(W(vt),c=t.memoizedState,c===null)return rt(t),null;if(l=(t.flags&128)!==0,d=c.rendering,d===null)if(l)Pl(c,!1);else{if(ct!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(d=Ho(e),d!==null){for(t.flags|=128,Pl(c,!1),e=d.updateQueue,t.updateQueue=e,Lo(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)ih(a,e),a=a.sibling;return ae(vt,vt.current&1|2),t.child}e=e.sibling}c.tail!==null&&oe()>Go&&(t.flags|=128,l=!0,Pl(c,!1),t.lanes=4194304)}else{if(!l)if(e=Ho(d),e!==null){if(t.flags|=128,l=!0,e=e.updateQueue,t.updateQueue=e,Lo(t,e),Pl(c,!0),c.tail===null&&c.tailMode==="hidden"&&!d.alternate&&!Ze)return rt(t),null}else 2*oe()-c.renderingStartTime>Go&&a!==536870912&&(t.flags|=128,l=!0,Pl(c,!1),t.lanes=4194304);c.isBackwards?(d.sibling=t.child,t.child=d):(e=c.last,e!==null?e.sibling=d:t.child=d,c.last=d)}return c.tail!==null?(t=c.tail,c.rendering=t,c.tail=t.sibling,c.renderingStartTime=oe(),t.sibling=null,e=vt.current,ae(vt,l?e&1|2:e&1),t):(rt(t),null);case 22:case 23:return Xn(t),Lc(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(a&536870912)!==0&&(t.flags&128)===0&&(rt(t),t.subtreeFlags&6&&(t.flags|=8192)):rt(t),a=t.updateQueue,a!==null&&Lo(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==a&&(t.flags|=2048),e!==null&&W(as),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Vn(bt),rt(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function kb(e,t){switch(_c(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Vn(bt),Ae(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return We(t),null;case 13:if(Xn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));$l()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return W(vt),null;case 4:return Ae(),null;case 10:return Vn(t.type),null;case 22:case 23:return Xn(t),Lc(),e!==null&&W(as),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Vn(bt),null;case 25:return null;default:return null}}function Dx(e,t){switch(_c(t),t.tag){case 3:Vn(bt),Ae();break;case 26:case 27:case 5:We(t);break;case 4:Ae();break;case 13:Xn(t);break;case 19:W(vt);break;case 10:Vn(t.type);break;case 22:case 23:Xn(t),Lc(),e!==null&&W(as);break;case 24:Vn(bt)}}function er(e,t){try{var a=t.updateQueue,l=a!==null?a.lastEffect:null;if(l!==null){var c=l.next;a=c;do{if((a.tag&e)===e){l=void 0;var d=a.create,y=a.inst;l=d(),y.destroy=l}a=a.next}while(a!==c)}}catch(w){Pe(t,t.return,w)}}function ja(e,t,a){try{var l=t.updateQueue,c=l!==null?l.lastEffect:null;if(c!==null){var d=c.next;l=d;do{if((l.tag&e)===e){var y=l.inst,w=y.destroy;if(w!==void 0){y.destroy=void 0,c=t;var z=a,J=w;try{J()}catch(ce){Pe(c,z,ce)}}}l=l.next}while(l!==d)}}catch(ce){Pe(t,t.return,ce)}}function Hx(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{wh(t,a)}catch(l){Pe(e,e.return,l)}}}function $x(e,t,a){a.props=ls(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(l){Pe(e,t,l)}}function tr(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof a=="function"?e.refCleanup=a(l):a.current=l}}catch(c){Pe(e,t,c)}}function Mn(e,t){var a=e.ref,l=e.refCleanup;if(a!==null)if(typeof l=="function")try{l()}catch(c){Pe(e,t,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(c){Pe(e,t,c)}else a.current=null}function Ux(e){var t=e.type,a=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&l.focus();break e;case"img":a.src?l.src=a.src:a.srcSet&&(l.srcset=a.srcSet)}}catch(c){Pe(e,e.return,c)}}function pu(e,t,a){try{var l=e.stateNode;Wb(l,e.type,a,t),l[Ut]=t}catch(c){Pe(e,e.return,c)}}function Bx(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ta(e.type)||e.tag===4}function mu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Bx(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.tag===27&&Ta(e.type)||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 gu(e,t,a){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=Po));else if(l!==4&&(l===27&&Ta(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(gu(e,t,a),e=e.sibling;e!==null;)gu(e,t,a),e=e.sibling}function Yo(e,t,a){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(l!==4&&(l===27&&Ta(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(Yo(e,t,a),e=e.sibling;e!==null;)Yo(e,t,a),e=e.sibling}function qx(e){var t=e.stateNode,a=e.memoizedProps;try{for(var l=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);Dt(t,l,a),t[wt]=e,t[Ut]=a}catch(d){Pe(e,e.return,d)}}var Qn=!1,ht=!1,yu=!1,Lx=typeof WeakSet=="function"?WeakSet:Set,Et=null;function _b(e,t){if(e=e.containerInfo,Yu=ri,e=Ff(e),mc(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var l=a.getSelection&&a.getSelection();if(l&&l.rangeCount!==0){a=l.anchorNode;var c=l.anchorOffset,d=l.focusNode;l=l.focusOffset;try{a.nodeType,d.nodeType}catch{a=null;break e}var y=0,w=-1,z=-1,J=0,ce=0,fe=e,F=null;t:for(;;){for(var te;fe!==a||c!==0&&fe.nodeType!==3||(w=y+c),fe!==d||l!==0&&fe.nodeType!==3||(z=y+l),fe.nodeType===3&&(y+=fe.nodeValue.length),(te=fe.firstChild)!==null;)F=fe,fe=te;for(;;){if(fe===e)break t;if(F===a&&++J===c&&(w=y),F===d&&++ce===l&&(z=y),(te=fe.nextSibling)!==null)break;fe=F,F=fe.parentNode}fe=te}a=w===-1||z===-1?null:{start:w,end:z}}else a=null}a=a||{start:0,end:0}}else a=null;for(Vu={focusedElem:e,selectionRange:a},ri=!1,Et=t;Et!==null;)if(t=Et,e=t.child,(t.subtreeFlags&1024)!==0&&e!==null)e.return=t,Et=e;else for(;Et!==null;){switch(t=Et,d=t.alternate,e=t.flags,t.tag){case 0:break;case 11:case 15:break;case 1:if((e&1024)!==0&&d!==null){e=void 0,a=t,c=d.memoizedProps,d=d.memoizedState,l=a.stateNode;try{var Me=ls(a.type,c,a.elementType===a.type);e=l.getSnapshotBeforeUpdate(Me,d),l.__reactInternalSnapshotBeforeUpdate=e}catch(_e){Pe(a,a.return,_e)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)Zu(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Zu(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,Et=e;break}Et=t.return}}function Yx(e,t,a){var l=a.flags;switch(a.tag){case 0:case 11:case 15:Na(e,a),l&4&&er(5,a);break;case 1:if(Na(e,a),l&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(y){Pe(a,a.return,y)}else{var c=ls(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(y){Pe(a,a.return,y)}}l&64&&Hx(a),l&512&&tr(a,a.return);break;case 3:if(Na(e,a),l&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{wh(e,t)}catch(y){Pe(a,a.return,y)}}break;case 27:t===null&&l&4&&qx(a);case 26:case 5:Na(e,a),t===null&&l&4&&Ux(a),l&512&&tr(a,a.return);break;case 12:Na(e,a);break;case 13:Na(e,a),l&4&&Xx(e,a),l&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=Hb.bind(null,a),ev(e,a))));break;case 22:if(l=a.memoizedState!==null||Qn,!l){t=t!==null&&t.memoizedState!==null||ht,c=Qn;var d=ht;Qn=l,(ht=t)&&!d?wa(e,a,(a.subtreeFlags&8772)!==0):Na(e,a),Qn=c,ht=d}break;case 30:break;default:Na(e,a)}}function Vx(e){var t=e.alternate;t!==null&&(e.alternate=null,Vx(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&El(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var st=null,Wt=!1;function Kn(e,t,a){for(a=a.child;a!==null;)Gx(e,t,a),a=a.sibling}function Gx(e,t,a){if(nt&&typeof nt.onCommitFiberUnmount=="function")try{nt.onCommitFiberUnmount(dt,a)}catch{}switch(a.tag){case 26:ht||Mn(a,t),Kn(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:ht||Mn(a,t);var l=st,c=Wt;Ta(a.type)&&(st=a.stateNode,Wt=!1),Kn(e,t,a),ur(a.stateNode),st=l,Wt=c;break;case 5:ht||Mn(a,t);case 6:if(l=st,c=Wt,st=null,Kn(e,t,a),st=l,Wt=c,st!==null)if(Wt)try{(st.nodeType===9?st.body:st.nodeName==="HTML"?st.ownerDocument.body:st).removeChild(a.stateNode)}catch(d){Pe(a,t,d)}else try{st.removeChild(a.stateNode)}catch(d){Pe(a,t,d)}break;case 18:st!==null&&(Wt?(e=st,Rp(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),yr(e)):Rp(st,a.stateNode));break;case 4:l=st,c=Wt,st=a.stateNode.containerInfo,Wt=!0,Kn(e,t,a),st=l,Wt=c;break;case 0:case 11:case 14:case 15:ht||ja(2,a,t),ht||ja(4,a,t),Kn(e,t,a);break;case 1:ht||(Mn(a,t),l=a.stateNode,typeof l.componentWillUnmount=="function"&&$x(a,t,l)),Kn(e,t,a);break;case 21:Kn(e,t,a);break;case 22:ht=(l=ht)||a.memoizedState!==null,Kn(e,t,a),ht=l;break;default:Kn(e,t,a)}}function Xx(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{yr(e)}catch(a){Pe(t,t.return,a)}}function Cb(e){switch(e.tag){case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Lx),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Lx),t;default:throw Error(i(435,e.tag))}}function bu(e,t){var a=Cb(e);t.forEach(function(l){var c=$b.bind(null,e,l);a.has(l)||(a.add(l),l.then(c,c))})}function Pt(e,t){var a=t.deletions;if(a!==null)for(var l=0;l<a.length;l++){var c=a[l],d=e,y=t,w=y;e:for(;w!==null;){switch(w.tag){case 27:if(Ta(w.type)){st=w.stateNode,Wt=!1;break e}break;case 5:st=w.stateNode,Wt=!1;break e;case 3:case 4:st=w.stateNode.containerInfo,Wt=!0;break e}w=w.return}if(st===null)throw Error(i(160));Gx(d,y,c),st=null,Wt=!1,d=c.alternate,d!==null&&(d.return=null),c.return=null}if(t.subtreeFlags&13878)for(t=t.child;t!==null;)Zx(t,e),t=t.sibling}var jn=null;function Zx(e,t){var a=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Pt(t,e),en(e),l&4&&(ja(3,e,e.return),er(3,e),ja(5,e,e.return));break;case 1:Pt(t,e),en(e),l&512&&(ht||a===null||Mn(a,a.return)),l&64&&Qn&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?l:a.concat(l))));break;case 26:var c=jn;if(Pt(t,e),en(e),l&512&&(ht||a===null||Mn(a,a.return)),l&4){var d=a!==null?a.memoizedState:null;if(l=e.memoizedState,a===null)if(l===null)if(e.stateNode===null){e:{l=e.type,a=e.memoizedProps,c=c.ownerDocument||c;t:switch(l){case"title":d=c.getElementsByTagName("title")[0],(!d||d[Ga]||d[wt]||d.namespaceURI==="http://www.w3.org/2000/svg"||d.hasAttribute("itemprop"))&&(d=c.createElement(l),c.head.insertBefore(d,c.querySelector("head > title"))),Dt(d,l,a),d[wt]=e,mt(d),l=d;break e;case"link":var y=qp("link","href",c).get(l+(a.href||""));if(y){for(var w=0;w<y.length;w++)if(d=y[w],d.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&d.getAttribute("rel")===(a.rel==null?null:a.rel)&&d.getAttribute("title")===(a.title==null?null:a.title)&&d.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){y.splice(w,1);break t}}d=c.createElement(l),Dt(d,l,a),c.head.appendChild(d);break;case"meta":if(y=qp("meta","content",c).get(l+(a.content||""))){for(w=0;w<y.length;w++)if(d=y[w],d.getAttribute("content")===(a.content==null?null:""+a.content)&&d.getAttribute("name")===(a.name==null?null:a.name)&&d.getAttribute("property")===(a.property==null?null:a.property)&&d.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&d.getAttribute("charset")===(a.charSet==null?null:a.charSet)){y.splice(w,1);break t}}d=c.createElement(l),Dt(d,l,a),c.head.appendChild(d);break;default:throw Error(i(468,l))}d[wt]=e,mt(d),l=d}e.stateNode=l}else Lp(c,e.type,e.stateNode);else e.stateNode=Bp(c,l,e.memoizedProps);else d!==l?(d===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):d.count--,l===null?Lp(c,e.type,e.stateNode):Bp(c,l,e.memoizedProps)):l===null&&e.stateNode!==null&&pu(e,e.memoizedProps,a.memoizedProps)}break;case 27:Pt(t,e),en(e),l&512&&(ht||a===null||Mn(a,a.return)),a!==null&&l&4&&pu(e,e.memoizedProps,a.memoizedProps);break;case 5:if(Pt(t,e),en(e),l&512&&(ht||a===null||Mn(a,a.return)),e.flags&32){c=e.stateNode;try{ws(c,"")}catch(te){Pe(e,e.return,te)}}l&4&&e.stateNode!=null&&(c=e.memoizedProps,pu(e,c,a!==null?a.memoizedProps:c)),l&1024&&(yu=!0);break;case 6:if(Pt(t,e),en(e),l&4){if(e.stateNode===null)throw Error(i(162));l=e.memoizedProps,a=e.stateNode;try{a.nodeValue=l}catch(te){Pe(e,e.return,te)}}break;case 3:if(ai=null,c=jn,jn=ti(t.containerInfo),Pt(t,e),jn=c,en(e),l&4&&a!==null&&a.memoizedState.isDehydrated)try{yr(t.containerInfo)}catch(te){Pe(e,e.return,te)}yu&&(yu=!1,Wx(e));break;case 4:l=jn,jn=ti(e.stateNode.containerInfo),Pt(t,e),en(e),jn=l;break;case 12:Pt(t,e),en(e);break;case 13:Pt(t,e),en(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Eu=oe()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,bu(e,l)));break;case 22:c=e.memoizedState!==null;var z=a!==null&&a.memoizedState!==null,J=Qn,ce=ht;if(Qn=J||c,ht=ce||z,Pt(t,e),ht=ce,Qn=J,en(e),l&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(a===null||z||Qn||ht||rs(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){z=a=t;try{if(d=z.stateNode,c)y=d.style,typeof y.setProperty=="function"?y.setProperty("display","none","important"):y.display="none";else{w=z.stateNode;var fe=z.memoizedProps.style,F=fe!=null&&fe.hasOwnProperty("display")?fe.display:null;w.style.display=F==null||typeof F=="boolean"?"":(""+F).trim()}}catch(te){Pe(z,z.return,te)}}}else if(t.tag===6){if(a===null){z=t;try{z.stateNode.nodeValue=c?"":z.memoizedProps}catch(te){Pe(z,z.return,te)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}l&4&&(l=e.updateQueue,l!==null&&(a=l.retryQueue,a!==null&&(l.retryQueue=null,bu(e,a))));break;case 19:Pt(t,e),en(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,bu(e,l)));break;case 30:break;case 21:break;default:Pt(t,e),en(e)}}function en(e){var t=e.flags;if(t&2){try{for(var a,l=e.return;l!==null;){if(Bx(l)){a=l;break}l=l.return}if(a==null)throw Error(i(160));switch(a.tag){case 27:var c=a.stateNode,d=mu(e);Yo(e,d,c);break;case 5:var y=a.stateNode;a.flags&32&&(ws(y,""),a.flags&=-33);var w=mu(e);Yo(e,w,y);break;case 3:case 4:var z=a.stateNode.containerInfo,J=mu(e);gu(e,J,z);break;default:throw Error(i(161))}}catch(ce){Pe(e,e.return,ce)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Wx(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Wx(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Na(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Yx(e,t.alternate,t),t=t.sibling}function rs(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:ja(4,t,t.return),rs(t);break;case 1:Mn(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&$x(t,t.return,a),rs(t);break;case 27:ur(t.stateNode);case 26:case 5:Mn(t,t.return),rs(t);break;case 22:t.memoizedState===null&&rs(t);break;case 30:rs(t);break;default:rs(t)}e=e.sibling}}function wa(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,c=e,d=t,y=d.flags;switch(d.tag){case 0:case 11:case 15:wa(c,d,a),er(4,d);break;case 1:if(wa(c,d,a),l=d,c=l.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(J){Pe(l,l.return,J)}if(l=d,c=l.updateQueue,c!==null){var w=l.stateNode;try{var z=c.shared.hiddenCallbacks;if(z!==null)for(c.shared.hiddenCallbacks=null,c=0;c<z.length;c++)Nh(z[c],w)}catch(J){Pe(l,l.return,J)}}a&&y&64&&Hx(d),tr(d,d.return);break;case 27:qx(d);case 26:case 5:wa(c,d,a),a&&l===null&&y&4&&Ux(d),tr(d,d.return);break;case 12:wa(c,d,a);break;case 13:wa(c,d,a),a&&y&4&&Xx(c,d);break;case 22:d.memoizedState===null&&wa(c,d,a),tr(d,d.return);break;case 30:break;default:wa(c,d,a)}t=t.sibling}}function vu(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&ql(a))}function ju(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ql(e))}function An(e,t,a,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Qx(e,t,a,l),t=t.sibling}function Qx(e,t,a,l){var c=t.flags;switch(t.tag){case 0:case 11:case 15:An(e,t,a,l),c&2048&&er(9,t);break;case 1:An(e,t,a,l);break;case 3:An(e,t,a,l),c&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ql(e)));break;case 12:if(c&2048){An(e,t,a,l),e=t.stateNode;try{var d=t.memoizedProps,y=d.id,w=d.onPostCommit;typeof w=="function"&&w(y,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(z){Pe(t,t.return,z)}}else An(e,t,a,l);break;case 13:An(e,t,a,l);break;case 23:break;case 22:d=t.stateNode,y=t.alternate,t.memoizedState!==null?d._visibility&2?An(e,t,a,l):nr(e,t):d._visibility&2?An(e,t,a,l):(d._visibility|=2,Ys(e,t,a,l,(t.subtreeFlags&10256)!==0)),c&2048&&vu(y,t);break;case 24:An(e,t,a,l),c&2048&&ju(t.alternate,t);break;default:An(e,t,a,l)}}function Ys(e,t,a,l,c){for(c=c&&(t.subtreeFlags&10256)!==0,t=t.child;t!==null;){var d=e,y=t,w=a,z=l,J=y.flags;switch(y.tag){case 0:case 11:case 15:Ys(d,y,w,z,c),er(8,y);break;case 23:break;case 22:var ce=y.stateNode;y.memoizedState!==null?ce._visibility&2?Ys(d,y,w,z,c):nr(d,y):(ce._visibility|=2,Ys(d,y,w,z,c)),c&&J&2048&&vu(y.alternate,y);break;case 24:Ys(d,y,w,z,c),c&&J&2048&&ju(y.alternate,y);break;default:Ys(d,y,w,z,c)}t=t.sibling}}function nr(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,l=t,c=l.flags;switch(l.tag){case 22:nr(a,l),c&2048&&vu(l.alternate,l);break;case 24:nr(a,l),c&2048&&ju(l.alternate,l);break;default:nr(a,l)}t=t.sibling}}var ar=8192;function Vs(e){if(e.subtreeFlags&ar)for(e=e.child;e!==null;)Kx(e),e=e.sibling}function Kx(e){switch(e.tag){case 26:Vs(e),e.flags&ar&&e.memoizedState!==null&&hv(jn,e.memoizedState,e.memoizedProps);break;case 5:Vs(e);break;case 3:case 4:var t=jn;jn=ti(e.stateNode.containerInfo),Vs(e),jn=t;break;case 22:e.memoizedState===null&&(t=e.alternate,t!==null&&t.memoizedState!==null?(t=ar,ar=16777216,Vs(e),ar=t):Vs(e));break;default:Vs(e)}}function Jx(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function sr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var l=t[a];Et=l,Fx(l,e)}Jx(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ix(e),e=e.sibling}function Ix(e){switch(e.tag){case 0:case 11:case 15:sr(e),e.flags&2048&&ja(9,e,e.return);break;case 3:sr(e);break;case 12:sr(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Vo(e)):sr(e);break;default:sr(e)}}function Vo(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var l=t[a];Et=l,Fx(l,e)}Jx(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:ja(8,t,t.return),Vo(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Vo(t));break;default:Vo(t)}e=e.sibling}}function Fx(e,t){for(;Et!==null;){var a=Et;switch(a.tag){case 0:case 11:case 15:ja(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var l=a.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:ql(a.memoizedState.cache)}if(l=a.child,l!==null)l.return=a,Et=l;else e:for(a=e;Et!==null;){l=Et;var c=l.sibling,d=l.return;if(Vx(l),l===a){Et=null;break e}if(c!==null){c.return=d,Et=c;break e}Et=d}}}var Tb={getCacheForType:function(e){var t=Bt(bt),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a}},Mb=typeof WeakMap=="function"?WeakMap:Map,Qe=0,et=null,Be=null,Ye=0,Ke=0,tn=null,Sa=!1,Gs=!1,Nu=!1,Jn=0,ct=0,Ea=0,os=0,wu=0,pn=0,Xs=0,lr=null,Qt=null,Su=!1,Eu=0,Go=1/0,Xo=null,ka=null,Ot=0,_a=null,Zs=null,Ws=0,ku=0,_u=null,Px=null,rr=0,Cu=null;function nn(){if((Qe&2)!==0&&Ye!==0)return Ye&-Ye;if(k.T!==null){var e=Os;return e!==0?e:Du()}return Jr()}function ep(){pn===0&&(pn=(Ye&536870912)===0||Ze?ys():536870912);var e=xn.current;return e!==null&&(e.flags|=32),pn}function an(e,t,a){(e===et&&(Ke===2||Ke===9)||e.cancelPendingCommit!==null)&&(Qs(e,0),Ca(e,Ye,pn,!1)),oa(e,a),((Qe&2)===0||e!==et)&&(e===et&&((Qe&2)===0&&(os|=a),ct===4&&Ca(e,Ye,pn,!1)),Rn(e))}function tp(e,t,a){if((Qe&6)!==0)throw Error(i(327));var l=!a&&(t&124)===0&&(t&e.expiredLanes)===0||Jt(e,t),c=l?zb(e,t):Au(e,t,!0),d=l;do{if(c===0){Gs&&!l&&Ca(e,t,0,!1);break}else{if(a=e.current.alternate,d&&!Ab(a)){c=Au(e,t,!1),d=!1;continue}if(c===2){if(d=t,e.errorRecoveryDisabledLanes&d)var y=0;else y=e.pendingLanes&-536870913,y=y!==0?y:y&536870912?536870912:0;if(y!==0){t=y;e:{var w=e;c=lr;var z=w.current.memoizedState.isDehydrated;if(z&&(Qs(w,y).flags|=256),y=Au(w,y,!1),y!==2){if(Nu&&!z){w.errorRecoveryDisabledLanes|=d,os|=d,c=4;break e}d=Qt,Qt=c,d!==null&&(Qt===null?Qt=d:Qt.push.apply(Qt,d))}c=y}if(d=!1,c!==2)continue}}if(c===1){Qs(e,0),Ca(e,t,0,!0);break}e:{switch(l=e,d=c,d){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:Ca(l,t,pn,!Sa);break e;case 2:Qt=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(c=Eu+300-oe(),10<c)){if(Ca(l,t,pn,!Sa),Vt(l,0,!0)!==0)break e;l.timeoutHandle=Mp(np.bind(null,l,a,Qt,Xo,Su,t,pn,os,Xs,Sa,d,2,-0,0),c);break e}np(l,a,Qt,Xo,Su,t,pn,os,Xs,Sa,d,0,-0,0)}}break}while(!0);Rn(e)}function np(e,t,a,l,c,d,y,w,z,J,ce,fe,F,te){if(e.timeoutHandle=-1,fe=t.subtreeFlags,(fe&8192||(fe&16785408)===16785408)&&(hr={stylesheets:null,count:0,unsuspend:fv},Kx(t),fe=xv(),fe!==null)){e.cancelPendingCommit=fe(cp.bind(null,e,t,d,a,l,c,y,w,z,ce,1,F,te)),Ca(e,d,y,!J);return}cp(e,t,d,a,l,c,y,w,z)}function Ab(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var l=0;l<a.length;l++){var c=a[l],d=c.getSnapshot;c=c.value;try{if(!It(d(),c))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;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 Ca(e,t,a,l){t&=~wu,t&=~os,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var c=t;0<c;){var d=31-at(c),y=1<<d;l[d]=-1,c&=~y}a!==0&&Qr(e,a,t)}function Zo(){return(Qe&6)===0?(or(0),!1):!0}function Tu(){if(Be!==null){if(Ke===0)var e=Be.return;else e=Be,Yn=ts=null,Zc(e),qs=null,Il=0,e=Be;for(;e!==null;)Dx(e.alternate,e),e=e.return;Be=null}}function Qs(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,Kb(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),Tu(),et=e,Be=a=Bn(e.current,null),Ye=t,Ke=0,tn=null,Sa=!1,Gs=Jt(e,t),Nu=!1,Xs=pn=wu=os=Ea=ct=0,Qt=lr=null,Su=!1,(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var c=31-at(l),d=1<<c;t|=e[c],l&=~d}return Jn=t,xo(),a}function ap(e,t){He=null,k.H=zo,t===Yl||t===wo?(t=vh(),Ke=3):t===gh?(t=vh(),Ke=4):Ke=t===jx?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,tn=t,Be===null&&(ct=1,Uo(e,un(t,e.current)))}function sp(){var e=k.H;return k.H=zo,e===null?zo:e}function lp(){var e=k.A;return k.A=Tb,e}function Mu(){ct=4,Sa||(Ye&4194048)!==Ye&&xn.current!==null||(Gs=!0),(Ea&134217727)===0&&(os&134217727)===0||et===null||Ca(et,Ye,pn,!1)}function Au(e,t,a){var l=Qe;Qe|=2;var c=sp(),d=lp();(et!==e||Ye!==t)&&(Xo=null,Qs(e,t)),t=!1;var y=ct;e:do try{if(Ke!==0&&Be!==null){var w=Be,z=tn;switch(Ke){case 8:Tu(),y=6;break e;case 3:case 2:case 9:case 6:xn.current===null&&(t=!0);var J=Ke;if(Ke=0,tn=null,Ks(e,w,z,J),a&&Gs){y=0;break e}break;default:J=Ke,Ke=0,tn=null,Ks(e,w,z,J)}}Rb(),y=ct;break}catch(ce){ap(e,ce)}while(!0);return t&&e.shellSuspendCounter++,Yn=ts=null,Qe=l,k.H=c,k.A=d,Be===null&&(et=null,Ye=0,xo()),y}function Rb(){for(;Be!==null;)rp(Be)}function zb(e,t){var a=Qe;Qe|=2;var l=sp(),c=lp();et!==e||Ye!==t?(Xo=null,Go=oe()+500,Qs(e,t)):Gs=Jt(e,t);e:do try{if(Ke!==0&&Be!==null){t=Be;var d=tn;t:switch(Ke){case 1:Ke=0,tn=null,Ks(e,t,d,1);break;case 2:case 9:if(yh(d)){Ke=0,tn=null,op(t);break}t=function(){Ke!==2&&Ke!==9||et!==e||(Ke=7),Rn(e)},d.then(t,t);break e;case 3:Ke=7;break e;case 4:Ke=5;break e;case 7:yh(d)?(Ke=0,tn=null,op(t)):(Ke=0,tn=null,Ks(e,t,d,7));break;case 5:var y=null;switch(Be.tag){case 26:y=Be.memoizedState;case 5:case 27:var w=Be;if(!y||Yp(y)){Ke=0,tn=null;var z=w.sibling;if(z!==null)Be=z;else{var J=w.return;J!==null?(Be=J,Wo(J)):Be=null}break t}}Ke=0,tn=null,Ks(e,t,d,5);break;case 6:Ke=0,tn=null,Ks(e,t,d,6);break;case 8:Tu(),ct=6;break e;default:throw Error(i(462))}}Ob();break}catch(ce){ap(e,ce)}while(!0);return Yn=ts=null,k.H=l,k.A=c,Qe=a,Be!==null?0:(et=null,Ye=0,xo(),ct)}function Ob(){for(;Be!==null&&!V();)rp(Be)}function rp(e){var t=zx(e.alternate,e,Jn);e.memoizedProps=e.pendingProps,t===null?Wo(e):Be=t}function op(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=_x(a,t,t.pendingProps,t.type,void 0,Ye);break;case 11:t=_x(a,t,t.pendingProps,t.type.render,t.ref,Ye);break;case 5:Zc(t);default:Dx(a,t),t=Be=ih(t,Jn),t=zx(a,t,Jn)}e.memoizedProps=e.pendingProps,t===null?Wo(e):Be=t}function Ks(e,t,a,l){Yn=ts=null,Zc(t),qs=null,Il=0;var c=t.return;try{if(wb(e,c,t,a,Ye)){ct=1,Uo(e,un(a,e.current)),Be=null;return}}catch(d){if(c!==null)throw Be=c,d;ct=1,Uo(e,un(a,e.current)),Be=null;return}t.flags&32768?(Ze||l===1?e=!0:Gs||(Ye&536870912)!==0?e=!1:(Sa=e=!0,(l===2||l===9||l===3||l===6)&&(l=xn.current,l!==null&&l.tag===13&&(l.flags|=16384))),ip(t,e)):Wo(t)}function Wo(e){var t=e;do{if((t.flags&32768)!==0){ip(t,Sa);return}e=t.return;var a=Eb(t.alternate,t,Jn);if(a!==null){Be=a;return}if(t=t.sibling,t!==null){Be=t;return}Be=t=e}while(t!==null);ct===0&&(ct=5)}function ip(e,t){do{var a=kb(e.alternate,e);if(a!==null){a.flags&=32767,Be=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){Be=e;return}Be=e=a}while(e!==null);ct=6,Be=null}function cp(e,t,a,l,c,d,y,w,z){e.cancelPendingCommit=null;do Qo();while(Ot!==0);if((Qe&6)!==0)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(d=t.lanes|t.childLanes,d|=jc,Dn(e,a,d,y,w,z),e===et&&(Be=et=null,Ye=0),Zs=t,_a=e,Ws=a,ku=d,_u=c,Px=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Ub(ke,function(){return xp(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=k.T,k.T=null,c=H.p,H.p=2,y=Qe,Qe|=4;try{_b(e,t,a)}finally{Qe=y,H.p=c,k.T=l}}Ot=1,up(),dp(),fp()}}function up(){if(Ot===1){Ot=0;var e=_a,t=Zs,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=k.T,k.T=null;var l=H.p;H.p=2;var c=Qe;Qe|=4;try{Zx(t,e);var d=Vu,y=Ff(e.containerInfo),w=d.focusedElem,z=d.selectionRange;if(y!==w&&w&&w.ownerDocument&&If(w.ownerDocument.documentElement,w)){if(z!==null&&mc(w)){var J=z.start,ce=z.end;if(ce===void 0&&(ce=J),"selectionStart"in w)w.selectionStart=J,w.selectionEnd=Math.min(ce,w.value.length);else{var fe=w.ownerDocument||document,F=fe&&fe.defaultView||window;if(F.getSelection){var te=F.getSelection(),Me=w.textContent.length,_e=Math.min(z.start,Me),Fe=z.end===void 0?_e:Math.min(z.end,Me);!te.extend&&_e>Fe&&(y=Fe,Fe=_e,_e=y);var Z=Jf(w,_e),B=Jf(w,Fe);if(Z&&B&&(te.rangeCount!==1||te.anchorNode!==Z.node||te.anchorOffset!==Z.offset||te.focusNode!==B.node||te.focusOffset!==B.offset)){var Q=fe.createRange();Q.setStart(Z.node,Z.offset),te.removeAllRanges(),_e>Fe?(te.addRange(Q),te.extend(B.node,B.offset)):(Q.setEnd(B.node,B.offset),te.addRange(Q))}}}}for(fe=[],te=w;te=te.parentNode;)te.nodeType===1&&fe.push({element:te,left:te.scrollLeft,top:te.scrollTop});for(typeof w.focus=="function"&&w.focus(),w=0;w<fe.length;w++){var de=fe[w];de.element.scrollLeft=de.left,de.element.scrollTop=de.top}}ri=!!Yu,Vu=Yu=null}finally{Qe=c,H.p=l,k.T=a}}e.current=t,Ot=2}}function dp(){if(Ot===2){Ot=0;var e=_a,t=Zs,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=k.T,k.T=null;var l=H.p;H.p=2;var c=Qe;Qe|=4;try{Yx(e,t.alternate,t)}finally{Qe=c,H.p=l,k.T=a}}Ot=3}}function fp(){if(Ot===4||Ot===3){Ot=0,ue();var e=_a,t=Zs,a=Ws,l=Px;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Ot=5:(Ot=0,Zs=_a=null,hp(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(ka=null),wl(a),t=t.stateNode,nt&&typeof nt.onCommitFiberRoot=="function")try{nt.onCommitFiberRoot(dt,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=k.T,c=H.p,H.p=2,k.T=null;try{for(var d=e.onRecoverableError,y=0;y<l.length;y++){var w=l[y];d(w.value,{componentStack:w.stack})}}finally{k.T=t,H.p=c}}(Ws&3)!==0&&Qo(),Rn(e),c=e.pendingLanes,(a&4194090)!==0&&(c&42)!==0?e===Cu?rr++:(rr=0,Cu=e):rr=0,or(0)}}function hp(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ql(t)))}function Qo(e){return up(),dp(),fp(),xp()}function xp(){if(Ot!==5)return!1;var e=_a,t=ku;ku=0;var a=wl(Ws),l=k.T,c=H.p;try{H.p=32>a?32:a,k.T=null,a=_u,_u=null;var d=_a,y=Ws;if(Ot=0,Zs=_a=null,Ws=0,(Qe&6)!==0)throw Error(i(331));var w=Qe;if(Qe|=4,Ix(d.current),Qx(d,d.current,y,a),Qe=w,or(0,!1),nt&&typeof nt.onPostCommitFiberRoot=="function")try{nt.onPostCommitFiberRoot(dt,d)}catch{}return!0}finally{H.p=c,k.T=l,hp(e,t)}}function pp(e,t,a){t=un(a,t),t=ru(e.stateNode,t,2),e=ga(e,t,2),e!==null&&(oa(e,2),Rn(e))}function Pe(e,t,a){if(e.tag===3)pp(e,e,a);else for(;t!==null;){if(t.tag===3){pp(t,e,a);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(ka===null||!ka.has(l))){e=un(a,e),a=bx(2),l=ga(t,a,2),l!==null&&(vx(a,l,t,e),oa(l,2),Rn(l));break}}t=t.return}}function Ru(e,t,a){var l=e.pingCache;if(l===null){l=e.pingCache=new Mb;var c=new Set;l.set(t,c)}else c=l.get(t),c===void 0&&(c=new Set,l.set(t,c));c.has(a)||(Nu=!0,c.add(a),e=Db.bind(null,e,t,a),t.then(e,e))}function Db(e,t,a){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,et===e&&(Ye&a)===a&&(ct===4||ct===3&&(Ye&62914560)===Ye&&300>oe()-Eu?(Qe&2)===0&&Qs(e,0):wu|=a,Xs===Ye&&(Xs=0)),Rn(e)}function mp(e,t){t===0&&(t=ra()),e=Ms(e,t),e!==null&&(oa(e,t),Rn(e))}function Hb(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),mp(e,a)}function $b(e,t){var a=0;switch(e.tag){case 13:var l=e.stateNode,c=e.memoizedState;c!==null&&(a=c.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(i(314))}l!==null&&l.delete(t),mp(e,a)}function Ub(e,t){return be(e,t)}var Ko=null,Js=null,zu=!1,Jo=!1,Ou=!1,is=0;function Rn(e){e!==Js&&e.next===null&&(Js===null?Ko=Js=e:Js=Js.next=e),Jo=!0,zu||(zu=!0,qb())}function or(e,t){if(!Ou&&Jo){Ou=!0;do for(var a=!1,l=Ko;l!==null;){if(e!==0){var c=l.pendingLanes;if(c===0)var d=0;else{var y=l.suspendedLanes,w=l.pingedLanes;d=(1<<31-at(42|e)+1)-1,d&=c&~(y&~w),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(a=!0,vp(l,d))}else d=Ye,d=Vt(l,l===et?d:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(d&3)===0||Jt(l,d)||(a=!0,vp(l,d));l=l.next}while(a);Ou=!1}}function Bb(){gp()}function gp(){Jo=zu=!1;var e=0;is!==0&&(Qb()&&(e=is),is=0);for(var t=oe(),a=null,l=Ko;l!==null;){var c=l.next,d=yp(l,t);d===0?(l.next=null,a===null?Ko=c:a.next=c,c===null&&(Js=a)):(a=l,(e!==0||(d&3)!==0)&&(Jo=!0)),l=c}or(e)}function yp(e,t){for(var a=e.suspendedLanes,l=e.pingedLanes,c=e.expirationTimes,d=e.pendingLanes&-62914561;0<d;){var y=31-at(d),w=1<<y,z=c[y];z===-1?((w&a)===0||(w&l)!==0)&&(c[y]=jl(w,t)):z<=t&&(e.expiredLanes|=w),d&=~w}if(t=et,a=Ye,a=Vt(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,a===0||e===t&&(Ke===2||Ke===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&q(l),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Jt(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(l!==null&&q(l),wl(a)){case 2:case 8:a=ge;break;case 32:a=ke;break;case 268435456:a=ze;break;default:a=ke}return l=bp.bind(null,e),a=be(a,l),e.callbackPriority=t,e.callbackNode=a,t}return l!==null&&l!==null&&q(l),e.callbackPriority=2,e.callbackNode=null,2}function bp(e,t){if(Ot!==0&&Ot!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Qo()&&e.callbackNode!==a)return null;var l=Ye;return l=Vt(e,e===et?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(tp(e,l,t),yp(e,oe()),e.callbackNode!=null&&e.callbackNode===a?bp.bind(null,e):null)}function vp(e,t){if(Qo())return null;tp(e,t,!0)}function qb(){Jb(function(){(Qe&6)!==0?be(Ee,Bb):gp()})}function Du(){return is===0&&(is=ys()),is}function jp(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:ro(""+e)}function Np(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function Lb(e,t,a,l,c){if(t==="submit"&&a&&a.stateNode===c){var d=jp((c[Ut]||null).action),y=l.submitter;y&&(t=(t=y[Ut]||null)?jp(t.formAction):y.getAttribute("formAction"),t!==null&&(d=t,y=null));var w=new uo("action","action",null,l,c);e.push({event:w,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(is!==0){var z=y?Np(c,y):new FormData(c);tu(a,{pending:!0,data:z,method:c.method,action:d},null,z)}}else typeof d=="function"&&(w.preventDefault(),z=y?Np(c,y):new FormData(c),tu(a,{pending:!0,data:z,method:c.method,action:d},d,z))},currentTarget:c}]})}}for(var Hu=0;Hu<vc.length;Hu++){var $u=vc[Hu],Yb=$u.toLowerCase(),Vb=$u[0].toUpperCase()+$u.slice(1);vn(Yb,"on"+Vb)}vn(th,"onAnimationEnd"),vn(nh,"onAnimationIteration"),vn(ah,"onAnimationStart"),vn("dblclick","onDoubleClick"),vn("focusin","onFocus"),vn("focusout","onBlur"),vn(rb,"onTransitionRun"),vn(ob,"onTransitionStart"),vn(ib,"onTransitionCancel"),vn(sh,"onTransitionEnd"),da("onMouseEnter",["mouseout","mouseover"]),da("onMouseLeave",["mouseout","mouseover"]),da("onPointerEnter",["pointerout","pointerover"]),da("onPointerLeave",["pointerout","pointerover"]),$n("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),$n("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),$n("onBeforeInput",["compositionend","keypress","textInput","paste"]),$n("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),$n("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),$n("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ir="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(" "),Gb=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ir));function wp(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var l=e[a],c=l.event;l=l.listeners;e:{var d=void 0;if(t)for(var y=l.length-1;0<=y;y--){var w=l[y],z=w.instance,J=w.currentTarget;if(w=w.listener,z!==d&&c.isPropagationStopped())break e;d=w,c.currentTarget=J;try{d(c)}catch(ce){$o(ce)}c.currentTarget=null,d=z}else for(y=0;y<l.length;y++){if(w=l[y],z=w.instance,J=w.currentTarget,w=w.listener,z!==d&&c.isPropagationStopped())break e;d=w,c.currentTarget=J;try{d(c)}catch(ce){$o(ce)}c.currentTarget=null,d=z}}}}function qe(e,t){var a=t[Sl];a===void 0&&(a=t[Sl]=new Set);var l=e+"__bubble";a.has(l)||(Sp(t,e,2,!1),a.add(l))}function Uu(e,t,a){var l=0;t&&(l|=4),Sp(a,e,l,t)}var Io="_reactListening"+Math.random().toString(36).slice(2);function Bu(e){if(!e[Io]){e[Io]=!0,Fr.forEach(function(a){a!=="selectionchange"&&(Gb.has(a)||Uu(a,!1,e),Uu(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Io]||(t[Io]=!0,Uu("selectionchange",!1,t))}}function Sp(e,t,a,l){switch(Qp(t)){case 2:var c=gv;break;case 8:c=yv;break;default:c=Pu}a=c.bind(null,t,a,e),c=void 0,!oc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),l?c!==void 0?e.addEventListener(t,a,{capture:!0,passive:c}):e.addEventListener(t,a,!0):c!==void 0?e.addEventListener(t,a,{passive:c}):e.addEventListener(t,a,!1)}function qu(e,t,a,l,c){var d=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var y=l.tag;if(y===3||y===4){var w=l.stateNode.containerInfo;if(w===c)break;if(y===4)for(y=l.return;y!==null;){var z=y.tag;if((z===3||z===4)&&y.stateNode.containerInfo===c)return;y=y.return}for(;w!==null;){if(y=Hn(w),y===null)return;if(z=y.tag,z===5||z===6||z===26||z===27){l=d=y;continue e}w=w.parentNode}}l=l.return}Af(function(){var J=d,ce=lc(a),fe=[];e:{var F=lh.get(e);if(F!==void 0){var te=uo,Me=e;switch(e){case"keypress":if(io(a)===0)break e;case"keydown":case"keyup":te=Uy;break;case"focusin":Me="focus",te=dc;break;case"focusout":Me="blur",te=dc;break;case"beforeblur":case"afterblur":te=dc;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":te=Of;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":te=ky;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":te=Ly;break;case th:case nh:case ah:te=Ty;break;case sh:te=Vy;break;case"scroll":case"scrollend":te=Sy;break;case"wheel":te=Xy;break;case"copy":case"cut":case"paste":te=Ay;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":te=Hf;break;case"toggle":case"beforetoggle":te=Wy}var _e=(t&4)!==0,Fe=!_e&&(e==="scroll"||e==="scrollend"),Z=_e?F!==null?F+"Capture":null:F;_e=[];for(var B=J,Q;B!==null;){var de=B;if(Q=de.stateNode,de=de.tag,de!==5&&de!==26&&de!==27||Q===null||Z===null||(de=_l(B,Z),de!=null&&_e.push(cr(B,de,Q))),Fe)break;B=B.return}0<_e.length&&(F=new te(F,Me,null,a,ce),fe.push({event:F,listeners:_e}))}}if((t&7)===0){e:{if(F=e==="mouseover"||e==="pointerover",te=e==="mouseout"||e==="pointerout",F&&a!==sc&&(Me=a.relatedTarget||a.fromElement)&&(Hn(Me)||Me[ia]))break e;if((te||F)&&(F=ce.window===ce?ce:(F=ce.ownerDocument)?F.defaultView||F.parentWindow:window,te?(Me=a.relatedTarget||a.toElement,te=J,Me=Me?Hn(Me):null,Me!==null&&(Fe=f(Me),_e=Me.tag,Me!==Fe||_e!==5&&_e!==27&&_e!==6)&&(Me=null)):(te=null,Me=J),te!==Me)){if(_e=Of,de="onMouseLeave",Z="onMouseEnter",B="mouse",(e==="pointerout"||e==="pointerover")&&(_e=Hf,de="onPointerLeave",Z="onPointerEnter",B="pointer"),Fe=te==null?F:Xa(te),Q=Me==null?F:Xa(Me),F=new _e(de,B+"leave",te,a,ce),F.target=Fe,F.relatedTarget=Q,de=null,Hn(ce)===J&&(_e=new _e(Z,B+"enter",Me,a,ce),_e.target=Q,_e.relatedTarget=Fe,de=_e),Fe=de,te&&Me)t:{for(_e=te,Z=Me,B=0,Q=_e;Q;Q=Is(Q))B++;for(Q=0,de=Z;de;de=Is(de))Q++;for(;0<B-Q;)_e=Is(_e),B--;for(;0<Q-B;)Z=Is(Z),Q--;for(;B--;){if(_e===Z||Z!==null&&_e===Z.alternate)break t;_e=Is(_e),Z=Is(Z)}_e=null}else _e=null;te!==null&&Ep(fe,F,te,_e,!1),Me!==null&&Fe!==null&&Ep(fe,Fe,Me,_e,!0)}}e:{if(F=J?Xa(J):window,te=F.nodeName&&F.nodeName.toLowerCase(),te==="select"||te==="input"&&F.type==="file")var ye=Gf;else if(Yf(F))if(Xf)ye=ab;else{ye=tb;var $e=eb}else te=F.nodeName,!te||te.toLowerCase()!=="input"||F.type!=="checkbox"&&F.type!=="radio"?J&&ac(J.elementType)&&(ye=Gf):ye=nb;if(ye&&(ye=ye(e,J))){Vf(fe,ye,a,ce);break e}$e&&$e(e,F,J),e==="focusout"&&J&&F.type==="number"&&J.memoizedProps.value!=null&&nc(F,"number",F.value)}switch($e=J?Xa(J):window,e){case"focusin":(Yf($e)||$e.contentEditable==="true")&&(_s=$e,gc=J,Dl=null);break;case"focusout":Dl=gc=_s=null;break;case"mousedown":yc=!0;break;case"contextmenu":case"mouseup":case"dragend":yc=!1,Pf(fe,a,ce);break;case"selectionchange":if(lb)break;case"keydown":case"keyup":Pf(fe,a,ce)}var Ne;if(hc)e:{switch(e){case"compositionstart":var Ce="onCompositionStart";break e;case"compositionend":Ce="onCompositionEnd";break e;case"compositionupdate":Ce="onCompositionUpdate";break e}Ce=void 0}else ks?qf(e,a)&&(Ce="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Ce="onCompositionStart");Ce&&($f&&a.locale!=="ko"&&(ks||Ce!=="onCompositionStart"?Ce==="onCompositionEnd"&&ks&&(Ne=Rf()):(ha=ce,ic="value"in ha?ha.value:ha.textContent,ks=!0)),$e=Fo(J,Ce),0<$e.length&&(Ce=new Df(Ce,e,null,a,ce),fe.push({event:Ce,listeners:$e}),Ne?Ce.data=Ne:(Ne=Lf(a),Ne!==null&&(Ce.data=Ne)))),(Ne=Ky?Jy(e,a):Iy(e,a))&&(Ce=Fo(J,"onBeforeInput"),0<Ce.length&&($e=new Df("onBeforeInput","beforeinput",null,a,ce),fe.push({event:$e,listeners:Ce}),$e.data=Ne)),Lb(fe,e,J,a,ce)}wp(fe,t)})}function cr(e,t,a){return{instance:e,listener:t,currentTarget:a}}function Fo(e,t){for(var a=t+"Capture",l=[];e!==null;){var c=e,d=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||d===null||(c=_l(e,a),c!=null&&l.unshift(cr(e,c,d)),c=_l(e,t),c!=null&&l.push(cr(e,c,d))),e.tag===3)return l;e=e.return}return[]}function Is(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Ep(e,t,a,l,c){for(var d=t._reactName,y=[];a!==null&&a!==l;){var w=a,z=w.alternate,J=w.stateNode;if(w=w.tag,z!==null&&z===l)break;w!==5&&w!==26&&w!==27||J===null||(z=J,c?(J=_l(a,d),J!=null&&y.unshift(cr(a,J,z))):c||(J=_l(a,d),J!=null&&y.push(cr(a,J,z)))),a=a.return}y.length!==0&&e.push({event:t,listeners:y})}var Xb=/\r\n?/g,Zb=/\u0000|\uFFFD/g;function kp(e){return(typeof e=="string"?e:""+e).replace(Xb,`
|
|
49
|
-
`).replace(Zb,"")}function _p(e,t){return t=kp(t),kp(e)===t}function Po(){}function Ie(e,t,a,l,c,d){switch(a){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||ws(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&ws(e,""+l);break;case"className":vs(e,"class",l);break;case"tabIndex":vs(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":vs(e,a,l);break;case"style":Tf(e,l,d);break;case"data":if(t!=="object"){vs(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(a);break}l=ro(""+l),e.setAttribute(a,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof d=="function"&&(a==="formAction"?(t!=="input"&&Ie(e,t,"name",c.name,c,null),Ie(e,t,"formEncType",c.formEncType,c,null),Ie(e,t,"formMethod",c.formMethod,c,null),Ie(e,t,"formTarget",c.formTarget,c,null)):(Ie(e,t,"encType",c.encType,c,null),Ie(e,t,"method",c.method,c,null),Ie(e,t,"target",c.target,c,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(a);break}l=ro(""+l),e.setAttribute(a,l);break;case"onClick":l!=null&&(e.onclick=Po);break;case"onScroll":l!=null&&qe("scroll",e);break;case"onScrollEnd":l!=null&&qe("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(i(61));if(a=l.__html,a!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=a}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}a=ro(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,""+l):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":l===!0?e.setAttribute(a,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,l):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(a,l):e.removeAttribute(a);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(a):e.setAttribute(a,l);break;case"popover":qe("beforetoggle",e),qe("toggle",e),bs(e,"popover",l);break;case"xlinkActuate":bn(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":bn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":bn(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":bn(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":bn(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":bn(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":bn(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":bn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":bn(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":bs(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=Ny.get(a)||a,bs(e,a,l))}}function Lu(e,t,a,l,c,d){switch(a){case"style":Tf(e,l,d);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(i(61));if(a=l.__html,a!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=a}}break;case"children":typeof l=="string"?ws(e,l):(typeof l=="number"||typeof l=="bigint")&&ws(e,""+l);break;case"onScroll":l!=null&&qe("scroll",e);break;case"onScrollEnd":l!=null&&qe("scrollend",e);break;case"onClick":l!=null&&(e.onclick=Po);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Pr.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(c=a.endsWith("Capture"),t=a.slice(2,c?a.length-7:void 0),d=e[Ut]||null,d=d!=null?d[a]:null,typeof d=="function"&&e.removeEventListener(t,d,c),typeof l=="function")){typeof d!="function"&&d!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,l,c);break e}a in e?e[a]=l:l===!0?e.setAttribute(a,""):bs(e,a,l)}}}function Dt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":qe("error",e),qe("load",e);var l=!1,c=!1,d;for(d in a)if(a.hasOwnProperty(d)){var y=a[d];if(y!=null)switch(d){case"src":l=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:Ie(e,t,d,y,a,null)}}c&&Ie(e,t,"srcSet",a.srcSet,a,null),l&&Ie(e,t,"src",a.src,a,null);return;case"input":qe("invalid",e);var w=d=y=c=null,z=null,J=null;for(l in a)if(a.hasOwnProperty(l)){var ce=a[l];if(ce!=null)switch(l){case"name":c=ce;break;case"type":y=ce;break;case"checked":z=ce;break;case"defaultChecked":J=ce;break;case"value":d=ce;break;case"defaultValue":w=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(i(137,t));break;default:Ie(e,t,l,ce,a,null)}}Ef(e,d,w,z,J,y,c,!1),so(e);return;case"select":qe("invalid",e),l=y=d=null;for(c in a)if(a.hasOwnProperty(c)&&(w=a[c],w!=null))switch(c){case"value":d=w;break;case"defaultValue":y=w;break;case"multiple":l=w;default:Ie(e,t,c,w,a,null)}t=d,a=y,e.multiple=!!l,t!=null?Ns(e,!!l,t,!1):a!=null&&Ns(e,!!l,a,!0);return;case"textarea":qe("invalid",e),d=c=l=null;for(y in a)if(a.hasOwnProperty(y)&&(w=a[y],w!=null))switch(y){case"value":l=w;break;case"defaultValue":c=w;break;case"children":d=w;break;case"dangerouslySetInnerHTML":if(w!=null)throw Error(i(91));break;default:Ie(e,t,y,w,a,null)}_f(e,l,c,d),so(e);return;case"option":for(z in a)if(a.hasOwnProperty(z)&&(l=a[z],l!=null))switch(z){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:Ie(e,t,z,l,a,null)}return;case"dialog":qe("beforetoggle",e),qe("toggle",e),qe("cancel",e),qe("close",e);break;case"iframe":case"object":qe("load",e);break;case"video":case"audio":for(l=0;l<ir.length;l++)qe(ir[l],e);break;case"image":qe("error",e),qe("load",e);break;case"details":qe("toggle",e);break;case"embed":case"source":case"link":qe("error",e),qe("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(J in a)if(a.hasOwnProperty(J)&&(l=a[J],l!=null))switch(J){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:Ie(e,t,J,l,a,null)}return;default:if(ac(t)){for(ce in a)a.hasOwnProperty(ce)&&(l=a[ce],l!==void 0&&Lu(e,t,ce,l,a,void 0));return}}for(w in a)a.hasOwnProperty(w)&&(l=a[w],l!=null&&Ie(e,t,w,l,a,null))}function Wb(e,t,a,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,d=null,y=null,w=null,z=null,J=null,ce=null;for(te in a){var fe=a[te];if(a.hasOwnProperty(te)&&fe!=null)switch(te){case"checked":break;case"value":break;case"defaultValue":z=fe;default:l.hasOwnProperty(te)||Ie(e,t,te,null,l,fe)}}for(var F in l){var te=l[F];if(fe=a[F],l.hasOwnProperty(F)&&(te!=null||fe!=null))switch(F){case"type":d=te;break;case"name":c=te;break;case"checked":J=te;break;case"defaultChecked":ce=te;break;case"value":y=te;break;case"defaultValue":w=te;break;case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(i(137,t));break;default:te!==fe&&Ie(e,t,F,te,l,fe)}}tc(e,y,w,z,J,ce,d,c);return;case"select":te=y=w=F=null;for(d in a)if(z=a[d],a.hasOwnProperty(d)&&z!=null)switch(d){case"value":break;case"multiple":te=z;default:l.hasOwnProperty(d)||Ie(e,t,d,null,l,z)}for(c in l)if(d=l[c],z=a[c],l.hasOwnProperty(c)&&(d!=null||z!=null))switch(c){case"value":F=d;break;case"defaultValue":w=d;break;case"multiple":y=d;default:d!==z&&Ie(e,t,c,d,l,z)}t=w,a=y,l=te,F!=null?Ns(e,!!a,F,!1):!!l!=!!a&&(t!=null?Ns(e,!!a,t,!0):Ns(e,!!a,a?[]:"",!1));return;case"textarea":te=F=null;for(w in a)if(c=a[w],a.hasOwnProperty(w)&&c!=null&&!l.hasOwnProperty(w))switch(w){case"value":break;case"children":break;default:Ie(e,t,w,null,l,c)}for(y in l)if(c=l[y],d=a[y],l.hasOwnProperty(y)&&(c!=null||d!=null))switch(y){case"value":F=c;break;case"defaultValue":te=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(i(91));break;default:c!==d&&Ie(e,t,y,c,l,d)}kf(e,F,te);return;case"option":for(var Me in a)if(F=a[Me],a.hasOwnProperty(Me)&&F!=null&&!l.hasOwnProperty(Me))switch(Me){case"selected":e.selected=!1;break;default:Ie(e,t,Me,null,l,F)}for(z in l)if(F=l[z],te=a[z],l.hasOwnProperty(z)&&F!==te&&(F!=null||te!=null))switch(z){case"selected":e.selected=F&&typeof F!="function"&&typeof F!="symbol";break;default:Ie(e,t,z,F,l,te)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var _e in a)F=a[_e],a.hasOwnProperty(_e)&&F!=null&&!l.hasOwnProperty(_e)&&Ie(e,t,_e,null,l,F);for(J in l)if(F=l[J],te=a[J],l.hasOwnProperty(J)&&F!==te&&(F!=null||te!=null))switch(J){case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(i(137,t));break;default:Ie(e,t,J,F,l,te)}return;default:if(ac(t)){for(var Fe in a)F=a[Fe],a.hasOwnProperty(Fe)&&F!==void 0&&!l.hasOwnProperty(Fe)&&Lu(e,t,Fe,void 0,l,F);for(ce in l)F=l[ce],te=a[ce],!l.hasOwnProperty(ce)||F===te||F===void 0&&te===void 0||Lu(e,t,ce,F,l,te);return}}for(var Z in a)F=a[Z],a.hasOwnProperty(Z)&&F!=null&&!l.hasOwnProperty(Z)&&Ie(e,t,Z,null,l,F);for(fe in l)F=l[fe],te=a[fe],!l.hasOwnProperty(fe)||F===te||F==null&&te==null||Ie(e,t,fe,F,l,te)}var Yu=null,Vu=null;function ei(e){return e.nodeType===9?e:e.ownerDocument}function Cp(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Tp(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Gu(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Xu=null;function Qb(){var e=window.event;return e&&e.type==="popstate"?e===Xu?!1:(Xu=e,!0):(Xu=null,!1)}var Mp=typeof setTimeout=="function"?setTimeout:void 0,Kb=typeof clearTimeout=="function"?clearTimeout:void 0,Ap=typeof Promise=="function"?Promise:void 0,Jb=typeof queueMicrotask=="function"?queueMicrotask:typeof Ap<"u"?function(e){return Ap.resolve(null).then(e).catch(Ib)}:Mp;function Ib(e){setTimeout(function(){throw e})}function Ta(e){return e==="head"}function Rp(e,t){var a=t,l=0,c=0;do{var d=a.nextSibling;if(e.removeChild(a),d&&d.nodeType===8)if(a=d.data,a==="/$"){if(0<l&&8>l){a=l;var y=e.ownerDocument;if(a&1&&ur(y.documentElement),a&2&&ur(y.body),a&4)for(a=y.head,ur(a),y=a.firstChild;y;){var w=y.nextSibling,z=y.nodeName;y[Ga]||z==="SCRIPT"||z==="STYLE"||z==="LINK"&&y.rel.toLowerCase()==="stylesheet"||a.removeChild(y),y=w}}if(c===0){e.removeChild(d),yr(t);return}c--}else a==="$"||a==="$?"||a==="$!"?c++:l=a.charCodeAt(0)-48;else l=0;a=d}while(a);yr(t)}function Zu(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Zu(a),El(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function Fb(e,t,a,l){for(;e.nodeType===1;){var c=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[Ga])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(d=e.getAttribute("rel"),d==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(d!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(d=e.getAttribute("src"),(d!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&d&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var d=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===d)return e}else return e;if(e=Nn(e.nextSibling),e===null)break}return null}function Pb(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=Nn(e.nextSibling),e===null))return null;return e}function Wu(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState==="complete"}function ev(e,t){var a=e.ownerDocument;if(e.data!=="$?"||a.readyState==="complete")t();else{var l=function(){t(),a.removeEventListener("DOMContentLoaded",l)};a.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function Nn(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==="$?"||t==="F!"||t==="F")break;if(t==="/$")return null}}return e}var Qu=null;function zp(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"){if(t===0)return e;t--}else a==="/$"&&t++}e=e.previousSibling}return null}function Op(e,t,a){switch(t=ei(a),e){case"html":if(e=t.documentElement,!e)throw Error(i(452));return e;case"head":if(e=t.head,!e)throw Error(i(453));return e;case"body":if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function ur(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);El(e)}var mn=new Map,Dp=new Set;function ti(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var In=H.d;H.d={f:tv,r:nv,D:av,C:sv,L:lv,m:rv,X:iv,S:ov,M:cv};function tv(){var e=In.f(),t=Zo();return e||t}function nv(e){var t=ca(e);t!==null&&t.tag===5&&t.type==="form"?tx(t):In.r(e)}var Fs=typeof document>"u"?null:document;function Hp(e,t,a){var l=Fs;if(l&&typeof t=="string"&&t){var c=cn(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof a=="string"&&(c+='[crossorigin="'+a+'"]'),Dp.has(c)||(Dp.add(c),e={rel:e,crossOrigin:a,href:t},l.querySelector(c)===null&&(t=l.createElement("link"),Dt(t,"link",e),mt(t),l.head.appendChild(t)))}}function av(e){In.D(e),Hp("dns-prefetch",e,null)}function sv(e,t){In.C(e,t),Hp("preconnect",e,t)}function lv(e,t,a){In.L(e,t,a);var l=Fs;if(l&&e&&t){var c='link[rel="preload"][as="'+cn(t)+'"]';t==="image"&&a&&a.imageSrcSet?(c+='[imagesrcset="'+cn(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(c+='[imagesizes="'+cn(a.imageSizes)+'"]')):c+='[href="'+cn(e)+'"]';var d=c;switch(t){case"style":d=Ps(e);break;case"script":d=el(e)}mn.has(d)||(e=m({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),mn.set(d,e),l.querySelector(c)!==null||t==="style"&&l.querySelector(dr(d))||t==="script"&&l.querySelector(fr(d))||(t=l.createElement("link"),Dt(t,"link",e),mt(t),l.head.appendChild(t)))}}function rv(e,t){In.m(e,t);var a=Fs;if(a&&e){var l=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+cn(l)+'"][href="'+cn(e)+'"]',d=c;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=el(e)}if(!mn.has(d)&&(e=m({rel:"modulepreload",href:e},t),mn.set(d,e),a.querySelector(c)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(fr(d)))return}l=a.createElement("link"),Dt(l,"link",e),mt(l),a.head.appendChild(l)}}}function ov(e,t,a){In.S(e,t,a);var l=Fs;if(l&&e){var c=ua(l).hoistableStyles,d=Ps(e);t=t||"default";var y=c.get(d);if(!y){var w={loading:0,preload:null};if(y=l.querySelector(dr(d)))w.loading=5;else{e=m({rel:"stylesheet",href:e,"data-precedence":t},a),(a=mn.get(d))&&Ku(e,a);var z=y=l.createElement("link");mt(z),Dt(z,"link",e),z._p=new Promise(function(J,ce){z.onload=J,z.onerror=ce}),z.addEventListener("load",function(){w.loading|=1}),z.addEventListener("error",function(){w.loading|=2}),w.loading|=4,ni(y,t,l)}y={type:"stylesheet",instance:y,count:1,state:w},c.set(d,y)}}}function iv(e,t){In.X(e,t);var a=Fs;if(a&&e){var l=ua(a).hoistableScripts,c=el(e),d=l.get(c);d||(d=a.querySelector(fr(c)),d||(e=m({src:e,async:!0},t),(t=mn.get(c))&&Ju(e,t),d=a.createElement("script"),mt(d),Dt(d,"link",e),a.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},l.set(c,d))}}function cv(e,t){In.M(e,t);var a=Fs;if(a&&e){var l=ua(a).hoistableScripts,c=el(e),d=l.get(c);d||(d=a.querySelector(fr(c)),d||(e=m({src:e,async:!0,type:"module"},t),(t=mn.get(c))&&Ju(e,t),d=a.createElement("script"),mt(d),Dt(d,"link",e),a.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},l.set(c,d))}}function $p(e,t,a,l){var c=(c=xe.current)?ti(c):null;if(!c)throw Error(i(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=Ps(a.href),a=ua(c).hoistableStyles,l=a.get(t),l||(l={type:"style",instance:null,count:0,state:null},a.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=Ps(a.href);var d=ua(c).hoistableStyles,y=d.get(e);if(y||(c=c.ownerDocument||c,y={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},d.set(e,y),(d=c.querySelector(dr(e)))&&!d._p&&(y.instance=d,y.state.loading=5),mn.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},mn.set(e,a),d||uv(c,e,a,y.state))),t&&l===null)throw Error(i(528,""));return y}if(t&&l!==null)throw Error(i(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=el(a),a=ua(c).hoistableScripts,l=a.get(t),l||(l={type:"script",instance:null,count:0,state:null},a.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Ps(e){return'href="'+cn(e)+'"'}function dr(e){return'link[rel="stylesheet"]['+e+"]"}function Up(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function uv(e,t,a,l){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?l.loading=1:(t=e.createElement("link"),l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2}),Dt(t,"link",a),mt(t),e.head.appendChild(t))}function el(e){return'[src="'+cn(e)+'"]'}function fr(e){return"script[async]"+e}function Bp(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+cn(a.href)+'"]');if(l)return t.instance=l,mt(l),l;var c=m({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),mt(l),Dt(l,"style",c),ni(l,a.precedence,e),t.instance=l;case"stylesheet":c=Ps(a.href);var d=e.querySelector(dr(c));if(d)return t.state.loading|=4,t.instance=d,mt(d),d;l=Up(a),(c=mn.get(c))&&Ku(l,c),d=(e.ownerDocument||e).createElement("link"),mt(d);var y=d;return y._p=new Promise(function(w,z){y.onload=w,y.onerror=z}),Dt(d,"link",l),t.state.loading|=4,ni(d,a.precedence,e),t.instance=d;case"script":return d=el(a.src),(c=e.querySelector(fr(d)))?(t.instance=c,mt(c),c):(l=a,(c=mn.get(d))&&(l=m({},a),Ju(l,c)),e=e.ownerDocument||e,c=e.createElement("script"),mt(c),Dt(c,"link",l),e.head.appendChild(c),t.instance=c);case"void":return null;default:throw Error(i(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,ni(l,a.precedence,e));return t.instance}function ni(e,t,a){for(var l=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=l.length?l[l.length-1]:null,d=c,y=0;y<l.length;y++){var w=l[y];if(w.dataset.precedence===t)d=w;else if(d!==c)break}d?d.parentNode.insertBefore(e,d.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function Ku(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Ju(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ai=null;function qp(e,t,a){if(ai===null){var l=new Map,c=ai=new Map;c.set(a,l)}else c=ai,l=c.get(a),l||(l=new Map,c.set(a,l));if(l.has(e))return l;for(l.set(e,null),a=a.getElementsByTagName(e),c=0;c<a.length;c++){var d=a[c];if(!(d[Ga]||d[wt]||e==="link"&&d.getAttribute("rel")==="stylesheet")&&d.namespaceURI!=="http://www.w3.org/2000/svg"){var y=d.getAttribute(t)||"";y=e+y;var w=l.get(y);w?w.push(d):l.set(y,[d])}}return l}function Lp(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function dv(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Yp(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}var hr=null;function fv(){}function hv(e,t,a){if(hr===null)throw Error(i(475));var l=hr;if(t.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(t.state.loading&4)===0){if(t.instance===null){var c=Ps(a.href),d=e.querySelector(dr(c));if(d){e=d._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(l.count++,l=si.bind(l),e.then(l,l)),t.state.loading|=4,t.instance=d,mt(d);return}d=e.ownerDocument||e,a=Up(a),(c=mn.get(c))&&Ku(a,c),d=d.createElement("link"),mt(d);var y=d;y._p=new Promise(function(w,z){y.onload=w,y.onerror=z}),Dt(d,"link",a),t.instance=d}l.stylesheets===null&&(l.stylesheets=new Map),l.stylesheets.set(t,e),(e=t.state.preload)&&(t.state.loading&3)===0&&(l.count++,t=si.bind(l),e.addEventListener("load",t),e.addEventListener("error",t))}}function xv(){if(hr===null)throw Error(i(475));var e=hr;return e.stylesheets&&e.count===0&&Iu(e,e.stylesheets),0<e.count?function(t){var a=setTimeout(function(){if(e.stylesheets&&Iu(e,e.stylesheets),e.unsuspend){var l=e.unsuspend;e.unsuspend=null,l()}},6e4);return e.unsuspend=t,function(){e.unsuspend=null,clearTimeout(a)}}:null}function si(){if(this.count--,this.count===0){if(this.stylesheets)Iu(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var li=null;function Iu(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,li=new Map,t.forEach(pv,e),li=null,si.call(e))}function pv(e,t){if(!(t.state.loading&4)){var a=li.get(e);if(a)var l=a.get(null);else{a=new Map,li.set(e,a);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;d<c.length;d++){var y=c[d];(y.nodeName==="LINK"||y.getAttribute("media")!=="not all")&&(a.set(y.dataset.precedence,y),l=y)}l&&a.set(null,l)}c=t.instance,y=c.getAttribute("data-precedence"),d=a.get(y)||l,d===l&&a.set(null,c),a.set(y,c),this.count++,l=si.bind(this),c.addEventListener("load",l),c.addEventListener("error",l),d?d.parentNode.insertBefore(c,d.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var xr={$$typeof:L,Provider:null,Consumer:null,_currentValue:D,_currentValue2:D,_threadCount:0};function mv(e,t,a,l,c,d,y,w){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Va(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Va(0),this.hiddenUpdates=Va(null),this.identifierPrefix=l,this.onUncaughtError=c,this.onCaughtError=d,this.onRecoverableError=y,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=w,this.incompleteTransitions=new Map}function Vp(e,t,a,l,c,d,y,w,z,J,ce,fe){return e=new mv(e,t,a,y,w,z,J,fe),t=1,d===!0&&(t|=24),d=Ft(3,null,null,t),e.current=d,d.stateNode=e,t=Rc(),t.refCount++,e.pooledCache=t,t.refCount++,d.memoizedState={element:l,isDehydrated:a,cache:t},Hc(d),e}function Gp(e){return e?(e=As,e):As}function Xp(e,t,a,l,c,d){c=Gp(c),l.context===null?l.context=c:l.pendingContext=c,l=ma(t),l.payload={element:a},d=d===void 0?null:d,d!==null&&(l.callback=d),a=ga(e,l,t),a!==null&&(an(a,e,t),Gl(a,e,t))}function Zp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Fu(e,t){Zp(e,t),(e=e.alternate)&&Zp(e,t)}function Wp(e){if(e.tag===13){var t=Ms(e,67108864);t!==null&&an(t,e,67108864),Fu(e,67108864)}}var ri=!0;function gv(e,t,a,l){var c=k.T;k.T=null;var d=H.p;try{H.p=2,Pu(e,t,a,l)}finally{H.p=d,k.T=c}}function yv(e,t,a,l){var c=k.T;k.T=null;var d=H.p;try{H.p=8,Pu(e,t,a,l)}finally{H.p=d,k.T=c}}function Pu(e,t,a,l){if(ri){var c=ed(l);if(c===null)qu(e,t,l,oi,a),Kp(e,l);else if(vv(c,e,t,a,l))l.stopPropagation();else if(Kp(e,l),t&4&&-1<bv.indexOf(e)){for(;c!==null;){var d=ca(c);if(d!==null)switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var y=Rt(d.pendingLanes);if(y!==0){var w=d;for(w.pendingLanes|=2,w.entangledLanes|=2;y;){var z=1<<31-at(y);w.entanglements[1]|=z,y&=~z}Rn(d),(Qe&6)===0&&(Go=oe()+500,or(0))}}break;case 13:w=Ms(d,2),w!==null&&an(w,d,2),Zo(),Fu(d,2)}if(d=ed(l),d===null&&qu(e,t,l,oi,a),d===c)break;c=d}c!==null&&l.stopPropagation()}else qu(e,t,l,null,a)}}function ed(e){return e=lc(e),td(e)}var oi=null;function td(e){if(oi=null,e=Hn(e),e!==null){var t=f(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=h(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return oi=e,null}function Qp(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(P()){case Ee:return 2;case ge:return 8;case ke:case Oe:return 32;case ze:return 268435456;default:return 32}default:return 32}}var nd=!1,Ma=null,Aa=null,Ra=null,pr=new Map,mr=new Map,za=[],bv="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Kp(e,t){switch(e){case"focusin":case"focusout":Ma=null;break;case"dragenter":case"dragleave":Aa=null;break;case"mouseover":case"mouseout":Ra=null;break;case"pointerover":case"pointerout":pr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":mr.delete(t.pointerId)}}function gr(e,t,a,l,c,d){return e===null||e.nativeEvent!==d?(e={blockedOn:t,domEventName:a,eventSystemFlags:l,nativeEvent:d,targetContainers:[c]},t!==null&&(t=ca(t),t!==null&&Wp(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function vv(e,t,a,l,c){switch(t){case"focusin":return Ma=gr(Ma,e,t,a,l,c),!0;case"dragenter":return Aa=gr(Aa,e,t,a,l,c),!0;case"mouseover":return Ra=gr(Ra,e,t,a,l,c),!0;case"pointerover":var d=c.pointerId;return pr.set(d,gr(pr.get(d)||null,e,t,a,l,c)),!0;case"gotpointercapture":return d=c.pointerId,mr.set(d,gr(mr.get(d)||null,e,t,a,l,c)),!0}return!1}function Jp(e){var t=Hn(e.target);if(t!==null){var a=f(t);if(a!==null){if(t=a.tag,t===13){if(t=h(a),t!==null){e.blockedOn=t,Ii(e.priority,function(){if(a.tag===13){var l=nn();l=Nl(l);var c=Ms(a,l);c!==null&&an(c,a,l),Fu(a,l)}});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ii(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=ed(e.nativeEvent);if(a===null){a=e.nativeEvent;var l=new a.constructor(a.type,a);sc=l,a.target.dispatchEvent(l),sc=null}else return t=ca(a),t!==null&&Wp(t),e.blockedOn=a,!1;t.shift()}return!0}function Ip(e,t,a){ii(e)&&a.delete(t)}function jv(){nd=!1,Ma!==null&&ii(Ma)&&(Ma=null),Aa!==null&&ii(Aa)&&(Aa=null),Ra!==null&&ii(Ra)&&(Ra=null),pr.forEach(Ip),mr.forEach(Ip)}function ci(e,t){e.blockedOn===t&&(e.blockedOn=null,nd||(nd=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,jv)))}var ui=null;function Fp(e){ui!==e&&(ui=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){ui===e&&(ui=null);for(var t=0;t<e.length;t+=3){var a=e[t],l=e[t+1],c=e[t+2];if(typeof l!="function"){if(td(l||a)===null)continue;break}var d=ca(a);d!==null&&(e.splice(t,3),t-=3,tu(d,{pending:!0,data:c,method:a.method,action:l},l,c))}}))}function yr(e){function t(z){return ci(z,e)}Ma!==null&&ci(Ma,e),Aa!==null&&ci(Aa,e),Ra!==null&&ci(Ra,e),pr.forEach(t),mr.forEach(t);for(var a=0;a<za.length;a++){var l=za[a];l.blockedOn===e&&(l.blockedOn=null)}for(;0<za.length&&(a=za[0],a.blockedOn===null);)Jp(a),a.blockedOn===null&&za.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(l=0;l<a.length;l+=3){var c=a[l],d=a[l+1],y=c[Ut]||null;if(typeof d=="function")y||Fp(a);else if(y){var w=null;if(d&&d.hasAttribute("formAction")){if(c=d,y=d[Ut]||null)w=y.formAction;else if(td(c)!==null)continue}else w=y.action;typeof w=="function"?a[l+1]=w:(a.splice(l,3),l-=3),Fp(a)}}}function ad(e){this._internalRoot=e}di.prototype.render=ad.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var a=t.current,l=nn();Xp(a,l,e,t,null,null)},di.prototype.unmount=ad.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Xp(e.current,2,null,e,null,null),Zo(),t[ia]=null}};function di(e){this._internalRoot=e}di.prototype.unstable_scheduleHydration=function(e){if(e){var t=Jr();e={blockedOn:null,target:e,priority:t};for(var a=0;a<za.length&&t!==0&&t<za[a].priority;a++);za.splice(a,0,e),a===0&&Jp(e)}};var Pp=r.version;if(Pp!=="19.1.1")throw Error(i(527,Pp,"19.1.1"));H.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(i(188)):(e=Object.keys(e).join(","),Error(i(268,e)));return e=p(t),e=e!==null?x(e):null,e=e===null?null:e.stateNode,e};var Nv={bundleType:0,version:"19.1.1",rendererPackageName:"react-dom",currentDispatcherRef:k,reconcilerVersion:"19.1.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var fi=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!fi.isDisabled&&fi.supportsFiber)try{dt=fi.inject(Nv),nt=fi}catch{}}return vr.createRoot=function(e,t){if(!u(e))throw Error(i(299));var a=!1,l="",c=px,d=mx,y=gx,w=null;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(c=t.onUncaughtError),t.onCaughtError!==void 0&&(d=t.onCaughtError),t.onRecoverableError!==void 0&&(y=t.onRecoverableError),t.unstable_transitionCallbacks!==void 0&&(w=t.unstable_transitionCallbacks)),t=Vp(e,1,!1,null,null,a,l,c,d,y,w,null),e[ia]=t.current,Bu(e),new ad(t)},vr.hydrateRoot=function(e,t,a){if(!u(e))throw Error(i(299));var l=!1,c="",d=px,y=mx,w=gx,z=null,J=null;return a!=null&&(a.unstable_strictMode===!0&&(l=!0),a.identifierPrefix!==void 0&&(c=a.identifierPrefix),a.onUncaughtError!==void 0&&(d=a.onUncaughtError),a.onCaughtError!==void 0&&(y=a.onCaughtError),a.onRecoverableError!==void 0&&(w=a.onRecoverableError),a.unstable_transitionCallbacks!==void 0&&(z=a.unstable_transitionCallbacks),a.formState!==void 0&&(J=a.formState)),t=Vp(e,1,!0,t,a??null,l,c,d,y,w,z,J),t.context=Gp(null),a=t.current,l=nn(),l=Nl(l),c=ma(l),c.callback=null,ga(a,c,l),a=l,t.current.lanes=a,oa(t,a),Rn(t),e[ia]=t.current,Bu(e),new di(t)},vr.version="19.1.1",vr}var cm;function Av(){if(cm)return rd.exports;cm=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),rd.exports=Mv(),rd.exports}var Rv=Av();/**
|
|
50
|
-
* @license lucide-react v1.33.0 - ISC
|
|
51
|
-
*
|
|
52
|
-
* This source code is licensed under the ISC license.
|
|
53
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
54
|
-
*/const k0=(...n)=>n.filter((r,o,i)=>!!r&&r.trim()!==""&&i.indexOf(r)===o).join(" ").trim();/**
|
|
55
|
-
* @license lucide-react v1.33.0 - ISC
|
|
56
|
-
*
|
|
57
|
-
* This source code is licensed under the ISC license.
|
|
58
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
59
|
-
*/const zv=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
60
|
-
* @license lucide-react v1.33.0 - ISC
|
|
61
|
-
*
|
|
62
|
-
* This source code is licensed under the ISC license.
|
|
63
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
64
|
-
*/const Ov=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(r,o,i)=>i?i.toUpperCase():o.toLowerCase());/**
|
|
65
|
-
* @license lucide-react v1.33.0 - ISC
|
|
66
|
-
*
|
|
67
|
-
* This source code is licensed under the ISC license.
|
|
68
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
69
|
-
*/const um=n=>{const r=Ov(n);return r.charAt(0).toUpperCase()+r.slice(1)};/**
|
|
70
|
-
* @license lucide-react v1.33.0 - ISC
|
|
71
|
-
*
|
|
72
|
-
* This source code is licensed under the ISC license.
|
|
73
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
74
|
-
*/var ud={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"};/**
|
|
75
|
-
* @license lucide-react v1.33.0 - ISC
|
|
76
|
-
*
|
|
77
|
-
* This source code is licensed under the ISC license.
|
|
78
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
79
|
-
*/const Dv=n=>{for(const r in n)if(r.startsWith("aria-")||r==="role"||r==="title")return!0;return!1},Hv=j.createContext({}),$v=()=>j.useContext(Hv),Uv=j.forwardRef(({color:n,size:r,strokeWidth:o,absoluteStrokeWidth:i,className:u="",children:f,iconNode:h,...g},p)=>{const{size:x=24,strokeWidth:m=2,absoluteStrokeWidth:b=!1,color:v="currentColor",className:N=""}=$v()??{},C=i??b?Number(o??m)*24/Number(r??x):o??m;return j.createElement("svg",{ref:p,...ud,width:r??x??ud.width,height:r??x??ud.height,stroke:n??v,strokeWidth:C,className:k0("lucide",N,u),...!f&&!Dv(g)&&{"aria-hidden":"true"},...g},[...h.map(([_,M])=>j.createElement(_,M)),...Array.isArray(f)?f:[f]])});/**
|
|
80
|
-
* @license lucide-react v1.33.0 - ISC
|
|
81
|
-
*
|
|
82
|
-
* This source code is licensed under the ISC license.
|
|
83
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
84
|
-
*/const we=(n,r)=>{const o=j.forwardRef(({className:i,...u},f)=>j.createElement(Uv,{ref:f,iconNode:r,className:k0(`lucide-${zv(um(n))}`,`lucide-${n}`,i),...u}));return o.displayName=um(n),o};/**
|
|
85
|
-
* @license lucide-react v1.33.0 - ISC
|
|
86
|
-
*
|
|
87
|
-
* This source code is licensed under the ISC license.
|
|
88
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
89
|
-
*/const Bv=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Vr=we("activity",Bv);/**
|
|
90
|
-
* @license lucide-react v1.33.0 - ISC
|
|
91
|
-
*
|
|
92
|
-
* This source code is licensed under the ISC license.
|
|
93
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
94
|
-
*/const qv=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],dm=we("arrow-left",qv);/**
|
|
95
|
-
* @license lucide-react v1.33.0 - ISC
|
|
96
|
-
*
|
|
97
|
-
* This source code is licensed under the ISC license.
|
|
98
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
99
|
-
*/const Lv=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],dl=we("arrow-right",Lv);/**
|
|
100
|
-
* @license lucide-react v1.33.0 - ISC
|
|
101
|
-
*
|
|
102
|
-
* This source code is licensed under the ISC license.
|
|
103
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
104
|
-
*/const Yv=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],_0=we("bell",Yv);/**
|
|
105
|
-
* @license lucide-react v1.33.0 - ISC
|
|
106
|
-
*
|
|
107
|
-
* This source code is licensed under the ISC license.
|
|
108
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
109
|
-
*/const Vv=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],_i=we("brain",Vv);/**
|
|
110
|
-
* @license lucide-react v1.33.0 - ISC
|
|
111
|
-
*
|
|
112
|
-
* This source code is licensed under the ISC license.
|
|
113
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
114
|
-
*/const Gv=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],xt=we("check",Gv);/**
|
|
115
|
-
* @license lucide-react v1.33.0 - ISC
|
|
116
|
-
*
|
|
117
|
-
* This source code is licensed under the ISC license.
|
|
118
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
119
|
-
*/const Xv=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],La=we("chevron-down",Xv);/**
|
|
120
|
-
* @license lucide-react v1.33.0 - ISC
|
|
121
|
-
*
|
|
122
|
-
* This source code is licensed under the ISC license.
|
|
123
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
124
|
-
*/const Zv=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],bl=we("chevron-right",Zv);/**
|
|
125
|
-
* @license lucide-react v1.33.0 - ISC
|
|
126
|
-
*
|
|
127
|
-
* This source code is licensed under the ISC license.
|
|
128
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
129
|
-
*/const Wv=[["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"}]],Ht=we("circle-alert",Wv);/**
|
|
130
|
-
* @license lucide-react v1.33.0 - ISC
|
|
131
|
-
*
|
|
132
|
-
* This source code is licensed under the ISC license.
|
|
133
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
134
|
-
*/const Qv=[["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Kv=we("circle-play",Qv);/**
|
|
135
|
-
* @license lucide-react v1.33.0 - ISC
|
|
136
|
-
*
|
|
137
|
-
* This source code is licensed under the ISC license.
|
|
138
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
139
|
-
*/const Jv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],Iv=we("circle-plus",Jv);/**
|
|
140
|
-
* @license lucide-react v1.33.0 - ISC
|
|
141
|
-
*
|
|
142
|
-
* This source code is licensed under the ISC license.
|
|
143
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
144
|
-
*/const Fv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Pv=we("circle-question-mark",Fv);/**
|
|
145
|
-
* @license lucide-react v1.33.0 - ISC
|
|
146
|
-
*
|
|
147
|
-
* This source code is licensed under the ISC license.
|
|
148
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
149
|
-
*/const e1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],Gr=we("clock",e1);/**
|
|
150
|
-
* @license lucide-react v1.33.0 - ISC
|
|
151
|
-
*
|
|
152
|
-
* This source code is licensed under the ISC license.
|
|
153
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
154
|
-
*/const t1=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],Vi=we("code-xml",t1);/**
|
|
155
|
-
* @license lucide-react v1.33.0 - ISC
|
|
156
|
-
*
|
|
157
|
-
* This source code is licensed under the ISC license.
|
|
158
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
159
|
-
*/const n1=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],a1=we("copy",n1);/**
|
|
160
|
-
* @license lucide-react v1.33.0 - ISC
|
|
161
|
-
*
|
|
162
|
-
* This source code is licensed under the ISC license.
|
|
163
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
164
|
-
*/const s1=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],Rr=we("database",s1);/**
|
|
165
|
-
* @license lucide-react v1.33.0 - ISC
|
|
166
|
-
*
|
|
167
|
-
* This source code is licensed under the ISC license.
|
|
168
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
169
|
-
*/const l1=[["path",{d:"M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z",key:"1f1r0c"}]],ea=we("diamond",l1);/**
|
|
170
|
-
* @license lucide-react v1.33.0 - ISC
|
|
171
|
-
*
|
|
172
|
-
* This source code is licensed under the ISC license.
|
|
173
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
174
|
-
*/const r1=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],fm=we("external-link",r1);/**
|
|
175
|
-
* @license lucide-react v1.33.0 - ISC
|
|
176
|
-
*
|
|
177
|
-
* This source code is licensed under the ISC license.
|
|
178
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
179
|
-
*/const o1=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],i1=we("file-code",o1);/**
|
|
180
|
-
* @license lucide-react v1.33.0 - ISC
|
|
181
|
-
*
|
|
182
|
-
* This source code is licensed under the ISC license.
|
|
183
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
184
|
-
*/const c1=[["path",{d:"M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35",key:"1wthlu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 16-3 3 3 3",key:"331omg"}],["path",{d:"m9 22 3-3-3-3",key:"lsp7cz"}]],Kd=we("file-code-corner",c1);/**
|
|
185
|
-
* @license lucide-react v1.33.0 - ISC
|
|
186
|
-
*
|
|
187
|
-
* This source code is licensed under the ISC license.
|
|
188
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
189
|
-
*/const u1=[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]],d1=we("file-pen",u1);/**
|
|
190
|
-
* @license lucide-react v1.33.0 - ISC
|
|
191
|
-
*
|
|
192
|
-
* This source code is licensed under the ISC license.
|
|
193
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
194
|
-
*/const f1=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Jd=we("file-text",f1);/**
|
|
195
|
-
* @license lucide-react v1.33.0 - ISC
|
|
196
|
-
*
|
|
197
|
-
* This source code is licensed under the ISC license.
|
|
198
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
199
|
-
*/const h1=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],Id=we("git-branch",h1);/**
|
|
200
|
-
* @license lucide-react v1.33.0 - ISC
|
|
201
|
-
*
|
|
202
|
-
* This source code is licensed under the ISC license.
|
|
203
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
204
|
-
*/const x1=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],C0=we("git-commit-horizontal",x1);/**
|
|
205
|
-
* @license lucide-react v1.33.0 - ISC
|
|
206
|
-
*
|
|
207
|
-
* This source code is licensed under the ISC license.
|
|
208
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
209
|
-
*/const p1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],vl=we("globe",p1);/**
|
|
210
|
-
* @license lucide-react v1.33.0 - ISC
|
|
211
|
-
*
|
|
212
|
-
* This source code is licensed under the ISC license.
|
|
213
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
214
|
-
*/const m1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],g1=we("info",m1);/**
|
|
215
|
-
* @license lucide-react v1.33.0 - ISC
|
|
216
|
-
*
|
|
217
|
-
* This source code is licensed under the ISC license.
|
|
218
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
219
|
-
*/const y1=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],T0=we("key",y1);/**
|
|
220
|
-
* @license lucide-react v1.33.0 - ISC
|
|
221
|
-
*
|
|
222
|
-
* This source code is licensed under the ISC license.
|
|
223
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
224
|
-
*/const b1=[["path",{d:"M13 13.74a2 2 0 0 1-2 0L2.5 8.87a1 1 0 0 1 0-1.74L11 2.26a2 2 0 0 1 2 0l8.5 4.87a1 1 0 0 1 0 1.74z",key:"15q6uc"}],["path",{d:"m20 14.285 1.5.845a1 1 0 0 1 0 1.74L13 21.74a2 2 0 0 1-2 0l-8.5-4.87a1 1 0 0 1 0-1.74l1.5-.845",key:"byia6g"}]],M0=we("layers-2",b1);/**
|
|
225
|
-
* @license lucide-react v1.33.0 - ISC
|
|
226
|
-
*
|
|
227
|
-
* This source code is licensed under the ISC license.
|
|
228
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
229
|
-
*/const v1=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],A0=we("layers",v1);/**
|
|
230
|
-
* @license lucide-react v1.33.0 - ISC
|
|
231
|
-
*
|
|
232
|
-
* This source code is licensed under the ISC license.
|
|
233
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
234
|
-
*/const j1=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],N1=we("layout-grid",j1);/**
|
|
235
|
-
* @license lucide-react v1.33.0 - ISC
|
|
236
|
-
*
|
|
237
|
-
* This source code is licensed under the ISC license.
|
|
238
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
239
|
-
*/const w1=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],R0=we("list",w1);/**
|
|
240
|
-
* @license lucide-react v1.33.0 - ISC
|
|
241
|
-
*
|
|
242
|
-
* This source code is licensed under the ISC license.
|
|
243
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
244
|
-
*/const S1=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],ot=we("loader-circle",S1);/**
|
|
245
|
-
* @license lucide-react v1.33.0 - ISC
|
|
246
|
-
*
|
|
247
|
-
* This source code is licensed under the ISC license.
|
|
248
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
249
|
-
*/const E1=[["path",{d:"M3 5h1",key:"1mv5vm"}],["path",{d:"M3 12h1",key:"lp3yf2"}],["path",{d:"M3 19h1",key:"w6f3n9"}],["path",{d:"M8 5h1",key:"1nxr5w"}],["path",{d:"M8 12h1",key:"1con00"}],["path",{d:"M8 19h1",key:"k7p10e"}],["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}]],k1=we("logs",E1);/**
|
|
250
|
-
* @license lucide-react v1.33.0 - ISC
|
|
251
|
-
*
|
|
252
|
-
* This source code is licensed under the ISC license.
|
|
253
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
254
|
-
*/const _1=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],C1=we("moon",_1);/**
|
|
255
|
-
* @license lucide-react v1.33.0 - ISC
|
|
256
|
-
*
|
|
257
|
-
* This source code is licensed under the ISC license.
|
|
258
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
259
|
-
*/const T1=[["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"}]],hm=we("network",T1);/**
|
|
260
|
-
* @license lucide-react v1.33.0 - ISC
|
|
261
|
-
*
|
|
262
|
-
* This source code is licensed under the ISC license.
|
|
263
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
264
|
-
*/const M1=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],z0=we("palette",M1);/**
|
|
265
|
-
* @license lucide-react v1.33.0 - ISC
|
|
266
|
-
*
|
|
267
|
-
* This source code is licensed under the ISC license.
|
|
268
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
269
|
-
*/const A1=[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],Fd=we("pen-line",A1);/**
|
|
270
|
-
* @license lucide-react v1.33.0 - ISC
|
|
271
|
-
*
|
|
272
|
-
* This source code is licensed under the ISC license.
|
|
273
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
274
|
-
*/const R1=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],z1=we("pen",R1);/**
|
|
275
|
-
* @license lucide-react v1.33.0 - ISC
|
|
276
|
-
*
|
|
277
|
-
* This source code is licensed under the ISC license.
|
|
278
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
279
|
-
*/const O1=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],_d=we("play",O1);/**
|
|
280
|
-
* @license lucide-react v1.33.0 - ISC
|
|
281
|
-
*
|
|
282
|
-
* This source code is licensed under the ISC license.
|
|
283
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
284
|
-
*/const D1=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],_t=we("plus",D1);/**
|
|
285
|
-
* @license lucide-react v1.33.0 - ISC
|
|
286
|
-
*
|
|
287
|
-
* This source code is licensed under the ISC license.
|
|
288
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
289
|
-
*/const H1=[["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"}]],na=we("refresh-cw",H1);/**
|
|
290
|
-
* @license lucide-react v1.33.0 - ISC
|
|
291
|
-
*
|
|
292
|
-
* This source code is licensed under the ISC license.
|
|
293
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
294
|
-
*/const $1=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],U1=we("rotate-ccw",$1);/**
|
|
295
|
-
* @license lucide-react v1.33.0 - ISC
|
|
296
|
-
*
|
|
297
|
-
* This source code is licensed under the ISC license.
|
|
298
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
299
|
-
*/const B1=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],q1=we("save",B1);/**
|
|
300
|
-
* @license lucide-react v1.33.0 - ISC
|
|
301
|
-
*
|
|
302
|
-
* This source code is licensed under the ISC license.
|
|
303
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
304
|
-
*/const L1=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["path",{d:"M7 12h10",key:"b7w52i"}]],Ri=we("scan-line",L1);/**
|
|
305
|
-
* @license lucide-react v1.33.0 - ISC
|
|
306
|
-
*
|
|
307
|
-
* This source code is licensed under the ISC license.
|
|
308
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
309
|
-
*/const Y1=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],zi=we("search",Y1);/**
|
|
310
|
-
* @license lucide-react v1.33.0 - ISC
|
|
311
|
-
*
|
|
312
|
-
* This source code is licensed under the ISC license.
|
|
313
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
314
|
-
*/const V1=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],Cd=we("send",V1);/**
|
|
315
|
-
* @license lucide-react v1.33.0 - ISC
|
|
316
|
-
*
|
|
317
|
-
* This source code is licensed under the ISC license.
|
|
318
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
319
|
-
*/const G1=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],Ya=we("shield",G1);/**
|
|
320
|
-
* @license lucide-react v1.33.0 - ISC
|
|
321
|
-
*
|
|
322
|
-
* This source code is licensed under the ISC license.
|
|
323
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
324
|
-
*/const X1=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],O0=we("sparkles",X1);/**
|
|
325
|
-
* @license lucide-react v1.33.0 - ISC
|
|
326
|
-
*
|
|
327
|
-
* This source code is licensed under the ISC license.
|
|
328
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
329
|
-
*/const Z1=[["path",{d:"M12.034 12.681a.498.498 0 0 1 .647-.647l9 3.5a.5.5 0 0 1-.033.943l-3.444 1.068a1 1 0 0 0-.66.66l-1.067 3.443a.5.5 0 0 1-.943.033z",key:"xwnzip"}],["path",{d:"M21 11V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h6",key:"14rsvq"}]],W1=we("square-mouse-pointer",Z1);/**
|
|
330
|
-
* @license lucide-react v1.33.0 - ISC
|
|
331
|
-
*
|
|
332
|
-
* This source code is licensed under the ISC license.
|
|
333
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
334
|
-
*/const Q1=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],K1=we("square",Q1);/**
|
|
335
|
-
* @license lucide-react v1.33.0 - ISC
|
|
336
|
-
*
|
|
337
|
-
* This source code is licensed under the ISC license.
|
|
338
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
339
|
-
*/const J1=[["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"}]],I1=we("sun",J1);/**
|
|
340
|
-
* @license lucide-react v1.33.0 - ISC
|
|
341
|
-
*
|
|
342
|
-
* This source code is licensed under the ISC license.
|
|
343
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
344
|
-
*/const F1=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Pd=we("terminal",F1);/**
|
|
345
|
-
* @license lucide-react v1.33.0 - ISC
|
|
346
|
-
*
|
|
347
|
-
* This source code is licensed under the ISC license.
|
|
348
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
349
|
-
*/const P1=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Yt=we("trash-2",P1);/**
|
|
350
|
-
* @license lucide-react v1.33.0 - ISC
|
|
351
|
-
*
|
|
352
|
-
* This source code is licensed under the ISC license.
|
|
353
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
354
|
-
*/const e2=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],zr=we("user",e2);/**
|
|
355
|
-
* @license lucide-react v1.33.0 - ISC
|
|
356
|
-
*
|
|
357
|
-
* This source code is licensed under the ISC license.
|
|
358
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
359
|
-
*/const t2=[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]],Td=we("workflow",t2);/**
|
|
360
|
-
* @license lucide-react v1.33.0 - ISC
|
|
361
|
-
*
|
|
362
|
-
* This source code is licensed under the ISC license.
|
|
363
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
364
|
-
*/const n2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ct=we("x",n2);/**
|
|
365
|
-
* @license lucide-react v1.33.0 - ISC
|
|
366
|
-
*
|
|
367
|
-
* This source code is licensed under the ISC license.
|
|
368
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
369
|
-
*/const a2=[["path",{d:"M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z",key:"1v7up4"}]],aa=we("zap",a2),D0=j.createContext({theme:"dark",toggleTheme:()=>{}});function s2({children:n}){const[r,o]=j.useState(()=>localStorage.getItem("jetic_theme")==="light"?"light":"dark");j.useEffect(()=>{const u=document.documentElement;r==="light"?(u.classList.add("light"),u.classList.remove("dark")):(u.classList.add("dark"),u.classList.remove("light")),localStorage.setItem("jetic_theme",r)},[r]);const i=()=>o(u=>u==="dark"?"light":"dark");return s.jsx(D0.Provider,{value:{theme:r,toggleTheme:i},children:n})}function l2(){return j.useContext(D0)}const r2=[{label:"WORKFLOW",items:[{id:"overview",label:"Overview",icon:N1},{id:"model",label:"Model",icon:M0},{id:"simulations",label:"Simulations",icon:ea},{id:"inspect",label:"Inspect",icon:W1}]},{label:"AGENT",items:[{id:"memory",label:"Memory & Environment",icon:Rr}]},{label:"OBSERVABILITY",items:[{id:"traces",label:"Traces",icon:Vr},{id:"changes",label:"Files changes",icon:C0}]}],o2=[];function xm({icon:n,label:r,active:o=!1,onClick:i}){return s.jsxs("button",{type:"button",onClick:i,className:`relative hover:cursor-pointer flex w-full items-center gap-3 rounded-lg px-3 py-1.5 text-left text-[13.5px] transition-colors ${o?"bg-[var(--bg-overlay-md)] text-[var(--text-primary)] font-medium":"text-[var(--text-muted)] hover:bg-[var(--bg-overlay)] hover:text-[var(--text-secondary)]"}`,children:[o&&s.jsx("span",{className:"absolute -left-3 top-1/2 h-4 w-[3px] -translate-y-1/2 rounded-full bg-blue-500"}),s.jsx(n,{className:"h-[15px] w-[15px] shrink-0",strokeWidth:2}),s.jsx("span",{children:r})]})}function i2({currentPage:n,onNavigate:r,onToggleAssistant:o,isAssistantOpen:i}){const{theme:u,toggleTheme:f}=l2();return s.jsxs("div",{className:"flex w-60 shrink-0 flex-col select-none transition-colors duration-300",style:{borderRight:"1px solid var(--border)",backgroundColor:"var(--sidebar-bg)"},children:[s.jsxs("div",{className:"flex items-center justify-between px-4 pb-6 pt-5",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[u==="dark"?s.jsx("img",{src:"/jetic.png",alt:"jetic",className:"h-6 w-6"}):s.jsx("img",{src:"/jetic_light.png",alt:"jetic",className:"h-5 w-5"}),s.jsxs("span",{className:"text-[15px] tracking-wide",style:{color:"var(--text-primary)"},children:["Jetic",s.jsx("span",{className:"ml-1 text-blue-400 animate-pulse",children:"Studio"})]})]}),s.jsxs("div",{className:"flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[11px] font-medium",style:{border:"1px solid var(--border)",backgroundColor:"var(--bg-overlay)",color:"var(--text-muted)"},children:[s.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-blue-500"}),"v0.1.4"]})]}),s.jsx("div",{className:"flex-1 overflow-y-auto px-3",children:s.jsx("div",{className:"flex flex-col gap-6",children:r2.map(h=>s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"px-3 pb-1 text-[11px] font-semibold tracking-wider",style:{color:"var(--text-faint)"},children:h.label}),s.jsx("div",{className:"flex flex-col gap-0.5",children:h.items.map(g=>s.jsx(xm,{icon:g.icon,label:g.label,active:n===g.id,onClick:()=>r(g.id)},g.id))})]},h.label))})}),s.jsx("div",{className:"mx-3 my-3 hidden ",style:{borderTop:"1px solid var(--border)"}}),s.jsx("div",{className:"flex flex-col gap-0.5 px-3",children:s.jsxs("button",{type:"button",onClick:o,className:`hidden relative flex w-full items-center gap-3 rounded-lg px-3 py-2 text-left text-[13.5px] font-medium transition-colors ${i?"bg-blue-500/10 text-blue-400":"hover:bg-[var(--bg-overlay)]"}`,style:i?void 0:{color:"var(--text-secondary)"},children:[s.jsx(O0,{className:"h-[15px] w-[15px] shrink-0",strokeWidth:2}),s.jsx("span",{children:"Jetic Assistant"})]})}),s.jsx("div",{className:"mx-3 my-3 hidden",style:{borderTop:"1px solid var(--border)"}}),s.jsx("div",{className:"flex flex-col gap-0.5 px-3",children:o2.map(h=>s.jsx(xm,{icon:h.icon,label:h.label,active:n===h.id,onClick:()=>r(h.id)},h.id))}),s.jsx("div",{className:"px-3 pb-4 pt-3",children:s.jsxs("div",{className:"flex items-center gap-2 rounded-xl p-1",style:{border:"1px solid var(--border)",backgroundColor:"var(--bg-overlay)"},children:[s.jsxs("button",{type:"button",onClick:()=>u!=="dark"&&f(),title:"Dark mode",className:`flex flex-1 items-center justify-center gap-1.5 rounded-lg py-1.5 text-[11px] font-medium transition-all duration-200 hover:cursor-pointer ${u==="dark"?"bg-[#1e1e2e] text-blue-300 shadow-sm":"text-[var(--text-faint)] hover:text-[var(--text-muted)]"}`,children:[s.jsx(C1,{className:"h-3 w-3 shrink-0",strokeWidth:2}),"Dark"]}),s.jsxs("button",{type:"button",onClick:()=>u!=="light"&&f(),title:"Light mode",className:`flex flex-1 items-center justify-center gap-1.5 rounded-lg py-1.5 text-[11px] font-medium transition-all duration-200 hover:cursor-pointer ${u==="light"?"bg-white text-amber-500 shadow-sm":"text-[var(--text-faint)] hover:text-[var(--text-muted)]"}`,children:[s.jsx(I1,{className:"h-3 w-3 shrink-0",strokeWidth:2}),"Light"]})]})})]})}function c2({isOpen:n,onClose:r}){return n?s.jsxs("div",{className:"absolute inset-y-0 right-0 w-[400px] border-l border-white/10 bg-[#0a0a0a] shadow-2xl flex flex-col z-50",children:[s.jsxs("div",{className:"flex h-14 items-center justify-between border-b border-white/10 px-5",children:[s.jsx("div",{className:"flex items-center gap-2 text-emerald-400",children:s.jsx("span",{className:"text-[14px] font-medium",children:"Jetic AI"})}),s.jsx("button",{onClick:r,className:" hover:text-zinc-300 text-sm hover:bg-zinc-800/20 p-2 rounded-full",children:s.jsx(Ct,{className:"",size:13})})]}),s.jsx("div",{className:"flex-1 overflow-y-auto p-5 space-y-4",children:s.jsxs("div",{className:"flex flex-col items-center pt-8 pb-4",children:[s.jsx("div",{className:"mb-4 flex h-10 w-10 items-center justify-center rounded-full bg-zinc-800 text-[13px] font-medium text-zinc-300",children:"J"}),s.jsx("h2",{className:"text-[17px] font-semibold text-white text-center",children:"How can I help you test your APIs?"}),s.jsx("p",{className:"text-zinc-500 text-[13px] mt-2 text-center",children:"Ask me to generate simulations, debug traces, or explain API behavior."})]})}),s.jsx("div",{className:"p-4 border-t border-white/10 bg-white/[0.01]",children:s.jsxs("div",{className:"rounded border border-emerald-600/60 bg-white/[0.015] focus-within:border-emerald-500 transition-colors",children:[s.jsx("textarea",{rows:2,placeholder:"E.g. Test password reset flow...",className:"w-full resize-none bg-transparent px-4 pb-2 pt-3.5 text-[13.5px] text-zinc-200 placeholder:text-zinc-500 focus:outline-none"}),s.jsxs("div",{className:"flex items-center justify-between px-3 pb-3 pt-1",children:[s.jsx("div",{className:"flex gap-2",children:s.jsx("span",{className:"text-[11px] text-zinc-500 font-mono bg-white/[0.05] px-2 py-0.5 rounded",children:"gpt-4o"})}),s.jsx("button",{className:"text-[12px] font-medium text-emerald-400 hover:text-emerald-300",children:"Send"})]})]})})]}):null}const u2={GET:{bg:"bg-emerald-500/10",text:"text-emerald-400",dot:"#34d399"},POST:{bg:"bg-blue-500/10",text:"text-blue-400",dot:"#60a5fa"},PUT:{bg:"bg-amber-500/10",text:"text-amber-400",dot:"#fbbf24"},PATCH:{bg:"bg-orange-500/10",text:"text-orange-400",dot:"#fb923c"},DELETE:{bg:"bg-red-500/10",text:"text-red-400",dot:"#f87171"}};function Md(n){return u2[n.toUpperCase()]??{bg:"bg-[var(--bg-overlay-md)]",text:"text-[var(--text-muted)]",dot:"#a1a1aa"}}function hi({label:n,value:r,sub:o,icon:i,accent:u="blue"}){const f={blue:{glow:"bg-blue-500/10",text:"text-blue-400",border:"border-blue-500/20"},emerald:{glow:"bg-emerald-500/10",text:"text-emerald-400",border:"border-emerald-500/20"},amber:{glow:"bg-amber-500/10",text:"text-amber-400",border:"border-amber-500/20"},red:{glow:"bg-red-500/10",text:"text-red-400",border:"border-red-500/20"},zinc:{glow:"bg-[var(--bg-overlay-md)]",text:"text-[var(--text-muted)]",border:"border-[var(--border)]"}}[u];return s.jsxs("div",{className:"relative overflow-hidden rounded-lg border border-[var(--border)] bg-[var(--bg-overlay)] p-4 hover:bg-[var(--bg-overlay-md)] transition-colors",children:[s.jsx("div",{className:`absolute top-0 right-0 h-20 w-20 rounded-full blur-2xl ${f.glow} opacity-50 -translate-y-4 translate-x-4`}),s.jsxs("div",{className:"relative",children:[s.jsx("div",{className:`mb-3 flex h-8 w-8 items-center justify-center rounded-lg border border-[var(--border)] ${f.glow}`,children:s.jsx(i,{className:`h-[15px] w-[15px] ${f.text}`,strokeWidth:2})}),s.jsx("p",{className:"text-2xl font-semibold text-[var(--text-primary)] tabular-nums leading-none",children:r}),s.jsx("p",{className:"mt-1 text-[11px] font-semibold tracking-wider text-[var(--text-muted)] uppercase",children:n}),o&&s.jsx("p",{className:"mt-0.5 text-[11px] text-[var(--text-faint)]",children:o})]})]})}function jr({title:n,icon:r,action:o,children:i,noPad:u=!1}){return s.jsxs("div",{className:"rounded-lg border border-[var(--border)] bg-[var(--bg-overlay)] overflow-hidden",children:[s.jsxs("div",{className:"flex items-center gap-2.5 border-b border-[var(--border)] px-4 py-2.5 bg-[var(--bg-overlay-md)]",children:[r&&s.jsx(r,{className:"h-[15px] w-[15px] text-blue-400",strokeWidth:2}),s.jsx("span",{className:"text-[11px] font-semibold tracking-wider text-[var(--text-faint)] uppercase",children:n}),o&&s.jsx("span",{className:"ml-auto",children:o})]}),s.jsx("div",{className:u?"":"p-4",children:i})]})}function d2({method:n}){const r=Md(n);return s.jsx("span",{className:`inline-flex items-center rounded px-1.5 py-0.5 text-[9px] font-medium tracking-widest ${r.bg} ${r.text}`,children:n.toUpperCase()})}function xi({msg:n}){return s.jsx("p",{className:"py-6 text-center text-[12px] text-[var(--text-faint)]",children:n})}function f2({onClose:n,onSave:r}){const[o,i]=j.useState(""),[u,f]=j.useState("https://"),[h,g]=j.useState(!1),[p,x]=j.useState(""),m=j.useRef(null);j.useEffect(()=>{m.current?.focus()},[]);const b=async N=>{if(N.preventDefault(),!o.trim()){x("Name is required");return}if(!u.trim()||u==="https://"){x("Base URL is required");return}g(!0),x("");try{await r(o.trim(),u.trim()),n()}catch(C){x(C.message),g(!1)}},v="w-full rounded-lg px-3 py-2 text-[12px] outline-none transition-colors focus:border-blue-500/50 focus:bg-[var(--bg-overlay-md)]";return s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:N=>{N.target===N.currentTarget&&n()},children:s.jsxs("div",{className:"relative w-full max-w-sm rounded-lg p-6 shadow-2xl shadow-black/60",style:{border:"1px solid var(--border)",backgroundColor:"var(--sidebar-bg)"},children:[s.jsxs("div",{className:"mb-5 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-lg",style:{border:"1px solid var(--border)",backgroundColor:"var(--bg-overlay)"},children:s.jsx(vl,{className:"h-[15px] w-[15px] text-blue-400",strokeWidth:2})}),s.jsx("h2",{className:"text-[13.5px] font-medium",style:{color:"var(--text-primary)"},children:"Add Environment"})]}),s.jsx("button",{onClick:n,className:"flex h-7 w-7 items-center justify-center rounded-lg transition-colors hover:cursor-pointer hover:bg-[var(--bg-overlay-md)]",style:{border:"1px solid var(--border)",backgroundColor:"var(--bg-overlay)",color:"var(--text-muted)"},children:s.jsx(Ct,{className:"h-[15px] w-[15px]",strokeWidth:2})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"mb-1.5 block text-[11px] font-semibold uppercase tracking-wider",style:{color:"var(--text-faint)"},children:"Name"}),s.jsx("input",{ref:m,value:o,onChange:N=>i(N.target.value),placeholder:"production",className:v,style:{border:"1px solid var(--border)",backgroundColor:"var(--bg-overlay)",color:"var(--text-primary)"}})]}),s.jsxs("div",{children:[s.jsx("label",{className:"mb-1.5 block text-[11px] font-semibold uppercase tracking-wider",style:{color:"var(--text-faint)"},children:"Base URL"}),s.jsx("input",{value:u,onChange:N=>f(N.target.value),placeholder:"https://api.example.com",className:`${v} font-mono`,style:{border:"1px solid var(--border)",backgroundColor:"var(--bg-overlay)",color:"var(--text-primary)"}})]}),p&&s.jsx("p",{className:"text-[12px] text-red-400",children:p}),s.jsxs("div",{className:"flex items-center justify-end gap-2 pt-1",children:[s.jsx("button",{type:"button",onClick:n,className:"rounded-lg px-4 py-2 text-[12px] transition-colors hover:cursor-pointer hover:bg-[var(--bg-overlay-md)]",style:{border:"1px solid var(--border)",backgroundColor:"var(--bg-overlay)",color:"var(--text-muted)"},children:"Cancel"}),s.jsxs("button",{onClick:b,disabled:h,className:"flex items-center gap-2 rounded-lg bg-blue-500 px-4 py-2 text-[12px] font-medium text-white transition-colors hover:cursor-pointer hover:bg-blue-400 disabled:opacity-50",children:[h&&s.jsx(ot,{className:"h-[14px] w-[14px] animate-spin",strokeWidth:2}),h?"Saving…":"Add Environment"]})]})]})]})})}function pm({onNavigate:n}){const[r,o]=j.useState(null),[i,u]=j.useState([]),[f,h]=j.useState([]),[g,p]=j.useState(!0),[x,m]=j.useState(!1),[b,v]=j.useState(null),[N,C]=j.useState(null),[_,M]=j.useState(!1),[A,Y]=j.useState(null),[L,T]=j.useState(null),R=j.useCallback(async(S=!1)=>{S?m(!0):p(!0),v(null);try{const[U,k,H,D]=await Promise.allSettled([fetch("/api/model").then(O=>O.ok?O.json():null),fetch("/api/workflows").then(O=>O.ok?O.json():[]),fetch("/api/memory").then(O=>O.ok?O.json():[]),fetch("/api/model/environments").then(O=>O.ok?O.json():null)]);U.status==="fulfilled"&&o(U.value),k.status==="fulfilled"&&u(k.value??[]),H.status==="fulfilled"&&h(H.value??[]),D.status==="fulfilled"&&D.value&&C(D.value.defaultEnvironment??null)}catch(U){v(U.message)}finally{p(!1),m(!1)}},[]);j.useEffect(()=>{R()},[R]);const G=r?.endpoints?.length??0,X=i.length,le=f.length,I=r?.endpoints?.filter(S=>(S.security?.length??0)>0).length??0,K=(r?.endpoints??[]).reduce((S,U)=>(S[U.method.toUpperCase()]=(S[U.method.toUpperCase()]??0)+1,S),{}),ne=(r?.endpoints??[]).slice(0,8),ee=i.slice(0,4),se=f.slice(0,6);return s.jsxs("div",{className:"flex min-h-full w-full flex-col",children:[s.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-6 py-5",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-[15px] font-medium text-[var(--text-primary)] leading-none",children:r?.project?.name??"Overview"}),s.jsx("p",{className:"mt-0.5 text-[11px] text-[var(--text-muted)]",children:g?"Loading…":r?`${r.project.framework??r.project.language??""} · v${r.version} · ${new Date(r.generatedAt).toLocaleString()}`:"No model yet — run a scan"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("a",{href:"https://docs.jetic.online",target:"_blank",className:"relative hover:cursor-pointer flex w-full items-center gap-3 rounded-lg px-3 py-1.5 text-left text-[13.5px] transition-colors text-[var(--text-muted)] hover:cursor-pointer hover:text-[var(--text-secondary)] ",children:[s.jsx(Pv,{className:"h-[15px] w-[15px] shrink-0",strokeWidth:2}),s.jsx("span",{children:"Jetic Documentation"})]}),s.jsx("button",{type:"button",onClick:()=>R(!0),disabled:x||g,className:"flex h-8 w-8 items-center justify-center rounded-lg border border-[var(--border)] bg-[var(--bg-overlay)] text-[var(--text-muted)] hover:bg-[var(--bg-overlay-md)] hover:text-[var(--text-secondary)] disabled:opacity-40 transition-colors hover:cursor-pointer",children:s.jsx(na,{className:`h-[15px] w-[15px] ${x?"animate-spin":""}`,strokeWidth:2})}),!g&&!r&&s.jsxs("button",{type:"button",onClick:()=>n?.("model"),className:"flex items-center gap-1.5 rounded-lg bg-blue-500 px-3 py-1.5 text-[12px] font-medium text-white hover:bg-blue-400 transition-colors hover:cursor-pointer",children:[s.jsx(Ri,{className:"h-[15px] w-[15px]",strokeWidth:2})," Scan Project"]})]})]}),s.jsxs("div",{className:"flex-1 overflow-auto",children:[g&&s.jsx("div",{className:"space-y-3 p-6",children:[1,2,3,4,5].map(S=>s.jsx("div",{className:"h-14 animate-pulse rounded-lg border border-[var(--border)] bg-[var(--bg-overlay)]",style:{opacity:1-S*.15}},S))}),!g&&b&&s.jsxs("div",{className:"m-6 flex flex-col items-center gap-4 rounded-lg border border-red-500/20 bg-red-500/[0.05] p-10 text-center",children:[s.jsx(Ht,{className:"h-8 w-8 text-red-400",strokeWidth:2}),s.jsx("p",{className:"text-[13px] text-red-300",children:b}),s.jsx("button",{type:"button",onClick:()=>R(),className:"rounded-lg border border-red-500/20 bg-red-500/10 px-4 py-1.5 text-[12px] text-red-400 hover:bg-red-500/20 transition-colors hover:cursor-pointer",children:"Retry"})]}),!g&&!b&&s.jsxs("div",{className:"p-6 space-y-5",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[s.jsx(hi,{label:"Endpoints",value:G,icon:hm,accent:"blue"}),s.jsx(hi,{label:"Workflows",value:X,icon:Td,accent:"zinc"}),s.jsx(hi,{label:"Memory Keys",value:le,icon:Rr,accent:"emerald"}),s.jsx(hi,{label:"Secured",value:I,icon:Ya,accent:"amber",sub:G>0?`${Math.round(I/G*100)}% of routes`:void 0})]}),r&&s.jsxs("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2",children:[s.jsx(jr,{title:"Project",icon:O0,children:s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg border border-[var(--border)] bg-[var(--bg-overlay-md)]",children:s.jsx(Pd,{className:"h-[15px] w-[15px] text-blue-400",strokeWidth:2})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[13.5px] font-medium text-[var(--text-primary)]",children:r.project.name}),s.jsx("p",{className:"text-[11px] text-[var(--text-muted)]",children:r.project.framework??r.project.language??"Unknown framework"})]})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[s.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-[var(--text-faint)]",children:"Environments"}),s.jsxs("button",{type:"button",onClick:()=>M(!0),className:"flex items-center gap-1 rounded-lg px-2 py-1 text-[10px] font-medium text-blue-400 transition-colors hover:bg-blue-500/10 hover:cursor-pointer",style:{border:"1px solid var(--border)"},children:[s.jsx(_t,{className:"h-3 w-3",strokeWidth:2})," Add"]})]}),(r.environments?.length??0)===0?s.jsx("p",{className:"text-[12px] italic",style:{color:"var(--text-faint)"},children:"No environments configured"}):s.jsx("div",{className:"space-y-1",children:r.environments.map(S=>{const U=N===S.name,k=A===S.name,H=L===S.name;return s.jsxs("div",{className:`group flex items-center gap-2.5 rounded-lg border px-3 py-2 transition-all ${U?"border-blue-500/30 bg-blue-500/[0.05]":"border-[var(--border)] bg-[var(--bg-overlay-md)]"}`,children:[s.jsx("button",{type:"button",title:U?"Default environment":"Set as default",onClick:async()=>{if(!U){Y(S.name);try{await fetch(`/api/model/environments/${encodeURIComponent(S.name)}/default`,{method:"PUT"}),C(S.name),o(D=>D&&{...D,defaultEnvironment:S.name})}finally{Y(null)}}},className:"shrink-0 flex h-4 w-4 items-center justify-center rounded-full border-2 transition-colors hover:cursor-pointer",style:{borderColor:U?"#60a5fa":"var(--border)",backgroundColor:U?"#60a5fa22":"transparent"},children:k?s.jsx(ot,{className:"h-2.5 w-2.5 text-blue-400 animate-spin",strokeWidth:3}):U&&s.jsx(xt,{className:"h-2.5 w-2.5 text-blue-400",strokeWidth:3})}),s.jsx(vl,{className:"h-[14px] w-[14px] text-[var(--text-faint)] shrink-0",strokeWidth:2}),s.jsx("span",{className:`text-[11px] w-16 shrink-0 font-medium ${U?"text-blue-400":"text-[var(--text-muted)]"}`,children:S.name}),s.jsx("span",{className:"font-mono text-[11px] text-[var(--text-secondary)] truncate flex-1",children:S.baseUrl}),U&&s.jsx("span",{className:"shrink-0 rounded-full bg-blue-500/10 px-1.5 py-0.5 text-[9px] font-semibold text-blue-400 border border-blue-500/20",children:"default"}),s.jsx("button",{type:"button",disabled:H,onClick:async()=>{T(S.name);try{await fetch(`/api/model/environments/${encodeURIComponent(S.name)}`,{method:"DELETE"}),o(D=>D&&{...D,environments:D.environments?.filter(O=>O.name!==S.name)}),N===S.name&&C(null)}finally{T(null)}},className:"ml-1 flex h-6 w-6 shrink-0 items-center justify-center rounded-lg border border-transparent text-[var(--text-faint)] opacity-0 group-hover:opacity-100 transition-all hover:cursor-pointer hover:border-red-500/30 hover:bg-red-500/10 hover:text-red-400",children:H?s.jsx(ot,{className:"h-3 w-3 animate-spin",strokeWidth:2}):s.jsx(Yt,{className:"h-3 w-3",strokeWidth:2})})]},S.name)})})]}),s.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[s.jsxs("button",{type:"button",onClick:()=>n?.("model"),className:"flex items-center gap-1.5 rounded-lg border border-[var(--border)] bg-[var(--bg-overlay-md)] px-3 py-1.5 text-[12px] text-[var(--text-secondary)] hover:bg-blue-500 hover:text-white hover:border-blue-400 transition-colors hover:cursor-pointer",children:[s.jsx(A0,{className:"h-[15px] w-[15px]",strokeWidth:2})," View Model"]}),s.jsxs("button",{type:"button",onClick:()=>n?.("simulations"),className:"flex items-center gap-1.5 rounded-lg border border-[var(--border)] bg-[var(--bg-overlay-md)] px-3 py-1.5 text-[12px] text-[var(--text-secondary)] hover:bg-[var(--bg-overlay-md)] hover:text-[var(--text-primary)] transition-colors hover:cursor-pointer",children:[s.jsx(Kv,{className:"h-[15px] w-[15px]",strokeWidth:2})," Simulations"]})]})]})}),s.jsx(jr,{title:"Method Distribution",icon:Vr,children:Object.keys(K).length===0?s.jsx(xi,{msg:"No endpoints scanned yet"}):s.jsx("div",{className:"space-y-3",children:Object.entries(K).sort(([,S],[,U])=>U-S).map(([S,U])=>{const k=Md(S),H=Math.round(U/G*100);return s.jsxs("div",{children:[s.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[s.jsx("span",{className:`text-[12px] font-medium ${k.text}`,children:S}),s.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:[U," ",s.jsxs("span",{className:"text-[var(--text-faint)]",children:["(",H,"%)"]})]})]}),s.jsx("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-[var(--bg-overlay-md)]",children:s.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${H}%`,background:k.dot}})})]},S)})})})]}),s.jsx(jr,{title:"Endpoints",icon:hm,noPad:!0,action:s.jsxs("button",{type:"button",onClick:()=>n?.("model"),className:"flex items-center gap-1 text-[11px] text-blue-400 hover:text-blue-300 transition-colors hover:cursor-pointer",children:["View all ",s.jsx(dl,{className:"h-3.5 w-3.5",strokeWidth:2})]}),children:ne.length===0?s.jsx(xi,{msg:"No endpoints — scan your project first"}):s.jsxs("div",{className:"divide-y divide-[var(--border)]",children:[ne.map(S=>{const U=Md(S.method);return s.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5 hover:bg-[var(--bg-overlay-md)] transition-colors",children:[s.jsx("div",{className:"h-1.5 w-1.5 shrink-0 rounded-full",style:{background:U.dot}}),s.jsx(d2,{method:S.method}),s.jsx("span",{className:"flex-1 truncate font-mono text-[12px] text-[var(--text-secondary)]",children:S.path}),S.handlerName&&s.jsx("span",{className:"hidden sm:block truncate text-[11px] text-[var(--text-faint)] max-w-[140px]",children:S.handlerName}),(S.security?.length??0)>0&&s.jsx(Ya,{className:"h-[15px] w-[15px] text-amber-500/60 shrink-0",strokeWidth:2})]},S.id)}),G>8&&s.jsxs("div",{className:"px-4 py-2.5 text-[11px] text-[var(--text-faint)]",children:["+",G-8," more endpoints"]})]})}),s.jsxs("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2",children:[s.jsx(jr,{title:"Workflows",icon:Td,noPad:!0,action:s.jsxs("button",{type:"button",onClick:()=>n?.("simulations"),className:"flex items-center gap-1 text-[11px] text-blue-400 hover:text-blue-300 transition-colors hover:cursor-pointer",children:["View all ",s.jsx(dl,{className:"h-3.5 w-3.5",strokeWidth:2})]}),children:ee.length===0?s.jsx(xi,{msg:"No workflows found"}):s.jsx("div",{className:"divide-y divide-[var(--border)]",children:ee.map((S,U)=>s.jsxs("button",{type:"button",onClick:()=>n?.("simulations"),className:"group flex w-full items-center gap-3 px-4 py-2.5 hover:bg-[var(--bg-overlay-md)] text-left transition-colors hover:cursor-pointer",children:[s.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-lg border border-[var(--border)] bg-[var(--bg-overlay-md)]",children:s.jsx(aa,{className:"h-[15px] w-[15px] text-blue-400",strokeWidth:2})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"truncate text-[13px] text-[var(--text-primary)]",children:S.name}),s.jsxs("p",{className:"text-[11px] text-[var(--text-faint)]",children:[S.steps.length," steps"]})]}),s.jsx(bl,{className:"h-[15px] w-[15px] shrink-0 text-[var(--text-faint)] opacity-0 group-hover:opacity-100 transition-opacity",strokeWidth:2})]},U))})}),s.jsx(jr,{title:"Runtime Memory",icon:Rr,noPad:!0,action:s.jsxs("button",{type:"button",onClick:()=>n?.("memory"),className:"flex items-center gap-1 text-[11px] text-blue-400 hover:text-blue-300 transition-colors hover:cursor-pointer",children:["Inspect ",s.jsx(dl,{className:"h-3.5 w-3.5",strokeWidth:2})]}),children:se.length===0?s.jsx(xi,{msg:"No memory entries"}):s.jsxs("div",{className:"divide-y divide-[var(--border)]",children:[se.map((S,U)=>s.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5 hover:bg-[var(--bg-overlay-md)] transition-colors",children:[s.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500/50 shrink-0"}),s.jsx("span",{className:"font-mono text-[11px] text-[var(--text-secondary)] flex-1 truncate",children:S.key}),s.jsx("span",{className:"text-[11px] text-[var(--text-faint)] truncate max-w-[100px]",children:typeof S.value=="object"?JSON.stringify(S.value):String(S.value)})]},U)),f.length>6&&s.jsxs("p",{className:"px-4 py-2.5 text-[11px] text-[var(--text-faint)]",children:["+",f.length-6," more entries"]})]})})]}),s.jsxs("div",{className:"flex items-center gap-2 border-t border-[var(--border)] pt-3 text-[11px] text-[var(--text-faint)]",children:[s.jsx(Gr,{className:"h-[15px] w-[15px]",strokeWidth:2}),r?`Model generated ${new Date(r.generatedAt).toLocaleString()}`:"No model generated yet"]})]})]}),_&&s.jsx(f2,{onClose:()=>M(!1),onSave:async(S,U)=>{const k=await fetch("/api/model/environments",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:S,baseUrl:U})});if(!k.ok){const D=await k.json().catch(()=>({}));throw new Error(D.error??"Failed")}const H=await k.json();o(D=>D&&{...D,environments:H.environments}),H.defaultEnvironment&&C(H.defaultEnvironment)}})]})}async function h2(n){return await fetch("/api/traces",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}),n.id}async function mm(){try{const n=await fetch("/api/traces");if(n.ok){const r=await n.json();if(Array.isArray(r))return r}}catch{}return[]}async function x2(n){await fetch(`/api/traces/${encodeURIComponent(n)}`,{method:"DELETE"})}async function p2(){await fetch("/api/traces",{method:"DELETE"})}function $t(n){if(typeof n=="string"||typeof n=="number")return""+n;let r="";if(Array.isArray(n))for(let o=0,i;o<n.length;o++)(i=$t(n[o]))!==""&&(r+=(r&&" ")+i);else for(let o in n)n[o]&&(r+=(r&&" ")+o);return r}var dd={exports:{}},fd={},hd={exports:{}},xd={};/**
|
|
370
|
-
* @license React
|
|
371
|
-
* use-sync-external-store-shim.production.js
|
|
372
|
-
*
|
|
373
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
374
|
-
*
|
|
375
|
-
* This source code is licensed under the MIT license found in the
|
|
376
|
-
* LICENSE file in the root directory of this source tree.
|
|
377
|
-
*/var gm;function m2(){if(gm)return xd;gm=1;var n=Yr();function r(b,v){return b===v&&(b!==0||1/b===1/v)||b!==b&&v!==v}var o=typeof Object.is=="function"?Object.is:r,i=n.useState,u=n.useEffect,f=n.useLayoutEffect,h=n.useDebugValue;function g(b,v){var N=v(),C=i({inst:{value:N,getSnapshot:v}}),_=C[0].inst,M=C[1];return f(function(){_.value=N,_.getSnapshot=v,p(_)&&M({inst:_})},[b,N,v]),u(function(){return p(_)&&M({inst:_}),b(function(){p(_)&&M({inst:_})})},[b]),h(N),N}function p(b){var v=b.getSnapshot;b=b.value;try{var N=v();return!o(b,N)}catch{return!0}}function x(b,v){return v()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?x:g;return xd.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:m,xd}var ym;function g2(){return ym||(ym=1,hd.exports=m2()),hd.exports}/**
|
|
378
|
-
* @license React
|
|
379
|
-
* use-sync-external-store-shim/with-selector.production.js
|
|
380
|
-
*
|
|
381
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
382
|
-
*
|
|
383
|
-
* This source code is licensed under the MIT license found in the
|
|
384
|
-
* LICENSE file in the root directory of this source tree.
|
|
385
|
-
*/var bm;function y2(){if(bm)return fd;bm=1;var n=Yr(),r=g2();function o(x,m){return x===m&&(x!==0||1/x===1/m)||x!==x&&m!==m}var i=typeof Object.is=="function"?Object.is:o,u=r.useSyncExternalStore,f=n.useRef,h=n.useEffect,g=n.useMemo,p=n.useDebugValue;return fd.useSyncExternalStoreWithSelector=function(x,m,b,v,N){var C=f(null);if(C.current===null){var _={hasValue:!1,value:null};C.current=_}else _=C.current;C=g(function(){function A(G){if(!Y){if(Y=!0,L=G,G=v(G),N!==void 0&&_.hasValue){var X=_.value;if(N(X,G))return T=X}return T=G}if(X=T,i(L,G))return X;var le=v(G);return N!==void 0&&N(X,le)?(L=G,X):(L=G,T=le)}var Y=!1,L,T,R=b===void 0?null:b;return[function(){return A(m())},R===null?void 0:function(){return A(R())}]},[m,b,v,N]);var M=u(x,C[0],C[1]);return h(function(){_.hasValue=!0,_.value=M},[M]),p(M),M},fd}var vm;function b2(){return vm||(vm=1,dd.exports=y2()),dd.exports}var v2=b2();const j2=S0(v2),N2={},jm=n=>{let r;const o=new Set,i=(m,b)=>{const v=typeof m=="function"?m(r):m;if(!Object.is(v,r)){const N=r;r=b??(typeof v!="object"||v===null)?v:Object.assign({},r,v),o.forEach(C=>C(r,N))}},u=()=>r,p={setState:i,getState:u,getInitialState:()=>x,subscribe:m=>(o.add(m),()=>o.delete(m)),destroy:()=>{(N2?"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."),o.clear()}},x=r=n(i,u,p);return p},w2=n=>n?jm(n):jm,{useDebugValue:S2}=re,{useSyncExternalStoreWithSelector:E2}=j2,k2=n=>n;function H0(n,r=k2,o){const i=E2(n.subscribe,n.getState,n.getServerState||n.getInitialState,r,o);return S2(i),i}const Nm=(n,r)=>{const o=w2(n),i=(u,f=r)=>H0(o,u,f);return Object.assign(i,o),i},_2=(n,r)=>n?Nm(n,r):Nm;function Tt(n,r){if(Object.is(n,r))return!0;if(typeof n!="object"||n===null||typeof r!="object"||r===null)return!1;if(n instanceof Map&&r instanceof Map){if(n.size!==r.size)return!1;for(const[i,u]of n)if(!Object.is(u,r.get(i)))return!1;return!0}if(n instanceof Set&&r instanceof Set){if(n.size!==r.size)return!1;for(const i of n)if(!r.has(i))return!1;return!0}const o=Object.keys(n);if(o.length!==Object.keys(r).length)return!1;for(const i of o)if(!Object.prototype.hasOwnProperty.call(r,i)||!Object.is(n[i],r[i]))return!1;return!0}var C2={value:()=>{}};function Gi(){for(var n=0,r=arguments.length,o={},i;n<r;++n){if(!(i=arguments[n]+"")||i in o||/[\s.]/.test(i))throw new Error("illegal type: "+i);o[i]=[]}return new Ci(o)}function Ci(n){this._=n}function T2(n,r){return n.trim().split(/^|\s+/).map(function(o){var i="",u=o.indexOf(".");if(u>=0&&(i=o.slice(u+1),o=o.slice(0,u)),o&&!r.hasOwnProperty(o))throw new Error("unknown type: "+o);return{type:o,name:i}})}Ci.prototype=Gi.prototype={constructor:Ci,on:function(n,r){var o=this._,i=T2(n+"",o),u,f=-1,h=i.length;if(arguments.length<2){for(;++f<h;)if((u=(n=i[f]).type)&&(u=M2(o[u],n.name)))return u;return}if(r!=null&&typeof r!="function")throw new Error("invalid callback: "+r);for(;++f<h;)if(u=(n=i[f]).type)o[u]=wm(o[u],n.name,r);else if(r==null)for(u in o)o[u]=wm(o[u],n.name,null);return this},copy:function(){var n={},r=this._;for(var o in r)n[o]=r[o].slice();return new Ci(n)},call:function(n,r){if((u=arguments.length-2)>0)for(var o=new Array(u),i=0,u,f;i<u;++i)o[i]=arguments[i+2];if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(f=this._[n],i=0,u=f.length;i<u;++i)f[i].value.apply(r,o)},apply:function(n,r,o){if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(var i=this._[n],u=0,f=i.length;u<f;++u)i[u].value.apply(r,o)}};function M2(n,r){for(var o=0,i=n.length,u;o<i;++o)if((u=n[o]).name===r)return u.value}function wm(n,r,o){for(var i=0,u=n.length;i<u;++i)if(n[i].name===r){n[i]=C2,n=n.slice(0,i).concat(n.slice(i+1));break}return o!=null&&n.push({name:r,value:o}),n}var Ad="http://www.w3.org/1999/xhtml";const Sm={svg:"http://www.w3.org/2000/svg",xhtml:Ad,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Xi(n){var r=n+="",o=r.indexOf(":");return o>=0&&(r=n.slice(0,o))!=="xmlns"&&(n=n.slice(o+1)),Sm.hasOwnProperty(r)?{space:Sm[r],local:n}:n}function A2(n){return function(){var r=this.ownerDocument,o=this.namespaceURI;return o===Ad&&r.documentElement.namespaceURI===Ad?r.createElement(n):r.createElementNS(o,n)}}function R2(n){return function(){return this.ownerDocument.createElementNS(n.space,n.local)}}function $0(n){var r=Xi(n);return(r.local?R2:A2)(r)}function z2(){}function ef(n){return n==null?z2:function(){return this.querySelector(n)}}function O2(n){typeof n!="function"&&(n=ef(n));for(var r=this._groups,o=r.length,i=new Array(o),u=0;u<o;++u)for(var f=r[u],h=f.length,g=i[u]=new Array(h),p,x,m=0;m<h;++m)(p=f[m])&&(x=n.call(p,p.__data__,m,f))&&("__data__"in p&&(x.__data__=p.__data__),g[m]=x);return new rn(i,this._parents)}function D2(n){return n==null?[]:Array.isArray(n)?n:Array.from(n)}function H2(){return[]}function U0(n){return n==null?H2:function(){return this.querySelectorAll(n)}}function $2(n){return function(){return D2(n.apply(this,arguments))}}function U2(n){typeof n=="function"?n=$2(n):n=U0(n);for(var r=this._groups,o=r.length,i=[],u=[],f=0;f<o;++f)for(var h=r[f],g=h.length,p,x=0;x<g;++x)(p=h[x])&&(i.push(n.call(p,p.__data__,x,h)),u.push(p));return new rn(i,u)}function B0(n){return function(){return this.matches(n)}}function q0(n){return function(r){return r.matches(n)}}var B2=Array.prototype.find;function q2(n){return function(){return B2.call(this.children,n)}}function L2(){return this.firstElementChild}function Y2(n){return this.select(n==null?L2:q2(typeof n=="function"?n:q0(n)))}var V2=Array.prototype.filter;function G2(){return Array.from(this.children)}function X2(n){return function(){return V2.call(this.children,n)}}function Z2(n){return this.selectAll(n==null?G2:X2(typeof n=="function"?n:q0(n)))}function W2(n){typeof n!="function"&&(n=B0(n));for(var r=this._groups,o=r.length,i=new Array(o),u=0;u<o;++u)for(var f=r[u],h=f.length,g=i[u]=[],p,x=0;x<h;++x)(p=f[x])&&n.call(p,p.__data__,x,f)&&g.push(p);return new rn(i,this._parents)}function L0(n){return new Array(n.length)}function Q2(){return new rn(this._enter||this._groups.map(L0),this._parents)}function Oi(n,r){this.ownerDocument=n.ownerDocument,this.namespaceURI=n.namespaceURI,this._next=null,this._parent=n,this.__data__=r}Oi.prototype={constructor:Oi,appendChild:function(n){return this._parent.insertBefore(n,this._next)},insertBefore:function(n,r){return this._parent.insertBefore(n,r)},querySelector:function(n){return this._parent.querySelector(n)},querySelectorAll:function(n){return this._parent.querySelectorAll(n)}};function K2(n){return function(){return n}}function J2(n,r,o,i,u,f){for(var h=0,g,p=r.length,x=f.length;h<x;++h)(g=r[h])?(g.__data__=f[h],i[h]=g):o[h]=new Oi(n,f[h]);for(;h<p;++h)(g=r[h])&&(u[h]=g)}function I2(n,r,o,i,u,f,h){var g,p,x=new Map,m=r.length,b=f.length,v=new Array(m),N;for(g=0;g<m;++g)(p=r[g])&&(v[g]=N=h.call(p,p.__data__,g,r)+"",x.has(N)?u[g]=p:x.set(N,p));for(g=0;g<b;++g)N=h.call(n,f[g],g,f)+"",(p=x.get(N))?(i[g]=p,p.__data__=f[g],x.delete(N)):o[g]=new Oi(n,f[g]);for(g=0;g<m;++g)(p=r[g])&&x.get(v[g])===p&&(u[g]=p)}function F2(n){return n.__data__}function P2(n,r){if(!arguments.length)return Array.from(this,F2);var o=r?I2:J2,i=this._parents,u=this._groups;typeof n!="function"&&(n=K2(n));for(var f=u.length,h=new Array(f),g=new Array(f),p=new Array(f),x=0;x<f;++x){var m=i[x],b=u[x],v=b.length,N=ej(n.call(m,m&&m.__data__,x,i)),C=N.length,_=g[x]=new Array(C),M=h[x]=new Array(C),A=p[x]=new Array(v);o(m,b,_,M,A,N,r);for(var Y=0,L=0,T,R;Y<C;++Y)if(T=_[Y]){for(Y>=L&&(L=Y+1);!(R=M[L])&&++L<C;);T._next=R||null}}return h=new rn(h,i),h._enter=g,h._exit=p,h}function ej(n){return typeof n=="object"&&"length"in n?n:Array.from(n)}function tj(){return new rn(this._exit||this._groups.map(L0),this._parents)}function nj(n,r,o){var i=this.enter(),u=this,f=this.exit();return typeof n=="function"?(i=n(i),i&&(i=i.selection())):i=i.append(n+""),r!=null&&(u=r(u),u&&(u=u.selection())),o==null?f.remove():o(f),i&&u?i.merge(u).order():u}function aj(n){for(var r=n.selection?n.selection():n,o=this._groups,i=r._groups,u=o.length,f=i.length,h=Math.min(u,f),g=new Array(u),p=0;p<h;++p)for(var x=o[p],m=i[p],b=x.length,v=g[p]=new Array(b),N,C=0;C<b;++C)(N=x[C]||m[C])&&(v[C]=N);for(;p<u;++p)g[p]=o[p];return new rn(g,this._parents)}function sj(){for(var n=this._groups,r=-1,o=n.length;++r<o;)for(var i=n[r],u=i.length-1,f=i[u],h;--u>=0;)(h=i[u])&&(f&&h.compareDocumentPosition(f)^4&&f.parentNode.insertBefore(h,f),f=h);return this}function lj(n){n||(n=rj);function r(b,v){return b&&v?n(b.__data__,v.__data__):!b-!v}for(var o=this._groups,i=o.length,u=new Array(i),f=0;f<i;++f){for(var h=o[f],g=h.length,p=u[f]=new Array(g),x,m=0;m<g;++m)(x=h[m])&&(p[m]=x);p.sort(r)}return new rn(u,this._parents).order()}function rj(n,r){return n<r?-1:n>r?1:n>=r?0:NaN}function oj(){var n=arguments[0];return arguments[0]=this,n.apply(null,arguments),this}function ij(){return Array.from(this)}function cj(){for(var n=this._groups,r=0,o=n.length;r<o;++r)for(var i=n[r],u=0,f=i.length;u<f;++u){var h=i[u];if(h)return h}return null}function uj(){let n=0;for(const r of this)++n;return n}function dj(){return!this.node()}function fj(n){for(var r=this._groups,o=0,i=r.length;o<i;++o)for(var u=r[o],f=0,h=u.length,g;f<h;++f)(g=u[f])&&n.call(g,g.__data__,f,u);return this}function hj(n){return function(){this.removeAttribute(n)}}function xj(n){return function(){this.removeAttributeNS(n.space,n.local)}}function pj(n,r){return function(){this.setAttribute(n,r)}}function mj(n,r){return function(){this.setAttributeNS(n.space,n.local,r)}}function gj(n,r){return function(){var o=r.apply(this,arguments);o==null?this.removeAttribute(n):this.setAttribute(n,o)}}function yj(n,r){return function(){var o=r.apply(this,arguments);o==null?this.removeAttributeNS(n.space,n.local):this.setAttributeNS(n.space,n.local,o)}}function bj(n,r){var o=Xi(n);if(arguments.length<2){var i=this.node();return o.local?i.getAttributeNS(o.space,o.local):i.getAttribute(o)}return this.each((r==null?o.local?xj:hj:typeof r=="function"?o.local?yj:gj:o.local?mj:pj)(o,r))}function Y0(n){return n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView}function vj(n){return function(){this.style.removeProperty(n)}}function jj(n,r,o){return function(){this.style.setProperty(n,r,o)}}function Nj(n,r,o){return function(){var i=r.apply(this,arguments);i==null?this.style.removeProperty(n):this.style.setProperty(n,i,o)}}function wj(n,r,o){return arguments.length>1?this.each((r==null?vj:typeof r=="function"?Nj:jj)(n,r,o??"")):pl(this.node(),n)}function pl(n,r){return n.style.getPropertyValue(r)||Y0(n).getComputedStyle(n,null).getPropertyValue(r)}function Sj(n){return function(){delete this[n]}}function Ej(n,r){return function(){this[n]=r}}function kj(n,r){return function(){var o=r.apply(this,arguments);o==null?delete this[n]:this[n]=o}}function _j(n,r){return arguments.length>1?this.each((r==null?Sj:typeof r=="function"?kj:Ej)(n,r)):this.node()[n]}function V0(n){return n.trim().split(/^|\s+/)}function tf(n){return n.classList||new G0(n)}function G0(n){this._node=n,this._names=V0(n.getAttribute("class")||"")}G0.prototype={add:function(n){var r=this._names.indexOf(n);r<0&&(this._names.push(n),this._node.setAttribute("class",this._names.join(" ")))},remove:function(n){var r=this._names.indexOf(n);r>=0&&(this._names.splice(r,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(n){return this._names.indexOf(n)>=0}};function X0(n,r){for(var o=tf(n),i=-1,u=r.length;++i<u;)o.add(r[i])}function Z0(n,r){for(var o=tf(n),i=-1,u=r.length;++i<u;)o.remove(r[i])}function Cj(n){return function(){X0(this,n)}}function Tj(n){return function(){Z0(this,n)}}function Mj(n,r){return function(){(r.apply(this,arguments)?X0:Z0)(this,n)}}function Aj(n,r){var o=V0(n+"");if(arguments.length<2){for(var i=tf(this.node()),u=-1,f=o.length;++u<f;)if(!i.contains(o[u]))return!1;return!0}return this.each((typeof r=="function"?Mj:r?Cj:Tj)(o,r))}function Rj(){this.textContent=""}function zj(n){return function(){this.textContent=n}}function Oj(n){return function(){var r=n.apply(this,arguments);this.textContent=r??""}}function Dj(n){return arguments.length?this.each(n==null?Rj:(typeof n=="function"?Oj:zj)(n)):this.node().textContent}function Hj(){this.innerHTML=""}function $j(n){return function(){this.innerHTML=n}}function Uj(n){return function(){var r=n.apply(this,arguments);this.innerHTML=r??""}}function Bj(n){return arguments.length?this.each(n==null?Hj:(typeof n=="function"?Uj:$j)(n)):this.node().innerHTML}function qj(){this.nextSibling&&this.parentNode.appendChild(this)}function Lj(){return this.each(qj)}function Yj(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Vj(){return this.each(Yj)}function Gj(n){var r=typeof n=="function"?n:$0(n);return this.select(function(){return this.appendChild(r.apply(this,arguments))})}function Xj(){return null}function Zj(n,r){var o=typeof n=="function"?n:$0(n),i=r==null?Xj:typeof r=="function"?r:ef(r);return this.select(function(){return this.insertBefore(o.apply(this,arguments),i.apply(this,arguments)||null)})}function Wj(){var n=this.parentNode;n&&n.removeChild(this)}function Qj(){return this.each(Wj)}function Kj(){var n=this.cloneNode(!1),r=this.parentNode;return r?r.insertBefore(n,this.nextSibling):n}function Jj(){var n=this.cloneNode(!0),r=this.parentNode;return r?r.insertBefore(n,this.nextSibling):n}function Ij(n){return this.select(n?Jj:Kj)}function Fj(n){return arguments.length?this.property("__data__",n):this.node().__data__}function Pj(n){return function(r){n.call(this,r,this.__data__)}}function eN(n){return n.trim().split(/^|\s+/).map(function(r){var o="",i=r.indexOf(".");return i>=0&&(o=r.slice(i+1),r=r.slice(0,i)),{type:r,name:o}})}function tN(n){return function(){var r=this.__on;if(r){for(var o=0,i=-1,u=r.length,f;o<u;++o)f=r[o],(!n.type||f.type===n.type)&&f.name===n.name?this.removeEventListener(f.type,f.listener,f.options):r[++i]=f;++i?r.length=i:delete this.__on}}}function nN(n,r,o){return function(){var i=this.__on,u,f=Pj(r);if(i){for(var h=0,g=i.length;h<g;++h)if((u=i[h]).type===n.type&&u.name===n.name){this.removeEventListener(u.type,u.listener,u.options),this.addEventListener(u.type,u.listener=f,u.options=o),u.value=r;return}}this.addEventListener(n.type,f,o),u={type:n.type,name:n.name,value:r,listener:f,options:o},i?i.push(u):this.__on=[u]}}function aN(n,r,o){var i=eN(n+""),u,f=i.length,h;if(arguments.length<2){var g=this.node().__on;if(g){for(var p=0,x=g.length,m;p<x;++p)for(u=0,m=g[p];u<f;++u)if((h=i[u]).type===m.type&&h.name===m.name)return m.value}return}for(g=r?nN:tN,u=0;u<f;++u)this.each(g(i[u],r,o));return this}function W0(n,r,o){var i=Y0(n),u=i.CustomEvent;typeof u=="function"?u=new u(r,o):(u=i.document.createEvent("Event"),o?(u.initEvent(r,o.bubbles,o.cancelable),u.detail=o.detail):u.initEvent(r,!1,!1)),n.dispatchEvent(u)}function sN(n,r){return function(){return W0(this,n,r)}}function lN(n,r){return function(){return W0(this,n,r.apply(this,arguments))}}function rN(n,r){return this.each((typeof r=="function"?lN:sN)(n,r))}function*oN(){for(var n=this._groups,r=0,o=n.length;r<o;++r)for(var i=n[r],u=0,f=i.length,h;u<f;++u)(h=i[u])&&(yield h)}var Q0=[null];function rn(n,r){this._groups=n,this._parents=r}function Xr(){return new rn([[document.documentElement]],Q0)}function iN(){return this}rn.prototype=Xr.prototype={constructor:rn,select:O2,selectAll:U2,selectChild:Y2,selectChildren:Z2,filter:W2,data:P2,enter:Q2,exit:tj,join:nj,merge:aj,selection:iN,order:sj,sort:lj,call:oj,nodes:ij,node:cj,size:uj,empty:dj,each:fj,attr:bj,style:wj,property:_j,classed:Aj,text:Dj,html:Bj,raise:Lj,lower:Vj,append:Gj,insert:Zj,remove:Qj,clone:Ij,datum:Fj,on:aN,dispatch:rN,[Symbol.iterator]:oN};function gn(n){return typeof n=="string"?new rn([[document.querySelector(n)]],[document.documentElement]):new rn([[n]],Q0)}function cN(n){let r;for(;r=n.sourceEvent;)n=r;return n}function Sn(n,r){if(n=cN(n),r===void 0&&(r=n.currentTarget),r){var o=r.ownerSVGElement||r;if(o.createSVGPoint){var i=o.createSVGPoint();return i.x=n.clientX,i.y=n.clientY,i=i.matrixTransform(r.getScreenCTM().inverse()),[i.x,i.y]}if(r.getBoundingClientRect){var u=r.getBoundingClientRect();return[n.clientX-u.left-r.clientLeft,n.clientY-u.top-r.clientTop]}}return[n.pageX,n.pageY]}const uN={passive:!1},Or={capture:!0,passive:!1};function pd(n){n.stopImmediatePropagation()}function fl(n){n.preventDefault(),n.stopImmediatePropagation()}function K0(n){var r=n.document.documentElement,o=gn(n).on("dragstart.drag",fl,Or);"onselectstart"in r?o.on("selectstart.drag",fl,Or):(r.__noselect=r.style.MozUserSelect,r.style.MozUserSelect="none")}function J0(n,r){var o=n.document.documentElement,i=gn(n).on("dragstart.drag",null);r&&(i.on("click.drag",fl,Or),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in o?i.on("selectstart.drag",null):(o.style.MozUserSelect=o.__noselect,delete o.__noselect)}const pi=n=>()=>n;function Rd(n,{sourceEvent:r,subject:o,target:i,identifier:u,active:f,x:h,y:g,dx:p,dy:x,dispatch:m}){Object.defineProperties(this,{type:{value:n,enumerable:!0,configurable:!0},sourceEvent:{value:r,enumerable:!0,configurable:!0},subject:{value:o,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:u,enumerable:!0,configurable:!0},active:{value:f,enumerable:!0,configurable:!0},x:{value:h,enumerable:!0,configurable:!0},y:{value:g,enumerable:!0,configurable:!0},dx:{value:p,enumerable:!0,configurable:!0},dy:{value:x,enumerable:!0,configurable:!0},_:{value:m}})}Rd.prototype.on=function(){var n=this._.on.apply(this._,arguments);return n===this._?this:n};function dN(n){return!n.ctrlKey&&!n.button}function fN(){return this.parentNode}function hN(n,r){return r??{x:n.x,y:n.y}}function xN(){return navigator.maxTouchPoints||"ontouchstart"in this}function pN(){var n=dN,r=fN,o=hN,i=xN,u={},f=Gi("start","drag","end"),h=0,g,p,x,m,b=0;function v(T){T.on("mousedown.drag",N).filter(i).on("touchstart.drag",M).on("touchmove.drag",A,uN).on("touchend.drag touchcancel.drag",Y).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function N(T,R){if(!(m||!n.call(this,T,R))){var G=L(this,r.call(this,T,R),T,R,"mouse");G&&(gn(T.view).on("mousemove.drag",C,Or).on("mouseup.drag",_,Or),K0(T.view),pd(T),x=!1,g=T.clientX,p=T.clientY,G("start",T))}}function C(T){if(fl(T),!x){var R=T.clientX-g,G=T.clientY-p;x=R*R+G*G>b}u.mouse("drag",T)}function _(T){gn(T.view).on("mousemove.drag mouseup.drag",null),J0(T.view,x),fl(T),u.mouse("end",T)}function M(T,R){if(n.call(this,T,R)){var G=T.changedTouches,X=r.call(this,T,R),le=G.length,I,K;for(I=0;I<le;++I)(K=L(this,X,T,R,G[I].identifier,G[I]))&&(pd(T),K("start",T,G[I]))}}function A(T){var R=T.changedTouches,G=R.length,X,le;for(X=0;X<G;++X)(le=u[R[X].identifier])&&(fl(T),le("drag",T,R[X]))}function Y(T){var R=T.changedTouches,G=R.length,X,le;for(m&&clearTimeout(m),m=setTimeout(function(){m=null},500),X=0;X<G;++X)(le=u[R[X].identifier])&&(pd(T),le("end",T,R[X]))}function L(T,R,G,X,le,I){var K=f.copy(),ne=Sn(I||G,R),ee,se,S;if((S=o.call(T,new Rd("beforestart",{sourceEvent:G,target:v,identifier:le,active:h,x:ne[0],y:ne[1],dx:0,dy:0,dispatch:K}),X))!=null)return ee=S.x-ne[0]||0,se=S.y-ne[1]||0,function U(k,H,D){var O=ne,E;switch(k){case"start":u[le]=U,E=h++;break;case"end":delete u[le],--h;case"drag":ne=Sn(D||H,R),E=h;break}K.call(k,T,new Rd(k,{sourceEvent:H,subject:S,target:v,identifier:le,active:E,x:ne[0]+ee,y:ne[1]+se,dx:ne[0]-O[0],dy:ne[1]-O[1],dispatch:K}),X)}}return v.filter=function(T){return arguments.length?(n=typeof T=="function"?T:pi(!!T),v):n},v.container=function(T){return arguments.length?(r=typeof T=="function"?T:pi(T),v):r},v.subject=function(T){return arguments.length?(o=typeof T=="function"?T:pi(T),v):o},v.touchable=function(T){return arguments.length?(i=typeof T=="function"?T:pi(!!T),v):i},v.on=function(){var T=f.on.apply(f,arguments);return T===f?v:T},v.clickDistance=function(T){return arguments.length?(b=(T=+T)*T,v):Math.sqrt(b)},v}function nf(n,r,o){n.prototype=r.prototype=o,o.constructor=n}function I0(n,r){var o=Object.create(n.prototype);for(var i in r)o[i]=r[i];return o}function Zr(){}var Dr=.7,Di=1/Dr,hl="\\s*([+-]?\\d+)\\s*",Hr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",zn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",mN=/^#([0-9a-f]{3,8})$/,gN=new RegExp(`^rgb\\(${hl},${hl},${hl}\\)$`),yN=new RegExp(`^rgb\\(${zn},${zn},${zn}\\)$`),bN=new RegExp(`^rgba\\(${hl},${hl},${hl},${Hr}\\)$`),vN=new RegExp(`^rgba\\(${zn},${zn},${zn},${Hr}\\)$`),jN=new RegExp(`^hsl\\(${Hr},${zn},${zn}\\)$`),NN=new RegExp(`^hsla\\(${Hr},${zn},${zn},${Hr}\\)$`),Em={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};nf(Zr,$r,{copy(n){return Object.assign(new this.constructor,this,n)},displayable(){return this.rgb().displayable()},hex:km,formatHex:km,formatHex8:wN,formatHsl:SN,formatRgb:_m,toString:_m});function km(){return this.rgb().formatHex()}function wN(){return this.rgb().formatHex8()}function SN(){return F0(this).formatHsl()}function _m(){return this.rgb().formatRgb()}function $r(n){var r,o;return n=(n+"").trim().toLowerCase(),(r=mN.exec(n))?(o=r[1].length,r=parseInt(r[1],16),o===6?Cm(r):o===3?new Kt(r>>8&15|r>>4&240,r>>4&15|r&240,(r&15)<<4|r&15,1):o===8?mi(r>>24&255,r>>16&255,r>>8&255,(r&255)/255):o===4?mi(r>>12&15|r>>8&240,r>>8&15|r>>4&240,r>>4&15|r&240,((r&15)<<4|r&15)/255):null):(r=gN.exec(n))?new Kt(r[1],r[2],r[3],1):(r=yN.exec(n))?new Kt(r[1]*255/100,r[2]*255/100,r[3]*255/100,1):(r=bN.exec(n))?mi(r[1],r[2],r[3],r[4]):(r=vN.exec(n))?mi(r[1]*255/100,r[2]*255/100,r[3]*255/100,r[4]):(r=jN.exec(n))?Am(r[1],r[2]/100,r[3]/100,1):(r=NN.exec(n))?Am(r[1],r[2]/100,r[3]/100,r[4]):Em.hasOwnProperty(n)?Cm(Em[n]):n==="transparent"?new Kt(NaN,NaN,NaN,0):null}function Cm(n){return new Kt(n>>16&255,n>>8&255,n&255,1)}function mi(n,r,o,i){return i<=0&&(n=r=o=NaN),new Kt(n,r,o,i)}function EN(n){return n instanceof Zr||(n=$r(n)),n?(n=n.rgb(),new Kt(n.r,n.g,n.b,n.opacity)):new Kt}function zd(n,r,o,i){return arguments.length===1?EN(n):new Kt(n,r,o,i??1)}function Kt(n,r,o,i){this.r=+n,this.g=+r,this.b=+o,this.opacity=+i}nf(Kt,zd,I0(Zr,{brighter(n){return n=n==null?Di:Math.pow(Di,n),new Kt(this.r*n,this.g*n,this.b*n,this.opacity)},darker(n){return n=n==null?Dr:Math.pow(Dr,n),new Kt(this.r*n,this.g*n,this.b*n,this.opacity)},rgb(){return this},clamp(){return new Kt(fs(this.r),fs(this.g),fs(this.b),Hi(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:Tm,formatHex:Tm,formatHex8:kN,formatRgb:Mm,toString:Mm}));function Tm(){return`#${us(this.r)}${us(this.g)}${us(this.b)}`}function kN(){return`#${us(this.r)}${us(this.g)}${us(this.b)}${us((isNaN(this.opacity)?1:this.opacity)*255)}`}function Mm(){const n=Hi(this.opacity);return`${n===1?"rgb(":"rgba("}${fs(this.r)}, ${fs(this.g)}, ${fs(this.b)}${n===1?")":`, ${n})`}`}function Hi(n){return isNaN(n)?1:Math.max(0,Math.min(1,n))}function fs(n){return Math.max(0,Math.min(255,Math.round(n)||0))}function us(n){return n=fs(n),(n<16?"0":"")+n.toString(16)}function Am(n,r,o,i){return i<=0?n=r=o=NaN:o<=0||o>=1?n=r=NaN:r<=0&&(n=NaN),new En(n,r,o,i)}function F0(n){if(n instanceof En)return new En(n.h,n.s,n.l,n.opacity);if(n instanceof Zr||(n=$r(n)),!n)return new En;if(n instanceof En)return n;n=n.rgb();var r=n.r/255,o=n.g/255,i=n.b/255,u=Math.min(r,o,i),f=Math.max(r,o,i),h=NaN,g=f-u,p=(f+u)/2;return g?(r===f?h=(o-i)/g+(o<i)*6:o===f?h=(i-r)/g+2:h=(r-o)/g+4,g/=p<.5?f+u:2-f-u,h*=60):g=p>0&&p<1?0:h,new En(h,g,p,n.opacity)}function _N(n,r,o,i){return arguments.length===1?F0(n):new En(n,r,o,i??1)}function En(n,r,o,i){this.h=+n,this.s=+r,this.l=+o,this.opacity=+i}nf(En,_N,I0(Zr,{brighter(n){return n=n==null?Di:Math.pow(Di,n),new En(this.h,this.s,this.l*n,this.opacity)},darker(n){return n=n==null?Dr:Math.pow(Dr,n),new En(this.h,this.s,this.l*n,this.opacity)},rgb(){var n=this.h%360+(this.h<0)*360,r=isNaN(n)||isNaN(this.s)?0:this.s,o=this.l,i=o+(o<.5?o:1-o)*r,u=2*o-i;return new Kt(md(n>=240?n-240:n+120,u,i),md(n,u,i),md(n<120?n+240:n-120,u,i),this.opacity)},clamp(){return new En(Rm(this.h),gi(this.s),gi(this.l),Hi(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 n=Hi(this.opacity);return`${n===1?"hsl(":"hsla("}${Rm(this.h)}, ${gi(this.s)*100}%, ${gi(this.l)*100}%${n===1?")":`, ${n})`}`}}));function Rm(n){return n=(n||0)%360,n<0?n+360:n}function gi(n){return Math.max(0,Math.min(1,n||0))}function md(n,r,o){return(n<60?r+(o-r)*n/60:n<180?o:n<240?r+(o-r)*(240-n)/60:r)*255}const P0=n=>()=>n;function CN(n,r){return function(o){return n+o*r}}function TN(n,r,o){return n=Math.pow(n,o),r=Math.pow(r,o)-n,o=1/o,function(i){return Math.pow(n+i*r,o)}}function MN(n){return(n=+n)==1?eg:function(r,o){return o-r?TN(r,o,n):P0(isNaN(r)?o:r)}}function eg(n,r){var o=r-n;return o?CN(n,o):P0(isNaN(n)?r:n)}const zm=(function n(r){var o=MN(r);function i(u,f){var h=o((u=zd(u)).r,(f=zd(f)).r),g=o(u.g,f.g),p=o(u.b,f.b),x=eg(u.opacity,f.opacity);return function(m){return u.r=h(m),u.g=g(m),u.b=p(m),u.opacity=x(m),u+""}}return i.gamma=n,i})(1);function Ha(n,r){return n=+n,r=+r,function(o){return n*(1-o)+r*o}}var Od=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,gd=new RegExp(Od.source,"g");function AN(n){return function(){return n}}function RN(n){return function(r){return n(r)+""}}function zN(n,r){var o=Od.lastIndex=gd.lastIndex=0,i,u,f,h=-1,g=[],p=[];for(n=n+"",r=r+"";(i=Od.exec(n))&&(u=gd.exec(r));)(f=u.index)>o&&(f=r.slice(o,f),g[h]?g[h]+=f:g[++h]=f),(i=i[0])===(u=u[0])?g[h]?g[h]+=u:g[++h]=u:(g[++h]=null,p.push({i:h,x:Ha(i,u)})),o=gd.lastIndex;return o<r.length&&(f=r.slice(o),g[h]?g[h]+=f:g[++h]=f),g.length<2?p[0]?RN(p[0].x):AN(r):(r=p.length,function(x){for(var m=0,b;m<r;++m)g[(b=p[m]).i]=b.x(x);return g.join("")})}var Om=180/Math.PI,Dd={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function tg(n,r,o,i,u,f){var h,g,p;return(h=Math.sqrt(n*n+r*r))&&(n/=h,r/=h),(p=n*o+r*i)&&(o-=n*p,i-=r*p),(g=Math.sqrt(o*o+i*i))&&(o/=g,i/=g,p/=g),n*i<r*o&&(n=-n,r=-r,p=-p,h=-h),{translateX:u,translateY:f,rotate:Math.atan2(r,n)*Om,skewX:Math.atan(p)*Om,scaleX:h,scaleY:g}}var yi;function ON(n){const r=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(n+"");return r.isIdentity?Dd:tg(r.a,r.b,r.c,r.d,r.e,r.f)}function DN(n){return n==null||(yi||(yi=document.createElementNS("http://www.w3.org/2000/svg","g")),yi.setAttribute("transform",n),!(n=yi.transform.baseVal.consolidate()))?Dd:(n=n.matrix,tg(n.a,n.b,n.c,n.d,n.e,n.f))}function ng(n,r,o,i){function u(x){return x.length?x.pop()+" ":""}function f(x,m,b,v,N,C){if(x!==b||m!==v){var _=N.push("translate(",null,r,null,o);C.push({i:_-4,x:Ha(x,b)},{i:_-2,x:Ha(m,v)})}else(b||v)&&N.push("translate("+b+r+v+o)}function h(x,m,b,v){x!==m?(x-m>180?m+=360:m-x>180&&(x+=360),v.push({i:b.push(u(b)+"rotate(",null,i)-2,x:Ha(x,m)})):m&&b.push(u(b)+"rotate("+m+i)}function g(x,m,b,v){x!==m?v.push({i:b.push(u(b)+"skewX(",null,i)-2,x:Ha(x,m)}):m&&b.push(u(b)+"skewX("+m+i)}function p(x,m,b,v,N,C){if(x!==b||m!==v){var _=N.push(u(N)+"scale(",null,",",null,")");C.push({i:_-4,x:Ha(x,b)},{i:_-2,x:Ha(m,v)})}else(b!==1||v!==1)&&N.push(u(N)+"scale("+b+","+v+")")}return function(x,m){var b=[],v=[];return x=n(x),m=n(m),f(x.translateX,x.translateY,m.translateX,m.translateY,b,v),h(x.rotate,m.rotate,b,v),g(x.skewX,m.skewX,b,v),p(x.scaleX,x.scaleY,m.scaleX,m.scaleY,b,v),x=m=null,function(N){for(var C=-1,_=v.length,M;++C<_;)b[(M=v[C]).i]=M.x(N);return b.join("")}}}var HN=ng(ON,"px, ","px)","deg)"),$N=ng(DN,", ",")",")"),UN=1e-12;function Dm(n){return((n=Math.exp(n))+1/n)/2}function BN(n){return((n=Math.exp(n))-1/n)/2}function qN(n){return((n=Math.exp(2*n))-1)/(n+1)}const LN=(function n(r,o,i){function u(f,h){var g=f[0],p=f[1],x=f[2],m=h[0],b=h[1],v=h[2],N=m-g,C=b-p,_=N*N+C*C,M,A;if(_<UN)A=Math.log(v/x)/r,M=function(X){return[g+X*N,p+X*C,x*Math.exp(r*X*A)]};else{var Y=Math.sqrt(_),L=(v*v-x*x+i*_)/(2*x*o*Y),T=(v*v-x*x-i*_)/(2*v*o*Y),R=Math.log(Math.sqrt(L*L+1)-L),G=Math.log(Math.sqrt(T*T+1)-T);A=(G-R)/r,M=function(X){var le=X*A,I=Dm(R),K=x/(o*Y)*(I*qN(r*le+R)-BN(R));return[g+K*N,p+K*C,x*I/Dm(r*le+R)]}}return M.duration=A*1e3*r/Math.SQRT2,M}return u.rho=function(f){var h=Math.max(.001,+f),g=h*h,p=g*g;return n(h,g,p)},u})(Math.SQRT2,2,4);var ml=0,Cr=0,Nr=0,ag=1e3,$i,Tr,Ui=0,xs=0,Zi=0,Ur=typeof performance=="object"&&performance.now?performance:Date,sg=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(n){setTimeout(n,17)};function af(){return xs||(sg(YN),xs=Ur.now()+Zi)}function YN(){xs=0}function Bi(){this._call=this._time=this._next=null}Bi.prototype=lg.prototype={constructor:Bi,restart:function(n,r,o){if(typeof n!="function")throw new TypeError("callback is not a function");o=(o==null?af():+o)+(r==null?0:+r),!this._next&&Tr!==this&&(Tr?Tr._next=this:$i=this,Tr=this),this._call=n,this._time=o,Hd()},stop:function(){this._call&&(this._call=null,this._time=1/0,Hd())}};function lg(n,r,o){var i=new Bi;return i.restart(n,r,o),i}function VN(){af(),++ml;for(var n=$i,r;n;)(r=xs-n._time)>=0&&n._call.call(void 0,r),n=n._next;--ml}function Hm(){xs=(Ui=Ur.now())+Zi,ml=Cr=0;try{VN()}finally{ml=0,XN(),xs=0}}function GN(){var n=Ur.now(),r=n-Ui;r>ag&&(Zi-=r,Ui=n)}function XN(){for(var n,r=$i,o,i=1/0;r;)r._call?(i>r._time&&(i=r._time),n=r,r=r._next):(o=r._next,r._next=null,r=n?n._next=o:$i=o);Tr=n,Hd(i)}function Hd(n){if(!ml){Cr&&(Cr=clearTimeout(Cr));var r=n-xs;r>24?(n<1/0&&(Cr=setTimeout(Hm,n-Ur.now()-Zi)),Nr&&(Nr=clearInterval(Nr))):(Nr||(Ui=Ur.now(),Nr=setInterval(GN,ag)),ml=1,sg(Hm))}}function $m(n,r,o){var i=new Bi;return r=r==null?0:+r,i.restart(u=>{i.stop(),n(u+r)},r,o),i}var ZN=Gi("start","end","cancel","interrupt"),WN=[],rg=0,Um=1,$d=2,Ti=3,Bm=4,Ud=5,Mi=6;function Wi(n,r,o,i,u,f){var h=n.__transition;if(!h)n.__transition={};else if(o in h)return;QN(n,o,{name:r,index:i,group:u,on:ZN,tween:WN,time:f.time,delay:f.delay,duration:f.duration,ease:f.ease,timer:null,state:rg})}function sf(n,r){var o=kn(n,r);if(o.state>rg)throw new Error("too late; already scheduled");return o}function On(n,r){var o=kn(n,r);if(o.state>Ti)throw new Error("too late; already running");return o}function kn(n,r){var o=n.__transition;if(!o||!(o=o[r]))throw new Error("transition not found");return o}function QN(n,r,o){var i=n.__transition,u;i[r]=o,o.timer=lg(f,0,o.time);function f(x){o.state=Um,o.timer.restart(h,o.delay,o.time),o.delay<=x&&h(x-o.delay)}function h(x){var m,b,v,N;if(o.state!==Um)return p();for(m in i)if(N=i[m],N.name===o.name){if(N.state===Ti)return $m(h);N.state===Bm?(N.state=Mi,N.timer.stop(),N.on.call("interrupt",n,n.__data__,N.index,N.group),delete i[m]):+m<r&&(N.state=Mi,N.timer.stop(),N.on.call("cancel",n,n.__data__,N.index,N.group),delete i[m])}if($m(function(){o.state===Ti&&(o.state=Bm,o.timer.restart(g,o.delay,o.time),g(x))}),o.state=$d,o.on.call("start",n,n.__data__,o.index,o.group),o.state===$d){for(o.state=Ti,u=new Array(v=o.tween.length),m=0,b=-1;m<v;++m)(N=o.tween[m].value.call(n,n.__data__,o.index,o.group))&&(u[++b]=N);u.length=b+1}}function g(x){for(var m=x<o.duration?o.ease.call(null,x/o.duration):(o.timer.restart(p),o.state=Ud,1),b=-1,v=u.length;++b<v;)u[b].call(n,m);o.state===Ud&&(o.on.call("end",n,n.__data__,o.index,o.group),p())}function p(){o.state=Mi,o.timer.stop(),delete i[r];for(var x in i)return;delete n.__transition}}function Ai(n,r){var o=n.__transition,i,u,f=!0,h;if(o){r=r==null?null:r+"";for(h in o){if((i=o[h]).name!==r){f=!1;continue}u=i.state>$d&&i.state<Ud,i.state=Mi,i.timer.stop(),i.on.call(u?"interrupt":"cancel",n,n.__data__,i.index,i.group),delete o[h]}f&&delete n.__transition}}function KN(n){return this.each(function(){Ai(this,n)})}function JN(n,r){var o,i;return function(){var u=On(this,n),f=u.tween;if(f!==o){i=o=f;for(var h=0,g=i.length;h<g;++h)if(i[h].name===r){i=i.slice(),i.splice(h,1);break}}u.tween=i}}function IN(n,r,o){var i,u;if(typeof o!="function")throw new Error;return function(){var f=On(this,n),h=f.tween;if(h!==i){u=(i=h).slice();for(var g={name:r,value:o},p=0,x=u.length;p<x;++p)if(u[p].name===r){u[p]=g;break}p===x&&u.push(g)}f.tween=u}}function FN(n,r){var o=this._id;if(n+="",arguments.length<2){for(var i=kn(this.node(),o).tween,u=0,f=i.length,h;u<f;++u)if((h=i[u]).name===n)return h.value;return null}return this.each((r==null?JN:IN)(o,n,r))}function lf(n,r,o){var i=n._id;return n.each(function(){var u=On(this,i);(u.value||(u.value={}))[r]=o.apply(this,arguments)}),function(u){return kn(u,i).value[r]}}function og(n,r){var o;return(typeof r=="number"?Ha:r instanceof $r?zm:(o=$r(r))?(r=o,zm):zN)(n,r)}function PN(n){return function(){this.removeAttribute(n)}}function ew(n){return function(){this.removeAttributeNS(n.space,n.local)}}function tw(n,r,o){var i,u=o+"",f;return function(){var h=this.getAttribute(n);return h===u?null:h===i?f:f=r(i=h,o)}}function nw(n,r,o){var i,u=o+"",f;return function(){var h=this.getAttributeNS(n.space,n.local);return h===u?null:h===i?f:f=r(i=h,o)}}function aw(n,r,o){var i,u,f;return function(){var h,g=o(this),p;return g==null?void this.removeAttribute(n):(h=this.getAttribute(n),p=g+"",h===p?null:h===i&&p===u?f:(u=p,f=r(i=h,g)))}}function sw(n,r,o){var i,u,f;return function(){var h,g=o(this),p;return g==null?void this.removeAttributeNS(n.space,n.local):(h=this.getAttributeNS(n.space,n.local),p=g+"",h===p?null:h===i&&p===u?f:(u=p,f=r(i=h,g)))}}function lw(n,r){var o=Xi(n),i=o==="transform"?$N:og;return this.attrTween(n,typeof r=="function"?(o.local?sw:aw)(o,i,lf(this,"attr."+n,r)):r==null?(o.local?ew:PN)(o):(o.local?nw:tw)(o,i,r))}function rw(n,r){return function(o){this.setAttribute(n,r.call(this,o))}}function ow(n,r){return function(o){this.setAttributeNS(n.space,n.local,r.call(this,o))}}function iw(n,r){var o,i;function u(){var f=r.apply(this,arguments);return f!==i&&(o=(i=f)&&ow(n,f)),o}return u._value=r,u}function cw(n,r){var o,i;function u(){var f=r.apply(this,arguments);return f!==i&&(o=(i=f)&&rw(n,f)),o}return u._value=r,u}function uw(n,r){var o="attr."+n;if(arguments.length<2)return(o=this.tween(o))&&o._value;if(r==null)return this.tween(o,null);if(typeof r!="function")throw new Error;var i=Xi(n);return this.tween(o,(i.local?iw:cw)(i,r))}function dw(n,r){return function(){sf(this,n).delay=+r.apply(this,arguments)}}function fw(n,r){return r=+r,function(){sf(this,n).delay=r}}function hw(n){var r=this._id;return arguments.length?this.each((typeof n=="function"?dw:fw)(r,n)):kn(this.node(),r).delay}function xw(n,r){return function(){On(this,n).duration=+r.apply(this,arguments)}}function pw(n,r){return r=+r,function(){On(this,n).duration=r}}function mw(n){var r=this._id;return arguments.length?this.each((typeof n=="function"?xw:pw)(r,n)):kn(this.node(),r).duration}function gw(n,r){if(typeof r!="function")throw new Error;return function(){On(this,n).ease=r}}function yw(n){var r=this._id;return arguments.length?this.each(gw(r,n)):kn(this.node(),r).ease}function bw(n,r){return function(){var o=r.apply(this,arguments);if(typeof o!="function")throw new Error;On(this,n).ease=o}}function vw(n){if(typeof n!="function")throw new Error;return this.each(bw(this._id,n))}function jw(n){typeof n!="function"&&(n=B0(n));for(var r=this._groups,o=r.length,i=new Array(o),u=0;u<o;++u)for(var f=r[u],h=f.length,g=i[u]=[],p,x=0;x<h;++x)(p=f[x])&&n.call(p,p.__data__,x,f)&&g.push(p);return new sa(i,this._parents,this._name,this._id)}function Nw(n){if(n._id!==this._id)throw new Error;for(var r=this._groups,o=n._groups,i=r.length,u=o.length,f=Math.min(i,u),h=new Array(i),g=0;g<f;++g)for(var p=r[g],x=o[g],m=p.length,b=h[g]=new Array(m),v,N=0;N<m;++N)(v=p[N]||x[N])&&(b[N]=v);for(;g<i;++g)h[g]=r[g];return new sa(h,this._parents,this._name,this._id)}function ww(n){return(n+"").trim().split(/^|\s+/).every(function(r){var o=r.indexOf(".");return o>=0&&(r=r.slice(0,o)),!r||r==="start"})}function Sw(n,r,o){var i,u,f=ww(r)?sf:On;return function(){var h=f(this,n),g=h.on;g!==i&&(u=(i=g).copy()).on(r,o),h.on=u}}function Ew(n,r){var o=this._id;return arguments.length<2?kn(this.node(),o).on.on(n):this.each(Sw(o,n,r))}function kw(n){return function(){var r=this.parentNode;for(var o in this.__transition)if(+o!==n)return;r&&r.removeChild(this)}}function _w(){return this.on("end.remove",kw(this._id))}function Cw(n){var r=this._name,o=this._id;typeof n!="function"&&(n=ef(n));for(var i=this._groups,u=i.length,f=new Array(u),h=0;h<u;++h)for(var g=i[h],p=g.length,x=f[h]=new Array(p),m,b,v=0;v<p;++v)(m=g[v])&&(b=n.call(m,m.__data__,v,g))&&("__data__"in m&&(b.__data__=m.__data__),x[v]=b,Wi(x[v],r,o,v,x,kn(m,o)));return new sa(f,this._parents,r,o)}function Tw(n){var r=this._name,o=this._id;typeof n!="function"&&(n=U0(n));for(var i=this._groups,u=i.length,f=[],h=[],g=0;g<u;++g)for(var p=i[g],x=p.length,m,b=0;b<x;++b)if(m=p[b]){for(var v=n.call(m,m.__data__,b,p),N,C=kn(m,o),_=0,M=v.length;_<M;++_)(N=v[_])&&Wi(N,r,o,_,v,C);f.push(v),h.push(m)}return new sa(f,h,r,o)}var Mw=Xr.prototype.constructor;function Aw(){return new Mw(this._groups,this._parents)}function Rw(n,r){var o,i,u;return function(){var f=pl(this,n),h=(this.style.removeProperty(n),pl(this,n));return f===h?null:f===o&&h===i?u:u=r(o=f,i=h)}}function ig(n){return function(){this.style.removeProperty(n)}}function zw(n,r,o){var i,u=o+"",f;return function(){var h=pl(this,n);return h===u?null:h===i?f:f=r(i=h,o)}}function Ow(n,r,o){var i,u,f;return function(){var h=pl(this,n),g=o(this),p=g+"";return g==null&&(p=g=(this.style.removeProperty(n),pl(this,n))),h===p?null:h===i&&p===u?f:(u=p,f=r(i=h,g))}}function Dw(n,r){var o,i,u,f="style."+r,h="end."+f,g;return function(){var p=On(this,n),x=p.on,m=p.value[f]==null?g||(g=ig(r)):void 0;(x!==o||u!==m)&&(i=(o=x).copy()).on(h,u=m),p.on=i}}function Hw(n,r,o){var i=(n+="")=="transform"?HN:og;return r==null?this.styleTween(n,Rw(n,i)).on("end.style."+n,ig(n)):typeof r=="function"?this.styleTween(n,Ow(n,i,lf(this,"style."+n,r))).each(Dw(this._id,n)):this.styleTween(n,zw(n,i,r),o).on("end.style."+n,null)}function $w(n,r,o){return function(i){this.style.setProperty(n,r.call(this,i),o)}}function Uw(n,r,o){var i,u;function f(){var h=r.apply(this,arguments);return h!==u&&(i=(u=h)&&$w(n,h,o)),i}return f._value=r,f}function Bw(n,r,o){var i="style."+(n+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(r==null)return this.tween(i,null);if(typeof r!="function")throw new Error;return this.tween(i,Uw(n,r,o??""))}function qw(n){return function(){this.textContent=n}}function Lw(n){return function(){var r=n(this);this.textContent=r??""}}function Yw(n){return this.tween("text",typeof n=="function"?Lw(lf(this,"text",n)):qw(n==null?"":n+""))}function Vw(n){return function(r){this.textContent=n.call(this,r)}}function Gw(n){var r,o;function i(){var u=n.apply(this,arguments);return u!==o&&(r=(o=u)&&Vw(u)),r}return i._value=n,i}function Xw(n){var r="text";if(arguments.length<1)return(r=this.tween(r))&&r._value;if(n==null)return this.tween(r,null);if(typeof n!="function")throw new Error;return this.tween(r,Gw(n))}function Zw(){for(var n=this._name,r=this._id,o=cg(),i=this._groups,u=i.length,f=0;f<u;++f)for(var h=i[f],g=h.length,p,x=0;x<g;++x)if(p=h[x]){var m=kn(p,r);Wi(p,n,o,x,h,{time:m.time+m.delay+m.duration,delay:0,duration:m.duration,ease:m.ease})}return new sa(i,this._parents,n,o)}function Ww(){var n,r,o=this,i=o._id,u=o.size();return new Promise(function(f,h){var g={value:h},p={value:function(){--u===0&&f()}};o.each(function(){var x=On(this,i),m=x.on;m!==n&&(r=(n=m).copy(),r._.cancel.push(g),r._.interrupt.push(g),r._.end.push(p)),x.on=r}),u===0&&f()})}var Qw=0;function sa(n,r,o,i){this._groups=n,this._parents=r,this._name=o,this._id=i}function cg(){return++Qw}var Fn=Xr.prototype;sa.prototype={constructor:sa,select:Cw,selectAll:Tw,selectChild:Fn.selectChild,selectChildren:Fn.selectChildren,filter:jw,merge:Nw,selection:Aw,transition:Zw,call:Fn.call,nodes:Fn.nodes,node:Fn.node,size:Fn.size,empty:Fn.empty,each:Fn.each,on:Ew,attr:lw,attrTween:uw,style:Hw,styleTween:Bw,text:Yw,textTween:Xw,remove:_w,tween:FN,delay:hw,duration:mw,ease:yw,easeVarying:vw,end:Ww,[Symbol.iterator]:Fn[Symbol.iterator]};function Kw(n){return((n*=2)<=1?n*n*n:(n-=2)*n*n+2)/2}var Jw={time:null,delay:0,duration:250,ease:Kw};function Iw(n,r){for(var o;!(o=n.__transition)||!(o=o[r]);)if(!(n=n.parentNode))throw new Error(`transition ${r} not found`);return o}function Fw(n){var r,o;n instanceof sa?(r=n._id,n=n._name):(r=cg(),(o=Jw).time=af(),n=n==null?null:n+"");for(var i=this._groups,u=i.length,f=0;f<u;++f)for(var h=i[f],g=h.length,p,x=0;x<g;++x)(p=h[x])&&Wi(p,n,r,x,h,o||Iw(p,r));return new sa(i,this._parents,n,r)}Xr.prototype.interrupt=KN;Xr.prototype.transition=Fw;const bi=n=>()=>n;function Pw(n,{sourceEvent:r,target:o,transform:i,dispatch:u}){Object.defineProperties(this,{type:{value:n,enumerable:!0,configurable:!0},sourceEvent:{value:r,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:u}})}function Pn(n,r,o){this.k=n,this.x=r,this.y=o}Pn.prototype={constructor:Pn,scale:function(n){return n===1?this:new Pn(this.k*n,this.x,this.y)},translate:function(n,r){return n===0&r===0?this:new Pn(this.k,this.x+this.k*n,this.y+this.k*r)},apply:function(n){return[n[0]*this.k+this.x,n[1]*this.k+this.y]},applyX:function(n){return n*this.k+this.x},applyY:function(n){return n*this.k+this.y},invert:function(n){return[(n[0]-this.x)/this.k,(n[1]-this.y)/this.k]},invertX:function(n){return(n-this.x)/this.k},invertY:function(n){return(n-this.y)/this.k},rescaleX:function(n){return n.copy().domain(n.range().map(this.invertX,this).map(n.invert,n))},rescaleY:function(n){return n.copy().domain(n.range().map(this.invertY,this).map(n.invert,n))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var ta=new Pn(1,0,0);Pn.prototype;function yd(n){n.stopImmediatePropagation()}function wr(n){n.preventDefault(),n.stopImmediatePropagation()}function e5(n){return(!n.ctrlKey||n.type==="wheel")&&!n.button}function t5(){var n=this;return n instanceof SVGElement?(n=n.ownerSVGElement||n,n.hasAttribute("viewBox")?(n=n.viewBox.baseVal,[[n.x,n.y],[n.x+n.width,n.y+n.height]]):[[0,0],[n.width.baseVal.value,n.height.baseVal.value]]):[[0,0],[n.clientWidth,n.clientHeight]]}function qm(){return this.__zoom||ta}function n5(n){return-n.deltaY*(n.deltaMode===1?.05:n.deltaMode?1:.002)*(n.ctrlKey?10:1)}function a5(){return navigator.maxTouchPoints||"ontouchstart"in this}function s5(n,r,o){var i=n.invertX(r[0][0])-o[0][0],u=n.invertX(r[1][0])-o[1][0],f=n.invertY(r[0][1])-o[0][1],h=n.invertY(r[1][1])-o[1][1];return n.translate(u>i?(i+u)/2:Math.min(0,i)||Math.max(0,u),h>f?(f+h)/2:Math.min(0,f)||Math.max(0,h))}function ug(){var n=e5,r=t5,o=s5,i=n5,u=a5,f=[0,1/0],h=[[-1/0,-1/0],[1/0,1/0]],g=250,p=LN,x=Gi("start","zoom","end"),m,b,v,N=500,C=150,_=0,M=10;function A(S){S.property("__zoom",qm).on("wheel.zoom",le,{passive:!1}).on("mousedown.zoom",I).on("dblclick.zoom",K).filter(u).on("touchstart.zoom",ne).on("touchmove.zoom",ee).on("touchend.zoom touchcancel.zoom",se).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}A.transform=function(S,U,k,H){var D=S.selection?S.selection():S;D.property("__zoom",qm),S!==D?R(S,U,k,H):D.interrupt().each(function(){G(this,arguments).event(H).start().zoom(null,typeof U=="function"?U.apply(this,arguments):U).end()})},A.scaleBy=function(S,U,k,H){A.scaleTo(S,function(){var D=this.__zoom.k,O=typeof U=="function"?U.apply(this,arguments):U;return D*O},k,H)},A.scaleTo=function(S,U,k,H){A.transform(S,function(){var D=r.apply(this,arguments),O=this.__zoom,E=k==null?T(D):typeof k=="function"?k.apply(this,arguments):k,$=O.invert(E),W=typeof U=="function"?U.apply(this,arguments):U;return o(L(Y(O,W),E,$),D,h)},k,H)},A.translateBy=function(S,U,k,H){A.transform(S,function(){return o(this.__zoom.translate(typeof U=="function"?U.apply(this,arguments):U,typeof k=="function"?k.apply(this,arguments):k),r.apply(this,arguments),h)},null,H)},A.translateTo=function(S,U,k,H,D){A.transform(S,function(){var O=r.apply(this,arguments),E=this.__zoom,$=H==null?T(O):typeof H=="function"?H.apply(this,arguments):H;return o(ta.translate($[0],$[1]).scale(E.k).translate(typeof U=="function"?-U.apply(this,arguments):-U,typeof k=="function"?-k.apply(this,arguments):-k),O,h)},H,D)};function Y(S,U){return U=Math.max(f[0],Math.min(f[1],U)),U===S.k?S:new Pn(U,S.x,S.y)}function L(S,U,k){var H=U[0]-k[0]*S.k,D=U[1]-k[1]*S.k;return H===S.x&&D===S.y?S:new Pn(S.k,H,D)}function T(S){return[(+S[0][0]+ +S[1][0])/2,(+S[0][1]+ +S[1][1])/2]}function R(S,U,k,H){S.on("start.zoom",function(){G(this,arguments).event(H).start()}).on("interrupt.zoom end.zoom",function(){G(this,arguments).event(H).end()}).tween("zoom",function(){var D=this,O=arguments,E=G(D,O).event(H),$=r.apply(D,O),W=k==null?T($):typeof k=="function"?k.apply(D,O):k,ae=Math.max($[1][0]-$[0][0],$[1][1]-$[0][1]),ie=D.__zoom,he=typeof U=="function"?U.apply(D,O):U,xe=p(ie.invert(W).concat(ae/ie.k),he.invert(W).concat(ae/he.k));return function(Se){if(Se===1)Se=he;else{var ve=xe(Se),Ae=ae/ve[2];Se=new Pn(Ae,W[0]-ve[0]*Ae,W[1]-ve[1]*Ae)}E.zoom(null,Se)}})}function G(S,U,k){return!k&&S.__zooming||new X(S,U)}function X(S,U){this.that=S,this.args=U,this.active=0,this.sourceEvent=null,this.extent=r.apply(S,U),this.taps=0}X.prototype={event:function(S){return S&&(this.sourceEvent=S),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(S,U){return this.mouse&&S!=="mouse"&&(this.mouse[1]=U.invert(this.mouse[0])),this.touch0&&S!=="touch"&&(this.touch0[1]=U.invert(this.touch0[0])),this.touch1&&S!=="touch"&&(this.touch1[1]=U.invert(this.touch1[0])),this.that.__zoom=U,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(S){var U=gn(this.that).datum();x.call(S,this.that,new Pw(S,{sourceEvent:this.sourceEvent,target:A,transform:this.that.__zoom,dispatch:x}),U)}};function le(S,...U){if(!n.apply(this,arguments))return;var k=G(this,U).event(S),H=this.__zoom,D=Math.max(f[0],Math.min(f[1],H.k*Math.pow(2,i.apply(this,arguments)))),O=Sn(S);if(k.wheel)(k.mouse[0][0]!==O[0]||k.mouse[0][1]!==O[1])&&(k.mouse[1]=H.invert(k.mouse[0]=O)),clearTimeout(k.wheel);else{if(H.k===D)return;k.mouse=[O,H.invert(O)],Ai(this),k.start()}wr(S),k.wheel=setTimeout(E,C),k.zoom("mouse",o(L(Y(H,D),k.mouse[0],k.mouse[1]),k.extent,h));function E(){k.wheel=null,k.end()}}function I(S,...U){if(v||!n.apply(this,arguments))return;var k=S.currentTarget,H=G(this,U,!0).event(S),D=gn(S.view).on("mousemove.zoom",W,!0).on("mouseup.zoom",ae,!0),O=Sn(S,k),E=S.clientX,$=S.clientY;K0(S.view),yd(S),H.mouse=[O,this.__zoom.invert(O)],Ai(this),H.start();function W(ie){if(wr(ie),!H.moved){var he=ie.clientX-E,xe=ie.clientY-$;H.moved=he*he+xe*xe>_}H.event(ie).zoom("mouse",o(L(H.that.__zoom,H.mouse[0]=Sn(ie,k),H.mouse[1]),H.extent,h))}function ae(ie){D.on("mousemove.zoom mouseup.zoom",null),J0(ie.view,H.moved),wr(ie),H.event(ie).end()}}function K(S,...U){if(n.apply(this,arguments)){var k=this.__zoom,H=Sn(S.changedTouches?S.changedTouches[0]:S,this),D=k.invert(H),O=k.k*(S.shiftKey?.5:2),E=o(L(Y(k,O),H,D),r.apply(this,U),h);wr(S),g>0?gn(this).transition().duration(g).call(R,E,H,S):gn(this).call(A.transform,E,H,S)}}function ne(S,...U){if(n.apply(this,arguments)){var k=S.touches,H=k.length,D=G(this,U,S.changedTouches.length===H).event(S),O,E,$,W;for(yd(S),E=0;E<H;++E)$=k[E],W=Sn($,this),W=[W,this.__zoom.invert(W),$.identifier],D.touch0?!D.touch1&&D.touch0[2]!==W[2]&&(D.touch1=W,D.taps=0):(D.touch0=W,O=!0,D.taps=1+!!m);m&&(m=clearTimeout(m)),O&&(D.taps<2&&(b=W[0],m=setTimeout(function(){m=null},N)),Ai(this),D.start())}}function ee(S,...U){if(this.__zooming){var k=G(this,U).event(S),H=S.changedTouches,D=H.length,O,E,$,W;for(wr(S),O=0;O<D;++O)E=H[O],$=Sn(E,this),k.touch0&&k.touch0[2]===E.identifier?k.touch0[0]=$:k.touch1&&k.touch1[2]===E.identifier&&(k.touch1[0]=$);if(E=k.that.__zoom,k.touch1){var ae=k.touch0[0],ie=k.touch0[1],he=k.touch1[0],xe=k.touch1[1],Se=(Se=he[0]-ae[0])*Se+(Se=he[1]-ae[1])*Se,ve=(ve=xe[0]-ie[0])*ve+(ve=xe[1]-ie[1])*ve;E=Y(E,Math.sqrt(Se/ve)),$=[(ae[0]+he[0])/2,(ae[1]+he[1])/2],W=[(ie[0]+xe[0])/2,(ie[1]+xe[1])/2]}else if(k.touch0)$=k.touch0[0],W=k.touch0[1];else return;k.zoom("touch",o(L(E,$,W),k.extent,h))}}function se(S,...U){if(this.__zooming){var k=G(this,U).event(S),H=S.changedTouches,D=H.length,O,E;for(yd(S),v&&clearTimeout(v),v=setTimeout(function(){v=null},N),O=0;O<D;++O)E=H[O],k.touch0&&k.touch0[2]===E.identifier?delete k.touch0:k.touch1&&k.touch1[2]===E.identifier&&delete k.touch1;if(k.touch1&&!k.touch0&&(k.touch0=k.touch1,delete k.touch1),k.touch0)k.touch0[1]=this.__zoom.invert(k.touch0[0]);else if(k.end(),k.taps===2&&(E=Sn(E,this),Math.hypot(b[0]-E[0],b[1]-E[1])<M)){var $=gn(this).on("dblclick.zoom");$&&$.apply(this,arguments)}}}return A.wheelDelta=function(S){return arguments.length?(i=typeof S=="function"?S:bi(+S),A):i},A.filter=function(S){return arguments.length?(n=typeof S=="function"?S:bi(!!S),A):n},A.touchable=function(S){return arguments.length?(u=typeof S=="function"?S:bi(!!S),A):u},A.extent=function(S){return arguments.length?(r=typeof S=="function"?S:bi([[+S[0][0],+S[0][1]],[+S[1][0],+S[1][1]]]),A):r},A.scaleExtent=function(S){return arguments.length?(f[0]=+S[0],f[1]=+S[1],A):[f[0],f[1]]},A.translateExtent=function(S){return arguments.length?(h[0][0]=+S[0][0],h[1][0]=+S[1][0],h[0][1]=+S[0][1],h[1][1]=+S[1][1],A):[[h[0][0],h[0][1]],[h[1][0],h[1][1]]]},A.constrain=function(S){return arguments.length?(o=S,A):o},A.duration=function(S){return arguments.length?(g=+S,A):g},A.interpolate=function(S){return arguments.length?(p=S,A):p},A.on=function(){var S=x.on.apply(x,arguments);return S===x?A:S},A.clickDistance=function(S){return arguments.length?(_=(S=+S)*S,A):Math.sqrt(_)},A.tapDistance=function(S){return arguments.length?(M=+S,A):M},A}E0();const Qi=j.createContext(null),l5=Qi.Provider,la={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:n=>`Node type "${n}" 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:n=>`The old edge with id=${n} does not exist.`,error009:n=>`Marker type "${n}" doesn't exist.`,error008:(n,r)=>`Couldn't create edge for ${n?"target":"source"} handle id: "${n?r.targetHandle:r.sourceHandle}", edge id: ${r.id}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:n=>`Edge type "${n}" not found. Using fallback type "default".`,error012:n=>`Node with id "${n}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`},dg=la.error001();function tt(n,r){const o=j.useContext(Qi);if(o===null)throw new Error(dg);return H0(o,n,r)}const Nt=()=>{const n=j.useContext(Qi);if(n===null)throw new Error(dg);return j.useMemo(()=>({getState:n.getState,setState:n.setState,subscribe:n.subscribe,destroy:n.destroy}),[n])},r5=n=>n.userSelectionActive?"none":"all";function rf({position:n,children:r,className:o,style:i,...u}){const f=tt(r5),h=`${n}`.split("-");return re.createElement("div",{className:$t(["react-flow__panel",o,...h]),style:{...i,pointerEvents:f},...u},r)}function o5({proOptions:n,position:r="bottom-right"}){return n?.hideAttribution?null:re.createElement(rf,{position:r,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro"},re.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}const i5=({x:n,y:r,label:o,labelStyle:i={},labelShowBg:u=!0,labelBgStyle:f={},labelBgPadding:h=[2,4],labelBgBorderRadius:g=2,children:p,className:x,...m})=>{const b=j.useRef(null),[v,N]=j.useState({x:0,y:0,width:0,height:0}),C=$t(["react-flow__edge-textwrapper",x]);return j.useEffect(()=>{if(b.current){const _=b.current.getBBox();N({x:_.x,y:_.y,width:_.width,height:_.height})}},[o]),typeof o>"u"||!o?null:re.createElement("g",{transform:`translate(${n-v.width/2} ${r-v.height/2})`,className:C,visibility:v.width?"visible":"hidden",...m},u&&re.createElement("rect",{width:v.width+2*h[0],x:-h[0],y:-h[1],height:v.height+2*h[1],className:"react-flow__edge-textbg",style:f,rx:g,ry:g}),re.createElement("text",{className:"react-flow__edge-text",y:v.height/2,dy:"0.3em",ref:b,style:i},o),p)};var c5=j.memo(i5);const of=n=>({width:n.offsetWidth,height:n.offsetHeight}),gl=(n,r=0,o=1)=>Math.min(Math.max(n,r),o),cf=(n={x:0,y:0},r)=>({x:gl(n.x,r[0][0],r[1][0]),y:gl(n.y,r[0][1],r[1][1])}),Lm=(n,r,o)=>n<r?gl(Math.abs(n-r),1,50)/50:n>o?-gl(Math.abs(n-o),1,50)/50:0,fg=(n,r)=>{const o=Lm(n.x,35,r.width-35)*20,i=Lm(n.y,35,r.height-35)*20;return[o,i]},hg=n=>n.getRootNode?.()||window?.document,xg=(n,r)=>({x:Math.min(n.x,r.x),y:Math.min(n.y,r.y),x2:Math.max(n.x2,r.x2),y2:Math.max(n.y2,r.y2)}),Br=({x:n,y:r,width:o,height:i})=>({x:n,y:r,x2:n+o,y2:r+i}),pg=({x:n,y:r,x2:o,y2:i})=>({x:n,y:r,width:o-n,height:i-r}),Ym=n=>({...n.positionAbsolute||{x:0,y:0},width:n.width||0,height:n.height||0}),u5=(n,r)=>pg(xg(Br(n),Br(r))),Bd=(n,r)=>{const o=Math.max(0,Math.min(n.x+n.width,r.x+r.width)-Math.max(n.x,r.x)),i=Math.max(0,Math.min(n.y+n.height,r.y+r.height)-Math.max(n.y,r.y));return Math.ceil(o*i)},d5=n=>yn(n.width)&&yn(n.height)&&yn(n.x)&&yn(n.y),yn=n=>!isNaN(n)&&isFinite(n),ut=Symbol.for("internals"),mg=["Enter"," ","Escape"],f5=(n,r)=>{},h5=n=>"nativeEvent"in n;function qd(n){const o=(h5(n)?n.nativeEvent:n).composedPath?.()?.[0]||n.target;return["INPUT","SELECT","TEXTAREA"].includes(o?.nodeName)||o?.hasAttribute("contenteditable")||!!o?.closest(".nokey")}const gg=n=>"clientX"in n,Ba=(n,r)=>{const o=gg(n),i=o?n.clientX:n.touches?.[0].clientX,u=o?n.clientY:n.touches?.[0].clientY;return{x:i-(r?.left??0),y:u-(r?.top??0)}},qi=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0,Wr=({id:n,path:r,labelX:o,labelY:i,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:g,labelBgPadding:p,labelBgBorderRadius:x,style:m,markerEnd:b,markerStart:v,interactionWidth:N=20})=>re.createElement(re.Fragment,null,re.createElement("path",{id:n,style:m,d:r,fill:"none",className:"react-flow__edge-path",markerEnd:b,markerStart:v}),N&&re.createElement("path",{d:r,fill:"none",strokeOpacity:0,strokeWidth:N,className:"react-flow__edge-interaction"}),u&&yn(o)&&yn(i)?re.createElement(c5,{x:o,y:i,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:g,labelBgPadding:p,labelBgBorderRadius:x}):null);Wr.displayName="BaseEdge";function Sr(n,r,o){return o===void 0?o:i=>{const u=r().edges.find(f=>f.id===n);u&&o(i,{...u})}}function yg({sourceX:n,sourceY:r,targetX:o,targetY:i}){const u=Math.abs(o-n)/2,f=o<n?o+u:o-u,h=Math.abs(i-r)/2,g=i<r?i+h:i-h;return[f,g,u,h]}function bg({sourceX:n,sourceY:r,targetX:o,targetY:i,sourceControlX:u,sourceControlY:f,targetControlX:h,targetControlY:g}){const p=n*.125+u*.375+h*.375+o*.125,x=r*.125+f*.375+g*.375+i*.125,m=Math.abs(p-n),b=Math.abs(x-r);return[p,x,m,b]}var ps;(function(n){n.Strict="strict",n.Loose="loose"})(ps||(ps={}));var ds;(function(n){n.Free="free",n.Vertical="vertical",n.Horizontal="horizontal"})(ds||(ds={}));var qr;(function(n){n.Partial="partial",n.Full="full"})(qr||(qr={}));var Ua;(function(n){n.Bezier="default",n.Straight="straight",n.Step="step",n.SmoothStep="smoothstep",n.SimpleBezier="simplebezier"})(Ua||(Ua={}));var qa;(function(n){n.Arrow="arrow",n.ArrowClosed="arrowclosed"})(qa||(qa={}));var me;(function(n){n.Left="left",n.Top="top",n.Right="right",n.Bottom="bottom"})(me||(me={}));function Vm({pos:n,x1:r,y1:o,x2:i,y2:u}){return n===me.Left||n===me.Right?[.5*(r+i),o]:[r,.5*(o+u)]}function vg({sourceX:n,sourceY:r,sourcePosition:o=me.Bottom,targetX:i,targetY:u,targetPosition:f=me.Top}){const[h,g]=Vm({pos:o,x1:n,y1:r,x2:i,y2:u}),[p,x]=Vm({pos:f,x1:i,y1:u,x2:n,y2:r}),[m,b,v,N]=bg({sourceX:n,sourceY:r,targetX:i,targetY:u,sourceControlX:h,sourceControlY:g,targetControlX:p,targetControlY:x});return[`M${n},${r} C${h},${g} ${p},${x} ${i},${u}`,m,b,v,N]}const uf=j.memo(({sourceX:n,sourceY:r,targetX:o,targetY:i,sourcePosition:u=me.Bottom,targetPosition:f=me.Top,label:h,labelStyle:g,labelShowBg:p,labelBgStyle:x,labelBgPadding:m,labelBgBorderRadius:b,style:v,markerEnd:N,markerStart:C,interactionWidth:_})=>{const[M,A,Y]=vg({sourceX:n,sourceY:r,sourcePosition:u,targetX:o,targetY:i,targetPosition:f});return re.createElement(Wr,{path:M,labelX:A,labelY:Y,label:h,labelStyle:g,labelShowBg:p,labelBgStyle:x,labelBgPadding:m,labelBgBorderRadius:b,style:v,markerEnd:N,markerStart:C,interactionWidth:_})});uf.displayName="SimpleBezierEdge";const Gm={[me.Left]:{x:-1,y:0},[me.Right]:{x:1,y:0},[me.Top]:{x:0,y:-1},[me.Bottom]:{x:0,y:1}},x5=({source:n,sourcePosition:r=me.Bottom,target:o})=>r===me.Left||r===me.Right?n.x<o.x?{x:1,y:0}:{x:-1,y:0}:n.y<o.y?{x:0,y:1}:{x:0,y:-1},Xm=(n,r)=>Math.sqrt(Math.pow(r.x-n.x,2)+Math.pow(r.y-n.y,2));function p5({source:n,sourcePosition:r=me.Bottom,target:o,targetPosition:i=me.Top,center:u,offset:f}){const h=Gm[r],g=Gm[i],p={x:n.x+h.x*f,y:n.y+h.y*f},x={x:o.x+g.x*f,y:o.y+g.y*f},m=x5({source:p,sourcePosition:r,target:x}),b=m.x!==0?"x":"y",v=m[b];let N=[],C,_;const M={x:0,y:0},A={x:0,y:0},[Y,L,T,R]=yg({sourceX:n.x,sourceY:n.y,targetX:o.x,targetY:o.y});if(h[b]*g[b]===-1){C=u.x??Y,_=u.y??L;const X=[{x:C,y:p.y},{x:C,y:x.y}],le=[{x:p.x,y:_},{x:x.x,y:_}];h[b]===v?N=b==="x"?X:le:N=b==="x"?le:X}else{const X=[{x:p.x,y:x.y}],le=[{x:x.x,y:p.y}];if(b==="x"?N=h.x===v?le:X:N=h.y===v?X:le,r===i){const se=Math.abs(n[b]-o[b]);if(se<=f){const S=Math.min(f-1,f-se);h[b]===v?M[b]=(p[b]>n[b]?-1:1)*S:A[b]=(x[b]>o[b]?-1:1)*S}}if(r!==i){const se=b==="x"?"y":"x",S=h[b]===g[se],U=p[se]>x[se],k=p[se]<x[se];(h[b]===1&&(!S&&U||S&&k)||h[b]!==1&&(!S&&k||S&&U))&&(N=b==="x"?X:le)}const I={x:p.x+M.x,y:p.y+M.y},K={x:x.x+A.x,y:x.y+A.y},ne=Math.max(Math.abs(I.x-N[0].x),Math.abs(K.x-N[0].x)),ee=Math.max(Math.abs(I.y-N[0].y),Math.abs(K.y-N[0].y));ne>=ee?(C=(I.x+K.x)/2,_=N[0].y):(C=N[0].x,_=(I.y+K.y)/2)}return[[n,{x:p.x+M.x,y:p.y+M.y},...N,{x:x.x+A.x,y:x.y+A.y},o],C,_,T,R]}function m5(n,r,o,i){const u=Math.min(Xm(n,r)/2,Xm(r,o)/2,i),{x:f,y:h}=r;if(n.x===f&&f===o.x||n.y===h&&h===o.y)return`L${f} ${h}`;if(n.y===h){const x=n.x<o.x?-1:1,m=n.y<o.y?1:-1;return`L ${f+u*x},${h}Q ${f},${h} ${f},${h+u*m}`}const g=n.x<o.x?1:-1,p=n.y<o.y?-1:1;return`L ${f},${h+u*p}Q ${f},${h} ${f+u*g},${h}`}function Ld({sourceX:n,sourceY:r,sourcePosition:o=me.Bottom,targetX:i,targetY:u,targetPosition:f=me.Top,borderRadius:h=5,centerX:g,centerY:p,offset:x=20}){const[m,b,v,N,C]=p5({source:{x:n,y:r},sourcePosition:o,target:{x:i,y:u},targetPosition:f,center:{x:g,y:p},offset:x});return[m.reduce((M,A,Y)=>{let L="";return Y>0&&Y<m.length-1?L=m5(m[Y-1],A,m[Y+1],h):L=`${Y===0?"M":"L"}${A.x} ${A.y}`,M+=L,M},""),b,v,N,C]}const Ki=j.memo(({sourceX:n,sourceY:r,targetX:o,targetY:i,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:g,labelBgPadding:p,labelBgBorderRadius:x,style:m,sourcePosition:b=me.Bottom,targetPosition:v=me.Top,markerEnd:N,markerStart:C,pathOptions:_,interactionWidth:M})=>{const[A,Y,L]=Ld({sourceX:n,sourceY:r,sourcePosition:b,targetX:o,targetY:i,targetPosition:v,borderRadius:_?.borderRadius,offset:_?.offset});return re.createElement(Wr,{path:A,labelX:Y,labelY:L,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:g,labelBgPadding:p,labelBgBorderRadius:x,style:m,markerEnd:N,markerStart:C,interactionWidth:M})});Ki.displayName="SmoothStepEdge";const df=j.memo(n=>re.createElement(Ki,{...n,pathOptions:j.useMemo(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])}));df.displayName="StepEdge";function g5({sourceX:n,sourceY:r,targetX:o,targetY:i}){const[u,f,h,g]=yg({sourceX:n,sourceY:r,targetX:o,targetY:i});return[`M ${n},${r}L ${o},${i}`,u,f,h,g]}const ff=j.memo(({sourceX:n,sourceY:r,targetX:o,targetY:i,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:g,labelBgPadding:p,labelBgBorderRadius:x,style:m,markerEnd:b,markerStart:v,interactionWidth:N})=>{const[C,_,M]=g5({sourceX:n,sourceY:r,targetX:o,targetY:i});return re.createElement(Wr,{path:C,labelX:_,labelY:M,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:g,labelBgPadding:p,labelBgBorderRadius:x,style:m,markerEnd:b,markerStart:v,interactionWidth:N})});ff.displayName="StraightEdge";function vi(n,r){return n>=0?.5*n:r*25*Math.sqrt(-n)}function Zm({pos:n,x1:r,y1:o,x2:i,y2:u,c:f}){switch(n){case me.Left:return[r-vi(r-i,f),o];case me.Right:return[r+vi(i-r,f),o];case me.Top:return[r,o-vi(o-u,f)];case me.Bottom:return[r,o+vi(u-o,f)]}}function jg({sourceX:n,sourceY:r,sourcePosition:o=me.Bottom,targetX:i,targetY:u,targetPosition:f=me.Top,curvature:h=.25}){const[g,p]=Zm({pos:o,x1:n,y1:r,x2:i,y2:u,c:h}),[x,m]=Zm({pos:f,x1:i,y1:u,x2:n,y2:r,c:h}),[b,v,N,C]=bg({sourceX:n,sourceY:r,targetX:i,targetY:u,sourceControlX:g,sourceControlY:p,targetControlX:x,targetControlY:m});return[`M${n},${r} C${g},${p} ${x},${m} ${i},${u}`,b,v,N,C]}const Li=j.memo(({sourceX:n,sourceY:r,targetX:o,targetY:i,sourcePosition:u=me.Bottom,targetPosition:f=me.Top,label:h,labelStyle:g,labelShowBg:p,labelBgStyle:x,labelBgPadding:m,labelBgBorderRadius:b,style:v,markerEnd:N,markerStart:C,pathOptions:_,interactionWidth:M})=>{const[A,Y,L]=jg({sourceX:n,sourceY:r,sourcePosition:u,targetX:o,targetY:i,targetPosition:f,curvature:_?.curvature});return re.createElement(Wr,{path:A,labelX:Y,labelY:L,label:h,labelStyle:g,labelShowBg:p,labelBgStyle:x,labelBgPadding:m,labelBgBorderRadius:b,style:v,markerEnd:N,markerStart:C,interactionWidth:M})});Li.displayName="BezierEdge";const hf=j.createContext(null),y5=hf.Provider;hf.Consumer;const b5=()=>j.useContext(hf),v5=n=>"id"in n&&"source"in n&&"target"in n,j5=({source:n,sourceHandle:r,target:o,targetHandle:i})=>`reactflow__edge-${n}${r||""}-${o}${i||""}`,Yd=(n,r)=>typeof n>"u"?"":typeof n=="string"?n:`${r?`${r}__`:""}${Object.keys(n).sort().map(i=>`${i}=${n[i]}`).join("&")}`,N5=(n,r)=>r.some(o=>o.source===n.source&&o.target===n.target&&(o.sourceHandle===n.sourceHandle||!o.sourceHandle&&!n.sourceHandle)&&(o.targetHandle===n.targetHandle||!o.targetHandle&&!n.targetHandle)),w5=(n,r)=>{if(!n.source||!n.target)return r;let o;return v5(n)?o={...n}:o={...n,id:j5(n)},N5(o,r)?r:r.concat(o)},Vd=({x:n,y:r},[o,i,u],f,[h,g])=>{const p={x:(n-o)/u,y:(r-i)/u};return f?{x:h*Math.round(p.x/h),y:g*Math.round(p.y/g)}:p},Ng=({x:n,y:r},[o,i,u])=>({x:n*u+o,y:r*u+i}),hs=(n,r=[0,0])=>{if(!n)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const o=(n.width??0)*r[0],i=(n.height??0)*r[1],u={x:n.position.x-o,y:n.position.y-i};return{...u,positionAbsolute:n.positionAbsolute?{x:n.positionAbsolute.x-o,y:n.positionAbsolute.y-i}:u}},Ji=(n,r=[0,0])=>{if(n.length===0)return{x:0,y:0,width:0,height:0};const o=n.reduce((i,u)=>{const{x:f,y:h}=hs(u,r).positionAbsolute;return xg(i,Br({x:f,y:h,width:u.width||0,height:u.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return pg(o)},wg=(n,r,[o,i,u]=[0,0,1],f=!1,h=!1,g=[0,0])=>{const p={x:(r.x-o)/u,y:(r.y-i)/u,width:r.width/u,height:r.height/u},x=[];return n.forEach(m=>{const{width:b,height:v,selectable:N=!0,hidden:C=!1}=m;if(h&&!N||C)return!1;const{positionAbsolute:_}=hs(m,g),M={x:_.x,y:_.y,width:b||0,height:v||0},A=Bd(p,M),Y=typeof b>"u"||typeof v>"u"||b===null||v===null,L=f&&A>0,T=(b||0)*(v||0);(Y||L||A>=T||m.dragging)&&x.push(m)}),x},Sg=(n,r)=>{const o=n.map(i=>i.id);return r.filter(i=>o.includes(i.source)||o.includes(i.target))},Eg=(n,r,o,i,u,f=.1)=>{const h=r/(n.width*(1+f)),g=o/(n.height*(1+f)),p=Math.min(h,g),x=gl(p,i,u),m=n.x+n.width/2,b=n.y+n.height/2,v=r/2-m*x,N=o/2-b*x;return{x:v,y:N,zoom:x}},cs=(n,r=0)=>n.transition().duration(r);function Wm(n,r,o,i){return(r[o]||[]).reduce((u,f)=>(`${n.id}-${f.id}-${o}`!==i&&u.push({id:f.id||null,type:o,nodeId:n.id,x:(n.positionAbsolute?.x??0)+f.x+f.width/2,y:(n.positionAbsolute?.y??0)+f.y+f.height/2}),u),[])}function S5(n,r,o,i,u,f){const{x:h,y:g}=Ba(n),x=r.elementsFromPoint(h,g).find(C=>C.classList.contains("react-flow__handle"));if(x){const C=x.getAttribute("data-nodeid");if(C){const _=xf(void 0,x),M=x.getAttribute("data-handleid"),A=f({nodeId:C,id:M,type:_});if(A){const Y=u.find(L=>L.nodeId===C&&L.type===_&&L.id===M);return{handle:{id:M,type:_,nodeId:C,x:Y?.x||o.x,y:Y?.y||o.y},validHandleResult:A}}}}let m=[],b=1/0;if(u.forEach(C=>{const _=Math.sqrt((C.x-o.x)**2+(C.y-o.y)**2);if(_<=i){const M=f(C);_<=b&&(_<b?m=[{handle:C,validHandleResult:M}]:_===b&&m.push({handle:C,validHandleResult:M}),b=_)}}),!m.length)return{handle:null,validHandleResult:kg()};if(m.length===1)return m[0];const v=m.some(({validHandleResult:C})=>C.isValid),N=m.some(({handle:C})=>C.type==="target");return m.find(({handle:C,validHandleResult:_})=>N?C.type==="target":v?_.isValid:!0)||m[0]}const E5={source:null,target:null,sourceHandle:null,targetHandle:null},kg=()=>({handleDomNode:null,isValid:!1,connection:E5,endHandle:null});function _g(n,r,o,i,u,f,h){const g=u==="target",p=h.querySelector(`.react-flow__handle[data-id="${n?.nodeId}-${n?.id}-${n?.type}"]`),x={...kg(),handleDomNode:p};if(p){const m=xf(void 0,p),b=p.getAttribute("data-nodeid"),v=p.getAttribute("data-handleid"),N=p.classList.contains("connectable"),C=p.classList.contains("connectableend"),_={source:g?b:o,sourceHandle:g?v:i,target:g?o:b,targetHandle:g?i:v};x.connection=_,N&&C&&(r===ps.Strict?g&&m==="source"||!g&&m==="target":b!==o||v!==i)&&(x.endHandle={nodeId:b,handleId:v,type:m},x.isValid=f(_))}return x}function k5({nodes:n,nodeId:r,handleId:o,handleType:i}){return n.reduce((u,f)=>{if(f[ut]){const{handleBounds:h}=f[ut];let g=[],p=[];h&&(g=Wm(f,h,"source",`${r}-${o}-${i}`),p=Wm(f,h,"target",`${r}-${o}-${i}`)),u.push(...g,...p)}return u},[])}function xf(n,r){return n||(r?.classList.contains("target")?"target":r?.classList.contains("source")?"source":null)}function bd(n){n?.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function _5(n,r){let o=null;return r?o="valid":n&&!r&&(o="invalid"),o}function Cg({event:n,handleId:r,nodeId:o,onConnect:i,isTarget:u,getState:f,setState:h,isValidConnection:g,edgeUpdaterType:p,onReconnectEnd:x}){const m=hg(n.target),{connectionMode:b,domNode:v,autoPanOnConnect:N,connectionRadius:C,onConnectStart:_,panBy:M,getNodes:A,cancelConnection:Y}=f();let L=0,T;const{x:R,y:G}=Ba(n),X=m?.elementFromPoint(R,G),le=xf(p,X),I=v?.getBoundingClientRect();if(!I||!le)return;let K,ne=Ba(n,I),ee=!1,se=null,S=!1,U=null;const k=k5({nodes:A(),nodeId:o,handleId:r,handleType:le}),H=()=>{if(!N)return;const[E,$]=fg(ne,I);M({x:E,y:$}),L=requestAnimationFrame(H)};h({connectionPosition:ne,connectionStatus:null,connectionNodeId:o,connectionHandleId:r,connectionHandleType:le,connectionStartHandle:{nodeId:o,handleId:r,type:le},connectionEndHandle:null}),_?.(n,{nodeId:o,handleId:r,handleType:le});function D(E){const{transform:$}=f();ne=Ba(E,I);const{handle:W,validHandleResult:ae}=S5(E,m,Vd(ne,$,!1,[1,1]),C,k,ie=>_g(ie,b,o,r,u?"target":"source",g,m));if(T=W,ee||(H(),ee=!0),U=ae.handleDomNode,se=ae.connection,S=ae.isValid,h({connectionPosition:T&&S?Ng({x:T.x,y:T.y},$):ne,connectionStatus:_5(!!T,S),connectionEndHandle:ae.endHandle}),!T&&!S&&!U)return bd(K);se.source!==se.target&&U&&(bd(K),K=U,U.classList.add("connecting","react-flow__handle-connecting"),U.classList.toggle("valid",S),U.classList.toggle("react-flow__handle-valid",S))}function O(E){(T||U)&&se&&S&&i?.(se),f().onConnectEnd?.(E),p&&x?.(E),bd(K),Y(),cancelAnimationFrame(L),ee=!1,S=!1,se=null,U=null,m.removeEventListener("mousemove",D),m.removeEventListener("mouseup",O),m.removeEventListener("touchmove",D),m.removeEventListener("touchend",O)}m.addEventListener("mousemove",D),m.addEventListener("mouseup",O),m.addEventListener("touchmove",D),m.addEventListener("touchend",O)}const Qm=()=>!0,C5=n=>({connectionStartHandle:n.connectionStartHandle,connectOnClick:n.connectOnClick,noPanClassName:n.noPanClassName}),T5=(n,r,o)=>i=>{const{connectionStartHandle:u,connectionEndHandle:f,connectionClickStartHandle:h}=i;return{connecting:u?.nodeId===n&&u?.handleId===r&&u?.type===o||f?.nodeId===n&&f?.handleId===r&&f?.type===o,clickConnecting:h?.nodeId===n&&h?.handleId===r&&h?.type===o}},Tg=j.forwardRef(({type:n="source",position:r=me.Top,isValidConnection:o,isConnectable:i=!0,isConnectableStart:u=!0,isConnectableEnd:f=!0,id:h,onConnect:g,children:p,className:x,onMouseDown:m,onTouchStart:b,...v},N)=>{const C=h||null,_=n==="target",M=Nt(),A=b5(),{connectOnClick:Y,noPanClassName:L}=tt(C5,Tt),{connecting:T,clickConnecting:R}=tt(T5(A,C,n),Tt);A||M.getState().onError?.("010",la.error010());const G=I=>{const{defaultEdgeOptions:K,onConnect:ne,hasDefaultEdges:ee}=M.getState(),se={...K,...I};if(ee){const{edges:S,setEdges:U}=M.getState();U(w5(se,S))}ne?.(se),g?.(se)},X=I=>{if(!A)return;const K=gg(I);u&&(K&&I.button===0||!K)&&Cg({event:I,handleId:C,nodeId:A,onConnect:G,isTarget:_,getState:M.getState,setState:M.setState,isValidConnection:o||M.getState().isValidConnection||Qm}),K?m?.(I):b?.(I)},le=I=>{const{onClickConnectStart:K,onClickConnectEnd:ne,connectionClickStartHandle:ee,connectionMode:se,isValidConnection:S}=M.getState();if(!A||!ee&&!u)return;if(!ee){K?.(I,{nodeId:A,handleId:C,handleType:n}),M.setState({connectionClickStartHandle:{nodeId:A,type:n,handleId:C}});return}const U=hg(I.target),k=o||S||Qm,{connection:H,isValid:D}=_g({nodeId:A,id:C,type:n},se,ee.nodeId,ee.handleId||null,ee.type,k,U);D&&G(H),ne?.(I),M.setState({connectionClickStartHandle:null})};return re.createElement("div",{"data-handleid":C,"data-nodeid":A,"data-handlepos":r,"data-id":`${A}-${C}-${n}`,className:$t(["react-flow__handle",`react-flow__handle-${r}`,"nodrag",L,x,{source:!_,target:_,connectable:i,connectablestart:u,connectableend:f,connecting:R,connectionindicator:i&&(u&&!T||f&&T)}]),onMouseDown:X,onTouchStart:X,onClick:Y?le:void 0,ref:N,...v},p)});Tg.displayName="Handle";var jt=j.memo(Tg);const Mg=({data:n,isConnectable:r,targetPosition:o=me.Top,sourcePosition:i=me.Bottom})=>re.createElement(re.Fragment,null,re.createElement(jt,{type:"target",position:o,isConnectable:r}),n?.label,re.createElement(jt,{type:"source",position:i,isConnectable:r}));Mg.displayName="DefaultNode";var Gd=j.memo(Mg);const Ag=({data:n,isConnectable:r,sourcePosition:o=me.Bottom})=>re.createElement(re.Fragment,null,n?.label,re.createElement(jt,{type:"source",position:o,isConnectable:r}));Ag.displayName="InputNode";var Rg=j.memo(Ag);const zg=({data:n,isConnectable:r,targetPosition:o=me.Top})=>re.createElement(re.Fragment,null,re.createElement(jt,{type:"target",position:o,isConnectable:r}),n?.label);zg.displayName="OutputNode";var Og=j.memo(zg);const pf=()=>null;pf.displayName="GroupNode";const M5=n=>({selectedNodes:n.getNodes().filter(r=>r.selected),selectedEdges:n.edges.filter(r=>r.selected).map(r=>({...r}))}),ji=n=>n.id;function A5(n,r){return Tt(n.selectedNodes.map(ji),r.selectedNodes.map(ji))&&Tt(n.selectedEdges.map(ji),r.selectedEdges.map(ji))}const Dg=j.memo(({onSelectionChange:n})=>{const r=Nt(),{selectedNodes:o,selectedEdges:i}=tt(M5,A5);return j.useEffect(()=>{const u={nodes:o,edges:i};n?.(u),r.getState().onSelectionChange.forEach(f=>f(u))},[o,i,n]),null});Dg.displayName="SelectionListener";const R5=n=>!!n.onSelectionChange;function z5({onSelectionChange:n}){const r=tt(R5);return n||r?re.createElement(Dg,{onSelectionChange:n}):null}const O5=n=>({setNodes:n.setNodes,setEdges:n.setEdges,setDefaultNodesAndEdges:n.setDefaultNodesAndEdges,setMinZoom:n.setMinZoom,setMaxZoom:n.setMaxZoom,setTranslateExtent:n.setTranslateExtent,setNodeExtent:n.setNodeExtent,reset:n.reset});function tl(n,r){j.useEffect(()=>{typeof n<"u"&&r(n)},[n])}function Ue(n,r,o){j.useEffect(()=>{typeof r<"u"&&o({[n]:r})},[r])}const D5=({nodes:n,edges:r,defaultNodes:o,defaultEdges:i,onConnect:u,onConnectStart:f,onConnectEnd:h,onClickConnectStart:g,onClickConnectEnd:p,nodesDraggable:x,nodesConnectable:m,nodesFocusable:b,edgesFocusable:v,edgesUpdatable:N,elevateNodesOnSelect:C,minZoom:_,maxZoom:M,nodeExtent:A,onNodesChange:Y,onEdgesChange:L,elementsSelectable:T,connectionMode:R,snapGrid:G,snapToGrid:X,translateExtent:le,connectOnClick:I,defaultEdgeOptions:K,fitView:ne,fitViewOptions:ee,onNodesDelete:se,onEdgesDelete:S,onNodeDrag:U,onNodeDragStart:k,onNodeDragStop:H,onSelectionDrag:D,onSelectionDragStart:O,onSelectionDragStop:E,noPanClassName:$,nodeOrigin:W,rfId:ae,autoPanOnConnect:ie,autoPanOnNodeDrag:he,onError:xe,connectionRadius:Se,isValidConnection:ve,nodeDragThreshold:Ae})=>{const{setNodes:Re,setEdges:We,setDefaultNodesAndEdges:Te,setMinZoom:be,setMaxZoom:q,setTranslateExtent:V,setNodeExtent:ue,reset:oe}=tt(O5,Tt),P=Nt();return j.useEffect(()=>{const Ee=i?.map(ge=>({...ge,...K}));return Te(o,Ee),()=>{oe()}},[]),Ue("defaultEdgeOptions",K,P.setState),Ue("connectionMode",R,P.setState),Ue("onConnect",u,P.setState),Ue("onConnectStart",f,P.setState),Ue("onConnectEnd",h,P.setState),Ue("onClickConnectStart",g,P.setState),Ue("onClickConnectEnd",p,P.setState),Ue("nodesDraggable",x,P.setState),Ue("nodesConnectable",m,P.setState),Ue("nodesFocusable",b,P.setState),Ue("edgesFocusable",v,P.setState),Ue("edgesUpdatable",N,P.setState),Ue("elementsSelectable",T,P.setState),Ue("elevateNodesOnSelect",C,P.setState),Ue("snapToGrid",X,P.setState),Ue("snapGrid",G,P.setState),Ue("onNodesChange",Y,P.setState),Ue("onEdgesChange",L,P.setState),Ue("connectOnClick",I,P.setState),Ue("fitViewOnInit",ne,P.setState),Ue("fitViewOnInitOptions",ee,P.setState),Ue("onNodesDelete",se,P.setState),Ue("onEdgesDelete",S,P.setState),Ue("onNodeDrag",U,P.setState),Ue("onNodeDragStart",k,P.setState),Ue("onNodeDragStop",H,P.setState),Ue("onSelectionDrag",D,P.setState),Ue("onSelectionDragStart",O,P.setState),Ue("onSelectionDragStop",E,P.setState),Ue("noPanClassName",$,P.setState),Ue("nodeOrigin",W,P.setState),Ue("rfId",ae,P.setState),Ue("autoPanOnConnect",ie,P.setState),Ue("autoPanOnNodeDrag",he,P.setState),Ue("onError",xe,P.setState),Ue("connectionRadius",Se,P.setState),Ue("isValidConnection",ve,P.setState),Ue("nodeDragThreshold",Ae,P.setState),tl(n,Re),tl(r,We),tl(_,be),tl(M,q),tl(le,V),tl(A,ue),null},Km={display:"none"},H5={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Hg="react-flow__node-desc",$g="react-flow__edge-desc",$5="react-flow__aria-live",U5=n=>n.ariaLiveMessage;function B5({rfId:n}){const r=tt(U5);return re.createElement("div",{id:`${$5}-${n}`,"aria-live":"assertive","aria-atomic":"true",style:H5},r)}function q5({rfId:n,disableKeyboardA11y:r}){return re.createElement(re.Fragment,null,re.createElement("div",{id:`${Hg}-${n}`,style:Km},"Press enter or space to select a node.",!r&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "),re.createElement("div",{id:`${$g}-${n}`,style:Km},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!r&&re.createElement(B5,{rfId:n}))}var Lr=(n=null,r={actInsideInputWithModifier:!0})=>{const[o,i]=j.useState(!1),u=j.useRef(!1),f=j.useRef(new Set([])),[h,g]=j.useMemo(()=>{if(n!==null){const x=(Array.isArray(n)?n:[n]).filter(b=>typeof b=="string").map(b=>b.split("+")),m=x.reduce((b,v)=>b.concat(...v),[]);return[x,m]}return[[],[]]},[n]);return j.useEffect(()=>{const p=typeof document<"u"?document:null,x=r?.target||p;if(n!==null){const m=N=>{if(u.current=N.ctrlKey||N.metaKey||N.shiftKey,(!u.current||u.current&&!r.actInsideInputWithModifier)&&qd(N))return!1;const _=Im(N.code,g);f.current.add(N[_]),Jm(h,f.current,!1)&&(N.preventDefault(),i(!0))},b=N=>{if((!u.current||u.current&&!r.actInsideInputWithModifier)&&qd(N))return!1;const _=Im(N.code,g);Jm(h,f.current,!0)?(i(!1),f.current.clear()):f.current.delete(N[_]),N.key==="Meta"&&f.current.clear(),u.current=!1},v=()=>{f.current.clear(),i(!1)};return x?.addEventListener("keydown",m),x?.addEventListener("keyup",b),window.addEventListener("blur",v),()=>{x?.removeEventListener("keydown",m),x?.removeEventListener("keyup",b),window.removeEventListener("blur",v)}}},[n,i]),o};function Jm(n,r,o){return n.filter(i=>o||i.length===r.size).some(i=>i.every(u=>r.has(u)))}function Im(n,r){return r.includes(n)?"code":"key"}function Ug(n,r,o,i){const u=n.parentNode||n.parentId;if(!u)return o;const f=r.get(u),h=hs(f,i);return Ug(f,r,{x:(o.x??0)+h.x,y:(o.y??0)+h.y,z:(f[ut]?.z??0)>(o.z??0)?f[ut]?.z??0:o.z??0},i)}function Bg(n,r,o){n.forEach(i=>{const u=i.parentNode||i.parentId;if(u&&!n.has(u))throw new Error(`Parent node ${u} not found`);if(u||o?.[i.id]){const{x:f,y:h,z:g}=Ug(i,n,{...i.position,z:i[ut]?.z??0},r);i.positionAbsolute={x:f,y:h},i[ut].z=g,o?.[i.id]&&(i[ut].isParent=!0)}})}function vd(n,r,o,i){const u=new Map,f={},h=i?1e3:0;return n.forEach(g=>{const p=(yn(g.zIndex)?g.zIndex:0)+(g.selected?h:0),x=r.get(g.id),m={...g,positionAbsolute:{x:g.position.x,y:g.position.y}},b=g.parentNode||g.parentId;b&&(f[b]=!0);const v=x?.type&&x?.type!==g.type;Object.defineProperty(m,ut,{enumerable:!1,value:{handleBounds:v?void 0:x?.[ut]?.handleBounds,z:p}}),u.set(g.id,m)}),Bg(u,o,f),u}function qg(n,r={}){const{getNodes:o,width:i,height:u,minZoom:f,maxZoom:h,d3Zoom:g,d3Selection:p,fitViewOnInitDone:x,fitViewOnInit:m,nodeOrigin:b}=n(),v=r.initial&&!x&&m;if(g&&p&&(v||!r.initial)){const C=o().filter(M=>{const A=r.includeHiddenNodes?M.width&&M.height:!M.hidden;return r.nodes?.length?A&&r.nodes.some(Y=>Y.id===M.id):A}),_=C.every(M=>M.width&&M.height);if(C.length>0&&_){const M=Ji(C,b),{x:A,y:Y,zoom:L}=Eg(M,i,u,r.minZoom??f,r.maxZoom??h,r.padding??.1),T=ta.translate(A,Y).scale(L);return typeof r.duration=="number"&&r.duration>0?g.transform(cs(p,r.duration),T):g.transform(p,T),!0}}return!1}function L5(n,r){return n.forEach(o=>{const i=r.get(o.id);i&&r.set(i.id,{...i,[ut]:i[ut],selected:o.selected})}),new Map(r)}function Y5(n,r){return r.map(o=>{const i=n.find(u=>u.id===o.id);return i&&(o.selected=i.selected),o})}function Ni({changedNodes:n,changedEdges:r,get:o,set:i}){const{nodeInternals:u,edges:f,onNodesChange:h,onEdgesChange:g,hasDefaultNodes:p,hasDefaultEdges:x}=o();n?.length&&(p&&i({nodeInternals:L5(n,u)}),h?.(n)),r?.length&&(x&&i({edges:Y5(r,f)}),g?.(r))}const nl=()=>{},V5={zoomIn:nl,zoomOut:nl,zoomTo:nl,getZoom:()=>1,setViewport:nl,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:nl,fitBounds:nl,project:n=>n,screenToFlowPosition:n=>n,flowToScreenPosition:n=>n,viewportInitialized:!1},G5=n=>({d3Zoom:n.d3Zoom,d3Selection:n.d3Selection}),X5=()=>{const n=Nt(),{d3Zoom:r,d3Selection:o}=tt(G5,Tt);return j.useMemo(()=>o&&r?{zoomIn:u=>r.scaleBy(cs(o,u?.duration),1.2),zoomOut:u=>r.scaleBy(cs(o,u?.duration),1/1.2),zoomTo:(u,f)=>r.scaleTo(cs(o,f?.duration),u),getZoom:()=>n.getState().transform[2],setViewport:(u,f)=>{const[h,g,p]=n.getState().transform,x=ta.translate(u.x??h,u.y??g).scale(u.zoom??p);r.transform(cs(o,f?.duration),x)},getViewport:()=>{const[u,f,h]=n.getState().transform;return{x:u,y:f,zoom:h}},fitView:u=>qg(n.getState,u),setCenter:(u,f,h)=>{const{width:g,height:p,maxZoom:x}=n.getState(),m=typeof h?.zoom<"u"?h.zoom:x,b=g/2-u*m,v=p/2-f*m,N=ta.translate(b,v).scale(m);r.transform(cs(o,h?.duration),N)},fitBounds:(u,f)=>{const{width:h,height:g,minZoom:p,maxZoom:x}=n.getState(),{x:m,y:b,zoom:v}=Eg(u,h,g,p,x,f?.padding??.1),N=ta.translate(m,b).scale(v);r.transform(cs(o,f?.duration),N)},project:u=>{const{transform:f,snapToGrid:h,snapGrid:g}=n.getState();return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"),Vd(u,f,h,g)},screenToFlowPosition:u=>{const{transform:f,snapToGrid:h,snapGrid:g,domNode:p}=n.getState();if(!p)return u;const{x,y:m}=p.getBoundingClientRect(),b={x:u.x-x,y:u.y-m};return Vd(b,f,h,g)},flowToScreenPosition:u=>{const{transform:f,domNode:h}=n.getState();if(!h)return u;const{x:g,y:p}=h.getBoundingClientRect(),x=Ng(u,f);return{x:x.x+g,y:x.y+p}},viewportInitialized:!0}:V5,[r,o])};function mf(){const n=X5(),r=Nt(),o=j.useCallback(()=>r.getState().getNodes().map(_=>({..._})),[]),i=j.useCallback(_=>r.getState().nodeInternals.get(_),[]),u=j.useCallback(()=>{const{edges:_=[]}=r.getState();return _.map(M=>({...M}))},[]),f=j.useCallback(_=>{const{edges:M=[]}=r.getState();return M.find(A=>A.id===_)},[]),h=j.useCallback(_=>{const{getNodes:M,setNodes:A,hasDefaultNodes:Y,onNodesChange:L}=r.getState(),T=M(),R=typeof _=="function"?_(T):_;if(Y)A(R);else if(L){const G=R.length===0?T.map(X=>({type:"remove",id:X.id})):R.map(X=>({item:X,type:"reset"}));L(G)}},[]),g=j.useCallback(_=>{const{edges:M=[],setEdges:A,hasDefaultEdges:Y,onEdgesChange:L}=r.getState(),T=typeof _=="function"?_(M):_;if(Y)A(T);else if(L){const R=T.length===0?M.map(G=>({type:"remove",id:G.id})):T.map(G=>({item:G,type:"reset"}));L(R)}},[]),p=j.useCallback(_=>{const M=Array.isArray(_)?_:[_],{getNodes:A,setNodes:Y,hasDefaultNodes:L,onNodesChange:T}=r.getState();if(L){const G=[...A(),...M];Y(G)}else if(T){const R=M.map(G=>({item:G,type:"add"}));T(R)}},[]),x=j.useCallback(_=>{const M=Array.isArray(_)?_:[_],{edges:A=[],setEdges:Y,hasDefaultEdges:L,onEdgesChange:T}=r.getState();if(L)Y([...A,...M]);else if(T){const R=M.map(G=>({item:G,type:"add"}));T(R)}},[]),m=j.useCallback(()=>{const{getNodes:_,edges:M=[],transform:A}=r.getState(),[Y,L,T]=A;return{nodes:_().map(R=>({...R})),edges:M.map(R=>({...R})),viewport:{x:Y,y:L,zoom:T}}},[]),b=j.useCallback(({nodes:_,edges:M})=>{const{nodeInternals:A,getNodes:Y,edges:L,hasDefaultNodes:T,hasDefaultEdges:R,onNodesDelete:G,onEdgesDelete:X,onNodesChange:le,onEdgesChange:I}=r.getState(),K=(_||[]).map(U=>U.id),ne=(M||[]).map(U=>U.id),ee=Y().reduce((U,k)=>{const H=k.parentNode||k.parentId,D=!K.includes(k.id)&&H&&U.find(E=>E.id===H);return(typeof k.deletable=="boolean"?k.deletable:!0)&&(K.includes(k.id)||D)&&U.push(k),U},[]),se=L.filter(U=>typeof U.deletable=="boolean"?U.deletable:!0),S=se.filter(U=>ne.includes(U.id));if(ee||S){const U=Sg(ee,se),k=[...S,...U],H=k.reduce((D,O)=>(D.includes(O.id)||D.push(O.id),D),[]);if((R||T)&&(R&&r.setState({edges:L.filter(D=>!H.includes(D.id))}),T&&(ee.forEach(D=>{A.delete(D.id)}),r.setState({nodeInternals:new Map(A)}))),H.length>0&&(X?.(k),I&&I(H.map(D=>({id:D,type:"remove"})))),ee.length>0&&(G?.(ee),le)){const D=ee.map(O=>({id:O.id,type:"remove"}));le(D)}}},[]),v=j.useCallback(_=>{const M=d5(_),A=M?null:r.getState().nodeInternals.get(_.id);return!M&&!A?[null,null,M]:[M?_:Ym(A),A,M]},[]),N=j.useCallback((_,M=!0,A)=>{const[Y,L,T]=v(_);return Y?(A||r.getState().getNodes()).filter(R=>{if(!T&&(R.id===L.id||!R.positionAbsolute))return!1;const G=Ym(R),X=Bd(G,Y);return M&&X>0||X>=Y.width*Y.height}):[]},[]),C=j.useCallback((_,M,A=!0)=>{const[Y]=v(_);if(!Y)return!1;const L=Bd(Y,M);return A&&L>0||L>=Y.width*Y.height},[]);return j.useMemo(()=>({...n,getNodes:o,getNode:i,getEdges:u,getEdge:f,setNodes:h,setEdges:g,addNodes:p,addEdges:x,toObject:m,deleteElements:b,getIntersectingNodes:N,isNodeIntersecting:C}),[n,o,i,u,f,h,g,p,x,m,b,N,C])}const Z5={actInsideInputWithModifier:!1};var W5=({deleteKeyCode:n,multiSelectionKeyCode:r})=>{const o=Nt(),{deleteElements:i}=mf(),u=Lr(n,Z5),f=Lr(r);j.useEffect(()=>{if(u){const{edges:h,getNodes:g}=o.getState(),p=g().filter(m=>m.selected),x=h.filter(m=>m.selected);i({nodes:p,edges:x}),o.setState({nodesSelectionActive:!1})}},[u]),j.useEffect(()=>{o.setState({multiSelectionActive:f})},[f])};function Q5(n){const r=Nt();j.useEffect(()=>{let o;const i=()=>{if(!n.current)return;const u=of(n.current);(u.height===0||u.width===0)&&r.getState().onError?.("004",la.error004()),r.setState({width:u.width||500,height:u.height||500})};return i(),window.addEventListener("resize",i),n.current&&(o=new ResizeObserver(()=>i()),o.observe(n.current)),()=>{window.removeEventListener("resize",i),o&&n.current&&o.unobserve(n.current)}},[])}const gf={position:"absolute",width:"100%",height:"100%",top:0,left:0},K5=(n,r)=>n.x!==r.x||n.y!==r.y||n.zoom!==r.k,wi=n=>({x:n.x,y:n.y,zoom:n.k}),al=(n,r)=>n.target.closest(`.${r}`),Fm=(n,r)=>r===2&&Array.isArray(n)&&n.includes(2),Pm=n=>{const r=n.ctrlKey&&qi()?10:1;return-n.deltaY*(n.deltaMode===1?.05:n.deltaMode?1:.002)*r},J5=n=>({d3Zoom:n.d3Zoom,d3Selection:n.d3Selection,d3ZoomHandler:n.d3ZoomHandler,userSelectionActive:n.userSelectionActive}),I5=({onMove:n,onMoveStart:r,onMoveEnd:o,onPaneContextMenu:i,zoomOnScroll:u=!0,zoomOnPinch:f=!0,panOnScroll:h=!1,panOnScrollSpeed:g=.5,panOnScrollMode:p=ds.Free,zoomOnDoubleClick:x=!0,elementsSelectable:m,panOnDrag:b=!0,defaultViewport:v,translateExtent:N,minZoom:C,maxZoom:_,zoomActivationKeyCode:M,preventScrolling:A=!0,children:Y,noWheelClassName:L,noPanClassName:T})=>{const R=j.useRef(),G=Nt(),X=j.useRef(!1),le=j.useRef(!1),I=j.useRef(null),K=j.useRef({x:0,y:0,zoom:0}),{d3Zoom:ne,d3Selection:ee,d3ZoomHandler:se,userSelectionActive:S}=tt(J5,Tt),U=Lr(M),k=j.useRef(0),H=j.useRef(!1),D=j.useRef();return Q5(I),j.useEffect(()=>{if(I.current){const O=I.current.getBoundingClientRect(),E=ug().scaleExtent([C,_]).translateExtent(N),$=gn(I.current).call(E),W=ta.translate(v.x,v.y).scale(gl(v.zoom,C,_)),ae=[[0,0],[O.width,O.height]],ie=E.constrain()(W,ae,N);E.transform($,ie),E.wheelDelta(Pm),G.setState({d3Zoom:E,d3Selection:$,d3ZoomHandler:$.on("wheel.zoom"),transform:[ie.x,ie.y,ie.k],domNode:I.current.closest(".react-flow")})}},[]),j.useEffect(()=>{ee&&ne&&(h&&!U&&!S?ee.on("wheel.zoom",O=>{if(al(O,L))return!1;O.preventDefault(),O.stopImmediatePropagation();const E=ee.property("__zoom").k||1;if(O.ctrlKey&&f){const ve=Sn(O),Ae=Pm(O),Re=E*Math.pow(2,Ae);ne.scaleTo(ee,Re,ve,O);return}const $=O.deltaMode===1?20:1;let W=p===ds.Vertical?0:O.deltaX*$,ae=p===ds.Horizontal?0:O.deltaY*$;!qi()&&O.shiftKey&&p!==ds.Vertical&&(W=O.deltaY*$,ae=0),ne.translateBy(ee,-(W/E)*g,-(ae/E)*g,{internal:!0});const ie=wi(ee.property("__zoom")),{onViewportChangeStart:he,onViewportChange:xe,onViewportChangeEnd:Se}=G.getState();clearTimeout(D.current),H.current||(H.current=!0,r?.(O,ie),he?.(ie)),H.current&&(n?.(O,ie),xe?.(ie),D.current=setTimeout(()=>{o?.(O,ie),Se?.(ie),H.current=!1},150))},{passive:!1}):typeof se<"u"&&ee.on("wheel.zoom",function(O,E){if(!A&&O.type==="wheel"&&!O.ctrlKey||al(O,L))return null;O.preventDefault(),se.call(this,O,E)},{passive:!1}))},[S,h,p,ee,ne,se,U,f,A,L,r,n,o]),j.useEffect(()=>{ne&&ne.on("start",O=>{if(!O.sourceEvent||O.sourceEvent.internal)return null;k.current=O.sourceEvent?.button;const{onViewportChangeStart:E}=G.getState(),$=wi(O.transform);X.current=!0,K.current=$,O.sourceEvent?.type==="mousedown"&&G.setState({paneDragging:!0}),E?.($),r?.(O.sourceEvent,$)})},[ne,r]),j.useEffect(()=>{ne&&(S&&!X.current?ne.on("zoom",null):S||ne.on("zoom",O=>{const{onViewportChange:E}=G.getState();if(G.setState({transform:[O.transform.x,O.transform.y,O.transform.k]}),le.current=!!(i&&Fm(b,k.current??0)),(n||E)&&!O.sourceEvent?.internal){const $=wi(O.transform);E?.($),n?.(O.sourceEvent,$)}}))},[S,ne,n,b,i]),j.useEffect(()=>{ne&&ne.on("end",O=>{if(!O.sourceEvent||O.sourceEvent.internal)return null;const{onViewportChangeEnd:E}=G.getState();if(X.current=!1,G.setState({paneDragging:!1}),i&&Fm(b,k.current??0)&&!le.current&&i(O.sourceEvent),le.current=!1,(o||E)&&K5(K.current,O.transform)){const $=wi(O.transform);K.current=$,clearTimeout(R.current),R.current=setTimeout(()=>{E?.($),o?.(O.sourceEvent,$)},h?150:0)}})},[ne,h,b,o,i]),j.useEffect(()=>{ne&&ne.filter(O=>{const E=U||u,$=f&&O.ctrlKey;if((b===!0||Array.isArray(b)&&b.includes(1))&&O.button===1&&O.type==="mousedown"&&(al(O,"react-flow__node")||al(O,"react-flow__edge")))return!0;if(!b&&!E&&!h&&!x&&!f||S||!x&&O.type==="dblclick"||al(O,L)&&O.type==="wheel"||al(O,T)&&(O.type!=="wheel"||h&&O.type==="wheel"&&!U)||!f&&O.ctrlKey&&O.type==="wheel"||!E&&!h&&!$&&O.type==="wheel"||!b&&(O.type==="mousedown"||O.type==="touchstart")||Array.isArray(b)&&!b.includes(O.button)&&O.type==="mousedown")return!1;const W=Array.isArray(b)&&b.includes(O.button)||!O.button||O.button<=1;return(!O.ctrlKey||O.type==="wheel")&&W})},[S,ne,u,f,h,x,b,m,U]),re.createElement("div",{className:"react-flow__renderer",ref:I,style:gf},Y)},F5=n=>({userSelectionActive:n.userSelectionActive,userSelectionRect:n.userSelectionRect});function P5(){const{userSelectionActive:n,userSelectionRect:r}=tt(F5,Tt);return n&&r?re.createElement("div",{className:"react-flow__selection react-flow__container",style:{width:r.width,height:r.height,transform:`translate(${r.x}px, ${r.y}px)`}}):null}function e0(n,r){const o=r.parentNode||r.parentId,i=n.find(u=>u.id===o);if(i){const u=r.position.x+r.width-i.width,f=r.position.y+r.height-i.height;if(u>0||f>0||r.position.x<0||r.position.y<0){if(i.style={...i.style},i.style.width=i.style.width??i.width,i.style.height=i.style.height??i.height,u>0&&(i.style.width+=u),f>0&&(i.style.height+=f),r.position.x<0){const h=Math.abs(r.position.x);i.position.x=i.position.x-h,i.style.width+=h,r.position.x=0}if(r.position.y<0){const h=Math.abs(r.position.y);i.position.y=i.position.y-h,i.style.height+=h,r.position.y=0}i.width=i.style.width,i.height=i.style.height}}}function Lg(n,r){if(n.some(i=>i.type==="reset"))return n.filter(i=>i.type==="reset").map(i=>i.item);const o=n.filter(i=>i.type==="add").map(i=>i.item);return r.reduce((i,u)=>{const f=n.filter(g=>g.id===u.id);if(f.length===0)return i.push(u),i;const h={...u};for(const g of f)if(g)switch(g.type){case"select":{h.selected=g.selected;break}case"position":{typeof g.position<"u"&&(h.position=g.position),typeof g.positionAbsolute<"u"&&(h.positionAbsolute=g.positionAbsolute),typeof g.dragging<"u"&&(h.dragging=g.dragging),h.expandParent&&e0(i,h);break}case"dimensions":{typeof g.dimensions<"u"&&(h.width=g.dimensions.width,h.height=g.dimensions.height),typeof g.updateStyle<"u"&&(h.style={...h.style||{},...g.dimensions}),typeof g.resizing=="boolean"&&(h.resizing=g.resizing),h.expandParent&&e0(i,h);break}case"remove":return i}return i.push(h),i},o)}function Yg(n,r){return Lg(n,r)}function eS(n,r){return Lg(n,r)}const $a=(n,r)=>({id:n,type:"select",selected:r});function cl(n,r){return n.reduce((o,i)=>{const u=r.includes(i.id);return!i.selected&&u?(i.selected=!0,o.push($a(i.id,!0))):i.selected&&!u&&(i.selected=!1,o.push($a(i.id,!1))),o},[])}const jd=(n,r)=>o=>{o.target===r.current&&n?.(o)},tS=n=>({userSelectionActive:n.userSelectionActive,elementsSelectable:n.elementsSelectable,dragging:n.paneDragging}),Vg=j.memo(({isSelecting:n,selectionMode:r=qr.Full,panOnDrag:o,onSelectionStart:i,onSelectionEnd:u,onPaneClick:f,onPaneContextMenu:h,onPaneScroll:g,onPaneMouseEnter:p,onPaneMouseMove:x,onPaneMouseLeave:m,children:b})=>{const v=j.useRef(null),N=Nt(),C=j.useRef(0),_=j.useRef(0),M=j.useRef(),{userSelectionActive:A,elementsSelectable:Y,dragging:L}=tt(tS,Tt),T=()=>{N.setState({userSelectionActive:!1,userSelectionRect:null}),C.current=0,_.current=0},R=se=>{f?.(se),N.getState().resetSelectedElements(),N.setState({nodesSelectionActive:!1})},G=se=>{if(Array.isArray(o)&&o?.includes(2)){se.preventDefault();return}h?.(se)},X=g?se=>g(se):void 0,le=se=>{const{resetSelectedElements:S,domNode:U}=N.getState();if(M.current=U?.getBoundingClientRect(),!Y||!n||se.button!==0||se.target!==v.current||!M.current)return;const{x:k,y:H}=Ba(se,M.current);S(),N.setState({userSelectionRect:{width:0,height:0,startX:k,startY:H,x:k,y:H}}),i?.(se)},I=se=>{const{userSelectionRect:S,nodeInternals:U,edges:k,transform:H,onNodesChange:D,onEdgesChange:O,nodeOrigin:E,getNodes:$}=N.getState();if(!n||!M.current||!S)return;N.setState({userSelectionActive:!0,nodesSelectionActive:!1});const W=Ba(se,M.current),ae=S.startX??0,ie=S.startY??0,he={...S,x:W.x<ae?W.x:ae,y:W.y<ie?W.y:ie,width:Math.abs(W.x-ae),height:Math.abs(W.y-ie)},xe=$(),Se=wg(U,he,H,r===qr.Partial,!0,E),ve=Sg(Se,k).map(Re=>Re.id),Ae=Se.map(Re=>Re.id);if(C.current!==Ae.length){C.current=Ae.length;const Re=cl(xe,Ae);Re.length&&D?.(Re)}if(_.current!==ve.length){_.current=ve.length;const Re=cl(k,ve);Re.length&&O?.(Re)}N.setState({userSelectionRect:he})},K=se=>{if(se.button!==0)return;const{userSelectionRect:S}=N.getState();!A&&S&&se.target===v.current&&R?.(se),N.setState({nodesSelectionActive:C.current>0}),T(),u?.(se)},ne=se=>{A&&(N.setState({nodesSelectionActive:C.current>0}),u?.(se)),T()},ee=Y&&(n||A);return re.createElement("div",{className:$t(["react-flow__pane",{dragging:L,selection:n}]),onClick:ee?void 0:jd(R,v),onContextMenu:jd(G,v),onWheel:jd(X,v),onMouseEnter:ee?void 0:p,onMouseDown:ee?le:void 0,onMouseMove:ee?I:x,onMouseUp:ee?K:void 0,onMouseLeave:ee?ne:m,ref:v,style:gf},b,re.createElement(P5,null))});Vg.displayName="Pane";function Gg(n,r){const o=n.parentNode||n.parentId;if(!o)return!1;const i=r.get(o);return i?i.selected?!0:Gg(i,r):!1}function t0(n,r,o){let i=n;do{if(i?.matches(r))return!0;if(i===o.current)return!1;i=i.parentElement}while(i);return!1}function nS(n,r,o,i){return Array.from(n.values()).filter(u=>(u.selected||u.id===i)&&(!u.parentNode||u.parentId||!Gg(u,n))&&(u.draggable||r&&typeof u.draggable>"u")).map(u=>({id:u.id,position:u.position||{x:0,y:0},positionAbsolute:u.positionAbsolute||{x:0,y:0},distance:{x:o.x-(u.positionAbsolute?.x??0),y:o.y-(u.positionAbsolute?.y??0)},delta:{x:0,y:0},extent:u.extent,parentNode:u.parentNode||u.parentId,parentId:u.parentNode||u.parentId,width:u.width,height:u.height,expandParent:u.expandParent}))}function aS(n,r){return!r||r==="parent"?r:[r[0],[r[1][0]-(n.width||0),r[1][1]-(n.height||0)]]}function Xg(n,r,o,i,u=[0,0],f){const h=aS(n,n.extent||i);let g=h;const p=n.parentNode||n.parentId;if(n.extent==="parent"&&!n.expandParent)if(p&&n.width&&n.height){const b=o.get(p),{x:v,y:N}=hs(b,u).positionAbsolute;g=b&&yn(v)&&yn(N)&&yn(b.width)&&yn(b.height)?[[v+n.width*u[0],N+n.height*u[1]],[v+b.width-n.width+n.width*u[0],N+b.height-n.height+n.height*u[1]]]:g}else f?.("005",la.error005()),g=h;else if(n.extent&&p&&n.extent!=="parent"){const b=o.get(p),{x:v,y:N}=hs(b,u).positionAbsolute;g=[[n.extent[0][0]+v,n.extent[0][1]+N],[n.extent[1][0]+v,n.extent[1][1]+N]]}let x={x:0,y:0};if(p){const b=o.get(p);x=hs(b,u).positionAbsolute}const m=g&&g!=="parent"?cf(r,g):r;return{position:{x:m.x-x.x,y:m.y-x.y},positionAbsolute:m}}function Nd({nodeId:n,dragItems:r,nodeInternals:o}){const i=r.map(u=>({...o.get(u.id),position:u.position,positionAbsolute:u.positionAbsolute}));return[n?i.find(u=>u.id===n):i[0],i]}const n0=(n,r,o,i)=>{const u=r.querySelectorAll(n);if(!u||!u.length)return null;const f=Array.from(u),h=r.getBoundingClientRect(),g={x:h.width*i[0],y:h.height*i[1]};return f.map(p=>{const x=p.getBoundingClientRect();return{id:p.getAttribute("data-handleid"),position:p.getAttribute("data-handlepos"),x:(x.left-h.left-g.x)/o,y:(x.top-h.top-g.y)/o,...of(p)}})};function Er(n,r,o){return o===void 0?o:i=>{const u=r().nodeInternals.get(n);u&&o(i,{...u})}}function Xd({id:n,store:r,unselect:o=!1,nodeRef:i}){const{addSelectedNodes:u,unselectNodesAndEdges:f,multiSelectionActive:h,nodeInternals:g,onError:p}=r.getState(),x=g.get(n);if(!x){p?.("012",la.error012(n));return}r.setState({nodesSelectionActive:!1}),x.selected?(o||x.selected&&h)&&(f({nodes:[x],edges:[]}),requestAnimationFrame(()=>i?.current?.blur())):u([n])}function sS(){const n=Nt();return j.useCallback(({sourceEvent:o})=>{const{transform:i,snapGrid:u,snapToGrid:f}=n.getState(),h=o.touches?o.touches[0].clientX:o.clientX,g=o.touches?o.touches[0].clientY:o.clientY,p={x:(h-i[0])/i[2],y:(g-i[1])/i[2]};return{xSnapped:f?u[0]*Math.round(p.x/u[0]):p.x,ySnapped:f?u[1]*Math.round(p.y/u[1]):p.y,...p}},[])}function wd(n){return(r,o,i)=>n?.(r,i)}function Zg({nodeRef:n,disabled:r=!1,noDragClassName:o,handleSelector:i,nodeId:u,isSelectable:f,selectNodesOnDrag:h}){const g=Nt(),[p,x]=j.useState(!1),m=j.useRef([]),b=j.useRef({x:null,y:null}),v=j.useRef(0),N=j.useRef(null),C=j.useRef({x:0,y:0}),_=j.useRef(null),M=j.useRef(!1),A=j.useRef(!1),Y=j.useRef(!1),L=sS();return j.useEffect(()=>{if(n?.current){const T=gn(n.current),R=({x:le,y:I})=>{const{nodeInternals:K,onNodeDrag:ne,onSelectionDrag:ee,updateNodePositions:se,nodeExtent:S,snapGrid:U,snapToGrid:k,nodeOrigin:H,onError:D}=g.getState();b.current={x:le,y:I};let O=!1,E={x:0,y:0,x2:0,y2:0};if(m.current.length>1&&S){const W=Ji(m.current,H);E=Br(W)}if(m.current=m.current.map(W=>{const ae={x:le-W.distance.x,y:I-W.distance.y};k&&(ae.x=U[0]*Math.round(ae.x/U[0]),ae.y=U[1]*Math.round(ae.y/U[1]));const ie=[[S[0][0],S[0][1]],[S[1][0],S[1][1]]];m.current.length>1&&S&&!W.extent&&(ie[0][0]=W.positionAbsolute.x-E.x+S[0][0],ie[1][0]=W.positionAbsolute.x+(W.width??0)-E.x2+S[1][0],ie[0][1]=W.positionAbsolute.y-E.y+S[0][1],ie[1][1]=W.positionAbsolute.y+(W.height??0)-E.y2+S[1][1]);const he=Xg(W,ae,K,ie,H,D);return O=O||W.position.x!==he.position.x||W.position.y!==he.position.y,W.position=he.position,W.positionAbsolute=he.positionAbsolute,W}),!O)return;se(m.current,!0,!0),x(!0);const $=u?ne:wd(ee);if($&&_.current){const[W,ae]=Nd({nodeId:u,dragItems:m.current,nodeInternals:K});$(_.current,W,ae)}},G=()=>{if(!N.current)return;const[le,I]=fg(C.current,N.current);if(le!==0||I!==0){const{transform:K,panBy:ne}=g.getState();b.current.x=(b.current.x??0)-le/K[2],b.current.y=(b.current.y??0)-I/K[2],ne({x:le,y:I})&&R(b.current)}v.current=requestAnimationFrame(G)},X=le=>{const{nodeInternals:I,multiSelectionActive:K,nodesDraggable:ne,unselectNodesAndEdges:ee,onNodeDragStart:se,onSelectionDragStart:S}=g.getState();A.current=!0;const U=u?se:wd(S);(!h||!f)&&!K&&u&&(I.get(u)?.selected||ee()),u&&f&&h&&Xd({id:u,store:g,nodeRef:n});const k=L(le);if(b.current=k,m.current=nS(I,ne,k,u),U&&m.current){const[H,D]=Nd({nodeId:u,dragItems:m.current,nodeInternals:I});U(le.sourceEvent,H,D)}};if(r)T.on(".drag",null);else{const le=pN().on("start",I=>{const{domNode:K,nodeDragThreshold:ne}=g.getState();ne===0&&X(I),Y.current=!1;const ee=L(I);b.current=ee,N.current=K?.getBoundingClientRect()||null,C.current=Ba(I.sourceEvent,N.current)}).on("drag",I=>{const K=L(I),{autoPanOnNodeDrag:ne,nodeDragThreshold:ee}=g.getState();if(I.sourceEvent.type==="touchmove"&&I.sourceEvent.touches.length>1&&(Y.current=!0),!Y.current){if(!M.current&&A.current&&ne&&(M.current=!0,G()),!A.current){const se=K.xSnapped-(b?.current?.x??0),S=K.ySnapped-(b?.current?.y??0);Math.sqrt(se*se+S*S)>ee&&X(I)}(b.current.x!==K.xSnapped||b.current.y!==K.ySnapped)&&m.current&&A.current&&(_.current=I.sourceEvent,C.current=Ba(I.sourceEvent,N.current),R(K))}}).on("end",I=>{if(!(!A.current||Y.current)&&(x(!1),M.current=!1,A.current=!1,cancelAnimationFrame(v.current),m.current)){const{updateNodePositions:K,nodeInternals:ne,onNodeDragStop:ee,onSelectionDragStop:se}=g.getState(),S=u?ee:wd(se);if(K(m.current,!1,!1),S){const[U,k]=Nd({nodeId:u,dragItems:m.current,nodeInternals:ne});S(I.sourceEvent,U,k)}}}).filter(I=>{const K=I.target;return!I.button&&(!o||!t0(K,`.${o}`,n))&&(!i||t0(K,i,n))});return T.call(le),()=>{T.on(".drag",null)}}}},[n,r,o,i,f,g,u,h,L]),p}function Wg(){const n=Nt();return j.useCallback(o=>{const{nodeInternals:i,nodeExtent:u,updateNodePositions:f,getNodes:h,snapToGrid:g,snapGrid:p,onError:x,nodesDraggable:m}=n.getState(),b=h().filter(Y=>Y.selected&&(Y.draggable||m&&typeof Y.draggable>"u")),v=g?p[0]:5,N=g?p[1]:5,C=o.isShiftPressed?4:1,_=o.x*v*C,M=o.y*N*C,A=b.map(Y=>{if(Y.positionAbsolute){const L={x:Y.positionAbsolute.x+_,y:Y.positionAbsolute.y+M};g&&(L.x=p[0]*Math.round(L.x/p[0]),L.y=p[1]*Math.round(L.y/p[1]));const{positionAbsolute:T,position:R}=Xg(Y,L,i,u,void 0,x);Y.position=R,Y.positionAbsolute=T}return Y});f(A,!0,!1)},[])}const xl={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var kr=n=>{const r=({id:o,type:i,data:u,xPos:f,yPos:h,xPosOrigin:g,yPosOrigin:p,selected:x,onClick:m,onMouseEnter:b,onMouseMove:v,onMouseLeave:N,onContextMenu:C,onDoubleClick:_,style:M,className:A,isDraggable:Y,isSelectable:L,isConnectable:T,isFocusable:R,selectNodesOnDrag:G,sourcePosition:X,targetPosition:le,hidden:I,resizeObserver:K,dragHandle:ne,zIndex:ee,isParent:se,noDragClassName:S,noPanClassName:U,initialized:k,disableKeyboardA11y:H,ariaLabel:D,rfId:O,hasHandleBounds:E})=>{const $=Nt(),W=j.useRef(null),ae=j.useRef(null),ie=j.useRef(X),he=j.useRef(le),xe=j.useRef(i),Se=L||Y||m||b||v||N,ve=Wg(),Ae=Er(o,$.getState,b),Re=Er(o,$.getState,v),We=Er(o,$.getState,N),Te=Er(o,$.getState,C),be=Er(o,$.getState,_),q=oe=>{const{nodeDragThreshold:P}=$.getState();if(L&&(!G||!Y||P>0)&&Xd({id:o,store:$,nodeRef:W}),m){const Ee=$.getState().nodeInternals.get(o);Ee&&m(oe,{...Ee})}},V=oe=>{if(!qd(oe)&&!H)if(mg.includes(oe.key)&&L){const P=oe.key==="Escape";Xd({id:o,store:$,unselect:P,nodeRef:W})}else Y&&x&&Object.prototype.hasOwnProperty.call(xl,oe.key)&&($.setState({ariaLiveMessage:`Moved selected node ${oe.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~f}, y: ${~~h}`}),ve({x:xl[oe.key].x,y:xl[oe.key].y,isShiftPressed:oe.shiftKey}))};j.useEffect(()=>()=>{ae.current&&(K?.unobserve(ae.current),ae.current=null)},[]),j.useEffect(()=>{if(W.current&&!I){const oe=W.current;(!k||!E||ae.current!==oe)&&(ae.current&&K?.unobserve(ae.current),K?.observe(oe),ae.current=oe)}},[I,k,E]),j.useEffect(()=>{const oe=xe.current!==i,P=ie.current!==X,Ee=he.current!==le;W.current&&(oe||P||Ee)&&(oe&&(xe.current=i),P&&(ie.current=X),Ee&&(he.current=le),$.getState().updateNodeDimensions([{id:o,nodeElement:W.current,forceUpdate:!0}]))},[o,i,X,le]);const ue=Zg({nodeRef:W,disabled:I||!Y,noDragClassName:S,handleSelector:ne,nodeId:o,isSelectable:L,selectNodesOnDrag:G});return I?null:re.createElement("div",{className:$t(["react-flow__node",`react-flow__node-${i}`,{[U]:Y},A,{selected:x,selectable:L,parent:se,dragging:ue}]),ref:W,style:{zIndex:ee,transform:`translate(${g}px,${p}px)`,pointerEvents:Se?"all":"none",visibility:k?"visible":"hidden",...M},"data-id":o,"data-testid":`rf__node-${o}`,onMouseEnter:Ae,onMouseMove:Re,onMouseLeave:We,onContextMenu:Te,onClick:q,onDoubleClick:be,onKeyDown:R?V:void 0,tabIndex:R?0:void 0,role:R?"button":void 0,"aria-describedby":H?void 0:`${Hg}-${O}`,"aria-label":D},re.createElement(y5,{value:o},re.createElement(n,{id:o,data:u,type:i,xPos:f,yPos:h,selected:x,isConnectable:T,sourcePosition:X,targetPosition:le,dragging:ue,dragHandle:ne,zIndex:ee})))};return r.displayName="NodeWrapper",j.memo(r)};const lS=n=>{const r=n.getNodes().filter(o=>o.selected);return{...Ji(r,n.nodeOrigin),transformString:`translate(${n.transform[0]}px,${n.transform[1]}px) scale(${n.transform[2]})`,userSelectionActive:n.userSelectionActive}};function rS({onSelectionContextMenu:n,noPanClassName:r,disableKeyboardA11y:o}){const i=Nt(),{width:u,height:f,x:h,y:g,transformString:p,userSelectionActive:x}=tt(lS,Tt),m=Wg(),b=j.useRef(null);if(j.useEffect(()=>{o||b.current?.focus({preventScroll:!0})},[o]),Zg({nodeRef:b}),x||!u||!f)return null;const v=n?C=>{const _=i.getState().getNodes().filter(M=>M.selected);n(C,_)}:void 0,N=C=>{Object.prototype.hasOwnProperty.call(xl,C.key)&&m({x:xl[C.key].x,y:xl[C.key].y,isShiftPressed:C.shiftKey})};return re.createElement("div",{className:$t(["react-flow__nodesselection","react-flow__container",r]),style:{transform:p}},re.createElement("div",{ref:b,className:"react-flow__nodesselection-rect",onContextMenu:v,tabIndex:o?void 0:-1,onKeyDown:o?void 0:N,style:{width:u,height:f,top:g,left:h}}))}var oS=j.memo(rS);const iS=n=>n.nodesSelectionActive,Qg=({children:n,onPaneClick:r,onPaneMouseEnter:o,onPaneMouseMove:i,onPaneMouseLeave:u,onPaneContextMenu:f,onPaneScroll:h,deleteKeyCode:g,onMove:p,onMoveStart:x,onMoveEnd:m,selectionKeyCode:b,selectionOnDrag:v,selectionMode:N,onSelectionStart:C,onSelectionEnd:_,multiSelectionKeyCode:M,panActivationKeyCode:A,zoomActivationKeyCode:Y,elementsSelectable:L,zoomOnScroll:T,zoomOnPinch:R,panOnScroll:G,panOnScrollSpeed:X,panOnScrollMode:le,zoomOnDoubleClick:I,panOnDrag:K,defaultViewport:ne,translateExtent:ee,minZoom:se,maxZoom:S,preventScrolling:U,onSelectionContextMenu:k,noWheelClassName:H,noPanClassName:D,disableKeyboardA11y:O})=>{const E=tt(iS),$=Lr(b),W=Lr(A),ae=W||K,ie=W||G,he=$||v&&ae!==!0;return W5({deleteKeyCode:g,multiSelectionKeyCode:M}),re.createElement(I5,{onMove:p,onMoveStart:x,onMoveEnd:m,onPaneContextMenu:f,elementsSelectable:L,zoomOnScroll:T,zoomOnPinch:R,panOnScroll:ie,panOnScrollSpeed:X,panOnScrollMode:le,zoomOnDoubleClick:I,panOnDrag:!$&&ae,defaultViewport:ne,translateExtent:ee,minZoom:se,maxZoom:S,zoomActivationKeyCode:Y,preventScrolling:U,noWheelClassName:H,noPanClassName:D},re.createElement(Vg,{onSelectionStart:C,onSelectionEnd:_,onPaneClick:r,onPaneMouseEnter:o,onPaneMouseMove:i,onPaneMouseLeave:u,onPaneContextMenu:f,onPaneScroll:h,panOnDrag:ae,isSelecting:!!he,selectionMode:N},n,E&&re.createElement(oS,{onSelectionContextMenu:k,noPanClassName:D,disableKeyboardA11y:O})))};Qg.displayName="FlowRenderer";var cS=j.memo(Qg);function uS(n){return tt(j.useCallback(o=>n?wg(o.nodeInternals,{x:0,y:0,width:o.width,height:o.height},o.transform,!0):o.getNodes(),[n]))}function dS(n){const r={input:kr(n.input||Rg),default:kr(n.default||Gd),output:kr(n.output||Og),group:kr(n.group||pf)},o={},i=Object.keys(n).filter(u=>!["input","default","output","group"].includes(u)).reduce((u,f)=>(u[f]=kr(n[f]||Gd),u),o);return{...r,...i}}const fS=({x:n,y:r,width:o,height:i,origin:u})=>!o||!i?{x:n,y:r}:u[0]<0||u[1]<0||u[0]>1||u[1]>1?{x:n,y:r}:{x:n-o*u[0],y:r-i*u[1]},hS=n=>({nodesDraggable:n.nodesDraggable,nodesConnectable:n.nodesConnectable,nodesFocusable:n.nodesFocusable,elementsSelectable:n.elementsSelectable,updateNodeDimensions:n.updateNodeDimensions,onError:n.onError}),Kg=n=>{const{nodesDraggable:r,nodesConnectable:o,nodesFocusable:i,elementsSelectable:u,updateNodeDimensions:f,onError:h}=tt(hS,Tt),g=uS(n.onlyRenderVisibleElements),p=j.useRef(),x=j.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const m=new ResizeObserver(b=>{const v=b.map(N=>({id:N.target.getAttribute("data-id"),nodeElement:N.target,forceUpdate:!0}));f(v)});return p.current=m,m},[]);return j.useEffect(()=>()=>{p?.current?.disconnect()},[]),re.createElement("div",{className:"react-flow__nodes",style:gf},g.map(m=>{let b=m.type||"default";n.nodeTypes[b]||(h?.("003",la.error003(b)),b="default");const v=n.nodeTypes[b]||n.nodeTypes.default,N=!!(m.draggable||r&&typeof m.draggable>"u"),C=!!(m.selectable||u&&typeof m.selectable>"u"),_=!!(m.connectable||o&&typeof m.connectable>"u"),M=!!(m.focusable||i&&typeof m.focusable>"u"),A=n.nodeExtent?cf(m.positionAbsolute,n.nodeExtent):m.positionAbsolute,Y=A?.x??0,L=A?.y??0,T=fS({x:Y,y:L,width:m.width??0,height:m.height??0,origin:n.nodeOrigin});return re.createElement(v,{key:m.id,id:m.id,className:m.className,style:m.style,type:b,data:m.data,sourcePosition:m.sourcePosition||me.Bottom,targetPosition:m.targetPosition||me.Top,hidden:m.hidden,xPos:Y,yPos:L,xPosOrigin:T.x,yPosOrigin:T.y,selectNodesOnDrag:n.selectNodesOnDrag,onClick:n.onNodeClick,onMouseEnter:n.onNodeMouseEnter,onMouseMove:n.onNodeMouseMove,onMouseLeave:n.onNodeMouseLeave,onContextMenu:n.onNodeContextMenu,onDoubleClick:n.onNodeDoubleClick,selected:!!m.selected,isDraggable:N,isSelectable:C,isConnectable:_,isFocusable:M,resizeObserver:x,dragHandle:m.dragHandle,zIndex:m[ut]?.z??0,isParent:!!m[ut]?.isParent,noDragClassName:n.noDragClassName,noPanClassName:n.noPanClassName,initialized:!!m.width&&!!m.height,rfId:n.rfId,disableKeyboardA11y:n.disableKeyboardA11y,ariaLabel:m.ariaLabel,hasHandleBounds:!!m[ut]?.handleBounds})}))};Kg.displayName="NodeRenderer";var xS=j.memo(Kg);const pS=(n,r,o)=>o===me.Left?n-r:o===me.Right?n+r:n,mS=(n,r,o)=>o===me.Top?n-r:o===me.Bottom?n+r:n,a0="react-flow__edgeupdater",s0=({position:n,centerX:r,centerY:o,radius:i=10,onMouseDown:u,onMouseEnter:f,onMouseOut:h,type:g})=>re.createElement("circle",{onMouseDown:u,onMouseEnter:f,onMouseOut:h,className:$t([a0,`${a0}-${g}`]),cx:pS(r,i,n),cy:mS(o,i,n),r:i,stroke:"transparent",fill:"transparent"}),gS=()=>!0;var sl=n=>{const r=({id:o,className:i,type:u,data:f,onClick:h,onEdgeDoubleClick:g,selected:p,animated:x,label:m,labelStyle:b,labelShowBg:v,labelBgStyle:N,labelBgPadding:C,labelBgBorderRadius:_,style:M,source:A,target:Y,sourceX:L,sourceY:T,targetX:R,targetY:G,sourcePosition:X,targetPosition:le,elementsSelectable:I,hidden:K,sourceHandleId:ne,targetHandleId:ee,onContextMenu:se,onMouseEnter:S,onMouseMove:U,onMouseLeave:k,reconnectRadius:H,onReconnect:D,onReconnectStart:O,onReconnectEnd:E,markerEnd:$,markerStart:W,rfId:ae,ariaLabel:ie,isFocusable:he,isReconnectable:xe,pathOptions:Se,interactionWidth:ve,disableKeyboardA11y:Ae})=>{const Re=j.useRef(null),[We,Te]=j.useState(!1),[be,q]=j.useState(!1),V=Nt(),ue=j.useMemo(()=>`url('#${Yd(W,ae)}')`,[W,ae]),oe=j.useMemo(()=>`url('#${Yd($,ae)}')`,[$,ae]);if(K)return null;const P=Ve=>{const{edges:je,addSelectedEdges:Le,unselectNodesAndEdges:Ge,multiSelectionActive:Rt}=V.getState(),Vt=je.find(Jt=>Jt.id===o);Vt&&(I&&(V.setState({nodesSelectionActive:!1}),Vt.selected&&Rt?(Ge({nodes:[],edges:[Vt]}),Re.current?.blur()):Le([o])),h&&h(Ve,Vt))},Ee=Sr(o,V.getState,g),ge=Sr(o,V.getState,se),ke=Sr(o,V.getState,S),Oe=Sr(o,V.getState,U),ze=Sr(o,V.getState,k),Mt=(Ve,je)=>{if(Ve.button!==0)return;const{edges:Le,isValidConnection:Ge}=V.getState(),Rt=je?Y:A,Vt=(je?ee:ne)||null,Jt=je?"target":"source",jl=Ge||gS,ys=je,ra=Le.find(Dn=>Dn.id===o);q(!0),O?.(Ve,ra,Jt);const Va=Dn=>{q(!1),E?.(Dn,ra,Jt)};Cg({event:Ve,handleId:Vt,nodeId:Rt,onConnect:Dn=>D?.(ra,Dn),isTarget:ys,getState:V.getState,setState:V.setState,isValidConnection:jl,edgeUpdaterType:Jt,onReconnectEnd:Va})},At=Ve=>Mt(Ve,!0),dt=Ve=>Mt(Ve,!1),nt=()=>Te(!0),pt=()=>Te(!1),at=!I&&!h,pe=Ve=>{if(!Ae&&mg.includes(Ve.key)&&I){const{unselectNodesAndEdges:je,addSelectedEdges:Le,edges:Ge}=V.getState();Ve.key==="Escape"?(Re.current?.blur(),je({edges:[Ge.find(Vt=>Vt.id===o)]})):Le([o])}};return re.createElement("g",{className:$t(["react-flow__edge",`react-flow__edge-${u}`,i,{selected:p,animated:x,inactive:at,updating:We}]),onClick:P,onDoubleClick:Ee,onContextMenu:ge,onMouseEnter:ke,onMouseMove:Oe,onMouseLeave:ze,onKeyDown:he?pe:void 0,tabIndex:he?0:void 0,role:he?"button":"img","data-testid":`rf__edge-${o}`,"aria-label":ie===null?void 0:ie||`Edge from ${A} to ${Y}`,"aria-describedby":he?`${$g}-${ae}`:void 0,ref:Re},!be&&re.createElement(n,{id:o,source:A,target:Y,selected:p,animated:x,label:m,labelStyle:b,labelShowBg:v,labelBgStyle:N,labelBgPadding:C,labelBgBorderRadius:_,data:f,style:M,sourceX:L,sourceY:T,targetX:R,targetY:G,sourcePosition:X,targetPosition:le,sourceHandleId:ne,targetHandleId:ee,markerStart:ue,markerEnd:oe,pathOptions:Se,interactionWidth:ve}),xe&&re.createElement(re.Fragment,null,(xe==="source"||xe===!0)&&re.createElement(s0,{position:X,centerX:L,centerY:T,radius:H,onMouseDown:At,onMouseEnter:nt,onMouseOut:pt,type:"source"}),(xe==="target"||xe===!0)&&re.createElement(s0,{position:le,centerX:R,centerY:G,radius:H,onMouseDown:dt,onMouseEnter:nt,onMouseOut:pt,type:"target"})))};return r.displayName="EdgeWrapper",j.memo(r)};function yS(n){const r={default:sl(n.default||Li),straight:sl(n.bezier||ff),step:sl(n.step||df),smoothstep:sl(n.step||Ki),simplebezier:sl(n.simplebezier||uf)},o={},i=Object.keys(n).filter(u=>!["default","bezier"].includes(u)).reduce((u,f)=>(u[f]=sl(n[f]||Li),u),o);return{...r,...i}}function l0(n,r,o=null){const i=(o?.x||0)+r.x,u=(o?.y||0)+r.y,f=o?.width||r.width,h=o?.height||r.height;switch(n){case me.Top:return{x:i+f/2,y:u};case me.Right:return{x:i+f,y:u+h/2};case me.Bottom:return{x:i+f/2,y:u+h};case me.Left:return{x:i,y:u+h/2}}}function r0(n,r){return n?n.length===1||!r?n[0]:r&&n.find(o=>o.id===r)||null:null}const bS=(n,r,o,i,u,f)=>{const h=l0(o,n,r),g=l0(f,i,u);return{sourceX:h.x,sourceY:h.y,targetX:g.x,targetY:g.y}};function vS({sourcePos:n,targetPos:r,sourceWidth:o,sourceHeight:i,targetWidth:u,targetHeight:f,width:h,height:g,transform:p}){const x={x:Math.min(n.x,r.x),y:Math.min(n.y,r.y),x2:Math.max(n.x+o,r.x+u),y2:Math.max(n.y+i,r.y+f)};x.x===x.x2&&(x.x2+=1),x.y===x.y2&&(x.y2+=1);const m=Br({x:(0-p[0])/p[2],y:(0-p[1])/p[2],width:h/p[2],height:g/p[2]}),b=Math.max(0,Math.min(m.x2,x.x2)-Math.max(m.x,x.x)),v=Math.max(0,Math.min(m.y2,x.y2)-Math.max(m.y,x.y));return Math.ceil(b*v)>0}function o0(n){const r=n?.[ut]?.handleBounds||null,o=r&&n?.width&&n?.height&&typeof n?.positionAbsolute?.x<"u"&&typeof n?.positionAbsolute?.y<"u";return[{x:n?.positionAbsolute?.x||0,y:n?.positionAbsolute?.y||0,width:n?.width||0,height:n?.height||0},r,!!o]}const jS=[{level:0,isMaxLevel:!0,edges:[]}];function NS(n,r,o=!1){let i=-1;const u=n.reduce((h,g)=>{const p=yn(g.zIndex);let x=p?g.zIndex:0;if(o){const m=r.get(g.target),b=r.get(g.source),v=g.selected||m?.selected||b?.selected,N=Math.max(b?.[ut]?.z||0,m?.[ut]?.z||0,1e3);x=(p?g.zIndex:0)+(v?N:0)}return h[x]?h[x].push(g):h[x]=[g],i=x>i?x:i,h},{}),f=Object.entries(u).map(([h,g])=>{const p=+h;return{edges:g,level:p,isMaxLevel:p===i}});return f.length===0?jS:f}function wS(n,r,o){const i=tt(j.useCallback(u=>n?u.edges.filter(f=>{const h=r.get(f.source),g=r.get(f.target);return h?.width&&h?.height&&g?.width&&g?.height&&vS({sourcePos:h.positionAbsolute||{x:0,y:0},targetPos:g.positionAbsolute||{x:0,y:0},sourceWidth:h.width,sourceHeight:h.height,targetWidth:g.width,targetHeight:g.height,width:u.width,height:u.height,transform:u.transform})}):u.edges,[n,r]));return NS(i,r,o)}const SS=({color:n="none",strokeWidth:r=1})=>re.createElement("polyline",{style:{stroke:n,strokeWidth:r},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),ES=({color:n="none",strokeWidth:r=1})=>re.createElement("polyline",{style:{stroke:n,fill:n,strokeWidth:r},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),i0={[qa.Arrow]:SS,[qa.ArrowClosed]:ES};function kS(n){const r=Nt();return j.useMemo(()=>Object.prototype.hasOwnProperty.call(i0,n)?i0[n]:(r.getState().onError?.("009",la.error009(n)),null),[n])}const _S=({id:n,type:r,color:o,width:i=12.5,height:u=12.5,markerUnits:f="strokeWidth",strokeWidth:h,orient:g="auto-start-reverse"})=>{const p=kS(r);return p?re.createElement("marker",{className:"react-flow__arrowhead",id:n,markerWidth:`${i}`,markerHeight:`${u}`,viewBox:"-10 -10 20 20",markerUnits:f,orient:g,refX:"0",refY:"0"},re.createElement(p,{color:o,strokeWidth:h})):null},CS=({defaultColor:n,rfId:r})=>o=>{const i=[];return o.edges.reduce((u,f)=>([f.markerStart,f.markerEnd].forEach(h=>{if(h&&typeof h=="object"){const g=Yd(h,r);i.includes(g)||(u.push({id:g,color:h.color||n,...h}),i.push(g))}}),u),[]).sort((u,f)=>u.id.localeCompare(f.id))},Jg=({defaultColor:n,rfId:r})=>{const o=tt(j.useCallback(CS({defaultColor:n,rfId:r}),[n,r]),(i,u)=>!(i.length!==u.length||i.some((f,h)=>f.id!==u[h].id)));return re.createElement("defs",null,o.map(i=>re.createElement(_S,{id:i.id,key:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient})))};Jg.displayName="MarkerDefinitions";var TS=j.memo(Jg);const MS=n=>({nodesConnectable:n.nodesConnectable,edgesFocusable:n.edgesFocusable,edgesUpdatable:n.edgesUpdatable,elementsSelectable:n.elementsSelectable,width:n.width,height:n.height,connectionMode:n.connectionMode,nodeInternals:n.nodeInternals,onError:n.onError}),Ig=({defaultMarkerColor:n,onlyRenderVisibleElements:r,elevateEdgesOnSelect:o,rfId:i,edgeTypes:u,noPanClassName:f,onEdgeContextMenu:h,onEdgeMouseEnter:g,onEdgeMouseMove:p,onEdgeMouseLeave:x,onEdgeClick:m,onEdgeDoubleClick:b,onReconnect:v,onReconnectStart:N,onReconnectEnd:C,reconnectRadius:_,children:M,disableKeyboardA11y:A})=>{const{edgesFocusable:Y,edgesUpdatable:L,elementsSelectable:T,width:R,height:G,connectionMode:X,nodeInternals:le,onError:I}=tt(MS,Tt),K=wS(r,le,o);return R?re.createElement(re.Fragment,null,K.map(({level:ne,edges:ee,isMaxLevel:se})=>re.createElement("svg",{key:ne,style:{zIndex:ne},width:R,height:G,className:"react-flow__edges react-flow__container"},se&&re.createElement(TS,{defaultColor:n,rfId:i}),re.createElement("g",null,ee.map(S=>{const[U,k,H]=o0(le.get(S.source)),[D,O,E]=o0(le.get(S.target));if(!H||!E)return null;let $=S.type||"default";u[$]||(I?.("011",la.error011($)),$="default");const W=u[$]||u.default,ae=X===ps.Strict?O.target:(O.target??[]).concat(O.source??[]),ie=r0(k.source,S.sourceHandle),he=r0(ae,S.targetHandle),xe=ie?.position||me.Bottom,Se=he?.position||me.Top,ve=!!(S.focusable||Y&&typeof S.focusable>"u"),Ae=S.reconnectable||S.updatable,Re=typeof v<"u"&&(Ae||L&&typeof Ae>"u");if(!ie||!he)return I?.("008",la.error008(ie,S)),null;const{sourceX:We,sourceY:Te,targetX:be,targetY:q}=bS(U,ie,xe,D,he,Se);return re.createElement(W,{key:S.id,id:S.id,className:$t([S.className,f]),type:$,data:S.data,selected:!!S.selected,animated:!!S.animated,hidden:!!S.hidden,label:S.label,labelStyle:S.labelStyle,labelShowBg:S.labelShowBg,labelBgStyle:S.labelBgStyle,labelBgPadding:S.labelBgPadding,labelBgBorderRadius:S.labelBgBorderRadius,style:S.style,source:S.source,target:S.target,sourceHandleId:S.sourceHandle,targetHandleId:S.targetHandle,markerEnd:S.markerEnd,markerStart:S.markerStart,sourceX:We,sourceY:Te,targetX:be,targetY:q,sourcePosition:xe,targetPosition:Se,elementsSelectable:T,onContextMenu:h,onMouseEnter:g,onMouseMove:p,onMouseLeave:x,onClick:m,onEdgeDoubleClick:b,onReconnect:v,onReconnectStart:N,onReconnectEnd:C,reconnectRadius:_,rfId:i,ariaLabel:S.ariaLabel,isFocusable:ve,isReconnectable:Re,pathOptions:"pathOptions"in S?S.pathOptions:void 0,interactionWidth:S.interactionWidth,disableKeyboardA11y:A})})))),M):null};Ig.displayName="EdgeRenderer";var AS=j.memo(Ig);const RS=n=>`translate(${n.transform[0]}px,${n.transform[1]}px) scale(${n.transform[2]})`;function zS({children:n}){const r=tt(RS);return re.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:r}},n)}function OS(n){const r=mf(),o=j.useRef(!1);j.useEffect(()=>{!o.current&&r.viewportInitialized&&n&&(setTimeout(()=>n(r),1),o.current=!0)},[n,r.viewportInitialized])}const DS={[me.Left]:me.Right,[me.Right]:me.Left,[me.Top]:me.Bottom,[me.Bottom]:me.Top},Fg=({nodeId:n,handleType:r,style:o,type:i=Ua.Bezier,CustomComponent:u,connectionStatus:f})=>{const{fromNode:h,handleId:g,toX:p,toY:x,connectionMode:m}=tt(j.useCallback(G=>({fromNode:G.nodeInternals.get(n),handleId:G.connectionHandleId,toX:(G.connectionPosition.x-G.transform[0])/G.transform[2],toY:(G.connectionPosition.y-G.transform[1])/G.transform[2],connectionMode:G.connectionMode}),[n]),Tt),b=h?.[ut]?.handleBounds;let v=b?.[r];if(m===ps.Loose&&(v=v||b?.[r==="source"?"target":"source"]),!h||!v)return null;const N=g?v.find(G=>G.id===g):v[0],C=N?N.x+N.width/2:(h.width??0)/2,_=N?N.y+N.height/2:h.height??0,M=(h.positionAbsolute?.x??0)+C,A=(h.positionAbsolute?.y??0)+_,Y=N?.position,L=Y?DS[Y]:null;if(!Y||!L)return null;if(u)return re.createElement(u,{connectionLineType:i,connectionLineStyle:o,fromNode:h,fromHandle:N,fromX:M,fromY:A,toX:p,toY:x,fromPosition:Y,toPosition:L,connectionStatus:f});let T="";const R={sourceX:M,sourceY:A,sourcePosition:Y,targetX:p,targetY:x,targetPosition:L};return i===Ua.Bezier?[T]=jg(R):i===Ua.Step?[T]=Ld({...R,borderRadius:0}):i===Ua.SmoothStep?[T]=Ld(R):i===Ua.SimpleBezier?[T]=vg(R):T=`M${M},${A} ${p},${x}`,re.createElement("path",{d:T,fill:"none",className:"react-flow__connection-path",style:o})};Fg.displayName="ConnectionLine";const HS=n=>({nodeId:n.connectionNodeId,handleType:n.connectionHandleType,nodesConnectable:n.nodesConnectable,connectionStatus:n.connectionStatus,width:n.width,height:n.height});function $S({containerStyle:n,style:r,type:o,component:i}){const{nodeId:u,handleType:f,nodesConnectable:h,width:g,height:p,connectionStatus:x}=tt(HS,Tt);return!(u&&f&&g&&h)?null:re.createElement("svg",{style:n,width:g,height:p,className:"react-flow__edges react-flow__connectionline react-flow__container"},re.createElement("g",{className:$t(["react-flow__connection",x])},re.createElement(Fg,{nodeId:u,handleType:f,style:r,type:o,CustomComponent:i,connectionStatus:x})))}function c0(n,r){return j.useRef(null),Nt(),j.useMemo(()=>r(n),[n])}const Pg=({nodeTypes:n,edgeTypes:r,onMove:o,onMoveStart:i,onMoveEnd:u,onInit:f,onNodeClick:h,onEdgeClick:g,onNodeDoubleClick:p,onEdgeDoubleClick:x,onNodeMouseEnter:m,onNodeMouseMove:b,onNodeMouseLeave:v,onNodeContextMenu:N,onSelectionContextMenu:C,onSelectionStart:_,onSelectionEnd:M,connectionLineType:A,connectionLineStyle:Y,connectionLineComponent:L,connectionLineContainerStyle:T,selectionKeyCode:R,selectionOnDrag:G,selectionMode:X,multiSelectionKeyCode:le,panActivationKeyCode:I,zoomActivationKeyCode:K,deleteKeyCode:ne,onlyRenderVisibleElements:ee,elementsSelectable:se,selectNodesOnDrag:S,defaultViewport:U,translateExtent:k,minZoom:H,maxZoom:D,preventScrolling:O,defaultMarkerColor:E,zoomOnScroll:$,zoomOnPinch:W,panOnScroll:ae,panOnScrollSpeed:ie,panOnScrollMode:he,zoomOnDoubleClick:xe,panOnDrag:Se,onPaneClick:ve,onPaneMouseEnter:Ae,onPaneMouseMove:Re,onPaneMouseLeave:We,onPaneScroll:Te,onPaneContextMenu:be,onEdgeContextMenu:q,onEdgeMouseEnter:V,onEdgeMouseMove:ue,onEdgeMouseLeave:oe,onReconnect:P,onReconnectStart:Ee,onReconnectEnd:ge,reconnectRadius:ke,noDragClassName:Oe,noWheelClassName:ze,noPanClassName:Mt,elevateEdgesOnSelect:At,disableKeyboardA11y:dt,nodeOrigin:nt,nodeExtent:pt,rfId:at})=>{const pe=c0(n,dS),Ve=c0(r,yS);return OS(f),re.createElement(cS,{onPaneClick:ve,onPaneMouseEnter:Ae,onPaneMouseMove:Re,onPaneMouseLeave:We,onPaneContextMenu:be,onPaneScroll:Te,deleteKeyCode:ne,selectionKeyCode:R,selectionOnDrag:G,selectionMode:X,onSelectionStart:_,onSelectionEnd:M,multiSelectionKeyCode:le,panActivationKeyCode:I,zoomActivationKeyCode:K,elementsSelectable:se,onMove:o,onMoveStart:i,onMoveEnd:u,zoomOnScroll:$,zoomOnPinch:W,zoomOnDoubleClick:xe,panOnScroll:ae,panOnScrollSpeed:ie,panOnScrollMode:he,panOnDrag:Se,defaultViewport:U,translateExtent:k,minZoom:H,maxZoom:D,onSelectionContextMenu:C,preventScrolling:O,noDragClassName:Oe,noWheelClassName:ze,noPanClassName:Mt,disableKeyboardA11y:dt},re.createElement(zS,null,re.createElement(AS,{edgeTypes:Ve,onEdgeClick:g,onEdgeDoubleClick:x,onlyRenderVisibleElements:ee,onEdgeContextMenu:q,onEdgeMouseEnter:V,onEdgeMouseMove:ue,onEdgeMouseLeave:oe,onReconnect:P,onReconnectStart:Ee,onReconnectEnd:ge,reconnectRadius:ke,defaultMarkerColor:E,noPanClassName:Mt,elevateEdgesOnSelect:!!At,disableKeyboardA11y:dt,rfId:at},re.createElement($S,{style:Y,type:A,component:L,containerStyle:T})),re.createElement("div",{className:"react-flow__edgelabel-renderer"}),re.createElement(xS,{nodeTypes:pe,onNodeClick:h,onNodeDoubleClick:p,onNodeMouseEnter:m,onNodeMouseMove:b,onNodeMouseLeave:v,onNodeContextMenu:N,selectNodesOnDrag:S,onlyRenderVisibleElements:ee,noPanClassName:Mt,noDragClassName:Oe,disableKeyboardA11y:dt,nodeOrigin:nt,nodeExtent:pt,rfId:at})))};Pg.displayName="GraphView";var US=j.memo(Pg);const Zd=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Da={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:Zd,nodeExtent:Zd,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:ps.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:0,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,onSelectionChange:[],multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:f5,isValidConnection:void 0},BS=()=>_2((n,r)=>({...Da,setNodes:o=>{const{nodeInternals:i,nodeOrigin:u,elevateNodesOnSelect:f}=r();n({nodeInternals:vd(o,i,u,f)})},getNodes:()=>Array.from(r().nodeInternals.values()),setEdges:o=>{const{defaultEdgeOptions:i={}}=r();n({edges:o.map(u=>({...i,...u}))})},setDefaultNodesAndEdges:(o,i)=>{const u=typeof o<"u",f=typeof i<"u",h=u?vd(o,new Map,r().nodeOrigin,r().elevateNodesOnSelect):new Map;n({nodeInternals:h,edges:f?i:[],hasDefaultNodes:u,hasDefaultEdges:f})},updateNodeDimensions:o=>{const{onNodesChange:i,nodeInternals:u,fitViewOnInit:f,fitViewOnInitDone:h,fitViewOnInitOptions:g,domNode:p,nodeOrigin:x}=r(),m=p?.querySelector(".react-flow__viewport");if(!m)return;const b=window.getComputedStyle(m),{m22:v}=new window.DOMMatrixReadOnly(b.transform),N=o.reduce((_,M)=>{const A=u.get(M.id);if(A?.hidden)u.set(A.id,{...A,[ut]:{...A[ut],handleBounds:void 0}});else if(A){const Y=of(M.nodeElement);!!(Y.width&&Y.height&&(A.width!==Y.width||A.height!==Y.height||M.forceUpdate))&&(u.set(A.id,{...A,[ut]:{...A[ut],handleBounds:{source:n0(".source",M.nodeElement,v,x),target:n0(".target",M.nodeElement,v,x)}},...Y}),_.push({id:A.id,type:"dimensions",dimensions:Y}))}return _},[]);Bg(u,x);const C=h||f&&!h&&qg(r,{initial:!0,...g});n({nodeInternals:new Map(u),fitViewOnInitDone:C}),N?.length>0&&i?.(N)},updateNodePositions:(o,i=!0,u=!1)=>{const{triggerNodeChanges:f}=r(),h=o.map(g=>{const p={id:g.id,type:"position",dragging:u};return i&&(p.positionAbsolute=g.positionAbsolute,p.position=g.position),p});f(h)},triggerNodeChanges:o=>{const{onNodesChange:i,nodeInternals:u,hasDefaultNodes:f,nodeOrigin:h,getNodes:g,elevateNodesOnSelect:p}=r();if(o?.length){if(f){const x=Yg(o,g()),m=vd(x,u,h,p);n({nodeInternals:m})}i?.(o)}},addSelectedNodes:o=>{const{multiSelectionActive:i,edges:u,getNodes:f}=r();let h,g=null;i?h=o.map(p=>$a(p,!0)):(h=cl(f(),o),g=cl(u,[])),Ni({changedNodes:h,changedEdges:g,get:r,set:n})},addSelectedEdges:o=>{const{multiSelectionActive:i,edges:u,getNodes:f}=r();let h,g=null;i?h=o.map(p=>$a(p,!0)):(h=cl(u,o),g=cl(f(),[])),Ni({changedNodes:g,changedEdges:h,get:r,set:n})},unselectNodesAndEdges:({nodes:o,edges:i}={})=>{const{edges:u,getNodes:f}=r(),h=o||f(),g=i||u,p=h.map(m=>(m.selected=!1,$a(m.id,!1))),x=g.map(m=>$a(m.id,!1));Ni({changedNodes:p,changedEdges:x,get:r,set:n})},setMinZoom:o=>{const{d3Zoom:i,maxZoom:u}=r();i?.scaleExtent([o,u]),n({minZoom:o})},setMaxZoom:o=>{const{d3Zoom:i,minZoom:u}=r();i?.scaleExtent([u,o]),n({maxZoom:o})},setTranslateExtent:o=>{r().d3Zoom?.translateExtent(o),n({translateExtent:o})},resetSelectedElements:()=>{const{edges:o,getNodes:i}=r(),f=i().filter(g=>g.selected).map(g=>$a(g.id,!1)),h=o.filter(g=>g.selected).map(g=>$a(g.id,!1));Ni({changedNodes:f,changedEdges:h,get:r,set:n})},setNodeExtent:o=>{const{nodeInternals:i}=r();i.forEach(u=>{u.positionAbsolute=cf(u.position,o)}),n({nodeExtent:o,nodeInternals:new Map(i)})},panBy:o=>{const{transform:i,width:u,height:f,d3Zoom:h,d3Selection:g,translateExtent:p}=r();if(!h||!g||!o.x&&!o.y)return!1;const x=ta.translate(i[0]+o.x,i[1]+o.y).scale(i[2]),m=[[0,0],[u,f]],b=h?.constrain()(x,m,p);return h.transform(g,b),i[0]!==b.x||i[1]!==b.y||i[2]!==b.k},cancelConnection:()=>n({connectionNodeId:Da.connectionNodeId,connectionHandleId:Da.connectionHandleId,connectionHandleType:Da.connectionHandleType,connectionStatus:Da.connectionStatus,connectionStartHandle:Da.connectionStartHandle,connectionEndHandle:Da.connectionEndHandle}),reset:()=>n({...Da})}),Object.is),ey=({children:n})=>{const r=j.useRef(null);return r.current||(r.current=BS()),re.createElement(l5,{value:r.current},n)};ey.displayName="ReactFlowProvider";const ty=({children:n})=>j.useContext(Qi)?re.createElement(re.Fragment,null,n):re.createElement(ey,null,n);ty.displayName="ReactFlowWrapper";const qS={input:Rg,default:Gd,output:Og,group:pf},LS={default:Li,straight:ff,step:df,smoothstep:Ki,simplebezier:uf},YS=[0,0],VS=[15,15],GS={x:0,y:0,zoom:1},XS={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},yf=j.forwardRef(({nodes:n,edges:r,defaultNodes:o,defaultEdges:i,className:u,nodeTypes:f=qS,edgeTypes:h=LS,onNodeClick:g,onEdgeClick:p,onInit:x,onMove:m,onMoveStart:b,onMoveEnd:v,onConnect:N,onConnectStart:C,onConnectEnd:_,onClickConnectStart:M,onClickConnectEnd:A,onNodeMouseEnter:Y,onNodeMouseMove:L,onNodeMouseLeave:T,onNodeContextMenu:R,onNodeDoubleClick:G,onNodeDragStart:X,onNodeDrag:le,onNodeDragStop:I,onNodesDelete:K,onEdgesDelete:ne,onSelectionChange:ee,onSelectionDragStart:se,onSelectionDrag:S,onSelectionDragStop:U,onSelectionContextMenu:k,onSelectionStart:H,onSelectionEnd:D,connectionMode:O=ps.Strict,connectionLineType:E=Ua.Bezier,connectionLineStyle:$,connectionLineComponent:W,connectionLineContainerStyle:ae,deleteKeyCode:ie="Backspace",selectionKeyCode:he="Shift",selectionOnDrag:xe=!1,selectionMode:Se=qr.Full,panActivationKeyCode:ve="Space",multiSelectionKeyCode:Ae=qi()?"Meta":"Control",zoomActivationKeyCode:Re=qi()?"Meta":"Control",snapToGrid:We=!1,snapGrid:Te=VS,onlyRenderVisibleElements:be=!1,selectNodesOnDrag:q=!0,nodesDraggable:V,nodesConnectable:ue,nodesFocusable:oe,nodeOrigin:P=YS,edgesFocusable:Ee,edgesUpdatable:ge,elementsSelectable:ke,defaultViewport:Oe=GS,minZoom:ze=.5,maxZoom:Mt=2,translateExtent:At=Zd,preventScrolling:dt=!0,nodeExtent:nt,defaultMarkerColor:pt="#b1b1b7",zoomOnScroll:at=!0,zoomOnPinch:pe=!0,panOnScroll:Ve=!1,panOnScrollSpeed:je=.5,panOnScrollMode:Le=ds.Free,zoomOnDoubleClick:Ge=!0,panOnDrag:Rt=!0,onPaneClick:Vt,onPaneMouseEnter:Jt,onPaneMouseMove:jl,onPaneMouseLeave:ys,onPaneScroll:ra,onPaneContextMenu:Va,children:oa,onEdgeContextMenu:Dn,onEdgeDoubleClick:Qr,onEdgeMouseEnter:Kr,onEdgeMouseMove:Nl,onEdgeMouseLeave:wl,onEdgeUpdate:Jr,onEdgeUpdateStart:Ii,onEdgeUpdateEnd:_n,onReconnect:wt,onReconnectStart:Ut,onReconnectEnd:ia,reconnectRadius:Sl=10,edgeUpdaterRadius:Fi=10,onNodesChange:Pi,onEdgesChange:Ir,noDragClassName:Ga="nodrag",noWheelClassName:El="nowheel",noPanClassName:Hn="nopan",fitView:ca=!1,fitViewOptions:Xa,connectOnClick:ua=!0,attributionPosition:mt,proOptions:Fr,defaultEdgeOptions:Pr,elevateNodesOnSelect:$n=!0,elevateEdgesOnSelect:da=!1,disableKeyboardA11y:eo=!1,autoPanOnConnect:to=!0,autoPanOnNodeDrag:no=!0,connectionRadius:ec=20,isValidConnection:bs,onError:vs,style:bn,id:js,nodeDragThreshold:ao,...fa},kl)=>{const Za=js||"1";return re.createElement("div",{...fa,style:{...bn,...XS},ref:kl,className:$t(["react-flow",u]),"data-testid":"rf__wrapper",id:js},re.createElement(ty,null,re.createElement(US,{onInit:x,onMove:m,onMoveStart:b,onMoveEnd:v,onNodeClick:g,onEdgeClick:p,onNodeMouseEnter:Y,onNodeMouseMove:L,onNodeMouseLeave:T,onNodeContextMenu:R,onNodeDoubleClick:G,nodeTypes:f,edgeTypes:h,connectionLineType:E,connectionLineStyle:$,connectionLineComponent:W,connectionLineContainerStyle:ae,selectionKeyCode:he,selectionOnDrag:xe,selectionMode:Se,deleteKeyCode:ie,multiSelectionKeyCode:Ae,panActivationKeyCode:ve,zoomActivationKeyCode:Re,onlyRenderVisibleElements:be,selectNodesOnDrag:q,defaultViewport:Oe,translateExtent:At,minZoom:ze,maxZoom:Mt,preventScrolling:dt,zoomOnScroll:at,zoomOnPinch:pe,zoomOnDoubleClick:Ge,panOnScroll:Ve,panOnScrollSpeed:je,panOnScrollMode:Le,panOnDrag:Rt,onPaneClick:Vt,onPaneMouseEnter:Jt,onPaneMouseMove:jl,onPaneMouseLeave:ys,onPaneScroll:ra,onPaneContextMenu:Va,onSelectionContextMenu:k,onSelectionStart:H,onSelectionEnd:D,onEdgeContextMenu:Dn,onEdgeDoubleClick:Qr,onEdgeMouseEnter:Kr,onEdgeMouseMove:Nl,onEdgeMouseLeave:wl,onReconnect:wt??Jr,onReconnectStart:Ut??Ii,onReconnectEnd:ia??_n,reconnectRadius:Sl??Fi,defaultMarkerColor:pt,noDragClassName:Ga,noWheelClassName:El,noPanClassName:Hn,elevateEdgesOnSelect:da,rfId:Za,disableKeyboardA11y:eo,nodeOrigin:P,nodeExtent:nt}),re.createElement(D5,{nodes:n,edges:r,defaultNodes:o,defaultEdges:i,onConnect:N,onConnectStart:C,onConnectEnd:_,onClickConnectStart:M,onClickConnectEnd:A,nodesDraggable:V,nodesConnectable:ue,nodesFocusable:oe,edgesFocusable:Ee,edgesUpdatable:ge,elementsSelectable:ke,elevateNodesOnSelect:$n,minZoom:ze,maxZoom:Mt,nodeExtent:nt,onNodesChange:Pi,onEdgesChange:Ir,snapToGrid:We,snapGrid:Te,connectionMode:O,translateExtent:At,connectOnClick:ua,defaultEdgeOptions:Pr,fitView:ca,fitViewOptions:Xa,onNodesDelete:K,onEdgesDelete:ne,onNodeDragStart:X,onNodeDrag:le,onNodeDragStop:I,onSelectionDrag:S,onSelectionDragStart:se,onSelectionDragStop:U,noPanClassName:Hn,nodeOrigin:P,rfId:Za,autoPanOnConnect:to,autoPanOnNodeDrag:no,onError:vs,connectionRadius:ec,isValidConnection:bs,nodeDragThreshold:ao}),re.createElement(z5,{onSelectionChange:ee}),oa,re.createElement(o5,{proOptions:Fr,position:mt}),re.createElement(q5,{rfId:Za,disableKeyboardA11y:eo})))});yf.displayName="ReactFlow";function ny(n){return r=>{const[o,i]=j.useState(r),u=j.useCallback(f=>i(h=>n(f,h)),[]);return[o,i,u]}}const ay=ny(Yg),sy=ny(eS),ly=({id:n,x:r,y:o,width:i,height:u,style:f,color:h,strokeColor:g,strokeWidth:p,className:x,borderRadius:m,shapeRendering:b,onClick:v,selected:N})=>{const{background:C,backgroundColor:_}=f||{},M=h||C||_;return re.createElement("rect",{className:$t(["react-flow__minimap-node",{selected:N},x]),x:r,y:o,rx:m,ry:m,width:i,height:u,fill:M,stroke:g,strokeWidth:p,shapeRendering:b,onClick:v?A=>v(A,n):void 0})};ly.displayName="MiniMapNode";var ZS=j.memo(ly);const WS=n=>n.nodeOrigin,QS=n=>n.getNodes().filter(r=>!r.hidden&&r.width&&r.height),Sd=n=>n instanceof Function?n:()=>n;function KS({nodeStrokeColor:n="transparent",nodeColor:r="#e2e2e2",nodeClassName:o="",nodeBorderRadius:i=5,nodeStrokeWidth:u=2,nodeComponent:f=ZS,onClick:h}){const g=tt(QS,Tt),p=tt(WS),x=Sd(r),m=Sd(n),b=Sd(o),v=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return re.createElement(re.Fragment,null,g.map(N=>{const{x:C,y:_}=hs(N,p).positionAbsolute;return re.createElement(f,{key:N.id,x:C,y:_,width:N.width,height:N.height,style:N.style,selected:N.selected,className:b(N),color:x(N),borderRadius:i,strokeColor:m(N),strokeWidth:u,shapeRendering:v,onClick:h,id:N.id})}))}var JS=j.memo(KS);const IS=200,FS=150,PS=n=>{const r=n.getNodes(),o={x:-n.transform[0]/n.transform[2],y:-n.transform[1]/n.transform[2],width:n.width/n.transform[2],height:n.height/n.transform[2]};return{viewBB:o,boundingRect:r.length>0?u5(Ji(r,n.nodeOrigin),o):o,rfId:n.rfId}},e3="react-flow__minimap-desc";function ry({style:n,className:r,nodeStrokeColor:o="transparent",nodeColor:i="#e2e2e2",nodeClassName:u="",nodeBorderRadius:f=5,nodeStrokeWidth:h=2,nodeComponent:g,maskColor:p="rgb(240, 240, 240, 0.6)",maskStrokeColor:x="none",maskStrokeWidth:m=1,position:b="bottom-right",onClick:v,onNodeClick:N,pannable:C=!1,zoomable:_=!1,ariaLabel:M="React Flow mini map",inversePan:A=!1,zoomStep:Y=10,offsetScale:L=5}){const T=Nt(),R=j.useRef(null),{boundingRect:G,viewBB:X,rfId:le}=tt(PS,Tt),I=n?.width??IS,K=n?.height??FS,ne=G.width/I,ee=G.height/K,se=Math.max(ne,ee),S=se*I,U=se*K,k=L*se,H=G.x-(S-G.width)/2-k,D=G.y-(U-G.height)/2-k,O=S+k*2,E=U+k*2,$=`${e3}-${le}`,W=j.useRef(0);W.current=se,j.useEffect(()=>{if(R.current){const he=gn(R.current),xe=Ae=>{const{transform:Re,d3Selection:We,d3Zoom:Te}=T.getState();if(Ae.sourceEvent.type!=="wheel"||!We||!Te)return;const be=-Ae.sourceEvent.deltaY*(Ae.sourceEvent.deltaMode===1?.05:Ae.sourceEvent.deltaMode?1:.002)*Y,q=Re[2]*Math.pow(2,be);Te.scaleTo(We,q)},Se=Ae=>{const{transform:Re,d3Selection:We,d3Zoom:Te,translateExtent:be,width:q,height:V}=T.getState();if(Ae.sourceEvent.type!=="mousemove"||!We||!Te)return;const ue=W.current*Math.max(1,Re[2])*(A?-1:1),oe={x:Re[0]-Ae.sourceEvent.movementX*ue,y:Re[1]-Ae.sourceEvent.movementY*ue},P=[[0,0],[q,V]],Ee=ta.translate(oe.x,oe.y).scale(Re[2]),ge=Te.constrain()(Ee,P,be);Te.transform(We,ge)},ve=ug().on("zoom",C?Se:null).on("zoom.wheel",_?xe:null);return he.call(ve),()=>{he.on("zoom",null)}}},[C,_,A,Y]);const ae=v?he=>{const xe=Sn(he);v(he,{x:xe[0],y:xe[1]})}:void 0,ie=N?(he,xe)=>{const Se=T.getState().nodeInternals.get(xe);N(he,Se)}:void 0;return re.createElement(rf,{position:b,style:n,className:$t(["react-flow__minimap",r]),"data-testid":"rf__minimap"},re.createElement("svg",{width:I,height:K,viewBox:`${H} ${D} ${O} ${E}`,role:"img","aria-labelledby":$,ref:R,onClick:ae},M&&re.createElement("title",{id:$},M),re.createElement(JS,{onClick:ie,nodeColor:i,nodeStrokeColor:o,nodeBorderRadius:f,nodeClassName:u,nodeStrokeWidth:h,nodeComponent:g}),re.createElement("path",{className:"react-flow__minimap-mask",d:`M${H-k},${D-k}h${O+k*2}v${E+k*2}h${-O-k*2}z
|
|
386
|
-
M${X.x},${X.y}h${X.width}v${X.height}h${-X.width}z`,fill:p,fillRule:"evenodd",stroke:x,strokeWidth:m,pointerEvents:"none"})))}ry.displayName="MiniMap";var t3=j.memo(ry);function n3(){return re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},re.createElement("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"}))}function a3(){return re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},re.createElement("path",{d:"M0 0h32v4.2H0z"}))}function s3(){return re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},re.createElement("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 l3(){return re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},re.createElement("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 r3(){return re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},re.createElement("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"}))}const Mr=({children:n,className:r,...o})=>re.createElement("button",{type:"button",className:$t(["react-flow__controls-button",r]),...o},n);Mr.displayName="ControlButton";const o3=n=>({isInteractive:n.nodesDraggable||n.nodesConnectable||n.elementsSelectable,minZoomReached:n.transform[2]<=n.minZoom,maxZoomReached:n.transform[2]>=n.maxZoom}),oy=({style:n,showZoom:r=!0,showFitView:o=!0,showInteractive:i=!0,fitViewOptions:u,onZoomIn:f,onZoomOut:h,onFitView:g,onInteractiveChange:p,className:x,children:m,position:b="bottom-left"})=>{const v=Nt(),[N,C]=j.useState(!1),{isInteractive:_,minZoomReached:M,maxZoomReached:A}=tt(o3,Tt),{zoomIn:Y,zoomOut:L,fitView:T}=mf();if(j.useEffect(()=>{C(!0)},[]),!N)return null;const R=()=>{Y(),f?.()},G=()=>{L(),h?.()},X=()=>{T(u),g?.()},le=()=>{v.setState({nodesDraggable:!_,nodesConnectable:!_,elementsSelectable:!_}),p?.(!_)};return re.createElement(rf,{className:$t(["react-flow__controls",x]),position:b,style:n,"data-testid":"rf__controls"},r&&re.createElement(re.Fragment,null,re.createElement(Mr,{onClick:R,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:A},re.createElement(n3,null)),re.createElement(Mr,{onClick:G,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:M},re.createElement(a3,null))),o&&re.createElement(Mr,{className:"react-flow__controls-fitview",onClick:X,title:"fit view","aria-label":"fit view"},re.createElement(s3,null)),i&&re.createElement(Mr,{className:"react-flow__controls-interactive",onClick:le,title:"toggle interactivity","aria-label":"toggle interactivity"},_?re.createElement(r3,null):re.createElement(l3,null)),m)};oy.displayName="Controls";var iy=j.memo(oy),ln;(function(n){n.Lines="lines",n.Dots="dots",n.Cross="cross"})(ln||(ln={}));function i3({color:n,dimensions:r,lineWidth:o}){return re.createElement("path",{stroke:n,strokeWidth:o,d:`M${r[0]/2} 0 V${r[1]} M0 ${r[1]/2} H${r[0]}`})}function c3({color:n,radius:r}){return re.createElement("circle",{cx:r,cy:r,r,fill:n})}const u3={[ln.Dots]:"#91919a",[ln.Lines]:"#eee",[ln.Cross]:"#e2e2e2"},d3={[ln.Dots]:1,[ln.Lines]:1,[ln.Cross]:6},f3=n=>({transform:n.transform,patternId:`pattern-${n.rfId}`});function cy({id:n,variant:r=ln.Dots,gap:o=20,size:i,lineWidth:u=1,offset:f=2,color:h,style:g,className:p}){const x=j.useRef(null),{transform:m,patternId:b}=tt(f3,Tt),v=h||u3[r],N=i||d3[r],C=r===ln.Dots,_=r===ln.Cross,M=Array.isArray(o)?o:[o,o],A=[M[0]*m[2]||1,M[1]*m[2]||1],Y=N*m[2],L=_?[Y,Y]:A,T=C?[Y/f,Y/f]:[L[0]/f,L[1]/f];return re.createElement("svg",{className:$t(["react-flow__background",p]),style:{...g,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:x,"data-testid":"rf__background"},re.createElement("pattern",{id:b+n,x:m[0]%A[0],y:m[1]%A[1],width:A[0],height:A[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${T[0]},-${T[1]})`},C?re.createElement(c3,{color:v,radius:Y/f}):re.createElement(i3,{dimensions:L,color:v,lineWidth:u})),re.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${b+n})`}))}cy.displayName="Background";var uy=j.memo(cy);const u0={GET:{bg:"bg-emerald-500/10",text:"text-emerald-400",dot:"#34d399"},POST:{bg:"bg-blue-500/10",text:"text-blue-400",dot:"#60a5fa"},PUT:{bg:"bg-amber-500/10",text:"text-amber-400",dot:"#fbbf24"},PATCH:{bg:"bg-orange-500/10",text:"text-orange-400",dot:"#fb923c"},DELETE:{bg:"bg-red-500/10",text:"text-red-400",dot:"#f87171"},HEAD:{bg:"bg-[var(--bg-overlay-md)]",text:"text-[var(--text-muted)]",dot:"#a1a1aa"},OPTIONS:{bg:"bg-purple-500/10",text:"text-purple-400",dot:"#c084fc"}};function bf(n){return u0[n.toUpperCase()]??u0.GET}const d0=["exists","not_exists","is_empty","is_not_empty"];function f0(n,r){return n.replace(/\{\{([^}]+)\}\}/g,(o,i)=>{const u=i.trim();if(u.includes(":")){const f=u.indexOf(":"),h=u.slice(0,f),g=u.slice(f+1);return r[`${h}:${g}`]??r[g]??""}return r[u]??""})}function h3(n,r){const o=f0(n.left,r),i=n.right!==void 0?f0(n.right,r):void 0;switch(n.operator){case"equals":return o===i;case"not_equals":return o!==i;case"greater_than":return Number(o)>Number(i);case"greater_than_or_equal":return Number(o)>=Number(i);case"less_than":return Number(o)<Number(i);case"less_than_or_equal":return Number(o)<=Number(i);case"exists":return o!==""&&o!==void 0;case"not_exists":return o===""||o===void 0;case"is_empty":return o===""||o===null;case"is_not_empty":return o!==""&&o!==null;case"contains":return i!==void 0&&o.includes(i);case"not_contains":return i!==void 0&&!o.includes(i);case"starts_with":return i!==void 0&&o.startsWith(i);case"ends_with":return i!==void 0&&o.endsWith(i);default:return!1}}function x3(n,r){const{rules:o}=n,i=o.all??o.any??[],u=!!o.all;if(i.length===0)return{passed:!0,reason:"No rules"};const f=i.map(x=>({rule:x,ok:h3(x,r)})),h=u?f.every(x=>x.ok):f.some(x=>x.ok),g=f.filter(x=>!x.ok),p=h?`All conditions met (${u?"AND":"OR"})`:`Failed: ${g.map(x=>`${x.rule.left} ${x.rule.operator}${x.rule.right!==void 0?" "+x.rule.right:""}`).join(", ")}`;return{passed:h,reason:p}}async function p3(n,r){const o=n.replace(/^workflows\//,"").replace(/\.json$/,"");await fetch(`/api/workflows/${encodeURIComponent(o)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({steps:r})})}function m3({method:n}){const r=bf(n);return s.jsx("span",{className:`inline-flex items-center rounded px-1.5 py-0.5 text-[10px] font-medium tracking-widest ${r.bg} ${r.text}`,children:n.toUpperCase()})}async function g3(){const n=await fetch("/api/workflows");if(!n.ok)throw new Error(`HTTP ${n.status}`);return n.json()}async function y3(n){const r=n.replace(/^workflows\//,"").replace(/\.json$/,""),o=await fetch(`/api/workflows/${encodeURIComponent(r)}`,{method:"DELETE"});if(!o.ok){const i=await o.json().catch(()=>({}));throw new Error(i.error??`HTTP ${o.status}`)}}const h0=/\{\{\s*human:([^}]+?)\s*\}\}/g;function vf(n){const r=new Set;for(const o of[n.path,JSON.stringify(n.body??{}),JSON.stringify(n.inject??{}),JSON.stringify(n.condition??{})]){if(!o)continue;h0.lastIndex=0;let i;for(;(i=h0.exec(o))!==null;){const u=i[1].trim();u&&r.add(u)}}return[...r]}function b3(n){const r=new Set;return n.forEach(o=>vf(o).forEach(i=>r.add(i))),[...r]}function v3(n){return/pass|secret|token|pwd|private|credential/i.test(n)}function j3({title:n,subtitle:r,fields:o,values:i,onChange:u,onSubmit:f,onCancel:h,submitLabel:g,error:p,submitting:x}){return s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm p-4",children:s.jsxs("div",{className:"w-full max-w-sm rounded-xl border border-amber-500/25 bg-[var(--bg-overlay)] shadow-2xl",children:[s.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-[var(--border)]",children:[s.jsx("span",{className:"flex h-7 w-7 items-center justify-center rounded-full bg-amber-500/15 text-amber-400",children:s.jsx(zr,{className:"h-3.5 w-3.5",strokeWidth:2})}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-[12px] font-medium text-[var(--text-primary)]",children:n}),r&&s.jsx("p",{className:"text-[10px] text-[var(--text-faint)] truncate",children:r})]})]}),s.jsxs("div",{className:"space-y-2.5 p-4",children:[s.jsx("p",{className:"text-[11px] text-[var(--text-muted)]",children:"This workflow needs a value only you know. The run stays paused until you answer."}),o.map(m=>s.jsxs("div",{children:[s.jsx("label",{className:"mb-1 block font-mono text-[10px] text-amber-400/90",children:`{{human:${m.key}}}`}),s.jsx("input",{autoFocus:o.length===1,type:v3(m.key)?"password":"text",value:i[m.key]??"",onChange:b=>u(m.key,b.target.value),onKeyDown:b=>{b.key==="Enter"&&f()},placeholder:m.hint??`Enter ${m.key}…`,className:"h-8 w-full rounded-lg border border-amber-500/30 bg-[var(--bg-overlay-md)] px-2.5 text-[12px] text-[var(--text-primary)] placeholder-[var(--text-faint)] outline-none focus:border-amber-500/70 transition-colors"})]},m.key)),p&&s.jsx("p",{className:"text-[10px] text-red-400 leading-tight",children:p}),s.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[s.jsxs("button",{type:"button",onClick:f,disabled:!!x,className:"flex h-8 flex-1 items-center justify-center gap-1.5 rounded-lg bg-amber-500/20 border border-amber-500/40 px-3 text-[11px] font-medium text-amber-300 hover:bg-amber-500/30 transition-colors disabled:opacity-40 hover:cursor-pointer",children:[x?s.jsx(ot,{className:"h-3 w-3 animate-spin",strokeWidth:2}):s.jsx(xt,{className:"h-3 w-3",strokeWidth:2}),g]}),h&&s.jsxs("button",{type:"button",onClick:h,className:"flex h-8 items-center gap-1 rounded-lg border border-[var(--border)] px-3 text-[11px] text-[var(--text-muted)] hover:text-[var(--text-secondary)] transition-colors hover:cursor-pointer",children:[s.jsx(Ct,{className:"h-3 w-3",strokeWidth:2})," Cancel run"]})]})]})]})})}const dy=230,Wd=64;function N3({data:n}){const r=bf(n.method),o={idle:"border-[var(--border)]",running:"border-blue-500/60",passed:"border-emerald-500/40",failed:"border-red-500/40",skipped:"border-[var(--border)]"},i={idle:"",running:"shadow-[0_0_12px_rgba(96,165,250,0.28)]",passed:"shadow-[0_0_8px_rgba(52,211,153,0.15)]",failed:"shadow-[0_0_8px_rgba(248,113,113,0.15)]",skipped:""},u=n.status??"idle";return s.jsxs("div",{className:`rounded-lg border bg-[var(--bg-overlay)] flex items-center gap-2.5 px-3 overflow-hidden transition-all duration-300 ${o[u]} ${i[u]}`,style:{width:dy,height:Wd},children:[s.jsx(jt,{type:"target",position:me.Top,style:{background:"transparent",border:"none"}}),s.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-[3px] transition-colors duration-300",style:{background:u==="running"?"#60a5fa":u==="passed"?r.dot:u==="failed"?"#f87171":r.dot+"60"}}),s.jsxs("div",{className:"shrink-0 flex items-center justify-center",children:[u==="running"&&s.jsx(ot,{className:"h-3.5 w-3.5 text-blue-400 animate-spin",strokeWidth:2}),u==="passed"&&s.jsx(xt,{className:"h-3.5 w-3.5 text-emerald-400",strokeWidth:2}),u==="failed"&&s.jsx(Ht,{className:"h-3.5 w-3.5 text-red-400",strokeWidth:2}),u==="idle"&&s.jsx("span",{className:"flex h-3.5 w-3.5 items-center justify-center rounded-full border border-[var(--border)] text-[8px] font-medium text-[var(--text-faint)]",children:n.index+1}),u==="skipped"&&s.jsx("span",{className:"h-3.5 w-3.5 rounded-full border border-[var(--border)] bg-[var(--bg-overlay-md)]"})]}),s.jsxs("div",{className:"min-w-0 flex-1 pl-0.5",children:[s.jsxs("div",{className:"flex items-center gap-1.5 mb-0.5",children:[s.jsx("span",{className:`text-[9px] font-medium ${r.text}`,children:n.method}),s.jsx("span",{className:"font-mono text-[10px] text-[var(--text-secondary)] truncate",children:n.path}),n.result&&s.jsxs("span",{className:`ml-auto shrink-0 font-mono text-[9px] ${n.result.passed?"text-emerald-400":"text-red-400"}`,children:[n.result.status>0?n.result.status:"ERR"," · ",n.result.durationMs,"ms"]})]}),s.jsx("p",{className:"text-[9px] text-[var(--text-faint)] truncate",children:n.name})]}),s.jsx(jt,{type:"source",position:me.Bottom,style:{background:"transparent",border:"none"}})]})}function w3({data:n}){const r=n.passed,o=r===void 0?"rgba(96,165,250,0.5)":r?"rgba(52,211,153,0.7)":"rgba(248,113,113,0.7)";return s.jsxs("div",{style:{width:40,height:40,position:"relative",display:"flex",alignItems:"center",justifyContent:"center"},children:[s.jsx(jt,{type:"target",position:me.Top,style:{background:"transparent",border:"none"}}),s.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 40 40",children:[s.jsx("polygon",{points:"20,2 38,20 20,38 2,20",fill:"none",stroke:o,strokeWidth:"1.5"}),s.jsx("polygon",{points:"20,8 32,20 20,32 8,20",fill:o,fillOpacity:.12,stroke:"none"})]}),s.jsx("span",{style:{position:"absolute",fontSize:8,fontFamily:"monospace",color:o,top:"50%",left:"50%",transform:"translate(-50%,-50%)",whiteSpace:"nowrap"},children:"◇"}),s.jsx(jt,{type:"source",position:me.Bottom,style:{background:"transparent",border:"none"}})]})}const S3={step:N3,condition:w3};function E3({steps:n,runState:r}){const[o,i,u]=ay([]),[f,h,g]=sy([]);j.useEffect(()=>{const v=[],N=[];let C=40;for(let _=0;_<n.length;_++){const M=n[_],A=r.stepStatuses[_]??"idle",Y=r.stepResults[_]??null;if(v.push({id:`step-${_}`,type:"step",position:{x:0,y:C},data:{index:_,name:M.name,method:M.method,path:M.path,status:A,result:Y}}),C+=Wd+36,M.condition){const L=`cond-${_}`,T=Y?.conditionResult;v.push({id:L,type:"condition",position:{x:dy/2-20,y:C},data:{passed:T?.passed}});const R=A==="passed"?"rgba(52,211,153,0.3)":A==="failed"?"rgba(248,113,113,0.3)":"rgba(96,165,250,0.18)";if(N.push({id:`e-${_}-cond`,source:`step-${_}`,target:L,style:{stroke:R,strokeWidth:1.5},markerEnd:{type:qa.ArrowClosed,color:R},animated:A==="running"}),C+=64,_<n.length-1){const G=T?.passed===!0?"rgba(52,211,153,0.5)":"rgba(96,165,250,0.18)",X=T?.passed===!1?"rgba(248,113,113,0.5)":"rgba(96,165,250,0.1)";N.push({id:`e-${_}-cond-pass`,source:L,target:`step-${_+1}`,label:"PASS",labelStyle:{fill:"rgba(52,211,153,0.8)",fontSize:8,fontFamily:"monospace"},labelBgStyle:{fill:"transparent"},style:{stroke:G,strokeWidth:1.2},markerEnd:{type:qa.ArrowClosed,color:G}}),N.push({id:`e-${_}-cond-fail`,source:L,target:`step-${_+1}`,label:`FAIL→${M.condition.onFail.toUpperCase()}`,labelStyle:{fill:"rgba(248,113,113,0.8)",fontSize:8,fontFamily:"monospace"},labelBgStyle:{fill:"transparent"},style:{stroke:X,strokeWidth:1.2,strokeDasharray:"4 3"}})}}else if(_<n.length-1){const L=Object.keys(M.capture??{}),T=L.length>0?L.map(X=>X.split(":").pop()).join(", "):void 0,R=r.stepStatuses[_]??"idle",G=R==="passed"?"rgba(52,211,153,0.3)":R==="failed"?"rgba(248,113,113,0.3)":"rgba(96,165,250,0.18)";N.push({id:`e-${_}`,source:`step-${_}`,target:`step-${_+1}`,label:T,labelStyle:{fill:"rgba(96,165,250,0.7)",fontSize:9,fontFamily:"monospace"},labelBgStyle:{fill:"transparent"},style:{stroke:G,strokeWidth:1.5,strokeDasharray:R==="idle"||R==="running"?"5 5":void 0},markerEnd:{type:qa.ArrowClosed,color:R==="passed"?"rgba(52,211,153,0.4)":"rgba(96,165,250,0.3)"},animated:R==="running"})}}i(v),h(N)},[n,r.stepStatuses,r.stepResults]);const p=n.reduce((x,m)=>x+Wd+36+(m.condition?64:0),40);return s.jsx("div",{style:{height:Math.max(400,p)},className:"w-full rounded-lg overflow-hidden",children:s.jsxs(yf,{nodes:o,edges:f,onNodesChange:u,onEdgesChange:g,nodeTypes:S3,fitView:!0,fitViewOptions:{padding:.3},proOptions:{hideAttribution:!0},minZoom:.3,maxZoom:2,children:[s.jsx(uy,{variant:ln.Dots,gap:20,size:1,color:"var(--border)"}),s.jsx(iy,{showInteractive:!1,style:{background:"var(--bg-overlay)",border:"1px solid var(--border)"}})]})})}function k3({runState:n,steps:r,waitingStepIndex:o}){const i=j.useRef(null);return j.useEffect(()=>{i.current&&(i.current.scrollTop=i.current.scrollHeight)},[n.stepResults,n.phase]),n.phase==="idle"?null:s.jsxs("div",{className:"mt-3 rounded-lg border border-[var(--border)] bg-[var(--bg-overlay)]",children:[s.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-[var(--border)] bg-[var(--bg-overlay-md)]",children:[s.jsx("span",{className:"text-[10px] font-semibold text-[var(--text-muted)] uppercase tracking-wider",children:"Run Log"}),n.baseUrl&&s.jsxs("span",{className:"font-mono text-[10px] text-[var(--text-faint)]",children:["→ ",n.baseUrl]}),s.jsxs("span",{className:"ml-auto flex items-center gap-2 text-[10px]",children:[n.passed>0&&s.jsxs("span",{className:"text-emerald-400",children:[n.passed," passed"]}),n.failed>0&&s.jsxs("span",{className:"text-red-400",children:[n.failed," failed"]}),n.phase==="running"&&s.jsx(ot,{className:"h-3 w-3 text-blue-400 animate-spin",strokeWidth:2}),n.phase==="done"&&s.jsx(xt,{className:"h-3 w-3 text-emerald-400",strokeWidth:2}),n.phase==="aborted"&&s.jsx(Ht,{className:"h-3 w-3 text-red-400",strokeWidth:2})]})]}),s.jsxs("div",{ref:i,className:"overflow-y-auto max-h-80 font-mono text-[11px] p-3 space-y-1",children:[s.jsx("p",{className:"text-[var(--text-faint)]",children:"▶ Starting workflow execution…"}),n.humanUnsupported&&s.jsxs("p",{className:"text-red-400",children:["⚠ Connected server doesn't support ","{{human:*}}"," — restart `jetic dev` from the latest build. Human values will resolve empty and the dialog will never appear."]}),(n.humanKeys??[]).filter(u=>u.source==="prompt").map(u=>s.jsxs("p",{className:"text-amber-400",children:["◉ will ask for ",`{{human:${u.key}}}`," when reached"]},`need-${u.key}`)),(n.humanKeys??[]).filter(u=>u.source!=="prompt").map(u=>s.jsxs("p",{className:"text-[var(--text-faint)]",children:["↳ human ",`{{human:${u.key}}}`," ← ",fy[u.source]??u.source," (ready)"]},`have-${u.key}`)),(n.notes??[]).map((u,f)=>s.jsx("p",{className:"text-[var(--text-faint)]",children:u},`note-${f}`)),n.stepResults.map((u,f)=>{if(!u&&n.stepStatuses[f]!=="running")return null;const h=r[f],g=bf(h.method);return n.stepStatuses[f]==="running"?s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2 text-[var(--text-muted)]",children:[s.jsx(ot,{className:"h-3 w-3 animate-spin text-blue-400",strokeWidth:2}),s.jsxs("span",{className:"text-[var(--text-faint)]",children:["Step ",f+1,"/",r.length]}),s.jsx("span",{className:g.text,children:h.method}),s.jsx("span",{className:"text-[var(--text-secondary)]",children:h.path}),s.jsx("span",{className:"text-[var(--text-faint)]",children:"…"})]}),o===f&&s.jsx("p",{className:"pl-5 text-amber-400",children:"⏳ Waiting for your input — answer the dialog to resume the run."})]},f):u?s.jsxs("div",{className:"space-y-0.5",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:u.passed?"text-emerald-400":"text-red-400",children:u.passed?"✓":"✗"}),s.jsxs("span",{className:"text-[var(--text-faint)]",children:["Step ",f+1,"/",r.length]}),s.jsx("span",{className:`${g.text}`,children:h.method.padEnd(6)}),s.jsx("span",{className:"text-[var(--text-secondary)]",children:h.path}),s.jsx("span",{className:`${u.passed?"text-emerald-400":"text-red-400"}`,children:u.status>0?u.status:"NO RESPONSE"}),s.jsxs("span",{className:"text-[var(--text-faint)]",children:[u.durationMs,"ms"]})]}),h.name&&s.jsx("p",{className:"pl-5 text-[var(--text-faint)] italic",children:h.name}),Object.entries(u.injected??{}).filter(([x])=>x!=="Content-Type").map(([x,m])=>s.jsxs("p",{className:"pl-5 text-[var(--text-faint)]",children:["↳ ",s.jsxs("span",{className:"text-amber-500/80",children:[x,":"]})," ",s.jsx("span",{className:"text-[var(--text-faint)]",children:String(m).length>60?String(m).slice(0,57)+"…":m})]},x)),u.captured.map((x,m)=>s.jsxs("p",{className:"pl-5 text-emerald-400",children:["↳ captured ",x]},m)),u.conditionResult&&s.jsxs("p",{className:`pl-5 ${u.conditionResult.passed?"text-purple-400":"text-orange-400"}`,children:["◇ condition ",u.conditionResult.passed?"passed":"failed"," — ",u.conditionResult.reason,!u.conditionResult.passed&&h.condition&&s.jsxs("span",{className:"text-orange-300/70",children:[" → ",h.condition.onFail,h.condition.onFail==="switch"&&h.condition.switchToWorkflow?`: ${h.condition.switchToWorkflow}`:""]})]}),u.error&&s.jsxs("p",{className:"pl-5 text-red-400",children:["Error: ",u.error]}),!u.passed&&u.responseBody&&!u.error&&s.jsxs("p",{className:"pl-5 text-red-400/80 truncate",children:["Response: ",typeof u.responseBody=="string"?u.responseBody.slice(0,120):JSON.stringify(u.responseBody).slice(0,120)]})]},f):null}),n.phase==="done"&&s.jsxs("p",{className:`mt-1 ${n.failed===0?"text-emerald-400":"text-amber-400"}`,children:["✓ Done — ",n.passed,"/",n.passed+n.failed," steps passed"]}),n.phase==="aborted"&&s.jsxs("p",{className:"mt-1 text-red-400",children:["✗ Aborted — ",n.error]}),n.phase==="error"&&s.jsxs("p",{className:"mt-1 text-red-400",children:["✗ Error — ",n.error]})]})]})}const _3=[{label:"Equality",ops:[{value:"equals",label:"equals"},{value:"not_equals",label:"not equals"}]},{label:"Comparison",ops:[{value:"greater_than",label:"greater than"},{value:"greater_than_or_equal",label:"greater than or equal"},{value:"less_than",label:"less than"},{value:"less_than_or_equal",label:"less than or equal"}]},{label:"Existence",ops:[{value:"exists",label:"exists"},{value:"not_exists",label:"does not exist"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}]},{label:"Text / Collection",ops:[{value:"contains",label:"contains"},{value:"not_contains",label:"does not contain"},{value:"starts_with",label:"starts with"},{value:"ends_with",label:"ends with"}]}];function x0(){return{left:"",operator:"equals",right:""}}function C3({stepIndex:n,existingCondition:r,capturedKeys:o,onSave:i,onRemove:u,onCancel:f}){const[h,g]=j.useState(r?.rules.all?"all":r?.rules.any?"any":"all"),p=r?.rules.all??r?.rules.any??[],[x,m]=j.useState(p.length>0?p:[x0()]),[b,v]=j.useState(r?.onFail??"abort"),[N,C]=j.useState(r?.switchToWorkflow??""),[_,M]=j.useState(r?.returnOnComplete??!0),A=(X,le)=>{m(I=>I.map((K,ne)=>ne===X?{...K,...le}:K))},Y=()=>m(X=>[...X,x0()]),L=X=>m(le=>le.filter((I,K)=>K!==X)),T=()=>{const X=x.filter(I=>I.left.trim()!=="");if(X.length===0)return;const le={rules:h==="all"?{all:X}:{any:X},onFail:b,...b==="switch"&&N.trim()?{switchToWorkflow:N.trim(),returnOnComplete:_}:{}};i(le)},R="h-7 rounded-lg border border-[var(--border)] bg-[var(--bg-overlay-md)] px-2 text-[11px] text-[var(--text-primary)] placeholder-[var(--text-faint)] outline-none focus:border-purple-500/60 transition-colors",G=`${R} cursor-pointer`;return s.jsxs("div",{className:"mt-2 rounded-lg border border-purple-500/20 bg-purple-500/[0.04] p-3 space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ea,{className:"h-3 w-3 text-purple-400",strokeWidth:2}),s.jsx("span",{className:"text-[10px] font-semibold text-purple-400 uppercase tracking-wider",children:"Step Condition"}),s.jsx("span",{className:"text-[10px] text-[var(--text-faint)] ml-1",children:"— evaluated after this step runs"}),s.jsx("div",{className:"ml-auto flex items-center gap-1",children:["all","any"].map(X=>s.jsx("button",{type:"button",onClick:()=>g(X),className:`px-2 py-0.5 rounded text-[9px] font-semibold transition-colors hover:cursor-pointer ${h===X?"bg-purple-500/20 text-purple-400 border border-purple-500/40":"bg-[var(--bg-overlay-md)] text-[var(--text-faint)] border border-[var(--border)] hover:text-[var(--text-muted)]"}`,children:X==="all"?"AND":"OR"},X))})]}),s.jsxs("div",{className:"space-y-2",children:[x.map((X,le)=>s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("input",{list:`cond-left-${n}-${le}`,value:X.left,onChange:I=>A(le,{left:I.target.value}),placeholder:"{{workflow:key}} or value",className:`flex-1 min-w-0 ${R}`}),s.jsx("datalist",{id:`cond-left-${n}-${le}`,children:o.map(I=>s.jsx("option",{value:`{{${I}}}`},I))}),s.jsx("select",{value:X.operator,onChange:I=>A(le,{operator:I.target.value,right:d0.includes(I.target.value)?void 0:X.right}),className:`w-44 shrink-0 ${G}`,children:_3.map(I=>s.jsx("optgroup",{label:I.label,children:I.ops.map(K=>s.jsx("option",{value:K.value,children:K.label},K.value))},I.label))}),d0.includes(X.operator)?s.jsx("div",{className:"flex-1"}):s.jsx("input",{value:X.right??"",onChange:I=>A(le,{right:I.target.value}),placeholder:"value or {{workflow:key}}",className:`flex-1 min-w-0 ${R}`}),x.length>1&&s.jsx("button",{type:"button",onClick:()=>L(le),className:"shrink-0 text-[var(--text-faint)] hover:text-red-400 transition-colors hover:cursor-pointer",children:s.jsx(Ct,{className:"h-3 w-3",strokeWidth:2})})]},le)),s.jsxs("button",{type:"button",onClick:Y,className:"flex items-center gap-1 text-[10px] text-purple-400/70 hover:text-purple-400 transition-colors hover:cursor-pointer",children:[s.jsx(_t,{className:"h-3 w-3",strokeWidth:2})," Add rule"]})]}),s.jsxs("div",{className:"flex flex-col gap-2 pt-1 border-t border-purple-500/10",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-[10px] text-[var(--text-faint)] shrink-0",children:"If condition fails →"}),["abort","continue","switch"].map(X=>s.jsx("button",{type:"button",onClick:()=>v(X),className:`px-2 py-0.5 rounded text-[9px] font-medium capitalize transition-colors border hover:cursor-pointer ${b===X?X==="abort"?"bg-red-500/20 text-red-400 border-red-500/40":X==="continue"?"bg-emerald-500/20 text-emerald-400 border-emerald-500/40":"bg-blue-500/20 text-blue-400 border-blue-500/40":"bg-[var(--bg-overlay-md)] text-[var(--text-faint)] border-[var(--border)] hover:text-[var(--text-muted)]"}`,children:X},X)),b==="switch"&&s.jsx("input",{value:N,onChange:X=>C(X.target.value),placeholder:"workflow-slug",className:`flex-1 ${R}`})]}),b==="switch"&&s.jsxs("label",{className:"flex items-center gap-1.5 text-[10px] text-[var(--text-muted)] cursor-pointer select-none ml-1",children:[s.jsx("input",{type:"checkbox",checked:_,onChange:X=>M(X.target.checked),className:"rounded border-[var(--border)] bg-[var(--bg-overlay-md)] text-purple-500 focus:ring-0"}),s.jsxs("span",{children:["Return to main workflow after completing ",s.jsx("code",{className:"text-purple-400",children:N||"sub-workflow"})]})]})]}),s.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[s.jsxs("button",{type:"button",onClick:T,disabled:x.every(X=>!X.left.trim()),className:"flex items-center gap-1 rounded-lg bg-purple-500/20 border border-purple-500/40 px-3 py-1 text-[10px] text-purple-400 hover:bg-purple-500/30 transition-colors disabled:opacity-40 hover:cursor-pointer",children:[s.jsx(xt,{className:"h-3 w-3",strokeWidth:2})," Save Condition"]}),r&&s.jsxs("button",{type:"button",onClick:u,className:"flex items-center gap-1 rounded-lg border border-red-500/20 bg-red-500/[0.06] px-3 py-1 text-[10px] text-red-400/80 hover:bg-red-500/15 transition-colors hover:cursor-pointer",children:[s.jsx(Yt,{className:"h-3 w-3",strokeWidth:2})," Remove"]}),s.jsxs("button",{type:"button",onClick:f,className:"ml-auto flex items-center gap-1 rounded-lg border border-[var(--border)] px-3 py-1 text-[10px] text-[var(--text-muted)] hover:text-[var(--text-secondary)] transition-colors hover:cursor-pointer",children:[s.jsx(Ct,{className:"h-3 w-3",strokeWidth:2})," Cancel"]})]})]})}function T3({step:n,index:r,total:o,status:i,result:u,allSteps:f,onConditionChange:h,waitingHuman:g}){const[p,x]=j.useState(!1),[m,b]=j.useState(!1),v=n.capture&&Object.keys(n.capture).length>0,N=n.inject&&Object.keys(n.inject).length>0,C=n.body&&Object.keys(n.body).length>0,_=!!n.condition,M=vf(n),A=[];for(let T=0;T<=r;T++){const R=f[T];Object.keys(R.capture??{}).forEach(G=>A.push(G)),Object.keys(R.captureInput??{}).forEach(G=>A.push(G))}const Y=g?s.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-amber-500/15 text-amber-400",title:"Waiting for your input — answer the dialog to resume",children:s.jsx(zr,{className:"h-3 w-3 animate-pulse",strokeWidth:2})}):{idle:s.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded-full border border-[var(--border)] text-[9px] text-[var(--text-faint)]",children:r+1}),running:s.jsx(ot,{className:"h-5 w-5 text-blue-400 animate-spin",strokeWidth:2}),passed:s.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-emerald-500/10 text-emerald-400",children:s.jsx(xt,{className:"h-3 w-3",strokeWidth:2})}),failed:s.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-red-500/10 text-red-400",children:s.jsx(Ht,{className:"h-3 w-3",strokeWidth:2})}),skipped:s.jsx("span",{className:"h-5 w-5 rounded-full border border-[var(--border)] bg-[var(--bg-overlay-md)]"})}[i],L=_&&n.condition?(()=>{const T=n.condition.rules.all??n.condition.rules.any??[],R=n.condition.rules.all?"AND":"OR";return`${T.length} rule${T.length!==1?"s":""} ${R} → ${n.condition.onFail}`})():null;return s.jsxs("div",{className:"relative",children:[r<o-1&&s.jsx("div",{className:`absolute left-[19px] top-[38px] bottom-0 w-px z-0 transition-colors duration-500 ${i==="passed"?"bg-emerald-500/20":"bg-[var(--border)]"}`}),s.jsxs("div",{className:"relative z-10",children:[s.jsxs("button",{type:"button",onClick:()=>x(T=>!T),className:"flex w-full items-center gap-3 px-4 py-2.5 hover:bg-[var(--bg-overlay-md)] transition-colors text-left hover:cursor-pointer",children:[s.jsx("span",{className:"shrink-0",children:Y}),s.jsx(m3,{method:n.method}),s.jsx("span",{className:"font-mono text-xs text-[var(--text-secondary)] flex-1 truncate",children:n.path}),u&&s.jsxs("span",{className:`font-mono text-[10px] ${u.passed?"text-emerald-400":"text-red-400"}`,children:[u.status>0?u.status:"ERR"," · ",u.durationMs,"ms"]}),s.jsxs("span",{className:"flex items-center gap-1",children:[N&&s.jsx("span",{className:"rounded bg-amber-500/10 px-1 py-0.5 text-[9px] text-amber-400",children:"auth"}),v&&s.jsx("span",{className:"rounded bg-blue-500/10 px-1 py-0.5 text-[9px] text-blue-400",children:"capture"}),M.length>0&&s.jsxs("span",{title:`Needs human input at runtime: ${M.map(T=>`{{human:${T}}}`).join(", ")}`,className:"rounded bg-orange-500/10 px-1 py-0.5 text-[9px] text-orange-400 flex items-center gap-0.5",children:[s.jsx(zr,{className:"h-2.5 w-2.5",strokeWidth:2})," human"]}),_&&s.jsxs("span",{className:"rounded bg-purple-500/10 px-1 py-0.5 text-[9px] text-purple-400 flex items-center gap-0.5",children:[s.jsx(ea,{className:"h-2.5 w-2.5",strokeWidth:2})," condition"]}),u?.conditionResult&&s.jsxs("span",{className:`rounded px-1 py-0.5 text-[9px] ${u.conditionResult.passed?"bg-purple-500/10 text-purple-400":"bg-orange-500/10 text-orange-400"}`,children:["◇ ",u.conditionResult.passed?"passed":"failed"]})]}),s.jsx("span",{className:"text-[var(--text-faint)] shrink-0",children:p?s.jsx(La,{className:"h-3.5 w-3.5"}):s.jsx(bl,{className:"h-3.5 w-3.5"})})]}),p&&s.jsxs("div",{className:"ml-12 mr-4 my-3 space-y-2.5 rounded-lg border-y border-[var(--border)] bg-[var(--bg-overlay)] p-3",children:[n.description&&s.jsx("p",{className:"text-[11px] text-[var(--text-muted)]",children:n.description}),u&&s.jsxs("div",{className:`rounded-lg border px-3 py-2 ${u.passed?"border-emerald-500/15 bg-emerald-500/[0.05]":"border-red-500/15 bg-red-500/[0.05]"}`,children:[s.jsx("p",{className:"text-[10px] text-[var(--text-faint)] mb-1 uppercase tracking-wider",children:"Response"}),u.error?s.jsx("p",{className:"text-[11px] text-red-400",children:u.error}):s.jsx("pre",{className:"text-[10px] text-[var(--text-muted)] overflow-auto max-h-24 whitespace-pre-wrap break-all",children:typeof u.responseBody=="string"?u.responseBody.slice(0,300):JSON.stringify(u.responseBody,null,2).slice(0,300)})]}),C&&s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] text-[var(--text-faint)] mb-1 uppercase tracking-wider",children:"Request Body"}),s.jsx("div",{className:"space-y-1",children:Object.entries(n.body).map(([T,R])=>s.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-[var(--border)] bg-[var(--bg-overlay-md)] px-3 py-1.5",children:[s.jsx("span",{className:"font-mono text-[10px] text-[var(--text-secondary)]",children:T}),s.jsx("span",{className:"font-mono text-[10px] text-blue-400/80 truncate",children:String(R)})]},T))})]}),N&&s.jsxs("div",{children:[s.jsxs("p",{className:"text-[10px] text-[var(--text-faint)] mb-1 uppercase tracking-wider flex items-center gap-1",children:[s.jsx(T0,{className:"h-3 w-3",strokeWidth:2})," Inject"]}),s.jsx("div",{className:"space-y-1",children:Object.entries(n.inject).map(([T,R])=>s.jsxs("div",{className:"flex items-center gap-2 rounded-lg bg-amber-500/[0.05] border border-amber-500/15 px-3 py-1.5",children:[s.jsx("span",{className:"font-mono text-[10px] text-amber-400/80",children:T}),s.jsx(dl,{className:"h-3 w-3 text-[var(--text-faint)] shrink-0",strokeWidth:2}),s.jsx("span",{className:"font-mono text-[10px] text-[var(--text-muted)]",children:R})]},T))})]}),v&&s.jsxs("div",{children:[s.jsxs("p",{className:"text-[10px] text-[var(--text-faint)] mb-1 uppercase tracking-wider flex items-center gap-1",children:[s.jsx(aa,{className:"h-3 w-3",strokeWidth:2})," Capture"]}),s.jsx("div",{className:"space-y-1",children:Object.entries(n.capture).map(([T,R])=>s.jsxs("div",{className:"flex items-center gap-2 rounded-lg bg-blue-500/[0.05] border border-blue-500/15 px-3 py-1.5",children:[s.jsx("span",{className:"font-mono text-[10px] text-blue-400",children:T}),s.jsx(dl,{className:"h-3 w-3 text-[var(--text-faint)] shrink-0",strokeWidth:2}),s.jsx("span",{className:"font-mono text-[10px] text-[var(--text-muted)]",children:R})]},T))})]}),s.jsxs("div",{className:"pt-1",children:[_&&L&&!m&&s.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-purple-500/20 bg-purple-500/[0.04] px-3 py-2 mb-2",children:[s.jsx(ea,{className:"h-3 w-3 text-purple-400 shrink-0",strokeWidth:2}),s.jsx("span",{className:"text-[10px] text-purple-400 flex-1",children:L}),u?.conditionResult&&s.jsx("span",{className:`text-[9px] font-medium ${u.conditionResult.passed?"text-purple-400":"text-orange-400"}`,children:u.conditionResult.passed?"✓ passed":"✗ failed"}),s.jsx("button",{type:"button",onClick:()=>b(!0),className:"shrink-0 text-[var(--text-faint)] hover:text-purple-400 transition-colors hover:cursor-pointer",children:s.jsx(z1,{className:"h-3 w-3",strokeWidth:2})})]}),m?s.jsx(C3,{stepIndex:r,existingCondition:n.condition,capturedKeys:A,onSave:T=>{h(r,T),b(!1)},onRemove:()=>{h(r,void 0),b(!1)},onCancel:()=>b(!1)}):!_&&s.jsxs("button",{type:"button",onClick:()=>b(!0),className:"flex items-center gap-1.5 text-[10px] text-[var(--text-faint)] hover:text-purple-400 transition-colors hover:cursor-pointer",children:[s.jsx(_t,{className:"h-3 w-3",strokeWidth:2}),s.jsx(ea,{className:"h-3 w-3",strokeWidth:2}),"Add Condition"]})]})]})]})]})}function Ed(n){return{phase:"idle",currentStep:-1,stepStatuses:Array(n).fill("idle"),stepResults:Array(n).fill(null),passed:0,failed:0,humanKeys:[],notes:[]}}const fy={run:"pre-seeded for this run",env:"environment variable",memory:"saved human memory",prompt:"your answer"};function M3({workflow:n,onDelete:r,onViewTraces:o}){const[i,u]=j.useState(n),[f,h]=j.useState("list"),[g,p]=j.useState(!1),[x,m]=j.useState(!1),[b,v]=j.useState(!1),[N,C]=j.useState(()=>Ed(i.steps.length)),[_,M]=j.useState(void 0),[A,Y]=j.useState([]),[L,T]=j.useState(null),[R,G]=j.useState(""),X=j.useRef(!1),le=j.useRef(null),I=j.useRef(""),K=j.useRef("local-sim"),ne=j.useRef({}),ee=j.useRef(new Set),se=j.useRef(null),[S,U]=j.useState(null),[k,H]=j.useState(""),[D,O]=j.useState(null),[E,$]=j.useState(!1),W=j.useRef(null),ae=async(q,V)=>{const ue=i.steps.map((P,Ee)=>{if(Ee!==q)return P;if(V===void 0){const{condition:ge,...ke}=P;return ke}return{...P,condition:V}}),oe={...i,steps:ue};u(oe);try{await p3(i._file,ue)}catch{}};j.useEffect(()=>{fetch("/api/model/environments").then(q=>q.ok?q.json():null).then(q=>{if(!q)return;const V=q.environments??[];Y(V);const ue=q.defaultEnvironment??V.find(P=>P.default)?.name??V[0]?.name??null;T(ue);const oe=V.find(P=>P.name===ue);oe&&G(oe.baseUrl)}).catch(()=>{})},[]);const ie=async()=>{if(confirm(`Delete workflow "${i.name}"? This cannot be undone.`)){v(!0);try{await y3(i._file),r()}catch(q){alert(`Failed to delete: ${q.message}`),v(!1)}}},he=()=>{if(X.current=!0,le.current?.close(),le.current=null,W.current){const q=W.current;W.current=null,U(null),q(null)}else S&&ve();C(q=>({...q,phase:q.phase==="running"?"aborted":q.phase}))},xe=async(q,V)=>{if(!se.current)throw new Error("Run id lost — please re-run the workflow.");const ue=await fetch("/api/workflows/human-input",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runId:se.current,key:q,value:V})}),oe=await ue.json().catch(()=>({}));if(!ue.ok)throw new Error(oe.error??`HTTP ${ue.status}`)},Se=async()=>{if(S){if(W.current){const q=W.current;W.current=null,U(null),H(""),q(k);return}$(!0),O(null);try{await xe(S.key,k),U(null),H("")}catch(q){O(q.message)}finally{$(!1)}}},ve=async()=>{if(S){if(W.current){const q=W.current;W.current=null,U(null),H(""),O(null),q(null);return}try{await xe(S.key,null)}catch{}U(null),H(""),O(null)}},Ae=()=>{he(),C(Ed(i.steps.length))},Re=async(q,V,ue)=>{const oe=new Date().toISOString(),P={id:crypto.randomUUID(),workflowName:i.name,workflowFile:i._file,startedAt:ue,finishedAt:oe,durationMs:q.stepResults.reduce((ge,ke)=>ge+(ke?.durationMs??0),0),phase:q.phase==="done"?"done":q.phase==="aborted"?"aborted":"error",passed:q.passed,failed:q.failed,baseUrl:q.baseUrl,source:V,steps:i.steps.map((ge,ke)=>{const Oe=q.stepResults[ke];return{index:ke,name:ge.name,method:ge.method,path:ge.path,description:ge.description,status:Oe?.status??0,passed:Oe?.passed??!1,durationMs:Oe?.durationMs??0,captured:Object.fromEntries((Oe?.captured??[]).map(ze=>[ze,"(captured)"])),injected:Oe?.injected??{},requestBody:ge.body,responseBody:Oe?.responseBody,error:Oe?.error??null,expectStatus:ge.expectStatus,captureSpec:ge.capture,injectSpec:ge.inject,conditionSpec:ge.condition,conditionResult:Oe?.conditionResult}})},Ee=await h2(P);M(Ee)},We=q=>{X.current=!1,se.current=null,ee.current=new Set,W.current=null,U(null),H(""),O(null);const V=i.steps.length;C({...Ed(V),baseUrl:R||void 0}),M(void 0),I.current=new Date().toISOString(),K.current="local-sim",p(!0);const ue=(P,Ee,ge)=>new Promise(ke=>{H(""),O(null),U({key:P,stepIndex:Ee,stepName:ge}),W.current=ke}),oe=async()=>{C(Oe=>({...Oe,phase:"running",baseUrl:R||Oe.baseUrl})),ne.current={};let P=0,Ee=0,ge=!1,ke="";for(let Oe=0;Oe<V&&!(X.current||ge);Oe++){const ze=i.steps[Oe],Mt=vf(ze);for(const pe of Mt){if(X.current)break;if(ne.current[`human:${pe}`]!==void 0)continue;C(je=>{const Le=[...je.stepStatuses];return Le[Oe]="running",{...je,stepStatuses:Le,currentStep:Oe}});const Ve=await ue(pe,Oe,ze.name);if(Ve===null||X.current){C(je=>({...je,phase:"aborted",error:"Run cancelled by user"}));return}ne.current[`human:${pe}`]=Ve,C(je=>({...je,notes:[...je.notes??[],`↳ human {{human:${pe}}} ← your answer`]}))}if(X.current)break;C(pe=>{const Ve=[...pe.stepStatuses];return Ve[Oe]="running",{...pe,stepStatuses:Ve,currentStep:Oe}});const At=600+Math.random()*800;if(await new Promise(pe=>{const Ve=setTimeout(pe,At),je=setInterval(()=>{X.current&&(clearTimeout(Ve),clearInterval(je),pe())},50);setTimeout(()=>clearInterval(je),At+100)}),X.current)break;Object.keys(ze.capture??{}).forEach(pe=>{ne.current[pe]="[simulated]"}),Object.keys(ze.captureInput??{}).forEach(pe=>{ne.current[pe]="[simulated]"});let dt;if(ze.condition&&(dt=x3(ze.condition,ne.current),!dt.passed)){const{onFail:pe,returnOnComplete:Ve}=ze.condition;pe==="abort"?(ge=!0,ke=`Condition failed at step ${Oe+1}: ${dt.reason}`):pe==="continue"?(ge=!0,ke="Condition failed → continuing without remaining steps"):pe==="switch"&&(Ve||(ge=!0,ke=`Condition failed → switched to: ${ze.condition.switchToWorkflow??"unknown"}`))}const nt=!0,pt=Math.round(At),at={index:Oe,step:{name:ze.name,method:ze.method,path:ze.path,description:ze.description},status:200,passed:nt,durationMs:pt,captured:Object.keys(ze.capture??{}).map(pe=>pe.split(":").pop()??pe),injected:{},responseBody:{simulated:!0},error:null,conditionResult:dt};if(P++,C(pe=>{const Ve=[...pe.stepStatuses],je=[...pe.stepResults];return Ve[Oe]="passed",je[Oe]=at,{...pe,stepStatuses:Ve,stepResults:je,passed:P,failed:Ee}}),ge)break}if(!X.current)if(ge){const Oe={phase:"aborted",stepStatuses:N.stepStatuses,stepResults:N.stepResults,passed:P,failed:Ee,baseUrl:R||void 0};C(ze=>({...ze,phase:"aborted",error:ke})),Re(Oe,"local-sim",I.current)}else{const Oe={phase:"done",stepStatuses:Array(V).fill("passed"),stepResults:i.steps.map((ze,Mt)=>({index:Mt,step:{name:ze.name,method:ze.method,path:ze.path,description:ze.description},status:200,passed:!0,durationMs:Math.round(600+Math.random()*800),captured:Object.keys(ze.capture??{}).map(At=>At.split(":").pop()??At),injected:{},responseBody:{simulated:!0},error:null})),passed:P,failed:Ee};C(ze=>({...ze,phase:"done",passed:P,failed:Ee})),Re(Oe,"local-sim",I.current)}};fetch("/api/workflows/run",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file:i._file,baseUrl:R||void 0,humanInputs:q})}).then(P=>{if(!P.ok||!P.body){oe();return}K.current="api";const Ee=P.body.getReader(),ge=new TextDecoder;let ke="";C(ze=>({...ze,phase:"running"})),(async()=>{let ze=!1;for(;!X.current;){const{value:Mt,done:At}=await Ee.read();if(At)break;ze=!0,ke+=ge.decode(Mt,{stream:!0});const dt=ke.split(`
|
|
387
|
-
`);ke=dt.pop()??"";for(const nt of dt){const pt=nt.trim();if(!pt.startsWith("data:"))continue;const at=pt.slice(5).trim();if(!at)continue;let pe;try{pe=JSON.parse(at)}catch{continue}if(pe.type==="human_input_required"){H(""),O(null),U({key:String(pe.key??""),stepIndex:Number(pe.stepIndex??-1),stepName:String(pe.stepName??"")});continue}C(Ve=>{const je={...Ve};if(pe.type==="start")je.phase="running",je.baseUrl=pe.baseUrl,je.humanKeys=Array.isArray(pe.humanKeys)?pe.humanKeys:[],je.notes=[],je.humanUnsupported=!Array.isArray(pe.humanKeys)&&b3(i.steps).length>0,typeof pe.runId=="string"&&(se.current=pe.runId);else if(pe.type==="human_resolved"){const Le=`${pe.index}:${pe.key}`;if(!ee.current.has(Le)){ee.current.add(Le);const Ge=fy[String(pe.source)]??String(pe.source??"run");je.notes=[...je.notes??[],`↳ human {{human:${pe.key}}} ← ${Ge}`]}}else if(pe.type==="step_start"){const Le=pe.index,Ge=[...je.stepStatuses];Ge[Le]="running",je.stepStatuses=Ge,je.currentStep=Le}else if(pe.type==="step_result"){const Le=pe.index,Ge=[...je.stepStatuses],Rt=[...je.stepResults];Ge[Le]=pe.passed?"passed":"failed",Rt[Le]={index:pe.index,step:pe.step??{name:"",method:"",path:""},status:pe.status,passed:pe.passed,durationMs:pe.durationMs,captured:pe.captured??[],injected:pe.injected??{},responseBody:pe.responseBody,error:pe.error??null},pe.passed?je.passed=(je.passed??0)+1:je.failed=(je.failed??0)+1,je.stepStatuses=Ge,je.stepResults=Rt}else if(pe.type==="condition_result"){const Le=pe.index,Ge=[...je.stepResults];Ge[Le]&&(Ge[Le]={...Ge[Le],conditionResult:{passed:pe.passed,reason:pe.reason}},je.stepResults=Ge)}else if(pe.type==="aborted"){const Le=[...je.stepStatuses];for(let Ge=0;Ge<Le.length;Ge++)Le[Ge]==="running"?Le[Ge]="failed":Le[Ge]==="idle"&&(Le[Ge]="skipped");je.stepStatuses=Le,je.phase="aborted",je.error=pe.reason,Re(je,"api",I.current)}else pe.type==="done"&&(je.phase="done",(pe.passed>0||pe.failed>0)&&(je.passed=pe.passed,je.failed=pe.failed),pe.conditionBranch==="continue"?je.error="Condition failed → remaining steps skipped":pe.conditionBranch==="switch"&&(je.error=`Condition failed → switched to: ${pe.switchToWorkflow??"unknown"}`),Re(je,"api",I.current));return je})}}!ze&&!X.current&&oe()})().catch(()=>{X.current||oe()})}).catch(()=>{X.current||oe()})},Te=N.phase==="running",be=N.phase!=="idle";return s.jsxs("div",{className:"relative",children:[s.jsxs("button",{type:"button",onClick:()=>We(),className:"absolute -top-2 -right-2 flex items-center gap-1 rounded-full bg-blue-500 px-2 py-0.5 text-[10px] font-medium text-white shadow-sm z-10 hover:bg-blue-400 transition-colors hover:cursor-pointer",children:[s.jsx(_d,{size:10})," Run Workflow"]}),s.jsxs("div",{className:"rounded-lg border border-[var(--border)] bg-[var(--bg-overlay)] overflow-hidden",children:[s.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-3 border-b border-[var(--border)]",children:[s.jsx("button",{type:"button",onClick:()=>m(q=>!q),className:"text-blue-400/70 hover:text-blue-400 transition-colors shrink-0 hover:cursor-pointer",children:x?s.jsx(bl,{className:"h-3.5 w-3.5"}):s.jsx(La,{className:"h-3.5 w-3.5"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-[var(--text-primary)] truncate",children:i.name}),i.generatedAt&&s.jsxs("p",{className:"flex items-center gap-1 text-[10px] text-[var(--text-faint)] mt-0.5",children:[s.jsx(Gr,{className:"h-2.5 w-2.5",strokeWidth:2}),new Date(i.generatedAt).toLocaleString()]})]}),s.jsxs("span",{className:"rounded-full border border-[var(--border)] bg-[var(--bg-overlay-md)] px-2 py-0.5 text-[10px] text-[var(--text-muted)] shrink-0",children:[i.steps.length," steps"]}),be&&s.jsxs("span",{className:`flex items-center gap-1 rounded-full px-2 py-0.5 text-[10px] shrink-0 ${N.phase==="done"&&N.failed===0?"bg-emerald-500/10 text-emerald-400":N.phase==="running"?"bg-blue-500/10 text-blue-400":"bg-red-500/10 text-red-400"}`,children:[N.phase==="running"&&s.jsx(ot,{className:"h-2.5 w-2.5 animate-spin",strokeWidth:2}),N.phase==="done"&&N.failed===0&&s.jsx(xt,{className:"h-2.5 w-2.5",strokeWidth:2}),(N.phase==="done"||N.phase==="aborted")&&N.failed>0&&s.jsx(Ht,{className:"h-2.5 w-2.5",strokeWidth:2}),N.phase==="running"?"Running…":N.phase==="done"?`${N.passed}/${N.passed+N.failed}`:N.phase==="aborted"?"Aborted":"Error"]}),N.humanUnsupported&&s.jsxs("span",{title:"The connected jetic dev server predates human-input support. Restart it from the latest build — human values will otherwise resolve empty and no dialog appears.",className:"flex items-center gap-1 rounded-full px-2 py-0.5 text-[10px] shrink-0 bg-red-500/10 text-red-400",children:[s.jsx(Ht,{className:"h-2.5 w-2.5",strokeWidth:2}),"Old server — no human dialog"]}),!x&&s.jsx("div",{className:"flex items-center gap-0.5 rounded-lg border border-[var(--border)] bg-[var(--bg-overlay-md)] p-0.5 shrink-0",children:["list","graph"].map(q=>s.jsxs("button",{type:"button",onClick:()=>h(q),className:`flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium transition-colors hover:cursor-pointer ${f===q?"bg-blue-500/20 text-blue-400":"text-[var(--text-faint)] hover:text-[var(--text-muted)]"}`,children:[q==="list"?s.jsx(R0,{className:"h-3 w-3",strokeWidth:2}):s.jsx(Id,{className:"h-3 w-3",strokeWidth:2}),q.charAt(0).toUpperCase()+q.slice(1)]},q))}),be&&!x&&s.jsxs("button",{type:"button",onClick:()=>p(q=>!q),className:`flex items-center gap-1 rounded-lg px-2.5 py-1 text-[10px] transition-colors border border-[var(--border)] hover:cursor-pointer ${g?"bg-[var(--bg-overlay-md)] text-[var(--text-secondary)]":"text-[var(--text-faint)] hover:text-[var(--text-secondary)] bg-[var(--bg-overlay)]"}`,children:[s.jsx(k1,{className:"h-3 w-3",strokeWidth:2})," Log"]}),Te&&s.jsxs("button",{type:"button",onClick:he,className:"flex items-center gap-1 rounded-lg border border-red-500/30 bg-red-500/10 px-2.5 py-1 text-[10px] text-red-400 hover:bg-red-500/20 transition-colors shrink-0 hover:cursor-pointer",children:[s.jsx(K1,{className:"h-3 w-3",strokeWidth:2})," Stop"]}),be&&!Te&&s.jsxs("button",{type:"button",onClick:Ae,className:"flex items-center gap-1 rounded-lg border border-[var(--border)] bg-[var(--bg-overlay)] px-2.5 py-1 text-[10px] text-[var(--text-muted)] hover:text-[var(--text-secondary)] transition-colors shrink-0 hover:cursor-pointer",children:[s.jsx(U1,{className:"h-3 w-3",strokeWidth:2})," Reset"]}),be&&!Te&&o&&s.jsxs("button",{type:"button",onClick:()=>o(i.name,_),className:"flex items-center gap-1 rounded-lg border border-blue-500/30 bg-blue-500/10 px-2.5 py-1 text-[10px] text-blue-400 hover:bg-blue-500/20 transition-colors shrink-0 hover:cursor-pointer",children:[s.jsx(Vr,{className:"h-3 w-3",strokeWidth:2}),_?"View Trace":"Traces"]}),!Te&&s.jsxs("button",{type:"button",onClick:()=>We(),className:"hidden items-center gap-1.5 rounded-lg bg-blue-500 px-3 py-1.5 text-[10px] font-medium text-white hover:bg-blue-400 transition-colors shrink-0 hover:cursor-pointer",children:[s.jsx(_d,{className:"h-3 w-3",strokeWidth:2}),be?"Re-run":"Run"]}),!i._legacy&&!Te&&s.jsx("button",{type:"button",onClick:ie,disabled:b,title:"Delete workflow",className:"flex items-center gap-1 rounded-lg border border-red-500/20 bg-red-500/[0.06] px-2 py-1 text-[10px] text-red-400/80 hover:bg-red-500/20 hover:text-red-400 transition-colors shrink-0 disabled:opacity-40 hover:cursor-pointer",children:b?s.jsx(ot,{className:"h-3 w-3 animate-spin",strokeWidth:2}):s.jsx(Yt,{className:"h-3 w-3",strokeWidth:2})})]}),!x&&s.jsxs(s.Fragment,{children:[A.length>0&&s.jsxs("div",{className:"flex items-center gap-2 border-b border-[var(--border)] px-4 py-2 bg-[var(--bg-overlay-md)] flex-wrap",children:[s.jsx(vl,{className:"h-3 w-3 text-[var(--text-faint)] shrink-0",strokeWidth:2}),s.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-[var(--text-faint)] mr-1",children:"Env:"}),A.map(q=>{const V=L===q.name;return s.jsxs("button",{type:"button",onClick:()=>{T(q.name),G(q.baseUrl)},className:`flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-[10px] font-medium transition-all hover:cursor-pointer ${V?"border-blue-500/40 bg-blue-500/10 text-blue-400":"border-[var(--border)] text-[var(--text-faint)] hover:border-blue-500/20 hover:text-[var(--text-muted)]"}`,children:[s.jsx("span",{className:"h-1.5 w-1.5 rounded-full shrink-0",style:{background:V?"#60a5fa":"var(--text-faint)"}}),q.name]},q.name)}),L&&s.jsx("span",{className:"ml-auto font-mono text-[10px] text-[var(--text-faint)] truncate max-w-[180px]",children:R})]}),g&&s.jsx("div",{className:"border-b border-[var(--border)]",children:s.jsx(k3,{runState:N,steps:i.steps,waitingStepIndex:S?.stepIndex??null})}),f==="list"&&s.jsx("div",{className:"divide-y divide-[var(--border)]",children:i.steps.map((q,V)=>s.jsx(T3,{step:q,index:V,total:i.steps.length,status:N.stepStatuses[V]??"idle",result:N.stepResults[V]??null,allSteps:i.steps,onConditionChange:ae,waitingHuman:S?.stepIndex===V},V))}),f==="graph"&&s.jsx("div",{className:"p-4",children:s.jsx(E3,{steps:i.steps,runState:N})})]})]}),S&&s.jsx(j3,{title:"Human input required",subtitle:S.stepName?`Step ${S.stepIndex+1} · ${S.stepName}`:`Step ${S.stepIndex+1}`,fields:[{key:S.key}],values:{[S.key]:k},onChange:(q,V)=>H(V),onSubmit:Se,onCancel:ve,submitLabel:"Submit & resume run",error:D,submitting:E})]})}function A3(){return s.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-5 py-20 text-center",children:[s.jsxs("div",{className:"relative flex h-16 w-16 items-center justify-center",children:[s.jsx("div",{className:"absolute inset-0 rounded-full bg-blue-500/10 blur-xl"}),s.jsx("div",{className:"relative flex h-16 w-16 items-center justify-center rounded-full border border-[var(--border)] bg-[var(--bg-overlay)] text-blue-400",children:s.jsx(ea,{className:"h-7 w-7",strokeWidth:2})})]}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-[var(--text-primary)]",children:"No workflows yet"}),s.jsxs("p",{className:"mt-1 text-[11px] text-[var(--text-muted)]",children:["Create one with the"," ",s.jsx("span",{className:"text-[var(--text-secondary)]",children:"+ New Workflow"})," button, or run"," ",s.jsx("code",{className:"text-[var(--text-secondary)]",children:'jetic simulate workflow --goal "..."'})]}),s.jsxs("p",{className:"mt-1 text-[11px] text-[var(--text-faint)]",children:["Workflows are stored in ",s.jsx("code",{className:"text-[var(--text-faint)]",children:".jetic/workflows/"})]})]})]})}function R3({onViewTraces:n}){const[r,o]=j.useState([]),[i,u]=j.useState(!0),[f,h]=j.useState(!1),[g,p]=j.useState(null),[x,m]=j.useState(!1),[b,v]=j.useState(""),[N,C]=j.useState(null),[_,M]=j.useState(!1),A=()=>{m(!1),v(""),C(null)},Y=j.useCallback(async(R=!1)=>{R?h(!0):u(!0),p(null);try{o(await g3())}catch(G){p(G.message)}finally{u(!1),h(!1)}},[]);j.useEffect(()=>{Y()},[Y]);const L=async()=>{if(b.trim()){M(!0),C(null);try{const R=await fetch("/api/workflows/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({goal:b.trim()})}),G=await R.json();if(!R.ok)throw new Error(G.error??`HTTP ${R.status}`);A(),await Y(!0)}catch(R){C(R.message)}finally{M(!1)}}},T=R=>{o(G=>G.filter(X=>X._file!==R))};return s.jsxs("div",{className:"flex min-h-full w-full flex-col",children:[s.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-6 py-5 sticky",children:[s.jsx("div",{className:"flex items-center gap-3",children:s.jsxs("div",{children:[s.jsx("h1",{className:"text-[15px] font-medium text-[var(--text-primary)] leading-none",children:"Simulations"}),s.jsx("p",{className:"mt-0.5 text-[11px] text-[var(--text-muted)]",children:i?"Loading…":`${r.length} workflow${r.length!==1?"s":""} found`})]})}),s.jsxs("div",{className:"flex items-center gap-2",children:[x?s.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border border-blue-500/20 bg-blue-500/[0.05] p-3 w-80",children:[s.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] text-blue-400 font-medium",children:[s.jsx(aa,{className:"h-3 w-3",strokeWidth:2})," AI Workflow Generator"]}),s.jsx("input",{autoFocus:!0,value:b,onChange:R=>{v(R.target.value),C(null)},onKeyDown:R=>{R.key==="Enter"&&!R.shiftKey&&L(),R.key==="Escape"&&A()},placeholder:"Describe the workflow goal, e.g. Admin creates workspace, invites teacher and logs out",className:"h-7 w-full rounded-lg border border-blue-500/30 bg-[var(--bg-overlay-md)] px-2 text-[11px] text-[var(--text-primary)] placeholder-[var(--text-faint)] outline-none focus:border-blue-500/60"}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("button",{type:"button",onClick:L,disabled:_||!b.trim(),className:"flex h-6 flex-1 items-center justify-center gap-1.5 rounded-lg border border-blue-500/40 bg-blue-500/20 px-2 text-[10px] text-blue-400 hover:bg-blue-500/30 transition-colors disabled:opacity-40 hover:cursor-pointer",children:_?s.jsxs(s.Fragment,{children:[s.jsx(ot,{className:"h-3 w-3 animate-spin",strokeWidth:2})," AI generating…"]}):s.jsxs(s.Fragment,{children:[s.jsx(aa,{className:"h-3 w-3",strokeWidth:2})," Generate with AI"]})}),s.jsx("button",{type:"button",onClick:A,className:"flex h-6 w-6 items-center justify-center rounded-lg border border-[var(--border)] bg-[var(--bg-overlay)] text-[var(--text-muted)] hover:text-[var(--text-secondary)] transition-colors hover:cursor-pointer",children:s.jsx(Ct,{className:"h-3 w-3",strokeWidth:2})})]}),N&&s.jsx("span",{className:"text-[10px] text-red-400 leading-tight",children:N})]}):s.jsxs("button",{type:"button",onClick:()=>m(!0),className:"flex h-6 items-center gap-1.5 rounded-lg border border-blue-500/30 bg-blue-500/10 px-2.5 text-[10px] text-blue-400 hover:bg-blue-500/20 transition-colors hover:cursor-pointer",children:[s.jsx(_t,{className:"h-3 w-3",strokeWidth:2})," New Workflow"]}),s.jsx("button",{type:"button",onClick:()=>Y(!0),disabled:f||i,className:"flex h-6 w-6 items-center justify-center rounded-lg border border-[var(--border)] bg-[var(--bg-overlay)] text-[var(--text-muted)] hover:bg-[var(--bg-overlay-md)] hover:text-[var(--text-secondary)] disabled:opacity-40 transition-all hover:cursor-pointer",children:s.jsx(na,{className:`h-3.5 w-3.5 ${f?"animate-spin":""}`,strokeWidth:2})})]})]}),s.jsxs("div",{className:"flex flex-1 flex-col gap-4 p-6 overflow-y-auto max-h[(calc(100vh-60px))]",children:[i&&s.jsx("div",{className:"space-y-3",children:[1,2].map(R=>s.jsx("div",{className:"h-16 animate-pulse rounded-lg border border-[var(--border)] bg-[var(--bg-overlay)]",style:{opacity:1-R*.3}},R))}),!i&&g&&s.jsxs("div",{className:"flex flex-col items-center gap-4 rounded-lg border border-red-500/20 bg-red-500/[0.06] p-10 text-center",children:[s.jsx(Ht,{className:"h-8 w-8 text-red-400",strokeWidth:2}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-red-300",children:"Could not load simulations"}),s.jsx("p",{className:"mt-1 text-[11px] text-red-400/80",children:g})]}),s.jsx("button",{type:"button",onClick:()=>Y(),className:"rounded-lg border border-red-500/20 bg-red-500/10 px-4 py-1.5 text-[11px] text-red-400 hover:bg-red-500/20 transition-colors hover:cursor-pointer",children:"Retry"})]}),!i&&!g&&r.length===0&&s.jsx(A3,{}),!i&&!g&&r.length>0&&s.jsx("div",{className:"space-y-5",children:r.map((R,G)=>s.jsx(M3,{workflow:R,onDelete:()=>T(R._file),onViewTraces:n?(X,le)=>n({workflowName:X,traceId:le}):void 0},`${R._file}-${G}`))}),!i&&!g&&r.length>0&&s.jsxs("div",{className:"flex items-center gap-1.5 border-t border-[var(--border)] pt-3 text-[10px] text-[var(--text-faint)]",children:["Workflows from ",s.jsx("code",{className:"text-[var(--text-faint)]",children:".jetic/workflows/"})]})]})]})}const z3={GET:{bg:"bg-emerald-500/10",text:"text-emerald-400",dot:"#34d399"},POST:{bg:"bg-blue-500/10",text:"text-blue-400",dot:"#60a5fa"},PUT:{bg:"bg-amber-500/10",text:"text-amber-400",dot:"#fbbf24"},PATCH:{bg:"bg-orange-500/10",text:"text-orange-400",dot:"#fb923c"},DELETE:{bg:"bg-red-500/10",text:"text-red-400",dot:"#f87171"},HEAD:{bg:"bg-[var(--bg-overlay-md)]",text:"text-[var(--text-muted)]",dot:"#a1a1aa"},OPTIONS:{bg:"bg-purple-500/10",text:"text-purple-400",dot:"#c084fc"}};function hy(n){return z3[n.toUpperCase()]??{bg:"bg-[var(--bg-overlay-md)]",text:"text-[var(--text-muted)]",dot:"#a1a1aa"}}async function O3(){const n=await fetch("/api/model");if(!n.ok)throw new Error(`HTTP ${n.status}`);return n.json()}async function D3(){const n=await fetch("/api/model/scan",{method:"POST"});if(!n.ok){const r=await n.json().catch(()=>({}));throw new Error(r.error??`Scan failed (${n.status})`)}return(await n.json()).model}async function H3(n,r){const o=await fetch(`/api/model/endpoint/${n}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!o.ok)throw new Error(`Save failed (${o.status})`)}async function $3(n){const r=await fetch("/api/model/endpoint",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!r.ok){const o=await r.json().catch(()=>({}));throw new Error(o.error??`Create failed (${r.status})`)}return r.json()}function U3({method:n}){const r=hy(n);return s.jsx("span",{className:`inline-flex items-center rounded px-1.5 py-0.5 text-[10px] tracking-widest ${r.bg} ${r.text}`,children:n.toUpperCase()})}function p0({value:n,onSave:r,mono:o=!0}){const[i,u]=j.useState(!1),[f,h]=j.useState(n),[g,p]=j.useState(!1),x=j.useRef(null);j.useEffect(()=>{i&&x.current?.focus()},[i]);const m=async()=>{if(f===n){u(!1);return}p(!0);try{await r(f)}finally{p(!1),u(!1)}};return i?s.jsxs("span",{className:"inline-flex items-center gap-1",children:[s.jsx("input",{ref:x,value:f,onChange:b=>h(b.target.value),onKeyDown:b=>{b.key==="Enter"&&m(),b.key==="Escape"&&(h(n),u(!1))},className:`rounded border border-blue-500/40 bg-[var(--bg-overlay-md)] px-1.5 py-0.5 text-xs text-[var(--text-primary)] outline-none w-56 ${o?"font-mono":""}`}),s.jsx("button",{type:"button",onClick:m,disabled:g,className:"text-emerald-400 hover:text-emerald-300 hover:cursor-pointer",children:g?s.jsx(ot,{className:"h-3 w-3 animate-spin"}):s.jsx(xt,{className:"h-3 w-3"})}),s.jsx("button",{type:"button",onClick:()=>{h(n),u(!1)},className:"text-[var(--text-faint)] hover:text-[var(--text-muted)] hover:cursor-pointer",children:s.jsx(Ct,{className:"h-3 w-3"})})]}):s.jsxs("button",{type:"button",onClick:()=>u(!0),className:`group/ie inline-flex items-center gap-1 rounded px-1 py-0.5 hover:bg-[var(--bg-overlay-md)] transition-colors hover:cursor-pointer ${o?"font-mono":""}`,children:[s.jsx("span",{className:"text-xs text-[var(--text-secondary)]",children:n}),s.jsx(Fd,{className:"h-2.5 w-2.5 text-[var(--text-faint)] opacity-0 group-hover/ie:opacity-100 transition-opacity"})]})}function B3({ep:n,onUpdate:r,onInspect:o,onViewTraces:i,onEdit:u}){const[f,h]=j.useState(!1),[g,p]=j.useState(""),x=async(v,N)=>{p("");try{await H3(v,N),r(v,N)}catch(C){p(C.message)}},m=n.requestBody?.fields??{},b=n.responses??{};return s.jsxs("div",{className:"border-b border-[var(--border)] last:border-0",children:[s.jsxs("button",{type:"button",onClick:()=>h(v=>!v),className:"group flex w-full items-center gap-3 px-7 py-2.5 hover:bg-[var(--bg-overlay-md)] transition-colors text-left hover:cursor-pointer",children:[s.jsx("span",{className:"shrink-0 text-[var(--text-faint)]",children:f?s.jsx(La,{className:"h-3.5 w-3.5"}):s.jsx(bl,{className:"h-3.5 w-3.5"})}),s.jsx(U3,{method:n.method}),s.jsx("span",{className:"font-mono text-xs text-[var(--text-secondary)] flex-1 truncate",children:n.path}),n.security&&n.security.length>0&&s.jsx(Ya,{className:"h-3 w-3 text-amber-500/60 shrink-0"}),n.deprecated&&s.jsx("span",{className:"rounded text-[9px] font-medium text-amber-500/60 border border-amber-500/20 px-1 py-0.5",children:"deprecated"}),s.jsxs("span",{onClick:v=>{v.stopPropagation(),u(n)},className:"inline-flex items-center gap-0.5 rounded px-1.5 py-0.5 text-[10px] border border-[var(--border)] text-[var(--text-faint)] hover:bg-[var(--bg-overlay-md)] hover:text-[var(--text-secondary)] hover:cursor-pointer transition-colors",children:[s.jsx(Fd,{className:"h-2.5 w-2.5"})," EDIT"]}),s.jsx("span",{onClick:v=>{v.stopPropagation(),o(n)},className:"inline-flex items-center rounded px-1.5 py-0.5 text-[10px] border border-blue-500/40 text-blue-400 hover:bg-blue-500/10 hover:border-blue-400/60 hover:cursor-pointer transition-colors",children:"INSPECT"}),i&&s.jsxs("span",{onClick:v=>{v.stopPropagation(),i(n.path)},className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] border border-blue-500/30 text-blue-400 hover:bg-blue-500/10 hover:cursor-pointer transition-colors",children:[s.jsx(Vr,{className:"h-2.5 w-2.5"})," Traces"]}),s.jsx("span",{className:"hidden sm:block text-[10px] text-[var(--text-faint)] truncate max-w-[180px]",children:n.handlerName})]}),f&&s.jsxs("div",{className:"px-10 pb-4 pt-1 space-y-3 bg-[var(--bg-overlay)]",children:[g&&s.jsx("p",{className:"text-xs text-red-400 rounded border border-red-500/20 bg-red-500/10 px-2 py-1",children:g}),s.jsxs("div",{className:"flex flex-wrap gap-x-6 gap-y-2",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] text-[var(--text-faint)] mb-1 uppercase tracking-wider",children:"Method"}),s.jsx("select",{value:n.method,onChange:v=>x(n.id,{method:v.target.value}),className:"rounded-lg border border-[var(--border)] bg-[var(--bg-overlay-md)] px-2 py-1 text-xs text-[var(--text-secondary)] outline-none hover:cursor-pointer",children:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"].map(v=>s.jsx("option",{children:v},v))})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] text-[var(--text-faint)] mb-1 uppercase tracking-wider",children:"Path"}),s.jsx(p0,{value:n.path,onSave:v=>x(n.id,{path:v})})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] text-[var(--text-faint)] mb-1 uppercase tracking-wider",children:"Handler"}),s.jsx(p0,{value:n.handlerName??"—",onSave:v=>x(n.id,{handlerName:v}),mono:!1})]})]}),n.source&&s.jsxs("p",{className:"flex items-center gap-1.5 text-[10px] text-[var(--text-faint)]",children:[s.jsx(Kd,{className:"h-3 w-3 shrink-0",strokeWidth:2}),n.source.file.split(/[/\\]/).slice(-2).join("/"),":",n.source.line]}),Object.keys(m).length>0&&s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] text-[var(--text-faint)] mb-1.5 uppercase tracking-wider",children:"Request Body"}),s.jsx("div",{className:"space-y-1",children:Object.entries(m).map(([v,N])=>s.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-[var(--border)] bg-[var(--bg-overlay-md)] px-3 py-1.5",children:[s.jsx("span",{className:"font-mono text-[11px] text-[var(--text-secondary)]",children:v}),s.jsx("span",{className:"text-[10px] text-[var(--text-faint)]",children:N.type}),N.required&&s.jsx("span",{className:"text-[10px] text-rose-400",children:"required"})]},v))})]}),Object.keys(b).length>0&&s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] text-[var(--text-faint)] mb-1.5 uppercase tracking-wider",children:"Responses"}),s.jsx("div",{className:"space-y-1",children:Object.entries(b).map(([v,N])=>s.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-[var(--border)] bg-[var(--bg-overlay-md)] px-3 py-1.5",children:[s.jsx("span",{className:`font-mono text-[11px] ${v.startsWith("2")?"text-emerald-400":"text-red-400"}`,children:v}),N.schema&&s.jsx("span",{className:"text-[10px] text-[var(--text-muted)]",children:Object.keys(N.schema).join(", ")})]},v))})]}),n.middleware&&n.middleware.length>0&&s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] text-[var(--text-faint)] mb-1.5 uppercase tracking-wider",children:"Middleware"}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:n.middleware.map((v,N)=>s.jsx("span",{className:"rounded-lg border border-[var(--border)] bg-[var(--bg-overlay-md)] px-2 py-0.5 text-[10px] text-[var(--text-muted)]",children:v.name},N))})]})]})]})}function q3({prefix:n,endpoints:r,onUpdate:o,onInspect:i,onViewTraces:u,onEdit:f}){const[h,g]=j.useState(!1);return s.jsxs("div",{children:[s.jsxs("button",{type:"button",onClick:()=>g(p=>!p),className:"flex w-full items-center gap-3 px-4 py-2 hover:bg-[var(--bg-overlay-md)] transition-colors bg-[var(--bg-overlay)] hover:cursor-pointer",children:[s.jsx("span",{className:"text-blue-400",children:h?s.jsx(bl,{className:"h-3 w-3"}):s.jsx(La,{className:"h-3 w-3"})}),s.jsx("span",{className:"font-mono text-xs font-medium text-blue-400",children:n}),s.jsx("span",{className:"ml-auto rounded-full border border-[var(--border)] bg-[var(--bg-overlay-md)] px-2 py-0.5 text-[10px] text-[var(--text-muted)]",children:r.length})]}),s.jsx("div",{className:"flex flex-col overflow-y-auto max-h-[calc(100vh-280px)]",children:!h&&r.map(p=>s.jsx(B3,{ep:p,onUpdate:o,onInspect:i,onViewTraces:u,onEdit:f},p.id))})]})}const ll=210,_r=52,kd=100,m0=14,rl=36;function L3({endpoints:n}){const r=j.useRef(null),o=new Map;for(const p of n){const x="/"+(p.path.split("/")[1]??"");o.has(x)||o.set(x,[]),o.get(x).push(p)}const i=Array.from(o.entries()),u=Math.max(1,...i.map(([,p])=>p.length)),f=i.length*ll+(i.length-1)*kd+rl*2,h=u*_r+(u-1)*m0+rl*2+24,g=new Map;return i.forEach(([,p],x)=>{const m=rl+x*(ll+kd);p.forEach((b,v)=>{g.set(b.id,{x:m,y:rl+24+v*(_r+m0)})})}),j.useEffect(()=>{const p=r.current;if(!p)return;const x=p.getContext("2d");x&&(x.clearRect(0,0,p.width,p.height),i.forEach(([,m],b)=>{if(b>=i.length-1)return;const v=i[b+1][1];m.forEach(N=>{const C=g.get(N.id);v.forEach(_=>{const M=g.get(_.id),A=C.x+ll,Y=C.y+_r/2,L=M.x,T=M.y+_r/2,R=(A+L)/2;x.beginPath(),x.strokeStyle="rgba(96,165,250,0.14)",x.lineWidth=1,x.moveTo(A,Y),x.bezierCurveTo(R,Y,R,T,L,T),x.stroke()})})}))}),s.jsxs("div",{className:"relative overflow-auto",style:{minWidth:f,minHeight:h},children:[s.jsx("canvas",{ref:r,width:f,height:h,className:"absolute inset-0 pointer-events-none"}),i.map(([p],x)=>s.jsx("div",{className:"absolute text-[9px] font-medium text-blue-400/70 uppercase tracking-widest text-center",style:{left:rl+x*(ll+kd),top:rl,width:ll},children:p},p)),n.map(p=>{const x=g.get(p.id);if(!x)return null;const m=hy(p.method);return s.jsxs("div",{className:"absolute rounded-lg border border-[var(--border)] bg-[var(--bg-overlay)] shadow-md flex items-center gap-2 px-3 overflow-hidden hover:border-blue-500/30 transition-colors",style:{left:x.x,top:x.y,width:ll,height:_r},children:[s.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-[3px]",style:{background:m.dot}}),s.jsx("span",{className:`shrink-0 text-[9px] font-medium ${m.text}`,children:p.method}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"font-mono text-[10px] text-[var(--text-secondary)] truncate",children:p.path}),s.jsx("p",{className:"text-[9px] text-[var(--text-faint)] truncate",children:p.handlerName})]})]},p.id)})]})}function Y3({onScan:n,scanning:r,error:o}){return s.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-5 py-20 text-center",children:[s.jsxs("div",{className:"relative flex h-16 w-16 items-center justify-center",children:[s.jsx("div",{className:"absolute inset-0 rounded-full bg-blue-500/10 blur-xl"}),s.jsx("div",{className:"relative flex h-16 w-16 items-center justify-center rounded-full border border-[var(--border)] bg-[var(--bg-overlay)] text-blue-400",children:s.jsx(Ri,{className:"h-7 w-7",strokeWidth:2})})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-[var(--text-primary)]",children:"No model found"}),s.jsxs("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:["Scan your project to generate ",s.jsx("code",{className:"text-[var(--text-secondary)]",children:".jetic/model.json"})]})]}),o&&s.jsx("p",{className:"text-xs text-red-400 max-w-xs",children:o}),s.jsxs("button",{type:"button",onClick:n,disabled:r,className:"flex items-center gap-2 rounded-lg bg-blue-500 px-5 py-2.5 text-sm font-medium text-white hover:bg-blue-400 disabled:opacity-50 transition-colors hover:cursor-pointer",children:[r?s.jsx(ot,{className:"h-4 w-4 animate-spin",strokeWidth:2}):s.jsx(Ri,{className:"h-4 w-4",strokeWidth:2}),r?"Scanning project…":"Scan Project"]})]})}const Yi=["application/json","application/x-www-form-urlencoded","multipart/form-data","text/plain","application/xml","application/octet-stream"],xy=["string","integer","number","boolean","array","object"];function V3({open:n,onClose:r,onCreated:o}){const[i,u]=j.useState("basic"),[f,h]=j.useState(!1),[g,p]=j.useState(""),[x,m]=j.useState("GET"),[b,v]=j.useState(""),[N,C]=j.useState(""),[_,M]=j.useState(""),[A,Y]=j.useState(""),[L,T]=j.useState([]),[R,G]=j.useState("application/json"),[X,le]=j.useState(""),[I,K]=j.useState(""),[ne,ee]=j.useState(!1),[se,S]=j.useState([]),[U,k]=j.useState([]),[H,D]=j.useState(!1),O=H&&!b.trim(),E=j.useRef(null);j.useEffect(()=>{n&&(u("basic"),m("GET"),v(""),C(""),M(""),Y(""),T([]),G("application/json"),le(""),K(""),ee(!1),S([]),k([]),D(!1),p(""),h(!1))},[n]),j.useEffect(()=>{if(!n)return;const V=ue=>{ue.key==="Escape"&&r()};return window.addEventListener("keydown",V),()=>window.removeEventListener("keydown",V)},[n,r]);const $=()=>T(V=>[...V,{name:"",in:"query",type:"string",required:!1,description:"",example:""}]),W=(V,ue)=>T(oe=>oe.map((P,Ee)=>Ee===V?{...P,...ue}:P)),ae=V=>T(ue=>ue.filter((oe,P)=>P!==V)),ie=()=>S(V=>[...V,{status:"200",description:"",contentType:"application/json",schema:"",example:""}]),he=(V,ue)=>S(oe=>oe.map((P,Ee)=>Ee===V?{...P,...ue}:P)),xe=V=>S(ue=>ue.filter((oe,P)=>P!==V)),Se=()=>k(V=>[...V,{name:""}]),ve=(V,ue)=>k(oe=>oe.map((P,Ee)=>Ee===V?{name:ue}:P)),Ae=V=>k(ue=>ue.filter((oe,P)=>P!==V)),Re=(V,ue)=>k(oe=>{const P=[...oe],Ee=V+ue;return Ee<0||Ee>=P.length||([P[V],P[Ee]]=[P[Ee],P[V]]),P}),We=async()=>{if(D(!0),!b.trim()){u("basic");return}h(!0),p("");try{const V={method:x.toUpperCase(),path:b.startsWith("/")?b:"/"+b};N.trim()&&(V.name=N.trim()),_.trim()&&(V.description=_.trim()),A.trim()&&(V.tags=A.split(",").map(ge=>ge.trim()).filter(Boolean));const ue=U.filter(ge=>ge.name.trim());V.middleware=ue.map(ge=>({name:ge.name.trim()}));const oe=L.filter(ge=>ge.name.trim());if(oe.length>0&&(V.parameters=oe.map(ge=>{const ke={name:ge.name,in:ge.in,schema:{type:ge.type},required:ge.required};return ge.description.trim()&&(ke.description=ge.description),ge.example.trim()&&(ke.example=ge.example),ke})),X.trim()||I.trim()){const ge={},ke={};if(X.trim())try{ke.schema=JSON.parse(X)}catch{ke.schema=X}if(I.trim())try{ke.example=JSON.parse(I)}catch{ke.example=I}ge[R]=ke,V.requestBody={required:ne,content:ge}}const P=se.filter(ge=>ge.status.trim());if(P.length>0){const ge={};for(const ke of P){const Oe={};if(ke.description.trim()&&(Oe.description=ke.description),ke.schema.trim()||ke.example.trim()){const ze={};if(ke.schema.trim())try{ze.schema=JSON.parse(ke.schema)}catch{ze.schema=ke.schema}if(ke.example.trim())try{ze.example=JSON.parse(ke.example)}catch{ze.example=ke.example}Oe.content={[ke.contentType]:ze}}ge[ke.status]=Oe}V.responses=ge}const Ee=await $3(V);o(Ee.endpoint,Ee.model),r()}catch(V){p(V.message)}finally{h(!1)}};if(!n)return null;const Te=[{key:"basic",label:"Basic"},{key:"request",label:"Request"},{key:"responses",label:"Responses"},{key:"middleware",label:`Middleware${U.length>0?` (${U.length})`:""}`}],be="w-full rounded-lg border border-[var(--border)] bg-[var(--bg-overlay)] px-3 py-2 text-xs text-[var(--text-secondary)] placeholder-[var(--text-faint)] outline-none focus:border-blue-500/50 focus:bg-[var(--bg-overlay-md)] transition-all",q="block text-[10px] text-[var(--text-faint)] mb-1.5 uppercase tracking-wider font-medium";return s.jsx("div",{ref:E,className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:V=>{V.target===E.current&&r()},children:s.jsxs("div",{className:"relative w-full max-w-2xl max-h-[85vh] flex flex-col rounded-2xl border border-[var(--border-md)] shadow-2xl overflow-hidden",style:{backgroundColor:"var(--bg-surface)"},children:[s.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-[var(--border)]",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-lg bg-blue-500/10",children:s.jsx(Iv,{className:"h-4 w-4 text-blue-400"})}),s.jsx("h2",{className:"text-sm font-medium text-[var(--text-primary)]",children:"Add Endpoint"})]}),s.jsx("button",{type:"button",onClick:r,className:"text-[var(--text-faint)] hover:text-[var(--text-secondary)] transition-colors hover:cursor-pointer",children:s.jsx(Ct,{className:"h-4 w-4"})})]}),s.jsx("div",{className:"flex items-center gap-1 px-6 pt-4 pb-2",children:Te.map(V=>s.jsx("button",{type:"button",onClick:()=>u(V.key),className:`rounded-lg px-3 py-1.5 text-[11px] font-medium transition-all duration-200 hover:cursor-pointer ${i===V.key?"bg-blue-500/15 text-blue-400 shadow-sm":"text-[var(--text-faint)] hover:text-[var(--text-muted)] hover:bg-[var(--bg-overlay)]"}`,children:V.label},V.key))}),g&&s.jsxs("div",{className:"mx-6 mt-2 flex items-center gap-2 rounded-lg border border-red-500/20 bg-red-500/[0.06] px-3 py-2 text-xs text-red-400",children:[s.jsx(Ht,{className:"h-3.5 w-3.5 shrink-0"}),g]}),s.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-4 space-y-4",children:[i==="basic"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid grid-cols-[140px_1fr] gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:q,children:"Method *"}),s.jsx("select",{value:x,onChange:V=>m(V.target.value),className:`${be} hover:cursor-pointer`,children:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"].map(V=>s.jsx("option",{children:V},V))})]}),s.jsxs("div",{children:[s.jsx("label",{className:q,children:"Path *"}),s.jsx("input",{value:b,onChange:V=>v(V.target.value),placeholder:"/api/users",className:`${be} font-mono ${O?"border-red-500/60 focus:border-red-500/80":""}`}),O&&s.jsx("p",{className:"text-[10px] text-red-400 mt-1",children:"Path is required"})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:q,children:"Name"}),s.jsx("input",{value:N,onChange:V=>C(V.target.value),placeholder:"Create User",className:be})]}),s.jsxs("div",{children:[s.jsx("label",{className:q,children:"Description"}),s.jsx("textarea",{value:_,onChange:V=>M(V.target.value),placeholder:"Creates a new user account",rows:2,className:`${be} resize-none`})]}),s.jsxs("div",{children:[s.jsx("label",{className:q,children:"Tags"}),s.jsx("input",{value:A,onChange:V=>Y(V.target.value),placeholder:"users, auth, public",className:be}),s.jsx("p",{className:"text-[10px] text-[var(--text-faint)] mt-1",children:"Comma-separated"})]})]}),i==="request"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("p",{className:q+" mb-0",children:"Parameters"}),s.jsxs("button",{type:"button",onClick:$,className:"flex items-center gap-1 rounded-lg px-2 py-1 text-[10px] font-medium text-blue-400 hover:bg-blue-500/10 transition-colors hover:cursor-pointer",children:[s.jsx(_t,{className:"h-3 w-3"})," Add Parameter"]})]}),L.length===0&&s.jsx("p",{className:"text-[10px] text-[var(--text-faint)] italic",children:"No parameters added yet"}),s.jsx("div",{className:"space-y-2",children:L.map((V,ue)=>s.jsxs("div",{className:"rounded-lg border border-[var(--border)] bg-[var(--bg-overlay)] p-3 space-y-2",children:[s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("div",{className:"flex-1",children:s.jsx("input",{value:V.name,onChange:oe=>W(ue,{name:oe.target.value}),placeholder:"Parameter name",className:`${be} font-mono`})}),s.jsx("select",{value:V.in,onChange:oe=>W(ue,{in:oe.target.value}),className:`${be} w-28 hover:cursor-pointer`,children:["query","path","header","cookie"].map(oe=>s.jsx("option",{children:oe},oe))}),s.jsx("select",{value:V.type,onChange:oe=>W(ue,{type:oe.target.value}),className:`${be} w-28 hover:cursor-pointer`,children:xy.map(oe=>s.jsx("option",{children:oe},oe))}),s.jsx("button",{type:"button",onClick:()=>ae(ue),className:"mt-1.5 text-[var(--text-faint)] hover:text-red-400 transition-colors hover:cursor-pointer",children:s.jsx(Yt,{className:"h-3.5 w-3.5"})})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("label",{className:"flex items-center gap-1.5 text-[10px] text-[var(--text-muted)] hover:cursor-pointer select-none",children:[s.jsx("input",{type:"checkbox",checked:V.required,onChange:oe=>W(ue,{required:oe.target.checked}),className:"accent-blue-500"}),"Required"]}),s.jsx("input",{value:V.description,onChange:oe=>W(ue,{description:oe.target.value}),placeholder:"Description",className:`${be} flex-1 text-[10px]`}),s.jsx("input",{value:V.example,onChange:oe=>W(ue,{example:oe.target.value}),placeholder:"Example",className:`${be} w-32 text-[10px] font-mono`})]})]},ue))})]}),s.jsx("div",{className:"border-t border-[var(--border)]"}),s.jsxs("div",{children:[s.jsx("p",{className:q,children:"Request Body"}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx("label",{className:q,children:"Content Type"}),s.jsx("select",{value:R,onChange:V=>G(V.target.value),className:`${be} hover:cursor-pointer`,children:Yi.map(V=>s.jsx("option",{children:V},V))})]}),s.jsxs("label",{className:"flex items-center gap-1.5 text-[10px] text-[var(--text-muted)] mt-5 hover:cursor-pointer select-none",children:[s.jsx("input",{type:"checkbox",checked:ne,onChange:V=>ee(V.target.checked),className:"accent-blue-500"}),"Required"]})]}),s.jsxs("div",{children:[s.jsx("label",{className:q,children:"Schema (JSON)"}),s.jsx("textarea",{value:X,onChange:V=>le(V.target.value),placeholder:`{
|
|
388
|
-
"type": "object",
|
|
389
|
-
"properties": {
|
|
390
|
-
"email": { "type": "string", "format": "email" },
|
|
391
|
-
"password": { "type": "string" }
|
|
392
|
-
},
|
|
393
|
-
"required": ["email", "password"]
|
|
394
|
-
}`,rows:5,className:`${be} resize-none font-mono text-[11px] leading-relaxed`})]}),s.jsxs("div",{children:[s.jsx("label",{className:q,children:"Example"}),s.jsx("textarea",{value:I,onChange:V=>K(V.target.value),placeholder:`{
|
|
395
|
-
"email": "test@example.com",
|
|
396
|
-
"password": "password123"
|
|
397
|
-
}`,rows:3,className:`${be} resize-none font-mono text-[11px] leading-relaxed`})]})]})]})]}),i==="responses"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("p",{className:q+" mb-0",children:"Responses"}),s.jsxs("button",{type:"button",onClick:ie,className:"flex items-center gap-1 rounded-lg px-2 py-1 text-[10px] font-medium text-blue-400 hover:bg-blue-500/10 transition-colors hover:cursor-pointer",children:[s.jsx(_t,{className:"h-3 w-3"})," Add Response"]})]}),se.length===0&&s.jsx("p",{className:"text-[10px] text-[var(--text-faint)] italic",children:'No responses defined yet. Click "Add Response" above.'}),s.jsx("div",{className:"space-y-3",children:se.map((V,ue)=>s.jsxs("div",{className:"rounded-lg border border-[var(--border)] bg-[var(--bg-overlay)] p-3 space-y-3",children:[s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsxs("div",{className:"w-24",children:[s.jsx("label",{className:q,children:"Status"}),s.jsx("input",{value:V.status,onChange:oe=>he(ue,{status:oe.target.value}),placeholder:"200",className:`${be} font-mono`})]}),s.jsxs("div",{className:"flex-1",children:[s.jsx("label",{className:q,children:"Description"}),s.jsx("input",{value:V.description,onChange:oe=>he(ue,{description:oe.target.value}),placeholder:"Success",className:be})]}),s.jsxs("div",{className:"w-48",children:[s.jsx("label",{className:q,children:"Content Type"}),s.jsx("select",{value:V.contentType,onChange:oe=>he(ue,{contentType:oe.target.value}),className:`${be} hover:cursor-pointer`,children:Yi.map(oe=>s.jsx("option",{children:oe},oe))})]}),s.jsx("button",{type:"button",onClick:()=>xe(ue),className:"mt-5 text-[var(--text-faint)] hover:text-red-400 transition-colors hover:cursor-pointer",children:s.jsx(Yt,{className:"h-3.5 w-3.5"})})]}),s.jsxs("div",{children:[s.jsx("label",{className:q,children:"Body Schema (JSON)"}),s.jsx("textarea",{value:V.schema,onChange:oe=>he(ue,{schema:oe.target.value}),placeholder:`{
|
|
398
|
-
"type": "object",
|
|
399
|
-
"properties": { ... }
|
|
400
|
-
}`,rows:3,className:`${be} resize-none font-mono text-[11px] leading-relaxed`})]}),s.jsxs("div",{children:[s.jsx("label",{className:q,children:"Example"}),s.jsx("textarea",{value:V.example,onChange:oe=>he(ue,{example:oe.target.value}),placeholder:`{
|
|
401
|
-
"id": "abc123",
|
|
402
|
-
"email": "test@example.com"
|
|
403
|
-
}`,rows:2,className:`${be} resize-none font-mono text-[11px] leading-relaxed`})]})]},ue))})]}),i==="middleware"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsxs("div",{children:[s.jsx("p",{className:q+" mb-0",children:"Middleware Chain"}),s.jsx("p",{className:"text-[10px] text-[var(--text-faint)] mt-0.5",children:"Executed in order, top → bottom"})]}),s.jsxs("button",{type:"button",onClick:Se,className:"flex items-center gap-1 rounded-lg px-2 py-1 text-[10px] font-medium text-blue-400 hover:bg-blue-500/10 transition-colors hover:cursor-pointer",children:[s.jsx(_t,{className:"h-3 w-3"})," Add Middleware"]})]}),U.length===0&&s.jsxs("div",{className:"flex flex-col items-center gap-2 py-8 rounded-lg border border-dashed border-[var(--border)] text-center",children:[s.jsx(Ya,{className:"h-6 w-6 text-[var(--text-faint)]",strokeWidth:1.5}),s.jsxs("p",{className:"text-[10px] text-[var(--text-faint)] italic",children:["No middleware added yet.",s.jsx("br",{}),'Click "Add Middleware" to get started.']})]}),s.jsx("div",{className:"space-y-2",children:U.map((V,ue)=>s.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-[var(--border)] bg-[var(--bg-overlay)] px-3 py-2",children:[s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("button",{type:"button",onClick:()=>Re(ue,-1),disabled:ue===0,className:"text-[var(--text-faint)] hover:text-[var(--text-secondary)] disabled:opacity-25 hover:cursor-pointer transition-colors leading-none",title:"Move up",children:s.jsx(La,{className:"h-3 w-3 rotate-180"})}),s.jsx("button",{type:"button",onClick:()=>Re(ue,1),disabled:ue===U.length-1,className:"text-[var(--text-faint)] hover:text-[var(--text-secondary)] disabled:opacity-25 hover:cursor-pointer transition-colors leading-none",title:"Move down",children:s.jsx(La,{className:"h-3 w-3"})})]}),s.jsx("span",{className:"text-[10px] text-[var(--text-faint)] w-4 text-center shrink-0",children:ue+1}),s.jsx("input",{value:V.name,onChange:oe=>ve(ue,oe.target.value),placeholder:"e.g. authenticateToken",className:`${be} flex-1 font-mono`}),s.jsx("button",{type:"button",onClick:()=>Ae(ue),className:"text-[var(--text-faint)] hover:text-red-400 transition-colors hover:cursor-pointer shrink-0",title:"Remove",children:s.jsx(Yt,{className:"h-3.5 w-3.5"})})]},ue))})]})]}),s.jsxs("div",{className:"flex items-center justify-between border-t border-[var(--border)] px-6 py-4",children:[s.jsxs("p",{className:"text-[10px] text-[var(--text-faint)]",children:["Only ",s.jsx("span",{className:"text-[var(--text-muted)]",children:"Method"})," and ",s.jsx("span",{className:"text-[var(--text-muted)]",children:"Path"})," are required"]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("button",{type:"button",onClick:r,className:"rounded-lg border border-[var(--border)] px-4 py-2 text-xs font-medium text-[var(--text-muted)] hover:bg-[var(--bg-overlay-md)] hover:text-[var(--text-secondary)] transition-colors hover:cursor-pointer",children:"Cancel"}),s.jsxs("button",{type:"button",onClick:We,disabled:f,className:"flex items-center gap-1.5 rounded-lg bg-blue-500 px-4 py-2 text-xs font-medium text-white hover:bg-blue-400 disabled:opacity-50 transition-colors hover:cursor-pointer",children:[f?s.jsx(ot,{className:"h-3.5 w-3.5 animate-spin"}):s.jsx(_t,{className:"h-3.5 w-3.5"}),f?"Adding…":"Add Endpoint"]})]})]})]})})}function G3({endpoint:n,onClose:r,onSaved:o}){const[i,u]=j.useState("basic"),[f,h]=j.useState(!1),[g,p]=j.useState(""),[x,m]=j.useState(n.method),[b,v]=j.useState(n.path),[N,C]=j.useState(n.name??""),[_,M]=j.useState(n.description??""),[A,Y]=j.useState((n.tags??[]).join(", ")),[L,T]=j.useState(n.deprecated??!1),[R,G]=j.useState(()=>(n.parameters??[]).filter(q=>q.in!=="body").map(q=>({name:q.name,in:q.in??"query",type:q.type,required:q.required??!1,description:q.description??"",example:q.example?String(q.example):""}))),[X,le]=j.useState(n.requestBody?.contentType??"application/json"),[I,K]=j.useState(n.requestBody?.required??!1),[ne,ee]=j.useState(()=>{const q=n.requestBody?.fields;if(!q||Object.keys(q).length===0)return"";const V={},ue=[];for(const[oe,P]of Object.entries(q))V[oe]={type:P.type,...P.format?{format:P.format}:{},...P.description?{description:P.description}:{}},P.required&&ue.push(oe);return JSON.stringify({type:"object",properties:V,...ue.length>0?{required:ue}:{}},null,2)}),[se,S]=j.useState(""),[U,k]=j.useState(()=>Object.entries(n.responses??{}).map(([q,V])=>({status:q,description:V.description??"",contentType:V.contentType??"application/json",schema:V.schema?JSON.stringify(V.schema,null,2):"",example:""}))),[H,D]=j.useState((n.middleware??[]).map(q=>({name:q.name}))),O=j.useRef(null);j.useEffect(()=>{if(!open)return;const q=V=>{V.key==="Escape"&&r()};return window.addEventListener("keydown",q),()=>window.removeEventListener("keydown",q)},[r]);const E=()=>G(q=>[...q,{name:"",in:"query",type:"string",required:!1,description:"",example:""}]),$=(q,V)=>G(ue=>ue.map((oe,P)=>P===q?{...oe,...V}:oe)),W=q=>G(V=>V.filter((ue,oe)=>oe!==q)),ae=()=>k(q=>[...q,{status:"200",description:"",contentType:"application/json",schema:"",example:""}]),ie=(q,V)=>k(ue=>ue.map((oe,P)=>P===q?{...oe,...V}:oe)),he=q=>k(V=>V.filter((ue,oe)=>oe!==q)),xe=()=>D(q=>[...q,{name:""}]),Se=(q,V)=>D(ue=>ue.map((oe,P)=>P===q?{name:V}:oe)),ve=q=>D(V=>V.filter((ue,oe)=>oe!==q)),Ae=(q,V)=>D(ue=>{const oe=[...ue],P=q+V;return P<0||P>=oe.length||([oe[q],oe[P]]=[oe[P],oe[q]]),oe}),Re=async()=>{if(!b.trim()){u("basic");return}h(!0),p("");try{const q={id:n.id,method:x.toUpperCase(),path:b.startsWith("/")?b:"/"+b};N.trim()&&(q.name=N.trim()),_.trim()&&(q.description=_.trim()),A.trim()&&(q.tags=A.split(",").map(P=>P.trim()).filter(Boolean)),L&&(q.deprecated=!0),n.handlerName&&(q.handlerName=n.handlerName),n.source&&(q.source=n.source),n.security&&(q.security=n.security),q.middleware=H.filter(P=>P.name.trim()).map(P=>({name:P.name.trim()}));const V=R.filter(P=>P.name.trim());if(V.length>0&&(q.parameters=V.map(P=>({name:P.name,in:P.in,schema:{type:P.type},required:P.required,...P.description?{description:P.description}:{},...P.example?{example:P.example}:{}}))),ne.trim()){const P={};try{P.schema=JSON.parse(ne)}catch{P.schema=ne}if(se.trim())try{P.example=JSON.parse(se)}catch{P.example=se}q.requestBody={required:I,content:{[X]:P}}}const ue=U.filter(P=>P.status.trim());if(ue.length>0){const P={};for(const Ee of ue){const ge={};if(Ee.description.trim()&&(ge.description=Ee.description),Ee.schema.trim())try{ge.schema=JSON.parse(Ee.schema)}catch{ge.schema=Ee.schema}P[Ee.status]=ge}q.responses=P}const oe=await fetch(`/api/model/endpoint/${n.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(q)});if(!oe.ok){const P=await oe.json().catch(()=>({}));throw new Error(P.error??`Save failed (${oe.status})`)}o({...n,...q})}catch(q){p(q.message)}finally{h(!1)}},We=[{key:"basic",label:"Basic"},{key:"request",label:"Request"},{key:"responses",label:"Responses"},{key:"middleware",label:`Middleware${H.length>0?` (${H.length})`:""}`}],Te="w-full rounded-lg border border-[var(--border)] bg-[var(--bg-overlay)] px-3 py-2 text-xs text-[var(--text-secondary)] placeholder-[var(--text-faint)] outline-none focus:border-blue-500/50 focus:bg-[var(--bg-overlay-md)] transition-all",be="block text-[10px] text-[var(--text-faint)] mb-1.5 uppercase tracking-wider font-medium";return s.jsx("div",{ref:O,className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:q=>{q.target===O.current&&r()},children:s.jsxs("div",{className:"relative w-full max-w-2xl max-h-[85vh] flex flex-col rounded-2xl border border-[var(--border-md)] shadow-2xl overflow-hidden",style:{backgroundColor:"var(--bg-surface)"},children:[s.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-[var(--border)]",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-lg bg-amber-500/10",children:s.jsx(Fd,{className:"h-4 w-4 text-amber-400"})}),s.jsxs("div",{children:[s.jsx("h2",{className:"text-sm font-medium text-[var(--text-primary)]",children:"Edit Endpoint"}),s.jsxs("p",{className:"text-[10px] text-[var(--text-faint)] font-mono",children:[n.method," ",n.path]})]})]}),s.jsx("button",{type:"button",onClick:r,className:"text-[var(--text-faint)] hover:text-[var(--text-secondary)] transition-colors hover:cursor-pointer",children:s.jsx(Ct,{className:"h-4 w-4"})})]}),s.jsx("div",{className:"flex items-center gap-1 px-6 pt-4 pb-2",children:We.map(q=>s.jsx("button",{type:"button",onClick:()=>u(q.key),className:`rounded-lg px-3 py-1.5 text-[11px] font-medium transition-all duration-200 hover:cursor-pointer ${i===q.key?"bg-amber-500/15 text-amber-400 shadow-sm":"text-[var(--text-faint)] hover:text-[var(--text-muted)] hover:bg-[var(--bg-overlay)]"}`,children:q.label},q.key))}),g&&s.jsxs("div",{className:"mx-6 mt-2 flex items-center gap-2 rounded-lg border border-red-500/20 bg-red-500/[0.06] px-3 py-2 text-xs text-red-400",children:[s.jsx(Ht,{className:"h-3.5 w-3.5 shrink-0"}),g]}),s.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-4 space-y-4",children:[i==="basic"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid grid-cols-[140px_1fr] gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:be,children:"Method *"}),s.jsx("select",{value:x,onChange:q=>m(q.target.value),className:`${Te} hover:cursor-pointer`,children:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"].map(q=>s.jsx("option",{children:q},q))})]}),s.jsxs("div",{children:[s.jsx("label",{className:be,children:"Path *"}),s.jsx("input",{value:b,onChange:q=>v(q.target.value),placeholder:"/api/users",className:`${Te} font-mono`})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:be,children:"Name"}),s.jsx("input",{value:N,onChange:q=>C(q.target.value),placeholder:"Create User",className:Te})]}),s.jsxs("div",{children:[s.jsx("label",{className:be,children:"Description"}),s.jsx("textarea",{value:_,onChange:q=>M(q.target.value),rows:2,className:`${Te} resize-none`})]}),s.jsxs("div",{children:[s.jsx("label",{className:be,children:"Tags"}),s.jsx("input",{value:A,onChange:q=>Y(q.target.value),placeholder:"users, auth, public",className:Te}),s.jsx("p",{className:"text-[10px] text-[var(--text-faint)] mt-1",children:"Comma-separated"})]}),s.jsxs("label",{className:"flex items-center gap-2 text-[11px] text-[var(--text-muted)] hover:cursor-pointer select-none",children:[s.jsx("input",{type:"checkbox",checked:L,onChange:q=>T(q.target.checked),className:"accent-amber-500"}),"Mark as deprecated"]})]}),i==="request"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("p",{className:be+" mb-0",children:"Parameters"}),s.jsxs("button",{type:"button",onClick:E,className:"flex items-center gap-1 rounded-lg px-2 py-1 text-[10px] font-medium text-amber-400 hover:bg-amber-500/10 transition-colors hover:cursor-pointer",children:[s.jsx(_t,{className:"h-3 w-3"})," Add Parameter"]})]}),R.length===0&&s.jsx("p",{className:"text-[10px] text-[var(--text-faint)] italic",children:"No parameters"}),s.jsx("div",{className:"space-y-2",children:R.map((q,V)=>s.jsxs("div",{className:"rounded-lg border border-[var(--border)] bg-[var(--bg-overlay)] p-3 space-y-2",children:[s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("div",{className:"flex-1",children:s.jsx("input",{value:q.name,onChange:ue=>$(V,{name:ue.target.value}),placeholder:"name",className:`${Te} font-mono`})}),s.jsx("select",{value:q.in,onChange:ue=>$(V,{in:ue.target.value}),className:`${Te} w-28 hover:cursor-pointer`,children:["query","path","header","cookie"].map(ue=>s.jsx("option",{children:ue},ue))}),s.jsx("select",{value:q.type,onChange:ue=>$(V,{type:ue.target.value}),className:`${Te} w-28 hover:cursor-pointer`,children:xy.map(ue=>s.jsx("option",{children:ue},ue))}),s.jsx("button",{type:"button",onClick:()=>W(V),className:"mt-1.5 text-[var(--text-faint)] hover:text-red-400 transition-colors hover:cursor-pointer",children:s.jsx(Yt,{className:"h-3.5 w-3.5"})})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("label",{className:"flex items-center gap-1.5 text-[10px] text-[var(--text-muted)] hover:cursor-pointer select-none",children:[s.jsx("input",{type:"checkbox",checked:q.required,onChange:ue=>$(V,{required:ue.target.checked}),className:"accent-amber-500"})," Required"]}),s.jsx("input",{value:q.description,onChange:ue=>$(V,{description:ue.target.value}),placeholder:"Description",className:`${Te} flex-1 text-[10px]`})]})]},V))})]}),s.jsx("div",{className:"border-t border-[var(--border)]"}),s.jsxs("div",{children:[s.jsx("p",{className:be,children:"Request Body"}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx("label",{className:be,children:"Content Type"}),s.jsx("select",{value:X,onChange:q=>le(q.target.value),className:`${Te} hover:cursor-pointer`,children:Yi.map(q=>s.jsx("option",{children:q},q))})]}),s.jsxs("label",{className:"flex items-center gap-1.5 text-[10px] text-[var(--text-muted)] mt-5 hover:cursor-pointer select-none",children:[s.jsx("input",{type:"checkbox",checked:I,onChange:q=>K(q.target.checked),className:"accent-amber-500"})," Required"]})]}),s.jsxs("div",{children:[s.jsx("label",{className:be,children:"Schema (JSON)"}),s.jsx("textarea",{value:ne,onChange:q=>ee(q.target.value),rows:5,className:`${Te} resize-none font-mono text-[11px] leading-relaxed`})]}),s.jsxs("div",{children:[s.jsx("label",{className:be,children:"Example"}),s.jsx("textarea",{value:se,onChange:q=>S(q.target.value),rows:3,className:`${Te} resize-none font-mono text-[11px] leading-relaxed`})]})]})]})]}),i==="responses"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("p",{className:be+" mb-0",children:"Responses"}),s.jsxs("button",{type:"button",onClick:ae,className:"flex items-center gap-1 rounded-lg px-2 py-1 text-[10px] font-medium text-amber-400 hover:bg-amber-500/10 transition-colors hover:cursor-pointer",children:[s.jsx(_t,{className:"h-3 w-3"})," Add Response"]})]}),U.length===0&&s.jsx("p",{className:"text-[10px] text-[var(--text-faint)] italic",children:"No responses defined."}),s.jsx("div",{className:"space-y-3",children:U.map((q,V)=>s.jsxs("div",{className:"rounded-lg border border-[var(--border)] bg-[var(--bg-overlay)] p-3 space-y-3",children:[s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsxs("div",{className:"w-24",children:[s.jsx("label",{className:be,children:"Status"}),s.jsx("input",{value:q.status,onChange:ue=>ie(V,{status:ue.target.value}),placeholder:"200",className:`${Te} font-mono`})]}),s.jsxs("div",{className:"flex-1",children:[s.jsx("label",{className:be,children:"Description"}),s.jsx("input",{value:q.description,onChange:ue=>ie(V,{description:ue.target.value}),placeholder:"Success",className:Te})]}),s.jsxs("div",{className:"w-48",children:[s.jsx("label",{className:be,children:"Content Type"}),s.jsx("select",{value:q.contentType,onChange:ue=>ie(V,{contentType:ue.target.value}),className:`${Te} hover:cursor-pointer`,children:Yi.map(ue=>s.jsx("option",{children:ue},ue))})]}),s.jsx("button",{type:"button",onClick:()=>he(V),className:"mt-5 text-[var(--text-faint)] hover:text-red-400 transition-colors hover:cursor-pointer",children:s.jsx(Yt,{className:"h-3.5 w-3.5"})})]}),s.jsxs("div",{children:[s.jsx("label",{className:be,children:"Body Schema (JSON)"}),s.jsx("textarea",{value:q.schema,onChange:ue=>ie(V,{schema:ue.target.value}),rows:3,className:`${Te} resize-none font-mono text-[11px] leading-relaxed`})]})]},V))})]}),i==="middleware"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsxs("div",{children:[s.jsx("p",{className:be+" mb-0",children:"Middleware Chain"}),s.jsx("p",{className:"text-[10px] text-[var(--text-faint)] mt-0.5",children:"Executed in order, top → bottom"})]}),s.jsxs("button",{type:"button",onClick:xe,className:"flex items-center gap-1 rounded-lg px-2 py-1 text-[10px] font-medium text-amber-400 hover:bg-amber-500/10 transition-colors hover:cursor-pointer",children:[s.jsx(_t,{className:"h-3 w-3"})," Add Middleware"]})]}),H.length===0&&s.jsxs("div",{className:"flex flex-col items-center gap-2 py-8 rounded-lg border border-dashed border-[var(--border)] text-center",children:[s.jsx(Ya,{className:"h-6 w-6 text-[var(--text-faint)]",strokeWidth:1.5}),s.jsx("p",{className:"text-[10px] text-[var(--text-faint)] italic",children:'No middleware. Click "Add Middleware" to get started.'})]}),s.jsx("div",{className:"space-y-2",children:H.map((q,V)=>s.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-[var(--border)] bg-[var(--bg-overlay)] px-3 py-2",children:[s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("button",{type:"button",onClick:()=>Ae(V,-1),disabled:V===0,className:"text-[var(--text-faint)] hover:text-[var(--text-secondary)] disabled:opacity-25 hover:cursor-pointer transition-colors leading-none",title:"Move up",children:s.jsx(La,{className:"h-3 w-3 rotate-180"})}),s.jsx("button",{type:"button",onClick:()=>Ae(V,1),disabled:V===H.length-1,className:"text-[var(--text-faint)] hover:text-[var(--text-secondary)] disabled:opacity-25 hover:cursor-pointer transition-colors leading-none",title:"Move down",children:s.jsx(La,{className:"h-3 w-3"})})]}),s.jsx("span",{className:"text-[10px] text-[var(--text-faint)] w-4 text-center shrink-0",children:V+1}),s.jsx("input",{value:q.name,onChange:ue=>Se(V,ue.target.value),placeholder:"e.g. authenticateToken",className:`${Te} flex-1 font-mono`}),s.jsx("button",{type:"button",onClick:()=>ve(V),className:"text-[var(--text-faint)] hover:text-red-400 transition-colors hover:cursor-pointer shrink-0",title:"Remove",children:s.jsx(Yt,{className:"h-3.5 w-3.5"})})]},V))})]})]}),s.jsxs("div",{className:"flex items-center justify-between border-t border-[var(--border)] px-6 py-4",children:[s.jsxs("p",{className:"text-[10px] text-[var(--text-faint)]",children:["ID: ",s.jsx("span",{className:"font-mono",children:n.id})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("button",{type:"button",onClick:r,className:"rounded-lg border border-[var(--border)] px-4 py-2 text-xs font-medium text-[var(--text-muted)] hover:bg-[var(--bg-overlay-md)] hover:text-[var(--text-secondary)] transition-colors hover:cursor-pointer",children:"Cancel"}),s.jsxs("button",{type:"button",onClick:Re,disabled:f,className:"flex items-center gap-1.5 rounded-lg bg-amber-500 px-4 py-2 text-xs font-medium text-white hover:bg-amber-400 disabled:opacity-50 transition-colors hover:cursor-pointer",children:[f?s.jsx(ot,{className:"h-3.5 w-3.5 animate-spin"}):s.jsx(xt,{className:"h-3.5 w-3.5"}),f?"Saving…":"Save Changes"]})]})]})]})})}function X3({onInspect:n,onViewTraces:r}){const[o,i]=j.useState(null),[u,f]=j.useState(!0),[h,g]=j.useState(!1),[p,x]=j.useState(!1),[m,b]=j.useState(null),[v,N]=j.useState(""),[C,_]=j.useState("list"),[M,A]=j.useState(""),[Y,L]=j.useState(!1),[T,R]=j.useState(null),G=j.useCallback(async(ee=!1)=>{ee?g(!0):f(!0),b(null);try{i(await O3())}catch(se){b(se.message)}finally{f(!1),g(!1)}},[]);j.useEffect(()=>{G()},[G]);const X=async()=>{x(!0),N("");try{i(await D3())}catch(ee){N(ee.message)}finally{x(!1)}},le=(ee,se)=>{i(S=>S&&{...S,endpoints:S.endpoints.map(U=>U.id===ee?{...U,...se}:U)})},I=(ee,se)=>{i(se)},K=(o?.endpoints??[]).filter(ee=>!M||ee.path.toLowerCase().includes(M.toLowerCase())||ee.method.toLowerCase().includes(M.toLowerCase())||(ee.handlerName??"").toLowerCase().includes(M.toLowerCase())),ne=new Map;for(const ee of K){const se="/"+(ee.path.split("/")[1]??"");ne.has(se)||ne.set(se,[]),ne.get(se).push(ee)}return s.jsxs("div",{className:"flex min-h-full w-full flex-col",children:[s.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-6 py-5",children:[s.jsx("div",{className:"flex items-center gap-3",children:s.jsxs("div",{children:[s.jsx("h1",{className:"text-[15px] font-medium text-[var(--text-primary)] leading-none",children:o?.project?.name??"Model"}),s.jsx("p",{className:"mt-0.5 text-[11px] text-[var(--text-muted)]",children:u?"Loading…":o?`v${o.version} · ${o.endpoints.length} endpoints · ${o.project.framework??o.project.language??""}`:"No model generated yet"})]})}),s.jsxs("div",{className:"flex items-center gap-2",children:[o&&s.jsx("div",{className:"flex items-center gap-1 rounded-xl border border-[var(--border)] bg-[var(--bg-overlay)] p-1",children:["list","graph"].map(ee=>s.jsxs("button",{type:"button",onClick:()=>_(ee),className:`flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-[11px] font-medium transition-all duration-200 hover:cursor-pointer ${C===ee?"bg-blue-500/15 text-blue-400 shadow-sm":"text-[var(--text-faint)] hover:text-[var(--text-muted)]"}`,children:[ee==="list"?s.jsx(R0,{className:"h-3.5 w-3.5",strokeWidth:2}):s.jsx(Id,{className:"h-3.5 w-3.5",strokeWidth:2}),ee.charAt(0).toUpperCase()+ee.slice(1)]},ee))}),s.jsx("button",{type:"button",onClick:()=>G(!0),disabled:h||u,className:"flex h-8 w-8 items-center justify-center rounded-lg border border-[var(--border)] bg-[var(--bg-overlay)] text-[var(--text-muted)] hover:bg-[var(--bg-overlay-md)] hover:text-[var(--text-secondary)] disabled:opacity-40 transition-all hover:cursor-pointer",children:s.jsx(na,{className:`h-3.5 w-3.5 ${h?"animate-spin":""}`,strokeWidth:2})}),s.jsxs("button",{type:"button",onClick:X,disabled:p,className:"flex items-center gap-1.5 rounded-lg bg-blue-500 px-3 py-1.5 text-sm font-medium text-white hover:bg-blue-400 disabled:opacity-50 transition-colors hover:cursor-pointer",children:[p?s.jsx(ot,{className:"h-3.5 w-3.5 animate-spin",strokeWidth:2}):s.jsx(Ri,{className:"h-3.5 w-3.5",strokeWidth:2}),p?"Scanning…":"Re-scan"]}),s.jsxs("button",{type:"button",onClick:()=>L(!0),className:"flex items-center gap-1.5 rounded-lg bg-emerald-500 px-3 py-1.5 text-sm font-medium text-white hover:bg-emerald-400 transition-colors hover:cursor-pointer",children:[s.jsx(_t,{className:"h-3.5 w-3.5",strokeWidth:2}),"Add Endpoint"]})]})]}),v&&s.jsxs("div",{className:"flex items-center gap-2 border-b border-red-500/20 bg-red-500/[0.06] px-6 py-2 text-xs text-red-400",children:[s.jsx(Ht,{className:"h-3.5 w-3.5 shrink-0",strokeWidth:2}),v,s.jsx("button",{type:"button",onClick:()=>N(""),className:"ml-auto hover:cursor-pointer",children:s.jsx(Ct,{className:"h-3.5 w-3.5",strokeWidth:2})})]}),s.jsxs("div",{className:"flex flex-1 flex-col",children:[u&&s.jsx("div",{className:"space-y-2 p-6",children:[1,2,3,4].map(ee=>s.jsx("div",{className:"h-10 animate-pulse rounded-lg border border-[var(--border)] bg-[var(--bg-overlay)]",style:{opacity:1-ee*.18}},ee))}),!u&&m&&s.jsxs("div",{className:"flex flex-col items-center gap-4 m-6 rounded-lg border border-red-500/20 bg-red-500/[0.06] p-10 text-center",children:[s.jsx(Ht,{className:"h-8 w-8 text-red-400",strokeWidth:2}),s.jsx("p",{className:"text-sm text-red-300",children:m}),s.jsx("button",{type:"button",onClick:()=>G(),className:"rounded-lg border border-red-500/20 bg-red-500/10 px-4 py-1.5 text-xs text-red-400 hover:bg-red-500/20 transition-colors hover:cursor-pointer",children:"Retry"})]}),!u&&!m&&!o&&s.jsx(Y3,{onScan:X,scanning:p,error:v}),!u&&!m&&o&&C==="graph"&&s.jsx("div",{className:"flex-1 overflow-auto p-6",children:s.jsx(L3,{endpoints:K})}),!u&&!m&&o&&C==="list"&&s.jsxs("div",{className:"flex flex-1 flex-col",children:[s.jsxs("div",{className:"flex items-center gap-3 border-b border-[var(--border)] px-6 py-3",children:[s.jsx("input",{value:M,onChange:ee=>A(ee.target.value),placeholder:"Filter by path, method or handler…",className:"w-full max-w-sm rounded-lg border border-[var(--border)] bg-[var(--bg-overlay)] py-1.5 px-3 text-xs text-[var(--text-secondary)] placeholder-[var(--text-faint)] outline-none focus:border-blue-500/50 focus:bg-[var(--bg-overlay-md)] transition-all"}),M&&s.jsx("button",{type:"button",onClick:()=>A(""),className:"text-[var(--text-faint)] hover:text-[var(--text-secondary)] hover:cursor-pointer",children:s.jsx(Ct,{className:"h-3.5 w-3.5",strokeWidth:2})}),s.jsxs("span",{className:"ml-auto text-[10px] text-[var(--text-faint)]",children:[K.length," endpoint",K.length!==1?"s":""]})]}),s.jsxs("div",{className:"flex-1 overflow-y-auto max-h-[calc(100vh-170px)] divide-y divide-[var(--border)]",children:[Array.from(ne.entries()).map(([ee,se])=>s.jsx(q3,{prefix:ee,endpoints:se,onUpdate:le,onInspect:S=>n?.(S),onViewTraces:r?S=>r({endpointPath:S}):void 0,onEdit:S=>R(S)},ee)),K.length===0&&s.jsxs("div",{className:"flex flex-col items-center gap-2 py-12 text-center",children:[s.jsxs("p",{className:"text-sm text-[var(--text-muted)]",children:['No endpoints match "',M,'"']}),s.jsx("button",{type:"button",onClick:()=>A(""),className:"text-xs text-blue-400 hover:text-blue-300 transition-colors hover:cursor-pointer",children:"Clear filter"})]})]}),s.jsxs("div",{className:"flex items-center gap-1.5 border-t border-[var(--border)] px-6 py-2.5 text-[10px] text-[var(--text-faint)]",children:["Generated ",new Date(o.generatedAt).toLocaleString(),s.jsx("span",{className:"ml-auto",children:s.jsx("button",{type:"button",onClick:()=>G(!0),className:"text-[var(--text-faint)] hover:text-[var(--text-secondary)] transition-colors hover:cursor-pointer",children:"Refresh"})})]})]})]}),s.jsx(V3,{open:Y,onClose:()=>L(!1),onCreated:I}),T&&s.jsx(G3,{endpoint:T,onClose:()=>R(null),onSaved:ee=>{i(se=>se&&{...se,endpoints:se.endpoints.map(S=>S.id===ee.id?ee:S)}),R(null)}})]})}const g0={GET:{bg:"bg-emerald-500/10",text:"text-emerald-400",border:"border-emerald-500/30"},POST:{bg:"bg-blue-500/10",text:"text-blue-400",border:"border-blue-500/30"},PUT:{bg:"bg-amber-500/10",text:"text-amber-400",border:"border-amber-500/30"},PATCH:{bg:"bg-orange-500/10",text:"text-orange-400",border:"border-orange-500/30"},DELETE:{bg:"bg-red-500/10",text:"text-red-400",border:"border-red-500/30"},HEAD:{bg:"bg-[var(--bg-overlay-md)]",text:"text-[var(--text-muted)]",border:"border-[var(--border)]"},OPTIONS:{bg:"bg-purple-500/10",text:"text-purple-400",border:"border-purple-500/30"}};function Z3(n){return g0[n.toUpperCase()]??g0.GET}function Qd({method:n,size:r="md"}){const o=Z3(n);return s.jsx("span",{className:`inline-flex items-center rounded font-medium tracking-widest border ${o.bg} ${o.text} ${o.border} ${r==="sm"?"px-1.5 py-0.5 text-[10px]":"px-2 py-0.5 text-[11px]"}`,children:n.toUpperCase()})}function y0(n,r,o){const i=n.toLowerCase();return i.includes("email")?"user@example.com":i.includes("name")?"Jane Doe":i.includes("username")?"jane_doe":i.includes("password")?"P@ssw0rd123!":i.includes("phone")?"+14155552671":i.includes("url")?"https://example.com":i.includes("id")?Math.random().toString(36).slice(2,10):i.includes("date")||o==="date"?new Date().toISOString().split("T")[0]:i.includes("time")||o==="date-time"?new Date().toISOString():r==="integer"||r==="number"?String(Math.floor(Math.random()*100)+1):r==="boolean"?"true":r==="array"?"[]":r==="object"?"{}":`fake_${i}`}function ul({children:n,className:r=""}){return s.jsx("div",{className:`rounded-lg border border-[var(--border)] bg-[var(--bg-overlay)] overflow-hidden ${r}`,children:n})}function Ar({icon:n,label:r,count:o,action:i}){return s.jsxs("div",{className:"flex items-center gap-2.5 border-b border-[var(--border)] px-4 py-2.5 bg-[var(--bg-overlay-md)]",children:[s.jsx(n,{className:"h-[15px] w-[15px] text-blue-400",strokeWidth:2}),s.jsx("span",{className:"text-[11px] font-semibold tracking-wider text-[var(--text-faint)] uppercase",children:r}),o!==void 0&&s.jsx("span",{className:"rounded-full border border-[var(--border)] bg-[var(--bg-overlay)] px-2 py-0.5 text-[10px] text-[var(--text-muted)]",children:o}),i&&s.jsx("div",{className:"ml-auto",children:i})]})}function W3({endpoint:n}){const[r,o]=j.useState(null),[i,u]=j.useState(1),[f,h]=j.useState(!1),[g,p]=j.useState(""),x=j.useCallback(async()=>{if(n.source){h(!0),p(""),o(null);try{const N=await fetch(`/api/model/source?file=${encodeURIComponent(n.source.file)}&line=${n.source.line}`);if(!N.ok){if((N.headers.get("content-type")??"").includes("application/json")){const M=await N.json().catch(()=>({}));throw new Error(M.error??`HTTP ${N.status}`)}throw new Error(`HTTP ${N.status}`)}if((N.headers.get("content-type")??"").includes("application/json")){const _=await N.json();o(_.source??_.content??""),u(_.startLine??1)}else o(await N.text()),u(1)}catch(N){p(N.message)}finally{h(!1)}}},[n]);if(j.useEffect(()=>{x()},[x]),!n.source)return null;const m=n.source.file.split(/[/\\]/).slice(-3).join("/"),b=r?r.split(`
|
|
404
|
-
`):[],v=n.source.line-i;return s.jsxs(ul,{children:[s.jsxs("div",{className:"flex items-center gap-2.5 border-b border-[var(--border)] px-4 py-2.5 bg-[var(--bg-overlay-md)]",children:[s.jsx(Kd,{className:"h-[15px] w-[15px] text-blue-400",strokeWidth:2}),s.jsx("span",{className:"text-[11px] font-semibold tracking-wider text-[var(--text-faint)] uppercase",children:"Source"}),s.jsx("span",{className:"ml-2 font-mono text-[11px] text-[var(--text-muted)] truncate",children:m}),s.jsxs("span",{className:"rounded border border-[var(--border)] bg-[var(--bg-overlay)] px-1.5 py-0.5 font-mono text-[10px] text-[var(--text-secondary)]",children:[":",n.source.line]}),s.jsx("button",{type:"button",onClick:x,disabled:f,className:"ml-auto flex h-6 w-6 items-center justify-center rounded-lg border border-[var(--border)] bg-[var(--bg-overlay)] text-[var(--text-muted)] hover:bg-[var(--bg-overlay-md)] hover:text-[var(--text-secondary)] transition-colors hover:cursor-pointer",children:s.jsx(na,{className:`h-3 w-3 ${f?"animate-spin":""}`,strokeWidth:2})})]}),s.jsxs("div",{className:"relative bg-[var(--sidebar-bg)]",children:[f&&s.jsxs("div",{className:"flex items-center gap-2 px-4 py-4 text-[11px] text-[var(--text-muted)]",children:[s.jsx(ot,{className:"h-3.5 w-3.5 animate-spin",strokeWidth:2})," Loading source…"]}),g&&s.jsxs("div",{className:"flex items-start gap-2 px-4 py-3 text-[11px] text-red-400",children:[s.jsx(Ht,{className:"h-3.5 w-3.5 mt-0.5 shrink-0",strokeWidth:2}),s.jsxs("span",{children:["Source unavailable — ",g]})]}),r&&!f&&s.jsx("div",{className:"overflow-auto max-h-[340px]",children:s.jsx("table",{className:"w-full border-collapse",children:s.jsx("tbody",{children:b.map((N,C)=>{const _=i+C,M=C===v;return s.jsxs("tr",{className:M?"bg-blue-500/[0.08]":"hover:bg-[var(--bg-overlay-md)]",children:[s.jsx("td",{className:`select-none w-12 px-3 py-0 text-right font-mono text-[10px] border-r border-[var(--border)] leading-5 ${M?"text-blue-400":"text-[var(--text-faint)]"}`,children:_}),s.jsx("td",{className:`px-4 py-0 font-mono text-[11px] whitespace-pre leading-5 ${M?"text-[var(--text-primary)]":"text-[var(--text-muted)]"}`,children:N||" "})]},C)})})})})]})]})}function Q3({endpoint:n}){const[r,o]=j.useState([]),[i,u]=j.useState(!0),[f,h]=j.useState("");j.useEffect(()=>{u(!0),h(""),o([]),fetch(`/api/model/related?id=${encodeURIComponent(n.id)}`).then(p=>{const x=p.headers.get("content-type")??"";if(!p.ok||!x.includes("application/json"))throw new Error(`HTTP ${p.status}`);return p.json()}).then(p=>o(p?.files??[])).catch(p=>h(p.message)).finally(()=>u(!1))},[n.id]);const g={ts:"text-blue-400",tsx:"text-cyan-400",js:"text-amber-400",jsx:"text-amber-300",json:"text-emerald-400"};return s.jsxs(ul,{children:[s.jsx(Ar,{icon:Jd,label:"Related Files",count:!i&&!f?r.length:void 0}),s.jsxs("div",{className:"divide-y divide-[var(--border)]",children:[i&&s.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 text-[11px] text-[var(--text-muted)]",children:[s.jsx(ot,{className:"h-3.5 w-3.5 animate-spin",strokeWidth:2})," Resolving files…"]}),!i&&f&&s.jsxs("div",{className:"flex items-start gap-2 px-4 py-3 text-[11px] text-red-400",children:[s.jsx(Ht,{className:"h-3.5 w-3.5 mt-0.5 shrink-0",strokeWidth:2}),s.jsxs("span",{children:["Could not resolve — ",f]})]}),!i&&!f&&r.length===0&&s.jsx("p",{className:"px-4 py-4 text-[12px] text-[var(--text-faint)] italic",children:"No related files resolved"}),r.map(p=>{const x=p.split(/[/\\]/),m=x.pop()??p,b=x.slice(-2).join("/"),v=m.split(".").pop()??"",N=g[v]??"text-[var(--text-faint)]";return s.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5 hover:bg-[var(--bg-overlay-md)] transition-colors",children:[s.jsx(Vi,{className:`h-[15px] w-[15px] shrink-0 ${N}`,strokeWidth:2}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"text-[13px] text-[var(--text-secondary)] truncate",children:m}),b&&s.jsx("p",{className:"text-[10px] text-[var(--text-faint)] truncate font-mono",children:b})]}),s.jsxs("span",{className:`shrink-0 rounded border border-[var(--border)] bg-[var(--bg-overlay-md)] px-1.5 py-0.5 text-[10px] font-mono ${N}`,children:[".",v]})]},p)})]})]})}function b0({endpoint:n}){const[r,o]=j.useState("fake"),[i,u]=j.useState(""),[f,h]=j.useState({}),[g,p]=j.useState(!1),[x,m]=j.useState(null),[b,v]=j.useState("http://localhost:3000"),[N,C]=j.useState([]),[_,M]=j.useState(null),[A,Y]=j.useState(!1);j.useEffect(()=>{fetch("/api/model/environments").then(K=>K.ok?K.json():null).then(K=>{if(!K)return;C(K.environments??[]);const ne=K.defaultEnvironment??K.environments?.find(se=>se.default)?.name??K.environments?.[0]?.name??null;M(ne);const ee=(K.environments??[]).find(se=>se.name===ne);ee&&v(ee.baseUrl)}).catch(()=>{}).finally(()=>Y(!0))},[]);const L=n.requestBody?.fields??{},T=(n.security?.length??0)>0,R=["POST","PUT","PATCH"].includes(n.method.toUpperCase());j.useEffect(()=>{m(null),h({})},[n.id]);const G=()=>{const K={};for(const[ne,ee]of Object.entries(L))K[ne]=y0(ne,ee.type,ee.format);return K},X=()=>{const K={};for(const[ne,ee]of Object.entries(L)){const se=f[ne]??"";se&&(ee.type==="integer"||ee.type==="number"?K[ne]=Number(se):ee.type==="boolean"?K[ne]=se.toLowerCase()==="true":K[ne]=se)}return K},le=async()=>{p(!0),m(null);const K=Date.now();try{const ne=r==="fake"?G():X(),ee={};(R||r==="fake")&&(ee["Content-Type"]="application/json"),i&&(ee.Authorization=`Bearer ${i}`);const se=`${b}${n.path}`,S=await fetch(se,{method:n.method.toUpperCase(),headers:ee,body:R?JSON.stringify(ne):void 0}),U=Date.now()-K;let k;try{k=await S.json()}catch{k=await S.text().catch(()=>"(no body)")}m({status:S.status,body:k,durationMs:U})}catch(ne){m({status:0,body:null,durationMs:Date.now()-K,error:ne.message})}finally{p(!1)}},I=x&&x.status>=200&&x.status<300;return s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-[var(--border)] bg-[var(--bg-overlay)] px-3 py-2",children:[s.jsx(Qd,{method:n.method,size:"sm"}),s.jsx("code",{className:"font-mono text-[12px] text-[var(--text-secondary)] truncate",children:n.path})]}),s.jsx("p",{className:"hidden",children:A}),s.jsxs("div",{className:"flex items-center gap-2 rounded-xl border border-[var(--border)] bg-[var(--bg-overlay)] p-1",children:[s.jsxs("button",{type:"button",onClick:()=>o("fake"),className:`flex flex-1 items-center justify-center gap-1.5 rounded-lg py-1.5 text-[11px] font-medium transition-all duration-200 hover:cursor-pointer ${r==="fake"?"bg-blue-500/15 text-blue-400 shadow-sm":"text-[var(--text-faint)] hover:text-[var(--text-muted)]"}`,children:[s.jsx(aa,{className:"h-3 w-3 shrink-0",strokeWidth:2}),"Fake Data"]}),s.jsxs("button",{type:"button",onClick:()=>o("real"),className:`flex flex-1 items-center justify-center gap-1.5 rounded-lg py-1.5 text-[11px] font-medium transition-all duration-200 hover:cursor-pointer ${r==="real"?"bg-blue-500/15 text-blue-400 shadow-sm":"text-[var(--text-faint)] hover:text-[var(--text-muted)]"}`,children:[s.jsx(Cd,{className:"h-3 w-3 shrink-0",strokeWidth:2}),"Real Data"]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-[var(--text-faint)]",children:"Base URL"}),N.length>0?s.jsx("div",{className:"rounded-lg border border-[var(--border)] bg-[var(--bg-overlay)] overflow-hidden",children:N.map(K=>{const ne=_===K.name;return s.jsxs("button",{type:"button",onClick:()=>{M(K.name),v(K.baseUrl)},className:`group flex w-full items-center gap-2.5 px-3 py-2 text-left transition-colors hover:cursor-pointer ${ne?"bg-blue-500/10":"hover:bg-[var(--bg-overlay-md)]"}`,style:{borderTop:"1px solid var(--border)"},children:[s.jsx("div",{className:"flex h-4 w-4 shrink-0 items-center justify-center rounded-full border-2 transition-colors",style:{borderColor:ne?"#60a5fa":"var(--border)",backgroundColor:ne?"#60a5fa22":"transparent"},children:ne&&s.jsx(xt,{className:"h-2.5 w-2.5 text-blue-400",strokeWidth:3})}),s.jsx(vl,{className:`h-3 w-3 shrink-0 ${ne?"text-blue-400":"text-[var(--text-faint)]"}`,strokeWidth:2}),s.jsx("span",{className:`text-[11px] w-14 shrink-0 font-medium ${ne?"text-blue-400":"text-[var(--text-muted)]"}`,children:K.name}),s.jsx("span",{className:"font-mono text-[11px] text-[var(--text-faint)] truncate",children:K.baseUrl})]},K.name)})}):s.jsx("input",{value:b,onChange:K=>v(K.target.value),className:"w-full rounded-lg border border-[var(--border)] bg-[var(--bg-overlay)] px-3 py-1.5 font-mono text-[12px] text-[var(--text-primary)] outline-none focus:border-blue-500/50 focus:bg-[var(--bg-overlay-md)] placeholder-[var(--text-faint)] transition-colors",placeholder:"http://localhost:3000"})]}),(T||r==="real")&&s.jsxs("label",{className:"flex flex-col gap-1.5",children:[s.jsxs("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-[var(--text-faint)] flex items-center gap-1",children:[s.jsx(T0,{className:"h-3 w-3",strokeWidth:2})," Bearer Token"]}),s.jsx("input",{type:"password",value:i,onChange:K=>u(K.target.value),className:"w-full rounded-lg border border-amber-500/25 bg-amber-500/[0.04] px-3 py-1.5 font-mono text-[12px] text-[var(--text-primary)] outline-none focus:border-amber-400/50 focus:bg-amber-500/[0.07] placeholder-[var(--text-faint)] transition-colors",placeholder:"Optional"})]}),r==="fake"&&Object.keys(L).length>0&&s.jsxs("div",{children:[s.jsxs("p",{className:"mb-2 text-[10px] font-semibold uppercase tracking-wider text-[var(--text-faint)] flex items-center gap-1.5",children:[s.jsx(aa,{className:"h-3 w-3 text-blue-400",strokeWidth:2})," Auto-generated body"]}),s.jsx("div",{className:"space-y-1",children:Object.entries(L).map(([K,ne])=>s.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-[var(--border)] bg-[var(--bg-overlay)] px-3 py-2",children:[s.jsx("span",{className:"text-[11px] text-[var(--text-secondary)] w-20 truncate shrink-0",children:K}),s.jsx("span",{className:"text-[11px] text-[var(--text-faint)] shrink-0",children:ne.type}),s.jsx("span",{className:"ml-auto font-mono text-[11px] text-blue-400/80 truncate",children:y0(K,ne.type,ne.format)})]},K))})]}),r==="real"&&Object.keys(L).length>0&&s.jsxs("div",{children:[s.jsxs("p",{className:"mb-2 text-[10px] font-semibold uppercase tracking-wider text-[var(--text-faint)] flex items-center gap-1.5",children:[s.jsx(Cd,{className:"h-3 w-3 text-blue-400",strokeWidth:2})," Request body"]}),s.jsx("div",{className:"space-y-2",children:Object.entries(L).map(([K,ne])=>s.jsxs("label",{className:"flex flex-col gap-1",children:[s.jsxs("span",{className:"text-[11px] text-[var(--text-secondary)]",children:[K,ne.required&&s.jsx("span",{className:"ml-1 text-[10px] text-rose-400",children:"*"})]}),s.jsx("input",{value:f[K]??"",onChange:ee=>h(se=>({...se,[K]:ee.target.value})),placeholder:`${ne.type}${ne.format?` (${ne.format})`:""}`,className:"rounded-lg border border-[var(--border)] bg-[var(--bg-overlay)] px-3 py-1.5 font-mono text-[12px] text-[var(--text-primary)] outline-none focus:border-blue-500/50 focus:bg-[var(--bg-overlay-md)] placeholder-[var(--text-faint)] transition-colors"})]},K))})]}),r==="real"&&Object.keys(L).length===0&&!R&&s.jsxs("p",{className:"text-[12px] text-[var(--text-faint)] italic",children:["No body required for ",n.method.toUpperCase()," requests."]}),s.jsxs("button",{type:"button",onClick:le,disabled:g,className:"flex w-full items-center justify-center gap-2 rounded-lg border border-[var(--border)] bg-blue-500 py-2 text-[12px] font-medium text-white hover:bg-blue-400 disabled:opacity-50 transition-colors hover:cursor-pointer",children:[g?s.jsx(ot,{className:"h-[15px] w-[15px] animate-spin",strokeWidth:2}):s.jsx(_d,{className:"h-[15px] w-[15px]",strokeWidth:2}),g?"Sending…":`Run ${r==="fake"?"with Fake Data":"with Real Data"}`]}),x&&s.jsxs("div",{className:`rounded-lg border overflow-hidden ${I?"border-emerald-500/25 bg-emerald-500/[0.05]":"border-red-500/25 bg-red-500/[0.05]"}`,children:[s.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b border-[var(--border)]",children:[I?s.jsx(xt,{className:"h-[15px] w-[15px] text-emerald-400",strokeWidth:2}):s.jsx(Ht,{className:"h-[15px] w-[15px] text-red-400",strokeWidth:2}),s.jsx("span",{className:`text-[12px] font-medium ${I?"text-emerald-400":"text-red-400"}`,children:x.status>0?x.status:"Error"}),s.jsxs("span",{className:"text-[11px] text-[var(--text-faint)]",children:[x.durationMs,"ms"]}),s.jsx("button",{type:"button",onClick:()=>m(null),className:"ml-auto flex h-6 w-6 items-center justify-center rounded-lg border border-[var(--border)] bg-[var(--bg-overlay)] text-[var(--text-faint)] hover:text-[var(--text-secondary)] transition-colors hover:cursor-pointer",children:s.jsx(Ct,{className:"h-3 w-3",strokeWidth:2})})]}),x.error&&s.jsx("p",{className:"px-3 py-2.5 text-[12px] text-red-400",children:x.error}),!x.error&&x.body!=null&&s.jsx("pre",{className:"overflow-auto max-h-72 p-3 text-[11px] text-[var(--text-muted)] whitespace-pre-wrap break-all leading-5",children:typeof x.body=="string"?x.body:JSON.stringify(x.body,null,2)})]})]})}const K3=({endpoint:n,onBack:r})=>{if(!n)return s.jsxs("div",{className:"flex min-h-full w-full flex-col items-center justify-center gap-5 text-center p-12",children:[s.jsxs("div",{className:"relative flex h-16 w-16 items-center justify-center",children:[s.jsx("div",{className:"absolute inset-0 rounded-full bg-blue-500/10 blur-xl"}),s.jsx("div",{className:"relative flex h-16 w-16 items-center justify-center rounded-lg border border-[var(--border)] bg-[var(--bg-overlay)] text-blue-400",children:s.jsx(Kd,{className:"h-7 w-7",strokeWidth:2})})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[13.5px] font-medium text-[var(--text-primary)]",children:"No endpoint selected"}),s.jsxs("p",{className:"mt-1 text-[12px] text-[var(--text-muted)]",children:["Click ",s.jsx("span",{className:"text-blue-400 font-medium",children:"INSPECT"})," on any endpoint in the Model view."]})]}),s.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-1.5 rounded-lg border border-[var(--border)] bg-[var(--bg-overlay)] px-4 py-2 text-[12px] text-[var(--text-muted)] hover:bg-[var(--bg-overlay-md)] hover:text-[var(--text-secondary)] transition-colors hover:cursor-pointer",children:[s.jsx(dm,{className:"h-[15px] w-[15px]",strokeWidth:2})," Back to Model"]})]});const o=n.requestBody?.fields??{},i=n.responses??{},u=Object.keys(o).length>0,f=Object.keys(i).length>0,h=(n.security?.length??0)>0,g=(n.middleware?.length??0)>0,p=n.source?n.source.file.split(/[/\\]/).slice(-3).join("/")+":"+n.source.line:null;return s.jsxs("div",{className:"flex min-h-full w-full",children:[s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[s.jsxs("div",{className:"flex items-center gap-4 border-b border-[var(--border)] px-6 py-5",children:[s.jsx("button",{type:"button",onClick:r,className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border border-[var(--border)] bg-[var(--bg-overlay)] text-[var(--text-muted)] hover:bg-[var(--bg-overlay-md)] hover:text-[var(--text-secondary)] transition-colors hover:cursor-pointer",children:s.jsx(dm,{className:"h-[15px] w-[15px]",strokeWidth:2})}),s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[s.jsx(Qd,{method:n.method}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("h1",{className:"text-[13.5px] font-medium text-[var(--text-primary)] leading-none truncate",children:n.path}),n.handlerName&&s.jsx("p",{className:"mt-0.5 text-[11px] text-[var(--text-muted)] truncate",children:n.handlerName})]})]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[h&&s.jsxs("span",{className:"flex items-center gap-1.5 rounded-lg border border-amber-500/25 bg-amber-500/[0.07] px-2.5 py-1 text-[11px] text-amber-400",children:[s.jsx(Ya,{className:"h-[15px] w-[15px]",strokeWidth:2}),n.security[0].scheme]}),p&&s.jsx("span",{className:"hidden sm:block font-mono text-[11px] text-[var(--text-faint)] truncate max-w-[200px]",children:p})]})]}),s.jsxs("div",{className:"flex-1 overflow-auto p-6 space-y-4",children:[s.jsxs(ul,{children:[s.jsx(Ar,{icon:Jd,label:"Details"}),s.jsxs("div",{className:"p-4 grid grid-cols-2 sm:grid-cols-3 gap-4",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-[var(--text-faint)] mb-1.5",children:"Method"}),s.jsx(Qd,{method:n.method})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-[var(--text-faint)] mb-1.5",children:"Path"}),s.jsx("code",{className:"font-mono text-[12px] text-[var(--text-secondary)]",children:n.path})]}),n.handlerName&&s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-[var(--text-faint)] mb-1.5",children:"Handler"}),s.jsx("code",{className:"font-mono text-[12px] text-[var(--text-muted)]",children:n.handlerName})]}),n.source&&s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-[var(--text-faint)] mb-1.5",children:"Source"}),s.jsx("code",{className:"font-mono text-[11px] text-[var(--text-faint)]",children:p})]}),n.requestBody?.contentType&&s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-[var(--text-faint)] mb-1.5",children:"Content-Type"}),s.jsx("code",{className:"font-mono text-[11px] text-[var(--text-faint)]",children:n.requestBody.contentType})]}),g&&s.jsxs("div",{className:"col-span-2 sm:col-span-3",children:[s.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-[var(--text-faint)] mb-1.5",children:"Middleware"}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:n.middleware.map((x,m)=>s.jsx("span",{className:"rounded-lg border border-[var(--border)] bg-[var(--bg-overlay-md)] px-2.5 py-0.5 text-[11px] text-[var(--text-secondary)]",children:x.name},m))})]})]})]}),u&&s.jsxs(ul,{children:[s.jsx(Ar,{icon:Cd,label:"Request Body",count:Object.keys(o).length}),s.jsxs("div",{className:"p-4 space-y-1.5",children:[s.jsxs("div",{className:"flex items-center gap-4 px-3 py-1.5 text-[10px] font-semibold uppercase tracking-wider text-[var(--text-faint)]",children:[s.jsx("span",{className:"w-28",children:"Field"}),s.jsx("span",{className:"w-16",children:"Type"}),s.jsx("span",{children:"Format"}),s.jsx("span",{className:"ml-auto",children:"Required"})]}),Object.entries(o).map(([x,m])=>s.jsxs("div",{className:"flex items-center gap-4 rounded-lg border border-[var(--border)] bg-[var(--bg-overlay)] px-3 py-2 hover:bg-[var(--bg-overlay-md)] transition-colors",children:[s.jsx("span",{className:"w-28 shrink-0 font-mono text-[12px] text-[var(--text-primary)] truncate",children:x}),s.jsx("span",{className:"w-16 shrink-0 text-[11px] text-blue-400",children:m.type}),s.jsx("span",{className:"flex-1 text-[11px] text-[var(--text-faint)]",children:m.format??"—"}),m.required?s.jsx("span",{className:"ml-auto shrink-0 rounded border border-rose-500/25 bg-rose-500/10 px-1.5 py-0.5 text-[10px] text-rose-400",children:"required"}):s.jsx("span",{className:"ml-auto shrink-0 text-[10px] text-[var(--text-faint)]",children:"optional"})]},x))]})]}),f&&s.jsxs(ul,{children:[s.jsx(Ar,{icon:xt,label:"Responses",count:Object.keys(i).length}),s.jsx("div",{className:"p-4 space-y-1.5",children:Object.entries(i).map(([x,m])=>{const b=x.startsWith("2");return s.jsxs("div",{className:`flex items-start gap-3 rounded-lg border px-3 py-2 ${b?"border-emerald-500/20 bg-emerald-500/[0.05]":"border-red-500/20 bg-red-500/[0.05]"}`,children:[s.jsx("span",{className:`shrink-0 w-10 font-mono text-[12px] font-medium ${b?"text-emerald-400":"text-red-400"}`,children:x}),m.schema&&s.jsx("div",{className:"flex flex-wrap gap-1",children:Object.keys(m.schema).map(v=>s.jsx("span",{className:"rounded border border-[var(--border)] bg-[var(--bg-overlay-md)] px-1.5 py-0.5 font-mono text-[10px] text-[var(--text-muted)]",children:v},v))})]},x)})})]}),s.jsx(W3,{endpoint:n}),s.jsx(Q3,{endpoint:n}),s.jsxs(ul,{className:"lg:hidden",children:[s.jsx(Ar,{icon:aa,label:"Simulate Endpoint"}),s.jsx("div",{className:"p-4",children:s.jsx(b0,{endpoint:n})})]})]})]}),s.jsxs("aside",{className:"hidden lg:flex w-[400px] shrink-0 flex-col border-l border-[var(--border)] bg-[var(--sidebar-bg)]",children:[s.jsxs("div",{className:"flex items-center gap-2.5 border-b border-[var(--border)] px-5 py-[18px]",children:[s.jsx(aa,{className:"h-[15px] w-[15px] text-blue-400",strokeWidth:2}),s.jsx("span",{className:"text-[13.5px] font-medium text-[var(--text-primary)]",children:"Simulate Endpoint"})]}),s.jsx("div",{className:"flex-1 overflow-y-auto p-5",children:s.jsx(b0,{endpoint:n})})]})]})};function J3(){return s.jsxs("div",{className:"p-8",children:[s.jsx("h1",{className:"text-2xl font-semibold text-white",children:"Agents"}),s.jsx("p",{className:"mt-4 text-zinc-400",children:"This is under developnment."})]})}function I3(){return s.jsxs("div",{className:"p-8",children:[s.jsx("h1",{className:"text-2xl font-semibold text-white",children:"Tools"}),s.jsx("p",{className:"mt-4 text-zinc-400",children:"This is the Tools page."})]})}function F3(){return s.jsxs("div",{className:"p-8",children:[s.jsx("h1",{className:"text-2xl font-semibold text-white",children:"Context"}),s.jsx("p",{className:"mt-4 text-zinc-400",children:"This is the Context page."})]})}const jf="/api/memory";async function v0(){const n=await fetch(jf);if(!n.ok)throw new Error(`Failed to fetch memory (${n.status})`);return n.json()}async function P3(){try{const n=await fetch("/api/model");return n.ok?(await n.json())?.environments??[]:[]}catch{return[]}}async function e4(n,r){const o=await fetch(jf,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:n,value:r})});if(!o.ok){const i=await o.json().catch(()=>({}));throw new Error(i.error??`Failed to add entry (${o.status})`)}}async function t4(n){const r=await fetch(jf,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:n})});if(!r.ok)throw new Error(`Failed to delete entry (${r.status})`)}function j0(n){return typeof n=="object"&&n!==null?JSON.stringify(n):String(n)}function n4(n){const r=n.indexOf(":");return r!==-1?n.slice(r+1):n}function Si(n){return n.includes(":")?n.split(":")[0]:"global"}function a4({value:n}){const[r,o]=j.useState(!1),i=n.length>200?n.slice(0,200)+"…":n;return s.jsx("div",{onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),className:"cursor-pointer max-w-[300px]",children:r?s.jsx("p",{className:"text-[12px] break-all transition-colors truncate",style:{color:"var(--text-secondary)"},children:i}):s.jsx("p",{className:"text-[12px] font-mono tracking-widest select-none",style:{color:"var(--text-faint)"},children:"••••••"})})}function s4({onClose:n,onSave:r,defaultScope:o}){const[i,u]=j.useState(o?`${o}:`:""),[f,h]=j.useState(""),[g,p]=j.useState(!1),[x,m]=j.useState(""),b=j.useRef(null);j.useEffect(()=>{b.current?.focus()},[]);const v=async N=>{if(N.preventDefault(),!i.trim()){m("Key is required");return}if(f.trim()===""){m("Value is required");return}p(!0),m("");try{await r(i.trim(),f.trim()),n()}catch(C){m(C.message??"An error occurred"),p(!1)}};return s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:N=>{N.target===N.currentTarget&&n()},children:s.jsxs("div",{className:"relative w-full max-w-md rounded-lg p-6 shadow-2xl shadow-black/60",style:{border:"1px solid var(--border)",backgroundColor:"var(--sidebar-bg)"},children:[s.jsxs("div",{className:"mb-5 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-lg",style:{border:"1px solid var(--border)",backgroundColor:"var(--bg-overlay)"},children:s.jsx(_t,{className:"h-[15px] w-[15px] text-blue-400",strokeWidth:2})}),s.jsx("h2",{className:"text-[13.5px] font-medium",style:{color:"var(--text-primary)"},children:"Add Memory Entry"})]}),s.jsx("button",{onClick:n,className:"flex h-7 w-7 items-center justify-center rounded-lg transition-colors hover:cursor-pointer hover:bg-[var(--bg-overlay-md)] hover:text-[var(--text-secondary)]",style:{border:"1px solid var(--border)",backgroundColor:"var(--bg-overlay)",color:"var(--text-muted)"},children:s.jsx(Ct,{className:"h-[15px] w-[15px]",strokeWidth:2})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"mb-1.5 block text-[11px] font-semibold uppercase tracking-wider",style:{color:"var(--text-faint)"},children:"Key / Identifier"}),s.jsx("input",{ref:b,value:i,onChange:N=>u(N.target.value),placeholder:"global:myKey or myKey",className:"w-full rounded-lg px-3 py-2 text-[12px] outline-none transition-colors focus:border-blue-500/50 focus:bg-[var(--bg-overlay-md)]",style:{border:"1px solid var(--border)",backgroundColor:"var(--bg-overlay)",color:"var(--text-primary)"}}),s.jsxs("p",{className:"mt-1.5 text-[10px]",style:{color:"var(--text-faint)"},children:["Prefix with"," ",s.jsx("code",{className:"rounded px-1 py-0.5 text-[10px]",style:{border:"1px solid var(--border)",backgroundColor:"var(--bg-overlay-md)",color:"var(--text-muted)"},children:"scope:"})," ","to organise by scope (e.g."," ",s.jsx("code",{className:"rounded px-1 py-0.5 text-[10px]",style:{border:"1px solid var(--border)",backgroundColor:"var(--bg-overlay-md)",color:"var(--text-muted)"},children:"user:name"}),"). Defaults to"," ",s.jsx("code",{className:"rounded px-1 py-0.5 text-[10px]",style:{border:"1px solid var(--border)",backgroundColor:"var(--bg-overlay-md)",color:"var(--text-muted)"},children:"global"}),"."]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"mb-1.5 block text-[11px] font-semibold uppercase tracking-wider",style:{color:"var(--text-faint)"},children:"Value"}),s.jsx("textarea",{value:f,onChange:N=>h(N.target.value),placeholder:"Enter a string value…",rows:4,className:"w-full resize-none rounded-lg px-3 py-2 text-[12px] outline-none transition-colors focus:border-blue-500/50 focus:bg-[var(--bg-overlay-md)]",style:{border:"1px solid var(--border)",backgroundColor:"var(--bg-overlay)",color:"var(--text-primary)"}})]}),x&&s.jsx("div",{className:"flex items-center gap-2 rounded-lg border border-red-500/20 bg-red-500/[0.06] px-3 py-2.5",children:s.jsx("p",{className:"text-[12px] text-red-400",children:x})}),s.jsxs("div",{className:"flex items-center justify-end gap-2 pt-1",children:[s.jsx("button",{type:"button",onClick:n,className:"rounded-lg px-4 py-2 text-[12px] transition-colors hover:cursor-pointer hover:bg-[var(--bg-overlay-md)] hover:text-[var(--text-secondary)]",style:{border:"1px solid var(--border)",backgroundColor:"var(--bg-overlay)",color:"var(--text-muted)"},children:"Cancel"}),s.jsxs("button",{onClick:v,disabled:g,className:"flex items-center gap-2 rounded-lg bg-blue-500 px-4 py-2 text-[12px] font-medium text-white transition-colors hover:cursor-pointer hover:bg-blue-400 disabled:cursor-not-allowed disabled:opacity-50",children:[g&&s.jsx(ot,{className:"h-[15px] w-[15px] animate-spin",strokeWidth:2}),g?"Saving…":"Save Entry"]})]})]})]})})}function l4({onClose:n,onSave:r}){const[o,i]=j.useState(""),[u,f]=j.useState(""),h=j.useRef(null);j.useEffect(()=>{h.current?.focus()},[]);const g=p=>{p.preventDefault();const x=o.trim().toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"");if(!x){f("Enter a valid scope name");return}r(x),n()};return s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:p=>{p.target===p.currentTarget&&n()},children:s.jsxs("div",{className:"relative w-full max-w-sm rounded-lg p-6 shadow-2xl shadow-black/60",style:{border:"1px solid var(--border)",backgroundColor:"var(--sidebar-bg)"},children:[s.jsxs("div",{className:"mb-5 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-lg",style:{border:"1px solid var(--border)",backgroundColor:"var(--bg-overlay)"},children:s.jsx(_t,{className:"h-[15px] w-[15px] text-blue-400",strokeWidth:2})}),s.jsx("h2",{className:"text-[13.5px] font-medium",style:{color:"var(--text-primary)"},children:"Add Scope"})]}),s.jsx("button",{onClick:n,className:"flex h-7 w-7 items-center justify-center rounded-lg transition-colors hover:cursor-pointer hover:bg-[var(--bg-overlay-md)]",style:{border:"1px solid var(--border)",backgroundColor:"var(--bg-overlay)",color:"var(--text-muted)"},children:s.jsx(Ct,{className:"h-[15px] w-[15px]",strokeWidth:2})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"mb-1.5 block text-[11px] font-semibold uppercase tracking-wider",style:{color:"var(--text-faint)"},children:"Scope Name"}),s.jsx("input",{ref:h,value:o,onChange:p=>{i(p.target.value),f("")},placeholder:"e.g. session, user, cart",className:"w-full rounded-lg px-3 py-2 text-[12px] outline-none transition-colors focus:border-blue-500/50",style:{border:"1px solid var(--border)",backgroundColor:"var(--bg-overlay)",color:"var(--text-primary)"}}),s.jsxs("p",{className:"mt-1.5 text-[10px]",style:{color:"var(--text-faint)"},children:["Memory entries under this scope will be keyed as"," ",s.jsxs("code",{className:"rounded px-1 py-0.5 text-[10px]",style:{border:"1px solid var(--border)",backgroundColor:"var(--bg-overlay-md)",color:"var(--text-muted)"},children:[o.trim()?o.trim().toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,""):"scope",":key"]})]})]}),u&&s.jsx("p",{className:"text-[12px] text-red-400",children:u}),s.jsxs("div",{className:"flex items-center justify-end gap-2 pt-1",children:[s.jsx("button",{type:"button",onClick:n,className:"rounded-lg px-4 py-2 text-[12px] transition-colors hover:cursor-pointer hover:bg-[var(--bg-overlay-md)]",style:{border:"1px solid var(--border)",backgroundColor:"var(--bg-overlay)",color:"var(--text-muted)"},children:"Cancel"}),s.jsxs("button",{onClick:g,className:"flex items-center gap-2 rounded-lg bg-blue-500 px-4 py-2 text-[12px] font-medium text-white transition-colors hover:cursor-pointer hover:bg-blue-400",children:[s.jsx(xt,{className:"h-[14px] w-[14px]",strokeWidth:2})," Create Scope"]})]})]})]})})}const r4={workflow:Td,global:A0},o4={workflow:{border:"border-blue-500/20",bg:"bg-blue-500/5",dot:"bg-blue-500/40",text:"text-blue-400",activeBg:"bg-blue-500/15",activeBorder:"border-blue-500/40"},environment:{border:"border-emerald-500/20",bg:"bg-emerald-500/5",dot:"bg-emerald-500/40",text:"text-emerald-400",activeBg:"bg-emerald-500/15",activeBorder:"border-emerald-500/40"},global:{border:"border-[var(--border)]",bg:"bg-[var(--bg-overlay)]",dot:"bg-[var(--text-faint)]",text:"text-[var(--text-muted)]",activeBg:"bg-[var(--bg-overlay-md)]",activeBorder:"border-[var(--border)]"}},i4={border:"border-purple-500/20",bg:"bg-purple-500/5",dot:"bg-purple-500/40",text:"text-purple-400",activeBg:"bg-purple-500/15",activeBorder:"border-purple-500/40"};function py(n){return o4[n]??i4}function c4({scope:n,active:r,onClick:o}){const i=py(n.id),u=r4[n.id]??_i;return s.jsxs("button",{type:"button",onClick:o,className:`group relative flex flex-col gap-2 rounded-lg border p-3.5 text-left transition-all duration-200 hover:cursor-pointer ${r?`${i.activeBg} ${i.activeBorder}`:`${i.border} ${i.bg} hover:${i.activeBg}`}`,children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("div",{className:`flex h-7 w-7 items-center justify-center rounded-lg border ${i.border} bg-[var(--bg-overlay)]`,children:s.jsx(u,{className:`h-[14px] w-[14px] ${i.text}`,strokeWidth:2})}),r&&s.jsx("div",{className:`flex h-4 w-4 items-center justify-center rounded-full ${i.activeBg}`,children:s.jsx(xt,{className:`h-2.5 w-2.5 ${i.text}`,strokeWidth:3})})]}),s.jsxs("div",{children:[s.jsx("p",{className:`text-[12px] font-medium ${i.text}`,children:n.label}),s.jsxs("p",{className:"text-[10px]",style:{color:"var(--text-faint)"},children:[n.count," ",n.count===1?"entry":"entries"]})]})]})}function u4(){const[n,r]=j.useState([]),[o,i]=j.useState([]),[u,f]=j.useState([]),[h,g]=j.useState(null),[p,x]=j.useState(!0),[m,b]=j.useState(!1),[v,N]=j.useState(null),[C,_]=j.useState(""),[M,A]=j.useState(!1),[Y,L]=j.useState(!1),[T,R]=j.useState(null),G=j.useCallback(async(D=!1)=>{D?b(!0):x(!0),N(null);try{const[O,E]=await Promise.all([v0(),P3()]);r(O),i(E)}catch(O){N(O.message??"Could not load memory data. Is `jetic dev` running?")}finally{x(!1),b(!1)}},[]);j.useEffect(()=>{G()},[G]);const X=async D=>{R(D);try{await t4(D),r(O=>O.filter(E=>E.key!==D))}catch(O){N(O.message??"Failed to delete entry")}finally{R(null)}},le=async(D,O)=>{await e4(D,O);const E=await v0();r(E)},I=Array.from(new Set(n.map(D=>Si(D.key)))),K=D=>n.filter(O=>Si(O.key)===D).length,ne=[{id:"workflow",label:"Workflow",count:K("workflow"),isBuiltIn:!0},...o.map(D=>({id:`environment.${D.name}`,label:D.name,count:K(`environment.${D.name}`),isBuiltIn:!0}))],ee=new Set(["workflow",...o.map(D=>`environment.${D.name}`)]),se=I.filter(D=>!ee.has(D)&&D!=="global"),S=Array.from(new Set([...u,...se])),U=[...ne,...S.map(D=>({id:D,label:D.charAt(0).toUpperCase()+D.slice(1),count:K(D),isCustom:!0})),{id:"global",label:"Global",count:K("global"),isBuiltIn:!0}],k=h?n.filter(D=>Si(D.key)===h):n,H=k.filter(D=>!C||D.key.toLowerCase().includes(C.toLowerCase())||j0(D.value).toLowerCase().includes(C.toLowerCase()));return s.jsxs("div",{className:"flex h-full w-full flex-col overflow-hidden",children:[s.jsxs("div",{className:"flex items-center justify-between px-6 py-5",style:{borderBottom:"1px solid var(--border)"},children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-[15px] font-medium leading-none",style:{color:"var(--text-primary)"},children:"Memory"}),s.jsx("p",{className:"mt-0.5 text-[11px]",style:{color:"var(--text-muted)"},children:p?"Loading…":h?`${H.length} entries in ${h}`:`${n.length} entr${n.length===1?"y":"ies"} stored`})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("button",{onClick:()=>G(!0),disabled:m||p,title:"Refresh",className:"flex h-8 w-8 items-center justify-center rounded-lg transition-colors hover:cursor-pointer hover:bg-[var(--bg-overlay-md)] hover:text-[var(--text-secondary)] disabled:opacity-40",style:{border:"1px solid var(--border)",backgroundColor:"var(--bg-overlay)",color:"var(--text-muted)"},children:s.jsx(na,{className:`h-[15px] w-[15px] ${m?"animate-spin":""}`,strokeWidth:2})}),s.jsxs("button",{onClick:()=>A(!0),className:"flex items-center gap-1.5 rounded-lg bg-blue-500 px-3 py-1.5 text-[12px] font-medium text-white transition-colors hover:cursor-pointer hover:bg-blue-400",children:[s.jsx(_t,{className:"h-[15px] w-[15px]",strokeWidth:2}),"Add Entry"]})]})]}),s.jsxs("div",{className:"flex flex-1 flex-col gap-4 overflow-y-auto p-6",children:[!p&&!v&&s.jsxs("div",{children:[s.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[s.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-faint)"},children:"Scopes"}),s.jsxs("button",{onClick:()=>L(!0),className:"flex items-center gap-1 rounded-lg px-2 py-1 text-[10px] font-medium transition-colors hover:cursor-pointer hover:bg-[var(--bg-overlay-md)]",style:{border:"1px solid var(--border)",color:"var(--text-faint)"},children:[s.jsx(_t,{className:"h-3 w-3",strokeWidth:2})," Add Scope"]})]}),s.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5",children:U.map(D=>s.jsx(c4,{scope:D,active:h===D.id,onClick:()=>g(O=>O===D.id?null:D.id)},D.id))}),h&&s.jsx("button",{type:"button",onClick:()=>g(null),className:"mt-2 text-[11px] transition-colors hover:cursor-pointer hover:text-blue-300",style:{color:"var(--text-faint)"},children:"← Show all scopes"})]}),!p&&!v&&s.jsx("div",{style:{borderTop:"1px solid var(--border)"}}),!p&&n.length>0&&s.jsxs("div",{className:"relative",children:[s.jsx(zi,{className:"absolute left-3 top-1/2 h-[15px] w-[15px] -translate-y-1/2",strokeWidth:2,style:{color:"var(--text-faint)"}}),s.jsx("input",{value:C,onChange:D=>_(D.target.value),placeholder:h?`Filter ${h} entries…`:"Filter by key or value…",className:"w-full rounded-lg py-2 pl-9 pr-9 text-[12px] outline-none transition-colors focus:border-blue-500/50 focus:bg-[var(--bg-overlay-md)]",style:{border:"1px solid var(--border)",backgroundColor:"var(--bg-overlay)",color:"var(--text-secondary)"}}),C&&s.jsx("button",{onClick:()=>_(""),className:"absolute right-3 top-1/2 flex h-5 w-5 -translate-y-1/2 items-center justify-center rounded-lg transition-colors hover:cursor-pointer hover:text-[var(--text-secondary)]",style:{border:"1px solid var(--border)",backgroundColor:"var(--bg-overlay-md)",color:"var(--text-faint)"},children:s.jsx(Ct,{className:"h-3 w-3",strokeWidth:2})})]}),p&&s.jsx("div",{className:"space-y-3",children:[1,2,3].map(D=>s.jsx("div",{className:"h-14 animate-pulse rounded-lg",style:{border:"1px solid var(--border)",backgroundColor:"var(--bg-overlay)",opacity:1-D*.2}},D))}),!p&&v&&s.jsxs("div",{className:"flex flex-col items-center gap-4 rounded-lg border border-red-500/20 bg-red-500/[0.04] p-10 text-center",children:[s.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-lg border border-red-500/20 bg-red-500/10 text-red-400",children:s.jsx(_i,{className:"h-6 w-6",strokeWidth:2})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[13.5px] font-medium text-red-300",children:"Could not load memory"}),s.jsx("p",{className:"mt-1 text-[11px] text-red-500/70",children:v})]}),s.jsx("button",{onClick:()=>G(),className:"rounded-lg border border-red-500/20 bg-red-500/10 px-4 py-1.5 text-[12px] text-red-400 transition-colors hover:cursor-pointer hover:bg-red-500/20",children:"Retry"})]}),!p&&!v&&n.length===0&&s.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-4 py-20 text-center",children:[s.jsxs("div",{className:"relative flex h-16 w-16 items-center justify-center",children:[s.jsx("div",{className:"absolute inset-0 rounded-full bg-blue-500/10 blur-xl"}),s.jsx("div",{className:"relative flex h-16 w-16 items-center justify-center rounded-lg text-blue-400",style:{border:"1px solid var(--border)",backgroundColor:"var(--bg-overlay)"},children:s.jsx(_i,{className:"h-7 w-7",strokeWidth:2})})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[13.5px] font-medium",style:{color:"var(--text-secondary)"},children:"Memory is empty"}),s.jsxs("p",{className:"mt-1 text-[12px]",style:{color:"var(--text-faint)"},children:["Add your first entry or run"," ",s.jsx("code",{className:"rounded px-1.5 py-0.5 text-[11px]",style:{border:"1px solid var(--border)",backgroundColor:"var(--bg-overlay-md)",color:"var(--text-muted)"},children:"jetic memory add"})," ","in the CLI."]})]}),s.jsxs("button",{onClick:()=>A(!0),className:"flex items-center gap-1.5 rounded-lg bg-blue-500 px-4 py-2 text-[12px] font-medium text-white transition-colors hover:cursor-pointer hover:bg-blue-400",children:[s.jsx(_t,{className:"h-[15px] w-[15px]",strokeWidth:2}),"Add Entry"]})]}),!p&&!v&&n.length>0&&h&&H.length===0&&!C&&s.jsxs("div",{className:"flex flex-col items-center gap-3 py-12 text-center",children:[s.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg",style:{border:"1px solid var(--border)",backgroundColor:"var(--bg-overlay)"},children:s.jsx(_i,{className:"h-[15px] w-[15px]",strokeWidth:2,style:{color:"var(--text-faint)"}})}),s.jsxs("p",{className:"text-[13px]",style:{color:"var(--text-muted)"},children:["No entries in ",s.jsx("code",{className:"text-blue-400",children:h})," scope"]}),s.jsxs("button",{onClick:()=>A(!0),className:"flex items-center gap-1.5 rounded-lg bg-blue-500 px-3 py-1.5 text-[12px] font-medium text-white transition-colors hover:cursor-pointer hover:bg-blue-400",children:[s.jsx(_t,{className:"h-[14px] w-[14px]",strokeWidth:2})," Add to ",h]})]}),!p&&!v&&n.length>0&&C&&H.length===0&&s.jsxs("div",{className:"flex flex-col items-center gap-3 py-12 text-center",children:[s.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg",style:{border:"1px solid var(--border)",backgroundColor:"var(--bg-overlay)"},children:s.jsx(zi,{className:"h-[15px] w-[15px]",strokeWidth:2,style:{color:"var(--text-faint)"}})}),s.jsxs("p",{className:"text-[13px]",style:{color:"var(--text-muted)"},children:['No entries match "',C,'"']}),s.jsx("button",{onClick:()=>_(""),className:"text-[12px] text-blue-400 transition-colors hover:cursor-pointer hover:text-blue-300",children:"Clear filter"})]}),!p&&!v&&H.length>0&&s.jsx("div",{className:"overflow-y-auto rounded-lg",style:{border:"1px solid var(--border)",backgroundColor:"var(--bg-overlay)"},children:s.jsxs("table",{className:"w-full text-left whitespace-nowrap",children:[s.jsx("thead",{style:{borderBottom:"1px solid var(--border)",backgroundColor:"var(--bg-overlay)"},children:s.jsxs("tr",{children:[s.jsx("th",{className:"w-32 px-4 py-3 text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-faint)"},children:"Scope"}),s.jsx("th",{className:"w-48 px-4 py-3 text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-faint)"},children:"Key"}),s.jsx("th",{className:"px-4 py-3 text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-faint)"},children:"Value"}),s.jsx("th",{className:"w-16 px-4 py-3 text-right text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-faint)"},children:"Actions"})]})}),s.jsx("tbody",{children:H.map((D,O)=>{const E=Si(D.key),$=n4(D.key),W=j0(D.value),ae=T===D.key,ie=py(E);return s.jsxs("tr",{className:"group transition-colors hover:bg-[var(--bg-overlay-md)]",style:O!==0?{borderTop:"1px solid var(--border)"}:void 0,children:[s.jsx("td",{className:"px-4 py-3",children:s.jsx("span",{className:`inline-flex items-center rounded-full px-2.5 py-0.5 text-[10px] font-semibold uppercase tracking-wider border ${ie.border} ${ie.text}`,style:{backgroundColor:"var(--bg-overlay-md)"},children:E})}),s.jsx("td",{className:"px-4 py-3",children:s.jsx("span",{className:"inline-flex items-center rounded-lg px-2.5 py-0.5 font-mono text-[11px]",style:{border:"1px solid var(--border)",backgroundColor:"var(--bg-overlay-md)",color:"var(--text-secondary)"},children:$})}),s.jsx("td",{className:"px-4 py-3",children:s.jsx(a4,{value:W})}),s.jsx("td",{className:"px-4 py-3 text-right",children:s.jsx("button",{onClick:()=>X(D.key),disabled:ae,title:"Delete entry",className:"inline-flex h-7 w-7 items-center justify-center rounded-lg transition-colors hover:cursor-pointer hover:border-red-500/30 hover:bg-red-500/10 hover:text-red-400 disabled:cursor-not-allowed disabled:opacity-50",style:{border:"1px solid var(--border)",backgroundColor:"var(--bg-overlay)",color:"var(--text-faint)"},children:ae?s.jsx(ot,{className:"h-[15px] w-[15px] animate-spin",strokeWidth:2}):s.jsx(Yt,{className:"h-[15px] w-[15px]",strokeWidth:2})})})]},D.key)})})]})}),!p&&!v&&C&&H.length>0&&s.jsxs("p",{className:"text-center text-[11px]",style:{color:"var(--text-faint)"},children:["Showing ",H.length," of ",k.length," entries"]})]}),!p&&!v&&n.length>0&&s.jsxs("div",{className:"flex items-center gap-1.5 px-6 py-3 text-[11px]",style:{borderTop:"1px solid var(--border)",color:"var(--text-faint)"},children:[s.jsx(Gr,{className:"h-[15px] w-[15px]",strokeWidth:2}),"Data read from"," ",s.jsx("code",{className:"rounded px-1.5 py-0.5 text-[10px]",style:{border:"1px solid var(--border)",backgroundColor:"var(--bg-overlay-md)",color:"var(--text-muted)"},children:".jetic/memory.json"}),s.jsx("span",{className:"ml-auto",children:s.jsx("button",{onClick:()=>G(!0),className:"text-[11px] transition-colors hover:cursor-pointer hover:text-blue-400",style:{color:"var(--text-faint)"},children:"Refresh"})})]}),M&&s.jsx(s4,{onClose:()=>A(!1),onSave:le,defaultScope:h??void 0}),Y&&s.jsx(l4,{onClose:()=>L(!1),onSave:D=>f(O=>O.includes(D)?O:[...O,D])})]})}function d4(){return s.jsxs("div",{className:"p-8",children:[s.jsx("h1",{className:"text-2xl font-semibold text-white",children:"APIs"}),s.jsx("p",{className:"mt-4 text-zinc-400",children:"This is the APIs page."})]})}function f4(){return s.jsxs("div",{className:"p-8",children:[s.jsx("h1",{className:"text-2xl font-semibold text-white",children:"Email"}),s.jsx("p",{className:"mt-4 text-zinc-400",children:"This is the Email page."})]})}function h4(){return s.jsxs("div",{className:"p-8",children:[s.jsx("h1",{className:"text-2xl font-semibold text-white",children:"OAuth"}),s.jsx("p",{className:"mt-4 text-zinc-400",children:"This is the OAuth page."})]})}function x4(){return s.jsxs("div",{className:"p-8",children:[s.jsx("h1",{className:"text-2xl font-semibold text-white",children:"Webhooks"}),s.jsx("p",{className:"mt-4 text-zinc-400",children:"This is the Webhooks page."})]})}const N0={GET:{bg:"#052e16",text:"#4ade80",border:"#166534",dot:"#34d399"},POST:{bg:"#172554",text:"#60a5fa",border:"#1e40af",dot:"#60a5fa"},PUT:{bg:"#422006",text:"#fbbf24",border:"#92400e",dot:"#fbbf24"},PATCH:{bg:"#431407",text:"#fb923c",border:"#9a3412",dot:"#fb923c"},DELETE:{bg:"#3f0000",text:"#f87171",border:"#991b1b",dot:"#f87171"},HEAD:{bg:"#18181b",text:"#a1a1aa",border:"#3f3f46",dot:"#a1a1aa"},OPTIONS:{bg:"#2e1065",text:"#c084fc",border:"#6b21a8",dot:"#c084fc"}};function my(n){return N0[n.toUpperCase()]??N0.GET}function p4({data:n}){const r=my(n.method),o=n.passed?"#34d399":"#f87171",i=n.selected?"#60a5fa":n.passed===!0?"#166534":n.passed===!1?"#991b1b":"#3f3f46";return s.jsxs("div",{onClick:n.onSelect,style:{width:260,border:`1.5px solid ${i}`,borderRadius:10,background:"var(--bg-surface, #111)",cursor:"pointer",boxShadow:n.selected?"0 0 0 2px rgba(96,165,250,0.4)":"0 2px 12px rgba(0,0,0,0.4)",transition:"box-shadow 0.15s ease",overflow:"hidden"},children:[s.jsx(jt,{type:"target",position:me.Top,style:{background:"transparent",border:"none"}}),s.jsxs("div",{style:{background:r.bg,borderBottom:`1px solid ${r.border}`,padding:"8px 12px",display:"flex",alignItems:"center",gap:8},children:[s.jsx("span",{style:{fontSize:9,fontWeight:700,letterSpacing:"0.1em",color:r.text,background:`${r.dot}15`,border:`1px solid ${r.dot}40`,borderRadius:4,padding:"2px 6px"},children:n.method}),s.jsx("span",{style:{fontSize:11,color:"#e4e4e7",fontFamily:"monospace",flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.path}),n.status>0&&s.jsx("span",{style:{fontSize:10,color:o,fontFamily:"monospace",fontWeight:600,flexShrink:0},children:n.status})]}),s.jsxs("div",{style:{padding:"8px 12px",display:"flex",flexDirection:"column",gap:5},children:[n.name&&s.jsx("span",{style:{fontSize:10,color:"#71717a",fontStyle:"italic"},children:n.name}),s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[s.jsx("span",{style:{fontSize:9,fontWeight:600,letterSpacing:"0.08em",color:n.passed?"#4ade80":"#f87171",background:n.passed?"rgba(74,222,128,0.08)":"rgba(248,113,113,0.08)",border:`1px solid ${n.passed?"rgba(74,222,128,0.2)":"rgba(248,113,113,0.2)"}`,borderRadius:4,padding:"2px 6px"},children:n.passed?"✓ PASSED":"✗ FAILED"}),n.durationMs>0&&s.jsxs("span",{style:{fontSize:10,color:"#52525b"},children:[n.durationMs,"ms"]})]}),n.injectSpec&&Object.keys(n.injectSpec).length>0&&s.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:4,marginTop:2},children:Object.entries(n.injectSpec).map(([u,f])=>s.jsxs("span",{style:{fontSize:9,color:"#a78bfa",background:"rgba(167,139,250,0.08)",border:"1px solid rgba(167,139,250,0.2)",borderRadius:4,padding:"1px 5px"},children:["📥 ",u," ← ","{{",f,"}}"]},u))}),(n.conditionSpec||n.conditionResult)&&s.jsx("div",{style:{display:"flex",alignItems:"center",gap:4,marginTop:2},children:s.jsxs("span",{style:{fontSize:9,fontWeight:600,color:n.conditionResult?n.conditionResult.passed?"#c084fc":"#fb923c":"#c084fc",background:n.conditionResult?.passed===!1?"rgba(251,146,60,0.1)":"rgba(192,132,252,0.1)",border:`1px solid ${n.conditionResult?.passed===!1?"rgba(251,146,60,0.3)":"rgba(192,132,252,0.3)"}`,borderRadius:4,padding:"1px 5px",display:"flex",alignItems:"center",gap:3},children:[s.jsx(ea,{style:{width:9,height:9}}),n.conditionResult?n.conditionResult.passed?"cond passed":"cond FAILED":"has condition"]})}),n.error&&s.jsxs("span",{style:{fontSize:9,color:"#f87171",marginTop:2},children:["⚠ ",n.error]}),s.jsx("span",{style:{fontSize:9,color:"#3f3f46",marginTop:2},children:"Click for details"})]}),s.jsx(jt,{type:"source",position:me.Bottom,style:{background:"transparent",border:"none"}})]})}function m4({data:n}){const r=Object.entries(n.captured??{});return s.jsxs("div",{style:{width:200,border:"1.5px solid rgba(167,139,250,0.35)",borderRadius:10,background:"rgba(139,92,246,0.07)",padding:"8px 12px",backdropFilter:"blur(4px)"},children:[s.jsx(jt,{type:"target",position:me.Top,style:{background:"transparent",border:"none"}}),s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:6},children:[s.jsx(Rr,{style:{width:12,height:12,color:"#a78bfa"}}),s.jsx("span",{style:{fontSize:10,fontWeight:600,color:"#a78bfa",letterSpacing:"0.06em"},children:"MEMORY"})]}),r.length===0&&s.jsx("span",{style:{fontSize:9,color:"#52525b"},children:"No variables captured"}),r.map(([o,i])=>s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:3},children:[s.jsx("span",{style:{fontSize:10,color:"#c4b5fd",fontFamily:"monospace"},children:o}),s.jsx(dl,{style:{width:10,height:10,color:"#52525b",flexShrink:0}}),s.jsx("span",{style:{fontSize:9,color:"#a1a1aa",fontFamily:"monospace",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1},children:String(i).length>20?String(i).slice(0,20)+"…":i})]},o)),s.jsx(jt,{type:"source",position:me.Bottom,style:{background:"transparent",border:"none"}})]})}function g4({data:n}){return s.jsxs("div",{style:{width:120,border:"1.5px solid rgba(96,165,250,0.4)",borderRadius:20,background:"rgba(96,165,250,0.08)",padding:"7px 14px",textAlign:"center"},children:[s.jsx("span",{style:{fontSize:11,fontWeight:600,color:"#60a5fa",letterSpacing:"0.05em"},children:n.label}),s.jsx(jt,{type:"source",position:me.Bottom,style:{background:"transparent",border:"none"}})]})}function y4({data:n}){const r=n.phase==="done"&&n.failed===0?"#4ade80":n.phase==="aborted"?"#f87171":"#fbbf24";return s.jsxs("div",{style:{width:140,border:`1.5px solid ${r}40`,borderRadius:20,background:`${r}0d`,padding:"7px 14px",textAlign:"center"},children:[s.jsx(jt,{type:"target",position:me.Top,style:{background:"transparent",border:"none"}}),s.jsx("span",{style:{fontSize:11,fontWeight:600,color:r,letterSpacing:"0.05em"},children:n.phase==="done"&&n.failed===0?"✓ PASSED":n.phase==="aborted"?"✗ ABORTED":`${n.passed}/${n.passed+n.failed} PASSED`})]})}function b4({data:n}){const r=n.conditionResult?.passed,o=r===void 0?"#c084fc":r?"#4ade80":"#fb923c";return s.jsxs("div",{style:{width:44,height:44,position:"relative",display:"flex",alignItems:"center",justifyContent:"center"},children:[s.jsx(jt,{type:"target",position:me.Top,style:{background:"transparent",border:"none"}}),s.jsxs("svg",{width:"44",height:"44",viewBox:"0 0 44 44",children:[s.jsx("polygon",{points:"22,2 42,22 22,42 2,22",fill:"none",stroke:o,strokeWidth:"1.5"}),s.jsx("polygon",{points:"22,8 36,22 22,36 8,22",fill:o,fillOpacity:.15,stroke:"none"})]}),s.jsx("span",{style:{position:"absolute",fontSize:9,fontFamily:"monospace",fontWeight:700,color:o,top:"50%",left:"50%",transform:"translate(-50%,-50%)",whiteSpace:"nowrap"},children:"◇"}),s.jsx(jt,{type:"source",position:me.Bottom,id:"pass",style:{background:"transparent",border:"none"}}),s.jsx(jt,{type:"source",position:me.Right,id:"fail",style:{background:"transparent",border:"none"}})]})}function v4({data:n}){return s.jsxs("div",{style:{width:210,border:"1.5px dashed rgba(251,146,60,0.45)",borderRadius:12,background:"rgba(251,146,60,0.06)",padding:"9px 13px",backdropFilter:"blur(4px)"},children:[s.jsx(jt,{type:"target",position:me.Left,style:{background:"transparent",border:"none"}}),s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:4},children:[s.jsx(Id,{style:{width:11,height:11,color:"#fb923c"}}),s.jsx("span",{style:{fontSize:9,fontWeight:700,letterSpacing:"0.08em",color:"#fb923c"},children:"SWITCHED WORKFLOW"})]}),s.jsx("span",{style:{fontSize:11,color:"#fdba74",fontFamily:"monospace"},children:n.workflowName||"unknown"}),n.returnsOnComplete&&s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4,marginTop:6},children:[s.jsx(na,{style:{width:9,height:9,color:"#71717a"}}),s.jsx("span",{style:{fontSize:9,color:"#71717a"},children:"resumes main flow after"})]}),s.jsx(jt,{type:"source",position:me.Right,id:"return",style:{background:"transparent",border:"none"}})]})}const j4={step:p4,memory:m4,condition:b4,start:g4,end:y4,branch:v4},il=260,N4=130,w4=200,S4=90,E4=il+90,Ei=50;function ol(n,r={}){return{type:"smoothstep",pathOptions:{borderRadius:14},animated:!!r.animated,style:{stroke:n,strokeWidth:r.width??1.5,strokeDasharray:r.dashed?"5 4":void 0},markerEnd:{type:qa.ArrowClosed,color:n,width:16,height:16},labelStyle:{fill:n,fontSize:9,fontWeight:600,fontFamily:"monospace"},labelBgStyle:r.labelBg===!1?{fill:"transparent"}:{fill:"var(--bg-base, #0a0a0a)",fillOpacity:.9},labelBgPadding:[4,2],labelBgBorderRadius:4}}function k4(n,r,o){const i=[],u=[];let f=0;i.push({id:"start",type:"start",position:{x:(il-120)/2,y:f},data:{label:`▶ START · ${new Date(n.startedAt).toLocaleTimeString()}`},draggable:!1}),f+=50+Ei;for(let x=0;x<n.steps.length;x++){const m=n.steps[x],b=m.captureSpec&&Object.keys(m.captureSpec).length>0,v=m.captured&&Object.keys(m.captured).length>0,N=!!(m.conditionSpec||m.conditionResult),C=!!m.conditionSpec?.switchToWorkflow,_=m.passed?"#4ade80":"#f87171";i.push({id:`step-${x}`,type:"step",position:{x:0,y:f},data:{index:x,name:m.name,method:m.method,path:m.path,status:m.status,passed:m.passed,durationMs:m.durationMs,error:m.error,injectSpec:m.injectSpec,captureSpec:m.captureSpec,conditionSpec:m.conditionSpec,conditionResult:m.conditionResult,selected:r===x,onSelect:()=>o(x)},draggable:!1});const M=x===0?"start":ki(n,x-1)?`cond-${x-1}`:w0(n,x-1)?`mem-${x-1}`:`step-${x-1}`,A=x>0&&ki(n,x-1)?"pass":void 0;u.push({id:`e-${x}`,source:M,sourceHandle:A,target:`step-${x}`,...ol(_,{width:2}),label:x>0&&n.steps[x-1].injectSpec?Object.keys(n.steps[x-1].injectSpec??{}).map(L=>`{{${L}}}`).join(", "):void 0}),f+=N4+Ei;let Y=`step-${x}`;if((b||v)&&(i.push({id:`mem-${x}`,type:"memory",position:{x:(il-w4)/2,y:f},data:{captured:v?m.captured:Object.fromEntries(Object.keys(m.captureSpec??{}).map(L=>[L.split(":").pop()??L,"…"]))},draggable:!1}),u.push({id:`e-mem-${x}`,source:`step-${x}`,target:`mem-${x}`,...ol("#a78bfa",{dashed:!0,width:1.2}),label:"capture"}),f+=S4+Ei,Y=`mem-${x}`),N){const L=m.conditionResult?.passed===!1?"#fb923c":"#c084fc",T=f;if(i.push({id:`cond-${x}`,type:"condition",position:{x:(il-44)/2,y:T},data:{conditionSpec:m.conditionSpec,conditionResult:m.conditionResult},draggable:!1}),u.push({id:`e-cond-${x}`,source:Y,target:`cond-${x}`,...ol(L,{width:1.4}),label:m.conditionResult?m.conditionResult.passed?"PASS":"FAIL":"eval"}),C&&(i.push({id:`branch-${x}`,type:"branch",position:{x:E4,y:T-10},data:{workflowName:m.conditionSpec?.switchToWorkflow,returnsOnComplete:m.conditionSpec?.returnOnComplete},draggable:!1}),u.push({id:`e-branch-${x}`,source:`cond-${x}`,sourceHandle:"fail",target:`branch-${x}`,...ol("#fb923c",{dashed:!0,width:1.6,labelBg:!0}),label:"on FAIL → switch"}),m.conditionSpec?.returnOnComplete)){const R=x<n.steps.length-1?`step-${x+1}`:"end";u.push({id:`e-branch-return-${x}`,source:`branch-${x}`,sourceHandle:"return",target:R,...ol("#60a5fa",{dashed:!0,width:1.2,labelBg:!0}),label:"resume"})}f+=44+Ei}}i.push({id:"end",type:"end",position:{x:(il-140)/2,y:f},data:{phase:n.phase,passed:n.passed,failed:n.failed},draggable:!1});const h=n.steps.length-1,g=n.steps.length>0?ki(n,h)?`cond-${h}`:w0(n,h)?`mem-${h}`:`step-${h}`:"start",p=n.steps.length>0&&ki(n,h)?"pass":void 0;return u.push({id:"e-end",source:g,sourceHandle:p,target:"end",...ol(n.phase==="done"&&n.failed===0?"#4ade80":"#f87171",{width:2})}),i.push({id:"spine-rail",type:"default",position:{x:il/2-1,y:0},data:{label:""},draggable:!1,selectable:!1,focusable:!1,style:{width:2,height:f,background:"linear-gradient(to bottom, rgba(96,165,250,0.18), rgba(167,139,250,0.12), rgba(74,222,128,0.18))",border:"none",borderRadius:2,pointerEvents:"none"},zIndex:-1}),{nodes:i,edges:u}}function ki(n,r){const o=n.steps[r];return o?!!(o.conditionSpec||o.conditionResult):!1}function w0(n,r){const o=n.steps[r];return o?o.captureSpec&&Object.keys(o.captureSpec).length>0||o.captured&&Object.keys(o.captured).length>0:!1}function _4({trace:n,selectedStep:r,onSelectStep:o}){const[i,u,f]=ay([]),[h,g,p]=sy([]);return j.useEffect(()=>{const{nodes:x,edges:m}=k4(n,r,o);u(x),g(m)},[n,r]),s.jsxs(yf,{nodes:i,edges:h,onNodesChange:f,onEdgesChange:p,nodeTypes:j4,fitView:!0,fitViewOptions:{padding:.3},proOptions:{hideAttribution:!0},minZoom:.15,maxZoom:2,defaultEdgeOptions:{type:"smoothstep"},style:{background:"transparent"},children:[s.jsx(uy,{variant:ln.Dots,gap:24,size:1,color:"rgba(255,255,255,0.04)"}),s.jsx(iy,{style:{background:"var(--bg-surface)",border:"1px solid var(--border)",borderRadius:8},showInteractive:!1}),s.jsx(t3,{nodeColor:x=>x.type==="memory"?"rgba(167,139,250,0.5)":x.type==="branch"?"rgba(251,146,60,0.5)":x.type==="start"||x.type==="end"?"rgba(96,165,250,0.5)":x.id==="spine-rail"?"transparent":x.data?.passed?"rgba(74,222,128,0.5)":"rgba(248,113,113,0.5)",style:{background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:8},maskColor:"rgba(0,0,0,0.4)"})]})}function C4({step:n,onClose:r}){const o=my(n.method),[i,u]=j.useState("overview");return s.jsxs("div",{className:"flex flex-col h-full",style:{width:360,borderLeft:"1px solid var(--border)",backgroundColor:"var(--bg-surface)",flexShrink:0},children:[s.jsxs("div",{style:{borderBottom:"1px solid var(--border)",padding:"12px 16px",display:"flex",alignItems:"center",gap:10,backgroundColor:"var(--bg-elevated)"},children:[s.jsx("span",{style:{fontSize:9,fontWeight:700,letterSpacing:"0.1em",color:o.text,background:o.bg,border:`1px solid ${o.border}`,borderRadius:4,padding:"2px 8px"},children:n.method}),s.jsx("span",{style:{fontFamily:"monospace",fontSize:12,color:"var(--text-primary)",flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.path}),s.jsx("button",{onClick:r,style:{color:"var(--text-faint)",display:"flex",alignItems:"center"},children:s.jsx(Ct,{className:"h-4 w-4"})})]}),s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"8px 16px",borderBottom:"1px solid var(--border)",backgroundColor:n.passed?"rgba(74,222,128,0.04)":"rgba(248,113,113,0.04)"},children:[n.passed?s.jsx(xt,{className:"h-4 w-4 text-emerald-400 shrink-0"}):s.jsx(Ht,{className:"h-4 w-4 text-red-400 shrink-0"}),s.jsxs("span",{style:{fontSize:11,fontWeight:600,color:n.passed?"#4ade80":"#f87171"},children:["HTTP ",n.status>0?n.status:"ERROR"," · ",n.durationMs,"ms"]}),n.expectStatus&&s.jsxs("span",{style:{fontSize:10,color:"var(--text-muted)",marginLeft:"auto"},children:["expected ",n.expectStatus]})]}),s.jsx("div",{style:{display:"flex",borderBottom:"1px solid var(--border)"},children:["overview","request","response","vars","conditions"].map(f=>s.jsx("button",{onClick:()=>u(f),style:{flex:1,padding:"8px 4px",fontSize:10,fontWeight:600,letterSpacing:"0.05em",textTransform:"capitalize",color:i===f?"#60a5fa":"var(--text-muted)",borderBottom:i===f?"2px solid #60a5fa":"2px solid transparent",background:"transparent",cursor:"pointer",transition:"color 0.15s"},children:f},f))}),s.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"14px 16px"},children:[i==="overview"&&s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:14},children:[s.jsxs(wn,{title:"Step",children:[s.jsx(Lt,{k:"Index",v:`#${n.index+1}`}),s.jsx(Lt,{k:"Name",v:n.name||"—"}),s.jsx(Lt,{k:"Method",v:n.method}),s.jsx(Lt,{k:"Path",v:n.path,mono:!0}),n.description&&s.jsx(Lt,{k:"Description",v:n.description})]}),s.jsxs(wn,{title:"Timing",children:[s.jsx(Lt,{k:"Duration",v:`${n.durationMs}ms`,accent:"#60a5fa"}),n.expectStatus&&s.jsx(Lt,{k:"Expected status",v:String(n.expectStatus)}),s.jsx(Lt,{k:"Actual status",v:n.status>0?String(n.status):"No response",accent:n.passed?"#4ade80":"#f87171"})]}),n.error&&s.jsx(wn,{title:"Error",children:s.jsx("div",{style:{background:"rgba(248,113,113,0.06)",border:"1px solid rgba(248,113,113,0.2)",borderRadius:6,padding:"8px 10px"},children:s.jsx("span",{style:{fontSize:11,color:"#f87171",fontFamily:"monospace"},children:n.error})})})]}),i==="request"&&s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:14},children:[Object.keys(n.injected??{}).length>0&&s.jsx(wn,{title:"Headers (injected)",children:Object.entries(n.injected??{}).map(([f,h])=>s.jsx(Lt,{k:f,v:String(h),mono:!0},f))}),n.injectSpec&&Object.keys(n.injectSpec).length>0&&s.jsx(wn,{title:"Variable injection spec",children:Object.entries(n.injectSpec).map(([f,h])=>s.jsx(Lt,{k:f,v:`← {{${h}}}`,mono:!0,accent:"#a78bfa"},f))}),n.requestBody?s.jsx(wn,{title:"Request body",children:s.jsx("pre",{style:{fontSize:10,color:"var(--text-secondary)",fontFamily:"monospace",background:"var(--bg-overlay)",border:"1px solid var(--border)",borderRadius:6,padding:10,overflowX:"auto",whiteSpace:"pre-wrap",wordBreak:"break-all",margin:0},children:JSON.stringify(n.requestBody,null,2)})}):s.jsx("span",{style:{fontSize:11,color:"var(--text-faint)"},children:"No request body"})]}),i==="response"&&s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:14},children:n.responseBody!==void 0?s.jsx(wn,{title:`Response body · HTTP ${n.status}`,children:s.jsx("pre",{style:{fontSize:10,color:"var(--text-secondary)",fontFamily:"monospace",background:"var(--bg-overlay)",border:"1px solid var(--border)",borderRadius:6,padding:10,overflowX:"auto",whiteSpace:"pre-wrap",wordBreak:"break-all",margin:0},children:typeof n.responseBody=="string"?n.responseBody:JSON.stringify(n.responseBody,null,2)})}):s.jsx("span",{style:{fontSize:11,color:"var(--text-faint)"},children:"No response body recorded"})}),i==="vars"&&s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:14},children:[n.captureSpec&&Object.keys(n.captureSpec).length>0&&s.jsx(wn,{title:"Capture spec (JSONPath)",children:Object.entries(n.captureSpec).map(([f,h])=>s.jsx(Lt,{k:f,v:h,mono:!0,accent:"#a78bfa"},f))}),n.captured&&Object.keys(n.captured).length>0?s.jsx(wn,{title:"Captured values",children:Object.entries(n.captured).map(([f,h])=>s.jsx(Lt,{k:f,v:String(h),mono:!0,accent:"#4ade80"},f))}):s.jsx("span",{style:{fontSize:11,color:"var(--text-faint)"},children:"No variables captured in this step"})]}),i==="conditions"&&s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:14},children:[n.conditionResult&&s.jsx(wn,{title:"Condition Evaluation Result",children:s.jsxs("div",{style:{padding:"8px 10px",borderRadius:6,border:`1px solid ${n.conditionResult.passed?"rgba(74,222,128,0.2)":"rgba(251,146,60,0.2)"}`,background:n.conditionResult.passed?"rgba(74,222,128,0.06)":"rgba(251,146,60,0.06)"},children:[s.jsxs("span",{style:{fontSize:11,fontWeight:600,color:n.conditionResult.passed?"#4ade80":"#fb923c"},children:["◇ Condition ",n.conditionResult.passed?"PASSED":"FAILED"]}),s.jsx("p",{style:{fontSize:10,color:"var(--text-secondary)",marginTop:4,fontFamily:"monospace"},children:n.conditionResult.reason})]})}),n.conditionSpec?s.jsxs(wn,{title:"Condition Rules",children:[s.jsx(Lt,{k:"Logic mode",v:n.conditionSpec.rules.all?"AND (all rules must pass)":"OR (any rule can pass)"}),s.jsx(Lt,{k:"Failure action",v:n.conditionSpec.onFail,accent:"#fb923c"}),n.conditionSpec.switchToWorkflow&&s.jsx(Lt,{k:"Switch workflow",v:n.conditionSpec.switchToWorkflow,mono:!0,accent:"#60a5fa"}),n.conditionSpec.returnOnComplete!==void 0&&s.jsx(Lt,{k:"Return on complete",v:n.conditionSpec.returnOnComplete?"Yes (resumes main workflow)":"No (permanent switch)"}),s.jsxs("div",{style:{marginTop:6},children:[s.jsx("p",{style:{fontSize:9,color:"var(--text-faint)",textTransform:"uppercase",marginBottom:4},children:"Rules list"}),(n.conditionSpec.rules.all??n.conditionSpec.rules.any??[]).map((f,h)=>s.jsxs("div",{style:{fontSize:10,color:"#c4b5fd",fontFamily:"monospace",background:"var(--bg-overlay)",padding:"4px 8px",borderRadius:4,marginBottom:3},children:[f.left," ",s.jsx("span",{style:{color:"#a78bfa"},children:f.operator})," ",f.right!==void 0?f.right:""]},h))]})]}):s.jsx("span",{style:{fontSize:11,color:"var(--text-faint)"},children:"No condition configured for this step"})]})]})]})}function wn({title:n,children:r}){return s.jsxs("div",{children:[s.jsx("p",{style:{fontSize:9,fontWeight:700,letterSpacing:"0.1em",color:"var(--text-faint)",textTransform:"uppercase",marginBottom:8},children:n}),s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:5},children:r})]})}function Lt({k:n,v:r,mono:o=!1,accent:i}){return s.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:8},children:[s.jsx("span",{style:{fontSize:10,color:"var(--text-muted)",minWidth:100,flexShrink:0},children:n}),s.jsx("span",{style:{fontSize:10,color:i??"var(--text-secondary)",fontFamily:o?"monospace":void 0,wordBreak:"break-all"},children:r})]})}function T4({trace:n}){const[r,o]=j.useState(null),i=n.steps.reduce((f,h)=>f+h.durationMs,0)||1,u=j.useCallback(f=>{o(h=>h===f?null:f)},[]);return s.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",minWidth:0},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"14px 20px",borderBottom:"1px solid var(--border)",backgroundColor:"var(--bg-elevated)",flexShrink:0},children:[s.jsxs("div",{style:{flex:1,minWidth:0},children:[s.jsx("p",{style:{fontSize:14,fontWeight:600,color:"var(--text-primary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.workflowName}),s.jsxs("p",{style:{fontSize:10,color:"var(--text-muted)",marginTop:2,display:"flex",alignItems:"center",gap:6},children:[s.jsx(Gr,{className:"h-3 w-3 inline"}),new Date(n.startedAt).toLocaleString(),n.baseUrl&&s.jsxs(s.Fragment,{children:[" · ",s.jsx("code",{style:{color:"var(--text-faint)"},children:n.baseUrl})]}),"· ",s.jsx("span",{style:{color:"var(--text-faint)"},children:n.source==="local-sim"?"Simulated locally":"Real API run"})]})]}),s.jsxs("span",{style:{display:"flex",alignItems:"center",gap:6,flexShrink:0,fontSize:11,fontWeight:600,padding:"4px 12px",borderRadius:20,color:n.phase==="done"&&n.failed===0?"#4ade80":n.phase==="aborted"?"#f87171":"#fbbf24",background:n.phase==="done"&&n.failed===0?"rgba(74,222,128,0.08)":"rgba(248,113,113,0.08)",border:`1px solid ${n.phase==="done"&&n.failed===0?"rgba(74,222,128,0.2)":"rgba(248,113,113,0.2)"}`},children:[n.phase==="done"&&n.failed===0?s.jsx(xt,{className:"h-3.5 w-3.5"}):s.jsx(Ht,{className:"h-3.5 w-3.5"}),n.passed,"/",n.passed+n.failed," passed · ",n.durationMs,"ms"]})]}),s.jsxs("div",{style:{padding:"10px 20px",borderBottom:"1px solid var(--border)",flexShrink:0},children:[s.jsxs("p",{style:{fontSize:9,fontWeight:700,letterSpacing:"0.1em",color:"var(--text-faint)",marginBottom:6,textTransform:"uppercase"},children:["Timeline · ",n.steps.length," steps · ",n.durationMs,"ms total"]}),s.jsx("div",{style:{display:"flex",gap:2,height:8,borderRadius:4,overflow:"hidden"},children:n.steps.map((f,h)=>s.jsx("div",{onClick:()=>u(h),title:`${f.method} ${f.path} — ${f.durationMs}ms`,style:{flex:f.durationMs/i,minWidth:4,background:f.passed?"#22c55e":"#ef4444",cursor:"pointer",opacity:r===h?1:.7,borderRadius:2,transition:"opacity 0.15s"}},h))}),s.jsx("div",{style:{display:"flex",gap:2,marginTop:4},children:n.steps.map((f,h)=>s.jsx("div",{style:{flex:f.durationMs/i,minWidth:4,fontSize:8,color:"var(--text-faint)",overflow:"hidden",cursor:"pointer"},onClick:()=>u(h),children:h+1},h))})]}),s.jsxs("div",{style:{flex:1,display:"flex",minHeight:0},children:[s.jsx("div",{style:{flex:1,minWidth:0,position:"relative"},children:s.jsx(_4,{trace:n,selectedStep:r,onSelectStep:u})}),r!==null&&n.steps[r]&&s.jsx(C4,{step:n.steps[r],onClose:()=>o(null)})]})]})}function M4({trace:n,selected:r,onClick:o,onDelete:i}){const u=n.phase==="done"&&n.failed===0?"#4ade80":n.phase==="aborted"?"#f87171":"#fbbf24",f=()=>{const h=Date.now()-new Date(n.startedAt).getTime();return h<6e4?`${Math.round(h/1e3)}s ago`:h<36e5?`${Math.round(h/6e4)}m ago`:`${Math.round(h/36e5)}h ago`};return s.jsx("div",{onClick:o,style:{padding:"10px 14px",borderBottom:"1px solid var(--border)",cursor:"pointer",backgroundColor:r?"rgba(96,165,250,0.06)":"transparent",borderLeft:r?"3px solid #60a5fa":"3px solid transparent",transition:"background 0.1s",position:"relative"},className:"group",children:s.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:8},children:[s.jsx("div",{style:{width:8,height:8,borderRadius:"50%",background:u,flexShrink:0,marginTop:4}}),s.jsxs("div",{style:{flex:1,minWidth:0},children:[s.jsx("p",{style:{fontSize:11,fontWeight:500,color:"var(--text-primary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.workflowName}),s.jsxs("p",{style:{fontSize:9,color:"var(--text-muted)",marginTop:2,display:"flex",alignItems:"center",gap:4},children:[s.jsx(Gr,{className:"h-2.5 w-2.5 inline shrink-0"}),f()," · ",n.steps.length," steps · ",n.durationMs,"ms"]}),s.jsxs("div",{style:{display:"flex",gap:4,marginTop:4,flexWrap:"wrap"},children:[n.passed>0&&s.jsxs("span",{style:{fontSize:9,color:"#4ade80",background:"rgba(74,222,128,0.08)",border:"1px solid rgba(74,222,128,0.2)",borderRadius:4,padding:"1px 5px"},children:[n.passed," ✓"]}),n.failed>0&&s.jsxs("span",{style:{fontSize:9,color:"#f87171",background:"rgba(248,113,113,0.08)",border:"1px solid rgba(248,113,113,0.2)",borderRadius:4,padding:"1px 5px"},children:[n.failed," ✗"]}),s.jsx("span",{style:{fontSize:9,color:"var(--text-faint)",background:"var(--bg-overlay)",border:"1px solid var(--border)",borderRadius:4,padding:"1px 5px"},children:n.source==="local-sim"?"sim":"api"}),n.steps.some(h=>h.conditionSpec||h.conditionResult)&&s.jsxs("span",{style:{fontSize:9,color:"#c084fc",background:"rgba(192,132,252,0.08)",border:"1px solid rgba(192,132,252,0.2)",borderRadius:4,padding:"1px 5px",display:"flex",alignItems:"center",gap:2},children:[s.jsx(ea,{style:{width:8,height:8}})," cond"]})]})]}),s.jsx("button",{onClick:h=>{h.stopPropagation(),i()},style:{opacity:0,transition:"opacity 0.1s",color:"var(--text-faint)",display:"flex",alignItems:"center",padding:2,borderRadius:4},className:"group-hover:opacity-100",title:"Delete trace",children:s.jsx(Yt,{className:"h-3 w-3"})})]})})}function A4(){return s.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:12,padding:"40px 20px",textAlign:"center"},children:[s.jsxs("div",{style:{position:"relative",width:52,height:52,display:"flex",alignItems:"center",justifyContent:"center"},children:[s.jsx("div",{style:{position:"absolute",inset:0,borderRadius:"50%",background:"rgba(96,165,250,0.1)",filter:"blur(8px)"}}),s.jsx("div",{style:{position:"relative",width:52,height:52,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid var(--border)",backgroundColor:"var(--bg-overlay)",color:"#60a5fa"},children:s.jsx(Vr,{className:"h-6 w-6"})})]}),s.jsx("p",{style:{fontSize:12,fontWeight:500,color:"var(--text-secondary)"},children:"No traces yet"}),s.jsx("p",{style:{fontSize:10,color:"var(--text-muted)",maxWidth:200},children:"Run a simulation from the Simulations page to generate a trace."})]})}function R4(){return s.jsxs("div",{style:{display:"flex",flex:1,flexDirection:"column",alignItems:"center",justifyContent:"center",gap:14,textAlign:"center",padding:32},children:[s.jsxs("div",{style:{position:"relative",width:64,height:64,display:"flex",alignItems:"center",justifyContent:"center"},children:[s.jsx("div",{style:{position:"absolute",inset:0,borderRadius:"50%",background:"rgba(167,139,250,0.1)",filter:"blur(12px)"}}),s.jsx("div",{style:{position:"relative",width:64,height:64,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid var(--border)",backgroundColor:"var(--bg-overlay)",color:"#a78bfa"},children:s.jsx(Vi,{className:"h-8 w-8"})})]}),s.jsxs("div",{children:[s.jsx("p",{style:{fontSize:14,fontWeight:600,color:"var(--text-secondary)"},children:"Select a trace"}),s.jsx("p",{style:{fontSize:11,color:"var(--text-muted)",marginTop:4},children:"Pick a run from the list to visualize its execution graph"})]}),s.jsxs("div",{style:{border:"1px solid var(--border)",borderRadius:10,padding:"12px 16px",backgroundColor:"var(--bg-overlay)",maxWidth:340,textAlign:"left"},children:[s.jsx("p",{style:{fontSize:10,fontWeight:600,color:"var(--text-faint)",marginBottom:8,textTransform:"uppercase",letterSpacing:"0.08em"},children:"What you'll see"}),[["HTTP step nodes","Every request in the workflow shown as a graph node with method, path, status, and timing"],["Memory nodes","Variables captured from responses (tokens, IDs, etc.) shown in between steps"],["Branch forks","Conditions that switch workflows peel off into a side branch, then merge back if they resume"],["Execution flow","Arrows colored green/red showing the success/failure path through your workflow"],["Step detail drawer","Click any node to see full request/response bodies, headers, and capture specs"]].map(([n,r])=>s.jsxs("div",{style:{display:"flex",gap:8,marginBottom:8},children:[s.jsx("span",{style:{color:"#60a5fa",flexShrink:0,marginTop:1},children:"→"}),s.jsxs("div",{children:[s.jsx("span",{style:{fontSize:11,fontWeight:500,color:"var(--text-secondary)"},children:n}),s.jsx("p",{style:{fontSize:10,color:"var(--text-muted)",marginTop:1},children:r})]})]},n))]})]})}function z4({initialFilter:n,onNavigate:r}){const[o,i]=j.useState([]),[u,f]=j.useState(!0),[h,g]=j.useState(""),[p,x]=j.useState(null),m=j.useRef(!1),b=j.useCallback(async()=>{f(!0);try{const _=await mm();if(i(_),!m.current&&n?.traceId){const M=_.find(A=>A.id===n.traceId);M&&(x(M),m.current=!0)}else if(!m.current&&n?.workflowName&&_.length>0){const M=_.find(A=>A.workflowName===n.workflowName);M&&(x(M),m.current=!0)}}finally{f(!1)}},[n?.traceId,n?.workflowName]);j.useEffect(()=>{b()},[b]),j.useEffect(()=>{const _=setInterval(()=>{mm().then(M=>{(M.length!==o.length||M.some((A,Y)=>A.id!==o[Y]?.id))&&i(M)}).catch(()=>{})},5e3);return()=>clearInterval(_)},[o]),j.useEffect(()=>{if(n?.traceId&&o.length>0){const _=o.find(M=>M.id===n.traceId);_&&x(_)}},[n?.traceId,o]);const v=async _=>{await x2(_),p?.id===_&&x(null),i(M=>M.filter(A=>A.id!==_))},N=async()=>{confirm("Delete all traces? This cannot be undone.")&&(await p2(),i([]),x(null))},C=o.filter(_=>!h.trim()||_.workflowName.toLowerCase().includes(h.toLowerCase())||_.steps.some(M=>M.path.toLowerCase().includes(h.toLowerCase())));return s.jsxs("div",{style:{display:"flex",height:"100%"},className:"w-full",children:[s.jsxs("div",{style:{width:280,flexShrink:0,display:"flex",flexDirection:"column",borderRight:"1px solid var(--border)",backgroundColor:"var(--bg-surface)"},children:[s.jsxs("div",{style:{padding:"14px 14px 10px",borderBottom:"1px solid var(--border)",backgroundColor:"var(--bg-elevated)",flexShrink:0},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:10},children:[s.jsxs("div",{children:[s.jsx("p",{style:{fontSize:13,fontWeight:600,color:"var(--text-primary)",lineHeight:1},children:"Traces"}),s.jsx("p",{style:{fontSize:10,color:"var(--text-muted)",marginTop:3},children:u?"Loading…":`${o.length} run${o.length!==1?"s":""} stored`})]}),s.jsxs("div",{style:{display:"flex",gap:6},children:[s.jsx("button",{onClick:b,title:"Refresh",style:{display:"flex",alignItems:"center",justifyContent:"center",width:28,height:28,borderRadius:7,border:"1px solid var(--border)",background:"var(--bg-overlay)",color:"var(--text-muted)",cursor:"pointer"},children:s.jsx(na,{className:"h-3.5 w-3.5"})}),o.length>0&&s.jsx("button",{onClick:N,title:"Clear all",style:{display:"flex",alignItems:"center",justifyContent:"center",width:28,height:28,borderRadius:7,border:"1px solid rgba(239,68,68,0.25)",background:"rgba(239,68,68,0.06)",color:"#f87171",cursor:"pointer"},children:s.jsx(Yt,{className:"h-3.5 w-3.5"})})]})]}),s.jsxs("div",{style:{position:"relative"},children:[s.jsx(zi,{style:{position:"absolute",left:8,top:"50%",transform:"translateY(-50%)",width:13,height:13,color:"var(--text-faint)",pointerEvents:"none"}}),s.jsx("input",{value:h,onChange:_=>g(_.target.value),placeholder:"Search traces…",style:{width:"100%",paddingLeft:28,paddingRight:h?28:10,paddingTop:6,paddingBottom:6,fontSize:11,border:"1px solid var(--border)",borderRadius:8,backgroundColor:"var(--bg-overlay)",color:"var(--text-secondary)",outline:"none",boxSizing:"border-box"}}),h&&s.jsx("button",{onClick:()=>g(""),style:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",color:"var(--text-faint)",display:"flex",background:"none",border:"none",cursor:"pointer",padding:0},children:s.jsx(Ct,{className:"h-3 w-3"})})]})]}),s.jsxs("div",{style:{flex:1,overflowY:"auto"},children:[u&&s.jsx("div",{style:{padding:16,display:"flex",flexDirection:"column",gap:8},children:[1,2,3].map(_=>s.jsx("div",{style:{height:64,borderRadius:8,border:"1px solid var(--border)",backgroundColor:"var(--bg-overlay)",opacity:1-_*.25,animation:"pulse 2s cubic-bezier(0.4,0,0.6,1) infinite"}},_))}),!u&&C.length===0&&s.jsx(A4,{}),!u&&C.map(_=>s.jsx(M4,{trace:_,selected:p?.id===_.id,onClick:()=>x(_),onDelete:()=>v(_.id)},_.id))]}),r&&s.jsxs("div",{style:{padding:"10px 14px",borderTop:"1px solid var(--border)",display:"flex",gap:10},children:[s.jsxs("button",{onClick:()=>r("simulations"),style:{display:"flex",alignItems:"center",gap:4,fontSize:10,color:"#60a5fa",background:"none",border:"none",cursor:"pointer",padding:0},children:[s.jsx(ea,{className:"h-3 w-3"})," Simulations ",s.jsx(fm,{className:"h-2.5 w-2.5"})]}),s.jsxs("button",{onClick:()=>r("model"),style:{display:"flex",alignItems:"center",gap:4,fontSize:10,color:"#60a5fa",background:"none",border:"none",cursor:"pointer",padding:0},children:[s.jsx(M0,{className:"h-3 w-3"})," Model ",s.jsx(fm,{className:"h-2.5 w-2.5"})]})]})]}),s.jsx("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",backgroundColor:"var(--bg-base)"},children:p?s.jsx(T4,{trace:p,onNavigate:r}):s.jsx(R4,{})})]})}function O4(){return s.jsxs("div",{className:"p-8",children:[s.jsx("h1",{className:"text-2xl font-semibold text-white",children:"Events"}),s.jsx("p",{className:"mt-4 text-zinc-400",children:"This page is underdevelopnment."})]})}function D4(n){const r=n.split(".").pop()?.toLowerCase()??"";return["ts","tsx","js","jsx","mjs","py","go","rs"].includes(r)?{icon:i1,color:"text-blue-400"}:["json","yaml","yml","toml","env"].includes(r)?{icon:Jd,color:"text-amber-400"}:["sql","prisma","graphql","gql"].includes(r)?{icon:Rr,color:"text-emerald-400"}:{icon:d1,color:"text-[var(--text-muted)]"}}function H4(n){try{const r=Math.floor((Date.now()-new Date(n).getTime())/1e3);return r<5?"just now":r<60?`${r}s ago`:r<3600?`${Math.floor(r/60)}m ago`:r<86400?`${Math.floor(r/3600)}h ago`:new Date(n).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch{return""}}function $4({onNavigate:n}={}){const[r,o]=j.useState(null),[i,u]=j.useState(!0),[f,h]=j.useState(null),[g,p]=j.useState(!1),[x,m]=j.useState(""),[b,v]=j.useState(null),[N,C]=j.useState(!1),_=j.useCallback(async(T=!1)=>{T||u(!0);try{const R=await fetch("/api/changes");if(!R.ok)throw new Error(`HTTP ${R.status}`);o(await R.json()),h(null)}catch(R){h(R.message??"Failed to fetch changes")}finally{T||u(!1)}},[]),M=async()=>{if(!N){C(!0);try{await fetch("/api/changes",{method:"DELETE"}),await _(!0)}catch(T){alert(`Clear failed: ${T.message}`)}finally{C(!1)}}},A=T=>{navigator.clipboard.writeText(T),v(T),setTimeout(()=>v(null),2e3)};j.useEffect(()=>{_();let T=null,R=null;try{T=new EventSource("/api/changes/stream"),T.onopen=()=>p(!0),T.onmessage=G=>{try{o(JSON.parse(G.data))}catch{}},T.onerror=()=>{p(!1),R||(R=setInterval(()=>_(!0),2e3))}}catch{R=setInterval(()=>_(!0),2e3)}return()=>{T?.close(),R&&clearInterval(R)}},[_]);const Y=j.useMemo(()=>{if(!r?.changes)return[];if(!x)return r.changes;const T=x.toLowerCase();return r.changes.filter(R=>R.filePath.toLowerCase().includes(T))},[r,x]),L=r?.changes?.length??0;return s.jsxs("div",{className:"flex flex-1 flex-col min-h-0",style:{backgroundColor:"var(--bg-base)",color:"var(--text-primary)"},children:[s.jsxs("div",{className:"flex items-center justify-between px-5 py-3.5",style:{borderBottom:"1px solid var(--border)",backgroundColor:"var(--sidebar-bg)"},children:[s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.jsx(C0,{className:"h-[15px] w-[15px] shrink-0",style:{color:"var(--text-muted)"},strokeWidth:2}),s.jsx("span",{className:"text-[13.5px] font-medium tracking-tight",style:{color:"var(--text-primary)"},children:"File Changes"}),L>0&&s.jsx("span",{className:"rounded-full px-2 py-0.5 text-[11px] font-medium",style:{backgroundColor:"var(--bg-overlay-md)",border:"1px solid var(--border)",color:"var(--text-muted)"},children:L}),s.jsxs("div",{className:"flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[11px] font-medium",style:{border:"1px solid var(--border)",backgroundColor:"var(--bg-overlay)",color:"var(--text-muted)"},children:[s.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${g?"bg-blue-500 animate-pulse":"bg-[var(--text-faint)]"}`}),g?"Live":"Polling"]})]}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsxs("button",{type:"button",onClick:()=>_(!1),disabled:i,className:"flex items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-[11px] font-medium transition-colors",style:{border:"1px solid var(--border)",backgroundColor:"var(--bg-overlay)",color:"var(--text-muted)"},children:[s.jsx(na,{className:`h-3 w-3 shrink-0 ${i?"animate-spin":""}`,strokeWidth:2}),"Refresh"]}),s.jsxs("button",{type:"button",onClick:M,disabled:N||L===0,className:"flex items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-[11px] font-medium transition-colors disabled:opacity-40",style:{border:"1px solid var(--border)",backgroundColor:"var(--bg-overlay)",color:"var(--text-muted)"},children:[s.jsx(Yt,{className:"h-3 w-3 shrink-0",strokeWidth:2}),N?"Clearing…":"Clear"]})]})]}),s.jsx("div",{className:"px-4 py-2.5",style:{borderBottom:"1px solid var(--border)"},children:s.jsxs("div",{className:"relative",children:[s.jsx(zi,{className:"absolute left-2.5 top-1/2 h-3 w-3 -translate-y-1/2 shrink-0",style:{color:"var(--text-faint)"},strokeWidth:2}),s.jsx("input",{type:"text",placeholder:"Filter by filename or path…",value:x,onChange:T=>m(T.target.value),className:"w-full rounded-lg py-1.5 pl-8 pr-3 text-[12px] focus:outline-none focus:ring-1 focus:ring-blue-500/50",style:{border:"1px solid var(--border)",backgroundColor:"var(--bg-overlay)",color:"var(--text-primary)"}}),x&&s.jsx("button",{type:"button",onClick:()=>m(""),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-[10px]",style:{color:"var(--text-muted)"},children:"Clear"})]})}),f&&s.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 text-[11px]",style:{borderBottom:"1px solid var(--border)",color:"var(--text-muted)"},children:[s.jsx(Ht,{className:"h-3.5 w-3.5 shrink-0 text-red-400",strokeWidth:2}),f]}),s.jsx("div",{className:"flex flex-1 flex-col overflow-y-auto",children:i&&!r?s.jsxs("div",{className:"flex items-center justify-center gap-2 p-10",style:{color:"var(--text-muted)"},children:[s.jsx(na,{className:"h-4 w-4 animate-spin text-blue-400",strokeWidth:2}),s.jsx("span",{className:"text-[12px]",children:"Connecting…"})]}):Y.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center gap-1 p-10 text-center",children:[s.jsx(xt,{className:"h-5 w-5 mb-1 text-blue-400",strokeWidth:2}),s.jsx("span",{className:"text-[13px] font-medium",style:{color:"var(--text-primary)"},children:L===0?"No pending changes":"No files match filter"}),s.jsx("span",{className:"text-[11px]",style:{color:"var(--text-muted)"},children:L===0?"File edits appear here in real-time.":"Try a different search."})]}):Y.map(T=>{const{icon:R,color:G}=D4(T.filePath),X=T.filePath.split("/"),le=X.pop()??T.filePath,I=X.join("/"),K=b===T.filePath;return s.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5 transition-colors hover:bg-[var(--bg-overlay)]",style:{borderBottom:"1px solid var(--border)"},children:[s.jsx(R,{className:`h-[15px] w-[15px] shrink-0 ${G}`,strokeWidth:1.75}),s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[s.jsx("span",{className:"truncate text-[12.5px] font-medium",style:{color:"var(--text-primary)"},children:le}),I&&s.jsxs("span",{className:"truncate text-[11px]",style:{color:"var(--text-faint)"},children:[I,"/"]})]}),s.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[s.jsx("span",{className:"rounded px-1.5 py-0.5 text-[10px]",style:{border:"1px solid var(--border)",backgroundColor:"var(--bg-overlay)",color:"var(--text-faint)"},children:T.eventType}),s.jsx("span",{className:"w-14 text-right text-[11px]",style:{color:"var(--text-muted)"},children:H4(T.changedAt)}),s.jsx("button",{type:"button",onClick:()=>A(T.filePath),title:"Copy path",className:"flex h-6 w-6 items-center justify-center rounded transition-colors",style:{border:"1px solid var(--border)",backgroundColor:"var(--bg-overlay)",color:"var(--text-faint)"},children:K?s.jsx(xt,{className:"h-3 w-3 text-blue-400",strokeWidth:2}):s.jsx(a1,{className:"h-3 w-3",strokeWidth:2})})]})]},T.filePath)})})]})}function ms({icon:n,label:r,description:o}){return s.jsxs("div",{className:"flex items-start gap-3 pb-4 border-b border-white/10",children:[s.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-lg border border-white/10 bg-white/[0.04]",children:s.jsx(n,{className:"h-[15px] w-[15px] text-blue-400",strokeWidth:2})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[13.5px] font-medium text-white",children:r}),o&&s.jsx("p",{className:"mt-0.5 text-[11px] text-zinc-500",children:o})]})]})}function lt({label:n,description:r,children:o}){return s.jsxs("div",{className:"flex items-center justify-between gap-4 py-3 border-b border-white/[0.06] last:border-0",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-[13px] text-zinc-200",children:n}),r&&s.jsx("p",{className:"text-[11px] text-zinc-500 mt-0.5",children:r})]}),s.jsx("div",{className:"shrink-0",children:o})]})}function sn({value:n,onChange:r}){return s.jsx("button",{onClick:()=>r(!n),className:`relative flex h-5 w-9 items-center rounded-full border transition-colors ${n?"bg-blue-500 border-blue-400":"bg-white/[0.04] border-white/10"}`,children:s.jsx("span",{className:`absolute h-3.5 w-3.5 rounded-full bg-white shadow transition-transform ${n?"translate-x-4":"translate-x-0.5"}`})})}function U4({value:n,onChange:r,placeholder:o,mono:i=!1,type:u="text"}){return s.jsx("input",{type:u,value:n,onChange:f=>r(f.target.value),placeholder:o,className:`w-56 rounded-lg border border-white/10 bg-white/[0.03] px-3 py-1.5 text-[12px] text-zinc-200 outline-none focus:border-blue-500/50 focus:bg-white/[0.05] placeholder-zinc-600 transition-colors ${i?"font-mono":""}`})}function yl({value:n,onChange:r,options:o}){return s.jsx("select",{value:n,onChange:i=>r(i.target.value),className:"rounded-lg border border-white/10 bg-zinc-900 px-3 py-1.5 text-[12px] text-zinc-200 outline-none focus:border-blue-500/50 transition-colors",children:o.map(i=>s.jsx("option",{value:i,children:i},i))})}function gs({children:n,className:r=""}){return s.jsx("div",{className:`rounded-lg border border-white/10 bg-white/[0.02] p-5 space-y-1 ${r}`,children:n})}function gy({saving:n,onClick:r}){return s.jsxs("button",{onClick:r,disabled:n,className:"flex items-center gap-1.5 rounded-lg bg-blue-500 px-3 py-1.5 text-[12px] font-medium text-white hover:bg-blue-400 disabled:opacity-50 transition-colors",children:[n?s.jsx(ot,{className:"h-3.5 w-3.5 animate-spin",strokeWidth:2}):s.jsx(q1,{className:"h-3.5 w-3.5",strokeWidth:2}),n?"Saving…":"Save"]})}const B4=[{id:"general",label:"General",icon:zr},{id:"environments",label:"Environments",icon:vl},{id:"appearance",label:"Appearance",icon:z0},{id:"editor",label:"Editor",icon:Vi},{id:"notifications",label:"Notifications",icon:_0},{id:"api",label:"API & Auth",icon:Ya},{id:"advanced",label:"Advanced",icon:Pd}];function q4({model:n}){const[r,o]=j.useState(n?.project?.name??""),[i,u]=j.useState(n?.project?.language??"TypeScript"),[f,h]=j.useState(n?.project?.framework??"Express"),[g,p]=j.useState(!1),[x,m]=j.useState(!1);j.useEffect(()=>{o(n?.project?.name??""),u(n?.project?.language??"TypeScript"),h(n?.project?.framework??"Express")},[n]);const b=async()=>{p(!0),await new Promise(v=>setTimeout(v,600)),p(!1),m(!0),setTimeout(()=>m(!1),2e3)};return s.jsxs("div",{className:"space-y-5",children:[s.jsx(ms,{icon:zr,label:"General",description:"Project identity and basic configuration"}),s.jsxs(gs,{children:[s.jsx(lt,{label:"Project Name",description:"Display name shown in the dashboard",children:s.jsx(U4,{value:r,onChange:o,placeholder:"My API"})}),s.jsx(lt,{label:"Language",description:"Primary language of your backend",children:s.jsx(yl,{value:i,onChange:u,options:["TypeScript","JavaScript","Python","Go","Rust"]})}),s.jsx(lt,{label:"Framework",description:"HTTP framework used by your server",children:s.jsx(yl,{value:f,onChange:h,options:["Express","Fastify","Hono","Koa","NestJS","Other"]})}),s.jsxs("div",{className:"flex justify-end pt-2 gap-2",children:[x&&s.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-emerald-400",children:[s.jsx(xt,{className:"h-3.5 w-3.5",strokeWidth:2})," Saved"]}),s.jsx(gy,{saving:g,onClick:b})]})]})]})}function L4({model:n}){const[r,o]=j.useState(n?.environments??[{name:"local",baseUrl:"http://localhost:3000"}]),[i,u]=j.useState(!1),[f,h]=j.useState(!1);j.useEffect(()=>{o(n?.environments??[{name:"local",baseUrl:"http://localhost:3000"}])},[n]);const g=()=>o(b=>[...b,{name:"",baseUrl:""}]),p=b=>o(v=>v.filter((N,C)=>C!==b)),x=(b,v,N)=>o(C=>C.map((_,M)=>M===b?{..._,[v]:N}:_)),m=async()=>{u(!0),await new Promise(b=>setTimeout(b,600)),u(!1),h(!0),setTimeout(()=>h(!1),2e3)};return s.jsxs("div",{className:"space-y-5",children:[s.jsx(ms,{icon:vl,label:"Environments",description:"Configure your API base URLs for simulation"}),s.jsxs(gs,{children:[s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-4 px-1 mb-2",children:[s.jsx("p",{className:"w-24 text-[10px] uppercase tracking-wider text-zinc-600 font-semibold",children:"Name"}),s.jsx("p",{className:"flex-1 text-[10px] uppercase tracking-wider text-zinc-600 font-semibold",children:"Base URL"})]}),r.map((b,v)=>s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("input",{value:b.name,onChange:N=>x(v,"name",N.target.value),placeholder:"local",className:"w-24 rounded-lg border border-white/10 bg-white/[0.03] px-3 py-1.5 text-[12px] text-zinc-200 outline-none focus:border-blue-500/50 focus:bg-white/[0.05] placeholder-zinc-600 transition-colors"}),s.jsx("input",{value:b.baseUrl,onChange:N=>x(v,"baseUrl",N.target.value),placeholder:"http://localhost:3000",className:"flex-1 rounded-lg border border-white/10 bg-white/[0.03] px-3 py-1.5 font-mono text-[12px] text-zinc-200 outline-none focus:border-blue-500/50 focus:bg-white/[0.05] placeholder-zinc-600 transition-colors"}),s.jsx("button",{onClick:()=>p(v),className:"flex h-7 w-7 items-center justify-center rounded-lg border border-white/10 bg-white/[0.03] text-zinc-500 hover:bg-red-500/10 hover:border-red-500/30 hover:text-red-400 transition-colors",children:s.jsx(Ct,{className:"h-3.5 w-3.5",strokeWidth:2})})]},v)),s.jsx("button",{onClick:g,className:"text-[12px] text-blue-400 hover:text-blue-300 transition-colors mt-1",children:"+ Add environment"})]}),s.jsxs("div",{className:"flex justify-end pt-3 gap-2 border-t border-white/[0.06]",children:[f&&s.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-emerald-400",children:[s.jsx(xt,{className:"h-3.5 w-3.5",strokeWidth:2})," Saved"]}),s.jsx(gy,{saving:i,onClick:m})]})]}),s.jsxs("div",{className:"rounded-lg border border-white/10 bg-white/[0.02] px-4 py-3 flex items-start gap-2.5",children:[s.jsx(g1,{className:"h-3.5 w-3.5 text-blue-400/70 shrink-0 mt-0.5",strokeWidth:2}),s.jsxs("p",{className:"text-[11px] text-zinc-500",children:["The"," ",s.jsx("code",{className:"text-zinc-300 bg-white/[0.06] px-1 py-0.5 rounded text-[10px]",children:"local"})," ","environment is used as the default base URL for simulations and endpoint testing."]})]})]})}function Y4(){const[n,r]=j.useState("dark"),[o,i]=j.useState("blue"),[u,f]=j.useState("comfortable"),[h,g]=j.useState(!0),p=["blue","violet","emerald","amber","rose"],x={blue:"#3b82f6",violet:"#8b5cf6",emerald:"#34d399",amber:"#fbbf24",rose:"#fb7185"};return s.jsxs("div",{className:"space-y-5",children:[s.jsx(ms,{icon:z0,label:"Appearance",description:"Customize the look and feel of the dashboard"}),s.jsxs(gs,{children:[s.jsx(lt,{label:"Theme",description:"Choose your preferred colour scheme",children:s.jsx("div",{className:"flex gap-px overflow-hidden rounded-lg border border-white/10",children:["dark","darker"].map(m=>s.jsx("button",{onClick:()=>r(m),className:`px-3 py-1.5 text-[12px] transition-colors capitalize ${n===m?"bg-blue-500 text-white":"text-zinc-400 hover:text-zinc-200 bg-white/[0.02] hover:bg-white/[0.05]"}`,children:m},m))})}),s.jsx(lt,{label:"Accent Colour",description:"Primary highlight colour throughout the UI",children:s.jsx("div",{className:"flex items-center gap-2",children:p.map(m=>s.jsx("button",{onClick:()=>i(m),className:`h-5 w-5 rounded-full border-2 transition-transform ${o===m?"scale-110 border-white/40":"border-transparent hover:scale-105"}`,style:{background:x[m]}},m))})}),s.jsx(lt,{label:"Density",description:"Controls spacing throughout the layout",children:s.jsx("div",{className:"flex gap-px overflow-hidden rounded-lg border border-white/10",children:["comfortable","compact"].map(m=>s.jsx("button",{onClick:()=>f(m),className:`px-3 py-1.5 text-[12px] transition-colors capitalize ${u===m?"bg-blue-500 text-white":"text-zinc-400 hover:text-zinc-200 bg-white/[0.02] hover:bg-white/[0.05]"}`,children:m},m))})}),s.jsx(lt,{label:"Animations",description:"Smooth transitions and micro-animations",children:s.jsx(sn,{value:h,onChange:g})})]})]})}function V4(){const[n,r]=j.useState("11"),[o,i]=j.useState("2"),[u,f]=j.useState(!0),[h,g]=j.useState(!0),[p,x]=j.useState(!0);return s.jsxs("div",{className:"space-y-5",children:[s.jsx(ms,{icon:Vi,label:"Editor",description:"Source viewer and code display preferences"}),s.jsxs(gs,{children:[s.jsx(lt,{label:"Font Size",description:"Monospace font size in the source viewer",children:s.jsx(yl,{value:n,onChange:r,options:["10","11","12","13","14"]})}),s.jsx(lt,{label:"Tab Size",description:"Number of spaces per indentation level",children:s.jsx(yl,{value:o,onChange:i,options:["2","4","8"]})}),s.jsx(lt,{label:"Word Wrap",description:"Wrap long lines in the source viewer",children:s.jsx(sn,{value:u,onChange:f})}),s.jsx(lt,{label:"Line Numbers",description:"Show line numbers in the source viewer gutter",children:s.jsx(sn,{value:h,onChange:g})}),s.jsx(lt,{label:"Highlight Handler Line",description:"Highlight the matched handler line in source view",children:s.jsx(sn,{value:p,onChange:x})})]})]})}function G4(){const[n,r]=j.useState(!0),[o,i]=j.useState(!0),[u,f]=j.useState(!0),[h,g]=j.useState(!1),[p,x]=j.useState(!1);return s.jsxs("div",{className:"space-y-5",children:[s.jsx(ms,{icon:_0,label:"Notifications",description:"Control when and how you're notified"}),s.jsxs(gs,{children:[s.jsx(lt,{label:"Scan complete",description:"Notify when a project scan finishes",children:s.jsx(sn,{value:n,onChange:r})}),s.jsx(lt,{label:"Simulation complete",description:"Notify when a workflow run finishes",children:s.jsx(sn,{value:o,onChange:i})}),s.jsx(lt,{label:"Simulation failure",description:"Notify when a workflow step fails",children:s.jsx(sn,{value:u,onChange:f})}),s.jsx(lt,{label:"Memory updates",description:"Notify on runtime memory changes",children:s.jsx(sn,{value:h,onChange:g})}),s.jsx(lt,{label:"Desktop notifications",description:"Show browser push notifications",children:s.jsx(sn,{value:p,onChange:x})})]})]})}function X4(){const[n,r]=j.useState(""),[o,i]=j.useState("10000"),[u,f]=j.useState(!1),[h,g]=j.useState(!1);return s.jsxs("div",{className:"space-y-5",children:[s.jsx(ms,{icon:Ya,label:"API & Auth",description:"Default request settings for endpoint simulation"}),s.jsxs(gs,{children:[s.jsx(lt,{label:"Default Bearer Token",description:"Pre-fill bearer token in simulate panels",children:s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("input",{type:h?"text":"password",value:n,onChange:p=>r(p.target.value),placeholder:"eyJ…",className:"w-48 rounded-lg border border-white/10 bg-white/[0.03] px-3 py-1.5 font-mono text-[12px] text-zinc-200 outline-none focus:border-blue-500/50 focus:bg-white/[0.05] placeholder-zinc-600 transition-colors"}),s.jsx("button",{onClick:()=>g(p=>!p),className:"text-[11px] text-zinc-500 hover:text-zinc-300 transition-colors",children:h?"Hide":"Show"})]})}),s.jsx(lt,{label:"Request Timeout",description:"Milliseconds before a simulated request times out",children:s.jsx(yl,{value:o,onChange:i,options:["5000","10000","15000","30000","60000"]})}),s.jsx(lt,{label:"Auto-retry on 5xx",description:"Automatically retry failed requests once",children:s.jsx(sn,{value:u,onChange:f})})]})]})}function Z4({onClearMemory:n}){const[r,o]=j.useState(!1),[i,u]=j.useState(!1),[f,h]=j.useState(!1),[g,p]=j.useState("30"),[x,m]=j.useState(!1),[b,v]=j.useState(!1),N=async()=>{m(!0),await new Promise(C=>setTimeout(C,800)),m(!1),v(!0),setTimeout(()=>v(!1),2e3),n()};return s.jsxs("div",{className:"space-y-5",children:[s.jsx(ms,{icon:Pd,label:"Advanced",description:"Developer and diagnostic options"}),s.jsxs(gs,{children:[s.jsx(lt,{label:"Scan on start",description:"Auto-scan project when the dashboard loads",children:s.jsx(sn,{value:r,onChange:o})}),s.jsx(lt,{label:"Auto-refresh model",description:"Periodically reload model.json from disk",children:s.jsx(sn,{value:f,onChange:h})}),f&&s.jsx(lt,{label:"Refresh interval",description:"How often to poll for model changes",children:s.jsx(yl,{value:g,onChange:p,options:["10","30","60","120"]})}),s.jsx(lt,{label:"Debug mode",description:"Verbose logging in the browser console",children:s.jsx(sn,{value:i,onChange:u})})]}),s.jsxs("div",{className:"rounded-lg border border-red-500/20 bg-red-500/[0.03] overflow-hidden",children:[s.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 border-b border-red-500/10",children:[s.jsx(Yt,{className:"h-[15px] w-[15px] text-red-400/60",strokeWidth:2}),s.jsx("span",{className:"text-[11px] font-semibold tracking-wider text-red-400/70",children:"DANGER ZONE"})]}),s.jsxs("div",{className:"p-4 space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between gap-4",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-[13px] text-zinc-200",children:"Clear Runtime Memory"}),s.jsx("p",{className:"text-[11px] text-zinc-500 mt-0.5",children:"Delete all stored memory keys and values"})]}),s.jsxs("button",{onClick:N,disabled:x,className:"flex items-center gap-1.5 rounded-lg border border-red-500/30 bg-red-500/[0.06] px-3 py-1.5 text-[12px] text-red-400 hover:bg-red-500/10 disabled:opacity-50 transition-colors",children:[x?s.jsx(ot,{className:"h-3.5 w-3.5 animate-spin",strokeWidth:2}):b?s.jsx(xt,{className:"h-3.5 w-3.5",strokeWidth:2}):s.jsx(Yt,{className:"h-3.5 w-3.5",strokeWidth:2}),x?"Clearing…":b?"Cleared":"Clear Memory"]})]}),s.jsxs("div",{className:"flex items-center justify-between gap-4 pt-3 border-t border-red-500/10",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-[13px] text-zinc-200",children:"Reset Model"}),s.jsxs("p",{className:"text-[11px] text-zinc-500 mt-0.5",children:["Delete"," ",s.jsx("code",{className:"text-zinc-400 bg-white/[0.06] px-1 py-0.5 rounded text-[10px]",children:".jetic/model.json"})," ","and start fresh"]})]}),s.jsxs("button",{className:"flex items-center gap-1.5 rounded-lg border border-red-500/30 bg-red-500/[0.06] px-3 py-1.5 text-[12px] text-red-400 hover:bg-red-500/10 transition-colors",children:[s.jsx(Yt,{className:"h-3.5 w-3.5",strokeWidth:2})," Reset Model"]})]})]})]})]})}function W4(){return s.jsxs("div",{className:"rounded-lg border border-white/10 bg-white/[0.02] p-4 flex items-center gap-3",children:[s.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg border border-white/10 bg-white/[0.04]",children:s.jsx(aa,{className:"h-[15px] w-[15px] text-blue-400",strokeWidth:2})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[13.5px] font-medium text-white",children:"Jetic Studio"}),s.jsx("p",{className:"text-[11px] text-zinc-500",children:"v0.1.0 · Local development dashboard"})]}),s.jsxs("div",{className:"ml-auto flex items-center gap-1.5 rounded-full border border-white/10 bg-white/[0.02] px-2.5 py-1",children:[s.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-blue-500 animate-pulse"}),s.jsx("span",{className:"text-[11px] text-zinc-400 font-medium",children:"Running"})]})]})}function Q4({icon:n,label:r,active:o,onClick:i}){return s.jsxs("button",{type:"button",onClick:i,className:`relative flex w-full items-center gap-3 rounded-lg px-3 py-1.5 text-left text-[13.5px] transition-colors ${o?"bg-white/[0.07] text-white font-medium":"text-zinc-400 hover:bg-white/[0.03] hover:text-zinc-200"}`,children:[o&&s.jsx("span",{className:"absolute -left-3 top-1/2 h-4 w-[3px] -translate-y-1/2 rounded-full bg-blue-500"}),s.jsx(n,{className:"h-[15px] w-[15px] shrink-0",strokeWidth:2}),s.jsx("span",{children:r}),o&&s.jsx(bl,{className:"ml-auto h-3.5 w-3.5 opacity-40",strokeWidth:2})]})}function K4(){const[n,r]=j.useState("general"),[o,i]=j.useState(null),[u,f]=j.useState(!0);j.useEffect(()=>{fetch("/api/model").then(g=>g.ok?g.json():null).then(g=>i(g)).catch(()=>{}).finally(()=>f(!1))},[]);const h=()=>{switch(n){case"general":return s.jsx(q4,{model:o});case"environments":return s.jsx(L4,{model:o});case"appearance":return s.jsx(Y4,{});case"editor":return s.jsx(V4,{});case"notifications":return s.jsx(G4,{});case"api":return s.jsx(X4,{});case"advanced":return s.jsx(Z4,{onClearMemory:()=>{}});default:return null}};return s.jsxs("div",{className:"flex min-h-full w-full flex-col",children:[s.jsx("div",{className:"flex items-center justify-between border-b border-white/10 px-6 py-5",children:s.jsxs("div",{children:[s.jsx("h1",{className:"text-[15px] font-medium text-white leading-none",children:"Settings"}),s.jsx("p",{className:"mt-0.5 text-[11px] text-zinc-500",children:"Configure Jetic Studio"})]})}),s.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[s.jsxs("nav",{className:"w-52 shrink-0 border-r border-white/10 bg-black/20 select-none overflow-y-auto p-3 space-y-0.5",children:[s.jsx("span",{className:"px-3 pb-1.5 pt-1 block text-[11px] font-semibold tracking-wider text-zinc-500",children:"CONFIGURATION"}),s.jsx("div",{className:"flex flex-col gap-0.5",children:B4.map(({id:g,label:p,icon:x})=>s.jsx(Q4,{icon:x,label:p,active:n===g,onClick:()=>r(g)},g))}),s.jsx("div",{className:"hidden pt-4 mt-2 border-t border-white/10",children:s.jsxs("div",{className:"flex items-center gap-1.5 rounded-full border border-white/10 bg-white/[0.02] px-2.5 py-1 w-fit",children:[s.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-blue-500"}),s.jsx("span",{className:"text-[11px] font-medium text-zinc-400",children:"v0.1.0"})]})})]}),s.jsx("div",{className:"flex-1 overflow-y-auto p-6 space-y-5",children:u?s.jsx("div",{className:"space-y-3",children:[1,2,3].map(g=>s.jsx("div",{className:"h-16 animate-pulse rounded-lg border border-white/10 bg-white/[0.02]",style:{opacity:1-g*.25}},g))}):s.jsxs(s.Fragment,{children:[s.jsx(W4,{}),h()]})})]})]})}function J4(){return s.jsxs("div",{className:"p-8",children:[s.jsx("h1",{className:"text-2xl font-semibold text-white",children:"Docs"}),s.jsx("p",{className:"mt-4 text-zinc-400",children:"This is the Docs page."})]})}const I4=["overview","simulations","model","inspect","agents","tools","context","memory","apis","email","oauth","webhooks","traces","events","changes","settings","docs"];function F4(){const[n,r]=j.useState(()=>{const v=localStorage.getItem("active_sidebar_item");return I4.includes(v)?v:"overview"}),[o,i]=j.useState(!1),[u,f]=j.useState(()=>{try{const v=localStorage.getItem("inspected_endpoint");return v?JSON.parse(v):null}catch{return null}}),[h,g]=j.useState(void 0);j.useEffect(()=>{localStorage.setItem("active_sidebar_item",n)},[n]),j.useEffect(()=>{u?localStorage.setItem("inspected_endpoint",JSON.stringify(u)):localStorage.removeItem("inspected_endpoint")},[u]);const p=v=>{v!=="inspect"&&f(null),v!=="traces"&&g(void 0),r(v)},x=v=>{f(v),r("inspect")},m=v=>{g(v),r("traces")},b=()=>{switch(n){case"overview":return s.jsx(pm,{onNavigate:p});case"simulations":return s.jsx(R3,{onViewTraces:m});case"model":return s.jsx(X3,{onInspect:x,onViewTraces:m});case"inspect":return s.jsx(K3,{endpoint:u,onBack:()=>p("model")});case"agents":return s.jsx(J3,{});case"tools":return s.jsx(I3,{});case"context":return s.jsx(F3,{});case"memory":return s.jsx(u4,{});case"apis":return s.jsx(d4,{});case"email":return s.jsx(f4,{});case"oauth":return s.jsx(h4,{});case"webhooks":return s.jsx(x4,{});case"traces":return s.jsx(z4,{initialFilter:h,onNavigate:p});case"events":return s.jsx(O4,{});case"changes":return s.jsx($4,{onNavigate:p});case"settings":return s.jsx(K4,{});case"docs":return s.jsx(J4,{});default:return s.jsx(pm,{})}};return s.jsxs("div",{className:"flex h-screen w-full overflow-hidden antialiased [font-feature-settings:'ss01'] font-sans text-xs transition-colors duration-300",style:{backgroundColor:"var(--bg-base)",color:"var(--text-secondary)"},children:[s.jsx(i2,{currentPage:n,onNavigate:p,onToggleAssistant:()=>i(!o),isAssistantOpen:o}),s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col relative",children:[s.jsx("div",{className:"flex min-h-0 flex-1 overflow-auto transition-colors duration-300",style:{backgroundColor:"var(--bg-base)"},children:b()}),s.jsx(c2,{isOpen:o,onClose:()=>i(!1)})]})]})}const P4=()=>s.jsx(s2,{children:s.jsx(F4,{})});Rv.createRoot(document.getElementById("root")).render(s.jsx(j.StrictMode,{children:s.jsx(P4,{})}));
|