jetic-cli 0.1.9 → 0.2.1
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 +76 -445
- package/dist/dashboard/assets/index-8Xh271uc.js +384 -0
- package/dist/dashboard/assets/index-ANQK1AeT.css +1 -0
- package/dist/dashboard/index.html +2 -2
- package/dist/index.js +811 -136
- package/package.json +3 -2
- package/dist/dashboard/assets/index-DEc0dXNe.css +0 -1
- package/dist/dashboard/assets/index-DZwpY2T2.js +0 -384
|
@@ -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 vm(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var nd={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 Fp;function vv(){if(Fp)return yr;Fp=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 m in u)m!=="key"&&(f[m]=u[m])}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 Ip;function jv(){return Ip||(Ip=1,nd.exports=vv()),nd.exports}var l=jv(),ad={exports:{}},Me={};/**
|
|
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 Pp;function Nv(){if(Pp)return Me;Pp=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"),m=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),y=Symbol.iterator;function v(N){return N===null||typeof N!="object"?null:(N=y&&N[y]||N["@@iterator"],typeof N=="function"?N:null)}var j={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,_={};function T(N,R,V){this.props=N,this.context=R,this.refs=_,this.updater=V||j}T.prototype.isReactComponent={},T.prototype.setState=function(N,R){if(typeof N!="object"&&typeof N!="function"&&N!=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,N,R,"setState")},T.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function M(){}M.prototype=T.prototype;function B(N,R,V){this.props=N,this.context=R,this.refs=_,this.updater=V||j}var L=B.prototype=new M;L.constructor=B,C(L,T.prototype),L.isPureReactComponent=!0;var D=Array.isArray,H={H:null,A:null,T:null,S:null,V:null},Z=Object.prototype.hasOwnProperty;function X(N,R,V,I,le,xe){return V=xe.ref,{$$typeof:n,type:N,key:R,ref:V!==void 0?V:null,props:xe}}function ce(N,R){return X(N.type,R,void 0,void 0,void 0,N.props)}function F(N){return typeof N=="object"&&N!==null&&N.$$typeof===n}function J(N){var R={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(V){return R[V]})}var ae=/\/+/g;function te(N,R){return typeof N=="object"&&N!==null&&N.key!=null?J(""+N.key):R.toString(36)}function se(){}function E(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(se,se):(N.status="pending",N.then(function(R){N.status==="pending"&&(N.status="fulfilled",N.value=R)},function(R){N.status==="pending"&&(N.status="rejected",N.reason=R)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function q(N,R,V,I,le){var xe=typeof N;(xe==="undefined"||xe==="boolean")&&(N=null);var de=!1;if(N===null)de=!0;else switch(xe){case"bigint":case"string":case"number":de=!0;break;case"object":switch(N.$$typeof){case n:case r:de=!0;break;case g:return de=N._init,q(de(N._payload),R,V,I,le)}}if(de)return le=le(N),de=I===""?"."+te(N,0):I,D(le)?(V="",de!=null&&(V=de.replace(ae,"$&/")+"/"),q(le,R,V,"",function(ve){return ve})):le!=null&&(F(le)&&(le=ce(le,V+(le.key==null||N&&N.key===le.key?"":(""+le.key).replace(ae,"$&/")+"/")+de)),R.push(le)),1;de=0;var ge=I===""?".":I+":";if(D(N))for(var pe=0;pe<N.length;pe++)I=N[pe],xe=ge+te(I,pe),de+=q(I,R,V,xe,le);else if(pe=v(N),typeof pe=="function")for(N=pe.call(N),pe=0;!(I=N.next()).done;)I=I.value,xe=ge+te(I,pe++),de+=q(I,R,V,xe,le);else if(xe==="object"){if(typeof N.then=="function")return q(E(N),R,V,I,le);throw R=String(N),Error("Objects are not valid as a React child (found: "+(R==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":R)+"). If you meant to render a collection of children, use an array instead.")}return de}function k(N,R,V){if(N==null)return N;var I=[],le=0;return q(N,I,"","",function(xe){return R.call(V,xe,le++)}),I}function U(N){if(N._status===-1){var R=N._result;R=R(),R.then(function(V){(N._status===0||N._status===-1)&&(N._status=1,N._result=V)},function(V){(N._status===0||N._status===-1)&&(N._status=2,N._result=V)}),N._status===-1&&(N._status=0,N._result=R)}if(N._status===1)return N._result.default;throw N._result}var z=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var R=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof N=="object"&&N!==null&&typeof N.message=="string"?String(N.message):String(N),error:N});if(!window.dispatchEvent(R))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)};function O(){}return Me.Children={map:k,forEach:function(N,R,V){k(N,function(){R.apply(this,arguments)},V)},count:function(N){var R=0;return k(N,function(){R++}),R},toArray:function(N){return k(N,function(R){return R})||[]},only:function(N){if(!F(N))throw Error("React.Children.only expected to receive a single React element child.");return N}},Me.Component=T,Me.Fragment=o,Me.Profiler=u,Me.PureComponent=B,Me.StrictMode=i,Me.Suspense=p,Me.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=H,Me.__COMPILER_RUNTIME={__proto__:null,c:function(N){return H.H.useMemoCache(N)}},Me.cache=function(N){return function(){return N.apply(null,arguments)}},Me.cloneElement=function(N,R,V){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var I=C({},N.props),le=N.key,xe=void 0;if(R!=null)for(de in R.ref!==void 0&&(xe=void 0),R.key!==void 0&&(le=""+R.key),R)!Z.call(R,de)||de==="key"||de==="__self"||de==="__source"||de==="ref"&&R.ref===void 0||(I[de]=R[de]);var de=arguments.length-2;if(de===1)I.children=V;else if(1<de){for(var ge=Array(de),pe=0;pe<de;pe++)ge[pe]=arguments[pe+2];I.children=ge}return X(N.type,le,void 0,void 0,xe,I)},Me.createContext=function(N){return N={$$typeof:h,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:f,_context:N},N},Me.createElement=function(N,R,V){var I,le={},xe=null;if(R!=null)for(I in R.key!==void 0&&(xe=""+R.key),R)Z.call(R,I)&&I!=="key"&&I!=="__self"&&I!=="__source"&&(le[I]=R[I]);var de=arguments.length-2;if(de===1)le.children=V;else if(1<de){for(var ge=Array(de),pe=0;pe<de;pe++)ge[pe]=arguments[pe+2];le.children=ge}if(N&&N.defaultProps)for(I in de=N.defaultProps,de)le[I]===void 0&&(le[I]=de[I]);return X(N,xe,void 0,void 0,null,le)},Me.createRef=function(){return{current:null}},Me.forwardRef=function(N){return{$$typeof:m,render:N}},Me.isValidElement=F,Me.lazy=function(N){return{$$typeof:g,_payload:{_status:-1,_result:N},_init:U}},Me.memo=function(N,R){return{$$typeof:x,type:N,compare:R===void 0?null:R}},Me.startTransition=function(N){var R=H.T,V={};H.T=V;try{var I=N(),le=H.S;le!==null&&le(V,I),typeof I=="object"&&I!==null&&typeof I.then=="function"&&I.then(O,z)}catch(xe){z(xe)}finally{H.T=R}},Me.unstable_useCacheRefresh=function(){return H.H.useCacheRefresh()},Me.use=function(N){return H.H.use(N)},Me.useActionState=function(N,R,V){return H.H.useActionState(N,R,V)},Me.useCallback=function(N,R){return H.H.useCallback(N,R)},Me.useContext=function(N){return H.H.useContext(N)},Me.useDebugValue=function(){},Me.useDeferredValue=function(N,R){return H.H.useDeferredValue(N,R)},Me.useEffect=function(N,R,V){var I=H.H;if(typeof V=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return I.useEffect(N,R)},Me.useId=function(){return H.H.useId()},Me.useImperativeHandle=function(N,R,V){return H.H.useImperativeHandle(N,R,V)},Me.useInsertionEffect=function(N,R){return H.H.useInsertionEffect(N,R)},Me.useLayoutEffect=function(N,R){return H.H.useLayoutEffect(N,R)},Me.useMemo=function(N,R){return H.H.useMemo(N,R)},Me.useOptimistic=function(N,R){return H.H.useOptimistic(N,R)},Me.useReducer=function(N,R,V){return H.H.useReducer(N,R,V)},Me.useRef=function(N){return H.H.useRef(N)},Me.useState=function(N){return H.H.useState(N)},Me.useSyncExternalStore=function(N,R,V){return H.H.useSyncExternalStore(N,R,V)},Me.useTransition=function(){return H.H.useTransition()},Me.version="19.1.1",Me}var e0;function qr(){return e0||(e0=1,ad.exports=Nv()),ad.exports}var w=qr();const ie=vm(w);var ld={exports:{}},vr={},sd={exports:{}},rd={};/**
|
|
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 t0;function wv(){return t0||(t0=1,(function(n){function r(k,U){var z=k.length;k.push(U);e:for(;0<z;){var O=z-1>>>1,N=k[O];if(0<u(N,U))k[O]=U,k[z]=N,z=O;else break e}}function o(k){return k.length===0?null:k[0]}function i(k){if(k.length===0)return null;var U=k[0],z=k.pop();if(z!==U){k[0]=z;e:for(var O=0,N=k.length,R=N>>>1;O<R;){var V=2*(O+1)-1,I=k[V],le=V+1,xe=k[le];if(0>u(I,z))le<N&&0>u(xe,I)?(k[O]=xe,k[le]=z,O=le):(k[O]=I,k[V]=z,O=V);else if(le<N&&0>u(xe,z))k[O]=xe,k[le]=z,O=le;else break e}}return U}function u(k,U){var z=k.sortIndex-U.sortIndex;return z!==0?z:k.id-U.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,m=h.now();n.unstable_now=function(){return h.now()-m}}var p=[],x=[],g=1,y=null,v=3,j=!1,C=!1,_=!1,T=!1,M=typeof setTimeout=="function"?setTimeout:null,B=typeof clearTimeout=="function"?clearTimeout:null,L=typeof setImmediate<"u"?setImmediate:null;function D(k){for(var U=o(x);U!==null;){if(U.callback===null)i(x);else if(U.startTime<=k)i(x),U.sortIndex=U.expirationTime,r(p,U);else break;U=o(x)}}function H(k){if(_=!1,D(k),!C)if(o(p)!==null)C=!0,Z||(Z=!0,te());else{var U=o(x);U!==null&&q(H,U.startTime-k)}}var Z=!1,X=-1,ce=5,F=-1;function J(){return T?!0:!(n.unstable_now()-F<ce)}function ae(){if(T=!1,Z){var k=n.unstable_now();F=k;var U=!0;try{e:{C=!1,_&&(_=!1,B(X),X=-1),j=!0;var z=v;try{t:{for(D(k),y=o(p);y!==null&&!(y.expirationTime>k&&J());){var O=y.callback;if(typeof O=="function"){y.callback=null,v=y.priorityLevel;var N=O(y.expirationTime<=k);if(k=n.unstable_now(),typeof N=="function"){y.callback=N,D(k),U=!0;break t}y===o(p)&&i(p),D(k)}else i(p);y=o(p)}if(y!==null)U=!0;else{var R=o(x);R!==null&&q(H,R.startTime-k),U=!1}}break e}finally{y=null,v=z,j=!1}U=void 0}}finally{U?te():Z=!1}}}var te;if(typeof L=="function")te=function(){L(ae)};else if(typeof MessageChannel<"u"){var se=new MessageChannel,E=se.port2;se.port1.onmessage=ae,te=function(){E.postMessage(null)}}else te=function(){M(ae,0)};function q(k,U){X=M(function(){k(n.unstable_now())},U)}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"):ce=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 U=3;break;default:U=v}var z=v;v=U;try{return k()}finally{v=z}},n.unstable_requestPaint=function(){T=!0},n.unstable_runWithPriority=function(k,U){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var z=v;v=k;try{return U()}finally{v=z}},n.unstable_scheduleCallback=function(k,U,z){var O=n.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?O+z:O):z=O,k){case 1:var N=-1;break;case 2:N=250;break;case 5:N=1073741823;break;case 4:N=1e4;break;default:N=5e3}return N=z+N,k={id:g++,callback:U,priorityLevel:k,startTime:z,expirationTime:N,sortIndex:-1},z>O?(k.sortIndex=z,r(x,k),o(p)===null&&k===o(x)&&(_?(B(X),X=-1):_=!0,q(H,z-O))):(k.sortIndex=N,r(p,k),C||j||(C=!0,Z||(Z=!0,te()))),k},n.unstable_shouldYield=J,n.unstable_wrapCallback=function(k){var U=v;return function(){var z=v;v=U;try{return k.apply(this,arguments)}finally{v=z}}}})(rd)),rd}var n0;function Sv(){return n0||(n0=1,sd.exports=wv()),sd.exports}var od={exports:{}},Ct={};/**
|
|
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 a0;function Ev(){if(a0)return Ct;a0=1;var n=qr();function r(p){var x="https://react.dev/errors/"+p;if(1<arguments.length){x+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)x+="&args[]="+encodeURIComponent(arguments[g])}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,g){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:g}}var h=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(p,x){if(p==="font")return"";if(typeof x=="string")return x==="use-credentials"?x:""}return Ct.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,Ct.createPortal=function(p,x){var g=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,g)},Ct.flushSync=function(p){var x=h.T,g=i.p;try{if(h.T=null,i.p=2,p)return p()}finally{h.T=x,i.p=g,i.d.f()}},Ct.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))},Ct.prefetchDNS=function(p){typeof p=="string"&&i.d.D(p)},Ct.preinit=function(p,x){if(typeof p=="string"&&x&&typeof x.as=="string"){var g=x.as,y=m(g,x.crossOrigin),v=typeof x.integrity=="string"?x.integrity:void 0,j=typeof x.fetchPriority=="string"?x.fetchPriority:void 0;g==="style"?i.d.S(p,typeof x.precedence=="string"?x.precedence:void 0,{crossOrigin:y,integrity:v,fetchPriority:j}):g==="script"&&i.d.X(p,{crossOrigin:y,integrity:v,fetchPriority:j,nonce:typeof x.nonce=="string"?x.nonce:void 0})}},Ct.preinitModule=function(p,x){if(typeof p=="string")if(typeof x=="object"&&x!==null){if(x.as==null||x.as==="script"){var g=m(x.as,x.crossOrigin);i.d.M(p,{crossOrigin:g,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)},Ct.preload=function(p,x){if(typeof p=="string"&&typeof x=="object"&&x!==null&&typeof x.as=="string"){var g=x.as,y=m(g,x.crossOrigin);i.d.L(p,g,{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})}},Ct.preloadModule=function(p,x){if(typeof p=="string")if(x){var g=m(x.as,x.crossOrigin);i.d.m(p,{as:typeof x.as=="string"&&x.as!=="script"?x.as:void 0,crossOrigin:g,integrity:typeof x.integrity=="string"?x.integrity:void 0})}else i.d.m(p)},Ct.requestFormReset=function(p){i.d.r(p)},Ct.unstable_batchedUpdates=function(p,x){return p(x)},Ct.useFormState=function(p,x,g){return h.H.useFormState(p,x,g)},Ct.useFormStatus=function(){return h.H.useHostTransitionStatus()},Ct.version="19.1.1",Ct}var l0;function jm(){if(l0)return od.exports;l0=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(),od.exports=Ev(),od.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 s0;function kv(){if(s0)return vr;s0=1;var n=Sv(),r=qr(),o=jm();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 m(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,s=t;;){var c=a.return;if(c===null)break;var d=c.alternate;if(d===null){if(s=c.return,s!==null){a=s;continue}break}if(c.child===d.child){for(d=c.child;d;){if(d===a)return m(c),e;if(d===s)return m(c),t;d=d.sibling}throw Error(i(188))}if(a.return!==s.return)a=c,s=d;else{for(var b=!1,S=c.child;S;){if(S===a){b=!0,a=c,s=d;break}if(S===s){b=!0,s=c,a=d;break}S=S.sibling}if(!b){for(S=d.child;S;){if(S===a){b=!0,a=d,s=c;break}if(S===s){b=!0,s=d,a=c;break}S=S.sibling}if(!b)throw Error(i(189))}}if(a.alternate!==s)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 g=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"),B=Symbol.for("react.consumer"),L=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),H=Symbol.for("react.suspense"),Z=Symbol.for("react.suspense_list"),X=Symbol.for("react.memo"),ce=Symbol.for("react.lazy"),F=Symbol.for("react.activity"),J=Symbol.for("react.memo_cache_sentinel"),ae=Symbol.iterator;function te(e){return e===null||typeof e!="object"?null:(e=ae&&e[ae]||e["@@iterator"],typeof e=="function"?e:null)}var se=Symbol.for("react.client.reference");function E(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 H:return"Suspense";case Z:return"SuspenseList";case F:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case j:return"Portal";case L:return(e.displayName||"Context")+".Provider";case B:return(e._context.displayName||"Context")+".Consumer";case D: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:E(e.type)||"Memo";case ce:t=e._payload,e=e._init;try{return E(e(t))}catch{}}return null}var q=Array.isArray,k=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z={pending:!1,data:null,method:null,action:null},O=[],N=-1;function R(e){return{current:e}}function V(e){0>N||(e.current=O[N],O[N]=null,N--)}function I(e,t){N++,O[N]=e.current,e.current=t}var le=R(null),xe=R(null),de=R(null),ge=R(null);function pe(e,t){switch(I(de,t),I(xe,e),I(le,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Ep(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Ep(t),e=kp(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}V(le),I(le,e)}function ve(){V(le),V(xe),V(de)}function _e(e){e.memoizedState!==null&&I(ge,e);var t=le.current,a=kp(t,e.type);t!==a&&(I(xe,e),I(le,a))}function qe(e){xe.current===e&&(V(le),V(xe)),ge.current===e&&(V(ge),xr._currentValue=z)}var Ee=Object.prototype.hasOwnProperty,me=n.unstable_scheduleCallback,Y=n.unstable_cancelCallback,W=n.unstable_shouldYield,re=n.unstable_requestPaint,oe=n.unstable_now,ne=n.unstable_getCurrentPriorityLevel,Ce=n.unstable_ImmediatePriority,Te=n.unstable_UserBlockingPriority,Ue=n.unstable_NormalPriority,en=n.unstable_LowPriority,Mt=n.unstable_IdlePriority,mn=n.log,aa=n.unstable_setDisableYieldValue,Yt=null,nt=null;function At(e){if(typeof mn=="function"&&aa(e),nt&&typeof nt.setStrictMode=="function")try{nt.setStrictMode(Yt,e)}catch{}}var st=Math.clz32?Math.clz32:tn,La=Math.log,ht=Math.LN2;function tn(e){return e>>>=0,e===0?32:31-(La(e)/ht|0)|0}var nn=256,an=4194304;function Ht(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 Rt(e,t,a){var s=e.pendingLanes;if(s===0)return 0;var c=0,d=e.suspendedLanes,b=e.pingedLanes;e=e.warmLanes;var S=s&134217727;return S!==0?(s=S&~d,s!==0?c=Ht(s):(b&=S,b!==0?c=Ht(b):a||(a=S&~e,a!==0&&(c=Ht(a))))):(S=s&~d,S!==0?c=Ht(S):b!==0?c=Ht(b):a||(a=s&~e,a!==0&&(c=Ht(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 Vt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function js(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 bl(){var e=nn;return nn<<=1,(nn&4194048)===0&&(nn=256),e}function la(){var e=an;return an<<=1,(an&62914560)===0&&(an=4194304),e}function Ya(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function sa(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function zn(e,t,a,s,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 S=e.entanglements,A=e.expirationTimes,K=e.hiddenUpdates;for(a=b&~a;0<a;){var ue=31-st(a),he=1<<ue;S[ue]=0,A[ue]=-1;var P=K[ue];if(P!==null)for(K[ue]=null,ue=0;ue<P.length;ue++){var ee=P[ue];ee!==null&&(ee.lane&=-536870913)}a&=~he}s!==0&&Zr(e,s,0),d!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=d&~(b&~t))}function Zr(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-st(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|a&4194090}function Wr(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var s=31-st(a),c=1<<s;c&t|e[s]&t&&(e[s]|=t),a&=~c}}function Ns(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 ws(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Qr(){var e=U.p;return e!==0?e:(e=window.event,e===void 0?32:Xp(e.type))}function Ki(e,t){var a=U.p;try{return U.p=e,t()}finally{U.p=a}}var En=Math.random().toString(36).slice(2),xt="__reactFiber$"+En,kt="__reactProps$"+En,ra="__reactContainer$"+En,Ss="__reactEvents$"+En,Ji="__reactListeners$"+En,Fi="__reactHandles$"+En,Kr="__reactResources$"+En,Va="__reactMarker$"+En;function Es(e){delete e[xt],delete e[kt],delete e[Ss],delete e[Ji],delete e[Fi]}function On(e){var t=e[xt];if(t)return t;for(var a=e.parentNode;a;){if(t=a[ra]||a[xt]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=Mp(e);e!==null;){if(a=e[xt])return a;e=Mp(e)}return t}e=a,a=e.parentNode}return null}function oa(e){if(e=e[xt]||e[ra]){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 ia(e){var t=e[Kr];return t||(t=e[Kr]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function rt(e){e[Va]=!0}var Jr=new Set,Fr={};function Dn(e,t){ca(e,t),ca(e+"Capture",t)}function ca(e,t){for(Fr[e]=t,e=0;e<t.length;e++)Jr.add(t[e])}var Ir=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]*$"),Pr={},eo={};function Ii(e){return Ee.call(eo,e)?!0:Ee.call(Pr,e)?!1:Ir.test(e)?eo[e]=!0:(Pr[e]=!0,!1)}function yl(e,t,a){if(Ii(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var s=t.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function vl(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 gn(e,t,a,s){if(s===null)e.removeAttribute(a);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+s)}}var jl,to;function ua(e){if(jl===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);jl=t&&t[1]||"",to=-1<a.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+jl+e+to}var ks=!1;function Xa(e,t){if(!e||ks)return"";ks=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(t){var he=function(){throw Error()};if(Object.defineProperty(he.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(he,[])}catch(ee){var P=ee}Reflect.construct(e,[],he)}else{try{he.call()}catch(ee){P=ee}e.call(he.prototype)}}else{try{throw Error()}catch(ee){P=ee}(he=e())&&typeof he.catch=="function"&&he.catch(function(){})}}catch(ee){if(ee&&P&&typeof ee.stack=="string")return[ee.stack,P.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var d=s.DetermineComponentFrameRoot(),b=d[0],S=d[1];if(b&&S){var A=b.split(`
|
|
44
|
-
`),K=S.split(`
|
|
45
|
-
`);for(c=s=0;s<A.length&&!A[s].includes("DetermineComponentFrameRoot");)s++;for(;c<K.length&&!K[c].includes("DetermineComponentFrameRoot");)c++;if(s===A.length||c===K.length)for(s=A.length-1,c=K.length-1;1<=s&&0<=c&&A[s]!==K[c];)c--;for(;1<=s&&0<=c;s--,c--)if(A[s]!==K[c]){if(s!==1||c!==1)do if(s--,c--,0>c||A[s]!==K[c]){var ue=`
|
|
46
|
-
`+A[s].replace(" at new "," at ");return e.displayName&&ue.includes("<anonymous>")&&(ue=ue.replace("<anonymous>",e.displayName)),ue}while(1<=s&&0<=c);break}}}finally{ks=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?ua(a):""}function xb(e){switch(e.tag){case 26:case 27:case 5:return ua(e.type);case 16:return ua("Lazy");case 13:return ua("Suspense");case 19:return ua("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 ua("Activity");default:return""}}function yf(e){try{var t="";do t+=xb(e),e=e.return;while(e);return t}catch(a){return`
|
|
47
|
-
Error generating stack: `+a.message+`
|
|
48
|
-
`+a.stack}}function ln(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function vf(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function pb(e){var t=vf(e)?"checked":"value",a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),s=""+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){s=""+b,d.call(this,b)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return s},setValue:function(b){s=""+b},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function no(e){e._valueTracker||(e._valueTracker=pb(e))}function jf(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),s="";return e&&(s=vf(e)?e.checked?"true":"false":e.value),e=s,e!==a?(t.setValue(e),!0):!1}function ao(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 mb=/[\n"\\]/g;function sn(e){return e.replace(mb,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Pi(e,t,a,s,c,d,b,S){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=""+ln(t)):e.value!==""+ln(t)&&(e.value=""+ln(t)):b!=="submit"&&b!=="reset"||e.removeAttribute("value"),t!=null?ec(e,b,ln(t)):a!=null?ec(e,b,ln(a)):s!=null&&e.removeAttribute("value"),c==null&&d!=null&&(e.defaultChecked=!!d),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?e.name=""+ln(S):e.removeAttribute("name")}function Nf(e,t,a,s,c,d,b,S){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?""+ln(a):"",t=t!=null?""+ln(t):a,S||t===e.value||(e.value=t),e.defaultValue=t}s=s??c,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=S?e.checked:!!s,e.defaultChecked=!!s,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(e.name=b)}function ec(e,t,a){t==="number"&&ao(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Nl(e,t,a,s){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&&s&&(e[a].defaultSelected=!0)}else{for(a=""+ln(a),t=null,c=0;c<e.length;c++){if(e[c].value===a){e[c].selected=!0,s&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function wf(e,t,a){if(t!=null&&(t=""+ln(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+ln(a):""}function Sf(e,t,a,s){if(t==null){if(s!=null){if(a!=null)throw Error(i(92));if(q(s)){if(1<s.length)throw Error(i(93));s=s[0]}a=s}a==null&&(a=""),t=a}a=ln(t),e.defaultValue=a,s=e.textContent,s===a&&s!==""&&s!==null&&(e.value=s)}function wl(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var gb=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 Ef(e,t,a){var s=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?s?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":s?e.setProperty(t,a):typeof a!="number"||a===0||gb.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function kf(e,t,a){if(t!=null&&typeof t!="object")throw Error(i(62));if(e=e.style,a!=null){for(var s in a)!a.hasOwnProperty(s)||t!=null&&t.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var c in t)s=t[c],t.hasOwnProperty(c)&&a[c]!==s&&Ef(e,c,s)}else for(var d in t)t.hasOwnProperty(d)&&Ef(e,d,t[d])}function tc(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 bb=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"]]),yb=/^[\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 yb.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var nc=null;function ac(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Sl=null,El=null;function _f(e){var t=oa(e);if(t&&(e=t.stateNode)){var a=e[kt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Pi(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="'+sn(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var s=a[t];if(s!==e&&s.form===e.form){var c=s[kt]||null;if(!c)throw Error(i(90));Pi(s,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<a.length;t++)s=a[t],s.form===e.form&&jf(s)}break e;case"textarea":wf(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&Nl(e,!!a.multiple,t,!1)}}}var lc=!1;function Cf(e,t,a){if(lc)return e(t,a);lc=!0;try{var s=e(t);return s}finally{if(lc=!1,(Sl!==null||El!==null)&&(Go(),Sl&&(t=Sl,e=El,El=Sl=null,_f(t),e)))for(t=0;t<e.length;t++)_f(e[t])}}function _s(e,t){var a=e.stateNode;if(a===null)return null;var s=a[kt]||null;if(s===null)return null;a=s[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":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(i(231,t,typeof a));return a}var Hn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),sc=!1;if(Hn)try{var Cs={};Object.defineProperty(Cs,"passive",{get:function(){sc=!0}}),window.addEventListener("test",Cs,Cs),window.removeEventListener("test",Cs,Cs)}catch{sc=!1}var da=null,rc=null,so=null;function Tf(){if(so)return so;var e,t=rc,a=t.length,s,c="value"in da?da.value:da.textContent,d=c.length;for(e=0;e<a&&t[e]===c[e];e++);var b=a-e;for(s=1;s<=b&&t[a-s]===c[d-s];s++);return so=c.slice(e,1<s?1-s:void 0)}function ro(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 oo(){return!0}function Mf(){return!1}function Ut(e){function t(a,s,c,d,b){this._reactName=a,this._targetInst=c,this.type=s,this.nativeEvent=d,this.target=b,this.currentTarget=null;for(var S in e)e.hasOwnProperty(S)&&(a=e[S],this[S]=a?a(d):d[S]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?oo:Mf,this.isPropagationStopped=Mf,this}return g(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=oo)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=oo)},persist:function(){},isPersistent:oo}),t}var Za={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},io=Ut(Za),Ts=g({},Za,{view:0,detail:0}),vb=Ut(Ts),oc,ic,Ms,co=g({},Ts,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:uc,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!==Ms&&(Ms&&e.type==="mousemove"?(oc=e.screenX-Ms.screenX,ic=e.screenY-Ms.screenY):ic=oc=0,Ms=e),oc)},movementY:function(e){return"movementY"in e?e.movementY:ic}}),Af=Ut(co),jb=g({},co,{dataTransfer:0}),Nb=Ut(jb),wb=g({},Ts,{relatedTarget:0}),cc=Ut(wb),Sb=g({},Za,{animationName:0,elapsedTime:0,pseudoElement:0}),Eb=Ut(Sb),kb=g({},Za,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),_b=Ut(kb),Cb=g({},Za,{data:0}),Rf=Ut(Cb),Tb={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Mb={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"},Ab={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Rb(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Ab[e])?!!t[e]:!1}function uc(){return Rb}var zb=g({},Ts,{key:function(e){if(e.key){var t=Tb[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ro(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Mb[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:uc,charCode:function(e){return e.type==="keypress"?ro(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ro(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Ob=Ut(zb),Db=g({},co,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),zf=Ut(Db),Hb=g({},Ts,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:uc}),Ub=Ut(Hb),Bb=g({},Za,{propertyName:0,elapsedTime:0,pseudoElement:0}),$b=Ut(Bb),qb=g({},co,{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}),Lb=Ut(qb),Yb=g({},Za,{newState:0,oldState:0}),Vb=Ut(Yb),Gb=[9,13,27,32],dc=Hn&&"CompositionEvent"in window,As=null;Hn&&"documentMode"in document&&(As=document.documentMode);var Xb=Hn&&"TextEvent"in window&&!As,Of=Hn&&(!dc||As&&8<As&&11>=As),Df=" ",Hf=!1;function Uf(e,t){switch(e){case"keyup":return Gb.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Bf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var kl=!1;function Zb(e,t){switch(e){case"compositionend":return Bf(t);case"keypress":return t.which!==32?null:(Hf=!0,Df);case"textInput":return e=t.data,e===Df&&Hf?null:e;default:return null}}function Wb(e,t){if(kl)return e==="compositionend"||!dc&&Uf(e,t)?(e=Tf(),so=rc=da=null,kl=!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 Of&&t.locale!=="ko"?null:t.data;default:return null}}var Qb={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 $f(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Qb[e.type]:t==="textarea"}function qf(e,t,a,s){Sl?El?El.push(s):El=[s]:Sl=s,t=Jo(t,"onChange"),0<t.length&&(a=new io("onChange","change",null,a,s),e.push({event:a,listeners:t}))}var Rs=null,zs=null;function Kb(e){vp(e,0)}function uo(e){var t=Ga(e);if(jf(t))return e}function Lf(e,t){if(e==="change")return t}var Yf=!1;if(Hn){var fc;if(Hn){var hc="oninput"in document;if(!hc){var Vf=document.createElement("div");Vf.setAttribute("oninput","return;"),hc=typeof Vf.oninput=="function"}fc=hc}else fc=!1;Yf=fc&&(!document.documentMode||9<document.documentMode)}function Gf(){Rs&&(Rs.detachEvent("onpropertychange",Xf),zs=Rs=null)}function Xf(e){if(e.propertyName==="value"&&uo(zs)){var t=[];qf(t,zs,e,ac(e)),Cf(Kb,t)}}function Jb(e,t,a){e==="focusin"?(Gf(),Rs=t,zs=a,Rs.attachEvent("onpropertychange",Xf)):e==="focusout"&&Gf()}function Fb(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return uo(zs)}function Ib(e,t){if(e==="click")return uo(t)}function Pb(e,t){if(e==="input"||e==="change")return uo(t)}function ey(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Gt=typeof Object.is=="function"?Object.is:ey;function Os(e,t){if(Gt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),s=Object.keys(t);if(a.length!==s.length)return!1;for(s=0;s<a.length;s++){var c=a[s];if(!Ee.call(t,c)||!Gt(e[c],t[c]))return!1}return!0}function Zf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Wf(e,t){var a=Zf(e);e=0;for(var s;a;){if(a.nodeType===3){if(s=e+a.textContent.length,e<=t&&s>=t)return{node:a,offset:t-e};e=s}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Zf(a)}}function Qf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Qf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Kf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ao(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=ao(e.document)}return t}function xc(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 ty=Hn&&"documentMode"in document&&11>=document.documentMode,_l=null,pc=null,Ds=null,mc=!1;function Jf(e,t,a){var s=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;mc||_l==null||_l!==ao(s)||(s=_l,"selectionStart"in s&&xc(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Ds&&Os(Ds,s)||(Ds=s,s=Jo(pc,"onSelect"),0<s.length&&(t=new io("onSelect","select",null,t,a),e.push({event:t,listeners:s}),t.target=_l)))}function Wa(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Cl={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")},gc={},Ff={};Hn&&(Ff=document.createElement("div").style,"AnimationEvent"in window||(delete Cl.animationend.animation,delete Cl.animationiteration.animation,delete Cl.animationstart.animation),"TransitionEvent"in window||delete Cl.transitionend.transition);function Qa(e){if(gc[e])return gc[e];if(!Cl[e])return e;var t=Cl[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in Ff)return gc[e]=t[a];return e}var If=Qa("animationend"),Pf=Qa("animationiteration"),eh=Qa("animationstart"),ny=Qa("transitionrun"),ay=Qa("transitionstart"),ly=Qa("transitioncancel"),th=Qa("transitionend"),nh=new Map,bc="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(" ");bc.push("scrollEnd");function bn(e,t){nh.set(e,t),Dn(t,[e])}var ah=new WeakMap;function rn(e,t){if(typeof e=="object"&&e!==null){var a=ah.get(e);return a!==void 0?a:(t={value:e,source:t,stack:yf(t)},ah.set(e,t),t)}return{value:e,source:t,stack:yf(t)}}var on=[],Tl=0,yc=0;function fo(){for(var e=Tl,t=yc=Tl=0;t<e;){var a=on[t];on[t++]=null;var s=on[t];on[t++]=null;var c=on[t];on[t++]=null;var d=on[t];if(on[t++]=null,s!==null&&c!==null){var b=s.pending;b===null?c.next=c:(c.next=b.next,b.next=c),s.pending=c}d!==0&&lh(a,c,d)}}function ho(e,t,a,s){on[Tl++]=e,on[Tl++]=t,on[Tl++]=a,on[Tl++]=s,yc|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function vc(e,t,a,s){return ho(e,t,a,s),xo(e)}function Ml(e,t){return ho(e,null,null,t),xo(e)}function lh(e,t,a){e.lanes|=a;var s=e.alternate;s!==null&&(s.lanes|=a);for(var c=!1,d=e.return;d!==null;)d.childLanes|=a,s=d.alternate,s!==null&&(s.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-st(a),e=d.hiddenUpdates,s=e[c],s===null?e[c]=[t]:s.push(t),t.lane=a|536870912),d):null}function xo(e){if(50<rr)throw rr=0,ku=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Al={};function sy(e,t,a,s){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=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Xt(e,t,a,s){return new sy(e,t,a,s)}function jc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Un(e,t){var a=e.alternate;return a===null?(a=Xt(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 sh(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 po(e,t,a,s,c,d){var b=0;if(s=e,typeof e=="function")jc(e)&&(b=1);else if(typeof e=="string")b=ov(e,a,le.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case F:return e=Xt(31,a,t,c),e.elementType=F,e.lanes=d,e;case C:return Ka(a.children,c,d,t);case _:b=8,c|=24;break;case T:return e=Xt(12,a,t,c|2),e.elementType=T,e.lanes=d,e;case H:return e=Xt(13,a,t,c),e.elementType=H,e.lanes=d,e;case Z:return e=Xt(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 B:b=9;break e;case D:b=11;break e;case X:b=14;break e;case ce:b=16,s=null;break e}b=29,a=Error(i(130,e===null?"null":typeof e,"")),s=null}return t=Xt(b,a,t,c),t.elementType=e,t.type=s,t.lanes=d,t}function Ka(e,t,a,s){return e=Xt(7,e,s,t),e.lanes=a,e}function Nc(e,t,a){return e=Xt(6,e,null,t),e.lanes=a,e}function wc(e,t,a){return t=Xt(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Rl=[],zl=0,mo=null,go=0,cn=[],un=0,Ja=null,Bn=1,$n="";function Fa(e,t){Rl[zl++]=go,Rl[zl++]=mo,mo=e,go=t}function rh(e,t,a){cn[un++]=Bn,cn[un++]=$n,cn[un++]=Ja,Ja=e;var s=Bn;e=$n;var c=32-st(s)-1;s&=~(1<<c),a+=1;var d=32-st(t)+c;if(30<d){var b=c-c%5;d=(s&(1<<b)-1).toString(32),s>>=b,c-=b,Bn=1<<32-st(t)+c|a<<c|s,$n=d+e}else Bn=1<<d|a<<c|s,$n=e}function Sc(e){e.return!==null&&(Fa(e,1),rh(e,1,0))}function Ec(e){for(;e===mo;)mo=Rl[--zl],Rl[zl]=null,go=Rl[--zl],Rl[zl]=null;for(;e===Ja;)Ja=cn[--un],cn[un]=null,$n=cn[--un],cn[un]=null,Bn=cn[--un],cn[un]=null}var zt=null,Ie=null,$e=!1,Ia=null,kn=!1,kc=Error(i(519));function Pa(e){var t=Error(i(418,""));throw Bs(rn(t,e)),kc}function oh(e){var t=e.stateNode,a=e.type,s=e.memoizedProps;switch(t[xt]=e,t[kt]=s,a){case"dialog":De("cancel",t),De("close",t);break;case"iframe":case"object":case"embed":De("load",t);break;case"video":case"audio":for(a=0;a<ir.length;a++)De(ir[a],t);break;case"source":De("error",t);break;case"img":case"image":case"link":De("error",t),De("load",t);break;case"details":De("toggle",t);break;case"input":De("invalid",t),Nf(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0),no(t);break;case"select":De("invalid",t);break;case"textarea":De("invalid",t),Sf(t,s.value,s.defaultValue,s.children),no(t)}a=s.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||s.suppressHydrationWarning===!0||Sp(t.textContent,a)?(s.popover!=null&&(De("beforetoggle",t),De("toggle",t)),s.onScroll!=null&&De("scroll",t),s.onScrollEnd!=null&&De("scrollend",t),s.onClick!=null&&(t.onclick=Fo),t=!0):t=!1,t||Pa(e)}function ih(e){for(zt=e.return;zt;)switch(zt.tag){case 5:case 13:kn=!1;return;case 27:case 3:kn=!0;return;default:zt=zt.return}}function Hs(e){if(e!==zt)return!1;if(!$e)return ih(e),$e=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Yu(e.type,e.memoizedProps)),a=!a),a&&Ie&&Pa(e),ih(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){Ie=vn(e.nextSibling);break e}t--}else a!=="$"&&a!=="$!"&&a!=="$?"||t++;e=e.nextSibling}Ie=null}}else t===27?(t=Ie,_a(e.type)?(e=Zu,Zu=null,Ie=e):Ie=t):Ie=zt?vn(e.stateNode.nextSibling):null;return!0}function Us(){Ie=zt=null,$e=!1}function ch(){var e=Ia;return e!==null&&(qt===null?qt=e:qt.push.apply(qt,e),Ia=null),e}function Bs(e){Ia===null?Ia=[e]:Ia.push(e)}var _c=R(null),el=null,qn=null;function fa(e,t,a){I(_c,t._currentValue),t._currentValue=a}function Ln(e){e._currentValue=_c.current,V(_c)}function Cc(e,t,a){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===a)break;e=e.return}}function Tc(e,t,a,s){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 S=d;d=c;for(var A=0;A<t.length;A++)if(S.context===t[A]){d.lanes|=a,S=d.alternate,S!==null&&(S.lanes|=a),Cc(d.return,a,e),s||(b=null);break e}d=S.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),Cc(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 $s(e,t,a,s){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 S=c.type;Gt(c.pendingProps.value,b.value)||(e!==null?e.push(S):e=[S])}}else if(c===ge.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&&Tc(t,e,a,s),t.flags|=262144}function bo(e){for(e=e.firstContext;e!==null;){if(!Gt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function tl(e){el=e,qn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function _t(e){return uh(el,e)}function yo(e,t){return el===null&&tl(e),uh(e,t)}function uh(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},qn===null){if(e===null)throw Error(i(308));qn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else qn=qn.next=t;return a}var ry=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,s){e.push(s)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},oy=n.unstable_scheduleCallback,iy=n.unstable_NormalPriority,ct={$$typeof:L,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Mc(){return{controller:new ry,data:new Map,refCount:0}}function qs(e){e.refCount--,e.refCount===0&&oy(iy,function(){e.controller.abort()})}var Ls=null,Ac=0,Ol=0,Dl=null;function cy(e,t){if(Ls===null){var a=Ls=[];Ac=0,Ol=zu(),Dl={status:"pending",value:void 0,then:function(s){a.push(s)}}}return Ac++,t.then(dh,dh),t}function dh(){if(--Ac===0&&Ls!==null){Dl!==null&&(Dl.status="fulfilled");var e=Ls;Ls=null,Ol=0,Dl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function uy(e,t){var a=[],s={status:"pending",value:null,reason:null,then:function(c){a.push(c)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var c=0;c<a.length;c++)(0,a[c])(t)},function(c){for(s.status="rejected",s.reason=c,c=0;c<a.length;c++)(0,a[c])(void 0)}),s}var fh=k.S;k.S=function(e,t){typeof t=="object"&&t!==null&&typeof t.then=="function"&&cy(e,t),fh!==null&&fh(e,t)};var nl=R(null);function Rc(){var e=nl.current;return e!==null?e:We.pooledCache}function vo(e,t){t===null?I(nl,nl.current):I(nl,t.pool)}function hh(){var e=Rc();return e===null?null:{parent:ct._currentValue,pool:e}}var Ys=Error(i(460)),xh=Error(i(474)),jo=Error(i(542)),zc={then:function(){}};function ph(e){return e=e.status,e==="fulfilled"||e==="rejected"}function No(){}function mh(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(No,No),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,bh(e),e;default:if(typeof t.status=="string")t.then(No,No);else{if(e=We,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var c=t;c.status="fulfilled",c.value=s}},function(s){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,bh(e),e}throw Vs=t,Ys}}var Vs=null;function gh(){if(Vs===null)throw Error(i(459));var e=Vs;return Vs=null,e}function bh(e){if(e===Ys||e===jo)throw Error(i(483))}var ha=!1;function Oc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Dc(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 xa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function pa(e,t,a){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(Le&2)!==0){var c=s.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),s.pending=t,t=xo(e),lh(e,null,a),t}return ho(e,s,t,a),xo(e)}function Gs(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,a|=s,t.lanes=a,Wr(e,a)}}function Hc(e,t){var a=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,a===s)){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:s.baseState,firstBaseUpdate:c,lastBaseUpdate:d,shared:s.shared,callbacks:s.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var Uc=!1;function Xs(){if(Uc){var e=Dl;if(e!==null)throw e}}function Zs(e,t,a,s){Uc=!1;var c=e.updateQueue;ha=!1;var d=c.firstBaseUpdate,b=c.lastBaseUpdate,S=c.shared.pending;if(S!==null){c.shared.pending=null;var A=S,K=A.next;A.next=null,b===null?d=K:b.next=K,b=A;var ue=e.alternate;ue!==null&&(ue=ue.updateQueue,S=ue.lastBaseUpdate,S!==b&&(S===null?ue.firstBaseUpdate=K:S.next=K,ue.lastBaseUpdate=A))}if(d!==null){var he=c.baseState;b=0,ue=K=A=null,S=d;do{var P=S.lane&-536870913,ee=P!==S.lane;if(ee?(He&P)===P:(s&P)===P){P!==0&&P===Ol&&(Uc=!0),ue!==null&&(ue=ue.next={lane:0,tag:S.tag,payload:S.payload,callback:null,next:null});e:{var ke=e,we=S;P=t;var Xe=a;switch(we.tag){case 1:if(ke=we.payload,typeof ke=="function"){he=ke.call(Xe,he,P);break e}he=ke;break e;case 3:ke.flags=ke.flags&-65537|128;case 0:if(ke=we.payload,P=typeof ke=="function"?ke.call(Xe,he,P):ke,P==null)break e;he=g({},he,P);break e;case 2:ha=!0}}P=S.callback,P!==null&&(e.flags|=64,ee&&(e.flags|=8192),ee=c.callbacks,ee===null?c.callbacks=[P]:ee.push(P))}else ee={lane:P,tag:S.tag,payload:S.payload,callback:S.callback,next:null},ue===null?(K=ue=ee,A=he):ue=ue.next=ee,b|=P;if(S=S.next,S===null){if(S=c.shared.pending,S===null)break;ee=S,S=ee.next,ee.next=null,c.lastBaseUpdate=ee,c.shared.pending=null}}while(!0);ue===null&&(A=he),c.baseState=A,c.firstBaseUpdate=K,c.lastBaseUpdate=ue,d===null&&(c.shared.lanes=0),wa|=b,e.lanes=b,e.memoizedState=he}}function yh(e,t){if(typeof e!="function")throw Error(i(191,e));e.call(t)}function vh(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)yh(a[e],t)}var Hl=R(null),wo=R(0);function jh(e,t){e=Qn,I(wo,e),I(Hl,t),Qn=e|t.baseLanes}function Bc(){I(wo,Qn),I(Hl,Hl.current)}function $c(){Qn=wo.current,V(Hl),V(wo)}var ma=0,Ae=null,Ve=null,ot=null,So=!1,Ul=!1,al=!1,Eo=0,Ws=0,Bl=null,dy=0;function at(){throw Error(i(321))}function qc(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!Gt(e[a],t[a]))return!1;return!0}function Lc(e,t,a,s,c,d){return ma=d,Ae=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,k.H=e===null||e.memoizedState===null?lx:sx,al=!1,d=a(s,c),al=!1,Ul&&(d=wh(t,a,s,c)),Nh(e),d}function Nh(e){k.H=Ao;var t=Ve!==null&&Ve.next!==null;if(ma=0,ot=Ve=Ae=null,So=!1,Ws=0,Bl=null,t)throw Error(i(300));e===null||pt||(e=e.dependencies,e!==null&&bo(e)&&(pt=!0))}function wh(e,t,a,s){Ae=e;var c=0;do{if(Ul&&(Bl=null),Ws=0,Ul=!1,25<=c)throw Error(i(301));if(c+=1,ot=Ve=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=by,d=t(a,s)}while(Ul);return d}function fy(){var e=k.H,t=e.useState()[0];return t=typeof t.then=="function"?Qs(t):t,e=e.useState()[0],(Ve!==null?Ve.memoizedState:null)!==e&&(Ae.flags|=1024),t}function Yc(){var e=Eo!==0;return Eo=0,e}function Vc(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function Gc(e){if(So){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}So=!1}ma=0,ot=Ve=Ae=null,Ul=!1,Ws=Eo=0,Bl=null}function Bt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ot===null?Ae.memoizedState=ot=e:ot=ot.next=e,ot}function it(){if(Ve===null){var e=Ae.alternate;e=e!==null?e.memoizedState:null}else e=Ve.next;var t=ot===null?Ae.memoizedState:ot.next;if(t!==null)ot=t,Ve=e;else{if(e===null)throw Ae.alternate===null?Error(i(467)):Error(i(310));Ve=e,e={memoizedState:Ve.memoizedState,baseState:Ve.baseState,baseQueue:Ve.baseQueue,queue:Ve.queue,next:null},ot===null?Ae.memoizedState=ot=e:ot=ot.next=e}return ot}function Xc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Qs(e){var t=Ws;return Ws+=1,Bl===null&&(Bl=[]),e=mh(Bl,e,t),t=Ae,(ot===null?t.memoizedState:ot.next)===null&&(t=t.alternate,k.H=t===null||t.memoizedState===null?lx:sx),e}function ko(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Qs(e);if(e.$$typeof===L)return _t(e)}throw Error(i(438,String(e)))}function Zc(e){var t=null,a=Ae.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var s=Ae.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=Xc(),Ae.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),s=0;s<e;s++)a[s]=J;return t.index++,a}function Yn(e,t){return typeof t=="function"?t(e):t}function _o(e){var t=it();return Wc(t,Ve,e)}function Wc(e,t,a){var s=e.queue;if(s===null)throw Error(i(311));s.lastRenderedReducer=a;var c=e.baseQueue,d=s.pending;if(d!==null){if(c!==null){var b=c.next;c.next=d.next,d.next=b}t.baseQueue=c=d,s.pending=null}if(d=e.baseState,c===null)e.memoizedState=d;else{t=c.next;var S=b=null,A=null,K=t,ue=!1;do{var he=K.lane&-536870913;if(he!==K.lane?(He&he)===he:(ma&he)===he){var P=K.revertLane;if(P===0)A!==null&&(A=A.next={lane:0,revertLane:0,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null}),he===Ol&&(ue=!0);else if((ma&P)===P){K=K.next,P===Ol&&(ue=!0);continue}else he={lane:0,revertLane:K.revertLane,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null},A===null?(S=A=he,b=d):A=A.next=he,Ae.lanes|=P,wa|=P;he=K.action,al&&a(d,he),d=K.hasEagerState?K.eagerState:a(d,he)}else P={lane:he,revertLane:K.revertLane,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null},A===null?(S=A=P,b=d):A=A.next=P,Ae.lanes|=he,wa|=he;K=K.next}while(K!==null&&K!==t);if(A===null?b=d:A.next=S,!Gt(d,e.memoizedState)&&(pt=!0,ue&&(a=Dl,a!==null)))throw a;e.memoizedState=d,e.baseState=b,e.baseQueue=A,s.lastRenderedState=d}return c===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function Qc(e){var t=it(),a=t.queue;if(a===null)throw Error(i(311));a.lastRenderedReducer=e;var s=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);Gt(d,t.memoizedState)||(pt=!0),t.memoizedState=d,t.baseQueue===null&&(t.baseState=d),a.lastRenderedState=d}return[d,s]}function Sh(e,t,a){var s=Ae,c=it(),d=$e;if(d){if(a===void 0)throw Error(i(407));a=a()}else a=t();var b=!Gt((Ve||c).memoizedState,a);b&&(c.memoizedState=a,pt=!0),c=c.queue;var S=_h.bind(null,s,c,e);if(Ks(2048,8,S,[e]),c.getSnapshot!==t||b||ot!==null&&ot.memoizedState.tag&1){if(s.flags|=2048,$l(9,Co(),kh.bind(null,s,c,a,t),null),We===null)throw Error(i(349));d||(ma&124)!==0||Eh(s,t,a)}return a}function Eh(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=Ae.updateQueue,t===null?(t=Xc(),Ae.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function kh(e,t,a,s){t.value=a,t.getSnapshot=s,Ch(t)&&Th(e)}function _h(e,t,a){return a(function(){Ch(t)&&Th(e)})}function Ch(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!Gt(e,a)}catch{return!0}}function Th(e){var t=Ml(e,2);t!==null&&Jt(t,e,2)}function Kc(e){var t=Bt();if(typeof e=="function"){var a=e;if(e=a(),al){At(!0);try{a()}finally{At(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yn,lastRenderedState:e},t}function Mh(e,t,a,s){return e.baseState=a,Wc(e,Ve,typeof s=="function"?s:Yn)}function hy(e,t,a,s,c){if(Mo(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,s(d),a=t.pending,a===null?(d.next=t.pending=d,Ah(t,d)):(d.next=a.next,t.pending=a.next=d)}}function Ah(e,t){var a=t.action,s=t.payload,c=e.state;if(t.isTransition){var d=k.T,b={};k.T=b;try{var S=a(c,s),A=k.S;A!==null&&A(b,S),Rh(e,t,S)}catch(K){Jc(e,t,K)}finally{k.T=d}}else try{d=a(c,s),Rh(e,t,d)}catch(K){Jc(e,t,K)}}function Rh(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(s){zh(e,t,s)},function(s){return Jc(e,t,s)}):zh(e,t,a)}function zh(e,t,a){t.status="fulfilled",t.value=a,Oh(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,Ah(e,a)))}function Jc(e,t,a){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=a,Oh(t),t=t.next;while(t!==s)}e.action=null}function Oh(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Dh(e,t){return t}function Hh(e,t){if($e){var a=We.formState;if(a!==null){e:{var s=Ae;if($e){if(Ie){t:{for(var c=Ie,d=kn;c.nodeType!==8;){if(!d){c=null;break t}if(c=vn(c.nextSibling),c===null){c=null;break t}}d=c.data,c=d==="F!"||d==="F"?c:null}if(c){Ie=vn(c.nextSibling),s=c.data==="F!";break e}}Pa(s)}s=!1}s&&(t=a[0])}}return a=Bt(),a.memoizedState=a.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Dh,lastRenderedState:t},a.queue=s,a=tx.bind(null,Ae,s),s.dispatch=a,s=Kc(!1),d=tu.bind(null,Ae,!1,s.queue),s=Bt(),c={state:t,dispatch:null,action:e,pending:null},s.queue=c,a=hy.bind(null,Ae,c,d,a),c.dispatch=a,s.memoizedState=e,[t,a,!1]}function Uh(e){var t=it();return Bh(t,Ve,e)}function Bh(e,t,a){if(t=Wc(e,t,Dh)[0],e=_o(Yn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=Qs(t)}catch(b){throw b===Ys?jo:b}else s=t;t=it();var c=t.queue,d=c.dispatch;return a!==t.memoizedState&&(Ae.flags|=2048,$l(9,Co(),xy.bind(null,c,a),null)),[s,d,e]}function xy(e,t){e.action=t}function $h(e){var t=it(),a=Ve;if(a!==null)return Bh(t,a,e);it(),t=t.memoizedState,a=it();var s=a.queue.dispatch;return a.memoizedState=e,[t,s,!1]}function $l(e,t,a,s){return e={tag:e,create:a,deps:s,inst:t,next:null},t=Ae.updateQueue,t===null&&(t=Xc(),Ae.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(s=a.next,a.next=e,e.next=s,t.lastEffect=e),e}function Co(){return{destroy:void 0,resource:void 0}}function qh(){return it().memoizedState}function To(e,t,a,s){var c=Bt();s=s===void 0?null:s,Ae.flags|=e,c.memoizedState=$l(1|t,Co(),a,s)}function Ks(e,t,a,s){var c=it();s=s===void 0?null:s;var d=c.memoizedState.inst;Ve!==null&&s!==null&&qc(s,Ve.memoizedState.deps)?c.memoizedState=$l(t,d,a,s):(Ae.flags|=e,c.memoizedState=$l(1|t,d,a,s))}function Lh(e,t){To(8390656,8,e,t)}function Yh(e,t){Ks(2048,8,e,t)}function Vh(e,t){return Ks(4,2,e,t)}function Gh(e,t){return Ks(4,4,e,t)}function Xh(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 Zh(e,t,a){a=a!=null?a.concat([e]):null,Ks(4,4,Xh.bind(null,t,e),a)}function Fc(){}function Wh(e,t){var a=it();t=t===void 0?null:t;var s=a.memoizedState;return t!==null&&qc(t,s[1])?s[0]:(a.memoizedState=[e,t],e)}function Qh(e,t){var a=it();t=t===void 0?null:t;var s=a.memoizedState;if(t!==null&&qc(t,s[1]))return s[0];if(s=e(),al){At(!0);try{e()}finally{At(!1)}}return a.memoizedState=[s,t],s}function Ic(e,t,a){return a===void 0||(ma&1073741824)!==0?e.memoizedState=t:(e.memoizedState=a,e=Fx(),Ae.lanes|=e,wa|=e,a)}function Kh(e,t,a,s){return Gt(a,t)?a:Hl.current!==null?(e=Ic(e,a,s),Gt(e,t)||(pt=!0),e):(ma&42)===0?(pt=!0,e.memoizedState=a):(e=Fx(),Ae.lanes|=e,wa|=e,t)}function Jh(e,t,a,s,c){var d=U.p;U.p=d!==0&&8>d?d:8;var b=k.T,S={};k.T=S,tu(e,!1,t,a);try{var A=c(),K=k.S;if(K!==null&&K(S,A),A!==null&&typeof A=="object"&&typeof A.then=="function"){var ue=uy(A,s);Js(e,t,ue,Kt(e))}else Js(e,t,s,Kt(e))}catch(he){Js(e,t,{then:function(){},status:"rejected",reason:he},Kt())}finally{U.p=d,k.T=b}}function py(){}function Pc(e,t,a,s){if(e.tag!==5)throw Error(i(476));var c=Fh(e).queue;Jh(e,c,t,z,a===null?py:function(){return Ih(e),a(s)})}function Fh(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:z,baseState:z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yn,lastRenderedState:z},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yn,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ih(e){var t=Fh(e).next.queue;Js(e,t,{},Kt())}function eu(){return _t(xr)}function Ph(){return it().memoizedState}function ex(){return it().memoizedState}function my(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=Kt();e=xa(a);var s=pa(t,e,a);s!==null&&(Jt(s,t,a),Gs(s,t,a)),t={cache:Mc()},e.payload=t;return}t=t.return}}function gy(e,t,a){var s=Kt();a={lane:s,revertLane:0,action:a,hasEagerState:!1,eagerState:null,next:null},Mo(e)?nx(t,a):(a=vc(e,t,a,s),a!==null&&(Jt(a,e,s),ax(a,t,s)))}function tx(e,t,a){var s=Kt();Js(e,t,a,s)}function Js(e,t,a,s){var c={lane:s,revertLane:0,action:a,hasEagerState:!1,eagerState:null,next:null};if(Mo(e))nx(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,S=d(b,a);if(c.hasEagerState=!0,c.eagerState=S,Gt(S,b))return ho(e,t,c,0),We===null&&fo(),!1}catch{}finally{}if(a=vc(e,t,c,s),a!==null)return Jt(a,e,s),ax(a,t,s),!0}return!1}function tu(e,t,a,s){if(s={lane:2,revertLane:zu(),action:s,hasEagerState:!1,eagerState:null,next:null},Mo(e)){if(t)throw Error(i(479))}else t=vc(e,a,s,2),t!==null&&Jt(t,e,2)}function Mo(e){var t=e.alternate;return e===Ae||t!==null&&t===Ae}function nx(e,t){Ul=So=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function ax(e,t,a){if((a&4194048)!==0){var s=t.lanes;s&=e.pendingLanes,a|=s,t.lanes=a,Wr(e,a)}}var Ao={readContext:_t,use:ko,useCallback:at,useContext:at,useEffect:at,useImperativeHandle:at,useLayoutEffect:at,useInsertionEffect:at,useMemo:at,useReducer:at,useRef:at,useState:at,useDebugValue:at,useDeferredValue:at,useTransition:at,useSyncExternalStore:at,useId:at,useHostTransitionStatus:at,useFormState:at,useActionState:at,useOptimistic:at,useMemoCache:at,useCacheRefresh:at},lx={readContext:_t,use:ko,useCallback:function(e,t){return Bt().memoizedState=[e,t===void 0?null:t],e},useContext:_t,useEffect:Lh,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,To(4194308,4,Xh.bind(null,t,e),a)},useLayoutEffect:function(e,t){return To(4194308,4,e,t)},useInsertionEffect:function(e,t){To(4,2,e,t)},useMemo:function(e,t){var a=Bt();t=t===void 0?null:t;var s=e();if(al){At(!0);try{e()}finally{At(!1)}}return a.memoizedState=[s,t],s},useReducer:function(e,t,a){var s=Bt();if(a!==void 0){var c=a(t);if(al){At(!0);try{a(t)}finally{At(!1)}}}else c=t;return s.memoizedState=s.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},s.queue=e,e=e.dispatch=gy.bind(null,Ae,e),[s.memoizedState,e]},useRef:function(e){var t=Bt();return e={current:e},t.memoizedState=e},useState:function(e){e=Kc(e);var t=e.queue,a=tx.bind(null,Ae,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Fc,useDeferredValue:function(e,t){var a=Bt();return Ic(a,e,t)},useTransition:function(){var e=Kc(!1);return e=Jh.bind(null,Ae,e.queue,!0,!1),Bt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var s=Ae,c=Bt();if($e){if(a===void 0)throw Error(i(407));a=a()}else{if(a=t(),We===null)throw Error(i(349));(He&124)!==0||Eh(s,t,a)}c.memoizedState=a;var d={value:a,getSnapshot:t};return c.queue=d,Lh(_h.bind(null,s,d,e),[e]),s.flags|=2048,$l(9,Co(),kh.bind(null,s,d,a,t),null),a},useId:function(){var e=Bt(),t=We.identifierPrefix;if($e){var a=$n,s=Bn;a=(s&~(1<<32-st(s)-1)).toString(32)+a,t="«"+t+"R"+a,a=Eo++,0<a&&(t+="H"+a.toString(32)),t+="»"}else a=dy++,t="«"+t+"r"+a.toString(32)+"»";return e.memoizedState=t},useHostTransitionStatus:eu,useFormState:Hh,useActionState:Hh,useOptimistic:function(e){var t=Bt();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=tu.bind(null,Ae,!0,a),a.dispatch=t,[e,t]},useMemoCache:Zc,useCacheRefresh:function(){return Bt().memoizedState=my.bind(null,Ae)}},sx={readContext:_t,use:ko,useCallback:Wh,useContext:_t,useEffect:Yh,useImperativeHandle:Zh,useInsertionEffect:Vh,useLayoutEffect:Gh,useMemo:Qh,useReducer:_o,useRef:qh,useState:function(){return _o(Yn)},useDebugValue:Fc,useDeferredValue:function(e,t){var a=it();return Kh(a,Ve.memoizedState,e,t)},useTransition:function(){var e=_o(Yn)[0],t=it().memoizedState;return[typeof e=="boolean"?e:Qs(e),t]},useSyncExternalStore:Sh,useId:Ph,useHostTransitionStatus:eu,useFormState:Uh,useActionState:Uh,useOptimistic:function(e,t){var a=it();return Mh(a,Ve,e,t)},useMemoCache:Zc,useCacheRefresh:ex},by={readContext:_t,use:ko,useCallback:Wh,useContext:_t,useEffect:Yh,useImperativeHandle:Zh,useInsertionEffect:Vh,useLayoutEffect:Gh,useMemo:Qh,useReducer:Qc,useRef:qh,useState:function(){return Qc(Yn)},useDebugValue:Fc,useDeferredValue:function(e,t){var a=it();return Ve===null?Ic(a,e,t):Kh(a,Ve.memoizedState,e,t)},useTransition:function(){var e=Qc(Yn)[0],t=it().memoizedState;return[typeof e=="boolean"?e:Qs(e),t]},useSyncExternalStore:Sh,useId:Ph,useHostTransitionStatus:eu,useFormState:$h,useActionState:$h,useOptimistic:function(e,t){var a=it();return Ve!==null?Mh(a,Ve,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Zc,useCacheRefresh:ex},ql=null,Fs=0;function Ro(e){var t=Fs;return Fs+=1,ql===null&&(ql=[]),mh(ql,e,t)}function Is(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function zo(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 rx(e){var t=e._init;return t(e._payload)}function ox(e){function t(G,$){if(e){var Q=G.deletions;Q===null?(G.deletions=[$],G.flags|=16):Q.push($)}}function a(G,$){if(!e)return null;for(;$!==null;)t(G,$),$=$.sibling;return null}function s(G){for(var $=new Map;G!==null;)G.key!==null?$.set(G.key,G):$.set(G.index,G),G=G.sibling;return $}function c(G,$){return G=Un(G,$),G.index=0,G.sibling=null,G}function d(G,$,Q){return G.index=Q,e?(Q=G.alternate,Q!==null?(Q=Q.index,Q<$?(G.flags|=67108866,$):Q):(G.flags|=67108866,$)):(G.flags|=1048576,$)}function b(G){return e&&G.alternate===null&&(G.flags|=67108866),G}function S(G,$,Q,fe){return $===null||$.tag!==6?($=Nc(Q,G.mode,fe),$.return=G,$):($=c($,Q),$.return=G,$)}function A(G,$,Q,fe){var ye=Q.type;return ye===C?ue(G,$,Q.props.children,fe,Q.key):$!==null&&($.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===ce&&rx(ye)===$.type)?($=c($,Q.props),Is($,Q),$.return=G,$):($=po(Q.type,Q.key,Q.props,null,G.mode,fe),Is($,Q),$.return=G,$)}function K(G,$,Q,fe){return $===null||$.tag!==4||$.stateNode.containerInfo!==Q.containerInfo||$.stateNode.implementation!==Q.implementation?($=wc(Q,G.mode,fe),$.return=G,$):($=c($,Q.children||[]),$.return=G,$)}function ue(G,$,Q,fe,ye){return $===null||$.tag!==7?($=Ka(Q,G.mode,fe,ye),$.return=G,$):($=c($,Q),$.return=G,$)}function he(G,$,Q){if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return $=Nc(""+$,G.mode,Q),$.return=G,$;if(typeof $=="object"&&$!==null){switch($.$$typeof){case v:return Q=po($.type,$.key,$.props,null,G.mode,Q),Is(Q,$),Q.return=G,Q;case j:return $=wc($,G.mode,Q),$.return=G,$;case ce:var fe=$._init;return $=fe($._payload),he(G,$,Q)}if(q($)||te($))return $=Ka($,G.mode,Q,null),$.return=G,$;if(typeof $.then=="function")return he(G,Ro($),Q);if($.$$typeof===L)return he(G,yo(G,$),Q);zo(G,$)}return null}function P(G,$,Q,fe){var ye=$!==null?$.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return ye!==null?null:S(G,$,""+Q,fe);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case v:return Q.key===ye?A(G,$,Q,fe):null;case j:return Q.key===ye?K(G,$,Q,fe):null;case ce:return ye=Q._init,Q=ye(Q._payload),P(G,$,Q,fe)}if(q(Q)||te(Q))return ye!==null?null:ue(G,$,Q,fe,null);if(typeof Q.then=="function")return P(G,$,Ro(Q),fe);if(Q.$$typeof===L)return P(G,$,yo(G,Q),fe);zo(G,Q)}return null}function ee(G,$,Q,fe,ye){if(typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint")return G=G.get(Q)||null,S($,G,""+fe,ye);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case v:return G=G.get(fe.key===null?Q:fe.key)||null,A($,G,fe,ye);case j:return G=G.get(fe.key===null?Q:fe.key)||null,K($,G,fe,ye);case ce:var Re=fe._init;return fe=Re(fe._payload),ee(G,$,Q,fe,ye)}if(q(fe)||te(fe))return G=G.get(Q)||null,ue($,G,fe,ye,null);if(typeof fe.then=="function")return ee(G,$,Q,Ro(fe),ye);if(fe.$$typeof===L)return ee(G,$,Q,yo($,fe),ye);zo($,fe)}return null}function ke(G,$,Q,fe){for(var ye=null,Re=null,je=$,Se=$=0,gt=null;je!==null&&Se<Q.length;Se++){je.index>Se?(gt=je,je=null):gt=je.sibling;var Be=P(G,je,Q[Se],fe);if(Be===null){je===null&&(je=gt);break}e&&je&&Be.alternate===null&&t(G,je),$=d(Be,$,Se),Re===null?ye=Be:Re.sibling=Be,Re=Be,je=gt}if(Se===Q.length)return a(G,je),$e&&Fa(G,Se),ye;if(je===null){for(;Se<Q.length;Se++)je=he(G,Q[Se],fe),je!==null&&($=d(je,$,Se),Re===null?ye=je:Re.sibling=je,Re=je);return $e&&Fa(G,Se),ye}for(je=s(je);Se<Q.length;Se++)gt=ee(je,G,Se,Q[Se],fe),gt!==null&&(e&>.alternate!==null&&je.delete(gt.key===null?Se:gt.key),$=d(gt,$,Se),Re===null?ye=gt:Re.sibling=gt,Re=gt);return e&&je.forEach(function(Ra){return t(G,Ra)}),$e&&Fa(G,Se),ye}function we(G,$,Q,fe){if(Q==null)throw Error(i(151));for(var ye=null,Re=null,je=$,Se=$=0,gt=null,Be=Q.next();je!==null&&!Be.done;Se++,Be=Q.next()){je.index>Se?(gt=je,je=null):gt=je.sibling;var Ra=P(G,je,Be.value,fe);if(Ra===null){je===null&&(je=gt);break}e&&je&&Ra.alternate===null&&t(G,je),$=d(Ra,$,Se),Re===null?ye=Ra:Re.sibling=Ra,Re=Ra,je=gt}if(Be.done)return a(G,je),$e&&Fa(G,Se),ye;if(je===null){for(;!Be.done;Se++,Be=Q.next())Be=he(G,Be.value,fe),Be!==null&&($=d(Be,$,Se),Re===null?ye=Be:Re.sibling=Be,Re=Be);return $e&&Fa(G,Se),ye}for(je=s(je);!Be.done;Se++,Be=Q.next())Be=ee(je,G,Se,Be.value,fe),Be!==null&&(e&&Be.alternate!==null&&je.delete(Be.key===null?Se:Be.key),$=d(Be,$,Se),Re===null?ye=Be:Re.sibling=Be,Re=Be);return e&&je.forEach(function(yv){return t(G,yv)}),$e&&Fa(G,Se),ye}function Xe(G,$,Q,fe){if(typeof Q=="object"&&Q!==null&&Q.type===C&&Q.key===null&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case v:e:{for(var ye=Q.key;$!==null;){if($.key===ye){if(ye=Q.type,ye===C){if($.tag===7){a(G,$.sibling),fe=c($,Q.props.children),fe.return=G,G=fe;break e}}else if($.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===ce&&rx(ye)===$.type){a(G,$.sibling),fe=c($,Q.props),Is(fe,Q),fe.return=G,G=fe;break e}a(G,$);break}else t(G,$);$=$.sibling}Q.type===C?(fe=Ka(Q.props.children,G.mode,fe,Q.key),fe.return=G,G=fe):(fe=po(Q.type,Q.key,Q.props,null,G.mode,fe),Is(fe,Q),fe.return=G,G=fe)}return b(G);case j:e:{for(ye=Q.key;$!==null;){if($.key===ye)if($.tag===4&&$.stateNode.containerInfo===Q.containerInfo&&$.stateNode.implementation===Q.implementation){a(G,$.sibling),fe=c($,Q.children||[]),fe.return=G,G=fe;break e}else{a(G,$);break}else t(G,$);$=$.sibling}fe=wc(Q,G.mode,fe),fe.return=G,G=fe}return b(G);case ce:return ye=Q._init,Q=ye(Q._payload),Xe(G,$,Q,fe)}if(q(Q))return ke(G,$,Q,fe);if(te(Q)){if(ye=te(Q),typeof ye!="function")throw Error(i(150));return Q=ye.call(Q),we(G,$,Q,fe)}if(typeof Q.then=="function")return Xe(G,$,Ro(Q),fe);if(Q.$$typeof===L)return Xe(G,$,yo(G,Q),fe);zo(G,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,$!==null&&$.tag===6?(a(G,$.sibling),fe=c($,Q),fe.return=G,G=fe):(a(G,$),fe=Nc(Q,G.mode,fe),fe.return=G,G=fe),b(G)):a(G,$)}return function(G,$,Q,fe){try{Fs=0;var ye=Xe(G,$,Q,fe);return ql=null,ye}catch(je){if(je===Ys||je===jo)throw je;var Re=Xt(29,je,null,G.mode);return Re.lanes=fe,Re.return=G,Re}finally{}}}var Ll=ox(!0),ix=ox(!1),dn=R(null),_n=null;function ga(e){var t=e.alternate;I(ut,ut.current&1),I(dn,e),_n===null&&(t===null||Hl.current!==null||t.memoizedState!==null)&&(_n=e)}function cx(e){if(e.tag===22){if(I(ut,ut.current),I(dn,e),_n===null){var t=e.alternate;t!==null&&t.memoizedState!==null&&(_n=e)}}else ba()}function ba(){I(ut,ut.current),I(dn,dn.current)}function Vn(e){V(dn),_n===e&&(_n=null),V(ut)}var ut=R(0);function Oo(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==="$?"||Xu(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 nu(e,t,a,s){t=e.memoizedState,a=a(s,t),a=a==null?t:g({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var au={enqueueSetState:function(e,t,a){e=e._reactInternals;var s=Kt(),c=xa(s);c.payload=t,a!=null&&(c.callback=a),t=pa(e,c,s),t!==null&&(Jt(t,e,s),Gs(t,e,s))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var s=Kt(),c=xa(s);c.tag=1,c.payload=t,a!=null&&(c.callback=a),t=pa(e,c,s),t!==null&&(Jt(t,e,s),Gs(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=Kt(),s=xa(a);s.tag=2,t!=null&&(s.callback=t),t=pa(e,s,a),t!==null&&(Jt(t,e,a),Gs(t,e,a))}};function ux(e,t,a,s,c,d,b){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,d,b):t.prototype&&t.prototype.isPureReactComponent?!Os(a,s)||!Os(c,d):!0}function dx(e,t,a,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,s),t.state!==e&&au.enqueueReplaceState(t,t.state,null)}function ll(e,t){var a=t;if("ref"in t){a={};for(var s in t)s!=="ref"&&(a[s]=t[s])}if(e=e.defaultProps){a===t&&(a=g({},a));for(var c in e)a[c]===void 0&&(a[c]=e[c])}return a}var Do=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 fx(e){Do(e)}function hx(e){console.error(e)}function xx(e){Do(e)}function Ho(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function px(e,t,a){try{var s=e.onCaughtError;s(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=xa(a),a.tag=3,a.payload={element:null},a.callback=function(){Ho(e,t)},a}function mx(e){return e=xa(e),e.tag=3,e}function gx(e,t,a,s){var c=a.type.getDerivedStateFromError;if(typeof c=="function"){var d=s.value;e.payload=function(){return c(d)},e.callback=function(){px(t,a,s)}}var b=a.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(e.callback=function(){px(t,a,s),typeof c!="function"&&(Sa===null?Sa=new Set([this]):Sa.add(this));var S=s.stack;this.componentDidCatch(s.value,{componentStack:S!==null?S:""})})}function yy(e,t,a,s,c){if(a.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=a.alternate,t!==null&&$s(t,a,c,!0),a=dn.current,a!==null){switch(a.tag){case 13:return _n===null?Cu():a.alternate===null&&Pe===0&&(Pe=3),a.flags&=-257,a.flags|=65536,a.lanes=c,s===zc?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([s]):t.add(s),Mu(e,s,c)),!1;case 22:return a.flags|=65536,s===zc?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([s])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([s]):a.add(s)),Mu(e,s,c)),!1}throw Error(i(435,a.tag))}return Mu(e,s,c),Cu(),!1}if($e)return t=dn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,s!==kc&&(e=Error(i(422),{cause:s}),Bs(rn(e,a)))):(s!==kc&&(t=Error(i(423),{cause:s}),Bs(rn(t,a))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,s=rn(s,a),c=lu(e.stateNode,s,c),Hc(e,c),Pe!==4&&(Pe=2)),!1;var d=Error(i(520),{cause:s});if(d=rn(d,a),sr===null?sr=[d]:sr.push(d),Pe!==4&&(Pe=2),t===null)return!0;s=rn(s,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=c&-c,a.lanes|=e,e=lu(a.stateNode,s,e),Hc(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"&&(Sa===null||!Sa.has(d))))return a.flags|=65536,c&=-c,a.lanes|=c,c=mx(c),gx(c,e,a,s),Hc(a,c),!1}a=a.return}while(a!==null);return!1}var bx=Error(i(461)),pt=!1;function jt(e,t,a,s){t.child=e===null?ix(t,null,a,s):Ll(t,e.child,a,s)}function yx(e,t,a,s,c){a=a.render;var d=t.ref;if("ref"in s){var b={};for(var S in s)S!=="ref"&&(b[S]=s[S])}else b=s;return tl(t),s=Lc(e,t,a,b,d,c),S=Yc(),e!==null&&!pt?(Vc(e,t,c),Gn(e,t,c)):($e&&S&&Sc(t),t.flags|=1,jt(e,t,s,c),t.child)}function vx(e,t,a,s,c){if(e===null){var d=a.type;return typeof d=="function"&&!jc(d)&&d.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=d,jx(e,t,d,s,c)):(e=po(a.type,null,s,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(d=e.child,!fu(e,c)){var b=d.memoizedProps;if(a=a.compare,a=a!==null?a:Os,a(b,s)&&e.ref===t.ref)return Gn(e,t,c)}return t.flags|=1,e=Un(d,s),e.ref=t.ref,e.return=t,t.child=e}function jx(e,t,a,s,c){if(e!==null){var d=e.memoizedProps;if(Os(d,s)&&e.ref===t.ref)if(pt=!1,t.pendingProps=s=d,fu(e,c))(e.flags&131072)!==0&&(pt=!0);else return t.lanes=e.lanes,Gn(e,t,c)}return su(e,t,a,s,c)}function Nx(e,t,a){var s=t.pendingProps,c=s.children,d=e!==null?e.memoizedState:null;if(s.mode==="hidden"){if((t.flags&128)!==0){if(s=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&~s}else t.childLanes=0,t.child=null;return wx(e,t,s,a)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&vo(t,d!==null?d.cachePool:null),d!==null?jh(t,d):Bc(),cx(t);else return t.lanes=t.childLanes=536870912,wx(e,t,d!==null?d.baseLanes|a:a,a)}else d!==null?(vo(t,d.cachePool),jh(t,d),ba(),t.memoizedState=null):(e!==null&&vo(t,null),Bc(),ba());return jt(e,t,c,a),t.child}function wx(e,t,a,s){var c=Rc();return c=c===null?null:{parent:ct._currentValue,pool:c},t.memoizedState={baseLanes:a,cachePool:c},e!==null&&vo(t,null),Bc(),cx(t),e!==null&&$s(e,t,s,!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 su(e,t,a,s,c){return tl(t),a=Lc(e,t,a,s,void 0,c),s=Yc(),e!==null&&!pt?(Vc(e,t,c),Gn(e,t,c)):($e&&s&&Sc(t),t.flags|=1,jt(e,t,a,c),t.child)}function Sx(e,t,a,s,c,d){return tl(t),t.updateQueue=null,a=wh(t,s,a,c),Nh(e),s=Yc(),e!==null&&!pt?(Vc(e,t,d),Gn(e,t,d)):($e&&s&&Sc(t),t.flags|=1,jt(e,t,a,d),t.child)}function Ex(e,t,a,s,c){if(tl(t),t.stateNode===null){var d=Al,b=a.contextType;typeof b=="object"&&b!==null&&(d=_t(b)),d=new a(s,d),t.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=au,t.stateNode=d,d._reactInternals=t,d=t.stateNode,d.props=s,d.state=t.memoizedState,d.refs={},Oc(t),b=a.contextType,d.context=typeof b=="object"&&b!==null?_t(b):Al,d.state=t.memoizedState,b=a.getDerivedStateFromProps,typeof b=="function"&&(nu(t,a,b,s),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&&au.enqueueReplaceState(d,d.state,null),Zs(t,s,d,c),Xs(),d.state=t.memoizedState),typeof d.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){d=t.stateNode;var S=t.memoizedProps,A=ll(a,S);d.props=A;var K=d.context,ue=a.contextType;b=Al,typeof ue=="object"&&ue!==null&&(b=_t(ue));var he=a.getDerivedStateFromProps;ue=typeof he=="function"||typeof d.getSnapshotBeforeUpdate=="function",S=t.pendingProps!==S,ue||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(S||K!==b)&&dx(t,d,s,b),ha=!1;var P=t.memoizedState;d.state=P,Zs(t,s,d,c),Xs(),K=t.memoizedState,S||P!==K||ha?(typeof he=="function"&&(nu(t,a,he,s),K=t.memoizedState),(A=ha||ux(t,a,A,s,P,K,b))?(ue||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=s,t.memoizedState=K),d.props=s,d.state=K,d.context=b,s=A):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{d=t.stateNode,Dc(e,t),b=t.memoizedProps,ue=ll(a,b),d.props=ue,he=t.pendingProps,P=d.context,K=a.contextType,A=Al,typeof K=="object"&&K!==null&&(A=_t(K)),S=a.getDerivedStateFromProps,(K=typeof S=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(b!==he||P!==A)&&dx(t,d,s,A),ha=!1,P=t.memoizedState,d.state=P,Zs(t,s,d,c),Xs();var ee=t.memoizedState;b!==he||P!==ee||ha||e!==null&&e.dependencies!==null&&bo(e.dependencies)?(typeof S=="function"&&(nu(t,a,S,s),ee=t.memoizedState),(ue=ha||ux(t,a,ue,s,P,ee,A)||e!==null&&e.dependencies!==null&&bo(e.dependencies))?(K||typeof d.UNSAFE_componentWillUpdate!="function"&&typeof d.componentWillUpdate!="function"||(typeof d.componentWillUpdate=="function"&&d.componentWillUpdate(s,ee,A),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(s,ee,A)),typeof d.componentDidUpdate=="function"&&(t.flags|=4),typeof d.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof d.componentDidUpdate!="function"||b===e.memoizedProps&&P===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&P===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=ee),d.props=s,d.state=ee,d.context=A,s=ue):(typeof d.componentDidUpdate!="function"||b===e.memoizedProps&&P===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&P===e.memoizedState||(t.flags|=1024),s=!1)}return d=s,Uo(e,t),s=(t.flags&128)!==0,d||s?(d=t.stateNode,a=s&&typeof a.getDerivedStateFromError!="function"?null:d.render(),t.flags|=1,e!==null&&s?(t.child=Ll(t,e.child,null,c),t.child=Ll(t,null,a,c)):jt(e,t,a,c),t.memoizedState=d.state,e=t.child):e=Gn(e,t,c),e}function kx(e,t,a,s){return Us(),t.flags|=256,jt(e,t,a,s),t.child}var ru={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ou(e){return{baseLanes:e,cachePool:hh()}}function iu(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=fn),e}function _x(e,t,a){var s=t.pendingProps,c=!1,d=(t.flags&128)!==0,b;if((b=d)||(b=e!==null&&e.memoizedState===null?!1:(ut.current&2)!==0),b&&(c=!0,t.flags&=-129),b=(t.flags&32)!==0,t.flags&=-33,e===null){if($e){if(c?ga(t):ba(),$e){var S=Ie,A;if(A=S){e:{for(A=S,S=kn;A.nodeType!==8;){if(!S){S=null;break e}if(A=vn(A.nextSibling),A===null){S=null;break e}}S=A}S!==null?(t.memoizedState={dehydrated:S,treeContext:Ja!==null?{id:Bn,overflow:$n}:null,retryLane:536870912,hydrationErrors:null},A=Xt(18,null,null,0),A.stateNode=S,A.return=t,t.child=A,zt=t,Ie=null,A=!0):A=!1}A||Pa(t)}if(S=t.memoizedState,S!==null&&(S=S.dehydrated,S!==null))return Xu(S)?t.lanes=32:t.lanes=536870912,null;Vn(t)}return S=s.children,s=s.fallback,c?(ba(),c=t.mode,S=Bo({mode:"hidden",children:S},c),s=Ka(s,c,a,null),S.return=t,s.return=t,S.sibling=s,t.child=S,c=t.child,c.memoizedState=ou(a),c.childLanes=iu(e,b,a),t.memoizedState=ru,s):(ga(t),cu(t,S))}if(A=e.memoizedState,A!==null&&(S=A.dehydrated,S!==null)){if(d)t.flags&256?(ga(t),t.flags&=-257,t=uu(e,t,a)):t.memoizedState!==null?(ba(),t.child=e.child,t.flags|=128,t=null):(ba(),c=s.fallback,S=t.mode,s=Bo({mode:"visible",children:s.children},S),c=Ka(c,S,a,null),c.flags|=2,s.return=t,c.return=t,s.sibling=c,t.child=s,Ll(t,e.child,null,a),s=t.child,s.memoizedState=ou(a),s.childLanes=iu(e,b,a),t.memoizedState=ru,t=c);else if(ga(t),Xu(S)){if(b=S.nextSibling&&S.nextSibling.dataset,b)var K=b.dgst;b=K,s=Error(i(419)),s.stack="",s.digest=b,Bs({value:s,source:null,stack:null}),t=uu(e,t,a)}else if(pt||$s(e,t,a,!1),b=(a&e.childLanes)!==0,pt||b){if(b=We,b!==null&&(s=a&-a,s=(s&42)!==0?1:Ns(s),s=(s&(b.suspendedLanes|a))!==0?0:s,s!==0&&s!==A.retryLane))throw A.retryLane=s,Ml(e,s),Jt(b,e,s),bx;S.data==="$?"||Cu(),t=uu(e,t,a)}else S.data==="$?"?(t.flags|=192,t.child=e.child,t=null):(e=A.treeContext,Ie=vn(S.nextSibling),zt=t,$e=!0,Ia=null,kn=!1,e!==null&&(cn[un++]=Bn,cn[un++]=$n,cn[un++]=Ja,Bn=e.id,$n=e.overflow,Ja=t),t=cu(t,s.children),t.flags|=4096);return t}return c?(ba(),c=s.fallback,S=t.mode,A=e.child,K=A.sibling,s=Un(A,{mode:"hidden",children:s.children}),s.subtreeFlags=A.subtreeFlags&65011712,K!==null?c=Un(K,c):(c=Ka(c,S,a,null),c.flags|=2),c.return=t,s.return=t,s.sibling=c,t.child=s,s=c,c=t.child,S=e.child.memoizedState,S===null?S=ou(a):(A=S.cachePool,A!==null?(K=ct._currentValue,A=A.parent!==K?{parent:K,pool:K}:A):A=hh(),S={baseLanes:S.baseLanes|a,cachePool:A}),c.memoizedState=S,c.childLanes=iu(e,b,a),t.memoizedState=ru,s):(ga(t),a=e.child,e=a.sibling,a=Un(a,{mode:"visible",children:s.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 cu(e,t){return t=Bo({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Bo(e,t){return e=Xt(22,e,null,t),e.lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function uu(e,t,a){return Ll(t,e.child,null,a),e=cu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Cx(e,t,a){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),Cc(e.return,t,a)}function du(e,t,a,s,c){var d=e.memoizedState;d===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:a,tailMode:c}:(d.isBackwards=t,d.rendering=null,d.renderingStartTime=0,d.last=s,d.tail=a,d.tailMode=c)}function Tx(e,t,a){var s=t.pendingProps,c=s.revealOrder,d=s.tail;if(jt(e,t,s.children,a),s=ut.current,(s&2)!==0)s=s&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&&Cx(e,a,t);else if(e.tag===19)Cx(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}s&=1}switch(I(ut,s),c){case"forwards":for(a=t.child,c=null;a!==null;)e=a.alternate,e!==null&&Oo(e)===null&&(c=a),a=a.sibling;a=c,a===null?(c=t.child,t.child=null):(c=a.sibling,a.sibling=null),du(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&&Oo(e)===null){t.child=c;break}e=c.sibling,c.sibling=a,a=c,c=e}du(t,!0,a,null,d);break;case"together":du(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Gn(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),wa|=t.lanes,(a&t.childLanes)===0)if(e!==null){if($s(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=Un(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Un(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function fu(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&bo(e)))}function vy(e,t,a){switch(t.tag){case 3:pe(t,t.stateNode.containerInfo),fa(t,ct,e.memoizedState.cache),Us();break;case 27:case 5:_e(t);break;case 4:pe(t,t.stateNode.containerInfo);break;case 10:fa(t,t.type,t.memoizedProps.value);break;case 13:var s=t.memoizedState;if(s!==null)return s.dehydrated!==null?(ga(t),t.flags|=128,null):(a&t.child.childLanes)!==0?_x(e,t,a):(ga(t),e=Gn(e,t,a),e!==null?e.sibling:null);ga(t);break;case 19:var c=(e.flags&128)!==0;if(s=(a&t.childLanes)!==0,s||($s(e,t,a,!1),s=(a&t.childLanes)!==0),c){if(s)return Tx(e,t,a);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),I(ut,ut.current),s)break;return null;case 22:case 23:return t.lanes=0,Nx(e,t,a);case 24:fa(t,ct,e.memoizedState.cache)}return Gn(e,t,a)}function Mx(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)pt=!0;else{if(!fu(e,a)&&(t.flags&128)===0)return pt=!1,vy(e,t,a);pt=(e.flags&131072)!==0}else pt=!1,$e&&(t.flags&1048576)!==0&&rh(t,go,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var s=t.elementType,c=s._init;if(s=c(s._payload),t.type=s,typeof s=="function")jc(s)?(e=ll(s,e),t.tag=1,t=Ex(null,t,s,e,a)):(t.tag=0,t=su(null,t,s,e,a));else{if(s!=null){if(c=s.$$typeof,c===D){t.tag=11,t=yx(null,t,s,e,a);break e}else if(c===X){t.tag=14,t=vx(null,t,s,e,a);break e}}throw t=E(s)||s,Error(i(306,t,""))}}return t;case 0:return su(e,t,t.type,t.pendingProps,a);case 1:return s=t.type,c=ll(s,t.pendingProps),Ex(e,t,s,c,a);case 3:e:{if(pe(t,t.stateNode.containerInfo),e===null)throw Error(i(387));s=t.pendingProps;var d=t.memoizedState;c=d.element,Dc(e,t),Zs(t,s,null,a);var b=t.memoizedState;if(s=b.cache,fa(t,ct,s),s!==d.cache&&Tc(t,[ct],a,!0),Xs(),s=b.element,d.isDehydrated)if(d={element:s,isDehydrated:!1,cache:b.cache},t.updateQueue.baseState=d,t.memoizedState=d,t.flags&256){t=kx(e,t,s,a);break e}else if(s!==c){c=rn(Error(i(424)),t),Bs(c),t=kx(e,t,s,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(Ie=vn(e.firstChild),zt=t,$e=!0,Ia=null,kn=!0,a=ix(t,null,s,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(Us(),s===c){t=Gn(e,t,a);break e}jt(e,t,s,a)}t=t.child}return t;case 26:return Uo(e,t),e===null?(a=Op(t.type,null,t.pendingProps,null))?t.memoizedState=a:$e||(a=t.type,e=t.pendingProps,s=Io(de.current).createElement(a),s[xt]=t,s[kt]=e,wt(s,a,e),rt(s),t.stateNode=s):t.memoizedState=Op(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return _e(t),e===null&&$e&&(s=t.stateNode=Ap(t.type,t.pendingProps,de.current),zt=t,kn=!0,c=Ie,_a(t.type)?(Zu=c,Ie=vn(s.firstChild)):Ie=c),jt(e,t,t.pendingProps.children,a),Uo(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&$e&&((c=s=Ie)&&(s=Qy(s,t.type,t.pendingProps,kn),s!==null?(t.stateNode=s,zt=t,Ie=vn(s.firstChild),kn=!1,c=!0):c=!1),c||Pa(t)),_e(t),c=t.type,d=t.pendingProps,b=e!==null?e.memoizedProps:null,s=d.children,Yu(c,d)?s=null:b!==null&&Yu(c,b)&&(t.flags|=32),t.memoizedState!==null&&(c=Lc(e,t,fy,null,null,a),xr._currentValue=c),Uo(e,t),jt(e,t,s,a),t.child;case 6:return e===null&&$e&&((e=a=Ie)&&(a=Ky(a,t.pendingProps,kn),a!==null?(t.stateNode=a,zt=t,Ie=null,e=!0):e=!1),e||Pa(t)),null;case 13:return _x(e,t,a);case 4:return pe(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=Ll(t,null,s,a):jt(e,t,s,a),t.child;case 11:return yx(e,t,t.type,t.pendingProps,a);case 7:return jt(e,t,t.pendingProps,a),t.child;case 8:return jt(e,t,t.pendingProps.children,a),t.child;case 12:return jt(e,t,t.pendingProps.children,a),t.child;case 10:return s=t.pendingProps,fa(t,t.type,s.value),jt(e,t,s.children,a),t.child;case 9:return c=t.type._context,s=t.pendingProps.children,tl(t),c=_t(c),s=s(c),t.flags|=1,jt(e,t,s,a),t.child;case 14:return vx(e,t,t.type,t.pendingProps,a);case 15:return jx(e,t,t.type,t.pendingProps,a);case 19:return Tx(e,t,a);case 31:return s=t.pendingProps,a=t.mode,s={mode:s.mode,children:s.children},e===null?(a=Bo(s,a),a.ref=t.ref,t.child=a,a.return=t,t=a):(a=Un(e.child,s),a.ref=t.ref,t.child=a,a.return=t,t=a),t;case 22:return Nx(e,t,a);case 24:return tl(t),s=_t(ct),e===null?(c=Rc(),c===null&&(c=We,d=Mc(),c.pooledCache=d,d.refCount++,d!==null&&(c.pooledCacheLanes|=a),c=d),t.memoizedState={parent:s,cache:c},Oc(t),fa(t,ct,c)):((e.lanes&a)!==0&&(Dc(e,t),Zs(t,null,null,a),Xs()),c=e.memoizedState,d=t.memoizedState,c.parent!==s?(c={parent:s,cache:s},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),fa(t,ct,s)):(s=d.cache,fa(t,ct,s),s!==c.cache&&Tc(t,[ct],a,!0))),jt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Xn(e){e.flags|=4}function Ax(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!$p(t)){if(t=dn.current,t!==null&&((He&4194048)===He?_n!==null:(He&62914560)!==He&&(He&536870912)===0||t!==_n))throw Vs=zc,xh;e.flags|=8192}}function $o(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?la():536870912,e.lanes|=t,Xl|=t)}function Ps(e,t){if(!$e)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 s=null;a!==null;)a.alternate!==null&&(s=a),a=a.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function Fe(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,s=0;if(t)for(var c=e.child;c!==null;)a|=c.lanes|c.childLanes,s|=c.subtreeFlags&65011712,s|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)a|=c.lanes|c.childLanes,s|=c.subtreeFlags,s|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=s,e.childLanes=a,t}function jy(e,t,a){var s=t.pendingProps;switch(Ec(t),t.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Fe(t),null;case 1:return Fe(t),null;case 3:return a=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),Ln(ct),ve(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Hs(t)?Xn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,ch())),Fe(t),null;case 26:return a=t.memoizedState,e===null?(Xn(t),a!==null?(Fe(t),Ax(t,a)):(Fe(t),t.flags&=-16777217)):a?a!==e.memoizedState?(Xn(t),Fe(t),Ax(t,a)):(Fe(t),t.flags&=-16777217):(e.memoizedProps!==s&&Xn(t),Fe(t),t.flags&=-16777217),null;case 27:qe(t),a=de.current;var c=t.type;if(e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Xn(t);else{if(!s){if(t.stateNode===null)throw Error(i(166));return Fe(t),null}e=le.current,Hs(t)?oh(t):(e=Ap(c,s,a),t.stateNode=e,Xn(t))}return Fe(t),null;case 5:if(qe(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Xn(t);else{if(!s){if(t.stateNode===null)throw Error(i(166));return Fe(t),null}if(e=le.current,Hs(t))oh(t);else{switch(c=Io(de.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 s.is=="string"?c.createElement("select",{is:s.is}):c.createElement("select"),s.multiple?e.multiple=!0:s.size&&(e.size=s.size);break;default:e=typeof s.is=="string"?c.createElement(a,{is:s.is}):c.createElement(a)}}e[xt]=t,e[kt]=s;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(wt(e,a,s),a){case"button":case"input":case"select":case"textarea":e=!!s.autoFocus;break e;case"img":e=!0;break e;default:e=!1}e&&Xn(t)}}return Fe(t),t.flags&=-16777217,null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&Xn(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(i(166));if(e=de.current,Hs(t)){if(e=t.stateNode,a=t.memoizedProps,s=null,c=zt,c!==null)switch(c.tag){case 27:case 5:s=c.memoizedProps}e[xt]=t,e=!!(e.nodeValue===a||s!==null&&s.suppressHydrationWarning===!0||Sp(e.nodeValue,a)),e||Pa(t)}else e=Io(e).createTextNode(s),e[xt]=t,t.stateNode=e}return Fe(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=Hs(t),s!==null&&s.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[xt]=t}else Us(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Fe(t),c=!1}else c=ch(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(Vn(t),t):(Vn(t),null)}if(Vn(t),(t.flags&128)!==0)return t.lanes=a,t;if(a=s!==null,e=e!==null&&e.memoizedState!==null,a){s=t.child,c=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(c=s.alternate.memoizedState.cachePool.pool);var d=null;s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(d=s.memoizedState.cachePool.pool),d!==c&&(s.flags|=2048)}return a!==e&&a&&(t.child.flags|=8192),$o(t,t.updateQueue),Fe(t),null;case 4:return ve(),e===null&&Uu(t.stateNode.containerInfo),Fe(t),null;case 10:return Ln(t.type),Fe(t),null;case 19:if(V(ut),c=t.memoizedState,c===null)return Fe(t),null;if(s=(t.flags&128)!==0,d=c.rendering,d===null)if(s)Ps(c,!1);else{if(Pe!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(d=Oo(e),d!==null){for(t.flags|=128,Ps(c,!1),e=d.updateQueue,t.updateQueue=e,$o(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)sh(a,e),a=a.sibling;return I(ut,ut.current&1|2),t.child}e=e.sibling}c.tail!==null&&oe()>Yo&&(t.flags|=128,s=!0,Ps(c,!1),t.lanes=4194304)}else{if(!s)if(e=Oo(d),e!==null){if(t.flags|=128,s=!0,e=e.updateQueue,t.updateQueue=e,$o(t,e),Ps(c,!0),c.tail===null&&c.tailMode==="hidden"&&!d.alternate&&!$e)return Fe(t),null}else 2*oe()-c.renderingStartTime>Yo&&a!==536870912&&(t.flags|=128,s=!0,Ps(c,!1),t.lanes=4194304);c.isBackwards?(d.sibling=t.child,t.child=d):(e=c.last,e!==null?e.sibling=d:t.child=d,c.last=d)}return c.tail!==null?(t=c.tail,c.rendering=t,c.tail=t.sibling,c.renderingStartTime=oe(),t.sibling=null,e=ut.current,I(ut,s?e&1|2:e&1),t):(Fe(t),null);case 22:case 23:return Vn(t),$c(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?(a&536870912)!==0&&(t.flags&128)===0&&(Fe(t),t.subtreeFlags&6&&(t.flags|=8192)):Fe(t),a=t.updateQueue,a!==null&&$o(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==a&&(t.flags|=2048),e!==null&&V(nl),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Ln(ct),Fe(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Ny(e,t){switch(Ec(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ln(ct),ve(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return qe(t),null;case 13:if(Vn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Us()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return V(ut),null;case 4:return ve(),null;case 10:return Ln(t.type),null;case 22:case 23:return Vn(t),$c(),e!==null&&V(nl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ln(ct),null;case 25:return null;default:return null}}function Rx(e,t){switch(Ec(t),t.tag){case 3:Ln(ct),ve();break;case 26:case 27:case 5:qe(t);break;case 4:ve();break;case 13:Vn(t);break;case 19:V(ut);break;case 10:Ln(t.type);break;case 22:case 23:Vn(t),$c(),e!==null&&V(nl);break;case 24:Ln(ct)}}function er(e,t){try{var a=t.updateQueue,s=a!==null?a.lastEffect:null;if(s!==null){var c=s.next;a=c;do{if((a.tag&e)===e){s=void 0;var d=a.create,b=a.inst;s=d(),b.destroy=s}a=a.next}while(a!==c)}}catch(S){Ze(t,t.return,S)}}function ya(e,t,a){try{var s=t.updateQueue,c=s!==null?s.lastEffect:null;if(c!==null){var d=c.next;s=d;do{if((s.tag&e)===e){var b=s.inst,S=b.destroy;if(S!==void 0){b.destroy=void 0,c=t;var A=a,K=S;try{K()}catch(ue){Ze(c,A,ue)}}}s=s.next}while(s!==d)}}catch(ue){Ze(t,t.return,ue)}}function zx(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{vh(t,a)}catch(s){Ze(e,e.return,s)}}}function Ox(e,t,a){a.props=ll(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(s){Ze(e,t,s)}}function tr(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof a=="function"?e.refCleanup=a(s):a.current=s}}catch(c){Ze(e,t,c)}}function Cn(e,t){var a=e.ref,s=e.refCleanup;if(a!==null)if(typeof s=="function")try{s()}catch(c){Ze(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){Ze(e,t,c)}else a.current=null}function Dx(e){var t=e.type,a=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&s.focus();break e;case"img":a.src?s.src=a.src:a.srcSet&&(s.srcset=a.srcSet)}}catch(c){Ze(e,e.return,c)}}function hu(e,t,a){try{var s=e.stateNode;Vy(s,e.type,a,t),s[kt]=t}catch(c){Ze(e,e.return,c)}}function Hx(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&_a(e.type)||e.tag===4}function xu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Hx(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&_a(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 pu(e,t,a){var s=e.tag;if(s===5||s===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(s!==4&&(s===27&&_a(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(pu(e,t,a),e=e.sibling;e!==null;)pu(e,t,a),e=e.sibling}function qo(e,t,a){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(s!==4&&(s===27&&_a(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(qo(e,t,a),e=e.sibling;e!==null;)qo(e,t,a),e=e.sibling}function Ux(e){var t=e.stateNode,a=e.memoizedProps;try{for(var s=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);wt(t,s,a),t[xt]=e,t[kt]=a}catch(d){Ze(e,e.return,d)}}var Zn=!1,lt=!1,mu=!1,Bx=typeof WeakSet=="function"?WeakSet:Set,mt=null;function wy(e,t){if(e=e.containerInfo,qu=li,e=Kf(e),xc(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var s=a.getSelection&&a.getSelection();if(s&&s.rangeCount!==0){a=s.anchorNode;var c=s.anchorOffset,d=s.focusNode;s=s.focusOffset;try{a.nodeType,d.nodeType}catch{a=null;break e}var b=0,S=-1,A=-1,K=0,ue=0,he=e,P=null;t:for(;;){for(var ee;he!==a||c!==0&&he.nodeType!==3||(S=b+c),he!==d||s!==0&&he.nodeType!==3||(A=b+s),he.nodeType===3&&(b+=he.nodeValue.length),(ee=he.firstChild)!==null;)P=he,he=ee;for(;;){if(he===e)break t;if(P===a&&++K===c&&(S=b),P===d&&++ue===s&&(A=b),(ee=he.nextSibling)!==null)break;he=P,P=he.parentNode}he=ee}a=S===-1||A===-1?null:{start:S,end:A}}else a=null}a=a||{start:0,end:0}}else a=null;for(Lu={focusedElem:e,selectionRange:a},li=!1,mt=t;mt!==null;)if(t=mt,e=t.child,(t.subtreeFlags&1024)!==0&&e!==null)e.return=t,mt=e;else for(;mt!==null;){switch(t=mt,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,s=a.stateNode;try{var ke=ll(a.type,c,a.elementType===a.type);e=s.getSnapshotBeforeUpdate(ke,d),s.__reactInternalSnapshotBeforeUpdate=e}catch(we){Ze(a,a.return,we)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)Gu(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Gu(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,mt=e;break}mt=t.return}}function $x(e,t,a){var s=a.flags;switch(a.tag){case 0:case 11:case 15:va(e,a),s&4&&er(5,a);break;case 1:if(va(e,a),s&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(b){Ze(a,a.return,b)}else{var c=ll(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(b){Ze(a,a.return,b)}}s&64&&zx(a),s&512&&tr(a,a.return);break;case 3:if(va(e,a),s&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{vh(e,t)}catch(b){Ze(a,a.return,b)}}break;case 27:t===null&&s&4&&Ux(a);case 26:case 5:va(e,a),t===null&&s&4&&Dx(a),s&512&&tr(a,a.return);break;case 12:va(e,a);break;case 13:va(e,a),s&4&&Yx(e,a),s&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=Ry.bind(null,a),Jy(e,a))));break;case 22:if(s=a.memoizedState!==null||Zn,!s){t=t!==null&&t.memoizedState!==null||lt,c=Zn;var d=lt;Zn=s,(lt=t)&&!d?ja(e,a,(a.subtreeFlags&8772)!==0):va(e,a),Zn=c,lt=d}break;case 30:break;default:va(e,a)}}function qx(e){var t=e.alternate;t!==null&&(e.alternate=null,qx(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Es(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 Ke=null,$t=!1;function Wn(e,t,a){for(a=a.child;a!==null;)Lx(e,t,a),a=a.sibling}function Lx(e,t,a){if(nt&&typeof nt.onCommitFiberUnmount=="function")try{nt.onCommitFiberUnmount(Yt,a)}catch{}switch(a.tag){case 26:lt||Cn(a,t),Wn(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:lt||Cn(a,t);var s=Ke,c=$t;_a(a.type)&&(Ke=a.stateNode,$t=!1),Wn(e,t,a),ur(a.stateNode),Ke=s,$t=c;break;case 5:lt||Cn(a,t);case 6:if(s=Ke,c=$t,Ke=null,Wn(e,t,a),Ke=s,$t=c,Ke!==null)if($t)try{(Ke.nodeType===9?Ke.body:Ke.nodeName==="HTML"?Ke.ownerDocument.body:Ke).removeChild(a.stateNode)}catch(d){Ze(a,t,d)}else try{Ke.removeChild(a.stateNode)}catch(d){Ze(a,t,d)}break;case 18:Ke!==null&&($t?(e=Ke,Tp(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),br(e)):Tp(Ke,a.stateNode));break;case 4:s=Ke,c=$t,Ke=a.stateNode.containerInfo,$t=!0,Wn(e,t,a),Ke=s,$t=c;break;case 0:case 11:case 14:case 15:lt||ya(2,a,t),lt||ya(4,a,t),Wn(e,t,a);break;case 1:lt||(Cn(a,t),s=a.stateNode,typeof s.componentWillUnmount=="function"&&Ox(a,t,s)),Wn(e,t,a);break;case 21:Wn(e,t,a);break;case 22:lt=(s=lt)||a.memoizedState!==null,Wn(e,t,a),lt=s;break;default:Wn(e,t,a)}}function Yx(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){Ze(t,t.return,a)}}function Sy(e){switch(e.tag){case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Bx),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Bx),t;default:throw Error(i(435,e.tag))}}function gu(e,t){var a=Sy(e);t.forEach(function(s){var c=zy.bind(null,e,s);a.has(s)||(a.add(s),s.then(c,c))})}function Zt(e,t){var a=t.deletions;if(a!==null)for(var s=0;s<a.length;s++){var c=a[s],d=e,b=t,S=b;e:for(;S!==null;){switch(S.tag){case 27:if(_a(S.type)){Ke=S.stateNode,$t=!1;break e}break;case 5:Ke=S.stateNode,$t=!1;break e;case 3:case 4:Ke=S.stateNode.containerInfo,$t=!0;break e}S=S.return}if(Ke===null)throw Error(i(160));Lx(d,b,c),Ke=null,$t=!1,d=c.alternate,d!==null&&(d.return=null),c.return=null}if(t.subtreeFlags&13878)for(t=t.child;t!==null;)Vx(t,e),t=t.sibling}var yn=null;function Vx(e,t){var a=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Zt(t,e),Wt(e),s&4&&(ya(3,e,e.return),er(3,e),ya(5,e,e.return));break;case 1:Zt(t,e),Wt(e),s&512&&(lt||a===null||Cn(a,a.return)),s&64&&Zn&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?s:a.concat(s))));break;case 26:var c=yn;if(Zt(t,e),Wt(e),s&512&&(lt||a===null||Cn(a,a.return)),s&4){var d=a!==null?a.memoizedState:null;if(s=e.memoizedState,a===null)if(s===null)if(e.stateNode===null){e:{s=e.type,a=e.memoizedProps,c=c.ownerDocument||c;t:switch(s){case"title":d=c.getElementsByTagName("title")[0],(!d||d[Va]||d[xt]||d.namespaceURI==="http://www.w3.org/2000/svg"||d.hasAttribute("itemprop"))&&(d=c.createElement(s),c.head.insertBefore(d,c.querySelector("head > title"))),wt(d,s,a),d[xt]=e,rt(d),s=d;break e;case"link":var b=Up("link","href",c).get(s+(a.href||""));if(b){for(var S=0;S<b.length;S++)if(d=b[S],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(S,1);break t}}d=c.createElement(s),wt(d,s,a),c.head.appendChild(d);break;case"meta":if(b=Up("meta","content",c).get(s+(a.content||""))){for(S=0;S<b.length;S++)if(d=b[S],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(S,1);break t}}d=c.createElement(s),wt(d,s,a),c.head.appendChild(d);break;default:throw Error(i(468,s))}d[xt]=e,rt(d),s=d}e.stateNode=s}else Bp(c,e.type,e.stateNode);else e.stateNode=Hp(c,s,e.memoizedProps);else d!==s?(d===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):d.count--,s===null?Bp(c,e.type,e.stateNode):Hp(c,s,e.memoizedProps)):s===null&&e.stateNode!==null&&hu(e,e.memoizedProps,a.memoizedProps)}break;case 27:Zt(t,e),Wt(e),s&512&&(lt||a===null||Cn(a,a.return)),a!==null&&s&4&&hu(e,e.memoizedProps,a.memoizedProps);break;case 5:if(Zt(t,e),Wt(e),s&512&&(lt||a===null||Cn(a,a.return)),e.flags&32){c=e.stateNode;try{wl(c,"")}catch(ee){Ze(e,e.return,ee)}}s&4&&e.stateNode!=null&&(c=e.memoizedProps,hu(e,c,a!==null?a.memoizedProps:c)),s&1024&&(mu=!0);break;case 6:if(Zt(t,e),Wt(e),s&4){if(e.stateNode===null)throw Error(i(162));s=e.memoizedProps,a=e.stateNode;try{a.nodeValue=s}catch(ee){Ze(e,e.return,ee)}}break;case 3:if(ti=null,c=yn,yn=Po(t.containerInfo),Zt(t,e),yn=c,Wt(e),s&4&&a!==null&&a.memoizedState.isDehydrated)try{br(t.containerInfo)}catch(ee){Ze(e,e.return,ee)}mu&&(mu=!1,Gx(e));break;case 4:s=yn,yn=Po(e.stateNode.containerInfo),Zt(t,e),Wt(e),yn=s;break;case 12:Zt(t,e),Wt(e);break;case 13:Zt(t,e),Wt(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(wu=oe()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,gu(e,s)));break;case 22:c=e.memoizedState!==null;var A=a!==null&&a.memoizedState!==null,K=Zn,ue=lt;if(Zn=K||c,lt=ue||A,Zt(t,e),lt=ue,Zn=K,Wt(e),s&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(a===null||A||Zn||lt||sl(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{S=A.stateNode;var he=A.memoizedProps.style,P=he!=null&&he.hasOwnProperty("display")?he.display:null;S.style.display=P==null||typeof P=="boolean"?"":(""+P).trim()}}catch(ee){Ze(A,A.return,ee)}}}else if(t.tag===6){if(a===null){A=t;try{A.stateNode.nodeValue=c?"":A.memoizedProps}catch(ee){Ze(A,A.return,ee)}}}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}s&4&&(s=e.updateQueue,s!==null&&(a=s.retryQueue,a!==null&&(s.retryQueue=null,gu(e,a))));break;case 19:Zt(t,e),Wt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,gu(e,s)));break;case 30:break;case 21:break;default:Zt(t,e),Wt(e)}}function Wt(e){var t=e.flags;if(t&2){try{for(var a,s=e.return;s!==null;){if(Hx(s)){a=s;break}s=s.return}if(a==null)throw Error(i(160));switch(a.tag){case 27:var c=a.stateNode,d=xu(e);qo(e,d,c);break;case 5:var b=a.stateNode;a.flags&32&&(wl(b,""),a.flags&=-33);var S=xu(e);qo(e,S,b);break;case 3:case 4:var A=a.stateNode.containerInfo,K=xu(e);pu(e,K,A);break;default:throw Error(i(161))}}catch(ue){Ze(e,e.return,ue)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Gx(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Gx(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function va(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)$x(e,t.alternate,t),t=t.sibling}function sl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:ya(4,t,t.return),sl(t);break;case 1:Cn(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&Ox(t,t.return,a),sl(t);break;case 27:ur(t.stateNode);case 26:case 5:Cn(t,t.return),sl(t);break;case 22:t.memoizedState===null&&sl(t);break;case 30:sl(t);break;default:sl(t)}e=e.sibling}}function ja(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var s=t.alternate,c=e,d=t,b=d.flags;switch(d.tag){case 0:case 11:case 15:ja(c,d,a),er(4,d);break;case 1:if(ja(c,d,a),s=d,c=s.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(K){Ze(s,s.return,K)}if(s=d,c=s.updateQueue,c!==null){var S=s.stateNode;try{var A=c.shared.hiddenCallbacks;if(A!==null)for(c.shared.hiddenCallbacks=null,c=0;c<A.length;c++)yh(A[c],S)}catch(K){Ze(s,s.return,K)}}a&&b&64&&zx(d),tr(d,d.return);break;case 27:Ux(d);case 26:case 5:ja(c,d,a),a&&s===null&&b&4&&Dx(d),tr(d,d.return);break;case 12:ja(c,d,a);break;case 13:ja(c,d,a),a&&b&4&&Yx(c,d);break;case 22:d.memoizedState===null&&ja(c,d,a),tr(d,d.return);break;case 30:break;default:ja(c,d,a)}t=t.sibling}}function bu(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&&qs(a))}function yu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&qs(e))}function Tn(e,t,a,s){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Xx(e,t,a,s),t=t.sibling}function Xx(e,t,a,s){var c=t.flags;switch(t.tag){case 0:case 11:case 15:Tn(e,t,a,s),c&2048&&er(9,t);break;case 1:Tn(e,t,a,s);break;case 3:Tn(e,t,a,s),c&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&qs(e)));break;case 12:if(c&2048){Tn(e,t,a,s),e=t.stateNode;try{var d=t.memoizedProps,b=d.id,S=d.onPostCommit;typeof S=="function"&&S(b,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(A){Ze(t,t.return,A)}}else Tn(e,t,a,s);break;case 13:Tn(e,t,a,s);break;case 23:break;case 22:d=t.stateNode,b=t.alternate,t.memoizedState!==null?d._visibility&2?Tn(e,t,a,s):nr(e,t):d._visibility&2?Tn(e,t,a,s):(d._visibility|=2,Yl(e,t,a,s,(t.subtreeFlags&10256)!==0)),c&2048&&bu(b,t);break;case 24:Tn(e,t,a,s),c&2048&&yu(t.alternate,t);break;default:Tn(e,t,a,s)}}function Yl(e,t,a,s,c){for(c=c&&(t.subtreeFlags&10256)!==0,t=t.child;t!==null;){var d=e,b=t,S=a,A=s,K=b.flags;switch(b.tag){case 0:case 11:case 15:Yl(d,b,S,A,c),er(8,b);break;case 23:break;case 22:var ue=b.stateNode;b.memoizedState!==null?ue._visibility&2?Yl(d,b,S,A,c):nr(d,b):(ue._visibility|=2,Yl(d,b,S,A,c)),c&&K&2048&&bu(b.alternate,b);break;case 24:Yl(d,b,S,A,c),c&&K&2048&&yu(b.alternate,b);break;default:Yl(d,b,S,A,c)}t=t.sibling}}function nr(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,s=t,c=s.flags;switch(s.tag){case 22:nr(a,s),c&2048&&bu(s.alternate,s);break;case 24:nr(a,s),c&2048&&yu(s.alternate,s);break;default:nr(a,s)}t=t.sibling}}var ar=8192;function Vl(e){if(e.subtreeFlags&ar)for(e=e.child;e!==null;)Zx(e),e=e.sibling}function Zx(e){switch(e.tag){case 26:Vl(e),e.flags&ar&&e.memoizedState!==null&&cv(yn,e.memoizedState,e.memoizedProps);break;case 5:Vl(e);break;case 3:case 4:var t=yn;yn=Po(e.stateNode.containerInfo),Vl(e),yn=t;break;case 22:e.memoizedState===null&&(t=e.alternate,t!==null&&t.memoizedState!==null?(t=ar,ar=16777216,Vl(e),ar=t):Vl(e));break;default:Vl(e)}}function Wx(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 lr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var s=t[a];mt=s,Kx(s,e)}Wx(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Qx(e),e=e.sibling}function Qx(e){switch(e.tag){case 0:case 11:case 15:lr(e),e.flags&2048&&ya(9,e,e.return);break;case 3:lr(e);break;case 12:lr(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Lo(e)):lr(e);break;default:lr(e)}}function Lo(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var s=t[a];mt=s,Kx(s,e)}Wx(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:ya(8,t,t.return),Lo(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Lo(t));break;default:Lo(t)}e=e.sibling}}function Kx(e,t){for(;mt!==null;){var a=mt;switch(a.tag){case 0:case 11:case 15:ya(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var s=a.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:qs(a.memoizedState.cache)}if(s=a.child,s!==null)s.return=a,mt=s;else e:for(a=e;mt!==null;){s=mt;var c=s.sibling,d=s.return;if(qx(s),s===a){mt=null;break e}if(c!==null){c.return=d,mt=c;break e}mt=d}}}var Ey={getCacheForType:function(e){var t=_t(ct),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a}},ky=typeof WeakMap=="function"?WeakMap:Map,Le=0,We=null,Oe=null,He=0,Ye=0,Qt=null,Na=!1,Gl=!1,vu=!1,Qn=0,Pe=0,wa=0,rl=0,ju=0,fn=0,Xl=0,sr=null,qt=null,Nu=!1,wu=0,Yo=1/0,Vo=null,Sa=null,Nt=0,Ea=null,Zl=null,Wl=0,Su=0,Eu=null,Jx=null,rr=0,ku=null;function Kt(){if((Le&2)!==0&&He!==0)return He&-He;if(k.T!==null){var e=Ol;return e!==0?e:zu()}return Qr()}function Fx(){fn===0&&(fn=(He&536870912)===0||$e?bl():536870912);var e=dn.current;return e!==null&&(e.flags|=32),fn}function Jt(e,t,a){(e===We&&(Ye===2||Ye===9)||e.cancelPendingCommit!==null)&&(Ql(e,0),ka(e,He,fn,!1)),sa(e,a),((Le&2)===0||e!==We)&&(e===We&&((Le&2)===0&&(rl|=a),Pe===4&&ka(e,He,fn,!1)),Mn(e))}function Ix(e,t,a){if((Le&6)!==0)throw Error(i(327));var s=!a&&(t&124)===0&&(t&e.expiredLanes)===0||Vt(e,t),c=s?Ty(e,t):Tu(e,t,!0),d=s;do{if(c===0){Gl&&!s&&ka(e,t,0,!1);break}else{if(a=e.current.alternate,d&&!_y(a)){c=Tu(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 S=e;c=sr;var A=S.current.memoizedState.isDehydrated;if(A&&(Ql(S,b).flags|=256),b=Tu(S,b,!1),b!==2){if(vu&&!A){S.errorRecoveryDisabledLanes|=d,rl|=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){Ql(e,0),ka(e,t,0,!0);break}e:{switch(s=e,d=c,d){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:ka(s,t,fn,!Na);break e;case 2:qt=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(c=wu+300-oe(),10<c)){if(ka(s,t,fn,!Na),Rt(s,0,!0)!==0)break e;s.timeoutHandle=_p(Px.bind(null,s,a,qt,Vo,Nu,t,fn,rl,Xl,Na,d,2,-0,0),c);break e}Px(s,a,qt,Vo,Nu,t,fn,rl,Xl,Na,d,0,-0,0)}}break}while(!0);Mn(e)}function Px(e,t,a,s,c,d,b,S,A,K,ue,he,P,ee){if(e.timeoutHandle=-1,he=t.subtreeFlags,(he&8192||(he&16785408)===16785408)&&(hr={stylesheets:null,count:0,unsuspend:iv},Zx(t),he=uv(),he!==null)){e.cancelPendingCommit=he(rp.bind(null,e,t,d,a,s,c,b,S,A,ue,1,P,ee)),ka(e,d,b,!K);return}rp(e,t,d,a,s,c,b,S,A)}function _y(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 s=0;s<a.length;s++){var c=a[s],d=c.getSnapshot;c=c.value;try{if(!Gt(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 ka(e,t,a,s){t&=~ju,t&=~rl,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var c=t;0<c;){var d=31-st(c),b=1<<d;s[d]=-1,c&=~b}a!==0&&Zr(e,a,t)}function Go(){return(Le&6)===0?(or(0),!1):!0}function _u(){if(Oe!==null){if(Ye===0)var e=Oe.return;else e=Oe,qn=el=null,Gc(e),ql=null,Fs=0,e=Oe;for(;e!==null;)Rx(e.alternate,e),e=e.return;Oe=null}}function Ql(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,Xy(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),_u(),We=e,Oe=a=Un(e.current,null),He=t,Ye=0,Qt=null,Na=!1,Gl=Vt(e,t),vu=!1,Xl=fn=ju=rl=wa=Pe=0,qt=sr=null,Nu=!1,(t&8)!==0&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var c=31-st(s),d=1<<c;t|=e[c],s&=~d}return Qn=t,fo(),a}function ep(e,t){Ae=null,k.H=Ao,t===Ys||t===jo?(t=gh(),Ye=3):t===xh?(t=gh(),Ye=4):Ye=t===bx?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Qt=t,Oe===null&&(Pe=1,Ho(e,rn(t,e.current)))}function tp(){var e=k.H;return k.H=Ao,e===null?Ao:e}function np(){var e=k.A;return k.A=Ey,e}function Cu(){Pe=4,Na||(He&4194048)!==He&&dn.current!==null||(Gl=!0),(wa&134217727)===0&&(rl&134217727)===0||We===null||ka(We,He,fn,!1)}function Tu(e,t,a){var s=Le;Le|=2;var c=tp(),d=np();(We!==e||He!==t)&&(Vo=null,Ql(e,t)),t=!1;var b=Pe;e:do try{if(Ye!==0&&Oe!==null){var S=Oe,A=Qt;switch(Ye){case 8:_u(),b=6;break e;case 3:case 2:case 9:case 6:dn.current===null&&(t=!0);var K=Ye;if(Ye=0,Qt=null,Kl(e,S,A,K),a&&Gl){b=0;break e}break;default:K=Ye,Ye=0,Qt=null,Kl(e,S,A,K)}}Cy(),b=Pe;break}catch(ue){ep(e,ue)}while(!0);return t&&e.shellSuspendCounter++,qn=el=null,Le=s,k.H=c,k.A=d,Oe===null&&(We=null,He=0,fo()),b}function Cy(){for(;Oe!==null;)ap(Oe)}function Ty(e,t){var a=Le;Le|=2;var s=tp(),c=np();We!==e||He!==t?(Vo=null,Yo=oe()+500,Ql(e,t)):Gl=Vt(e,t);e:do try{if(Ye!==0&&Oe!==null){t=Oe;var d=Qt;t:switch(Ye){case 1:Ye=0,Qt=null,Kl(e,t,d,1);break;case 2:case 9:if(ph(d)){Ye=0,Qt=null,lp(t);break}t=function(){Ye!==2&&Ye!==9||We!==e||(Ye=7),Mn(e)},d.then(t,t);break e;case 3:Ye=7;break e;case 4:Ye=5;break e;case 7:ph(d)?(Ye=0,Qt=null,lp(t)):(Ye=0,Qt=null,Kl(e,t,d,7));break;case 5:var b=null;switch(Oe.tag){case 26:b=Oe.memoizedState;case 5:case 27:var S=Oe;if(!b||$p(b)){Ye=0,Qt=null;var A=S.sibling;if(A!==null)Oe=A;else{var K=S.return;K!==null?(Oe=K,Xo(K)):Oe=null}break t}}Ye=0,Qt=null,Kl(e,t,d,5);break;case 6:Ye=0,Qt=null,Kl(e,t,d,6);break;case 8:_u(),Pe=6;break e;default:throw Error(i(462))}}My();break}catch(ue){ep(e,ue)}while(!0);return qn=el=null,k.H=s,k.A=c,Le=a,Oe!==null?0:(We=null,He=0,fo(),Pe)}function My(){for(;Oe!==null&&!W();)ap(Oe)}function ap(e){var t=Mx(e.alternate,e,Qn);e.memoizedProps=e.pendingProps,t===null?Xo(e):Oe=t}function lp(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=Sx(a,t,t.pendingProps,t.type,void 0,He);break;case 11:t=Sx(a,t,t.pendingProps,t.type.render,t.ref,He);break;case 5:Gc(t);default:Rx(a,t),t=Oe=sh(t,Qn),t=Mx(a,t,Qn)}e.memoizedProps=e.pendingProps,t===null?Xo(e):Oe=t}function Kl(e,t,a,s){qn=el=null,Gc(t),ql=null,Fs=0;var c=t.return;try{if(yy(e,c,t,a,He)){Pe=1,Ho(e,rn(a,e.current)),Oe=null;return}}catch(d){if(c!==null)throw Oe=c,d;Pe=1,Ho(e,rn(a,e.current)),Oe=null;return}t.flags&32768?($e||s===1?e=!0:Gl||(He&536870912)!==0?e=!1:(Na=e=!0,(s===2||s===9||s===3||s===6)&&(s=dn.current,s!==null&&s.tag===13&&(s.flags|=16384))),sp(t,e)):Xo(t)}function Xo(e){var t=e;do{if((t.flags&32768)!==0){sp(t,Na);return}e=t.return;var a=jy(t.alternate,t,Qn);if(a!==null){Oe=a;return}if(t=t.sibling,t!==null){Oe=t;return}Oe=t=e}while(t!==null);Pe===0&&(Pe=5)}function sp(e,t){do{var a=Ny(e.alternate,e);if(a!==null){a.flags&=32767,Oe=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){Oe=e;return}Oe=e=a}while(e!==null);Pe=6,Oe=null}function rp(e,t,a,s,c,d,b,S,A){e.cancelPendingCommit=null;do Zo();while(Nt!==0);if((Le&6)!==0)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(d=t.lanes|t.childLanes,d|=yc,zn(e,a,d,b,S,A),e===We&&(Oe=We=null,He=0),Zl=t,Ea=e,Wl=a,Su=d,Eu=c,Jx=s,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Oy(Ue,function(){return dp(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||s){s=k.T,k.T=null,c=U.p,U.p=2,b=Le,Le|=4;try{wy(e,t,a)}finally{Le=b,U.p=c,k.T=s}}Nt=1,op(),ip(),cp()}}function op(){if(Nt===1){Nt=0;var e=Ea,t=Zl,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=k.T,k.T=null;var s=U.p;U.p=2;var c=Le;Le|=4;try{Vx(t,e);var d=Lu,b=Kf(e.containerInfo),S=d.focusedElem,A=d.selectionRange;if(b!==S&&S&&S.ownerDocument&&Qf(S.ownerDocument.documentElement,S)){if(A!==null&&xc(S)){var K=A.start,ue=A.end;if(ue===void 0&&(ue=K),"selectionStart"in S)S.selectionStart=K,S.selectionEnd=Math.min(ue,S.value.length);else{var he=S.ownerDocument||document,P=he&&he.defaultView||window;if(P.getSelection){var ee=P.getSelection(),ke=S.textContent.length,we=Math.min(A.start,ke),Xe=A.end===void 0?we:Math.min(A.end,ke);!ee.extend&&we>Xe&&(b=Xe,Xe=we,we=b);var G=Wf(S,we),$=Wf(S,Xe);if(G&&$&&(ee.rangeCount!==1||ee.anchorNode!==G.node||ee.anchorOffset!==G.offset||ee.focusNode!==$.node||ee.focusOffset!==$.offset)){var Q=he.createRange();Q.setStart(G.node,G.offset),ee.removeAllRanges(),we>Xe?(ee.addRange(Q),ee.extend($.node,$.offset)):(Q.setEnd($.node,$.offset),ee.addRange(Q))}}}}for(he=[],ee=S;ee=ee.parentNode;)ee.nodeType===1&&he.push({element:ee,left:ee.scrollLeft,top:ee.scrollTop});for(typeof S.focus=="function"&&S.focus(),S=0;S<he.length;S++){var fe=he[S];fe.element.scrollLeft=fe.left,fe.element.scrollTop=fe.top}}li=!!qu,Lu=qu=null}finally{Le=c,U.p=s,k.T=a}}e.current=t,Nt=2}}function ip(){if(Nt===2){Nt=0;var e=Ea,t=Zl,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=k.T,k.T=null;var s=U.p;U.p=2;var c=Le;Le|=4;try{$x(e,t.alternate,t)}finally{Le=c,U.p=s,k.T=a}}Nt=3}}function cp(){if(Nt===4||Nt===3){Nt=0,re();var e=Ea,t=Zl,a=Wl,s=Jx;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Nt=5:(Nt=0,Zl=Ea=null,up(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(Sa=null),ws(a),t=t.stateNode,nt&&typeof nt.onCommitFiberRoot=="function")try{nt.onCommitFiberRoot(Yt,t,void 0,(t.current.flags&128)===128)}catch{}if(s!==null){t=k.T,c=U.p,U.p=2,k.T=null;try{for(var d=e.onRecoverableError,b=0;b<s.length;b++){var S=s[b];d(S.value,{componentStack:S.stack})}}finally{k.T=t,U.p=c}}(Wl&3)!==0&&Zo(),Mn(e),c=e.pendingLanes,(a&4194090)!==0&&(c&42)!==0?e===ku?rr++:(rr=0,ku=e):rr=0,or(0)}}function up(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,qs(t)))}function Zo(e){return op(),ip(),cp(),dp()}function dp(){if(Nt!==5)return!1;var e=Ea,t=Su;Su=0;var a=ws(Wl),s=k.T,c=U.p;try{U.p=32>a?32:a,k.T=null,a=Eu,Eu=null;var d=Ea,b=Wl;if(Nt=0,Zl=Ea=null,Wl=0,(Le&6)!==0)throw Error(i(331));var S=Le;if(Le|=4,Qx(d.current),Xx(d,d.current,b,a),Le=S,or(0,!1),nt&&typeof nt.onPostCommitFiberRoot=="function")try{nt.onPostCommitFiberRoot(Yt,d)}catch{}return!0}finally{U.p=c,k.T=s,up(e,t)}}function fp(e,t,a){t=rn(a,t),t=lu(e.stateNode,t,2),e=pa(e,t,2),e!==null&&(sa(e,2),Mn(e))}function Ze(e,t,a){if(e.tag===3)fp(e,e,a);else for(;t!==null;){if(t.tag===3){fp(t,e,a);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Sa===null||!Sa.has(s))){e=rn(a,e),a=mx(2),s=pa(t,a,2),s!==null&&(gx(a,s,t,e),sa(s,2),Mn(s));break}}t=t.return}}function Mu(e,t,a){var s=e.pingCache;if(s===null){s=e.pingCache=new ky;var c=new Set;s.set(t,c)}else c=s.get(t),c===void 0&&(c=new Set,s.set(t,c));c.has(a)||(vu=!0,c.add(a),e=Ay.bind(null,e,t,a),t.then(e,e))}function Ay(e,t,a){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,We===e&&(He&a)===a&&(Pe===4||Pe===3&&(He&62914560)===He&&300>oe()-wu?(Le&2)===0&&Ql(e,0):ju|=a,Xl===He&&(Xl=0)),Mn(e)}function hp(e,t){t===0&&(t=la()),e=Ml(e,t),e!==null&&(sa(e,t),Mn(e))}function Ry(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),hp(e,a)}function zy(e,t){var a=0;switch(e.tag){case 13:var s=e.stateNode,c=e.memoizedState;c!==null&&(a=c.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(i(314))}s!==null&&s.delete(t),hp(e,a)}function Oy(e,t){return me(e,t)}var Wo=null,Jl=null,Au=!1,Qo=!1,Ru=!1,ol=0;function Mn(e){e!==Jl&&e.next===null&&(Jl===null?Wo=Jl=e:Jl=Jl.next=e),Qo=!0,Au||(Au=!0,Hy())}function or(e,t){if(!Ru&&Qo){Ru=!0;do for(var a=!1,s=Wo;s!==null;){if(e!==0){var c=s.pendingLanes;if(c===0)var d=0;else{var b=s.suspendedLanes,S=s.pingedLanes;d=(1<<31-st(42|e)+1)-1,d&=c&~(b&~S),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(a=!0,gp(s,d))}else d=He,d=Rt(s,s===We?d:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(d&3)===0||Vt(s,d)||(a=!0,gp(s,d));s=s.next}while(a);Ru=!1}}function Dy(){xp()}function xp(){Qo=Au=!1;var e=0;ol!==0&&(Gy()&&(e=ol),ol=0);for(var t=oe(),a=null,s=Wo;s!==null;){var c=s.next,d=pp(s,t);d===0?(s.next=null,a===null?Wo=c:a.next=c,c===null&&(Jl=a)):(a=s,(e!==0||(d&3)!==0)&&(Qo=!0)),s=c}or(e)}function pp(e,t){for(var a=e.suspendedLanes,s=e.pingedLanes,c=e.expirationTimes,d=e.pendingLanes&-62914561;0<d;){var b=31-st(d),S=1<<b,A=c[b];A===-1?((S&a)===0||(S&s)!==0)&&(c[b]=js(S,t)):A<=t&&(e.expiredLanes|=S),d&=~S}if(t=We,a=He,a=Rt(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,a===0||e===t&&(Ye===2||Ye===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&Y(s),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Vt(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(s!==null&&Y(s),ws(a)){case 2:case 8:a=Te;break;case 32:a=Ue;break;case 268435456:a=Mt;break;default:a=Ue}return s=mp.bind(null,e),a=me(a,s),e.callbackPriority=t,e.callbackNode=a,t}return s!==null&&s!==null&&Y(s),e.callbackPriority=2,e.callbackNode=null,2}function mp(e,t){if(Nt!==0&&Nt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Zo()&&e.callbackNode!==a)return null;var s=He;return s=Rt(e,e===We?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(Ix(e,s,t),pp(e,oe()),e.callbackNode!=null&&e.callbackNode===a?mp.bind(null,e):null)}function gp(e,t){if(Zo())return null;Ix(e,t,!0)}function Hy(){Zy(function(){(Le&6)!==0?me(Ce,Dy):xp()})}function zu(){return ol===0&&(ol=bl()),ol}function bp(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:lo(""+e)}function yp(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 Uy(e,t,a,s,c){if(t==="submit"&&a&&a.stateNode===c){var d=bp((c[kt]||null).action),b=s.submitter;b&&(t=(t=b[kt]||null)?bp(t.formAction):b.getAttribute("formAction"),t!==null&&(d=t,b=null));var S=new io("action","action",null,s,c);e.push({event:S,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(ol!==0){var A=b?yp(c,b):new FormData(c);Pc(a,{pending:!0,data:A,method:c.method,action:d},null,A)}}else typeof d=="function"&&(S.preventDefault(),A=b?yp(c,b):new FormData(c),Pc(a,{pending:!0,data:A,method:c.method,action:d},d,A))},currentTarget:c}]})}}for(var Ou=0;Ou<bc.length;Ou++){var Du=bc[Ou],By=Du.toLowerCase(),$y=Du[0].toUpperCase()+Du.slice(1);bn(By,"on"+$y)}bn(If,"onAnimationEnd"),bn(Pf,"onAnimationIteration"),bn(eh,"onAnimationStart"),bn("dblclick","onDoubleClick"),bn("focusin","onFocus"),bn("focusout","onBlur"),bn(ny,"onTransitionRun"),bn(ay,"onTransitionStart"),bn(ly,"onTransitionCancel"),bn(th,"onTransitionEnd"),ca("onMouseEnter",["mouseout","mouseover"]),ca("onMouseLeave",["mouseout","mouseover"]),ca("onPointerEnter",["pointerout","pointerover"]),ca("onPointerLeave",["pointerout","pointerover"]),Dn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Dn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Dn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Dn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Dn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Dn("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(" "),qy=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ir));function vp(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var s=e[a],c=s.event;s=s.listeners;e:{var d=void 0;if(t)for(var b=s.length-1;0<=b;b--){var S=s[b],A=S.instance,K=S.currentTarget;if(S=S.listener,A!==d&&c.isPropagationStopped())break e;d=S,c.currentTarget=K;try{d(c)}catch(ue){Do(ue)}c.currentTarget=null,d=A}else for(b=0;b<s.length;b++){if(S=s[b],A=S.instance,K=S.currentTarget,S=S.listener,A!==d&&c.isPropagationStopped())break e;d=S,c.currentTarget=K;try{d(c)}catch(ue){Do(ue)}c.currentTarget=null,d=A}}}}function De(e,t){var a=t[Ss];a===void 0&&(a=t[Ss]=new Set);var s=e+"__bubble";a.has(s)||(jp(t,e,2,!1),a.add(s))}function Hu(e,t,a){var s=0;t&&(s|=4),jp(a,e,s,t)}var Ko="_reactListening"+Math.random().toString(36).slice(2);function Uu(e){if(!e[Ko]){e[Ko]=!0,Jr.forEach(function(a){a!=="selectionchange"&&(qy.has(a)||Hu(a,!1,e),Hu(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ko]||(t[Ko]=!0,Hu("selectionchange",!1,t))}}function jp(e,t,a,s){switch(Xp(t)){case 2:var c=hv;break;case 8:c=xv;break;default:c=Fu}a=c.bind(null,t,a,e),c=void 0,!sc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),s?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,s,c){var d=s;if((t&1)===0&&(t&2)===0&&s!==null)e:for(;;){if(s===null)return;var b=s.tag;if(b===3||b===4){var S=s.stateNode.containerInfo;if(S===c)break;if(b===4)for(b=s.return;b!==null;){var A=b.tag;if((A===3||A===4)&&b.stateNode.containerInfo===c)return;b=b.return}for(;S!==null;){if(b=On(S),b===null)return;if(A=b.tag,A===5||A===6||A===26||A===27){s=d=b;continue e}S=S.parentNode}}s=s.return}Cf(function(){var K=d,ue=ac(a),he=[];e:{var P=nh.get(e);if(P!==void 0){var ee=io,ke=e;switch(e){case"keypress":if(ro(a)===0)break e;case"keydown":case"keyup":ee=Ob;break;case"focusin":ke="focus",ee=cc;break;case"focusout":ke="blur",ee=cc;break;case"beforeblur":case"afterblur":ee=cc;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":ee=Af;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ee=Nb;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ee=Ub;break;case If:case Pf:case eh:ee=Eb;break;case th:ee=$b;break;case"scroll":case"scrollend":ee=vb;break;case"wheel":ee=Lb;break;case"copy":case"cut":case"paste":ee=_b;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ee=zf;break;case"toggle":case"beforetoggle":ee=Vb}var we=(t&4)!==0,Xe=!we&&(e==="scroll"||e==="scrollend"),G=we?P!==null?P+"Capture":null:P;we=[];for(var $=K,Q;$!==null;){var fe=$;if(Q=fe.stateNode,fe=fe.tag,fe!==5&&fe!==26&&fe!==27||Q===null||G===null||(fe=_s($,G),fe!=null&&we.push(cr($,fe,Q))),Xe)break;$=$.return}0<we.length&&(P=new ee(P,ke,null,a,ue),he.push({event:P,listeners:we}))}}if((t&7)===0){e:{if(P=e==="mouseover"||e==="pointerover",ee=e==="mouseout"||e==="pointerout",P&&a!==nc&&(ke=a.relatedTarget||a.fromElement)&&(On(ke)||ke[ra]))break e;if((ee||P)&&(P=ue.window===ue?ue:(P=ue.ownerDocument)?P.defaultView||P.parentWindow:window,ee?(ke=a.relatedTarget||a.toElement,ee=K,ke=ke?On(ke):null,ke!==null&&(Xe=f(ke),we=ke.tag,ke!==Xe||we!==5&&we!==27&&we!==6)&&(ke=null)):(ee=null,ke=K),ee!==ke)){if(we=Af,fe="onMouseLeave",G="onMouseEnter",$="mouse",(e==="pointerout"||e==="pointerover")&&(we=zf,fe="onPointerLeave",G="onPointerEnter",$="pointer"),Xe=ee==null?P:Ga(ee),Q=ke==null?P:Ga(ke),P=new we(fe,$+"leave",ee,a,ue),P.target=Xe,P.relatedTarget=Q,fe=null,On(ue)===K&&(we=new we(G,$+"enter",ke,a,ue),we.target=Q,we.relatedTarget=Xe,fe=we),Xe=fe,ee&&ke)t:{for(we=ee,G=ke,$=0,Q=we;Q;Q=Fl(Q))$++;for(Q=0,fe=G;fe;fe=Fl(fe))Q++;for(;0<$-Q;)we=Fl(we),$--;for(;0<Q-$;)G=Fl(G),Q--;for(;$--;){if(we===G||G!==null&&we===G.alternate)break t;we=Fl(we),G=Fl(G)}we=null}else we=null;ee!==null&&Np(he,P,ee,we,!1),ke!==null&&Xe!==null&&Np(he,Xe,ke,we,!0)}}e:{if(P=K?Ga(K):window,ee=P.nodeName&&P.nodeName.toLowerCase(),ee==="select"||ee==="input"&&P.type==="file")var ye=Lf;else if($f(P))if(Yf)ye=Pb;else{ye=Fb;var Re=Jb}else ee=P.nodeName,!ee||ee.toLowerCase()!=="input"||P.type!=="checkbox"&&P.type!=="radio"?K&&tc(K.elementType)&&(ye=Lf):ye=Ib;if(ye&&(ye=ye(e,K))){qf(he,ye,a,ue);break e}Re&&Re(e,P,K),e==="focusout"&&K&&P.type==="number"&&K.memoizedProps.value!=null&&ec(P,"number",P.value)}switch(Re=K?Ga(K):window,e){case"focusin":($f(Re)||Re.contentEditable==="true")&&(_l=Re,pc=K,Ds=null);break;case"focusout":Ds=pc=_l=null;break;case"mousedown":mc=!0;break;case"contextmenu":case"mouseup":case"dragend":mc=!1,Jf(he,a,ue);break;case"selectionchange":if(ty)break;case"keydown":case"keyup":Jf(he,a,ue)}var je;if(dc)e:{switch(e){case"compositionstart":var Se="onCompositionStart";break e;case"compositionend":Se="onCompositionEnd";break e;case"compositionupdate":Se="onCompositionUpdate";break e}Se=void 0}else kl?Uf(e,a)&&(Se="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Se="onCompositionStart");Se&&(Of&&a.locale!=="ko"&&(kl||Se!=="onCompositionStart"?Se==="onCompositionEnd"&&kl&&(je=Tf()):(da=ue,rc="value"in da?da.value:da.textContent,kl=!0)),Re=Jo(K,Se),0<Re.length&&(Se=new Rf(Se,e,null,a,ue),he.push({event:Se,listeners:Re}),je?Se.data=je:(je=Bf(a),je!==null&&(Se.data=je)))),(je=Xb?Zb(e,a):Wb(e,a))&&(Se=Jo(K,"onBeforeInput"),0<Se.length&&(Re=new Rf("onBeforeInput","beforeinput",null,a,ue),he.push({event:Re,listeners:Se}),Re.data=je)),Uy(he,e,K,a,ue)}vp(he,t)})}function cr(e,t,a){return{instance:e,listener:t,currentTarget:a}}function Jo(e,t){for(var a=t+"Capture",s=[];e!==null;){var c=e,d=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||d===null||(c=_s(e,a),c!=null&&s.unshift(cr(e,c,d)),c=_s(e,t),c!=null&&s.push(cr(e,c,d))),e.tag===3)return s;e=e.return}return[]}function Fl(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Np(e,t,a,s,c){for(var d=t._reactName,b=[];a!==null&&a!==s;){var S=a,A=S.alternate,K=S.stateNode;if(S=S.tag,A!==null&&A===s)break;S!==5&&S!==26&&S!==27||K===null||(A=K,c?(K=_s(a,d),K!=null&&b.unshift(cr(a,K,A))):c||(K=_s(a,d),K!=null&&b.push(cr(a,K,A)))),a=a.return}b.length!==0&&e.push({event:t,listeners:b})}var Ly=/\r\n?/g,Yy=/\u0000|\uFFFD/g;function wp(e){return(typeof e=="string"?e:""+e).replace(Ly,`
|
|
49
|
-
`).replace(Yy,"")}function Sp(e,t){return t=wp(t),wp(e)===t}function Fo(){}function Ge(e,t,a,s,c,d){switch(a){case"children":typeof s=="string"?t==="body"||t==="textarea"&&s===""||wl(e,s):(typeof s=="number"||typeof s=="bigint")&&t!=="body"&&wl(e,""+s);break;case"className":vl(e,"class",s);break;case"tabIndex":vl(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":vl(e,a,s);break;case"style":kf(e,s,d);break;case"data":if(t!=="object"){vl(e,"data",s);break}case"src":case"href":if(s===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(a);break}s=lo(""+s),e.setAttribute(a,s);break;case"action":case"formAction":if(typeof s=="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"&&Ge(e,t,"name",c.name,c,null),Ge(e,t,"formEncType",c.formEncType,c,null),Ge(e,t,"formMethod",c.formMethod,c,null),Ge(e,t,"formTarget",c.formTarget,c,null)):(Ge(e,t,"encType",c.encType,c,null),Ge(e,t,"method",c.method,c,null),Ge(e,t,"target",c.target,c,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(a);break}s=lo(""+s),e.setAttribute(a,s);break;case"onClick":s!=null&&(e.onclick=Fo);break;case"onScroll":s!=null&&De("scroll",e);break;case"onScrollEnd":s!=null&&De("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(i(61));if(a=s.__html,a!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=a}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}a=lo(""+s),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":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(a,""+s):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":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":s===!0?e.setAttribute(a,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(a,s):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(a,s):e.removeAttribute(a);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(a):e.setAttribute(a,s);break;case"popover":De("beforetoggle",e),De("toggle",e),yl(e,"popover",s);break;case"xlinkActuate":gn(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":gn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":gn(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":gn(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":gn(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":gn(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":gn(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":gn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":gn(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":yl(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=bb.get(a)||a,yl(e,a,s))}}function $u(e,t,a,s,c,d){switch(a){case"style":kf(e,s,d);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(i(61));if(a=s.__html,a!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=a}}break;case"children":typeof s=="string"?wl(e,s):(typeof s=="number"||typeof s=="bigint")&&wl(e,""+s);break;case"onScroll":s!=null&&De("scroll",e);break;case"onScrollEnd":s!=null&&De("scrollend",e);break;case"onClick":s!=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[kt]||null,d=d!=null?d[a]:null,typeof d=="function"&&e.removeEventListener(t,d,c),typeof s=="function")){typeof d!="function"&&d!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,s,c);break e}a in e?e[a]=s:s===!0?e.setAttribute(a,""):yl(e,a,s)}}}function wt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":De("error",e),De("load",e);var s=!1,c=!1,d;for(d in a)if(a.hasOwnProperty(d)){var b=a[d];if(b!=null)switch(d){case"src":s=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:Ge(e,t,d,b,a,null)}}c&&Ge(e,t,"srcSet",a.srcSet,a,null),s&&Ge(e,t,"src",a.src,a,null);return;case"input":De("invalid",e);var S=d=b=c=null,A=null,K=null;for(s in a)if(a.hasOwnProperty(s)){var ue=a[s];if(ue!=null)switch(s){case"name":c=ue;break;case"type":b=ue;break;case"checked":A=ue;break;case"defaultChecked":K=ue;break;case"value":d=ue;break;case"defaultValue":S=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(i(137,t));break;default:Ge(e,t,s,ue,a,null)}}Nf(e,d,S,A,K,b,c,!1),no(e);return;case"select":De("invalid",e),s=b=d=null;for(c in a)if(a.hasOwnProperty(c)&&(S=a[c],S!=null))switch(c){case"value":d=S;break;case"defaultValue":b=S;break;case"multiple":s=S;default:Ge(e,t,c,S,a,null)}t=d,a=b,e.multiple=!!s,t!=null?Nl(e,!!s,t,!1):a!=null&&Nl(e,!!s,a,!0);return;case"textarea":De("invalid",e),d=c=s=null;for(b in a)if(a.hasOwnProperty(b)&&(S=a[b],S!=null))switch(b){case"value":s=S;break;case"defaultValue":c=S;break;case"children":d=S;break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(i(91));break;default:Ge(e,t,b,S,a,null)}Sf(e,s,c,d),no(e);return;case"option":for(A in a)if(a.hasOwnProperty(A)&&(s=a[A],s!=null))switch(A){case"selected":e.selected=s&&typeof s!="function"&&typeof s!="symbol";break;default:Ge(e,t,A,s,a,null)}return;case"dialog":De("beforetoggle",e),De("toggle",e),De("cancel",e),De("close",e);break;case"iframe":case"object":De("load",e);break;case"video":case"audio":for(s=0;s<ir.length;s++)De(ir[s],e);break;case"image":De("error",e),De("load",e);break;case"details":De("toggle",e);break;case"embed":case"source":case"link":De("error",e),De("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)&&(s=a[K],s!=null))switch(K){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:Ge(e,t,K,s,a,null)}return;default:if(tc(t)){for(ue in a)a.hasOwnProperty(ue)&&(s=a[ue],s!==void 0&&$u(e,t,ue,s,a,void 0));return}}for(S in a)a.hasOwnProperty(S)&&(s=a[S],s!=null&&Ge(e,t,S,s,a,null))}function Vy(e,t,a,s){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,S=null,A=null,K=null,ue=null;for(ee in a){var he=a[ee];if(a.hasOwnProperty(ee)&&he!=null)switch(ee){case"checked":break;case"value":break;case"defaultValue":A=he;default:s.hasOwnProperty(ee)||Ge(e,t,ee,null,s,he)}}for(var P in s){var ee=s[P];if(he=a[P],s.hasOwnProperty(P)&&(ee!=null||he!=null))switch(P){case"type":d=ee;break;case"name":c=ee;break;case"checked":K=ee;break;case"defaultChecked":ue=ee;break;case"value":b=ee;break;case"defaultValue":S=ee;break;case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(i(137,t));break;default:ee!==he&&Ge(e,t,P,ee,s,he)}}Pi(e,b,S,A,K,ue,d,c);return;case"select":ee=b=S=P=null;for(d in a)if(A=a[d],a.hasOwnProperty(d)&&A!=null)switch(d){case"value":break;case"multiple":ee=A;default:s.hasOwnProperty(d)||Ge(e,t,d,null,s,A)}for(c in s)if(d=s[c],A=a[c],s.hasOwnProperty(c)&&(d!=null||A!=null))switch(c){case"value":P=d;break;case"defaultValue":S=d;break;case"multiple":b=d;default:d!==A&&Ge(e,t,c,d,s,A)}t=S,a=b,s=ee,P!=null?Nl(e,!!a,P,!1):!!s!=!!a&&(t!=null?Nl(e,!!a,t,!0):Nl(e,!!a,a?[]:"",!1));return;case"textarea":ee=P=null;for(S in a)if(c=a[S],a.hasOwnProperty(S)&&c!=null&&!s.hasOwnProperty(S))switch(S){case"value":break;case"children":break;default:Ge(e,t,S,null,s,c)}for(b in s)if(c=s[b],d=a[b],s.hasOwnProperty(b)&&(c!=null||d!=null))switch(b){case"value":P=c;break;case"defaultValue":ee=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(i(91));break;default:c!==d&&Ge(e,t,b,c,s,d)}wf(e,P,ee);return;case"option":for(var ke in a)if(P=a[ke],a.hasOwnProperty(ke)&&P!=null&&!s.hasOwnProperty(ke))switch(ke){case"selected":e.selected=!1;break;default:Ge(e,t,ke,null,s,P)}for(A in s)if(P=s[A],ee=a[A],s.hasOwnProperty(A)&&P!==ee&&(P!=null||ee!=null))switch(A){case"selected":e.selected=P&&typeof P!="function"&&typeof P!="symbol";break;default:Ge(e,t,A,P,s,ee)}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 we in a)P=a[we],a.hasOwnProperty(we)&&P!=null&&!s.hasOwnProperty(we)&&Ge(e,t,we,null,s,P);for(K in s)if(P=s[K],ee=a[K],s.hasOwnProperty(K)&&P!==ee&&(P!=null||ee!=null))switch(K){case"children":case"dangerouslySetInnerHTML":if(P!=null)throw Error(i(137,t));break;default:Ge(e,t,K,P,s,ee)}return;default:if(tc(t)){for(var Xe in a)P=a[Xe],a.hasOwnProperty(Xe)&&P!==void 0&&!s.hasOwnProperty(Xe)&&$u(e,t,Xe,void 0,s,P);for(ue in s)P=s[ue],ee=a[ue],!s.hasOwnProperty(ue)||P===ee||P===void 0&&ee===void 0||$u(e,t,ue,P,s,ee);return}}for(var G in a)P=a[G],a.hasOwnProperty(G)&&P!=null&&!s.hasOwnProperty(G)&&Ge(e,t,G,null,s,P);for(he in s)P=s[he],ee=a[he],!s.hasOwnProperty(he)||P===ee||P==null&&ee==null||Ge(e,t,he,P,s,ee)}var qu=null,Lu=null;function Io(e){return e.nodeType===9?e:e.ownerDocument}function Ep(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 kp(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 Yu(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 Vu=null;function Gy(){var e=window.event;return e&&e.type==="popstate"?e===Vu?!1:(Vu=e,!0):(Vu=null,!1)}var _p=typeof setTimeout=="function"?setTimeout:void 0,Xy=typeof clearTimeout=="function"?clearTimeout:void 0,Cp=typeof Promise=="function"?Promise:void 0,Zy=typeof queueMicrotask=="function"?queueMicrotask:typeof Cp<"u"?function(e){return Cp.resolve(null).then(e).catch(Wy)}:_p;function Wy(e){setTimeout(function(){throw e})}function _a(e){return e==="head"}function Tp(e,t){var a=t,s=0,c=0;do{var d=a.nextSibling;if(e.removeChild(a),d&&d.nodeType===8)if(a=d.data,a==="/$"){if(0<s&&8>s){a=s;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 S=b.nextSibling,A=b.nodeName;b[Va]||A==="SCRIPT"||A==="STYLE"||A==="LINK"&&b.rel.toLowerCase()==="stylesheet"||a.removeChild(b),b=S}}if(c===0){e.removeChild(d),br(t);return}c--}else a==="$"||a==="$?"||a==="$!"?c++:s=a.charCodeAt(0)-48;else s=0;a=d}while(a);br(t)}function Gu(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":Gu(a),Es(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function Qy(e,t,a,s){for(;e.nodeType===1;){var c=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){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=vn(e.nextSibling),e===null)break}return null}function Ky(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=vn(e.nextSibling),e===null))return null;return e}function Xu(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState==="complete"}function Jy(e,t){var a=e.ownerDocument;if(e.data!=="$?"||a.readyState==="complete")t();else{var s=function(){t(),a.removeEventListener("DOMContentLoaded",s)};a.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function vn(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 Zu=null;function Mp(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 Ap(e,t,a){switch(t=Io(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]);Es(e)}var hn=new Map,Rp=new Set;function Po(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Kn=U.d;U.d={f:Fy,r:Iy,D:Py,C:ev,L:tv,m:nv,X:lv,S:av,M:sv};function Fy(){var e=Kn.f(),t=Go();return e||t}function Iy(e){var t=oa(e);t!==null&&t.tag===5&&t.type==="form"?Ih(t):Kn.r(e)}var Il=typeof document>"u"?null:document;function zp(e,t,a){var s=Il;if(s&&typeof t=="string"&&t){var c=sn(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof a=="string"&&(c+='[crossorigin="'+a+'"]'),Rp.has(c)||(Rp.add(c),e={rel:e,crossOrigin:a,href:t},s.querySelector(c)===null&&(t=s.createElement("link"),wt(t,"link",e),rt(t),s.head.appendChild(t)))}}function Py(e){Kn.D(e),zp("dns-prefetch",e,null)}function ev(e,t){Kn.C(e,t),zp("preconnect",e,t)}function tv(e,t,a){Kn.L(e,t,a);var s=Il;if(s&&e&&t){var c='link[rel="preload"][as="'+sn(t)+'"]';t==="image"&&a&&a.imageSrcSet?(c+='[imagesrcset="'+sn(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(c+='[imagesizes="'+sn(a.imageSizes)+'"]')):c+='[href="'+sn(e)+'"]';var d=c;switch(t){case"style":d=Pl(e);break;case"script":d=es(e)}hn.has(d)||(e=g({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),hn.set(d,e),s.querySelector(c)!==null||t==="style"&&s.querySelector(dr(d))||t==="script"&&s.querySelector(fr(d))||(t=s.createElement("link"),wt(t,"link",e),rt(t),s.head.appendChild(t)))}}function nv(e,t){Kn.m(e,t);var a=Il;if(a&&e){var s=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+sn(s)+'"][href="'+sn(e)+'"]',d=c;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=es(e)}if(!hn.has(d)&&(e=g({rel:"modulepreload",href:e},t),hn.set(d,e),a.querySelector(c)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(fr(d)))return}s=a.createElement("link"),wt(s,"link",e),rt(s),a.head.appendChild(s)}}}function av(e,t,a){Kn.S(e,t,a);var s=Il;if(s&&e){var c=ia(s).hoistableStyles,d=Pl(e);t=t||"default";var b=c.get(d);if(!b){var S={loading:0,preload:null};if(b=s.querySelector(dr(d)))S.loading=5;else{e=g({rel:"stylesheet",href:e,"data-precedence":t},a),(a=hn.get(d))&&Wu(e,a);var A=b=s.createElement("link");rt(A),wt(A,"link",e),A._p=new Promise(function(K,ue){A.onload=K,A.onerror=ue}),A.addEventListener("load",function(){S.loading|=1}),A.addEventListener("error",function(){S.loading|=2}),S.loading|=4,ei(b,t,s)}b={type:"stylesheet",instance:b,count:1,state:S},c.set(d,b)}}}function lv(e,t){Kn.X(e,t);var a=Il;if(a&&e){var s=ia(a).hoistableScripts,c=es(e),d=s.get(c);d||(d=a.querySelector(fr(c)),d||(e=g({src:e,async:!0},t),(t=hn.get(c))&&Qu(e,t),d=a.createElement("script"),rt(d),wt(d,"link",e),a.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},s.set(c,d))}}function sv(e,t){Kn.M(e,t);var a=Il;if(a&&e){var s=ia(a).hoistableScripts,c=es(e),d=s.get(c);d||(d=a.querySelector(fr(c)),d||(e=g({src:e,async:!0,type:"module"},t),(t=hn.get(c))&&Qu(e,t),d=a.createElement("script"),rt(d),wt(d,"link",e),a.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},s.set(c,d))}}function Op(e,t,a,s){var c=(c=de.current)?Po(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=Pl(a.href),a=ia(c).hoistableStyles,s=a.get(t),s||(s={type:"style",instance:null,count:0,state:null},a.set(t,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=Pl(a.href);var d=ia(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),hn.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},hn.set(e,a),d||rv(c,e,a,b.state))),t&&s===null)throw Error(i(528,""));return b}if(t&&s!==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=es(a),a=ia(c).hoistableScripts,s=a.get(t),s||(s={type:"script",instance:null,count:0,state:null},a.set(t,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Pl(e){return'href="'+sn(e)+'"'}function dr(e){return'link[rel="stylesheet"]['+e+"]"}function Dp(e){return g({},e,{"data-precedence":e.precedence,precedence:null})}function rv(e,t,a,s){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?s.loading=1:(t=e.createElement("link"),s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2}),wt(t,"link",a),rt(t),e.head.appendChild(t))}function es(e){return'[src="'+sn(e)+'"]'}function fr(e){return"script[async]"+e}function Hp(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+sn(a.href)+'"]');if(s)return t.instance=s,rt(s),s;var c=g({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),rt(s),wt(s,"style",c),ei(s,a.precedence,e),t.instance=s;case"stylesheet":c=Pl(a.href);var d=e.querySelector(dr(c));if(d)return t.state.loading|=4,t.instance=d,rt(d),d;s=Dp(a),(c=hn.get(c))&&Wu(s,c),d=(e.ownerDocument||e).createElement("link"),rt(d);var b=d;return b._p=new Promise(function(S,A){b.onload=S,b.onerror=A}),wt(d,"link",s),t.state.loading|=4,ei(d,a.precedence,e),t.instance=d;case"script":return d=es(a.src),(c=e.querySelector(fr(d)))?(t.instance=c,rt(c),c):(s=a,(c=hn.get(d))&&(s=g({},a),Qu(s,c)),e=e.ownerDocument||e,c=e.createElement("script"),rt(c),wt(c,"link",s),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&&(s=t.instance,t.state.loading|=4,ei(s,a.precedence,e));return t.instance}function ei(e,t,a){for(var s=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=s.length?s[s.length-1]:null,d=c,b=0;b<s.length;b++){var S=s[b];if(S.dataset.precedence===t)d=S;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 Wu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Qu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ti=null;function Up(e,t,a){if(ti===null){var s=new Map,c=ti=new Map;c.set(a,s)}else c=ti,s=c.get(a),s||(s=new Map,c.set(a,s));if(s.has(e))return s;for(s.set(e,null),a=a.getElementsByTagName(e),c=0;c<a.length;c++){var d=a[c];if(!(d[Va]||d[xt]||e==="link"&&d.getAttribute("rel")==="stylesheet")&&d.namespaceURI!=="http://www.w3.org/2000/svg"){var b=d.getAttribute(t)||"";b=e+b;var S=s.get(b);S?S.push(d):s.set(b,[d])}}return s}function Bp(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function ov(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 $p(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}var hr=null;function iv(){}function cv(e,t,a){if(hr===null)throw Error(i(475));var s=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=Pl(a.href),d=e.querySelector(dr(c));if(d){e=d._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(s.count++,s=ni.bind(s),e.then(s,s)),t.state.loading|=4,t.instance=d,rt(d);return}d=e.ownerDocument||e,a=Dp(a),(c=hn.get(c))&&Wu(a,c),d=d.createElement("link"),rt(d);var b=d;b._p=new Promise(function(S,A){b.onload=S,b.onerror=A}),wt(d,"link",a),t.instance=d}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(t,e),(e=t.state.preload)&&(t.state.loading&3)===0&&(s.count++,t=ni.bind(s),e.addEventListener("load",t),e.addEventListener("error",t))}}function uv(){if(hr===null)throw Error(i(475));var e=hr;return e.stylesheets&&e.count===0&&Ku(e,e.stylesheets),0<e.count?function(t){var a=setTimeout(function(){if(e.stylesheets&&Ku(e,e.stylesheets),e.unsuspend){var s=e.unsuspend;e.unsuspend=null,s()}},6e4);return e.unsuspend=t,function(){e.unsuspend=null,clearTimeout(a)}}:null}function ni(){if(this.count--,this.count===0){if(this.stylesheets)Ku(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ai=null;function Ku(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ai=new Map,t.forEach(dv,e),ai=null,ni.call(e))}function dv(e,t){if(!(t.state.loading&4)){var a=ai.get(e);if(a)var s=a.get(null);else{a=new Map,ai.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),s=b)}s&&a.set(null,s)}c=t.instance,b=c.getAttribute("data-precedence"),d=a.get(b)||s,d===s&&a.set(null,c),a.set(b,c),this.count++,s=ni.bind(this),c.addEventListener("load",s),c.addEventListener("error",s),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:z,_currentValue2:z,_threadCount:0};function fv(e,t,a,s,c,d,b,S){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=s,this.onUncaughtError=c,this.onCaughtError=d,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=S,this.incompleteTransitions=new Map}function qp(e,t,a,s,c,d,b,S,A,K,ue,he){return e=new fv(e,t,a,b,S,A,K,he),t=1,d===!0&&(t|=24),d=Xt(3,null,null,t),e.current=d,d.stateNode=e,t=Mc(),t.refCount++,e.pooledCache=t,t.refCount++,d.memoizedState={element:s,isDehydrated:a,cache:t},Oc(d),e}function Lp(e){return e?(e=Al,e):Al}function Yp(e,t,a,s,c,d){c=Lp(c),s.context===null?s.context=c:s.pendingContext=c,s=xa(t),s.payload={element:a},d=d===void 0?null:d,d!==null&&(s.callback=d),a=pa(e,s,t),a!==null&&(Jt(a,e,t),Gs(a,e,t))}function Vp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Ju(e,t){Vp(e,t),(e=e.alternate)&&Vp(e,t)}function Gp(e){if(e.tag===13){var t=Ml(e,67108864);t!==null&&Jt(t,e,67108864),Ju(e,67108864)}}var li=!0;function hv(e,t,a,s){var c=k.T;k.T=null;var d=U.p;try{U.p=2,Fu(e,t,a,s)}finally{U.p=d,k.T=c}}function xv(e,t,a,s){var c=k.T;k.T=null;var d=U.p;try{U.p=8,Fu(e,t,a,s)}finally{U.p=d,k.T=c}}function Fu(e,t,a,s){if(li){var c=Iu(s);if(c===null)Bu(e,t,s,si,a),Zp(e,s);else if(mv(c,e,t,a,s))s.stopPropagation();else if(Zp(e,s),t&4&&-1<pv.indexOf(e)){for(;c!==null;){var d=oa(c);if(d!==null)switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var b=Ht(d.pendingLanes);if(b!==0){var S=d;for(S.pendingLanes|=2,S.entangledLanes|=2;b;){var A=1<<31-st(b);S.entanglements[1]|=A,b&=~A}Mn(d),(Le&6)===0&&(Yo=oe()+500,or(0))}}break;case 13:S=Ml(d,2),S!==null&&Jt(S,d,2),Go(),Ju(d,2)}if(d=Iu(s),d===null&&Bu(e,t,s,si,a),d===c)break;c=d}c!==null&&s.stopPropagation()}else Bu(e,t,s,null,a)}}function Iu(e){return e=ac(e),Pu(e)}var si=null;function Pu(e){if(si=null,e=On(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 si=e,null}function Xp(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(ne()){case Ce:return 2;case Te:return 8;case Ue:case en:return 32;case Mt:return 268435456;default:return 32}default:return 32}}var ed=!1,Ca=null,Ta=null,Ma=null,pr=new Map,mr=new Map,Aa=[],pv="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 Zp(e,t){switch(e){case"focusin":case"focusout":Ca=null;break;case"dragenter":case"dragleave":Ta=null;break;case"mouseover":case"mouseout":Ma=null;break;case"pointerover":case"pointerout":pr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":mr.delete(t.pointerId)}}function gr(e,t,a,s,c,d){return e===null||e.nativeEvent!==d?(e={blockedOn:t,domEventName:a,eventSystemFlags:s,nativeEvent:d,targetContainers:[c]},t!==null&&(t=oa(t),t!==null&&Gp(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function mv(e,t,a,s,c){switch(t){case"focusin":return Ca=gr(Ca,e,t,a,s,c),!0;case"dragenter":return Ta=gr(Ta,e,t,a,s,c),!0;case"mouseover":return Ma=gr(Ma,e,t,a,s,c),!0;case"pointerover":var d=c.pointerId;return pr.set(d,gr(pr.get(d)||null,e,t,a,s,c)),!0;case"gotpointercapture":return d=c.pointerId,mr.set(d,gr(mr.get(d)||null,e,t,a,s,c)),!0}return!1}function Wp(e){var t=On(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,Ki(e.priority,function(){if(a.tag===13){var s=Kt();s=Ns(s);var c=Ml(a,s);c!==null&&Jt(c,a,s),Ju(a,s)}});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ri(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=Iu(e.nativeEvent);if(a===null){a=e.nativeEvent;var s=new a.constructor(a.type,a);nc=s,a.target.dispatchEvent(s),nc=null}else return t=oa(a),t!==null&&Gp(t),e.blockedOn=a,!1;t.shift()}return!0}function Qp(e,t,a){ri(e)&&a.delete(t)}function gv(){ed=!1,Ca!==null&&ri(Ca)&&(Ca=null),Ta!==null&&ri(Ta)&&(Ta=null),Ma!==null&&ri(Ma)&&(Ma=null),pr.forEach(Qp),mr.forEach(Qp)}function oi(e,t){e.blockedOn===t&&(e.blockedOn=null,ed||(ed=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,gv)))}var ii=null;function Kp(e){ii!==e&&(ii=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){ii===e&&(ii=null);for(var t=0;t<e.length;t+=3){var a=e[t],s=e[t+1],c=e[t+2];if(typeof s!="function"){if(Pu(s||a)===null)continue;break}var d=oa(a);d!==null&&(e.splice(t,3),t-=3,Pc(d,{pending:!0,data:c,method:a.method,action:s},s,c))}}))}function br(e){function t(A){return oi(A,e)}Ca!==null&&oi(Ca,e),Ta!==null&&oi(Ta,e),Ma!==null&&oi(Ma,e),pr.forEach(t),mr.forEach(t);for(var a=0;a<Aa.length;a++){var s=Aa[a];s.blockedOn===e&&(s.blockedOn=null)}for(;0<Aa.length&&(a=Aa[0],a.blockedOn===null);)Wp(a),a.blockedOn===null&&Aa.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(s=0;s<a.length;s+=3){var c=a[s],d=a[s+1],b=c[kt]||null;if(typeof d=="function")b||Kp(a);else if(b){var S=null;if(d&&d.hasAttribute("formAction")){if(c=d,b=d[kt]||null)S=b.formAction;else if(Pu(c)!==null)continue}else S=b.action;typeof S=="function"?a[s+1]=S:(a.splice(s,3),s-=3),Kp(a)}}}function td(e){this._internalRoot=e}ci.prototype.render=td.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var a=t.current,s=Kt();Yp(a,s,e,t,null,null)},ci.prototype.unmount=td.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Yp(e.current,2,null,e,null,null),Go(),t[ra]=null}};function ci(e){this._internalRoot=e}ci.prototype.unstable_scheduleHydration=function(e){if(e){var t=Qr();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Aa.length&&t!==0&&t<Aa[a].priority;a++);Aa.splice(a,0,e),a===0&&Wp(e)}};var Jp=r.version;if(Jp!=="19.1.1")throw Error(i(527,Jp,"19.1.1"));U.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 bv={bundleType:0,version:"19.1.1",rendererPackageName:"react-dom",currentDispatcherRef:k,reconcilerVersion:"19.1.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ui=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ui.isDisabled&&ui.supportsFiber)try{Yt=ui.inject(bv),nt=ui}catch{}}return vr.createRoot=function(e,t){if(!u(e))throw Error(i(299));var a=!1,s="",c=fx,d=hx,b=xx,S=null;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(s=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&&(S=t.unstable_transitionCallbacks)),t=qp(e,1,!1,null,null,a,s,c,d,b,S,null),e[ra]=t.current,Uu(e),new td(t)},vr.hydrateRoot=function(e,t,a){if(!u(e))throw Error(i(299));var s=!1,c="",d=fx,b=hx,S=xx,A=null,K=null;return a!=null&&(a.unstable_strictMode===!0&&(s=!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&&(S=a.onRecoverableError),a.unstable_transitionCallbacks!==void 0&&(A=a.unstable_transitionCallbacks),a.formState!==void 0&&(K=a.formState)),t=qp(e,1,!0,t,a??null,s,c,d,b,S,A,K),t.context=Lp(null),a=t.current,s=Kt(),s=Ns(s),c=xa(s),c.callback=null,pa(a,c,s),a=s,t.current.lanes=a,sa(t,a),Mn(t),e[ra]=t.current,Uu(e),new ci(t)},vr.version="19.1.1",vr}var r0;function _v(){if(r0)return ld.exports;r0=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=kv(),ld.exports}var Cv=_v();/**
|
|
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 Nm=(...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 Tv=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 Mv=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 o0=n=>{const r=Mv(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 id={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 Av=n=>{for(const r in n)if(r.startsWith("aria-")||r==="role"||r==="title")return!0;return!1},Rv=w.createContext({}),zv=()=>w.useContext(Rv),Ov=w.forwardRef(({color:n,size:r,strokeWidth:o,absoluteStrokeWidth:i,className:u="",children:f,iconNode:h,...m},p)=>{const{size:x=24,strokeWidth:g=2,absoluteStrokeWidth:y=!1,color:v="currentColor",className:j=""}=zv()??{},C=i??y?Number(o??g)*24/Number(r??x):o??g;return w.createElement("svg",{ref:p,...id,width:r??x??id.width,height:r??x??id.height,stroke:n??v,strokeWidth:C,className:Nm("lucide",j,u),...!f&&!Av(m)&&{"aria-hidden":"true"},...m},[...h.map(([_,T])=>w.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 Ne=(n,r)=>{const o=w.forwardRef(({className:i,...u},f)=>w.createElement(Ov,{ref:f,iconNode:r,className:Nm(`lucide-${Tv(o0(n))}`,`lucide-${n}`,i),...u}));return o.displayName=o0(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 Dv=[["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"}]],Lr=Ne("activity",Dv);/**
|
|
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 Hv=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],i0=Ne("arrow-left",Hv);/**
|
|
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 Uv=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],ds=Ne("arrow-right",Uv);/**
|
|
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 Bv=[["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"}]],wm=Ne("bell",Bv);/**
|
|
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 $v=[["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"}]],Ei=Ne("brain",$v);/**
|
|
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 qv=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],yt=Ne("check",qv);/**
|
|
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 Lv=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],$a=Ne("chevron-down",Lv);/**
|
|
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 Yv=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],ys=Ne("chevron-right",Yv);/**
|
|
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 Vv=[["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"}]],Dt=Ne("circle-alert",Vv);/**
|
|
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 Gv=[["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"}]],Xv=Ne("circle-play",Gv);/**
|
|
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 Zv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],Wv=Ne("circle-plus",Zv);/**
|
|
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 Qv=[["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"}]],Kv=Ne("circle-question-mark",Qv);/**
|
|
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 Jv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],Yr=Ne("clock",Jv);/**
|
|
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 Fv=[["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"}]],Li=Ne("code-xml",Fv);/**
|
|
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 Iv=[["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"}]],Mi=Ne("database",Iv);/**
|
|
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 Pv=[["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"}]],In=Ne("diamond",Pv);/**
|
|
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 e1=[["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"}]],c0=Ne("external-link",e1);/**
|
|
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 t1=[["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"}]],Qd=Ne("file-code-corner",t1);/**
|
|
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 n1=[["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"}]],Sm=Ne("file-text",n1);/**
|
|
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 a1=[["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"}]],Kd=Ne("git-branch",a1);/**
|
|
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 l1=[["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"}]],vs=Ne("globe",l1);/**
|
|
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 s1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],r1=Ne("info",s1);/**
|
|
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 o1=[["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"}]],Em=Ne("key",o1);/**
|
|
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 i1=[["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"}]],km=Ne("layers-2",i1);/**
|
|
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 c1=[["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"}]],_m=Ne("layers",c1);/**
|
|
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 u1=[["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"}]],d1=Ne("layout-grid",u1);/**
|
|
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 f1=[["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"}]],Cm=Ne("list",f1);/**
|
|
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 h1=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],tt=Ne("loader-circle",h1);/**
|
|
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 x1=[["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"}]],p1=Ne("logs",x1);/**
|
|
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 m1=[["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"}]],g1=Ne("moon",m1);/**
|
|
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 b1=[["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"}]],u0=Ne("network",b1);/**
|
|
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 y1=[["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"}]],Tm=Ne("palette",y1);/**
|
|
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 v1=[["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"}]],Jd=Ne("pen-line",v1);/**
|
|
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 j1=[["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"}]],N1=Ne("pen",j1);/**
|
|
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 w1=[["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"}]],Ed=Ne("play",w1);/**
|
|
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 S1=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],bt=Ne("plus",S1);/**
|
|
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 E1=[["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"}]],pl=Ne("refresh-cw",E1);/**
|
|
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 k1=[["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"}]],_1=Ne("rotate-ccw",k1);/**
|
|
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 C1=[["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"}]],T1=Ne("save",C1);/**
|
|
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 M1=[["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"}]],Ai=Ne("scan-line",M1);/**
|
|
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 A1=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],kd=Ne("search",A1);/**
|
|
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 R1=[["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"}]],_d=Ne("send",R1);/**
|
|
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 z1=[["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"}]],qa=Ne("shield",z1);/**
|
|
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 O1=[["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"}]],Mm=Ne("sparkles",O1);/**
|
|
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 D1=[["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"}]],H1=Ne("square-mouse-pointer",D1);/**
|
|
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 U1=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],B1=Ne("square",U1);/**
|
|
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 $1=[["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"}]],q1=Ne("sun",$1);/**
|
|
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 L1=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Fd=Ne("terminal",L1);/**
|
|
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 Y1=[["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"}]],Ot=Ne("trash-2",Y1);/**
|
|
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 V1=[["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"}]],Am=Ne("user",V1);/**
|
|
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 G1=[["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"}]],Cd=Ne("workflow",G1);/**
|
|
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 X1=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],St=Ne("x",X1);/**
|
|
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 Z1=[["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"}]],ea=Ne("zap",Z1),Rm=w.createContext({theme:"dark",toggleTheme:()=>{}});function W1({children:n}){const[r,o]=w.useState(()=>localStorage.getItem("jetic_theme")==="light"?"light":"dark");w.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 l.jsx(Rm.Provider,{value:{theme:r,toggleTheme:i},children:n})}function Q1(){return w.useContext(Rm)}const K1=[{label:"WORKFLOW",items:[{id:"overview",label:"Overview",icon:d1},{id:"model",label:"Model",icon:km},{id:"simulations",label:"Simulations",icon:In},{id:"inspect",label:"Inspect",icon:H1}]},{label:"AGENT",items:[{id:"memory",label:"Memory & Environment",icon:Mi}]},{label:"OBSERVABILITY",items:[{id:"traces",label:"Traces",icon:Lr}]}],J1=[];function d0({icon:n,label:r,active:o=!1,onClick:i}){return l.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&&l.jsx("span",{className:"absolute -left-3 top-1/2 h-4 w-[3px] -translate-y-1/2 rounded-full bg-blue-500"}),l.jsx(n,{className:"h-[15px] w-[15px] shrink-0",strokeWidth:2}),l.jsx("span",{children:r})]})}function F1({currentPage:n,onNavigate:r,onToggleAssistant:o,isAssistantOpen:i}){const{theme:u,toggleTheme:f}=Q1();return l.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:[l.jsxs("div",{className:"flex items-center justify-between px-4 pb-6 pt-5",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[u==="dark"?l.jsx("img",{src:"/jetic.png",alt:"jetic",className:"h-6 w-6"}):l.jsx("img",{src:"/jetic_light.png",alt:"jetic",className:"h-5 w-5"}),l.jsxs("span",{className:"text-[15px] tracking-wide",style:{color:"var(--text-primary)"},children:["Jetic",l.jsx("span",{className:"ml-1 text-blue-400 animate-pulse",children:"Studio"})]})]}),l.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:[l.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-blue-500"}),"v0.1.4"]})]}),l.jsx("div",{className:"flex-1 overflow-y-auto px-3",children:l.jsx("div",{className:"flex flex-col gap-6",children:K1.map(h=>l.jsxs("div",{className:"flex flex-col gap-1",children:[l.jsx("span",{className:"px-3 pb-1 text-[11px] font-semibold tracking-wider",style:{color:"var(--text-faint)"},children:h.label}),l.jsx("div",{className:"flex flex-col gap-0.5",children:h.items.map(m=>l.jsx(d0,{icon:m.icon,label:m.label,active:n===m.id,onClick:()=>r(m.id)},m.id))})]},h.label))})}),l.jsx("div",{className:"mx-3 my-3 hidden ",style:{borderTop:"1px solid var(--border)"}}),l.jsx("div",{className:"flex flex-col gap-0.5 px-3",children:l.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:[l.jsx(Mm,{className:"h-[15px] w-[15px] shrink-0",strokeWidth:2}),l.jsx("span",{children:"Jetic Assistant"})]})}),l.jsx("div",{className:"mx-3 my-3 hidden",style:{borderTop:"1px solid var(--border)"}}),l.jsx("div",{className:"flex flex-col gap-0.5 px-3",children:J1.map(h=>l.jsx(d0,{icon:h.icon,label:h.label,active:n===h.id,onClick:()=>r(h.id)},h.id))}),l.jsx("div",{className:"px-3 pb-4 pt-3",children:l.jsxs("div",{className:"flex items-center gap-2 rounded-xl p-1",style:{border:"1px solid var(--border)",backgroundColor:"var(--bg-overlay)"},children:[l.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:[l.jsx(g1,{className:"h-3 w-3 shrink-0",strokeWidth:2}),"Dark"]}),l.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:[l.jsx(q1,{className:"h-3 w-3 shrink-0",strokeWidth:2}),"Light"]})]})})]})}function I1({isOpen:n,onClose:r}){return n?l.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:[l.jsxs("div",{className:"flex h-14 items-center justify-between border-b border-white/10 px-5",children:[l.jsx("div",{className:"flex items-center gap-2 text-emerald-400",children:l.jsx("span",{className:"text-[14px] font-medium",children:"Jetic AI"})}),l.jsx("button",{onClick:r,className:" hover:text-zinc-300 text-sm hover:bg-zinc-800/20 p-2 rounded-full",children:l.jsx(St,{className:"",size:13})})]}),l.jsx("div",{className:"flex-1 overflow-y-auto p-5 space-y-4",children:l.jsxs("div",{className:"flex flex-col items-center pt-8 pb-4",children:[l.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"}),l.jsx("h2",{className:"text-[17px] font-semibold text-white text-center",children:"How can I help you test your APIs?"}),l.jsx("p",{className:"text-zinc-500 text-[13px] mt-2 text-center",children:"Ask me to generate simulations, debug traces, or explain API behavior."})]})}),l.jsx("div",{className:"p-4 border-t border-white/10 bg-white/[0.01]",children:l.jsxs("div",{className:"rounded border border-emerald-600/60 bg-white/[0.015] focus-within:border-emerald-500 transition-colors",children:[l.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"}),l.jsxs("div",{className:"flex items-center justify-between px-3 pb-3 pt-1",children:[l.jsx("div",{className:"flex gap-2",children:l.jsx("span",{className:"text-[11px] text-zinc-500 font-mono bg-white/[0.05] px-2 py-0.5 rounded",children:"gpt-4o"})}),l.jsx("button",{className:"text-[12px] font-medium text-emerald-400 hover:text-emerald-300",children:"Send"})]})]})})]}):null}const P1={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 Td(n){return P1[n.toUpperCase()]??{bg:"bg-[var(--bg-overlay-md)]",text:"text-[var(--text-muted)]",dot:"#a1a1aa"}}function di({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 l.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:[l.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`}),l.jsxs("div",{className:"relative",children:[l.jsx("div",{className:`mb-3 flex h-8 w-8 items-center justify-center rounded-lg border border-[var(--border)] ${f.glow}`,children:l.jsx(i,{className:`h-[15px] w-[15px] ${f.text}`,strokeWidth:2})}),l.jsx("p",{className:"text-2xl font-semibold text-[var(--text-primary)] tabular-nums leading-none",children:r}),l.jsx("p",{className:"mt-1 text-[11px] font-semibold tracking-wider text-[var(--text-muted)] uppercase",children:n}),o&&l.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 l.jsxs("div",{className:"rounded-lg border border-[var(--border)] bg-[var(--bg-overlay)] overflow-hidden",children:[l.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&&l.jsx(r,{className:"h-[15px] w-[15px] text-blue-400",strokeWidth:2}),l.jsx("span",{className:"text-[11px] font-semibold tracking-wider text-[var(--text-faint)] uppercase",children:n}),o&&l.jsx("span",{className:"ml-auto",children:o})]}),l.jsx("div",{className:u?"":"p-4",children:i})]})}function e2({method:n}){const r=Td(n);return l.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 fi({msg:n}){return l.jsx("p",{className:"py-6 text-center text-[12px] text-[var(--text-faint)]",children:n})}function t2({onClose:n,onSave:r}){const[o,i]=w.useState(""),[u,f]=w.useState("https://"),[h,m]=w.useState(!1),[p,x]=w.useState(""),g=w.useRef(null);w.useEffect(()=>{g.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}m(!0),x("");try{await r(o.trim(),u.trim()),n()}catch(C){x(C.message),m(!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 l.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:l.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:[l.jsxs("div",{className:"mb-5 flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2.5",children:[l.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:l.jsx(vs,{className:"h-[15px] w-[15px] text-blue-400",strokeWidth:2})}),l.jsx("h2",{className:"text-[13.5px] font-medium",style:{color:"var(--text-primary)"},children:"Add Environment"})]}),l.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:l.jsx(St,{className:"h-[15px] w-[15px]",strokeWidth:2})})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"mb-1.5 block text-[11px] font-semibold uppercase tracking-wider",style:{color:"var(--text-faint)"},children:"Name"}),l.jsx("input",{ref:g,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)"}})]}),l.jsxs("div",{children:[l.jsx("label",{className:"mb-1.5 block text-[11px] font-semibold uppercase tracking-wider",style:{color:"var(--text-faint)"},children:"Base URL"}),l.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&&l.jsx("p",{className:"text-[12px] text-red-400",children:p}),l.jsxs("div",{className:"flex items-center justify-end gap-2 pt-1",children:[l.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"}),l.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&&l.jsx(tt,{className:"h-[14px] w-[14px] animate-spin",strokeWidth:2}),h?"Saving…":"Add Environment"]})]})]})]})})}function f0({onNavigate:n}){const[r,o]=w.useState(null),[i,u]=w.useState([]),[f,h]=w.useState([]),[m,p]=w.useState(!0),[x,g]=w.useState(!1),[y,v]=w.useState(null),[j,C]=w.useState(null),[_,T]=w.useState(!1),[M,B]=w.useState(null),[L,D]=w.useState(null),H=w.useCallback(async(E=!1)=>{E?g(!0):p(!0),v(null);try{const[q,k,U,z]=await Promise.allSettled([fetch("/api/model").then(O=>O.ok?O.json():null),fetch("/api/workflows").then(O=>O.ok?O.json():[]),fetch("/api/memory").then(O=>O.ok?O.json():[]),fetch("/api/model/environments").then(O=>O.ok?O.json():null)]);q.status==="fulfilled"&&o(q.value),k.status==="fulfilled"&&u(k.value??[]),U.status==="fulfilled"&&h(U.value??[]),z.status==="fulfilled"&&z.value&&C(z.value.defaultEnvironment??null)}catch(q){v(q.message)}finally{p(!1),g(!1)}},[]);w.useEffect(()=>{H()},[H]);const Z=r?.endpoints?.length??0,X=i.length,ce=f.length,F=r?.endpoints?.filter(E=>(E.security?.length??0)>0).length??0,J=(r?.endpoints??[]).reduce((E,q)=>(E[q.method.toUpperCase()]=(E[q.method.toUpperCase()]??0)+1,E),{}),ae=(r?.endpoints??[]).slice(0,8),te=i.slice(0,4),se=f.slice(0,6);return l.jsxs("div",{className:"flex min-h-full w-full flex-col",children:[l.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-6 py-5",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-[15px] font-medium text-[var(--text-primary)] leading-none",children:r?.project?.name??"Overview"}),l.jsx("p",{className:"mt-0.5 text-[11px] text-[var(--text-muted)]",children:m?"Loading…":r?`${r.project.framework??r.project.language??""} · v${r.version} · ${new Date(r.generatedAt).toLocaleString()}`:"No model yet — run a scan"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.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:[l.jsx(Kv,{className:"h-[15px] w-[15px] shrink-0",strokeWidth:2}),l.jsx("span",{children:"Jetic Documentation"})]}),l.jsx("button",{type:"button",onClick:()=>H(!0),disabled:x||m,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:l.jsx(pl,{className:`h-[15px] w-[15px] ${x?"animate-spin":""}`,strokeWidth:2})}),!m&&!r&&l.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:[l.jsx(Ai,{className:"h-[15px] w-[15px]",strokeWidth:2})," Scan Project"]})]})]}),l.jsxs("div",{className:"flex-1 overflow-auto",children:[m&&l.jsx("div",{className:"space-y-3 p-6",children:[1,2,3,4,5].map(E=>l.jsx("div",{className:"h-14 animate-pulse rounded-lg border border-[var(--border)] bg-[var(--bg-overlay)]",style:{opacity:1-E*.15}},E))}),!m&&y&&l.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:[l.jsx(Dt,{className:"h-8 w-8 text-red-400",strokeWidth:2}),l.jsx("p",{className:"text-[13px] text-red-300",children:y}),l.jsx("button",{type:"button",onClick:()=>H(),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"})]}),!m&&!y&&l.jsxs("div",{className:"p-6 space-y-5",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[l.jsx(di,{label:"Endpoints",value:Z,icon:u0,accent:"blue"}),l.jsx(di,{label:"Workflows",value:X,icon:Cd,accent:"zinc"}),l.jsx(di,{label:"Memory Keys",value:ce,icon:Mi,accent:"emerald"}),l.jsx(di,{label:"Secured",value:F,icon:qa,accent:"amber",sub:Z>0?`${Math.round(F/Z*100)}% of routes`:void 0})]}),r&&l.jsxs("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2",children:[l.jsx(jr,{title:"Project",icon:Mm,children:l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg border border-[var(--border)] bg-[var(--bg-overlay-md)]",children:l.jsx(Fd,{className:"h-[15px] w-[15px] text-blue-400",strokeWidth:2})}),l.jsxs("div",{children:[l.jsx("p",{className:"text-[13.5px] font-medium text-[var(--text-primary)]",children:r.project.name}),l.jsx("p",{className:"text-[11px] text-[var(--text-muted)]",children:r.project.framework??r.project.language??"Unknown framework"})]})]}),l.jsxs("div",{children:[l.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[l.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-[var(--text-faint)]",children:"Environments"}),l.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:[l.jsx(bt,{className:"h-3 w-3",strokeWidth:2})," Add"]})]}),(r.environments?.length??0)===0?l.jsx("p",{className:"text-[12px] italic",style:{color:"var(--text-faint)"},children:"No environments configured"}):l.jsx("div",{className:"space-y-1",children:r.environments.map(E=>{const q=j===E.name,k=M===E.name,U=L===E.name;return l.jsxs("div",{className:`group flex items-center gap-2.5 rounded-lg border px-3 py-2 transition-all ${q?"border-blue-500/30 bg-blue-500/[0.05]":"border-[var(--border)] bg-[var(--bg-overlay-md)]"}`,children:[l.jsx("button",{type:"button",title:q?"Default environment":"Set as default",onClick:async()=>{if(!q){B(E.name);try{await fetch(`/api/model/environments/${encodeURIComponent(E.name)}/default`,{method:"PUT"}),C(E.name),o(z=>z&&{...z,defaultEnvironment:E.name})}finally{B(null)}}},className:"shrink-0 flex h-4 w-4 items-center justify-center rounded-full border-2 transition-colors hover:cursor-pointer",style:{borderColor:q?"#60a5fa":"var(--border)",backgroundColor:q?"#60a5fa22":"transparent"},children:k?l.jsx(tt,{className:"h-2.5 w-2.5 text-blue-400 animate-spin",strokeWidth:3}):q&&l.jsx(yt,{className:"h-2.5 w-2.5 text-blue-400",strokeWidth:3})}),l.jsx(vs,{className:"h-[14px] w-[14px] text-[var(--text-faint)] shrink-0",strokeWidth:2}),l.jsx("span",{className:`text-[11px] w-16 shrink-0 font-medium ${q?"text-blue-400":"text-[var(--text-muted)]"}`,children:E.name}),l.jsx("span",{className:"font-mono text-[11px] text-[var(--text-secondary)] truncate flex-1",children:E.baseUrl}),q&&l.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"}),l.jsx("button",{type:"button",disabled:U,onClick:async()=>{D(E.name);try{await fetch(`/api/model/environments/${encodeURIComponent(E.name)}`,{method:"DELETE"}),o(z=>z&&{...z,environments:z.environments?.filter(O=>O.name!==E.name)}),j===E.name&&C(null)}finally{D(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:U?l.jsx(tt,{className:"h-3 w-3 animate-spin",strokeWidth:2}):l.jsx(Ot,{className:"h-3 w-3",strokeWidth:2})})]},E.name)})})]}),l.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[l.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:[l.jsx(_m,{className:"h-[15px] w-[15px]",strokeWidth:2})," View Model"]}),l.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:[l.jsx(Xv,{className:"h-[15px] w-[15px]",strokeWidth:2})," Simulations"]})]})]})}),l.jsx(jr,{title:"Method Distribution",icon:Lr,children:Object.keys(J).length===0?l.jsx(fi,{msg:"No endpoints scanned yet"}):l.jsx("div",{className:"space-y-3",children:Object.entries(J).sort(([,E],[,q])=>q-E).map(([E,q])=>{const k=Td(E),U=Math.round(q/Z*100);return l.jsxs("div",{children:[l.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[l.jsx("span",{className:`text-[12px] font-medium ${k.text}`,children:E}),l.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:[q," ",l.jsxs("span",{className:"text-[var(--text-faint)]",children:["(",U,"%)"]})]})]}),l.jsx("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-[var(--bg-overlay-md)]",children:l.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${U}%`,background:k.dot}})})]},E)})})})]}),l.jsx(jr,{title:"Endpoints",icon:u0,noPad:!0,action:l.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 ",l.jsx(ds,{className:"h-3.5 w-3.5",strokeWidth:2})]}),children:ae.length===0?l.jsx(fi,{msg:"No endpoints — scan your project first"}):l.jsxs("div",{className:"divide-y divide-[var(--border)]",children:[ae.map(E=>{const q=Td(E.method);return l.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5 hover:bg-[var(--bg-overlay-md)] transition-colors",children:[l.jsx("div",{className:"h-1.5 w-1.5 shrink-0 rounded-full",style:{background:q.dot}}),l.jsx(e2,{method:E.method}),l.jsx("span",{className:"flex-1 truncate font-mono text-[12px] text-[var(--text-secondary)]",children:E.path}),E.handlerName&&l.jsx("span",{className:"hidden sm:block truncate text-[11px] text-[var(--text-faint)] max-w-[140px]",children:E.handlerName}),(E.security?.length??0)>0&&l.jsx(qa,{className:"h-[15px] w-[15px] text-amber-500/60 shrink-0",strokeWidth:2})]},E.id)}),Z>8&&l.jsxs("div",{className:"px-4 py-2.5 text-[11px] text-[var(--text-faint)]",children:["+",Z-8," more endpoints"]})]})}),l.jsxs("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2",children:[l.jsx(jr,{title:"Workflows",icon:Cd,noPad:!0,action:l.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 ",l.jsx(ds,{className:"h-3.5 w-3.5",strokeWidth:2})]}),children:te.length===0?l.jsx(fi,{msg:"No workflows found"}):l.jsx("div",{className:"divide-y divide-[var(--border)]",children:te.map((E,q)=>l.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:[l.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:l.jsx(ea,{className:"h-[15px] w-[15px] text-blue-400",strokeWidth:2})}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("p",{className:"truncate text-[13px] text-[var(--text-primary)]",children:E.name}),l.jsxs("p",{className:"text-[11px] text-[var(--text-faint)]",children:[E.steps.length," steps"]})]}),l.jsx(ys,{className:"h-[15px] w-[15px] shrink-0 text-[var(--text-faint)] opacity-0 group-hover:opacity-100 transition-opacity",strokeWidth:2})]},q))})}),l.jsx(jr,{title:"Runtime Memory",icon:Mi,noPad:!0,action:l.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 ",l.jsx(ds,{className:"h-3.5 w-3.5",strokeWidth:2})]}),children:se.length===0?l.jsx(fi,{msg:"No memory entries"}):l.jsxs("div",{className:"divide-y divide-[var(--border)]",children:[se.map((E,q)=>l.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5 hover:bg-[var(--bg-overlay-md)] transition-colors",children:[l.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500/50 shrink-0"}),l.jsx("span",{className:"font-mono text-[11px] text-[var(--text-secondary)] flex-1 truncate",children:E.key}),l.jsx("span",{className:"text-[11px] text-[var(--text-faint)] truncate max-w-[100px]",children:typeof E.value=="object"?JSON.stringify(E.value):String(E.value)})]},q)),f.length>6&&l.jsxs("p",{className:"px-4 py-2.5 text-[11px] text-[var(--text-faint)]",children:["+",f.length-6," more entries"]})]})})]}),l.jsxs("div",{className:"flex items-center gap-2 border-t border-[var(--border)] pt-3 text-[11px] text-[var(--text-faint)]",children:[l.jsx(Yr,{className:"h-[15px] w-[15px]",strokeWidth:2}),r?`Model generated ${new Date(r.generatedAt).toLocaleString()}`:"No model generated yet"]})]})]}),_&&l.jsx(t2,{onClose:()=>T(!1),onSave:async(E,q)=>{const k=await fetch("/api/model/environments",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:E,baseUrl:q})});if(!k.ok){const z=await k.json().catch(()=>({}));throw new Error(z.error??"Failed")}const U=await k.json();o(z=>z&&{...z,environments:U.environments}),U.defaultEnvironment&&C(U.defaultEnvironment)}})]})}async function n2(n){return await fetch("/api/traces",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}),n.id}async function h0(){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 a2(n){await fetch(`/api/traces/${encodeURIComponent(n)}`,{method:"DELETE"})}async function l2(){await fetch("/api/traces",{method:"DELETE"})}function Et(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=Et(n[o]))!==""&&(r+=(r&&" ")+i);else for(let o in n)n[o]&&(r+=(r&&" ")+o);return r}var cd={exports:{}},ud={},dd={exports:{}},fd={};/**
|
|
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 x0;function s2(){if(x0)return fd;x0=1;var n=qr();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 m(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 g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?x:m;return fd.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:g,fd}var p0;function r2(){return p0||(p0=1,dd.exports=s2()),dd.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 m0;function o2(){if(m0)return ud;m0=1;var n=qr(),r=r2();function o(x,g){return x===g&&(x!==0||1/x===1/g)||x!==x&&g!==g}var i=typeof Object.is=="function"?Object.is:o,u=r.useSyncExternalStore,f=n.useRef,h=n.useEffect,m=n.useMemo,p=n.useDebugValue;return ud.useSyncExternalStoreWithSelector=function(x,g,y,v,j){var C=f(null);if(C.current===null){var _={hasValue:!1,value:null};C.current=_}else _=C.current;C=m(function(){function M(Z){if(!B){if(B=!0,L=Z,Z=v(Z),j!==void 0&&_.hasValue){var X=_.value;if(j(X,Z))return D=X}return D=Z}if(X=D,i(L,Z))return X;var ce=v(Z);return j!==void 0&&j(X,ce)?(L=Z,X):(L=Z,D=ce)}var B=!1,L,D,H=y===void 0?null:y;return[function(){return M(g())},H===null?void 0:function(){return M(H())}]},[g,y,v,j]);var T=u(x,C[0],C[1]);return h(function(){_.hasValue=!0,_.value=T},[T]),p(T),T},ud}var g0;function i2(){return g0||(g0=1,cd.exports=o2()),cd.exports}var c2=i2();const u2=vm(c2),d2={},b0=n=>{let r;const o=new Set,i=(g,y)=>{const v=typeof g=="function"?g(r):g;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:g=>(o.add(g),()=>o.delete(g)),destroy:()=>{(d2?"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},f2=n=>n?b0(n):b0,{useDebugValue:h2}=ie,{useSyncExternalStoreWithSelector:x2}=u2,p2=n=>n;function zm(n,r=p2,o){const i=x2(n.subscribe,n.getState,n.getServerState||n.getInitialState,r,o);return h2(i),i}const y0=(n,r)=>{const o=f2(n),i=(u,f=r)=>zm(o,u,f);return Object.assign(i,o),i},m2=(n,r)=>n?y0(n,r):y0;function vt(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 g2={value:()=>{}};function Yi(){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 ki(o)}function ki(n){this._=n}function b2(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}})}ki.prototype=Yi.prototype={constructor:ki,on:function(n,r){var o=this._,i=b2(n+"",o),u,f=-1,h=i.length;if(arguments.length<2){for(;++f<h;)if((u=(n=i[f]).type)&&(u=y2(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]=v0(o[u],n.name,r);else if(r==null)for(u in o)o[u]=v0(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 ki(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 y2(n,r){for(var o=0,i=n.length,u;o<i;++o)if((u=n[o]).name===r)return u.value}function v0(n,r,o){for(var i=0,u=n.length;i<u;++i)if(n[i].name===r){n[i]=g2,n=n.slice(0,i).concat(n.slice(i+1));break}return o!=null&&n.push({name:r,value:o}),n}var Md="http://www.w3.org/1999/xhtml";const j0={svg:"http://www.w3.org/2000/svg",xhtml:Md,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Vi(n){var r=n+="",o=r.indexOf(":");return o>=0&&(r=n.slice(0,o))!=="xmlns"&&(n=n.slice(o+1)),j0.hasOwnProperty(r)?{space:j0[r],local:n}:n}function v2(n){return function(){var r=this.ownerDocument,o=this.namespaceURI;return o===Md&&r.documentElement.namespaceURI===Md?r.createElement(n):r.createElementNS(o,n)}}function j2(n){return function(){return this.ownerDocument.createElementNS(n.space,n.local)}}function Om(n){var r=Vi(n);return(r.local?j2:v2)(r)}function N2(){}function Id(n){return n==null?N2:function(){return this.querySelector(n)}}function w2(n){typeof n!="function"&&(n=Id(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,m=i[u]=new Array(h),p,x,g=0;g<h;++g)(p=f[g])&&(x=n.call(p,p.__data__,g,f))&&("__data__"in p&&(x.__data__=p.__data__),m[g]=x);return new Pt(i,this._parents)}function S2(n){return n==null?[]:Array.isArray(n)?n:Array.from(n)}function E2(){return[]}function Dm(n){return n==null?E2:function(){return this.querySelectorAll(n)}}function k2(n){return function(){return S2(n.apply(this,arguments))}}function _2(n){typeof n=="function"?n=k2(n):n=Dm(n);for(var r=this._groups,o=r.length,i=[],u=[],f=0;f<o;++f)for(var h=r[f],m=h.length,p,x=0;x<m;++x)(p=h[x])&&(i.push(n.call(p,p.__data__,x,h)),u.push(p));return new Pt(i,u)}function Hm(n){return function(){return this.matches(n)}}function Um(n){return function(r){return r.matches(n)}}var C2=Array.prototype.find;function T2(n){return function(){return C2.call(this.children,n)}}function M2(){return this.firstElementChild}function A2(n){return this.select(n==null?M2:T2(typeof n=="function"?n:Um(n)))}var R2=Array.prototype.filter;function z2(){return Array.from(this.children)}function O2(n){return function(){return R2.call(this.children,n)}}function D2(n){return this.selectAll(n==null?z2:O2(typeof n=="function"?n:Um(n)))}function H2(n){typeof n!="function"&&(n=Hm(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,m=i[u]=[],p,x=0;x<h;++x)(p=f[x])&&n.call(p,p.__data__,x,f)&&m.push(p);return new Pt(i,this._parents)}function Bm(n){return new Array(n.length)}function U2(){return new Pt(this._enter||this._groups.map(Bm),this._parents)}function Ri(n,r){this.ownerDocument=n.ownerDocument,this.namespaceURI=n.namespaceURI,this._next=null,this._parent=n,this.__data__=r}Ri.prototype={constructor:Ri,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 B2(n){return function(){return n}}function $2(n,r,o,i,u,f){for(var h=0,m,p=r.length,x=f.length;h<x;++h)(m=r[h])?(m.__data__=f[h],i[h]=m):o[h]=new Ri(n,f[h]);for(;h<p;++h)(m=r[h])&&(u[h]=m)}function q2(n,r,o,i,u,f,h){var m,p,x=new Map,g=r.length,y=f.length,v=new Array(g),j;for(m=0;m<g;++m)(p=r[m])&&(v[m]=j=h.call(p,p.__data__,m,r)+"",x.has(j)?u[m]=p:x.set(j,p));for(m=0;m<y;++m)j=h.call(n,f[m],m,f)+"",(p=x.get(j))?(i[m]=p,p.__data__=f[m],x.delete(j)):o[m]=new Ri(n,f[m]);for(m=0;m<g;++m)(p=r[m])&&x.get(v[m])===p&&(u[m]=p)}function L2(n){return n.__data__}function Y2(n,r){if(!arguments.length)return Array.from(this,L2);var o=r?q2:$2,i=this._parents,u=this._groups;typeof n!="function"&&(n=B2(n));for(var f=u.length,h=new Array(f),m=new Array(f),p=new Array(f),x=0;x<f;++x){var g=i[x],y=u[x],v=y.length,j=V2(n.call(g,g&&g.__data__,x,i)),C=j.length,_=m[x]=new Array(C),T=h[x]=new Array(C),M=p[x]=new Array(v);o(g,y,_,T,M,j,r);for(var B=0,L=0,D,H;B<C;++B)if(D=_[B]){for(B>=L&&(L=B+1);!(H=T[L])&&++L<C;);D._next=H||null}}return h=new Pt(h,i),h._enter=m,h._exit=p,h}function V2(n){return typeof n=="object"&&"length"in n?n:Array.from(n)}function G2(){return new Pt(this._exit||this._groups.map(Bm),this._parents)}function X2(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 Z2(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),m=new Array(u),p=0;p<h;++p)for(var x=o[p],g=i[p],y=x.length,v=m[p]=new Array(y),j,C=0;C<y;++C)(j=x[C]||g[C])&&(v[C]=j);for(;p<u;++p)m[p]=o[p];return new Pt(m,this._parents)}function W2(){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 Q2(n){n||(n=K2);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],m=h.length,p=u[f]=new Array(m),x,g=0;g<m;++g)(x=h[g])&&(p[g]=x);p.sort(r)}return new Pt(u,this._parents).order()}function K2(n,r){return n<r?-1:n>r?1:n>=r?0:NaN}function J2(){var n=arguments[0];return arguments[0]=this,n.apply(null,arguments),this}function F2(){return Array.from(this)}function I2(){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 P2(){let n=0;for(const r of this)++n;return n}function ej(){return!this.node()}function tj(n){for(var r=this._groups,o=0,i=r.length;o<i;++o)for(var u=r[o],f=0,h=u.length,m;f<h;++f)(m=u[f])&&n.call(m,m.__data__,f,u);return this}function nj(n){return function(){this.removeAttribute(n)}}function aj(n){return function(){this.removeAttributeNS(n.space,n.local)}}function lj(n,r){return function(){this.setAttribute(n,r)}}function sj(n,r){return function(){this.setAttributeNS(n.space,n.local,r)}}function rj(n,r){return function(){var o=r.apply(this,arguments);o==null?this.removeAttribute(n):this.setAttribute(n,o)}}function oj(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 ij(n,r){var o=Vi(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?aj:nj:typeof r=="function"?o.local?oj:rj:o.local?sj:lj)(o,r))}function $m(n){return n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView}function cj(n){return function(){this.style.removeProperty(n)}}function uj(n,r,o){return function(){this.style.setProperty(n,r,o)}}function dj(n,r,o){return function(){var i=r.apply(this,arguments);i==null?this.style.removeProperty(n):this.style.setProperty(n,i,o)}}function fj(n,r,o){return arguments.length>1?this.each((r==null?cj:typeof r=="function"?dj:uj)(n,r,o??"")):ps(this.node(),n)}function ps(n,r){return n.style.getPropertyValue(r)||$m(n).getComputedStyle(n,null).getPropertyValue(r)}function hj(n){return function(){delete this[n]}}function xj(n,r){return function(){this[n]=r}}function pj(n,r){return function(){var o=r.apply(this,arguments);o==null?delete this[n]:this[n]=o}}function mj(n,r){return arguments.length>1?this.each((r==null?hj:typeof r=="function"?pj:xj)(n,r)):this.node()[n]}function qm(n){return n.trim().split(/^|\s+/)}function Pd(n){return n.classList||new Lm(n)}function Lm(n){this._node=n,this._names=qm(n.getAttribute("class")||"")}Lm.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 Ym(n,r){for(var o=Pd(n),i=-1,u=r.length;++i<u;)o.add(r[i])}function Vm(n,r){for(var o=Pd(n),i=-1,u=r.length;++i<u;)o.remove(r[i])}function gj(n){return function(){Ym(this,n)}}function bj(n){return function(){Vm(this,n)}}function yj(n,r){return function(){(r.apply(this,arguments)?Ym:Vm)(this,n)}}function vj(n,r){var o=qm(n+"");if(arguments.length<2){for(var i=Pd(this.node()),u=-1,f=o.length;++u<f;)if(!i.contains(o[u]))return!1;return!0}return this.each((typeof r=="function"?yj:r?gj:bj)(o,r))}function jj(){this.textContent=""}function Nj(n){return function(){this.textContent=n}}function wj(n){return function(){var r=n.apply(this,arguments);this.textContent=r??""}}function Sj(n){return arguments.length?this.each(n==null?jj:(typeof n=="function"?wj:Nj)(n)):this.node().textContent}function Ej(){this.innerHTML=""}function kj(n){return function(){this.innerHTML=n}}function _j(n){return function(){var r=n.apply(this,arguments);this.innerHTML=r??""}}function Cj(n){return arguments.length?this.each(n==null?Ej:(typeof n=="function"?_j:kj)(n)):this.node().innerHTML}function Tj(){this.nextSibling&&this.parentNode.appendChild(this)}function Mj(){return this.each(Tj)}function Aj(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Rj(){return this.each(Aj)}function zj(n){var r=typeof n=="function"?n:Om(n);return this.select(function(){return this.appendChild(r.apply(this,arguments))})}function Oj(){return null}function Dj(n,r){var o=typeof n=="function"?n:Om(n),i=r==null?Oj:typeof r=="function"?r:Id(r);return this.select(function(){return this.insertBefore(o.apply(this,arguments),i.apply(this,arguments)||null)})}function Hj(){var n=this.parentNode;n&&n.removeChild(this)}function Uj(){return this.each(Hj)}function Bj(){var n=this.cloneNode(!1),r=this.parentNode;return r?r.insertBefore(n,this.nextSibling):n}function $j(){var n=this.cloneNode(!0),r=this.parentNode;return r?r.insertBefore(n,this.nextSibling):n}function qj(n){return this.select(n?$j:Bj)}function Lj(n){return arguments.length?this.property("__data__",n):this.node().__data__}function Yj(n){return function(r){n.call(this,r,this.__data__)}}function Vj(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 Gj(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 Xj(n,r,o){return function(){var i=this.__on,u,f=Yj(r);if(i){for(var h=0,m=i.length;h<m;++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 Zj(n,r,o){var i=Vj(n+""),u,f=i.length,h;if(arguments.length<2){var m=this.node().__on;if(m){for(var p=0,x=m.length,g;p<x;++p)for(u=0,g=m[p];u<f;++u)if((h=i[u]).type===g.type&&h.name===g.name)return g.value}return}for(m=r?Xj:Gj,u=0;u<f;++u)this.each(m(i[u],r,o));return this}function Gm(n,r,o){var i=$m(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 Wj(n,r){return function(){return Gm(this,n,r)}}function Qj(n,r){return function(){return Gm(this,n,r.apply(this,arguments))}}function Kj(n,r){return this.each((typeof r=="function"?Qj:Wj)(n,r))}function*Jj(){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 Xm=[null];function Pt(n,r){this._groups=n,this._parents=r}function Vr(){return new Pt([[document.documentElement]],Xm)}function Fj(){return this}Pt.prototype=Vr.prototype={constructor:Pt,select:w2,selectAll:_2,selectChild:A2,selectChildren:D2,filter:H2,data:Y2,enter:U2,exit:G2,join:X2,merge:Z2,selection:Fj,order:W2,sort:Q2,call:J2,nodes:F2,node:I2,size:P2,empty:ej,each:tj,attr:ij,style:fj,property:mj,classed:vj,text:Sj,html:Cj,raise:Mj,lower:Rj,append:zj,insert:Dj,remove:Uj,clone:qj,datum:Lj,on:Zj,dispatch:Kj,[Symbol.iterator]:Jj};function xn(n){return typeof n=="string"?new Pt([[document.querySelector(n)]],[document.documentElement]):new Pt([[n]],Xm)}function Ij(n){let r;for(;r=n.sourceEvent;)n=r;return n}function Nn(n,r){if(n=Ij(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 Pj={passive:!1},Rr={capture:!0,passive:!1};function hd(n){n.stopImmediatePropagation()}function fs(n){n.preventDefault(),n.stopImmediatePropagation()}function Zm(n){var r=n.document.documentElement,o=xn(n).on("dragstart.drag",fs,Rr);"onselectstart"in r?o.on("selectstart.drag",fs,Rr):(r.__noselect=r.style.MozUserSelect,r.style.MozUserSelect="none")}function Wm(n,r){var o=n.document.documentElement,i=xn(n).on("dragstart.drag",null);r&&(i.on("click.drag",fs,Rr),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 hi=n=>()=>n;function Ad(n,{sourceEvent:r,subject:o,target:i,identifier:u,active:f,x:h,y:m,dx:p,dy:x,dispatch:g}){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:m,enumerable:!0,configurable:!0},dx:{value:p,enumerable:!0,configurable:!0},dy:{value:x,enumerable:!0,configurable:!0},_:{value:g}})}Ad.prototype.on=function(){var n=this._.on.apply(this._,arguments);return n===this._?this:n};function eN(n){return!n.ctrlKey&&!n.button}function tN(){return this.parentNode}function nN(n,r){return r??{x:n.x,y:n.y}}function aN(){return navigator.maxTouchPoints||"ontouchstart"in this}function lN(){var n=eN,r=tN,o=nN,i=aN,u={},f=Yi("start","drag","end"),h=0,m,p,x,g,y=0;function v(D){D.on("mousedown.drag",j).filter(i).on("touchstart.drag",T).on("touchmove.drag",M,Pj).on("touchend.drag touchcancel.drag",B).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function j(D,H){if(!(g||!n.call(this,D,H))){var Z=L(this,r.call(this,D,H),D,H,"mouse");Z&&(xn(D.view).on("mousemove.drag",C,Rr).on("mouseup.drag",_,Rr),Zm(D.view),hd(D),x=!1,m=D.clientX,p=D.clientY,Z("start",D))}}function C(D){if(fs(D),!x){var H=D.clientX-m,Z=D.clientY-p;x=H*H+Z*Z>y}u.mouse("drag",D)}function _(D){xn(D.view).on("mousemove.drag mouseup.drag",null),Wm(D.view,x),fs(D),u.mouse("end",D)}function T(D,H){if(n.call(this,D,H)){var Z=D.changedTouches,X=r.call(this,D,H),ce=Z.length,F,J;for(F=0;F<ce;++F)(J=L(this,X,D,H,Z[F].identifier,Z[F]))&&(hd(D),J("start",D,Z[F]))}}function M(D){var H=D.changedTouches,Z=H.length,X,ce;for(X=0;X<Z;++X)(ce=u[H[X].identifier])&&(fs(D),ce("drag",D,H[X]))}function B(D){var H=D.changedTouches,Z=H.length,X,ce;for(g&&clearTimeout(g),g=setTimeout(function(){g=null},500),X=0;X<Z;++X)(ce=u[H[X].identifier])&&(hd(D),ce("end",D,H[X]))}function L(D,H,Z,X,ce,F){var J=f.copy(),ae=Nn(F||Z,H),te,se,E;if((E=o.call(D,new Ad("beforestart",{sourceEvent:Z,target:v,identifier:ce,active:h,x:ae[0],y:ae[1],dx:0,dy:0,dispatch:J}),X))!=null)return te=E.x-ae[0]||0,se=E.y-ae[1]||0,function q(k,U,z){var O=ae,N;switch(k){case"start":u[ce]=q,N=h++;break;case"end":delete u[ce],--h;case"drag":ae=Nn(z||U,H),N=h;break}J.call(k,D,new Ad(k,{sourceEvent:U,subject:E,target:v,identifier:ce,active:N,x:ae[0]+te,y:ae[1]+se,dx:ae[0]-O[0],dy:ae[1]-O[1],dispatch:J}),X)}}return v.filter=function(D){return arguments.length?(n=typeof D=="function"?D:hi(!!D),v):n},v.container=function(D){return arguments.length?(r=typeof D=="function"?D:hi(D),v):r},v.subject=function(D){return arguments.length?(o=typeof D=="function"?D:hi(D),v):o},v.touchable=function(D){return arguments.length?(i=typeof D=="function"?D:hi(!!D),v):i},v.on=function(){var D=f.on.apply(f,arguments);return D===f?v:D},v.clickDistance=function(D){return arguments.length?(y=(D=+D)*D,v):Math.sqrt(y)},v}function ef(n,r,o){n.prototype=r.prototype=o,o.constructor=n}function Qm(n,r){var o=Object.create(n.prototype);for(var i in r)o[i]=r[i];return o}function Gr(){}var zr=.7,zi=1/zr,hs="\\s*([+-]?\\d+)\\s*",Or="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",An="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",sN=/^#([0-9a-f]{3,8})$/,rN=new RegExp(`^rgb\\(${hs},${hs},${hs}\\)$`),oN=new RegExp(`^rgb\\(${An},${An},${An}\\)$`),iN=new RegExp(`^rgba\\(${hs},${hs},${hs},${Or}\\)$`),cN=new RegExp(`^rgba\\(${An},${An},${An},${Or}\\)$`),uN=new RegExp(`^hsl\\(${Or},${An},${An}\\)$`),dN=new RegExp(`^hsla\\(${Or},${An},${An},${Or}\\)$`),N0={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};ef(Gr,Dr,{copy(n){return Object.assign(new this.constructor,this,n)},displayable(){return this.rgb().displayable()},hex:w0,formatHex:w0,formatHex8:fN,formatHsl:hN,formatRgb:S0,toString:S0});function w0(){return this.rgb().formatHex()}function fN(){return this.rgb().formatHex8()}function hN(){return Km(this).formatHsl()}function S0(){return this.rgb().formatRgb()}function Dr(n){var r,o;return n=(n+"").trim().toLowerCase(),(r=sN.exec(n))?(o=r[1].length,r=parseInt(r[1],16),o===6?E0(r):o===3?new Lt(r>>8&15|r>>4&240,r>>4&15|r&240,(r&15)<<4|r&15,1):o===8?xi(r>>24&255,r>>16&255,r>>8&255,(r&255)/255):o===4?xi(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=rN.exec(n))?new Lt(r[1],r[2],r[3],1):(r=oN.exec(n))?new Lt(r[1]*255/100,r[2]*255/100,r[3]*255/100,1):(r=iN.exec(n))?xi(r[1],r[2],r[3],r[4]):(r=cN.exec(n))?xi(r[1]*255/100,r[2]*255/100,r[3]*255/100,r[4]):(r=uN.exec(n))?C0(r[1],r[2]/100,r[3]/100,1):(r=dN.exec(n))?C0(r[1],r[2]/100,r[3]/100,r[4]):N0.hasOwnProperty(n)?E0(N0[n]):n==="transparent"?new Lt(NaN,NaN,NaN,0):null}function E0(n){return new Lt(n>>16&255,n>>8&255,n&255,1)}function xi(n,r,o,i){return i<=0&&(n=r=o=NaN),new Lt(n,r,o,i)}function xN(n){return n instanceof Gr||(n=Dr(n)),n?(n=n.rgb(),new Lt(n.r,n.g,n.b,n.opacity)):new Lt}function Rd(n,r,o,i){return arguments.length===1?xN(n):new Lt(n,r,o,i??1)}function Lt(n,r,o,i){this.r=+n,this.g=+r,this.b=+o,this.opacity=+i}ef(Lt,Rd,Qm(Gr,{brighter(n){return n=n==null?zi:Math.pow(zi,n),new Lt(this.r*n,this.g*n,this.b*n,this.opacity)},darker(n){return n=n==null?zr:Math.pow(zr,n),new Lt(this.r*n,this.g*n,this.b*n,this.opacity)},rgb(){return this},clamp(){return new Lt(dl(this.r),dl(this.g),dl(this.b),Oi(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:k0,formatHex:k0,formatHex8:pN,formatRgb:_0,toString:_0}));function k0(){return`#${cl(this.r)}${cl(this.g)}${cl(this.b)}`}function pN(){return`#${cl(this.r)}${cl(this.g)}${cl(this.b)}${cl((isNaN(this.opacity)?1:this.opacity)*255)}`}function _0(){const n=Oi(this.opacity);return`${n===1?"rgb(":"rgba("}${dl(this.r)}, ${dl(this.g)}, ${dl(this.b)}${n===1?")":`, ${n})`}`}function Oi(n){return isNaN(n)?1:Math.max(0,Math.min(1,n))}function dl(n){return Math.max(0,Math.min(255,Math.round(n)||0))}function cl(n){return n=dl(n),(n<16?"0":"")+n.toString(16)}function C0(n,r,o,i){return i<=0?n=r=o=NaN:o<=0||o>=1?n=r=NaN:r<=0&&(n=NaN),new wn(n,r,o,i)}function Km(n){if(n instanceof wn)return new wn(n.h,n.s,n.l,n.opacity);if(n instanceof Gr||(n=Dr(n)),!n)return new wn;if(n instanceof wn)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,m=f-u,p=(f+u)/2;return m?(r===f?h=(o-i)/m+(o<i)*6:o===f?h=(i-r)/m+2:h=(r-o)/m+4,m/=p<.5?f+u:2-f-u,h*=60):m=p>0&&p<1?0:h,new wn(h,m,p,n.opacity)}function mN(n,r,o,i){return arguments.length===1?Km(n):new wn(n,r,o,i??1)}function wn(n,r,o,i){this.h=+n,this.s=+r,this.l=+o,this.opacity=+i}ef(wn,mN,Qm(Gr,{brighter(n){return n=n==null?zi:Math.pow(zi,n),new wn(this.h,this.s,this.l*n,this.opacity)},darker(n){return n=n==null?zr:Math.pow(zr,n),new wn(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 Lt(xd(n>=240?n-240:n+120,u,i),xd(n,u,i),xd(n<120?n+240:n-120,u,i),this.opacity)},clamp(){return new wn(T0(this.h),pi(this.s),pi(this.l),Oi(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=Oi(this.opacity);return`${n===1?"hsl(":"hsla("}${T0(this.h)}, ${pi(this.s)*100}%, ${pi(this.l)*100}%${n===1?")":`, ${n})`}`}}));function T0(n){return n=(n||0)%360,n<0?n+360:n}function pi(n){return Math.max(0,Math.min(1,n||0))}function xd(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 Jm=n=>()=>n;function gN(n,r){return function(o){return n+o*r}}function bN(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 yN(n){return(n=+n)==1?Fm:function(r,o){return o-r?bN(r,o,n):Jm(isNaN(r)?o:r)}}function Fm(n,r){var o=r-n;return o?gN(n,o):Jm(isNaN(n)?r:n)}const M0=(function n(r){var o=yN(r);function i(u,f){var h=o((u=Rd(u)).r,(f=Rd(f)).r),m=o(u.g,f.g),p=o(u.b,f.b),x=Fm(u.opacity,f.opacity);return function(g){return u.r=h(g),u.g=m(g),u.b=p(g),u.opacity=x(g),u+""}}return i.gamma=n,i})(1);function Oa(n,r){return n=+n,r=+r,function(o){return n*(1-o)+r*o}}var zd=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,pd=new RegExp(zd.source,"g");function vN(n){return function(){return n}}function jN(n){return function(r){return n(r)+""}}function NN(n,r){var o=zd.lastIndex=pd.lastIndex=0,i,u,f,h=-1,m=[],p=[];for(n=n+"",r=r+"";(i=zd.exec(n))&&(u=pd.exec(r));)(f=u.index)>o&&(f=r.slice(o,f),m[h]?m[h]+=f:m[++h]=f),(i=i[0])===(u=u[0])?m[h]?m[h]+=u:m[++h]=u:(m[++h]=null,p.push({i:h,x:Oa(i,u)})),o=pd.lastIndex;return o<r.length&&(f=r.slice(o),m[h]?m[h]+=f:m[++h]=f),m.length<2?p[0]?jN(p[0].x):vN(r):(r=p.length,function(x){for(var g=0,y;g<r;++g)m[(y=p[g]).i]=y.x(x);return m.join("")})}var A0=180/Math.PI,Od={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Im(n,r,o,i,u,f){var h,m,p;return(h=Math.sqrt(n*n+r*r))&&(n/=h,r/=h),(p=n*o+r*i)&&(o-=n*p,i-=r*p),(m=Math.sqrt(o*o+i*i))&&(o/=m,i/=m,p/=m),n*i<r*o&&(n=-n,r=-r,p=-p,h=-h),{translateX:u,translateY:f,rotate:Math.atan2(r,n)*A0,skewX:Math.atan(p)*A0,scaleX:h,scaleY:m}}var mi;function wN(n){const r=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(n+"");return r.isIdentity?Od:Im(r.a,r.b,r.c,r.d,r.e,r.f)}function SN(n){return n==null||(mi||(mi=document.createElementNS("http://www.w3.org/2000/svg","g")),mi.setAttribute("transform",n),!(n=mi.transform.baseVal.consolidate()))?Od:(n=n.matrix,Im(n.a,n.b,n.c,n.d,n.e,n.f))}function Pm(n,r,o,i){function u(x){return x.length?x.pop()+" ":""}function f(x,g,y,v,j,C){if(x!==y||g!==v){var _=j.push("translate(",null,r,null,o);C.push({i:_-4,x:Oa(x,y)},{i:_-2,x:Oa(g,v)})}else(y||v)&&j.push("translate("+y+r+v+o)}function h(x,g,y,v){x!==g?(x-g>180?g+=360:g-x>180&&(x+=360),v.push({i:y.push(u(y)+"rotate(",null,i)-2,x:Oa(x,g)})):g&&y.push(u(y)+"rotate("+g+i)}function m(x,g,y,v){x!==g?v.push({i:y.push(u(y)+"skewX(",null,i)-2,x:Oa(x,g)}):g&&y.push(u(y)+"skewX("+g+i)}function p(x,g,y,v,j,C){if(x!==y||g!==v){var _=j.push(u(j)+"scale(",null,",",null,")");C.push({i:_-4,x:Oa(x,y)},{i:_-2,x:Oa(g,v)})}else(y!==1||v!==1)&&j.push(u(j)+"scale("+y+","+v+")")}return function(x,g){var y=[],v=[];return x=n(x),g=n(g),f(x.translateX,x.translateY,g.translateX,g.translateY,y,v),h(x.rotate,g.rotate,y,v),m(x.skewX,g.skewX,y,v),p(x.scaleX,x.scaleY,g.scaleX,g.scaleY,y,v),x=g=null,function(j){for(var C=-1,_=v.length,T;++C<_;)y[(T=v[C]).i]=T.x(j);return y.join("")}}}var EN=Pm(wN,"px, ","px)","deg)"),kN=Pm(SN,", ",")",")"),_N=1e-12;function R0(n){return((n=Math.exp(n))+1/n)/2}function CN(n){return((n=Math.exp(n))-1/n)/2}function TN(n){return((n=Math.exp(2*n))-1)/(n+1)}const MN=(function n(r,o,i){function u(f,h){var m=f[0],p=f[1],x=f[2],g=h[0],y=h[1],v=h[2],j=g-m,C=y-p,_=j*j+C*C,T,M;if(_<_N)M=Math.log(v/x)/r,T=function(X){return[m+X*j,p+X*C,x*Math.exp(r*X*M)]};else{var B=Math.sqrt(_),L=(v*v-x*x+i*_)/(2*x*o*B),D=(v*v-x*x-i*_)/(2*v*o*B),H=Math.log(Math.sqrt(L*L+1)-L),Z=Math.log(Math.sqrt(D*D+1)-D);M=(Z-H)/r,T=function(X){var ce=X*M,F=R0(H),J=x/(o*B)*(F*TN(r*ce+H)-CN(H));return[m+J*j,p+J*C,x*F/R0(r*ce+H)]}}return T.duration=M*1e3*r/Math.SQRT2,T}return u.rho=function(f){var h=Math.max(.001,+f),m=h*h,p=m*m;return n(h,m,p)},u})(Math.SQRT2,2,4);var ms=0,Cr=0,Nr=0,eg=1e3,Di,Tr,Hi=0,hl=0,Gi=0,Hr=typeof performance=="object"&&performance.now?performance:Date,tg=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(n){setTimeout(n,17)};function tf(){return hl||(tg(AN),hl=Hr.now()+Gi)}function AN(){hl=0}function Ui(){this._call=this._time=this._next=null}Ui.prototype=ng.prototype={constructor:Ui,restart:function(n,r,o){if(typeof n!="function")throw new TypeError("callback is not a function");o=(o==null?tf():+o)+(r==null?0:+r),!this._next&&Tr!==this&&(Tr?Tr._next=this:Di=this,Tr=this),this._call=n,this._time=o,Dd()},stop:function(){this._call&&(this._call=null,this._time=1/0,Dd())}};function ng(n,r,o){var i=new Ui;return i.restart(n,r,o),i}function RN(){tf(),++ms;for(var n=Di,r;n;)(r=hl-n._time)>=0&&n._call.call(void 0,r),n=n._next;--ms}function z0(){hl=(Hi=Hr.now())+Gi,ms=Cr=0;try{RN()}finally{ms=0,ON(),hl=0}}function zN(){var n=Hr.now(),r=n-Hi;r>eg&&(Gi-=r,Hi=n)}function ON(){for(var n,r=Di,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:Di=o);Tr=n,Dd(i)}function Dd(n){if(!ms){Cr&&(Cr=clearTimeout(Cr));var r=n-hl;r>24?(n<1/0&&(Cr=setTimeout(z0,n-Hr.now()-Gi)),Nr&&(Nr=clearInterval(Nr))):(Nr||(Hi=Hr.now(),Nr=setInterval(zN,eg)),ms=1,tg(z0))}}function O0(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 DN=Yi("start","end","cancel","interrupt"),HN=[],ag=0,D0=1,Hd=2,_i=3,H0=4,Ud=5,Ci=6;function Xi(n,r,o,i,u,f){var h=n.__transition;if(!h)n.__transition={};else if(o in h)return;UN(n,o,{name:r,index:i,group:u,on:DN,tween:HN,time:f.time,delay:f.delay,duration:f.duration,ease:f.ease,timer:null,state:ag})}function nf(n,r){var o=Sn(n,r);if(o.state>ag)throw new Error("too late; already scheduled");return o}function Rn(n,r){var o=Sn(n,r);if(o.state>_i)throw new Error("too late; already running");return o}function Sn(n,r){var o=n.__transition;if(!o||!(o=o[r]))throw new Error("transition not found");return o}function UN(n,r,o){var i=n.__transition,u;i[r]=o,o.timer=ng(f,0,o.time);function f(x){o.state=D0,o.timer.restart(h,o.delay,o.time),o.delay<=x&&h(x-o.delay)}function h(x){var g,y,v,j;if(o.state!==D0)return p();for(g in i)if(j=i[g],j.name===o.name){if(j.state===_i)return O0(h);j.state===H0?(j.state=Ci,j.timer.stop(),j.on.call("interrupt",n,n.__data__,j.index,j.group),delete i[g]):+g<r&&(j.state=Ci,j.timer.stop(),j.on.call("cancel",n,n.__data__,j.index,j.group),delete i[g])}if(O0(function(){o.state===_i&&(o.state=H0,o.timer.restart(m,o.delay,o.time),m(x))}),o.state=Hd,o.on.call("start",n,n.__data__,o.index,o.group),o.state===Hd){for(o.state=_i,u=new Array(v=o.tween.length),g=0,y=-1;g<v;++g)(j=o.tween[g].value.call(n,n.__data__,o.index,o.group))&&(u[++y]=j);u.length=y+1}}function m(x){for(var g=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,g);o.state===Ud&&(o.on.call("end",n,n.__data__,o.index,o.group),p())}function p(){o.state=Ci,o.timer.stop(),delete i[r];for(var x in i)return;delete n.__transition}}function Ti(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>Hd&&i.state<Ud,i.state=Ci,i.timer.stop(),i.on.call(u?"interrupt":"cancel",n,n.__data__,i.index,i.group),delete o[h]}f&&delete n.__transition}}function BN(n){return this.each(function(){Ti(this,n)})}function $N(n,r){var o,i;return function(){var u=Rn(this,n),f=u.tween;if(f!==o){i=o=f;for(var h=0,m=i.length;h<m;++h)if(i[h].name===r){i=i.slice(),i.splice(h,1);break}}u.tween=i}}function qN(n,r,o){var i,u;if(typeof o!="function")throw new Error;return function(){var f=Rn(this,n),h=f.tween;if(h!==i){u=(i=h).slice();for(var m={name:r,value:o},p=0,x=u.length;p<x;++p)if(u[p].name===r){u[p]=m;break}p===x&&u.push(m)}f.tween=u}}function LN(n,r){var o=this._id;if(n+="",arguments.length<2){for(var i=Sn(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?$N:qN)(o,n,r))}function af(n,r,o){var i=n._id;return n.each(function(){var u=Rn(this,i);(u.value||(u.value={}))[r]=o.apply(this,arguments)}),function(u){return Sn(u,i).value[r]}}function lg(n,r){var o;return(typeof r=="number"?Oa:r instanceof Dr?M0:(o=Dr(r))?(r=o,M0):NN)(n,r)}function YN(n){return function(){this.removeAttribute(n)}}function VN(n){return function(){this.removeAttributeNS(n.space,n.local)}}function GN(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 XN(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 ZN(n,r,o){var i,u,f;return function(){var h,m=o(this),p;return m==null?void this.removeAttribute(n):(h=this.getAttribute(n),p=m+"",h===p?null:h===i&&p===u?f:(u=p,f=r(i=h,m)))}}function WN(n,r,o){var i,u,f;return function(){var h,m=o(this),p;return m==null?void this.removeAttributeNS(n.space,n.local):(h=this.getAttributeNS(n.space,n.local),p=m+"",h===p?null:h===i&&p===u?f:(u=p,f=r(i=h,m)))}}function QN(n,r){var o=Vi(n),i=o==="transform"?kN:lg;return this.attrTween(n,typeof r=="function"?(o.local?WN:ZN)(o,i,af(this,"attr."+n,r)):r==null?(o.local?VN:YN)(o):(o.local?XN:GN)(o,i,r))}function KN(n,r){return function(o){this.setAttribute(n,r.call(this,o))}}function JN(n,r){return function(o){this.setAttributeNS(n.space,n.local,r.call(this,o))}}function FN(n,r){var o,i;function u(){var f=r.apply(this,arguments);return f!==i&&(o=(i=f)&&JN(n,f)),o}return u._value=r,u}function IN(n,r){var o,i;function u(){var f=r.apply(this,arguments);return f!==i&&(o=(i=f)&&KN(n,f)),o}return u._value=r,u}function PN(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=Vi(n);return this.tween(o,(i.local?FN:IN)(i,r))}function ew(n,r){return function(){nf(this,n).delay=+r.apply(this,arguments)}}function tw(n,r){return r=+r,function(){nf(this,n).delay=r}}function nw(n){var r=this._id;return arguments.length?this.each((typeof n=="function"?ew:tw)(r,n)):Sn(this.node(),r).delay}function aw(n,r){return function(){Rn(this,n).duration=+r.apply(this,arguments)}}function lw(n,r){return r=+r,function(){Rn(this,n).duration=r}}function sw(n){var r=this._id;return arguments.length?this.each((typeof n=="function"?aw:lw)(r,n)):Sn(this.node(),r).duration}function rw(n,r){if(typeof r!="function")throw new Error;return function(){Rn(this,n).ease=r}}function ow(n){var r=this._id;return arguments.length?this.each(rw(r,n)):Sn(this.node(),r).ease}function iw(n,r){return function(){var o=r.apply(this,arguments);if(typeof o!="function")throw new Error;Rn(this,n).ease=o}}function cw(n){if(typeof n!="function")throw new Error;return this.each(iw(this._id,n))}function uw(n){typeof n!="function"&&(n=Hm(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,m=i[u]=[],p,x=0;x<h;++x)(p=f[x])&&n.call(p,p.__data__,x,f)&&m.push(p);return new ta(i,this._parents,this._name,this._id)}function dw(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),m=0;m<f;++m)for(var p=r[m],x=o[m],g=p.length,y=h[m]=new Array(g),v,j=0;j<g;++j)(v=p[j]||x[j])&&(y[j]=v);for(;m<i;++m)h[m]=r[m];return new ta(h,this._parents,this._name,this._id)}function fw(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 hw(n,r,o){var i,u,f=fw(r)?nf:Rn;return function(){var h=f(this,n),m=h.on;m!==i&&(u=(i=m).copy()).on(r,o),h.on=u}}function xw(n,r){var o=this._id;return arguments.length<2?Sn(this.node(),o).on.on(n):this.each(hw(o,n,r))}function pw(n){return function(){var r=this.parentNode;for(var o in this.__transition)if(+o!==n)return;r&&r.removeChild(this)}}function mw(){return this.on("end.remove",pw(this._id))}function gw(n){var r=this._name,o=this._id;typeof n!="function"&&(n=Id(n));for(var i=this._groups,u=i.length,f=new Array(u),h=0;h<u;++h)for(var m=i[h],p=m.length,x=f[h]=new Array(p),g,y,v=0;v<p;++v)(g=m[v])&&(y=n.call(g,g.__data__,v,m))&&("__data__"in g&&(y.__data__=g.__data__),x[v]=y,Xi(x[v],r,o,v,x,Sn(g,o)));return new ta(f,this._parents,r,o)}function bw(n){var r=this._name,o=this._id;typeof n!="function"&&(n=Dm(n));for(var i=this._groups,u=i.length,f=[],h=[],m=0;m<u;++m)for(var p=i[m],x=p.length,g,y=0;y<x;++y)if(g=p[y]){for(var v=n.call(g,g.__data__,y,p),j,C=Sn(g,o),_=0,T=v.length;_<T;++_)(j=v[_])&&Xi(j,r,o,_,v,C);f.push(v),h.push(g)}return new ta(f,h,r,o)}var yw=Vr.prototype.constructor;function vw(){return new yw(this._groups,this._parents)}function jw(n,r){var o,i,u;return function(){var f=ps(this,n),h=(this.style.removeProperty(n),ps(this,n));return f===h?null:f===o&&h===i?u:u=r(o=f,i=h)}}function sg(n){return function(){this.style.removeProperty(n)}}function Nw(n,r,o){var i,u=o+"",f;return function(){var h=ps(this,n);return h===u?null:h===i?f:f=r(i=h,o)}}function ww(n,r,o){var i,u,f;return function(){var h=ps(this,n),m=o(this),p=m+"";return m==null&&(p=m=(this.style.removeProperty(n),ps(this,n))),h===p?null:h===i&&p===u?f:(u=p,f=r(i=h,m))}}function Sw(n,r){var o,i,u,f="style."+r,h="end."+f,m;return function(){var p=Rn(this,n),x=p.on,g=p.value[f]==null?m||(m=sg(r)):void 0;(x!==o||u!==g)&&(i=(o=x).copy()).on(h,u=g),p.on=i}}function Ew(n,r,o){var i=(n+="")=="transform"?EN:lg;return r==null?this.styleTween(n,jw(n,i)).on("end.style."+n,sg(n)):typeof r=="function"?this.styleTween(n,ww(n,i,af(this,"style."+n,r))).each(Sw(this._id,n)):this.styleTween(n,Nw(n,i,r),o).on("end.style."+n,null)}function kw(n,r,o){return function(i){this.style.setProperty(n,r.call(this,i),o)}}function _w(n,r,o){var i,u;function f(){var h=r.apply(this,arguments);return h!==u&&(i=(u=h)&&kw(n,h,o)),i}return f._value=r,f}function Cw(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,_w(n,r,o??""))}function Tw(n){return function(){this.textContent=n}}function Mw(n){return function(){var r=n(this);this.textContent=r??""}}function Aw(n){return this.tween("text",typeof n=="function"?Mw(af(this,"text",n)):Tw(n==null?"":n+""))}function Rw(n){return function(r){this.textContent=n.call(this,r)}}function zw(n){var r,o;function i(){var u=n.apply(this,arguments);return u!==o&&(r=(o=u)&&Rw(u)),r}return i._value=n,i}function Ow(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,zw(n))}function Dw(){for(var n=this._name,r=this._id,o=rg(),i=this._groups,u=i.length,f=0;f<u;++f)for(var h=i[f],m=h.length,p,x=0;x<m;++x)if(p=h[x]){var g=Sn(p,r);Xi(p,n,o,x,h,{time:g.time+g.delay+g.duration,delay:0,duration:g.duration,ease:g.ease})}return new ta(i,this._parents,n,o)}function Hw(){var n,r,o=this,i=o._id,u=o.size();return new Promise(function(f,h){var m={value:h},p={value:function(){--u===0&&f()}};o.each(function(){var x=Rn(this,i),g=x.on;g!==n&&(r=(n=g).copy(),r._.cancel.push(m),r._.interrupt.push(m),r._.end.push(p)),x.on=r}),u===0&&f()})}var Uw=0;function ta(n,r,o,i){this._groups=n,this._parents=r,this._name=o,this._id=i}function rg(){return++Uw}var Jn=Vr.prototype;ta.prototype={constructor:ta,select:gw,selectAll:bw,selectChild:Jn.selectChild,selectChildren:Jn.selectChildren,filter:uw,merge:dw,selection:vw,transition:Dw,call:Jn.call,nodes:Jn.nodes,node:Jn.node,size:Jn.size,empty:Jn.empty,each:Jn.each,on:xw,attr:QN,attrTween:PN,style:Ew,styleTween:Cw,text:Aw,textTween:Ow,remove:mw,tween:LN,delay:nw,duration:sw,ease:ow,easeVarying:cw,end:Hw,[Symbol.iterator]:Jn[Symbol.iterator]};function Bw(n){return((n*=2)<=1?n*n*n:(n-=2)*n*n+2)/2}var $w={time:null,delay:0,duration:250,ease:Bw};function qw(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 Lw(n){var r,o;n instanceof ta?(r=n._id,n=n._name):(r=rg(),(o=$w).time=tf(),n=n==null?null:n+"");for(var i=this._groups,u=i.length,f=0;f<u;++f)for(var h=i[f],m=h.length,p,x=0;x<m;++x)(p=h[x])&&Xi(p,n,r,x,h,o||qw(p,r));return new ta(i,this._parents,n,r)}Vr.prototype.interrupt=BN;Vr.prototype.transition=Lw;const gi=n=>()=>n;function Yw(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 Fn(n,r,o){this.k=n,this.x=r,this.y=o}Fn.prototype={constructor:Fn,scale:function(n){return n===1?this:new Fn(this.k*n,this.x,this.y)},translate:function(n,r){return n===0&r===0?this:new Fn(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 Pn=new Fn(1,0,0);Fn.prototype;function md(n){n.stopImmediatePropagation()}function wr(n){n.preventDefault(),n.stopImmediatePropagation()}function Vw(n){return(!n.ctrlKey||n.type==="wheel")&&!n.button}function Gw(){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 U0(){return this.__zoom||Pn}function Xw(n){return-n.deltaY*(n.deltaMode===1?.05:n.deltaMode?1:.002)*(n.ctrlKey?10:1)}function Zw(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ww(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 og(){var n=Vw,r=Gw,o=Ww,i=Xw,u=Zw,f=[0,1/0],h=[[-1/0,-1/0],[1/0,1/0]],m=250,p=MN,x=Yi("start","zoom","end"),g,y,v,j=500,C=150,_=0,T=10;function M(E){E.property("__zoom",U0).on("wheel.zoom",ce,{passive:!1}).on("mousedown.zoom",F).on("dblclick.zoom",J).filter(u).on("touchstart.zoom",ae).on("touchmove.zoom",te).on("touchend.zoom touchcancel.zoom",se).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}M.transform=function(E,q,k,U){var z=E.selection?E.selection():E;z.property("__zoom",U0),E!==z?H(E,q,k,U):z.interrupt().each(function(){Z(this,arguments).event(U).start().zoom(null,typeof q=="function"?q.apply(this,arguments):q).end()})},M.scaleBy=function(E,q,k,U){M.scaleTo(E,function(){var z=this.__zoom.k,O=typeof q=="function"?q.apply(this,arguments):q;return z*O},k,U)},M.scaleTo=function(E,q,k,U){M.transform(E,function(){var z=r.apply(this,arguments),O=this.__zoom,N=k==null?D(z):typeof k=="function"?k.apply(this,arguments):k,R=O.invert(N),V=typeof q=="function"?q.apply(this,arguments):q;return o(L(B(O,V),N,R),z,h)},k,U)},M.translateBy=function(E,q,k,U){M.transform(E,function(){return o(this.__zoom.translate(typeof q=="function"?q.apply(this,arguments):q,typeof k=="function"?k.apply(this,arguments):k),r.apply(this,arguments),h)},null,U)},M.translateTo=function(E,q,k,U,z){M.transform(E,function(){var O=r.apply(this,arguments),N=this.__zoom,R=U==null?D(O):typeof U=="function"?U.apply(this,arguments):U;return o(Pn.translate(R[0],R[1]).scale(N.k).translate(typeof q=="function"?-q.apply(this,arguments):-q,typeof k=="function"?-k.apply(this,arguments):-k),O,h)},U,z)};function B(E,q){return q=Math.max(f[0],Math.min(f[1],q)),q===E.k?E:new Fn(q,E.x,E.y)}function L(E,q,k){var U=q[0]-k[0]*E.k,z=q[1]-k[1]*E.k;return U===E.x&&z===E.y?E:new Fn(E.k,U,z)}function D(E){return[(+E[0][0]+ +E[1][0])/2,(+E[0][1]+ +E[1][1])/2]}function H(E,q,k,U){E.on("start.zoom",function(){Z(this,arguments).event(U).start()}).on("interrupt.zoom end.zoom",function(){Z(this,arguments).event(U).end()}).tween("zoom",function(){var z=this,O=arguments,N=Z(z,O).event(U),R=r.apply(z,O),V=k==null?D(R):typeof k=="function"?k.apply(z,O):k,I=Math.max(R[1][0]-R[0][0],R[1][1]-R[0][1]),le=z.__zoom,xe=typeof q=="function"?q.apply(z,O):q,de=p(le.invert(V).concat(I/le.k),xe.invert(V).concat(I/xe.k));return function(ge){if(ge===1)ge=xe;else{var pe=de(ge),ve=I/pe[2];ge=new Fn(ve,V[0]-pe[0]*ve,V[1]-pe[1]*ve)}N.zoom(null,ge)}})}function Z(E,q,k){return!k&&E.__zooming||new X(E,q)}function X(E,q){this.that=E,this.args=q,this.active=0,this.sourceEvent=null,this.extent=r.apply(E,q),this.taps=0}X.prototype={event:function(E){return E&&(this.sourceEvent=E),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(E,q){return this.mouse&&E!=="mouse"&&(this.mouse[1]=q.invert(this.mouse[0])),this.touch0&&E!=="touch"&&(this.touch0[1]=q.invert(this.touch0[0])),this.touch1&&E!=="touch"&&(this.touch1[1]=q.invert(this.touch1[0])),this.that.__zoom=q,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(E){var q=xn(this.that).datum();x.call(E,this.that,new Yw(E,{sourceEvent:this.sourceEvent,target:M,transform:this.that.__zoom,dispatch:x}),q)}};function ce(E,...q){if(!n.apply(this,arguments))return;var k=Z(this,q).event(E),U=this.__zoom,z=Math.max(f[0],Math.min(f[1],U.k*Math.pow(2,i.apply(this,arguments)))),O=Nn(E);if(k.wheel)(k.mouse[0][0]!==O[0]||k.mouse[0][1]!==O[1])&&(k.mouse[1]=U.invert(k.mouse[0]=O)),clearTimeout(k.wheel);else{if(U.k===z)return;k.mouse=[O,U.invert(O)],Ti(this),k.start()}wr(E),k.wheel=setTimeout(N,C),k.zoom("mouse",o(L(B(U,z),k.mouse[0],k.mouse[1]),k.extent,h));function N(){k.wheel=null,k.end()}}function F(E,...q){if(v||!n.apply(this,arguments))return;var k=E.currentTarget,U=Z(this,q,!0).event(E),z=xn(E.view).on("mousemove.zoom",V,!0).on("mouseup.zoom",I,!0),O=Nn(E,k),N=E.clientX,R=E.clientY;Zm(E.view),md(E),U.mouse=[O,this.__zoom.invert(O)],Ti(this),U.start();function V(le){if(wr(le),!U.moved){var xe=le.clientX-N,de=le.clientY-R;U.moved=xe*xe+de*de>_}U.event(le).zoom("mouse",o(L(U.that.__zoom,U.mouse[0]=Nn(le,k),U.mouse[1]),U.extent,h))}function I(le){z.on("mousemove.zoom mouseup.zoom",null),Wm(le.view,U.moved),wr(le),U.event(le).end()}}function J(E,...q){if(n.apply(this,arguments)){var k=this.__zoom,U=Nn(E.changedTouches?E.changedTouches[0]:E,this),z=k.invert(U),O=k.k*(E.shiftKey?.5:2),N=o(L(B(k,O),U,z),r.apply(this,q),h);wr(E),m>0?xn(this).transition().duration(m).call(H,N,U,E):xn(this).call(M.transform,N,U,E)}}function ae(E,...q){if(n.apply(this,arguments)){var k=E.touches,U=k.length,z=Z(this,q,E.changedTouches.length===U).event(E),O,N,R,V;for(md(E),N=0;N<U;++N)R=k[N],V=Nn(R,this),V=[V,this.__zoom.invert(V),R.identifier],z.touch0?!z.touch1&&z.touch0[2]!==V[2]&&(z.touch1=V,z.taps=0):(z.touch0=V,O=!0,z.taps=1+!!g);g&&(g=clearTimeout(g)),O&&(z.taps<2&&(y=V[0],g=setTimeout(function(){g=null},j)),Ti(this),z.start())}}function te(E,...q){if(this.__zooming){var k=Z(this,q).event(E),U=E.changedTouches,z=U.length,O,N,R,V;for(wr(E),O=0;O<z;++O)N=U[O],R=Nn(N,this),k.touch0&&k.touch0[2]===N.identifier?k.touch0[0]=R:k.touch1&&k.touch1[2]===N.identifier&&(k.touch1[0]=R);if(N=k.that.__zoom,k.touch1){var I=k.touch0[0],le=k.touch0[1],xe=k.touch1[0],de=k.touch1[1],ge=(ge=xe[0]-I[0])*ge+(ge=xe[1]-I[1])*ge,pe=(pe=de[0]-le[0])*pe+(pe=de[1]-le[1])*pe;N=B(N,Math.sqrt(ge/pe)),R=[(I[0]+xe[0])/2,(I[1]+xe[1])/2],V=[(le[0]+de[0])/2,(le[1]+de[1])/2]}else if(k.touch0)R=k.touch0[0],V=k.touch0[1];else return;k.zoom("touch",o(L(N,R,V),k.extent,h))}}function se(E,...q){if(this.__zooming){var k=Z(this,q).event(E),U=E.changedTouches,z=U.length,O,N;for(md(E),v&&clearTimeout(v),v=setTimeout(function(){v=null},j),O=0;O<z;++O)N=U[O],k.touch0&&k.touch0[2]===N.identifier?delete k.touch0:k.touch1&&k.touch1[2]===N.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&&(N=Nn(N,this),Math.hypot(y[0]-N[0],y[1]-N[1])<T)){var R=xn(this).on("dblclick.zoom");R&&R.apply(this,arguments)}}}return M.wheelDelta=function(E){return arguments.length?(i=typeof E=="function"?E:gi(+E),M):i},M.filter=function(E){return arguments.length?(n=typeof E=="function"?E:gi(!!E),M):n},M.touchable=function(E){return arguments.length?(u=typeof E=="function"?E:gi(!!E),M):u},M.extent=function(E){return arguments.length?(r=typeof E=="function"?E:gi([[+E[0][0],+E[0][1]],[+E[1][0],+E[1][1]]]),M):r},M.scaleExtent=function(E){return arguments.length?(f[0]=+E[0],f[1]=+E[1],M):[f[0],f[1]]},M.translateExtent=function(E){return arguments.length?(h[0][0]=+E[0][0],h[1][0]=+E[1][0],h[0][1]=+E[0][1],h[1][1]=+E[1][1],M):[[h[0][0],h[0][1]],[h[1][0],h[1][1]]]},M.constrain=function(E){return arguments.length?(o=E,M):o},M.duration=function(E){return arguments.length?(m=+E,M):m},M.interpolate=function(E){return arguments.length?(p=E,M):p},M.on=function(){var E=x.on.apply(x,arguments);return E===x?M:E},M.clickDistance=function(E){return arguments.length?(_=(E=+E)*E,M):Math.sqrt(_)},M.tapDistance=function(E){return arguments.length?(T=+E,M):T},M}jm();const Zi=w.createContext(null),Qw=Zi.Provider,na={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.`},ig=na.error001();function Qe(n,r){const o=w.useContext(Zi);if(o===null)throw new Error(ig);return zm(o,n,r)}const ft=()=>{const n=w.useContext(Zi);if(n===null)throw new Error(ig);return w.useMemo(()=>({getState:n.getState,setState:n.setState,subscribe:n.subscribe,destroy:n.destroy}),[n])},Kw=n=>n.userSelectionActive?"none":"all";function lf({position:n,children:r,className:o,style:i,...u}){const f=Qe(Kw),h=`${n}`.split("-");return ie.createElement("div",{className:Et(["react-flow__panel",o,...h]),style:{...i,pointerEvents:f},...u},r)}function Jw({proOptions:n,position:r="bottom-right"}){return n?.hideAttribution?null:ie.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"},ie.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}const Fw=({x:n,y:r,label:o,labelStyle:i={},labelShowBg:u=!0,labelBgStyle:f={},labelBgPadding:h=[2,4],labelBgBorderRadius:m=2,children:p,className:x,...g})=>{const y=w.useRef(null),[v,j]=w.useState({x:0,y:0,width:0,height:0}),C=Et(["react-flow__edge-textwrapper",x]);return w.useEffect(()=>{if(y.current){const _=y.current.getBBox();j({x:_.x,y:_.y,width:_.width,height:_.height})}},[o]),typeof o>"u"||!o?null:ie.createElement("g",{transform:`translate(${n-v.width/2} ${r-v.height/2})`,className:C,visibility:v.width?"visible":"hidden",...g},u&&ie.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:m,ry:m}),ie.createElement("text",{className:"react-flow__edge-text",y:v.height/2,dy:"0.3em",ref:y,style:i},o),p)};var Iw=w.memo(Fw);const sf=n=>({width:n.offsetWidth,height:n.offsetHeight}),gs=(n,r=0,o=1)=>Math.min(Math.max(n,r),o),rf=(n={x:0,y:0},r)=>({x:gs(n.x,r[0][0],r[1][0]),y:gs(n.y,r[0][1],r[1][1])}),B0=(n,r,o)=>n<r?gs(Math.abs(n-r),1,50)/50:n>o?-gs(Math.abs(n-o),1,50)/50:0,cg=(n,r)=>{const o=B0(n.x,35,r.width-35)*20,i=B0(n.y,35,r.height-35)*20;return[o,i]},ug=n=>n.getRootNode?.()||window?.document,dg=(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}),fg=({x:n,y:r,x2:o,y2:i})=>({x:n,y:r,width:o-n,height:i-r}),$0=n=>({...n.positionAbsolute||{x:0,y:0},width:n.width||0,height:n.height||0}),Pw=(n,r)=>fg(dg(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)},e5=n=>pn(n.width)&&pn(n.height)&&pn(n.x)&&pn(n.y),pn=n=>!isNaN(n)&&isFinite(n),et=Symbol.for("internals"),hg=["Enter"," ","Escape"],t5=(n,r)=>{},n5=n=>"nativeEvent"in n;function $d(n){const o=(n5(n)?n.nativeEvent:n).composedPath?.()?.[0]||n.target;return["INPUT","SELECT","TEXTAREA"].includes(o?.nodeName)||o?.hasAttribute("contenteditable")||!!o?.closest(".nokey")}const xg=n=>"clientX"in n,Ua=(n,r)=>{const o=xg(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,Xr=({id:n,path:r,labelX:o,labelY:i,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:m,labelBgPadding:p,labelBgBorderRadius:x,style:g,markerEnd:y,markerStart:v,interactionWidth:j=20})=>ie.createElement(ie.Fragment,null,ie.createElement("path",{id:n,style:g,d:r,fill:"none",className:"react-flow__edge-path",markerEnd:y,markerStart:v}),j&&ie.createElement("path",{d:r,fill:"none",strokeOpacity:0,strokeWidth:j,className:"react-flow__edge-interaction"}),u&&pn(o)&&pn(i)?ie.createElement(Iw,{x:o,y:i,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:m,labelBgPadding:p,labelBgBorderRadius:x}):null);Xr.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 pg({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,m=i<r?i+h:i-h;return[f,m,u,h]}function mg({sourceX:n,sourceY:r,targetX:o,targetY:i,sourceControlX:u,sourceControlY:f,targetControlX:h,targetControlY:m}){const p=n*.125+u*.375+h*.375+o*.125,x=r*.125+f*.375+m*.375+i*.125,g=Math.abs(p-n),y=Math.abs(x-r);return[p,x,g,y]}var xl;(function(n){n.Strict="strict",n.Loose="loose"})(xl||(xl={}));var ul;(function(n){n.Free="free",n.Vertical="vertical",n.Horizontal="horizontal"})(ul||(ul={}));var Br;(function(n){n.Partial="partial",n.Full="full"})(Br||(Br={}));var Ha;(function(n){n.Bezier="default",n.Straight="straight",n.Step="step",n.SmoothStep="smoothstep",n.SimpleBezier="simplebezier"})(Ha||(Ha={}));var Ba;(function(n){n.Arrow="arrow",n.ArrowClosed="arrowclosed"})(Ba||(Ba={}));var be;(function(n){n.Left="left",n.Top="top",n.Right="right",n.Bottom="bottom"})(be||(be={}));function q0({pos:n,x1:r,y1:o,x2:i,y2:u}){return n===be.Left||n===be.Right?[.5*(r+i),o]:[r,.5*(o+u)]}function gg({sourceX:n,sourceY:r,sourcePosition:o=be.Bottom,targetX:i,targetY:u,targetPosition:f=be.Top}){const[h,m]=q0({pos:o,x1:n,y1:r,x2:i,y2:u}),[p,x]=q0({pos:f,x1:i,y1:u,x2:n,y2:r}),[g,y,v,j]=mg({sourceX:n,sourceY:r,targetX:i,targetY:u,sourceControlX:h,sourceControlY:m,targetControlX:p,targetControlY:x});return[`M${n},${r} C${h},${m} ${p},${x} ${i},${u}`,g,y,v,j]}const of=w.memo(({sourceX:n,sourceY:r,targetX:o,targetY:i,sourcePosition:u=be.Bottom,targetPosition:f=be.Top,label:h,labelStyle:m,labelShowBg:p,labelBgStyle:x,labelBgPadding:g,labelBgBorderRadius:y,style:v,markerEnd:j,markerStart:C,interactionWidth:_})=>{const[T,M,B]=gg({sourceX:n,sourceY:r,sourcePosition:u,targetX:o,targetY:i,targetPosition:f});return ie.createElement(Xr,{path:T,labelX:M,labelY:B,label:h,labelStyle:m,labelShowBg:p,labelBgStyle:x,labelBgPadding:g,labelBgBorderRadius:y,style:v,markerEnd:j,markerStart:C,interactionWidth:_})});of.displayName="SimpleBezierEdge";const L0={[be.Left]:{x:-1,y:0},[be.Right]:{x:1,y:0},[be.Top]:{x:0,y:-1},[be.Bottom]:{x:0,y:1}},a5=({source:n,sourcePosition:r=be.Bottom,target:o})=>r===be.Left||r===be.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},Y0=(n,r)=>Math.sqrt(Math.pow(r.x-n.x,2)+Math.pow(r.y-n.y,2));function l5({source:n,sourcePosition:r=be.Bottom,target:o,targetPosition:i=be.Top,center:u,offset:f}){const h=L0[r],m=L0[i],p={x:n.x+h.x*f,y:n.y+h.y*f},x={x:o.x+m.x*f,y:o.y+m.y*f},g=a5({source:p,sourcePosition:r,target:x}),y=g.x!==0?"x":"y",v=g[y];let j=[],C,_;const T={x:0,y:0},M={x:0,y:0},[B,L,D,H]=pg({sourceX:n.x,sourceY:n.y,targetX:o.x,targetY:o.y});if(h[y]*m[y]===-1){C=u.x??B,_=u.y??L;const X=[{x:C,y:p.y},{x:C,y:x.y}],ce=[{x:p.x,y:_},{x:x.x,y:_}];h[y]===v?j=y==="x"?X:ce:j=y==="x"?ce:X}else{const X=[{x:p.x,y:x.y}],ce=[{x:x.x,y:p.y}];if(y==="x"?j=h.x===v?ce:X:j=h.y===v?X:ce,r===i){const se=Math.abs(n[y]-o[y]);if(se<=f){const E=Math.min(f-1,f-se);h[y]===v?T[y]=(p[y]>n[y]?-1:1)*E:M[y]=(x[y]>o[y]?-1:1)*E}}if(r!==i){const se=y==="x"?"y":"x",E=h[y]===m[se],q=p[se]>x[se],k=p[se]<x[se];(h[y]===1&&(!E&&q||E&&k)||h[y]!==1&&(!E&&k||E&&q))&&(j=y==="x"?X:ce)}const F={x:p.x+T.x,y:p.y+T.y},J={x:x.x+M.x,y:x.y+M.y},ae=Math.max(Math.abs(F.x-j[0].x),Math.abs(J.x-j[0].x)),te=Math.max(Math.abs(F.y-j[0].y),Math.abs(J.y-j[0].y));ae>=te?(C=(F.x+J.x)/2,_=j[0].y):(C=j[0].x,_=(F.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,_,D,H]}function s5(n,r,o,i){const u=Math.min(Y0(n,r)/2,Y0(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,g=n.y<o.y?1:-1;return`L ${f+u*x},${h}Q ${f},${h} ${f},${h+u*g}`}const m=n.x<o.x?1:-1,p=n.y<o.y?-1:1;return`L ${f},${h+u*p}Q ${f},${h} ${f+u*m},${h}`}function qd({sourceX:n,sourceY:r,sourcePosition:o=be.Bottom,targetX:i,targetY:u,targetPosition:f=be.Top,borderRadius:h=5,centerX:m,centerY:p,offset:x=20}){const[g,y,v,j,C]=l5({source:{x:n,y:r},sourcePosition:o,target:{x:i,y:u},targetPosition:f,center:{x:m,y:p},offset:x});return[g.reduce((T,M,B)=>{let L="";return B>0&&B<g.length-1?L=s5(g[B-1],M,g[B+1],h):L=`${B===0?"M":"L"}${M.x} ${M.y}`,T+=L,T},""),y,v,j,C]}const Wi=w.memo(({sourceX:n,sourceY:r,targetX:o,targetY:i,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:m,labelBgPadding:p,labelBgBorderRadius:x,style:g,sourcePosition:y=be.Bottom,targetPosition:v=be.Top,markerEnd:j,markerStart:C,pathOptions:_,interactionWidth:T})=>{const[M,B,L]=qd({sourceX:n,sourceY:r,sourcePosition:y,targetX:o,targetY:i,targetPosition:v,borderRadius:_?.borderRadius,offset:_?.offset});return ie.createElement(Xr,{path:M,labelX:B,labelY:L,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:m,labelBgPadding:p,labelBgBorderRadius:x,style:g,markerEnd:j,markerStart:C,interactionWidth:T})});Wi.displayName="SmoothStepEdge";const cf=w.memo(n=>ie.createElement(Wi,{...n,pathOptions:w.useMemo(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])}));cf.displayName="StepEdge";function r5({sourceX:n,sourceY:r,targetX:o,targetY:i}){const[u,f,h,m]=pg({sourceX:n,sourceY:r,targetX:o,targetY:i});return[`M ${n},${r}L ${o},${i}`,u,f,h,m]}const uf=w.memo(({sourceX:n,sourceY:r,targetX:o,targetY:i,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:m,labelBgPadding:p,labelBgBorderRadius:x,style:g,markerEnd:y,markerStart:v,interactionWidth:j})=>{const[C,_,T]=r5({sourceX:n,sourceY:r,targetX:o,targetY:i});return ie.createElement(Xr,{path:C,labelX:_,labelY:T,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:m,labelBgPadding:p,labelBgBorderRadius:x,style:g,markerEnd:y,markerStart:v,interactionWidth:j})});uf.displayName="StraightEdge";function bi(n,r){return n>=0?.5*n:r*25*Math.sqrt(-n)}function V0({pos:n,x1:r,y1:o,x2:i,y2:u,c:f}){switch(n){case be.Left:return[r-bi(r-i,f),o];case be.Right:return[r+bi(i-r,f),o];case be.Top:return[r,o-bi(o-u,f)];case be.Bottom:return[r,o+bi(u-o,f)]}}function bg({sourceX:n,sourceY:r,sourcePosition:o=be.Bottom,targetX:i,targetY:u,targetPosition:f=be.Top,curvature:h=.25}){const[m,p]=V0({pos:o,x1:n,y1:r,x2:i,y2:u,c:h}),[x,g]=V0({pos:f,x1:i,y1:u,x2:n,y2:r,c:h}),[y,v,j,C]=mg({sourceX:n,sourceY:r,targetX:i,targetY:u,sourceControlX:m,sourceControlY:p,targetControlX:x,targetControlY:g});return[`M${n},${r} C${m},${p} ${x},${g} ${i},${u}`,y,v,j,C]}const $i=w.memo(({sourceX:n,sourceY:r,targetX:o,targetY:i,sourcePosition:u=be.Bottom,targetPosition:f=be.Top,label:h,labelStyle:m,labelShowBg:p,labelBgStyle:x,labelBgPadding:g,labelBgBorderRadius:y,style:v,markerEnd:j,markerStart:C,pathOptions:_,interactionWidth:T})=>{const[M,B,L]=bg({sourceX:n,sourceY:r,sourcePosition:u,targetX:o,targetY:i,targetPosition:f,curvature:_?.curvature});return ie.createElement(Xr,{path:M,labelX:B,labelY:L,label:h,labelStyle:m,labelShowBg:p,labelBgStyle:x,labelBgPadding:g,labelBgBorderRadius:y,style:v,markerEnd:j,markerStart:C,interactionWidth:T})});$i.displayName="BezierEdge";const df=w.createContext(null),o5=df.Provider;df.Consumer;const i5=()=>w.useContext(df),c5=n=>"id"in n&&"source"in n&&"target"in n,u5=({source:n,sourceHandle:r,target:o,targetHandle:i})=>`reactflow__edge-${n}${r||""}-${o}${i||""}`,Ld=(n,r)=>typeof n>"u"?"":typeof n=="string"?n:`${r?`${r}__`:""}${Object.keys(n).sort().map(i=>`${i}=${n[i]}`).join("&")}`,d5=(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)),f5=(n,r)=>{if(!n.source||!n.target)return r;let o;return c5(n)?o={...n}:o={...n,id:u5(n)},d5(o,r)?r:r.concat(o)},Yd=({x:n,y:r},[o,i,u],f,[h,m])=>{const p={x:(n-o)/u,y:(r-i)/u};return f?{x:h*Math.round(p.x/h),y:m*Math.round(p.y/m)}:p},yg=({x:n,y:r},[o,i,u])=>({x:n*u+o,y:r*u+i}),fl=(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}},Qi=(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}=fl(u,r).positionAbsolute;return dg(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 fg(o)},vg=(n,r,[o,i,u]=[0,0,1],f=!1,h=!1,m=[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(g=>{const{width:y,height:v,selectable:j=!0,hidden:C=!1}=g;if(h&&!j||C)return!1;const{positionAbsolute:_}=fl(g,m),T={x:_.x,y:_.y,width:y||0,height:v||0},M=Bd(p,T),B=typeof y>"u"||typeof v>"u"||y===null||v===null,L=f&&M>0,D=(y||0)*(v||0);(B||L||M>=D||g.dragging)&&x.push(g)}),x},jg=(n,r)=>{const o=n.map(i=>i.id);return r.filter(i=>o.includes(i.source)||o.includes(i.target))},Ng=(n,r,o,i,u,f=.1)=>{const h=r/(n.width*(1+f)),m=o/(n.height*(1+f)),p=Math.min(h,m),x=gs(p,i,u),g=n.x+n.width/2,y=n.y+n.height/2,v=r/2-g*x,j=o/2-y*x;return{x:v,y:j,zoom:x}},il=(n,r=0)=>n.transition().duration(r);function G0(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 h5(n,r,o,i,u,f){const{x:h,y:m}=Ua(n),x=r.elementsFromPoint(h,m).find(C=>C.classList.contains("react-flow__handle"));if(x){const C=x.getAttribute("data-nodeid");if(C){const _=ff(void 0,x),T=x.getAttribute("data-handleid"),M=f({nodeId:C,id:T,type:_});if(M){const B=u.find(L=>L.nodeId===C&&L.type===_&&L.id===T);return{handle:{id:T,type:_,nodeId:C,x:B?.x||o.x,y:B?.y||o.y},validHandleResult:M}}}}let g=[],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?g=[{handle:C,validHandleResult:T}]:_===y&&g.push({handle:C,validHandleResult:T}),y=_)}}),!g.length)return{handle:null,validHandleResult:wg()};if(g.length===1)return g[0];const v=g.some(({validHandleResult:C})=>C.isValid),j=g.some(({handle:C})=>C.type==="target");return g.find(({handle:C,validHandleResult:_})=>j?C.type==="target":v?_.isValid:!0)||g[0]}const x5={source:null,target:null,sourceHandle:null,targetHandle:null},wg=()=>({handleDomNode:null,isValid:!1,connection:x5,endHandle:null});function Sg(n,r,o,i,u,f,h){const m=u==="target",p=h.querySelector(`.react-flow__handle[data-id="${n?.nodeId}-${n?.id}-${n?.type}"]`),x={...wg(),handleDomNode:p};if(p){const g=ff(void 0,p),y=p.getAttribute("data-nodeid"),v=p.getAttribute("data-handleid"),j=p.classList.contains("connectable"),C=p.classList.contains("connectableend"),_={source:m?y:o,sourceHandle:m?v:i,target:m?o:y,targetHandle:m?i:v};x.connection=_,j&&C&&(r===xl.Strict?m&&g==="source"||!m&&g==="target":y!==o||v!==i)&&(x.endHandle={nodeId:y,handleId:v,type:g},x.isValid=f(_))}return x}function p5({nodes:n,nodeId:r,handleId:o,handleType:i}){return n.reduce((u,f)=>{if(f[et]){const{handleBounds:h}=f[et];let m=[],p=[];h&&(m=G0(f,h,"source",`${r}-${o}-${i}`),p=G0(f,h,"target",`${r}-${o}-${i}`)),u.push(...m,...p)}return u},[])}function ff(n,r){return n||(r?.classList.contains("target")?"target":r?.classList.contains("source")?"source":null)}function gd(n){n?.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function m5(n,r){let o=null;return r?o="valid":n&&!r&&(o="invalid"),o}function Eg({event:n,handleId:r,nodeId:o,onConnect:i,isTarget:u,getState:f,setState:h,isValidConnection:m,edgeUpdaterType:p,onReconnectEnd:x}){const g=ug(n.target),{connectionMode:y,domNode:v,autoPanOnConnect:j,connectionRadius:C,onConnectStart:_,panBy:T,getNodes:M,cancelConnection:B}=f();let L=0,D;const{x:H,y:Z}=Ua(n),X=g?.elementFromPoint(H,Z),ce=ff(p,X),F=v?.getBoundingClientRect();if(!F||!ce)return;let J,ae=Ua(n,F),te=!1,se=null,E=!1,q=null;const k=p5({nodes:M(),nodeId:o,handleId:r,handleType:ce}),U=()=>{if(!j)return;const[N,R]=cg(ae,F);T({x:N,y:R}),L=requestAnimationFrame(U)};h({connectionPosition:ae,connectionStatus:null,connectionNodeId:o,connectionHandleId:r,connectionHandleType:ce,connectionStartHandle:{nodeId:o,handleId:r,type:ce},connectionEndHandle:null}),_?.(n,{nodeId:o,handleId:r,handleType:ce});function z(N){const{transform:R}=f();ae=Ua(N,F);const{handle:V,validHandleResult:I}=h5(N,g,Yd(ae,R,!1,[1,1]),C,k,le=>Sg(le,y,o,r,u?"target":"source",m,g));if(D=V,te||(U(),te=!0),q=I.handleDomNode,se=I.connection,E=I.isValid,h({connectionPosition:D&&E?yg({x:D.x,y:D.y},R):ae,connectionStatus:m5(!!D,E),connectionEndHandle:I.endHandle}),!D&&!E&&!q)return gd(J);se.source!==se.target&&q&&(gd(J),J=q,q.classList.add("connecting","react-flow__handle-connecting"),q.classList.toggle("valid",E),q.classList.toggle("react-flow__handle-valid",E))}function O(N){(D||q)&&se&&E&&i?.(se),f().onConnectEnd?.(N),p&&x?.(N),gd(J),B(),cancelAnimationFrame(L),te=!1,E=!1,se=null,q=null,g.removeEventListener("mousemove",z),g.removeEventListener("mouseup",O),g.removeEventListener("touchmove",z),g.removeEventListener("touchend",O)}g.addEventListener("mousemove",z),g.addEventListener("mouseup",O),g.addEventListener("touchmove",z),g.addEventListener("touchend",O)}const X0=()=>!0,g5=n=>({connectionStartHandle:n.connectionStartHandle,connectOnClick:n.connectOnClick,noPanClassName:n.noPanClassName}),b5=(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}},kg=w.forwardRef(({type:n="source",position:r=be.Top,isValidConnection:o,isConnectable:i=!0,isConnectableStart:u=!0,isConnectableEnd:f=!0,id:h,onConnect:m,children:p,className:x,onMouseDown:g,onTouchStart:y,...v},j)=>{const C=h||null,_=n==="target",T=ft(),M=i5(),{connectOnClick:B,noPanClassName:L}=Qe(g5,vt),{connecting:D,clickConnecting:H}=Qe(b5(M,C,n),vt);M||T.getState().onError?.("010",na.error010());const Z=F=>{const{defaultEdgeOptions:J,onConnect:ae,hasDefaultEdges:te}=T.getState(),se={...J,...F};if(te){const{edges:E,setEdges:q}=T.getState();q(f5(se,E))}ae?.(se),m?.(se)},X=F=>{if(!M)return;const J=xg(F);u&&(J&&F.button===0||!J)&&Eg({event:F,handleId:C,nodeId:M,onConnect:Z,isTarget:_,getState:T.getState,setState:T.setState,isValidConnection:o||T.getState().isValidConnection||X0}),J?g?.(F):y?.(F)},ce=F=>{const{onClickConnectStart:J,onClickConnectEnd:ae,connectionClickStartHandle:te,connectionMode:se,isValidConnection:E}=T.getState();if(!M||!te&&!u)return;if(!te){J?.(F,{nodeId:M,handleId:C,handleType:n}),T.setState({connectionClickStartHandle:{nodeId:M,type:n,handleId:C}});return}const q=ug(F.target),k=o||E||X0,{connection:U,isValid:z}=Sg({nodeId:M,id:C,type:n},se,te.nodeId,te.handleId||null,te.type,k,q);z&&Z(U),ae?.(F),T.setState({connectionClickStartHandle:null})};return ie.createElement("div",{"data-handleid":C,"data-nodeid":M,"data-handlepos":r,"data-id":`${M}-${C}-${n}`,className:Et(["react-flow__handle",`react-flow__handle-${r}`,"nodrag",L,x,{source:!_,target:_,connectable:i,connectablestart:u,connectableend:f,connecting:H,connectionindicator:i&&(u&&!D||f&&D)}]),onMouseDown:X,onTouchStart:X,onClick:B?ce:void 0,ref:j,...v},p)});kg.displayName="Handle";var dt=w.memo(kg);const _g=({data:n,isConnectable:r,targetPosition:o=be.Top,sourcePosition:i=be.Bottom})=>ie.createElement(ie.Fragment,null,ie.createElement(dt,{type:"target",position:o,isConnectable:r}),n?.label,ie.createElement(dt,{type:"source",position:i,isConnectable:r}));_g.displayName="DefaultNode";var Vd=w.memo(_g);const Cg=({data:n,isConnectable:r,sourcePosition:o=be.Bottom})=>ie.createElement(ie.Fragment,null,n?.label,ie.createElement(dt,{type:"source",position:o,isConnectable:r}));Cg.displayName="InputNode";var Tg=w.memo(Cg);const Mg=({data:n,isConnectable:r,targetPosition:o=be.Top})=>ie.createElement(ie.Fragment,null,ie.createElement(dt,{type:"target",position:o,isConnectable:r}),n?.label);Mg.displayName="OutputNode";var Ag=w.memo(Mg);const hf=()=>null;hf.displayName="GroupNode";const y5=n=>({selectedNodes:n.getNodes().filter(r=>r.selected),selectedEdges:n.edges.filter(r=>r.selected).map(r=>({...r}))}),yi=n=>n.id;function v5(n,r){return vt(n.selectedNodes.map(yi),r.selectedNodes.map(yi))&&vt(n.selectedEdges.map(yi),r.selectedEdges.map(yi))}const Rg=w.memo(({onSelectionChange:n})=>{const r=ft(),{selectedNodes:o,selectedEdges:i}=Qe(y5,v5);return w.useEffect(()=>{const u={nodes:o,edges:i};n?.(u),r.getState().onSelectionChange.forEach(f=>f(u))},[o,i,n]),null});Rg.displayName="SelectionListener";const j5=n=>!!n.onSelectionChange;function N5({onSelectionChange:n}){const r=Qe(j5);return n||r?ie.createElement(Rg,{onSelectionChange:n}):null}const w5=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 ts(n,r){w.useEffect(()=>{typeof n<"u"&&r(n)},[n])}function ze(n,r,o){w.useEffect(()=>{typeof r<"u"&&o({[n]:r})},[r])}const S5=({nodes:n,edges:r,defaultNodes:o,defaultEdges:i,onConnect:u,onConnectStart:f,onConnectEnd:h,onClickConnectStart:m,onClickConnectEnd:p,nodesDraggable:x,nodesConnectable:g,nodesFocusable:y,edgesFocusable:v,edgesUpdatable:j,elevateNodesOnSelect:C,minZoom:_,maxZoom:T,nodeExtent:M,onNodesChange:B,onEdgesChange:L,elementsSelectable:D,connectionMode:H,snapGrid:Z,snapToGrid:X,translateExtent:ce,connectOnClick:F,defaultEdgeOptions:J,fitView:ae,fitViewOptions:te,onNodesDelete:se,onEdgesDelete:E,onNodeDrag:q,onNodeDragStart:k,onNodeDragStop:U,onSelectionDrag:z,onSelectionDragStart:O,onSelectionDragStop:N,noPanClassName:R,nodeOrigin:V,rfId:I,autoPanOnConnect:le,autoPanOnNodeDrag:xe,onError:de,connectionRadius:ge,isValidConnection:pe,nodeDragThreshold:ve})=>{const{setNodes:_e,setEdges:qe,setDefaultNodesAndEdges:Ee,setMinZoom:me,setMaxZoom:Y,setTranslateExtent:W,setNodeExtent:re,reset:oe}=Qe(w5,vt),ne=ft();return w.useEffect(()=>{const Ce=i?.map(Te=>({...Te,...J}));return Ee(o,Ce),()=>{oe()}},[]),ze("defaultEdgeOptions",J,ne.setState),ze("connectionMode",H,ne.setState),ze("onConnect",u,ne.setState),ze("onConnectStart",f,ne.setState),ze("onConnectEnd",h,ne.setState),ze("onClickConnectStart",m,ne.setState),ze("onClickConnectEnd",p,ne.setState),ze("nodesDraggable",x,ne.setState),ze("nodesConnectable",g,ne.setState),ze("nodesFocusable",y,ne.setState),ze("edgesFocusable",v,ne.setState),ze("edgesUpdatable",j,ne.setState),ze("elementsSelectable",D,ne.setState),ze("elevateNodesOnSelect",C,ne.setState),ze("snapToGrid",X,ne.setState),ze("snapGrid",Z,ne.setState),ze("onNodesChange",B,ne.setState),ze("onEdgesChange",L,ne.setState),ze("connectOnClick",F,ne.setState),ze("fitViewOnInit",ae,ne.setState),ze("fitViewOnInitOptions",te,ne.setState),ze("onNodesDelete",se,ne.setState),ze("onEdgesDelete",E,ne.setState),ze("onNodeDrag",q,ne.setState),ze("onNodeDragStart",k,ne.setState),ze("onNodeDragStop",U,ne.setState),ze("onSelectionDrag",z,ne.setState),ze("onSelectionDragStart",O,ne.setState),ze("onSelectionDragStop",N,ne.setState),ze("noPanClassName",R,ne.setState),ze("nodeOrigin",V,ne.setState),ze("rfId",I,ne.setState),ze("autoPanOnConnect",le,ne.setState),ze("autoPanOnNodeDrag",xe,ne.setState),ze("onError",de,ne.setState),ze("connectionRadius",ge,ne.setState),ze("isValidConnection",pe,ne.setState),ze("nodeDragThreshold",ve,ne.setState),ts(n,_e),ts(r,qe),ts(_,me),ts(T,Y),ts(ce,W),ts(M,re),null},Z0={display:"none"},E5={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},zg="react-flow__node-desc",Og="react-flow__edge-desc",k5="react-flow__aria-live",_5=n=>n.ariaLiveMessage;function C5({rfId:n}){const r=Qe(_5);return ie.createElement("div",{id:`${k5}-${n}`,"aria-live":"assertive","aria-atomic":"true",style:E5},r)}function T5({rfId:n,disableKeyboardA11y:r}){return ie.createElement(ie.Fragment,null,ie.createElement("div",{id:`${zg}-${n}`,style:Z0},"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."," "),ie.createElement("div",{id:`${Og}-${n}`,style:Z0},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!r&&ie.createElement(C5,{rfId:n}))}var $r=(n=null,r={actInsideInputWithModifier:!0})=>{const[o,i]=w.useState(!1),u=w.useRef(!1),f=w.useRef(new Set([])),[h,m]=w.useMemo(()=>{if(n!==null){const x=(Array.isArray(n)?n:[n]).filter(y=>typeof y=="string").map(y=>y.split("+")),g=x.reduce((y,v)=>y.concat(...v),[]);return[x,g]}return[[],[]]},[n]);return w.useEffect(()=>{const p=typeof document<"u"?document:null,x=r?.target||p;if(n!==null){const g=j=>{if(u.current=j.ctrlKey||j.metaKey||j.shiftKey,(!u.current||u.current&&!r.actInsideInputWithModifier)&&$d(j))return!1;const _=Q0(j.code,m);f.current.add(j[_]),W0(h,f.current,!1)&&(j.preventDefault(),i(!0))},y=j=>{if((!u.current||u.current&&!r.actInsideInputWithModifier)&&$d(j))return!1;const _=Q0(j.code,m);W0(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",g),x?.addEventListener("keyup",y),window.addEventListener("blur",v),()=>{x?.removeEventListener("keydown",g),x?.removeEventListener("keyup",y),window.removeEventListener("blur",v)}}},[n,i]),o};function W0(n,r,o){return n.filter(i=>o||i.length===r.size).some(i=>i.every(u=>r.has(u)))}function Q0(n,r){return r.includes(n)?"code":"key"}function Dg(n,r,o,i){const u=n.parentNode||n.parentId;if(!u)return o;const f=r.get(u),h=fl(f,i);return Dg(f,r,{x:(o.x??0)+h.x,y:(o.y??0)+h.y,z:(f[et]?.z??0)>(o.z??0)?f[et]?.z??0:o.z??0},i)}function Hg(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:m}=Dg(i,n,{...i.position,z:i[et]?.z??0},r);i.positionAbsolute={x:f,y:h},i[et].z=m,o?.[i.id]&&(i[et].isParent=!0)}})}function bd(n,r,o,i){const u=new Map,f={},h=i?1e3:0;return n.forEach(m=>{const p=(pn(m.zIndex)?m.zIndex:0)+(m.selected?h:0),x=r.get(m.id),g={...m,positionAbsolute:{x:m.position.x,y:m.position.y}},y=m.parentNode||m.parentId;y&&(f[y]=!0);const v=x?.type&&x?.type!==m.type;Object.defineProperty(g,et,{enumerable:!1,value:{handleBounds:v?void 0:x?.[et]?.handleBounds,z:p}}),u.set(m.id,g)}),Hg(u,o,f),u}function Ug(n,r={}){const{getNodes:o,width:i,height:u,minZoom:f,maxZoom:h,d3Zoom:m,d3Selection:p,fitViewOnInitDone:x,fitViewOnInit:g,nodeOrigin:y}=n(),v=r.initial&&!x&&g;if(m&&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(B=>B.id===T.id):M}),_=C.every(T=>T.width&&T.height);if(C.length>0&&_){const T=Qi(C,y),{x:M,y:B,zoom:L}=Ng(T,i,u,r.minZoom??f,r.maxZoom??h,r.padding??.1),D=Pn.translate(M,B).scale(L);return typeof r.duration=="number"&&r.duration>0?m.transform(il(p,r.duration),D):m.transform(p,D),!0}}return!1}function M5(n,r){return n.forEach(o=>{const i=r.get(o.id);i&&r.set(i.id,{...i,[et]:i[et],selected:o.selected})}),new Map(r)}function A5(n,r){return r.map(o=>{const i=n.find(u=>u.id===o.id);return i&&(o.selected=i.selected),o})}function vi({changedNodes:n,changedEdges:r,get:o,set:i}){const{nodeInternals:u,edges:f,onNodesChange:h,onEdgesChange:m,hasDefaultNodes:p,hasDefaultEdges:x}=o();n?.length&&(p&&i({nodeInternals:M5(n,u)}),h?.(n)),r?.length&&(x&&i({edges:A5(r,f)}),m?.(r))}const ns=()=>{},R5={zoomIn:ns,zoomOut:ns,zoomTo:ns,getZoom:()=>1,setViewport:ns,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:ns,fitBounds:ns,project:n=>n,screenToFlowPosition:n=>n,flowToScreenPosition:n=>n,viewportInitialized:!1},z5=n=>({d3Zoom:n.d3Zoom,d3Selection:n.d3Selection}),O5=()=>{const n=ft(),{d3Zoom:r,d3Selection:o}=Qe(z5,vt);return w.useMemo(()=>o&&r?{zoomIn:u=>r.scaleBy(il(o,u?.duration),1.2),zoomOut:u=>r.scaleBy(il(o,u?.duration),1/1.2),zoomTo:(u,f)=>r.scaleTo(il(o,f?.duration),u),getZoom:()=>n.getState().transform[2],setViewport:(u,f)=>{const[h,m,p]=n.getState().transform,x=Pn.translate(u.x??h,u.y??m).scale(u.zoom??p);r.transform(il(o,f?.duration),x)},getViewport:()=>{const[u,f,h]=n.getState().transform;return{x:u,y:f,zoom:h}},fitView:u=>Ug(n.getState,u),setCenter:(u,f,h)=>{const{width:m,height:p,maxZoom:x}=n.getState(),g=typeof h?.zoom<"u"?h.zoom:x,y=m/2-u*g,v=p/2-f*g,j=Pn.translate(y,v).scale(g);r.transform(il(o,h?.duration),j)},fitBounds:(u,f)=>{const{width:h,height:m,minZoom:p,maxZoom:x}=n.getState(),{x:g,y,zoom:v}=Ng(u,h,m,p,x,f?.padding??.1),j=Pn.translate(g,y).scale(v);r.transform(il(o,f?.duration),j)},project:u=>{const{transform:f,snapToGrid:h,snapGrid:m}=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"),Yd(u,f,h,m)},screenToFlowPosition:u=>{const{transform:f,snapToGrid:h,snapGrid:m,domNode:p}=n.getState();if(!p)return u;const{x,y:g}=p.getBoundingClientRect(),y={x:u.x-x,y:u.y-g};return Yd(y,f,h,m)},flowToScreenPosition:u=>{const{transform:f,domNode:h}=n.getState();if(!h)return u;const{x:m,y:p}=h.getBoundingClientRect(),x=yg(u,f);return{x:x.x+m,y:x.y+p}},viewportInitialized:!0}:R5,[r,o])};function xf(){const n=O5(),r=ft(),o=w.useCallback(()=>r.getState().getNodes().map(_=>({..._})),[]),i=w.useCallback(_=>r.getState().nodeInternals.get(_),[]),u=w.useCallback(()=>{const{edges:_=[]}=r.getState();return _.map(T=>({...T}))},[]),f=w.useCallback(_=>{const{edges:T=[]}=r.getState();return T.find(M=>M.id===_)},[]),h=w.useCallback(_=>{const{getNodes:T,setNodes:M,hasDefaultNodes:B,onNodesChange:L}=r.getState(),D=T(),H=typeof _=="function"?_(D):_;if(B)M(H);else if(L){const Z=H.length===0?D.map(X=>({type:"remove",id:X.id})):H.map(X=>({item:X,type:"reset"}));L(Z)}},[]),m=w.useCallback(_=>{const{edges:T=[],setEdges:M,hasDefaultEdges:B,onEdgesChange:L}=r.getState(),D=typeof _=="function"?_(T):_;if(B)M(D);else if(L){const H=D.length===0?T.map(Z=>({type:"remove",id:Z.id})):D.map(Z=>({item:Z,type:"reset"}));L(H)}},[]),p=w.useCallback(_=>{const T=Array.isArray(_)?_:[_],{getNodes:M,setNodes:B,hasDefaultNodes:L,onNodesChange:D}=r.getState();if(L){const Z=[...M(),...T];B(Z)}else if(D){const H=T.map(Z=>({item:Z,type:"add"}));D(H)}},[]),x=w.useCallback(_=>{const T=Array.isArray(_)?_:[_],{edges:M=[],setEdges:B,hasDefaultEdges:L,onEdgesChange:D}=r.getState();if(L)B([...M,...T]);else if(D){const H=T.map(Z=>({item:Z,type:"add"}));D(H)}},[]),g=w.useCallback(()=>{const{getNodes:_,edges:T=[],transform:M}=r.getState(),[B,L,D]=M;return{nodes:_().map(H=>({...H})),edges:T.map(H=>({...H})),viewport:{x:B,y:L,zoom:D}}},[]),y=w.useCallback(({nodes:_,edges:T})=>{const{nodeInternals:M,getNodes:B,edges:L,hasDefaultNodes:D,hasDefaultEdges:H,onNodesDelete:Z,onEdgesDelete:X,onNodesChange:ce,onEdgesChange:F}=r.getState(),J=(_||[]).map(q=>q.id),ae=(T||[]).map(q=>q.id),te=B().reduce((q,k)=>{const U=k.parentNode||k.parentId,z=!J.includes(k.id)&&U&&q.find(N=>N.id===U);return(typeof k.deletable=="boolean"?k.deletable:!0)&&(J.includes(k.id)||z)&&q.push(k),q},[]),se=L.filter(q=>typeof q.deletable=="boolean"?q.deletable:!0),E=se.filter(q=>ae.includes(q.id));if(te||E){const q=jg(te,se),k=[...E,...q],U=k.reduce((z,O)=>(z.includes(O.id)||z.push(O.id),z),[]);if((H||D)&&(H&&r.setState({edges:L.filter(z=>!U.includes(z.id))}),D&&(te.forEach(z=>{M.delete(z.id)}),r.setState({nodeInternals:new Map(M)}))),U.length>0&&(X?.(k),F&&F(U.map(z=>({id:z,type:"remove"})))),te.length>0&&(Z?.(te),ce)){const z=te.map(O=>({id:O.id,type:"remove"}));ce(z)}}},[]),v=w.useCallback(_=>{const T=e5(_),M=T?null:r.getState().nodeInternals.get(_.id);return!T&&!M?[null,null,T]:[T?_:$0(M),M,T]},[]),j=w.useCallback((_,T=!0,M)=>{const[B,L,D]=v(_);return B?(M||r.getState().getNodes()).filter(H=>{if(!D&&(H.id===L.id||!H.positionAbsolute))return!1;const Z=$0(H),X=Bd(Z,B);return T&&X>0||X>=B.width*B.height}):[]},[]),C=w.useCallback((_,T,M=!0)=>{const[B]=v(_);if(!B)return!1;const L=Bd(B,T);return M&&L>0||L>=B.width*B.height},[]);return w.useMemo(()=>({...n,getNodes:o,getNode:i,getEdges:u,getEdge:f,setNodes:h,setEdges:m,addNodes:p,addEdges:x,toObject:g,deleteElements:y,getIntersectingNodes:j,isNodeIntersecting:C}),[n,o,i,u,f,h,m,p,x,g,y,j,C])}const D5={actInsideInputWithModifier:!1};var H5=({deleteKeyCode:n,multiSelectionKeyCode:r})=>{const o=ft(),{deleteElements:i}=xf(),u=$r(n,D5),f=$r(r);w.useEffect(()=>{if(u){const{edges:h,getNodes:m}=o.getState(),p=m().filter(g=>g.selected),x=h.filter(g=>g.selected);i({nodes:p,edges:x}),o.setState({nodesSelectionActive:!1})}},[u]),w.useEffect(()=>{o.setState({multiSelectionActive:f})},[f])};function U5(n){const r=ft();w.useEffect(()=>{let o;const i=()=>{if(!n.current)return;const u=sf(n.current);(u.height===0||u.width===0)&&r.getState().onError?.("004",na.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 pf={position:"absolute",width:"100%",height:"100%",top:0,left:0},B5=(n,r)=>n.x!==r.x||n.y!==r.y||n.zoom!==r.k,ji=n=>({x:n.x,y:n.y,zoom:n.k}),as=(n,r)=>n.target.closest(`.${r}`),K0=(n,r)=>r===2&&Array.isArray(n)&&n.includes(2),J0=n=>{const r=n.ctrlKey&&Bi()?10:1;return-n.deltaY*(n.deltaMode===1?.05:n.deltaMode?1:.002)*r},$5=n=>({d3Zoom:n.d3Zoom,d3Selection:n.d3Selection,d3ZoomHandler:n.d3ZoomHandler,userSelectionActive:n.userSelectionActive}),q5=({onMove:n,onMoveStart:r,onMoveEnd:o,onPaneContextMenu:i,zoomOnScroll:u=!0,zoomOnPinch:f=!0,panOnScroll:h=!1,panOnScrollSpeed:m=.5,panOnScrollMode:p=ul.Free,zoomOnDoubleClick:x=!0,elementsSelectable:g,panOnDrag:y=!0,defaultViewport:v,translateExtent:j,minZoom:C,maxZoom:_,zoomActivationKeyCode:T,preventScrolling:M=!0,children:B,noWheelClassName:L,noPanClassName:D})=>{const H=w.useRef(),Z=ft(),X=w.useRef(!1),ce=w.useRef(!1),F=w.useRef(null),J=w.useRef({x:0,y:0,zoom:0}),{d3Zoom:ae,d3Selection:te,d3ZoomHandler:se,userSelectionActive:E}=Qe($5,vt),q=$r(T),k=w.useRef(0),U=w.useRef(!1),z=w.useRef();return U5(F),w.useEffect(()=>{if(F.current){const O=F.current.getBoundingClientRect(),N=og().scaleExtent([C,_]).translateExtent(j),R=xn(F.current).call(N),V=Pn.translate(v.x,v.y).scale(gs(v.zoom,C,_)),I=[[0,0],[O.width,O.height]],le=N.constrain()(V,I,j);N.transform(R,le),N.wheelDelta(J0),Z.setState({d3Zoom:N,d3Selection:R,d3ZoomHandler:R.on("wheel.zoom"),transform:[le.x,le.y,le.k],domNode:F.current.closest(".react-flow")})}},[]),w.useEffect(()=>{te&&ae&&(h&&!q&&!E?te.on("wheel.zoom",O=>{if(as(O,L))return!1;O.preventDefault(),O.stopImmediatePropagation();const N=te.property("__zoom").k||1;if(O.ctrlKey&&f){const pe=Nn(O),ve=J0(O),_e=N*Math.pow(2,ve);ae.scaleTo(te,_e,pe,O);return}const R=O.deltaMode===1?20:1;let V=p===ul.Vertical?0:O.deltaX*R,I=p===ul.Horizontal?0:O.deltaY*R;!Bi()&&O.shiftKey&&p!==ul.Vertical&&(V=O.deltaY*R,I=0),ae.translateBy(te,-(V/N)*m,-(I/N)*m,{internal:!0});const le=ji(te.property("__zoom")),{onViewportChangeStart:xe,onViewportChange:de,onViewportChangeEnd:ge}=Z.getState();clearTimeout(z.current),U.current||(U.current=!0,r?.(O,le),xe?.(le)),U.current&&(n?.(O,le),de?.(le),z.current=setTimeout(()=>{o?.(O,le),ge?.(le),U.current=!1},150))},{passive:!1}):typeof se<"u"&&te.on("wheel.zoom",function(O,N){if(!M&&O.type==="wheel"&&!O.ctrlKey||as(O,L))return null;O.preventDefault(),se.call(this,O,N)},{passive:!1}))},[E,h,p,te,ae,se,q,f,M,L,r,n,o]),w.useEffect(()=>{ae&&ae.on("start",O=>{if(!O.sourceEvent||O.sourceEvent.internal)return null;k.current=O.sourceEvent?.button;const{onViewportChangeStart:N}=Z.getState(),R=ji(O.transform);X.current=!0,J.current=R,O.sourceEvent?.type==="mousedown"&&Z.setState({paneDragging:!0}),N?.(R),r?.(O.sourceEvent,R)})},[ae,r]),w.useEffect(()=>{ae&&(E&&!X.current?ae.on("zoom",null):E||ae.on("zoom",O=>{const{onViewportChange:N}=Z.getState();if(Z.setState({transform:[O.transform.x,O.transform.y,O.transform.k]}),ce.current=!!(i&&K0(y,k.current??0)),(n||N)&&!O.sourceEvent?.internal){const R=ji(O.transform);N?.(R),n?.(O.sourceEvent,R)}}))},[E,ae,n,y,i]),w.useEffect(()=>{ae&&ae.on("end",O=>{if(!O.sourceEvent||O.sourceEvent.internal)return null;const{onViewportChangeEnd:N}=Z.getState();if(X.current=!1,Z.setState({paneDragging:!1}),i&&K0(y,k.current??0)&&!ce.current&&i(O.sourceEvent),ce.current=!1,(o||N)&&B5(J.current,O.transform)){const R=ji(O.transform);J.current=R,clearTimeout(H.current),H.current=setTimeout(()=>{N?.(R),o?.(O.sourceEvent,R)},h?150:0)}})},[ae,h,y,o,i]),w.useEffect(()=>{ae&&ae.filter(O=>{const N=q||u,R=f&&O.ctrlKey;if((y===!0||Array.isArray(y)&&y.includes(1))&&O.button===1&&O.type==="mousedown"&&(as(O,"react-flow__node")||as(O,"react-flow__edge")))return!0;if(!y&&!N&&!h&&!x&&!f||E||!x&&O.type==="dblclick"||as(O,L)&&O.type==="wheel"||as(O,D)&&(O.type!=="wheel"||h&&O.type==="wheel"&&!q)||!f&&O.ctrlKey&&O.type==="wheel"||!N&&!h&&!R&&O.type==="wheel"||!y&&(O.type==="mousedown"||O.type==="touchstart")||Array.isArray(y)&&!y.includes(O.button)&&O.type==="mousedown")return!1;const V=Array.isArray(y)&&y.includes(O.button)||!O.button||O.button<=1;return(!O.ctrlKey||O.type==="wheel")&&V})},[E,ae,u,f,h,x,y,g,q]),ie.createElement("div",{className:"react-flow__renderer",ref:F,style:pf},B)},L5=n=>({userSelectionActive:n.userSelectionActive,userSelectionRect:n.userSelectionRect});function Y5(){const{userSelectionActive:n,userSelectionRect:r}=Qe(L5,vt);return n&&r?ie.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 F0(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 Bg(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(m=>m.id===u.id);if(f.length===0)return i.push(u),i;const h={...u};for(const m of f)if(m)switch(m.type){case"select":{h.selected=m.selected;break}case"position":{typeof m.position<"u"&&(h.position=m.position),typeof m.positionAbsolute<"u"&&(h.positionAbsolute=m.positionAbsolute),typeof m.dragging<"u"&&(h.dragging=m.dragging),h.expandParent&&F0(i,h);break}case"dimensions":{typeof m.dimensions<"u"&&(h.width=m.dimensions.width,h.height=m.dimensions.height),typeof m.updateStyle<"u"&&(h.style={...h.style||{},...m.dimensions}),typeof m.resizing=="boolean"&&(h.resizing=m.resizing),h.expandParent&&F0(i,h);break}case"remove":return i}return i.push(h),i},o)}function $g(n,r){return Bg(n,r)}function V5(n,r){return Bg(n,r)}const Da=(n,r)=>({id:n,type:"select",selected:r});function cs(n,r){return n.reduce((o,i)=>{const u=r.includes(i.id);return!i.selected&&u?(i.selected=!0,o.push(Da(i.id,!0))):i.selected&&!u&&(i.selected=!1,o.push(Da(i.id,!1))),o},[])}const yd=(n,r)=>o=>{o.target===r.current&&n?.(o)},G5=n=>({userSelectionActive:n.userSelectionActive,elementsSelectable:n.elementsSelectable,dragging:n.paneDragging}),qg=w.memo(({isSelecting:n,selectionMode:r=Br.Full,panOnDrag:o,onSelectionStart:i,onSelectionEnd:u,onPaneClick:f,onPaneContextMenu:h,onPaneScroll:m,onPaneMouseEnter:p,onPaneMouseMove:x,onPaneMouseLeave:g,children:y})=>{const v=w.useRef(null),j=ft(),C=w.useRef(0),_=w.useRef(0),T=w.useRef(),{userSelectionActive:M,elementsSelectable:B,dragging:L}=Qe(G5,vt),D=()=>{j.setState({userSelectionActive:!1,userSelectionRect:null}),C.current=0,_.current=0},H=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=m?se=>m(se):void 0,ce=se=>{const{resetSelectedElements:E,domNode:q}=j.getState();if(T.current=q?.getBoundingClientRect(),!B||!n||se.button!==0||se.target!==v.current||!T.current)return;const{x:k,y:U}=Ua(se,T.current);E(),j.setState({userSelectionRect:{width:0,height:0,startX:k,startY:U,x:k,y:U}}),i?.(se)},F=se=>{const{userSelectionRect:E,nodeInternals:q,edges:k,transform:U,onNodesChange:z,onEdgesChange:O,nodeOrigin:N,getNodes:R}=j.getState();if(!n||!T.current||!E)return;j.setState({userSelectionActive:!0,nodesSelectionActive:!1});const V=Ua(se,T.current),I=E.startX??0,le=E.startY??0,xe={...E,x:V.x<I?V.x:I,y:V.y<le?V.y:le,width:Math.abs(V.x-I),height:Math.abs(V.y-le)},de=R(),ge=vg(q,xe,U,r===Br.Partial,!0,N),pe=jg(ge,k).map(_e=>_e.id),ve=ge.map(_e=>_e.id);if(C.current!==ve.length){C.current=ve.length;const _e=cs(de,ve);_e.length&&z?.(_e)}if(_.current!==pe.length){_.current=pe.length;const _e=cs(k,pe);_e.length&&O?.(_e)}j.setState({userSelectionRect:xe})},J=se=>{if(se.button!==0)return;const{userSelectionRect:E}=j.getState();!M&&E&&se.target===v.current&&H?.(se),j.setState({nodesSelectionActive:C.current>0}),D(),u?.(se)},ae=se=>{M&&(j.setState({nodesSelectionActive:C.current>0}),u?.(se)),D()},te=B&&(n||M);return ie.createElement("div",{className:Et(["react-flow__pane",{dragging:L,selection:n}]),onClick:te?void 0:yd(H,v),onContextMenu:yd(Z,v),onWheel:yd(X,v),onMouseEnter:te?void 0:p,onMouseDown:te?ce:void 0,onMouseMove:te?F:x,onMouseUp:te?J:void 0,onMouseLeave:te?ae:g,ref:v,style:pf},y,ie.createElement(Y5,null))});qg.displayName="Pane";function Lg(n,r){const o=n.parentNode||n.parentId;if(!o)return!1;const i=r.get(o);return i?i.selected?!0:Lg(i,r):!1}function I0(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 X5(n,r,o,i){return Array.from(n.values()).filter(u=>(u.selected||u.id===i)&&(!u.parentNode||u.parentId||!Lg(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 Z5(n,r){return!r||r==="parent"?r:[r[0],[r[1][0]-(n.width||0),r[1][1]-(n.height||0)]]}function Yg(n,r,o,i,u=[0,0],f){const h=Z5(n,n.extent||i);let m=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}=fl(y,u).positionAbsolute;m=y&&pn(v)&&pn(j)&&pn(y.width)&&pn(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]]]:m}else f?.("005",na.error005()),m=h;else if(n.extent&&p&&n.extent!=="parent"){const y=o.get(p),{x:v,y:j}=fl(y,u).positionAbsolute;m=[[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=fl(y,u).positionAbsolute}const g=m&&m!=="parent"?rf(r,m):r;return{position:{x:g.x-x.x,y:g.y-x.y},positionAbsolute:g}}function vd({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 P0=(n,r,o,i)=>{const u=r.querySelectorAll(n);if(!u||!u.length)return null;const f=Array.from(u),h=r.getBoundingClientRect(),m={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-m.x)/o,y:(x.top-h.top-m.y)/o,...sf(p)}})};function Er(n,r,o){return o===void 0?o:i=>{const u=r().nodeInternals.get(n);u&&o(i,{...u})}}function Gd({id:n,store:r,unselect:o=!1,nodeRef:i}){const{addSelectedNodes:u,unselectNodesAndEdges:f,multiSelectionActive:h,nodeInternals:m,onError:p}=r.getState(),x=m.get(n);if(!x){p?.("012",na.error012(n));return}r.setState({nodesSelectionActive:!1}),x.selected?(o||x.selected&&h)&&(f({nodes:[x],edges:[]}),requestAnimationFrame(()=>i?.current?.blur())):u([n])}function W5(){const n=ft();return w.useCallback(({sourceEvent:o})=>{const{transform:i,snapGrid:u,snapToGrid:f}=n.getState(),h=o.touches?o.touches[0].clientX:o.clientX,m=o.touches?o.touches[0].clientY:o.clientY,p={x:(h-i[0])/i[2],y:(m-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 jd(n){return(r,o,i)=>n?.(r,i)}function Vg({nodeRef:n,disabled:r=!1,noDragClassName:o,handleSelector:i,nodeId:u,isSelectable:f,selectNodesOnDrag:h}){const m=ft(),[p,x]=w.useState(!1),g=w.useRef([]),y=w.useRef({x:null,y:null}),v=w.useRef(0),j=w.useRef(null),C=w.useRef({x:0,y:0}),_=w.useRef(null),T=w.useRef(!1),M=w.useRef(!1),B=w.useRef(!1),L=W5();return w.useEffect(()=>{if(n?.current){const D=xn(n.current),H=({x:ce,y:F})=>{const{nodeInternals:J,onNodeDrag:ae,onSelectionDrag:te,updateNodePositions:se,nodeExtent:E,snapGrid:q,snapToGrid:k,nodeOrigin:U,onError:z}=m.getState();y.current={x:ce,y:F};let O=!1,N={x:0,y:0,x2:0,y2:0};if(g.current.length>1&&E){const V=Qi(g.current,U);N=Ur(V)}if(g.current=g.current.map(V=>{const I={x:ce-V.distance.x,y:F-V.distance.y};k&&(I.x=q[0]*Math.round(I.x/q[0]),I.y=q[1]*Math.round(I.y/q[1]));const le=[[E[0][0],E[0][1]],[E[1][0],E[1][1]]];g.current.length>1&&E&&!V.extent&&(le[0][0]=V.positionAbsolute.x-N.x+E[0][0],le[1][0]=V.positionAbsolute.x+(V.width??0)-N.x2+E[1][0],le[0][1]=V.positionAbsolute.y-N.y+E[0][1],le[1][1]=V.positionAbsolute.y+(V.height??0)-N.y2+E[1][1]);const xe=Yg(V,I,J,le,U,z);return O=O||V.position.x!==xe.position.x||V.position.y!==xe.position.y,V.position=xe.position,V.positionAbsolute=xe.positionAbsolute,V}),!O)return;se(g.current,!0,!0),x(!0);const R=u?ae:jd(te);if(R&&_.current){const[V,I]=vd({nodeId:u,dragItems:g.current,nodeInternals:J});R(_.current,V,I)}},Z=()=>{if(!j.current)return;const[ce,F]=cg(C.current,j.current);if(ce!==0||F!==0){const{transform:J,panBy:ae}=m.getState();y.current.x=(y.current.x??0)-ce/J[2],y.current.y=(y.current.y??0)-F/J[2],ae({x:ce,y:F})&&H(y.current)}v.current=requestAnimationFrame(Z)},X=ce=>{const{nodeInternals:F,multiSelectionActive:J,nodesDraggable:ae,unselectNodesAndEdges:te,onNodeDragStart:se,onSelectionDragStart:E}=m.getState();M.current=!0;const q=u?se:jd(E);(!h||!f)&&!J&&u&&(F.get(u)?.selected||te()),u&&f&&h&&Gd({id:u,store:m,nodeRef:n});const k=L(ce);if(y.current=k,g.current=X5(F,ae,k,u),q&&g.current){const[U,z]=vd({nodeId:u,dragItems:g.current,nodeInternals:F});q(ce.sourceEvent,U,z)}};if(r)D.on(".drag",null);else{const ce=lN().on("start",F=>{const{domNode:J,nodeDragThreshold:ae}=m.getState();ae===0&&X(F),B.current=!1;const te=L(F);y.current=te,j.current=J?.getBoundingClientRect()||null,C.current=Ua(F.sourceEvent,j.current)}).on("drag",F=>{const J=L(F),{autoPanOnNodeDrag:ae,nodeDragThreshold:te}=m.getState();if(F.sourceEvent.type==="touchmove"&&F.sourceEvent.touches.length>1&&(B.current=!0),!B.current){if(!T.current&&M.current&&ae&&(T.current=!0,Z()),!M.current){const se=J.xSnapped-(y?.current?.x??0),E=J.ySnapped-(y?.current?.y??0);Math.sqrt(se*se+E*E)>te&&X(F)}(y.current.x!==J.xSnapped||y.current.y!==J.ySnapped)&&g.current&&M.current&&(_.current=F.sourceEvent,C.current=Ua(F.sourceEvent,j.current),H(J))}}).on("end",F=>{if(!(!M.current||B.current)&&(x(!1),T.current=!1,M.current=!1,cancelAnimationFrame(v.current),g.current)){const{updateNodePositions:J,nodeInternals:ae,onNodeDragStop:te,onSelectionDragStop:se}=m.getState(),E=u?te:jd(se);if(J(g.current,!1,!1),E){const[q,k]=vd({nodeId:u,dragItems:g.current,nodeInternals:ae});E(F.sourceEvent,q,k)}}}).filter(F=>{const J=F.target;return!F.button&&(!o||!I0(J,`.${o}`,n))&&(!i||I0(J,i,n))});return D.call(ce),()=>{D.on(".drag",null)}}}},[n,r,o,i,f,m,u,h,L]),p}function Gg(){const n=ft();return w.useCallback(o=>{const{nodeInternals:i,nodeExtent:u,updateNodePositions:f,getNodes:h,snapToGrid:m,snapGrid:p,onError:x,nodesDraggable:g}=n.getState(),y=h().filter(B=>B.selected&&(B.draggable||g&&typeof B.draggable>"u")),v=m?p[0]:5,j=m?p[1]:5,C=o.isShiftPressed?4:1,_=o.x*v*C,T=o.y*j*C,M=y.map(B=>{if(B.positionAbsolute){const L={x:B.positionAbsolute.x+_,y:B.positionAbsolute.y+T};m&&(L.x=p[0]*Math.round(L.x/p[0]),L.y=p[1]*Math.round(L.y/p[1]));const{positionAbsolute:D,position:H}=Yg(B,L,i,u,void 0,x);B.position=H,B.positionAbsolute=D}return B});f(M,!0,!1)},[])}const xs={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:m,yPosOrigin:p,selected:x,onClick:g,onMouseEnter:y,onMouseMove:v,onMouseLeave:j,onContextMenu:C,onDoubleClick:_,style:T,className:M,isDraggable:B,isSelectable:L,isConnectable:D,isFocusable:H,selectNodesOnDrag:Z,sourcePosition:X,targetPosition:ce,hidden:F,resizeObserver:J,dragHandle:ae,zIndex:te,isParent:se,noDragClassName:E,noPanClassName:q,initialized:k,disableKeyboardA11y:U,ariaLabel:z,rfId:O,hasHandleBounds:N})=>{const R=ft(),V=w.useRef(null),I=w.useRef(null),le=w.useRef(X),xe=w.useRef(ce),de=w.useRef(i),ge=L||B||g||y||v||j,pe=Gg(),ve=Er(o,R.getState,y),_e=Er(o,R.getState,v),qe=Er(o,R.getState,j),Ee=Er(o,R.getState,C),me=Er(o,R.getState,_),Y=oe=>{const{nodeDragThreshold:ne}=R.getState();if(L&&(!Z||!B||ne>0)&&Gd({id:o,store:R,nodeRef:V}),g){const Ce=R.getState().nodeInternals.get(o);Ce&&g(oe,{...Ce})}},W=oe=>{if(!$d(oe)&&!U)if(hg.includes(oe.key)&&L){const ne=oe.key==="Escape";Gd({id:o,store:R,unselect:ne,nodeRef:V})}else B&&x&&Object.prototype.hasOwnProperty.call(xs,oe.key)&&(R.setState({ariaLiveMessage:`Moved selected node ${oe.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~f}, y: ${~~h}`}),pe({x:xs[oe.key].x,y:xs[oe.key].y,isShiftPressed:oe.shiftKey}))};w.useEffect(()=>()=>{I.current&&(J?.unobserve(I.current),I.current=null)},[]),w.useEffect(()=>{if(V.current&&!F){const oe=V.current;(!k||!N||I.current!==oe)&&(I.current&&J?.unobserve(I.current),J?.observe(oe),I.current=oe)}},[F,k,N]),w.useEffect(()=>{const oe=de.current!==i,ne=le.current!==X,Ce=xe.current!==ce;V.current&&(oe||ne||Ce)&&(oe&&(de.current=i),ne&&(le.current=X),Ce&&(xe.current=ce),R.getState().updateNodeDimensions([{id:o,nodeElement:V.current,forceUpdate:!0}]))},[o,i,X,ce]);const re=Vg({nodeRef:V,disabled:F||!B,noDragClassName:E,handleSelector:ae,nodeId:o,isSelectable:L,selectNodesOnDrag:Z});return F?null:ie.createElement("div",{className:Et(["react-flow__node",`react-flow__node-${i}`,{[q]:B},M,{selected:x,selectable:L,parent:se,dragging:re}]),ref:V,style:{zIndex:te,transform:`translate(${m}px,${p}px)`,pointerEvents:ge?"all":"none",visibility:k?"visible":"hidden",...T},"data-id":o,"data-testid":`rf__node-${o}`,onMouseEnter:ve,onMouseMove:_e,onMouseLeave:qe,onContextMenu:Ee,onClick:Y,onDoubleClick:me,onKeyDown:H?W:void 0,tabIndex:H?0:void 0,role:H?"button":void 0,"aria-describedby":U?void 0:`${zg}-${O}`,"aria-label":z},ie.createElement(o5,{value:o},ie.createElement(n,{id:o,data:u,type:i,xPos:f,yPos:h,selected:x,isConnectable:D,sourcePosition:X,targetPosition:ce,dragging:re,dragHandle:ae,zIndex:te})))};return r.displayName="NodeWrapper",w.memo(r)};const Q5=n=>{const r=n.getNodes().filter(o=>o.selected);return{...Qi(r,n.nodeOrigin),transformString:`translate(${n.transform[0]}px,${n.transform[1]}px) scale(${n.transform[2]})`,userSelectionActive:n.userSelectionActive}};function K5({onSelectionContextMenu:n,noPanClassName:r,disableKeyboardA11y:o}){const i=ft(),{width:u,height:f,x:h,y:m,transformString:p,userSelectionActive:x}=Qe(Q5,vt),g=Gg(),y=w.useRef(null);if(w.useEffect(()=>{o||y.current?.focus({preventScroll:!0})},[o]),Vg({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(xs,C.key)&&g({x:xs[C.key].x,y:xs[C.key].y,isShiftPressed:C.shiftKey})};return ie.createElement("div",{className:Et(["react-flow__nodesselection","react-flow__container",r]),style:{transform:p}},ie.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:m,left:h}}))}var J5=w.memo(K5);const F5=n=>n.nodesSelectionActive,Xg=({children:n,onPaneClick:r,onPaneMouseEnter:o,onPaneMouseMove:i,onPaneMouseLeave:u,onPaneContextMenu:f,onPaneScroll:h,deleteKeyCode:m,onMove:p,onMoveStart:x,onMoveEnd:g,selectionKeyCode:y,selectionOnDrag:v,selectionMode:j,onSelectionStart:C,onSelectionEnd:_,multiSelectionKeyCode:T,panActivationKeyCode:M,zoomActivationKeyCode:B,elementsSelectable:L,zoomOnScroll:D,zoomOnPinch:H,panOnScroll:Z,panOnScrollSpeed:X,panOnScrollMode:ce,zoomOnDoubleClick:F,panOnDrag:J,defaultViewport:ae,translateExtent:te,minZoom:se,maxZoom:E,preventScrolling:q,onSelectionContextMenu:k,noWheelClassName:U,noPanClassName:z,disableKeyboardA11y:O})=>{const N=Qe(F5),R=$r(y),V=$r(M),I=V||J,le=V||Z,xe=R||v&&I!==!0;return H5({deleteKeyCode:m,multiSelectionKeyCode:T}),ie.createElement(q5,{onMove:p,onMoveStart:x,onMoveEnd:g,onPaneContextMenu:f,elementsSelectable:L,zoomOnScroll:D,zoomOnPinch:H,panOnScroll:le,panOnScrollSpeed:X,panOnScrollMode:ce,zoomOnDoubleClick:F,panOnDrag:!R&&I,defaultViewport:ae,translateExtent:te,minZoom:se,maxZoom:E,zoomActivationKeyCode:B,preventScrolling:q,noWheelClassName:U,noPanClassName:z},ie.createElement(qg,{onSelectionStart:C,onSelectionEnd:_,onPaneClick:r,onPaneMouseEnter:o,onPaneMouseMove:i,onPaneMouseLeave:u,onPaneContextMenu:f,onPaneScroll:h,panOnDrag:I,isSelecting:!!xe,selectionMode:j},n,N&&ie.createElement(J5,{onSelectionContextMenu:k,noPanClassName:z,disableKeyboardA11y:O})))};Xg.displayName="FlowRenderer";var I5=w.memo(Xg);function P5(n){return Qe(w.useCallback(o=>n?vg(o.nodeInternals,{x:0,y:0,width:o.width,height:o.height},o.transform,!0):o.getNodes(),[n]))}function eS(n){const r={input:kr(n.input||Tg),default:kr(n.default||Vd),output:kr(n.output||Ag),group:kr(n.group||hf)},o={},i=Object.keys(n).filter(u=>!["input","default","output","group"].includes(u)).reduce((u,f)=>(u[f]=kr(n[f]||Vd),u),o);return{...r,...i}}const tS=({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]},nS=n=>({nodesDraggable:n.nodesDraggable,nodesConnectable:n.nodesConnectable,nodesFocusable:n.nodesFocusable,elementsSelectable:n.elementsSelectable,updateNodeDimensions:n.updateNodeDimensions,onError:n.onError}),Zg=n=>{const{nodesDraggable:r,nodesConnectable:o,nodesFocusable:i,elementsSelectable:u,updateNodeDimensions:f,onError:h}=Qe(nS,vt),m=P5(n.onlyRenderVisibleElements),p=w.useRef(),x=w.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const g=new ResizeObserver(y=>{const v=y.map(j=>({id:j.target.getAttribute("data-id"),nodeElement:j.target,forceUpdate:!0}));f(v)});return p.current=g,g},[]);return w.useEffect(()=>()=>{p?.current?.disconnect()},[]),ie.createElement("div",{className:"react-flow__nodes",style:pf},m.map(g=>{let y=g.type||"default";n.nodeTypes[y]||(h?.("003",na.error003(y)),y="default");const v=n.nodeTypes[y]||n.nodeTypes.default,j=!!(g.draggable||r&&typeof g.draggable>"u"),C=!!(g.selectable||u&&typeof g.selectable>"u"),_=!!(g.connectable||o&&typeof g.connectable>"u"),T=!!(g.focusable||i&&typeof g.focusable>"u"),M=n.nodeExtent?rf(g.positionAbsolute,n.nodeExtent):g.positionAbsolute,B=M?.x??0,L=M?.y??0,D=tS({x:B,y:L,width:g.width??0,height:g.height??0,origin:n.nodeOrigin});return ie.createElement(v,{key:g.id,id:g.id,className:g.className,style:g.style,type:y,data:g.data,sourcePosition:g.sourcePosition||be.Bottom,targetPosition:g.targetPosition||be.Top,hidden:g.hidden,xPos:B,yPos:L,xPosOrigin:D.x,yPosOrigin:D.y,selectNodesOnDrag:n.selectNodesOnDrag,onClick:n.onNodeClick,onMouseEnter:n.onNodeMouseEnter,onMouseMove:n.onNodeMouseMove,onMouseLeave:n.onNodeMouseLeave,onContextMenu:n.onNodeContextMenu,onDoubleClick:n.onNodeDoubleClick,selected:!!g.selected,isDraggable:j,isSelectable:C,isConnectable:_,isFocusable:T,resizeObserver:x,dragHandle:g.dragHandle,zIndex:g[et]?.z??0,isParent:!!g[et]?.isParent,noDragClassName:n.noDragClassName,noPanClassName:n.noPanClassName,initialized:!!g.width&&!!g.height,rfId:n.rfId,disableKeyboardA11y:n.disableKeyboardA11y,ariaLabel:g.ariaLabel,hasHandleBounds:!!g[et]?.handleBounds})}))};Zg.displayName="NodeRenderer";var aS=w.memo(Zg);const lS=(n,r,o)=>o===be.Left?n-r:o===be.Right?n+r:n,sS=(n,r,o)=>o===be.Top?n-r:o===be.Bottom?n+r:n,em="react-flow__edgeupdater",tm=({position:n,centerX:r,centerY:o,radius:i=10,onMouseDown:u,onMouseEnter:f,onMouseOut:h,type:m})=>ie.createElement("circle",{onMouseDown:u,onMouseEnter:f,onMouseOut:h,className:Et([em,`${em}-${m}`]),cx:lS(r,i,n),cy:sS(o,i,n),r:i,stroke:"transparent",fill:"transparent"}),rS=()=>!0;var ls=n=>{const r=({id:o,className:i,type:u,data:f,onClick:h,onEdgeDoubleClick:m,selected:p,animated:x,label:g,labelStyle:y,labelShowBg:v,labelBgStyle:j,labelBgPadding:C,labelBgBorderRadius:_,style:T,source:M,target:B,sourceX:L,sourceY:D,targetX:H,targetY:Z,sourcePosition:X,targetPosition:ce,elementsSelectable:F,hidden:J,sourceHandleId:ae,targetHandleId:te,onContextMenu:se,onMouseEnter:E,onMouseMove:q,onMouseLeave:k,reconnectRadius:U,onReconnect:z,onReconnectStart:O,onReconnectEnd:N,markerEnd:R,markerStart:V,rfId:I,ariaLabel:le,isFocusable:xe,isReconnectable:de,pathOptions:ge,interactionWidth:pe,disableKeyboardA11y:ve})=>{const _e=w.useRef(null),[qe,Ee]=w.useState(!1),[me,Y]=w.useState(!1),W=ft(),re=w.useMemo(()=>`url('#${Ld(V,I)}')`,[V,I]),oe=w.useMemo(()=>`url('#${Ld(R,I)}')`,[R,I]);if(J)return null;const ne=ht=>{const{edges:tn,addSelectedEdges:nn,unselectNodesAndEdges:an,multiSelectionActive:Ht}=W.getState(),Rt=tn.find(Vt=>Vt.id===o);Rt&&(F&&(W.setState({nodesSelectionActive:!1}),Rt.selected&&Ht?(an({nodes:[],edges:[Rt]}),_e.current?.blur()):nn([o])),h&&h(ht,Rt))},Ce=Sr(o,W.getState,m),Te=Sr(o,W.getState,se),Ue=Sr(o,W.getState,E),en=Sr(o,W.getState,q),Mt=Sr(o,W.getState,k),mn=(ht,tn)=>{if(ht.button!==0)return;const{edges:nn,isValidConnection:an}=W.getState(),Ht=tn?B:M,Rt=(tn?te:ae)||null,Vt=tn?"target":"source",js=an||rS,bl=tn,la=nn.find(zn=>zn.id===o);Y(!0),O?.(ht,la,Vt);const Ya=zn=>{Y(!1),N?.(zn,la,Vt)};Eg({event:ht,handleId:Rt,nodeId:Ht,onConnect:zn=>z?.(la,zn),isTarget:bl,getState:W.getState,setState:W.setState,isValidConnection:js,edgeUpdaterType:Vt,onReconnectEnd:Ya})},aa=ht=>mn(ht,!0),Yt=ht=>mn(ht,!1),nt=()=>Ee(!0),At=()=>Ee(!1),st=!F&&!h,La=ht=>{if(!ve&&hg.includes(ht.key)&&F){const{unselectNodesAndEdges:tn,addSelectedEdges:nn,edges:an}=W.getState();ht.key==="Escape"?(_e.current?.blur(),tn({edges:[an.find(Rt=>Rt.id===o)]})):nn([o])}};return ie.createElement("g",{className:Et(["react-flow__edge",`react-flow__edge-${u}`,i,{selected:p,animated:x,inactive:st,updating:qe}]),onClick:ne,onDoubleClick:Ce,onContextMenu:Te,onMouseEnter:Ue,onMouseMove:en,onMouseLeave:Mt,onKeyDown:xe?La:void 0,tabIndex:xe?0:void 0,role:xe?"button":"img","data-testid":`rf__edge-${o}`,"aria-label":le===null?void 0:le||`Edge from ${M} to ${B}`,"aria-describedby":xe?`${Og}-${I}`:void 0,ref:_e},!me&&ie.createElement(n,{id:o,source:M,target:B,selected:p,animated:x,label:g,labelStyle:y,labelShowBg:v,labelBgStyle:j,labelBgPadding:C,labelBgBorderRadius:_,data:f,style:T,sourceX:L,sourceY:D,targetX:H,targetY:Z,sourcePosition:X,targetPosition:ce,sourceHandleId:ae,targetHandleId:te,markerStart:re,markerEnd:oe,pathOptions:ge,interactionWidth:pe}),de&&ie.createElement(ie.Fragment,null,(de==="source"||de===!0)&&ie.createElement(tm,{position:X,centerX:L,centerY:D,radius:U,onMouseDown:aa,onMouseEnter:nt,onMouseOut:At,type:"source"}),(de==="target"||de===!0)&&ie.createElement(tm,{position:ce,centerX:H,centerY:Z,radius:U,onMouseDown:Yt,onMouseEnter:nt,onMouseOut:At,type:"target"})))};return r.displayName="EdgeWrapper",w.memo(r)};function oS(n){const r={default:ls(n.default||$i),straight:ls(n.bezier||uf),step:ls(n.step||cf),smoothstep:ls(n.step||Wi),simplebezier:ls(n.simplebezier||of)},o={},i=Object.keys(n).filter(u=>!["default","bezier"].includes(u)).reduce((u,f)=>(u[f]=ls(n[f]||$i),u),o);return{...r,...i}}function nm(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 be.Top:return{x:i+f/2,y:u};case be.Right:return{x:i+f,y:u+h/2};case be.Bottom:return{x:i+f/2,y:u+h};case be.Left:return{x:i,y:u+h/2}}}function am(n,r){return n?n.length===1||!r?n[0]:r&&n.find(o=>o.id===r)||null:null}const iS=(n,r,o,i,u,f)=>{const h=nm(o,n,r),m=nm(f,i,u);return{sourceX:h.x,sourceY:h.y,targetX:m.x,targetY:m.y}};function cS({sourcePos:n,targetPos:r,sourceWidth:o,sourceHeight:i,targetWidth:u,targetHeight:f,width:h,height:m,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 g=Ur({x:(0-p[0])/p[2],y:(0-p[1])/p[2],width:h/p[2],height:m/p[2]}),y=Math.max(0,Math.min(g.x2,x.x2)-Math.max(g.x,x.x)),v=Math.max(0,Math.min(g.y2,x.y2)-Math.max(g.y,x.y));return Math.ceil(y*v)>0}function lm(n){const r=n?.[et]?.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 uS=[{level:0,isMaxLevel:!0,edges:[]}];function dS(n,r,o=!1){let i=-1;const u=n.reduce((h,m)=>{const p=pn(m.zIndex);let x=p?m.zIndex:0;if(o){const g=r.get(m.target),y=r.get(m.source),v=m.selected||g?.selected||y?.selected,j=Math.max(y?.[et]?.z||0,g?.[et]?.z||0,1e3);x=(p?m.zIndex:0)+(v?j:0)}return h[x]?h[x].push(m):h[x]=[m],i=x>i?x:i,h},{}),f=Object.entries(u).map(([h,m])=>{const p=+h;return{edges:m,level:p,isMaxLevel:p===i}});return f.length===0?uS:f}function fS(n,r,o){const i=Qe(w.useCallback(u=>n?u.edges.filter(f=>{const h=r.get(f.source),m=r.get(f.target);return h?.width&&h?.height&&m?.width&&m?.height&&cS({sourcePos:h.positionAbsolute||{x:0,y:0},targetPos:m.positionAbsolute||{x:0,y:0},sourceWidth:h.width,sourceHeight:h.height,targetWidth:m.width,targetHeight:m.height,width:u.width,height:u.height,transform:u.transform})}):u.edges,[n,r]));return dS(i,r,o)}const hS=({color:n="none",strokeWidth:r=1})=>ie.createElement("polyline",{style:{stroke:n,strokeWidth:r},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),xS=({color:n="none",strokeWidth:r=1})=>ie.createElement("polyline",{style:{stroke:n,fill:n,strokeWidth:r},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),sm={[Ba.Arrow]:hS,[Ba.ArrowClosed]:xS};function pS(n){const r=ft();return w.useMemo(()=>Object.prototype.hasOwnProperty.call(sm,n)?sm[n]:(r.getState().onError?.("009",na.error009(n)),null),[n])}const mS=({id:n,type:r,color:o,width:i=12.5,height:u=12.5,markerUnits:f="strokeWidth",strokeWidth:h,orient:m="auto-start-reverse"})=>{const p=pS(r);return p?ie.createElement("marker",{className:"react-flow__arrowhead",id:n,markerWidth:`${i}`,markerHeight:`${u}`,viewBox:"-10 -10 20 20",markerUnits:f,orient:m,refX:"0",refY:"0"},ie.createElement(p,{color:o,strokeWidth:h})):null},gS=({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 m=Ld(h,r);i.includes(m)||(u.push({id:m,color:h.color||n,...h}),i.push(m))}}),u),[]).sort((u,f)=>u.id.localeCompare(f.id))},Wg=({defaultColor:n,rfId:r})=>{const o=Qe(w.useCallback(gS({defaultColor:n,rfId:r}),[n,r]),(i,u)=>!(i.length!==u.length||i.some((f,h)=>f.id!==u[h].id)));return ie.createElement("defs",null,o.map(i=>ie.createElement(mS,{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})))};Wg.displayName="MarkerDefinitions";var bS=w.memo(Wg);const yS=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}),Qg=({defaultMarkerColor:n,onlyRenderVisibleElements:r,elevateEdgesOnSelect:o,rfId:i,edgeTypes:u,noPanClassName:f,onEdgeContextMenu:h,onEdgeMouseEnter:m,onEdgeMouseMove:p,onEdgeMouseLeave:x,onEdgeClick:g,onEdgeDoubleClick:y,onReconnect:v,onReconnectStart:j,onReconnectEnd:C,reconnectRadius:_,children:T,disableKeyboardA11y:M})=>{const{edgesFocusable:B,edgesUpdatable:L,elementsSelectable:D,width:H,height:Z,connectionMode:X,nodeInternals:ce,onError:F}=Qe(yS,vt),J=fS(r,ce,o);return H?ie.createElement(ie.Fragment,null,J.map(({level:ae,edges:te,isMaxLevel:se})=>ie.createElement("svg",{key:ae,style:{zIndex:ae},width:H,height:Z,className:"react-flow__edges react-flow__container"},se&&ie.createElement(bS,{defaultColor:n,rfId:i}),ie.createElement("g",null,te.map(E=>{const[q,k,U]=lm(ce.get(E.source)),[z,O,N]=lm(ce.get(E.target));if(!U||!N)return null;let R=E.type||"default";u[R]||(F?.("011",na.error011(R)),R="default");const V=u[R]||u.default,I=X===xl.Strict?O.target:(O.target??[]).concat(O.source??[]),le=am(k.source,E.sourceHandle),xe=am(I,E.targetHandle),de=le?.position||be.Bottom,ge=xe?.position||be.Top,pe=!!(E.focusable||B&&typeof E.focusable>"u"),ve=E.reconnectable||E.updatable,_e=typeof v<"u"&&(ve||L&&typeof ve>"u");if(!le||!xe)return F?.("008",na.error008(le,E)),null;const{sourceX:qe,sourceY:Ee,targetX:me,targetY:Y}=iS(q,le,de,z,xe,ge);return ie.createElement(V,{key:E.id,id:E.id,className:Et([E.className,f]),type:R,data:E.data,selected:!!E.selected,animated:!!E.animated,hidden:!!E.hidden,label:E.label,labelStyle:E.labelStyle,labelShowBg:E.labelShowBg,labelBgStyle:E.labelBgStyle,labelBgPadding:E.labelBgPadding,labelBgBorderRadius:E.labelBgBorderRadius,style:E.style,source:E.source,target:E.target,sourceHandleId:E.sourceHandle,targetHandleId:E.targetHandle,markerEnd:E.markerEnd,markerStart:E.markerStart,sourceX:qe,sourceY:Ee,targetX:me,targetY:Y,sourcePosition:de,targetPosition:ge,elementsSelectable:D,onContextMenu:h,onMouseEnter:m,onMouseMove:p,onMouseLeave:x,onClick:g,onEdgeDoubleClick:y,onReconnect:v,onReconnectStart:j,onReconnectEnd:C,reconnectRadius:_,rfId:i,ariaLabel:E.ariaLabel,isFocusable:pe,isReconnectable:_e,pathOptions:"pathOptions"in E?E.pathOptions:void 0,interactionWidth:E.interactionWidth,disableKeyboardA11y:M})})))),T):null};Qg.displayName="EdgeRenderer";var vS=w.memo(Qg);const jS=n=>`translate(${n.transform[0]}px,${n.transform[1]}px) scale(${n.transform[2]})`;function NS({children:n}){const r=Qe(jS);return ie.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:r}},n)}function wS(n){const r=xf(),o=w.useRef(!1);w.useEffect(()=>{!o.current&&r.viewportInitialized&&n&&(setTimeout(()=>n(r),1),o.current=!0)},[n,r.viewportInitialized])}const SS={[be.Left]:be.Right,[be.Right]:be.Left,[be.Top]:be.Bottom,[be.Bottom]:be.Top},Kg=({nodeId:n,handleType:r,style:o,type:i=Ha.Bezier,CustomComponent:u,connectionStatus:f})=>{const{fromNode:h,handleId:m,toX:p,toY:x,connectionMode:g}=Qe(w.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]),vt),y=h?.[et]?.handleBounds;let v=y?.[r];if(g===xl.Loose&&(v=v||y?.[r==="source"?"target":"source"]),!h||!v)return null;const j=m?v.find(Z=>Z.id===m):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)+_,B=j?.position,L=B?SS[B]:null;if(!B||!L)return null;if(u)return ie.createElement(u,{connectionLineType:i,connectionLineStyle:o,fromNode:h,fromHandle:j,fromX:T,fromY:M,toX:p,toY:x,fromPosition:B,toPosition:L,connectionStatus:f});let D="";const H={sourceX:T,sourceY:M,sourcePosition:B,targetX:p,targetY:x,targetPosition:L};return i===Ha.Bezier?[D]=bg(H):i===Ha.Step?[D]=qd({...H,borderRadius:0}):i===Ha.SmoothStep?[D]=qd(H):i===Ha.SimpleBezier?[D]=gg(H):D=`M${T},${M} ${p},${x}`,ie.createElement("path",{d:D,fill:"none",className:"react-flow__connection-path",style:o})};Kg.displayName="ConnectionLine";const ES=n=>({nodeId:n.connectionNodeId,handleType:n.connectionHandleType,nodesConnectable:n.nodesConnectable,connectionStatus:n.connectionStatus,width:n.width,height:n.height});function kS({containerStyle:n,style:r,type:o,component:i}){const{nodeId:u,handleType:f,nodesConnectable:h,width:m,height:p,connectionStatus:x}=Qe(ES,vt);return!(u&&f&&m&&h)?null:ie.createElement("svg",{style:n,width:m,height:p,className:"react-flow__edges react-flow__connectionline react-flow__container"},ie.createElement("g",{className:Et(["react-flow__connection",x])},ie.createElement(Kg,{nodeId:u,handleType:f,style:r,type:o,CustomComponent:i,connectionStatus:x})))}function rm(n,r){return w.useRef(null),ft(),w.useMemo(()=>r(n),[n])}const Jg=({nodeTypes:n,edgeTypes:r,onMove:o,onMoveStart:i,onMoveEnd:u,onInit:f,onNodeClick:h,onEdgeClick:m,onNodeDoubleClick:p,onEdgeDoubleClick:x,onNodeMouseEnter:g,onNodeMouseMove:y,onNodeMouseLeave:v,onNodeContextMenu:j,onSelectionContextMenu:C,onSelectionStart:_,onSelectionEnd:T,connectionLineType:M,connectionLineStyle:B,connectionLineComponent:L,connectionLineContainerStyle:D,selectionKeyCode:H,selectionOnDrag:Z,selectionMode:X,multiSelectionKeyCode:ce,panActivationKeyCode:F,zoomActivationKeyCode:J,deleteKeyCode:ae,onlyRenderVisibleElements:te,elementsSelectable:se,selectNodesOnDrag:E,defaultViewport:q,translateExtent:k,minZoom:U,maxZoom:z,preventScrolling:O,defaultMarkerColor:N,zoomOnScroll:R,zoomOnPinch:V,panOnScroll:I,panOnScrollSpeed:le,panOnScrollMode:xe,zoomOnDoubleClick:de,panOnDrag:ge,onPaneClick:pe,onPaneMouseEnter:ve,onPaneMouseMove:_e,onPaneMouseLeave:qe,onPaneScroll:Ee,onPaneContextMenu:me,onEdgeContextMenu:Y,onEdgeMouseEnter:W,onEdgeMouseMove:re,onEdgeMouseLeave:oe,onReconnect:ne,onReconnectStart:Ce,onReconnectEnd:Te,reconnectRadius:Ue,noDragClassName:en,noWheelClassName:Mt,noPanClassName:mn,elevateEdgesOnSelect:aa,disableKeyboardA11y:Yt,nodeOrigin:nt,nodeExtent:At,rfId:st})=>{const La=rm(n,eS),ht=rm(r,oS);return wS(f),ie.createElement(I5,{onPaneClick:pe,onPaneMouseEnter:ve,onPaneMouseMove:_e,onPaneMouseLeave:qe,onPaneContextMenu:me,onPaneScroll:Ee,deleteKeyCode:ae,selectionKeyCode:H,selectionOnDrag:Z,selectionMode:X,onSelectionStart:_,onSelectionEnd:T,multiSelectionKeyCode:ce,panActivationKeyCode:F,zoomActivationKeyCode:J,elementsSelectable:se,onMove:o,onMoveStart:i,onMoveEnd:u,zoomOnScroll:R,zoomOnPinch:V,zoomOnDoubleClick:de,panOnScroll:I,panOnScrollSpeed:le,panOnScrollMode:xe,panOnDrag:ge,defaultViewport:q,translateExtent:k,minZoom:U,maxZoom:z,onSelectionContextMenu:C,preventScrolling:O,noDragClassName:en,noWheelClassName:Mt,noPanClassName:mn,disableKeyboardA11y:Yt},ie.createElement(NS,null,ie.createElement(vS,{edgeTypes:ht,onEdgeClick:m,onEdgeDoubleClick:x,onlyRenderVisibleElements:te,onEdgeContextMenu:Y,onEdgeMouseEnter:W,onEdgeMouseMove:re,onEdgeMouseLeave:oe,onReconnect:ne,onReconnectStart:Ce,onReconnectEnd:Te,reconnectRadius:Ue,defaultMarkerColor:N,noPanClassName:mn,elevateEdgesOnSelect:!!aa,disableKeyboardA11y:Yt,rfId:st},ie.createElement(kS,{style:B,type:M,component:L,containerStyle:D})),ie.createElement("div",{className:"react-flow__edgelabel-renderer"}),ie.createElement(aS,{nodeTypes:La,onNodeClick:h,onNodeDoubleClick:p,onNodeMouseEnter:g,onNodeMouseMove:y,onNodeMouseLeave:v,onNodeContextMenu:j,selectNodesOnDrag:E,onlyRenderVisibleElements:te,noPanClassName:mn,noDragClassName:en,disableKeyboardA11y:Yt,nodeOrigin:nt,nodeExtent:At,rfId:st})))};Jg.displayName="GraphView";var _S=w.memo(Jg);const Xd=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],za={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:Xd,nodeExtent:Xd,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:xl.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:t5,isValidConnection:void 0},CS=()=>m2((n,r)=>({...za,setNodes:o=>{const{nodeInternals:i,nodeOrigin:u,elevateNodesOnSelect:f}=r();n({nodeInternals:bd(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?bd(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:m,domNode:p,nodeOrigin:x}=r(),g=p?.querySelector(".react-flow__viewport");if(!g)return;const y=window.getComputedStyle(g),{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,[et]:{...M[et],handleBounds:void 0}});else if(M){const B=sf(T.nodeElement);!!(B.width&&B.height&&(M.width!==B.width||M.height!==B.height||T.forceUpdate))&&(u.set(M.id,{...M,[et]:{...M[et],handleBounds:{source:P0(".source",T.nodeElement,v,x),target:P0(".target",T.nodeElement,v,x)}},...B}),_.push({id:M.id,type:"dimensions",dimensions:B}))}return _},[]);Hg(u,x);const C=h||f&&!h&&Ug(r,{initial:!0,...m});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(m=>{const p={id:m.id,type:"position",dragging:u};return i&&(p.positionAbsolute=m.positionAbsolute,p.position=m.position),p});f(h)},triggerNodeChanges:o=>{const{onNodesChange:i,nodeInternals:u,hasDefaultNodes:f,nodeOrigin:h,getNodes:m,elevateNodesOnSelect:p}=r();if(o?.length){if(f){const x=$g(o,m()),g=bd(x,u,h,p);n({nodeInternals:g})}i?.(o)}},addSelectedNodes:o=>{const{multiSelectionActive:i,edges:u,getNodes:f}=r();let h,m=null;i?h=o.map(p=>Da(p,!0)):(h=cs(f(),o),m=cs(u,[])),vi({changedNodes:h,changedEdges:m,get:r,set:n})},addSelectedEdges:o=>{const{multiSelectionActive:i,edges:u,getNodes:f}=r();let h,m=null;i?h=o.map(p=>Da(p,!0)):(h=cs(u,o),m=cs(f(),[])),vi({changedNodes:m,changedEdges:h,get:r,set:n})},unselectNodesAndEdges:({nodes:o,edges:i}={})=>{const{edges:u,getNodes:f}=r(),h=o||f(),m=i||u,p=h.map(g=>(g.selected=!1,Da(g.id,!1))),x=m.map(g=>Da(g.id,!1));vi({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(m=>m.selected).map(m=>Da(m.id,!1)),h=o.filter(m=>m.selected).map(m=>Da(m.id,!1));vi({changedNodes:f,changedEdges:h,get:r,set:n})},setNodeExtent:o=>{const{nodeInternals:i}=r();i.forEach(u=>{u.positionAbsolute=rf(u.position,o)}),n({nodeExtent:o,nodeInternals:new Map(i)})},panBy:o=>{const{transform:i,width:u,height:f,d3Zoom:h,d3Selection:m,translateExtent:p}=r();if(!h||!m||!o.x&&!o.y)return!1;const x=Pn.translate(i[0]+o.x,i[1]+o.y).scale(i[2]),g=[[0,0],[u,f]],y=h?.constrain()(x,g,p);return h.transform(m,y),i[0]!==y.x||i[1]!==y.y||i[2]!==y.k},cancelConnection:()=>n({connectionNodeId:za.connectionNodeId,connectionHandleId:za.connectionHandleId,connectionHandleType:za.connectionHandleType,connectionStatus:za.connectionStatus,connectionStartHandle:za.connectionStartHandle,connectionEndHandle:za.connectionEndHandle}),reset:()=>n({...za})}),Object.is),Fg=({children:n})=>{const r=w.useRef(null);return r.current||(r.current=CS()),ie.createElement(Qw,{value:r.current},n)};Fg.displayName="ReactFlowProvider";const Ig=({children:n})=>w.useContext(Zi)?ie.createElement(ie.Fragment,null,n):ie.createElement(Fg,null,n);Ig.displayName="ReactFlowWrapper";const TS={input:Tg,default:Vd,output:Ag,group:hf},MS={default:$i,straight:uf,step:cf,smoothstep:Wi,simplebezier:of},AS=[0,0],RS=[15,15],zS={x:0,y:0,zoom:1},OS={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},mf=w.forwardRef(({nodes:n,edges:r,defaultNodes:o,defaultEdges:i,className:u,nodeTypes:f=TS,edgeTypes:h=MS,onNodeClick:m,onEdgeClick:p,onInit:x,onMove:g,onMoveStart:y,onMoveEnd:v,onConnect:j,onConnectStart:C,onConnectEnd:_,onClickConnectStart:T,onClickConnectEnd:M,onNodeMouseEnter:B,onNodeMouseMove:L,onNodeMouseLeave:D,onNodeContextMenu:H,onNodeDoubleClick:Z,onNodeDragStart:X,onNodeDrag:ce,onNodeDragStop:F,onNodesDelete:J,onEdgesDelete:ae,onSelectionChange:te,onSelectionDragStart:se,onSelectionDrag:E,onSelectionDragStop:q,onSelectionContextMenu:k,onSelectionStart:U,onSelectionEnd:z,connectionMode:O=xl.Strict,connectionLineType:N=Ha.Bezier,connectionLineStyle:R,connectionLineComponent:V,connectionLineContainerStyle:I,deleteKeyCode:le="Backspace",selectionKeyCode:xe="Shift",selectionOnDrag:de=!1,selectionMode:ge=Br.Full,panActivationKeyCode:pe="Space",multiSelectionKeyCode:ve=Bi()?"Meta":"Control",zoomActivationKeyCode:_e=Bi()?"Meta":"Control",snapToGrid:qe=!1,snapGrid:Ee=RS,onlyRenderVisibleElements:me=!1,selectNodesOnDrag:Y=!0,nodesDraggable:W,nodesConnectable:re,nodesFocusable:oe,nodeOrigin:ne=AS,edgesFocusable:Ce,edgesUpdatable:Te,elementsSelectable:Ue,defaultViewport:en=zS,minZoom:Mt=.5,maxZoom:mn=2,translateExtent:aa=Xd,preventScrolling:Yt=!0,nodeExtent:nt,defaultMarkerColor:At="#b1b1b7",zoomOnScroll:st=!0,zoomOnPinch:La=!0,panOnScroll:ht=!1,panOnScrollSpeed:tn=.5,panOnScrollMode:nn=ul.Free,zoomOnDoubleClick:an=!0,panOnDrag:Ht=!0,onPaneClick:Rt,onPaneMouseEnter:Vt,onPaneMouseMove:js,onPaneMouseLeave:bl,onPaneScroll:la,onPaneContextMenu:Ya,children:sa,onEdgeContextMenu:zn,onEdgeDoubleClick:Zr,onEdgeMouseEnter:Wr,onEdgeMouseMove:Ns,onEdgeMouseLeave:ws,onEdgeUpdate:Qr,onEdgeUpdateStart:Ki,onEdgeUpdateEnd:En,onReconnect:xt,onReconnectStart:kt,onReconnectEnd:ra,reconnectRadius:Ss=10,edgeUpdaterRadius:Ji=10,onNodesChange:Fi,onEdgesChange:Kr,noDragClassName:Va="nodrag",noWheelClassName:Es="nowheel",noPanClassName:On="nopan",fitView:oa=!1,fitViewOptions:Ga,connectOnClick:ia=!0,attributionPosition:rt,proOptions:Jr,defaultEdgeOptions:Fr,elevateNodesOnSelect:Dn=!0,elevateEdgesOnSelect:ca=!1,disableKeyboardA11y:Ir=!1,autoPanOnConnect:Pr=!0,autoPanOnNodeDrag:eo=!0,connectionRadius:Ii=20,isValidConnection:yl,onError:vl,style:gn,id:jl,nodeDragThreshold:to,...ua},ks)=>{const Xa=jl||"1";return ie.createElement("div",{...ua,style:{...gn,...OS},ref:ks,className:Et(["react-flow",u]),"data-testid":"rf__wrapper",id:jl},ie.createElement(Ig,null,ie.createElement(_S,{onInit:x,onMove:g,onMoveStart:y,onMoveEnd:v,onNodeClick:m,onEdgeClick:p,onNodeMouseEnter:B,onNodeMouseMove:L,onNodeMouseLeave:D,onNodeContextMenu:H,onNodeDoubleClick:Z,nodeTypes:f,edgeTypes:h,connectionLineType:N,connectionLineStyle:R,connectionLineComponent:V,connectionLineContainerStyle:I,selectionKeyCode:xe,selectionOnDrag:de,selectionMode:ge,deleteKeyCode:le,multiSelectionKeyCode:ve,panActivationKeyCode:pe,zoomActivationKeyCode:_e,onlyRenderVisibleElements:me,selectNodesOnDrag:Y,defaultViewport:en,translateExtent:aa,minZoom:Mt,maxZoom:mn,preventScrolling:Yt,zoomOnScroll:st,zoomOnPinch:La,zoomOnDoubleClick:an,panOnScroll:ht,panOnScrollSpeed:tn,panOnScrollMode:nn,panOnDrag:Ht,onPaneClick:Rt,onPaneMouseEnter:Vt,onPaneMouseMove:js,onPaneMouseLeave:bl,onPaneScroll:la,onPaneContextMenu:Ya,onSelectionContextMenu:k,onSelectionStart:U,onSelectionEnd:z,onEdgeContextMenu:zn,onEdgeDoubleClick:Zr,onEdgeMouseEnter:Wr,onEdgeMouseMove:Ns,onEdgeMouseLeave:ws,onReconnect:xt??Qr,onReconnectStart:kt??Ki,onReconnectEnd:ra??En,reconnectRadius:Ss??Ji,defaultMarkerColor:At,noDragClassName:Va,noWheelClassName:Es,noPanClassName:On,elevateEdgesOnSelect:ca,rfId:Xa,disableKeyboardA11y:Ir,nodeOrigin:ne,nodeExtent:nt}),ie.createElement(S5,{nodes:n,edges:r,defaultNodes:o,defaultEdges:i,onConnect:j,onConnectStart:C,onConnectEnd:_,onClickConnectStart:T,onClickConnectEnd:M,nodesDraggable:W,nodesConnectable:re,nodesFocusable:oe,edgesFocusable:Ce,edgesUpdatable:Te,elementsSelectable:Ue,elevateNodesOnSelect:Dn,minZoom:Mt,maxZoom:mn,nodeExtent:nt,onNodesChange:Fi,onEdgesChange:Kr,snapToGrid:qe,snapGrid:Ee,connectionMode:O,translateExtent:aa,connectOnClick:ia,defaultEdgeOptions:Fr,fitView:oa,fitViewOptions:Ga,onNodesDelete:J,onEdgesDelete:ae,onNodeDragStart:X,onNodeDrag:ce,onNodeDragStop:F,onSelectionDrag:E,onSelectionDragStart:se,onSelectionDragStop:q,noPanClassName:On,nodeOrigin:ne,rfId:Xa,autoPanOnConnect:Pr,autoPanOnNodeDrag:eo,onError:vl,connectionRadius:Ii,isValidConnection:yl,nodeDragThreshold:to}),ie.createElement(N5,{onSelectionChange:te}),sa,ie.createElement(Jw,{proOptions:Jr,position:rt}),ie.createElement(T5,{rfId:Xa,disableKeyboardA11y:Ir})))});mf.displayName="ReactFlow";function Pg(n){return r=>{const[o,i]=w.useState(r),u=w.useCallback(f=>i(h=>n(f,h)),[]);return[o,i,u]}}const eb=Pg($g),tb=Pg(V5),nb=({id:n,x:r,y:o,width:i,height:u,style:f,color:h,strokeColor:m,strokeWidth:p,className:x,borderRadius:g,shapeRendering:y,onClick:v,selected:j})=>{const{background:C,backgroundColor:_}=f||{},T=h||C||_;return ie.createElement("rect",{className:Et(["react-flow__minimap-node",{selected:j},x]),x:r,y:o,rx:g,ry:g,width:i,height:u,fill:T,stroke:m,strokeWidth:p,shapeRendering:y,onClick:v?M=>v(M,n):void 0})};nb.displayName="MiniMapNode";var DS=w.memo(nb);const HS=n=>n.nodeOrigin,US=n=>n.getNodes().filter(r=>!r.hidden&&r.width&&r.height),Nd=n=>n instanceof Function?n:()=>n;function BS({nodeStrokeColor:n="transparent",nodeColor:r="#e2e2e2",nodeClassName:o="",nodeBorderRadius:i=5,nodeStrokeWidth:u=2,nodeComponent:f=DS,onClick:h}){const m=Qe(US,vt),p=Qe(HS),x=Nd(r),g=Nd(n),y=Nd(o),v=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return ie.createElement(ie.Fragment,null,m.map(j=>{const{x:C,y:_}=fl(j,p).positionAbsolute;return ie.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:g(j),strokeWidth:u,shapeRendering:v,onClick:h,id:j.id})}))}var $S=w.memo(BS);const qS=200,LS=150,YS=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?Pw(Qi(r,n.nodeOrigin),o):o,rfId:n.rfId}},VS="react-flow__minimap-desc";function ab({style:n,className:r,nodeStrokeColor:o="transparent",nodeColor:i="#e2e2e2",nodeClassName:u="",nodeBorderRadius:f=5,nodeStrokeWidth:h=2,nodeComponent:m,maskColor:p="rgb(240, 240, 240, 0.6)",maskStrokeColor:x="none",maskStrokeWidth:g=1,position:y="bottom-right",onClick:v,onNodeClick:j,pannable:C=!1,zoomable:_=!1,ariaLabel:T="React Flow mini map",inversePan:M=!1,zoomStep:B=10,offsetScale:L=5}){const D=ft(),H=w.useRef(null),{boundingRect:Z,viewBB:X,rfId:ce}=Qe(YS,vt),F=n?.width??qS,J=n?.height??LS,ae=Z.width/F,te=Z.height/J,se=Math.max(ae,te),E=se*F,q=se*J,k=L*se,U=Z.x-(E-Z.width)/2-k,z=Z.y-(q-Z.height)/2-k,O=E+k*2,N=q+k*2,R=`${VS}-${ce}`,V=w.useRef(0);V.current=se,w.useEffect(()=>{if(H.current){const xe=xn(H.current),de=ve=>{const{transform:_e,d3Selection:qe,d3Zoom:Ee}=D.getState();if(ve.sourceEvent.type!=="wheel"||!qe||!Ee)return;const me=-ve.sourceEvent.deltaY*(ve.sourceEvent.deltaMode===1?.05:ve.sourceEvent.deltaMode?1:.002)*B,Y=_e[2]*Math.pow(2,me);Ee.scaleTo(qe,Y)},ge=ve=>{const{transform:_e,d3Selection:qe,d3Zoom:Ee,translateExtent:me,width:Y,height:W}=D.getState();if(ve.sourceEvent.type!=="mousemove"||!qe||!Ee)return;const re=V.current*Math.max(1,_e[2])*(M?-1:1),oe={x:_e[0]-ve.sourceEvent.movementX*re,y:_e[1]-ve.sourceEvent.movementY*re},ne=[[0,0],[Y,W]],Ce=Pn.translate(oe.x,oe.y).scale(_e[2]),Te=Ee.constrain()(Ce,ne,me);Ee.transform(qe,Te)},pe=og().on("zoom",C?ge:null).on("zoom.wheel",_?de:null);return xe.call(pe),()=>{xe.on("zoom",null)}}},[C,_,M,B]);const I=v?xe=>{const de=Nn(xe);v(xe,{x:de[0],y:de[1]})}:void 0,le=j?(xe,de)=>{const ge=D.getState().nodeInternals.get(de);j(xe,ge)}:void 0;return ie.createElement(lf,{position:y,style:n,className:Et(["react-flow__minimap",r]),"data-testid":"rf__minimap"},ie.createElement("svg",{width:F,height:J,viewBox:`${U} ${z} ${O} ${N}`,role:"img","aria-labelledby":R,ref:H,onClick:I},T&&ie.createElement("title",{id:R},T),ie.createElement($S,{onClick:le,nodeColor:i,nodeStrokeColor:o,nodeBorderRadius:f,nodeClassName:u,nodeStrokeWidth:h,nodeComponent:m}),ie.createElement("path",{className:"react-flow__minimap-mask",d:`M${U-k},${z-k}h${O+k*2}v${N+k*2}h${-O-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:g,pointerEvents:"none"})))}ab.displayName="MiniMap";var GS=w.memo(ab);function XS(){return ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},ie.createElement("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"}))}function ZS(){return ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},ie.createElement("path",{d:"M0 0h32v4.2H0z"}))}function WS(){return ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},ie.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 QS(){return ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},ie.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 KS(){return ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},ie.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})=>ie.createElement("button",{type:"button",className:Et(["react-flow__controls-button",r]),...o},n);Mr.displayName="ControlButton";const JS=n=>({isInteractive:n.nodesDraggable||n.nodesConnectable||n.elementsSelectable,minZoomReached:n.transform[2]<=n.minZoom,maxZoomReached:n.transform[2]>=n.maxZoom}),lb=({style:n,showZoom:r=!0,showFitView:o=!0,showInteractive:i=!0,fitViewOptions:u,onZoomIn:f,onZoomOut:h,onFitView:m,onInteractiveChange:p,className:x,children:g,position:y="bottom-left"})=>{const v=ft(),[j,C]=w.useState(!1),{isInteractive:_,minZoomReached:T,maxZoomReached:M}=Qe(JS,vt),{zoomIn:B,zoomOut:L,fitView:D}=xf();if(w.useEffect(()=>{C(!0)},[]),!j)return null;const H=()=>{B(),f?.()},Z=()=>{L(),h?.()},X=()=>{D(u),m?.()},ce=()=>{v.setState({nodesDraggable:!_,nodesConnectable:!_,elementsSelectable:!_}),p?.(!_)};return ie.createElement(lf,{className:Et(["react-flow__controls",x]),position:y,style:n,"data-testid":"rf__controls"},r&&ie.createElement(ie.Fragment,null,ie.createElement(Mr,{onClick:H,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:M},ie.createElement(XS,null)),ie.createElement(Mr,{onClick:Z,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:T},ie.createElement(ZS,null))),o&&ie.createElement(Mr,{className:"react-flow__controls-fitview",onClick:X,title:"fit view","aria-label":"fit view"},ie.createElement(WS,null)),i&&ie.createElement(Mr,{className:"react-flow__controls-interactive",onClick:ce,title:"toggle interactivity","aria-label":"toggle interactivity"},_?ie.createElement(KS,null):ie.createElement(QS,null)),g)};lb.displayName="Controls";var sb=w.memo(lb),It;(function(n){n.Lines="lines",n.Dots="dots",n.Cross="cross"})(It||(It={}));function FS({color:n,dimensions:r,lineWidth:o}){return ie.createElement("path",{stroke:n,strokeWidth:o,d:`M${r[0]/2} 0 V${r[1]} M0 ${r[1]/2} H${r[0]}`})}function IS({color:n,radius:r}){return ie.createElement("circle",{cx:r,cy:r,r,fill:n})}const PS={[It.Dots]:"#91919a",[It.Lines]:"#eee",[It.Cross]:"#e2e2e2"},e3={[It.Dots]:1,[It.Lines]:1,[It.Cross]:6},t3=n=>({transform:n.transform,patternId:`pattern-${n.rfId}`});function rb({id:n,variant:r=It.Dots,gap:o=20,size:i,lineWidth:u=1,offset:f=2,color:h,style:m,className:p}){const x=w.useRef(null),{transform:g,patternId:y}=Qe(t3,vt),v=h||PS[r],j=i||e3[r],C=r===It.Dots,_=r===It.Cross,T=Array.isArray(o)?o:[o,o],M=[T[0]*g[2]||1,T[1]*g[2]||1],B=j*g[2],L=_?[B,B]:M,D=C?[B/f,B/f]:[L[0]/f,L[1]/f];return ie.createElement("svg",{className:Et(["react-flow__background",p]),style:{...m,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:x,"data-testid":"rf__background"},ie.createElement("pattern",{id:y+n,x:g[0]%M[0],y:g[1]%M[1],width:M[0],height:M[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${D[0]},-${D[1]})`},C?ie.createElement(IS,{color:v,radius:B/f}):ie.createElement(FS,{dimensions:L,color:v,lineWidth:u})),ie.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${y+n})`}))}rb.displayName="Background";var ob=w.memo(rb);const om={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 gf(n){return om[n.toUpperCase()]??om.GET}const im=["exists","not_exists","is_empty","is_not_empty"];function cm(n,r){return n.replace(/\{\{([^}]+)\}\}/g,(o,i)=>{const u=i.trim();if(u.includes(":")){const f=u.indexOf(":"),h=u.slice(0,f),m=u.slice(f+1);return r[`${h}:${m}`]??r[m]??""}return r[u]??""})}function n3(n,r){const o=cm(n.left,r),i=n.right!==void 0?cm(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 a3(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:n3(x,r)})),h=u?f.every(x=>x.ok):f.some(x=>x.ok),m=f.filter(x=>!x.ok),p=h?`All conditions met (${u?"AND":"OR"})`:`Failed: ${m.map(x=>`${x.rule.left} ${x.rule.operator}${x.rule.right!==void 0?" "+x.rule.right:""}`).join(", ")}`;return{passed:h,reason:p}}async function l3(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 s3({method:n}){const r=gf(n);return l.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 r3(){const n=await fetch("/api/workflows");if(!n.ok)throw new Error(`HTTP ${n.status}`);return n.json()}async function o3(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 ib=230,Zd=64;function i3({data:n}){const r=gf(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 l.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:ib,height:Zd},children:[l.jsx(dt,{type:"target",position:be.Top,style:{background:"transparent",border:"none"}}),l.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"}}),l.jsxs("div",{className:"shrink-0 flex items-center justify-center",children:[u==="running"&&l.jsx(tt,{className:"h-3.5 w-3.5 text-blue-400 animate-spin",strokeWidth:2}),u==="passed"&&l.jsx(yt,{className:"h-3.5 w-3.5 text-emerald-400",strokeWidth:2}),u==="failed"&&l.jsx(Dt,{className:"h-3.5 w-3.5 text-red-400",strokeWidth:2}),u==="idle"&&l.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"&&l.jsx("span",{className:"h-3.5 w-3.5 rounded-full border border-[var(--border)] bg-[var(--bg-overlay-md)]"})]}),l.jsxs("div",{className:"min-w-0 flex-1 pl-0.5",children:[l.jsxs("div",{className:"flex items-center gap-1.5 mb-0.5",children:[l.jsx("span",{className:`text-[9px] font-medium ${r.text}`,children:n.method}),l.jsx("span",{className:"font-mono text-[10px] text-[var(--text-secondary)] truncate",children:n.path}),n.result&&l.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"]})]}),l.jsx("p",{className:"text-[9px] text-[var(--text-faint)] truncate",children:n.name})]}),l.jsx(dt,{type:"source",position:be.Bottom,style:{background:"transparent",border:"none"}})]})}function c3({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 l.jsxs("div",{style:{width:40,height:40,position:"relative",display:"flex",alignItems:"center",justifyContent:"center"},children:[l.jsx(dt,{type:"target",position:be.Top,style:{background:"transparent",border:"none"}}),l.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 40 40",children:[l.jsx("polygon",{points:"20,2 38,20 20,38 2,20",fill:"none",stroke:o,strokeWidth:"1.5"}),l.jsx("polygon",{points:"20,8 32,20 20,32 8,20",fill:o,fillOpacity:.12,stroke:"none"})]}),l.jsx("span",{style:{position:"absolute",fontSize:8,fontFamily:"monospace",color:o,top:"50%",left:"50%",transform:"translate(-50%,-50%)",whiteSpace:"nowrap"},children:"◇"}),l.jsx(dt,{type:"source",position:be.Bottom,style:{background:"transparent",border:"none"}})]})}const u3={step:i3,condition:c3};function d3({steps:n,runState:r}){const[o,i,u]=eb([]),[f,h,m]=tb([]);w.useEffect(()=>{const v=[],j=[];let C=40;for(let _=0;_<n.length;_++){const T=n[_],M=r.stepStatuses[_]??"idle",B=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:B}}),C+=Zd+36,T.condition){const L=`cond-${_}`,D=B?.conditionResult;v.push({id:L,type:"condition",position:{x:ib/2-20,y:C},data:{passed:D?.passed}});const H=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:H,strokeWidth:1.5},markerEnd:{type:Ba.ArrowClosed,color:H},animated:M==="running"}),C+=64,_<n.length-1){const Z=D?.passed===!0?"rgba(52,211,153,0.5)":"rgba(96,165,250,0.18)",X=D?.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??{}),D=L.length>0?L.map(X=>X.split(":").pop()).join(", "):void 0,H=r.stepStatuses[_]??"idle",Z=H==="passed"?"rgba(52,211,153,0.3)":H==="failed"?"rgba(248,113,113,0.3)":"rgba(96,165,250,0.18)";j.push({id:`e-${_}`,source:`step-${_}`,target:`step-${_+1}`,label:D,labelStyle:{fill:"rgba(96,165,250,0.7)",fontSize:9,fontFamily:"monospace"},labelBgStyle:{fill:"transparent"},style:{stroke:Z,strokeWidth:1.5,strokeDasharray:H==="idle"||H==="running"?"5 5":void 0},markerEnd:{type:Ba.ArrowClosed,color:H==="passed"?"rgba(52,211,153,0.4)":"rgba(96,165,250,0.3)"},animated:H==="running"})}}i(v),h(j)},[n,r.stepStatuses,r.stepResults]);const p=n.reduce((x,g)=>x+Zd+36+(g.condition?64:0),40);return l.jsx("div",{style:{height:Math.max(400,p)},className:"w-full rounded-lg overflow-hidden",children:l.jsxs(mf,{nodes:o,edges:f,onNodesChange:u,onEdgesChange:m,nodeTypes:u3,fitView:!0,fitViewOptions:{padding:.3},proOptions:{hideAttribution:!0},minZoom:.3,maxZoom:2,children:[l.jsx(ob,{variant:It.Dots,gap:20,size:1,color:"var(--border)"}),l.jsx(sb,{showInteractive:!1,style:{background:"var(--bg-overlay)",border:"1px solid var(--border)"}})]})})}function f3({runState:n,steps:r}){const o=w.useRef(null);return w.useEffect(()=>{o.current&&(o.current.scrollTop=o.current.scrollHeight)},[n.stepResults,n.phase]),n.phase==="idle"?null:l.jsxs("div",{className:"mt-3 rounded-lg border border-[var(--border)] bg-[var(--bg-overlay)]",children:[l.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-[var(--border)] bg-[var(--bg-overlay-md)]",children:[l.jsx("span",{className:"text-[10px] font-semibold text-[var(--text-muted)] uppercase tracking-wider",children:"Run Log"}),n.baseUrl&&l.jsxs("span",{className:"font-mono text-[10px] text-[var(--text-faint)]",children:["→ ",n.baseUrl]}),l.jsxs("span",{className:"ml-auto flex items-center gap-2 text-[10px]",children:[n.passed>0&&l.jsxs("span",{className:"text-emerald-400",children:[n.passed," passed"]}),n.failed>0&&l.jsxs("span",{className:"text-red-400",children:[n.failed," failed"]}),n.phase==="running"&&l.jsx(tt,{className:"h-3 w-3 text-blue-400 animate-spin",strokeWidth:2}),n.phase==="done"&&l.jsx(yt,{className:"h-3 w-3 text-emerald-400",strokeWidth:2}),n.phase==="aborted"&&l.jsx(Dt,{className:"h-3 w-3 text-red-400",strokeWidth:2})]})]}),l.jsxs("div",{ref:o,className:"overflow-y-auto max-h-80 font-mono text-[11px] p-3 space-y-1",children:[l.jsx("p",{className:"text-[var(--text-faint)]",children:"▶ Starting workflow execution…"}),n.stepResults.map((i,u)=>{if(!i&&n.stepStatuses[u]!=="running")return null;const f=r[u],h=gf(f.method);return n.stepStatuses[u]==="running"?l.jsxs("div",{className:"flex items-center gap-2 text-[var(--text-muted)]",children:[l.jsx(tt,{className:"h-3 w-3 animate-spin text-blue-400",strokeWidth:2}),l.jsxs("span",{className:"text-[var(--text-faint)]",children:["Step ",u+1,"/",r.length]}),l.jsx("span",{className:h.text,children:f.method}),l.jsx("span",{className:"text-[var(--text-secondary)]",children:f.path}),l.jsx("span",{className:"text-[var(--text-faint)]",children:"…"})]},u):i?l.jsxs("div",{className:"space-y-0.5",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:i.passed?"text-emerald-400":"text-red-400",children:i.passed?"✓":"✗"}),l.jsxs("span",{className:"text-[var(--text-faint)]",children:["Step ",u+1,"/",r.length]}),l.jsx("span",{className:`${h.text}`,children:f.method.padEnd(6)}),l.jsx("span",{className:"text-[var(--text-secondary)]",children:f.path}),l.jsx("span",{className:`${i.passed?"text-emerald-400":"text-red-400"}`,children:i.status>0?i.status:"NO RESPONSE"}),l.jsxs("span",{className:"text-[var(--text-faint)]",children:[i.durationMs,"ms"]})]}),f.name&&l.jsx("p",{className:"pl-5 text-[var(--text-faint)] italic",children:f.name}),Object.entries(i.injected??{}).filter(([p])=>p!=="Content-Type").map(([p,x])=>l.jsxs("p",{className:"pl-5 text-[var(--text-faint)]",children:["↳ ",l.jsxs("span",{className:"text-amber-500/80",children:[p,":"]})," ",l.jsx("span",{className:"text-[var(--text-faint)]",children:String(x).length>60?String(x).slice(0,57)+"…":x})]},p)),i.captured.map((p,x)=>l.jsxs("p",{className:"pl-5 text-emerald-400",children:["↳ captured ",p]},x)),i.conditionResult&&l.jsxs("p",{className:`pl-5 ${i.conditionResult.passed?"text-purple-400":"text-orange-400"}`,children:["◇ condition ",i.conditionResult.passed?"passed":"failed"," — ",i.conditionResult.reason,!i.conditionResult.passed&&f.condition&&l.jsxs("span",{className:"text-orange-300/70",children:[" → ",f.condition.onFail,f.condition.onFail==="switch"&&f.condition.switchToWorkflow?`: ${f.condition.switchToWorkflow}`:""]})]}),i.error&&l.jsxs("p",{className:"pl-5 text-red-400",children:["Error: ",i.error]}),!i.passed&&i.responseBody&&!i.error&&l.jsxs("p",{className:"pl-5 text-red-400/80 truncate",children:["Response: ",typeof i.responseBody=="string"?i.responseBody.slice(0,120):JSON.stringify(i.responseBody).slice(0,120)]})]},u):null}),n.phase==="done"&&l.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"&&l.jsxs("p",{className:"mt-1 text-red-400",children:["✗ Aborted — ",n.error]}),n.phase==="error"&&l.jsxs("p",{className:"mt-1 text-red-400",children:["✗ Error — ",n.error]})]})]})}const h3=[{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 um(){return{left:"",operator:"equals",right:""}}function x3({stepIndex:n,existingCondition:r,capturedKeys:o,onSave:i,onRemove:u,onCancel:f}){const[h,m]=w.useState(r?.rules.all?"all":r?.rules.any?"any":"all"),p=r?.rules.all??r?.rules.any??[],[x,g]=w.useState(p.length>0?p:[um()]),[y,v]=w.useState(r?.onFail??"abort"),[j,C]=w.useState(r?.switchToWorkflow??""),[_,T]=w.useState(r?.returnOnComplete??!0),M=(X,ce)=>{g(F=>F.map((J,ae)=>ae===X?{...J,...ce}:J))},B=()=>g(X=>[...X,um()]),L=X=>g(ce=>ce.filter((F,J)=>J!==X)),D=()=>{const X=x.filter(F=>F.left.trim()!=="");if(X.length===0)return;const ce={rules:h==="all"?{all:X}:{any:X},onFail:y,...y==="switch"&&j.trim()?{switchToWorkflow:j.trim(),returnOnComplete:_}:{}};i(ce)},H="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=`${H} cursor-pointer`;return l.jsxs("div",{className:"mt-2 rounded-lg border border-purple-500/20 bg-purple-500/[0.04] p-3 space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(In,{className:"h-3 w-3 text-purple-400",strokeWidth:2}),l.jsx("span",{className:"text-[10px] font-semibold text-purple-400 uppercase tracking-wider",children:"Step Condition"}),l.jsx("span",{className:"text-[10px] text-[var(--text-faint)] ml-1",children:"— evaluated after this step runs"}),l.jsx("div",{className:"ml-auto flex items-center gap-1",children:["all","any"].map(X=>l.jsx("button",{type:"button",onClick:()=>m(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))})]}),l.jsxs("div",{className:"space-y-2",children:[x.map((X,ce)=>l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx("input",{list:`cond-left-${n}-${ce}`,value:X.left,onChange:F=>M(ce,{left:F.target.value}),placeholder:"{{workflow:key}} or value",className:`flex-1 min-w-0 ${H}`}),l.jsx("datalist",{id:`cond-left-${n}-${ce}`,children:o.map(F=>l.jsx("option",{value:`{{${F}}}`},F))}),l.jsx("select",{value:X.operator,onChange:F=>M(ce,{operator:F.target.value,right:im.includes(F.target.value)?void 0:X.right}),className:`w-44 shrink-0 ${Z}`,children:h3.map(F=>l.jsx("optgroup",{label:F.label,children:F.ops.map(J=>l.jsx("option",{value:J.value,children:J.label},J.value))},F.label))}),im.includes(X.operator)?l.jsx("div",{className:"flex-1"}):l.jsx("input",{value:X.right??"",onChange:F=>M(ce,{right:F.target.value}),placeholder:"value or {{workflow:key}}",className:`flex-1 min-w-0 ${H}`}),x.length>1&&l.jsx("button",{type:"button",onClick:()=>L(ce),className:"shrink-0 text-[var(--text-faint)] hover:text-red-400 transition-colors hover:cursor-pointer",children:l.jsx(St,{className:"h-3 w-3",strokeWidth:2})})]},ce)),l.jsxs("button",{type:"button",onClick:B,className:"flex items-center gap-1 text-[10px] text-purple-400/70 hover:text-purple-400 transition-colors hover:cursor-pointer",children:[l.jsx(bt,{className:"h-3 w-3",strokeWidth:2})," Add rule"]})]}),l.jsxs("div",{className:"flex flex-col gap-2 pt-1 border-t border-purple-500/10",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-[10px] text-[var(--text-faint)] shrink-0",children:"If condition fails →"}),["abort","continue","switch"].map(X=>l.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"&&l.jsx("input",{value:j,onChange:X=>C(X.target.value),placeholder:"workflow-slug",className:`flex-1 ${H}`})]}),y==="switch"&&l.jsxs("label",{className:"flex items-center gap-1.5 text-[10px] text-[var(--text-muted)] cursor-pointer select-none ml-1",children:[l.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"}),l.jsxs("span",{children:["Return to main workflow after completing ",l.jsx("code",{className:"text-purple-400",children:j||"sub-workflow"})]})]})]}),l.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[l.jsxs("button",{type:"button",onClick:D,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:[l.jsx(yt,{className:"h-3 w-3",strokeWidth:2})," Save Condition"]}),r&&l.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:[l.jsx(Ot,{className:"h-3 w-3",strokeWidth:2})," Remove"]}),l.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:[l.jsx(St,{className:"h-3 w-3",strokeWidth:2})," Cancel"]})]})]})}function p3({step:n,index:r,total:o,status:i,result:u,allSteps:f,onConditionChange:h}){const[m,p]=w.useState(!1),[x,g]=w.useState(!1),y=n.capture&&Object.keys(n.capture).length>0,v=n.inject&&Object.keys(n.inject).length>0,j=n.body&&Object.keys(n.body).length>0,C=!!n.condition,_=[];for(let B=0;B<=r;B++){const L=f[B];Object.keys(L.capture??{}).forEach(D=>_.push(D)),Object.keys(L.captureInput??{}).forEach(D=>_.push(D))}const T={idle:l.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:l.jsx(tt,{className:"h-5 w-5 text-blue-400 animate-spin",strokeWidth:2}),passed:l.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-emerald-500/10 text-emerald-400",children:l.jsx(yt,{className:"h-3 w-3",strokeWidth:2})}),failed:l.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-red-500/10 text-red-400",children:l.jsx(Dt,{className:"h-3 w-3",strokeWidth:2})}),skipped:l.jsx("span",{className:"h-5 w-5 rounded-full border border-[var(--border)] bg-[var(--bg-overlay-md)]"})}[i],M=C&&n.condition?(()=>{const B=n.condition.rules.all??n.condition.rules.any??[],L=n.condition.rules.all?"AND":"OR";return`${B.length} rule${B.length!==1?"s":""} ${L} → ${n.condition.onFail}`})():null;return l.jsxs("div",{className:"relative",children:[r<o-1&&l.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)]"}`}),l.jsxs("div",{className:"relative z-10",children:[l.jsxs("button",{type:"button",onClick:()=>p(B=>!B),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:[l.jsx("span",{className:"shrink-0",children:T}),l.jsx(s3,{method:n.method}),l.jsx("span",{className:"font-mono text-xs text-[var(--text-secondary)] flex-1 truncate",children:n.path}),u&&l.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"]}),l.jsxs("span",{className:"flex items-center gap-1",children:[v&&l.jsx("span",{className:"rounded bg-amber-500/10 px-1 py-0.5 text-[9px] text-amber-400",children:"auth"}),y&&l.jsx("span",{className:"rounded bg-blue-500/10 px-1 py-0.5 text-[9px] text-blue-400",children:"capture"}),C&&l.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:[l.jsx(In,{className:"h-2.5 w-2.5",strokeWidth:2})," condition"]}),u?.conditionResult&&l.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"]})]}),l.jsx("span",{className:"text-[var(--text-faint)] shrink-0",children:m?l.jsx($a,{className:"h-3.5 w-3.5"}):l.jsx(ys,{className:"h-3.5 w-3.5"})})]}),m&&l.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&&l.jsx("p",{className:"text-[11px] text-[var(--text-muted)]",children:n.description}),u&&l.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:[l.jsx("p",{className:"text-[10px] text-[var(--text-faint)] mb-1 uppercase tracking-wider",children:"Response"}),u.error?l.jsx("p",{className:"text-[11px] text-red-400",children:u.error}):l.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)})]}),j&&l.jsxs("div",{children:[l.jsx("p",{className:"text-[10px] text-[var(--text-faint)] mb-1 uppercase tracking-wider",children:"Request Body"}),l.jsx("div",{className:"space-y-1",children:Object.entries(n.body).map(([B,L])=>l.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:[l.jsx("span",{className:"font-mono text-[10px] text-[var(--text-secondary)]",children:B}),l.jsx("span",{className:"font-mono text-[10px] text-blue-400/80 truncate",children:String(L)})]},B))})]}),v&&l.jsxs("div",{children:[l.jsxs("p",{className:"text-[10px] text-[var(--text-faint)] mb-1 uppercase tracking-wider flex items-center gap-1",children:[l.jsx(Em,{className:"h-3 w-3",strokeWidth:2})," Inject"]}),l.jsx("div",{className:"space-y-1",children:Object.entries(n.inject).map(([B,L])=>l.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:[l.jsx("span",{className:"font-mono text-[10px] text-amber-400/80",children:B}),l.jsx(ds,{className:"h-3 w-3 text-[var(--text-faint)] shrink-0",strokeWidth:2}),l.jsx("span",{className:"font-mono text-[10px] text-[var(--text-muted)]",children:L})]},B))})]}),y&&l.jsxs("div",{children:[l.jsxs("p",{className:"text-[10px] text-[var(--text-faint)] mb-1 uppercase tracking-wider flex items-center gap-1",children:[l.jsx(ea,{className:"h-3 w-3",strokeWidth:2})," Capture"]}),l.jsx("div",{className:"space-y-1",children:Object.entries(n.capture).map(([B,L])=>l.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:[l.jsx("span",{className:"font-mono text-[10px] text-blue-400",children:B}),l.jsx(ds,{className:"h-3 w-3 text-[var(--text-faint)] shrink-0",strokeWidth:2}),l.jsx("span",{className:"font-mono text-[10px] text-[var(--text-muted)]",children:L})]},B))})]}),l.jsxs("div",{className:"pt-1",children:[C&&M&&!x&&l.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:[l.jsx(In,{className:"h-3 w-3 text-purple-400 shrink-0",strokeWidth:2}),l.jsx("span",{className:"text-[10px] text-purple-400 flex-1",children:M}),u?.conditionResult&&l.jsx("span",{className:`text-[9px] font-medium ${u.conditionResult.passed?"text-purple-400":"text-orange-400"}`,children:u.conditionResult.passed?"✓ passed":"✗ failed"}),l.jsx("button",{type:"button",onClick:()=>g(!0),className:"shrink-0 text-[var(--text-faint)] hover:text-purple-400 transition-colors hover:cursor-pointer",children:l.jsx(N1,{className:"h-3 w-3",strokeWidth:2})})]}),x?l.jsx(x3,{stepIndex:r,existingCondition:n.condition,capturedKeys:_,onSave:B=>{h(r,B),g(!1)},onRemove:()=>{h(r,void 0),g(!1)},onCancel:()=>g(!1)}):!C&&l.jsxs("button",{type:"button",onClick:()=>g(!0),className:"flex items-center gap-1.5 text-[10px] text-[var(--text-faint)] hover:text-purple-400 transition-colors hover:cursor-pointer",children:[l.jsx(bt,{className:"h-3 w-3",strokeWidth:2}),l.jsx(In,{className:"h-3 w-3",strokeWidth:2}),"Add Condition"]})]})]})]})]})}function wd(n){return{phase:"idle",currentStep:-1,stepStatuses:Array(n).fill("idle"),stepResults:Array(n).fill(null),passed:0,failed:0}}function m3({workflow:n,onDelete:r,onViewTraces:o}){const[i,u]=w.useState(n),[f,h]=w.useState("list"),[m,p]=w.useState(!1),[x,g]=w.useState(!1),[y,v]=w.useState(!1),[j,C]=w.useState(()=>wd(i.steps.length)),[_,T]=w.useState(void 0),[M,B]=w.useState([]),[L,D]=w.useState(null),[H,Z]=w.useState(""),X=w.useRef(!1),ce=w.useRef(null),F=w.useRef(""),J=w.useRef("local-sim"),ae=w.useRef({}),te=async(N,R)=>{const V=i.steps.map((le,xe)=>{if(xe!==N)return le;if(R===void 0){const{condition:de,...ge}=le;return ge}return{...le,condition:R}}),I={...i,steps:V};u(I);try{await l3(i._file,V)}catch{}};w.useEffect(()=>{fetch("/api/model/environments").then(N=>N.ok?N.json():null).then(N=>{if(!N)return;const R=N.environments??[];B(R);const V=N.defaultEnvironment??R.find(le=>le.default)?.name??R[0]?.name??null;D(V);const I=R.find(le=>le.name===V);I&&Z(I.baseUrl)}).catch(()=>{})},[]);const se=async()=>{if(confirm(`Delete workflow "${i.name}"? This cannot be undone.`)){v(!0);try{await o3(i._file),r()}catch(N){alert(`Failed to delete: ${N.message}`),v(!1)}}},E=()=>{X.current=!0,ce.current?.close(),ce.current=null,C(N=>({...N,phase:N.phase==="running"?"aborted":N.phase}))},q=()=>{E(),C(wd(i.steps.length))},k=async(N,R,V)=>{const I=new Date().toISOString(),le={id:crypto.randomUUID(),workflowName:i.name,workflowFile:i._file,startedAt:V,finishedAt:I,durationMs:N.stepResults.reduce((de,ge)=>de+(ge?.durationMs??0),0),phase:N.phase==="done"?"done":N.phase==="aborted"?"aborted":"error",passed:N.passed,failed:N.failed,baseUrl:N.baseUrl,source:R,steps:i.steps.map((de,ge)=>{const pe=N.stepResults[ge];return{index:ge,name:de.name,method:de.method,path:de.path,description:de.description,status:pe?.status??0,passed:pe?.passed??!1,durationMs:pe?.durationMs??0,captured:Object.fromEntries((pe?.captured??[]).map(ve=>[ve,"(captured)"])),injected:pe?.injected??{},requestBody:de.body,responseBody:pe?.responseBody,error:pe?.error??null,expectStatus:de.expectStatus,captureSpec:de.capture,injectSpec:de.inject,conditionSpec:de.condition,conditionResult:pe?.conditionResult}})},xe=await n2(le);T(xe)},U=()=>{X.current=!1;const N=i.steps.length;C({...wd(N),baseUrl:H||void 0}),T(void 0),F.current=new Date().toISOString(),J.current="local-sim",p(!0);const R=async()=>{C(de=>({...de,phase:"running",baseUrl:H||de.baseUrl})),ae.current={};let V=0,I=0,le=!1,xe="";for(let de=0;de<N&&!(X.current||le);de++){C(me=>{const Y=[...me.stepStatuses];return Y[de]="running",{...me,stepStatuses:Y,currentStep:de}});const ge=600+Math.random()*800;if(await new Promise(me=>{const Y=setTimeout(me,ge),W=setInterval(()=>{X.current&&(clearTimeout(Y),clearInterval(W),me())},50);setTimeout(()=>clearInterval(W),ge+100)}),X.current)break;const pe=i.steps[de];Object.keys(pe.capture??{}).forEach(me=>{ae.current[me]="[simulated]"}),Object.keys(pe.captureInput??{}).forEach(me=>{ae.current[me]="[simulated]"});let ve;if(pe.condition&&(ve=a3(pe.condition,ae.current),!ve.passed)){const{onFail:me,returnOnComplete:Y}=pe.condition;me==="abort"?(le=!0,xe=`Condition failed at step ${de+1}: ${ve.reason}`):me==="continue"?(le=!0,xe="Condition failed → continuing without remaining steps"):me==="switch"&&(Y||(le=!0,xe=`Condition failed → switched to: ${pe.condition.switchToWorkflow??"unknown"}`))}const _e=!0,qe=Math.round(ge),Ee={index:de,step:{name:pe.name,method:pe.method,path:pe.path,description:pe.description},status:200,passed:_e,durationMs:qe,captured:Object.keys(pe.capture??{}).map(me=>me.split(":").pop()??me),injected:{},responseBody:{simulated:!0},error:null,conditionResult:ve};if(V++,C(me=>{const Y=[...me.stepStatuses],W=[...me.stepResults];return Y[de]="passed",W[de]=Ee,{...me,stepStatuses:Y,stepResults:W,passed:V,failed:I}}),le)break}if(!X.current)if(le){const de={phase:"aborted",stepStatuses:j.stepStatuses,stepResults:j.stepResults,passed:V,failed:I,baseUrl:H||void 0};C(ge=>({...ge,phase:"aborted",error:xe})),k(de,"local-sim",F.current)}else{const de={phase:"done",stepStatuses:Array(N).fill("passed"),stepResults:i.steps.map((ge,pe)=>({index:pe,step:{name:ge.name,method:ge.method,path:ge.path,description:ge.description},status:200,passed:!0,durationMs:Math.round(600+Math.random()*800),captured:Object.keys(ge.capture??{}).map(ve=>ve.split(":").pop()??ve),injected:{},responseBody:{simulated:!0},error:null})),passed:V,failed:I};C(ge=>({...ge,phase:"done",passed:V,failed:I})),k(de,"local-sim",F.current)}};fetch("/api/workflows/run",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file:i._file,baseUrl:H||void 0})}).then(V=>{if(!V.ok||!V.body){R();return}const I=V.body.getReader(),le=new TextDecoder;let xe="";C(ge=>({...ge,phase:"running"})),(async()=>{let ge=!1;for(;!X.current;){const{value:pe,done:ve}=await I.read();if(ve)break;ge=!0,xe+=le.decode(pe,{stream:!0});const _e=xe.split(`
|
|
367
|
-
`);xe=_e.pop()??"";for(const qe of _e){const Ee=qe.trim();if(!Ee.startsWith("data:"))continue;const me=Ee.slice(5).trim();if(!me)continue;let Y;try{Y=JSON.parse(me)}catch{continue}C(W=>{const re={...W};if(Y.type==="start")re.phase="running",re.baseUrl=Y.baseUrl;else if(Y.type==="step_start"){const oe=Y.index,ne=[...re.stepStatuses];ne[oe]="running",re.stepStatuses=ne,re.currentStep=oe}else if(Y.type==="step_result"){const oe=Y.index,ne=[...re.stepStatuses],Ce=[...re.stepResults];ne[oe]=Y.passed?"passed":"failed",Ce[oe]={index:Y.index,step:Y.step??{name:"",method:"",path:""},status:Y.status,passed:Y.passed,durationMs:Y.durationMs,captured:Y.captured??[],injected:Y.injected??{},responseBody:Y.responseBody,error:Y.error??null},Y.passed?re.passed=(re.passed??0)+1:re.failed=(re.failed??0)+1,re.stepStatuses=ne,re.stepResults=Ce}else if(Y.type==="condition_result"){const oe=Y.index,ne=[...re.stepResults];ne[oe]&&(ne[oe]={...ne[oe],conditionResult:{passed:Y.passed,reason:Y.reason}},re.stepResults=ne)}else if(Y.type==="aborted"){const oe=[...re.stepStatuses];for(let ne=0;ne<oe.length;ne++)oe[ne]==="running"?oe[ne]="failed":oe[ne]==="idle"&&(oe[ne]="skipped");re.stepStatuses=oe,re.phase="aborted",re.error=Y.reason,k(re,"api",F.current)}else Y.type==="done"&&(re.phase="done",(Y.passed>0||Y.failed>0)&&(re.passed=Y.passed,re.failed=Y.failed),Y.conditionBranch==="continue"?re.error="Condition failed → remaining steps skipped":Y.conditionBranch==="switch"&&(re.error=`Condition failed → switched to: ${Y.switchToWorkflow??"unknown"}`),k(re,"api",F.current));return re})}}!ge&&!X.current&&R()})().catch(()=>{X.current||R()})}).catch(()=>{X.current||R()})},z=j.phase==="running",O=j.phase!=="idle";return l.jsxs("div",{className:"relative",children:[l.jsxs("button",{type:"button",onClick:U,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:[l.jsx(Ed,{size:10})," Run Workflow"]}),l.jsxs("div",{className:"rounded-lg border border-[var(--border)] bg-[var(--bg-overlay)] overflow-hidden",children:[l.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-3 border-b border-[var(--border)]",children:[l.jsx("button",{type:"button",onClick:()=>g(N=>!N),className:"text-blue-400/70 hover:text-blue-400 transition-colors shrink-0 hover:cursor-pointer",children:x?l.jsx(ys,{className:"h-3.5 w-3.5"}):l.jsx($a,{className:"h-3.5 w-3.5"})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("p",{className:"text-[var(--text-primary)] truncate",children:i.name}),i.generatedAt&&l.jsxs("p",{className:"flex items-center gap-1 text-[10px] text-[var(--text-faint)] mt-0.5",children:[l.jsx(Yr,{className:"h-2.5 w-2.5",strokeWidth:2}),new Date(i.generatedAt).toLocaleString()]})]}),l.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"]}),O&&l.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"&&l.jsx(tt,{className:"h-2.5 w-2.5 animate-spin",strokeWidth:2}),j.phase==="done"&&j.failed===0&&l.jsx(yt,{className:"h-2.5 w-2.5",strokeWidth:2}),(j.phase==="done"||j.phase==="aborted")&&j.failed>0&&l.jsx(Dt,{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"]}),!x&&l.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(N=>l.jsxs("button",{type:"button",onClick:()=>h(N),className:`flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium transition-colors hover:cursor-pointer ${f===N?"bg-blue-500/20 text-blue-400":"text-[var(--text-faint)] hover:text-[var(--text-muted)]"}`,children:[N==="list"?l.jsx(Cm,{className:"h-3 w-3",strokeWidth:2}):l.jsx(Kd,{className:"h-3 w-3",strokeWidth:2}),N.charAt(0).toUpperCase()+N.slice(1)]},N))}),O&&!x&&l.jsxs("button",{type:"button",onClick:()=>p(N=>!N),className:`flex items-center gap-1 rounded-lg px-2.5 py-1 text-[10px] transition-colors border border-[var(--border)] hover:cursor-pointer ${m?"bg-[var(--bg-overlay-md)] text-[var(--text-secondary)]":"text-[var(--text-faint)] hover:text-[var(--text-secondary)] bg-[var(--bg-overlay)]"}`,children:[l.jsx(p1,{className:"h-3 w-3",strokeWidth:2})," Log"]}),z&&l.jsxs("button",{type:"button",onClick:E,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:[l.jsx(B1,{className:"h-3 w-3",strokeWidth:2})," Stop"]}),O&&!z&&l.jsxs("button",{type:"button",onClick:q,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:[l.jsx(_1,{className:"h-3 w-3",strokeWidth:2})," Reset"]}),O&&!z&&o&&l.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:[l.jsx(Lr,{className:"h-3 w-3",strokeWidth:2}),_?"View Trace":"Traces"]}),!z&&l.jsxs("button",{type:"button",onClick:U,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:[l.jsx(Ed,{className:"h-3 w-3",strokeWidth:2}),O?"Re-run":"Run"]}),!i._legacy&&!z&&l.jsx("button",{type:"button",onClick:se,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?l.jsx(tt,{className:"h-3 w-3 animate-spin",strokeWidth:2}):l.jsx(Ot,{className:"h-3 w-3",strokeWidth:2})})]}),!x&&l.jsxs(l.Fragment,{children:[M.length>0&&l.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:[l.jsx(vs,{className:"h-3 w-3 text-[var(--text-faint)] shrink-0",strokeWidth:2}),l.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-[var(--text-faint)] mr-1",children:"Env:"}),M.map(N=>{const R=L===N.name;return l.jsxs("button",{type:"button",onClick:()=>{D(N.name),Z(N.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 ${R?"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:[l.jsx("span",{className:"h-1.5 w-1.5 rounded-full shrink-0",style:{background:R?"#60a5fa":"var(--text-faint)"}}),N.name]},N.name)}),L&&l.jsx("span",{className:"ml-auto font-mono text-[10px] text-[var(--text-faint)] truncate max-w-[180px]",children:H})]}),m&&l.jsx("div",{className:"border-b border-[var(--border)]",children:l.jsx(f3,{runState:j,steps:i.steps})}),f==="list"&&l.jsx("div",{className:"divide-y divide-[var(--border)]",children:i.steps.map((N,R)=>l.jsx(p3,{step:N,index:R,total:i.steps.length,status:j.stepStatuses[R]??"idle",result:j.stepResults[R]??null,allSteps:i.steps,onConditionChange:te},R))}),f==="graph"&&l.jsx("div",{className:"p-4",children:l.jsx(d3,{steps:i.steps,runState:j})})]})]})]})}function g3(){return l.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-5 py-20 text-center",children:[l.jsxs("div",{className:"relative flex h-16 w-16 items-center justify-center",children:[l.jsx("div",{className:"absolute inset-0 rounded-full bg-blue-500/10 blur-xl"}),l.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:l.jsx(In,{className:"h-7 w-7",strokeWidth:2})})]}),l.jsxs("div",{children:[l.jsx("p",{className:"font-medium text-[var(--text-primary)]",children:"No workflows yet"}),l.jsxs("p",{className:"mt-1 text-[11px] text-[var(--text-muted)]",children:["Create one with the"," ",l.jsx("span",{className:"text-[var(--text-secondary)]",children:"+ New Workflow"})," button, or run"," ",l.jsx("code",{className:"text-[var(--text-secondary)]",children:'jetic simulate workflow --goal "..."'})]}),l.jsxs("p",{className:"mt-1 text-[11px] text-[var(--text-faint)]",children:["Workflows are stored in ",l.jsx("code",{className:"text-[var(--text-faint)]",children:".jetic/workflows/"})]})]})]})}function b3({onViewTraces:n}){const[r,o]=w.useState([]),[i,u]=w.useState(!0),[f,h]=w.useState(!1),[m,p]=w.useState(null),[x,g]=w.useState(!1),[y,v]=w.useState(""),[j,C]=w.useState(null),[_,T]=w.useState(!1),M=()=>{g(!1),v(""),C(null)},B=w.useCallback(async(H=!1)=>{H?h(!0):u(!0),p(null);try{o(await r3())}catch(Z){p(Z.message)}finally{u(!1),h(!1)}},[]);w.useEffect(()=>{B()},[B]);const L=async()=>{if(y.trim()){T(!0),C(null);try{const H=await fetch("/api/workflows/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({goal:y.trim()})}),Z=await H.json();if(!H.ok)throw new Error(Z.error??`HTTP ${H.status}`);M(),await B(!0)}catch(H){C(H.message)}finally{T(!1)}}},D=H=>{o(Z=>Z.filter(X=>X._file!==H))};return l.jsxs("div",{className:"flex min-h-full w-full flex-col",children:[l.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-6 py-5 sticky",children:[l.jsx("div",{className:"flex items-center gap-3",children:l.jsxs("div",{children:[l.jsx("h1",{className:"text-[15px] font-medium text-[var(--text-primary)] leading-none",children:"Simulations"}),l.jsx("p",{className:"mt-0.5 text-[11px] text-[var(--text-muted)]",children:i?"Loading…":`${r.length} workflow${r.length!==1?"s":""} found`})]})}),l.jsxs("div",{className:"flex items-center gap-2",children:[x?l.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:[l.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] text-blue-400 font-medium",children:[l.jsx(ea,{className:"h-3 w-3",strokeWidth:2})," AI Workflow Generator"]}),l.jsx("input",{autoFocus:!0,value:y,onChange:H=>{v(H.target.value),C(null)},onKeyDown:H=>{H.key==="Enter"&&!H.shiftKey&&L(),H.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"}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.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:_?l.jsxs(l.Fragment,{children:[l.jsx(tt,{className:"h-3 w-3 animate-spin",strokeWidth:2})," AI generating…"]}):l.jsxs(l.Fragment,{children:[l.jsx(ea,{className:"h-3 w-3",strokeWidth:2})," Generate with AI"]})}),l.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:l.jsx(St,{className:"h-3 w-3",strokeWidth:2})})]}),j&&l.jsx("span",{className:"text-[10px] text-red-400 leading-tight",children:j})]}):l.jsxs("button",{type:"button",onClick:()=>g(!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:[l.jsx(bt,{className:"h-3 w-3",strokeWidth:2})," New Workflow"]}),l.jsx("button",{type:"button",onClick:()=>B(!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:l.jsx(pl,{className:`h-3.5 w-3.5 ${f?"animate-spin":""}`,strokeWidth:2})})]})]}),l.jsxs("div",{className:"flex flex-1 flex-col gap-4 p-6 overflow-y-auto max-h[(calc(100vh-60px))]",children:[i&&l.jsx("div",{className:"space-y-3",children:[1,2].map(H=>l.jsx("div",{className:"h-16 animate-pulse rounded-lg border border-[var(--border)] bg-[var(--bg-overlay)]",style:{opacity:1-H*.3}},H))}),!i&&m&&l.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:[l.jsx(Dt,{className:"h-8 w-8 text-red-400",strokeWidth:2}),l.jsxs("div",{children:[l.jsx("p",{className:"font-medium text-red-300",children:"Could not load simulations"}),l.jsx("p",{className:"mt-1 text-[11px] text-red-400/80",children:m})]}),l.jsx("button",{type:"button",onClick:()=>B(),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&&!m&&r.length===0&&l.jsx(g3,{}),!i&&!m&&r.length>0&&l.jsx("div",{className:"space-y-5",children:r.map((H,Z)=>l.jsx(m3,{workflow:H,onDelete:()=>D(H._file),onViewTraces:n?(X,ce)=>n({workflowName:X,traceId:ce}):void 0},`${H._file}-${Z}`))}),!i&&!m&&r.length>0&&l.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 ",l.jsx("code",{className:"text-[var(--text-faint)]",children:".jetic/workflows/"})]})]})]})}const y3={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 cb(n){return y3[n.toUpperCase()]??{bg:"bg-[var(--bg-overlay-md)]",text:"text-[var(--text-muted)]",dot:"#a1a1aa"}}async function v3(){const n=await fetch("/api/model");if(!n.ok)throw new Error(`HTTP ${n.status}`);return n.json()}async function j3(){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 N3(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 w3(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 S3({method:n}){const r=cb(n);return l.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 dm({value:n,onSave:r,mono:o=!0}){const[i,u]=w.useState(!1),[f,h]=w.useState(n),[m,p]=w.useState(!1),x=w.useRef(null);w.useEffect(()=>{i&&x.current?.focus()},[i]);const g=async()=>{if(f===n){u(!1);return}p(!0);try{await r(f)}finally{p(!1),u(!1)}};return i?l.jsxs("span",{className:"inline-flex items-center gap-1",children:[l.jsx("input",{ref:x,value:f,onChange:y=>h(y.target.value),onKeyDown:y=>{y.key==="Enter"&&g(),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":""}`}),l.jsx("button",{type:"button",onClick:g,disabled:m,className:"text-emerald-400 hover:text-emerald-300 hover:cursor-pointer",children:m?l.jsx(tt,{className:"h-3 w-3 animate-spin"}):l.jsx(yt,{className:"h-3 w-3"})}),l.jsx("button",{type:"button",onClick:()=>{h(n),u(!1)},className:"text-[var(--text-faint)] hover:text-[var(--text-muted)] hover:cursor-pointer",children:l.jsx(St,{className:"h-3 w-3"})})]}):l.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:[l.jsx("span",{className:"text-xs text-[var(--text-secondary)]",children:n}),l.jsx(Jd,{className:"h-2.5 w-2.5 text-[var(--text-faint)] opacity-0 group-hover/ie:opacity-100 transition-opacity"})]})}function E3({ep:n,onUpdate:r,onInspect:o,onViewTraces:i,onEdit:u}){const[f,h]=w.useState(!1),[m,p]=w.useState(""),x=async(v,j)=>{p("");try{await N3(v,j),r(v,j)}catch(C){p(C.message)}},g=n.requestBody?.fields??{},y=n.responses??{};return l.jsxs("div",{className:"border-b border-[var(--border)] last:border-0",children:[l.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:[l.jsx("span",{className:"shrink-0 text-[var(--text-faint)]",children:f?l.jsx($a,{className:"h-3.5 w-3.5"}):l.jsx(ys,{className:"h-3.5 w-3.5"})}),l.jsx(S3,{method:n.method}),l.jsx("span",{className:"font-mono text-xs text-[var(--text-secondary)] flex-1 truncate",children:n.path}),n.security&&n.security.length>0&&l.jsx(qa,{className:"h-3 w-3 text-amber-500/60 shrink-0"}),n.deprecated&&l.jsx("span",{className:"rounded text-[9px] font-medium text-amber-500/60 border border-amber-500/20 px-1 py-0.5",children:"deprecated"}),l.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:[l.jsx(Jd,{className:"h-2.5 w-2.5"})," EDIT"]}),l.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&&l.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:[l.jsx(Lr,{className:"h-2.5 w-2.5"})," Traces"]}),l.jsx("span",{className:"hidden sm:block text-[10px] text-[var(--text-faint)] truncate max-w-[180px]",children:n.handlerName})]}),f&&l.jsxs("div",{className:"px-10 pb-4 pt-1 space-y-3 bg-[var(--bg-overlay)]",children:[m&&l.jsx("p",{className:"text-xs text-red-400 rounded border border-red-500/20 bg-red-500/10 px-2 py-1",children:m}),l.jsxs("div",{className:"flex flex-wrap gap-x-6 gap-y-2",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-[10px] text-[var(--text-faint)] mb-1 uppercase tracking-wider",children:"Method"}),l.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=>l.jsx("option",{children:v},v))})]}),l.jsxs("div",{children:[l.jsx("p",{className:"text-[10px] text-[var(--text-faint)] mb-1 uppercase tracking-wider",children:"Path"}),l.jsx(dm,{value:n.path,onSave:v=>x(n.id,{path:v})})]}),l.jsxs("div",{children:[l.jsx("p",{className:"text-[10px] text-[var(--text-faint)] mb-1 uppercase tracking-wider",children:"Handler"}),l.jsx(dm,{value:n.handlerName??"—",onSave:v=>x(n.id,{handlerName:v}),mono:!1})]})]}),n.source&&l.jsxs("p",{className:"flex items-center gap-1.5 text-[10px] text-[var(--text-faint)]",children:[l.jsx(Qd,{className:"h-3 w-3 shrink-0",strokeWidth:2}),n.source.file.split(/[/\\]/).slice(-2).join("/"),":",n.source.line]}),Object.keys(g).length>0&&l.jsxs("div",{children:[l.jsx("p",{className:"text-[10px] text-[var(--text-faint)] mb-1.5 uppercase tracking-wider",children:"Request Body"}),l.jsx("div",{className:"space-y-1",children:Object.entries(g).map(([v,j])=>l.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:[l.jsx("span",{className:"font-mono text-[11px] text-[var(--text-secondary)]",children:v}),l.jsx("span",{className:"text-[10px] text-[var(--text-faint)]",children:j.type}),j.required&&l.jsx("span",{className:"text-[10px] text-rose-400",children:"required"})]},v))})]}),Object.keys(y).length>0&&l.jsxs("div",{children:[l.jsx("p",{className:"text-[10px] text-[var(--text-faint)] mb-1.5 uppercase tracking-wider",children:"Responses"}),l.jsx("div",{className:"space-y-1",children:Object.entries(y).map(([v,j])=>l.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:[l.jsx("span",{className:`font-mono text-[11px] ${v.startsWith("2")?"text-emerald-400":"text-red-400"}`,children:v}),j.schema&&l.jsx("span",{className:"text-[10px] text-[var(--text-muted)]",children:Object.keys(j.schema).join(", ")})]},v))})]}),n.middleware&&n.middleware.length>0&&l.jsxs("div",{children:[l.jsx("p",{className:"text-[10px] text-[var(--text-faint)] mb-1.5 uppercase tracking-wider",children:"Middleware"}),l.jsx("div",{className:"flex flex-wrap gap-1.5",children:n.middleware.map((v,j)=>l.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 k3({prefix:n,endpoints:r,onUpdate:o,onInspect:i,onViewTraces:u,onEdit:f}){const[h,m]=w.useState(!1);return l.jsxs("div",{children:[l.jsxs("button",{type:"button",onClick:()=>m(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:[l.jsx("span",{className:"text-blue-400",children:h?l.jsx(ys,{className:"h-3 w-3"}):l.jsx($a,{className:"h-3 w-3"})}),l.jsx("span",{className:"font-mono text-xs font-medium text-blue-400",children:n}),l.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})]}),l.jsx("div",{className:"flex flex-col overflow-y-auto max-h-[calc(100vh-280px)]",children:!h&&r.map(p=>l.jsx(E3,{ep:p,onUpdate:o,onInspect:i,onViewTraces:u,onEdit:f},p.id))})]})}const ss=210,_r=52,Sd=100,fm=14,rs=36;function _3({endpoints:n}){const r=w.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*ss+(i.length-1)*Sd+rs*2,h=u*_r+(u-1)*fm+rs*2+24,m=new Map;return i.forEach(([,p],x)=>{const g=rs+x*(ss+Sd);p.forEach((y,v)=>{m.set(y.id,{x:g,y:rs+24+v*(_r+fm)})})}),w.useEffect(()=>{const p=r.current;if(!p)return;const x=p.getContext("2d");x&&(x.clearRect(0,0,p.width,p.height),i.forEach(([,g],y)=>{if(y>=i.length-1)return;const v=i[y+1][1];g.forEach(j=>{const C=m.get(j.id);v.forEach(_=>{const T=m.get(_.id),M=C.x+ss,B=C.y+_r/2,L=T.x,D=T.y+_r/2,H=(M+L)/2;x.beginPath(),x.strokeStyle="rgba(96,165,250,0.14)",x.lineWidth=1,x.moveTo(M,B),x.bezierCurveTo(H,B,H,D,L,D),x.stroke()})})}))}),l.jsxs("div",{className:"relative overflow-auto",style:{minWidth:f,minHeight:h},children:[l.jsx("canvas",{ref:r,width:f,height:h,className:"absolute inset-0 pointer-events-none"}),i.map(([p],x)=>l.jsx("div",{className:"absolute text-[9px] font-medium text-blue-400/70 uppercase tracking-widest text-center",style:{left:rs+x*(ss+Sd),top:rs,width:ss},children:p},p)),n.map(p=>{const x=m.get(p.id);if(!x)return null;const g=cb(p.method);return l.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:ss,height:_r},children:[l.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-[3px]",style:{background:g.dot}}),l.jsx("span",{className:`shrink-0 text-[9px] font-medium ${g.text}`,children:p.method}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("p",{className:"font-mono text-[10px] text-[var(--text-secondary)] truncate",children:p.path}),l.jsx("p",{className:"text-[9px] text-[var(--text-faint)] truncate",children:p.handlerName})]})]},p.id)})]})}function C3({onScan:n,scanning:r,error:o}){return l.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-5 py-20 text-center",children:[l.jsxs("div",{className:"relative flex h-16 w-16 items-center justify-center",children:[l.jsx("div",{className:"absolute inset-0 rounded-full bg-blue-500/10 blur-xl"}),l.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:l.jsx(Ai,{className:"h-7 w-7",strokeWidth:2})})]}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-[var(--text-primary)]",children:"No model found"}),l.jsxs("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:["Scan your project to generate ",l.jsx("code",{className:"text-[var(--text-secondary)]",children:".jetic/model.json"})]})]}),o&&l.jsx("p",{className:"text-xs text-red-400 max-w-xs",children:o}),l.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?l.jsx(tt,{className:"h-4 w-4 animate-spin",strokeWidth:2}):l.jsx(Ai,{className:"h-4 w-4",strokeWidth:2}),r?"Scanning project…":"Scan Project"]})]})}const qi=["application/json","application/x-www-form-urlencoded","multipart/form-data","text/plain","application/xml","application/octet-stream"],ub=["string","integer","number","boolean","array","object"];function T3({open:n,onClose:r,onCreated:o}){const[i,u]=w.useState("basic"),[f,h]=w.useState(!1),[m,p]=w.useState(""),[x,g]=w.useState("GET"),[y,v]=w.useState(""),[j,C]=w.useState(""),[_,T]=w.useState(""),[M,B]=w.useState(""),[L,D]=w.useState([]),[H,Z]=w.useState("application/json"),[X,ce]=w.useState(""),[F,J]=w.useState(""),[ae,te]=w.useState(!1),[se,E]=w.useState([]),[q,k]=w.useState([]),[U,z]=w.useState(!1),O=U&&!y.trim(),N=w.useRef(null);w.useEffect(()=>{n&&(u("basic"),g("GET"),v(""),C(""),T(""),B(""),D([]),Z("application/json"),ce(""),J(""),te(!1),E([]),k([]),z(!1),p(""),h(!1))},[n]),w.useEffect(()=>{if(!n)return;const W=re=>{re.key==="Escape"&&r()};return window.addEventListener("keydown",W),()=>window.removeEventListener("keydown",W)},[n,r]);const R=()=>D(W=>[...W,{name:"",in:"query",type:"string",required:!1,description:"",example:""}]),V=(W,re)=>D(oe=>oe.map((ne,Ce)=>Ce===W?{...ne,...re}:ne)),I=W=>D(re=>re.filter((oe,ne)=>ne!==W)),le=()=>E(W=>[...W,{status:"200",description:"",contentType:"application/json",schema:"",example:""}]),xe=(W,re)=>E(oe=>oe.map((ne,Ce)=>Ce===W?{...ne,...re}:ne)),de=W=>E(re=>re.filter((oe,ne)=>ne!==W)),ge=()=>k(W=>[...W,{name:""}]),pe=(W,re)=>k(oe=>oe.map((ne,Ce)=>Ce===W?{name:re}:ne)),ve=W=>k(re=>re.filter((oe,ne)=>ne!==W)),_e=(W,re)=>k(oe=>{const ne=[...oe],Ce=W+re;return Ce<0||Ce>=ne.length||([ne[W],ne[Ce]]=[ne[Ce],ne[W]]),ne}),qe=async()=>{if(z(!0),!y.trim()){u("basic");return}h(!0),p("");try{const W={method:x.toUpperCase(),path:y.startsWith("/")?y:"/"+y};j.trim()&&(W.name=j.trim()),_.trim()&&(W.description=_.trim()),M.trim()&&(W.tags=M.split(",").map(Te=>Te.trim()).filter(Boolean));const re=q.filter(Te=>Te.name.trim());W.middleware=re.map(Te=>({name:Te.name.trim()}));const oe=L.filter(Te=>Te.name.trim());if(oe.length>0&&(W.parameters=oe.map(Te=>{const Ue={name:Te.name,in:Te.in,schema:{type:Te.type},required:Te.required};return Te.description.trim()&&(Ue.description=Te.description),Te.example.trim()&&(Ue.example=Te.example),Ue})),X.trim()||F.trim()){const Te={},Ue={};if(X.trim())try{Ue.schema=JSON.parse(X)}catch{Ue.schema=X}if(F.trim())try{Ue.example=JSON.parse(F)}catch{Ue.example=F}Te[H]=Ue,W.requestBody={required:ae,content:Te}}const ne=se.filter(Te=>Te.status.trim());if(ne.length>0){const Te={};for(const Ue of ne){const en={};if(Ue.description.trim()&&(en.description=Ue.description),Ue.schema.trim()||Ue.example.trim()){const Mt={};if(Ue.schema.trim())try{Mt.schema=JSON.parse(Ue.schema)}catch{Mt.schema=Ue.schema}if(Ue.example.trim())try{Mt.example=JSON.parse(Ue.example)}catch{Mt.example=Ue.example}en.content={[Ue.contentType]:Mt}}Te[Ue.status]=en}W.responses=Te}const Ce=await w3(W);o(Ce.endpoint,Ce.model),r()}catch(W){p(W.message)}finally{h(!1)}};if(!n)return null;const Ee=[{key:"basic",label:"Basic"},{key:"request",label:"Request"},{key:"responses",label:"Responses"},{key:"middleware",label:`Middleware${q.length>0?` (${q.length})`:""}`}],me="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",Y="block text-[10px] text-[var(--text-faint)] mb-1.5 uppercase tracking-wider font-medium";return l.jsx("div",{ref:N,className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:W=>{W.target===N.current&&r()},children:l.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:[l.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-[var(--border)]",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-lg bg-blue-500/10",children:l.jsx(Wv,{className:"h-4 w-4 text-blue-400"})}),l.jsx("h2",{className:"text-sm font-medium text-[var(--text-primary)]",children:"Add Endpoint"})]}),l.jsx("button",{type:"button",onClick:r,className:"text-[var(--text-faint)] hover:text-[var(--text-secondary)] transition-colors hover:cursor-pointer",children:l.jsx(St,{className:"h-4 w-4"})})]}),l.jsx("div",{className:"flex items-center gap-1 px-6 pt-4 pb-2",children:Ee.map(W=>l.jsx("button",{type:"button",onClick:()=>u(W.key),className:`rounded-lg px-3 py-1.5 text-[11px] font-medium transition-all duration-200 hover:cursor-pointer ${i===W.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:W.label},W.key))}),m&&l.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:[l.jsx(Dt,{className:"h-3.5 w-3.5 shrink-0"}),m]}),l.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-4 space-y-4",children:[i==="basic"&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"grid grid-cols-[140px_1fr] gap-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:Y,children:"Method *"}),l.jsx("select",{value:x,onChange:W=>g(W.target.value),className:`${me} hover:cursor-pointer`,children:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"].map(W=>l.jsx("option",{children:W},W))})]}),l.jsxs("div",{children:[l.jsx("label",{className:Y,children:"Path *"}),l.jsx("input",{value:y,onChange:W=>v(W.target.value),placeholder:"/api/users",className:`${me} font-mono ${O?"border-red-500/60 focus:border-red-500/80":""}`}),O&&l.jsx("p",{className:"text-[10px] text-red-400 mt-1",children:"Path is required"})]})]}),l.jsxs("div",{children:[l.jsx("label",{className:Y,children:"Name"}),l.jsx("input",{value:j,onChange:W=>C(W.target.value),placeholder:"Create User",className:me})]}),l.jsxs("div",{children:[l.jsx("label",{className:Y,children:"Description"}),l.jsx("textarea",{value:_,onChange:W=>T(W.target.value),placeholder:"Creates a new user account",rows:2,className:`${me} resize-none`})]}),l.jsxs("div",{children:[l.jsx("label",{className:Y,children:"Tags"}),l.jsx("input",{value:M,onChange:W=>B(W.target.value),placeholder:"users, auth, public",className:me}),l.jsx("p",{className:"text-[10px] text-[var(--text-faint)] mt-1",children:"Comma-separated"})]})]}),i==="request"&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsx("p",{className:Y+" mb-0",children:"Parameters"}),l.jsxs("button",{type:"button",onClick:R,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:[l.jsx(bt,{className:"h-3 w-3"})," Add Parameter"]})]}),L.length===0&&l.jsx("p",{className:"text-[10px] text-[var(--text-faint)] italic",children:"No parameters added yet"}),l.jsx("div",{className:"space-y-2",children:L.map((W,re)=>l.jsxs("div",{className:"rounded-lg border border-[var(--border)] bg-[var(--bg-overlay)] p-3 space-y-2",children:[l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx("div",{className:"flex-1",children:l.jsx("input",{value:W.name,onChange:oe=>V(re,{name:oe.target.value}),placeholder:"Parameter name",className:`${me} font-mono`})}),l.jsx("select",{value:W.in,onChange:oe=>V(re,{in:oe.target.value}),className:`${me} w-28 hover:cursor-pointer`,children:["query","path","header","cookie"].map(oe=>l.jsx("option",{children:oe},oe))}),l.jsx("select",{value:W.type,onChange:oe=>V(re,{type:oe.target.value}),className:`${me} w-28 hover:cursor-pointer`,children:ub.map(oe=>l.jsx("option",{children:oe},oe))}),l.jsx("button",{type:"button",onClick:()=>I(re),className:"mt-1.5 text-[var(--text-faint)] hover:text-red-400 transition-colors hover:cursor-pointer",children:l.jsx(Ot,{className:"h-3.5 w-3.5"})})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("label",{className:"flex items-center gap-1.5 text-[10px] text-[var(--text-muted)] hover:cursor-pointer select-none",children:[l.jsx("input",{type:"checkbox",checked:W.required,onChange:oe=>V(re,{required:oe.target.checked}),className:"accent-blue-500"}),"Required"]}),l.jsx("input",{value:W.description,onChange:oe=>V(re,{description:oe.target.value}),placeholder:"Description",className:`${me} flex-1 text-[10px]`}),l.jsx("input",{value:W.example,onChange:oe=>V(re,{example:oe.target.value}),placeholder:"Example",className:`${me} w-32 text-[10px] font-mono`})]})]},re))})]}),l.jsx("div",{className:"border-t border-[var(--border)]"}),l.jsxs("div",{children:[l.jsx("p",{className:Y,children:"Request Body"}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("div",{className:"flex-1",children:[l.jsx("label",{className:Y,children:"Content Type"}),l.jsx("select",{value:H,onChange:W=>Z(W.target.value),className:`${me} hover:cursor-pointer`,children:qi.map(W=>l.jsx("option",{children:W},W))})]}),l.jsxs("label",{className:"flex items-center gap-1.5 text-[10px] text-[var(--text-muted)] mt-5 hover:cursor-pointer select-none",children:[l.jsx("input",{type:"checkbox",checked:ae,onChange:W=>te(W.target.checked),className:"accent-blue-500"}),"Required"]})]}),l.jsxs("div",{children:[l.jsx("label",{className:Y,children:"Schema (JSON)"}),l.jsx("textarea",{value:X,onChange:W=>ce(W.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:`${me} resize-none font-mono text-[11px] leading-relaxed`})]}),l.jsxs("div",{children:[l.jsx("label",{className:Y,children:"Example"}),l.jsx("textarea",{value:F,onChange:W=>J(W.target.value),placeholder:`{
|
|
375
|
-
"email": "test@example.com",
|
|
376
|
-
"password": "password123"
|
|
377
|
-
}`,rows:3,className:`${me} resize-none font-mono text-[11px] leading-relaxed`})]})]})]})]}),i==="responses"&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsx("p",{className:Y+" mb-0",children:"Responses"}),l.jsxs("button",{type:"button",onClick:le,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:[l.jsx(bt,{className:"h-3 w-3"})," Add Response"]})]}),se.length===0&&l.jsx("p",{className:"text-[10px] text-[var(--text-faint)] italic",children:'No responses defined yet. Click "Add Response" above.'}),l.jsx("div",{className:"space-y-3",children:se.map((W,re)=>l.jsxs("div",{className:"rounded-lg border border-[var(--border)] bg-[var(--bg-overlay)] p-3 space-y-3",children:[l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsxs("div",{className:"w-24",children:[l.jsx("label",{className:Y,children:"Status"}),l.jsx("input",{value:W.status,onChange:oe=>xe(re,{status:oe.target.value}),placeholder:"200",className:`${me} font-mono`})]}),l.jsxs("div",{className:"flex-1",children:[l.jsx("label",{className:Y,children:"Description"}),l.jsx("input",{value:W.description,onChange:oe=>xe(re,{description:oe.target.value}),placeholder:"Success",className:me})]}),l.jsxs("div",{className:"w-48",children:[l.jsx("label",{className:Y,children:"Content Type"}),l.jsx("select",{value:W.contentType,onChange:oe=>xe(re,{contentType:oe.target.value}),className:`${me} hover:cursor-pointer`,children:qi.map(oe=>l.jsx("option",{children:oe},oe))})]}),l.jsx("button",{type:"button",onClick:()=>de(re),className:"mt-5 text-[var(--text-faint)] hover:text-red-400 transition-colors hover:cursor-pointer",children:l.jsx(Ot,{className:"h-3.5 w-3.5"})})]}),l.jsxs("div",{children:[l.jsx("label",{className:Y,children:"Body Schema (JSON)"}),l.jsx("textarea",{value:W.schema,onChange:oe=>xe(re,{schema:oe.target.value}),placeholder:`{
|
|
378
|
-
"type": "object",
|
|
379
|
-
"properties": { ... }
|
|
380
|
-
}`,rows:3,className:`${me} resize-none font-mono text-[11px] leading-relaxed`})]}),l.jsxs("div",{children:[l.jsx("label",{className:Y,children:"Example"}),l.jsx("textarea",{value:W.example,onChange:oe=>xe(re,{example:oe.target.value}),placeholder:`{
|
|
381
|
-
"id": "abc123",
|
|
382
|
-
"email": "test@example.com"
|
|
383
|
-
}`,rows:2,className:`${me} resize-none font-mono text-[11px] leading-relaxed`})]})]},re))})]}),i==="middleware"&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsxs("div",{children:[l.jsx("p",{className:Y+" mb-0",children:"Middleware Chain"}),l.jsx("p",{className:"text-[10px] text-[var(--text-faint)] mt-0.5",children:"Executed in order, top → bottom"})]}),l.jsxs("button",{type:"button",onClick:ge,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:[l.jsx(bt,{className:"h-3 w-3"})," Add Middleware"]})]}),q.length===0&&l.jsxs("div",{className:"flex flex-col items-center gap-2 py-8 rounded-lg border border-dashed border-[var(--border)] text-center",children:[l.jsx(qa,{className:"h-6 w-6 text-[var(--text-faint)]",strokeWidth:1.5}),l.jsxs("p",{className:"text-[10px] text-[var(--text-faint)] italic",children:["No middleware added yet.",l.jsx("br",{}),'Click "Add Middleware" to get started.']})]}),l.jsx("div",{className:"space-y-2",children:q.map((W,re)=>l.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-[var(--border)] bg-[var(--bg-overlay)] px-3 py-2",children:[l.jsxs("div",{className:"flex flex-col gap-0.5",children:[l.jsx("button",{type:"button",onClick:()=>_e(re,-1),disabled:re===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:l.jsx($a,{className:"h-3 w-3 rotate-180"})}),l.jsx("button",{type:"button",onClick:()=>_e(re,1),disabled:re===q.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:l.jsx($a,{className:"h-3 w-3"})})]}),l.jsx("span",{className:"text-[10px] text-[var(--text-faint)] w-4 text-center shrink-0",children:re+1}),l.jsx("input",{value:W.name,onChange:oe=>pe(re,oe.target.value),placeholder:"e.g. authenticateToken",className:`${me} flex-1 font-mono`}),l.jsx("button",{type:"button",onClick:()=>ve(re),className:"text-[var(--text-faint)] hover:text-red-400 transition-colors hover:cursor-pointer shrink-0",title:"Remove",children:l.jsx(Ot,{className:"h-3.5 w-3.5"})})]},re))})]})]}),l.jsxs("div",{className:"flex items-center justify-between border-t border-[var(--border)] px-6 py-4",children:[l.jsxs("p",{className:"text-[10px] text-[var(--text-faint)]",children:["Only ",l.jsx("span",{className:"text-[var(--text-muted)]",children:"Method"})," and ",l.jsx("span",{className:"text-[var(--text-muted)]",children:"Path"})," are required"]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.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"}),l.jsxs("button",{type:"button",onClick:qe,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?l.jsx(tt,{className:"h-3.5 w-3.5 animate-spin"}):l.jsx(bt,{className:"h-3.5 w-3.5"}),f?"Adding…":"Add Endpoint"]})]})]})]})})}function M3({endpoint:n,onClose:r,onSaved:o}){const[i,u]=w.useState("basic"),[f,h]=w.useState(!1),[m,p]=w.useState(""),[x,g]=w.useState(n.method),[y,v]=w.useState(n.path),[j,C]=w.useState(n.name??""),[_,T]=w.useState(n.description??""),[M,B]=w.useState((n.tags??[]).join(", ")),[L,D]=w.useState(n.deprecated??!1),[H,Z]=w.useState(()=>(n.parameters??[]).filter(Y=>Y.in!=="body").map(Y=>({name:Y.name,in:Y.in??"query",type:Y.type,required:Y.required??!1,description:Y.description??"",example:Y.example?String(Y.example):""}))),[X,ce]=w.useState(n.requestBody?.contentType??"application/json"),[F,J]=w.useState(n.requestBody?.required??!1),[ae,te]=w.useState(()=>{const Y=n.requestBody?.fields;if(!Y||Object.keys(Y).length===0)return"";const W={},re=[];for(const[oe,ne]of Object.entries(Y))W[oe]={type:ne.type,...ne.format?{format:ne.format}:{},...ne.description?{description:ne.description}:{}},ne.required&&re.push(oe);return JSON.stringify({type:"object",properties:W,...re.length>0?{required:re}:{}},null,2)}),[se,E]=w.useState(""),[q,k]=w.useState(()=>Object.entries(n.responses??{}).map(([Y,W])=>({status:Y,description:W.description??"",contentType:W.contentType??"application/json",schema:W.schema?JSON.stringify(W.schema,null,2):"",example:""}))),[U,z]=w.useState((n.middleware??[]).map(Y=>({name:Y.name}))),O=w.useRef(null);w.useEffect(()=>{if(!open)return;const Y=W=>{W.key==="Escape"&&r()};return window.addEventListener("keydown",Y),()=>window.removeEventListener("keydown",Y)},[r]);const N=()=>Z(Y=>[...Y,{name:"",in:"query",type:"string",required:!1,description:"",example:""}]),R=(Y,W)=>Z(re=>re.map((oe,ne)=>ne===Y?{...oe,...W}:oe)),V=Y=>Z(W=>W.filter((re,oe)=>oe!==Y)),I=()=>k(Y=>[...Y,{status:"200",description:"",contentType:"application/json",schema:"",example:""}]),le=(Y,W)=>k(re=>re.map((oe,ne)=>ne===Y?{...oe,...W}:oe)),xe=Y=>k(W=>W.filter((re,oe)=>oe!==Y)),de=()=>z(Y=>[...Y,{name:""}]),ge=(Y,W)=>z(re=>re.map((oe,ne)=>ne===Y?{name:W}:oe)),pe=Y=>z(W=>W.filter((re,oe)=>oe!==Y)),ve=(Y,W)=>z(re=>{const oe=[...re],ne=Y+W;return ne<0||ne>=oe.length||([oe[Y],oe[ne]]=[oe[ne],oe[Y]]),oe}),_e=async()=>{if(!y.trim()){u("basic");return}h(!0),p("");try{const Y={id:n.id,method:x.toUpperCase(),path:y.startsWith("/")?y:"/"+y};j.trim()&&(Y.name=j.trim()),_.trim()&&(Y.description=_.trim()),M.trim()&&(Y.tags=M.split(",").map(ne=>ne.trim()).filter(Boolean)),L&&(Y.deprecated=!0),n.handlerName&&(Y.handlerName=n.handlerName),n.source&&(Y.source=n.source),n.security&&(Y.security=n.security),Y.middleware=U.filter(ne=>ne.name.trim()).map(ne=>({name:ne.name.trim()}));const W=H.filter(ne=>ne.name.trim());if(W.length>0&&(Y.parameters=W.map(ne=>({name:ne.name,in:ne.in,schema:{type:ne.type},required:ne.required,...ne.description?{description:ne.description}:{},...ne.example?{example:ne.example}:{}}))),ae.trim()){const ne={};try{ne.schema=JSON.parse(ae)}catch{ne.schema=ae}if(se.trim())try{ne.example=JSON.parse(se)}catch{ne.example=se}Y.requestBody={required:F,content:{[X]:ne}}}const re=q.filter(ne=>ne.status.trim());if(re.length>0){const ne={};for(const Ce of re){const Te={};if(Ce.description.trim()&&(Te.description=Ce.description),Ce.schema.trim())try{Te.schema=JSON.parse(Ce.schema)}catch{Te.schema=Ce.schema}ne[Ce.status]=Te}Y.responses=ne}const oe=await fetch(`/api/model/endpoint/${n.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(Y)});if(!oe.ok){const ne=await oe.json().catch(()=>({}));throw new Error(ne.error??`Save failed (${oe.status})`)}o({...n,...Y})}catch(Y){p(Y.message)}finally{h(!1)}},qe=[{key:"basic",label:"Basic"},{key:"request",label:"Request"},{key:"responses",label:"Responses"},{key:"middleware",label:`Middleware${U.length>0?` (${U.length})`:""}`}],Ee="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",me="block text-[10px] text-[var(--text-faint)] mb-1.5 uppercase tracking-wider font-medium";return l.jsx("div",{ref:O,className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:Y=>{Y.target===O.current&&r()},children:l.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:[l.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-[var(--border)]",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-lg bg-amber-500/10",children:l.jsx(Jd,{className:"h-4 w-4 text-amber-400"})}),l.jsxs("div",{children:[l.jsx("h2",{className:"text-sm font-medium text-[var(--text-primary)]",children:"Edit Endpoint"}),l.jsxs("p",{className:"text-[10px] text-[var(--text-faint)] font-mono",children:[n.method," ",n.path]})]})]}),l.jsx("button",{type:"button",onClick:r,className:"text-[var(--text-faint)] hover:text-[var(--text-secondary)] transition-colors hover:cursor-pointer",children:l.jsx(St,{className:"h-4 w-4"})})]}),l.jsx("div",{className:"flex items-center gap-1 px-6 pt-4 pb-2",children:qe.map(Y=>l.jsx("button",{type:"button",onClick:()=>u(Y.key),className:`rounded-lg px-3 py-1.5 text-[11px] font-medium transition-all duration-200 hover:cursor-pointer ${i===Y.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:Y.label},Y.key))}),m&&l.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:[l.jsx(Dt,{className:"h-3.5 w-3.5 shrink-0"}),m]}),l.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-4 space-y-4",children:[i==="basic"&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"grid grid-cols-[140px_1fr] gap-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:me,children:"Method *"}),l.jsx("select",{value:x,onChange:Y=>g(Y.target.value),className:`${Ee} hover:cursor-pointer`,children:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"].map(Y=>l.jsx("option",{children:Y},Y))})]}),l.jsxs("div",{children:[l.jsx("label",{className:me,children:"Path *"}),l.jsx("input",{value:y,onChange:Y=>v(Y.target.value),placeholder:"/api/users",className:`${Ee} font-mono`})]})]}),l.jsxs("div",{children:[l.jsx("label",{className:me,children:"Name"}),l.jsx("input",{value:j,onChange:Y=>C(Y.target.value),placeholder:"Create User",className:Ee})]}),l.jsxs("div",{children:[l.jsx("label",{className:me,children:"Description"}),l.jsx("textarea",{value:_,onChange:Y=>T(Y.target.value),rows:2,className:`${Ee} resize-none`})]}),l.jsxs("div",{children:[l.jsx("label",{className:me,children:"Tags"}),l.jsx("input",{value:M,onChange:Y=>B(Y.target.value),placeholder:"users, auth, public",className:Ee}),l.jsx("p",{className:"text-[10px] text-[var(--text-faint)] mt-1",children:"Comma-separated"})]}),l.jsxs("label",{className:"flex items-center gap-2 text-[11px] text-[var(--text-muted)] hover:cursor-pointer select-none",children:[l.jsx("input",{type:"checkbox",checked:L,onChange:Y=>D(Y.target.checked),className:"accent-amber-500"}),"Mark as deprecated"]})]}),i==="request"&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsx("p",{className:me+" mb-0",children:"Parameters"}),l.jsxs("button",{type:"button",onClick:N,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:[l.jsx(bt,{className:"h-3 w-3"})," Add Parameter"]})]}),H.length===0&&l.jsx("p",{className:"text-[10px] text-[var(--text-faint)] italic",children:"No parameters"}),l.jsx("div",{className:"space-y-2",children:H.map((Y,W)=>l.jsxs("div",{className:"rounded-lg border border-[var(--border)] bg-[var(--bg-overlay)] p-3 space-y-2",children:[l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx("div",{className:"flex-1",children:l.jsx("input",{value:Y.name,onChange:re=>R(W,{name:re.target.value}),placeholder:"name",className:`${Ee} font-mono`})}),l.jsx("select",{value:Y.in,onChange:re=>R(W,{in:re.target.value}),className:`${Ee} w-28 hover:cursor-pointer`,children:["query","path","header","cookie"].map(re=>l.jsx("option",{children:re},re))}),l.jsx("select",{value:Y.type,onChange:re=>R(W,{type:re.target.value}),className:`${Ee} w-28 hover:cursor-pointer`,children:ub.map(re=>l.jsx("option",{children:re},re))}),l.jsx("button",{type:"button",onClick:()=>V(W),className:"mt-1.5 text-[var(--text-faint)] hover:text-red-400 transition-colors hover:cursor-pointer",children:l.jsx(Ot,{className:"h-3.5 w-3.5"})})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("label",{className:"flex items-center gap-1.5 text-[10px] text-[var(--text-muted)] hover:cursor-pointer select-none",children:[l.jsx("input",{type:"checkbox",checked:Y.required,onChange:re=>R(W,{required:re.target.checked}),className:"accent-amber-500"})," Required"]}),l.jsx("input",{value:Y.description,onChange:re=>R(W,{description:re.target.value}),placeholder:"Description",className:`${Ee} flex-1 text-[10px]`})]})]},W))})]}),l.jsx("div",{className:"border-t border-[var(--border)]"}),l.jsxs("div",{children:[l.jsx("p",{className:me,children:"Request Body"}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("div",{className:"flex-1",children:[l.jsx("label",{className:me,children:"Content Type"}),l.jsx("select",{value:X,onChange:Y=>ce(Y.target.value),className:`${Ee} hover:cursor-pointer`,children:qi.map(Y=>l.jsx("option",{children:Y},Y))})]}),l.jsxs("label",{className:"flex items-center gap-1.5 text-[10px] text-[var(--text-muted)] mt-5 hover:cursor-pointer select-none",children:[l.jsx("input",{type:"checkbox",checked:F,onChange:Y=>J(Y.target.checked),className:"accent-amber-500"})," Required"]})]}),l.jsxs("div",{children:[l.jsx("label",{className:me,children:"Schema (JSON)"}),l.jsx("textarea",{value:ae,onChange:Y=>te(Y.target.value),rows:5,className:`${Ee} resize-none font-mono text-[11px] leading-relaxed`})]}),l.jsxs("div",{children:[l.jsx("label",{className:me,children:"Example"}),l.jsx("textarea",{value:se,onChange:Y=>E(Y.target.value),rows:3,className:`${Ee} resize-none font-mono text-[11px] leading-relaxed`})]})]})]})]}),i==="responses"&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsx("p",{className:me+" mb-0",children:"Responses"}),l.jsxs("button",{type:"button",onClick:I,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:[l.jsx(bt,{className:"h-3 w-3"})," Add Response"]})]}),q.length===0&&l.jsx("p",{className:"text-[10px] text-[var(--text-faint)] italic",children:"No responses defined."}),l.jsx("div",{className:"space-y-3",children:q.map((Y,W)=>l.jsxs("div",{className:"rounded-lg border border-[var(--border)] bg-[var(--bg-overlay)] p-3 space-y-3",children:[l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsxs("div",{className:"w-24",children:[l.jsx("label",{className:me,children:"Status"}),l.jsx("input",{value:Y.status,onChange:re=>le(W,{status:re.target.value}),placeholder:"200",className:`${Ee} font-mono`})]}),l.jsxs("div",{className:"flex-1",children:[l.jsx("label",{className:me,children:"Description"}),l.jsx("input",{value:Y.description,onChange:re=>le(W,{description:re.target.value}),placeholder:"Success",className:Ee})]}),l.jsxs("div",{className:"w-48",children:[l.jsx("label",{className:me,children:"Content Type"}),l.jsx("select",{value:Y.contentType,onChange:re=>le(W,{contentType:re.target.value}),className:`${Ee} hover:cursor-pointer`,children:qi.map(re=>l.jsx("option",{children:re},re))})]}),l.jsx("button",{type:"button",onClick:()=>xe(W),className:"mt-5 text-[var(--text-faint)] hover:text-red-400 transition-colors hover:cursor-pointer",children:l.jsx(Ot,{className:"h-3.5 w-3.5"})})]}),l.jsxs("div",{children:[l.jsx("label",{className:me,children:"Body Schema (JSON)"}),l.jsx("textarea",{value:Y.schema,onChange:re=>le(W,{schema:re.target.value}),rows:3,className:`${Ee} resize-none font-mono text-[11px] leading-relaxed`})]})]},W))})]}),i==="middleware"&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsxs("div",{children:[l.jsx("p",{className:me+" mb-0",children:"Middleware Chain"}),l.jsx("p",{className:"text-[10px] text-[var(--text-faint)] mt-0.5",children:"Executed in order, top → bottom"})]}),l.jsxs("button",{type:"button",onClick:de,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:[l.jsx(bt,{className:"h-3 w-3"})," Add Middleware"]})]}),U.length===0&&l.jsxs("div",{className:"flex flex-col items-center gap-2 py-8 rounded-lg border border-dashed border-[var(--border)] text-center",children:[l.jsx(qa,{className:"h-6 w-6 text-[var(--text-faint)]",strokeWidth:1.5}),l.jsx("p",{className:"text-[10px] text-[var(--text-faint)] italic",children:'No middleware. Click "Add Middleware" to get started.'})]}),l.jsx("div",{className:"space-y-2",children:U.map((Y,W)=>l.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-[var(--border)] bg-[var(--bg-overlay)] px-3 py-2",children:[l.jsxs("div",{className:"flex flex-col gap-0.5",children:[l.jsx("button",{type:"button",onClick:()=>ve(W,-1),disabled:W===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:l.jsx($a,{className:"h-3 w-3 rotate-180"})}),l.jsx("button",{type:"button",onClick:()=>ve(W,1),disabled:W===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:l.jsx($a,{className:"h-3 w-3"})})]}),l.jsx("span",{className:"text-[10px] text-[var(--text-faint)] w-4 text-center shrink-0",children:W+1}),l.jsx("input",{value:Y.name,onChange:re=>ge(W,re.target.value),placeholder:"e.g. authenticateToken",className:`${Ee} flex-1 font-mono`}),l.jsx("button",{type:"button",onClick:()=>pe(W),className:"text-[var(--text-faint)] hover:text-red-400 transition-colors hover:cursor-pointer shrink-0",title:"Remove",children:l.jsx(Ot,{className:"h-3.5 w-3.5"})})]},W))})]})]}),l.jsxs("div",{className:"flex items-center justify-between border-t border-[var(--border)] px-6 py-4",children:[l.jsxs("p",{className:"text-[10px] text-[var(--text-faint)]",children:["ID: ",l.jsx("span",{className:"font-mono",children:n.id})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.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"}),l.jsxs("button",{type:"button",onClick:_e,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?l.jsx(tt,{className:"h-3.5 w-3.5 animate-spin"}):l.jsx(yt,{className:"h-3.5 w-3.5"}),f?"Saving…":"Save Changes"]})]})]})]})})}function A3({onInspect:n,onViewTraces:r}){const[o,i]=w.useState(null),[u,f]=w.useState(!0),[h,m]=w.useState(!1),[p,x]=w.useState(!1),[g,y]=w.useState(null),[v,j]=w.useState(""),[C,_]=w.useState("list"),[T,M]=w.useState(""),[B,L]=w.useState(!1),[D,H]=w.useState(null),Z=w.useCallback(async(te=!1)=>{te?m(!0):f(!0),y(null);try{i(await v3())}catch(se){y(se.message)}finally{f(!1),m(!1)}},[]);w.useEffect(()=>{Z()},[Z]);const X=async()=>{x(!0),j("");try{i(await j3())}catch(te){j(te.message)}finally{x(!1)}},ce=(te,se)=>{i(E=>E&&{...E,endpoints:E.endpoints.map(q=>q.id===te?{...q,...se}:q)})},F=(te,se)=>{i(se)},J=(o?.endpoints??[]).filter(te=>!T||te.path.toLowerCase().includes(T.toLowerCase())||te.method.toLowerCase().includes(T.toLowerCase())||(te.handlerName??"").toLowerCase().includes(T.toLowerCase())),ae=new Map;for(const te of J){const se="/"+(te.path.split("/")[1]??"");ae.has(se)||ae.set(se,[]),ae.get(se).push(te)}return l.jsxs("div",{className:"flex min-h-full w-full flex-col",children:[l.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-6 py-5",children:[l.jsx("div",{className:"flex items-center gap-3",children:l.jsxs("div",{children:[l.jsx("h1",{className:"text-[15px] font-medium text-[var(--text-primary)] leading-none",children:o?.project?.name??"Model"}),l.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"})]})}),l.jsxs("div",{className:"flex items-center gap-2",children:[o&&l.jsx("div",{className:"flex items-center gap-1 rounded-xl border border-[var(--border)] bg-[var(--bg-overlay)] p-1",children:["list","graph"].map(te=>l.jsxs("button",{type:"button",onClick:()=>_(te),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===te?"bg-blue-500/15 text-blue-400 shadow-sm":"text-[var(--text-faint)] hover:text-[var(--text-muted)]"}`,children:[te==="list"?l.jsx(Cm,{className:"h-3.5 w-3.5",strokeWidth:2}):l.jsx(Kd,{className:"h-3.5 w-3.5",strokeWidth:2}),te.charAt(0).toUpperCase()+te.slice(1)]},te))}),l.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:l.jsx(pl,{className:`h-3.5 w-3.5 ${h?"animate-spin":""}`,strokeWidth:2})}),l.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?l.jsx(tt,{className:"h-3.5 w-3.5 animate-spin",strokeWidth:2}):l.jsx(Ai,{className:"h-3.5 w-3.5",strokeWidth:2}),p?"Scanning…":"Re-scan"]}),l.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:[l.jsx(bt,{className:"h-3.5 w-3.5",strokeWidth:2}),"Add Endpoint"]})]})]}),v&&l.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:[l.jsx(Dt,{className:"h-3.5 w-3.5 shrink-0",strokeWidth:2}),v,l.jsx("button",{type:"button",onClick:()=>j(""),className:"ml-auto hover:cursor-pointer",children:l.jsx(St,{className:"h-3.5 w-3.5",strokeWidth:2})})]}),l.jsxs("div",{className:"flex flex-1 flex-col",children:[u&&l.jsx("div",{className:"space-y-2 p-6",children:[1,2,3,4].map(te=>l.jsx("div",{className:"h-10 animate-pulse rounded-lg border border-[var(--border)] bg-[var(--bg-overlay)]",style:{opacity:1-te*.18}},te))}),!u&&g&&l.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:[l.jsx(Dt,{className:"h-8 w-8 text-red-400",strokeWidth:2}),l.jsx("p",{className:"text-sm text-red-300",children:g}),l.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&&!g&&!o&&l.jsx(C3,{onScan:X,scanning:p,error:v}),!u&&!g&&o&&C==="graph"&&l.jsx("div",{className:"flex-1 overflow-auto p-6",children:l.jsx(_3,{endpoints:J})}),!u&&!g&&o&&C==="list"&&l.jsxs("div",{className:"flex flex-1 flex-col",children:[l.jsxs("div",{className:"flex items-center gap-3 border-b border-[var(--border)] px-6 py-3",children:[l.jsx("input",{value:T,onChange:te=>M(te.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&&l.jsx("button",{type:"button",onClick:()=>M(""),className:"text-[var(--text-faint)] hover:text-[var(--text-secondary)] hover:cursor-pointer",children:l.jsx(St,{className:"h-3.5 w-3.5",strokeWidth:2})}),l.jsxs("span",{className:"ml-auto text-[10px] text-[var(--text-faint)]",children:[J.length," endpoint",J.length!==1?"s":""]})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto max-h-[calc(100vh-170px)] divide-y divide-[var(--border)]",children:[Array.from(ae.entries()).map(([te,se])=>l.jsx(k3,{prefix:te,endpoints:se,onUpdate:ce,onInspect:E=>n?.(E),onViewTraces:r?E=>r({endpointPath:E}):void 0,onEdit:E=>H(E)},te)),J.length===0&&l.jsxs("div",{className:"flex flex-col items-center gap-2 py-12 text-center",children:[l.jsxs("p",{className:"text-sm text-[var(--text-muted)]",children:['No endpoints match "',T,'"']}),l.jsx("button",{type:"button",onClick:()=>M(""),className:"text-xs text-blue-400 hover:text-blue-300 transition-colors hover:cursor-pointer",children:"Clear filter"})]})]}),l.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(),l.jsx("span",{className:"ml-auto",children:l.jsx("button",{type:"button",onClick:()=>Z(!0),className:"text-[var(--text-faint)] hover:text-[var(--text-secondary)] transition-colors hover:cursor-pointer",children:"Refresh"})})]})]})]}),l.jsx(T3,{open:B,onClose:()=>L(!1),onCreated:F}),D&&l.jsx(M3,{endpoint:D,onClose:()=>H(null),onSaved:te=>{i(se=>se&&{...se,endpoints:se.endpoints.map(E=>E.id===te.id?te:E)}),H(null)}})]})}const hm={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 R3(n){return hm[n.toUpperCase()]??hm.GET}function Wd({method:n,size:r="md"}){const o=R3(n);return l.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 xm(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 us({children:n,className:r=""}){return l.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 l.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:[l.jsx(n,{className:"h-[15px] w-[15px] text-blue-400",strokeWidth:2}),l.jsx("span",{className:"text-[11px] font-semibold tracking-wider text-[var(--text-faint)] uppercase",children:r}),o!==void 0&&l.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&&l.jsx("div",{className:"ml-auto",children:i})]})}function z3({endpoint:n}){const[r,o]=w.useState(null),[i,u]=w.useState(1),[f,h]=w.useState(!1),[m,p]=w.useState(""),x=w.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(w.useEffect(()=>{x()},[x]),!n.source)return null;const g=n.source.file.split(/[/\\]/).slice(-3).join("/"),y=r?r.split(`
|
|
384
|
-
`):[],v=n.source.line-i;return l.jsxs(us,{children:[l.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:[l.jsx(Qd,{className:"h-[15px] w-[15px] text-blue-400",strokeWidth:2}),l.jsx("span",{className:"text-[11px] font-semibold tracking-wider text-[var(--text-faint)] uppercase",children:"Source"}),l.jsx("span",{className:"ml-2 font-mono text-[11px] text-[var(--text-muted)] truncate",children:g}),l.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]}),l.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:l.jsx(pl,{className:`h-3 w-3 ${f?"animate-spin":""}`,strokeWidth:2})})]}),l.jsxs("div",{className:"relative bg-[var(--sidebar-bg)]",children:[f&&l.jsxs("div",{className:"flex items-center gap-2 px-4 py-4 text-[11px] text-[var(--text-muted)]",children:[l.jsx(tt,{className:"h-3.5 w-3.5 animate-spin",strokeWidth:2})," Loading source…"]}),m&&l.jsxs("div",{className:"flex items-start gap-2 px-4 py-3 text-[11px] text-red-400",children:[l.jsx(Dt,{className:"h-3.5 w-3.5 mt-0.5 shrink-0",strokeWidth:2}),l.jsxs("span",{children:["Source unavailable — ",m]})]}),r&&!f&&l.jsx("div",{className:"overflow-auto max-h-[340px]",children:l.jsx("table",{className:"w-full border-collapse",children:l.jsx("tbody",{children:y.map((j,C)=>{const _=i+C,T=C===v;return l.jsxs("tr",{className:T?"bg-blue-500/[0.08]":"hover:bg-[var(--bg-overlay-md)]",children:[l.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:_}),l.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 O3({endpoint:n}){const[r,o]=w.useState([]),[i,u]=w.useState(!0),[f,h]=w.useState("");w.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 m={ts:"text-blue-400",tsx:"text-cyan-400",js:"text-amber-400",jsx:"text-amber-300",json:"text-emerald-400"};return l.jsxs(us,{children:[l.jsx(Ar,{icon:Sm,label:"Related Files",count:!i&&!f?r.length:void 0}),l.jsxs("div",{className:"divide-y divide-[var(--border)]",children:[i&&l.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 text-[11px] text-[var(--text-muted)]",children:[l.jsx(tt,{className:"h-3.5 w-3.5 animate-spin",strokeWidth:2})," Resolving files…"]}),!i&&f&&l.jsxs("div",{className:"flex items-start gap-2 px-4 py-3 text-[11px] text-red-400",children:[l.jsx(Dt,{className:"h-3.5 w-3.5 mt-0.5 shrink-0",strokeWidth:2}),l.jsxs("span",{children:["Could not resolve — ",f]})]}),!i&&!f&&r.length===0&&l.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(/[/\\]/),g=x.pop()??p,y=x.slice(-2).join("/"),v=g.split(".").pop()??"",j=m[v]??"text-[var(--text-faint)]";return l.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5 hover:bg-[var(--bg-overlay-md)] transition-colors",children:[l.jsx(Li,{className:`h-[15px] w-[15px] shrink-0 ${j}`,strokeWidth:2}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("p",{className:"text-[13px] text-[var(--text-secondary)] truncate",children:g}),y&&l.jsx("p",{className:"text-[10px] text-[var(--text-faint)] truncate font-mono",children:y})]}),l.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 pm({endpoint:n}){const[r,o]=w.useState("fake"),[i,u]=w.useState(""),[f,h]=w.useState({}),[m,p]=w.useState(!1),[x,g]=w.useState(null),[y,v]=w.useState("http://localhost:3000"),[j,C]=w.useState([]),[_,T]=w.useState(null),[M,B]=w.useState(!1);w.useEffect(()=>{fetch("/api/model/environments").then(J=>J.ok?J.json():null).then(J=>{if(!J)return;C(J.environments??[]);const ae=J.defaultEnvironment??J.environments?.find(se=>se.default)?.name??J.environments?.[0]?.name??null;T(ae);const te=(J.environments??[]).find(se=>se.name===ae);te&&v(te.baseUrl)}).catch(()=>{}).finally(()=>B(!0))},[]);const L=n.requestBody?.fields??{},D=(n.security?.length??0)>0,H=["POST","PUT","PATCH"].includes(n.method.toUpperCase());w.useEffect(()=>{g(null),h({})},[n.id]);const Z=()=>{const J={};for(const[ae,te]of Object.entries(L))J[ae]=xm(ae,te.type,te.format);return J},X=()=>{const J={};for(const[ae,te]of Object.entries(L)){const se=f[ae]??"";se&&(te.type==="integer"||te.type==="number"?J[ae]=Number(se):te.type==="boolean"?J[ae]=se.toLowerCase()==="true":J[ae]=se)}return J},ce=async()=>{p(!0),g(null);const J=Date.now();try{const ae=r==="fake"?Z():X(),te={};(H||r==="fake")&&(te["Content-Type"]="application/json"),i&&(te.Authorization=`Bearer ${i}`);const se=`${y}${n.path}`,E=await fetch(se,{method:n.method.toUpperCase(),headers:te,body:H?JSON.stringify(ae):void 0}),q=Date.now()-J;let k;try{k=await E.json()}catch{k=await E.text().catch(()=>"(no body)")}g({status:E.status,body:k,durationMs:q})}catch(ae){g({status:0,body:null,durationMs:Date.now()-J,error:ae.message})}finally{p(!1)}},F=x&&x.status>=200&&x.status<300;return l.jsxs("div",{className:"flex flex-col gap-4",children:[l.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-[var(--border)] bg-[var(--bg-overlay)] px-3 py-2",children:[l.jsx(Wd,{method:n.method,size:"sm"}),l.jsx("code",{className:"font-mono text-[12px] text-[var(--text-secondary)] truncate",children:n.path})]}),l.jsx("p",{className:"hidden",children:M}),l.jsxs("div",{className:"flex items-center gap-2 rounded-xl border border-[var(--border)] bg-[var(--bg-overlay)] p-1",children:[l.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:[l.jsx(ea,{className:"h-3 w-3 shrink-0",strokeWidth:2}),"Fake Data"]}),l.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:[l.jsx(_d,{className:"h-3 w-3 shrink-0",strokeWidth:2}),"Real Data"]})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-[var(--text-faint)]",children:"Base URL"}),j.length>0?l.jsx("div",{className:"rounded-lg border border-[var(--border)] bg-[var(--bg-overlay)] overflow-hidden",children:j.map(J=>{const ae=_===J.name;return l.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 ${ae?"bg-blue-500/10":"hover:bg-[var(--bg-overlay-md)]"}`,style:{borderTop:"1px solid var(--border)"},children:[l.jsx("div",{className:"flex h-4 w-4 shrink-0 items-center justify-center rounded-full border-2 transition-colors",style:{borderColor:ae?"#60a5fa":"var(--border)",backgroundColor:ae?"#60a5fa22":"transparent"},children:ae&&l.jsx(yt,{className:"h-2.5 w-2.5 text-blue-400",strokeWidth:3})}),l.jsx(vs,{className:`h-3 w-3 shrink-0 ${ae?"text-blue-400":"text-[var(--text-faint)]"}`,strokeWidth:2}),l.jsx("span",{className:`text-[11px] w-14 shrink-0 font-medium ${ae?"text-blue-400":"text-[var(--text-muted)]"}`,children:J.name}),l.jsx("span",{className:"font-mono text-[11px] text-[var(--text-faint)] truncate",children:J.baseUrl})]},J.name)})}):l.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"})]}),(D||r==="real")&&l.jsxs("label",{className:"flex flex-col gap-1.5",children:[l.jsxs("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-[var(--text-faint)] flex items-center gap-1",children:[l.jsx(Em,{className:"h-3 w-3",strokeWidth:2})," Bearer Token"]}),l.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&&l.jsxs("div",{children:[l.jsxs("p",{className:"mb-2 text-[10px] font-semibold uppercase tracking-wider text-[var(--text-faint)] flex items-center gap-1.5",children:[l.jsx(ea,{className:"h-3 w-3 text-blue-400",strokeWidth:2})," Auto-generated body"]}),l.jsx("div",{className:"space-y-1",children:Object.entries(L).map(([J,ae])=>l.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-[var(--border)] bg-[var(--bg-overlay)] px-3 py-2",children:[l.jsx("span",{className:"text-[11px] text-[var(--text-secondary)] w-20 truncate shrink-0",children:J}),l.jsx("span",{className:"text-[11px] text-[var(--text-faint)] shrink-0",children:ae.type}),l.jsx("span",{className:"ml-auto font-mono text-[11px] text-blue-400/80 truncate",children:xm(J,ae.type,ae.format)})]},J))})]}),r==="real"&&Object.keys(L).length>0&&l.jsxs("div",{children:[l.jsxs("p",{className:"mb-2 text-[10px] font-semibold uppercase tracking-wider text-[var(--text-faint)] flex items-center gap-1.5",children:[l.jsx(_d,{className:"h-3 w-3 text-blue-400",strokeWidth:2})," Request body"]}),l.jsx("div",{className:"space-y-2",children:Object.entries(L).map(([J,ae])=>l.jsxs("label",{className:"flex flex-col gap-1",children:[l.jsxs("span",{className:"text-[11px] text-[var(--text-secondary)]",children:[J,ae.required&&l.jsx("span",{className:"ml-1 text-[10px] text-rose-400",children:"*"})]}),l.jsx("input",{value:f[J]??"",onChange:te=>h(se=>({...se,[J]:te.target.value})),placeholder:`${ae.type}${ae.format?` (${ae.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&&!H&&l.jsxs("p",{className:"text-[12px] text-[var(--text-faint)] italic",children:["No body required for ",n.method.toUpperCase()," requests."]}),l.jsxs("button",{type:"button",onClick:ce,disabled:m,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:[m?l.jsx(tt,{className:"h-[15px] w-[15px] animate-spin",strokeWidth:2}):l.jsx(Ed,{className:"h-[15px] w-[15px]",strokeWidth:2}),m?"Sending…":`Run ${r==="fake"?"with Fake Data":"with Real Data"}`]}),x&&l.jsxs("div",{className:`rounded-lg border overflow-hidden ${F?"border-emerald-500/25 bg-emerald-500/[0.05]":"border-red-500/25 bg-red-500/[0.05]"}`,children:[l.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b border-[var(--border)]",children:[F?l.jsx(yt,{className:"h-[15px] w-[15px] text-emerald-400",strokeWidth:2}):l.jsx(Dt,{className:"h-[15px] w-[15px] text-red-400",strokeWidth:2}),l.jsx("span",{className:`text-[12px] font-medium ${F?"text-emerald-400":"text-red-400"}`,children:x.status>0?x.status:"Error"}),l.jsxs("span",{className:"text-[11px] text-[var(--text-faint)]",children:[x.durationMs,"ms"]}),l.jsx("button",{type:"button",onClick:()=>g(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:l.jsx(St,{className:"h-3 w-3",strokeWidth:2})})]}),x.error&&l.jsx("p",{className:"px-3 py-2.5 text-[12px] text-red-400",children:x.error}),!x.error&&x.body!=null&&l.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 D3=({endpoint:n,onBack:r})=>{if(!n)return l.jsxs("div",{className:"flex min-h-full w-full flex-col items-center justify-center gap-5 text-center p-12",children:[l.jsxs("div",{className:"relative flex h-16 w-16 items-center justify-center",children:[l.jsx("div",{className:"absolute inset-0 rounded-full bg-blue-500/10 blur-xl"}),l.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:l.jsx(Qd,{className:"h-7 w-7",strokeWidth:2})})]}),l.jsxs("div",{children:[l.jsx("p",{className:"text-[13.5px] font-medium text-[var(--text-primary)]",children:"No endpoint selected"}),l.jsxs("p",{className:"mt-1 text-[12px] text-[var(--text-muted)]",children:["Click ",l.jsx("span",{className:"text-blue-400 font-medium",children:"INSPECT"})," on any endpoint in the Model view."]})]}),l.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:[l.jsx(i0,{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,m=(n.middleware?.length??0)>0,p=n.source?n.source.file.split(/[/\\]/).slice(-3).join("/")+":"+n.source.line:null;return l.jsxs("div",{className:"flex min-h-full w-full",children:[l.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[l.jsxs("div",{className:"flex items-center gap-4 border-b border-[var(--border)] px-6 py-5",children:[l.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:l.jsx(i0,{className:"h-[15px] w-[15px]",strokeWidth:2})}),l.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[l.jsx(Wd,{method:n.method}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("h1",{className:"text-[13.5px] font-medium text-[var(--text-primary)] leading-none truncate",children:n.path}),n.handlerName&&l.jsx("p",{className:"mt-0.5 text-[11px] text-[var(--text-muted)] truncate",children:n.handlerName})]})]}),l.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[h&&l.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:[l.jsx(qa,{className:"h-[15px] w-[15px]",strokeWidth:2}),n.security[0].scheme]}),p&&l.jsx("span",{className:"hidden sm:block font-mono text-[11px] text-[var(--text-faint)] truncate max-w-[200px]",children:p})]})]}),l.jsxs("div",{className:"flex-1 overflow-auto p-6 space-y-4",children:[l.jsxs(us,{children:[l.jsx(Ar,{icon:Sm,label:"Details"}),l.jsxs("div",{className:"p-4 grid grid-cols-2 sm:grid-cols-3 gap-4",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-[var(--text-faint)] mb-1.5",children:"Method"}),l.jsx(Wd,{method:n.method})]}),l.jsxs("div",{children:[l.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-[var(--text-faint)] mb-1.5",children:"Path"}),l.jsx("code",{className:"font-mono text-[12px] text-[var(--text-secondary)]",children:n.path})]}),n.handlerName&&l.jsxs("div",{children:[l.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-[var(--text-faint)] mb-1.5",children:"Handler"}),l.jsx("code",{className:"font-mono text-[12px] text-[var(--text-muted)]",children:n.handlerName})]}),n.source&&l.jsxs("div",{children:[l.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-[var(--text-faint)] mb-1.5",children:"Source"}),l.jsx("code",{className:"font-mono text-[11px] text-[var(--text-faint)]",children:p})]}),n.requestBody?.contentType&&l.jsxs("div",{children:[l.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-[var(--text-faint)] mb-1.5",children:"Content-Type"}),l.jsx("code",{className:"font-mono text-[11px] text-[var(--text-faint)]",children:n.requestBody.contentType})]}),m&&l.jsxs("div",{className:"col-span-2 sm:col-span-3",children:[l.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-[var(--text-faint)] mb-1.5",children:"Middleware"}),l.jsx("div",{className:"flex flex-wrap gap-1.5",children:n.middleware.map((x,g)=>l.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},g))})]})]})]}),u&&l.jsxs(us,{children:[l.jsx(Ar,{icon:_d,label:"Request Body",count:Object.keys(o).length}),l.jsxs("div",{className:"p-4 space-y-1.5",children:[l.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:[l.jsx("span",{className:"w-28",children:"Field"}),l.jsx("span",{className:"w-16",children:"Type"}),l.jsx("span",{children:"Format"}),l.jsx("span",{className:"ml-auto",children:"Required"})]}),Object.entries(o).map(([x,g])=>l.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:[l.jsx("span",{className:"w-28 shrink-0 font-mono text-[12px] text-[var(--text-primary)] truncate",children:x}),l.jsx("span",{className:"w-16 shrink-0 text-[11px] text-blue-400",children:g.type}),l.jsx("span",{className:"flex-1 text-[11px] text-[var(--text-faint)]",children:g.format??"—"}),g.required?l.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"}):l.jsx("span",{className:"ml-auto shrink-0 text-[10px] text-[var(--text-faint)]",children:"optional"})]},x))]})]}),f&&l.jsxs(us,{children:[l.jsx(Ar,{icon:yt,label:"Responses",count:Object.keys(i).length}),l.jsx("div",{className:"p-4 space-y-1.5",children:Object.entries(i).map(([x,g])=>{const y=x.startsWith("2");return l.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:[l.jsx("span",{className:`shrink-0 w-10 font-mono text-[12px] font-medium ${y?"text-emerald-400":"text-red-400"}`,children:x}),g.schema&&l.jsx("div",{className:"flex flex-wrap gap-1",children:Object.keys(g.schema).map(v=>l.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)})})]}),l.jsx(z3,{endpoint:n}),l.jsx(O3,{endpoint:n}),l.jsxs(us,{className:"lg:hidden",children:[l.jsx(Ar,{icon:ea,label:"Simulate Endpoint"}),l.jsx("div",{className:"p-4",children:l.jsx(pm,{endpoint:n})})]})]})]}),l.jsxs("aside",{className:"hidden lg:flex w-[400px] shrink-0 flex-col border-l border-[var(--border)] bg-[var(--sidebar-bg)]",children:[l.jsxs("div",{className:"flex items-center gap-2.5 border-b border-[var(--border)] px-5 py-[18px]",children:[l.jsx(ea,{className:"h-[15px] w-[15px] text-blue-400",strokeWidth:2}),l.jsx("span",{className:"text-[13.5px] font-medium text-[var(--text-primary)]",children:"Simulate Endpoint"})]}),l.jsx("div",{className:"flex-1 overflow-y-auto p-5",children:l.jsx(pm,{endpoint:n})})]})]})};function H3(){return l.jsxs("div",{className:"p-8",children:[l.jsx("h1",{className:"text-2xl font-semibold text-white",children:"Agents"}),l.jsx("p",{className:"mt-4 text-zinc-400",children:"This is under developnment."})]})}function U3(){return l.jsxs("div",{className:"p-8",children:[l.jsx("h1",{className:"text-2xl font-semibold text-white",children:"Tools"}),l.jsx("p",{className:"mt-4 text-zinc-400",children:"This is the Tools page."})]})}function B3(){return l.jsxs("div",{className:"p-8",children:[l.jsx("h1",{className:"text-2xl font-semibold text-white",children:"Context"}),l.jsx("p",{className:"mt-4 text-zinc-400",children:"This is the Context page."})]})}const bf="/api/memory";async function mm(){const n=await fetch(bf);if(!n.ok)throw new Error(`Failed to fetch memory (${n.status})`);return n.json()}async function $3(){try{const n=await fetch("/api/model");return n.ok?(await n.json())?.environments??[]:[]}catch{return[]}}async function q3(n,r){const o=await fetch(bf,{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 L3(n){const r=await fetch(bf,{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 gm(n){return typeof n=="object"&&n!==null?JSON.stringify(n):String(n)}function Y3(n){const r=n.indexOf(":");return r!==-1?n.slice(r+1):n}function Ni(n){return n.includes(":")?n.split(":")[0]:"global"}function V3({value:n}){const[r,o]=w.useState(!1),i=n.length>200?n.slice(0,200)+"…":n;return l.jsx("div",{onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),className:"cursor-pointer max-w-[300px]",children:r?l.jsx("p",{className:"text-[12px] break-all transition-colors truncate",style:{color:"var(--text-secondary)"},children:i}):l.jsx("p",{className:"text-[12px] font-mono tracking-widest select-none",style:{color:"var(--text-faint)"},children:"••••••"})})}function G3({onClose:n,onSave:r,defaultScope:o}){const[i,u]=w.useState(o?`${o}:`:""),[f,h]=w.useState(""),[m,p]=w.useState(!1),[x,g]=w.useState(""),y=w.useRef(null);w.useEffect(()=>{y.current?.focus()},[]);const v=async j=>{if(j.preventDefault(),!i.trim()){g("Key is required");return}if(f.trim()===""){g("Value is required");return}p(!0),g("");try{await r(i.trim(),f.trim()),n()}catch(C){g(C.message??"An error occurred"),p(!1)}};return l.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:l.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:[l.jsxs("div",{className:"mb-5 flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2.5",children:[l.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:l.jsx(bt,{className:"h-[15px] w-[15px] text-blue-400",strokeWidth:2})}),l.jsx("h2",{className:"text-[13.5px] font-medium",style:{color:"var(--text-primary)"},children:"Add Memory Entry"})]}),l.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:l.jsx(St,{className:"h-[15px] w-[15px]",strokeWidth:2})})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"mb-1.5 block text-[11px] font-semibold uppercase tracking-wider",style:{color:"var(--text-faint)"},children:"Key / Identifier"}),l.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)"}}),l.jsxs("p",{className:"mt-1.5 text-[10px]",style:{color:"var(--text-faint)"},children:["Prefix with"," ",l.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."," ",l.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"," ",l.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"}),"."]})]}),l.jsxs("div",{children:[l.jsx("label",{className:"mb-1.5 block text-[11px] font-semibold uppercase tracking-wider",style:{color:"var(--text-faint)"},children:"Value"}),l.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&&l.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:l.jsx("p",{className:"text-[12px] text-red-400",children:x})}),l.jsxs("div",{className:"flex items-center justify-end gap-2 pt-1",children:[l.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"}),l.jsxs("button",{onClick:v,disabled:m,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:[m&&l.jsx(tt,{className:"h-[15px] w-[15px] animate-spin",strokeWidth:2}),m?"Saving…":"Save Entry"]})]})]})]})})}function X3({onClose:n,onSave:r}){const[o,i]=w.useState(""),[u,f]=w.useState(""),h=w.useRef(null);w.useEffect(()=>{h.current?.focus()},[]);const m=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 l.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:l.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:[l.jsxs("div",{className:"mb-5 flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2.5",children:[l.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:l.jsx(bt,{className:"h-[15px] w-[15px] text-blue-400",strokeWidth:2})}),l.jsx("h2",{className:"text-[13.5px] font-medium",style:{color:"var(--text-primary)"},children:"Add Scope"})]}),l.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:l.jsx(St,{className:"h-[15px] w-[15px]",strokeWidth:2})})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"mb-1.5 block text-[11px] font-semibold uppercase tracking-wider",style:{color:"var(--text-faint)"},children:"Scope Name"}),l.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)"}}),l.jsxs("p",{className:"mt-1.5 text-[10px]",style:{color:"var(--text-faint)"},children:["Memory entries under this scope will be keyed as"," ",l.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&&l.jsx("p",{className:"text-[12px] text-red-400",children:u}),l.jsxs("div",{className:"flex items-center justify-end gap-2 pt-1",children:[l.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"}),l.jsxs("button",{onClick:m,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:[l.jsx(yt,{className:"h-[14px] w-[14px]",strokeWidth:2})," Create Scope"]})]})]})]})})}const Z3={workflow:Cd,global:_m},W3={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)]"}},Q3={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 db(n){return W3[n]??Q3}function K3({scope:n,active:r,onClick:o}){const i=db(n.id),u=Z3[n.id]??Ei;return l.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:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("div",{className:`flex h-7 w-7 items-center justify-center rounded-lg border ${i.border} bg-[var(--bg-overlay)]`,children:l.jsx(u,{className:`h-[14px] w-[14px] ${i.text}`,strokeWidth:2})}),r&&l.jsx("div",{className:`flex h-4 w-4 items-center justify-center rounded-full ${i.activeBg}`,children:l.jsx(yt,{className:`h-2.5 w-2.5 ${i.text}`,strokeWidth:3})})]}),l.jsxs("div",{children:[l.jsx("p",{className:`text-[12px] font-medium ${i.text}`,children:n.label}),l.jsxs("p",{className:"text-[10px]",style:{color:"var(--text-faint)"},children:[n.count," ",n.count===1?"entry":"entries"]})]})]})}function J3(){const[n,r]=w.useState([]),[o,i]=w.useState([]),[u,f]=w.useState([]),[h,m]=w.useState(null),[p,x]=w.useState(!0),[g,y]=w.useState(!1),[v,j]=w.useState(null),[C,_]=w.useState(""),[T,M]=w.useState(!1),[B,L]=w.useState(!1),[D,H]=w.useState(null),Z=w.useCallback(async(z=!1)=>{z?y(!0):x(!0),j(null);try{const[O,N]=await Promise.all([mm(),$3()]);r(O),i(N)}catch(O){j(O.message??"Could not load memory data. Is `jetic dev` running?")}finally{x(!1),y(!1)}},[]);w.useEffect(()=>{Z()},[Z]);const X=async z=>{H(z);try{await L3(z),r(O=>O.filter(N=>N.key!==z))}catch(O){j(O.message??"Failed to delete entry")}finally{H(null)}},ce=async(z,O)=>{await q3(z,O);const N=await mm();r(N)},F=Array.from(new Set(n.map(z=>Ni(z.key)))),J=z=>n.filter(O=>Ni(O.key)===z).length,ae=[{id:"workflow",label:"Workflow",count:J("workflow"),isBuiltIn:!0},...o.map(z=>({id:`environment.${z.name}`,label:z.name,count:J(`environment.${z.name}`),isBuiltIn:!0}))],te=new Set(["workflow",...o.map(z=>`environment.${z.name}`)]),se=F.filter(z=>!te.has(z)&&z!=="global"),E=Array.from(new Set([...u,...se])),q=[...ae,...E.map(z=>({id:z,label:z.charAt(0).toUpperCase()+z.slice(1),count:J(z),isCustom:!0})),{id:"global",label:"Global",count:J("global"),isBuiltIn:!0}],k=h?n.filter(z=>Ni(z.key)===h):n,U=k.filter(z=>!C||z.key.toLowerCase().includes(C.toLowerCase())||gm(z.value).toLowerCase().includes(C.toLowerCase()));return l.jsxs("div",{className:"flex h-full w-full flex-col overflow-hidden",children:[l.jsxs("div",{className:"flex items-center justify-between px-6 py-5",style:{borderBottom:"1px solid var(--border)"},children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-[15px] font-medium leading-none",style:{color:"var(--text-primary)"},children:"Memory"}),l.jsx("p",{className:"mt-0.5 text-[11px]",style:{color:"var(--text-muted)"},children:p?"Loading…":h?`${U.length} entries in ${h}`:`${n.length} entr${n.length===1?"y":"ies"} stored`})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("button",{onClick:()=>Z(!0),disabled:g||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:l.jsx(pl,{className:`h-[15px] w-[15px] ${g?"animate-spin":""}`,strokeWidth:2})}),l.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:[l.jsx(bt,{className:"h-[15px] w-[15px]",strokeWidth:2}),"Add Entry"]})]})]}),l.jsxs("div",{className:"flex flex-1 flex-col gap-4 overflow-y-auto p-6",children:[!p&&!v&&l.jsxs("div",{children:[l.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[l.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-faint)"},children:"Scopes"}),l.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:[l.jsx(bt,{className:"h-3 w-3",strokeWidth:2})," Add Scope"]})]}),l.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5",children:q.map(z=>l.jsx(K3,{scope:z,active:h===z.id,onClick:()=>m(O=>O===z.id?null:z.id)},z.id))}),h&&l.jsx("button",{type:"button",onClick:()=>m(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&&l.jsx("div",{style:{borderTop:"1px solid var(--border)"}}),!p&&n.length>0&&l.jsxs("div",{className:"relative",children:[l.jsx(kd,{className:"absolute left-3 top-1/2 h-[15px] w-[15px] -translate-y-1/2",strokeWidth:2,style:{color:"var(--text-faint)"}}),l.jsx("input",{value:C,onChange:z=>_(z.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&&l.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:l.jsx(St,{className:"h-3 w-3",strokeWidth:2})})]}),p&&l.jsx("div",{className:"space-y-3",children:[1,2,3].map(z=>l.jsx("div",{className:"h-14 animate-pulse rounded-lg",style:{border:"1px solid var(--border)",backgroundColor:"var(--bg-overlay)",opacity:1-z*.2}},z))}),!p&&v&&l.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:[l.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:l.jsx(Ei,{className:"h-6 w-6",strokeWidth:2})}),l.jsxs("div",{children:[l.jsx("p",{className:"text-[13.5px] font-medium text-red-300",children:"Could not load memory"}),l.jsx("p",{className:"mt-1 text-[11px] text-red-500/70",children:v})]}),l.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&&l.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-4 py-20 text-center",children:[l.jsxs("div",{className:"relative flex h-16 w-16 items-center justify-center",children:[l.jsx("div",{className:"absolute inset-0 rounded-full bg-blue-500/10 blur-xl"}),l.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:l.jsx(Ei,{className:"h-7 w-7",strokeWidth:2})})]}),l.jsxs("div",{children:[l.jsx("p",{className:"text-[13.5px] font-medium",style:{color:"var(--text-secondary)"},children:"Memory is empty"}),l.jsxs("p",{className:"mt-1 text-[12px]",style:{color:"var(--text-faint)"},children:["Add your first entry or run"," ",l.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."]})]}),l.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:[l.jsx(bt,{className:"h-[15px] w-[15px]",strokeWidth:2}),"Add Entry"]})]}),!p&&!v&&n.length>0&&h&&U.length===0&&!C&&l.jsxs("div",{className:"flex flex-col items-center gap-3 py-12 text-center",children:[l.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:l.jsx(Ei,{className:"h-[15px] w-[15px]",strokeWidth:2,style:{color:"var(--text-faint)"}})}),l.jsxs("p",{className:"text-[13px]",style:{color:"var(--text-muted)"},children:["No entries in ",l.jsx("code",{className:"text-blue-400",children:h})," scope"]}),l.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:[l.jsx(bt,{className:"h-[14px] w-[14px]",strokeWidth:2})," Add to ",h]})]}),!p&&!v&&n.length>0&&C&&U.length===0&&l.jsxs("div",{className:"flex flex-col items-center gap-3 py-12 text-center",children:[l.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:l.jsx(kd,{className:"h-[15px] w-[15px]",strokeWidth:2,style:{color:"var(--text-faint)"}})}),l.jsxs("p",{className:"text-[13px]",style:{color:"var(--text-muted)"},children:['No entries match "',C,'"']}),l.jsx("button",{onClick:()=>_(""),className:"text-[12px] text-blue-400 transition-colors hover:cursor-pointer hover:text-blue-300",children:"Clear filter"})]}),!p&&!v&&U.length>0&&l.jsx("div",{className:"overflow-y-auto rounded-lg",style:{border:"1px solid var(--border)",backgroundColor:"var(--bg-overlay)"},children:l.jsxs("table",{className:"w-full text-left whitespace-nowrap",children:[l.jsx("thead",{style:{borderBottom:"1px solid var(--border)",backgroundColor:"var(--bg-overlay)"},children:l.jsxs("tr",{children:[l.jsx("th",{className:"w-32 px-4 py-3 text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-faint)"},children:"Scope"}),l.jsx("th",{className:"w-48 px-4 py-3 text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-faint)"},children:"Key"}),l.jsx("th",{className:"px-4 py-3 text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-faint)"},children:"Value"}),l.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"})]})}),l.jsx("tbody",{children:U.map((z,O)=>{const N=Ni(z.key),R=Y3(z.key),V=gm(z.value),I=D===z.key,le=db(N);return l.jsxs("tr",{className:"group transition-colors hover:bg-[var(--bg-overlay-md)]",style:O!==0?{borderTop:"1px solid var(--border)"}:void 0,children:[l.jsx("td",{className:"px-4 py-3",children:l.jsx("span",{className:`inline-flex items-center rounded-full px-2.5 py-0.5 text-[10px] font-semibold uppercase tracking-wider border ${le.border} ${le.text}`,style:{backgroundColor:"var(--bg-overlay-md)"},children:N})}),l.jsx("td",{className:"px-4 py-3",children:l.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:R})}),l.jsx("td",{className:"px-4 py-3",children:l.jsx(V3,{value:V})}),l.jsx("td",{className:"px-4 py-3 text-right",children:l.jsx("button",{onClick:()=>X(z.key),disabled:I,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:I?l.jsx(tt,{className:"h-[15px] w-[15px] animate-spin",strokeWidth:2}):l.jsx(Ot,{className:"h-[15px] w-[15px]",strokeWidth:2})})})]},z.key)})})]})}),!p&&!v&&C&&U.length>0&&l.jsxs("p",{className:"text-center text-[11px]",style:{color:"var(--text-faint)"},children:["Showing ",U.length," of ",k.length," entries"]})]}),!p&&!v&&n.length>0&&l.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:[l.jsx(Yr,{className:"h-[15px] w-[15px]",strokeWidth:2}),"Data read from"," ",l.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"}),l.jsx("span",{className:"ml-auto",children:l.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&&l.jsx(G3,{onClose:()=>M(!1),onSave:ce,defaultScope:h??void 0}),B&&l.jsx(X3,{onClose:()=>L(!1),onSave:z=>f(O=>O.includes(z)?O:[...O,z])})]})}function F3(){return l.jsxs("div",{className:"p-8",children:[l.jsx("h1",{className:"text-2xl font-semibold text-white",children:"APIs"}),l.jsx("p",{className:"mt-4 text-zinc-400",children:"This is the APIs page."})]})}function I3(){return l.jsxs("div",{className:"p-8",children:[l.jsx("h1",{className:"text-2xl font-semibold text-white",children:"Email"}),l.jsx("p",{className:"mt-4 text-zinc-400",children:"This is the Email page."})]})}function P3(){return l.jsxs("div",{className:"p-8",children:[l.jsx("h1",{className:"text-2xl font-semibold text-white",children:"OAuth"}),l.jsx("p",{className:"mt-4 text-zinc-400",children:"This is the OAuth page."})]})}function e4(){return l.jsxs("div",{className:"p-8",children:[l.jsx("h1",{className:"text-2xl font-semibold text-white",children:"Webhooks"}),l.jsx("p",{className:"mt-4 text-zinc-400",children:"This is the Webhooks page."})]})}const bm={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 fb(n){return bm[n.toUpperCase()]??bm.GET}function t4({data:n}){const r=fb(n.method),o=n.passed?"#34d399":"#f87171",i=n.selected?"#60a5fa":n.passed===!0?"#166534":n.passed===!1?"#991b1b":"#3f3f46";return l.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:[l.jsx(dt,{type:"target",position:be.Top,style:{background:"transparent",border:"none"}}),l.jsxs("div",{style:{background:r.bg,borderBottom:`1px solid ${r.border}`,padding:"8px 12px",display:"flex",alignItems:"center",gap:8},children:[l.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}),l.jsx("span",{style:{fontSize:11,color:"#e4e4e7",fontFamily:"monospace",flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.path}),n.status>0&&l.jsx("span",{style:{fontSize:10,color:o,fontFamily:"monospace",fontWeight:600,flexShrink:0},children:n.status})]}),l.jsxs("div",{style:{padding:"8px 12px",display:"flex",flexDirection:"column",gap:5},children:[n.name&&l.jsx("span",{style:{fontSize:10,color:"#71717a",fontStyle:"italic"},children:n.name}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[l.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&&l.jsxs("span",{style:{fontSize:10,color:"#52525b"},children:[n.durationMs,"ms"]})]}),n.injectSpec&&Object.keys(n.injectSpec).length>0&&l.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:4,marginTop:2},children:Object.entries(n.injectSpec).map(([u,f])=>l.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)&&l.jsx("div",{style:{display:"flex",alignItems:"center",gap:4,marginTop:2},children:l.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:[l.jsx(In,{style:{width:9,height:9}}),n.conditionResult?n.conditionResult.passed?"cond passed":"cond FAILED":"has condition"]})}),n.error&&l.jsxs("span",{style:{fontSize:9,color:"#f87171",marginTop:2},children:["⚠ ",n.error]}),l.jsx("span",{style:{fontSize:9,color:"#3f3f46",marginTop:2},children:"Click for details"})]}),l.jsx(dt,{type:"source",position:be.Bottom,style:{background:"transparent",border:"none"}})]})}function n4({data:n}){const r=Object.entries(n.captured??{});return l.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:[l.jsx(dt,{type:"target",position:be.Top,style:{background:"transparent",border:"none"}}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:6},children:[l.jsx(Mi,{style:{width:12,height:12,color:"#a78bfa"}}),l.jsx("span",{style:{fontSize:10,fontWeight:600,color:"#a78bfa",letterSpacing:"0.06em"},children:"MEMORY"})]}),r.length===0&&l.jsx("span",{style:{fontSize:9,color:"#52525b"},children:"No variables captured"}),r.map(([o,i])=>l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:3},children:[l.jsx("span",{style:{fontSize:10,color:"#c4b5fd",fontFamily:"monospace"},children:o}),l.jsx(ds,{style:{width:10,height:10,color:"#52525b",flexShrink:0}}),l.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)),l.jsx(dt,{type:"source",position:be.Bottom,style:{background:"transparent",border:"none"}})]})}function a4({data:n}){return l.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:[l.jsx("span",{style:{fontSize:11,fontWeight:600,color:"#60a5fa",letterSpacing:"0.05em"},children:n.label}),l.jsx(dt,{type:"source",position:be.Bottom,style:{background:"transparent",border:"none"}})]})}function l4({data:n}){const r=n.phase==="done"&&n.failed===0?"#4ade80":n.phase==="aborted"?"#f87171":"#fbbf24";return l.jsxs("div",{style:{width:140,border:`1.5px solid ${r}40`,borderRadius:20,background:`${r}0d`,padding:"7px 14px",textAlign:"center"},children:[l.jsx(dt,{type:"target",position:be.Top,style:{background:"transparent",border:"none"}}),l.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 s4({data:n}){const r=n.conditionResult?.passed,o=r===void 0?"#c084fc":r?"#4ade80":"#fb923c";return l.jsxs("div",{style:{width:44,height:44,position:"relative",display:"flex",alignItems:"center",justifyContent:"center"},children:[l.jsx(dt,{type:"target",position:be.Top,style:{background:"transparent",border:"none"}}),l.jsxs("svg",{width:"44",height:"44",viewBox:"0 0 44 44",children:[l.jsx("polygon",{points:"22,2 42,22 22,42 2,22",fill:"none",stroke:o,strokeWidth:"1.5"}),l.jsx("polygon",{points:"22,8 36,22 22,36 8,22",fill:o,fillOpacity:.15,stroke:"none"})]}),l.jsx("span",{style:{position:"absolute",fontSize:9,fontFamily:"monospace",fontWeight:700,color:o,top:"50%",left:"50%",transform:"translate(-50%,-50%)",whiteSpace:"nowrap"},children:"◇"}),l.jsx(dt,{type:"source",position:be.Bottom,id:"pass",style:{background:"transparent",border:"none"}}),l.jsx(dt,{type:"source",position:be.Right,id:"fail",style:{background:"transparent",border:"none"}})]})}function r4({data:n}){return l.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:[l.jsx(dt,{type:"target",position:be.Left,style:{background:"transparent",border:"none"}}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:4},children:[l.jsx(Kd,{style:{width:11,height:11,color:"#fb923c"}}),l.jsx("span",{style:{fontSize:9,fontWeight:700,letterSpacing:"0.08em",color:"#fb923c"},children:"SWITCHED WORKFLOW"})]}),l.jsx("span",{style:{fontSize:11,color:"#fdba74",fontFamily:"monospace"},children:n.workflowName||"unknown"}),n.returnsOnComplete&&l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4,marginTop:6},children:[l.jsx(pl,{style:{width:9,height:9,color:"#71717a"}}),l.jsx("span",{style:{fontSize:9,color:"#71717a"},children:"resumes main flow after"})]}),l.jsx(dt,{type:"source",position:be.Right,id:"return",style:{background:"transparent",border:"none"}})]})}const o4={step:t4,memory:n4,condition:s4,start:a4,end:l4,branch:r4},is=260,i4=130,c4=200,u4=90,d4=is+90,wi=50;function os(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 f4(n,r,o){const i=[],u=[];let f=0;i.push({id:"start",type:"start",position:{x:(is-120)/2,y:f},data:{label:`▶ START · ${new Date(n.startedAt).toLocaleTimeString()}`},draggable:!1}),f+=50+wi;for(let x=0;x<n.steps.length;x++){const g=n.steps[x],y=g.captureSpec&&Object.keys(g.captureSpec).length>0,v=g.captured&&Object.keys(g.captured).length>0,j=!!(g.conditionSpec||g.conditionResult),C=!!g.conditionSpec?.switchToWorkflow,_=g.passed?"#4ade80":"#f87171";i.push({id:`step-${x}`,type:"step",position:{x:0,y:f},data:{index:x,name:g.name,method:g.method,path:g.path,status:g.status,passed:g.passed,durationMs:g.durationMs,error:g.error,injectSpec:g.injectSpec,captureSpec:g.captureSpec,conditionSpec:g.conditionSpec,conditionResult:g.conditionResult,selected:r===x,onSelect:()=>o(x)},draggable:!1});const T=x===0?"start":Si(n,x-1)?`cond-${x-1}`:ym(n,x-1)?`mem-${x-1}`:`step-${x-1}`,M=x>0&&Si(n,x-1)?"pass":void 0;u.push({id:`e-${x}`,source:T,sourceHandle:M,target:`step-${x}`,...os(_,{width:2}),label:x>0&&n.steps[x-1].injectSpec?Object.keys(n.steps[x-1].injectSpec??{}).map(L=>`{{${L}}}`).join(", "):void 0}),f+=i4+wi;let B=`step-${x}`;if((y||v)&&(i.push({id:`mem-${x}`,type:"memory",position:{x:(is-c4)/2,y:f},data:{captured:v?g.captured:Object.fromEntries(Object.keys(g.captureSpec??{}).map(L=>[L.split(":").pop()??L,"…"]))},draggable:!1}),u.push({id:`e-mem-${x}`,source:`step-${x}`,target:`mem-${x}`,...os("#a78bfa",{dashed:!0,width:1.2}),label:"capture"}),f+=u4+wi,B=`mem-${x}`),j){const L=g.conditionResult?.passed===!1?"#fb923c":"#c084fc",D=f;if(i.push({id:`cond-${x}`,type:"condition",position:{x:(is-44)/2,y:D},data:{conditionSpec:g.conditionSpec,conditionResult:g.conditionResult},draggable:!1}),u.push({id:`e-cond-${x}`,source:B,target:`cond-${x}`,...os(L,{width:1.4}),label:g.conditionResult?g.conditionResult.passed?"PASS":"FAIL":"eval"}),C&&(i.push({id:`branch-${x}`,type:"branch",position:{x:d4,y:D-10},data:{workflowName:g.conditionSpec?.switchToWorkflow,returnsOnComplete:g.conditionSpec?.returnOnComplete},draggable:!1}),u.push({id:`e-branch-${x}`,source:`cond-${x}`,sourceHandle:"fail",target:`branch-${x}`,...os("#fb923c",{dashed:!0,width:1.6,labelBg:!0}),label:"on FAIL → switch"}),g.conditionSpec?.returnOnComplete)){const H=x<n.steps.length-1?`step-${x+1}`:"end";u.push({id:`e-branch-return-${x}`,source:`branch-${x}`,sourceHandle:"return",target:H,...os("#60a5fa",{dashed:!0,width:1.2,labelBg:!0}),label:"resume"})}f+=44+wi}}i.push({id:"end",type:"end",position:{x:(is-140)/2,y:f},data:{phase:n.phase,passed:n.passed,failed:n.failed},draggable:!1});const h=n.steps.length-1,m=n.steps.length>0?Si(n,h)?`cond-${h}`:ym(n,h)?`mem-${h}`:`step-${h}`:"start",p=n.steps.length>0&&Si(n,h)?"pass":void 0;return u.push({id:"e-end",source:m,sourceHandle:p,target:"end",...os(n.phase==="done"&&n.failed===0?"#4ade80":"#f87171",{width:2})}),i.push({id:"spine-rail",type:"default",position:{x:is/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 Si(n,r){const o=n.steps[r];return o?!!(o.conditionSpec||o.conditionResult):!1}function ym(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 h4({trace:n,selectedStep:r,onSelectStep:o}){const[i,u,f]=eb([]),[h,m,p]=tb([]);return w.useEffect(()=>{const{nodes:x,edges:g}=f4(n,r,o);u(x),m(g)},[n,r]),l.jsxs(mf,{nodes:i,edges:h,onNodesChange:f,onEdgesChange:p,nodeTypes:o4,fitView:!0,fitViewOptions:{padding:.3},proOptions:{hideAttribution:!0},minZoom:.15,maxZoom:2,defaultEdgeOptions:{type:"smoothstep"},style:{background:"transparent"},children:[l.jsx(ob,{variant:It.Dots,gap:24,size:1,color:"rgba(255,255,255,0.04)"}),l.jsx(sb,{style:{background:"var(--bg-surface)",border:"1px solid var(--border)",borderRadius:8},showInteractive:!1}),l.jsx(GS,{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 x4({step:n,onClose:r}){const o=fb(n.method),[i,u]=w.useState("overview");return l.jsxs("div",{className:"flex flex-col h-full",style:{width:360,borderLeft:"1px solid var(--border)",backgroundColor:"var(--bg-surface)",flexShrink:0},children:[l.jsxs("div",{style:{borderBottom:"1px solid var(--border)",padding:"12px 16px",display:"flex",alignItems:"center",gap:10,backgroundColor:"var(--bg-elevated)"},children:[l.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}),l.jsx("span",{style:{fontFamily:"monospace",fontSize:12,color:"var(--text-primary)",flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.path}),l.jsx("button",{onClick:r,style:{color:"var(--text-faint)",display:"flex",alignItems:"center"},children:l.jsx(St,{className:"h-4 w-4"})})]}),l.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?l.jsx(yt,{className:"h-4 w-4 text-emerald-400 shrink-0"}):l.jsx(Dt,{className:"h-4 w-4 text-red-400 shrink-0"}),l.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&&l.jsxs("span",{style:{fontSize:10,color:"var(--text-muted)",marginLeft:"auto"},children:["expected ",n.expectStatus]})]}),l.jsx("div",{style:{display:"flex",borderBottom:"1px solid var(--border)"},children:["overview","request","response","vars","conditions"].map(f=>l.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))}),l.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"14px 16px"},children:[i==="overview"&&l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:14},children:[l.jsxs(jn,{title:"Step",children:[l.jsx(Tt,{k:"Index",v:`#${n.index+1}`}),l.jsx(Tt,{k:"Name",v:n.name||"—"}),l.jsx(Tt,{k:"Method",v:n.method}),l.jsx(Tt,{k:"Path",v:n.path,mono:!0}),n.description&&l.jsx(Tt,{k:"Description",v:n.description})]}),l.jsxs(jn,{title:"Timing",children:[l.jsx(Tt,{k:"Duration",v:`${n.durationMs}ms`,accent:"#60a5fa"}),n.expectStatus&&l.jsx(Tt,{k:"Expected status",v:String(n.expectStatus)}),l.jsx(Tt,{k:"Actual status",v:n.status>0?String(n.status):"No response",accent:n.passed?"#4ade80":"#f87171"})]}),n.error&&l.jsx(jn,{title:"Error",children:l.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:l.jsx("span",{style:{fontSize:11,color:"#f87171",fontFamily:"monospace"},children:n.error})})})]}),i==="request"&&l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:14},children:[Object.keys(n.injected??{}).length>0&&l.jsx(jn,{title:"Headers (injected)",children:Object.entries(n.injected??{}).map(([f,h])=>l.jsx(Tt,{k:f,v:String(h),mono:!0},f))}),n.injectSpec&&Object.keys(n.injectSpec).length>0&&l.jsx(jn,{title:"Variable injection spec",children:Object.entries(n.injectSpec).map(([f,h])=>l.jsx(Tt,{k:f,v:`← {{${h}}}`,mono:!0,accent:"#a78bfa"},f))}),n.requestBody?l.jsx(jn,{title:"Request body",children:l.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)})}):l.jsx("span",{style:{fontSize:11,color:"var(--text-faint)"},children:"No request body"})]}),i==="response"&&l.jsx("div",{style:{display:"flex",flexDirection:"column",gap:14},children:n.responseBody!==void 0?l.jsx(jn,{title:`Response body · HTTP ${n.status}`,children:l.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)})}):l.jsx("span",{style:{fontSize:11,color:"var(--text-faint)"},children:"No response body recorded"})}),i==="vars"&&l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:14},children:[n.captureSpec&&Object.keys(n.captureSpec).length>0&&l.jsx(jn,{title:"Capture spec (JSONPath)",children:Object.entries(n.captureSpec).map(([f,h])=>l.jsx(Tt,{k:f,v:h,mono:!0,accent:"#a78bfa"},f))}),n.captured&&Object.keys(n.captured).length>0?l.jsx(jn,{title:"Captured values",children:Object.entries(n.captured).map(([f,h])=>l.jsx(Tt,{k:f,v:String(h),mono:!0,accent:"#4ade80"},f))}):l.jsx("span",{style:{fontSize:11,color:"var(--text-faint)"},children:"No variables captured in this step"})]}),i==="conditions"&&l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:14},children:[n.conditionResult&&l.jsx(jn,{title:"Condition Evaluation Result",children:l.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:[l.jsxs("span",{style:{fontSize:11,fontWeight:600,color:n.conditionResult.passed?"#4ade80":"#fb923c"},children:["◇ Condition ",n.conditionResult.passed?"PASSED":"FAILED"]}),l.jsx("p",{style:{fontSize:10,color:"var(--text-secondary)",marginTop:4,fontFamily:"monospace"},children:n.conditionResult.reason})]})}),n.conditionSpec?l.jsxs(jn,{title:"Condition Rules",children:[l.jsx(Tt,{k:"Logic mode",v:n.conditionSpec.rules.all?"AND (all rules must pass)":"OR (any rule can pass)"}),l.jsx(Tt,{k:"Failure action",v:n.conditionSpec.onFail,accent:"#fb923c"}),n.conditionSpec.switchToWorkflow&&l.jsx(Tt,{k:"Switch workflow",v:n.conditionSpec.switchToWorkflow,mono:!0,accent:"#60a5fa"}),n.conditionSpec.returnOnComplete!==void 0&&l.jsx(Tt,{k:"Return on complete",v:n.conditionSpec.returnOnComplete?"Yes (resumes main workflow)":"No (permanent switch)"}),l.jsxs("div",{style:{marginTop:6},children:[l.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)=>l.jsxs("div",{style:{fontSize:10,color:"#c4b5fd",fontFamily:"monospace",background:"var(--bg-overlay)",padding:"4px 8px",borderRadius:4,marginBottom:3},children:[f.left," ",l.jsx("span",{style:{color:"#a78bfa"},children:f.operator})," ",f.right!==void 0?f.right:""]},h))]})]}):l.jsx("span",{style:{fontSize:11,color:"var(--text-faint)"},children:"No condition configured for this step"})]})]})]})}function jn({title:n,children:r}){return l.jsxs("div",{children:[l.jsx("p",{style:{fontSize:9,fontWeight:700,letterSpacing:"0.1em",color:"var(--text-faint)",textTransform:"uppercase",marginBottom:8},children:n}),l.jsx("div",{style:{display:"flex",flexDirection:"column",gap:5},children:r})]})}function Tt({k:n,v:r,mono:o=!1,accent:i}){return l.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:8},children:[l.jsx("span",{style:{fontSize:10,color:"var(--text-muted)",minWidth:100,flexShrink:0},children:n}),l.jsx("span",{style:{fontSize:10,color:i??"var(--text-secondary)",fontFamily:o?"monospace":void 0,wordBreak:"break-all"},children:r})]})}function p4({trace:n}){const[r,o]=w.useState(null),i=n.steps.reduce((f,h)=>f+h.durationMs,0)||1,u=w.useCallback(f=>{o(h=>h===f?null:f)},[]);return l.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",minWidth:0},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"14px 20px",borderBottom:"1px solid var(--border)",backgroundColor:"var(--bg-elevated)",flexShrink:0},children:[l.jsxs("div",{style:{flex:1,minWidth:0},children:[l.jsx("p",{style:{fontSize:14,fontWeight:600,color:"var(--text-primary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.workflowName}),l.jsxs("p",{style:{fontSize:10,color:"var(--text-muted)",marginTop:2,display:"flex",alignItems:"center",gap:6},children:[l.jsx(Yr,{className:"h-3 w-3 inline"}),new Date(n.startedAt).toLocaleString(),n.baseUrl&&l.jsxs(l.Fragment,{children:[" · ",l.jsx("code",{style:{color:"var(--text-faint)"},children:n.baseUrl})]}),"· ",l.jsx("span",{style:{color:"var(--text-faint)"},children:n.source==="local-sim"?"Simulated locally":"Real API run"})]})]}),l.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?l.jsx(yt,{className:"h-3.5 w-3.5"}):l.jsx(Dt,{className:"h-3.5 w-3.5"}),n.passed,"/",n.passed+n.failed," passed · ",n.durationMs,"ms"]})]}),l.jsxs("div",{style:{padding:"10px 20px",borderBottom:"1px solid var(--border)",flexShrink:0},children:[l.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"]}),l.jsx("div",{style:{display:"flex",gap:2,height:8,borderRadius:4,overflow:"hidden"},children:n.steps.map((f,h)=>l.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))}),l.jsx("div",{style:{display:"flex",gap:2,marginTop:4},children:n.steps.map((f,h)=>l.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))})]}),l.jsxs("div",{style:{flex:1,display:"flex",minHeight:0},children:[l.jsx("div",{style:{flex:1,minWidth:0,position:"relative"},children:l.jsx(h4,{trace:n,selectedStep:r,onSelectStep:u})}),r!==null&&n.steps[r]&&l.jsx(x4,{step:n.steps[r],onClose:()=>o(null)})]})]})}function m4({trace:n,selected:r,onClick:o,onDelete:i}){const u=n.phase==="done"&&n.failed===0?"#4ade80":n.phase==="aborted"?"#f87171":"#fbbf24",f=()=>{const h=Date.now()-new Date(n.startedAt).getTime();return h<6e4?`${Math.round(h/1e3)}s ago`:h<36e5?`${Math.round(h/6e4)}m ago`:`${Math.round(h/36e5)}h ago`};return l.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:l.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:8},children:[l.jsx("div",{style:{width:8,height:8,borderRadius:"50%",background:u,flexShrink:0,marginTop:4}}),l.jsxs("div",{style:{flex:1,minWidth:0},children:[l.jsx("p",{style:{fontSize:11,fontWeight:500,color:"var(--text-primary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.workflowName}),l.jsxs("p",{style:{fontSize:9,color:"var(--text-muted)",marginTop:2,display:"flex",alignItems:"center",gap:4},children:[l.jsx(Yr,{className:"h-2.5 w-2.5 inline shrink-0"}),f()," · ",n.steps.length," steps · ",n.durationMs,"ms"]}),l.jsxs("div",{style:{display:"flex",gap:4,marginTop:4,flexWrap:"wrap"},children:[n.passed>0&&l.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&&l.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," ✗"]}),l.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)&&l.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:[l.jsx(In,{style:{width:8,height:8}})," cond"]})]})]}),l.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:l.jsx(Ot,{className:"h-3 w-3"})})]})})}function g4(){return l.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:12,padding:"40px 20px",textAlign:"center"},children:[l.jsxs("div",{style:{position:"relative",width:52,height:52,display:"flex",alignItems:"center",justifyContent:"center"},children:[l.jsx("div",{style:{position:"absolute",inset:0,borderRadius:"50%",background:"rgba(96,165,250,0.1)",filter:"blur(8px)"}}),l.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:l.jsx(Lr,{className:"h-6 w-6"})})]}),l.jsx("p",{style:{fontSize:12,fontWeight:500,color:"var(--text-secondary)"},children:"No traces yet"}),l.jsx("p",{style:{fontSize:10,color:"var(--text-muted)",maxWidth:200},children:"Run a simulation from the Simulations page to generate a trace."})]})}function b4(){return l.jsxs("div",{style:{display:"flex",flex:1,flexDirection:"column",alignItems:"center",justifyContent:"center",gap:14,textAlign:"center",padding:32},children:[l.jsxs("div",{style:{position:"relative",width:64,height:64,display:"flex",alignItems:"center",justifyContent:"center"},children:[l.jsx("div",{style:{position:"absolute",inset:0,borderRadius:"50%",background:"rgba(167,139,250,0.1)",filter:"blur(12px)"}}),l.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:l.jsx(Li,{className:"h-8 w-8"})})]}),l.jsxs("div",{children:[l.jsx("p",{style:{fontSize:14,fontWeight:600,color:"var(--text-secondary)"},children:"Select a trace"}),l.jsx("p",{style:{fontSize:11,color:"var(--text-muted)",marginTop:4},children:"Pick a run from the list to visualize its execution graph"})]}),l.jsxs("div",{style:{border:"1px solid var(--border)",borderRadius:10,padding:"12px 16px",backgroundColor:"var(--bg-overlay)",maxWidth:340,textAlign:"left"},children:[l.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])=>l.jsxs("div",{style:{display:"flex",gap:8,marginBottom:8},children:[l.jsx("span",{style:{color:"#60a5fa",flexShrink:0,marginTop:1},children:"→"}),l.jsxs("div",{children:[l.jsx("span",{style:{fontSize:11,fontWeight:500,color:"var(--text-secondary)"},children:n}),l.jsx("p",{style:{fontSize:10,color:"var(--text-muted)",marginTop:1},children:r})]})]},n))]})]})}function y4({initialFilter:n,onNavigate:r}){const[o,i]=w.useState([]),[u,f]=w.useState(!0),[h,m]=w.useState(""),[p,x]=w.useState(null),g=w.useRef(!1),y=w.useCallback(async()=>{f(!0);try{const _=await h0();if(i(_),!g.current&&n?.traceId){const T=_.find(M=>M.id===n.traceId);T&&(x(T),g.current=!0)}else if(!g.current&&n?.workflowName&&_.length>0){const T=_.find(M=>M.workflowName===n.workflowName);T&&(x(T),g.current=!0)}}finally{f(!1)}},[n?.traceId,n?.workflowName]);w.useEffect(()=>{y()},[y]),w.useEffect(()=>{const _=setInterval(()=>{h0().then(T=>{(T.length!==o.length||T.some((M,B)=>M.id!==o[B]?.id))&&i(T)}).catch(()=>{})},5e3);return()=>clearInterval(_)},[o]),w.useEffect(()=>{if(n?.traceId&&o.length>0){const _=o.find(T=>T.id===n.traceId);_&&x(_)}},[n?.traceId,o]);const v=async _=>{await a2(_),p?.id===_&&x(null),i(T=>T.filter(M=>M.id!==_))},j=async()=>{confirm("Delete all traces? This cannot be undone.")&&(await l2(),i([]),x(null))},C=o.filter(_=>!h.trim()||_.workflowName.toLowerCase().includes(h.toLowerCase())||_.steps.some(T=>T.path.toLowerCase().includes(h.toLowerCase())));return l.jsxs("div",{style:{display:"flex",height:"100%"},className:"w-full",children:[l.jsxs("div",{style:{width:280,flexShrink:0,display:"flex",flexDirection:"column",borderRight:"1px solid var(--border)",backgroundColor:"var(--bg-surface)"},children:[l.jsxs("div",{style:{padding:"14px 14px 10px",borderBottom:"1px solid var(--border)",backgroundColor:"var(--bg-elevated)",flexShrink:0},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:10},children:[l.jsxs("div",{children:[l.jsx("p",{style:{fontSize:13,fontWeight:600,color:"var(--text-primary)",lineHeight:1},children:"Traces"}),l.jsx("p",{style:{fontSize:10,color:"var(--text-muted)",marginTop:3},children:u?"Loading…":`${o.length} run${o.length!==1?"s":""} stored`})]}),l.jsxs("div",{style:{display:"flex",gap:6},children:[l.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:l.jsx(pl,{className:"h-3.5 w-3.5"})}),o.length>0&&l.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:l.jsx(Ot,{className:"h-3.5 w-3.5"})})]})]}),l.jsxs("div",{style:{position:"relative"},children:[l.jsx(kd,{style:{position:"absolute",left:8,top:"50%",transform:"translateY(-50%)",width:13,height:13,color:"var(--text-faint)",pointerEvents:"none"}}),l.jsx("input",{value:h,onChange:_=>m(_.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&&l.jsx("button",{onClick:()=>m(""),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:l.jsx(St,{className:"h-3 w-3"})})]})]}),l.jsxs("div",{style:{flex:1,overflowY:"auto"},children:[u&&l.jsx("div",{style:{padding:16,display:"flex",flexDirection:"column",gap:8},children:[1,2,3].map(_=>l.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&&l.jsx(g4,{}),!u&&C.map(_=>l.jsx(m4,{trace:_,selected:p?.id===_.id,onClick:()=>x(_),onDelete:()=>v(_.id)},_.id))]}),r&&l.jsxs("div",{style:{padding:"10px 14px",borderTop:"1px solid var(--border)",display:"flex",gap:10},children:[l.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:[l.jsx(In,{className:"h-3 w-3"})," Simulations ",l.jsx(c0,{className:"h-2.5 w-2.5"})]}),l.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:[l.jsx(km,{className:"h-3 w-3"})," Model ",l.jsx(c0,{className:"h-2.5 w-2.5"})]})]})]}),l.jsx("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",backgroundColor:"var(--bg-base)"},children:p?l.jsx(p4,{trace:p,onNavigate:r}):l.jsx(b4,{})})]})}function v4(){return l.jsxs("div",{className:"p-8",children:[l.jsx("h1",{className:"text-2xl font-semibold text-white",children:"Events"}),l.jsx("p",{className:"mt-4 text-zinc-400",children:"This page is underdevelopnment."})]})}function ml({icon:n,label:r,description:o}){return l.jsxs("div",{className:"flex items-start gap-3 pb-4 border-b border-white/10",children:[l.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:l.jsx(n,{className:"h-[15px] w-[15px] text-blue-400",strokeWidth:2})}),l.jsxs("div",{children:[l.jsx("p",{className:"text-[13.5px] font-medium text-white",children:r}),o&&l.jsx("p",{className:"mt-0.5 text-[11px] text-zinc-500",children:o})]})]})}function Je({label:n,description:r,children:o}){return l.jsxs("div",{className:"flex items-center justify-between gap-4 py-3 border-b border-white/[0.06] last:border-0",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("p",{className:"text-[13px] text-zinc-200",children:n}),r&&l.jsx("p",{className:"text-[11px] text-zinc-500 mt-0.5",children:r})]}),l.jsx("div",{className:"shrink-0",children:o})]})}function Ft({value:n,onChange:r}){return l.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:l.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 j4({value:n,onChange:r,placeholder:o,mono:i=!1,type:u="text"}){return l.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 bs({value:n,onChange:r,options:o}){return l.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=>l.jsx("option",{value:i,children:i},i))})}function gl({children:n,className:r=""}){return l.jsx("div",{className:`rounded-lg border border-white/10 bg-white/[0.02] p-5 space-y-1 ${r}`,children:n})}function hb({saving:n,onClick:r}){return l.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?l.jsx(tt,{className:"h-3.5 w-3.5 animate-spin",strokeWidth:2}):l.jsx(T1,{className:"h-3.5 w-3.5",strokeWidth:2}),n?"Saving…":"Save"]})}const N4=[{id:"general",label:"General",icon:Am},{id:"environments",label:"Environments",icon:vs},{id:"appearance",label:"Appearance",icon:Tm},{id:"editor",label:"Editor",icon:Li},{id:"notifications",label:"Notifications",icon:wm},{id:"api",label:"API & Auth",icon:qa},{id:"advanced",label:"Advanced",icon:Fd}];function w4({model:n}){const[r,o]=w.useState(n?.project?.name??""),[i,u]=w.useState(n?.project?.language??"TypeScript"),[f,h]=w.useState(n?.project?.framework??"Express"),[m,p]=w.useState(!1),[x,g]=w.useState(!1);w.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),g(!0),setTimeout(()=>g(!1),2e3)};return l.jsxs("div",{className:"space-y-5",children:[l.jsx(ml,{icon:Am,label:"General",description:"Project identity and basic configuration"}),l.jsxs(gl,{children:[l.jsx(Je,{label:"Project Name",description:"Display name shown in the dashboard",children:l.jsx(j4,{value:r,onChange:o,placeholder:"My API"})}),l.jsx(Je,{label:"Language",description:"Primary language of your backend",children:l.jsx(bs,{value:i,onChange:u,options:["TypeScript","JavaScript","Python","Go","Rust"]})}),l.jsx(Je,{label:"Framework",description:"HTTP framework used by your server",children:l.jsx(bs,{value:f,onChange:h,options:["Express","Fastify","Hono","Koa","NestJS","Other"]})}),l.jsxs("div",{className:"flex justify-end pt-2 gap-2",children:[x&&l.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-emerald-400",children:[l.jsx(yt,{className:"h-3.5 w-3.5",strokeWidth:2})," Saved"]}),l.jsx(hb,{saving:m,onClick:y})]})]})]})}function S4({model:n}){const[r,o]=w.useState(n?.environments??[{name:"local",baseUrl:"http://localhost:3000"}]),[i,u]=w.useState(!1),[f,h]=w.useState(!1);w.useEffect(()=>{o(n?.environments??[{name:"local",baseUrl:"http://localhost:3000"}])},[n]);const m=()=>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}:_)),g=async()=>{u(!0),await new Promise(y=>setTimeout(y,600)),u(!1),h(!0),setTimeout(()=>h(!1),2e3)};return l.jsxs("div",{className:"space-y-5",children:[l.jsx(ml,{icon:vs,label:"Environments",description:"Configure your API base URLs for simulation"}),l.jsxs(gl,{children:[l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex items-center gap-4 px-1 mb-2",children:[l.jsx("p",{className:"w-24 text-[10px] uppercase tracking-wider text-zinc-600 font-semibold",children:"Name"}),l.jsx("p",{className:"flex-1 text-[10px] uppercase tracking-wider text-zinc-600 font-semibold",children:"Base URL"})]}),r.map((y,v)=>l.jsxs("div",{className:"flex items-center gap-2",children:[l.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"}),l.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"}),l.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:l.jsx(St,{className:"h-3.5 w-3.5",strokeWidth:2})})]},v)),l.jsx("button",{onClick:m,className:"text-[12px] text-blue-400 hover:text-blue-300 transition-colors mt-1",children:"+ Add environment"})]}),l.jsxs("div",{className:"flex justify-end pt-3 gap-2 border-t border-white/[0.06]",children:[f&&l.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-emerald-400",children:[l.jsx(yt,{className:"h-3.5 w-3.5",strokeWidth:2})," Saved"]}),l.jsx(hb,{saving:i,onClick:g})]})]}),l.jsxs("div",{className:"rounded-lg border border-white/10 bg-white/[0.02] px-4 py-3 flex items-start gap-2.5",children:[l.jsx(r1,{className:"h-3.5 w-3.5 text-blue-400/70 shrink-0 mt-0.5",strokeWidth:2}),l.jsxs("p",{className:"text-[11px] text-zinc-500",children:["The"," ",l.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 E4(){const[n,r]=w.useState("dark"),[o,i]=w.useState("blue"),[u,f]=w.useState("comfortable"),[h,m]=w.useState(!0),p=["blue","violet","emerald","amber","rose"],x={blue:"#3b82f6",violet:"#8b5cf6",emerald:"#34d399",amber:"#fbbf24",rose:"#fb7185"};return l.jsxs("div",{className:"space-y-5",children:[l.jsx(ml,{icon:Tm,label:"Appearance",description:"Customize the look and feel of the dashboard"}),l.jsxs(gl,{children:[l.jsx(Je,{label:"Theme",description:"Choose your preferred colour scheme",children:l.jsx("div",{className:"flex gap-px overflow-hidden rounded-lg border border-white/10",children:["dark","darker"].map(g=>l.jsx("button",{onClick:()=>r(g),className:`px-3 py-1.5 text-[12px] transition-colors capitalize ${n===g?"bg-blue-500 text-white":"text-zinc-400 hover:text-zinc-200 bg-white/[0.02] hover:bg-white/[0.05]"}`,children:g},g))})}),l.jsx(Je,{label:"Accent Colour",description:"Primary highlight colour throughout the UI",children:l.jsx("div",{className:"flex items-center gap-2",children:p.map(g=>l.jsx("button",{onClick:()=>i(g),className:`h-5 w-5 rounded-full border-2 transition-transform ${o===g?"scale-110 border-white/40":"border-transparent hover:scale-105"}`,style:{background:x[g]}},g))})}),l.jsx(Je,{label:"Density",description:"Controls spacing throughout the layout",children:l.jsx("div",{className:"flex gap-px overflow-hidden rounded-lg border border-white/10",children:["comfortable","compact"].map(g=>l.jsx("button",{onClick:()=>f(g),className:`px-3 py-1.5 text-[12px] transition-colors capitalize ${u===g?"bg-blue-500 text-white":"text-zinc-400 hover:text-zinc-200 bg-white/[0.02] hover:bg-white/[0.05]"}`,children:g},g))})}),l.jsx(Je,{label:"Animations",description:"Smooth transitions and micro-animations",children:l.jsx(Ft,{value:h,onChange:m})})]})]})}function k4(){const[n,r]=w.useState("11"),[o,i]=w.useState("2"),[u,f]=w.useState(!0),[h,m]=w.useState(!0),[p,x]=w.useState(!0);return l.jsxs("div",{className:"space-y-5",children:[l.jsx(ml,{icon:Li,label:"Editor",description:"Source viewer and code display preferences"}),l.jsxs(gl,{children:[l.jsx(Je,{label:"Font Size",description:"Monospace font size in the source viewer",children:l.jsx(bs,{value:n,onChange:r,options:["10","11","12","13","14"]})}),l.jsx(Je,{label:"Tab Size",description:"Number of spaces per indentation level",children:l.jsx(bs,{value:o,onChange:i,options:["2","4","8"]})}),l.jsx(Je,{label:"Word Wrap",description:"Wrap long lines in the source viewer",children:l.jsx(Ft,{value:u,onChange:f})}),l.jsx(Je,{label:"Line Numbers",description:"Show line numbers in the source viewer gutter",children:l.jsx(Ft,{value:h,onChange:m})}),l.jsx(Je,{label:"Highlight Handler Line",description:"Highlight the matched handler line in source view",children:l.jsx(Ft,{value:p,onChange:x})})]})]})}function _4(){const[n,r]=w.useState(!0),[o,i]=w.useState(!0),[u,f]=w.useState(!0),[h,m]=w.useState(!1),[p,x]=w.useState(!1);return l.jsxs("div",{className:"space-y-5",children:[l.jsx(ml,{icon:wm,label:"Notifications",description:"Control when and how you're notified"}),l.jsxs(gl,{children:[l.jsx(Je,{label:"Scan complete",description:"Notify when a project scan finishes",children:l.jsx(Ft,{value:n,onChange:r})}),l.jsx(Je,{label:"Simulation complete",description:"Notify when a workflow run finishes",children:l.jsx(Ft,{value:o,onChange:i})}),l.jsx(Je,{label:"Simulation failure",description:"Notify when a workflow step fails",children:l.jsx(Ft,{value:u,onChange:f})}),l.jsx(Je,{label:"Memory updates",description:"Notify on runtime memory changes",children:l.jsx(Ft,{value:h,onChange:m})}),l.jsx(Je,{label:"Desktop notifications",description:"Show browser push notifications",children:l.jsx(Ft,{value:p,onChange:x})})]})]})}function C4(){const[n,r]=w.useState(""),[o,i]=w.useState("10000"),[u,f]=w.useState(!1),[h,m]=w.useState(!1);return l.jsxs("div",{className:"space-y-5",children:[l.jsx(ml,{icon:qa,label:"API & Auth",description:"Default request settings for endpoint simulation"}),l.jsxs(gl,{children:[l.jsx(Je,{label:"Default Bearer Token",description:"Pre-fill bearer token in simulate panels",children:l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.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"}),l.jsx("button",{onClick:()=>m(p=>!p),className:"text-[11px] text-zinc-500 hover:text-zinc-300 transition-colors",children:h?"Hide":"Show"})]})}),l.jsx(Je,{label:"Request Timeout",description:"Milliseconds before a simulated request times out",children:l.jsx(bs,{value:o,onChange:i,options:["5000","10000","15000","30000","60000"]})}),l.jsx(Je,{label:"Auto-retry on 5xx",description:"Automatically retry failed requests once",children:l.jsx(Ft,{value:u,onChange:f})})]})]})}function T4({onClearMemory:n}){const[r,o]=w.useState(!1),[i,u]=w.useState(!1),[f,h]=w.useState(!1),[m,p]=w.useState("30"),[x,g]=w.useState(!1),[y,v]=w.useState(!1),j=async()=>{g(!0),await new Promise(C=>setTimeout(C,800)),g(!1),v(!0),setTimeout(()=>v(!1),2e3),n()};return l.jsxs("div",{className:"space-y-5",children:[l.jsx(ml,{icon:Fd,label:"Advanced",description:"Developer and diagnostic options"}),l.jsxs(gl,{children:[l.jsx(Je,{label:"Scan on start",description:"Auto-scan project when the dashboard loads",children:l.jsx(Ft,{value:r,onChange:o})}),l.jsx(Je,{label:"Auto-refresh model",description:"Periodically reload model.json from disk",children:l.jsx(Ft,{value:f,onChange:h})}),f&&l.jsx(Je,{label:"Refresh interval",description:"How often to poll for model changes",children:l.jsx(bs,{value:m,onChange:p,options:["10","30","60","120"]})}),l.jsx(Je,{label:"Debug mode",description:"Verbose logging in the browser console",children:l.jsx(Ft,{value:i,onChange:u})})]}),l.jsxs("div",{className:"rounded-lg border border-red-500/20 bg-red-500/[0.03] overflow-hidden",children:[l.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 border-b border-red-500/10",children:[l.jsx(Ot,{className:"h-[15px] w-[15px] text-red-400/60",strokeWidth:2}),l.jsx("span",{className:"text-[11px] font-semibold tracking-wider text-red-400/70",children:"DANGER ZONE"})]}),l.jsxs("div",{className:"p-4 space-y-4",children:[l.jsxs("div",{className:"flex items-center justify-between gap-4",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-[13px] text-zinc-200",children:"Clear Runtime Memory"}),l.jsx("p",{className:"text-[11px] text-zinc-500 mt-0.5",children:"Delete all stored memory keys and values"})]}),l.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?l.jsx(tt,{className:"h-3.5 w-3.5 animate-spin",strokeWidth:2}):y?l.jsx(yt,{className:"h-3.5 w-3.5",strokeWidth:2}):l.jsx(Ot,{className:"h-3.5 w-3.5",strokeWidth:2}),x?"Clearing…":y?"Cleared":"Clear Memory"]})]}),l.jsxs("div",{className:"flex items-center justify-between gap-4 pt-3 border-t border-red-500/10",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-[13px] text-zinc-200",children:"Reset Model"}),l.jsxs("p",{className:"text-[11px] text-zinc-500 mt-0.5",children:["Delete"," ",l.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"]})]}),l.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:[l.jsx(Ot,{className:"h-3.5 w-3.5",strokeWidth:2})," Reset Model"]})]})]})]})]})}function M4(){return l.jsxs("div",{className:"rounded-lg border border-white/10 bg-white/[0.02] p-4 flex items-center gap-3",children:[l.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg border border-white/10 bg-white/[0.04]",children:l.jsx(ea,{className:"h-[15px] w-[15px] text-blue-400",strokeWidth:2})}),l.jsxs("div",{children:[l.jsx("p",{className:"text-[13.5px] font-medium text-white",children:"Jetic Studio"}),l.jsx("p",{className:"text-[11px] text-zinc-500",children:"v0.1.0 · Local development dashboard"})]}),l.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:[l.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-blue-500 animate-pulse"}),l.jsx("span",{className:"text-[11px] text-zinc-400 font-medium",children:"Running"})]})]})}function A4({icon:n,label:r,active:o,onClick:i}){return l.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&&l.jsx("span",{className:"absolute -left-3 top-1/2 h-4 w-[3px] -translate-y-1/2 rounded-full bg-blue-500"}),l.jsx(n,{className:"h-[15px] w-[15px] shrink-0",strokeWidth:2}),l.jsx("span",{children:r}),o&&l.jsx(ys,{className:"ml-auto h-3.5 w-3.5 opacity-40",strokeWidth:2})]})}function R4(){const[n,r]=w.useState("general"),[o,i]=w.useState(null),[u,f]=w.useState(!0);w.useEffect(()=>{fetch("/api/model").then(m=>m.ok?m.json():null).then(m=>i(m)).catch(()=>{}).finally(()=>f(!1))},[]);const h=()=>{switch(n){case"general":return l.jsx(w4,{model:o});case"environments":return l.jsx(S4,{model:o});case"appearance":return l.jsx(E4,{});case"editor":return l.jsx(k4,{});case"notifications":return l.jsx(_4,{});case"api":return l.jsx(C4,{});case"advanced":return l.jsx(T4,{onClearMemory:()=>{}});default:return null}};return l.jsxs("div",{className:"flex min-h-full w-full flex-col",children:[l.jsx("div",{className:"flex items-center justify-between border-b border-white/10 px-6 py-5",children:l.jsxs("div",{children:[l.jsx("h1",{className:"text-[15px] font-medium text-white leading-none",children:"Settings"}),l.jsx("p",{className:"mt-0.5 text-[11px] text-zinc-500",children:"Configure Jetic Studio"})]})}),l.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[l.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:[l.jsx("span",{className:"px-3 pb-1.5 pt-1 block text-[11px] font-semibold tracking-wider text-zinc-500",children:"CONFIGURATION"}),l.jsx("div",{className:"flex flex-col gap-0.5",children:N4.map(({id:m,label:p,icon:x})=>l.jsx(A4,{icon:x,label:p,active:n===m,onClick:()=>r(m)},m))}),l.jsx("div",{className:"hidden pt-4 mt-2 border-t border-white/10",children:l.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:[l.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-blue-500"}),l.jsx("span",{className:"text-[11px] font-medium text-zinc-400",children:"v0.1.0"})]})})]}),l.jsx("div",{className:"flex-1 overflow-y-auto p-6 space-y-5",children:u?l.jsx("div",{className:"space-y-3",children:[1,2,3].map(m=>l.jsx("div",{className:"h-16 animate-pulse rounded-lg border border-white/10 bg-white/[0.02]",style:{opacity:1-m*.25}},m))}):l.jsxs(l.Fragment,{children:[l.jsx(M4,{}),h()]})})]})]})}function z4(){return l.jsxs("div",{className:"p-8",children:[l.jsx("h1",{className:"text-2xl font-semibold text-white",children:"Docs"}),l.jsx("p",{className:"mt-4 text-zinc-400",children:"This is the Docs page."})]})}const O4=["overview","simulations","model","inspect","agents","tools","context","memory","apis","email","oauth","webhooks","traces","events","settings","docs"];function D4(){const[n,r]=w.useState(()=>{const v=localStorage.getItem("active_sidebar_item");return O4.includes(v)?v:"overview"}),[o,i]=w.useState(!1),[u,f]=w.useState(()=>{try{const v=localStorage.getItem("inspected_endpoint");return v?JSON.parse(v):null}catch{return null}}),[h,m]=w.useState(void 0);w.useEffect(()=>{localStorage.setItem("active_sidebar_item",n)},[n]),w.useEffect(()=>{u?localStorage.setItem("inspected_endpoint",JSON.stringify(u)):localStorage.removeItem("inspected_endpoint")},[u]);const p=v=>{v!=="inspect"&&f(null),v!=="traces"&&m(void 0),r(v)},x=v=>{f(v),r("inspect")},g=v=>{m(v),r("traces")},y=()=>{switch(n){case"overview":return l.jsx(f0,{onNavigate:p});case"simulations":return l.jsx(b3,{onViewTraces:g});case"model":return l.jsx(A3,{onInspect:x,onViewTraces:g});case"inspect":return l.jsx(D3,{endpoint:u,onBack:()=>p("model")});case"agents":return l.jsx(H3,{});case"tools":return l.jsx(U3,{});case"context":return l.jsx(B3,{});case"memory":return l.jsx(J3,{});case"apis":return l.jsx(F3,{});case"email":return l.jsx(I3,{});case"oauth":return l.jsx(P3,{});case"webhooks":return l.jsx(e4,{});case"traces":return l.jsx(y4,{initialFilter:h,onNavigate:p});case"events":return l.jsx(v4,{});case"settings":return l.jsx(R4,{});case"docs":return l.jsx(z4,{});default:return l.jsx(f0,{})}};return l.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:[l.jsx(F1,{currentPage:n,onNavigate:p,onToggleAssistant:()=>i(!o),isAssistantOpen:o}),l.jsxs("div",{className:"flex min-w-0 flex-1 flex-col relative",children:[l.jsx("div",{className:"flex min-h-0 flex-1 overflow-auto transition-colors duration-300",style:{backgroundColor:"var(--bg-base)"},children:y()}),l.jsx(I1,{isOpen:o,onClose:()=>i(!1)})]})]})}const H4=()=>l.jsx(W1,{children:l.jsx(D4,{})});Cv.createRoot(document.getElementById("root")).render(l.jsx(w.StrictMode,{children:l.jsx(H4,{})}));
|