jetic-cli 0.2.3 → 0.2.4
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 +57 -7
- package/dist/dashboard/assets/index-B7pzujvn.js +404 -0
- package/dist/dashboard/assets/index-CAj2uFAP.css +1 -0
- package/dist/dashboard/index.html +2 -2
- package/dist/index.js +298 -22
- package/package.json +1 -1
- package/dist/dashboard/assets/index-8Xh271uc.js +0 -384
- package/dist/dashboard/assets/index-ANQK1AeT.css +0 -1
|
@@ -1,384 +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 w0(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var ad={exports:{}},yr={};/**
|
|
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 Pp;function wv(){if(Pp)return yr;Pp=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 yr.Fragment=r,yr.jsx=o,yr.jsxs=o,yr}var em;function Sv(){return em||(em=1,ad.exports=wv()),ad.exports}var s=Sv(),sd={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 tm;function Ev(){if(tm)return De;tm=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"),y=Symbol.iterator;function v(E){return E===null||typeof E!="object"?null:(E=y&&E[y]||E["@@iterator"],typeof E=="function"?E:null)}var j={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,_={};function T(E,$,W){this.props=E,this.context=$,this.refs=_,this.updater=W||j}T.prototype.isReactComponent={},T.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")},T.prototype.forceUpdate=function(E){this.updater.enqueueForceUpdate(this,E,"forceUpdate")};function M(){}M.prototype=T.prototype;function Y(E,$,W){this.props=E,this.context=$,this.refs=_,this.updater=W||j}var L=Y.prototype=new M;L.constructor=Y,C(L,T.prototype),L.isPureReactComponent=!0;var R=Array.isArray,O={H:null,A:null,T:null,S:null,V:null},Z=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 oe(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 J(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?J(""+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,R(ie)?(W="",xe!=null&&(W=xe.replace(ne,"$&/")+"/"),U(ie,$,W,"",function(Ae){return Ae})):ie!=null&&(I(ie)&&(ie=oe(ie,W+(ie.key==null||E&&E.key===ie.key?"":(""+ie.key).replace(ne,"$&/")+"/")+xe)),$.push(ie)),1;xe=0;var we=ae===""?".":ae+":";if(R(E))for(var ve=0;ve<E.length;ve++)ae=E[ve],he=we+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=we+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 z(){}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=T,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=O,De.__COMPILER_RUNTIME={__proto__:null,c:function(E){return O.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),$)!Z.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 we=Array(xe),ve=0;ve<xe;ve++)we[ve]=arguments[ve+2];ae.children=we}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),$)Z.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 we=Array(xe),ve=0;ve<xe;ve++)we[ve]=arguments[ve+2];ie.children=we}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 $=O.T,W={};O.T=W;try{var ae=E(),ie=O.S;ie!==null&&ie(W,ae),typeof ae=="object"&&ae!==null&&typeof ae.then=="function"&&ae.then(z,D)}catch(he){D(he)}finally{O.T=$}},De.unstable_useCacheRefresh=function(){return O.H.useCacheRefresh()},De.use=function(E){return O.H.use(E)},De.useActionState=function(E,$,W){return O.H.useActionState(E,$,W)},De.useCallback=function(E,$){return O.H.useCallback(E,$)},De.useContext=function(E){return O.H.useContext(E)},De.useDebugValue=function(){},De.useDeferredValue=function(E,$){return O.H.useDeferredValue(E,$)},De.useEffect=function(E,$,W){var ae=O.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 O.H.useId()},De.useImperativeHandle=function(E,$,W){return O.H.useImperativeHandle(E,$,W)},De.useInsertionEffect=function(E,$){return O.H.useInsertionEffect(E,$)},De.useLayoutEffect=function(E,$){return O.H.useLayoutEffect(E,$)},De.useMemo=function(E,$){return O.H.useMemo(E,$)},De.useOptimistic=function(E,$){return O.H.useOptimistic(E,$)},De.useReducer=function(E,$,W){return O.H.useReducer(E,$,W)},De.useRef=function(E){return O.H.useRef(E)},De.useState=function(E){return O.H.useState(E)},De.useSyncExternalStore=function(E,$,W){return O.H.useSyncExternalStore(E,$,W)},De.useTransition=function(){return O.H.useTransition()},De.version="19.1.1",De}var nm;function Lr(){return nm||(nm=1,sd.exports=Ev()),sd.exports}var N=Lr();const le=w0(N);var ld={exports:{}},vr={},rd={exports:{}},od={};/**
|
|
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 am;function kv(){return am||(am=1,(function(n){function r(k,H){var D=k.length;k.push(H);e:for(;0<D;){var z=D-1>>>1,E=k[z];if(0<u(E,H))k[z]=H,k[D]=E,D=z;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 z=0,E=k.length,$=E>>>1;z<$;){var W=2*(z+1)-1,ae=k[W],ie=W+1,he=k[ie];if(0>u(ae,D))ie<E&&0>u(he,ae)?(k[z]=he,k[ie]=D,z=ie):(k[z]=ae,k[W]=D,z=W);else if(ie<E&&0>u(he,D))k[z]=he,k[ie]=D,z=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,y=null,v=3,j=!1,C=!1,_=!1,T=!1,M=typeof setTimeout=="function"?setTimeout:null,Y=typeof clearTimeout=="function"?clearTimeout:null,L=typeof setImmediate<"u"?setImmediate:null;function R(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 O(k){if(_=!1,R(k),!C)if(o(p)!==null)C=!0,Z||(Z=!0,ee());else{var H=o(x);H!==null&&U(O,H.startTime-k)}}var Z=!1,X=-1,oe=5,I=-1;function J(){return T?!0:!(n.unstable_now()-I<oe)}function ne(){if(T=!1,Z){var k=n.unstable_now();I=k;var H=!0;try{e:{C=!1,_&&(_=!1,Y(X),X=-1),j=!0;var D=v;try{t:{for(R(k),y=o(p);y!==null&&!(y.expirationTime>k&&J());){var z=y.callback;if(typeof z=="function"){y.callback=null,v=y.priorityLevel;var E=z(y.expirationTime<=k);if(k=n.unstable_now(),typeof E=="function"){y.callback=E,R(k),H=!0;break t}y===o(p)&&i(p),R(k)}else i(p);y=o(p)}if(y!==null)H=!0;else{var $=o(x);$!==null&&U(O,$.startTime-k),H=!1}}break e}finally{y=null,v=D,j=!1}H=void 0}}finally{H?ee():Z=!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(){M(ne,0)};function U(k,H){X=M(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"):oe=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(){T=!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 z=n.unstable_now();switch(typeof D=="object"&&D!==null?(D=D.delay,D=typeof D=="number"&&0<D?z+D:z):D=z,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>z?(k.sortIndex=D,r(x,k),o(p)===null&&k===o(x)&&(_?(Y(X),X=-1):_=!0,U(O,D-z))):(k.sortIndex=E,r(p,k),C||j||(C=!0,Z||(Z=!0,ee()))),k},n.unstable_shouldYield=J,n.unstable_wrapCallback=function(k){var H=v;return function(){var D=v;v=H;try{return k.apply(this,arguments)}finally{v=D}}}})(od)),od}var sm;function _v(){return sm||(sm=1,rd.exports=kv()),rd.exports}var id={exports:{}},Bt={};/**
|
|
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 lm;function Cv(){if(lm)return Bt;lm=1;var n=Lr();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 y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:y==null?null:""+y,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 Bt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,Bt.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)},Bt.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()}},Bt.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))},Bt.prefetchDNS=function(p){typeof p=="string"&&i.d.D(p)},Bt.preinit=function(p,x){if(typeof p=="string"&&x&&typeof x.as=="string"){var m=x.as,y=g(m,x.crossOrigin),v=typeof x.integrity=="string"?x.integrity:void 0,j=typeof x.fetchPriority=="string"?x.fetchPriority:void 0;m==="style"?i.d.S(p,typeof x.precedence=="string"?x.precedence:void 0,{crossOrigin:y,integrity:v,fetchPriority:j}):m==="script"&&i.d.X(p,{crossOrigin:y,integrity:v,fetchPriority:j,nonce:typeof x.nonce=="string"?x.nonce:void 0})}},Bt.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)},Bt.preload=function(p,x){if(typeof p=="string"&&typeof x=="object"&&x!==null&&typeof x.as=="string"){var m=x.as,y=g(m,x.crossOrigin);i.d.L(p,m,{crossOrigin:y,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})}},Bt.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)},Bt.requestFormReset=function(p){i.d.r(p)},Bt.unstable_batchedUpdates=function(p,x){return p(x)},Bt.useFormState=function(p,x,m){return h.H.useFormState(p,x,m)},Bt.useFormStatus=function(){return h.H.useHostTransitionStatus()},Bt.version="19.1.1",Bt}var rm;function S0(){if(rm)return id.exports;rm=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(),id.exports=Cv(),id.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 om;function Tv(){if(om)return vr;om=1;var n=_v(),r=Lr(),o=S0();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 b=!1,w=c.child;w;){if(w===a){b=!0,a=c,l=d;break}if(w===l){b=!0,l=c,a=d;break}w=w.sibling}if(!b){for(w=d.child;w;){if(w===a){b=!0,a=d,l=c;break}if(w===l){b=!0,l=d,a=c;break}w=w.sibling}if(!b)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,y=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),j=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),M=Symbol.for("react.provider"),Y=Symbol.for("react.consumer"),L=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),Z=Symbol.for("react.suspense_list"),X=Symbol.for("react.memo"),oe=Symbol.for("react.lazy"),I=Symbol.for("react.activity"),J=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 T:return"Profiler";case _:return"StrictMode";case O:return"Suspense";case Z:return"SuspenseList";case I:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case j:return"Portal";case L:return(e.displayName||"Context")+".Provider";case Y:return(e._context.displayName||"Context")+".Consumer";case R: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 oe: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},z=[],E=-1;function $(e){return{current:e}}function W(e){0>E||(e.current=z[E],z[E]=null,E--)}function ae(e,t){E++,z[E]=e.current,e.current=t}var ie=$(null),he=$(null),xe=$(null),we=$(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)?_p(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=_p(t),e=Cp(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(we,e);var t=ie.current,a=Cp(t,e.type);t!==a&&(ae(he,e),ae(ie,a))}function We(e){he.current===e&&(W(ie),W(he)),we.current===e&&(W(we),xr._currentValue=D)}var Te=Object.prototype.hasOwnProperty,ye=n.unstable_scheduleCallback,q=n.unstable_cancelCallback,V=n.unstable_shouldYield,ue=n.unstable_requestPaint,re=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 xt(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 Yt(e,t,a){var l=e.pendingLanes;if(l===0)return 0;var c=0,d=e.suspendedLanes,b=e.pingedLanes;e=e.warmLanes;var w=l&134217727;return w!==0?(l=w&~d,l!==0?c=Rt(l):(b&=w,b!==0?c=Rt(b):a||(a=w&~e,a!==0&&(c=Rt(a))))):(w=l&~d,w!==0?c=Rt(w):b!==0?c=Rt(b):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 bs(){var e=Le;return Le<<=1,(Le&4194048)===0&&(Le=256),e}function la(){var e=Ge;return Ge<<=1,(Ge&62914560)===0&&(Ge=4194304),e}function Ya(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function ra(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 b=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,A=e.expirationTimes,K=e.hiddenUpdates;for(a=b&~a;0<a;){var ce=31-at(a),fe=1<<ce;w[ce]=0,A[ce]=-1;var F=K[ce];if(F!==null)for(K[ce]=null,ce=0;ce<F.length;ce++){var te=F[ce];te!==null&&(te.lane&=-536870913)}a&=~fe}l!==0&&Wr(e,l,0),d!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=d&~(b&~t))}function Wr(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 Qr(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 Kr(){var e=H.p;return e!==0?e:(e=window.event,e===void 0?32:Wp(e.type))}function Ji(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,$t="__reactProps$"+_n,oa="__reactContainer$"+_n,Sl="__reactEvents$"+_n,Ii="__reactListeners$"+_n,Fi="__reactHandles$"+_n,Jr="__reactResources$"+_n,Va="__reactMarker$"+_n;function El(e){delete e[wt],delete e[$t],delete e[Sl],delete e[Ii],delete e[Fi]}function Hn(e){var t=e[wt];if(t)return t;for(var a=e.parentNode;a;){if(t=a[oa]||a[wt]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=Rp(e);e!==null;){if(a=e[wt])return a;e=Rp(e)}return t}e=a,a=e.parentNode}return null}function ia(e){if(e=e[wt]||e[oa]){var t=e.tag;if(t===5||t===6||t===13||t===26||t===27||t===3)return e}return null}function Ga(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function ca(e){var t=e[Jr];return t||(t=e[Jr]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function pt(e){e[Va]=!0}var Ir=new Set,Fr={};function $n(e,t){ua(e,t),ua(e+"Capture",t)}function ua(e,t){for(Fr[e]=t,e=0;e<t.length;e++)Ir.add(t[e])}var Pr=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]*$"),eo={},to={};function Pi(e){return Te.call(to,e)?!0:Te.call(eo,e)?!1:Pr.test(e)?to[e]=!0:(eo[e]=!0,!1)}function ys(e,t,a){if(Pi(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 yn(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,no;function da(e){if(js===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);js=t&&t[1]||"",no=-1<a.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+js+e+no}var kl=!1;function Xa(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(),b=d[0],w=d[1];if(b&&w){var A=b.split(`
|
|
44
|
-
`),K=w.split(`
|
|
45
|
-
`);for(c=l=0;l<A.length&&!A[l].includes("DetermineComponentFrameRoot");)l++;for(;c<K.length&&!K[c].includes("DetermineComponentFrameRoot");)c++;if(l===A.length||c===K.length)for(l=A.length-1,c=K.length-1;1<=l&&0<=c&&A[l]!==K[c];)c--;for(;1<=l&&0<=c;l--,c--)if(A[l]!==K[c]){if(l!==1||c!==1)do if(l--,c--,0>c||A[l]!==K[c]){var ce=`
|
|
46
|
-
`+A[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:"")?da(a):""}function gb(e){switch(e.tag){case 26:case 27:case 5:return da(e.type);case 16:return da("Lazy");case 13:return da("Suspense");case 19:return da("SuspenseList");case 0:case 15:return Xa(e.type,!1);case 11:return Xa(e.type.render,!1);case 1:return Xa(e.type,!0);case 31:return da("Activity");default:return""}}function jf(e){try{var t="";do t+=gb(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 Nf(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function bb(e){var t=Nf(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(b){l=""+b,d.call(this,b)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return l},setValue:function(b){l=""+b},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ao(e){e._valueTracker||(e._valueTracker=bb(e))}function wf(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),l="";return e&&(l=Nf(e)?e.checked?"true":"false":e.value),e=l,e!==a?(t.setValue(e),!0):!1}function so(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 yb=/[\n"\\]/g;function cn(e){return e.replace(yb,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ec(e,t,a,l,c,d,b,w){e.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.type=b:e.removeAttribute("type"),t!=null?b==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+on(t)):e.value!==""+on(t)&&(e.value=""+on(t)):b!=="submit"&&b!=="reset"||e.removeAttribute("value"),t!=null?tc(e,b,on(t)):a!=null?tc(e,b,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 Sf(e,t,a,l,c,d,b,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,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(e.name=b)}function tc(e,t,a){t==="number"&&so(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 Ef(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 kf(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 vb=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 _f(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||vb.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function Cf(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&&_f(e,c,l)}else for(var d in t)t.hasOwnProperty(d)&&_f(e,d,t[d])}function nc(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 jb=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"]]),Nb=/^[\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 lo(e){return Nb.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var ac=null;function sc(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 Tf(e){var t=ia(e);if(t&&(e=t.stateNode)){var a=e[$t]||null;e:switch(e=t.stateNode,t.type){case"input":if(ec(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[$t]||null;if(!c)throw Error(i(90));ec(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&&wf(l)}break e;case"textarea":Ef(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&Ns(e,!!a.multiple,t,!1)}}}var lc=!1;function Mf(e,t,a){if(lc)return e(t,a);lc=!0;try{var l=e(t);return l}finally{if(lc=!1,(Ss!==null||Es!==null)&&(Xo(),Ss&&(t=Ss,e=Es,Es=Ss=null,Tf(t),e)))for(t=0;t<e.length;t++)Tf(e[t])}}function _l(e,t){var a=e.stateNode;if(a===null)return null;var l=a[$t]||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"),rc=!1;if(Un)try{var Cl={};Object.defineProperty(Cl,"passive",{get:function(){rc=!0}}),window.addEventListener("test",Cl,Cl),window.removeEventListener("test",Cl,Cl)}catch{rc=!1}var fa=null,oc=null,ro=null;function Af(){if(ro)return ro;var e,t=oc,a=t.length,l,c="value"in fa?fa.value:fa.textContent,d=c.length;for(e=0;e<a&&t[e]===c[e];e++);var b=a-e;for(l=1;l<=b&&t[a-l]===c[d-l];l++);return ro=c.slice(e,1<l?1-l:void 0)}function oo(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 io(){return!0}function Rf(){return!1}function Xt(e){function t(a,l,c,d,b){this._reactName=a,this._targetInst=c,this.type=l,this.nativeEvent=d,this.target=b,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)?io:Rf,this.isPropagationStopped=Rf,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=io)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=io)},persist:function(){},isPersistent:io}),t}var Za={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},co=Xt(Za),Tl=m({},Za,{view:0,detail:0}),wb=Xt(Tl),ic,cc,Ml,uo=m({},Tl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:dc,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"?(ic=e.screenX-Ml.screenX,cc=e.screenY-Ml.screenY):cc=ic=0,Ml=e),ic)},movementY:function(e){return"movementY"in e?e.movementY:cc}}),zf=Xt(uo),Sb=m({},uo,{dataTransfer:0}),Eb=Xt(Sb),kb=m({},Tl,{relatedTarget:0}),uc=Xt(kb),_b=m({},Za,{animationName:0,elapsedTime:0,pseudoElement:0}),Cb=Xt(_b),Tb=m({},Za,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Mb=Xt(Tb),Ab=m({},Za,{data:0}),Of=Xt(Ab),Rb={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},zb={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"},Ob={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Db(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Ob[e])?!!t[e]:!1}function dc(){return Db}var Hb=m({},Tl,{key:function(e){if(e.key){var t=Rb[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=oo(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?zb[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:dc,charCode:function(e){return e.type==="keypress"?oo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?oo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),$b=Xt(Hb),Ub=m({},uo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Df=Xt(Ub),Bb=m({},Tl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:dc}),qb=Xt(Bb),Lb=m({},Za,{propertyName:0,elapsedTime:0,pseudoElement:0}),Yb=Xt(Lb),Vb=m({},uo,{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}),Gb=Xt(Vb),Xb=m({},Za,{newState:0,oldState:0}),Zb=Xt(Xb),Wb=[9,13,27,32],fc=Un&&"CompositionEvent"in window,Al=null;Un&&"documentMode"in document&&(Al=document.documentMode);var Qb=Un&&"TextEvent"in window&&!Al,Hf=Un&&(!fc||Al&&8<Al&&11>=Al),$f=" ",Uf=!1;function Bf(e,t){switch(e){case"keyup":return Wb.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function qf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ks=!1;function Kb(e,t){switch(e){case"compositionend":return qf(t);case"keypress":return t.which!==32?null:(Uf=!0,$f);case"textInput":return e=t.data,e===$f&&Uf?null:e;default:return null}}function Jb(e,t){if(ks)return e==="compositionend"||!fc&&Bf(e,t)?(e=Af(),ro=oc=fa=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 Hf&&t.locale!=="ko"?null:t.data;default:return null}}var Ib={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 Lf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Ib[e.type]:t==="textarea"}function Yf(e,t,a,l){Ss?Es?Es.push(l):Es=[l]:Ss=l,t=Io(t,"onChange"),0<t.length&&(a=new co("onChange","change",null,a,l),e.push({event:a,listeners:t}))}var Rl=null,zl=null;function Fb(e){Np(e,0)}function fo(e){var t=Ga(e);if(wf(t))return e}function Vf(e,t){if(e==="change")return t}var Gf=!1;if(Un){var hc;if(Un){var xc="oninput"in document;if(!xc){var Xf=document.createElement("div");Xf.setAttribute("oninput","return;"),xc=typeof Xf.oninput=="function"}hc=xc}else hc=!1;Gf=hc&&(!document.documentMode||9<document.documentMode)}function Zf(){Rl&&(Rl.detachEvent("onpropertychange",Wf),zl=Rl=null)}function Wf(e){if(e.propertyName==="value"&&fo(zl)){var t=[];Yf(t,zl,e,sc(e)),Mf(Fb,t)}}function Pb(e,t,a){e==="focusin"?(Zf(),Rl=t,zl=a,Rl.attachEvent("onpropertychange",Wf)):e==="focusout"&&Zf()}function ey(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return fo(zl)}function ty(e,t){if(e==="click")return fo(t)}function ny(e,t){if(e==="input"||e==="change")return fo(t)}function ay(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var It=typeof Object.is=="function"?Object.is:ay;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 Qf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Kf(e,t){var a=Qf(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=Qf(a)}}function Jf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Jf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function If(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=so(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=so(e.document)}return t}function pc(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 sy=Un&&"documentMode"in document&&11>=document.documentMode,_s=null,mc=null,Dl=null,gc=!1;function Ff(e,t,a){var l=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;gc||_s==null||_s!==so(l)||(l=_s,"selectionStart"in l&&pc(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=Io(mc,"onSelect"),0<l.length&&(t=new co("onSelect","select",null,t,a),e.push({event:t,listeners:l}),t.target=_s)))}function Wa(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Cs={animationend:Wa("Animation","AnimationEnd"),animationiteration:Wa("Animation","AnimationIteration"),animationstart:Wa("Animation","AnimationStart"),transitionrun:Wa("Transition","TransitionRun"),transitionstart:Wa("Transition","TransitionStart"),transitioncancel:Wa("Transition","TransitionCancel"),transitionend:Wa("Transition","TransitionEnd")},bc={},Pf={};Un&&(Pf=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 Qa(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 Pf)return bc[e]=t[a];return e}var eh=Qa("animationend"),th=Qa("animationiteration"),nh=Qa("animationstart"),ly=Qa("transitionrun"),ry=Qa("transitionstart"),oy=Qa("transitioncancel"),ah=Qa("transitionend"),sh=new Map,yc="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(" ");yc.push("scrollEnd");function vn(e,t){sh.set(e,t),$n(t,[e])}var lh=new WeakMap;function un(e,t){if(typeof e=="object"&&e!==null){var a=lh.get(e);return a!==void 0?a:(t={value:e,source:t,stack:jf(t)},lh.set(e,t),t)}return{value:e,source:t,stack:jf(t)}}var dn=[],Ts=0,vc=0;function ho(){for(var e=Ts,t=vc=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 b=l.pending;b===null?c.next=c:(c.next=b.next,b.next=c),l.pending=c}d!==0&&rh(a,c,d)}}function xo(e,t,a,l){dn[Ts++]=e,dn[Ts++]=t,dn[Ts++]=a,dn[Ts++]=l,vc|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function jc(e,t,a,l){return xo(e,t,a,l),po(e)}function Ms(e,t){return xo(e,null,null,t),po(e)}function rh(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 po(e){if(50<rr)throw rr=0,_u=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 iy(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 iy(e,t,a,l)}function Nc(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 oh(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 mo(e,t,a,l,c,d){var b=0;if(l=e,typeof e=="function")Nc(e)&&(b=1);else if(typeof e=="string")b=uv(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 Ka(a.children,c,d,t);case _:b=8,c|=24;break;case T:return e=Ft(12,a,t,c|2),e.elementType=T,e.lanes=d,e;case O:return e=Ft(13,a,t,c),e.elementType=O,e.lanes=d,e;case Z:return e=Ft(19,a,t,c),e.elementType=Z,e.lanes=d,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case M:case L:b=10;break e;case Y:b=9;break e;case R:b=11;break e;case X:b=14;break e;case oe:b=16,l=null;break e}b=29,a=Error(i(130,e===null?"null":typeof e,"")),l=null}return t=Ft(b,a,t,c),t.elementType=e,t.type=l,t.lanes=d,t}function Ka(e,t,a,l){return e=Ft(7,e,l,t),e.lanes=a,e}function wc(e,t,a){return e=Ft(6,e,null,t),e.lanes=a,e}function Sc(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,go=null,bo=0,fn=[],hn=0,Ja=null,qn=1,Ln="";function Ia(e,t){Rs[zs++]=bo,Rs[zs++]=go,go=e,bo=t}function ih(e,t,a){fn[hn++]=qn,fn[hn++]=Ln,fn[hn++]=Ja,Ja=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 b=c-c%5;d=(l&(1<<b)-1).toString(32),l>>=b,c-=b,qn=1<<32-at(t)+c|a<<c|l,Ln=d+e}else qn=1<<d|a<<c|l,Ln=e}function Ec(e){e.return!==null&&(Ia(e,1),ih(e,1,0))}function kc(e){for(;e===go;)go=Rs[--zs],Rs[zs]=null,bo=Rs[--zs],Rs[zs]=null;for(;e===Ja;)Ja=fn[--hn],fn[hn]=null,Ln=fn[--hn],fn[hn]=null,qn=fn[--hn],fn[hn]=null}var Vt=null,it=null,Ze=!1,Fa=null,Cn=!1,_c=Error(i(519));function Pa(e){var t=Error(i(418,""));throw Ul(un(t,e)),_c}function ch(e){var t=e.stateNode,a=e.type,l=e.memoizedProps;switch(t[wt]=e,t[$t]=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),Sf(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0),ao(t);break;case"select":qe("invalid",t);break;case"textarea":qe("invalid",t),kf(t,l.value,l.defaultValue,l.children),ao(t)}a=l.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||l.suppressHydrationWarning===!0||kp(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=Fo),t=!0):t=!1,t||Pa(e)}function uh(e){for(Vt=e.return;Vt;)switch(Vt.tag){case 5:case 13:Cn=!1;return;case 27:case 3:Cn=!0;return;default:Vt=Vt.return}}function Hl(e){if(e!==Vt)return!1;if(!Ze)return uh(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")||Vu(e.type,e.memoizedProps)),a=!a),a&&it&&Pa(e),uh(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,Ca(e.type)?(e=Wu,Wu=null,it=e):it=t):it=Vt?Nn(e.stateNode.nextSibling):null;return!0}function $l(){it=Vt=null,Ze=!1}function dh(){var e=Fa;return e!==null&&(Qt===null?Qt=e:Qt.push.apply(Qt,e),Fa=null),e}function Ul(e){Fa===null?Fa=[e]:Fa.push(e)}var Cc=$(null),es=null,Yn=null;function ha(e,t,a){ae(Cc,t._currentValue),t._currentValue=a}function Vn(e){e._currentValue=Cc.current,W(Cc)}function Tc(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 Mc(e,t,a,l){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var d=c.dependencies;if(d!==null){var b=c.child;d=d.firstContext;e:for(;d!==null;){var w=d;d=c;for(var A=0;A<t.length;A++)if(w.context===t[A]){d.lanes|=a,w=d.alternate,w!==null&&(w.lanes|=a),Tc(d.return,a,e),l||(b=null);break e}d=w.next}}else if(c.tag===18){if(b=c.return,b===null)throw Error(i(341));b.lanes|=a,d=b.alternate,d!==null&&(d.lanes|=a),Tc(b,a,e),b=null}else b=c.child;if(b!==null)b.return=c;else for(b=c;b!==null;){if(b===e){b=null;break}if(c=b.sibling,c!==null){c.return=b.return,b=c;break}b=b.return}c=b}}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 b=c.alternate;if(b===null)throw Error(i(387));if(b=b.memoizedProps,b!==null){var w=c.type;It(c.pendingProps.value,b.value)||(e!==null?e.push(w):e=[w])}}else if(c===we.current){if(b=c.alternate,b===null)throw Error(i(387));b.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(xr):e=[xr])}c=c.return}e!==null&&Mc(t,e,a,l),t.flags|=262144}function yo(e){for(e=e.firstContext;e!==null;){if(!It(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ts(e){es=e,Yn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ut(e){return fh(es,e)}function vo(e,t){return es===null&&ts(e),fh(e,t)}function fh(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 cy=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()})}},uy=n.unstable_scheduleCallback,dy=n.unstable_NormalPriority,bt={$$typeof:L,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ac(){return{controller:new cy,data:new Map,refCount:0}}function ql(e){e.refCount--,e.refCount===0&&uy(dy,function(){e.controller.abort()})}var Ll=null,Rc=0,Os=0,Ds=null;function fy(e,t){if(Ll===null){var a=Ll=[];Rc=0,Os=Ou(),Ds={status:"pending",value:void 0,then:function(l){a.push(l)}}}return Rc++,t.then(hh,hh),t}function hh(){if(--Rc===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 hy(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 xh=k.S;k.S=function(e,t){typeof t=="object"&&t!==null&&typeof t.then=="function"&&fy(e,t),xh!==null&&xh(e,t)};var ns=$(null);function zc(){var e=ns.current;return e!==null?e:et.pooledCache}function jo(e,t){t===null?ae(ns,ns.current):ae(ns,t.pool)}function ph(){var e=zc();return e===null?null:{parent:bt._currentValue,pool:e}}var Yl=Error(i(460)),mh=Error(i(474)),No=Error(i(542)),Oc={then:function(){}};function gh(e){return e=e.status,e==="fulfilled"||e==="rejected"}function wo(){}function bh(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(wo,wo),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,vh(e),e;default:if(typeof t.status=="string")t.then(wo,wo);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,vh(e),e}throw Vl=t,Yl}}var Vl=null;function yh(){if(Vl===null)throw Error(i(459));var e=Vl;return Vl=null,e}function vh(e){if(e===Yl||e===No)throw Error(i(483))}var xa=!1;function Dc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Hc(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 pa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ma(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=po(e),rh(e,null,a),t}return xo(e,l,t,a),po(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,Qr(e,a)}}function $c(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 b={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};d===null?c=d=b:d=d.next=b,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 Uc=!1;function Xl(){if(Uc){var e=Ds;if(e!==null)throw e}}function Zl(e,t,a,l){Uc=!1;var c=e.updateQueue;xa=!1;var d=c.firstBaseUpdate,b=c.lastBaseUpdate,w=c.shared.pending;if(w!==null){c.shared.pending=null;var A=w,K=A.next;A.next=null,b===null?d=K:b.next=K,b=A;var ce=e.alternate;ce!==null&&(ce=ce.updateQueue,w=ce.lastBaseUpdate,w!==b&&(w===null?ce.firstBaseUpdate=K:w.next=K,ce.lastBaseUpdate=A))}if(d!==null){var fe=c.baseState;b=0,ce=K=A=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&&(Uc=!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:xa=!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?(K=ce=te,A=fe):ce=ce.next=te,b|=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&&(A=fe),c.baseState=A,c.firstBaseUpdate=K,c.lastBaseUpdate=ce,d===null&&(c.shared.lanes=0),Sa|=b,e.lanes=b,e.memoizedState=fe}}function jh(e,t){if(typeof e!="function")throw Error(i(191,e));e.call(t)}function Nh(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)jh(a[e],t)}var Hs=$(null),So=$(0);function wh(e,t){e=Jn,ae(So,e),ae(Hs,t),Jn=e|t.baseLanes}function Bc(){ae(So,Jn),ae(Hs,Hs.current)}function qc(){Jn=So.current,W(Hs),W(So)}var ga=0,He=null,Je=null,mt=null,Eo=!1,$s=!1,as=!1,ko=0,Wl=0,Us=null,xy=0;function ft(){throw Error(i(321))}function Lc(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 Yc(e,t,a,l,c,d){return ga=d,He=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,k.H=e===null||e.memoizedState===null?rx:ox,as=!1,d=a(l,c),as=!1,$s&&(d=Eh(t,a,l,c)),Sh(e),d}function Sh(e){k.H=Ro;var t=Je!==null&&Je.next!==null;if(ga=0,mt=Je=He=null,Eo=!1,Wl=0,Us=null,t)throw Error(i(300));e===null||St||(e=e.dependencies,e!==null&&yo(e)&&(St=!0))}function Eh(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,mt=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=jy,d=t(a,l)}while($s);return d}function py(){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 Vc(){var e=ko!==0;return ko=0,e}function Gc(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function Xc(e){if(Eo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Eo=!1}ga=0,mt=Je=He=null,$s=!1,Wl=ko=0,Us=null}function Zt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return mt===null?He.memoizedState=mt=e:mt=mt.next=e,mt}function gt(){if(Je===null){var e=He.alternate;e=e!==null?e.memoizedState:null}else e=Je.next;var t=mt===null?He.memoizedState:mt.next;if(t!==null)mt=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},mt===null?He.memoizedState=mt=e:mt=mt.next=e}return mt}function Zc(){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,(mt===null?t.memoizedState:mt.next)===null&&(t=t.alternate,k.H=t===null||t.memoizedState===null?rx:ox),e}function _o(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ql(e);if(e.$$typeof===L)return Ut(e)}throw Error(i(438,String(e)))}function Wc(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=Zc(),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]=J;return t.index++,a}function Gn(e,t){return typeof t=="function"?t(e):t}function Co(e){var t=gt();return Qc(t,Je,e)}function Qc(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 b=c.next;c.next=d.next,d.next=b}t.baseQueue=c=d,l.pending=null}if(d=e.baseState,c===null)e.memoizedState=d;else{t=c.next;var w=b=null,A=null,K=t,ce=!1;do{var fe=K.lane&-536870913;if(fe!==K.lane?(Ye&fe)===fe:(ga&fe)===fe){var F=K.revertLane;if(F===0)A!==null&&(A=A.next={lane:0,revertLane:0,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null}),fe===Os&&(ce=!0);else if((ga&F)===F){K=K.next,F===Os&&(ce=!0);continue}else fe={lane:0,revertLane:K.revertLane,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null},A===null?(w=A=fe,b=d):A=A.next=fe,He.lanes|=F,Sa|=F;fe=K.action,as&&a(d,fe),d=K.hasEagerState?K.eagerState:a(d,fe)}else F={lane:fe,revertLane:K.revertLane,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null},A===null?(w=A=F,b=d):A=A.next=F,He.lanes|=fe,Sa|=fe;K=K.next}while(K!==null&&K!==t);if(A===null?b=d:A.next=w,!It(d,e.memoizedState)&&(St=!0,ce&&(a=Ds,a!==null)))throw a;e.memoizedState=d,e.baseState=b,e.baseQueue=A,l.lastRenderedState=d}return c===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function Kc(e){var t=gt(),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 b=c=c.next;do d=e(d,b.action),b=b.next;while(b!==c);It(d,t.memoizedState)||(St=!0),t.memoizedState=d,t.baseQueue===null&&(t.baseState=d),a.lastRenderedState=d}return[d,l]}function kh(e,t,a){var l=He,c=gt(),d=Ze;if(d){if(a===void 0)throw Error(i(407));a=a()}else a=t();var b=!It((Je||c).memoizedState,a);b&&(c.memoizedState=a,St=!0),c=c.queue;var w=Th.bind(null,l,c,e);if(Kl(2048,8,w,[e]),c.getSnapshot!==t||b||mt!==null&&mt.memoizedState.tag&1){if(l.flags|=2048,Bs(9,To(),Ch.bind(null,l,c,a,t),null),et===null)throw Error(i(349));d||(ga&124)!==0||_h(l,t,a)}return a}function _h(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=He.updateQueue,t===null?(t=Zc(),He.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function Ch(e,t,a,l){t.value=a,t.getSnapshot=l,Mh(t)&&Ah(e)}function Th(e,t,a){return a(function(){Mh(t)&&Ah(e)})}function Mh(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!It(e,a)}catch{return!0}}function Ah(e){var t=Ms(e,2);t!==null&&an(t,e,2)}function Jc(e){var t=Zt();if(typeof e=="function"){var a=e;if(e=a(),as){xt(!0);try{a()}finally{xt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gn,lastRenderedState:e},t}function Rh(e,t,a,l){return e.baseState=a,Qc(e,Je,typeof l=="function"?l:Gn)}function my(e,t,a,l,c){if(Ao(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(b){d.listeners.push(b)}};k.T!==null?a(!0):d.isTransition=!1,l(d),a=t.pending,a===null?(d.next=t.pending=d,zh(t,d)):(d.next=a.next,t.pending=a.next=d)}}function zh(e,t){var a=t.action,l=t.payload,c=e.state;if(t.isTransition){var d=k.T,b={};k.T=b;try{var w=a(c,l),A=k.S;A!==null&&A(b,w),Oh(e,t,w)}catch(K){Ic(e,t,K)}finally{k.T=d}}else try{d=a(c,l),Oh(e,t,d)}catch(K){Ic(e,t,K)}}function Oh(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(l){Dh(e,t,l)},function(l){return Ic(e,t,l)}):Dh(e,t,a)}function Dh(e,t,a){t.status="fulfilled",t.value=a,Hh(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,zh(e,a)))}function Ic(e,t,a){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=a,Hh(t),t=t.next;while(t!==l)}e.action=null}function Hh(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function $h(e,t){return t}function Uh(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}}Pa(l)}l=!1}l&&(t=a[0])}}return a=Zt(),a.memoizedState=a.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:$h,lastRenderedState:t},a.queue=l,a=ax.bind(null,He,l),l.dispatch=a,l=Jc(!1),d=nu.bind(null,He,!1,l.queue),l=Zt(),c={state:t,dispatch:null,action:e,pending:null},l.queue=c,a=my.bind(null,He,c,d,a),c.dispatch=a,l.memoizedState=e,[t,a,!1]}function Bh(e){var t=gt();return qh(t,Je,e)}function qh(e,t,a){if(t=Qc(e,t,$h)[0],e=Co(Gn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=Ql(t)}catch(b){throw b===Yl?No:b}else l=t;t=gt();var c=t.queue,d=c.dispatch;return a!==t.memoizedState&&(He.flags|=2048,Bs(9,To(),gy.bind(null,c,a),null)),[l,d,e]}function gy(e,t){e.action=t}function Lh(e){var t=gt(),a=Je;if(a!==null)return qh(t,a,e);gt(),t=t.memoizedState,a=gt();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=Zc(),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 To(){return{destroy:void 0,resource:void 0}}function Yh(){return gt().memoizedState}function Mo(e,t,a,l){var c=Zt();l=l===void 0?null:l,He.flags|=e,c.memoizedState=Bs(1|t,To(),a,l)}function Kl(e,t,a,l){var c=gt();l=l===void 0?null:l;var d=c.memoizedState.inst;Je!==null&&l!==null&&Lc(l,Je.memoizedState.deps)?c.memoizedState=Bs(t,d,a,l):(He.flags|=e,c.memoizedState=Bs(1|t,d,a,l))}function Vh(e,t){Mo(8390656,8,e,t)}function Gh(e,t){Kl(2048,8,e,t)}function Xh(e,t){return Kl(4,2,e,t)}function Zh(e,t){return Kl(4,4,e,t)}function Wh(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 Qh(e,t,a){a=a!=null?a.concat([e]):null,Kl(4,4,Wh.bind(null,t,e),a)}function Fc(){}function Kh(e,t){var a=gt();t=t===void 0?null:t;var l=a.memoizedState;return t!==null&&Lc(t,l[1])?l[0]:(a.memoizedState=[e,t],e)}function Jh(e,t){var a=gt();t=t===void 0?null:t;var l=a.memoizedState;if(t!==null&&Lc(t,l[1]))return l[0];if(l=e(),as){xt(!0);try{e()}finally{xt(!1)}}return a.memoizedState=[l,t],l}function Pc(e,t,a){return a===void 0||(ga&1073741824)!==0?e.memoizedState=t:(e.memoizedState=a,e=Px(),He.lanes|=e,Sa|=e,a)}function Ih(e,t,a,l){return It(a,t)?a:Hs.current!==null?(e=Pc(e,a,l),It(e,t)||(St=!0),e):(ga&42)===0?(St=!0,e.memoizedState=a):(e=Px(),He.lanes|=e,Sa|=e,t)}function Fh(e,t,a,l,c){var d=H.p;H.p=d!==0&&8>d?d:8;var b=k.T,w={};k.T=w,nu(e,!1,t,a);try{var A=c(),K=k.S;if(K!==null&&K(w,A),A!==null&&typeof A=="object"&&typeof A.then=="function"){var ce=hy(A,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=b}}function by(){}function eu(e,t,a,l){if(e.tag!==5)throw Error(i(476));var c=Ph(e).queue;Fh(e,c,t,D,a===null?by:function(){return ex(e),a(l)})}function Ph(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 ex(e){var t=Ph(e).next.queue;Jl(e,t,{},nn())}function tu(){return Ut(xr)}function tx(){return gt().memoizedState}function nx(){return gt().memoizedState}function yy(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=nn();e=pa(a);var l=ma(t,e,a);l!==null&&(an(l,t,a),Gl(l,t,a)),t={cache:Ac()},e.payload=t;return}t=t.return}}function vy(e,t,a){var l=nn();a={lane:l,revertLane:0,action:a,hasEagerState:!1,eagerState:null,next:null},Ao(e)?sx(t,a):(a=jc(e,t,a,l),a!==null&&(an(a,e,l),lx(a,t,l)))}function ax(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(Ao(e))sx(t,c);else{var d=e.alternate;if(e.lanes===0&&(d===null||d.lanes===0)&&(d=t.lastRenderedReducer,d!==null))try{var b=t.lastRenderedState,w=d(b,a);if(c.hasEagerState=!0,c.eagerState=w,It(w,b))return xo(e,t,c,0),et===null&&ho(),!1}catch{}finally{}if(a=jc(e,t,c,l),a!==null)return an(a,e,l),lx(a,t,l),!0}return!1}function nu(e,t,a,l){if(l={lane:2,revertLane:Ou(),action:l,hasEagerState:!1,eagerState:null,next:null},Ao(e)){if(t)throw Error(i(479))}else t=jc(e,a,l,2),t!==null&&an(t,e,2)}function Ao(e){var t=e.alternate;return e===He||t!==null&&t===He}function sx(e,t){$s=Eo=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function lx(e,t,a){if((a&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,a|=l,t.lanes=a,Qr(e,a)}}var Ro={readContext:Ut,use:_o,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},rx={readContext:Ut,use:_o,useCallback:function(e,t){return Zt().memoizedState=[e,t===void 0?null:t],e},useContext:Ut,useEffect:Vh,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,Mo(4194308,4,Wh.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Mo(4194308,4,e,t)},useInsertionEffect:function(e,t){Mo(4,2,e,t)},useMemo:function(e,t){var a=Zt();t=t===void 0?null:t;var l=e();if(as){xt(!0);try{e()}finally{xt(!1)}}return a.memoizedState=[l,t],l},useReducer:function(e,t,a){var l=Zt();if(a!==void 0){var c=a(t);if(as){xt(!0);try{a(t)}finally{xt(!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=vy.bind(null,He,e),[l.memoizedState,e]},useRef:function(e){var t=Zt();return e={current:e},t.memoizedState=e},useState:function(e){e=Jc(e);var t=e.queue,a=ax.bind(null,He,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Fc,useDeferredValue:function(e,t){var a=Zt();return Pc(a,e,t)},useTransition:function(){var e=Jc(!1);return e=Fh.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||_h(l,t,a)}c.memoizedState=a;var d={value:a,getSnapshot:t};return c.queue=d,Vh(Th.bind(null,l,d,e),[e]),l.flags|=2048,Bs(9,To(),Ch.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=ko++,0<a&&(t+="H"+a.toString(32)),t+="»"}else a=xy++,t="«"+t+"r"+a.toString(32)+"»";return e.memoizedState=t},useHostTransitionStatus:tu,useFormState:Uh,useActionState:Uh,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=nu.bind(null,He,!0,a),a.dispatch=t,[e,t]},useMemoCache:Wc,useCacheRefresh:function(){return Zt().memoizedState=yy.bind(null,He)}},ox={readContext:Ut,use:_o,useCallback:Kh,useContext:Ut,useEffect:Gh,useImperativeHandle:Qh,useInsertionEffect:Xh,useLayoutEffect:Zh,useMemo:Jh,useReducer:Co,useRef:Yh,useState:function(){return Co(Gn)},useDebugValue:Fc,useDeferredValue:function(e,t){var a=gt();return Ih(a,Je.memoizedState,e,t)},useTransition:function(){var e=Co(Gn)[0],t=gt().memoizedState;return[typeof e=="boolean"?e:Ql(e),t]},useSyncExternalStore:kh,useId:tx,useHostTransitionStatus:tu,useFormState:Bh,useActionState:Bh,useOptimistic:function(e,t){var a=gt();return Rh(a,Je,e,t)},useMemoCache:Wc,useCacheRefresh:nx},jy={readContext:Ut,use:_o,useCallback:Kh,useContext:Ut,useEffect:Gh,useImperativeHandle:Qh,useInsertionEffect:Xh,useLayoutEffect:Zh,useMemo:Jh,useReducer:Kc,useRef:Yh,useState:function(){return Kc(Gn)},useDebugValue:Fc,useDeferredValue:function(e,t){var a=gt();return Je===null?Pc(a,e,t):Ih(a,Je.memoizedState,e,t)},useTransition:function(){var e=Kc(Gn)[0],t=gt().memoizedState;return[typeof e=="boolean"?e:Ql(e),t]},useSyncExternalStore:kh,useId:tx,useHostTransitionStatus:tu,useFormState:Lh,useActionState:Lh,useOptimistic:function(e,t){var a=gt();return Je!==null?Rh(a,Je,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Wc,useCacheRefresh:nx},qs=null,Il=0;function zo(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 Oo(e,t){throw t.$$typeof===y?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function ix(e){var t=e._init;return t(e._payload)}function cx(e){function t(G,B){if(e){var Q=G.deletions;Q===null?(G.deletions=[B],G.flags|=16):Q.push(B)}}function a(G,B){if(!e)return null;for(;B!==null;)t(G,B),B=B.sibling;return null}function l(G){for(var B=new Map;G!==null;)G.key!==null?B.set(G.key,G):B.set(G.index,G),G=G.sibling;return B}function c(G,B){return G=Bn(G,B),G.index=0,G.sibling=null,G}function d(G,B,Q){return G.index=Q,e?(Q=G.alternate,Q!==null?(Q=Q.index,Q<B?(G.flags|=67108866,B):Q):(G.flags|=67108866,B)):(G.flags|=1048576,B)}function b(G){return e&&G.alternate===null&&(G.flags|=67108866),G}function w(G,B,Q,de){return B===null||B.tag!==6?(B=wc(Q,G.mode,de),B.return=G,B):(B=c(B,Q),B.return=G,B)}function A(G,B,Q,de){var be=Q.type;return be===C?ce(G,B,Q.props.children,de,Q.key):B!==null&&(B.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===oe&&ix(be)===B.type)?(B=c(B,Q.props),Fl(B,Q),B.return=G,B):(B=mo(Q.type,Q.key,Q.props,null,G.mode,de),Fl(B,Q),B.return=G,B)}function K(G,B,Q,de){return B===null||B.tag!==4||B.stateNode.containerInfo!==Q.containerInfo||B.stateNode.implementation!==Q.implementation?(B=Sc(Q,G.mode,de),B.return=G,B):(B=c(B,Q.children||[]),B.return=G,B)}function ce(G,B,Q,de,be){return B===null||B.tag!==7?(B=Ka(Q,G.mode,de,be),B.return=G,B):(B=c(B,Q),B.return=G,B)}function fe(G,B,Q){if(typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint")return B=wc(""+B,G.mode,Q),B.return=G,B;if(typeof B=="object"&&B!==null){switch(B.$$typeof){case v:return Q=mo(B.type,B.key,B.props,null,G.mode,Q),Fl(Q,B),Q.return=G,Q;case j:return B=Sc(B,G.mode,Q),B.return=G,B;case oe:var de=B._init;return B=de(B._payload),fe(G,B,Q)}if(U(B)||ee(B))return B=Ka(B,G.mode,Q,null),B.return=G,B;if(typeof B.then=="function")return fe(G,zo(B),Q);if(B.$$typeof===L)return fe(G,vo(G,B),Q);Oo(G,B)}return null}function F(G,B,Q,de){var be=B!==null?B.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return be!==null?null:w(G,B,""+Q,de);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case v:return Q.key===be?A(G,B,Q,de):null;case j:return Q.key===be?K(G,B,Q,de):null;case oe:return be=Q._init,Q=be(Q._payload),F(G,B,Q,de)}if(U(Q)||ee(Q))return be!==null?null:ce(G,B,Q,de,null);if(typeof Q.then=="function")return F(G,B,zo(Q),de);if(Q.$$typeof===L)return F(G,B,vo(G,Q),de);Oo(G,Q)}return null}function te(G,B,Q,de,be){if(typeof de=="string"&&de!==""||typeof de=="number"||typeof de=="bigint")return G=G.get(Q)||null,w(B,G,""+de,be);if(typeof de=="object"&&de!==null){switch(de.$$typeof){case v:return G=G.get(de.key===null?Q:de.key)||null,A(B,G,de,be);case j:return G=G.get(de.key===null?Q:de.key)||null,K(B,G,de,be);case oe:var $e=de._init;return de=$e(de._payload),te(G,B,Q,de,be)}if(U(de)||ee(de))return G=G.get(Q)||null,ce(B,G,de,be,null);if(typeof de.then=="function")return te(G,B,Q,zo(de),be);if(de.$$typeof===L)return te(G,B,Q,vo(B,de),be);Oo(B,de)}return null}function Me(G,B,Q,de){for(var be=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(G,Ne,Q[Ce],de);if(Xe===null){Ne===null&&(Ne=kt);break}e&&Ne&&Xe.alternate===null&&t(G,Ne),B=d(Xe,B,Ce),$e===null?be=Xe:$e.sibling=Xe,$e=Xe,Ne=kt}if(Ce===Q.length)return a(G,Ne),Ze&&Ia(G,Ce),be;if(Ne===null){for(;Ce<Q.length;Ce++)Ne=fe(G,Q[Ce],de),Ne!==null&&(B=d(Ne,B,Ce),$e===null?be=Ne:$e.sibling=Ne,$e=Ne);return Ze&&Ia(G,Ce),be}for(Ne=l(Ne);Ce<Q.length;Ce++)kt=te(Ne,G,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?be=kt:$e.sibling=kt,$e=kt);return e&&Ne.forEach(function(za){return t(G,za)}),Ze&&Ia(G,Ce),be}function _e(G,B,Q,de){if(Q==null)throw Error(i(151));for(var be=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 za=F(G,Ne,Xe.value,de);if(za===null){Ne===null&&(Ne=kt);break}e&&Ne&&za.alternate===null&&t(G,Ne),B=d(za,B,Ce),$e===null?be=za:$e.sibling=za,$e=za,Ne=kt}if(Xe.done)return a(G,Ne),Ze&&Ia(G,Ce),be;if(Ne===null){for(;!Xe.done;Ce++,Xe=Q.next())Xe=fe(G,Xe.value,de),Xe!==null&&(B=d(Xe,B,Ce),$e===null?be=Xe:$e.sibling=Xe,$e=Xe);return Ze&&Ia(G,Ce),be}for(Ne=l(Ne);!Xe.done;Ce++,Xe=Q.next())Xe=te(Ne,G,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?be=Xe:$e.sibling=Xe,$e=Xe);return e&&Ne.forEach(function(Nv){return t(G,Nv)}),Ze&&Ia(G,Ce),be}function Fe(G,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 be=Q.key;B!==null;){if(B.key===be){if(be=Q.type,be===C){if(B.tag===7){a(G,B.sibling),de=c(B,Q.props.children),de.return=G,G=de;break e}}else if(B.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===oe&&ix(be)===B.type){a(G,B.sibling),de=c(B,Q.props),Fl(de,Q),de.return=G,G=de;break e}a(G,B);break}else t(G,B);B=B.sibling}Q.type===C?(de=Ka(Q.props.children,G.mode,de,Q.key),de.return=G,G=de):(de=mo(Q.type,Q.key,Q.props,null,G.mode,de),Fl(de,Q),de.return=G,G=de)}return b(G);case j:e:{for(be=Q.key;B!==null;){if(B.key===be)if(B.tag===4&&B.stateNode.containerInfo===Q.containerInfo&&B.stateNode.implementation===Q.implementation){a(G,B.sibling),de=c(B,Q.children||[]),de.return=G,G=de;break e}else{a(G,B);break}else t(G,B);B=B.sibling}de=Sc(Q,G.mode,de),de.return=G,G=de}return b(G);case oe:return be=Q._init,Q=be(Q._payload),Fe(G,B,Q,de)}if(U(Q))return Me(G,B,Q,de);if(ee(Q)){if(be=ee(Q),typeof be!="function")throw Error(i(150));return Q=be.call(Q),_e(G,B,Q,de)}if(typeof Q.then=="function")return Fe(G,B,zo(Q),de);if(Q.$$typeof===L)return Fe(G,B,vo(G,Q),de);Oo(G,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,B!==null&&B.tag===6?(a(G,B.sibling),de=c(B,Q),de.return=G,G=de):(a(G,B),de=wc(Q,G.mode,de),de.return=G,G=de),b(G)):a(G,B)}return function(G,B,Q,de){try{Il=0;var be=Fe(G,B,Q,de);return qs=null,be}catch(Ne){if(Ne===Yl||Ne===No)throw Ne;var $e=Ft(29,Ne,null,G.mode);return $e.lanes=de,$e.return=G,$e}finally{}}}var Ls=cx(!0),ux=cx(!1),xn=$(null),Tn=null;function ba(e){var t=e.alternate;ae(yt,yt.current&1),ae(xn,e),Tn===null&&(t===null||Hs.current!==null||t.memoizedState!==null)&&(Tn=e)}function dx(e){if(e.tag===22){if(ae(yt,yt.current),ae(xn,e),Tn===null){var t=e.alternate;t!==null&&t.memoizedState!==null&&(Tn=e)}}else ya()}function ya(){ae(yt,yt.current),ae(xn,xn.current)}function Xn(e){W(xn),Tn===e&&(Tn=null),W(yt)}var yt=$(0);function Do(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==="$?"||Zu(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 au(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 su={enqueueSetState:function(e,t,a){e=e._reactInternals;var l=nn(),c=pa(l);c.payload=t,a!=null&&(c.callback=a),t=ma(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=pa(l);c.tag=1,c.payload=t,a!=null&&(c.callback=a),t=ma(e,c,l),t!==null&&(an(t,e,l),Gl(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=nn(),l=pa(a);l.tag=2,t!=null&&(l.callback=t),t=ma(e,l,a),t!==null&&(an(t,e,a),Gl(t,e,a))}};function fx(e,t,a,l,c,d,b){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,d,b):t.prototype&&t.prototype.isPureReactComponent?!Ol(a,l)||!Ol(c,d):!0}function hx(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&&su.enqueueReplaceState(t,t.state,null)}function ss(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 Ho=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 xx(e){Ho(e)}function px(e){console.error(e)}function mx(e){Ho(e)}function $o(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function gx(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 lu(e,t,a){return a=pa(a),a.tag=3,a.payload={element:null},a.callback=function(){$o(e,t)},a}function bx(e){return e=pa(e),e.tag=3,e}function yx(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(){gx(t,a,l)}}var b=a.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(e.callback=function(){gx(t,a,l),typeof c!="function"&&(Ea===null?Ea=new Set([this]):Ea.add(this));var w=l.stack;this.componentDidCatch(l.value,{componentStack:w!==null?w:""})})}function Ny(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?Tu():a.alternate===null&&ct===0&&(ct=3),a.flags&=-257,a.flags|=65536,a.lanes=c,l===Oc?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([l]):t.add(l),Au(e,l,c)),!1;case 22:return a.flags|=65536,l===Oc?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)),Au(e,l,c)),!1}throw Error(i(435,a.tag))}return Au(e,l,c),Tu(),!1}if(Ze)return t=xn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,l!==_c&&(e=Error(i(422),{cause:l}),Ul(un(e,a)))):(l!==_c&&(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=lu(e.stateNode,l,c),$c(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=lu(a.stateNode,l,e),$c(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"&&(Ea===null||!Ea.has(d))))return a.flags|=65536,c&=-c,a.lanes|=c,c=bx(c),yx(c,e,a,l),$c(a,c),!1}a=a.return}while(a!==null);return!1}var vx=Error(i(461)),St=!1;function zt(e,t,a,l){t.child=e===null?ux(t,null,a,l):Ls(t,e.child,a,l)}function jx(e,t,a,l,c){a=a.render;var d=t.ref;if("ref"in l){var b={};for(var w in l)w!=="ref"&&(b[w]=l[w])}else b=l;return ts(t),l=Yc(e,t,a,b,d,c),w=Vc(),e!==null&&!St?(Gc(e,t,c),Zn(e,t,c)):(Ze&&w&&Ec(t),t.flags|=1,zt(e,t,l,c),t.child)}function Nx(e,t,a,l,c){if(e===null){var d=a.type;return typeof d=="function"&&!Nc(d)&&d.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=d,wx(e,t,d,l,c)):(e=mo(a.type,null,l,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(d=e.child,!hu(e,c)){var b=d.memoizedProps;if(a=a.compare,a=a!==null?a:Ol,a(b,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 wx(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,hu(e,c))(e.flags&131072)!==0&&(St=!0);else return t.lanes=e.lanes,Zn(e,t,c)}return ru(e,t,a,l,c)}function Sx(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 Ex(e,t,l,a)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&jo(t,d!==null?d.cachePool:null),d!==null?wh(t,d):Bc(),dx(t);else return t.lanes=t.childLanes=536870912,Ex(e,t,d!==null?d.baseLanes|a:a,a)}else d!==null?(jo(t,d.cachePool),wh(t,d),ya(),t.memoizedState=null):(e!==null&&jo(t,null),Bc(),ya());return zt(e,t,c,a),t.child}function Ex(e,t,a,l){var c=zc();return c=c===null?null:{parent:bt._currentValue,pool:c},t.memoizedState={baseLanes:a,cachePool:c},e!==null&&jo(t,null),Bc(),dx(t),e!==null&&Bl(e,t,l,!0),null}function Uo(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 ru(e,t,a,l,c){return ts(t),a=Yc(e,t,a,l,void 0,c),l=Vc(),e!==null&&!St?(Gc(e,t,c),Zn(e,t,c)):(Ze&&l&&Ec(t),t.flags|=1,zt(e,t,a,c),t.child)}function kx(e,t,a,l,c,d){return ts(t),t.updateQueue=null,a=Eh(t,l,a,c),Sh(e),l=Vc(),e!==null&&!St?(Gc(e,t,d),Zn(e,t,d)):(Ze&&l&&Ec(t),t.flags|=1,zt(e,t,a,d),t.child)}function _x(e,t,a,l,c){if(ts(t),t.stateNode===null){var d=As,b=a.contextType;typeof b=="object"&&b!==null&&(d=Ut(b)),d=new a(l,d),t.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=su,t.stateNode=d,d._reactInternals=t,d=t.stateNode,d.props=l,d.state=t.memoizedState,d.refs={},Dc(t),b=a.contextType,d.context=typeof b=="object"&&b!==null?Ut(b):As,d.state=t.memoizedState,b=a.getDerivedStateFromProps,typeof b=="function"&&(au(t,a,b,l),d.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(b=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),b!==d.state&&su.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,A=ss(a,w);d.props=A;var K=d.context,ce=a.contextType;b=As,typeof ce=="object"&&ce!==null&&(b=Ut(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||K!==b)&&hx(t,d,l,b),xa=!1;var F=t.memoizedState;d.state=F,Zl(t,l,d,c),Xl(),K=t.memoizedState,w||F!==K||xa?(typeof fe=="function"&&(au(t,a,fe,l),K=t.memoizedState),(A=xa||fx(t,a,A,l,F,K,b))?(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=K),d.props=l,d.state=K,d.context=b,l=A):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{d=t.stateNode,Hc(e,t),b=t.memoizedProps,ce=ss(a,b),d.props=ce,fe=t.pendingProps,F=d.context,K=a.contextType,A=As,typeof K=="object"&&K!==null&&(A=Ut(K)),w=a.getDerivedStateFromProps,(K=typeof w=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(b!==fe||F!==A)&&hx(t,d,l,A),xa=!1,F=t.memoizedState,d.state=F,Zl(t,l,d,c),Xl();var te=t.memoizedState;b!==fe||F!==te||xa||e!==null&&e.dependencies!==null&&yo(e.dependencies)?(typeof w=="function"&&(au(t,a,w,l),te=t.memoizedState),(ce=xa||fx(t,a,ce,l,F,te,A)||e!==null&&e.dependencies!==null&&yo(e.dependencies))?(K||typeof d.UNSAFE_componentWillUpdate!="function"&&typeof d.componentWillUpdate!="function"||(typeof d.componentWillUpdate=="function"&&d.componentWillUpdate(l,te,A),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(l,te,A)),typeof d.componentDidUpdate=="function"&&(t.flags|=4),typeof d.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof d.componentDidUpdate!="function"||b===e.memoizedProps&&F===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&F===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=te),d.props=l,d.state=te,d.context=A,l=ce):(typeof d.componentDidUpdate!="function"||b===e.memoizedProps&&F===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&F===e.memoizedState||(t.flags|=1024),l=!1)}return d=l,Uo(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 Cx(e,t,a,l){return $l(),t.flags|=256,zt(e,t,a,l),t.child}var ou={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function iu(e){return{baseLanes:e,cachePool:ph()}}function cu(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=pn),e}function Tx(e,t,a){var l=t.pendingProps,c=!1,d=(t.flags&128)!==0,b;if((b=d)||(b=e!==null&&e.memoizedState===null?!1:(yt.current&2)!==0),b&&(c=!0,t.flags&=-129),b=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ze){if(c?ba(t):ya(),Ze){var w=it,A;if(A=w){e:{for(A=w,w=Cn;A.nodeType!==8;){if(!w){w=null;break e}if(A=Nn(A.nextSibling),A===null){w=null;break e}}w=A}w!==null?(t.memoizedState={dehydrated:w,treeContext:Ja!==null?{id:qn,overflow:Ln}:null,retryLane:536870912,hydrationErrors:null},A=Ft(18,null,null,0),A.stateNode=w,A.return=t,t.child=A,Vt=t,it=null,A=!0):A=!1}A||Pa(t)}if(w=t.memoizedState,w!==null&&(w=w.dehydrated,w!==null))return Zu(w)?t.lanes=32:t.lanes=536870912,null;Xn(t)}return w=l.children,l=l.fallback,c?(ya(),c=t.mode,w=Bo({mode:"hidden",children:w},c),l=Ka(l,c,a,null),w.return=t,l.return=t,w.sibling=l,t.child=w,c=t.child,c.memoizedState=iu(a),c.childLanes=cu(e,b,a),t.memoizedState=ou,l):(ba(t),uu(t,w))}if(A=e.memoizedState,A!==null&&(w=A.dehydrated,w!==null)){if(d)t.flags&256?(ba(t),t.flags&=-257,t=du(e,t,a)):t.memoizedState!==null?(ya(),t.child=e.child,t.flags|=128,t=null):(ya(),c=l.fallback,w=t.mode,l=Bo({mode:"visible",children:l.children},w),c=Ka(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=iu(a),l.childLanes=cu(e,b,a),t.memoizedState=ou,t=c);else if(ba(t),Zu(w)){if(b=w.nextSibling&&w.nextSibling.dataset,b)var K=b.dgst;b=K,l=Error(i(419)),l.stack="",l.digest=b,Ul({value:l,source:null,stack:null}),t=du(e,t,a)}else if(St||Bl(e,t,a,!1),b=(a&e.childLanes)!==0,St||b){if(b=et,b!==null&&(l=a&-a,l=(l&42)!==0?1:Nl(l),l=(l&(b.suspendedLanes|a))!==0?0:l,l!==0&&l!==A.retryLane))throw A.retryLane=l,Ms(e,l),an(b,e,l),vx;w.data==="$?"||Tu(),t=du(e,t,a)}else w.data==="$?"?(t.flags|=192,t.child=e.child,t=null):(e=A.treeContext,it=Nn(w.nextSibling),Vt=t,Ze=!0,Fa=null,Cn=!1,e!==null&&(fn[hn++]=qn,fn[hn++]=Ln,fn[hn++]=Ja,qn=e.id,Ln=e.overflow,Ja=t),t=uu(t,l.children),t.flags|=4096);return t}return c?(ya(),c=l.fallback,w=t.mode,A=e.child,K=A.sibling,l=Bn(A,{mode:"hidden",children:l.children}),l.subtreeFlags=A.subtreeFlags&65011712,K!==null?c=Bn(K,c):(c=Ka(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=iu(a):(A=w.cachePool,A!==null?(K=bt._currentValue,A=A.parent!==K?{parent:K,pool:K}:A):A=ph(),w={baseLanes:w.baseLanes|a,cachePool:A}),c.memoizedState=w,c.childLanes=cu(e,b,a),t.memoizedState=ou,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&&(b=t.deletions,b===null?(t.deletions=[e],t.flags|=16):b.push(e)),t.child=a,t.memoizedState=null,a)}function uu(e,t){return t=Bo({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Bo(e,t){return e=Ft(22,e,null,t),e.lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function du(e,t,a){return Ls(t,e.child,null,a),e=uu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Mx(e,t,a){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),Tc(e.return,t,a)}function fu(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 Ax(e,t,a){var l=t.pendingProps,c=l.revealOrder,d=l.tail;if(zt(e,t,l.children,a),l=yt.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&&Mx(e,a,t);else if(e.tag===19)Mx(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(yt,l),c){case"forwards":for(a=t.child,c=null;a!==null;)e=a.alternate,e!==null&&Do(e)===null&&(c=a),a=a.sibling;a=c,a===null?(c=t.child,t.child=null):(c=a.sibling,a.sibling=null),fu(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&&Do(e)===null){t.child=c;break}e=c.sibling,c.sibling=a,a=c,c=e}fu(t,!0,a,null,d);break;case"together":fu(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),Sa|=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 hu(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&yo(e)))}function wy(e,t,a){switch(t.tag){case 3:ve(t,t.stateNode.containerInfo),ha(t,bt,e.memoizedState.cache),$l();break;case 27:case 5:Re(t);break;case 4:ve(t,t.stateNode.containerInfo);break;case 10:ha(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?Tx(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 Ax(e,t,a);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),ae(yt,yt.current),l)break;return null;case 22:case 23:return t.lanes=0,Sx(e,t,a);case 24:ha(t,bt,e.memoizedState.cache)}return Zn(e,t,a)}function Rx(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)St=!0;else{if(!hu(e,a)&&(t.flags&128)===0)return St=!1,wy(e,t,a);St=(e.flags&131072)!==0}else St=!1,Ze&&(t.flags&1048576)!==0&&ih(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")Nc(l)?(e=ss(l,e),t.tag=1,t=_x(null,t,l,e,a)):(t.tag=0,t=ru(null,t,l,e,a));else{if(l!=null){if(c=l.$$typeof,c===R){t.tag=11,t=jx(null,t,l,e,a);break e}else if(c===X){t.tag=14,t=Nx(null,t,l,e,a);break e}}throw t=S(l)||l,Error(i(306,t,""))}}return t;case 0:return ru(e,t,t.type,t.pendingProps,a);case 1:return l=t.type,c=ss(l,t.pendingProps),_x(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,Hc(e,t),Zl(t,l,null,a);var b=t.memoizedState;if(l=b.cache,ha(t,bt,l),l!==d.cache&&Mc(t,[bt],a,!0),Xl(),l=b.element,d.isDehydrated)if(d={element:l,isDehydrated:!1,cache:b.cache},t.updateQueue.baseState=d,t.memoizedState=d,t.flags&256){t=Cx(e,t,l,a);break e}else if(l!==c){c=un(Error(i(424)),t),Ul(c),t=Cx(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),Vt=t,Ze=!0,Fa=null,Cn=!0,a=ux(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 Uo(e,t),e===null?(a=Hp(t.type,null,t.pendingProps,null))?t.memoizedState=a:Ze||(a=t.type,e=t.pendingProps,l=Po(xe.current).createElement(a),l[wt]=t,l[$t]=e,Dt(l,a,e),pt(l),t.stateNode=l):t.memoizedState=Hp(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Re(t),e===null&&Ze&&(l=t.stateNode=zp(t.type,t.pendingProps,xe.current),Vt=t,Cn=!0,c=it,Ca(t.type)?(Wu=c,it=Nn(l.firstChild)):it=c),zt(e,t,t.pendingProps.children,a),Uo(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ze&&((c=l=it)&&(l=Iy(l,t.type,t.pendingProps,Cn),l!==null?(t.stateNode=l,Vt=t,it=Nn(l.firstChild),Cn=!1,c=!0):c=!1),c||Pa(t)),Re(t),c=t.type,d=t.pendingProps,b=e!==null?e.memoizedProps:null,l=d.children,Vu(c,d)?l=null:b!==null&&Vu(c,b)&&(t.flags|=32),t.memoizedState!==null&&(c=Yc(e,t,py,null,null,a),xr._currentValue=c),Uo(e,t),zt(e,t,l,a),t.child;case 6:return e===null&&Ze&&((e=a=it)&&(a=Fy(a,t.pendingProps,Cn),a!==null?(t.stateNode=a,Vt=t,it=null,e=!0):e=!1),e||Pa(t)),null;case 13:return Tx(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 jx(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,ha(t,t.type,l.value),zt(e,t,l.children,a),t.child;case 9:return c=t.type._context,l=t.pendingProps.children,ts(t),c=Ut(c),l=l(c),t.flags|=1,zt(e,t,l,a),t.child;case 14:return Nx(e,t,t.type,t.pendingProps,a);case 15:return wx(e,t,t.type,t.pendingProps,a);case 19:return Ax(e,t,a);case 31:return l=t.pendingProps,a=t.mode,l={mode:l.mode,children:l.children},e===null?(a=Bo(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 Sx(e,t,a);case 24:return ts(t),l=Ut(bt),e===null?(c=zc(),c===null&&(c=et,d=Ac(),c.pooledCache=d,d.refCount++,d!==null&&(c.pooledCacheLanes|=a),c=d),t.memoizedState={parent:l,cache:c},Dc(t),ha(t,bt,c)):((e.lanes&a)!==0&&(Hc(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),ha(t,bt,l)):(l=d.cache,ha(t,bt,l),l!==c.cache&&Mc(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 zx(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Lp(t)){if(t=xn.current,t!==null&&((Ye&4194048)===Ye?Tn!==null:(Ye&62914560)!==Ye&&(Ye&536870912)===0||t!==Tn))throw Vl=Oc,mh;e.flags|=8192}}function qo(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?la():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 Sy(e,t,a){var l=t.pendingProps;switch(kc(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,dh())),rt(t),null;case 26:return a=t.memoizedState,e===null?(Wn(t),a!==null?(rt(t),zx(t,a)):(rt(t),t.flags&=-16777217)):a?a!==e.memoizedState?(Wn(t),rt(t),zx(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)?ch(t):(e=zp(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))ch(t);else{switch(c=Po(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[$t]=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=Vt,c!==null)switch(c.tag){case 27:case 5:l=c.memoizedProps}e[wt]=t,e=!!(e.nodeValue===a||l!==null&&l.suppressHydrationWarning===!0||kp(e.nodeValue,a)),e||Pa(t)}else e=Po(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=dh(),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),qo(t,t.updateQueue),rt(t),null;case 4:return Ae(),e===null&&Uu(t.stateNode.containerInfo),rt(t),null;case 10:return Vn(t.type),rt(t),null;case 19:if(W(yt),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=Do(e),d!==null){for(t.flags|=128,Pl(c,!1),e=d.updateQueue,t.updateQueue=e,qo(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)oh(a,e),a=a.sibling;return ae(yt,yt.current&1|2),t.child}e=e.sibling}c.tail!==null&&re()>Vo&&(t.flags|=128,l=!0,Pl(c,!1),t.lanes=4194304)}else{if(!l)if(e=Do(d),e!==null){if(t.flags|=128,l=!0,e=e.updateQueue,t.updateQueue=e,qo(t,e),Pl(c,!0),c.tail===null&&c.tailMode==="hidden"&&!d.alternate&&!Ze)return rt(t),null}else 2*re()-c.renderingStartTime>Vo&&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=re(),t.sibling=null,e=yt.current,ae(yt,l?e&1|2:e&1),t):(rt(t),null);case 22:case 23:return Xn(t),qc(),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&&qo(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(ns),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 Ey(e,t){switch(kc(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(yt),null;case 4:return Ae(),null;case 10:return Vn(t.type),null;case 22:case 23:return Xn(t),qc(),e!==null&&W(ns),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 Ox(e,t){switch(kc(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(yt);break;case 10:Vn(t.type);break;case 22:case 23:Xn(t),qc(),e!==null&&W(ns);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,b=a.inst;l=d(),b.destroy=l}a=a.next}while(a!==c)}}catch(w){Pe(t,t.return,w)}}function va(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 b=l.inst,w=b.destroy;if(w!==void 0){b.destroy=void 0,c=t;var A=a,K=w;try{K()}catch(ce){Pe(c,A,ce)}}}l=l.next}while(l!==d)}}catch(ce){Pe(t,t.return,ce)}}function Dx(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{Nh(t,a)}catch(l){Pe(e,e.return,l)}}}function Hx(e,t,a){a.props=ss(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 $x(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 xu(e,t,a){try{var l=e.stateNode;Zy(l,e.type,a,t),l[$t]=t}catch(c){Pe(e,e.return,c)}}function Ux(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ca(e.type)||e.tag===4}function pu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ux(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&&Ca(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 mu(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=Fo));else if(l!==4&&(l===27&&Ca(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(mu(e,t,a),e=e.sibling;e!==null;)mu(e,t,a),e=e.sibling}function Lo(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&&Ca(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(Lo(e,t,a),e=e.sibling;e!==null;)Lo(e,t,a),e=e.sibling}function Bx(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[$t]=a}catch(d){Pe(e,e.return,d)}}var Qn=!1,ht=!1,gu=!1,qx=typeof WeakSet=="function"?WeakSet:Set,Et=null;function ky(e,t){if(e=e.containerInfo,Lu=li,e=If(e),pc(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 b=0,w=-1,A=-1,K=0,ce=0,fe=e,F=null;t:for(;;){for(var te;fe!==a||c!==0&&fe.nodeType!==3||(w=b+c),fe!==d||l!==0&&fe.nodeType!==3||(A=b+l),fe.nodeType===3&&(b+=fe.nodeValue.length),(te=fe.firstChild)!==null;)F=fe,fe=te;for(;;){if(fe===e)break t;if(F===a&&++K===c&&(w=b),F===d&&++ce===l&&(A=b),(te=fe.nextSibling)!==null)break;fe=F,F=fe.parentNode}fe=te}a=w===-1||A===-1?null:{start:w,end:A}}else a=null}a=a||{start:0,end:0}}else a=null;for(Yu={focusedElem:e,selectionRange:a},li=!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=ss(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)Xu(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Xu(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 Lx(e,t,a){var l=a.flags;switch(a.tag){case 0:case 11:case 15:ja(e,a),l&4&&er(5,a);break;case 1:if(ja(e,a),l&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(b){Pe(a,a.return,b)}else{var c=ss(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(b){Pe(a,a.return,b)}}l&64&&Dx(a),l&512&&tr(a,a.return);break;case 3:if(ja(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{Nh(e,t)}catch(b){Pe(a,a.return,b)}}break;case 27:t===null&&l&4&&Bx(a);case 26:case 5:ja(e,a),t===null&&l&4&&$x(a),l&512&&tr(a,a.return);break;case 12:ja(e,a);break;case 13:ja(e,a),l&4&&Gx(e,a),l&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=Dy.bind(null,a),Py(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?Na(e,a,(a.subtreeFlags&8772)!==0):ja(e,a),Qn=c,ht=d}break;case 30:break;default:ja(e,a)}}function Yx(e){var t=e.alternate;t!==null&&(e.alternate=null,Yx(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;)Vx(e,t,a),a=a.sibling}function Vx(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;Ca(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,Ap(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),br(e)):Ap(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||va(2,a,t),ht||va(4,a,t),Kn(e,t,a);break;case 1:ht||(Mn(a,t),l=a.stateNode,typeof l.componentWillUnmount=="function"&&Hx(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 Gx(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{br(e)}catch(a){Pe(t,t.return,a)}}function _y(e){switch(e.tag){case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new qx),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new qx),t;default:throw Error(i(435,e.tag))}}function bu(e,t){var a=_y(e);t.forEach(function(l){var c=Hy.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,b=t,w=b;e:for(;w!==null;){switch(w.tag){case 27:if(Ca(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));Vx(d,b,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;)Xx(t,e),t=t.sibling}var jn=null;function Xx(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&&(va(3,e,e.return),er(3,e),va(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[Va]||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,pt(d),l=d;break e;case"link":var b=Bp("link","href",c).get(l+(a.href||""));if(b){for(var w=0;w<b.length;w++)if(d=b[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)){b.splice(w,1);break t}}d=c.createElement(l),Dt(d,l,a),c.head.appendChild(d);break;case"meta":if(b=Bp("meta","content",c).get(l+(a.content||""))){for(w=0;w<b.length;w++)if(d=b[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)){b.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,pt(d),l=d}e.stateNode=l}else qp(c,e.type,e.stateNode);else e.stateNode=Up(c,l,e.memoizedProps);else d!==l?(d===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):d.count--,l===null?qp(c,e.type,e.stateNode):Up(c,l,e.memoizedProps)):l===null&&e.stateNode!==null&&xu(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&&xu(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,xu(e,c,a!==null?a.memoizedProps:c)),l&1024&&(gu=!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(ni=null,c=jn,jn=ei(t.containerInfo),Pt(t,e),jn=c,en(e),l&4&&a!==null&&a.memoizedState.isDehydrated)try{br(t.containerInfo)}catch(te){Pe(e,e.return,te)}gu&&(gu=!1,Zx(e));break;case 4:l=jn,jn=ei(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)&&(Su=re()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,bu(e,l)));break;case 22:c=e.memoizedState!==null;var A=a!==null&&a.memoizedState!==null,K=Qn,ce=ht;if(Qn=K||c,ht=ce||A,Pt(t,e),ht=ce,Qn=K,en(e),l&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(a===null||A||Qn||ht||ls(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){A=a=t;try{if(d=A.stateNode,c)b=d.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{w=A.stateNode;var fe=A.memoizedProps.style,F=fe!=null&&fe.hasOwnProperty("display")?fe.display:null;w.style.display=F==null||typeof F=="boolean"?"":(""+F).trim()}}catch(te){Pe(A,A.return,te)}}}else if(t.tag===6){if(a===null){A=t;try{A.stateNode.nodeValue=c?"":A.memoizedProps}catch(te){Pe(A,A.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(Ux(l)){a=l;break}l=l.return}if(a==null)throw Error(i(160));switch(a.tag){case 27:var c=a.stateNode,d=pu(e);Lo(e,d,c);break;case 5:var b=a.stateNode;a.flags&32&&(ws(b,""),a.flags&=-33);var w=pu(e);Lo(e,w,b);break;case 3:case 4:var A=a.stateNode.containerInfo,K=pu(e);mu(e,K,A);break;default:throw Error(i(161))}}catch(ce){Pe(e,e.return,ce)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Zx(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Zx(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ja(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Lx(e,t.alternate,t),t=t.sibling}function ls(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:va(4,t,t.return),ls(t);break;case 1:Mn(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&Hx(t,t.return,a),ls(t);break;case 27:ur(t.stateNode);case 26:case 5:Mn(t,t.return),ls(t);break;case 22:t.memoizedState===null&&ls(t);break;case 30:ls(t);break;default:ls(t)}e=e.sibling}}function Na(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,c=e,d=t,b=d.flags;switch(d.tag){case 0:case 11:case 15:Na(c,d,a),er(4,d);break;case 1:if(Na(c,d,a),l=d,c=l.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(K){Pe(l,l.return,K)}if(l=d,c=l.updateQueue,c!==null){var w=l.stateNode;try{var A=c.shared.hiddenCallbacks;if(A!==null)for(c.shared.hiddenCallbacks=null,c=0;c<A.length;c++)jh(A[c],w)}catch(K){Pe(l,l.return,K)}}a&&b&64&&Dx(d),tr(d,d.return);break;case 27:Bx(d);case 26:case 5:Na(c,d,a),a&&l===null&&b&4&&$x(d),tr(d,d.return);break;case 12:Na(c,d,a);break;case 13:Na(c,d,a),a&&b&4&&Gx(c,d);break;case 22:d.memoizedState===null&&Na(c,d,a),tr(d,d.return);break;case 30:break;default:Na(c,d,a)}t=t.sibling}}function yu(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 vu(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;)Wx(e,t,a,l),t=t.sibling}function Wx(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,b=d.id,w=d.onPostCommit;typeof w=="function"&&w(b,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(A){Pe(t,t.return,A)}}else An(e,t,a,l);break;case 13:An(e,t,a,l);break;case 23:break;case 22:d=t.stateNode,b=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&&yu(b,t);break;case 24:An(e,t,a,l),c&2048&&vu(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,b=t,w=a,A=l,K=b.flags;switch(b.tag){case 0:case 11:case 15:Ys(d,b,w,A,c),er(8,b);break;case 23:break;case 22:var ce=b.stateNode;b.memoizedState!==null?ce._visibility&2?Ys(d,b,w,A,c):nr(d,b):(ce._visibility|=2,Ys(d,b,w,A,c)),c&&K&2048&&yu(b.alternate,b);break;case 24:Ys(d,b,w,A,c),c&&K&2048&&vu(b.alternate,b);break;default:Ys(d,b,w,A,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&&yu(l.alternate,l);break;case 24:nr(a,l),c&2048&&vu(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;)Qx(e),e=e.sibling}function Qx(e){switch(e.tag){case 26:Vs(e),e.flags&ar&&e.memoizedState!==null&&fv(jn,e.memoizedState,e.memoizedProps);break;case 5:Vs(e);break;case 3:case 4:var t=jn;jn=ei(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 Kx(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,Ix(l,e)}Kx(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Jx(e),e=e.sibling}function Jx(e){switch(e.tag){case 0:case 11:case 15:sr(e),e.flags&2048&&va(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,Yo(e)):sr(e);break;default:sr(e)}}function Yo(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,Ix(l,e)}Kx(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:va(8,t,t.return),Yo(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Yo(t));break;default:Yo(t)}e=e.sibling}}function Ix(e,t){for(;Et!==null;){var a=Et;switch(a.tag){case 0:case 11:case 15:va(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(Yx(l),l===a){Et=null;break e}if(c!==null){c.return=d,Et=c;break e}Et=d}}}var Cy={getCacheForType:function(e){var t=Ut(bt),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a}},Ty=typeof WeakMap=="function"?WeakMap:Map,Qe=0,et=null,Be=null,Ye=0,Ke=0,tn=null,wa=!1,Gs=!1,ju=!1,Jn=0,ct=0,Sa=0,rs=0,Nu=0,pn=0,Xs=0,lr=null,Qt=null,wu=!1,Su=0,Vo=1/0,Go=null,Ea=null,Ot=0,ka=null,Zs=null,Ws=0,Eu=0,ku=null,Fx=null,rr=0,_u=null;function nn(){if((Qe&2)!==0&&Ye!==0)return Ye&-Ye;if(k.T!==null){var e=Os;return e!==0?e:Ou()}return Kr()}function Px(){pn===0&&(pn=(Ye&536870912)===0||Ze?bs():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),_a(e,Ye,pn,!1)),ra(e,a),((Qe&2)===0||e!==et)&&(e===et&&((Qe&2)===0&&(rs|=a),ct===4&&_a(e,Ye,pn,!1)),Rn(e))}function ep(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?Ry(e,t):Mu(e,t,!0),d=l;do{if(c===0){Gs&&!l&&_a(e,t,0,!1);break}else{if(a=e.current.alternate,d&&!My(a)){c=Mu(e,t,!1),d=!1;continue}if(c===2){if(d=t,e.errorRecoveryDisabledLanes&d)var b=0;else b=e.pendingLanes&-536870913,b=b!==0?b:b&536870912?536870912:0;if(b!==0){t=b;e:{var w=e;c=lr;var A=w.current.memoizedState.isDehydrated;if(A&&(Qs(w,b).flags|=256),b=Mu(w,b,!1),b!==2){if(ju&&!A){w.errorRecoveryDisabledLanes|=d,rs|=d,c=4;break e}d=Qt,Qt=c,d!==null&&(Qt===null?Qt=d:Qt.push.apply(Qt,d))}c=b}if(d=!1,c!==2)continue}}if(c===1){Qs(e,0),_a(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:_a(l,t,pn,!wa);break e;case 2:Qt=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(c=Su+300-re(),10<c)){if(_a(l,t,pn,!wa),Yt(l,0,!0)!==0)break e;l.timeoutHandle=Tp(tp.bind(null,l,a,Qt,Go,wu,t,pn,rs,Xs,wa,d,2,-0,0),c);break e}tp(l,a,Qt,Go,wu,t,pn,rs,Xs,wa,d,0,-0,0)}}break}while(!0);Rn(e)}function tp(e,t,a,l,c,d,b,w,A,K,ce,fe,F,te){if(e.timeoutHandle=-1,fe=t.subtreeFlags,(fe&8192||(fe&16785408)===16785408)&&(hr={stylesheets:null,count:0,unsuspend:dv},Qx(t),fe=hv(),fe!==null)){e.cancelPendingCommit=fe(ip.bind(null,e,t,d,a,l,c,b,w,A,ce,1,F,te)),_a(e,d,b,!K);return}ip(e,t,d,a,l,c,b,w,A)}function My(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 _a(e,t,a,l){t&=~Nu,t&=~rs,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var c=t;0<c;){var d=31-at(c),b=1<<d;l[d]=-1,c&=~b}a!==0&&Wr(e,a,t)}function Xo(){return(Qe&6)===0?(or(0),!1):!0}function Cu(){if(Be!==null){if(Ke===0)var e=Be.return;else e=Be,Yn=es=null,Xc(e),qs=null,Il=0,e=Be;for(;e!==null;)Ox(e.alternate,e),e=e.return;Be=null}}function Qs(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,Qy(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),Cu(),et=e,Be=a=Bn(e.current,null),Ye=t,Ke=0,tn=null,wa=!1,Gs=Jt(e,t),ju=!1,Xs=pn=Nu=rs=Sa=ct=0,Qt=lr=null,wu=!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,ho(),a}function np(e,t){He=null,k.H=Ro,t===Yl||t===No?(t=yh(),Ke=3):t===mh?(t=yh(),Ke=4):Ke=t===vx?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,tn=t,Be===null&&(ct=1,$o(e,un(t,e.current)))}function ap(){var e=k.H;return k.H=Ro,e===null?Ro:e}function sp(){var e=k.A;return k.A=Cy,e}function Tu(){ct=4,wa||(Ye&4194048)!==Ye&&xn.current!==null||(Gs=!0),(Sa&134217727)===0&&(rs&134217727)===0||et===null||_a(et,Ye,pn,!1)}function Mu(e,t,a){var l=Qe;Qe|=2;var c=ap(),d=sp();(et!==e||Ye!==t)&&(Go=null,Qs(e,t)),t=!1;var b=ct;e:do try{if(Ke!==0&&Be!==null){var w=Be,A=tn;switch(Ke){case 8:Cu(),b=6;break e;case 3:case 2:case 9:case 6:xn.current===null&&(t=!0);var K=Ke;if(Ke=0,tn=null,Ks(e,w,A,K),a&&Gs){b=0;break e}break;default:K=Ke,Ke=0,tn=null,Ks(e,w,A,K)}}Ay(),b=ct;break}catch(ce){np(e,ce)}while(!0);return t&&e.shellSuspendCounter++,Yn=es=null,Qe=l,k.H=c,k.A=d,Be===null&&(et=null,Ye=0,ho()),b}function Ay(){for(;Be!==null;)lp(Be)}function Ry(e,t){var a=Qe;Qe|=2;var l=ap(),c=sp();et!==e||Ye!==t?(Go=null,Vo=re()+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(gh(d)){Ke=0,tn=null,rp(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:gh(d)?(Ke=0,tn=null,rp(t)):(Ke=0,tn=null,Ks(e,t,d,7));break;case 5:var b=null;switch(Be.tag){case 26:b=Be.memoizedState;case 5:case 27:var w=Be;if(!b||Lp(b)){Ke=0,tn=null;var A=w.sibling;if(A!==null)Be=A;else{var K=w.return;K!==null?(Be=K,Zo(K)):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:Cu(),ct=6;break e;default:throw Error(i(462))}}zy();break}catch(ce){np(e,ce)}while(!0);return Yn=es=null,k.H=l,k.A=c,Qe=a,Be!==null?0:(et=null,Ye=0,ho(),ct)}function zy(){for(;Be!==null&&!V();)lp(Be)}function lp(e){var t=Rx(e.alternate,e,Jn);e.memoizedProps=e.pendingProps,t===null?Zo(e):Be=t}function rp(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=kx(a,t,t.pendingProps,t.type,void 0,Ye);break;case 11:t=kx(a,t,t.pendingProps,t.type.render,t.ref,Ye);break;case 5:Xc(t);default:Ox(a,t),t=Be=oh(t,Jn),t=Rx(a,t,Jn)}e.memoizedProps=e.pendingProps,t===null?Zo(e):Be=t}function Ks(e,t,a,l){Yn=es=null,Xc(t),qs=null,Il=0;var c=t.return;try{if(Ny(e,c,t,a,Ye)){ct=1,$o(e,un(a,e.current)),Be=null;return}}catch(d){if(c!==null)throw Be=c,d;ct=1,$o(e,un(a,e.current)),Be=null;return}t.flags&32768?(Ze||l===1?e=!0:Gs||(Ye&536870912)!==0?e=!1:(wa=e=!0,(l===2||l===9||l===3||l===6)&&(l=xn.current,l!==null&&l.tag===13&&(l.flags|=16384))),op(t,e)):Zo(t)}function Zo(e){var t=e;do{if((t.flags&32768)!==0){op(t,wa);return}e=t.return;var a=Sy(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 op(e,t){do{var a=Ey(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 ip(e,t,a,l,c,d,b,w,A){e.cancelPendingCommit=null;do Wo();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|=vc,Dn(e,a,d,b,w,A),e===et&&(Be=et=null,Ye=0),Zs=t,ka=e,Ws=a,Eu=d,ku=c,Fx=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,$y(ke,function(){return hp(),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,b=Qe,Qe|=4;try{ky(e,t,a)}finally{Qe=b,H.p=c,k.T=l}}Ot=1,cp(),up(),dp()}}function cp(){if(Ot===1){Ot=0;var e=ka,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{Xx(t,e);var d=Yu,b=If(e.containerInfo),w=d.focusedElem,A=d.selectionRange;if(b!==w&&w&&w.ownerDocument&&Jf(w.ownerDocument.documentElement,w)){if(A!==null&&pc(w)){var K=A.start,ce=A.end;if(ce===void 0&&(ce=K),"selectionStart"in w)w.selectionStart=K,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(A.start,Me),Fe=A.end===void 0?_e:Math.min(A.end,Me);!te.extend&&_e>Fe&&(b=Fe,Fe=_e,_e=b);var G=Kf(w,_e),B=Kf(w,Fe);if(G&&B&&(te.rangeCount!==1||te.anchorNode!==G.node||te.anchorOffset!==G.offset||te.focusNode!==B.node||te.focusOffset!==B.offset)){var Q=fe.createRange();Q.setStart(G.node,G.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}}li=!!Lu,Yu=Lu=null}finally{Qe=c,H.p=l,k.T=a}}e.current=t,Ot=2}}function up(){if(Ot===2){Ot=0;var e=ka,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{Lx(e,t.alternate,t)}finally{Qe=c,H.p=l,k.T=a}}Ot=3}}function dp(){if(Ot===4||Ot===3){Ot=0,ue();var e=ka,t=Zs,a=Ws,l=Fx;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Ot=5:(Ot=0,Zs=ka=null,fp(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(Ea=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,b=0;b<l.length;b++){var w=l[b];d(w.value,{componentStack:w.stack})}}finally{k.T=t,H.p=c}}(Ws&3)!==0&&Wo(),Rn(e),c=e.pendingLanes,(a&4194090)!==0&&(c&42)!==0?e===_u?rr++:(rr=0,_u=e):rr=0,or(0)}}function fp(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ql(t)))}function Wo(e){return cp(),up(),dp(),hp()}function hp(){if(Ot!==5)return!1;var e=ka,t=Eu;Eu=0;var a=wl(Ws),l=k.T,c=H.p;try{H.p=32>a?32:a,k.T=null,a=ku,ku=null;var d=ka,b=Ws;if(Ot=0,Zs=ka=null,Ws=0,(Qe&6)!==0)throw Error(i(331));var w=Qe;if(Qe|=4,Jx(d.current),Wx(d,d.current,b,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,fp(e,t)}}function xp(e,t,a){t=un(a,t),t=lu(e.stateNode,t,2),e=ma(e,t,2),e!==null&&(ra(e,2),Rn(e))}function Pe(e,t,a){if(e.tag===3)xp(e,e,a);else for(;t!==null;){if(t.tag===3){xp(t,e,a);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Ea===null||!Ea.has(l))){e=un(a,e),a=bx(2),l=ma(t,a,2),l!==null&&(yx(a,l,t,e),ra(l,2),Rn(l));break}}t=t.return}}function Au(e,t,a){var l=e.pingCache;if(l===null){l=e.pingCache=new Ty;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)||(ju=!0,c.add(a),e=Oy.bind(null,e,t,a),t.then(e,e))}function Oy(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>re()-Su?(Qe&2)===0&&Qs(e,0):Nu|=a,Xs===Ye&&(Xs=0)),Rn(e)}function pp(e,t){t===0&&(t=la()),e=Ms(e,t),e!==null&&(ra(e,t),Rn(e))}function Dy(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),pp(e,a)}function Hy(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),pp(e,a)}function $y(e,t){return ye(e,t)}var Qo=null,Js=null,Ru=!1,Ko=!1,zu=!1,os=0;function Rn(e){e!==Js&&e.next===null&&(Js===null?Qo=Js=e:Js=Js.next=e),Ko=!0,Ru||(Ru=!0,By())}function or(e,t){if(!zu&&Ko){zu=!0;do for(var a=!1,l=Qo;l!==null;){if(e!==0){var c=l.pendingLanes;if(c===0)var d=0;else{var b=l.suspendedLanes,w=l.pingedLanes;d=(1<<31-at(42|e)+1)-1,d&=c&~(b&~w),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(a=!0,yp(l,d))}else d=Ye,d=Yt(l,l===et?d:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(d&3)===0||Jt(l,d)||(a=!0,yp(l,d));l=l.next}while(a);zu=!1}}function Uy(){mp()}function mp(){Ko=Ru=!1;var e=0;os!==0&&(Wy()&&(e=os),os=0);for(var t=re(),a=null,l=Qo;l!==null;){var c=l.next,d=gp(l,t);d===0?(l.next=null,a===null?Qo=c:a.next=c,c===null&&(Js=a)):(a=l,(e!==0||(d&3)!==0)&&(Ko=!0)),l=c}or(e)}function gp(e,t){for(var a=e.suspendedLanes,l=e.pingedLanes,c=e.expirationTimes,d=e.pendingLanes&-62914561;0<d;){var b=31-at(d),w=1<<b,A=c[b];A===-1?((w&a)===0||(w&l)!==0)&&(c[b]=jl(w,t)):A<=t&&(e.expiredLanes|=w),d&=~w}if(t=et,a=Ye,a=Yt(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=ye(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(Wo()&&e.callbackNode!==a)return null;var l=Ye;return l=Yt(e,e===et?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(ep(e,l,t),gp(e,re()),e.callbackNode!=null&&e.callbackNode===a?bp.bind(null,e):null)}function yp(e,t){if(Wo())return null;ep(e,t,!0)}function By(){Ky(function(){(Qe&6)!==0?ye(Ee,Uy):mp()})}function Ou(){return os===0&&(os=bs()),os}function vp(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:lo(""+e)}function jp(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 qy(e,t,a,l,c){if(t==="submit"&&a&&a.stateNode===c){var d=vp((c[$t]||null).action),b=l.submitter;b&&(t=(t=b[$t]||null)?vp(t.formAction):b.getAttribute("formAction"),t!==null&&(d=t,b=null));var w=new co("action","action",null,l,c);e.push({event:w,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(os!==0){var A=b?jp(c,b):new FormData(c);eu(a,{pending:!0,data:A,method:c.method,action:d},null,A)}}else typeof d=="function"&&(w.preventDefault(),A=b?jp(c,b):new FormData(c),eu(a,{pending:!0,data:A,method:c.method,action:d},d,A))},currentTarget:c}]})}}for(var Du=0;Du<yc.length;Du++){var Hu=yc[Du],Ly=Hu.toLowerCase(),Yy=Hu[0].toUpperCase()+Hu.slice(1);vn(Ly,"on"+Yy)}vn(eh,"onAnimationEnd"),vn(th,"onAnimationIteration"),vn(nh,"onAnimationStart"),vn("dblclick","onDoubleClick"),vn("focusin","onFocus"),vn("focusout","onBlur"),vn(ly,"onTransitionRun"),vn(ry,"onTransitionStart"),vn(oy,"onTransitionCancel"),vn(ah,"onTransitionEnd"),ua("onMouseEnter",["mouseout","mouseover"]),ua("onMouseLeave",["mouseout","mouseover"]),ua("onPointerEnter",["pointerout","pointerover"]),ua("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(" "),Vy=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ir));function Np(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 b=l.length-1;0<=b;b--){var w=l[b],A=w.instance,K=w.currentTarget;if(w=w.listener,A!==d&&c.isPropagationStopped())break e;d=w,c.currentTarget=K;try{d(c)}catch(ce){Ho(ce)}c.currentTarget=null,d=A}else for(b=0;b<l.length;b++){if(w=l[b],A=w.instance,K=w.currentTarget,w=w.listener,A!==d&&c.isPropagationStopped())break e;d=w,c.currentTarget=K;try{d(c)}catch(ce){Ho(ce)}c.currentTarget=null,d=A}}}}function qe(e,t){var a=t[Sl];a===void 0&&(a=t[Sl]=new Set);var l=e+"__bubble";a.has(l)||(wp(t,e,2,!1),a.add(l))}function $u(e,t,a){var l=0;t&&(l|=4),wp(a,e,l,t)}var Jo="_reactListening"+Math.random().toString(36).slice(2);function Uu(e){if(!e[Jo]){e[Jo]=!0,Ir.forEach(function(a){a!=="selectionchange"&&(Vy.has(a)||$u(a,!1,e),$u(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Jo]||(t[Jo]=!0,$u("selectionchange",!1,t))}}function wp(e,t,a,l){switch(Wp(t)){case 2:var c=mv;break;case 8:c=gv;break;default:c=Fu}a=c.bind(null,t,a,e),c=void 0,!rc||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 Bu(e,t,a,l,c){var d=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var b=l.tag;if(b===3||b===4){var w=l.stateNode.containerInfo;if(w===c)break;if(b===4)for(b=l.return;b!==null;){var A=b.tag;if((A===3||A===4)&&b.stateNode.containerInfo===c)return;b=b.return}for(;w!==null;){if(b=Hn(w),b===null)return;if(A=b.tag,A===5||A===6||A===26||A===27){l=d=b;continue e}w=w.parentNode}}l=l.return}Mf(function(){var K=d,ce=sc(a),fe=[];e:{var F=sh.get(e);if(F!==void 0){var te=co,Me=e;switch(e){case"keypress":if(oo(a)===0)break e;case"keydown":case"keyup":te=$b;break;case"focusin":Me="focus",te=uc;break;case"focusout":Me="blur",te=uc;break;case"beforeblur":case"afterblur":te=uc;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=zf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":te=Eb;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":te=qb;break;case eh:case th:case nh:te=Cb;break;case ah:te=Yb;break;case"scroll":case"scrollend":te=wb;break;case"wheel":te=Gb;break;case"copy":case"cut":case"paste":te=Mb;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":te=Df;break;case"toggle":case"beforetoggle":te=Zb}var _e=(t&4)!==0,Fe=!_e&&(e==="scroll"||e==="scrollend"),G=_e?F!==null?F+"Capture":null:F;_e=[];for(var B=K,Q;B!==null;){var de=B;if(Q=de.stateNode,de=de.tag,de!==5&&de!==26&&de!==27||Q===null||G===null||(de=_l(B,G),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!==ac&&(Me=a.relatedTarget||a.fromElement)&&(Hn(Me)||Me[oa]))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=K,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=K),te!==Me)){if(_e=zf,de="onMouseLeave",G="onMouseEnter",B="mouse",(e==="pointerout"||e==="pointerover")&&(_e=Df,de="onPointerLeave",G="onPointerEnter",B="pointer"),Fe=te==null?F:Ga(te),Q=Me==null?F:Ga(Me),F=new _e(de,B+"leave",te,a,ce),F.target=Fe,F.relatedTarget=Q,de=null,Hn(ce)===K&&(_e=new _e(G,B+"enter",Me,a,ce),_e.target=Q,_e.relatedTarget=Fe,de=_e),Fe=de,te&&Me)t:{for(_e=te,G=Me,B=0,Q=_e;Q;Q=Is(Q))B++;for(Q=0,de=G;de;de=Is(de))Q++;for(;0<B-Q;)_e=Is(_e),B--;for(;0<Q-B;)G=Is(G),Q--;for(;B--;){if(_e===G||G!==null&&_e===G.alternate)break t;_e=Is(_e),G=Is(G)}_e=null}else _e=null;te!==null&&Sp(fe,F,te,_e,!1),Me!==null&&Fe!==null&&Sp(fe,Fe,Me,_e,!0)}}e:{if(F=K?Ga(K):window,te=F.nodeName&&F.nodeName.toLowerCase(),te==="select"||te==="input"&&F.type==="file")var be=Vf;else if(Lf(F))if(Gf)be=ny;else{be=ey;var $e=Pb}else te=F.nodeName,!te||te.toLowerCase()!=="input"||F.type!=="checkbox"&&F.type!=="radio"?K&&nc(K.elementType)&&(be=Vf):be=ty;if(be&&(be=be(e,K))){Yf(fe,be,a,ce);break e}$e&&$e(e,F,K),e==="focusout"&&K&&F.type==="number"&&K.memoizedProps.value!=null&&tc(F,"number",F.value)}switch($e=K?Ga(K):window,e){case"focusin":(Lf($e)||$e.contentEditable==="true")&&(_s=$e,mc=K,Dl=null);break;case"focusout":Dl=mc=_s=null;break;case"mousedown":gc=!0;break;case"contextmenu":case"mouseup":case"dragend":gc=!1,Ff(fe,a,ce);break;case"selectionchange":if(sy)break;case"keydown":case"keyup":Ff(fe,a,ce)}var Ne;if(fc)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?Bf(e,a)&&(Ce="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Ce="onCompositionStart");Ce&&(Hf&&a.locale!=="ko"&&(ks||Ce!=="onCompositionStart"?Ce==="onCompositionEnd"&&ks&&(Ne=Af()):(fa=ce,oc="value"in fa?fa.value:fa.textContent,ks=!0)),$e=Io(K,Ce),0<$e.length&&(Ce=new Of(Ce,e,null,a,ce),fe.push({event:Ce,listeners:$e}),Ne?Ce.data=Ne:(Ne=qf(a),Ne!==null&&(Ce.data=Ne)))),(Ne=Qb?Kb(e,a):Jb(e,a))&&(Ce=Io(K,"onBeforeInput"),0<Ce.length&&($e=new Of("onBeforeInput","beforeinput",null,a,ce),fe.push({event:$e,listeners:Ce}),$e.data=Ne)),qy(fe,e,K,a,ce)}Np(fe,t)})}function cr(e,t,a){return{instance:e,listener:t,currentTarget:a}}function Io(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 Sp(e,t,a,l,c){for(var d=t._reactName,b=[];a!==null&&a!==l;){var w=a,A=w.alternate,K=w.stateNode;if(w=w.tag,A!==null&&A===l)break;w!==5&&w!==26&&w!==27||K===null||(A=K,c?(K=_l(a,d),K!=null&&b.unshift(cr(a,K,A))):c||(K=_l(a,d),K!=null&&b.push(cr(a,K,A)))),a=a.return}b.length!==0&&e.push({event:t,listeners:b})}var Gy=/\r\n?/g,Xy=/\u0000|\uFFFD/g;function Ep(e){return(typeof e=="string"?e:""+e).replace(Gy,`
|
|
49
|
-
`).replace(Xy,"")}function kp(e,t){return t=Ep(t),Ep(e)===t}function Fo(){}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":Cf(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=lo(""+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=lo(""+l),e.setAttribute(a,l);break;case"onClick":l!=null&&(e.onclick=Fo);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=lo(""+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),ys(e,"popover",l);break;case"xlinkActuate":yn(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":yn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":yn(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":yn(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":yn(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":yn(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":yn(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":yn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":yn(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":ys(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=jb.get(a)||a,ys(e,a,l))}}function qu(e,t,a,l,c,d){switch(a){case"style":Cf(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=Fo);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Fr.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[$t]||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,""):ys(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 b=a[d];if(b!=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,b,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=b=c=null,A=null,K=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":b=ce;break;case"checked":A=ce;break;case"defaultChecked":K=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)}}Sf(e,d,w,A,K,b,c,!1),ao(e);return;case"select":qe("invalid",e),l=b=d=null;for(c in a)if(a.hasOwnProperty(c)&&(w=a[c],w!=null))switch(c){case"value":d=w;break;case"defaultValue":b=w;break;case"multiple":l=w;default:Ie(e,t,c,w,a,null)}t=d,a=b,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(b in a)if(a.hasOwnProperty(b)&&(w=a[b],w!=null))switch(b){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,b,w,a,null)}kf(e,l,c,d),ao(e);return;case"option":for(A in a)if(a.hasOwnProperty(A)&&(l=a[A],l!=null))switch(A){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:Ie(e,t,A,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(K in a)if(a.hasOwnProperty(K)&&(l=a[K],l!=null))switch(K){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:Ie(e,t,K,l,a,null)}return;default:if(nc(t)){for(ce in a)a.hasOwnProperty(ce)&&(l=a[ce],l!==void 0&&qu(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 Zy(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,b=null,w=null,A=null,K=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":A=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":K=te;break;case"defaultChecked":ce=te;break;case"value":b=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)}}ec(e,b,w,A,K,ce,d,c);return;case"select":te=b=w=F=null;for(d in a)if(A=a[d],a.hasOwnProperty(d)&&A!=null)switch(d){case"value":break;case"multiple":te=A;default:l.hasOwnProperty(d)||Ie(e,t,d,null,l,A)}for(c in l)if(d=l[c],A=a[c],l.hasOwnProperty(c)&&(d!=null||A!=null))switch(c){case"value":F=d;break;case"defaultValue":w=d;break;case"multiple":b=d;default:d!==A&&Ie(e,t,c,d,l,A)}t=w,a=b,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(b in l)if(c=l[b],d=a[b],l.hasOwnProperty(b)&&(c!=null||d!=null))switch(b){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,b,c,l,d)}Ef(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(A in l)if(F=l[A],te=a[A],l.hasOwnProperty(A)&&F!==te&&(F!=null||te!=null))switch(A){case"selected":e.selected=F&&typeof F!="function"&&typeof F!="symbol";break;default:Ie(e,t,A,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(K in l)if(F=l[K],te=a[K],l.hasOwnProperty(K)&&F!==te&&(F!=null||te!=null))switch(K){case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(i(137,t));break;default:Ie(e,t,K,F,l,te)}return;default:if(nc(t)){for(var Fe in a)F=a[Fe],a.hasOwnProperty(Fe)&&F!==void 0&&!l.hasOwnProperty(Fe)&&qu(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||qu(e,t,ce,F,l,te);return}}for(var G in a)F=a[G],a.hasOwnProperty(G)&&F!=null&&!l.hasOwnProperty(G)&&Ie(e,t,G,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 Lu=null,Yu=null;function Po(e){return e.nodeType===9?e:e.ownerDocument}function _p(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 Cp(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 Vu(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 Gu=null;function Wy(){var e=window.event;return e&&e.type==="popstate"?e===Gu?!1:(Gu=e,!0):(Gu=null,!1)}var Tp=typeof setTimeout=="function"?setTimeout:void 0,Qy=typeof clearTimeout=="function"?clearTimeout:void 0,Mp=typeof Promise=="function"?Promise:void 0,Ky=typeof queueMicrotask=="function"?queueMicrotask:typeof Mp<"u"?function(e){return Mp.resolve(null).then(e).catch(Jy)}:Tp;function Jy(e){setTimeout(function(){throw e})}function Ca(e){return e==="head"}function Ap(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 b=e.ownerDocument;if(a&1&&ur(b.documentElement),a&2&&ur(b.body),a&4)for(a=b.head,ur(a),b=a.firstChild;b;){var w=b.nextSibling,A=b.nodeName;b[Va]||A==="SCRIPT"||A==="STYLE"||A==="LINK"&&b.rel.toLowerCase()==="stylesheet"||a.removeChild(b),b=w}}if(c===0){e.removeChild(d),br(t);return}c--}else a==="$"||a==="$?"||a==="$!"?c++:l=a.charCodeAt(0)-48;else l=0;a=d}while(a);br(t)}function Xu(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":Xu(a),El(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function Iy(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[Va])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 Fy(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 Zu(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState==="complete"}function Py(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 Wu=null;function Rp(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 zp(e,t,a){switch(t=Po(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,Op=new Set;function ei(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var In=H.d;H.d={f:ev,r:tv,D:nv,C:av,L:sv,m:lv,X:ov,S:rv,M:iv};function ev(){var e=In.f(),t=Xo();return e||t}function tv(e){var t=ia(e);t!==null&&t.tag===5&&t.type==="form"?ex(t):In.r(e)}var Fs=typeof document>"u"?null:document;function Dp(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+'"]'),Op.has(c)||(Op.add(c),e={rel:e,crossOrigin:a,href:t},l.querySelector(c)===null&&(t=l.createElement("link"),Dt(t,"link",e),pt(t),l.head.appendChild(t)))}}function nv(e){In.D(e),Dp("dns-prefetch",e,null)}function av(e,t){In.C(e,t),Dp("preconnect",e,t)}function sv(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),pt(t),l.head.appendChild(t)))}}function lv(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),pt(l),a.head.appendChild(l)}}}function rv(e,t,a){In.S(e,t,a);var l=Fs;if(l&&e){var c=ca(l).hoistableStyles,d=Ps(e);t=t||"default";var b=c.get(d);if(!b){var w={loading:0,preload:null};if(b=l.querySelector(dr(d)))w.loading=5;else{e=m({rel:"stylesheet",href:e,"data-precedence":t},a),(a=mn.get(d))&&Qu(e,a);var A=b=l.createElement("link");pt(A),Dt(A,"link",e),A._p=new Promise(function(K,ce){A.onload=K,A.onerror=ce}),A.addEventListener("load",function(){w.loading|=1}),A.addEventListener("error",function(){w.loading|=2}),w.loading|=4,ti(b,t,l)}b={type:"stylesheet",instance:b,count:1,state:w},c.set(d,b)}}}function ov(e,t){In.X(e,t);var a=Fs;if(a&&e){var l=ca(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))&&Ku(e,t),d=a.createElement("script"),pt(d),Dt(d,"link",e),a.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},l.set(c,d))}}function iv(e,t){In.M(e,t);var a=Fs;if(a&&e){var l=ca(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))&&Ku(e,t),d=a.createElement("script"),pt(d),Dt(d,"link",e),a.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},l.set(c,d))}}function Hp(e,t,a,l){var c=(c=xe.current)?ei(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=ca(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=ca(c).hoistableStyles,b=d.get(e);if(b||(c=c.ownerDocument||c,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},d.set(e,b),(d=c.querySelector(dr(e)))&&!d._p&&(b.instance=d,b.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||cv(c,e,a,b.state))),t&&l===null)throw Error(i(528,""));return b}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=ca(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 $p(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function cv(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),pt(t),e.head.appendChild(t))}function el(e){return'[src="'+cn(e)+'"]'}function fr(e){return"script[async]"+e}function Up(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,pt(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"),pt(l),Dt(l,"style",c),ti(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,pt(d),d;l=$p(a),(c=mn.get(c))&&Qu(l,c),d=(e.ownerDocument||e).createElement("link"),pt(d);var b=d;return b._p=new Promise(function(w,A){b.onload=w,b.onerror=A}),Dt(d,"link",l),t.state.loading|=4,ti(d,a.precedence,e),t.instance=d;case"script":return d=el(a.src),(c=e.querySelector(fr(d)))?(t.instance=c,pt(c),c):(l=a,(c=mn.get(d))&&(l=m({},a),Ku(l,c)),e=e.ownerDocument||e,c=e.createElement("script"),pt(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,ti(l,a.precedence,e));return t.instance}function ti(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,b=0;b<l.length;b++){var w=l[b];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 Qu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Ku(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ni=null;function Bp(e,t,a){if(ni===null){var l=new Map,c=ni=new Map;c.set(a,l)}else c=ni,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[Va]||d[wt]||e==="link"&&d.getAttribute("rel")==="stylesheet")&&d.namespaceURI!=="http://www.w3.org/2000/svg"){var b=d.getAttribute(t)||"";b=e+b;var w=l.get(b);w?w.push(d):l.set(b,[d])}}return l}function qp(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function uv(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 Lp(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}var hr=null;function dv(){}function fv(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=ai.bind(l),e.then(l,l)),t.state.loading|=4,t.instance=d,pt(d);return}d=e.ownerDocument||e,a=$p(a),(c=mn.get(c))&&Qu(a,c),d=d.createElement("link"),pt(d);var b=d;b._p=new Promise(function(w,A){b.onload=w,b.onerror=A}),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=ai.bind(l),e.addEventListener("load",t),e.addEventListener("error",t))}}function hv(){if(hr===null)throw Error(i(475));var e=hr;return e.stylesheets&&e.count===0&&Ju(e,e.stylesheets),0<e.count?function(t){var a=setTimeout(function(){if(e.stylesheets&&Ju(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 ai(){if(this.count--,this.count===0){if(this.stylesheets)Ju(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var si=null;function Ju(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,si=new Map,t.forEach(xv,e),si=null,ai.call(e))}function xv(e,t){if(!(t.state.loading&4)){var a=si.get(e);if(a)var l=a.get(null);else{a=new Map,si.set(e,a);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;d<c.length;d++){var b=c[d];(b.nodeName==="LINK"||b.getAttribute("media")!=="not all")&&(a.set(b.dataset.precedence,b),l=b)}l&&a.set(null,l)}c=t.instance,b=c.getAttribute("data-precedence"),d=a.get(b)||l,d===l&&a.set(null,c),a.set(b,c),this.count++,l=ai.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 pv(e,t,a,l,c,d,b,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=Ya(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ya(0),this.hiddenUpdates=Ya(null),this.identifierPrefix=l,this.onUncaughtError=c,this.onCaughtError=d,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=w,this.incompleteTransitions=new Map}function Yp(e,t,a,l,c,d,b,w,A,K,ce,fe){return e=new pv(e,t,a,b,w,A,K,fe),t=1,d===!0&&(t|=24),d=Ft(3,null,null,t),e.current=d,d.stateNode=e,t=Ac(),t.refCount++,e.pooledCache=t,t.refCount++,d.memoizedState={element:l,isDehydrated:a,cache:t},Dc(d),e}function Vp(e){return e?(e=As,e):As}function Gp(e,t,a,l,c,d){c=Vp(c),l.context===null?l.context=c:l.pendingContext=c,l=pa(t),l.payload={element:a},d=d===void 0?null:d,d!==null&&(l.callback=d),a=ma(e,l,t),a!==null&&(an(a,e,t),Gl(a,e,t))}function Xp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Iu(e,t){Xp(e,t),(e=e.alternate)&&Xp(e,t)}function Zp(e){if(e.tag===13){var t=Ms(e,67108864);t!==null&&an(t,e,67108864),Iu(e,67108864)}}var li=!0;function mv(e,t,a,l){var c=k.T;k.T=null;var d=H.p;try{H.p=2,Fu(e,t,a,l)}finally{H.p=d,k.T=c}}function gv(e,t,a,l){var c=k.T;k.T=null;var d=H.p;try{H.p=8,Fu(e,t,a,l)}finally{H.p=d,k.T=c}}function Fu(e,t,a,l){if(li){var c=Pu(l);if(c===null)Bu(e,t,l,ri,a),Qp(e,l);else if(yv(c,e,t,a,l))l.stopPropagation();else if(Qp(e,l),t&4&&-1<bv.indexOf(e)){for(;c!==null;){var d=ia(c);if(d!==null)switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var b=Rt(d.pendingLanes);if(b!==0){var w=d;for(w.pendingLanes|=2,w.entangledLanes|=2;b;){var A=1<<31-at(b);w.entanglements[1]|=A,b&=~A}Rn(d),(Qe&6)===0&&(Vo=re()+500,or(0))}}break;case 13:w=Ms(d,2),w!==null&&an(w,d,2),Xo(),Iu(d,2)}if(d=Pu(l),d===null&&Bu(e,t,l,ri,a),d===c)break;c=d}c!==null&&l.stopPropagation()}else Bu(e,t,l,null,a)}}function Pu(e){return e=sc(e),ed(e)}var ri=null;function ed(e){if(ri=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 ri=e,null}function Wp(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 td=!1,Ta=null,Ma=null,Aa=null,pr=new Map,mr=new Map,Ra=[],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 Qp(e,t){switch(e){case"focusin":case"focusout":Ta=null;break;case"dragenter":case"dragleave":Ma=null;break;case"mouseover":case"mouseout":Aa=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=ia(t),t!==null&&Zp(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function yv(e,t,a,l,c){switch(t){case"focusin":return Ta=gr(Ta,e,t,a,l,c),!0;case"dragenter":return Ma=gr(Ma,e,t,a,l,c),!0;case"mouseover":return Aa=gr(Aa,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 Kp(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,Ji(e.priority,function(){if(a.tag===13){var l=nn();l=Nl(l);var c=Ms(a,l);c!==null&&an(c,a,l),Iu(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 oi(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=Pu(e.nativeEvent);if(a===null){a=e.nativeEvent;var l=new a.constructor(a.type,a);ac=l,a.target.dispatchEvent(l),ac=null}else return t=ia(a),t!==null&&Zp(t),e.blockedOn=a,!1;t.shift()}return!0}function Jp(e,t,a){oi(e)&&a.delete(t)}function vv(){td=!1,Ta!==null&&oi(Ta)&&(Ta=null),Ma!==null&&oi(Ma)&&(Ma=null),Aa!==null&&oi(Aa)&&(Aa=null),pr.forEach(Jp),mr.forEach(Jp)}function ii(e,t){e.blockedOn===t&&(e.blockedOn=null,td||(td=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,vv)))}var ci=null;function Ip(e){ci!==e&&(ci=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){ci===e&&(ci=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(ed(l||a)===null)continue;break}var d=ia(a);d!==null&&(e.splice(t,3),t-=3,eu(d,{pending:!0,data:c,method:a.method,action:l},l,c))}}))}function br(e){function t(A){return ii(A,e)}Ta!==null&&ii(Ta,e),Ma!==null&&ii(Ma,e),Aa!==null&&ii(Aa,e),pr.forEach(t),mr.forEach(t);for(var a=0;a<Ra.length;a++){var l=Ra[a];l.blockedOn===e&&(l.blockedOn=null)}for(;0<Ra.length&&(a=Ra[0],a.blockedOn===null);)Kp(a),a.blockedOn===null&&Ra.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],b=c[$t]||null;if(typeof d=="function")b||Ip(a);else if(b){var w=null;if(d&&d.hasAttribute("formAction")){if(c=d,b=d[$t]||null)w=b.formAction;else if(ed(c)!==null)continue}else w=b.action;typeof w=="function"?a[l+1]=w:(a.splice(l,3),l-=3),Ip(a)}}}function nd(e){this._internalRoot=e}ui.prototype.render=nd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var a=t.current,l=nn();Gp(a,l,e,t,null,null)},ui.prototype.unmount=nd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Gp(e.current,2,null,e,null,null),Xo(),t[oa]=null}};function ui(e){this._internalRoot=e}ui.prototype.unstable_scheduleHydration=function(e){if(e){var t=Kr();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Ra.length&&t!==0&&t<Ra[a].priority;a++);Ra.splice(a,0,e),a===0&&Kp(e)}};var Fp=r.version;if(Fp!=="19.1.1")throw Error(i(527,Fp,"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 jv={bundleType:0,version:"19.1.1",rendererPackageName:"react-dom",currentDispatcherRef:k,reconcilerVersion:"19.1.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var di=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!di.isDisabled&&di.supportsFiber)try{dt=di.inject(jv),nt=di}catch{}}return vr.createRoot=function(e,t){if(!u(e))throw Error(i(299));var a=!1,l="",c=xx,d=px,b=mx,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&&(b=t.onRecoverableError),t.unstable_transitionCallbacks!==void 0&&(w=t.unstable_transitionCallbacks)),t=Yp(e,1,!1,null,null,a,l,c,d,b,w,null),e[oa]=t.current,Uu(e),new nd(t)},vr.hydrateRoot=function(e,t,a){if(!u(e))throw Error(i(299));var l=!1,c="",d=xx,b=px,w=mx,A=null,K=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&&(b=a.onCaughtError),a.onRecoverableError!==void 0&&(w=a.onRecoverableError),a.unstable_transitionCallbacks!==void 0&&(A=a.unstable_transitionCallbacks),a.formState!==void 0&&(K=a.formState)),t=Yp(e,1,!0,t,a??null,l,c,d,b,w,A,K),t.context=Vp(null),a=t.current,l=nn(),l=Nl(l),c=pa(l),c.callback=null,ma(a,c,l),a=l,t.current.lanes=a,ra(t,a),Rn(t),e[oa]=t.current,Uu(e),new ui(t)},vr.version="19.1.1",vr}var im;function Mv(){if(im)return ld.exports;im=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(),ld.exports=Tv(),ld.exports}var Av=Mv();/**
|
|
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 E0=(...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 Rv=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 zv=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 cm=n=>{const r=zv(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 cd={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 Ov=n=>{for(const r in n)if(r.startsWith("aria-")||r==="role"||r==="title")return!0;return!1},Dv=N.createContext({}),Hv=()=>N.useContext(Dv),$v=N.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:y=!1,color:v="currentColor",className:j=""}=Hv()??{},C=i??y?Number(o??m)*24/Number(r??x):o??m;return N.createElement("svg",{ref:p,...cd,width:r??x??cd.width,height:r??x??cd.height,stroke:n??v,strokeWidth:C,className:E0("lucide",j,u),...!f&&!Ov(g)&&{"aria-hidden":"true"},...g},[...h.map(([_,T])=>N.createElement(_,T)),...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 Se=(n,r)=>{const o=N.forwardRef(({className:i,...u},f)=>N.createElement($v,{ref:f,iconNode:r,className:E0(`lucide-${Rv(cm(n))}`,`lucide-${n}`,i),...u}));return o.displayName=cm(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 Uv=[["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"}]],Yr=Se("activity",Uv);/**
|
|
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 Bv=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],um=Se("arrow-left",Bv);/**
|
|
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 qv=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],dl=Se("arrow-right",qv);/**
|
|
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 Lv=[["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"}]],k0=Se("bell",Lv);/**
|
|
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 Yv=[["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"}]],ki=Se("brain",Yv);/**
|
|
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 Vv=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],jt=Se("check",Vv);/**
|
|
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 Gv=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],qa=Se("chevron-down",Gv);/**
|
|
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 Xv=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],yl=Se("chevron-right",Xv);/**
|
|
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 Zv=[["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"}]],Lt=Se("circle-alert",Zv);/**
|
|
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 Wv=[["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"}]],Qv=Se("circle-play",Wv);/**
|
|
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 Kv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],Jv=Se("circle-plus",Kv);/**
|
|
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 Iv=[["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"}]],Fv=Se("circle-question-mark",Iv);/**
|
|
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 Pv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],Vr=Se("clock",Pv);/**
|
|
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 e1=[["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"}]],Yi=Se("code-xml",e1);/**
|
|
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 t1=[["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"}]],Ai=Se("database",t1);/**
|
|
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 n1=[["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=Se("diamond",n1);/**
|
|
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 a1=[["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"}]],dm=Se("external-link",a1);/**
|
|
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 s1=[["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=Se("file-code-corner",s1);/**
|
|
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 l1=[["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"}]],_0=Se("file-text",l1);/**
|
|
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 r1=[["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"}]],Jd=Se("git-branch",r1);/**
|
|
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 o1=[["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=Se("globe",o1);/**
|
|
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 i1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],c1=Se("info",i1);/**
|
|
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 u1=[["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"}]],C0=Se("key",u1);/**
|
|
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 d1=[["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"}]],T0=Se("layers-2",d1);/**
|
|
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 f1=[["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"}]],M0=Se("layers",f1);/**
|
|
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 h1=[["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"}]],x1=Se("layout-grid",h1);/**
|
|
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 p1=[["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"}]],A0=Se("list",p1);/**
|
|
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 m1=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],ot=Se("loader-circle",m1);/**
|
|
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 g1=[["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"}]],b1=Se("logs",g1);/**
|
|
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 y1=[["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"}]],v1=Se("moon",y1);/**
|
|
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 j1=[["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"}]],fm=Se("network",j1);/**
|
|
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 N1=[["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"}]],R0=Se("palette",N1);/**
|
|
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 w1=[["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"}]],Id=Se("pen-line",w1);/**
|
|
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 S1=[["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"}]],E1=Se("pen",S1);/**
|
|
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 k1=[["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"}]],kd=Se("play",k1);/**
|
|
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 _1=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],_t=Se("plus",_1);/**
|
|
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 C1=[["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"}]],ps=Se("refresh-cw",C1);/**
|
|
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 T1=[["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"}]],M1=Se("rotate-ccw",T1);/**
|
|
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 A1=[["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"}]],R1=Se("save",A1);/**
|
|
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 z1=[["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=Se("scan-line",z1);/**
|
|
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 O1=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],_d=Se("search",O1);/**
|
|
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 D1=[["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=Se("send",D1);/**
|
|
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 H1=[["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"}]],La=Se("shield",H1);/**
|
|
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 $1=[["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"}]],z0=Se("sparkles",$1);/**
|
|
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 U1=[["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"}]],B1=Se("square-mouse-pointer",U1);/**
|
|
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 q1=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],L1=Se("square",q1);/**
|
|
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 Y1=[["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"}]],V1=Se("sun",Y1);/**
|
|
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 G1=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Fd=Se("terminal",G1);/**
|
|
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 X1=[["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"}]],Gt=Se("trash-2",X1);/**
|
|
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 Z1=[["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"}]],Rr=Se("user",Z1);/**
|
|
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 W1=[["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=Se("workflow",W1);/**
|
|
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 Q1=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ct=Se("x",Q1);/**
|
|
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 K1=[["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"}]],na=Se("zap",K1),O0=N.createContext({theme:"dark",toggleTheme:()=>{}});function J1({children:n}){const[r,o]=N.useState(()=>localStorage.getItem("jetic_theme")==="light"?"light":"dark");N.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(O0.Provider,{value:{theme:r,toggleTheme:i},children:n})}function I1(){return N.useContext(O0)}const F1=[{label:"WORKFLOW",items:[{id:"overview",label:"Overview",icon:x1},{id:"model",label:"Model",icon:T0},{id:"simulations",label:"Simulations",icon:ea},{id:"inspect",label:"Inspect",icon:B1}]},{label:"AGENT",items:[{id:"memory",label:"Memory & Environment",icon:Ai}]},{label:"OBSERVABILITY",items:[{id:"traces",label:"Traces",icon:Yr}]}],P1=[];function hm({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 e2({currentPage:n,onNavigate:r,onToggleAssistant:o,isAssistantOpen:i}){const{theme:u,toggleTheme:f}=I1();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:F1.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(hm,{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(z0,{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:P1.map(h=>s.jsx(hm,{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(v1,{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(V1,{className:"h-3 w-3 shrink-0",strokeWidth:2}),"Light"]})]})})]})}function t2({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 n2={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 n2[n.toUpperCase()]??{bg:"bg-[var(--bg-overlay-md)]",text:"text-[var(--text-muted)]",dot:"#a1a1aa"}}function fi({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 a2({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 hi({msg:n}){return s.jsx("p",{className:"py-6 text-center text-[12px] text-[var(--text-faint)]",children:n})}function s2({onClose:n,onSave:r}){const[o,i]=N.useState(""),[u,f]=N.useState("https://"),[h,g]=N.useState(!1),[p,x]=N.useState(""),m=N.useRef(null);N.useEffect(()=>{m.current?.focus()},[]);const y=async j=>{if(j.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:j=>{j.target===j.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:j=>i(j.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:j=>f(j.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:y,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 xm({onNavigate:n}){const[r,o]=N.useState(null),[i,u]=N.useState([]),[f,h]=N.useState([]),[g,p]=N.useState(!0),[x,m]=N.useState(!1),[y,v]=N.useState(null),[j,C]=N.useState(null),[_,T]=N.useState(!1),[M,Y]=N.useState(null),[L,R]=N.useState(null),O=N.useCallback(async(S=!1)=>{S?m(!0):p(!0),v(null);try{const[U,k,H,D]=await Promise.allSettled([fetch("/api/model").then(z=>z.ok?z.json():null),fetch("/api/workflows").then(z=>z.ok?z.json():[]),fetch("/api/memory").then(z=>z.ok?z.json():[]),fetch("/api/model/environments").then(z=>z.ok?z.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)}},[]);N.useEffect(()=>{O()},[O]);const Z=r?.endpoints?.length??0,X=i.length,oe=f.length,I=r?.endpoints?.filter(S=>(S.security?.length??0)>0).length??0,J=(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(Fv,{className:"h-[15px] w-[15px] shrink-0",strokeWidth:2}),s.jsx("span",{children:"Jetic Documentation"})]}),s.jsx("button",{type:"button",onClick:()=>O(!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(ps,{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&&y&&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(Lt,{className:"h-8 w-8 text-red-400",strokeWidth:2}),s.jsx("p",{className:"text-[13px] text-red-300",children:y}),s.jsx("button",{type:"button",onClick:()=>O(),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&&!y&&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(fi,{label:"Endpoints",value:Z,icon:fm,accent:"blue"}),s.jsx(fi,{label:"Workflows",value:X,icon:Td,accent:"zinc"}),s.jsx(fi,{label:"Memory Keys",value:oe,icon:Ai,accent:"emerald"}),s.jsx(fi,{label:"Secured",value:I,icon:La,accent:"amber",sub:Z>0?`${Math.round(I/Z*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:z0,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(Fd,{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:()=>T(!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=j===S.name,k=M===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(jt,{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()=>{R(S.name);try{await fetch(`/api/model/environments/${encodeURIComponent(S.name)}`,{method:"DELETE"}),o(D=>D&&{...D,environments:D.environments?.filter(z=>z.name!==S.name)}),j===S.name&&C(null)}finally{R(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(Gt,{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(M0,{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(Qv,{className:"h-[15px] w-[15px]",strokeWidth:2})," Simulations"]})]})]})}),s.jsx(jr,{title:"Method Distribution",icon:Yr,children:Object.keys(J).length===0?s.jsx(hi,{msg:"No endpoints scanned yet"}):s.jsx("div",{className:"space-y-3",children:Object.entries(J).sort(([,S],[,U])=>U-S).map(([S,U])=>{const k=Md(S),H=Math.round(U/Z*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:fm,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(hi,{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(a2,{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(La,{className:"h-[15px] w-[15px] text-amber-500/60 shrink-0",strokeWidth:2})]},S.id)}),Z>8&&s.jsxs("div",{className:"px-4 py-2.5 text-[11px] text-[var(--text-faint)]",children:["+",Z-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(hi,{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(na,{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(yl,{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:Ai,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(hi,{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(Vr,{className:"h-[15px] w-[15px]",strokeWidth:2}),r?`Model generated ${new Date(r.generatedAt).toLocaleString()}`:"No model generated yet"]})]})]}),_&&s.jsx(s2,{onClose:()=>T(!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 l2(n){return await fetch("/api/traces",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}),n.id}async function pm(){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 r2(n){await fetch(`/api/traces/${encodeURIComponent(n)}`,{method:"DELETE"})}async function o2(){await fetch("/api/traces",{method:"DELETE"})}function Ht(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=Ht(n[o]))!==""&&(r+=(r&&" ")+i);else for(let o in n)n[o]&&(r+=(r&&" ")+o);return r}var ud={exports:{}},dd={},fd={exports:{}},hd={};/**
|
|
350
|
-
* @license React
|
|
351
|
-
* use-sync-external-store-shim.production.js
|
|
352
|
-
*
|
|
353
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
354
|
-
*
|
|
355
|
-
* This source code is licensed under the MIT license found in the
|
|
356
|
-
* LICENSE file in the root directory of this source tree.
|
|
357
|
-
*/var mm;function i2(){if(mm)return hd;mm=1;var n=Lr();function r(y,v){return y===v&&(y!==0||1/y===1/v)||y!==y&&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(y,v){var j=v(),C=i({inst:{value:j,getSnapshot:v}}),_=C[0].inst,T=C[1];return f(function(){_.value=j,_.getSnapshot=v,p(_)&&T({inst:_})},[y,j,v]),u(function(){return p(_)&&T({inst:_}),y(function(){p(_)&&T({inst:_})})},[y]),h(j),j}function p(y){var v=y.getSnapshot;y=y.value;try{var j=v();return!o(y,j)}catch{return!0}}function x(y,v){return v()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?x:g;return hd.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:m,hd}var gm;function c2(){return gm||(gm=1,fd.exports=i2()),fd.exports}/**
|
|
358
|
-
* @license React
|
|
359
|
-
* use-sync-external-store-shim/with-selector.production.js
|
|
360
|
-
*
|
|
361
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
362
|
-
*
|
|
363
|
-
* This source code is licensed under the MIT license found in the
|
|
364
|
-
* LICENSE file in the root directory of this source tree.
|
|
365
|
-
*/var bm;function u2(){if(bm)return dd;bm=1;var n=Lr(),r=c2();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 dd.useSyncExternalStoreWithSelector=function(x,m,y,v,j){var C=f(null);if(C.current===null){var _={hasValue:!1,value:null};C.current=_}else _=C.current;C=g(function(){function M(Z){if(!Y){if(Y=!0,L=Z,Z=v(Z),j!==void 0&&_.hasValue){var X=_.value;if(j(X,Z))return R=X}return R=Z}if(X=R,i(L,Z))return X;var oe=v(Z);return j!==void 0&&j(X,oe)?(L=Z,X):(L=Z,R=oe)}var Y=!1,L,R,O=y===void 0?null:y;return[function(){return M(m())},O===null?void 0:function(){return M(O())}]},[m,y,v,j]);var T=u(x,C[0],C[1]);return h(function(){_.hasValue=!0,_.value=T},[T]),p(T),T},dd}var ym;function d2(){return ym||(ym=1,ud.exports=u2()),ud.exports}var f2=d2();const h2=w0(f2),x2={},vm=n=>{let r;const o=new Set,i=(m,y)=>{const v=typeof m=="function"?m(r):m;if(!Object.is(v,r)){const j=r;r=y??(typeof v!="object"||v===null)?v:Object.assign({},r,v),o.forEach(C=>C(r,j))}},u=()=>r,p={setState:i,getState:u,getInitialState:()=>x,subscribe:m=>(o.add(m),()=>o.delete(m)),destroy:()=>{(x2?"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},p2=n=>n?vm(n):vm,{useDebugValue:m2}=le,{useSyncExternalStoreWithSelector:g2}=h2,b2=n=>n;function D0(n,r=b2,o){const i=g2(n.subscribe,n.getState,n.getServerState||n.getInitialState,r,o);return m2(i),i}const jm=(n,r)=>{const o=p2(n),i=(u,f=r)=>D0(o,u,f);return Object.assign(i,o),i},y2=(n,r)=>n?jm(n,r):jm;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 v2={value:()=>{}};function Vi(){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 _i(o)}function _i(n){this._=n}function j2(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}})}_i.prototype=Vi.prototype={constructor:_i,on:function(n,r){var o=this._,i=j2(n+"",o),u,f=-1,h=i.length;if(arguments.length<2){for(;++f<h;)if((u=(n=i[f]).type)&&(u=N2(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]=Nm(o[u],n.name,r);else if(r==null)for(u in o)o[u]=Nm(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 _i(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 N2(n,r){for(var o=0,i=n.length,u;o<i;++o)if((u=n[o]).name===r)return u.value}function Nm(n,r,o){for(var i=0,u=n.length;i<u;++i)if(n[i].name===r){n[i]=v2,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 wm={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 Gi(n){var r=n+="",o=r.indexOf(":");return o>=0&&(r=n.slice(0,o))!=="xmlns"&&(n=n.slice(o+1)),wm.hasOwnProperty(r)?{space:wm[r],local:n}:n}function w2(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 S2(n){return function(){return this.ownerDocument.createElementNS(n.space,n.local)}}function H0(n){var r=Gi(n);return(r.local?S2:w2)(r)}function E2(){}function Pd(n){return n==null?E2:function(){return this.querySelector(n)}}function k2(n){typeof n!="function"&&(n=Pd(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 _2(n){return n==null?[]:Array.isArray(n)?n:Array.from(n)}function C2(){return[]}function $0(n){return n==null?C2:function(){return this.querySelectorAll(n)}}function T2(n){return function(){return _2(n.apply(this,arguments))}}function M2(n){typeof n=="function"?n=T2(n):n=$0(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 U0(n){return function(){return this.matches(n)}}function B0(n){return function(r){return r.matches(n)}}var A2=Array.prototype.find;function R2(n){return function(){return A2.call(this.children,n)}}function z2(){return this.firstElementChild}function O2(n){return this.select(n==null?z2:R2(typeof n=="function"?n:B0(n)))}var D2=Array.prototype.filter;function H2(){return Array.from(this.children)}function $2(n){return function(){return D2.call(this.children,n)}}function U2(n){return this.selectAll(n==null?H2:$2(typeof n=="function"?n:B0(n)))}function B2(n){typeof n!="function"&&(n=U0(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 q0(n){return new Array(n.length)}function q2(){return new rn(this._enter||this._groups.map(q0),this._parents)}function zi(n,r){this.ownerDocument=n.ownerDocument,this.namespaceURI=n.namespaceURI,this._next=null,this._parent=n,this.__data__=r}zi.prototype={constructor:zi,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 L2(n){return function(){return n}}function Y2(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 zi(n,f[h]);for(;h<p;++h)(g=r[h])&&(u[h]=g)}function V2(n,r,o,i,u,f,h){var g,p,x=new Map,m=r.length,y=f.length,v=new Array(m),j;for(g=0;g<m;++g)(p=r[g])&&(v[g]=j=h.call(p,p.__data__,g,r)+"",x.has(j)?u[g]=p:x.set(j,p));for(g=0;g<y;++g)j=h.call(n,f[g],g,f)+"",(p=x.get(j))?(i[g]=p,p.__data__=f[g],x.delete(j)):o[g]=new zi(n,f[g]);for(g=0;g<m;++g)(p=r[g])&&x.get(v[g])===p&&(u[g]=p)}function G2(n){return n.__data__}function X2(n,r){if(!arguments.length)return Array.from(this,G2);var o=r?V2:Y2,i=this._parents,u=this._groups;typeof n!="function"&&(n=L2(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],y=u[x],v=y.length,j=Z2(n.call(m,m&&m.__data__,x,i)),C=j.length,_=g[x]=new Array(C),T=h[x]=new Array(C),M=p[x]=new Array(v);o(m,y,_,T,M,j,r);for(var Y=0,L=0,R,O;Y<C;++Y)if(R=_[Y]){for(Y>=L&&(L=Y+1);!(O=T[L])&&++L<C;);R._next=O||null}}return h=new rn(h,i),h._enter=g,h._exit=p,h}function Z2(n){return typeof n=="object"&&"length"in n?n:Array.from(n)}function W2(){return new rn(this._exit||this._groups.map(q0),this._parents)}function Q2(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 K2(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],y=x.length,v=g[p]=new Array(y),j,C=0;C<y;++C)(j=x[C]||m[C])&&(v[C]=j);for(;p<u;++p)g[p]=o[p];return new rn(g,this._parents)}function J2(){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 I2(n){n||(n=F2);function r(y,v){return y&&v?n(y.__data__,v.__data__):!y-!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 F2(n,r){return n<r?-1:n>r?1:n>=r?0:NaN}function P2(){var n=arguments[0];return arguments[0]=this,n.apply(null,arguments),this}function ej(){return Array.from(this)}function tj(){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 nj(){let n=0;for(const r of this)++n;return n}function aj(){return!this.node()}function sj(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 lj(n){return function(){this.removeAttribute(n)}}function rj(n){return function(){this.removeAttributeNS(n.space,n.local)}}function oj(n,r){return function(){this.setAttribute(n,r)}}function ij(n,r){return function(){this.setAttributeNS(n.space,n.local,r)}}function cj(n,r){return function(){var o=r.apply(this,arguments);o==null?this.removeAttribute(n):this.setAttribute(n,o)}}function uj(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 dj(n,r){var o=Gi(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?rj:lj:typeof r=="function"?o.local?uj:cj:o.local?ij:oj)(o,r))}function L0(n){return n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView}function fj(n){return function(){this.style.removeProperty(n)}}function hj(n,r,o){return function(){this.style.setProperty(n,r,o)}}function xj(n,r,o){return function(){var i=r.apply(this,arguments);i==null?this.style.removeProperty(n):this.style.setProperty(n,i,o)}}function pj(n,r,o){return arguments.length>1?this.each((r==null?fj:typeof r=="function"?xj:hj)(n,r,o??"")):pl(this.node(),n)}function pl(n,r){return n.style.getPropertyValue(r)||L0(n).getComputedStyle(n,null).getPropertyValue(r)}function mj(n){return function(){delete this[n]}}function gj(n,r){return function(){this[n]=r}}function bj(n,r){return function(){var o=r.apply(this,arguments);o==null?delete this[n]:this[n]=o}}function yj(n,r){return arguments.length>1?this.each((r==null?mj:typeof r=="function"?bj:gj)(n,r)):this.node()[n]}function Y0(n){return n.trim().split(/^|\s+/)}function ef(n){return n.classList||new V0(n)}function V0(n){this._node=n,this._names=Y0(n.getAttribute("class")||"")}V0.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 G0(n,r){for(var o=ef(n),i=-1,u=r.length;++i<u;)o.add(r[i])}function X0(n,r){for(var o=ef(n),i=-1,u=r.length;++i<u;)o.remove(r[i])}function vj(n){return function(){G0(this,n)}}function jj(n){return function(){X0(this,n)}}function Nj(n,r){return function(){(r.apply(this,arguments)?G0:X0)(this,n)}}function wj(n,r){var o=Y0(n+"");if(arguments.length<2){for(var i=ef(this.node()),u=-1,f=o.length;++u<f;)if(!i.contains(o[u]))return!1;return!0}return this.each((typeof r=="function"?Nj:r?vj:jj)(o,r))}function Sj(){this.textContent=""}function Ej(n){return function(){this.textContent=n}}function kj(n){return function(){var r=n.apply(this,arguments);this.textContent=r??""}}function _j(n){return arguments.length?this.each(n==null?Sj:(typeof n=="function"?kj:Ej)(n)):this.node().textContent}function Cj(){this.innerHTML=""}function Tj(n){return function(){this.innerHTML=n}}function Mj(n){return function(){var r=n.apply(this,arguments);this.innerHTML=r??""}}function Aj(n){return arguments.length?this.each(n==null?Cj:(typeof n=="function"?Mj:Tj)(n)):this.node().innerHTML}function Rj(){this.nextSibling&&this.parentNode.appendChild(this)}function zj(){return this.each(Rj)}function Oj(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Dj(){return this.each(Oj)}function Hj(n){var r=typeof n=="function"?n:H0(n);return this.select(function(){return this.appendChild(r.apply(this,arguments))})}function $j(){return null}function Uj(n,r){var o=typeof n=="function"?n:H0(n),i=r==null?$j:typeof r=="function"?r:Pd(r);return this.select(function(){return this.insertBefore(o.apply(this,arguments),i.apply(this,arguments)||null)})}function Bj(){var n=this.parentNode;n&&n.removeChild(this)}function qj(){return this.each(Bj)}function Lj(){var n=this.cloneNode(!1),r=this.parentNode;return r?r.insertBefore(n,this.nextSibling):n}function Yj(){var n=this.cloneNode(!0),r=this.parentNode;return r?r.insertBefore(n,this.nextSibling):n}function Vj(n){return this.select(n?Yj:Lj)}function Gj(n){return arguments.length?this.property("__data__",n):this.node().__data__}function Xj(n){return function(r){n.call(this,r,this.__data__)}}function Zj(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 Wj(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 Qj(n,r,o){return function(){var i=this.__on,u,f=Xj(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 Kj(n,r,o){var i=Zj(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?Qj:Wj,u=0;u<f;++u)this.each(g(i[u],r,o));return this}function Z0(n,r,o){var i=L0(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 Jj(n,r){return function(){return Z0(this,n,r)}}function Ij(n,r){return function(){return Z0(this,n,r.apply(this,arguments))}}function Fj(n,r){return this.each((typeof r=="function"?Ij:Jj)(n,r))}function*Pj(){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 W0=[null];function rn(n,r){this._groups=n,this._parents=r}function Gr(){return new rn([[document.documentElement]],W0)}function eN(){return this}rn.prototype=Gr.prototype={constructor:rn,select:k2,selectAll:M2,selectChild:O2,selectChildren:U2,filter:B2,data:X2,enter:q2,exit:W2,join:Q2,merge:K2,selection:eN,order:J2,sort:I2,call:P2,nodes:ej,node:tj,size:nj,empty:aj,each:sj,attr:dj,style:pj,property:yj,classed:wj,text:_j,html:Aj,raise:zj,lower:Dj,append:Hj,insert:Uj,remove:qj,clone:Vj,datum:Gj,on:Kj,dispatch:Fj,[Symbol.iterator]:Pj};function gn(n){return typeof n=="string"?new rn([[document.querySelector(n)]],[document.documentElement]):new rn([[n]],W0)}function tN(n){let r;for(;r=n.sourceEvent;)n=r;return n}function Sn(n,r){if(n=tN(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 nN={passive:!1},zr={capture:!0,passive:!1};function xd(n){n.stopImmediatePropagation()}function fl(n){n.preventDefault(),n.stopImmediatePropagation()}function Q0(n){var r=n.document.documentElement,o=gn(n).on("dragstart.drag",fl,zr);"onselectstart"in r?o.on("selectstart.drag",fl,zr):(r.__noselect=r.style.MozUserSelect,r.style.MozUserSelect="none")}function K0(n,r){var o=n.document.documentElement,i=gn(n).on("dragstart.drag",null);r&&(i.on("click.drag",fl,zr),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 xi=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 aN(n){return!n.ctrlKey&&!n.button}function sN(){return this.parentNode}function lN(n,r){return r??{x:n.x,y:n.y}}function rN(){return navigator.maxTouchPoints||"ontouchstart"in this}function oN(){var n=aN,r=sN,o=lN,i=rN,u={},f=Vi("start","drag","end"),h=0,g,p,x,m,y=0;function v(R){R.on("mousedown.drag",j).filter(i).on("touchstart.drag",T).on("touchmove.drag",M,nN).on("touchend.drag touchcancel.drag",Y).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function j(R,O){if(!(m||!n.call(this,R,O))){var Z=L(this,r.call(this,R,O),R,O,"mouse");Z&&(gn(R.view).on("mousemove.drag",C,zr).on("mouseup.drag",_,zr),Q0(R.view),xd(R),x=!1,g=R.clientX,p=R.clientY,Z("start",R))}}function C(R){if(fl(R),!x){var O=R.clientX-g,Z=R.clientY-p;x=O*O+Z*Z>y}u.mouse("drag",R)}function _(R){gn(R.view).on("mousemove.drag mouseup.drag",null),K0(R.view,x),fl(R),u.mouse("end",R)}function T(R,O){if(n.call(this,R,O)){var Z=R.changedTouches,X=r.call(this,R,O),oe=Z.length,I,J;for(I=0;I<oe;++I)(J=L(this,X,R,O,Z[I].identifier,Z[I]))&&(xd(R),J("start",R,Z[I]))}}function M(R){var O=R.changedTouches,Z=O.length,X,oe;for(X=0;X<Z;++X)(oe=u[O[X].identifier])&&(fl(R),oe("drag",R,O[X]))}function Y(R){var O=R.changedTouches,Z=O.length,X,oe;for(m&&clearTimeout(m),m=setTimeout(function(){m=null},500),X=0;X<Z;++X)(oe=u[O[X].identifier])&&(xd(R),oe("end",R,O[X]))}function L(R,O,Z,X,oe,I){var J=f.copy(),ne=Sn(I||Z,O),ee,se,S;if((S=o.call(R,new Rd("beforestart",{sourceEvent:Z,target:v,identifier:oe,active:h,x:ne[0],y:ne[1],dx:0,dy:0,dispatch:J}),X))!=null)return ee=S.x-ne[0]||0,se=S.y-ne[1]||0,function U(k,H,D){var z=ne,E;switch(k){case"start":u[oe]=U,E=h++;break;case"end":delete u[oe],--h;case"drag":ne=Sn(D||H,O),E=h;break}J.call(k,R,new Rd(k,{sourceEvent:H,subject:S,target:v,identifier:oe,active:E,x:ne[0]+ee,y:ne[1]+se,dx:ne[0]-z[0],dy:ne[1]-z[1],dispatch:J}),X)}}return v.filter=function(R){return arguments.length?(n=typeof R=="function"?R:xi(!!R),v):n},v.container=function(R){return arguments.length?(r=typeof R=="function"?R:xi(R),v):r},v.subject=function(R){return arguments.length?(o=typeof R=="function"?R:xi(R),v):o},v.touchable=function(R){return arguments.length?(i=typeof R=="function"?R:xi(!!R),v):i},v.on=function(){var R=f.on.apply(f,arguments);return R===f?v:R},v.clickDistance=function(R){return arguments.length?(y=(R=+R)*R,v):Math.sqrt(y)},v}function tf(n,r,o){n.prototype=r.prototype=o,o.constructor=n}function J0(n,r){var o=Object.create(n.prototype);for(var i in r)o[i]=r[i];return o}function Xr(){}var Or=.7,Oi=1/Or,hl="\\s*([+-]?\\d+)\\s*",Dr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",zn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",iN=/^#([0-9a-f]{3,8})$/,cN=new RegExp(`^rgb\\(${hl},${hl},${hl}\\)$`),uN=new RegExp(`^rgb\\(${zn},${zn},${zn}\\)$`),dN=new RegExp(`^rgba\\(${hl},${hl},${hl},${Dr}\\)$`),fN=new RegExp(`^rgba\\(${zn},${zn},${zn},${Dr}\\)$`),hN=new RegExp(`^hsl\\(${Dr},${zn},${zn}\\)$`),xN=new RegExp(`^hsla\\(${Dr},${zn},${zn},${Dr}\\)$`),Sm={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};tf(Xr,Hr,{copy(n){return Object.assign(new this.constructor,this,n)},displayable(){return this.rgb().displayable()},hex:Em,formatHex:Em,formatHex8:pN,formatHsl:mN,formatRgb:km,toString:km});function Em(){return this.rgb().formatHex()}function pN(){return this.rgb().formatHex8()}function mN(){return I0(this).formatHsl()}function km(){return this.rgb().formatRgb()}function Hr(n){var r,o;return n=(n+"").trim().toLowerCase(),(r=iN.exec(n))?(o=r[1].length,r=parseInt(r[1],16),o===6?_m(r):o===3?new Kt(r>>8&15|r>>4&240,r>>4&15|r&240,(r&15)<<4|r&15,1):o===8?pi(r>>24&255,r>>16&255,r>>8&255,(r&255)/255):o===4?pi(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=cN.exec(n))?new Kt(r[1],r[2],r[3],1):(r=uN.exec(n))?new Kt(r[1]*255/100,r[2]*255/100,r[3]*255/100,1):(r=dN.exec(n))?pi(r[1],r[2],r[3],r[4]):(r=fN.exec(n))?pi(r[1]*255/100,r[2]*255/100,r[3]*255/100,r[4]):(r=hN.exec(n))?Mm(r[1],r[2]/100,r[3]/100,1):(r=xN.exec(n))?Mm(r[1],r[2]/100,r[3]/100,r[4]):Sm.hasOwnProperty(n)?_m(Sm[n]):n==="transparent"?new Kt(NaN,NaN,NaN,0):null}function _m(n){return new Kt(n>>16&255,n>>8&255,n&255,1)}function pi(n,r,o,i){return i<=0&&(n=r=o=NaN),new Kt(n,r,o,i)}function gN(n){return n instanceof Xr||(n=Hr(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?gN(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}tf(Kt,zd,J0(Xr,{brighter(n){return n=n==null?Oi:Math.pow(Oi,n),new Kt(this.r*n,this.g*n,this.b*n,this.opacity)},darker(n){return n=n==null?Or:Math.pow(Or,n),new Kt(this.r*n,this.g*n,this.b*n,this.opacity)},rgb(){return this},clamp(){return new Kt(ds(this.r),ds(this.g),ds(this.b),Di(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:Cm,formatHex:Cm,formatHex8:bN,formatRgb:Tm,toString:Tm}));function Cm(){return`#${cs(this.r)}${cs(this.g)}${cs(this.b)}`}function bN(){return`#${cs(this.r)}${cs(this.g)}${cs(this.b)}${cs((isNaN(this.opacity)?1:this.opacity)*255)}`}function Tm(){const n=Di(this.opacity);return`${n===1?"rgb(":"rgba("}${ds(this.r)}, ${ds(this.g)}, ${ds(this.b)}${n===1?")":`, ${n})`}`}function Di(n){return isNaN(n)?1:Math.max(0,Math.min(1,n))}function ds(n){return Math.max(0,Math.min(255,Math.round(n)||0))}function cs(n){return n=ds(n),(n<16?"0":"")+n.toString(16)}function Mm(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 I0(n){if(n instanceof En)return new En(n.h,n.s,n.l,n.opacity);if(n instanceof Xr||(n=Hr(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 yN(n,r,o,i){return arguments.length===1?I0(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}tf(En,yN,J0(Xr,{brighter(n){return n=n==null?Oi:Math.pow(Oi,n),new En(this.h,this.s,this.l*n,this.opacity)},darker(n){return n=n==null?Or:Math.pow(Or,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(pd(n>=240?n-240:n+120,u,i),pd(n,u,i),pd(n<120?n+240:n-120,u,i),this.opacity)},clamp(){return new En(Am(this.h),mi(this.s),mi(this.l),Di(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=Di(this.opacity);return`${n===1?"hsl(":"hsla("}${Am(this.h)}, ${mi(this.s)*100}%, ${mi(this.l)*100}%${n===1?")":`, ${n})`}`}}));function Am(n){return n=(n||0)%360,n<0?n+360:n}function mi(n){return Math.max(0,Math.min(1,n||0))}function pd(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 F0=n=>()=>n;function vN(n,r){return function(o){return n+o*r}}function jN(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 NN(n){return(n=+n)==1?P0:function(r,o){return o-r?jN(r,o,n):F0(isNaN(r)?o:r)}}function P0(n,r){var o=r-n;return o?vN(n,o):F0(isNaN(n)?r:n)}const Rm=(function n(r){var o=NN(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=P0(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 Da(n,r){return n=+n,r=+r,function(o){return n*(1-o)+r*o}}var Od=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,md=new RegExp(Od.source,"g");function wN(n){return function(){return n}}function SN(n){return function(r){return n(r)+""}}function EN(n,r){var o=Od.lastIndex=md.lastIndex=0,i,u,f,h=-1,g=[],p=[];for(n=n+"",r=r+"";(i=Od.exec(n))&&(u=md.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:Da(i,u)})),o=md.lastIndex;return o<r.length&&(f=r.slice(o),g[h]?g[h]+=f:g[++h]=f),g.length<2?p[0]?SN(p[0].x):wN(r):(r=p.length,function(x){for(var m=0,y;m<r;++m)g[(y=p[m]).i]=y.x(x);return g.join("")})}var zm=180/Math.PI,Dd={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function eg(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)*zm,skewX:Math.atan(p)*zm,scaleX:h,scaleY:g}}var gi;function kN(n){const r=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(n+"");return r.isIdentity?Dd:eg(r.a,r.b,r.c,r.d,r.e,r.f)}function _N(n){return n==null||(gi||(gi=document.createElementNS("http://www.w3.org/2000/svg","g")),gi.setAttribute("transform",n),!(n=gi.transform.baseVal.consolidate()))?Dd:(n=n.matrix,eg(n.a,n.b,n.c,n.d,n.e,n.f))}function tg(n,r,o,i){function u(x){return x.length?x.pop()+" ":""}function f(x,m,y,v,j,C){if(x!==y||m!==v){var _=j.push("translate(",null,r,null,o);C.push({i:_-4,x:Da(x,y)},{i:_-2,x:Da(m,v)})}else(y||v)&&j.push("translate("+y+r+v+o)}function h(x,m,y,v){x!==m?(x-m>180?m+=360:m-x>180&&(x+=360),v.push({i:y.push(u(y)+"rotate(",null,i)-2,x:Da(x,m)})):m&&y.push(u(y)+"rotate("+m+i)}function g(x,m,y,v){x!==m?v.push({i:y.push(u(y)+"skewX(",null,i)-2,x:Da(x,m)}):m&&y.push(u(y)+"skewX("+m+i)}function p(x,m,y,v,j,C){if(x!==y||m!==v){var _=j.push(u(j)+"scale(",null,",",null,")");C.push({i:_-4,x:Da(x,y)},{i:_-2,x:Da(m,v)})}else(y!==1||v!==1)&&j.push(u(j)+"scale("+y+","+v+")")}return function(x,m){var y=[],v=[];return x=n(x),m=n(m),f(x.translateX,x.translateY,m.translateX,m.translateY,y,v),h(x.rotate,m.rotate,y,v),g(x.skewX,m.skewX,y,v),p(x.scaleX,x.scaleY,m.scaleX,m.scaleY,y,v),x=m=null,function(j){for(var C=-1,_=v.length,T;++C<_;)y[(T=v[C]).i]=T.x(j);return y.join("")}}}var CN=tg(kN,"px, ","px)","deg)"),TN=tg(_N,", ",")",")"),MN=1e-12;function Om(n){return((n=Math.exp(n))+1/n)/2}function AN(n){return((n=Math.exp(n))-1/n)/2}function RN(n){return((n=Math.exp(2*n))-1)/(n+1)}const zN=(function n(r,o,i){function u(f,h){var g=f[0],p=f[1],x=f[2],m=h[0],y=h[1],v=h[2],j=m-g,C=y-p,_=j*j+C*C,T,M;if(_<MN)M=Math.log(v/x)/r,T=function(X){return[g+X*j,p+X*C,x*Math.exp(r*X*M)]};else{var Y=Math.sqrt(_),L=(v*v-x*x+i*_)/(2*x*o*Y),R=(v*v-x*x-i*_)/(2*v*o*Y),O=Math.log(Math.sqrt(L*L+1)-L),Z=Math.log(Math.sqrt(R*R+1)-R);M=(Z-O)/r,T=function(X){var oe=X*M,I=Om(O),J=x/(o*Y)*(I*RN(r*oe+O)-AN(O));return[g+J*j,p+J*C,x*I/Om(r*oe+O)]}}return T.duration=M*1e3*r/Math.SQRT2,T}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,ng=1e3,Hi,Tr,$i=0,hs=0,Xi=0,$r=typeof performance=="object"&&performance.now?performance:Date,ag=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(n){setTimeout(n,17)};function nf(){return hs||(ag(ON),hs=$r.now()+Xi)}function ON(){hs=0}function Ui(){this._call=this._time=this._next=null}Ui.prototype=sg.prototype={constructor:Ui,restart:function(n,r,o){if(typeof n!="function")throw new TypeError("callback is not a function");o=(o==null?nf():+o)+(r==null?0:+r),!this._next&&Tr!==this&&(Tr?Tr._next=this:Hi=this,Tr=this),this._call=n,this._time=o,Hd()},stop:function(){this._call&&(this._call=null,this._time=1/0,Hd())}};function sg(n,r,o){var i=new Ui;return i.restart(n,r,o),i}function DN(){nf(),++ml;for(var n=Hi,r;n;)(r=hs-n._time)>=0&&n._call.call(void 0,r),n=n._next;--ml}function Dm(){hs=($i=$r.now())+Xi,ml=Cr=0;try{DN()}finally{ml=0,$N(),hs=0}}function HN(){var n=$r.now(),r=n-$i;r>ng&&(Xi-=r,$i=n)}function $N(){for(var n,r=Hi,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:Hi=o);Tr=n,Hd(i)}function Hd(n){if(!ml){Cr&&(Cr=clearTimeout(Cr));var r=n-hs;r>24?(n<1/0&&(Cr=setTimeout(Dm,n-$r.now()-Xi)),Nr&&(Nr=clearInterval(Nr))):(Nr||($i=$r.now(),Nr=setInterval(HN,ng)),ml=1,ag(Dm))}}function Hm(n,r,o){var i=new Ui;return r=r==null?0:+r,i.restart(u=>{i.stop(),n(u+r)},r,o),i}var UN=Vi("start","end","cancel","interrupt"),BN=[],lg=0,$m=1,$d=2,Ci=3,Um=4,Ud=5,Ti=6;function Zi(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:UN,tween:BN,time:f.time,delay:f.delay,duration:f.duration,ease:f.ease,timer:null,state:lg})}function af(n,r){var o=kn(n,r);if(o.state>lg)throw new Error("too late; already scheduled");return o}function On(n,r){var o=kn(n,r);if(o.state>Ci)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=sg(f,0,o.time);function f(x){o.state=$m,o.timer.restart(h,o.delay,o.time),o.delay<=x&&h(x-o.delay)}function h(x){var m,y,v,j;if(o.state!==$m)return p();for(m in i)if(j=i[m],j.name===o.name){if(j.state===Ci)return Hm(h);j.state===Um?(j.state=Ti,j.timer.stop(),j.on.call("interrupt",n,n.__data__,j.index,j.group),delete i[m]):+m<r&&(j.state=Ti,j.timer.stop(),j.on.call("cancel",n,n.__data__,j.index,j.group),delete i[m])}if(Hm(function(){o.state===Ci&&(o.state=Um,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=Ci,u=new Array(v=o.tween.length),m=0,y=-1;m<v;++m)(j=o.tween[m].value.call(n,n.__data__,o.index,o.group))&&(u[++y]=j);u.length=y+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),y=-1,v=u.length;++y<v;)u[y].call(n,m);o.state===Ud&&(o.on.call("end",n,n.__data__,o.index,o.group),p())}function p(){o.state=Ti,o.timer.stop(),delete i[r];for(var x in i)return;delete n.__transition}}function Mi(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=Ti,i.timer.stop(),i.on.call(u?"interrupt":"cancel",n,n.__data__,i.index,i.group),delete o[h]}f&&delete n.__transition}}function LN(n){return this.each(function(){Mi(this,n)})}function YN(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 VN(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 GN(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?YN:VN)(o,n,r))}function sf(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 rg(n,r){var o;return(typeof r=="number"?Da:r instanceof Hr?Rm:(o=Hr(r))?(r=o,Rm):EN)(n,r)}function XN(n){return function(){this.removeAttribute(n)}}function ZN(n){return function(){this.removeAttributeNS(n.space,n.local)}}function WN(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 QN(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 KN(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 JN(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 IN(n,r){var o=Gi(n),i=o==="transform"?TN:rg;return this.attrTween(n,typeof r=="function"?(o.local?JN:KN)(o,i,sf(this,"attr."+n,r)):r==null?(o.local?ZN:XN)(o):(o.local?QN:WN)(o,i,r))}function FN(n,r){return function(o){this.setAttribute(n,r.call(this,o))}}function PN(n,r){return function(o){this.setAttributeNS(n.space,n.local,r.call(this,o))}}function ew(n,r){var o,i;function u(){var f=r.apply(this,arguments);return f!==i&&(o=(i=f)&&PN(n,f)),o}return u._value=r,u}function tw(n,r){var o,i;function u(){var f=r.apply(this,arguments);return f!==i&&(o=(i=f)&&FN(n,f)),o}return u._value=r,u}function nw(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=Gi(n);return this.tween(o,(i.local?ew:tw)(i,r))}function aw(n,r){return function(){af(this,n).delay=+r.apply(this,arguments)}}function sw(n,r){return r=+r,function(){af(this,n).delay=r}}function lw(n){var r=this._id;return arguments.length?this.each((typeof n=="function"?aw:sw)(r,n)):kn(this.node(),r).delay}function rw(n,r){return function(){On(this,n).duration=+r.apply(this,arguments)}}function ow(n,r){return r=+r,function(){On(this,n).duration=r}}function iw(n){var r=this._id;return arguments.length?this.each((typeof n=="function"?rw:ow)(r,n)):kn(this.node(),r).duration}function cw(n,r){if(typeof r!="function")throw new Error;return function(){On(this,n).ease=r}}function uw(n){var r=this._id;return arguments.length?this.each(cw(r,n)):kn(this.node(),r).ease}function dw(n,r){return function(){var o=r.apply(this,arguments);if(typeof o!="function")throw new Error;On(this,n).ease=o}}function fw(n){if(typeof n!="function")throw new Error;return this.each(dw(this._id,n))}function hw(n){typeof n!="function"&&(n=U0(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 aa(i,this._parents,this._name,this._id)}function xw(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,y=h[g]=new Array(m),v,j=0;j<m;++j)(v=p[j]||x[j])&&(y[j]=v);for(;g<i;++g)h[g]=r[g];return new aa(h,this._parents,this._name,this._id)}function pw(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 mw(n,r,o){var i,u,f=pw(r)?af:On;return function(){var h=f(this,n),g=h.on;g!==i&&(u=(i=g).copy()).on(r,o),h.on=u}}function gw(n,r){var o=this._id;return arguments.length<2?kn(this.node(),o).on.on(n):this.each(mw(o,n,r))}function bw(n){return function(){var r=this.parentNode;for(var o in this.__transition)if(+o!==n)return;r&&r.removeChild(this)}}function yw(){return this.on("end.remove",bw(this._id))}function vw(n){var r=this._name,o=this._id;typeof n!="function"&&(n=Pd(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,y,v=0;v<p;++v)(m=g[v])&&(y=n.call(m,m.__data__,v,g))&&("__data__"in m&&(y.__data__=m.__data__),x[v]=y,Zi(x[v],r,o,v,x,kn(m,o)));return new aa(f,this._parents,r,o)}function jw(n){var r=this._name,o=this._id;typeof n!="function"&&(n=$0(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,y=0;y<x;++y)if(m=p[y]){for(var v=n.call(m,m.__data__,y,p),j,C=kn(m,o),_=0,T=v.length;_<T;++_)(j=v[_])&&Zi(j,r,o,_,v,C);f.push(v),h.push(m)}return new aa(f,h,r,o)}var Nw=Gr.prototype.constructor;function ww(){return new Nw(this._groups,this._parents)}function Sw(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 og(n){return function(){this.style.removeProperty(n)}}function Ew(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 kw(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 _w(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=og(r)):void 0;(x!==o||u!==m)&&(i=(o=x).copy()).on(h,u=m),p.on=i}}function Cw(n,r,o){var i=(n+="")=="transform"?CN:rg;return r==null?this.styleTween(n,Sw(n,i)).on("end.style."+n,og(n)):typeof r=="function"?this.styleTween(n,kw(n,i,sf(this,"style."+n,r))).each(_w(this._id,n)):this.styleTween(n,Ew(n,i,r),o).on("end.style."+n,null)}function Tw(n,r,o){return function(i){this.style.setProperty(n,r.call(this,i),o)}}function Mw(n,r,o){var i,u;function f(){var h=r.apply(this,arguments);return h!==u&&(i=(u=h)&&Tw(n,h,o)),i}return f._value=r,f}function Aw(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,Mw(n,r,o??""))}function Rw(n){return function(){this.textContent=n}}function zw(n){return function(){var r=n(this);this.textContent=r??""}}function Ow(n){return this.tween("text",typeof n=="function"?zw(sf(this,"text",n)):Rw(n==null?"":n+""))}function Dw(n){return function(r){this.textContent=n.call(this,r)}}function Hw(n){var r,o;function i(){var u=n.apply(this,arguments);return u!==o&&(r=(o=u)&&Dw(u)),r}return i._value=n,i}function $w(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,Hw(n))}function Uw(){for(var n=this._name,r=this._id,o=ig(),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);Zi(p,n,o,x,h,{time:m.time+m.delay+m.duration,delay:0,duration:m.duration,ease:m.ease})}return new aa(i,this._parents,n,o)}function Bw(){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 aa(n,r,o,i){this._groups=n,this._parents=r,this._name=o,this._id=i}function ig(){return++qw}var Fn=Gr.prototype;aa.prototype={constructor:aa,select:vw,selectAll:jw,selectChild:Fn.selectChild,selectChildren:Fn.selectChildren,filter:hw,merge:xw,selection:ww,transition:Uw,call:Fn.call,nodes:Fn.nodes,node:Fn.node,size:Fn.size,empty:Fn.empty,each:Fn.each,on:gw,attr:IN,attrTween:nw,style:Cw,styleTween:Aw,text:Ow,textTween:$w,remove:yw,tween:GN,delay:lw,duration:iw,ease:uw,easeVarying:fw,end:Bw,[Symbol.iterator]:Fn[Symbol.iterator]};function Lw(n){return((n*=2)<=1?n*n*n:(n-=2)*n*n+2)/2}var Yw={time:null,delay:0,duration:250,ease:Lw};function Vw(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 Gw(n){var r,o;n instanceof aa?(r=n._id,n=n._name):(r=ig(),(o=Yw).time=nf(),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])&&Zi(p,n,r,x,h,o||Vw(p,r));return new aa(i,this._parents,n,r)}Gr.prototype.interrupt=LN;Gr.prototype.transition=Gw;const bi=n=>()=>n;function Xw(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 gd(n){n.stopImmediatePropagation()}function wr(n){n.preventDefault(),n.stopImmediatePropagation()}function Zw(n){return(!n.ctrlKey||n.type==="wheel")&&!n.button}function Ww(){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 Bm(){return this.__zoom||ta}function Qw(n){return-n.deltaY*(n.deltaMode===1?.05:n.deltaMode?1:.002)*(n.ctrlKey?10:1)}function Kw(){return navigator.maxTouchPoints||"ontouchstart"in this}function Jw(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 cg(){var n=Zw,r=Ww,o=Jw,i=Qw,u=Kw,f=[0,1/0],h=[[-1/0,-1/0],[1/0,1/0]],g=250,p=zN,x=Vi("start","zoom","end"),m,y,v,j=500,C=150,_=0,T=10;function M(S){S.property("__zoom",Bm).on("wheel.zoom",oe,{passive:!1}).on("mousedown.zoom",I).on("dblclick.zoom",J).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)")}M.transform=function(S,U,k,H){var D=S.selection?S.selection():S;D.property("__zoom",Bm),S!==D?O(S,U,k,H):D.interrupt().each(function(){Z(this,arguments).event(H).start().zoom(null,typeof U=="function"?U.apply(this,arguments):U).end()})},M.scaleBy=function(S,U,k,H){M.scaleTo(S,function(){var D=this.__zoom.k,z=typeof U=="function"?U.apply(this,arguments):U;return D*z},k,H)},M.scaleTo=function(S,U,k,H){M.transform(S,function(){var D=r.apply(this,arguments),z=this.__zoom,E=k==null?R(D):typeof k=="function"?k.apply(this,arguments):k,$=z.invert(E),W=typeof U=="function"?U.apply(this,arguments):U;return o(L(Y(z,W),E,$),D,h)},k,H)},M.translateBy=function(S,U,k,H){M.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)},M.translateTo=function(S,U,k,H,D){M.transform(S,function(){var z=r.apply(this,arguments),E=this.__zoom,$=H==null?R(z):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),z,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 R(S){return[(+S[0][0]+ +S[1][0])/2,(+S[0][1]+ +S[1][1])/2]}function O(S,U,k,H){S.on("start.zoom",function(){Z(this,arguments).event(H).start()}).on("interrupt.zoom end.zoom",function(){Z(this,arguments).event(H).end()}).tween("zoom",function(){var D=this,z=arguments,E=Z(D,z).event(H),$=r.apply(D,z),W=k==null?R($):typeof k=="function"?k.apply(D,z):k,ae=Math.max($[1][0]-$[0][0],$[1][1]-$[0][1]),ie=D.__zoom,he=typeof U=="function"?U.apply(D,z):U,xe=p(ie.invert(W).concat(ae/ie.k),he.invert(W).concat(ae/he.k));return function(we){if(we===1)we=he;else{var ve=xe(we),Ae=ae/ve[2];we=new Pn(Ae,W[0]-ve[0]*Ae,W[1]-ve[1]*Ae)}E.zoom(null,we)}})}function Z(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 Xw(S,{sourceEvent:this.sourceEvent,target:M,transform:this.that.__zoom,dispatch:x}),U)}};function oe(S,...U){if(!n.apply(this,arguments))return;var k=Z(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)))),z=Sn(S);if(k.wheel)(k.mouse[0][0]!==z[0]||k.mouse[0][1]!==z[1])&&(k.mouse[1]=H.invert(k.mouse[0]=z)),clearTimeout(k.wheel);else{if(H.k===D)return;k.mouse=[z,H.invert(z)],Mi(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=Z(this,U,!0).event(S),D=gn(S.view).on("mousemove.zoom",W,!0).on("mouseup.zoom",ae,!0),z=Sn(S,k),E=S.clientX,$=S.clientY;Q0(S.view),gd(S),H.mouse=[z,this.__zoom.invert(z)],Mi(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),K0(ie.view,H.moved),wr(ie),H.event(ie).end()}}function J(S,...U){if(n.apply(this,arguments)){var k=this.__zoom,H=Sn(S.changedTouches?S.changedTouches[0]:S,this),D=k.invert(H),z=k.k*(S.shiftKey?.5:2),E=o(L(Y(k,z),H,D),r.apply(this,U),h);wr(S),g>0?gn(this).transition().duration(g).call(O,E,H,S):gn(this).call(M.transform,E,H,S)}}function ne(S,...U){if(n.apply(this,arguments)){var k=S.touches,H=k.length,D=Z(this,U,S.changedTouches.length===H).event(S),z,E,$,W;for(gd(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,z=!0,D.taps=1+!!m);m&&(m=clearTimeout(m)),z&&(D.taps<2&&(y=W[0],m=setTimeout(function(){m=null},j)),Mi(this),D.start())}}function ee(S,...U){if(this.__zooming){var k=Z(this,U).event(S),H=S.changedTouches,D=H.length,z,E,$,W;for(wr(S),z=0;z<D;++z)E=H[z],$=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],we=(we=he[0]-ae[0])*we+(we=he[1]-ae[1])*we,ve=(ve=xe[0]-ie[0])*ve+(ve=xe[1]-ie[1])*ve;E=Y(E,Math.sqrt(we/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=Z(this,U).event(S),H=S.changedTouches,D=H.length,z,E;for(gd(S),v&&clearTimeout(v),v=setTimeout(function(){v=null},j),z=0;z<D;++z)E=H[z],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(y[0]-E[0],y[1]-E[1])<T)){var $=gn(this).on("dblclick.zoom");$&&$.apply(this,arguments)}}}return M.wheelDelta=function(S){return arguments.length?(i=typeof S=="function"?S:bi(+S),M):i},M.filter=function(S){return arguments.length?(n=typeof S=="function"?S:bi(!!S),M):n},M.touchable=function(S){return arguments.length?(u=typeof S=="function"?S:bi(!!S),M):u},M.extent=function(S){return arguments.length?(r=typeof S=="function"?S:bi([[+S[0][0],+S[0][1]],[+S[1][0],+S[1][1]]]),M):r},M.scaleExtent=function(S){return arguments.length?(f[0]=+S[0],f[1]=+S[1],M):[f[0],f[1]]},M.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],M):[[h[0][0],h[0][1]],[h[1][0],h[1][1]]]},M.constrain=function(S){return arguments.length?(o=S,M):o},M.duration=function(S){return arguments.length?(g=+S,M):g},M.interpolate=function(S){return arguments.length?(p=S,M):p},M.on=function(){var S=x.on.apply(x,arguments);return S===x?M:S},M.clickDistance=function(S){return arguments.length?(_=(S=+S)*S,M):Math.sqrt(_)},M.tapDistance=function(S){return arguments.length?(T=+S,M):T},M}S0();const Wi=N.createContext(null),Iw=Wi.Provider,sa={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.`},ug=sa.error001();function tt(n,r){const o=N.useContext(Wi);if(o===null)throw new Error(ug);return D0(o,n,r)}const Nt=()=>{const n=N.useContext(Wi);if(n===null)throw new Error(ug);return N.useMemo(()=>({getState:n.getState,setState:n.setState,subscribe:n.subscribe,destroy:n.destroy}),[n])},Fw=n=>n.userSelectionActive?"none":"all";function lf({position:n,children:r,className:o,style:i,...u}){const f=tt(Fw),h=`${n}`.split("-");return le.createElement("div",{className:Ht(["react-flow__panel",o,...h]),style:{...i,pointerEvents:f},...u},r)}function Pw({proOptions:n,position:r="bottom-right"}){return n?.hideAttribution?null:le.createElement(lf,{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"},le.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}const e5=({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 y=N.useRef(null),[v,j]=N.useState({x:0,y:0,width:0,height:0}),C=Ht(["react-flow__edge-textwrapper",x]);return N.useEffect(()=>{if(y.current){const _=y.current.getBBox();j({x:_.x,y:_.y,width:_.width,height:_.height})}},[o]),typeof o>"u"||!o?null:le.createElement("g",{transform:`translate(${n-v.width/2} ${r-v.height/2})`,className:C,visibility:v.width?"visible":"hidden",...m},u&&le.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}),le.createElement("text",{className:"react-flow__edge-text",y:v.height/2,dy:"0.3em",ref:y,style:i},o),p)};var t5=N.memo(e5);const rf=n=>({width:n.offsetWidth,height:n.offsetHeight}),gl=(n,r=0,o=1)=>Math.min(Math.max(n,r),o),of=(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])}),qm=(n,r,o)=>n<r?gl(Math.abs(n-r),1,50)/50:n>o?-gl(Math.abs(n-o),1,50)/50:0,dg=(n,r)=>{const o=qm(n.x,35,r.width-35)*20,i=qm(n.y,35,r.height-35)*20;return[o,i]},fg=n=>n.getRootNode?.()||window?.document,hg=(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)}),Ur=({x:n,y:r,width:o,height:i})=>({x:n,y:r,x2:n+o,y2:r+i}),xg=({x:n,y:r,x2:o,y2:i})=>({x:n,y:r,width:o-n,height:i-r}),Lm=n=>({...n.positionAbsolute||{x:0,y:0},width:n.width||0,height:n.height||0}),n5=(n,r)=>xg(hg(Ur(n),Ur(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)},a5=n=>bn(n.width)&&bn(n.height)&&bn(n.x)&&bn(n.y),bn=n=>!isNaN(n)&&isFinite(n),ut=Symbol.for("internals"),pg=["Enter"," ","Escape"],s5=(n,r)=>{},l5=n=>"nativeEvent"in n;function qd(n){const o=(l5(n)?n.nativeEvent:n).composedPath?.()?.[0]||n.target;return["INPUT","SELECT","TEXTAREA"].includes(o?.nodeName)||o?.hasAttribute("contenteditable")||!!o?.closest(".nokey")}const mg=n=>"clientX"in n,Ua=(n,r)=>{const o=mg(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)}},Bi=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0,Zr=({id:n,path:r,labelX:o,labelY:i,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:g,labelBgPadding:p,labelBgBorderRadius:x,style:m,markerEnd:y,markerStart:v,interactionWidth:j=20})=>le.createElement(le.Fragment,null,le.createElement("path",{id:n,style:m,d:r,fill:"none",className:"react-flow__edge-path",markerEnd:y,markerStart:v}),j&&le.createElement("path",{d:r,fill:"none",strokeOpacity:0,strokeWidth:j,className:"react-flow__edge-interaction"}),u&&bn(o)&&bn(i)?le.createElement(t5,{x:o,y:i,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:g,labelBgPadding:p,labelBgBorderRadius:x}):null);Zr.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 gg({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),y=Math.abs(x-r);return[p,x,m,y]}var xs;(function(n){n.Strict="strict",n.Loose="loose"})(xs||(xs={}));var us;(function(n){n.Free="free",n.Vertical="vertical",n.Horizontal="horizontal"})(us||(us={}));var Br;(function(n){n.Partial="partial",n.Full="full"})(Br||(Br={}));var $a;(function(n){n.Bezier="default",n.Straight="straight",n.Step="step",n.SmoothStep="smoothstep",n.SimpleBezier="simplebezier"})($a||($a={}));var Ba;(function(n){n.Arrow="arrow",n.ArrowClosed="arrowclosed"})(Ba||(Ba={}));var me;(function(n){n.Left="left",n.Top="top",n.Right="right",n.Bottom="bottom"})(me||(me={}));function Ym({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 yg({sourceX:n,sourceY:r,sourcePosition:o=me.Bottom,targetX:i,targetY:u,targetPosition:f=me.Top}){const[h,g]=Ym({pos:o,x1:n,y1:r,x2:i,y2:u}),[p,x]=Ym({pos:f,x1:i,y1:u,x2:n,y2:r}),[m,y,v,j]=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,y,v,j]}const cf=N.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:y,style:v,markerEnd:j,markerStart:C,interactionWidth:_})=>{const[T,M,Y]=yg({sourceX:n,sourceY:r,sourcePosition:u,targetX:o,targetY:i,targetPosition:f});return le.createElement(Zr,{path:T,labelX:M,labelY:Y,label:h,labelStyle:g,labelShowBg:p,labelBgStyle:x,labelBgPadding:m,labelBgBorderRadius:y,style:v,markerEnd:j,markerStart:C,interactionWidth:_})});cf.displayName="SimpleBezierEdge";const Vm={[me.Left]:{x:-1,y:0},[me.Right]:{x:1,y:0},[me.Top]:{x:0,y:-1},[me.Bottom]:{x:0,y:1}},r5=({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},Gm=(n,r)=>Math.sqrt(Math.pow(r.x-n.x,2)+Math.pow(r.y-n.y,2));function o5({source:n,sourcePosition:r=me.Bottom,target:o,targetPosition:i=me.Top,center:u,offset:f}){const h=Vm[r],g=Vm[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=r5({source:p,sourcePosition:r,target:x}),y=m.x!==0?"x":"y",v=m[y];let j=[],C,_;const T={x:0,y:0},M={x:0,y:0},[Y,L,R,O]=gg({sourceX:n.x,sourceY:n.y,targetX:o.x,targetY:o.y});if(h[y]*g[y]===-1){C=u.x??Y,_=u.y??L;const X=[{x:C,y:p.y},{x:C,y:x.y}],oe=[{x:p.x,y:_},{x:x.x,y:_}];h[y]===v?j=y==="x"?X:oe:j=y==="x"?oe:X}else{const X=[{x:p.x,y:x.y}],oe=[{x:x.x,y:p.y}];if(y==="x"?j=h.x===v?oe:X:j=h.y===v?X:oe,r===i){const se=Math.abs(n[y]-o[y]);if(se<=f){const S=Math.min(f-1,f-se);h[y]===v?T[y]=(p[y]>n[y]?-1:1)*S:M[y]=(x[y]>o[y]?-1:1)*S}}if(r!==i){const se=y==="x"?"y":"x",S=h[y]===g[se],U=p[se]>x[se],k=p[se]<x[se];(h[y]===1&&(!S&&U||S&&k)||h[y]!==1&&(!S&&k||S&&U))&&(j=y==="x"?X:oe)}const I={x:p.x+T.x,y:p.y+T.y},J={x:x.x+M.x,y:x.y+M.y},ne=Math.max(Math.abs(I.x-j[0].x),Math.abs(J.x-j[0].x)),ee=Math.max(Math.abs(I.y-j[0].y),Math.abs(J.y-j[0].y));ne>=ee?(C=(I.x+J.x)/2,_=j[0].y):(C=j[0].x,_=(I.y+J.y)/2)}return[[n,{x:p.x+T.x,y:p.y+T.y},...j,{x:x.x+M.x,y:x.y+M.y},o],C,_,R,O]}function i5(n,r,o,i){const u=Math.min(Gm(n,r)/2,Gm(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,y,v,j,C]=o5({source:{x:n,y:r},sourcePosition:o,target:{x:i,y:u},targetPosition:f,center:{x:g,y:p},offset:x});return[m.reduce((T,M,Y)=>{let L="";return Y>0&&Y<m.length-1?L=i5(m[Y-1],M,m[Y+1],h):L=`${Y===0?"M":"L"}${M.x} ${M.y}`,T+=L,T},""),y,v,j,C]}const Qi=N.memo(({sourceX:n,sourceY:r,targetX:o,targetY:i,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:g,labelBgPadding:p,labelBgBorderRadius:x,style:m,sourcePosition:y=me.Bottom,targetPosition:v=me.Top,markerEnd:j,markerStart:C,pathOptions:_,interactionWidth:T})=>{const[M,Y,L]=Ld({sourceX:n,sourceY:r,sourcePosition:y,targetX:o,targetY:i,targetPosition:v,borderRadius:_?.borderRadius,offset:_?.offset});return le.createElement(Zr,{path:M,labelX:Y,labelY:L,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:g,labelBgPadding:p,labelBgBorderRadius:x,style:m,markerEnd:j,markerStart:C,interactionWidth:T})});Qi.displayName="SmoothStepEdge";const uf=N.memo(n=>le.createElement(Qi,{...n,pathOptions:N.useMemo(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])}));uf.displayName="StepEdge";function c5({sourceX:n,sourceY:r,targetX:o,targetY:i}){const[u,f,h,g]=gg({sourceX:n,sourceY:r,targetX:o,targetY:i});return[`M ${n},${r}L ${o},${i}`,u,f,h,g]}const df=N.memo(({sourceX:n,sourceY:r,targetX:o,targetY:i,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:g,labelBgPadding:p,labelBgBorderRadius:x,style:m,markerEnd:y,markerStart:v,interactionWidth:j})=>{const[C,_,T]=c5({sourceX:n,sourceY:r,targetX:o,targetY:i});return le.createElement(Zr,{path:C,labelX:_,labelY:T,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:g,labelBgPadding:p,labelBgBorderRadius:x,style:m,markerEnd:y,markerStart:v,interactionWidth:j})});df.displayName="StraightEdge";function yi(n,r){return n>=0?.5*n:r*25*Math.sqrt(-n)}function Xm({pos:n,x1:r,y1:o,x2:i,y2:u,c:f}){switch(n){case me.Left:return[r-yi(r-i,f),o];case me.Right:return[r+yi(i-r,f),o];case me.Top:return[r,o-yi(o-u,f)];case me.Bottom:return[r,o+yi(u-o,f)]}}function vg({sourceX:n,sourceY:r,sourcePosition:o=me.Bottom,targetX:i,targetY:u,targetPosition:f=me.Top,curvature:h=.25}){const[g,p]=Xm({pos:o,x1:n,y1:r,x2:i,y2:u,c:h}),[x,m]=Xm({pos:f,x1:i,y1:u,x2:n,y2:r,c:h}),[y,v,j,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}`,y,v,j,C]}const qi=N.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:y,style:v,markerEnd:j,markerStart:C,pathOptions:_,interactionWidth:T})=>{const[M,Y,L]=vg({sourceX:n,sourceY:r,sourcePosition:u,targetX:o,targetY:i,targetPosition:f,curvature:_?.curvature});return le.createElement(Zr,{path:M,labelX:Y,labelY:L,label:h,labelStyle:g,labelShowBg:p,labelBgStyle:x,labelBgPadding:m,labelBgBorderRadius:y,style:v,markerEnd:j,markerStart:C,interactionWidth:T})});qi.displayName="BezierEdge";const ff=N.createContext(null),u5=ff.Provider;ff.Consumer;const d5=()=>N.useContext(ff),f5=n=>"id"in n&&"source"in n&&"target"in n,h5=({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("&")}`,x5=(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)),p5=(n,r)=>{if(!n.source||!n.target)return r;let o;return f5(n)?o={...n}:o={...n,id:h5(n)},x5(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},jg=({x:n,y:r},[o,i,u])=>({x:n*u+o,y:r*u+i}),fs=(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}},Ki=(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}=fs(u,r).positionAbsolute;return hg(i,Ur({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 xg(o)},Ng=(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:y,height:v,selectable:j=!0,hidden:C=!1}=m;if(h&&!j||C)return!1;const{positionAbsolute:_}=fs(m,g),T={x:_.x,y:_.y,width:y||0,height:v||0},M=Bd(p,T),Y=typeof y>"u"||typeof v>"u"||y===null||v===null,L=f&&M>0,R=(y||0)*(v||0);(Y||L||M>=R||m.dragging)&&x.push(m)}),x},wg=(n,r)=>{const o=n.map(i=>i.id);return r.filter(i=>o.includes(i.source)||o.includes(i.target))},Sg=(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,y=n.y+n.height/2,v=r/2-m*x,j=o/2-y*x;return{x:v,y:j,zoom:x}},is=(n,r=0)=>n.transition().duration(r);function Zm(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 m5(n,r,o,i,u,f){const{x:h,y:g}=Ua(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 _=hf(void 0,x),T=x.getAttribute("data-handleid"),M=f({nodeId:C,id:T,type:_});if(M){const Y=u.find(L=>L.nodeId===C&&L.type===_&&L.id===T);return{handle:{id:T,type:_,nodeId:C,x:Y?.x||o.x,y:Y?.y||o.y},validHandleResult:M}}}}let m=[],y=1/0;if(u.forEach(C=>{const _=Math.sqrt((C.x-o.x)**2+(C.y-o.y)**2);if(_<=i){const T=f(C);_<=y&&(_<y?m=[{handle:C,validHandleResult:T}]:_===y&&m.push({handle:C,validHandleResult:T}),y=_)}}),!m.length)return{handle:null,validHandleResult:Eg()};if(m.length===1)return m[0];const v=m.some(({validHandleResult:C})=>C.isValid),j=m.some(({handle:C})=>C.type==="target");return m.find(({handle:C,validHandleResult:_})=>j?C.type==="target":v?_.isValid:!0)||m[0]}const g5={source:null,target:null,sourceHandle:null,targetHandle:null},Eg=()=>({handleDomNode:null,isValid:!1,connection:g5,endHandle:null});function kg(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={...Eg(),handleDomNode:p};if(p){const m=hf(void 0,p),y=p.getAttribute("data-nodeid"),v=p.getAttribute("data-handleid"),j=p.classList.contains("connectable"),C=p.classList.contains("connectableend"),_={source:g?y:o,sourceHandle:g?v:i,target:g?o:y,targetHandle:g?i:v};x.connection=_,j&&C&&(r===xs.Strict?g&&m==="source"||!g&&m==="target":y!==o||v!==i)&&(x.endHandle={nodeId:y,handleId:v,type:m},x.isValid=f(_))}return x}function b5({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=Zm(f,h,"source",`${r}-${o}-${i}`),p=Zm(f,h,"target",`${r}-${o}-${i}`)),u.push(...g,...p)}return u},[])}function hf(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 y5(n,r){let o=null;return r?o="valid":n&&!r&&(o="invalid"),o}function _g({event:n,handleId:r,nodeId:o,onConnect:i,isTarget:u,getState:f,setState:h,isValidConnection:g,edgeUpdaterType:p,onReconnectEnd:x}){const m=fg(n.target),{connectionMode:y,domNode:v,autoPanOnConnect:j,connectionRadius:C,onConnectStart:_,panBy:T,getNodes:M,cancelConnection:Y}=f();let L=0,R;const{x:O,y:Z}=Ua(n),X=m?.elementFromPoint(O,Z),oe=hf(p,X),I=v?.getBoundingClientRect();if(!I||!oe)return;let J,ne=Ua(n,I),ee=!1,se=null,S=!1,U=null;const k=b5({nodes:M(),nodeId:o,handleId:r,handleType:oe}),H=()=>{if(!j)return;const[E,$]=dg(ne,I);T({x:E,y:$}),L=requestAnimationFrame(H)};h({connectionPosition:ne,connectionStatus:null,connectionNodeId:o,connectionHandleId:r,connectionHandleType:oe,connectionStartHandle:{nodeId:o,handleId:r,type:oe},connectionEndHandle:null}),_?.(n,{nodeId:o,handleId:r,handleType:oe});function D(E){const{transform:$}=f();ne=Ua(E,I);const{handle:W,validHandleResult:ae}=m5(E,m,Vd(ne,$,!1,[1,1]),C,k,ie=>kg(ie,y,o,r,u?"target":"source",g,m));if(R=W,ee||(H(),ee=!0),U=ae.handleDomNode,se=ae.connection,S=ae.isValid,h({connectionPosition:R&&S?jg({x:R.x,y:R.y},$):ne,connectionStatus:y5(!!R,S),connectionEndHandle:ae.endHandle}),!R&&!S&&!U)return bd(J);se.source!==se.target&&U&&(bd(J),J=U,U.classList.add("connecting","react-flow__handle-connecting"),U.classList.toggle("valid",S),U.classList.toggle("react-flow__handle-valid",S))}function z(E){(R||U)&&se&&S&&i?.(se),f().onConnectEnd?.(E),p&&x?.(E),bd(J),Y(),cancelAnimationFrame(L),ee=!1,S=!1,se=null,U=null,m.removeEventListener("mousemove",D),m.removeEventListener("mouseup",z),m.removeEventListener("touchmove",D),m.removeEventListener("touchend",z)}m.addEventListener("mousemove",D),m.addEventListener("mouseup",z),m.addEventListener("touchmove",D),m.addEventListener("touchend",z)}const Wm=()=>!0,v5=n=>({connectionStartHandle:n.connectionStartHandle,connectOnClick:n.connectOnClick,noPanClassName:n.noPanClassName}),j5=(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}},Cg=N.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:y,...v},j)=>{const C=h||null,_=n==="target",T=Nt(),M=d5(),{connectOnClick:Y,noPanClassName:L}=tt(v5,Tt),{connecting:R,clickConnecting:O}=tt(j5(M,C,n),Tt);M||T.getState().onError?.("010",sa.error010());const Z=I=>{const{defaultEdgeOptions:J,onConnect:ne,hasDefaultEdges:ee}=T.getState(),se={...J,...I};if(ee){const{edges:S,setEdges:U}=T.getState();U(p5(se,S))}ne?.(se),g?.(se)},X=I=>{if(!M)return;const J=mg(I);u&&(J&&I.button===0||!J)&&_g({event:I,handleId:C,nodeId:M,onConnect:Z,isTarget:_,getState:T.getState,setState:T.setState,isValidConnection:o||T.getState().isValidConnection||Wm}),J?m?.(I):y?.(I)},oe=I=>{const{onClickConnectStart:J,onClickConnectEnd:ne,connectionClickStartHandle:ee,connectionMode:se,isValidConnection:S}=T.getState();if(!M||!ee&&!u)return;if(!ee){J?.(I,{nodeId:M,handleId:C,handleType:n}),T.setState({connectionClickStartHandle:{nodeId:M,type:n,handleId:C}});return}const U=fg(I.target),k=o||S||Wm,{connection:H,isValid:D}=kg({nodeId:M,id:C,type:n},se,ee.nodeId,ee.handleId||null,ee.type,k,U);D&&Z(H),ne?.(I),T.setState({connectionClickStartHandle:null})};return le.createElement("div",{"data-handleid":C,"data-nodeid":M,"data-handlepos":r,"data-id":`${M}-${C}-${n}`,className:Ht(["react-flow__handle",`react-flow__handle-${r}`,"nodrag",L,x,{source:!_,target:_,connectable:i,connectablestart:u,connectableend:f,connecting:O,connectionindicator:i&&(u&&!R||f&&R)}]),onMouseDown:X,onTouchStart:X,onClick:Y?oe:void 0,ref:j,...v},p)});Cg.displayName="Handle";var vt=N.memo(Cg);const Tg=({data:n,isConnectable:r,targetPosition:o=me.Top,sourcePosition:i=me.Bottom})=>le.createElement(le.Fragment,null,le.createElement(vt,{type:"target",position:o,isConnectable:r}),n?.label,le.createElement(vt,{type:"source",position:i,isConnectable:r}));Tg.displayName="DefaultNode";var Gd=N.memo(Tg);const Mg=({data:n,isConnectable:r,sourcePosition:o=me.Bottom})=>le.createElement(le.Fragment,null,n?.label,le.createElement(vt,{type:"source",position:o,isConnectable:r}));Mg.displayName="InputNode";var Ag=N.memo(Mg);const Rg=({data:n,isConnectable:r,targetPosition:o=me.Top})=>le.createElement(le.Fragment,null,le.createElement(vt,{type:"target",position:o,isConnectable:r}),n?.label);Rg.displayName="OutputNode";var zg=N.memo(Rg);const xf=()=>null;xf.displayName="GroupNode";const N5=n=>({selectedNodes:n.getNodes().filter(r=>r.selected),selectedEdges:n.edges.filter(r=>r.selected).map(r=>({...r}))}),vi=n=>n.id;function w5(n,r){return Tt(n.selectedNodes.map(vi),r.selectedNodes.map(vi))&&Tt(n.selectedEdges.map(vi),r.selectedEdges.map(vi))}const Og=N.memo(({onSelectionChange:n})=>{const r=Nt(),{selectedNodes:o,selectedEdges:i}=tt(N5,w5);return N.useEffect(()=>{const u={nodes:o,edges:i};n?.(u),r.getState().onSelectionChange.forEach(f=>f(u))},[o,i,n]),null});Og.displayName="SelectionListener";const S5=n=>!!n.onSelectionChange;function E5({onSelectionChange:n}){const r=tt(S5);return n||r?le.createElement(Og,{onSelectionChange:n}):null}const k5=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){N.useEffect(()=>{typeof n<"u"&&r(n)},[n])}function Ue(n,r,o){N.useEffect(()=>{typeof r<"u"&&o({[n]:r})},[r])}const _5=({nodes:n,edges:r,defaultNodes:o,defaultEdges:i,onConnect:u,onConnectStart:f,onConnectEnd:h,onClickConnectStart:g,onClickConnectEnd:p,nodesDraggable:x,nodesConnectable:m,nodesFocusable:y,edgesFocusable:v,edgesUpdatable:j,elevateNodesOnSelect:C,minZoom:_,maxZoom:T,nodeExtent:M,onNodesChange:Y,onEdgesChange:L,elementsSelectable:R,connectionMode:O,snapGrid:Z,snapToGrid:X,translateExtent:oe,connectOnClick:I,defaultEdgeOptions:J,fitView:ne,fitViewOptions:ee,onNodesDelete:se,onEdgesDelete:S,onNodeDrag:U,onNodeDragStart:k,onNodeDragStop:H,onSelectionDrag:D,onSelectionDragStart:z,onSelectionDragStop:E,noPanClassName:$,nodeOrigin:W,rfId:ae,autoPanOnConnect:ie,autoPanOnNodeDrag:he,onError:xe,connectionRadius:we,isValidConnection:ve,nodeDragThreshold:Ae})=>{const{setNodes:Re,setEdges:We,setDefaultNodesAndEdges:Te,setMinZoom:ye,setMaxZoom:q,setTranslateExtent:V,setNodeExtent:ue,reset:re}=tt(k5,Tt),P=Nt();return N.useEffect(()=>{const Ee=i?.map(ge=>({...ge,...J}));return Te(o,Ee),()=>{re()}},[]),Ue("defaultEdgeOptions",J,P.setState),Ue("connectionMode",O,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",y,P.setState),Ue("edgesFocusable",v,P.setState),Ue("edgesUpdatable",j,P.setState),Ue("elementsSelectable",R,P.setState),Ue("elevateNodesOnSelect",C,P.setState),Ue("snapToGrid",X,P.setState),Ue("snapGrid",Z,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",z,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",we,P.setState),Ue("isValidConnection",ve,P.setState),Ue("nodeDragThreshold",Ae,P.setState),tl(n,Re),tl(r,We),tl(_,ye),tl(T,q),tl(oe,V),tl(M,ue),null},Qm={display:"none"},C5={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Dg="react-flow__node-desc",Hg="react-flow__edge-desc",T5="react-flow__aria-live",M5=n=>n.ariaLiveMessage;function A5({rfId:n}){const r=tt(M5);return le.createElement("div",{id:`${T5}-${n}`,"aria-live":"assertive","aria-atomic":"true",style:C5},r)}function R5({rfId:n,disableKeyboardA11y:r}){return le.createElement(le.Fragment,null,le.createElement("div",{id:`${Dg}-${n}`,style:Qm},"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."," "),le.createElement("div",{id:`${Hg}-${n}`,style:Qm},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!r&&le.createElement(A5,{rfId:n}))}var qr=(n=null,r={actInsideInputWithModifier:!0})=>{const[o,i]=N.useState(!1),u=N.useRef(!1),f=N.useRef(new Set([])),[h,g]=N.useMemo(()=>{if(n!==null){const x=(Array.isArray(n)?n:[n]).filter(y=>typeof y=="string").map(y=>y.split("+")),m=x.reduce((y,v)=>y.concat(...v),[]);return[x,m]}return[[],[]]},[n]);return N.useEffect(()=>{const p=typeof document<"u"?document:null,x=r?.target||p;if(n!==null){const m=j=>{if(u.current=j.ctrlKey||j.metaKey||j.shiftKey,(!u.current||u.current&&!r.actInsideInputWithModifier)&&qd(j))return!1;const _=Jm(j.code,g);f.current.add(j[_]),Km(h,f.current,!1)&&(j.preventDefault(),i(!0))},y=j=>{if((!u.current||u.current&&!r.actInsideInputWithModifier)&&qd(j))return!1;const _=Jm(j.code,g);Km(h,f.current,!0)?(i(!1),f.current.clear()):f.current.delete(j[_]),j.key==="Meta"&&f.current.clear(),u.current=!1},v=()=>{f.current.clear(),i(!1)};return x?.addEventListener("keydown",m),x?.addEventListener("keyup",y),window.addEventListener("blur",v),()=>{x?.removeEventListener("keydown",m),x?.removeEventListener("keyup",y),window.removeEventListener("blur",v)}}},[n,i]),o};function Km(n,r,o){return n.filter(i=>o||i.length===r.size).some(i=>i.every(u=>r.has(u)))}function Jm(n,r){return r.includes(n)?"code":"key"}function $g(n,r,o,i){const u=n.parentNode||n.parentId;if(!u)return o;const f=r.get(u),h=fs(f,i);return $g(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 Ug(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}=$g(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 yd(n,r,o,i){const u=new Map,f={},h=i?1e3:0;return n.forEach(g=>{const p=(bn(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}},y=g.parentNode||g.parentId;y&&(f[y]=!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)}),Ug(u,o,f),u}function Bg(n,r={}){const{getNodes:o,width:i,height:u,minZoom:f,maxZoom:h,d3Zoom:g,d3Selection:p,fitViewOnInitDone:x,fitViewOnInit:m,nodeOrigin:y}=n(),v=r.initial&&!x&&m;if(g&&p&&(v||!r.initial)){const C=o().filter(T=>{const M=r.includeHiddenNodes?T.width&&T.height:!T.hidden;return r.nodes?.length?M&&r.nodes.some(Y=>Y.id===T.id):M}),_=C.every(T=>T.width&&T.height);if(C.length>0&&_){const T=Ki(C,y),{x:M,y:Y,zoom:L}=Sg(T,i,u,r.minZoom??f,r.maxZoom??h,r.padding??.1),R=ta.translate(M,Y).scale(L);return typeof r.duration=="number"&&r.duration>0?g.transform(is(p,r.duration),R):g.transform(p,R),!0}}return!1}function z5(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 O5(n,r){return r.map(o=>{const i=n.find(u=>u.id===o.id);return i&&(o.selected=i.selected),o})}function ji({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:z5(n,u)}),h?.(n)),r?.length&&(x&&i({edges:O5(r,f)}),g?.(r))}const nl=()=>{},D5={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},H5=n=>({d3Zoom:n.d3Zoom,d3Selection:n.d3Selection}),$5=()=>{const n=Nt(),{d3Zoom:r,d3Selection:o}=tt(H5,Tt);return N.useMemo(()=>o&&r?{zoomIn:u=>r.scaleBy(is(o,u?.duration),1.2),zoomOut:u=>r.scaleBy(is(o,u?.duration),1/1.2),zoomTo:(u,f)=>r.scaleTo(is(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(is(o,f?.duration),x)},getViewport:()=>{const[u,f,h]=n.getState().transform;return{x:u,y:f,zoom:h}},fitView:u=>Bg(n.getState,u),setCenter:(u,f,h)=>{const{width:g,height:p,maxZoom:x}=n.getState(),m=typeof h?.zoom<"u"?h.zoom:x,y=g/2-u*m,v=p/2-f*m,j=ta.translate(y,v).scale(m);r.transform(is(o,h?.duration),j)},fitBounds:(u,f)=>{const{width:h,height:g,minZoom:p,maxZoom:x}=n.getState(),{x:m,y,zoom:v}=Sg(u,h,g,p,x,f?.padding??.1),j=ta.translate(m,y).scale(v);r.transform(is(o,f?.duration),j)},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(),y={x:u.x-x,y:u.y-m};return Vd(y,f,h,g)},flowToScreenPosition:u=>{const{transform:f,domNode:h}=n.getState();if(!h)return u;const{x:g,y:p}=h.getBoundingClientRect(),x=jg(u,f);return{x:x.x+g,y:x.y+p}},viewportInitialized:!0}:D5,[r,o])};function pf(){const n=$5(),r=Nt(),o=N.useCallback(()=>r.getState().getNodes().map(_=>({..._})),[]),i=N.useCallback(_=>r.getState().nodeInternals.get(_),[]),u=N.useCallback(()=>{const{edges:_=[]}=r.getState();return _.map(T=>({...T}))},[]),f=N.useCallback(_=>{const{edges:T=[]}=r.getState();return T.find(M=>M.id===_)},[]),h=N.useCallback(_=>{const{getNodes:T,setNodes:M,hasDefaultNodes:Y,onNodesChange:L}=r.getState(),R=T(),O=typeof _=="function"?_(R):_;if(Y)M(O);else if(L){const Z=O.length===0?R.map(X=>({type:"remove",id:X.id})):O.map(X=>({item:X,type:"reset"}));L(Z)}},[]),g=N.useCallback(_=>{const{edges:T=[],setEdges:M,hasDefaultEdges:Y,onEdgesChange:L}=r.getState(),R=typeof _=="function"?_(T):_;if(Y)M(R);else if(L){const O=R.length===0?T.map(Z=>({type:"remove",id:Z.id})):R.map(Z=>({item:Z,type:"reset"}));L(O)}},[]),p=N.useCallback(_=>{const T=Array.isArray(_)?_:[_],{getNodes:M,setNodes:Y,hasDefaultNodes:L,onNodesChange:R}=r.getState();if(L){const Z=[...M(),...T];Y(Z)}else if(R){const O=T.map(Z=>({item:Z,type:"add"}));R(O)}},[]),x=N.useCallback(_=>{const T=Array.isArray(_)?_:[_],{edges:M=[],setEdges:Y,hasDefaultEdges:L,onEdgesChange:R}=r.getState();if(L)Y([...M,...T]);else if(R){const O=T.map(Z=>({item:Z,type:"add"}));R(O)}},[]),m=N.useCallback(()=>{const{getNodes:_,edges:T=[],transform:M}=r.getState(),[Y,L,R]=M;return{nodes:_().map(O=>({...O})),edges:T.map(O=>({...O})),viewport:{x:Y,y:L,zoom:R}}},[]),y=N.useCallback(({nodes:_,edges:T})=>{const{nodeInternals:M,getNodes:Y,edges:L,hasDefaultNodes:R,hasDefaultEdges:O,onNodesDelete:Z,onEdgesDelete:X,onNodesChange:oe,onEdgesChange:I}=r.getState(),J=(_||[]).map(U=>U.id),ne=(T||[]).map(U=>U.id),ee=Y().reduce((U,k)=>{const H=k.parentNode||k.parentId,D=!J.includes(k.id)&&H&&U.find(E=>E.id===H);return(typeof k.deletable=="boolean"?k.deletable:!0)&&(J.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=wg(ee,se),k=[...S,...U],H=k.reduce((D,z)=>(D.includes(z.id)||D.push(z.id),D),[]);if((O||R)&&(O&&r.setState({edges:L.filter(D=>!H.includes(D.id))}),R&&(ee.forEach(D=>{M.delete(D.id)}),r.setState({nodeInternals:new Map(M)}))),H.length>0&&(X?.(k),I&&I(H.map(D=>({id:D,type:"remove"})))),ee.length>0&&(Z?.(ee),oe)){const D=ee.map(z=>({id:z.id,type:"remove"}));oe(D)}}},[]),v=N.useCallback(_=>{const T=a5(_),M=T?null:r.getState().nodeInternals.get(_.id);return!T&&!M?[null,null,T]:[T?_:Lm(M),M,T]},[]),j=N.useCallback((_,T=!0,M)=>{const[Y,L,R]=v(_);return Y?(M||r.getState().getNodes()).filter(O=>{if(!R&&(O.id===L.id||!O.positionAbsolute))return!1;const Z=Lm(O),X=Bd(Z,Y);return T&&X>0||X>=Y.width*Y.height}):[]},[]),C=N.useCallback((_,T,M=!0)=>{const[Y]=v(_);if(!Y)return!1;const L=Bd(Y,T);return M&&L>0||L>=Y.width*Y.height},[]);return N.useMemo(()=>({...n,getNodes:o,getNode:i,getEdges:u,getEdge:f,setNodes:h,setEdges:g,addNodes:p,addEdges:x,toObject:m,deleteElements:y,getIntersectingNodes:j,isNodeIntersecting:C}),[n,o,i,u,f,h,g,p,x,m,y,j,C])}const U5={actInsideInputWithModifier:!1};var B5=({deleteKeyCode:n,multiSelectionKeyCode:r})=>{const o=Nt(),{deleteElements:i}=pf(),u=qr(n,U5),f=qr(r);N.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]),N.useEffect(()=>{o.setState({multiSelectionActive:f})},[f])};function q5(n){const r=Nt();N.useEffect(()=>{let o;const i=()=>{if(!n.current)return;const u=rf(n.current);(u.height===0||u.width===0)&&r.getState().onError?.("004",sa.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 mf={position:"absolute",width:"100%",height:"100%",top:0,left:0},L5=(n,r)=>n.x!==r.x||n.y!==r.y||n.zoom!==r.k,Ni=n=>({x:n.x,y:n.y,zoom:n.k}),al=(n,r)=>n.target.closest(`.${r}`),Im=(n,r)=>r===2&&Array.isArray(n)&&n.includes(2),Fm=n=>{const r=n.ctrlKey&&Bi()?10:1;return-n.deltaY*(n.deltaMode===1?.05:n.deltaMode?1:.002)*r},Y5=n=>({d3Zoom:n.d3Zoom,d3Selection:n.d3Selection,d3ZoomHandler:n.d3ZoomHandler,userSelectionActive:n.userSelectionActive}),V5=({onMove:n,onMoveStart:r,onMoveEnd:o,onPaneContextMenu:i,zoomOnScroll:u=!0,zoomOnPinch:f=!0,panOnScroll:h=!1,panOnScrollSpeed:g=.5,panOnScrollMode:p=us.Free,zoomOnDoubleClick:x=!0,elementsSelectable:m,panOnDrag:y=!0,defaultViewport:v,translateExtent:j,minZoom:C,maxZoom:_,zoomActivationKeyCode:T,preventScrolling:M=!0,children:Y,noWheelClassName:L,noPanClassName:R})=>{const O=N.useRef(),Z=Nt(),X=N.useRef(!1),oe=N.useRef(!1),I=N.useRef(null),J=N.useRef({x:0,y:0,zoom:0}),{d3Zoom:ne,d3Selection:ee,d3ZoomHandler:se,userSelectionActive:S}=tt(Y5,Tt),U=qr(T),k=N.useRef(0),H=N.useRef(!1),D=N.useRef();return q5(I),N.useEffect(()=>{if(I.current){const z=I.current.getBoundingClientRect(),E=cg().scaleExtent([C,_]).translateExtent(j),$=gn(I.current).call(E),W=ta.translate(v.x,v.y).scale(gl(v.zoom,C,_)),ae=[[0,0],[z.width,z.height]],ie=E.constrain()(W,ae,j);E.transform($,ie),E.wheelDelta(Fm),Z.setState({d3Zoom:E,d3Selection:$,d3ZoomHandler:$.on("wheel.zoom"),transform:[ie.x,ie.y,ie.k],domNode:I.current.closest(".react-flow")})}},[]),N.useEffect(()=>{ee&&ne&&(h&&!U&&!S?ee.on("wheel.zoom",z=>{if(al(z,L))return!1;z.preventDefault(),z.stopImmediatePropagation();const E=ee.property("__zoom").k||1;if(z.ctrlKey&&f){const ve=Sn(z),Ae=Fm(z),Re=E*Math.pow(2,Ae);ne.scaleTo(ee,Re,ve,z);return}const $=z.deltaMode===1?20:1;let W=p===us.Vertical?0:z.deltaX*$,ae=p===us.Horizontal?0:z.deltaY*$;!Bi()&&z.shiftKey&&p!==us.Vertical&&(W=z.deltaY*$,ae=0),ne.translateBy(ee,-(W/E)*g,-(ae/E)*g,{internal:!0});const ie=Ni(ee.property("__zoom")),{onViewportChangeStart:he,onViewportChange:xe,onViewportChangeEnd:we}=Z.getState();clearTimeout(D.current),H.current||(H.current=!0,r?.(z,ie),he?.(ie)),H.current&&(n?.(z,ie),xe?.(ie),D.current=setTimeout(()=>{o?.(z,ie),we?.(ie),H.current=!1},150))},{passive:!1}):typeof se<"u"&&ee.on("wheel.zoom",function(z,E){if(!M&&z.type==="wheel"&&!z.ctrlKey||al(z,L))return null;z.preventDefault(),se.call(this,z,E)},{passive:!1}))},[S,h,p,ee,ne,se,U,f,M,L,r,n,o]),N.useEffect(()=>{ne&&ne.on("start",z=>{if(!z.sourceEvent||z.sourceEvent.internal)return null;k.current=z.sourceEvent?.button;const{onViewportChangeStart:E}=Z.getState(),$=Ni(z.transform);X.current=!0,J.current=$,z.sourceEvent?.type==="mousedown"&&Z.setState({paneDragging:!0}),E?.($),r?.(z.sourceEvent,$)})},[ne,r]),N.useEffect(()=>{ne&&(S&&!X.current?ne.on("zoom",null):S||ne.on("zoom",z=>{const{onViewportChange:E}=Z.getState();if(Z.setState({transform:[z.transform.x,z.transform.y,z.transform.k]}),oe.current=!!(i&&Im(y,k.current??0)),(n||E)&&!z.sourceEvent?.internal){const $=Ni(z.transform);E?.($),n?.(z.sourceEvent,$)}}))},[S,ne,n,y,i]),N.useEffect(()=>{ne&&ne.on("end",z=>{if(!z.sourceEvent||z.sourceEvent.internal)return null;const{onViewportChangeEnd:E}=Z.getState();if(X.current=!1,Z.setState({paneDragging:!1}),i&&Im(y,k.current??0)&&!oe.current&&i(z.sourceEvent),oe.current=!1,(o||E)&&L5(J.current,z.transform)){const $=Ni(z.transform);J.current=$,clearTimeout(O.current),O.current=setTimeout(()=>{E?.($),o?.(z.sourceEvent,$)},h?150:0)}})},[ne,h,y,o,i]),N.useEffect(()=>{ne&&ne.filter(z=>{const E=U||u,$=f&&z.ctrlKey;if((y===!0||Array.isArray(y)&&y.includes(1))&&z.button===1&&z.type==="mousedown"&&(al(z,"react-flow__node")||al(z,"react-flow__edge")))return!0;if(!y&&!E&&!h&&!x&&!f||S||!x&&z.type==="dblclick"||al(z,L)&&z.type==="wheel"||al(z,R)&&(z.type!=="wheel"||h&&z.type==="wheel"&&!U)||!f&&z.ctrlKey&&z.type==="wheel"||!E&&!h&&!$&&z.type==="wheel"||!y&&(z.type==="mousedown"||z.type==="touchstart")||Array.isArray(y)&&!y.includes(z.button)&&z.type==="mousedown")return!1;const W=Array.isArray(y)&&y.includes(z.button)||!z.button||z.button<=1;return(!z.ctrlKey||z.type==="wheel")&&W})},[S,ne,u,f,h,x,y,m,U]),le.createElement("div",{className:"react-flow__renderer",ref:I,style:mf},Y)},G5=n=>({userSelectionActive:n.userSelectionActive,userSelectionRect:n.userSelectionRect});function X5(){const{userSelectionActive:n,userSelectionRect:r}=tt(G5,Tt);return n&&r?le.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 Pm(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 qg(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&&Pm(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&&Pm(i,h);break}case"remove":return i}return i.push(h),i},o)}function Lg(n,r){return qg(n,r)}function Z5(n,r){return qg(n,r)}const Ha=(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(Ha(i.id,!0))):i.selected&&!u&&(i.selected=!1,o.push(Ha(i.id,!1))),o},[])}const vd=(n,r)=>o=>{o.target===r.current&&n?.(o)},W5=n=>({userSelectionActive:n.userSelectionActive,elementsSelectable:n.elementsSelectable,dragging:n.paneDragging}),Yg=N.memo(({isSelecting:n,selectionMode:r=Br.Full,panOnDrag:o,onSelectionStart:i,onSelectionEnd:u,onPaneClick:f,onPaneContextMenu:h,onPaneScroll:g,onPaneMouseEnter:p,onPaneMouseMove:x,onPaneMouseLeave:m,children:y})=>{const v=N.useRef(null),j=Nt(),C=N.useRef(0),_=N.useRef(0),T=N.useRef(),{userSelectionActive:M,elementsSelectable:Y,dragging:L}=tt(W5,Tt),R=()=>{j.setState({userSelectionActive:!1,userSelectionRect:null}),C.current=0,_.current=0},O=se=>{f?.(se),j.getState().resetSelectedElements(),j.setState({nodesSelectionActive:!1})},Z=se=>{if(Array.isArray(o)&&o?.includes(2)){se.preventDefault();return}h?.(se)},X=g?se=>g(se):void 0,oe=se=>{const{resetSelectedElements:S,domNode:U}=j.getState();if(T.current=U?.getBoundingClientRect(),!Y||!n||se.button!==0||se.target!==v.current||!T.current)return;const{x:k,y:H}=Ua(se,T.current);S(),j.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:z,nodeOrigin:E,getNodes:$}=j.getState();if(!n||!T.current||!S)return;j.setState({userSelectionActive:!0,nodesSelectionActive:!1});const W=Ua(se,T.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=$(),we=Ng(U,he,H,r===Br.Partial,!0,E),ve=wg(we,k).map(Re=>Re.id),Ae=we.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&&z?.(Re)}j.setState({userSelectionRect:he})},J=se=>{if(se.button!==0)return;const{userSelectionRect:S}=j.getState();!M&&S&&se.target===v.current&&O?.(se),j.setState({nodesSelectionActive:C.current>0}),R(),u?.(se)},ne=se=>{M&&(j.setState({nodesSelectionActive:C.current>0}),u?.(se)),R()},ee=Y&&(n||M);return le.createElement("div",{className:Ht(["react-flow__pane",{dragging:L,selection:n}]),onClick:ee?void 0:vd(O,v),onContextMenu:vd(Z,v),onWheel:vd(X,v),onMouseEnter:ee?void 0:p,onMouseDown:ee?oe:void 0,onMouseMove:ee?I:x,onMouseUp:ee?J:void 0,onMouseLeave:ee?ne:m,ref:v,style:mf},y,le.createElement(X5,null))});Yg.displayName="Pane";function Vg(n,r){const o=n.parentNode||n.parentId;if(!o)return!1;const i=r.get(o);return i?i.selected?!0:Vg(i,r):!1}function e0(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 Q5(n,r,o,i){return Array.from(n.values()).filter(u=>(u.selected||u.id===i)&&(!u.parentNode||u.parentId||!Vg(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 K5(n,r){return!r||r==="parent"?r:[r[0],[r[1][0]-(n.width||0),r[1][1]-(n.height||0)]]}function Gg(n,r,o,i,u=[0,0],f){const h=K5(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 y=o.get(p),{x:v,y:j}=fs(y,u).positionAbsolute;g=y&&bn(v)&&bn(j)&&bn(y.width)&&bn(y.height)?[[v+n.width*u[0],j+n.height*u[1]],[v+y.width-n.width+n.width*u[0],j+y.height-n.height+n.height*u[1]]]:g}else f?.("005",sa.error005()),g=h;else if(n.extent&&p&&n.extent!=="parent"){const y=o.get(p),{x:v,y:j}=fs(y,u).positionAbsolute;g=[[n.extent[0][0]+v,n.extent[0][1]+j],[n.extent[1][0]+v,n.extent[1][1]+j]]}let x={x:0,y:0};if(p){const y=o.get(p);x=fs(y,u).positionAbsolute}const m=g&&g!=="parent"?of(r,g):r;return{position:{x:m.x-x.x,y:m.y-x.y},positionAbsolute:m}}function jd({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 t0=(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,...rf(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",sa.error012(n));return}r.setState({nodesSelectionActive:!1}),x.selected?(o||x.selected&&h)&&(f({nodes:[x],edges:[]}),requestAnimationFrame(()=>i?.current?.blur())):u([n])}function J5(){const n=Nt();return N.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 Nd(n){return(r,o,i)=>n?.(r,i)}function Xg({nodeRef:n,disabled:r=!1,noDragClassName:o,handleSelector:i,nodeId:u,isSelectable:f,selectNodesOnDrag:h}){const g=Nt(),[p,x]=N.useState(!1),m=N.useRef([]),y=N.useRef({x:null,y:null}),v=N.useRef(0),j=N.useRef(null),C=N.useRef({x:0,y:0}),_=N.useRef(null),T=N.useRef(!1),M=N.useRef(!1),Y=N.useRef(!1),L=J5();return N.useEffect(()=>{if(n?.current){const R=gn(n.current),O=({x:oe,y:I})=>{const{nodeInternals:J,onNodeDrag:ne,onSelectionDrag:ee,updateNodePositions:se,nodeExtent:S,snapGrid:U,snapToGrid:k,nodeOrigin:H,onError:D}=g.getState();y.current={x:oe,y:I};let z=!1,E={x:0,y:0,x2:0,y2:0};if(m.current.length>1&&S){const W=Ki(m.current,H);E=Ur(W)}if(m.current=m.current.map(W=>{const ae={x:oe-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=Gg(W,ae,J,ie,H,D);return z=z||W.position.x!==he.position.x||W.position.y!==he.position.y,W.position=he.position,W.positionAbsolute=he.positionAbsolute,W}),!z)return;se(m.current,!0,!0),x(!0);const $=u?ne:Nd(ee);if($&&_.current){const[W,ae]=jd({nodeId:u,dragItems:m.current,nodeInternals:J});$(_.current,W,ae)}},Z=()=>{if(!j.current)return;const[oe,I]=dg(C.current,j.current);if(oe!==0||I!==0){const{transform:J,panBy:ne}=g.getState();y.current.x=(y.current.x??0)-oe/J[2],y.current.y=(y.current.y??0)-I/J[2],ne({x:oe,y:I})&&O(y.current)}v.current=requestAnimationFrame(Z)},X=oe=>{const{nodeInternals:I,multiSelectionActive:J,nodesDraggable:ne,unselectNodesAndEdges:ee,onNodeDragStart:se,onSelectionDragStart:S}=g.getState();M.current=!0;const U=u?se:Nd(S);(!h||!f)&&!J&&u&&(I.get(u)?.selected||ee()),u&&f&&h&&Xd({id:u,store:g,nodeRef:n});const k=L(oe);if(y.current=k,m.current=Q5(I,ne,k,u),U&&m.current){const[H,D]=jd({nodeId:u,dragItems:m.current,nodeInternals:I});U(oe.sourceEvent,H,D)}};if(r)R.on(".drag",null);else{const oe=oN().on("start",I=>{const{domNode:J,nodeDragThreshold:ne}=g.getState();ne===0&&X(I),Y.current=!1;const ee=L(I);y.current=ee,j.current=J?.getBoundingClientRect()||null,C.current=Ua(I.sourceEvent,j.current)}).on("drag",I=>{const J=L(I),{autoPanOnNodeDrag:ne,nodeDragThreshold:ee}=g.getState();if(I.sourceEvent.type==="touchmove"&&I.sourceEvent.touches.length>1&&(Y.current=!0),!Y.current){if(!T.current&&M.current&&ne&&(T.current=!0,Z()),!M.current){const se=J.xSnapped-(y?.current?.x??0),S=J.ySnapped-(y?.current?.y??0);Math.sqrt(se*se+S*S)>ee&&X(I)}(y.current.x!==J.xSnapped||y.current.y!==J.ySnapped)&&m.current&&M.current&&(_.current=I.sourceEvent,C.current=Ua(I.sourceEvent,j.current),O(J))}}).on("end",I=>{if(!(!M.current||Y.current)&&(x(!1),T.current=!1,M.current=!1,cancelAnimationFrame(v.current),m.current)){const{updateNodePositions:J,nodeInternals:ne,onNodeDragStop:ee,onSelectionDragStop:se}=g.getState(),S=u?ee:Nd(se);if(J(m.current,!1,!1),S){const[U,k]=jd({nodeId:u,dragItems:m.current,nodeInternals:ne});S(I.sourceEvent,U,k)}}}).filter(I=>{const J=I.target;return!I.button&&(!o||!e0(J,`.${o}`,n))&&(!i||e0(J,i,n))});return R.call(oe),()=>{R.on(".drag",null)}}}},[n,r,o,i,f,g,u,h,L]),p}function Zg(){const n=Nt();return N.useCallback(o=>{const{nodeInternals:i,nodeExtent:u,updateNodePositions:f,getNodes:h,snapToGrid:g,snapGrid:p,onError:x,nodesDraggable:m}=n.getState(),y=h().filter(Y=>Y.selected&&(Y.draggable||m&&typeof Y.draggable>"u")),v=g?p[0]:5,j=g?p[1]:5,C=o.isShiftPressed?4:1,_=o.x*v*C,T=o.y*j*C,M=y.map(Y=>{if(Y.positionAbsolute){const L={x:Y.positionAbsolute.x+_,y:Y.positionAbsolute.y+T};g&&(L.x=p[0]*Math.round(L.x/p[0]),L.y=p[1]*Math.round(L.y/p[1]));const{positionAbsolute:R,position:O}=Gg(Y,L,i,u,void 0,x);Y.position=O,Y.positionAbsolute=R}return Y});f(M,!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:y,onMouseMove:v,onMouseLeave:j,onContextMenu:C,onDoubleClick:_,style:T,className:M,isDraggable:Y,isSelectable:L,isConnectable:R,isFocusable:O,selectNodesOnDrag:Z,sourcePosition:X,targetPosition:oe,hidden:I,resizeObserver:J,dragHandle:ne,zIndex:ee,isParent:se,noDragClassName:S,noPanClassName:U,initialized:k,disableKeyboardA11y:H,ariaLabel:D,rfId:z,hasHandleBounds:E})=>{const $=Nt(),W=N.useRef(null),ae=N.useRef(null),ie=N.useRef(X),he=N.useRef(oe),xe=N.useRef(i),we=L||Y||m||y||v||j,ve=Zg(),Ae=Er(o,$.getState,y),Re=Er(o,$.getState,v),We=Er(o,$.getState,j),Te=Er(o,$.getState,C),ye=Er(o,$.getState,_),q=re=>{const{nodeDragThreshold:P}=$.getState();if(L&&(!Z||!Y||P>0)&&Xd({id:o,store:$,nodeRef:W}),m){const Ee=$.getState().nodeInternals.get(o);Ee&&m(re,{...Ee})}},V=re=>{if(!qd(re)&&!H)if(pg.includes(re.key)&&L){const P=re.key==="Escape";Xd({id:o,store:$,unselect:P,nodeRef:W})}else Y&&x&&Object.prototype.hasOwnProperty.call(xl,re.key)&&($.setState({ariaLiveMessage:`Moved selected node ${re.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~f}, y: ${~~h}`}),ve({x:xl[re.key].x,y:xl[re.key].y,isShiftPressed:re.shiftKey}))};N.useEffect(()=>()=>{ae.current&&(J?.unobserve(ae.current),ae.current=null)},[]),N.useEffect(()=>{if(W.current&&!I){const re=W.current;(!k||!E||ae.current!==re)&&(ae.current&&J?.unobserve(ae.current),J?.observe(re),ae.current=re)}},[I,k,E]),N.useEffect(()=>{const re=xe.current!==i,P=ie.current!==X,Ee=he.current!==oe;W.current&&(re||P||Ee)&&(re&&(xe.current=i),P&&(ie.current=X),Ee&&(he.current=oe),$.getState().updateNodeDimensions([{id:o,nodeElement:W.current,forceUpdate:!0}]))},[o,i,X,oe]);const ue=Xg({nodeRef:W,disabled:I||!Y,noDragClassName:S,handleSelector:ne,nodeId:o,isSelectable:L,selectNodesOnDrag:Z});return I?null:le.createElement("div",{className:Ht(["react-flow__node",`react-flow__node-${i}`,{[U]:Y},M,{selected:x,selectable:L,parent:se,dragging:ue}]),ref:W,style:{zIndex:ee,transform:`translate(${g}px,${p}px)`,pointerEvents:we?"all":"none",visibility:k?"visible":"hidden",...T},"data-id":o,"data-testid":`rf__node-${o}`,onMouseEnter:Ae,onMouseMove:Re,onMouseLeave:We,onContextMenu:Te,onClick:q,onDoubleClick:ye,onKeyDown:O?V:void 0,tabIndex:O?0:void 0,role:O?"button":void 0,"aria-describedby":H?void 0:`${Dg}-${z}`,"aria-label":D},le.createElement(u5,{value:o},le.createElement(n,{id:o,data:u,type:i,xPos:f,yPos:h,selected:x,isConnectable:R,sourcePosition:X,targetPosition:oe,dragging:ue,dragHandle:ne,zIndex:ee})))};return r.displayName="NodeWrapper",N.memo(r)};const I5=n=>{const r=n.getNodes().filter(o=>o.selected);return{...Ki(r,n.nodeOrigin),transformString:`translate(${n.transform[0]}px,${n.transform[1]}px) scale(${n.transform[2]})`,userSelectionActive:n.userSelectionActive}};function F5({onSelectionContextMenu:n,noPanClassName:r,disableKeyboardA11y:o}){const i=Nt(),{width:u,height:f,x:h,y:g,transformString:p,userSelectionActive:x}=tt(I5,Tt),m=Zg(),y=N.useRef(null);if(N.useEffect(()=>{o||y.current?.focus({preventScroll:!0})},[o]),Xg({nodeRef:y}),x||!u||!f)return null;const v=n?C=>{const _=i.getState().getNodes().filter(T=>T.selected);n(C,_)}:void 0,j=C=>{Object.prototype.hasOwnProperty.call(xl,C.key)&&m({x:xl[C.key].x,y:xl[C.key].y,isShiftPressed:C.shiftKey})};return le.createElement("div",{className:Ht(["react-flow__nodesselection","react-flow__container",r]),style:{transform:p}},le.createElement("div",{ref:y,className:"react-flow__nodesselection-rect",onContextMenu:v,tabIndex:o?void 0:-1,onKeyDown:o?void 0:j,style:{width:u,height:f,top:g,left:h}}))}var P5=N.memo(F5);const eS=n=>n.nodesSelectionActive,Wg=({children:n,onPaneClick:r,onPaneMouseEnter:o,onPaneMouseMove:i,onPaneMouseLeave:u,onPaneContextMenu:f,onPaneScroll:h,deleteKeyCode:g,onMove:p,onMoveStart:x,onMoveEnd:m,selectionKeyCode:y,selectionOnDrag:v,selectionMode:j,onSelectionStart:C,onSelectionEnd:_,multiSelectionKeyCode:T,panActivationKeyCode:M,zoomActivationKeyCode:Y,elementsSelectable:L,zoomOnScroll:R,zoomOnPinch:O,panOnScroll:Z,panOnScrollSpeed:X,panOnScrollMode:oe,zoomOnDoubleClick:I,panOnDrag:J,defaultViewport:ne,translateExtent:ee,minZoom:se,maxZoom:S,preventScrolling:U,onSelectionContextMenu:k,noWheelClassName:H,noPanClassName:D,disableKeyboardA11y:z})=>{const E=tt(eS),$=qr(y),W=qr(M),ae=W||J,ie=W||Z,he=$||v&&ae!==!0;return B5({deleteKeyCode:g,multiSelectionKeyCode:T}),le.createElement(V5,{onMove:p,onMoveStart:x,onMoveEnd:m,onPaneContextMenu:f,elementsSelectable:L,zoomOnScroll:R,zoomOnPinch:O,panOnScroll:ie,panOnScrollSpeed:X,panOnScrollMode:oe,zoomOnDoubleClick:I,panOnDrag:!$&&ae,defaultViewport:ne,translateExtent:ee,minZoom:se,maxZoom:S,zoomActivationKeyCode:Y,preventScrolling:U,noWheelClassName:H,noPanClassName:D},le.createElement(Yg,{onSelectionStart:C,onSelectionEnd:_,onPaneClick:r,onPaneMouseEnter:o,onPaneMouseMove:i,onPaneMouseLeave:u,onPaneContextMenu:f,onPaneScroll:h,panOnDrag:ae,isSelecting:!!he,selectionMode:j},n,E&&le.createElement(P5,{onSelectionContextMenu:k,noPanClassName:D,disableKeyboardA11y:z})))};Wg.displayName="FlowRenderer";var tS=N.memo(Wg);function nS(n){return tt(N.useCallback(o=>n?Ng(o.nodeInternals,{x:0,y:0,width:o.width,height:o.height},o.transform,!0):o.getNodes(),[n]))}function aS(n){const r={input:kr(n.input||Ag),default:kr(n.default||Gd),output:kr(n.output||zg),group:kr(n.group||xf)},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 sS=({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]},lS=n=>({nodesDraggable:n.nodesDraggable,nodesConnectable:n.nodesConnectable,nodesFocusable:n.nodesFocusable,elementsSelectable:n.elementsSelectable,updateNodeDimensions:n.updateNodeDimensions,onError:n.onError}),Qg=n=>{const{nodesDraggable:r,nodesConnectable:o,nodesFocusable:i,elementsSelectable:u,updateNodeDimensions:f,onError:h}=tt(lS,Tt),g=nS(n.onlyRenderVisibleElements),p=N.useRef(),x=N.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const m=new ResizeObserver(y=>{const v=y.map(j=>({id:j.target.getAttribute("data-id"),nodeElement:j.target,forceUpdate:!0}));f(v)});return p.current=m,m},[]);return N.useEffect(()=>()=>{p?.current?.disconnect()},[]),le.createElement("div",{className:"react-flow__nodes",style:mf},g.map(m=>{let y=m.type||"default";n.nodeTypes[y]||(h?.("003",sa.error003(y)),y="default");const v=n.nodeTypes[y]||n.nodeTypes.default,j=!!(m.draggable||r&&typeof m.draggable>"u"),C=!!(m.selectable||u&&typeof m.selectable>"u"),_=!!(m.connectable||o&&typeof m.connectable>"u"),T=!!(m.focusable||i&&typeof m.focusable>"u"),M=n.nodeExtent?of(m.positionAbsolute,n.nodeExtent):m.positionAbsolute,Y=M?.x??0,L=M?.y??0,R=sS({x:Y,y:L,width:m.width??0,height:m.height??0,origin:n.nodeOrigin});return le.createElement(v,{key:m.id,id:m.id,className:m.className,style:m.style,type:y,data:m.data,sourcePosition:m.sourcePosition||me.Bottom,targetPosition:m.targetPosition||me.Top,hidden:m.hidden,xPos:Y,yPos:L,xPosOrigin:R.x,yPosOrigin:R.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:j,isSelectable:C,isConnectable:_,isFocusable:T,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})}))};Qg.displayName="NodeRenderer";var rS=N.memo(Qg);const oS=(n,r,o)=>o===me.Left?n-r:o===me.Right?n+r:n,iS=(n,r,o)=>o===me.Top?n-r:o===me.Bottom?n+r:n,n0="react-flow__edgeupdater",a0=({position:n,centerX:r,centerY:o,radius:i=10,onMouseDown:u,onMouseEnter:f,onMouseOut:h,type:g})=>le.createElement("circle",{onMouseDown:u,onMouseEnter:f,onMouseOut:h,className:Ht([n0,`${n0}-${g}`]),cx:oS(r,i,n),cy:iS(o,i,n),r:i,stroke:"transparent",fill:"transparent"}),cS=()=>!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:y,labelShowBg:v,labelBgStyle:j,labelBgPadding:C,labelBgBorderRadius:_,style:T,source:M,target:Y,sourceX:L,sourceY:R,targetX:O,targetY:Z,sourcePosition:X,targetPosition:oe,elementsSelectable:I,hidden:J,sourceHandleId:ne,targetHandleId:ee,onContextMenu:se,onMouseEnter:S,onMouseMove:U,onMouseLeave:k,reconnectRadius:H,onReconnect:D,onReconnectStart:z,onReconnectEnd:E,markerEnd:$,markerStart:W,rfId:ae,ariaLabel:ie,isFocusable:he,isReconnectable:xe,pathOptions:we,interactionWidth:ve,disableKeyboardA11y:Ae})=>{const Re=N.useRef(null),[We,Te]=N.useState(!1),[ye,q]=N.useState(!1),V=Nt(),ue=N.useMemo(()=>`url('#${Yd(W,ae)}')`,[W,ae]),re=N.useMemo(()=>`url('#${Yd($,ae)}')`,[$,ae]);if(J)return null;const P=Ve=>{const{edges:je,addSelectedEdges:Le,unselectNodesAndEdges:Ge,multiSelectionActive:Rt}=V.getState(),Yt=je.find(Jt=>Jt.id===o);Yt&&(I&&(V.setState({nodesSelectionActive:!1}),Yt.selected&&Rt?(Ge({nodes:[],edges:[Yt]}),Re.current?.blur()):Le([o])),h&&h(Ve,Yt))},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:M,Yt=(je?ee:ne)||null,Jt=je?"target":"source",jl=Ge||cS,bs=je,la=Le.find(Dn=>Dn.id===o);q(!0),z?.(Ve,la,Jt);const Ya=Dn=>{q(!1),E?.(Dn,la,Jt)};_g({event:Ve,handleId:Yt,nodeId:Rt,onConnect:Dn=>D?.(la,Dn),isTarget:bs,getState:V.getState,setState:V.setState,isValidConnection:jl,edgeUpdaterType:Jt,onReconnectEnd:Ya})},At=Ve=>Mt(Ve,!0),dt=Ve=>Mt(Ve,!1),nt=()=>Te(!0),xt=()=>Te(!1),at=!I&&!h,pe=Ve=>{if(!Ae&&pg.includes(Ve.key)&&I){const{unselectNodesAndEdges:je,addSelectedEdges:Le,edges:Ge}=V.getState();Ve.key==="Escape"?(Re.current?.blur(),je({edges:[Ge.find(Yt=>Yt.id===o)]})):Le([o])}};return le.createElement("g",{className:Ht(["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 ${M} to ${Y}`,"aria-describedby":he?`${Hg}-${ae}`:void 0,ref:Re},!ye&&le.createElement(n,{id:o,source:M,target:Y,selected:p,animated:x,label:m,labelStyle:y,labelShowBg:v,labelBgStyle:j,labelBgPadding:C,labelBgBorderRadius:_,data:f,style:T,sourceX:L,sourceY:R,targetX:O,targetY:Z,sourcePosition:X,targetPosition:oe,sourceHandleId:ne,targetHandleId:ee,markerStart:ue,markerEnd:re,pathOptions:we,interactionWidth:ve}),xe&&le.createElement(le.Fragment,null,(xe==="source"||xe===!0)&&le.createElement(a0,{position:X,centerX:L,centerY:R,radius:H,onMouseDown:At,onMouseEnter:nt,onMouseOut:xt,type:"source"}),(xe==="target"||xe===!0)&&le.createElement(a0,{position:oe,centerX:O,centerY:Z,radius:H,onMouseDown:dt,onMouseEnter:nt,onMouseOut:xt,type:"target"})))};return r.displayName="EdgeWrapper",N.memo(r)};function uS(n){const r={default:sl(n.default||qi),straight:sl(n.bezier||df),step:sl(n.step||uf),smoothstep:sl(n.step||Qi),simplebezier:sl(n.simplebezier||cf)},o={},i=Object.keys(n).filter(u=>!["default","bezier"].includes(u)).reduce((u,f)=>(u[f]=sl(n[f]||qi),u),o);return{...r,...i}}function s0(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 l0(n,r){return n?n.length===1||!r?n[0]:r&&n.find(o=>o.id===r)||null:null}const dS=(n,r,o,i,u,f)=>{const h=s0(o,n,r),g=s0(f,i,u);return{sourceX:h.x,sourceY:h.y,targetX:g.x,targetY:g.y}};function fS({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=Ur({x:(0-p[0])/p[2],y:(0-p[1])/p[2],width:h/p[2],height:g/p[2]}),y=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(y*v)>0}function r0(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 hS=[{level:0,isMaxLevel:!0,edges:[]}];function xS(n,r,o=!1){let i=-1;const u=n.reduce((h,g)=>{const p=bn(g.zIndex);let x=p?g.zIndex:0;if(o){const m=r.get(g.target),y=r.get(g.source),v=g.selected||m?.selected||y?.selected,j=Math.max(y?.[ut]?.z||0,m?.[ut]?.z||0,1e3);x=(p?g.zIndex:0)+(v?j: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?hS:f}function pS(n,r,o){const i=tt(N.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&&fS({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 xS(i,r,o)}const mS=({color:n="none",strokeWidth:r=1})=>le.createElement("polyline",{style:{stroke:n,strokeWidth:r},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),gS=({color:n="none",strokeWidth:r=1})=>le.createElement("polyline",{style:{stroke:n,fill:n,strokeWidth:r},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),o0={[Ba.Arrow]:mS,[Ba.ArrowClosed]:gS};function bS(n){const r=Nt();return N.useMemo(()=>Object.prototype.hasOwnProperty.call(o0,n)?o0[n]:(r.getState().onError?.("009",sa.error009(n)),null),[n])}const yS=({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=bS(r);return p?le.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"},le.createElement(p,{color:o,strokeWidth:h})):null},vS=({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))},Kg=({defaultColor:n,rfId:r})=>{const o=tt(N.useCallback(vS({defaultColor:n,rfId:r}),[n,r]),(i,u)=>!(i.length!==u.length||i.some((f,h)=>f.id!==u[h].id)));return le.createElement("defs",null,o.map(i=>le.createElement(yS,{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})))};Kg.displayName="MarkerDefinitions";var jS=N.memo(Kg);const NS=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}),Jg=({defaultMarkerColor:n,onlyRenderVisibleElements:r,elevateEdgesOnSelect:o,rfId:i,edgeTypes:u,noPanClassName:f,onEdgeContextMenu:h,onEdgeMouseEnter:g,onEdgeMouseMove:p,onEdgeMouseLeave:x,onEdgeClick:m,onEdgeDoubleClick:y,onReconnect:v,onReconnectStart:j,onReconnectEnd:C,reconnectRadius:_,children:T,disableKeyboardA11y:M})=>{const{edgesFocusable:Y,edgesUpdatable:L,elementsSelectable:R,width:O,height:Z,connectionMode:X,nodeInternals:oe,onError:I}=tt(NS,Tt),J=pS(r,oe,o);return O?le.createElement(le.Fragment,null,J.map(({level:ne,edges:ee,isMaxLevel:se})=>le.createElement("svg",{key:ne,style:{zIndex:ne},width:O,height:Z,className:"react-flow__edges react-flow__container"},se&&le.createElement(jS,{defaultColor:n,rfId:i}),le.createElement("g",null,ee.map(S=>{const[U,k,H]=r0(oe.get(S.source)),[D,z,E]=r0(oe.get(S.target));if(!H||!E)return null;let $=S.type||"default";u[$]||(I?.("011",sa.error011($)),$="default");const W=u[$]||u.default,ae=X===xs.Strict?z.target:(z.target??[]).concat(z.source??[]),ie=l0(k.source,S.sourceHandle),he=l0(ae,S.targetHandle),xe=ie?.position||me.Bottom,we=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",sa.error008(ie,S)),null;const{sourceX:We,sourceY:Te,targetX:ye,targetY:q}=dS(U,ie,xe,D,he,we);return le.createElement(W,{key:S.id,id:S.id,className:Ht([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:ye,targetY:q,sourcePosition:xe,targetPosition:we,elementsSelectable:R,onContextMenu:h,onMouseEnter:g,onMouseMove:p,onMouseLeave:x,onClick:m,onEdgeDoubleClick:y,onReconnect:v,onReconnectStart:j,onReconnectEnd:C,reconnectRadius:_,rfId:i,ariaLabel:S.ariaLabel,isFocusable:ve,isReconnectable:Re,pathOptions:"pathOptions"in S?S.pathOptions:void 0,interactionWidth:S.interactionWidth,disableKeyboardA11y:M})})))),T):null};Jg.displayName="EdgeRenderer";var wS=N.memo(Jg);const SS=n=>`translate(${n.transform[0]}px,${n.transform[1]}px) scale(${n.transform[2]})`;function ES({children:n}){const r=tt(SS);return le.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:r}},n)}function kS(n){const r=pf(),o=N.useRef(!1);N.useEffect(()=>{!o.current&&r.viewportInitialized&&n&&(setTimeout(()=>n(r),1),o.current=!0)},[n,r.viewportInitialized])}const _S={[me.Left]:me.Right,[me.Right]:me.Left,[me.Top]:me.Bottom,[me.Bottom]:me.Top},Ig=({nodeId:n,handleType:r,style:o,type:i=$a.Bezier,CustomComponent:u,connectionStatus:f})=>{const{fromNode:h,handleId:g,toX:p,toY:x,connectionMode:m}=tt(N.useCallback(Z=>({fromNode:Z.nodeInternals.get(n),handleId:Z.connectionHandleId,toX:(Z.connectionPosition.x-Z.transform[0])/Z.transform[2],toY:(Z.connectionPosition.y-Z.transform[1])/Z.transform[2],connectionMode:Z.connectionMode}),[n]),Tt),y=h?.[ut]?.handleBounds;let v=y?.[r];if(m===xs.Loose&&(v=v||y?.[r==="source"?"target":"source"]),!h||!v)return null;const j=g?v.find(Z=>Z.id===g):v[0],C=j?j.x+j.width/2:(h.width??0)/2,_=j?j.y+j.height/2:h.height??0,T=(h.positionAbsolute?.x??0)+C,M=(h.positionAbsolute?.y??0)+_,Y=j?.position,L=Y?_S[Y]:null;if(!Y||!L)return null;if(u)return le.createElement(u,{connectionLineType:i,connectionLineStyle:o,fromNode:h,fromHandle:j,fromX:T,fromY:M,toX:p,toY:x,fromPosition:Y,toPosition:L,connectionStatus:f});let R="";const O={sourceX:T,sourceY:M,sourcePosition:Y,targetX:p,targetY:x,targetPosition:L};return i===$a.Bezier?[R]=vg(O):i===$a.Step?[R]=Ld({...O,borderRadius:0}):i===$a.SmoothStep?[R]=Ld(O):i===$a.SimpleBezier?[R]=yg(O):R=`M${T},${M} ${p},${x}`,le.createElement("path",{d:R,fill:"none",className:"react-flow__connection-path",style:o})};Ig.displayName="ConnectionLine";const CS=n=>({nodeId:n.connectionNodeId,handleType:n.connectionHandleType,nodesConnectable:n.nodesConnectable,connectionStatus:n.connectionStatus,width:n.width,height:n.height});function TS({containerStyle:n,style:r,type:o,component:i}){const{nodeId:u,handleType:f,nodesConnectable:h,width:g,height:p,connectionStatus:x}=tt(CS,Tt);return!(u&&f&&g&&h)?null:le.createElement("svg",{style:n,width:g,height:p,className:"react-flow__edges react-flow__connectionline react-flow__container"},le.createElement("g",{className:Ht(["react-flow__connection",x])},le.createElement(Ig,{nodeId:u,handleType:f,style:r,type:o,CustomComponent:i,connectionStatus:x})))}function i0(n,r){return N.useRef(null),Nt(),N.useMemo(()=>r(n),[n])}const Fg=({nodeTypes:n,edgeTypes:r,onMove:o,onMoveStart:i,onMoveEnd:u,onInit:f,onNodeClick:h,onEdgeClick:g,onNodeDoubleClick:p,onEdgeDoubleClick:x,onNodeMouseEnter:m,onNodeMouseMove:y,onNodeMouseLeave:v,onNodeContextMenu:j,onSelectionContextMenu:C,onSelectionStart:_,onSelectionEnd:T,connectionLineType:M,connectionLineStyle:Y,connectionLineComponent:L,connectionLineContainerStyle:R,selectionKeyCode:O,selectionOnDrag:Z,selectionMode:X,multiSelectionKeyCode:oe,panActivationKeyCode:I,zoomActivationKeyCode:J,deleteKeyCode:ne,onlyRenderVisibleElements:ee,elementsSelectable:se,selectNodesOnDrag:S,defaultViewport:U,translateExtent:k,minZoom:H,maxZoom:D,preventScrolling:z,defaultMarkerColor:E,zoomOnScroll:$,zoomOnPinch:W,panOnScroll:ae,panOnScrollSpeed:ie,panOnScrollMode:he,zoomOnDoubleClick:xe,panOnDrag:we,onPaneClick:ve,onPaneMouseEnter:Ae,onPaneMouseMove:Re,onPaneMouseLeave:We,onPaneScroll:Te,onPaneContextMenu:ye,onEdgeContextMenu:q,onEdgeMouseEnter:V,onEdgeMouseMove:ue,onEdgeMouseLeave:re,onReconnect:P,onReconnectStart:Ee,onReconnectEnd:ge,reconnectRadius:ke,noDragClassName:Oe,noWheelClassName:ze,noPanClassName:Mt,elevateEdgesOnSelect:At,disableKeyboardA11y:dt,nodeOrigin:nt,nodeExtent:xt,rfId:at})=>{const pe=i0(n,aS),Ve=i0(r,uS);return kS(f),le.createElement(tS,{onPaneClick:ve,onPaneMouseEnter:Ae,onPaneMouseMove:Re,onPaneMouseLeave:We,onPaneContextMenu:ye,onPaneScroll:Te,deleteKeyCode:ne,selectionKeyCode:O,selectionOnDrag:Z,selectionMode:X,onSelectionStart:_,onSelectionEnd:T,multiSelectionKeyCode:oe,panActivationKeyCode:I,zoomActivationKeyCode:J,elementsSelectable:se,onMove:o,onMoveStart:i,onMoveEnd:u,zoomOnScroll:$,zoomOnPinch:W,zoomOnDoubleClick:xe,panOnScroll:ae,panOnScrollSpeed:ie,panOnScrollMode:he,panOnDrag:we,defaultViewport:U,translateExtent:k,minZoom:H,maxZoom:D,onSelectionContextMenu:C,preventScrolling:z,noDragClassName:Oe,noWheelClassName:ze,noPanClassName:Mt,disableKeyboardA11y:dt},le.createElement(ES,null,le.createElement(wS,{edgeTypes:Ve,onEdgeClick:g,onEdgeDoubleClick:x,onlyRenderVisibleElements:ee,onEdgeContextMenu:q,onEdgeMouseEnter:V,onEdgeMouseMove:ue,onEdgeMouseLeave:re,onReconnect:P,onReconnectStart:Ee,onReconnectEnd:ge,reconnectRadius:ke,defaultMarkerColor:E,noPanClassName:Mt,elevateEdgesOnSelect:!!At,disableKeyboardA11y:dt,rfId:at},le.createElement(TS,{style:Y,type:M,component:L,containerStyle:R})),le.createElement("div",{className:"react-flow__edgelabel-renderer"}),le.createElement(rS,{nodeTypes:pe,onNodeClick:h,onNodeDoubleClick:p,onNodeMouseEnter:m,onNodeMouseMove:y,onNodeMouseLeave:v,onNodeContextMenu:j,selectNodesOnDrag:S,onlyRenderVisibleElements:ee,noPanClassName:Mt,noDragClassName:Oe,disableKeyboardA11y:dt,nodeOrigin:nt,nodeExtent:xt,rfId:at})))};Fg.displayName="GraphView";var MS=N.memo(Fg);const Zd=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Oa={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:xs.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:s5,isValidConnection:void 0},AS=()=>y2((n,r)=>({...Oa,setNodes:o=>{const{nodeInternals:i,nodeOrigin:u,elevateNodesOnSelect:f}=r();n({nodeInternals:yd(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?yd(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 y=window.getComputedStyle(m),{m22:v}=new window.DOMMatrixReadOnly(y.transform),j=o.reduce((_,T)=>{const M=u.get(T.id);if(M?.hidden)u.set(M.id,{...M,[ut]:{...M[ut],handleBounds:void 0}});else if(M){const Y=rf(T.nodeElement);!!(Y.width&&Y.height&&(M.width!==Y.width||M.height!==Y.height||T.forceUpdate))&&(u.set(M.id,{...M,[ut]:{...M[ut],handleBounds:{source:t0(".source",T.nodeElement,v,x),target:t0(".target",T.nodeElement,v,x)}},...Y}),_.push({id:M.id,type:"dimensions",dimensions:Y}))}return _},[]);Ug(u,x);const C=h||f&&!h&&Bg(r,{initial:!0,...g});n({nodeInternals:new Map(u),fitViewOnInitDone:C}),j?.length>0&&i?.(j)},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=Lg(o,g()),m=yd(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=>Ha(p,!0)):(h=cl(f(),o),g=cl(u,[])),ji({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=>Ha(p,!0)):(h=cl(u,o),g=cl(f(),[])),ji({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,Ha(m.id,!1))),x=g.map(m=>Ha(m.id,!1));ji({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=>Ha(g.id,!1)),h=o.filter(g=>g.selected).map(g=>Ha(g.id,!1));ji({changedNodes:f,changedEdges:h,get:r,set:n})},setNodeExtent:o=>{const{nodeInternals:i}=r();i.forEach(u=>{u.positionAbsolute=of(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]],y=h?.constrain()(x,m,p);return h.transform(g,y),i[0]!==y.x||i[1]!==y.y||i[2]!==y.k},cancelConnection:()=>n({connectionNodeId:Oa.connectionNodeId,connectionHandleId:Oa.connectionHandleId,connectionHandleType:Oa.connectionHandleType,connectionStatus:Oa.connectionStatus,connectionStartHandle:Oa.connectionStartHandle,connectionEndHandle:Oa.connectionEndHandle}),reset:()=>n({...Oa})}),Object.is),Pg=({children:n})=>{const r=N.useRef(null);return r.current||(r.current=AS()),le.createElement(Iw,{value:r.current},n)};Pg.displayName="ReactFlowProvider";const eb=({children:n})=>N.useContext(Wi)?le.createElement(le.Fragment,null,n):le.createElement(Pg,null,n);eb.displayName="ReactFlowWrapper";const RS={input:Ag,default:Gd,output:zg,group:xf},zS={default:qi,straight:df,step:uf,smoothstep:Qi,simplebezier:cf},OS=[0,0],DS=[15,15],HS={x:0,y:0,zoom:1},$S={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},gf=N.forwardRef(({nodes:n,edges:r,defaultNodes:o,defaultEdges:i,className:u,nodeTypes:f=RS,edgeTypes:h=zS,onNodeClick:g,onEdgeClick:p,onInit:x,onMove:m,onMoveStart:y,onMoveEnd:v,onConnect:j,onConnectStart:C,onConnectEnd:_,onClickConnectStart:T,onClickConnectEnd:M,onNodeMouseEnter:Y,onNodeMouseMove:L,onNodeMouseLeave:R,onNodeContextMenu:O,onNodeDoubleClick:Z,onNodeDragStart:X,onNodeDrag:oe,onNodeDragStop:I,onNodesDelete:J,onEdgesDelete:ne,onSelectionChange:ee,onSelectionDragStart:se,onSelectionDrag:S,onSelectionDragStop:U,onSelectionContextMenu:k,onSelectionStart:H,onSelectionEnd:D,connectionMode:z=xs.Strict,connectionLineType:E=$a.Bezier,connectionLineStyle:$,connectionLineComponent:W,connectionLineContainerStyle:ae,deleteKeyCode:ie="Backspace",selectionKeyCode:he="Shift",selectionOnDrag:xe=!1,selectionMode:we=Br.Full,panActivationKeyCode:ve="Space",multiSelectionKeyCode:Ae=Bi()?"Meta":"Control",zoomActivationKeyCode:Re=Bi()?"Meta":"Control",snapToGrid:We=!1,snapGrid:Te=DS,onlyRenderVisibleElements:ye=!1,selectNodesOnDrag:q=!0,nodesDraggable:V,nodesConnectable:ue,nodesFocusable:re,nodeOrigin:P=OS,edgesFocusable:Ee,edgesUpdatable:ge,elementsSelectable:ke,defaultViewport:Oe=HS,minZoom:ze=.5,maxZoom:Mt=2,translateExtent:At=Zd,preventScrolling:dt=!0,nodeExtent:nt,defaultMarkerColor:xt="#b1b1b7",zoomOnScroll:at=!0,zoomOnPinch:pe=!0,panOnScroll:Ve=!1,panOnScrollSpeed:je=.5,panOnScrollMode:Le=us.Free,zoomOnDoubleClick:Ge=!0,panOnDrag:Rt=!0,onPaneClick:Yt,onPaneMouseEnter:Jt,onPaneMouseMove:jl,onPaneMouseLeave:bs,onPaneScroll:la,onPaneContextMenu:Ya,children:ra,onEdgeContextMenu:Dn,onEdgeDoubleClick:Wr,onEdgeMouseEnter:Qr,onEdgeMouseMove:Nl,onEdgeMouseLeave:wl,onEdgeUpdate:Kr,onEdgeUpdateStart:Ji,onEdgeUpdateEnd:_n,onReconnect:wt,onReconnectStart:$t,onReconnectEnd:oa,reconnectRadius:Sl=10,edgeUpdaterRadius:Ii=10,onNodesChange:Fi,onEdgesChange:Jr,noDragClassName:Va="nodrag",noWheelClassName:El="nowheel",noPanClassName:Hn="nopan",fitView:ia=!1,fitViewOptions:Ga,connectOnClick:ca=!0,attributionPosition:pt,proOptions:Ir,defaultEdgeOptions:Fr,elevateNodesOnSelect:$n=!0,elevateEdgesOnSelect:ua=!1,disableKeyboardA11y:Pr=!1,autoPanOnConnect:eo=!0,autoPanOnNodeDrag:to=!0,connectionRadius:Pi=20,isValidConnection:ys,onError:vs,style:yn,id:js,nodeDragThreshold:no,...da},kl)=>{const Xa=js||"1";return le.createElement("div",{...da,style:{...yn,...$S},ref:kl,className:Ht(["react-flow",u]),"data-testid":"rf__wrapper",id:js},le.createElement(eb,null,le.createElement(MS,{onInit:x,onMove:m,onMoveStart:y,onMoveEnd:v,onNodeClick:g,onEdgeClick:p,onNodeMouseEnter:Y,onNodeMouseMove:L,onNodeMouseLeave:R,onNodeContextMenu:O,onNodeDoubleClick:Z,nodeTypes:f,edgeTypes:h,connectionLineType:E,connectionLineStyle:$,connectionLineComponent:W,connectionLineContainerStyle:ae,selectionKeyCode:he,selectionOnDrag:xe,selectionMode:we,deleteKeyCode:ie,multiSelectionKeyCode:Ae,panActivationKeyCode:ve,zoomActivationKeyCode:Re,onlyRenderVisibleElements:ye,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:Yt,onPaneMouseEnter:Jt,onPaneMouseMove:jl,onPaneMouseLeave:bs,onPaneScroll:la,onPaneContextMenu:Ya,onSelectionContextMenu:k,onSelectionStart:H,onSelectionEnd:D,onEdgeContextMenu:Dn,onEdgeDoubleClick:Wr,onEdgeMouseEnter:Qr,onEdgeMouseMove:Nl,onEdgeMouseLeave:wl,onReconnect:wt??Kr,onReconnectStart:$t??Ji,onReconnectEnd:oa??_n,reconnectRadius:Sl??Ii,defaultMarkerColor:xt,noDragClassName:Va,noWheelClassName:El,noPanClassName:Hn,elevateEdgesOnSelect:ua,rfId:Xa,disableKeyboardA11y:Pr,nodeOrigin:P,nodeExtent:nt}),le.createElement(_5,{nodes:n,edges:r,defaultNodes:o,defaultEdges:i,onConnect:j,onConnectStart:C,onConnectEnd:_,onClickConnectStart:T,onClickConnectEnd:M,nodesDraggable:V,nodesConnectable:ue,nodesFocusable:re,edgesFocusable:Ee,edgesUpdatable:ge,elementsSelectable:ke,elevateNodesOnSelect:$n,minZoom:ze,maxZoom:Mt,nodeExtent:nt,onNodesChange:Fi,onEdgesChange:Jr,snapToGrid:We,snapGrid:Te,connectionMode:z,translateExtent:At,connectOnClick:ca,defaultEdgeOptions:Fr,fitView:ia,fitViewOptions:Ga,onNodesDelete:J,onEdgesDelete:ne,onNodeDragStart:X,onNodeDrag:oe,onNodeDragStop:I,onSelectionDrag:S,onSelectionDragStart:se,onSelectionDragStop:U,noPanClassName:Hn,nodeOrigin:P,rfId:Xa,autoPanOnConnect:eo,autoPanOnNodeDrag:to,onError:vs,connectionRadius:Pi,isValidConnection:ys,nodeDragThreshold:no}),le.createElement(E5,{onSelectionChange:ee}),ra,le.createElement(Pw,{proOptions:Ir,position:pt}),le.createElement(R5,{rfId:Xa,disableKeyboardA11y:Pr})))});gf.displayName="ReactFlow";function tb(n){return r=>{const[o,i]=N.useState(r),u=N.useCallback(f=>i(h=>n(f,h)),[]);return[o,i,u]}}const nb=tb(Lg),ab=tb(Z5),sb=({id:n,x:r,y:o,width:i,height:u,style:f,color:h,strokeColor:g,strokeWidth:p,className:x,borderRadius:m,shapeRendering:y,onClick:v,selected:j})=>{const{background:C,backgroundColor:_}=f||{},T=h||C||_;return le.createElement("rect",{className:Ht(["react-flow__minimap-node",{selected:j},x]),x:r,y:o,rx:m,ry:m,width:i,height:u,fill:T,stroke:g,strokeWidth:p,shapeRendering:y,onClick:v?M=>v(M,n):void 0})};sb.displayName="MiniMapNode";var US=N.memo(sb);const BS=n=>n.nodeOrigin,qS=n=>n.getNodes().filter(r=>!r.hidden&&r.width&&r.height),wd=n=>n instanceof Function?n:()=>n;function LS({nodeStrokeColor:n="transparent",nodeColor:r="#e2e2e2",nodeClassName:o="",nodeBorderRadius:i=5,nodeStrokeWidth:u=2,nodeComponent:f=US,onClick:h}){const g=tt(qS,Tt),p=tt(BS),x=wd(r),m=wd(n),y=wd(o),v=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return le.createElement(le.Fragment,null,g.map(j=>{const{x:C,y:_}=fs(j,p).positionAbsolute;return le.createElement(f,{key:j.id,x:C,y:_,width:j.width,height:j.height,style:j.style,selected:j.selected,className:y(j),color:x(j),borderRadius:i,strokeColor:m(j),strokeWidth:u,shapeRendering:v,onClick:h,id:j.id})}))}var YS=N.memo(LS);const VS=200,GS=150,XS=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?n5(Ki(r,n.nodeOrigin),o):o,rfId:n.rfId}},ZS="react-flow__minimap-desc";function lb({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:y="bottom-right",onClick:v,onNodeClick:j,pannable:C=!1,zoomable:_=!1,ariaLabel:T="React Flow mini map",inversePan:M=!1,zoomStep:Y=10,offsetScale:L=5}){const R=Nt(),O=N.useRef(null),{boundingRect:Z,viewBB:X,rfId:oe}=tt(XS,Tt),I=n?.width??VS,J=n?.height??GS,ne=Z.width/I,ee=Z.height/J,se=Math.max(ne,ee),S=se*I,U=se*J,k=L*se,H=Z.x-(S-Z.width)/2-k,D=Z.y-(U-Z.height)/2-k,z=S+k*2,E=U+k*2,$=`${ZS}-${oe}`,W=N.useRef(0);W.current=se,N.useEffect(()=>{if(O.current){const he=gn(O.current),xe=Ae=>{const{transform:Re,d3Selection:We,d3Zoom:Te}=R.getState();if(Ae.sourceEvent.type!=="wheel"||!We||!Te)return;const ye=-Ae.sourceEvent.deltaY*(Ae.sourceEvent.deltaMode===1?.05:Ae.sourceEvent.deltaMode?1:.002)*Y,q=Re[2]*Math.pow(2,ye);Te.scaleTo(We,q)},we=Ae=>{const{transform:Re,d3Selection:We,d3Zoom:Te,translateExtent:ye,width:q,height:V}=R.getState();if(Ae.sourceEvent.type!=="mousemove"||!We||!Te)return;const ue=W.current*Math.max(1,Re[2])*(M?-1:1),re={x:Re[0]-Ae.sourceEvent.movementX*ue,y:Re[1]-Ae.sourceEvent.movementY*ue},P=[[0,0],[q,V]],Ee=ta.translate(re.x,re.y).scale(Re[2]),ge=Te.constrain()(Ee,P,ye);Te.transform(We,ge)},ve=cg().on("zoom",C?we:null).on("zoom.wheel",_?xe:null);return he.call(ve),()=>{he.on("zoom",null)}}},[C,_,M,Y]);const ae=v?he=>{const xe=Sn(he);v(he,{x:xe[0],y:xe[1]})}:void 0,ie=j?(he,xe)=>{const we=R.getState().nodeInternals.get(xe);j(he,we)}:void 0;return le.createElement(lf,{position:y,style:n,className:Ht(["react-flow__minimap",r]),"data-testid":"rf__minimap"},le.createElement("svg",{width:I,height:J,viewBox:`${H} ${D} ${z} ${E}`,role:"img","aria-labelledby":$,ref:O,onClick:ae},T&&le.createElement("title",{id:$},T),le.createElement(YS,{onClick:ie,nodeColor:i,nodeStrokeColor:o,nodeBorderRadius:f,nodeClassName:u,nodeStrokeWidth:h,nodeComponent:g}),le.createElement("path",{className:"react-flow__minimap-mask",d:`M${H-k},${D-k}h${z+k*2}v${E+k*2}h${-z-k*2}z
|
|
366
|
-
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"})))}lb.displayName="MiniMap";var WS=N.memo(lb);function QS(){return le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},le.createElement("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"}))}function KS(){return le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},le.createElement("path",{d:"M0 0h32v4.2H0z"}))}function JS(){return le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},le.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 IS(){return le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},le.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 FS(){return le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},le.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})=>le.createElement("button",{type:"button",className:Ht(["react-flow__controls-button",r]),...o},n);Mr.displayName="ControlButton";const PS=n=>({isInteractive:n.nodesDraggable||n.nodesConnectable||n.elementsSelectable,minZoomReached:n.transform[2]<=n.minZoom,maxZoomReached:n.transform[2]>=n.maxZoom}),rb=({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:y="bottom-left"})=>{const v=Nt(),[j,C]=N.useState(!1),{isInteractive:_,minZoomReached:T,maxZoomReached:M}=tt(PS,Tt),{zoomIn:Y,zoomOut:L,fitView:R}=pf();if(N.useEffect(()=>{C(!0)},[]),!j)return null;const O=()=>{Y(),f?.()},Z=()=>{L(),h?.()},X=()=>{R(u),g?.()},oe=()=>{v.setState({nodesDraggable:!_,nodesConnectable:!_,elementsSelectable:!_}),p?.(!_)};return le.createElement(lf,{className:Ht(["react-flow__controls",x]),position:y,style:n,"data-testid":"rf__controls"},r&&le.createElement(le.Fragment,null,le.createElement(Mr,{onClick:O,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:M},le.createElement(QS,null)),le.createElement(Mr,{onClick:Z,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:T},le.createElement(KS,null))),o&&le.createElement(Mr,{className:"react-flow__controls-fitview",onClick:X,title:"fit view","aria-label":"fit view"},le.createElement(JS,null)),i&&le.createElement(Mr,{className:"react-flow__controls-interactive",onClick:oe,title:"toggle interactivity","aria-label":"toggle interactivity"},_?le.createElement(FS,null):le.createElement(IS,null)),m)};rb.displayName="Controls";var ob=N.memo(rb),ln;(function(n){n.Lines="lines",n.Dots="dots",n.Cross="cross"})(ln||(ln={}));function e3({color:n,dimensions:r,lineWidth:o}){return le.createElement("path",{stroke:n,strokeWidth:o,d:`M${r[0]/2} 0 V${r[1]} M0 ${r[1]/2} H${r[0]}`})}function t3({color:n,radius:r}){return le.createElement("circle",{cx:r,cy:r,r,fill:n})}const n3={[ln.Dots]:"#91919a",[ln.Lines]:"#eee",[ln.Cross]:"#e2e2e2"},a3={[ln.Dots]:1,[ln.Lines]:1,[ln.Cross]:6},s3=n=>({transform:n.transform,patternId:`pattern-${n.rfId}`});function ib({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=N.useRef(null),{transform:m,patternId:y}=tt(s3,Tt),v=h||n3[r],j=i||a3[r],C=r===ln.Dots,_=r===ln.Cross,T=Array.isArray(o)?o:[o,o],M=[T[0]*m[2]||1,T[1]*m[2]||1],Y=j*m[2],L=_?[Y,Y]:M,R=C?[Y/f,Y/f]:[L[0]/f,L[1]/f];return le.createElement("svg",{className:Ht(["react-flow__background",p]),style:{...g,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:x,"data-testid":"rf__background"},le.createElement("pattern",{id:y+n,x:m[0]%M[0],y:m[1]%M[1],width:M[0],height:M[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${R[0]},-${R[1]})`},C?le.createElement(t3,{color:v,radius:Y/f}):le.createElement(e3,{dimensions:L,color:v,lineWidth:u})),le.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${y+n})`}))}ib.displayName="Background";var cb=N.memo(ib);const c0={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 c0[n.toUpperCase()]??c0.GET}const u0=["exists","not_exists","is_empty","is_not_empty"];function d0(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 l3(n,r){const o=d0(n.left,r),i=n.right!==void 0?d0(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 r3(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:l3(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 o3(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 i3({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 c3(){const n=await fetch("/api/workflows");if(!n.ok)throw new Error(`HTTP ${n.status}`);return n.json()}async function u3(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 f0=/\{\{\s*human:([^}]+?)\s*\}\}/g;function yf(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;f0.lastIndex=0;let i;for(;(i=f0.exec(o))!==null;){const u=i[1].trim();u&&r.add(u)}}return[...r]}function d3(n){const r=new Set;return n.forEach(o=>yf(o).forEach(i=>r.add(i))),[...r]}function f3(n){return/pass|secret|token|pwd|private|credential/i.test(n)}function h3({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(Rr,{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:f3(m.key)?"password":"text",value:i[m.key]??"",onChange:y=>u(m.key,y.target.value),onKeyDown:y=>{y.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(jt,{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 ub=230,Wd=64;function x3({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:ub,height:Wd},children:[s.jsx(vt,{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(jt,{className:"h-3.5 w-3.5 text-emerald-400",strokeWidth:2}),u==="failed"&&s.jsx(Lt,{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(vt,{type:"source",position:me.Bottom,style:{background:"transparent",border:"none"}})]})}function p3({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(vt,{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(vt,{type:"source",position:me.Bottom,style:{background:"transparent",border:"none"}})]})}const m3={step:x3,condition:p3};function g3({steps:n,runState:r}){const[o,i,u]=nb([]),[f,h,g]=ab([]);N.useEffect(()=>{const v=[],j=[];let C=40;for(let _=0;_<n.length;_++){const T=n[_],M=r.stepStatuses[_]??"idle",Y=r.stepResults[_]??null;if(v.push({id:`step-${_}`,type:"step",position:{x:0,y:C},data:{index:_,name:T.name,method:T.method,path:T.path,status:M,result:Y}}),C+=Wd+36,T.condition){const L=`cond-${_}`,R=Y?.conditionResult;v.push({id:L,type:"condition",position:{x:ub/2-20,y:C},data:{passed:R?.passed}});const O=M==="passed"?"rgba(52,211,153,0.3)":M==="failed"?"rgba(248,113,113,0.3)":"rgba(96,165,250,0.18)";if(j.push({id:`e-${_}-cond`,source:`step-${_}`,target:L,style:{stroke:O,strokeWidth:1.5},markerEnd:{type:Ba.ArrowClosed,color:O},animated:M==="running"}),C+=64,_<n.length-1){const Z=R?.passed===!0?"rgba(52,211,153,0.5)":"rgba(96,165,250,0.18)",X=R?.passed===!1?"rgba(248,113,113,0.5)":"rgba(96,165,250,0.1)";j.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:Z,strokeWidth:1.2},markerEnd:{type:Ba.ArrowClosed,color:Z}}),j.push({id:`e-${_}-cond-fail`,source:L,target:`step-${_+1}`,label:`FAIL→${T.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(T.capture??{}),R=L.length>0?L.map(X=>X.split(":").pop()).join(", "):void 0,O=r.stepStatuses[_]??"idle",Z=O==="passed"?"rgba(52,211,153,0.3)":O==="failed"?"rgba(248,113,113,0.3)":"rgba(96,165,250,0.18)";j.push({id:`e-${_}`,source:`step-${_}`,target:`step-${_+1}`,label:R,labelStyle:{fill:"rgba(96,165,250,0.7)",fontSize:9,fontFamily:"monospace"},labelBgStyle:{fill:"transparent"},style:{stroke:Z,strokeWidth:1.5,strokeDasharray:O==="idle"||O==="running"?"5 5":void 0},markerEnd:{type:Ba.ArrowClosed,color:O==="passed"?"rgba(52,211,153,0.4)":"rgba(96,165,250,0.3)"},animated:O==="running"})}}i(v),h(j)},[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(gf,{nodes:o,edges:f,onNodesChange:u,onEdgesChange:g,nodeTypes:m3,fitView:!0,fitViewOptions:{padding:.3},proOptions:{hideAttribution:!0},minZoom:.3,maxZoom:2,children:[s.jsx(cb,{variant:ln.Dots,gap:20,size:1,color:"var(--border)"}),s.jsx(ob,{showInteractive:!1,style:{background:"var(--bg-overlay)",border:"1px solid var(--border)"}})]})})}function b3({runState:n,steps:r,waitingStepIndex:o}){const i=N.useRef(null);return N.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(jt,{className:"h-3 w-3 text-emerald-400",strokeWidth:2}),n.phase==="aborted"&&s.jsx(Lt,{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}}}`," ← ",db[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 y3=[{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 h0(){return{left:"",operator:"equals",right:""}}function v3({stepIndex:n,existingCondition:r,capturedKeys:o,onSave:i,onRemove:u,onCancel:f}){const[h,g]=N.useState(r?.rules.all?"all":r?.rules.any?"any":"all"),p=r?.rules.all??r?.rules.any??[],[x,m]=N.useState(p.length>0?p:[h0()]),[y,v]=N.useState(r?.onFail??"abort"),[j,C]=N.useState(r?.switchToWorkflow??""),[_,T]=N.useState(r?.returnOnComplete??!0),M=(X,oe)=>{m(I=>I.map((J,ne)=>ne===X?{...J,...oe}:J))},Y=()=>m(X=>[...X,h0()]),L=X=>m(oe=>oe.filter((I,J)=>J!==X)),R=()=>{const X=x.filter(I=>I.left.trim()!=="");if(X.length===0)return;const oe={rules:h==="all"?{all:X}:{any:X},onFail:y,...y==="switch"&&j.trim()?{switchToWorkflow:j.trim(),returnOnComplete:_}:{}};i(oe)},O="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",Z=`${O} 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,oe)=>s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("input",{list:`cond-left-${n}-${oe}`,value:X.left,onChange:I=>M(oe,{left:I.target.value}),placeholder:"{{workflow:key}} or value",className:`flex-1 min-w-0 ${O}`}),s.jsx("datalist",{id:`cond-left-${n}-${oe}`,children:o.map(I=>s.jsx("option",{value:`{{${I}}}`},I))}),s.jsx("select",{value:X.operator,onChange:I=>M(oe,{operator:I.target.value,right:u0.includes(I.target.value)?void 0:X.right}),className:`w-44 shrink-0 ${Z}`,children:y3.map(I=>s.jsx("optgroup",{label:I.label,children:I.ops.map(J=>s.jsx("option",{value:J.value,children:J.label},J.value))},I.label))}),u0.includes(X.operator)?s.jsx("div",{className:"flex-1"}):s.jsx("input",{value:X.right??"",onChange:I=>M(oe,{right:I.target.value}),placeholder:"value or {{workflow:key}}",className:`flex-1 min-w-0 ${O}`}),x.length>1&&s.jsx("button",{type:"button",onClick:()=>L(oe),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})})]},oe)),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 ${y===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)),y==="switch"&&s.jsx("input",{value:j,onChange:X=>C(X.target.value),placeholder:"workflow-slug",className:`flex-1 ${O}`})]}),y==="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=>T(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:j||"sub-workflow"})]})]})]}),s.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[s.jsxs("button",{type:"button",onClick:R,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(jt,{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(Gt,{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 j3({step:n,index:r,total:o,status:i,result:u,allSteps:f,onConditionChange:h,waitingHuman:g}){const[p,x]=N.useState(!1),[m,y]=N.useState(!1),v=n.capture&&Object.keys(n.capture).length>0,j=n.inject&&Object.keys(n.inject).length>0,C=n.body&&Object.keys(n.body).length>0,_=!!n.condition,T=yf(n),M=[];for(let R=0;R<=r;R++){const O=f[R];Object.keys(O.capture??{}).forEach(Z=>M.push(Z)),Object.keys(O.captureInput??{}).forEach(Z=>M.push(Z))}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(Rr,{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(jt,{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(Lt,{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 R=n.condition.rules.all??n.condition.rules.any??[],O=n.condition.rules.all?"AND":"OR";return`${R.length} rule${R.length!==1?"s":""} ${O} → ${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(R=>!R),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(i3,{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:[j&&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"}),T.length>0&&s.jsxs("span",{title:`Needs human input at runtime: ${T.map(R=>`{{human:${R}}}`).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(Rr,{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(qa,{className:"h-3.5 w-3.5"}):s.jsx(yl,{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(([R,O])=>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:R}),s.jsx("span",{className:"font-mono text-[10px] text-blue-400/80 truncate",children:String(O)})]},R))})]}),j&&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(C0,{className:"h-3 w-3",strokeWidth:2})," Inject"]}),s.jsx("div",{className:"space-y-1",children:Object.entries(n.inject).map(([R,O])=>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:R}),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:O})]},R))})]}),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(na,{className:"h-3 w-3",strokeWidth:2})," Capture"]}),s.jsx("div",{className:"space-y-1",children:Object.entries(n.capture).map(([R,O])=>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:R}),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:O})]},R))})]}),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:()=>y(!0),className:"shrink-0 text-[var(--text-faint)] hover:text-purple-400 transition-colors hover:cursor-pointer",children:s.jsx(E1,{className:"h-3 w-3",strokeWidth:2})})]}),m?s.jsx(v3,{stepIndex:r,existingCondition:n.condition,capturedKeys:M,onSave:R=>{h(r,R),y(!1)},onRemove:()=>{h(r,void 0),y(!1)},onCancel:()=>y(!1)}):!_&&s.jsxs("button",{type:"button",onClick:()=>y(!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 Sd(n){return{phase:"idle",currentStep:-1,stepStatuses:Array(n).fill("idle"),stepResults:Array(n).fill(null),passed:0,failed:0,humanKeys:[],notes:[]}}const db={run:"pre-seeded for this run",env:"environment variable",memory:"saved human memory",prompt:"your answer"};function N3({workflow:n,onDelete:r,onViewTraces:o}){const[i,u]=N.useState(n),[f,h]=N.useState("list"),[g,p]=N.useState(!1),[x,m]=N.useState(!1),[y,v]=N.useState(!1),[j,C]=N.useState(()=>Sd(i.steps.length)),[_,T]=N.useState(void 0),[M,Y]=N.useState([]),[L,R]=N.useState(null),[O,Z]=N.useState(""),X=N.useRef(!1),oe=N.useRef(null),I=N.useRef(""),J=N.useRef("local-sim"),ne=N.useRef({}),ee=N.useRef(new Set),se=N.useRef(null),[S,U]=N.useState(null),[k,H]=N.useState(""),[D,z]=N.useState(null),[E,$]=N.useState(!1),W=N.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}}),re={...i,steps:ue};u(re);try{await o3(i._file,ue)}catch{}};N.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;R(ue);const re=V.find(P=>P.name===ue);re&&Z(re.baseUrl)}).catch(()=>{})},[]);const ie=async()=>{if(confirm(`Delete workflow "${i.name}"? This cannot be undone.`)){v(!0);try{await u3(i._file),r()}catch(q){alert(`Failed to delete: ${q.message}`),v(!1)}}},he=()=>{if(X.current=!0,oe.current?.close(),oe.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})}),re=await ue.json().catch(()=>({}));if(!ue.ok)throw new Error(re.error??`HTTP ${ue.status}`)},we=async()=>{if(S){if(W.current){const q=W.current;W.current=null,U(null),H(""),q(k);return}$(!0),z(null);try{await xe(S.key,k),U(null),H("")}catch(q){z(q.message)}finally{$(!1)}}},ve=async()=>{if(S){if(W.current){const q=W.current;W.current=null,U(null),H(""),z(null),q(null);return}try{await xe(S.key,null)}catch{}U(null),H(""),z(null)}},Ae=()=>{he(),C(Sd(i.steps.length))},Re=async(q,V,ue)=>{const re=new Date().toISOString(),P={id:crypto.randomUUID(),workflowName:i.name,workflowFile:i._file,startedAt:ue,finishedAt:re,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 l2(P);T(Ee)},We=q=>{X.current=!1,se.current=null,ee.current=new Set,W.current=null,U(null),H(""),z(null);const V=i.steps.length;C({...Sd(V),baseUrl:O||void 0}),T(void 0),I.current=new Date().toISOString(),J.current="local-sim",p(!0);const ue=(P,Ee,ge)=>new Promise(ke=>{H(""),z(null),U({key:P,stepIndex:Ee,stepName:ge}),W.current=ke}),re=async()=>{C(Oe=>({...Oe,phase:"running",baseUrl:O||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=yf(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=r3(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,xt=Math.round(At),at={index:Oe,step:{name:ze.name,method:ze.method,path:ze.path,description:ze.description},status:200,passed:nt,durationMs:xt,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:j.stepStatuses,stepResults:j.stepResults,passed:P,failed:Ee,baseUrl:O||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:O||void 0,humanInputs:q})}).then(P=>{if(!P.ok||!P.body){re();return}J.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(`
|
|
367
|
-
`);ke=dt.pop()??"";for(const nt of dt){const xt=nt.trim();if(!xt.startsWith("data:"))continue;const at=xt.slice(5).trim();if(!at)continue;let pe;try{pe=JSON.parse(at)}catch{continue}if(pe.type==="human_input_required"){H(""),z(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)&&d3(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=db[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&&re()})().catch(()=>{X.current||re()})}).catch(()=>{X.current||re()})},Te=j.phase==="running",ye=j.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(kd,{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(yl,{className:"h-3.5 w-3.5"}):s.jsx(qa,{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(Vr,{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"]}),ye&&s.jsxs("span",{className:`flex items-center gap-1 rounded-full px-2 py-0.5 text-[10px] shrink-0 ${j.phase==="done"&&j.failed===0?"bg-emerald-500/10 text-emerald-400":j.phase==="running"?"bg-blue-500/10 text-blue-400":"bg-red-500/10 text-red-400"}`,children:[j.phase==="running"&&s.jsx(ot,{className:"h-2.5 w-2.5 animate-spin",strokeWidth:2}),j.phase==="done"&&j.failed===0&&s.jsx(jt,{className:"h-2.5 w-2.5",strokeWidth:2}),(j.phase==="done"||j.phase==="aborted")&&j.failed>0&&s.jsx(Lt,{className:"h-2.5 w-2.5",strokeWidth:2}),j.phase==="running"?"Running…":j.phase==="done"?`${j.passed}/${j.passed+j.failed}`:j.phase==="aborted"?"Aborted":"Error"]}),j.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(Lt,{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(A0,{className:"h-3 w-3",strokeWidth:2}):s.jsx(Jd,{className:"h-3 w-3",strokeWidth:2}),q.charAt(0).toUpperCase()+q.slice(1)]},q))}),ye&&!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(b1,{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(L1,{className:"h-3 w-3",strokeWidth:2})," Stop"]}),ye&&!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(M1,{className:"h-3 w-3",strokeWidth:2})," Reset"]}),ye&&!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(Yr,{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(kd,{className:"h-3 w-3",strokeWidth:2}),ye?"Re-run":"Run"]}),!i._legacy&&!Te&&s.jsx("button",{type:"button",onClick:ie,disabled:y,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:y?s.jsx(ot,{className:"h-3 w-3 animate-spin",strokeWidth:2}):s.jsx(Gt,{className:"h-3 w-3",strokeWidth:2})})]}),!x&&s.jsxs(s.Fragment,{children:[M.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:"}),M.map(q=>{const V=L===q.name;return s.jsxs("button",{type:"button",onClick:()=>{R(q.name),Z(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:O})]}),g&&s.jsx("div",{className:"border-b border-[var(--border)]",children:s.jsx(b3,{runState:j,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(j3,{step:q,index:V,total:i.steps.length,status:j.stepStatuses[V]??"idle",result:j.stepResults[V]??null,allSteps:i.steps,onConditionChange:ae,waitingHuman:S?.stepIndex===V},V))}),f==="graph"&&s.jsx("div",{className:"p-4",children:s.jsx(g3,{steps:i.steps,runState:j})})]})]}),S&&s.jsx(h3,{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:we,onCancel:ve,submitLabel:"Submit & resume run",error:D,submitting:E})]})}function w3(){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 S3({onViewTraces:n}){const[r,o]=N.useState([]),[i,u]=N.useState(!0),[f,h]=N.useState(!1),[g,p]=N.useState(null),[x,m]=N.useState(!1),[y,v]=N.useState(""),[j,C]=N.useState(null),[_,T]=N.useState(!1),M=()=>{m(!1),v(""),C(null)},Y=N.useCallback(async(O=!1)=>{O?h(!0):u(!0),p(null);try{o(await c3())}catch(Z){p(Z.message)}finally{u(!1),h(!1)}},[]);N.useEffect(()=>{Y()},[Y]);const L=async()=>{if(y.trim()){T(!0),C(null);try{const O=await fetch("/api/workflows/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({goal:y.trim()})}),Z=await O.json();if(!O.ok)throw new Error(Z.error??`HTTP ${O.status}`);M(),await Y(!0)}catch(O){C(O.message)}finally{T(!1)}}},R=O=>{o(Z=>Z.filter(X=>X._file!==O))};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(na,{className:"h-3 w-3",strokeWidth:2})," AI Workflow Generator"]}),s.jsx("input",{autoFocus:!0,value:y,onChange:O=>{v(O.target.value),C(null)},onKeyDown:O=>{O.key==="Enter"&&!O.shiftKey&&L(),O.key==="Escape"&&M()},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:_||!y.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(na,{className:"h-3 w-3",strokeWidth:2})," Generate with AI"]})}),s.jsx("button",{type:"button",onClick:M,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})})]}),j&&s.jsx("span",{className:"text-[10px] text-red-400 leading-tight",children:j})]}):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(ps,{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(O=>s.jsx("div",{className:"h-16 animate-pulse rounded-lg border border-[var(--border)] bg-[var(--bg-overlay)]",style:{opacity:1-O*.3}},O))}),!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(Lt,{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(w3,{}),!i&&!g&&r.length>0&&s.jsx("div",{className:"space-y-5",children:r.map((O,Z)=>s.jsx(N3,{workflow:O,onDelete:()=>R(O._file),onViewTraces:n?(X,oe)=>n({workflowName:X,traceId:oe}):void 0},`${O._file}-${Z}`))}),!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 E3={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 fb(n){return E3[n.toUpperCase()]??{bg:"bg-[var(--bg-overlay-md)]",text:"text-[var(--text-muted)]",dot:"#a1a1aa"}}async function k3(){const n=await fetch("/api/model");if(!n.ok)throw new Error(`HTTP ${n.status}`);return n.json()}async function _3(){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 C3(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 T3(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 M3({method:n}){const r=fb(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 x0({value:n,onSave:r,mono:o=!0}){const[i,u]=N.useState(!1),[f,h]=N.useState(n),[g,p]=N.useState(!1),x=N.useRef(null);N.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:y=>h(y.target.value),onKeyDown:y=>{y.key==="Enter"&&m(),y.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(jt,{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(Id,{className:"h-2.5 w-2.5 text-[var(--text-faint)] opacity-0 group-hover/ie:opacity-100 transition-opacity"})]})}function A3({ep:n,onUpdate:r,onInspect:o,onViewTraces:i,onEdit:u}){const[f,h]=N.useState(!1),[g,p]=N.useState(""),x=async(v,j)=>{p("");try{await C3(v,j),r(v,j)}catch(C){p(C.message)}},m=n.requestBody?.fields??{},y=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(qa,{className:"h-3.5 w-3.5"}):s.jsx(yl,{className:"h-3.5 w-3.5"})}),s.jsx(M3,{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(La,{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(Id,{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(Yr,{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(x0,{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(x0,{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,j])=>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:j.type}),j.required&&s.jsx("span",{className:"text-[10px] text-rose-400",children:"required"})]},v))})]}),Object.keys(y).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(y).map(([v,j])=>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}),j.schema&&s.jsx("span",{className:"text-[10px] text-[var(--text-muted)]",children:Object.keys(j.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,j)=>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},j))})]})]})]})}function R3({prefix:n,endpoints:r,onUpdate:o,onInspect:i,onViewTraces:u,onEdit:f}){const[h,g]=N.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(yl,{className:"h-3 w-3"}):s.jsx(qa,{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(A3,{ep:p,onUpdate:o,onInspect:i,onViewTraces:u,onEdit:f},p.id))})]})}const ll=210,_r=52,Ed=100,p0=14,rl=36;function z3({endpoints:n}){const r=N.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)*Ed+rl*2,h=u*_r+(u-1)*p0+rl*2+24,g=new Map;return i.forEach(([,p],x)=>{const m=rl+x*(ll+Ed);p.forEach((y,v)=>{g.set(y.id,{x:m,y:rl+24+v*(_r+p0)})})}),N.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],y)=>{if(y>=i.length-1)return;const v=i[y+1][1];m.forEach(j=>{const C=g.get(j.id);v.forEach(_=>{const T=g.get(_.id),M=C.x+ll,Y=C.y+_r/2,L=T.x,R=T.y+_r/2,O=(M+L)/2;x.beginPath(),x.strokeStyle="rgba(96,165,250,0.14)",x.lineWidth=1,x.moveTo(M,Y),x.bezierCurveTo(O,Y,O,R,L,R),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+Ed),top:rl,width:ll},children:p},p)),n.map(p=>{const x=g.get(p.id);if(!x)return null;const m=fb(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 O3({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 Li=["application/json","application/x-www-form-urlencoded","multipart/form-data","text/plain","application/xml","application/octet-stream"],hb=["string","integer","number","boolean","array","object"];function D3({open:n,onClose:r,onCreated:o}){const[i,u]=N.useState("basic"),[f,h]=N.useState(!1),[g,p]=N.useState(""),[x,m]=N.useState("GET"),[y,v]=N.useState(""),[j,C]=N.useState(""),[_,T]=N.useState(""),[M,Y]=N.useState(""),[L,R]=N.useState([]),[O,Z]=N.useState("application/json"),[X,oe]=N.useState(""),[I,J]=N.useState(""),[ne,ee]=N.useState(!1),[se,S]=N.useState([]),[U,k]=N.useState([]),[H,D]=N.useState(!1),z=H&&!y.trim(),E=N.useRef(null);N.useEffect(()=>{n&&(u("basic"),m("GET"),v(""),C(""),T(""),Y(""),R([]),Z("application/json"),oe(""),J(""),ee(!1),S([]),k([]),D(!1),p(""),h(!1))},[n]),N.useEffect(()=>{if(!n)return;const V=ue=>{ue.key==="Escape"&&r()};return window.addEventListener("keydown",V),()=>window.removeEventListener("keydown",V)},[n,r]);const $=()=>R(V=>[...V,{name:"",in:"query",type:"string",required:!1,description:"",example:""}]),W=(V,ue)=>R(re=>re.map((P,Ee)=>Ee===V?{...P,...ue}:P)),ae=V=>R(ue=>ue.filter((re,P)=>P!==V)),ie=()=>S(V=>[...V,{status:"200",description:"",contentType:"application/json",schema:"",example:""}]),he=(V,ue)=>S(re=>re.map((P,Ee)=>Ee===V?{...P,...ue}:P)),xe=V=>S(ue=>ue.filter((re,P)=>P!==V)),we=()=>k(V=>[...V,{name:""}]),ve=(V,ue)=>k(re=>re.map((P,Ee)=>Ee===V?{name:ue}:P)),Ae=V=>k(ue=>ue.filter((re,P)=>P!==V)),Re=(V,ue)=>k(re=>{const P=[...re],Ee=V+ue;return Ee<0||Ee>=P.length||([P[V],P[Ee]]=[P[Ee],P[V]]),P}),We=async()=>{if(D(!0),!y.trim()){u("basic");return}h(!0),p("");try{const V={method:x.toUpperCase(),path:y.startsWith("/")?y:"/"+y};j.trim()&&(V.name=j.trim()),_.trim()&&(V.description=_.trim()),M.trim()&&(V.tags=M.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 re=L.filter(ge=>ge.name.trim());if(re.length>0&&(V.parameters=re.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[O]=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 T3(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})`:""}`}],ye="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(Jv,{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(Lt,{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:`${ye} 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:y,onChange:V=>v(V.target.value),placeholder:"/api/users",className:`${ye} font-mono ${z?"border-red-500/60 focus:border-red-500/80":""}`}),z&&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:j,onChange:V=>C(V.target.value),placeholder:"Create User",className:ye})]}),s.jsxs("div",{children:[s.jsx("label",{className:q,children:"Description"}),s.jsx("textarea",{value:_,onChange:V=>T(V.target.value),placeholder:"Creates a new user account",rows:2,className:`${ye} resize-none`})]}),s.jsxs("div",{children:[s.jsx("label",{className:q,children:"Tags"}),s.jsx("input",{value:M,onChange:V=>Y(V.target.value),placeholder:"users, auth, public",className:ye}),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:re=>W(ue,{name:re.target.value}),placeholder:"Parameter name",className:`${ye} font-mono`})}),s.jsx("select",{value:V.in,onChange:re=>W(ue,{in:re.target.value}),className:`${ye} w-28 hover:cursor-pointer`,children:["query","path","header","cookie"].map(re=>s.jsx("option",{children:re},re))}),s.jsx("select",{value:V.type,onChange:re=>W(ue,{type:re.target.value}),className:`${ye} w-28 hover:cursor-pointer`,children:hb.map(re=>s.jsx("option",{children:re},re))}),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(Gt,{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:re=>W(ue,{required:re.target.checked}),className:"accent-blue-500"}),"Required"]}),s.jsx("input",{value:V.description,onChange:re=>W(ue,{description:re.target.value}),placeholder:"Description",className:`${ye} flex-1 text-[10px]`}),s.jsx("input",{value:V.example,onChange:re=>W(ue,{example:re.target.value}),placeholder:"Example",className:`${ye} 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:O,onChange:V=>Z(V.target.value),className:`${ye} hover:cursor-pointer`,children:Li.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=>oe(V.target.value),placeholder:`{
|
|
368
|
-
"type": "object",
|
|
369
|
-
"properties": {
|
|
370
|
-
"email": { "type": "string", "format": "email" },
|
|
371
|
-
"password": { "type": "string" }
|
|
372
|
-
},
|
|
373
|
-
"required": ["email", "password"]
|
|
374
|
-
}`,rows:5,className:`${ye} 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=>J(V.target.value),placeholder:`{
|
|
375
|
-
"email": "test@example.com",
|
|
376
|
-
"password": "password123"
|
|
377
|
-
}`,rows:3,className:`${ye} 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:re=>he(ue,{status:re.target.value}),placeholder:"200",className:`${ye} font-mono`})]}),s.jsxs("div",{className:"flex-1",children:[s.jsx("label",{className:q,children:"Description"}),s.jsx("input",{value:V.description,onChange:re=>he(ue,{description:re.target.value}),placeholder:"Success",className:ye})]}),s.jsxs("div",{className:"w-48",children:[s.jsx("label",{className:q,children:"Content Type"}),s.jsx("select",{value:V.contentType,onChange:re=>he(ue,{contentType:re.target.value}),className:`${ye} hover:cursor-pointer`,children:Li.map(re=>s.jsx("option",{children:re},re))})]}),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(Gt,{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:re=>he(ue,{schema:re.target.value}),placeholder:`{
|
|
378
|
-
"type": "object",
|
|
379
|
-
"properties": { ... }
|
|
380
|
-
}`,rows:3,className:`${ye} 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:re=>he(ue,{example:re.target.value}),placeholder:`{
|
|
381
|
-
"id": "abc123",
|
|
382
|
-
"email": "test@example.com"
|
|
383
|
-
}`,rows:2,className:`${ye} 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:we,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(La,{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(qa,{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(qa,{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:re=>ve(ue,re.target.value),placeholder:"e.g. authenticateToken",className:`${ye} 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(Gt,{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 H3({endpoint:n,onClose:r,onSaved:o}){const[i,u]=N.useState("basic"),[f,h]=N.useState(!1),[g,p]=N.useState(""),[x,m]=N.useState(n.method),[y,v]=N.useState(n.path),[j,C]=N.useState(n.name??""),[_,T]=N.useState(n.description??""),[M,Y]=N.useState((n.tags??[]).join(", ")),[L,R]=N.useState(n.deprecated??!1),[O,Z]=N.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,oe]=N.useState(n.requestBody?.contentType??"application/json"),[I,J]=N.useState(n.requestBody?.required??!1),[ne,ee]=N.useState(()=>{const q=n.requestBody?.fields;if(!q||Object.keys(q).length===0)return"";const V={},ue=[];for(const[re,P]of Object.entries(q))V[re]={type:P.type,...P.format?{format:P.format}:{},...P.description?{description:P.description}:{}},P.required&&ue.push(re);return JSON.stringify({type:"object",properties:V,...ue.length>0?{required:ue}:{}},null,2)}),[se,S]=N.useState(""),[U,k]=N.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]=N.useState((n.middleware??[]).map(q=>({name:q.name}))),z=N.useRef(null);N.useEffect(()=>{if(!open)return;const q=V=>{V.key==="Escape"&&r()};return window.addEventListener("keydown",q),()=>window.removeEventListener("keydown",q)},[r]);const E=()=>Z(q=>[...q,{name:"",in:"query",type:"string",required:!1,description:"",example:""}]),$=(q,V)=>Z(ue=>ue.map((re,P)=>P===q?{...re,...V}:re)),W=q=>Z(V=>V.filter((ue,re)=>re!==q)),ae=()=>k(q=>[...q,{status:"200",description:"",contentType:"application/json",schema:"",example:""}]),ie=(q,V)=>k(ue=>ue.map((re,P)=>P===q?{...re,...V}:re)),he=q=>k(V=>V.filter((ue,re)=>re!==q)),xe=()=>D(q=>[...q,{name:""}]),we=(q,V)=>D(ue=>ue.map((re,P)=>P===q?{name:V}:re)),ve=q=>D(V=>V.filter((ue,re)=>re!==q)),Ae=(q,V)=>D(ue=>{const re=[...ue],P=q+V;return P<0||P>=re.length||([re[q],re[P]]=[re[P],re[q]]),re}),Re=async()=>{if(!y.trim()){u("basic");return}h(!0),p("");try{const q={id:n.id,method:x.toUpperCase(),path:y.startsWith("/")?y:"/"+y};j.trim()&&(q.name=j.trim()),_.trim()&&(q.description=_.trim()),M.trim()&&(q.tags=M.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=O.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 re=await fetch(`/api/model/endpoint/${n.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(q)});if(!re.ok){const P=await re.json().catch(()=>({}));throw new Error(P.error??`Save failed (${re.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",ye="block text-[10px] text-[var(--text-faint)] mb-1.5 uppercase tracking-wider font-medium";return s.jsx("div",{ref:z,className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:q=>{q.target===z.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(Id,{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(Lt,{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:ye,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:ye,children:"Path *"}),s.jsx("input",{value:y,onChange:q=>v(q.target.value),placeholder:"/api/users",className:`${Te} font-mono`})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:ye,children:"Name"}),s.jsx("input",{value:j,onChange:q=>C(q.target.value),placeholder:"Create User",className:Te})]}),s.jsxs("div",{children:[s.jsx("label",{className:ye,children:"Description"}),s.jsx("textarea",{value:_,onChange:q=>T(q.target.value),rows:2,className:`${Te} resize-none`})]}),s.jsxs("div",{children:[s.jsx("label",{className:ye,children:"Tags"}),s.jsx("input",{value:M,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=>R(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:ye+" 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"]})]}),O.length===0&&s.jsx("p",{className:"text-[10px] text-[var(--text-faint)] italic",children:"No parameters"}),s.jsx("div",{className:"space-y-2",children:O.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:hb.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(Gt,{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:ye,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:ye,children:"Content Type"}),s.jsx("select",{value:X,onChange:q=>oe(q.target.value),className:`${Te} hover:cursor-pointer`,children:Li.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=>J(q.target.checked),className:"accent-amber-500"})," Required"]})]}),s.jsxs("div",{children:[s.jsx("label",{className:ye,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:ye,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:ye+" 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:ye,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:ye,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:ye,children:"Content Type"}),s.jsx("select",{value:q.contentType,onChange:ue=>ie(V,{contentType:ue.target.value}),className:`${Te} hover:cursor-pointer`,children:Li.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(Gt,{className:"h-3.5 w-3.5"})})]}),s.jsxs("div",{children:[s.jsx("label",{className:ye,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:ye+" 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(La,{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(qa,{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(qa,{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=>we(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(Gt,{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(jt,{className:"h-3.5 w-3.5"}),f?"Saving…":"Save Changes"]})]})]})]})})}function $3({onInspect:n,onViewTraces:r}){const[o,i]=N.useState(null),[u,f]=N.useState(!0),[h,g]=N.useState(!1),[p,x]=N.useState(!1),[m,y]=N.useState(null),[v,j]=N.useState(""),[C,_]=N.useState("list"),[T,M]=N.useState(""),[Y,L]=N.useState(!1),[R,O]=N.useState(null),Z=N.useCallback(async(ee=!1)=>{ee?g(!0):f(!0),y(null);try{i(await k3())}catch(se){y(se.message)}finally{f(!1),g(!1)}},[]);N.useEffect(()=>{Z()},[Z]);const X=async()=>{x(!0),j("");try{i(await _3())}catch(ee){j(ee.message)}finally{x(!1)}},oe=(ee,se)=>{i(S=>S&&{...S,endpoints:S.endpoints.map(U=>U.id===ee?{...U,...se}:U)})},I=(ee,se)=>{i(se)},J=(o?.endpoints??[]).filter(ee=>!T||ee.path.toLowerCase().includes(T.toLowerCase())||ee.method.toLowerCase().includes(T.toLowerCase())||(ee.handlerName??"").toLowerCase().includes(T.toLowerCase())),ne=new Map;for(const ee of J){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(A0,{className:"h-3.5 w-3.5",strokeWidth:2}):s.jsx(Jd,{className:"h-3.5 w-3.5",strokeWidth:2}),ee.charAt(0).toUpperCase()+ee.slice(1)]},ee))}),s.jsx("button",{type:"button",onClick:()=>Z(!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(ps,{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(Lt,{className:"h-3.5 w-3.5 shrink-0",strokeWidth:2}),v,s.jsx("button",{type:"button",onClick:()=>j(""),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(Lt,{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:()=>Z(),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(O3,{onScan:X,scanning:p,error:v}),!u&&!m&&o&&C==="graph"&&s.jsx("div",{className:"flex-1 overflow-auto p-6",children:s.jsx(z3,{endpoints:J})}),!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:T,onChange:ee=>M(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"}),T&&s.jsx("button",{type:"button",onClick:()=>M(""),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:[J.length," endpoint",J.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(R3,{prefix:ee,endpoints:se,onUpdate:oe,onInspect:S=>n?.(S),onViewTraces:r?S=>r({endpointPath:S}):void 0,onEdit:S=>O(S)},ee)),J.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 "',T,'"']}),s.jsx("button",{type:"button",onClick:()=>M(""),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:()=>Z(!0),className:"text-[var(--text-faint)] hover:text-[var(--text-secondary)] transition-colors hover:cursor-pointer",children:"Refresh"})})]})]})]}),s.jsx(D3,{open:Y,onClose:()=>L(!1),onCreated:I}),R&&s.jsx(H3,{endpoint:R,onClose:()=>O(null),onSaved:ee=>{i(se=>se&&{...se,endpoints:se.endpoints.map(S=>S.id===ee.id?ee:S)}),O(null)}})]})}const m0={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 U3(n){return m0[n.toUpperCase()]??m0.GET}function Qd({method:n,size:r="md"}){const o=U3(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 g0(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 B3({endpoint:n}){const[r,o]=N.useState(null),[i,u]=N.useState(1),[f,h]=N.useState(!1),[g,p]=N.useState(""),x=N.useCallback(async()=>{if(n.source){h(!0),p(""),o(null);try{const j=await fetch(`/api/model/source?file=${encodeURIComponent(n.source.file)}&line=${n.source.line}`);if(!j.ok){if((j.headers.get("content-type")??"").includes("application/json")){const T=await j.json().catch(()=>({}));throw new Error(T.error??`HTTP ${j.status}`)}throw new Error(`HTTP ${j.status}`)}if((j.headers.get("content-type")??"").includes("application/json")){const _=await j.json();o(_.source??_.content??""),u(_.startLine??1)}else o(await j.text()),u(1)}catch(j){p(j.message)}finally{h(!1)}}},[n]);if(N.useEffect(()=>{x()},[x]),!n.source)return null;const m=n.source.file.split(/[/\\]/).slice(-3).join("/"),y=r?r.split(`
|
|
384
|
-
`):[],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(ps,{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(Lt,{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:y.map((j,C)=>{const _=i+C,T=C===v;return s.jsxs("tr",{className:T?"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 ${T?"text-blue-400":"text-[var(--text-faint)]"}`,children:_}),s.jsx("td",{className:`px-4 py-0 font-mono text-[11px] whitespace-pre leading-5 ${T?"text-[var(--text-primary)]":"text-[var(--text-muted)]"}`,children:j||" "})]},C)})})})})]})]})}function q3({endpoint:n}){const[r,o]=N.useState([]),[i,u]=N.useState(!0),[f,h]=N.useState("");N.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:_0,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(Lt,{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,y=x.slice(-2).join("/"),v=m.split(".").pop()??"",j=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(Yi,{className:`h-[15px] w-[15px] shrink-0 ${j}`,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}),y&&s.jsx("p",{className:"text-[10px] text-[var(--text-faint)] truncate font-mono",children:y})]}),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 ${j}`,children:[".",v]})]},p)})]})]})}function b0({endpoint:n}){const[r,o]=N.useState("fake"),[i,u]=N.useState(""),[f,h]=N.useState({}),[g,p]=N.useState(!1),[x,m]=N.useState(null),[y,v]=N.useState("http://localhost:3000"),[j,C]=N.useState([]),[_,T]=N.useState(null),[M,Y]=N.useState(!1);N.useEffect(()=>{fetch("/api/model/environments").then(J=>J.ok?J.json():null).then(J=>{if(!J)return;C(J.environments??[]);const ne=J.defaultEnvironment??J.environments?.find(se=>se.default)?.name??J.environments?.[0]?.name??null;T(ne);const ee=(J.environments??[]).find(se=>se.name===ne);ee&&v(ee.baseUrl)}).catch(()=>{}).finally(()=>Y(!0))},[]);const L=n.requestBody?.fields??{},R=(n.security?.length??0)>0,O=["POST","PUT","PATCH"].includes(n.method.toUpperCase());N.useEffect(()=>{m(null),h({})},[n.id]);const Z=()=>{const J={};for(const[ne,ee]of Object.entries(L))J[ne]=g0(ne,ee.type,ee.format);return J},X=()=>{const J={};for(const[ne,ee]of Object.entries(L)){const se=f[ne]??"";se&&(ee.type==="integer"||ee.type==="number"?J[ne]=Number(se):ee.type==="boolean"?J[ne]=se.toLowerCase()==="true":J[ne]=se)}return J},oe=async()=>{p(!0),m(null);const J=Date.now();try{const ne=r==="fake"?Z():X(),ee={};(O||r==="fake")&&(ee["Content-Type"]="application/json"),i&&(ee.Authorization=`Bearer ${i}`);const se=`${y}${n.path}`,S=await fetch(se,{method:n.method.toUpperCase(),headers:ee,body:O?JSON.stringify(ne):void 0}),U=Date.now()-J;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()-J,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:M}),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(na,{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"}),j.length>0?s.jsx("div",{className:"rounded-lg border border-[var(--border)] bg-[var(--bg-overlay)] overflow-hidden",children:j.map(J=>{const ne=_===J.name;return s.jsxs("button",{type:"button",onClick:()=>{T(J.name),v(J.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(jt,{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:J.name}),s.jsx("span",{className:"font-mono text-[11px] text-[var(--text-faint)] truncate",children:J.baseUrl})]},J.name)})}):s.jsx("input",{value:y,onChange:J=>v(J.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"})]}),(R||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(C0,{className:"h-3 w-3",strokeWidth:2})," Bearer Token"]}),s.jsx("input",{type:"password",value:i,onChange:J=>u(J.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(na,{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(([J,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:J}),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:g0(J,ne.type,ne.format)})]},J))})]}),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(([J,ne])=>s.jsxs("label",{className:"flex flex-col gap-1",children:[s.jsxs("span",{className:"text-[11px] text-[var(--text-secondary)]",children:[J,ne.required&&s.jsx("span",{className:"ml-1 text-[10px] text-rose-400",children:"*"})]}),s.jsx("input",{value:f[J]??"",onChange:ee=>h(se=>({...se,[J]: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"})]},J))})]}),r==="real"&&Object.keys(L).length===0&&!O&&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:oe,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(kd,{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(jt,{className:"h-[15px] w-[15px] text-emerald-400",strokeWidth:2}):s.jsx(Lt,{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 L3=({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(um,{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(um,{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(La,{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:_0,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:jt,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 y=x.startsWith("2");return s.jsxs("div",{className:`flex items-start gap-3 rounded-lg border px-3 py-2 ${y?"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 ${y?"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(B3,{endpoint:n}),s.jsx(q3,{endpoint:n}),s.jsxs(ul,{className:"lg:hidden",children:[s.jsx(Ar,{icon:na,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(na,{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 Y3(){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 V3(){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 G3(){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 vf="/api/memory";async function y0(){const n=await fetch(vf);if(!n.ok)throw new Error(`Failed to fetch memory (${n.status})`);return n.json()}async function X3(){try{const n=await fetch("/api/model");return n.ok?(await n.json())?.environments??[]:[]}catch{return[]}}async function Z3(n,r){const o=await fetch(vf,{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 W3(n){const r=await fetch(vf,{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 v0(n){return typeof n=="object"&&n!==null?JSON.stringify(n):String(n)}function Q3(n){const r=n.indexOf(":");return r!==-1?n.slice(r+1):n}function wi(n){return n.includes(":")?n.split(":")[0]:"global"}function K3({value:n}){const[r,o]=N.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 J3({onClose:n,onSave:r,defaultScope:o}){const[i,u]=N.useState(o?`${o}:`:""),[f,h]=N.useState(""),[g,p]=N.useState(!1),[x,m]=N.useState(""),y=N.useRef(null);N.useEffect(()=>{y.current?.focus()},[]);const v=async j=>{if(j.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:j=>{j.target===j.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:y,value:i,onChange:j=>u(j.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:j=>h(j.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 I3({onClose:n,onSave:r}){const[o,i]=N.useState(""),[u,f]=N.useState(""),h=N.useRef(null);N.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(jt,{className:"h-[14px] w-[14px]",strokeWidth:2})," Create Scope"]})]})]})]})})}const F3={workflow:Td,global:M0},P3={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)]"}},e4={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 xb(n){return P3[n]??e4}function t4({scope:n,active:r,onClick:o}){const i=xb(n.id),u=F3[n.id]??ki;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(jt,{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 n4(){const[n,r]=N.useState([]),[o,i]=N.useState([]),[u,f]=N.useState([]),[h,g]=N.useState(null),[p,x]=N.useState(!0),[m,y]=N.useState(!1),[v,j]=N.useState(null),[C,_]=N.useState(""),[T,M]=N.useState(!1),[Y,L]=N.useState(!1),[R,O]=N.useState(null),Z=N.useCallback(async(D=!1)=>{D?y(!0):x(!0),j(null);try{const[z,E]=await Promise.all([y0(),X3()]);r(z),i(E)}catch(z){j(z.message??"Could not load memory data. Is `jetic dev` running?")}finally{x(!1),y(!1)}},[]);N.useEffect(()=>{Z()},[Z]);const X=async D=>{O(D);try{await W3(D),r(z=>z.filter(E=>E.key!==D))}catch(z){j(z.message??"Failed to delete entry")}finally{O(null)}},oe=async(D,z)=>{await Z3(D,z);const E=await y0();r(E)},I=Array.from(new Set(n.map(D=>wi(D.key)))),J=D=>n.filter(z=>wi(z.key)===D).length,ne=[{id:"workflow",label:"Workflow",count:J("workflow"),isBuiltIn:!0},...o.map(D=>({id:`environment.${D.name}`,label:D.name,count:J(`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:J(D),isCustom:!0})),{id:"global",label:"Global",count:J("global"),isBuiltIn:!0}],k=h?n.filter(D=>wi(D.key)===h):n,H=k.filter(D=>!C||D.key.toLowerCase().includes(C.toLowerCase())||v0(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:()=>Z(!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(ps,{className:`h-[15px] w-[15px] ${m?"animate-spin":""}`,strokeWidth:2})}),s.jsxs("button",{onClick:()=>M(!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(t4,{scope:D,active:h===D.id,onClick:()=>g(z=>z===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(_d,{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(ki,{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:()=>Z(),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(ki,{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:()=>M(!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(ki,{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:()=>M(!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(_d,{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,z)=>{const E=wi(D.key),$=Q3(D.key),W=v0(D.value),ae=R===D.key,ie=xb(E);return s.jsxs("tr",{className:"group transition-colors hover:bg-[var(--bg-overlay-md)]",style:z!==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(K3,{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(Gt,{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(Vr,{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:()=>Z(!0),className:"text-[11px] transition-colors hover:cursor-pointer hover:text-blue-400",style:{color:"var(--text-faint)"},children:"Refresh"})})]}),T&&s.jsx(J3,{onClose:()=>M(!1),onSave:oe,defaultScope:h??void 0}),Y&&s.jsx(I3,{onClose:()=>L(!1),onSave:D=>f(z=>z.includes(D)?z:[...z,D])})]})}function a4(){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 s4(){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 l4(){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 r4(){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 j0={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 pb(n){return j0[n.toUpperCase()]??j0.GET}function o4({data:n}){const r=pb(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(vt,{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(vt,{type:"source",position:me.Bottom,style:{background:"transparent",border:"none"}})]})}function i4({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(vt,{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(Ai,{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(vt,{type:"source",position:me.Bottom,style:{background:"transparent",border:"none"}})]})}function c4({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(vt,{type:"source",position:me.Bottom,style:{background:"transparent",border:"none"}})]})}function u4({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(vt,{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 d4({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(vt,{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(vt,{type:"source",position:me.Bottom,id:"pass",style:{background:"transparent",border:"none"}}),s.jsx(vt,{type:"source",position:me.Right,id:"fail",style:{background:"transparent",border:"none"}})]})}function f4({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(vt,{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(Jd,{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(ps,{style:{width:9,height:9,color:"#71717a"}}),s.jsx("span",{style:{fontSize:9,color:"#71717a"},children:"resumes main flow after"})]}),s.jsx(vt,{type:"source",position:me.Right,id:"return",style:{background:"transparent",border:"none"}})]})}const h4={step:o4,memory:i4,condition:d4,start:c4,end:u4,branch:f4},il=260,x4=130,p4=200,m4=90,g4=il+90,Si=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:Ba.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 b4(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+Si;for(let x=0;x<n.steps.length;x++){const m=n.steps[x],y=m.captureSpec&&Object.keys(m.captureSpec).length>0,v=m.captured&&Object.keys(m.captured).length>0,j=!!(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 T=x===0?"start":Ei(n,x-1)?`cond-${x-1}`:N0(n,x-1)?`mem-${x-1}`:`step-${x-1}`,M=x>0&&Ei(n,x-1)?"pass":void 0;u.push({id:`e-${x}`,source:T,sourceHandle:M,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+=x4+Si;let Y=`step-${x}`;if((y||v)&&(i.push({id:`mem-${x}`,type:"memory",position:{x:(il-p4)/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+=m4+Si,Y=`mem-${x}`),j){const L=m.conditionResult?.passed===!1?"#fb923c":"#c084fc",R=f;if(i.push({id:`cond-${x}`,type:"condition",position:{x:(il-44)/2,y:R},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:g4,y:R-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 O=x<n.steps.length-1?`step-${x+1}`:"end";u.push({id:`e-branch-return-${x}`,source:`branch-${x}`,sourceHandle:"return",target:O,...ol("#60a5fa",{dashed:!0,width:1.2,labelBg:!0}),label:"resume"})}f+=44+Si}}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?Ei(n,h)?`cond-${h}`:N0(n,h)?`mem-${h}`:`step-${h}`:"start",p=n.steps.length>0&&Ei(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 Ei(n,r){const o=n.steps[r];return o?!!(o.conditionSpec||o.conditionResult):!1}function N0(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 y4({trace:n,selectedStep:r,onSelectStep:o}){const[i,u,f]=nb([]),[h,g,p]=ab([]);return N.useEffect(()=>{const{nodes:x,edges:m}=b4(n,r,o);u(x),g(m)},[n,r]),s.jsxs(gf,{nodes:i,edges:h,onNodesChange:f,onEdgesChange:p,nodeTypes:h4,fitView:!0,fitViewOptions:{padding:.3},proOptions:{hideAttribution:!0},minZoom:.15,maxZoom:2,defaultEdgeOptions:{type:"smoothstep"},style:{background:"transparent"},children:[s.jsx(cb,{variant:ln.Dots,gap:24,size:1,color:"rgba(255,255,255,0.04)"}),s.jsx(ob,{style:{background:"var(--bg-surface)",border:"1px solid var(--border)",borderRadius:8},showInteractive:!1}),s.jsx(WS,{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 v4({step:n,onClose:r}){const o=pb(n.method),[i,u]=N.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(jt,{className:"h-4 w-4 text-emerald-400 shrink-0"}):s.jsx(Lt,{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(qt,{k:"Index",v:`#${n.index+1}`}),s.jsx(qt,{k:"Name",v:n.name||"—"}),s.jsx(qt,{k:"Method",v:n.method}),s.jsx(qt,{k:"Path",v:n.path,mono:!0}),n.description&&s.jsx(qt,{k:"Description",v:n.description})]}),s.jsxs(wn,{title:"Timing",children:[s.jsx(qt,{k:"Duration",v:`${n.durationMs}ms`,accent:"#60a5fa"}),n.expectStatus&&s.jsx(qt,{k:"Expected status",v:String(n.expectStatus)}),s.jsx(qt,{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(qt,{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(qt,{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(qt,{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(qt,{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(qt,{k:"Logic mode",v:n.conditionSpec.rules.all?"AND (all rules must pass)":"OR (any rule can pass)"}),s.jsx(qt,{k:"Failure action",v:n.conditionSpec.onFail,accent:"#fb923c"}),n.conditionSpec.switchToWorkflow&&s.jsx(qt,{k:"Switch workflow",v:n.conditionSpec.switchToWorkflow,mono:!0,accent:"#60a5fa"}),n.conditionSpec.returnOnComplete!==void 0&&s.jsx(qt,{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 qt({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 j4({trace:n}){const[r,o]=N.useState(null),i=n.steps.reduce((f,h)=>f+h.durationMs,0)||1,u=N.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(Vr,{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(jt,{className:"h-3.5 w-3.5"}):s.jsx(Lt,{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(y4,{trace:n,selectedStep:r,onSelectStep:u})}),r!==null&&n.steps[r]&&s.jsx(v4,{step:n.steps[r],onClose:()=>o(null)})]})]})}function N4({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(Vr,{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(Gt,{className:"h-3 w-3"})})]})})}function w4(){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(Yr,{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 S4(){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(Yi,{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 E4({initialFilter:n,onNavigate:r}){const[o,i]=N.useState([]),[u,f]=N.useState(!0),[h,g]=N.useState(""),[p,x]=N.useState(null),m=N.useRef(!1),y=N.useCallback(async()=>{f(!0);try{const _=await pm();if(i(_),!m.current&&n?.traceId){const T=_.find(M=>M.id===n.traceId);T&&(x(T),m.current=!0)}else if(!m.current&&n?.workflowName&&_.length>0){const T=_.find(M=>M.workflowName===n.workflowName);T&&(x(T),m.current=!0)}}finally{f(!1)}},[n?.traceId,n?.workflowName]);N.useEffect(()=>{y()},[y]),N.useEffect(()=>{const _=setInterval(()=>{pm().then(T=>{(T.length!==o.length||T.some((M,Y)=>M.id!==o[Y]?.id))&&i(T)}).catch(()=>{})},5e3);return()=>clearInterval(_)},[o]),N.useEffect(()=>{if(n?.traceId&&o.length>0){const _=o.find(T=>T.id===n.traceId);_&&x(_)}},[n?.traceId,o]);const v=async _=>{await r2(_),p?.id===_&&x(null),i(T=>T.filter(M=>M.id!==_))},j=async()=>{confirm("Delete all traces? This cannot be undone.")&&(await o2(),i([]),x(null))},C=o.filter(_=>!h.trim()||_.workflowName.toLowerCase().includes(h.toLowerCase())||_.steps.some(T=>T.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:y,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(ps,{className:"h-3.5 w-3.5"})}),o.length>0&&s.jsx("button",{onClick:j,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(Gt,{className:"h-3.5 w-3.5"})})]})]}),s.jsxs("div",{style:{position:"relative"},children:[s.jsx(_d,{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(w4,{}),!u&&C.map(_=>s.jsx(N4,{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(dm,{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(T0,{className:"h-3 w-3"})," Model ",s.jsx(dm,{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(j4,{trace:p,onNavigate:r}):s.jsx(S4,{})})]})}function k4(){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 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 _4({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 bl({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 mb({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(R1,{className:"h-3.5 w-3.5",strokeWidth:2}),n?"Saving…":"Save"]})}const C4=[{id:"general",label:"General",icon:Rr},{id:"environments",label:"Environments",icon:vl},{id:"appearance",label:"Appearance",icon:R0},{id:"editor",label:"Editor",icon:Yi},{id:"notifications",label:"Notifications",icon:k0},{id:"api",label:"API & Auth",icon:La},{id:"advanced",label:"Advanced",icon:Fd}];function T4({model:n}){const[r,o]=N.useState(n?.project?.name??""),[i,u]=N.useState(n?.project?.language??"TypeScript"),[f,h]=N.useState(n?.project?.framework??"Express"),[g,p]=N.useState(!1),[x,m]=N.useState(!1);N.useEffect(()=>{o(n?.project?.name??""),u(n?.project?.language??"TypeScript"),h(n?.project?.framework??"Express")},[n]);const y=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:Rr,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(_4,{value:r,onChange:o,placeholder:"My API"})}),s.jsx(lt,{label:"Language",description:"Primary language of your backend",children:s.jsx(bl,{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(bl,{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(jt,{className:"h-3.5 w-3.5",strokeWidth:2})," Saved"]}),s.jsx(mb,{saving:g,onClick:y})]})]})]})}function M4({model:n}){const[r,o]=N.useState(n?.environments??[{name:"local",baseUrl:"http://localhost:3000"}]),[i,u]=N.useState(!1),[f,h]=N.useState(!1);N.useEffect(()=>{o(n?.environments??[{name:"local",baseUrl:"http://localhost:3000"}])},[n]);const g=()=>o(y=>[...y,{name:"",baseUrl:""}]),p=y=>o(v=>v.filter((j,C)=>C!==y)),x=(y,v,j)=>o(C=>C.map((_,T)=>T===y?{..._,[v]:j}:_)),m=async()=>{u(!0),await new Promise(y=>setTimeout(y,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((y,v)=>s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("input",{value:y.name,onChange:j=>x(v,"name",j.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:y.baseUrl,onChange:j=>x(v,"baseUrl",j.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(jt,{className:"h-3.5 w-3.5",strokeWidth:2})," Saved"]}),s.jsx(mb,{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(c1,{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 A4(){const[n,r]=N.useState("dark"),[o,i]=N.useState("blue"),[u,f]=N.useState("comfortable"),[h,g]=N.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:R0,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 R4(){const[n,r]=N.useState("11"),[o,i]=N.useState("2"),[u,f]=N.useState(!0),[h,g]=N.useState(!0),[p,x]=N.useState(!0);return s.jsxs("div",{className:"space-y-5",children:[s.jsx(ms,{icon:Yi,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(bl,{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(bl,{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 z4(){const[n,r]=N.useState(!0),[o,i]=N.useState(!0),[u,f]=N.useState(!0),[h,g]=N.useState(!1),[p,x]=N.useState(!1);return s.jsxs("div",{className:"space-y-5",children:[s.jsx(ms,{icon:k0,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 O4(){const[n,r]=N.useState(""),[o,i]=N.useState("10000"),[u,f]=N.useState(!1),[h,g]=N.useState(!1);return s.jsxs("div",{className:"space-y-5",children:[s.jsx(ms,{icon:La,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(bl,{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 D4({onClearMemory:n}){const[r,o]=N.useState(!1),[i,u]=N.useState(!1),[f,h]=N.useState(!1),[g,p]=N.useState("30"),[x,m]=N.useState(!1),[y,v]=N.useState(!1),j=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:Fd,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(bl,{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(Gt,{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:j,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}):y?s.jsx(jt,{className:"h-3.5 w-3.5",strokeWidth:2}):s.jsx(Gt,{className:"h-3.5 w-3.5",strokeWidth:2}),x?"Clearing…":y?"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(Gt,{className:"h-3.5 w-3.5",strokeWidth:2})," Reset Model"]})]})]})]})]})}function H4(){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(na,{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 $4({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(yl,{className:"ml-auto h-3.5 w-3.5 opacity-40",strokeWidth:2})]})}function U4(){const[n,r]=N.useState("general"),[o,i]=N.useState(null),[u,f]=N.useState(!0);N.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(T4,{model:o});case"environments":return s.jsx(M4,{model:o});case"appearance":return s.jsx(A4,{});case"editor":return s.jsx(R4,{});case"notifications":return s.jsx(z4,{});case"api":return s.jsx(O4,{});case"advanced":return s.jsx(D4,{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:C4.map(({id:g,label:p,icon:x})=>s.jsx($4,{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(H4,{}),h()]})})]})]})}function B4(){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 q4=["overview","simulations","model","inspect","agents","tools","context","memory","apis","email","oauth","webhooks","traces","events","settings","docs"];function L4(){const[n,r]=N.useState(()=>{const v=localStorage.getItem("active_sidebar_item");return q4.includes(v)?v:"overview"}),[o,i]=N.useState(!1),[u,f]=N.useState(()=>{try{const v=localStorage.getItem("inspected_endpoint");return v?JSON.parse(v):null}catch{return null}}),[h,g]=N.useState(void 0);N.useEffect(()=>{localStorage.setItem("active_sidebar_item",n)},[n]),N.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")},y=()=>{switch(n){case"overview":return s.jsx(xm,{onNavigate:p});case"simulations":return s.jsx(S3,{onViewTraces:m});case"model":return s.jsx($3,{onInspect:x,onViewTraces:m});case"inspect":return s.jsx(L3,{endpoint:u,onBack:()=>p("model")});case"agents":return s.jsx(Y3,{});case"tools":return s.jsx(V3,{});case"context":return s.jsx(G3,{});case"memory":return s.jsx(n4,{});case"apis":return s.jsx(a4,{});case"email":return s.jsx(s4,{});case"oauth":return s.jsx(l4,{});case"webhooks":return s.jsx(r4,{});case"traces":return s.jsx(E4,{initialFilter:h,onNavigate:p});case"events":return s.jsx(k4,{});case"settings":return s.jsx(U4,{});case"docs":return s.jsx(B4,{});default:return s.jsx(xm,{})}};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(e2,{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:y()}),s.jsx(t2,{isOpen:o,onClose:()=>i(!1)})]})]})}const Y4=()=>s.jsx(J1,{children:s.jsx(L4,{})});Av.createRoot(document.getElementById("root")).render(s.jsx(N.StrictMode,{children:s.jsx(Y4,{})}));
|