apteva 0.4.12 → 0.4.14
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/dist/App.jdzxkzm1.js +228 -0
- package/dist/index.html +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/auth/middleware.ts +42 -26
- package/src/crypto.ts +2 -2
- package/src/db-tests.ts +174 -0
- package/src/db.ts +302 -5
- package/src/integrations/agentdojo.ts +168 -42
- package/src/mcp-client.ts +15 -9
- package/src/mcp-platform.ts +160 -0
- package/src/openapi.ts +416 -21
- package/src/routes/api/agent-utils.ts +2 -2
- package/src/routes/api/api-keys.ts +95 -0
- package/src/routes/api/mcp.ts +2 -2
- package/src/routes/api/system.ts +10 -1
- package/src/routes/api/tests.ts +148 -0
- package/src/routes/api.ts +4 -0
- package/src/server.ts +2 -1
- package/src/test-runner.ts +598 -0
- package/src/web/App.tsx +23 -10
- package/src/web/components/agents/AgentPanel.tsx +4 -8
- package/src/web/components/common/Icons.tsx +8 -0
- package/src/web/components/dashboard/Dashboard.tsx +2 -4
- package/src/web/components/index.ts +1 -0
- package/src/web/components/layout/Sidebar.tsx +7 -1
- package/src/web/components/settings/SettingsPage.tsx +288 -5
- package/src/web/components/skills/SkillsPage.tsx +1 -1
- package/src/web/components/tasks/TasksPage.tsx +8 -3
- package/src/web/components/telemetry/TelemetryPage.tsx +2 -5
- package/src/web/components/tests/TestsPage.tsx +580 -0
- package/src/web/context/index.ts +1 -1
- package/src/web/types.ts +1 -1
- package/dist/App.9ph8javh.js +0 -228
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
var pP=Object.create;var{getPrototypeOf:dP,defineProperty:bO,getOwnPropertyNames:cP}=Object;var lP=Object.prototype.hasOwnProperty;var B0=(Y,G,U)=>{U=Y!=null?pP(dP(Y)):{};let _=G||!Y||!Y.__esModule?bO(U,"default",{value:Y,enumerable:!0}):U;for(let q of cP(Y))if(!lP.call(_,q))bO(_,q,{get:()=>Y[q],enumerable:!0});return _};var Rz=(Y,G)=>()=>(G||Y((G={exports:{}}).exports,G),G.exports);var V1=Rz((iP,G2)=>{(function(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function")__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var Y="18.3.1",G=Symbol.for("react.element"),U=Symbol.for("react.portal"),_=Symbol.for("react.fragment"),q=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),K=Symbol.for("react.provider"),O=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),b=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),S=Symbol.for("react.offscreen"),f=Symbol.iterator,V="@@iterator";function x(L){if(L===null||typeof L!=="object")return null;var g=f&&L[f]||L[V];if(typeof g==="function")return g;return null}var v={current:null},p={transition:null},A={current:null,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1},E={current:null},j={},u=null;function r(L){u=L}j.setExtraStackFrame=function(L){u=L},j.getCurrentStack=null,j.getStackAddendum=function(){var L="";if(u)L+=u;var g=j.getCurrentStack;if(g)L+=g()||"";return L};var i=!1,d=!1,D=!1,Q0=!1,n=!1,G0={ReactCurrentDispatcher:v,ReactCurrentBatchConfig:p,ReactCurrentOwner:E};G0.ReactDebugCurrentFrame=j,G0.ReactCurrentActQueue=A;function F0(L){{for(var g=arguments.length,X0=Array(g>1?g-1:0),q0=1;q0<g;q0++)X0[q0-1]=arguments[q0];S0("warn",L,X0)}}function K0(L){{for(var g=arguments.length,X0=Array(g>1?g-1:0),q0=1;q0<g;q0++)X0[q0-1]=arguments[q0];S0("error",L,X0)}}function S0(L,g,X0){{var q0=G0.ReactDebugCurrentFrame,h0=q0.getStackAddendum();if(h0!=="")g+="%s",X0=X0.concat([h0]);var M1=X0.map(function(e0){return String(e0)});M1.unshift("Warning: "+g),Function.prototype.apply.call(console[L],console,M1)}}var P0={};function a(L,g){{var X0=L.constructor,q0=X0&&(X0.displayName||X0.name)||"ReactClass",h0=q0+"."+g;if(P0[h0])return;K0("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",g,q0),P0[h0]=!0}}var Y0={isMounted:function(L){return!1},enqueueForceUpdate:function(L,g,X0){a(L,"forceUpdate")},enqueueReplaceState:function(L,g,X0,q0){a(L,"replaceState")},enqueueSetState:function(L,g,X0,q0){a(L,"setState")}},U0=Object.assign,H0={};Object.freeze(H0);function y0(L,g,X0){this.props=L,this.context=g,this.refs=H0,this.updater=X0||Y0}y0.prototype.isReactComponent={},y0.prototype.setState=function(L,g){if(typeof L!=="object"&&typeof L!=="function"&&L!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,L,g,"setState")},y0.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};{var z0={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},v0=function(L,g){Object.defineProperty(y0.prototype,L,{get:function(){F0("%s(...) is deprecated in plain JavaScript React classes. %s",g[0],g[1]);return}})};for(var p0 in z0)if(z0.hasOwnProperty(p0))v0(p0,z0[p0])}function Y1(){}Y1.prototype=y0.prototype;function m0(L,g,X0){this.props=L,this.context=g,this.refs=H0,this.updater=X0||Y0}var $1=m0.prototype=new Y1;$1.constructor=m0,U0($1,y0.prototype),$1.isPureReactComponent=!0;function v1(){var L={current:null};return Object.seal(L),L}var m=Array.isArray;function N0(L){return m(L)}function V0(L){{var g=typeof Symbol==="function"&&Symbol.toStringTag,X0=g&&L[Symbol.toStringTag]||L.constructor.name||"Object";return X0}}function L1(L){try{return o1(L),!1}catch(g){return!0}}function o1(L){return""+L}function R1(L){if(L1(L))return K0("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",V0(L)),o1(L)}function A0(L,g,X0){var q0=L.displayName;if(q0)return q0;var h0=g.displayName||g.name||"";return h0!==""?X0+"("+h0+")":X0}function Z1(L){return L.displayName||"Context"}function S1(L){if(L==null)return null;if(typeof L.tag==="number")K0("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.");if(typeof L==="function")return L.displayName||L.name||null;if(typeof L==="string")return L;switch(L){case _:return"Fragment";case U:return"Portal";case R:return"Profiler";case q:return"StrictMode";case I:return"Suspense";case b:return"SuspenseList"}if(typeof L==="object")switch(L.$$typeof){case O:var g=L;return Z1(g)+".Consumer";case K:var X0=L;return Z1(X0._context)+".Provider";case T:return A0(L,L.render,"ForwardRef");case P:var q0=L.displayName||null;if(q0!==null)return q0;return S1(L.type)||"Memo";case N:{var h0=L,M1=h0._payload,e0=h0._init;try{return S1(e0(M1))}catch(P1){return null}}}return null}var a1=Object.prototype.hasOwnProperty,v4={key:!0,ref:!0,__self:!0,__source:!0},G4,I7,P4;P4={};function T7(L){if(a1.call(L,"ref")){var g=Object.getOwnPropertyDescriptor(L,"ref").get;if(g&&g.isReactWarning)return!1}return L.ref!==void 0}function f4(L){if(a1.call(L,"key")){var g=Object.getOwnPropertyDescriptor(L,"key").get;if(g&&g.isReactWarning)return!1}return L.key!==void 0}function V4(L,g){var X0=function(){if(!G4)G4=!0,K0("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",g)};X0.isReactWarning=!0,Object.defineProperty(L,"key",{get:X0,configurable:!0})}function N7(L,g){var X0=function(){if(!I7)I7=!0,K0("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",g)};X0.isReactWarning=!0,Object.defineProperty(L,"ref",{get:X0,configurable:!0})}function u7(L){if(typeof L.ref==="string"&&E.current&&L.__self&&E.current.stateNode!==L.__self){var g=S1(E.current.type);if(!P4[g])K0('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',g,L.ref),P4[g]=!0}}var l4=function(L,g,X0,q0,h0,M1,e0){var P1={$$typeof:G,type:L,key:g,ref:X0,props:e0,_owner:M1};if(P1._store={},Object.defineProperty(P1._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(P1,"_self",{configurable:!1,enumerable:!1,writable:!1,value:q0}),Object.defineProperty(P1,"_source",{configurable:!1,enumerable:!1,writable:!1,value:h0}),Object.freeze)Object.freeze(P1.props),Object.freeze(P1);return P1};function Q7(L,g,X0){var q0,h0={},M1=null,e0=null,P1=null,c1=null;if(g!=null){if(T7(g))e0=g.ref,u7(g);if(f4(g))R1(g.key),M1=""+g.key;P1=g.__self===void 0?null:g.__self,c1=g.__source===void 0?null:g.__source;for(q0 in g)if(a1.call(g,q0)&&!v4.hasOwnProperty(q0))h0[q0]=g[q0]}var W4=arguments.length-2;if(W4===1)h0.children=X0;else if(W4>1){var A4=Array(W4);for(var I4=0;I4<W4;I4++)A4[I4]=arguments[I4+2];if(Object.freeze)Object.freeze(A4);h0.children=A4}if(L&&L.defaultProps){var D4=L.defaultProps;for(q0 in D4)if(h0[q0]===void 0)h0[q0]=D4[q0]}if(M1||e0){var i4=typeof L==="function"?L.displayName||L.name||"Unknown":L;if(M1)V4(h0,i4);if(e0)N7(h0,i4)}return l4(L,M1,e0,P1,c1,E.current,h0)}function g0(L,g){var X0=l4(L.type,g,L.ref,L._self,L._source,L._owner,L.props);return X0}function H1(L,g,X0){if(L===null||L===void 0)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+L+".");var q0,h0=U0({},L.props),M1=L.key,e0=L.ref,P1=L._self,c1=L._source,W4=L._owner;if(g!=null){if(T7(g))e0=g.ref,W4=E.current;if(f4(g))R1(g.key),M1=""+g.key;var A4;if(L.type&&L.type.defaultProps)A4=L.type.defaultProps;for(q0 in g)if(a1.call(g,q0)&&!v4.hasOwnProperty(q0))if(g[q0]===void 0&&A4!==void 0)h0[q0]=A4[q0];else h0[q0]=g[q0]}var I4=arguments.length-2;if(I4===1)h0.children=X0;else if(I4>1){var D4=Array(I4);for(var i4=0;i4<I4;i4++)D4[i4]=arguments[i4+2];h0.children=D4}return l4(L.type,M1,e0,P1,c1,W4,h0)}function O1(L){return typeof L==="object"&&L!==null&&L.$$typeof===G}var n1=".",q4=":";function u4(L){var g=/[=:]/g,X0={"=":"=0",":":"=2"},q0=L.replace(g,function(h0){return X0[h0]});return"$"+q0}var N4=!1,e4=/\/+/g;function f1(L){return L.replace(e4,"$&/")}function k1(L,g){if(typeof L==="object"&&L!==null&&L.key!=null)return R1(L.key),u4(""+L.key);return g.toString(36)}function r7(L,g,X0,q0,h0){var M1=typeof L;if(M1==="undefined"||M1==="boolean")L=null;var e0=!1;if(L===null)e0=!0;else switch(M1){case"string":case"number":e0=!0;break;case"object":switch(L.$$typeof){case G:case U:e0=!0}}if(e0){var P1=L,c1=h0(P1),W4=q0===""?n1+k1(P1,0):q0;if(N0(c1)){var A4="";if(W4!=null)A4=f1(W4)+"/";r7(c1,g,A4,"",function(y2){return y2})}else if(c1!=null){if(O1(c1)){if(c1.key&&(!P1||P1.key!==c1.key))R1(c1.key);c1=g0(c1,X0+(c1.key&&(!P1||P1.key!==c1.key)?f1(""+c1.key)+"/":"")+W4)}g.push(c1)}return 1}var I4,D4,i4=0,Q4=q0===""?n1:q0+q4;if(N0(L))for(var x8=0;x8<L.length;x8++)I4=L[x8],D4=Q4+k1(I4,x8),i4+=r7(I4,g,X0,D4,h0);else{var Dz=x(L);if(typeof Dz==="function"){var zX=L;if(Dz===zX.entries){if(!N4)F0("Using Maps as children is not supported. Use an array of keyed ReactElements instead.");N4=!0}var h2=Dz.call(zX),k6,QX=0;while(!(k6=h2.next()).done)I4=k6.value,D4=Q4+k1(I4,QX++),i4+=r7(I4,g,X0,D4,h0)}else if(M1==="object"){var XX=String(L);throw Error("Objects are not valid as a React child (found: "+(XX==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":XX)+"). If you meant to render a collection of children, use an array instead.")}}return i4}function M7(L,g,X0){if(L==null)return L;var q0=[],h0=0;return r7(L,q0,"","",function(M1){return g.call(X0,M1,h0++)}),q0}function s7(L){var g=0;return M7(L,function(){g++}),g}function $6(L,g,X0){M7(L,function(){g.apply(this,arguments)},X0)}function p5(L){return M7(L,function(g){return g})||[]}function H6(L){if(!O1(L))throw Error("React.Children.only expected to receive a single React element child.");return L}function S5(L){var g={$$typeof:O,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};g.Provider={$$typeof:K,_context:g};var X0=!1,q0=!1,h0=!1;{var M1={$$typeof:O,_context:g};Object.defineProperties(M1,{Provider:{get:function(){if(!q0)q0=!0,K0("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?");return g.Provider},set:function(e0){g.Provider=e0}},_currentValue:{get:function(){return g._currentValue},set:function(e0){g._currentValue=e0}},_currentValue2:{get:function(){return g._currentValue2},set:function(e0){g._currentValue2=e0}},_threadCount:{get:function(){return g._threadCount},set:function(e0){g._threadCount=e0}},Consumer:{get:function(){if(!X0)X0=!0,K0("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?");return g.Consumer}},displayName:{get:function(){return g.displayName},set:function(e0){if(!h0)F0("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.",e0),h0=!0}}}),g.Consumer=M1}return g._currentRenderer=null,g._currentRenderer2=null,g}var x7=-1,d5=0,p1=1,U4=2;function F4(L){if(L._status===x7){var g=L._result,X0=g();if(X0.then(function(M1){if(L._status===d5||L._status===x7){var e0=L;e0._status=p1,e0._result=M1}},function(M1){if(L._status===d5||L._status===x7){var e0=L;e0._status=U4,e0._result=M1}}),L._status===x7){var q0=L;q0._status=d5,q0._result=X0}}if(L._status===p1){var h0=L._result;if(h0===void 0)K0(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
2
|
+
|
|
3
|
+
Your code should look like:
|
|
4
|
+
const MyComponent = lazy(() => import('./MyComponent'))
|
|
5
|
+
|
|
6
|
+
Did you accidentally put curly braces around the import?`,h0);if(!("default"in h0))K0(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
7
|
+
|
|
8
|
+
Your code should look like:
|
|
9
|
+
const MyComponent = lazy(() => import('./MyComponent'))`,h0);return h0.default}else throw L._result}function t1(L){var g={_status:x7,_result:L},X0={$$typeof:N,_payload:g,_init:F4};{var q0,h0;Object.defineProperties(X0,{defaultProps:{configurable:!0,get:function(){return q0},set:function(M1){K0("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),q0=M1,Object.defineProperty(X0,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return h0},set:function(M1){K0("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),h0=M1,Object.defineProperty(X0,"propTypes",{enumerable:!0})}}})}return X0}function y(L){{if(L!=null&&L.$$typeof===P)K0("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...)).");else if(typeof L!=="function")K0("forwardRef requires a render function but was given %s.",L===null?"null":typeof L);else if(L.length!==0&&L.length!==2)K0("forwardRef render functions accept exactly two parameters: props and ref. %s",L.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined.");if(L!=null){if(L.defaultProps!=null||L.propTypes!=null)K0("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?")}}var g={$$typeof:T,render:L};{var X0;Object.defineProperty(g,"displayName",{enumerable:!1,configurable:!0,get:function(){return X0},set:function(q0){if(X0=q0,!L.name&&!L.displayName)L.displayName=q0}})}return g}var W0=Symbol.for("react.module.reference");function w0(L){if(typeof L==="string"||typeof L==="function")return!0;if(L===_||L===R||n||L===q||L===I||L===b||Q0||L===S||i||d||D)return!0;if(typeof L==="object"&&L!==null){if(L.$$typeof===N||L.$$typeof===P||L.$$typeof===K||L.$$typeof===O||L.$$typeof===T||L.$$typeof===W0||L.getModuleId!==void 0)return!0}return!1}function C(L,g){if(!w0(L))K0("memo: The first argument must be a component. Instead received: %s",L===null?"null":typeof L);var X0={$$typeof:P,type:L,compare:g===void 0?null:g};{var q0;Object.defineProperty(X0,"displayName",{enumerable:!1,configurable:!0,get:function(){return q0},set:function(h0){if(q0=h0,!L.name&&!L.displayName)L.displayName=h0}})}return X0}function o(){var L=v.current;if(L===null)K0(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
10
|
+
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
11
|
+
2. You might be breaking the Rules of Hooks
|
|
12
|
+
3. You might have more than one copy of React in the same app
|
|
13
|
+
See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`);return L}function L0(L){var g=o();if(L._context!==void 0){var X0=L._context;if(X0.Consumer===L)K0("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?");else if(X0.Provider===L)K0("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")}return g.useContext(L)}function k0(L){var g=o();return g.useState(L)}function u0(L,g,X0){var q0=o();return q0.useReducer(L,g,X0)}function Q1(L){var g=o();return g.useRef(L)}function a0(L,g){var X0=o();return X0.useEffect(L,g)}function R0(L,g){var X0=o();return X0.useInsertionEffect(L,g)}function D0(L,g){var X0=o();return X0.useLayoutEffect(L,g)}function J1(L,g){var X0=o();return X0.useCallback(L,g)}function d1(L,g){var X0=o();return X0.useMemo(L,g)}function B4(L,g,X0){var q0=o();return q0.useImperativeHandle(L,g,X0)}function t7(L,g){{var X0=o();return X0.useDebugValue(L,g)}}function N5(){var L=o();return L.useTransition()}function h4(L){var g=o();return g.useDeferredValue(L)}function g1(){var L=o();return L.useId()}function I6(L,g,X0){var q0=o();return q0.useSyncExternalStore(L,g,X0)}var G6=0,pQ,dQ,cQ,lQ,iQ,oQ,aQ;function lZ(){}lZ.__reactDisabledLog=!0;function S2(){{if(G6===0){pQ=console.log,dQ=console.info,cQ=console.warn,lQ=console.error,iQ=console.group,oQ=console.groupCollapsed,aQ=console.groupEnd;var L={configurable:!0,enumerable:!0,value:lZ,writable:!0};Object.defineProperties(console,{info:L,log:L,warn:L,error:L,group:L,groupCollapsed:L,groupEnd:L})}G6++}}function nQ(){{if(G6--,G6===0){var L={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:U0({},L,{value:pQ}),info:U0({},L,{value:dQ}),warn:U0({},L,{value:cQ}),error:U0({},L,{value:lQ}),group:U0({},L,{value:iQ}),groupCollapsed:U0({},L,{value:oQ}),groupEnd:U0({},L,{value:aQ})})}if(G6<0)K0("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var g8=G0.ReactCurrentDispatcher,v5;function Z8(L,g,X0){{if(v5===void 0)try{throw Error()}catch(h0){var q0=h0.stack.trim().match(/\n( *(at )?)/);v5=q0&&q0[1]||""}return`
|
|
14
|
+
`+v5+L}}var J8=!1,vz;{var rQ=typeof WeakMap==="function"?WeakMap:Map;vz=new rQ}function iZ(L,g){if(!L||J8)return"";{var X0=vz.get(L);if(X0!==void 0)return X0}var q0;J8=!0;var h0=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var M1;M1=g8.current,g8.current=null,S2();try{if(g){var e0=function(){throw Error()};if(Object.defineProperty(e0.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==="object"&&Reflect.construct){try{Reflect.construct(e0,[])}catch(Q4){q0=Q4}Reflect.construct(L,[],e0)}else{try{e0.call()}catch(Q4){q0=Q4}L.call(e0.prototype)}}else{try{throw Error()}catch(Q4){q0=Q4}L()}}catch(Q4){if(Q4&&q0&&typeof Q4.stack==="string"){var P1=Q4.stack.split(`
|
|
15
|
+
`),c1=q0.stack.split(`
|
|
16
|
+
`),W4=P1.length-1,A4=c1.length-1;while(W4>=1&&A4>=0&&P1[W4]!==c1[A4])A4--;for(;W4>=1&&A4>=0;W4--,A4--)if(P1[W4]!==c1[A4]){if(W4!==1||A4!==1)do if(W4--,A4--,A4<0||P1[W4]!==c1[A4]){var I4=`
|
|
17
|
+
`+P1[W4].replace(" at new "," at ");if(L.displayName&&I4.includes("<anonymous>"))I4=I4.replace("<anonymous>",L.displayName);if(typeof L==="function")vz.set(L,I4);return I4}while(W4>=1&&A4>=0);break}}}finally{J8=!1,g8.current=M1,nQ(),Error.prepareStackTrace=h0}var D4=L?L.displayName||L.name:"",i4=D4?Z8(D4):"";if(typeof L==="function")vz.set(L,i4);return i4}function sQ(L,g,X0){return iZ(L,!1)}function v2(L){var g=L.prototype;return!!(g&&g.isReactComponent)}function Y8(L,g,X0){if(L==null)return"";if(typeof L==="function")return iZ(L,v2(L));if(typeof L==="string")return Z8(L);switch(L){case I:return Z8("Suspense");case b:return Z8("SuspenseList")}if(typeof L==="object")switch(L.$$typeof){case T:return sQ(L.render);case P:return Y8(L.type,g,X0);case N:{var q0=L,h0=q0._payload,M1=q0._init;try{return Y8(M1(h0),g,X0)}catch(e0){}}}return""}var oZ={},tQ=G0.ReactDebugCurrentFrame;function fz(L){if(L){var g=L._owner,X0=Y8(L.type,L._source,g?g.type:null);tQ.setExtraStackFrame(X0)}else tQ.setExtraStackFrame(null)}function aZ(L,g,X0,q0,h0){{var M1=Function.call.bind(a1);for(var e0 in L)if(M1(L,e0)){var P1=void 0;try{if(typeof L[e0]!=="function"){var c1=Error((q0||"React class")+": "+X0+" type `"+e0+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof L[e0]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw c1.name="Invariant Violation",c1}P1=L[e0](g,e0,q0,X0,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(W4){P1=W4}if(P1&&!(P1 instanceof Error))fz(h0),K0("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",q0||"React class",X0,e0,typeof P1),fz(null);if(P1 instanceof Error&&!(P1.message in oZ))oZ[P1.message]=!0,fz(h0),K0("Failed %s type: %s",X0,P1.message),fz(null)}}}function s1(L){if(L){var g=L._owner,X0=Y8(L.type,L._source,g?g.type:null);r(X0)}else r(null)}var nZ=!1;function eQ(){if(E.current){var L=S1(E.current.type);if(L)return`
|
|
18
|
+
|
|
19
|
+
Check the render method of \``+L+"`."}return""}function y1(L){if(L!==void 0){var g=L.fileName.replace(/^.*[\\\/]/,""),X0=L.lineNumber;return`
|
|
20
|
+
|
|
21
|
+
Check your code at `+g+":"+X0+"."}return""}function rZ(L){if(L!==null&&L!==void 0)return y1(L.__source);return""}var j7={};function E8(L){var g=eQ();if(!g){var X0=typeof L==="string"?L:L.displayName||L.name;if(X0)g=`
|
|
22
|
+
|
|
23
|
+
Check the top-level render call using <`+X0+">."}return g}function $8(L,g){if(!L._store||L._store.validated||L.key!=null)return;L._store.validated=!0;var X0=E8(g);if(j7[X0])return;j7[X0]=!0;var q0="";if(L&&L._owner&&L._owner!==E.current)q0=" It was passed a child from "+S1(L._owner.type)+".";s1(L),K0('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',X0,q0),s1(null)}function sZ(L,g){if(typeof L!=="object")return;if(N0(L))for(var X0=0;X0<L.length;X0++){var q0=L[X0];if(O1(q0))$8(q0,g)}else if(O1(L)){if(L._store)L._store.validated=!0}else if(L){var h0=x(L);if(typeof h0==="function"){if(h0!==L.entries){var M1=h0.call(L),e0;while(!(e0=M1.next()).done)if(O1(e0.value))$8(e0.value,g)}}}}function w7(L){{var g=L.type;if(g===null||g===void 0||typeof g==="string")return;var X0;if(typeof g==="function")X0=g.propTypes;else if(typeof g==="object"&&(g.$$typeof===T||g.$$typeof===P))X0=g.propTypes;else return;if(X0){var q0=S1(g);aZ(X0,L.props,"prop",q0,L)}else if(g.PropTypes!==void 0&&!nZ){nZ=!0;var h0=S1(g);K0("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",h0||"Unknown")}if(typeof g.getDefaultProps==="function"&&!g.getDefaultProps.isReactClassApproved)K0("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function p4(L){{var g=Object.keys(L.props);for(var X0=0;X0<g.length;X0++){var q0=g[X0];if(q0!=="children"&&q0!=="key"){s1(L),K0("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",q0),s1(null);break}}if(L.ref!==null)s1(L),K0("Invalid attribute `ref` supplied to `React.Fragment`."),s1(null)}}function tZ(L,g,X0){var q0=w0(L);if(!q0){var h0="";if(L===void 0||typeof L==="object"&&L!==null&&Object.keys(L).length===0)h0+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";var M1=rZ(g);if(M1)h0+=M1;else h0+=eQ();var e0;if(L===null)e0="null";else if(N0(L))e0="array";else if(L!==void 0&&L.$$typeof===G)e0="<"+(S1(L.type)||"Unknown")+" />",h0=" Did you accidentally export a JSX literal instead of a component?";else e0=typeof L;K0("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",e0,h0)}var P1=Q7.apply(this,arguments);if(P1==null)return P1;if(q0)for(var c1=2;c1<arguments.length;c1++)sZ(arguments[c1],L);if(L===_)p4(P1);else w7(P1);return P1}var M5=!1;function G5(L){var g=tZ.bind(null,L);g.type=L;{if(!M5)M5=!0,F0("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.");Object.defineProperty(g,"type",{enumerable:!1,get:function(){return F0("Factory.type is deprecated. Access the class directly before passing it to createFactory."),Object.defineProperty(this,"type",{value:L}),L}})}return g}function q6(L,g,X0){var q0=H1.apply(this,arguments);for(var h0=2;h0<arguments.length;h0++)sZ(arguments[h0],q0.type);return w7(q0),q0}function f2(L,g){var X0=p.transition;p.transition={};var q0=p.transition;p.transition._updatedFibers=new Set;try{L()}finally{if(p.transition=X0,X0===null&&q0._updatedFibers){var h0=q0._updatedFibers.size;if(h0>10)F0("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.");q0._updatedFibers.clear()}}}var hz=!1,u8=null;function eZ(L){if(u8===null)try{var g=("require"+Math.random()).slice(0,7),X0=G2&&G2[g];u8=X0.call(G2,"timers").setImmediate}catch(q0){u8=function(h0){if(hz===!1){if(hz=!0,typeof MessageChannel>"u")K0("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning.")}var M1=new MessageChannel;M1.port1.onmessage=h0,M1.port2.postMessage(void 0)}}return u8(L)}var H8=0,zJ=!1;function QJ(L){{var g=H8;if(H8++,A.current===null)A.current=[];var X0=A.isBatchingLegacy,q0;try{if(A.isBatchingLegacy=!0,q0=L(),!X0&&A.didScheduleLegacyUpdate){var h0=A.current;if(h0!==null)A.didScheduleLegacyUpdate=!1,Vz(h0)}}catch(D4){throw T6(g),D4}finally{A.isBatchingLegacy=X0}if(q0!==null&&typeof q0==="object"&&typeof q0.then==="function"){var M1=q0,e0=!1,P1={then:function(D4,i4){e0=!0,M1.then(function(Q4){if(T6(g),H8===0)yz(Q4,D4,i4);else D4(Q4)},function(Q4){T6(g),i4(Q4)})}};if(!zJ&&typeof Promise<"u")Promise.resolve().then(function(){}).then(function(){if(!e0)zJ=!0,K0("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);")});return P1}else{var c1=q0;if(T6(g),H8===0){var W4=A.current;if(W4!==null)Vz(W4),A.current=null;var A4={then:function(D4,i4){if(A.current===null)A.current=[],yz(c1,D4,i4);else D4(c1)}};return A4}else{var I4={then:function(D4,i4){D4(c1)}};return I4}}}}function T6(L){{if(L!==H8-1)K0("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. ");H8=L}}function yz(L,g,X0){{var q0=A.current;if(q0!==null)try{Vz(q0),eZ(function(){if(q0.length===0)A.current=null,g(L);else yz(L,g,X0)})}catch(h0){X0(h0)}else g(L)}}var G8=!1;function Vz(L){if(!G8){G8=!0;var g=0;try{for(;g<L.length;g++){var X0=L[g];do X0=X0(!0);while(X0!==null)}L.length=0}catch(q0){throw L=L.slice(g+1),q0}finally{G8=!1}}}var XJ=tZ,ZJ=q6,JJ=G5,YJ={map:M7,forEach:$6,count:s7,toArray:p5,only:H6};if(iP.Children=YJ,iP.Component=y0,iP.Fragment=_,iP.Profiler=R,iP.PureComponent=m0,iP.StrictMode=q,iP.Suspense=I,iP.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=G0,iP.act=QJ,iP.cloneElement=ZJ,iP.createContext=S5,iP.createElement=XJ,iP.createFactory=JJ,iP.createRef=v1,iP.forwardRef=y,iP.isValidElement=O1,iP.lazy=t1,iP.memo=C,iP.startTransition=f2,iP.unstable_act=QJ,iP.useCallback=J1,iP.useContext=L0,iP.useDebugValue=t7,iP.useDeferredValue=h4,iP.useEffect=a0,iP.useId=g1,iP.useImperativeHandle=B4,iP.useInsertionEffect=R0,iP.useLayoutEffect=D0,iP.useMemo=d1,iP.useReducer=u0,iP.useRef=Q1,iP.useState=k0,iP.useSyncExternalStore=I6,iP.useTransition=N5,iP.version=Y,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function")__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var PO=Rz((oP)=>{(function(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function")__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var Y=!1,G=!1,U=5;function _(g0,H1){var O1=g0.length;g0.push(H1),K(g0,H1,O1)}function q(g0){return g0.length===0?null:g0[0]}function R(g0){if(g0.length===0)return null;var H1=g0[0],O1=g0.pop();if(O1!==H1)g0[0]=O1,O(g0,O1,0);return H1}function K(g0,H1,O1){var n1=O1;while(n1>0){var q4=n1-1>>>1,u4=g0[q4];if(T(u4,H1)>0)g0[q4]=H1,g0[n1]=u4,n1=q4;else return}}function O(g0,H1,O1){var n1=O1,q4=g0.length,u4=q4>>>1;while(n1<u4){var N4=(n1+1)*2-1,e4=g0[N4],f1=N4+1,k1=g0[f1];if(T(e4,H1)<0)if(f1<q4&&T(k1,e4)<0)g0[n1]=k1,g0[f1]=H1,n1=f1;else g0[n1]=e4,g0[N4]=H1,n1=N4;else if(f1<q4&&T(k1,H1)<0)g0[n1]=k1,g0[f1]=H1,n1=f1;else return}}function T(g0,H1){var O1=g0.sortIndex-H1.sortIndex;return O1!==0?O1:g0.id-H1.id}var I=1,b=2,P=3,N=4,S=5;function f(g0,H1){}var V=typeof performance==="object"&&typeof performance.now==="function";if(V){var x=performance;oP.unstable_now=function(){return x.now()}}else{var v=Date,p=v.now();oP.unstable_now=function(){return v.now()-p}}var A=1073741823,E=-1,j=250,u=5000,r=1e4,i=A,d=[],D=[],Q0=1,n=null,G0=P,F0=!1,K0=!1,S0=!1,P0=typeof setTimeout==="function"?setTimeout:null,a=typeof clearTimeout==="function"?clearTimeout:null,Y0=typeof setImmediate<"u"?setImmediate:null,U0=typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0?navigator.scheduling.isInputPending.bind(navigator.scheduling):null;function H0(g0){var H1=q(D);while(H1!==null){if(H1.callback===null)R(D);else if(H1.startTime<=g0)R(D),H1.sortIndex=H1.expirationTime,_(d,H1);else return;H1=q(D)}}function y0(g0){if(S0=!1,H0(g0),!K0)if(q(d)!==null)K0=!0,V4(z0);else{var H1=q(D);if(H1!==null)N7(y0,H1.startTime-g0)}}function z0(g0,H1){if(K0=!1,S0)S0=!1,u7();F0=!0;var O1=G0;try{if(G)try{return v0(g0,H1)}catch(q4){if(n!==null){var n1=oP.unstable_now();f(n,n1),n.isQueued=!1}throw q4}else return v0(g0,H1)}finally{n=null,G0=O1,F0=!1}}function v0(g0,H1){var O1=H1;H0(O1),n=q(d);while(n!==null&&!Y){if(n.expirationTime>O1&&(!g0||a1()))break;var n1=n.callback;if(typeof n1==="function"){n.callback=null,G0=n.priorityLevel;var q4=n.expirationTime<=O1,u4=n1(q4);if(O1=oP.unstable_now(),typeof u4==="function")n.callback=u4;else if(n===q(d))R(d);H0(O1)}else R(d);n=q(d)}if(n!==null)return!0;else{var N4=q(D);if(N4!==null)N7(y0,N4.startTime-O1);return!1}}function p0(g0,H1){switch(g0){case I:case b:case P:case N:case S:break;default:g0=P}var O1=G0;G0=g0;try{return H1()}finally{G0=O1}}function Y1(g0){var H1;switch(G0){case I:case b:case P:H1=P;break;default:H1=G0;break}var O1=G0;G0=H1;try{return g0()}finally{G0=O1}}function m0(g0){var H1=G0;return function(){var O1=G0;G0=H1;try{return g0.apply(this,arguments)}finally{G0=O1}}}function $1(g0,H1,O1){var n1=oP.unstable_now(),q4;if(typeof O1==="object"&&O1!==null){var u4=O1.delay;if(typeof u4==="number"&&u4>0)q4=n1+u4;else q4=n1}else q4=n1;var N4;switch(g0){case I:N4=E;break;case b:N4=j;break;case S:N4=i;break;case N:N4=r;break;case P:default:N4=u;break}var e4=q4+N4,f1={id:Q0++,callback:H1,priorityLevel:g0,startTime:q4,expirationTime:e4,sortIndex:-1};if(q4>n1){if(f1.sortIndex=q4,_(D,f1),q(d)===null&&f1===q(D)){if(S0)u7();else S0=!0;N7(y0,q4-n1)}}else if(f1.sortIndex=e4,_(d,f1),!K0&&!F0)K0=!0,V4(z0);return f1}function v1(){}function m(){if(!K0&&!F0)K0=!0,V4(z0)}function N0(){return q(d)}function V0(g0){g0.callback=null}function L1(){return G0}var o1=!1,R1=null,A0=-1,Z1=U,S1=-1;function a1(){var g0=oP.unstable_now()-S1;if(g0<Z1)return!1;return!0}function v4(){}function G4(g0){if(g0<0||g0>125){console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported");return}if(g0>0)Z1=Math.floor(1000/g0);else Z1=U}var I7=function(){if(R1!==null){var g0=oP.unstable_now();S1=g0;var H1=!0,O1=!0;try{O1=R1(H1,g0)}finally{if(O1)P4();else o1=!1,R1=null}}else o1=!1},P4;if(typeof Y0==="function")P4=function(){Y0(I7)};else if(typeof MessageChannel<"u"){var T7=new MessageChannel,f4=T7.port2;T7.port1.onmessage=I7,P4=function(){f4.postMessage(null)}}else P4=function(){P0(I7,0)};function V4(g0){if(R1=g0,!o1)o1=!0,P4()}function N7(g0,H1){A0=P0(function(){g0(oP.unstable_now())},H1)}function u7(){a(A0),A0=-1}var l4=v4,Q7=null;if(oP.unstable_IdlePriority=S,oP.unstable_ImmediatePriority=I,oP.unstable_LowPriority=N,oP.unstable_NormalPriority=P,oP.unstable_Profiling=Q7,oP.unstable_UserBlockingPriority=b,oP.unstable_cancelCallback=V0,oP.unstable_continueExecution=m,oP.unstable_forceFrameRate=G4,oP.unstable_getCurrentPriorityLevel=L1,oP.unstable_getFirstCallbackNode=N0,oP.unstable_next=Y1,oP.unstable_pauseExecution=v1,oP.unstable_requestPaint=l4,oP.unstable_runWithPriority=p0,oP.unstable_scheduleCallback=$1,oP.unstable_shouldYield=a1,oP.unstable_wrapCallback=m0,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function")__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var AO=Rz((aP)=>{var hZ=B0(V1()),L4=B0(PO());(function(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function")__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var Y=hZ.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,G=!1;function U(z){G=z}function _(z){if(!G){for(var Q=arguments.length,X=Array(Q>1?Q-1:0),Z=1;Z<Q;Z++)X[Z-1]=arguments[Z];R("warn",z,X)}}function q(z){if(!G){for(var Q=arguments.length,X=Array(Q>1?Q-1:0),Z=1;Z<Q;Z++)X[Z-1]=arguments[Z];R("error",z,X)}}function R(z,Q,X){{var Z=Y.ReactDebugCurrentFrame,J=Z.getStackAddendum();if(J!=="")Q+="%s",X=X.concat([J]);var $=X.map(function(H){return String(H)});$.unshift("Warning: "+Q),Function.prototype.apply.call(console[z],console,$)}}var K=0,O=1,T=2,I=3,b=4,P=5,N=6,S=7,f=8,V=9,x=10,v=11,p=12,A=13,E=14,j=15,u=16,r=17,i=18,d=19,D=21,Q0=22,n=23,G0=24,F0=25,K0=!0,S0=!1,P0=!1,a=!1,Y0=!1,U0=!0,H0=!1,y0=!0,z0=!0,v0=!0,p0=!0,Y1=new Set,m0={},$1={};function v1(z,Q){m(z,Q),m(z+"Capture",Q)}function m(z,Q){if(m0[z])q("EventRegistry: More than one plugin attempted to publish the same registration name, `%s`.",z);m0[z]=Q;{var X=z.toLowerCase();if($1[X]=z,z==="onDoubleClick")$1.ondblclick=z}for(var Z=0;Z<Q.length;Z++)Y1.add(Q[Z])}var N0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",V0=Object.prototype.hasOwnProperty;function L1(z){{var Q=typeof Symbol==="function"&&Symbol.toStringTag,X=Q&&z[Symbol.toStringTag]||z.constructor.name||"Object";return X}}function o1(z){try{return R1(z),!1}catch(Q){return!0}}function R1(z){return""+z}function A0(z,Q){if(o1(z))return q("The provided `%s` attribute is an unsupported type %s. This value must be coerced to a string before before using it here.",Q,L1(z)),R1(z)}function Z1(z){if(o1(z))return q("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",L1(z)),R1(z)}function S1(z,Q){if(o1(z))return q("The provided `%s` prop is an unsupported type %s. This value must be coerced to a string before before using it here.",Q,L1(z)),R1(z)}function a1(z,Q){if(o1(z))return q("The provided `%s` CSS property is an unsupported type %s. This value must be coerced to a string before before using it here.",Q,L1(z)),R1(z)}function v4(z){if(o1(z))return q("The provided HTML markup uses a value of unsupported type %s. This value must be coerced to a string before before using it here.",L1(z)),R1(z)}function G4(z){if(o1(z))return q("Form field values (value, checked, defaultValue, or defaultChecked props) must be strings, not %s. This value must be coerced to a string before before using it here.",L1(z)),R1(z)}var I7=0,P4=1,T7=2,f4=3,V4=4,N7=5,u7=6,l4=":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",Q7=l4+"\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",g0=new RegExp("^["+l4+"]["+Q7+"]*$"),H1={},O1={};function n1(z){if(V0.call(O1,z))return!0;if(V0.call(H1,z))return!1;if(g0.test(z))return O1[z]=!0,!0;return H1[z]=!0,q("Invalid attribute name: `%s`",z),!1}function q4(z,Q,X){if(Q!==null)return Q.type===I7;if(X)return!1;if(z.length>2&&(z[0]==="o"||z[0]==="O")&&(z[1]==="n"||z[1]==="N"))return!0;return!1}function u4(z,Q,X,Z){if(X!==null&&X.type===I7)return!1;switch(typeof Q){case"function":case"symbol":return!0;case"boolean":{if(Z)return!1;if(X!==null)return!X.acceptsBooleans;else{var J=z.toLowerCase().slice(0,5);return J!=="data-"&&J!=="aria-"}}default:return!1}}function N4(z,Q,X,Z){if(Q===null||typeof Q>"u")return!0;if(u4(z,Q,X,Z))return!0;if(Z)return!1;if(X!==null)switch(X.type){case f4:return!Q;case V4:return Q===!1;case N7:return isNaN(Q);case u7:return isNaN(Q)||Q<1}return!1}function e4(z){return k1.hasOwnProperty(z)?k1[z]:null}function f1(z,Q,X,Z,J,$,H){this.acceptsBooleans=Q===T7||Q===f4||Q===V4,this.attributeName=Z,this.attributeNamespace=J,this.mustUseProperty=X,this.propertyName=z,this.type=Q,this.sanitizeURL=$,this.removeEmptyString=H}var k1={},r7=["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"];r7.forEach(function(z){k1[z]=new f1(z,I7,!1,z,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(z){var Q=z[0],X=z[1];k1[Q]=new f1(Q,P4,!1,X,null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(z){k1[z]=new f1(z,T7,!1,z.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(z){k1[z]=new f1(z,T7,!1,z,null,!1,!1)}),["allowFullScreen","async","autoFocus","autoPlay","controls","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"].forEach(function(z){k1[z]=new f1(z,f4,!1,z.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(z){k1[z]=new f1(z,f4,!0,z,null,!1,!1)}),["capture","download"].forEach(function(z){k1[z]=new f1(z,V4,!1,z,null,!1,!1)}),["cols","rows","size","span"].forEach(function(z){k1[z]=new f1(z,u7,!1,z,null,!1,!1)}),["rowSpan","start"].forEach(function(z){k1[z]=new f1(z,N7,!1,z.toLowerCase(),null,!1,!1)});var M7=/[\-\:]([a-z])/g,s7=function(z){return z[1].toUpperCase()};["accent-height","alignment-baseline","arabic-form","baseline-shift","cap-height","clip-path","clip-rule","color-interpolation","color-interpolation-filters","color-profile","color-rendering","dominant-baseline","enable-background","fill-opacity","fill-rule","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","glyph-name","glyph-orientation-horizontal","glyph-orientation-vertical","horiz-adv-x","horiz-origin-x","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","overline-position","overline-thickness","paint-order","panose-1","pointer-events","rendering-intent","shape-rendering","stop-color","stop-opacity","strikethrough-position","strikethrough-thickness","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-rendering","underline-position","underline-thickness","unicode-bidi","unicode-range","units-per-em","v-alphabetic","v-hanging","v-ideographic","v-mathematical","vector-effect","vert-adv-y","vert-origin-x","vert-origin-y","word-spacing","writing-mode","xmlns:xlink","x-height"].forEach(function(z){var Q=z.replace(M7,s7);k1[Q]=new f1(Q,P4,!1,z,null,!1,!1)}),["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(function(z){var Q=z.replace(M7,s7);k1[Q]=new f1(Q,P4,!1,z,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(z){var Q=z.replace(M7,s7);k1[Q]=new f1(Q,P4,!1,z,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(z){k1[z]=new f1(z,P4,!1,z.toLowerCase(),null,!1,!1)});var $6="xlinkHref";k1[$6]=new f1("xlinkHref",P4,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(z){k1[z]=new f1(z,P4,!1,z.toLowerCase(),null,!0,!0)});var p5=/^[\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,H6=!1;function S5(z){if(!H6&&p5.test(z))H6=!0,q("A future version of React will block javascript: URLs as a security precaution. Use event handlers instead if you can. If you need to generate unsafe HTML try using dangerouslySetInnerHTML instead. React was passed %s.",JSON.stringify(z))}function x7(z,Q,X,Z){if(Z.mustUseProperty){var J=Z.propertyName;return z[J]}else{if(A0(X,Q),Z.sanitizeURL)S5(""+X);var $=Z.attributeName,H=null;if(Z.type===V4){if(z.hasAttribute($)){var B=z.getAttribute($);if(B==="")return!0;if(N4(Q,X,Z,!1))return B;if(B===""+X)return X;return B}}else if(z.hasAttribute($)){if(N4(Q,X,Z,!1))return z.getAttribute($);if(Z.type===f4)return X;H=z.getAttribute($)}if(N4(Q,X,Z,!1))return H===null?X:H;else if(H===""+X)return X;else return H}}function d5(z,Q,X,Z){{if(!n1(Q))return;if(!z.hasAttribute(Q))return X===void 0?void 0:null;var J=z.getAttribute(Q);if(A0(X,Q),J===""+X)return X;return J}}function p1(z,Q,X,Z){var J=e4(Q);if(q4(Q,J,Z))return;if(N4(Q,X,J,Z))X=null;if(Z||J===null){if(n1(Q)){var $=Q;if(X===null)z.removeAttribute($);else A0(X,Q),z.setAttribute($,""+X)}return}var H=J.mustUseProperty;if(H){var B=J.propertyName;if(X===null){var W=J.type;z[B]=W===f4?!1:""}else z[B]=X;return}var{attributeName:w,attributeNamespace:k}=J;if(X===null)z.removeAttribute(w);else{var l=J.type,c;if(l===f4||l===V4&&X===!0)c="";else if(A0(X,w),c=""+X,J.sanitizeURL)S5(c.toString());if(k)z.setAttributeNS(k,w,c);else z.setAttribute(w,c)}}var U4=Symbol.for("react.element"),F4=Symbol.for("react.portal"),t1=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),W0=Symbol.for("react.profiler"),w0=Symbol.for("react.provider"),C=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),L0=Symbol.for("react.suspense"),k0=Symbol.for("react.suspense_list"),u0=Symbol.for("react.memo"),Q1=Symbol.for("react.lazy"),a0=Symbol.for("react.scope"),R0=Symbol.for("react.debug_trace_mode"),D0=Symbol.for("react.offscreen"),J1=Symbol.for("react.legacy_hidden"),d1=Symbol.for("react.cache"),B4=Symbol.for("react.tracing_marker"),t7=Symbol.iterator,N5="@@iterator";function h4(z){if(z===null||typeof z!=="object")return null;var Q=t7&&z[t7]||z[N5];if(typeof Q==="function")return Q;return null}var g1=Object.assign,I6=0,G6,pQ,dQ,cQ,lQ,iQ,oQ;function aQ(){}aQ.__reactDisabledLog=!0;function lZ(){{if(I6===0){G6=console.log,pQ=console.info,dQ=console.warn,cQ=console.error,lQ=console.group,iQ=console.groupCollapsed,oQ=console.groupEnd;var z={configurable:!0,enumerable:!0,value:aQ,writable:!0};Object.defineProperties(console,{info:z,log:z,warn:z,error:z,group:z,groupCollapsed:z,groupEnd:z})}I6++}}function S2(){{if(I6--,I6===0){var z={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:g1({},z,{value:G6}),info:g1({},z,{value:pQ}),warn:g1({},z,{value:dQ}),error:g1({},z,{value:cQ}),group:g1({},z,{value:lQ}),groupCollapsed:g1({},z,{value:iQ}),groupEnd:g1({},z,{value:oQ})})}if(I6<0)q("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var nQ=Y.ReactCurrentDispatcher,g8;function v5(z,Q,X){{if(g8===void 0)try{throw Error()}catch(J){var Z=J.stack.trim().match(/\n( *(at )?)/);g8=Z&&Z[1]||""}return`
|
|
24
|
+
`+g8+z}}var Z8=!1,J8;{var vz=typeof WeakMap==="function"?WeakMap:Map;J8=new vz}function rQ(z,Q){if(!z||Z8)return"";{var X=J8.get(z);if(X!==void 0)return X}var Z;Z8=!0;var J=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var $;$=nQ.current,nQ.current=null,lZ();try{if(Q){var H=function(){throw Error()};if(Object.defineProperty(H.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==="object"&&Reflect.construct){try{Reflect.construct(H,[])}catch(J0){Z=J0}Reflect.construct(z,[],H)}else{try{H.call()}catch(J0){Z=J0}z.call(H.prototype)}}else{try{throw Error()}catch(J0){Z=J0}z()}}catch(J0){if(J0&&Z&&typeof J0.stack==="string"){var B=J0.stack.split(`
|
|
25
|
+
`),W=Z.stack.split(`
|
|
26
|
+
`),w=B.length-1,k=W.length-1;while(w>=1&&k>=0&&B[w]!==W[k])k--;for(;w>=1&&k>=0;w--,k--)if(B[w]!==W[k]){if(w!==1||k!==1)do if(w--,k--,k<0||B[w]!==W[k]){var l=`
|
|
27
|
+
`+B[w].replace(" at new "," at ");if(z.displayName&&l.includes("<anonymous>"))l=l.replace("<anonymous>",z.displayName);if(typeof z==="function")J8.set(z,l);return l}while(w>=1&&k>=0);break}}}finally{Z8=!1,nQ.current=$,S2(),Error.prepareStackTrace=J}var c=z?z.displayName||z.name:"",Z0=c?v5(c):"";if(typeof z==="function")J8.set(z,Z0);return Z0}function iZ(z,Q,X){return rQ(z,!0)}function sQ(z,Q,X){return rQ(z,!1)}function v2(z){var Q=z.prototype;return!!(Q&&Q.isReactComponent)}function Y8(z,Q,X){if(z==null)return"";if(typeof z==="function")return rQ(z,v2(z));if(typeof z==="string")return v5(z);switch(z){case L0:return v5("Suspense");case k0:return v5("SuspenseList")}if(typeof z==="object")switch(z.$$typeof){case o:return sQ(z.render);case u0:return Y8(z.type,Q,X);case Q1:{var Z=z,J=Z._payload,$=Z._init;try{return Y8($(J),Q,X)}catch(H){}}}return""}function oZ(z){var Q=z._debugOwner?z._debugOwner.type:null,X=z._debugSource;switch(z.tag){case P:return v5(z.type);case u:return v5("Lazy");case A:return v5("Suspense");case d:return v5("SuspenseList");case K:case T:case j:return sQ(z.type);case v:return sQ(z.type.render);case O:return iZ(z.type);default:return""}}function tQ(z){try{var Q="",X=z;do Q+=oZ(X),X=X.return;while(X);return Q}catch(Z){return`
|
|
28
|
+
Error generating stack: `+Z.message+`
|
|
29
|
+
`+Z.stack}}function fz(z,Q,X){var Z=z.displayName;if(Z)return Z;var J=Q.displayName||Q.name||"";return J!==""?X+"("+J+")":X}function aZ(z){return z.displayName||"Context"}function s1(z){if(z==null)return null;if(typeof z.tag==="number")q("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.");if(typeof z==="function")return z.displayName||z.name||null;if(typeof z==="string")return z;switch(z){case t1:return"Fragment";case F4:return"Portal";case W0:return"Profiler";case y:return"StrictMode";case L0:return"Suspense";case k0:return"SuspenseList"}if(typeof z==="object")switch(z.$$typeof){case C:var Q=z;return aZ(Q)+".Consumer";case w0:var X=z;return aZ(X._context)+".Provider";case o:return fz(z,z.render,"ForwardRef");case u0:var Z=z.displayName||null;if(Z!==null)return Z;return s1(z.type)||"Memo";case Q1:{var J=z,$=J._payload,H=J._init;try{return s1(H($))}catch(B){return null}}}return null}function nZ(z,Q,X){var Z=Q.displayName||Q.name||"";return z.displayName||(Z!==""?X+"("+Z+")":X)}function eQ(z){return z.displayName||"Context"}function y1(z){var{tag:Q,type:X}=z;switch(Q){case G0:return"Cache";case V:var Z=X;return eQ(Z)+".Consumer";case x:var J=X;return eQ(J._context)+".Provider";case i:return"DehydratedFragment";case v:return nZ(X,X.render,"ForwardRef");case S:return"Fragment";case P:return X;case b:return"Portal";case I:return"Root";case N:return"Text";case u:return s1(X);case f:if(X===y)return"StrictMode";return"Mode";case Q0:return"Offscreen";case p:return"Profiler";case D:return"Scope";case A:return"Suspense";case d:return"SuspenseList";case F0:return"TracingMarker";case O:case K:case r:case T:case E:case j:if(typeof X==="function")return X.displayName||X.name||null;if(typeof X==="string")return X;break}return null}var rZ=Y.ReactDebugCurrentFrame,j7=null,E8=!1;function $8(){{if(j7===null)return null;var z=j7._debugOwner;if(z!==null&&typeof z<"u")return y1(z)}return null}function sZ(){{if(j7===null)return"";return tQ(j7)}}function w7(){rZ.getCurrentStack=null,j7=null,E8=!1}function p4(z){rZ.getCurrentStack=z===null?null:sZ,j7=z,E8=!1}function tZ(){return j7}function M5(z){E8=z}function G5(z){return""+z}function q6(z){switch(typeof z){case"boolean":case"number":case"string":case"undefined":return z;case"object":return G4(z),z;default:return""}}var f2={button:!0,checkbox:!0,image:!0,hidden:!0,radio:!0,reset:!0,submit:!0};function hz(z,Q){{if(!(f2[Q.type]||Q.onChange||Q.onInput||Q.readOnly||Q.disabled||Q.value==null))q("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`.");if(!(Q.onChange||Q.readOnly||Q.disabled||Q.checked==null))q("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.")}}function u8(z){var{type:Q,nodeName:X}=z;return X&&X.toLowerCase()==="input"&&(Q==="checkbox"||Q==="radio")}function eZ(z){return z._valueTracker}function H8(z){z._valueTracker=null}function zJ(z){var Q="";if(!z)return Q;if(u8(z))Q=z.checked?"true":"false";else Q=z.value;return Q}function QJ(z){var Q=u8(z)?"checked":"value",X=Object.getOwnPropertyDescriptor(z.constructor.prototype,Q);G4(z[Q]);var Z=""+z[Q];if(z.hasOwnProperty(Q)||typeof X>"u"||typeof X.get!=="function"||typeof X.set!=="function")return;var{get:J,set:$}=X;Object.defineProperty(z,Q,{configurable:!0,get:function(){return J.call(this)},set:function(B){G4(B),Z=""+B,$.call(this,B)}}),Object.defineProperty(z,Q,{enumerable:X.enumerable});var H={getValue:function(){return Z},setValue:function(B){G4(B),Z=""+B},stopTracking:function(){H8(z),delete z[Q]}};return H}function T6(z){if(eZ(z))return;z._valueTracker=QJ(z)}function yz(z){if(!z)return!1;var Q=eZ(z);if(!Q)return!0;var X=Q.getValue(),Z=zJ(z);if(Z!==X)return Q.setValue(Z),!0;return!1}function G8(z){if(z=z||(typeof document<"u"?document:void 0),typeof z>"u")return null;try{return z.activeElement||z.body}catch(Q){return z.body}}var Vz=!1,XJ=!1,ZJ=!1,JJ=!1;function YJ(z){var Q=z.type==="checkbox"||z.type==="radio";return Q?z.checked!=null:z.value!=null}function L(z,Q){var X=z,Z=Q.checked,J=g1({},Q,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:Z!=null?Z:X._wrapperState.initialChecked});return J}function g(z,Q){{if(hz("input",Q),Q.checked!==void 0&&Q.defaultChecked!==void 0&&!XJ)q("%s contains an input of type %s with both checked and defaultChecked props. Input elements must be either controlled or uncontrolled (specify either the checked prop, or the defaultChecked prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components",$8()||"A component",Q.type),XJ=!0;if(Q.value!==void 0&&Q.defaultValue!==void 0&&!Vz)q("%s contains an input of type %s with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components",$8()||"A component",Q.type),Vz=!0}var X=z,Z=Q.defaultValue==null?"":Q.defaultValue;X._wrapperState={initialChecked:Q.checked!=null?Q.checked:Q.defaultChecked,initialValue:q6(Q.value!=null?Q.value:Z),controlled:YJ(Q)}}function X0(z,Q){var X=z,Z=Q.checked;if(Z!=null)p1(X,"checked",Z,!1)}function q0(z,Q){var X=z;{var Z=YJ(Q);if(!X._wrapperState.controlled&&Z&&!JJ)q("A component is changing an uncontrolled input to be controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components"),JJ=!0;if(X._wrapperState.controlled&&!Z&&!ZJ)q("A component is changing a controlled input to be uncontrolled. This is likely caused by the value changing from a defined to undefined, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components"),ZJ=!0}X0(z,Q);var J=q6(Q.value),$=Q.type;if(J!=null){if($==="number"){if(J===0&&X.value===""||X.value!=J)X.value=G5(J)}else if(X.value!==G5(J))X.value=G5(J)}else if($==="submit"||$==="reset"){X.removeAttribute("value");return}if(Q.hasOwnProperty("value"))P1(X,Q.type,J);else if(Q.hasOwnProperty("defaultValue"))P1(X,Q.type,q6(Q.defaultValue));if(Q.checked==null&&Q.defaultChecked!=null)X.defaultChecked=!!Q.defaultChecked}function h0(z,Q,X){var Z=z;if(Q.hasOwnProperty("value")||Q.hasOwnProperty("defaultValue")){var J=Q.type,$=J==="submit"||J==="reset";if($&&(Q.value===void 0||Q.value===null))return;var H=G5(Z._wrapperState.initialValue);if(!X){if(H!==Z.value)Z.value=H}Z.defaultValue=H}var B=Z.name;if(B!=="")Z.name="";if(Z.defaultChecked=!Z.defaultChecked,Z.defaultChecked=!!Z._wrapperState.initialChecked,B!=="")Z.name=B}function M1(z,Q){var X=z;q0(X,Q),e0(X,Q)}function e0(z,Q){var X=Q.name;if(Q.type==="radio"&&X!=null){var Z=z;while(Z.parentNode)Z=Z.parentNode;A0(X,"name");var J=Z.querySelectorAll("input[name="+JSON.stringify(""+X)+'][type="radio"]');for(var $=0;$<J.length;$++){var H=J[$];if(H===z||H.form!==z.form)continue;var B=iJ(H);if(!B)throw Error("ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.");yz(H),q0(H,B)}}}function P1(z,Q,X){if(Q!=="number"||G8(z.ownerDocument)!==z){if(X==null)z.defaultValue=G5(z._wrapperState.initialValue);else if(z.defaultValue!==G5(X))z.defaultValue=G5(X)}}var c1=!1,W4=!1,A4=!1;function I4(z,Q){{if(Q.value==null){if(typeof Q.children==="object"&&Q.children!==null)hZ.Children.forEach(Q.children,function(X){if(X==null)return;if(typeof X==="string"||typeof X==="number")return;if(!W4)W4=!0,q("Cannot infer the option value of complex children. Pass a `value` prop or use a plain string as children to <option>.")});else if(Q.dangerouslySetInnerHTML!=null){if(!A4)A4=!0,q("Pass a `value` prop if you set dangerouslyInnerHTML so React knows which value should be selected.")}}if(Q.selected!=null&&!c1)q("Use the `defaultValue` or `value` props on <select> instead of setting `selected` on <option>."),c1=!0}}function D4(z,Q){if(Q.value!=null)z.setAttribute("value",G5(q6(Q.value)))}var i4=Array.isArray;function Q4(z){return i4(z)}var x8=!1;function Dz(){var z=$8();if(z)return`
|
|
30
|
+
|
|
31
|
+
Check the render method of \``+z+"`.";return""}var zX=["value","defaultValue"];function h2(z){{hz("select",z);for(var Q=0;Q<zX.length;Q++){var X=zX[Q];if(z[X]==null)continue;var Z=Q4(z[X]);if(z.multiple&&!Z)q("The `%s` prop supplied to <select> must be an array if `multiple` is true.%s",X,Dz());else if(!z.multiple&&Z)q("The `%s` prop supplied to <select> must be a scalar value if `multiple` is false.%s",X,Dz())}}}function k6(z,Q,X,Z){var J=z.options;if(Q){var $=X,H={};for(var B=0;B<$.length;B++)H["$"+$[B]]=!0;for(var W=0;W<J.length;W++){var w=H.hasOwnProperty("$"+J[W].value);if(J[W].selected!==w)J[W].selected=w;if(w&&Z)J[W].defaultSelected=!0}}else{var k=G5(q6(X)),l=null;for(var c=0;c<J.length;c++){if(J[c].value===k){if(J[c].selected=!0,Z)J[c].defaultSelected=!0;return}if(l===null&&!J[c].disabled)l=J[c]}if(l!==null)l.selected=!0}}function QX(z,Q){return g1({},Q,{value:void 0})}function XX(z,Q){var X=z;if(h2(Q),X._wrapperState={wasMultiple:!!Q.multiple},Q.value!==void 0&&Q.defaultValue!==void 0&&!x8)q("Select elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled select element and remove one of these props. More info: https://reactjs.org/link/controlled-components"),x8=!0}function y2(z,Q){var X=z;X.multiple=!!Q.multiple;var Z=Q.value;if(Z!=null)k6(X,!!Q.multiple,Z,!1);else if(Q.defaultValue!=null)k6(X,!!Q.multiple,Q.defaultValue,!0)}function bK(z,Q){var X=z,Z=X._wrapperState.wasMultiple;X._wrapperState.wasMultiple=!!Q.multiple;var J=Q.value;if(J!=null)k6(X,!!Q.multiple,J,!1);else if(Z!==!!Q.multiple)if(Q.defaultValue!=null)k6(X,!!Q.multiple,Q.defaultValue,!0);else k6(X,!!Q.multiple,Q.multiple?[]:"",!1)}function PK(z,Q){var X=z,Z=Q.value;if(Z!=null)k6(X,!!Q.multiple,Z,!1)}var OG=!1;function V2(z,Q){var X=z;if(Q.dangerouslySetInnerHTML!=null)throw Error("`dangerouslySetInnerHTML` does not make sense on <textarea>.");var Z=g1({},Q,{value:void 0,defaultValue:void 0,children:G5(X._wrapperState.initialValue)});return Z}function KG(z,Q){var X=z;if(hz("textarea",Q),Q.value!==void 0&&Q.defaultValue!==void 0&&!OG)q("%s contains a textarea with both value and defaultValue props. Textarea elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled textarea and remove one of these props. More info: https://reactjs.org/link/controlled-components",$8()||"A component"),OG=!0;var Z=Q.value;if(Z==null){var{children:J,defaultValue:$}=Q;if(J!=null){q("Use the `defaultValue` or `value` props instead of setting children on <textarea>.");{if($!=null)throw Error("If you supply `defaultValue` on a <textarea>, do not pass children.");if(Q4(J)){if(J.length>1)throw Error("<textarea> can only have at most one child.");J=J[0]}$=J}}if($==null)$="";Z=$}X._wrapperState={initialValue:q6(Z)}}function _G(z,Q){var X=z,Z=q6(Q.value),J=q6(Q.defaultValue);if(Z!=null){var $=G5(Z);if($!==X.value)X.value=$;if(Q.defaultValue==null&&X.defaultValue!==$)X.defaultValue=$}if(J!=null)X.defaultValue=G5(J)}function LG(z,Q){var X=z,Z=X.textContent;if(Z===X._wrapperState.initialValue){if(Z!==""&&Z!==null)X.value=Z}}function AK(z,Q){_G(z,Q)}var C6="http://www.w3.org/1999/xhtml",IK="http://www.w3.org/1998/Math/MathML",D2="http://www.w3.org/2000/svg";function m2(z){switch(z){case"svg":return D2;case"math":return IK;default:return C6}}function g2(z,Q){if(z==null||z===C6)return m2(Q);if(z===D2&&Q==="foreignObject")return C6;return z}var TK=function(z){if(typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction)return function(Q,X,Z,J){MSApp.execUnsafeLocalFunction(function(){return z(Q,X,Z,J)})};else return z},$J,RG=TK(function(z,Q){if(z.namespaceURI===D2){if(!("innerHTML"in z)){$J=$J||document.createElement("div"),$J.innerHTML="<svg>"+Q.valueOf().toString()+"</svg>";var X=$J.firstChild;while(z.firstChild)z.removeChild(z.firstChild);while(X.firstChild)z.appendChild(X.firstChild);return}}z.innerHTML=Q}),q5=1,S6=3,X7=8,v6=9,E2=11,HJ=function(z,Q){if(Q){var X=z.firstChild;if(X&&X===z.lastChild&&X.nodeType===S6){X.nodeValue=Q;return}}z.textContent=Q},kK={animation:["animationDelay","animationDirection","animationDuration","animationFillMode","animationIterationCount","animationName","animationPlayState","animationTimingFunction"],background:["backgroundAttachment","backgroundClip","backgroundColor","backgroundImage","backgroundOrigin","backgroundPositionX","backgroundPositionY","backgroundRepeat","backgroundSize"],backgroundPosition:["backgroundPositionX","backgroundPositionY"],border:["borderBottomColor","borderBottomStyle","borderBottomWidth","borderImageOutset","borderImageRepeat","borderImageSlice","borderImageSource","borderImageWidth","borderLeftColor","borderLeftStyle","borderLeftWidth","borderRightColor","borderRightStyle","borderRightWidth","borderTopColor","borderTopStyle","borderTopWidth"],borderBlockEnd:["borderBlockEndColor","borderBlockEndStyle","borderBlockEndWidth"],borderBlockStart:["borderBlockStartColor","borderBlockStartStyle","borderBlockStartWidth"],borderBottom:["borderBottomColor","borderBottomStyle","borderBottomWidth"],borderColor:["borderBottomColor","borderLeftColor","borderRightColor","borderTopColor"],borderImage:["borderImageOutset","borderImageRepeat","borderImageSlice","borderImageSource","borderImageWidth"],borderInlineEnd:["borderInlineEndColor","borderInlineEndStyle","borderInlineEndWidth"],borderInlineStart:["borderInlineStartColor","borderInlineStartStyle","borderInlineStartWidth"],borderLeft:["borderLeftColor","borderLeftStyle","borderLeftWidth"],borderRadius:["borderBottomLeftRadius","borderBottomRightRadius","borderTopLeftRadius","borderTopRightRadius"],borderRight:["borderRightColor","borderRightStyle","borderRightWidth"],borderStyle:["borderBottomStyle","borderLeftStyle","borderRightStyle","borderTopStyle"],borderTop:["borderTopColor","borderTopStyle","borderTopWidth"],borderWidth:["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth"],columnRule:["columnRuleColor","columnRuleStyle","columnRuleWidth"],columns:["columnCount","columnWidth"],flex:["flexBasis","flexGrow","flexShrink"],flexFlow:["flexDirection","flexWrap"],font:["fontFamily","fontFeatureSettings","fontKerning","fontLanguageOverride","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontVariantAlternates","fontVariantCaps","fontVariantEastAsian","fontVariantLigatures","fontVariantNumeric","fontVariantPosition","fontWeight","lineHeight"],fontVariant:["fontVariantAlternates","fontVariantCaps","fontVariantEastAsian","fontVariantLigatures","fontVariantNumeric","fontVariantPosition"],gap:["columnGap","rowGap"],grid:["gridAutoColumns","gridAutoFlow","gridAutoRows","gridTemplateAreas","gridTemplateColumns","gridTemplateRows"],gridArea:["gridColumnEnd","gridColumnStart","gridRowEnd","gridRowStart"],gridColumn:["gridColumnEnd","gridColumnStart"],gridColumnGap:["columnGap"],gridGap:["columnGap","rowGap"],gridRow:["gridRowEnd","gridRowStart"],gridRowGap:["rowGap"],gridTemplate:["gridTemplateAreas","gridTemplateColumns","gridTemplateRows"],listStyle:["listStyleImage","listStylePosition","listStyleType"],margin:["marginBottom","marginLeft","marginRight","marginTop"],marker:["markerEnd","markerMid","markerStart"],mask:["maskClip","maskComposite","maskImage","maskMode","maskOrigin","maskPositionX","maskPositionY","maskRepeat","maskSize"],maskPosition:["maskPositionX","maskPositionY"],outline:["outlineColor","outlineStyle","outlineWidth"],overflow:["overflowX","overflowY"],padding:["paddingBottom","paddingLeft","paddingRight","paddingTop"],placeContent:["alignContent","justifyContent"],placeItems:["alignItems","justifyItems"],placeSelf:["alignSelf","justifySelf"],textDecoration:["textDecorationColor","textDecorationLine","textDecorationStyle"],textEmphasis:["textEmphasisColor","textEmphasisStyle"],transition:["transitionDelay","transitionDuration","transitionProperty","transitionTimingFunction"],wordWrap:["overflowWrap"]},ZX={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};function CK(z,Q){return z+Q.charAt(0).toUpperCase()+Q.substring(1)}var SK=["Webkit","ms","Moz","O"];Object.keys(ZX).forEach(function(z){SK.forEach(function(Q){ZX[CK(Q,z)]=ZX[z]})});function u2(z,Q,X){var Z=Q==null||typeof Q==="boolean"||Q==="";if(Z)return"";if(!X&&typeof Q==="number"&&Q!==0&&!(ZX.hasOwnProperty(z)&&ZX[z]))return Q+"px";return a1(Q,z),(""+Q).trim()}var vK=/([A-Z])/g,fK=/^ms-/;function hK(z){return z.replace(vK,"-$1").toLowerCase().replace(fK,"-ms-")}var NG=function(){};{var yK=/^(?:webkit|moz|o)[A-Z]/,VK=/^-ms-/,DK=/-(.)/g,MG=/;\s*$/,mz={},x2={},wG=!1,FG=!1,mK=function(z){return z.replace(DK,function(Q,X){return X.toUpperCase()})},gK=function(z){if(mz.hasOwnProperty(z)&&mz[z])return;mz[z]=!0,q("Unsupported style property %s. Did you mean %s?",z,mK(z.replace(VK,"ms-")))},EK=function(z){if(mz.hasOwnProperty(z)&&mz[z])return;mz[z]=!0,q("Unsupported vendor-prefixed style property %s. Did you mean %s?",z,z.charAt(0).toUpperCase()+z.slice(1))},uK=function(z,Q){if(x2.hasOwnProperty(Q)&&x2[Q])return;x2[Q]=!0,q(`Style property values shouldn't contain a semicolon. Try "%s: %s" instead.`,z,Q.replace(MG,""))},xK=function(z,Q){if(wG)return;wG=!0,q("`NaN` is an invalid value for the `%s` css style property.",z)},jK=function(z,Q){if(FG)return;FG=!0,q("`Infinity` is an invalid value for the `%s` css style property.",z)};NG=function(z,Q){if(z.indexOf("-")>-1)gK(z);else if(yK.test(z))EK(z);else if(MG.test(Q))uK(z,Q);if(typeof Q==="number"){if(isNaN(Q))xK(z,Q);else if(!isFinite(Q))jK(z,Q)}}}var pK=NG;function dK(z){{var Q="",X="";for(var Z in z){if(!z.hasOwnProperty(Z))continue;var J=z[Z];if(J!=null){var $=Z.indexOf("--")===0;Q+=X+($?Z:hK(Z))+":",Q+=u2(Z,J,$),X=";"}}return Q||null}}function bG(z,Q){var X=z.style;for(var Z in Q){if(!Q.hasOwnProperty(Z))continue;var J=Z.indexOf("--")===0;if(!J)pK(Z,Q[Z]);var $=u2(Z,Q[Z],J);if(Z==="float")Z="cssFloat";if(J)X.setProperty(Z,$);else X[Z]=$}}function cK(z){return z==null||typeof z==="boolean"||z===""}function PG(z){var Q={};for(var X in z){var Z=kK[X]||[X];for(var J=0;J<Z.length;J++)Q[Z[J]]=X}return Q}function lK(z,Q){{if(!Q)return;var X=PG(z),Z=PG(Q),J={};for(var $ in X){var H=X[$],B=Z[$];if(B&&H!==B){var W=H+","+B;if(J[W])continue;J[W]=!0,q("%s a style property during rerender (%s) when a conflicting property is set (%s) can lead to styling bugs. To avoid this, don't mix shorthand and non-shorthand properties for the same value; instead, replace the shorthand with separate values.",cK(z[H])?"Removing":"Updating",H,B)}}}}var iK={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},oK=g1({menuitem:!0},iK),aK="__html";function j2(z,Q){if(!Q)return;if(oK[z]){if(Q.children!=null||Q.dangerouslySetInnerHTML!=null)throw Error(z+" is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.")}if(Q.dangerouslySetInnerHTML!=null){if(Q.children!=null)throw Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`.");if(typeof Q.dangerouslySetInnerHTML!=="object"||!(aK in Q.dangerouslySetInnerHTML))throw Error("`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://reactjs.org/link/dangerously-set-inner-html for more information.")}if(!Q.suppressContentEditableWarning&&Q.contentEditable&&Q.children!=null)q("A component is `contentEditable` and contains `children` managed by React. It is now your responsibility to guarantee that none of those nodes are unexpectedly modified or duplicated. This is probably not intentional.");if(Q.style!=null&&typeof Q.style!=="object")throw Error("The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.")}function j8(z,Q){if(z.indexOf("-")===-1)return typeof Q.is==="string";switch(z){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 GJ={accept:"accept",acceptcharset:"acceptCharset","accept-charset":"acceptCharset",accesskey:"accessKey",action:"action",allowfullscreen:"allowFullScreen",alt:"alt",as:"as",async:"async",autocapitalize:"autoCapitalize",autocomplete:"autoComplete",autocorrect:"autoCorrect",autofocus:"autoFocus",autoplay:"autoPlay",autosave:"autoSave",capture:"capture",cellpadding:"cellPadding",cellspacing:"cellSpacing",challenge:"challenge",charset:"charSet",checked:"checked",children:"children",cite:"cite",class:"className",classid:"classID",classname:"className",cols:"cols",colspan:"colSpan",content:"content",contenteditable:"contentEditable",contextmenu:"contextMenu",controls:"controls",controlslist:"controlsList",coords:"coords",crossorigin:"crossOrigin",dangerouslysetinnerhtml:"dangerouslySetInnerHTML",data:"data",datetime:"dateTime",default:"default",defaultchecked:"defaultChecked",defaultvalue:"defaultValue",defer:"defer",dir:"dir",disabled:"disabled",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback",download:"download",draggable:"draggable",enctype:"encType",enterkeyhint:"enterKeyHint",for:"htmlFor",form:"form",formmethod:"formMethod",formaction:"formAction",formenctype:"formEncType",formnovalidate:"formNoValidate",formtarget:"formTarget",frameborder:"frameBorder",headers:"headers",height:"height",hidden:"hidden",high:"high",href:"href",hreflang:"hrefLang",htmlfor:"htmlFor",httpequiv:"httpEquiv","http-equiv":"httpEquiv",icon:"icon",id:"id",imagesizes:"imageSizes",imagesrcset:"imageSrcSet",innerhtml:"innerHTML",inputmode:"inputMode",integrity:"integrity",is:"is",itemid:"itemID",itemprop:"itemProp",itemref:"itemRef",itemscope:"itemScope",itemtype:"itemType",keyparams:"keyParams",keytype:"keyType",kind:"kind",label:"label",lang:"lang",list:"list",loop:"loop",low:"low",manifest:"manifest",marginwidth:"marginWidth",marginheight:"marginHeight",max:"max",maxlength:"maxLength",media:"media",mediagroup:"mediaGroup",method:"method",min:"min",minlength:"minLength",multiple:"multiple",muted:"muted",name:"name",nomodule:"noModule",nonce:"nonce",novalidate:"noValidate",open:"open",optimum:"optimum",pattern:"pattern",placeholder:"placeholder",playsinline:"playsInline",poster:"poster",preload:"preload",profile:"profile",radiogroup:"radioGroup",readonly:"readOnly",referrerpolicy:"referrerPolicy",rel:"rel",required:"required",reversed:"reversed",role:"role",rows:"rows",rowspan:"rowSpan",sandbox:"sandbox",scope:"scope",scoped:"scoped",scrolling:"scrolling",seamless:"seamless",selected:"selected",shape:"shape",size:"size",sizes:"sizes",span:"span",spellcheck:"spellCheck",src:"src",srcdoc:"srcDoc",srclang:"srcLang",srcset:"srcSet",start:"start",step:"step",style:"style",summary:"summary",tabindex:"tabIndex",target:"target",title:"title",type:"type",usemap:"useMap",value:"value",width:"width",wmode:"wmode",wrap:"wrap",about:"about",accentheight:"accentHeight","accent-height":"accentHeight",accumulate:"accumulate",additive:"additive",alignmentbaseline:"alignmentBaseline","alignment-baseline":"alignmentBaseline",allowreorder:"allowReorder",alphabetic:"alphabetic",amplitude:"amplitude",arabicform:"arabicForm","arabic-form":"arabicForm",ascent:"ascent",attributename:"attributeName",attributetype:"attributeType",autoreverse:"autoReverse",azimuth:"azimuth",basefrequency:"baseFrequency",baselineshift:"baselineShift","baseline-shift":"baselineShift",baseprofile:"baseProfile",bbox:"bbox",begin:"begin",bias:"bias",by:"by",calcmode:"calcMode",capheight:"capHeight","cap-height":"capHeight",clip:"clip",clippath:"clipPath","clip-path":"clipPath",clippathunits:"clipPathUnits",cliprule:"clipRule","clip-rule":"clipRule",color:"color",colorinterpolation:"colorInterpolation","color-interpolation":"colorInterpolation",colorinterpolationfilters:"colorInterpolationFilters","color-interpolation-filters":"colorInterpolationFilters",colorprofile:"colorProfile","color-profile":"colorProfile",colorrendering:"colorRendering","color-rendering":"colorRendering",contentscripttype:"contentScriptType",contentstyletype:"contentStyleType",cursor:"cursor",cx:"cx",cy:"cy",d:"d",datatype:"datatype",decelerate:"decelerate",descent:"descent",diffuseconstant:"diffuseConstant",direction:"direction",display:"display",divisor:"divisor",dominantbaseline:"dominantBaseline","dominant-baseline":"dominantBaseline",dur:"dur",dx:"dx",dy:"dy",edgemode:"edgeMode",elevation:"elevation",enablebackground:"enableBackground","enable-background":"enableBackground",end:"end",exponent:"exponent",externalresourcesrequired:"externalResourcesRequired",fill:"fill",fillopacity:"fillOpacity","fill-opacity":"fillOpacity",fillrule:"fillRule","fill-rule":"fillRule",filter:"filter",filterres:"filterRes",filterunits:"filterUnits",floodopacity:"floodOpacity","flood-opacity":"floodOpacity",floodcolor:"floodColor","flood-color":"floodColor",focusable:"focusable",fontfamily:"fontFamily","font-family":"fontFamily",fontsize:"fontSize","font-size":"fontSize",fontsizeadjust:"fontSizeAdjust","font-size-adjust":"fontSizeAdjust",fontstretch:"fontStretch","font-stretch":"fontStretch",fontstyle:"fontStyle","font-style":"fontStyle",fontvariant:"fontVariant","font-variant":"fontVariant",fontweight:"fontWeight","font-weight":"fontWeight",format:"format",from:"from",fx:"fx",fy:"fy",g1:"g1",g2:"g2",glyphname:"glyphName","glyph-name":"glyphName",glyphorientationhorizontal:"glyphOrientationHorizontal","glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphorientationvertical:"glyphOrientationVertical","glyph-orientation-vertical":"glyphOrientationVertical",glyphref:"glyphRef",gradienttransform:"gradientTransform",gradientunits:"gradientUnits",hanging:"hanging",horizadvx:"horizAdvX","horiz-adv-x":"horizAdvX",horizoriginx:"horizOriginX","horiz-origin-x":"horizOriginX",ideographic:"ideographic",imagerendering:"imageRendering","image-rendering":"imageRendering",in2:"in2",in:"in",inlist:"inlist",intercept:"intercept",k1:"k1",k2:"k2",k3:"k3",k4:"k4",k:"k",kernelmatrix:"kernelMatrix",kernelunitlength:"kernelUnitLength",kerning:"kerning",keypoints:"keyPoints",keysplines:"keySplines",keytimes:"keyTimes",lengthadjust:"lengthAdjust",letterspacing:"letterSpacing","letter-spacing":"letterSpacing",lightingcolor:"lightingColor","lighting-color":"lightingColor",limitingconeangle:"limitingConeAngle",local:"local",markerend:"markerEnd","marker-end":"markerEnd",markerheight:"markerHeight",markermid:"markerMid","marker-mid":"markerMid",markerstart:"markerStart","marker-start":"markerStart",markerunits:"markerUnits",markerwidth:"markerWidth",mask:"mask",maskcontentunits:"maskContentUnits",maskunits:"maskUnits",mathematical:"mathematical",mode:"mode",numoctaves:"numOctaves",offset:"offset",opacity:"opacity",operator:"operator",order:"order",orient:"orient",orientation:"orientation",origin:"origin",overflow:"overflow",overlineposition:"overlinePosition","overline-position":"overlinePosition",overlinethickness:"overlineThickness","overline-thickness":"overlineThickness",paintorder:"paintOrder","paint-order":"paintOrder",panose1:"panose1","panose-1":"panose1",pathlength:"pathLength",patterncontentunits:"patternContentUnits",patterntransform:"patternTransform",patternunits:"patternUnits",pointerevents:"pointerEvents","pointer-events":"pointerEvents",points:"points",pointsatx:"pointsAtX",pointsaty:"pointsAtY",pointsatz:"pointsAtZ",prefix:"prefix",preservealpha:"preserveAlpha",preserveaspectratio:"preserveAspectRatio",primitiveunits:"primitiveUnits",property:"property",r:"r",radius:"radius",refx:"refX",refy:"refY",renderingintent:"renderingIntent","rendering-intent":"renderingIntent",repeatcount:"repeatCount",repeatdur:"repeatDur",requiredextensions:"requiredExtensions",requiredfeatures:"requiredFeatures",resource:"resource",restart:"restart",result:"result",results:"results",rotate:"rotate",rx:"rx",ry:"ry",scale:"scale",security:"security",seed:"seed",shaperendering:"shapeRendering","shape-rendering":"shapeRendering",slope:"slope",spacing:"spacing",specularconstant:"specularConstant",specularexponent:"specularExponent",speed:"speed",spreadmethod:"spreadMethod",startoffset:"startOffset",stddeviation:"stdDeviation",stemh:"stemh",stemv:"stemv",stitchtiles:"stitchTiles",stopcolor:"stopColor","stop-color":"stopColor",stopopacity:"stopOpacity","stop-opacity":"stopOpacity",strikethroughposition:"strikethroughPosition","strikethrough-position":"strikethroughPosition",strikethroughthickness:"strikethroughThickness","strikethrough-thickness":"strikethroughThickness",string:"string",stroke:"stroke",strokedasharray:"strokeDasharray","stroke-dasharray":"strokeDasharray",strokedashoffset:"strokeDashoffset","stroke-dashoffset":"strokeDashoffset",strokelinecap:"strokeLinecap","stroke-linecap":"strokeLinecap",strokelinejoin:"strokeLinejoin","stroke-linejoin":"strokeLinejoin",strokemiterlimit:"strokeMiterlimit","stroke-miterlimit":"strokeMiterlimit",strokewidth:"strokeWidth","stroke-width":"strokeWidth",strokeopacity:"strokeOpacity","stroke-opacity":"strokeOpacity",suppresscontenteditablewarning:"suppressContentEditableWarning",suppresshydrationwarning:"suppressHydrationWarning",surfacescale:"surfaceScale",systemlanguage:"systemLanguage",tablevalues:"tableValues",targetx:"targetX",targety:"targetY",textanchor:"textAnchor","text-anchor":"textAnchor",textdecoration:"textDecoration","text-decoration":"textDecoration",textlength:"textLength",textrendering:"textRendering","text-rendering":"textRendering",to:"to",transform:"transform",typeof:"typeof",u1:"u1",u2:"u2",underlineposition:"underlinePosition","underline-position":"underlinePosition",underlinethickness:"underlineThickness","underline-thickness":"underlineThickness",unicode:"unicode",unicodebidi:"unicodeBidi","unicode-bidi":"unicodeBidi",unicoderange:"unicodeRange","unicode-range":"unicodeRange",unitsperem:"unitsPerEm","units-per-em":"unitsPerEm",unselectable:"unselectable",valphabetic:"vAlphabetic","v-alphabetic":"vAlphabetic",values:"values",vectoreffect:"vectorEffect","vector-effect":"vectorEffect",version:"version",vertadvy:"vertAdvY","vert-adv-y":"vertAdvY",vertoriginx:"vertOriginX","vert-origin-x":"vertOriginX",vertoriginy:"vertOriginY","vert-origin-y":"vertOriginY",vhanging:"vHanging","v-hanging":"vHanging",videographic:"vIdeographic","v-ideographic":"vIdeographic",viewbox:"viewBox",viewtarget:"viewTarget",visibility:"visibility",vmathematical:"vMathematical","v-mathematical":"vMathematical",vocab:"vocab",widths:"widths",wordspacing:"wordSpacing","word-spacing":"wordSpacing",writingmode:"writingMode","writing-mode":"writingMode",x1:"x1",x2:"x2",x:"x",xchannelselector:"xChannelSelector",xheight:"xHeight","x-height":"xHeight",xlinkactuate:"xlinkActuate","xlink:actuate":"xlinkActuate",xlinkarcrole:"xlinkArcrole","xlink:arcrole":"xlinkArcrole",xlinkhref:"xlinkHref","xlink:href":"xlinkHref",xlinkrole:"xlinkRole","xlink:role":"xlinkRole",xlinkshow:"xlinkShow","xlink:show":"xlinkShow",xlinktitle:"xlinkTitle","xlink:title":"xlinkTitle",xlinktype:"xlinkType","xlink:type":"xlinkType",xmlbase:"xmlBase","xml:base":"xmlBase",xmllang:"xmlLang","xml:lang":"xmlLang",xmlns:"xmlns","xml:space":"xmlSpace",xmlnsxlink:"xmlnsXlink","xmlns:xlink":"xmlnsXlink",xmlspace:"xmlSpace",y1:"y1",y2:"y2",y:"y",ychannelselector:"yChannelSelector",z:"z",zoomandpan:"zoomAndPan"},AG={"aria-current":0,"aria-description":0,"aria-details":0,"aria-disabled":0,"aria-hidden":0,"aria-invalid":0,"aria-keyshortcuts":0,"aria-label":0,"aria-roledescription":0,"aria-autocomplete":0,"aria-checked":0,"aria-expanded":0,"aria-haspopup":0,"aria-level":0,"aria-modal":0,"aria-multiline":0,"aria-multiselectable":0,"aria-orientation":0,"aria-placeholder":0,"aria-pressed":0,"aria-readonly":0,"aria-required":0,"aria-selected":0,"aria-sort":0,"aria-valuemax":0,"aria-valuemin":0,"aria-valuenow":0,"aria-valuetext":0,"aria-atomic":0,"aria-busy":0,"aria-live":0,"aria-relevant":0,"aria-dropeffect":0,"aria-grabbed":0,"aria-activedescendant":0,"aria-colcount":0,"aria-colindex":0,"aria-colspan":0,"aria-controls":0,"aria-describedby":0,"aria-errormessage":0,"aria-flowto":0,"aria-labelledby":0,"aria-owns":0,"aria-posinset":0,"aria-rowcount":0,"aria-rowindex":0,"aria-rowspan":0,"aria-setsize":0},gz={},nK=new RegExp("^(aria)-["+Q7+"]*$"),rK=new RegExp("^(aria)[A-Z]["+Q7+"]*$");function sK(z,Q){{if(V0.call(gz,Q)&&gz[Q])return!0;if(rK.test(Q)){var X="aria-"+Q.slice(4).toLowerCase(),Z=AG.hasOwnProperty(X)?X:null;if(Z==null)return q("Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.",Q),gz[Q]=!0,!0;if(Q!==Z)return q("Invalid ARIA attribute `%s`. Did you mean `%s`?",Q,Z),gz[Q]=!0,!0}if(nK.test(Q)){var J=Q.toLowerCase(),$=AG.hasOwnProperty(J)?J:null;if($==null)return gz[Q]=!0,!1;if(Q!==$)return q("Unknown ARIA attribute `%s`. Did you mean `%s`?",Q,$),gz[Q]=!0,!0}}return!0}function tK(z,Q){{var X=[];for(var Z in Q){var J=sK(z,Z);if(!J)X.push(Z)}var $=X.map(function(H){return"`"+H+"`"}).join(", ");if(X.length===1)q("Invalid aria prop %s on <%s> tag. For details, see https://reactjs.org/link/invalid-aria-props",$,z);else if(X.length>1)q("Invalid aria props %s on <%s> tag. For details, see https://reactjs.org/link/invalid-aria-props",$,z)}}function eK(z,Q){if(j8(z,Q))return;tK(z,Q)}var IG=!1;function z_(z,Q){{if(z!=="input"&&z!=="textarea"&&z!=="select")return;if(Q!=null&&Q.value===null&&!IG)if(IG=!0,z==="select"&&Q.multiple)q("`value` prop on `%s` should not be null. Consider using an empty array when `multiple` is set to `true` to clear the component or `undefined` for uncontrolled components.",z);else q("`value` prop on `%s` should not be null. Consider using an empty string to clear the component or `undefined` for uncontrolled components.",z)}}var TG=function(){};{var e7={},kG=/^on./,Q_=/^on[^A-Z]/,X_=new RegExp("^(aria)-["+Q7+"]*$"),Z_=new RegExp("^(aria)[A-Z]["+Q7+"]*$");TG=function(z,Q,X,Z){if(V0.call(e7,Q)&&e7[Q])return!0;var J=Q.toLowerCase();if(J==="onfocusin"||J==="onfocusout")return q("React uses onFocus and onBlur instead of onFocusIn and onFocusOut. All React events are normalized to bubble, so onFocusIn and onFocusOut are not needed/supported by React."),e7[Q]=!0,!0;if(Z!=null){var{registrationNameDependencies:$,possibleRegistrationNames:H}=Z;if($.hasOwnProperty(Q))return!0;var B=H.hasOwnProperty(J)?H[J]:null;if(B!=null)return q("Invalid event handler property `%s`. Did you mean `%s`?",Q,B),e7[Q]=!0,!0;if(kG.test(Q))return q("Unknown event handler property `%s`. It will be ignored.",Q),e7[Q]=!0,!0}else if(kG.test(Q)){if(Q_.test(Q))q("Invalid event handler property `%s`. React events use the camelCase naming convention, for example `onClick`.",Q);return e7[Q]=!0,!0}if(X_.test(Q)||Z_.test(Q))return!0;if(J==="innerhtml")return q("Directly setting property `innerHTML` is not permitted. For more information, lookup documentation on `dangerouslySetInnerHTML`."),e7[Q]=!0,!0;if(J==="aria")return q("The `aria` attribute is reserved for future use in React. Pass individual `aria-` attributes instead."),e7[Q]=!0,!0;if(J==="is"&&X!==null&&X!==void 0&&typeof X!=="string")return q("Received a `%s` for a string attribute `is`. If this is expected, cast the value to a string.",typeof X),e7[Q]=!0,!0;if(typeof X==="number"&&isNaN(X))return q("Received NaN for the `%s` attribute. If this is expected, cast the value to a string.",Q),e7[Q]=!0,!0;var W=e4(Q),w=W!==null&&W.type===I7;if(GJ.hasOwnProperty(J)){var k=GJ[J];if(k!==Q)return q("Invalid DOM property `%s`. Did you mean `%s`?",Q,k),e7[Q]=!0,!0}else if(!w&&Q!==J)return q("React does not recognize the `%s` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `%s` instead. If you accidentally passed it from a parent component, remove it from the DOM element.",Q,J),e7[Q]=!0,!0;if(typeof X==="boolean"&&u4(Q,X,W,!1)){if(X)q('Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.',X,Q,Q,X,Q);else q('Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.',X,Q,Q,X,Q,Q,Q);return e7[Q]=!0,!0}if(w)return!0;if(u4(Q,X,W,!1))return e7[Q]=!0,!1;if((X==="false"||X==="true")&&W!==null&&W.type===f4)return q("Received the string `%s` for the boolean attribute `%s`. %s Did you mean %s={%s}?",X,Q,X==="false"?"The browser will interpret it as a truthy value.":'Although this works, it will not work as expected if you pass the string "false".',Q,X),e7[Q]=!0,!0;return!0}}var J_=function(z,Q,X){{var Z=[];for(var J in Q){var $=TG(z,J,Q[J],X);if(!$)Z.push(J)}var H=Z.map(function(B){return"`"+B+"`"}).join(", ");if(Z.length===1)q("Invalid value for prop %s on <%s> tag. Either remove it from the element, or pass a string or number value to keep it in the DOM. For details, see https://reactjs.org/link/attribute-behavior ",H,z);else if(Z.length>1)q("Invalid values for props %s on <%s> tag. Either remove them from the element, or pass a string or number value to keep them in the DOM. For details, see https://reactjs.org/link/attribute-behavior ",H,z)}};function Y_(z,Q,X){if(j8(z,Q))return;J_(z,Q,X)}var CG=1,p2=2,JX=4,$_=CG|p2|JX,YX=null;function H_(z){if(YX!==null)q("Expected currently replaying event to be null. This error is likely caused by a bug in React. Please file an issue.");YX=z}function G_(){if(YX===null)q("Expected currently replaying event to not be null. This error is likely caused by a bug in React. Please file an issue.");YX=null}function q_(z){return z===YX}function d2(z){var Q=z.target||z.srcElement||window;if(Q.correspondingUseElement)Q=Q.correspondingUseElement;return Q.nodeType===S6?Q.parentNode:Q}var c2=null,Ez=null,uz=null;function SG(z){var Q=L8(z);if(!Q)return;if(typeof c2!=="function")throw Error("setRestoreImplementation() needs to be called to handle a target for controlled events. This error is likely caused by a bug in React. Please file an issue.");var X=Q.stateNode;if(X){var Z=iJ(X);c2(Q.stateNode,Q.type,Z)}}function U_(z){c2=z}function vG(z){if(Ez)if(uz)uz.push(z);else uz=[z];else Ez=z}function B_(){return Ez!==null||uz!==null}function fG(){if(!Ez)return;var z=Ez,Q=uz;if(Ez=null,uz=null,SG(z),Q)for(var X=0;X<Q.length;X++)SG(Q[X])}var hG=function(z,Q){return z(Q)},yG=function(){},l2=!1;function W_(){var z=B_();if(z)yG(),fG()}function VG(z,Q,X){if(l2)return z(Q,X);l2=!0;try{return hG(z,Q,X)}finally{l2=!1,W_()}}function O_(z,Q,X){hG=z,yG=X}function K_(z){return z==="button"||z==="input"||z==="select"||z==="textarea"}function __(z,Q,X){switch(z){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":return!!(X.disabled&&K_(Q));default:return!1}}function $X(z,Q){var X=z.stateNode;if(X===null)return null;var Z=iJ(X);if(Z===null)return null;var J=Z[Q];if(__(Q,z.type,Z))return null;if(J&&typeof J!=="function")throw Error("Expected `"+Q+"` listener to be a function, instead got a value of `"+typeof J+"` type.");return J}var i2=!1;if(N0)try{var HX={};Object.defineProperty(HX,"passive",{get:function(){i2=!0}}),window.addEventListener("test",HX,HX),window.removeEventListener("test",HX,HX)}catch(z){i2=!1}function DG(z,Q,X,Z,J,$,H,B,W){var w=Array.prototype.slice.call(arguments,3);try{Q.apply(X,w)}catch(k){this.onError(k)}}var mG=DG;if(typeof window<"u"&&typeof window.dispatchEvent==="function"&&typeof document<"u"&&typeof document.createEvent==="function"){var o2=document.createElement("react");mG=function(Q,X,Z,J,$,H,B,W,w){if(typeof document>"u"||document===null)throw Error("The `document` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in `componentWillUnmount`), or you can change the test itself to be asynchronous.");var k=document.createEvent("Event"),l=!1,c=!0,Z0=window.event,J0=Object.getOwnPropertyDescriptor(window,"event");function $0(){if(o2.removeEventListener(O0,q1,!1),typeof window.event<"u"&&window.hasOwnProperty("event"))window.event=Z0}var j0=Array.prototype.slice.call(arguments,3);function q1(){l=!0,$0(),X.apply(Z,j0),c=!1}var X1,x1=!1,j1=!1;function t(e){if(X1=e.error,x1=!0,X1===null&&e.colno===0&&e.lineno===0)j1=!0;if(e.defaultPrevented){if(X1!=null&&typeof X1==="object")try{X1._suppressLogging=!0}catch(T0){}}}var O0="react-"+(Q?Q:"invokeguardedcallback");if(window.addEventListener("error",t),o2.addEventListener(O0,q1,!1),k.initEvent(O0,!1,!1),o2.dispatchEvent(k),J0)Object.defineProperty(window,"event",J0);if(l&&c){if(!x1)X1=Error(`An error was thrown inside one of your components, but React doesn't know what it was. This is likely due to browser flakiness. React does its best to preserve the "Pause on exceptions" behavior of the DevTools, which requires some DEV-mode only tricks. It's possible that these don't work in your browser. Try triggering the error in production mode, or switching to a modern browser. If you suspect that this is actually an issue with React, please file an issue.`);else if(j1)X1=Error("A cross-origin error was thrown. React doesn't have access to the actual error object in development. See https://reactjs.org/link/crossorigin-error for more information.");this.onError(X1)}if(window.removeEventListener("error",t),!l)return $0(),DG.apply(this,arguments)}}var L_=mG,xz=!1,qJ=null,UJ=!1,a2=null,R_={onError:function(z){xz=!0,qJ=z}};function n2(z,Q,X,Z,J,$,H,B,W){xz=!1,qJ=null,L_.apply(R_,arguments)}function N_(z,Q,X,Z,J,$,H,B,W){if(n2.apply(this,arguments),xz){var w=r2();if(!UJ)UJ=!0,a2=w}}function M_(){if(UJ){var z=a2;throw UJ=!1,a2=null,z}}function w_(){return xz}function r2(){if(xz){var z=qJ;return xz=!1,qJ=null,z}else throw Error("clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.")}function jz(z){return z._reactInternals}function F_(z){return z._reactInternals!==void 0}function b_(z,Q){z._reactInternals=Q}var N1=0,pz=1,Z7=2,r1=4,p8=16,GX=32,s2=64,X4=128,f6=256,q8=512,d8=1024,c5=2048,h6=4096,c8=8192,BJ=16384,P_=c5|r1|s2|q8|d8|BJ,A_=32767,qX=32768,z5=65536,t2=131072,gG=1048576,e2=2097152,l8=4194304,z3=8388608,y6=16777216,WJ=33554432,Q3=r1|d8|0,X3=Z7|r1|p8|GX|q8|h6|c8,UX=r1|s2|q8|c8,dz=c5|p8,V6=l8|z3|e2,I_=Y.ReactCurrentOwner;function i8(z){var Q=z,X=z;if(!z.alternate){var Z=Q;do{if(Q=Z,(Q.flags&(Z7|h6))!==N1)X=Q.return;Z=Q.return}while(Z)}else while(Q.return)Q=Q.return;if(Q.tag===I)return X;return null}function EG(z){if(z.tag===A){var Q=z.memoizedState;if(Q===null){var X=z.alternate;if(X!==null)Q=X.memoizedState}if(Q!==null)return Q.dehydrated}return null}function uG(z){return z.tag===I?z.stateNode.containerInfo:null}function T_(z){return i8(z)===z}function k_(z){{var Q=I_.current;if(Q!==null&&Q.tag===O){var X=Q,Z=X.stateNode;if(!Z._warnedAboutRefsInRender)q("%s is accessing isMounted inside its render() function. render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.",y1(X)||"A component");Z._warnedAboutRefsInRender=!0}}var J=jz(z);if(!J)return!1;return i8(J)===J}function xG(z){if(i8(z)!==z)throw Error("Unable to find node on an unmounted component.")}function jG(z){var Q=z.alternate;if(!Q){var X=i8(z);if(X===null)throw Error("Unable to find node on an unmounted component.");if(X!==z)return null;return z}var Z=z,J=Q;while(!0){var $=Z.return;if($===null)break;var H=$.alternate;if(H===null){var B=$.return;if(B!==null){Z=J=B;continue}break}if($.child===H.child){var W=$.child;while(W){if(W===Z)return xG($),z;if(W===J)return xG($),Q;W=W.sibling}throw Error("Unable to find node on an unmounted component.")}if(Z.return!==J.return)Z=$,J=H;else{var w=!1,k=$.child;while(k){if(k===Z){w=!0,Z=$,J=H;break}if(k===J){w=!0,J=$,Z=H;break}k=k.sibling}if(!w){k=H.child;while(k){if(k===Z){w=!0,Z=H,J=$;break}if(k===J){w=!0,J=H,Z=$;break}k=k.sibling}if(!w)throw Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.")}}if(Z.alternate!==J)throw Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.")}if(Z.tag!==I)throw Error("Unable to find node on an unmounted component.");if(Z.stateNode.current===Z)return z;return Q}function pG(z){var Q=jG(z);return Q!==null?dG(Q):null}function dG(z){if(z.tag===P||z.tag===N)return z;var Q=z.child;while(Q!==null){var X=dG(Q);if(X!==null)return X;Q=Q.sibling}return null}function C_(z){var Q=jG(z);return Q!==null?cG(Q):null}function cG(z){if(z.tag===P||z.tag===N)return z;var Q=z.child;while(Q!==null){if(Q.tag!==b){var X=cG(Q);if(X!==null)return X}Q=Q.sibling}return null}var lG=L4.unstable_scheduleCallback,S_=L4.unstable_cancelCallback,v_=L4.unstable_shouldYield,f_=L4.unstable_requestPaint,F7=L4.unstable_now,h_=L4.unstable_getCurrentPriorityLevel,OJ=L4.unstable_ImmediatePriority,Z3=L4.unstable_UserBlockingPriority,o8=L4.unstable_NormalPriority,y_=L4.unstable_LowPriority,J3=L4.unstable_IdlePriority,V_=L4.unstable_yieldValue,D_=L4.unstable_setDisableYieldValue,a8=null,k7=null,c0=null,U6=!1,l5=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u";function m_(z){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")return!1;var Q=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(Q.isDisabled)return!0;if(!Q.supportsFiber)return q("The installed version of React DevTools is too old and will not work with the current version of React. Please update React DevTools. https://reactjs.org/link/react-devtools"),!0;try{if(z0)z=g1({},z,{getLaneLabelMap:p_,injectProfilingHooks:j_});a8=Q.inject(z),k7=Q}catch(X){q("React instrumentation encountered an error: %s.",X)}if(Q.checkDCE)return!0;else return!1}function g_(z,Q){if(k7&&typeof k7.onScheduleFiberRoot==="function")try{k7.onScheduleFiberRoot(a8,z,Q)}catch(X){if(!U6)U6=!0,q("React instrumentation encountered an error: %s",X)}}function E_(z,Q){if(k7&&typeof k7.onCommitFiberRoot==="function")try{var X=(z.current.flags&X4)===X4;if(v0){var Z;switch(Q){case b5:Z=OJ;break;case m6:Z=Z3;break;case g6:Z=o8;break;case FJ:Z=J3;break;default:Z=o8;break}k7.onCommitFiberRoot(a8,z,Z,X)}else k7.onCommitFiberRoot(a8,z,void 0,X)}catch(J){if(!U6)U6=!0,q("React instrumentation encountered an error: %s",J)}}function u_(z){if(k7&&typeof k7.onPostCommitFiberRoot==="function")try{k7.onPostCommitFiberRoot(a8,z)}catch(Q){if(!U6)U6=!0,q("React instrumentation encountered an error: %s",Q)}}function x_(z){if(k7&&typeof k7.onCommitFiberUnmount==="function")try{k7.onCommitFiberUnmount(a8,z)}catch(Q){if(!U6)U6=!0,q("React instrumentation encountered an error: %s",Q)}}function b7(z){{if(typeof V_==="function")D_(z),U(z);if(k7&&typeof k7.setStrictMode==="function")try{k7.setStrictMode(a8,z)}catch(Q){if(!U6)U6=!0,q("React instrumentation encountered an error: %s",Q)}}}function j_(z){c0=z}function p_(){{var z=new Map,Q=1;for(var X=0;X<$3;X++){var Z=GL(Q);z.set(Q,Z),Q*=2}return z}}function d_(z){if(c0!==null&&typeof c0.markCommitStarted==="function")c0.markCommitStarted(z)}function iG(){if(c0!==null&&typeof c0.markCommitStopped==="function")c0.markCommitStopped()}function BX(z){if(c0!==null&&typeof c0.markComponentRenderStarted==="function")c0.markComponentRenderStarted(z)}function cz(){if(c0!==null&&typeof c0.markComponentRenderStopped==="function")c0.markComponentRenderStopped()}function c_(z){if(c0!==null&&typeof c0.markComponentPassiveEffectMountStarted==="function")c0.markComponentPassiveEffectMountStarted(z)}function l_(){if(c0!==null&&typeof c0.markComponentPassiveEffectMountStopped==="function")c0.markComponentPassiveEffectMountStopped()}function i_(z){if(c0!==null&&typeof c0.markComponentPassiveEffectUnmountStarted==="function")c0.markComponentPassiveEffectUnmountStarted(z)}function o_(){if(c0!==null&&typeof c0.markComponentPassiveEffectUnmountStopped==="function")c0.markComponentPassiveEffectUnmountStopped()}function a_(z){if(c0!==null&&typeof c0.markComponentLayoutEffectMountStarted==="function")c0.markComponentLayoutEffectMountStarted(z)}function n_(){if(c0!==null&&typeof c0.markComponentLayoutEffectMountStopped==="function")c0.markComponentLayoutEffectMountStopped()}function oG(z){if(c0!==null&&typeof c0.markComponentLayoutEffectUnmountStarted==="function")c0.markComponentLayoutEffectUnmountStarted(z)}function aG(){if(c0!==null&&typeof c0.markComponentLayoutEffectUnmountStopped==="function")c0.markComponentLayoutEffectUnmountStopped()}function r_(z,Q,X){if(c0!==null&&typeof c0.markComponentErrored==="function")c0.markComponentErrored(z,Q,X)}function s_(z,Q,X){if(c0!==null&&typeof c0.markComponentSuspended==="function")c0.markComponentSuspended(z,Q,X)}function t_(z){if(c0!==null&&typeof c0.markLayoutEffectsStarted==="function")c0.markLayoutEffectsStarted(z)}function e_(){if(c0!==null&&typeof c0.markLayoutEffectsStopped==="function")c0.markLayoutEffectsStopped()}function zL(z){if(c0!==null&&typeof c0.markPassiveEffectsStarted==="function")c0.markPassiveEffectsStarted(z)}function QL(){if(c0!==null&&typeof c0.markPassiveEffectsStopped==="function")c0.markPassiveEffectsStopped()}function nG(z){if(c0!==null&&typeof c0.markRenderStarted==="function")c0.markRenderStarted(z)}function XL(){if(c0!==null&&typeof c0.markRenderYielded==="function")c0.markRenderYielded()}function rG(){if(c0!==null&&typeof c0.markRenderStopped==="function")c0.markRenderStopped()}function ZL(z){if(c0!==null&&typeof c0.markRenderScheduled==="function")c0.markRenderScheduled(z)}function JL(z,Q){if(c0!==null&&typeof c0.markForceUpdateScheduled==="function")c0.markForceUpdateScheduled(z,Q)}function Y3(z,Q){if(c0!==null&&typeof c0.markStateUpdateScheduled==="function")c0.markStateUpdateScheduled(z,Q)}var K1=0,l1=1,O4=2,o4=8,B6=16,sG=Math.clz32?Math.clz32:HL,YL=Math.log,$L=Math.LN2;function HL(z){var Q=z>>>0;if(Q===0)return 32;return 31-(YL(Q)/$L|0)|0}var $3=31,b0=0,P7=0,A1=1,lz=2,D6=4,n8=8,W6=16,WX=32,iz=4194240,OX=64,H3=128,G3=256,q3=512,U3=1024,B3=2048,W3=4096,O3=8192,K3=16384,_3=32768,L3=65536,R3=131072,N3=262144,M3=524288,w3=1048576,F3=2097152,KJ=130023424,oz=4194304,b3=8388608,P3=16777216,A3=33554432,I3=67108864,tG=oz,KX=134217728,eG=268435455,_X=268435456,r8=536870912,w5=1073741824;function GL(z){{if(z&A1)return"Sync";if(z&lz)return"InputContinuousHydration";if(z&D6)return"InputContinuous";if(z&n8)return"DefaultHydration";if(z&W6)return"Default";if(z&WX)return"TransitionHydration";if(z&iz)return"Transition";if(z&KJ)return"Retry";if(z&KX)return"SelectiveHydration";if(z&_X)return"IdleHydration";if(z&r8)return"Idle";if(z&w5)return"Offscreen"}}var y4=-1,_J=OX,LJ=oz;function LX(z){switch(s8(z)){case A1:return A1;case lz:return lz;case D6:return D6;case n8:return n8;case W6:return W6;case WX:return WX;case OX:case H3:case G3:case q3:case U3:case B3:case W3:case O3:case K3:case _3:case L3:case R3:case N3:case M3:case w3:case F3:return z&iz;case oz:case b3:case P3:case A3:case I3:return z&KJ;case KX:return KX;case _X:return _X;case r8:return r8;case w5:return w5;default:return q("Should have found matching lanes. This is a bug in React."),z}}function RJ(z,Q){var X=z.pendingLanes;if(X===b0)return b0;var Z=b0,J=z.suspendedLanes,$=z.pingedLanes,H=X&eG;if(H!==b0){var B=H&~J;if(B!==b0)Z=LX(B);else{var W=H&$;if(W!==b0)Z=LX(W)}}else{var w=X&~J;if(w!==b0)Z=LX(w);else if($!==b0)Z=LX($)}if(Z===b0)return b0;if(Q!==b0&&Q!==Z&&(Q&J)===b0){var k=s8(Z),l=s8(Q);if(k>=l||k===W6&&(l&iz)!==b0)return Q}if((Z&D6)!==b0)Z|=X&W6;var c=z.entangledLanes;if(c!==b0){var Z0=z.entanglements,J0=Z&c;while(J0>0){var $0=t8(J0),j0=1<<$0;Z|=Z0[$0],J0&=~j0}}return Z}function qL(z,Q){var X=z.eventTimes,Z=y4;while(Q>0){var J=t8(Q),$=1<<J,H=X[J];if(H>Z)Z=H;Q&=~$}return Z}function UL(z,Q){switch(z){case A1:case lz:case D6:return Q+250;case n8:case W6:case WX:case OX:case H3:case G3:case q3:case U3:case B3:case W3:case O3:case K3:case _3:case L3:case R3:case N3:case M3:case w3:case F3:return Q+5000;case oz:case b3:case P3:case A3:case I3:return y4;case KX:case _X:case r8:case w5:return y4;default:return q("Should have found matching lanes. This is a bug in React."),y4}}function BL(z,Q){var{pendingLanes:X,suspendedLanes:Z,pingedLanes:J,expirationTimes:$}=z,H=X;while(H>0){var B=t8(H),W=1<<B,w=$[B];if(w===y4){if((W&Z)===b0||(W&J)!==b0)$[B]=UL(W,Q)}else if(w<=Q)z.expiredLanes|=W;H&=~W}}function WL(z){return LX(z.pendingLanes)}function T3(z){var Q=z.pendingLanes&~w5;if(Q!==b0)return Q;if(Q&w5)return w5;return b0}function OL(z){return(z&A1)!==b0}function k3(z){return(z&eG)!==b0}function zq(z){return(z&KJ)===z}function KL(z){var Q=A1|D6|W6;return(z&Q)===b0}function _L(z){return(z&iz)===z}function NJ(z,Q){var X=lz|D6|n8|W6;return(Q&X)!==b0}function LL(z,Q){return(Q&z.expiredLanes)!==b0}function Qq(z){return(z&iz)!==b0}function Xq(){var z=_J;if(_J<<=1,(_J&iz)===b0)_J=OX;return z}function RL(){var z=LJ;if(LJ<<=1,(LJ&KJ)===b0)LJ=oz;return z}function s8(z){return z&-z}function RX(z){return s8(z)}function t8(z){return 31-sG(z)}function C3(z){return t8(z)}function F5(z,Q){return(z&Q)!==b0}function az(z,Q){return(z&Q)===Q}function D1(z,Q){return z|Q}function MJ(z,Q){return z&~Q}function Zq(z,Q){return z&Q}function wJ(z){return z}function NL(z,Q){return z!==P7&&z<Q?z:Q}function S3(z){var Q=[];for(var X=0;X<$3;X++)Q.push(z);return Q}function NX(z,Q,X){if(z.pendingLanes|=Q,Q!==r8)z.suspendedLanes=b0,z.pingedLanes=b0;var Z=z.eventTimes,J=C3(Q);Z[J]=X}function ML(z,Q){z.suspendedLanes|=Q,z.pingedLanes&=~Q;var X=z.expirationTimes,Z=Q;while(Z>0){var J=t8(Z),$=1<<J;X[J]=y4,Z&=~$}}function Jq(z,Q,X){z.pingedLanes|=z.suspendedLanes&Q}function wL(z,Q){var X=z.pendingLanes&~Q;z.pendingLanes=Q,z.suspendedLanes=b0,z.pingedLanes=b0,z.expiredLanes&=Q,z.mutableReadLanes&=Q,z.entangledLanes&=Q;var{entanglements:Z,eventTimes:J,expirationTimes:$}=z,H=X;while(H>0){var B=t8(H),W=1<<B;Z[B]=b0,J[B]=y4,$[B]=y4,H&=~W}}function v3(z,Q){var X=z.entangledLanes|=Q,Z=z.entanglements,J=X;while(J){var $=t8(J),H=1<<$;if(H&Q|Z[$]&Q)Z[$]|=Q;J&=~H}}function FL(z,Q){var X=s8(Q),Z;switch(X){case D6:Z=lz;break;case W6:Z=n8;break;case OX:case H3:case G3:case q3:case U3:case B3:case W3:case O3:case K3:case _3:case L3:case R3:case N3:case M3:case w3:case F3:case oz:case b3:case P3:case A3:case I3:Z=WX;break;case r8:Z=_X;break;default:Z=P7;break}if((Z&(z.suspendedLanes|Q))!==P7)return P7;return Z}function Yq(z,Q,X){if(!l5)return;var Z=z.pendingUpdatersLaneMap;while(X>0){var J=C3(X),$=1<<J,H=Z[J];H.add(Q),X&=~$}}function $q(z,Q){if(!l5)return;var{pendingUpdatersLaneMap:X,memoizedUpdaters:Z}=z;while(Q>0){var J=C3(Q),$=1<<J,H=X[J];if(H.size>0)H.forEach(function(B){var W=B.alternate;if(W===null||!Z.has(W))Z.add(B)}),H.clear();Q&=~$}}function Hq(z,Q){return null}var b5=A1,m6=D6,g6=W6,FJ=r8,MX=P7;function i5(){return MX}function A7(z){MX=z}function bL(z,Q){var X=MX;try{return MX=z,Q()}finally{MX=X}}function PL(z,Q){return z!==0&&z<Q?z:Q}function AL(z,Q){return z===0||z>Q?z:Q}function f3(z,Q){return z!==0&&z<Q}function Gq(z){var Q=s8(z);if(!f3(b5,Q))return b5;if(!f3(m6,Q))return m6;if(k3(Q))return g6;return FJ}function bJ(z){var Q=z.current.memoizedState;return Q.isDehydrated}var qq;function IL(z){qq=z}function TL(z){qq(z)}var h3;function kL(z){h3=z}var Uq;function CL(z){Uq=z}var Bq;function SL(z){Bq=z}var Wq;function vL(z){Wq=z}var y3=!1,PJ=[],U8=null,B8=null,W8=null,wX=new Map,FX=new Map,O8=[],fL=["mousedown","mouseup","touchcancel","touchend","touchstart","auxclick","dblclick","pointercancel","pointerdown","pointerup","dragend","dragstart","drop","compositionend","compositionstart","keydown","keypress","keyup","input","textInput","copy","cut","paste","click","change","contextmenu","reset","submit"];function hL(z){return fL.indexOf(z)>-1}function yL(z,Q,X,Z,J){return{blockedOn:z,domEventName:Q,eventSystemFlags:X,nativeEvent:J,targetContainers:[Z]}}function Oq(z,Q){switch(z){case"focusin":case"focusout":U8=null;break;case"dragenter":case"dragleave":B8=null;break;case"mouseover":case"mouseout":W8=null;break;case"pointerover":case"pointerout":{var X=Q.pointerId;wX.delete(X);break}case"gotpointercapture":case"lostpointercapture":{var Z=Q.pointerId;FX.delete(Z);break}}}function bX(z,Q,X,Z,J,$){if(z===null||z.nativeEvent!==$){var H=yL(Q,X,Z,J,$);if(Q!==null){var B=L8(Q);if(B!==null)h3(B)}return H}z.eventSystemFlags|=Z;var W=z.targetContainers;if(J!==null&&W.indexOf(J)===-1)W.push(J);return z}function VL(z,Q,X,Z,J){switch(Q){case"focusin":{var $=J;return U8=bX(U8,z,Q,X,Z,$),!0}case"dragenter":{var H=J;return B8=bX(B8,z,Q,X,Z,H),!0}case"mouseover":{var B=J;return W8=bX(W8,z,Q,X,Z,B),!0}case"pointerover":{var W=J,w=W.pointerId;return wX.set(w,bX(wX.get(w)||null,z,Q,X,Z,W)),!0}case"gotpointercapture":{var k=J,l=k.pointerId;return FX.set(l,bX(FX.get(l)||null,z,Q,X,Z,k)),!0}}return!1}function Kq(z){var Q=Qz(z.target);if(Q!==null){var X=i8(Q);if(X!==null){var Z=X.tag;if(Z===A){var J=EG(X);if(J!==null){z.blockedOn=J,Wq(z.priority,function(){Uq(X)});return}}else if(Z===I){var $=X.stateNode;if(bJ($)){z.blockedOn=uG(X);return}}}}z.blockedOn=null}function DL(z){var Q=Bq(),X={blockedOn:null,target:z,priority:Q},Z=0;for(;Z<O8.length;Z++)if(!f3(Q,O8[Z].priority))break;if(O8.splice(Z,0,X),Z===0)Kq(X)}function AJ(z){if(z.blockedOn!==null)return!1;var Q=z.targetContainers;while(Q.length>0){var X=Q[0],Z=m3(z.domEventName,z.eventSystemFlags,X,z.nativeEvent);if(Z===null){var J=z.nativeEvent,$=new J.constructor(J.type,J);H_($),J.target.dispatchEvent($),G_()}else{var H=L8(Z);if(H!==null)h3(H);return z.blockedOn=Z,!1}Q.shift()}return!0}function _q(z,Q,X){if(AJ(z))X.delete(Q)}function mL(){if(y3=!1,U8!==null&&AJ(U8))U8=null;if(B8!==null&&AJ(B8))B8=null;if(W8!==null&&AJ(W8))W8=null;wX.forEach(_q),FX.forEach(_q)}function PX(z,Q){if(z.blockedOn===Q){if(z.blockedOn=null,!y3)y3=!0,L4.unstable_scheduleCallback(L4.unstable_NormalPriority,mL)}}function AX(z){if(PJ.length>0){PX(PJ[0],z);for(var Q=1;Q<PJ.length;Q++){var X=PJ[Q];if(X.blockedOn===z)X.blockedOn=null}}if(U8!==null)PX(U8,z);if(B8!==null)PX(B8,z);if(W8!==null)PX(W8,z);var Z=function(B){return PX(B,z)};wX.forEach(Z),FX.forEach(Z);for(var J=0;J<O8.length;J++){var $=O8[J];if($.blockedOn===z)$.blockedOn=null}while(O8.length>0){var H=O8[0];if(H.blockedOn!==null)break;else if(Kq(H),H.blockedOn===null)O8.shift()}}var nz=Y.ReactCurrentBatchConfig,V3=!0;function Lq(z){V3=!!z}function gL(){return V3}function EL(z,Q,X){var Z=Rq(Q),J;switch(Z){case b5:J=uL;break;case m6:J=xL;break;case g6:default:J=D3;break}return J.bind(null,Q,X,z)}function uL(z,Q,X,Z){var J=i5(),$=nz.transition;nz.transition=null;try{A7(b5),D3(z,Q,X,Z)}finally{A7(J),nz.transition=$}}function xL(z,Q,X,Z){var J=i5(),$=nz.transition;nz.transition=null;try{A7(m6),D3(z,Q,X,Z)}finally{A7(J),nz.transition=$}}function D3(z,Q,X,Z){if(!V3)return;jL(z,Q,X,Z)}function jL(z,Q,X,Z){var J=m3(z,Q,X,Z);if(J===null){r3(z,Q,Z,IJ,X),Oq(z,Z);return}if(VL(J,z,Q,X,Z)){Z.stopPropagation();return}if(Oq(z,Z),Q&JX&&hL(z)){while(J!==null){var $=L8(J);if($!==null)TL($);var H=m3(z,Q,X,Z);if(H===null)r3(z,Q,Z,IJ,X);if(H===J)break;J=H}if(J!==null)Z.stopPropagation();return}r3(z,Q,Z,null,X)}var IJ=null;function m3(z,Q,X,Z){IJ=null;var J=d2(Z),$=Qz(J);if($!==null){var H=i8($);if(H===null)$=null;else{var B=H.tag;if(B===A){var W=EG(H);if(W!==null)return W;$=null}else if(B===I){var w=H.stateNode;if(bJ(w))return uG(H);$=null}else if(H!==$)$=null}}return IJ=$,null}function Rq(z){switch(z){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return b5;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return m6;case"message":{var Q=h_();switch(Q){case OJ:return b5;case Z3:return m6;case o8:case y_:return g6;case J3:return FJ;default:return g6}}default:return g6}}function pL(z,Q,X){return z.addEventListener(Q,X,!1),X}function dL(z,Q,X){return z.addEventListener(Q,X,!0),X}function cL(z,Q,X,Z){return z.addEventListener(Q,X,{capture:!0,passive:Z}),X}function lL(z,Q,X,Z){return z.addEventListener(Q,X,{passive:Z}),X}var IX=null,g3=null,TX=null;function iL(z){return IX=z,g3=Mq(),!0}function oL(){IX=null,g3=null,TX=null}function Nq(){if(TX)return TX;var z,Q=g3,X=Q.length,Z,J=Mq(),$=J.length;for(z=0;z<X;z++)if(Q[z]!==J[z])break;var H=X-z;for(Z=1;Z<=H;Z++)if(Q[X-Z]!==J[$-Z])break;var B=Z>1?1-Z:void 0;return TX=J.slice(z,B),TX}function Mq(){if("value"in IX)return IX.value;return IX.textContent}function TJ(z){var Q,X=z.keyCode;if("charCode"in z){if(Q=z.charCode,Q===0&&X===13)Q=13}else Q=X;if(Q===10)Q=13;if(Q>=32||Q===13)return Q;return 0}function kJ(){return!0}function wq(){return!1}function P5(z){function Q(X,Z,J,$,H){this._reactName=X,this._targetInst=J,this.type=Z,this.nativeEvent=$,this.target=H,this.currentTarget=null;for(var B in z){if(!z.hasOwnProperty(B))continue;var W=z[B];if(W)this[B]=W($);else this[B]=$[B]}var w=$.defaultPrevented!=null?$.defaultPrevented:$.returnValue===!1;if(w)this.isDefaultPrevented=kJ;else this.isDefaultPrevented=wq;return this.isPropagationStopped=wq,this}return g1(Q.prototype,{preventDefault:function(){this.defaultPrevented=!0;var X=this.nativeEvent;if(!X)return;if(X.preventDefault)X.preventDefault();else if(typeof X.returnValue!=="unknown")X.returnValue=!1;this.isDefaultPrevented=kJ},stopPropagation:function(){var X=this.nativeEvent;if(!X)return;if(X.stopPropagation)X.stopPropagation();else if(typeof X.cancelBubble!=="unknown")X.cancelBubble=!0;this.isPropagationStopped=kJ},persist:function(){},isPersistent:kJ}),Q}var rz={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(z){return z.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},E3=P5(rz),kX=g1({},rz,{view:0,detail:0}),aL=P5(kX),u3,x3,CX;function nL(z){if(z!==CX){if(CX&&z.type==="mousemove")u3=z.screenX-CX.screenX,x3=z.screenY-CX.screenY;else u3=0,x3=0;CX=z}}var CJ=g1({},kX,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:p3,button:0,buttons:0,relatedTarget:function(z){if(z.relatedTarget===void 0)return z.fromElement===z.srcElement?z.toElement:z.fromElement;return z.relatedTarget},movementX:function(z){if("movementX"in z)return z.movementX;return nL(z),u3},movementY:function(z){if("movementY"in z)return z.movementY;return x3}}),Fq=P5(CJ),rL=g1({},CJ,{dataTransfer:0}),sL=P5(rL),tL=g1({},kX,{relatedTarget:0}),j3=P5(tL),eL=g1({},rz,{animationName:0,elapsedTime:0,pseudoElement:0}),zR=P5(eL),QR=g1({},rz,{clipboardData:function(z){return"clipboardData"in z?z.clipboardData:window.clipboardData}}),XR=P5(QR),ZR=g1({},rz,{data:0}),bq=P5(ZR),JR=bq,YR={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},$R={"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"};function HR(z){if(z.key){var Q=YR[z.key]||z.key;if(Q!=="Unidentified")return Q}if(z.type==="keypress"){var X=TJ(z);return X===13?"Enter":String.fromCharCode(X)}if(z.type==="keydown"||z.type==="keyup")return $R[z.keyCode]||"Unidentified";return""}var GR={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function qR(z){var Q=this,X=Q.nativeEvent;if(X.getModifierState)return X.getModifierState(z);var Z=GR[z];return Z?!!X[Z]:!1}function p3(z){return qR}var UR=g1({},kX,{key:HR,code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:p3,charCode:function(z){if(z.type==="keypress")return TJ(z);return 0},keyCode:function(z){if(z.type==="keydown"||z.type==="keyup")return z.keyCode;return 0},which:function(z){if(z.type==="keypress")return TJ(z);if(z.type==="keydown"||z.type==="keyup")return z.keyCode;return 0}}),BR=P5(UR),WR=g1({},CJ,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Pq=P5(WR),OR=g1({},kX,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:p3}),KR=P5(OR),_R=g1({},rz,{propertyName:0,elapsedTime:0,pseudoElement:0}),LR=P5(_R),RR=g1({},CJ,{deltaX:function(z){return"deltaX"in z?z.deltaX:("wheelDeltaX"in z)?-z.wheelDeltaX:0},deltaY:function(z){return"deltaY"in z?z.deltaY:("wheelDeltaY"in z)?-z.wheelDeltaY:("wheelDelta"in z)?-z.wheelDelta:0},deltaZ:0,deltaMode:0}),NR=P5(RR),MR=[9,13,27,32],Aq=229,d3=N0&&"CompositionEvent"in window,SX=null;if(N0&&"documentMode"in document)SX=document.documentMode;var wR=N0&&"TextEvent"in window&&!SX,Iq=N0&&(!d3||SX&&SX>8&&SX<=11),Tq=32,kq=String.fromCharCode(Tq);function FR(){v1("onBeforeInput",["compositionend","keypress","textInput","paste"]),v1("onCompositionEnd",["compositionend","focusout","keydown","keypress","keyup","mousedown"]),v1("onCompositionStart",["compositionstart","focusout","keydown","keypress","keyup","mousedown"]),v1("onCompositionUpdate",["compositionupdate","focusout","keydown","keypress","keyup","mousedown"])}var Cq=!1;function bR(z){return(z.ctrlKey||z.altKey||z.metaKey)&&!(z.ctrlKey&&z.altKey)}function PR(z){switch(z){case"compositionstart":return"onCompositionStart";case"compositionend":return"onCompositionEnd";case"compositionupdate":return"onCompositionUpdate"}}function AR(z,Q){return z==="keydown"&&Q.keyCode===Aq}function Sq(z,Q){switch(z){case"keyup":return MR.indexOf(Q.keyCode)!==-1;case"keydown":return Q.keyCode!==Aq;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function vq(z){var Q=z.detail;if(typeof Q==="object"&&"data"in Q)return Q.data;return null}function fq(z){return z.locale==="ko"}var sz=!1;function IR(z,Q,X,Z,J){var $,H;if(d3)$=PR(Q);else if(!sz){if(AR(Q,Z))$="onCompositionStart"}else if(Sq(Q,Z))$="onCompositionEnd";if(!$)return null;if(Iq&&!fq(Z)){if(!sz&&$==="onCompositionStart")sz=iL(J);else if($==="onCompositionEnd"){if(sz)H=Nq()}}var B=yJ(X,$);if(B.length>0){var W=new bq($,Q,null,Z,J);if(z.push({event:W,listeners:B}),H)W.data=H;else{var w=vq(Z);if(w!==null)W.data=w}}}function TR(z,Q){switch(z){case"compositionend":return vq(Q);case"keypress":var X=Q.which;if(X!==Tq)return null;return Cq=!0,kq;case"textInput":var Z=Q.data;if(Z===kq&&Cq)return null;return Z;default:return null}}function kR(z,Q){if(sz){if(z==="compositionend"||!d3&&Sq(z,Q)){var X=Nq();return oL(),sz=!1,X}return null}switch(z){case"paste":return null;case"keypress":if(!bR(Q)){if(Q.char&&Q.char.length>1)return Q.char;else if(Q.which)return String.fromCharCode(Q.which)}return null;case"compositionend":return Iq&&!fq(Q)?null:Q.data;default:return null}}function CR(z,Q,X,Z,J){var $;if(wR)$=TR(Q,Z);else $=kR(Q,Z);if(!$)return null;var H=yJ(X,"onBeforeInput");if(H.length>0){var B=new JR("onBeforeInput","beforeinput",null,Z,J);z.push({event:B,listeners:H}),B.data=$}}function SR(z,Q,X,Z,J,$,H){IR(z,Q,X,Z,J),CR(z,Q,X,Z,J)}var vR={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 hq(z){var Q=z&&z.nodeName&&z.nodeName.toLowerCase();if(Q==="input")return!!vR[z.type];if(Q==="textarea")return!0;return!1}function fR(z){if(!N0)return!1;var Q="on"+z,X=Q in document;if(!X){var Z=document.createElement("div");Z.setAttribute(Q,"return;"),X=typeof Z[Q]==="function"}return X}function hR(){v1("onChange",["change","click","focusin","focusout","input","keydown","keyup","selectionchange"])}function yq(z,Q,X,Z){vG(Z);var J=yJ(Q,"onChange");if(J.length>0){var $=new E3("onChange","change",null,X,Z);z.push({event:$,listeners:J})}}var vX=null,fX=null;function yR(z){var Q=z.nodeName&&z.nodeName.toLowerCase();return Q==="select"||Q==="input"&&z.type==="file"}function VR(z){var Q=[];yq(Q,fX,z,d2(z)),VG(DR,Q)}function DR(z){sq(z,0)}function SJ(z){var Q=ZQ(z);if(yz(Q))return z}function mR(z,Q){if(z==="change")return Q}var Vq=!1;if(N0)Vq=fR("input")&&(!document.documentMode||document.documentMode>9);function gR(z,Q){vX=z,fX=Q,vX.attachEvent("onpropertychange",mq)}function Dq(){if(!vX)return;vX.detachEvent("onpropertychange",mq),vX=null,fX=null}function mq(z){if(z.propertyName!=="value")return;if(SJ(fX))VR(z)}function ER(z,Q,X){if(z==="focusin")Dq(),gR(Q,X);else if(z==="focusout")Dq()}function uR(z,Q){if(z==="selectionchange"||z==="keyup"||z==="keydown")return SJ(fX)}function xR(z){var Q=z.nodeName;return Q&&Q.toLowerCase()==="input"&&(z.type==="checkbox"||z.type==="radio")}function jR(z,Q){if(z==="click")return SJ(Q)}function pR(z,Q){if(z==="input"||z==="change")return SJ(Q)}function dR(z){var Q=z._wrapperState;if(!Q||!Q.controlled||z.type!=="number")return;P1(z,"number",z.value)}function cR(z,Q,X,Z,J,$,H){var B=X?ZQ(X):window,W,w;if(yR(B))W=mR;else if(hq(B))if(Vq)W=pR;else W=uR,w=ER;else if(xR(B))W=jR;if(W){var k=W(Q,X);if(k){yq(z,k,Z,J);return}}if(w)w(Q,B,X);if(Q==="focusout")dR(B)}function lR(){m("onMouseEnter",["mouseout","mouseover"]),m("onMouseLeave",["mouseout","mouseover"]),m("onPointerEnter",["pointerout","pointerover"]),m("onPointerLeave",["pointerout","pointerover"])}function iR(z,Q,X,Z,J,$,H){var B=Q==="mouseover"||Q==="pointerover",W=Q==="mouseout"||Q==="pointerout";if(B&&!q_(Z)){var w=Z.relatedTarget||Z.fromElement;if(w){if(Qz(w)||iX(w))return}}if(!W&&!B)return;var k;if(J.window===J)k=J;else{var l=J.ownerDocument;if(l)k=l.defaultView||l.parentWindow;else k=window}var c,Z0;if(W){var J0=Z.relatedTarget||Z.toElement;if(c=X,Z0=J0?Qz(J0):null,Z0!==null){var $0=i8(Z0);if(Z0!==$0||Z0.tag!==P&&Z0.tag!==N)Z0=null}}else c=null,Z0=X;if(c===Z0)return;var j0=Fq,q1="onMouseLeave",X1="onMouseEnter",x1="mouse";if(Q==="pointerout"||Q==="pointerover")j0=Pq,q1="onPointerLeave",X1="onPointerEnter",x1="pointer";var j1=c==null?k:ZQ(c),t=Z0==null?k:ZQ(Z0),O0=new j0(q1,x1+"leave",c,Z,J);O0.target=j1,O0.relatedTarget=t;var e=null,T0=Qz(J);if(T0===X){var i0=new j0(X1,x1+"enter",Z0,Z,J);i0.target=t,i0.relatedTarget=j1,e=i0}LN(z,O0,e,c,Z0)}function oR(z,Q){return z===Q&&(z!==0||1/z===1/Q)||z!==z&&Q!==Q}var A5=typeof Object.is==="function"?Object.is:oR;function hX(z,Q){if(A5(z,Q))return!0;if(typeof z!=="object"||z===null||typeof Q!=="object"||Q===null)return!1;var X=Object.keys(z),Z=Object.keys(Q);if(X.length!==Z.length)return!1;for(var J=0;J<X.length;J++){var $=X[J];if(!V0.call(Q,$)||!A5(z[$],Q[$]))return!1}return!0}function gq(z){while(z&&z.firstChild)z=z.firstChild;return z}function aR(z){while(z){if(z.nextSibling)return z.nextSibling;z=z.parentNode}}function Eq(z,Q){var X=gq(z),Z=0,J=0;while(X){if(X.nodeType===S6){if(J=Z+X.textContent.length,Z<=Q&&J>=Q)return{node:X,offset:Q-Z};Z=J}X=gq(aR(X))}}function nR(z){var Q=z.ownerDocument,X=Q&&Q.defaultView||window,Z=X.getSelection&&X.getSelection();if(!Z||Z.rangeCount===0)return null;var{anchorNode:J,anchorOffset:$,focusNode:H,focusOffset:B}=Z;try{J.nodeType,H.nodeType}catch(W){return null}return rR(z,J,$,H,B)}function rR(z,Q,X,Z,J){var $=0,H=-1,B=-1,W=0,w=0,k=z,l=null;z:while(!0){var c=null;while(!0){if(k===Q&&(X===0||k.nodeType===S6))H=$+X;if(k===Z&&(J===0||k.nodeType===S6))B=$+J;if(k.nodeType===S6)$+=k.nodeValue.length;if((c=k.firstChild)===null)break;l=k,k=c}while(!0){if(k===z)break z;if(l===Q&&++W===X)H=$;if(l===Z&&++w===J)B=$;if((c=k.nextSibling)!==null)break;k=l,l=k.parentNode}k=c}if(H===-1||B===-1)return null;return{start:H,end:B}}function sR(z,Q){var X=z.ownerDocument||document,Z=X&&X.defaultView||window;if(!Z.getSelection)return;var J=Z.getSelection(),$=z.textContent.length,H=Math.min(Q.start,$),B=Q.end===void 0?H:Math.min(Q.end,$);if(!J.extend&&H>B){var W=B;B=H,H=W}var w=Eq(z,H),k=Eq(z,B);if(w&&k){if(J.rangeCount===1&&J.anchorNode===w.node&&J.anchorOffset===w.offset&&J.focusNode===k.node&&J.focusOffset===k.offset)return;var l=X.createRange();if(l.setStart(w.node,w.offset),J.removeAllRanges(),H>B)J.addRange(l),J.extend(k.node,k.offset);else l.setEnd(k.node,k.offset),J.addRange(l)}}function uq(z){return z&&z.nodeType===S6}function xq(z,Q){if(!z||!Q)return!1;else if(z===Q)return!0;else if(uq(z))return!1;else if(uq(Q))return xq(z,Q.parentNode);else if("contains"in z)return z.contains(Q);else if(z.compareDocumentPosition)return!!(z.compareDocumentPosition(Q)&16);else return!1}function tR(z){return z&&z.ownerDocument&&xq(z.ownerDocument.documentElement,z)}function eR(z){try{return typeof z.contentWindow.location.href==="string"}catch(Q){return!1}}function jq(){var z=window,Q=G8();while(Q instanceof z.HTMLIFrameElement){if(eR(Q))z=Q.contentWindow;else return Q;Q=G8(z.document)}return Q}function c3(z){var Q=z&&z.nodeName&&z.nodeName.toLowerCase();return Q&&(Q==="input"&&(z.type==="text"||z.type==="search"||z.type==="tel"||z.type==="url"||z.type==="password")||Q==="textarea"||z.contentEditable==="true")}function zN(){var z=jq();return{focusedElem:z,selectionRange:c3(z)?XN(z):null}}function QN(z){var Q=jq(),X=z.focusedElem,Z=z.selectionRange;if(Q!==X&&tR(X)){if(Z!==null&&c3(X))ZN(X,Z);var J=[],$=X;while($=$.parentNode)if($.nodeType===q5)J.push({element:$,left:$.scrollLeft,top:$.scrollTop});if(typeof X.focus==="function")X.focus();for(var H=0;H<J.length;H++){var B=J[H];B.element.scrollLeft=B.left,B.element.scrollTop=B.top}}}function XN(z){var Q;if("selectionStart"in z)Q={start:z.selectionStart,end:z.selectionEnd};else Q=nR(z);return Q||{start:0,end:0}}function ZN(z,Q){var{start:X,end:Z}=Q;if(Z===void 0)Z=X;if("selectionStart"in z)z.selectionStart=X,z.selectionEnd=Math.min(Z,z.value.length);else sR(z,Q)}var JN=N0&&"documentMode"in document&&document.documentMode<=11;function YN(){v1("onSelect",["focusout","contextmenu","dragend","focusin","keydown","keyup","mousedown","mouseup","selectionchange"])}var tz=null,l3=null,yX=null,i3=!1;function $N(z){if("selectionStart"in z&&c3(z))return{start:z.selectionStart,end:z.selectionEnd};else{var Q=z.ownerDocument&&z.ownerDocument.defaultView||window,X=Q.getSelection();return{anchorNode:X.anchorNode,anchorOffset:X.anchorOffset,focusNode:X.focusNode,focusOffset:X.focusOffset}}}function HN(z){return z.window===z?z.document:z.nodeType===v6?z:z.ownerDocument}function pq(z,Q,X){var Z=HN(X);if(i3||tz==null||tz!==G8(Z))return;var J=$N(tz);if(!yX||!hX(yX,J)){yX=J;var $=yJ(l3,"onSelect");if($.length>0){var H=new E3("onSelect","select",null,Q,X);z.push({event:H,listeners:$}),H.target=tz}}}function GN(z,Q,X,Z,J,$,H){var B=X?ZQ(X):window;switch(Q){case"focusin":if(hq(B)||B.contentEditable==="true")tz=B,l3=X,yX=null;break;case"focusout":tz=null,l3=null,yX=null;break;case"mousedown":i3=!0;break;case"contextmenu":case"mouseup":case"dragend":i3=!1,pq(z,Z,J);break;case"selectionchange":if(JN)break;case"keydown":case"keyup":pq(z,Z,J)}}function vJ(z,Q){var X={};return X[z.toLowerCase()]=Q.toLowerCase(),X["Webkit"+z]="webkit"+Q,X["Moz"+z]="moz"+Q,X}var ez={animationend:vJ("Animation","AnimationEnd"),animationiteration:vJ("Animation","AnimationIteration"),animationstart:vJ("Animation","AnimationStart"),transitionend:vJ("Transition","TransitionEnd")},o3={},dq={};if(N0){if(dq=document.createElement("div").style,!("AnimationEvent"in window))delete ez.animationend.animation,delete ez.animationiteration.animation,delete ez.animationstart.animation;if(!("TransitionEvent"in window))delete ez.transitionend.transition}function fJ(z){if(o3[z])return o3[z];else if(!ez[z])return z;var Q=ez[z];for(var X in Q)if(Q.hasOwnProperty(X)&&X in dq)return o3[z]=Q[X];return z}var cq=fJ("animationend"),lq=fJ("animationiteration"),iq=fJ("animationstart"),oq=fJ("transitionend"),aq=new Map,nq=["abort","auxClick","cancel","canPlay","canPlayThrough","click","close","contextMenu","copy","cut","drag","dragEnd","dragEnter","dragExit","dragLeave","dragOver","dragStart","drop","durationChange","emptied","encrypted","ended","error","gotPointerCapture","input","invalid","keyDown","keyPress","keyUp","load","loadedData","loadedMetadata","loadStart","lostPointerCapture","mouseDown","mouseMove","mouseOut","mouseOver","mouseUp","paste","pause","play","playing","pointerCancel","pointerDown","pointerMove","pointerOut","pointerOver","pointerUp","progress","rateChange","reset","resize","seeked","seeking","stalled","submit","suspend","timeUpdate","touchCancel","touchEnd","touchStart","volumeChange","scroll","toggle","touchMove","waiting","wheel"];function K8(z,Q){aq.set(z,Q),v1(Q,[z])}function qN(){for(var z=0;z<nq.length;z++){var Q=nq[z],X=Q.toLowerCase(),Z=Q[0].toUpperCase()+Q.slice(1);K8(X,"on"+Z)}K8(cq,"onAnimationEnd"),K8(lq,"onAnimationIteration"),K8(iq,"onAnimationStart"),K8("dblclick","onDoubleClick"),K8("focusin","onFocus"),K8("focusout","onBlur"),K8(oq,"onTransitionEnd")}function UN(z,Q,X,Z,J,$,H){var B=aq.get(Q);if(B===void 0)return;var W=E3,w=Q;switch(Q){case"keypress":if(TJ(Z)===0)return;case"keydown":case"keyup":W=BR;break;case"focusin":w="focus",W=j3;break;case"focusout":w="blur",W=j3;break;case"beforeblur":case"afterblur":W=j3;break;case"click":if(Z.button===2)return;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":W=Fq;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":W=sL;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":W=KR;break;case cq:case lq:case iq:W=zR;break;case oq:W=LR;break;case"scroll":W=aL;break;case"wheel":W=NR;break;case"copy":case"cut":case"paste":W=XR;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":W=Pq;break}var k=($&JX)!==0;{var l=!k&&Q==="scroll",c=KN(X,B,Z.type,k,l);if(c.length>0){var Z0=new W(B,w,null,Z,J);z.push({event:Z0,listeners:c})}}}qN(),lR(),hR(),YN(),FR();function BN(z,Q,X,Z,J,$,H){UN(z,Q,X,Z,J,$);var B=($&$_)===0;if(B)iR(z,Q,X,Z,J),cR(z,Q,X,Z,J),GN(z,Q,X,Z,J),SR(z,Q,X,Z,J)}var VX=["abort","canplay","canplaythrough","durationchange","emptied","encrypted","ended","error","loadeddata","loadedmetadata","loadstart","pause","play","playing","progress","ratechange","resize","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting"],a3=new Set(["cancel","close","invalid","load","scroll","toggle"].concat(VX));function rq(z,Q,X){var Z=z.type||"unknown-event";z.currentTarget=X,N_(Z,Q,void 0,z),z.currentTarget=null}function WN(z,Q,X){var Z;if(X)for(var J=Q.length-1;J>=0;J--){var $=Q[J],H=$.instance,B=$.currentTarget,W=$.listener;if(H!==Z&&z.isPropagationStopped())return;rq(z,W,B),Z=H}else for(var w=0;w<Q.length;w++){var k=Q[w],l=k.instance,c=k.currentTarget,Z0=k.listener;if(l!==Z&&z.isPropagationStopped())return;rq(z,Z0,c),Z=l}}function sq(z,Q){var X=(Q&JX)!==0;for(var Z=0;Z<z.length;Z++){var J=z[Z],$=J.event,H=J.listeners;WN($,H,X)}M_()}function ON(z,Q,X,Z,J){var $=d2(X),H=[];BN(H,z,Z,X,$,Q),sq(H,Q)}function m4(z,Q){if(!a3.has(z))q('Did not expect a listenToNonDelegatedEvent() call for "%s". This is a bug in React. Please file an issue.',z);var X=!1,Z=dM(Q),J=RN(z,X);if(!Z.has(J))tq(Q,z,p2,X),Z.add(J)}function n3(z,Q,X){if(a3.has(z)&&!Q)q('Did not expect a listenToNativeEvent() call for "%s" in the bubble phase. This is a bug in React. Please file an issue.',z);var Z=0;if(Q)Z|=JX;tq(X,z,Z,Q)}var hJ="_reactListening"+Math.random().toString(36).slice(2);function DX(z){if(!z[hJ]){z[hJ]=!0,Y1.forEach(function(X){if(X!=="selectionchange"){if(!a3.has(X))n3(X,!1,z);n3(X,!0,z)}});var Q=z.nodeType===v6?z:z.ownerDocument;if(Q!==null){if(!Q[hJ])Q[hJ]=!0,n3("selectionchange",!1,Q)}}}function tq(z,Q,X,Z,J){var $=EL(z,Q,X),H=void 0;if(i2){if(Q==="touchstart"||Q==="touchmove"||Q==="wheel")H=!0}z=z;var B;if(Z)if(H!==void 0)B=cL(z,Q,$,H);else B=dL(z,Q,$);else if(H!==void 0)B=lL(z,Q,$,H);else B=pL(z,Q,$)}function eq(z,Q){return z===Q||z.nodeType===X7&&z.parentNode===Q}function r3(z,Q,X,Z,J){var $=Z;if((Q&CG)===0&&(Q&p2)===0){var H=J;if(Z!==null){var B=Z;z:while(!0){if(B===null)return;var W=B.tag;if(W===I||W===b){var w=B.stateNode.containerInfo;if(eq(w,H))break;if(W===b){var k=B.return;while(k!==null){var l=k.tag;if(l===I||l===b){var c=k.stateNode.containerInfo;if(eq(c,H))return}k=k.return}}while(w!==null){var Z0=Qz(w);if(Z0===null)return;var J0=Z0.tag;if(J0===P||J0===N){B=$=Z0;continue z}w=w.parentNode}}B=B.return}}}VG(function(){return ON(z,Q,X,$)})}function mX(z,Q,X){return{instance:z,listener:Q,currentTarget:X}}function KN(z,Q,X,Z,J,$){var H=Q!==null?Q+"Capture":null,B=Z?H:Q,W=[],w=z,k=null;while(w!==null){var l=w,c=l.stateNode,Z0=l.tag;if(Z0===P&&c!==null){if(k=c,B!==null){var J0=$X(w,B);if(J0!=null)W.push(mX(w,J0,k))}}if(J)break;w=w.return}return W}function yJ(z,Q){var X=Q+"Capture",Z=[],J=z;while(J!==null){var $=J,H=$.stateNode,B=$.tag;if(B===P&&H!==null){var W=H,w=$X(J,X);if(w!=null)Z.unshift(mX(J,w,W));var k=$X(J,Q);if(k!=null)Z.push(mX(J,k,W))}J=J.return}return Z}function zQ(z){if(z===null)return null;do z=z.return;while(z&&z.tag!==P);if(z)return z;return null}function _N(z,Q){var X=z,Z=Q,J=0;for(var $=X;$;$=zQ($))J++;var H=0;for(var B=Z;B;B=zQ(B))H++;while(J-H>0)X=zQ(X),J--;while(H-J>0)Z=zQ(Z),H--;var W=J;while(W--){if(X===Z||Z!==null&&X===Z.alternate)return X;X=zQ(X),Z=zQ(Z)}return null}function zU(z,Q,X,Z,J){var $=Q._reactName,H=[],B=X;while(B!==null){if(B===Z)break;var W=B,w=W.alternate,k=W.stateNode,l=W.tag;if(w!==null&&w===Z)break;if(l===P&&k!==null){var c=k;if(J){var Z0=$X(B,$);if(Z0!=null)H.unshift(mX(B,Z0,c))}else if(!J){var J0=$X(B,$);if(J0!=null)H.push(mX(B,J0,c))}}B=B.return}if(H.length!==0)z.push({event:Q,listeners:H})}function LN(z,Q,X,Z,J){var $=Z&&J?_N(Z,J):null;if(Z!==null)zU(z,Q,Z,$,!1);if(J!==null&&X!==null)zU(z,X,J,$,!0)}function RN(z,Q){return z+"__"+(Q?"capture":"bubble")}var U5=!1,gX="dangerouslySetInnerHTML",VJ="suppressContentEditableWarning",_8="suppressHydrationWarning",QU="autoFocus",e8="children",zz="style",DJ="__html",s3,mJ,EX,XU,gJ,ZU,JU;s3={dialog:!0,webview:!0},mJ=function(z,Q){eK(z,Q),z_(z,Q),Y_(z,Q,{registrationNameDependencies:m0,possibleRegistrationNames:$1})},ZU=N0&&!document.documentMode,EX=function(z,Q,X){if(U5)return;var Z=EJ(X),J=EJ(Q);if(J===Z)return;U5=!0,q("Prop `%s` did not match. Server: %s Client: %s",z,JSON.stringify(J),JSON.stringify(Z))},XU=function(z){if(U5)return;U5=!0;var Q=[];z.forEach(function(X){Q.push(X)}),q("Extra attributes from the server: %s",Q)},gJ=function(z,Q){if(Q===!1)q("Expected `%s` listener to be a function, instead got `false`.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.",z,z,z);else q("Expected `%s` listener to be a function, instead got a value of `%s` type.",z,typeof Q)},JU=function(z,Q){var X=z.namespaceURI===C6?z.ownerDocument.createElement(z.tagName):z.ownerDocument.createElementNS(z.namespaceURI,z.tagName);return X.innerHTML=Q,X.innerHTML};var NN=/\r\n?/g,MN=/\u0000|\uFFFD/g;function EJ(z){v4(z);var Q=typeof z==="string"?z:""+z;return Q.replace(NN,`
|
|
32
|
+
`).replace(MN,"")}function uJ(z,Q,X,Z){var J=EJ(Q),$=EJ(z);if($===J)return;if(Z){if(!U5)U5=!0,q('Text content did not match. Server: "%s" Client: "%s"',$,J)}if(X&&K0)throw Error("Text content does not match server-rendered HTML.")}function YU(z){return z.nodeType===v6?z:z.ownerDocument}function wN(){}function xJ(z){z.onclick=wN}function FN(z,Q,X,Z,J){for(var $ in Z){if(!Z.hasOwnProperty($))continue;var H=Z[$];if($===zz){if(H)Object.freeze(H);bG(Q,H)}else if($===gX){var B=H?H[DJ]:void 0;if(B!=null)RG(Q,B)}else if($===e8){if(typeof H==="string"){var W=z!=="textarea"||H!=="";if(W)HJ(Q,H)}else if(typeof H==="number")HJ(Q,""+H)}else if($===VJ||$===_8);else if($===QU);else if(m0.hasOwnProperty($)){if(H!=null){if(typeof H!=="function")gJ($,H);if($==="onScroll")m4("scroll",Q)}}else if(H!=null)p1(Q,$,H,J)}}function bN(z,Q,X,Z){for(var J=0;J<Q.length;J+=2){var $=Q[J],H=Q[J+1];if($===zz)bG(z,H);else if($===gX)RG(z,H);else if($===e8)HJ(z,H);else p1(z,$,H,Z)}}function PN(z,Q,X,Z){var J,$=YU(X),H,B=Z;if(B===C6)B=m2(z);if(B===C6){if(J=j8(z,Q),!J&&z!==z.toLowerCase())q("<%s /> is using incorrect casing. Use PascalCase for React components, or lowercase for HTML elements.",z);if(z==="script"){var W=$.createElement("div");W.innerHTML="<script></script>";var w=W.firstChild;H=W.removeChild(w)}else if(typeof Q.is==="string")H=$.createElement(z,{is:Q.is});else if(H=$.createElement(z),z==="select"){var k=H;if(Q.multiple)k.multiple=!0;else if(Q.size)k.size=Q.size}}else H=$.createElementNS(B,z);if(B===C6){if(!J&&Object.prototype.toString.call(H)==="[object HTMLUnknownElement]"&&!V0.call(s3,z))s3[z]=!0,q("The tag <%s> is unrecognized in this browser. If you meant to render a React component, start its name with an uppercase letter.",z)}return H}function AN(z,Q){return YU(Q).createTextNode(z)}function IN(z,Q,X,Z){var J=j8(Q,X);mJ(Q,X);var $;switch(Q){case"dialog":m4("cancel",z),m4("close",z),$=X;break;case"iframe":case"object":case"embed":m4("load",z),$=X;break;case"video":case"audio":for(var H=0;H<VX.length;H++)m4(VX[H],z);$=X;break;case"source":m4("error",z),$=X;break;case"img":case"image":case"link":m4("error",z),m4("load",z),$=X;break;case"details":m4("toggle",z),$=X;break;case"input":g(z,X),$=L(z,X),m4("invalid",z);break;case"option":I4(z,X),$=X;break;case"select":XX(z,X),$=QX(z,X),m4("invalid",z);break;case"textarea":KG(z,X),$=V2(z,X),m4("invalid",z);break;default:$=X}switch(j2(Q,$),FN(Q,z,Z,$,J),Q){case"input":T6(z),h0(z,X,!1);break;case"textarea":T6(z),LG(z);break;case"option":D4(z,X);break;case"select":y2(z,X);break;default:if(typeof $.onClick==="function")xJ(z);break}}function TN(z,Q,X,Z,J){mJ(Q,Z);var $=null,H,B;switch(Q){case"input":H=L(z,X),B=L(z,Z),$=[];break;case"select":H=QX(z,X),B=QX(z,Z),$=[];break;case"textarea":H=V2(z,X),B=V2(z,Z),$=[];break;default:if(H=X,B=Z,typeof H.onClick!=="function"&&typeof B.onClick==="function")xJ(z);break}j2(Q,B);var W,w,k=null;for(W in H){if(B.hasOwnProperty(W)||!H.hasOwnProperty(W)||H[W]==null)continue;if(W===zz){var l=H[W];for(w in l)if(l.hasOwnProperty(w)){if(!k)k={};k[w]=""}}else if(W===gX||W===e8);else if(W===VJ||W===_8);else if(W===QU);else if(m0.hasOwnProperty(W)){if(!$)$=[]}else($=$||[]).push(W,null)}for(W in B){var c=B[W],Z0=H!=null?H[W]:void 0;if(!B.hasOwnProperty(W)||c===Z0||c==null&&Z0==null)continue;if(W===zz){if(c)Object.freeze(c);if(Z0){for(w in Z0)if(Z0.hasOwnProperty(w)&&(!c||!c.hasOwnProperty(w))){if(!k)k={};k[w]=""}for(w in c)if(c.hasOwnProperty(w)&&Z0[w]!==c[w]){if(!k)k={};k[w]=c[w]}}else{if(!k){if(!$)$=[];$.push(W,k)}k=c}}else if(W===gX){var J0=c?c[DJ]:void 0,$0=Z0?Z0[DJ]:void 0;if(J0!=null){if($0!==J0)($=$||[]).push(W,J0)}}else if(W===e8){if(typeof c==="string"||typeof c==="number")($=$||[]).push(W,""+c)}else if(W===VJ||W===_8);else if(m0.hasOwnProperty(W)){if(c!=null){if(typeof c!=="function")gJ(W,c);if(W==="onScroll")m4("scroll",z)}if(!$&&Z0!==c)$=[]}else($=$||[]).push(W,c)}if(k)lK(k,B[zz]),($=$||[]).push(zz,k);return $}function kN(z,Q,X,Z,J){if(X==="input"&&J.type==="radio"&&J.name!=null)X0(z,J);var $=j8(X,Z),H=j8(X,J);switch(bN(z,Q,$,H),X){case"input":q0(z,J);break;case"textarea":_G(z,J);break;case"select":bK(z,J);break}}function CN(z){{var Q=z.toLowerCase();if(!GJ.hasOwnProperty(Q))return null;return GJ[Q]||null}}function SN(z,Q,X,Z,J,$,H){var B,W;switch(B=j8(Q,X),mJ(Q,X),Q){case"dialog":m4("cancel",z),m4("close",z);break;case"iframe":case"object":case"embed":m4("load",z);break;case"video":case"audio":for(var w=0;w<VX.length;w++)m4(VX[w],z);break;case"source":m4("error",z);break;case"img":case"image":case"link":m4("error",z),m4("load",z);break;case"details":m4("toggle",z);break;case"input":g(z,X),m4("invalid",z);break;case"option":I4(z,X);break;case"select":XX(z,X),m4("invalid",z);break;case"textarea":KG(z,X),m4("invalid",z);break}j2(Q,X);{W=new Set;var k=z.attributes;for(var l=0;l<k.length;l++){var c=k[l].name.toLowerCase();switch(c){case"value":break;case"checked":break;case"selected":break;default:W.add(k[l].name)}}}var Z0=null;for(var J0 in X){if(!X.hasOwnProperty(J0))continue;var $0=X[J0];if(J0===e8){if(typeof $0==="string"){if(z.textContent!==$0){if(X[_8]!==!0)uJ(z.textContent,$0,$,H);Z0=[e8,$0]}}else if(typeof $0==="number"){if(z.textContent!==""+$0){if(X[_8]!==!0)uJ(z.textContent,$0,$,H);Z0=[e8,""+$0]}}}else if(m0.hasOwnProperty(J0)){if($0!=null){if(typeof $0!=="function")gJ(J0,$0);if(J0==="onScroll")m4("scroll",z)}}else if(H&&!0&&typeof B==="boolean"){var j0=void 0,q1=B&&H0?null:e4(J0);if(X[_8]===!0);else if(J0===VJ||J0===_8||J0==="value"||J0==="checked"||J0==="selected");else if(J0===gX){var X1=z.innerHTML,x1=$0?$0[DJ]:void 0;if(x1!=null){var j1=JU(z,x1);if(j1!==X1)EX(J0,X1,j1)}}else if(J0===zz){if(W.delete(J0),ZU){var t=dK($0);if(j0=z.getAttribute("style"),t!==j0)EX(J0,j0,t)}}else if(B&&!H0){if(W.delete(J0.toLowerCase()),j0=d5(z,J0,$0),$0!==j0)EX(J0,j0,$0)}else if(!q4(J0,q1,B)&&!N4(J0,$0,q1,B)){var O0=!1;if(q1!==null)W.delete(q1.attributeName),j0=x7(z,J0,$0,q1);else{var e=Z;if(e===C6)e=m2(Q);if(e===C6)W.delete(J0.toLowerCase());else{var T0=CN(J0);if(T0!==null&&T0!==J0)O0=!0,W.delete(T0);W.delete(J0)}j0=d5(z,J0,$0)}var i0=H0;if(!i0&&$0!==j0&&!O0)EX(J0,j0,$0)}}}if(H){if(W.size>0&&X[_8]!==!0)XU(W)}switch(Q){case"input":T6(z),h0(z,X,!0);break;case"textarea":T6(z),LG(z);break;case"select":case"option":break;default:if(typeof X.onClick==="function")xJ(z);break}return Z0}function vN(z,Q,X){var Z=z.nodeValue!==Q;return Z}function t3(z,Q){{if(U5)return;U5=!0,q("Did not expect server HTML to contain a <%s> in <%s>.",Q.nodeName.toLowerCase(),z.nodeName.toLowerCase())}}function e3(z,Q){{if(U5)return;U5=!0,q('Did not expect server HTML to contain the text node "%s" in <%s>.',Q.nodeValue,z.nodeName.toLowerCase())}}function z$(z,Q,X){{if(U5)return;U5=!0,q("Expected server HTML to contain a matching <%s> in <%s>.",Q,z.nodeName.toLowerCase())}}function Q$(z,Q){{if(Q==="")return;if(U5)return;U5=!0,q('Expected server HTML to contain a matching text node for "%s" in <%s>.',Q,z.nodeName.toLowerCase())}}function fN(z,Q,X){switch(Q){case"input":M1(z,X);return;case"textarea":AK(z,X);return;case"select":PK(z,X);return}}var uX=function(){},xX=function(){};{var hN=["address","applet","area","article","aside","base","basefont","bgsound","blockquote","body","br","button","caption","center","col","colgroup","dd","details","dir","div","dl","dt","embed","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","iframe","img","input","isindex","li","link","listing","main","marquee","menu","menuitem","meta","nav","noembed","noframes","noscript","object","ol","p","param","plaintext","pre","script","section","select","source","style","summary","table","tbody","td","template","textarea","tfoot","th","thead","title","tr","track","ul","wbr","xmp"],$U=["applet","caption","html","table","td","th","marquee","object","template","foreignObject","desc","title"],yN=$U.concat(["button"]),VN=["dd","dt","li","option","optgroup","p","rp","rt"],HU={current:null,formTag:null,aTagInScope:null,buttonTagInScope:null,nobrTagInScope:null,pTagInButtonScope:null,listItemTagAutoclosing:null,dlItemTagAutoclosing:null};xX=function(z,Q){var X=g1({},z||HU),Z={tag:Q};if($U.indexOf(Q)!==-1)X.aTagInScope=null,X.buttonTagInScope=null,X.nobrTagInScope=null;if(yN.indexOf(Q)!==-1)X.pTagInButtonScope=null;if(hN.indexOf(Q)!==-1&&Q!=="address"&&Q!=="div"&&Q!=="p")X.listItemTagAutoclosing=null,X.dlItemTagAutoclosing=null;if(X.current=Z,Q==="form")X.formTag=Z;if(Q==="a")X.aTagInScope=Z;if(Q==="button")X.buttonTagInScope=Z;if(Q==="nobr")X.nobrTagInScope=Z;if(Q==="p")X.pTagInButtonScope=Z;if(Q==="li")X.listItemTagAutoclosing=Z;if(Q==="dd"||Q==="dt")X.dlItemTagAutoclosing=Z;return X};var DN=function(z,Q){switch(Q){case"select":return z==="option"||z==="optgroup"||z==="#text";case"optgroup":return z==="option"||z==="#text";case"option":return z==="#text";case"tr":return z==="th"||z==="td"||z==="style"||z==="script"||z==="template";case"tbody":case"thead":case"tfoot":return z==="tr"||z==="style"||z==="script"||z==="template";case"colgroup":return z==="col"||z==="template";case"table":return z==="caption"||z==="colgroup"||z==="tbody"||z==="tfoot"||z==="thead"||z==="style"||z==="script"||z==="template";case"head":return z==="base"||z==="basefont"||z==="bgsound"||z==="link"||z==="meta"||z==="title"||z==="noscript"||z==="noframes"||z==="style"||z==="script"||z==="template";case"html":return z==="head"||z==="body"||z==="frameset";case"frameset":return z==="frame";case"#document":return z==="html"}switch(z){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":return Q!=="h1"&&Q!=="h2"&&Q!=="h3"&&Q!=="h4"&&Q!=="h5"&&Q!=="h6";case"rp":case"rt":return VN.indexOf(Q)===-1;case"body":case"caption":case"col":case"colgroup":case"frameset":case"frame":case"head":case"html":case"tbody":case"td":case"tfoot":case"th":case"thead":case"tr":return Q==null}return!0},mN=function(z,Q){switch(z){case"address":case"article":case"aside":case"blockquote":case"center":case"details":case"dialog":case"dir":case"div":case"dl":case"fieldset":case"figcaption":case"figure":case"footer":case"header":case"hgroup":case"main":case"menu":case"nav":case"ol":case"p":case"section":case"summary":case"ul":case"pre":case"listing":case"table":case"hr":case"xmp":case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":return Q.pTagInButtonScope;case"form":return Q.formTag||Q.pTagInButtonScope;case"li":return Q.listItemTagAutoclosing;case"dd":case"dt":return Q.dlItemTagAutoclosing;case"button":return Q.buttonTagInScope;case"a":return Q.aTagInScope;case"nobr":return Q.nobrTagInScope}return null},GU={};uX=function(z,Q,X){X=X||HU;var Z=X.current,J=Z&&Z.tag;if(Q!=null){if(z!=null)q("validateDOMNesting: when childText is passed, childTag should be null");z="#text"}var $=DN(z,J)?null:Z,H=$?null:mN(z,X),B=$||H;if(!B)return;var W=B.tag,w=!!$+"|"+z+"|"+W;if(GU[w])return;GU[w]=!0;var k=z,l="";if(z==="#text")if(/\S/.test(Q))k="Text nodes";else k="Whitespace text nodes",l=" Make sure you don't have any extra whitespace between tags on each line of your source code.";else k="<"+z+">";if($){var c="";if(W==="table"&&z==="tr")c+=" Add a <tbody>, <thead> or <tfoot> to your code to match the DOM tree generated by the browser.";q("validateDOMNesting(...): %s cannot appear as a child of <%s>.%s%s",k,W,l,c)}else q("validateDOMNesting(...): %s cannot appear as a descendant of <%s>.",k,W)}}var jJ="suppressHydrationWarning",pJ="$",dJ="/$",jX="$?",pX="$!",gN="style",X$=null,Z$=null;function EN(z){var Q,X,Z=z.nodeType;switch(Z){case v6:case E2:{Q=Z===v6?"#document":"#fragment";var J=z.documentElement;X=J?J.namespaceURI:g2(null,"");break}default:{var $=Z===X7?z.parentNode:z,H=$.namespaceURI||null;Q=$.tagName,X=g2(H,Q);break}}{var B=Q.toLowerCase(),W=xX(null,B);return{namespace:X,ancestorInfo:W}}}function uN(z,Q,X){{var Z=z,J=g2(Z.namespace,Q),$=xX(Z.ancestorInfo,Q);return{namespace:J,ancestorInfo:$}}}function J$(z){return z}function xN(z){X$=gL(),Z$=zN();var Q=null;return Lq(!1),Q}function jN(z){QN(Z$),Lq(X$),X$=null,Z$=null}function pN(z,Q,X,Z,J){var $;{var H=Z;if(uX(z,null,H.ancestorInfo),typeof Q.children==="string"||typeof Q.children==="number"){var B=""+Q.children,W=xX(H.ancestorInfo,z);uX(null,B,W)}$=H.namespace}var w=PN(z,Q,X,$);return lX(J,w),W$(w,Q),w}function dN(z,Q){z.appendChild(Q)}function cN(z,Q,X,Z,J){switch(IN(z,Q,X,Z),Q){case"button":case"input":case"select":case"textarea":return!!X.autoFocus;case"img":return!0;default:return!1}}function lN(z,Q,X,Z,J,$){{var H=$;if(typeof Z.children!==typeof X.children&&(typeof Z.children==="string"||typeof Z.children==="number")){var B=""+Z.children,W=xX(H.ancestorInfo,Q);uX(null,B,W)}}return TN(z,Q,X,Z)}function Y$(z,Q){return z==="textarea"||z==="noscript"||typeof Q.children==="string"||typeof Q.children==="number"||typeof Q.dangerouslySetInnerHTML==="object"&&Q.dangerouslySetInnerHTML!==null&&Q.dangerouslySetInnerHTML.__html!=null}function iN(z,Q,X,Z){{var J=X;uX(null,z,J.ancestorInfo)}var $=AN(z,Q);return lX(Z,$),$}function oN(){var z=window.event;if(z===void 0)return g6;return Rq(z.type)}var $$=typeof setTimeout==="function"?setTimeout:void 0,aN=typeof clearTimeout==="function"?clearTimeout:void 0,H$=-1,qU=typeof Promise==="function"?Promise:void 0,nN=typeof queueMicrotask==="function"?queueMicrotask:typeof qU<"u"?function(z){return qU.resolve(null).then(z).catch(rN)}:$$;function rN(z){setTimeout(function(){throw z})}function sN(z,Q,X,Z){switch(Q){case"button":case"input":case"select":case"textarea":if(X.autoFocus)z.focus();return;case"img":{if(X.src)z.src=X.src;return}}}function tN(z,Q,X,Z,J,$){kN(z,Q,X,Z,J),W$(z,J)}function UU(z){HJ(z,"")}function eN(z,Q,X){z.nodeValue=X}function zM(z,Q){z.appendChild(Q)}function QM(z,Q){var X;if(z.nodeType===X7)X=z.parentNode,X.insertBefore(Q,z);else X=z,X.appendChild(Q);var Z=z._reactRootContainer;if((Z===null||Z===void 0)&&X.onclick===null)xJ(X)}function XM(z,Q,X){z.insertBefore(Q,X)}function ZM(z,Q,X){if(z.nodeType===X7)z.parentNode.insertBefore(Q,X);else z.insertBefore(Q,X)}function JM(z,Q){z.removeChild(Q)}function YM(z,Q){if(z.nodeType===X7)z.parentNode.removeChild(Q);else z.removeChild(Q)}function G$(z,Q){var X=Q,Z=0;do{var J=X.nextSibling;if(z.removeChild(X),J&&J.nodeType===X7){var $=J.data;if($===dJ)if(Z===0){z.removeChild(J),AX(Q);return}else Z--;else if($===pJ||$===jX||$===pX)Z++}X=J}while(X);AX(Q)}function $M(z,Q){if(z.nodeType===X7)G$(z.parentNode,Q);else if(z.nodeType===q5)G$(z,Q);AX(z)}function HM(z){z=z;var Q=z.style;if(typeof Q.setProperty==="function")Q.setProperty("display","none","important");else Q.display="none"}function GM(z){z.nodeValue=""}function qM(z,Q){z=z;var X=Q[gN],Z=X!==void 0&&X!==null&&X.hasOwnProperty("display")?X.display:null;z.style.display=u2("display",Z)}function UM(z,Q){z.nodeValue=Q}function BM(z){if(z.nodeType===q5)z.textContent="";else if(z.nodeType===v6){if(z.documentElement)z.removeChild(z.documentElement)}}function WM(z,Q,X){if(z.nodeType!==q5||Q.toLowerCase()!==z.nodeName.toLowerCase())return null;return z}function OM(z,Q){if(Q===""||z.nodeType!==S6)return null;return z}function KM(z){if(z.nodeType!==X7)return null;return z}function BU(z){return z.data===jX}function q$(z){return z.data===pX}function _M(z){var Q=z.nextSibling&&z.nextSibling.dataset,X,Z,J;if(Q)X=Q.dgst,Z=Q.msg,J=Q.stck;return{message:Z,digest:X,stack:J}}function LM(z,Q){z._reactRetry=Q}function cJ(z){for(;z!=null;z=z.nextSibling){var Q=z.nodeType;if(Q===q5||Q===S6)break;if(Q===X7){var X=z.data;if(X===pJ||X===pX||X===jX)break;if(X===dJ)return null}}return z}function dX(z){return cJ(z.nextSibling)}function RM(z){return cJ(z.firstChild)}function NM(z){return cJ(z.firstChild)}function MM(z){return cJ(z.nextSibling)}function wM(z,Q,X,Z,J,$,H){lX($,z),W$(z,X);var B;{var W=J;B=W.namespace}var w=($.mode&l1)!==K1;return SN(z,Q,X,B,Z,w,H)}function FM(z,Q,X,Z){lX(X,z);var J=(X.mode&l1)!==K1;return vN(z,Q)}function bM(z,Q){lX(Q,z)}function PM(z){var Q=z.nextSibling,X=0;while(Q){if(Q.nodeType===X7){var Z=Q.data;if(Z===dJ)if(X===0)return dX(Q);else X--;else if(Z===pJ||Z===pX||Z===jX)X++}Q=Q.nextSibling}return null}function WU(z){var Q=z.previousSibling,X=0;while(Q){if(Q.nodeType===X7){var Z=Q.data;if(Z===pJ||Z===pX||Z===jX)if(X===0)return Q;else X--;else if(Z===dJ)X++}Q=Q.previousSibling}return null}function AM(z){AX(z)}function IM(z){AX(z)}function TM(z){return z!=="head"&&z!=="body"}function kM(z,Q,X,Z){var J=!0;uJ(Q.nodeValue,X,Z,J)}function CM(z,Q,X,Z,J,$){if(Q[jJ]!==!0){var H=!0;uJ(Z.nodeValue,J,$,H)}}function SM(z,Q){if(Q.nodeType===q5)t3(z,Q);else if(Q.nodeType===X7);else e3(z,Q)}function vM(z,Q){{var X=z.parentNode;if(X!==null)if(Q.nodeType===q5)t3(X,Q);else if(Q.nodeType===X7);else e3(X,Q)}}function fM(z,Q,X,Z,J){if(J||Q[jJ]!==!0)if(Z.nodeType===q5)t3(X,Z);else if(Z.nodeType===X7);else e3(X,Z)}function hM(z,Q,X){z$(z,Q)}function yM(z,Q){Q$(z,Q)}function VM(z,Q,X){{var Z=z.parentNode;if(Z!==null)z$(Z,Q)}}function DM(z,Q){{var X=z.parentNode;if(X!==null)Q$(X,Q)}}function mM(z,Q,X,Z,J,$){if($||Q[jJ]!==!0)z$(X,Z)}function gM(z,Q,X,Z,J){if(J||Q[jJ]!==!0)Q$(X,Z)}function EM(z){q("An error occurred during hydration. The server HTML was replaced with client content in <%s>.",z.nodeName.toLowerCase())}function uM(z){DX(z)}var QQ=Math.random().toString(36).slice(2),XQ="__reactFiber$"+QQ,U$="__reactProps$"+QQ,cX="__reactContainer$"+QQ,B$="__reactEvents$"+QQ,xM="__reactListeners$"+QQ,jM="__reactHandles$"+QQ;function pM(z){delete z[XQ],delete z[U$],delete z[B$],delete z[xM],delete z[jM]}function lX(z,Q){Q[XQ]=z}function lJ(z,Q){Q[cX]=z}function OU(z){z[cX]=null}function iX(z){return!!z[cX]}function Qz(z){var Q=z[XQ];if(Q)return Q;var X=z.parentNode;while(X){if(Q=X[cX]||X[XQ],Q){var Z=Q.alternate;if(Q.child!==null||Z!==null&&Z.child!==null){var J=WU(z);while(J!==null){var $=J[XQ];if($)return $;J=WU(J)}}return Q}z=X,X=z.parentNode}return null}function L8(z){var Q=z[XQ]||z[cX];if(Q)if(Q.tag===P||Q.tag===N||Q.tag===A||Q.tag===I)return Q;else return null;return null}function ZQ(z){if(z.tag===P||z.tag===N)return z.stateNode;throw Error("getNodeFromInstance: Invalid argument.")}function iJ(z){return z[U$]||null}function W$(z,Q){z[U$]=Q}function dM(z){var Q=z[B$];if(Q===void 0)Q=z[B$]=new Set;return Q}var KU={},_U=Y.ReactDebugCurrentFrame;function oJ(z){if(z){var Q=z._owner,X=Y8(z.type,z._source,Q?Q.type:null);_U.setExtraStackFrame(X)}else _U.setExtraStackFrame(null)}function o5(z,Q,X,Z,J){{var $=Function.call.bind(V0);for(var H in z)if($(z,H)){var B=void 0;try{if(typeof z[H]!=="function"){var W=Error((Z||"React class")+": "+X+" type `"+H+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof z[H]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw W.name="Invariant Violation",W}B=z[H](Q,H,Z,X,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(w){B=w}if(B&&!(B instanceof Error))oJ(J),q("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",Z||"React class",X,H,typeof B),oJ(null);if(B instanceof Error&&!(B.message in KU))KU[B.message]=!0,oJ(J),q("Failed %s type: %s",X,B.message),oJ(null)}}}var O$=[],aJ;aJ=[];var E6=-1;function R8(z){return{current:z}}function p7(z,Q){if(E6<0){q("Unexpected pop.");return}if(Q!==aJ[E6])q("Unexpected Fiber popped.");z.current=O$[E6],O$[E6]=null,aJ[E6]=null,E6--}function d7(z,Q,X){E6++,O$[E6]=z.current,aJ[E6]=X,z.current=Q}var LU={},I5={};Object.freeze(I5);var u6=R8(I5),O6=R8(!1),K$=I5;function JQ(z,Q,X){{if(X&&K6(Q))return K$;return u6.current}}function RU(z,Q,X){{var Z=z.stateNode;Z.__reactInternalMemoizedUnmaskedChildContext=Q,Z.__reactInternalMemoizedMaskedChildContext=X}}function YQ(z,Q){{var X=z.type,Z=X.contextTypes;if(!Z)return I5;var J=z.stateNode;if(J&&J.__reactInternalMemoizedUnmaskedChildContext===Q)return J.__reactInternalMemoizedMaskedChildContext;var $={};for(var H in Z)$[H]=Q[H];{var B=y1(z)||"Unknown";o5(Z,$,"context",B)}if(J)RU(z,Q,$);return $}}function nJ(){return O6.current}function K6(z){{var Q=z.childContextTypes;return Q!==null&&Q!==void 0}}function rJ(z){p7(O6,z),p7(u6,z)}function _$(z){p7(O6,z),p7(u6,z)}function NU(z,Q,X){{if(u6.current!==I5)throw Error("Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue.");d7(u6,Q,z),d7(O6,X,z)}}function MU(z,Q,X){{var Z=z.stateNode,J=Q.childContextTypes;if(typeof Z.getChildContext!=="function"){{var $=y1(z)||"Unknown";if(!LU[$])LU[$]=!0,q("%s.childContextTypes is specified but there is no getChildContext() method on the instance. You can either define getChildContext() on %s or remove childContextTypes from it.",$,$)}return X}var H=Z.getChildContext();for(var B in H)if(!(B in J))throw Error((y1(z)||"Unknown")+'.getChildContext(): key "'+B+'" is not defined in childContextTypes.');{var W=y1(z)||"Unknown";o5(J,H,"child context",W)}return g1({},X,H)}}function sJ(z){{var Q=z.stateNode,X=Q&&Q.__reactInternalMemoizedMergedChildContext||I5;return K$=u6.current,d7(u6,X,z),d7(O6,O6.current,z),!0}}function wU(z,Q,X){{var Z=z.stateNode;if(!Z)throw Error("Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue.");if(X){var J=MU(z,Q,K$);Z.__reactInternalMemoizedMergedChildContext=J,p7(O6,z),p7(u6,z),d7(u6,J,z),d7(O6,X,z)}else p7(O6,z),d7(O6,X,z)}}function cM(z){{if(!T_(z)||z.tag!==O)throw Error("Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue.");var Q=z;do{switch(Q.tag){case I:return Q.stateNode.context;case O:{var X=Q.type;if(K6(X))return Q.stateNode.__reactInternalMemoizedMergedChildContext;break}}Q=Q.return}while(Q!==null);throw Error("Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue.")}}var N8=0,tJ=1,x6=null,L$=!1,R$=!1;function FU(z){if(x6===null)x6=[z];else x6.push(z)}function lM(z){L$=!0,FU(z)}function bU(){if(L$)M8()}function M8(){if(!R$&&x6!==null){R$=!0;var z=0,Q=i5();try{var X=!0,Z=x6;A7(b5);for(;z<Z.length;z++){var J=Z[z];do J=J(X);while(J!==null)}x6=null,L$=!1}catch($){if(x6!==null)x6=x6.slice(z+1);throw lG(OJ,M8),$}finally{A7(Q),R$=!1}}return null}var $Q=[],HQ=0,eJ=null,zY=0,f5=[],h5=0,Xz=null,j6=1,p6="";function iM(z){return Jz(),(z.flags&gG)!==N1}function oM(z){return Jz(),zY}function aM(){var z=p6,Q=j6,X=Q&~nM(Q);return X.toString(32)+z}function Zz(z,Q){Jz(),$Q[HQ++]=zY,$Q[HQ++]=eJ,eJ=z,zY=Q}function PU(z,Q,X){Jz(),f5[h5++]=j6,f5[h5++]=p6,f5[h5++]=Xz,Xz=z;var Z=j6,J=p6,$=QY(Z)-1,H=Z&~(1<<$),B=X+1,W=QY(Q)+$;if(W>30){var w=$-$%5,k=(1<<w)-1,l=(H&k).toString(32),c=H>>w,Z0=$-w,J0=QY(Q)+Z0,$0=B<<Z0,j0=$0|c,q1=l+J;j6=1<<J0|j0,p6=q1}else{var X1=B<<$,x1=X1|H,j1=J;j6=1<<W|x1,p6=j1}}function N$(z){Jz();var Q=z.return;if(Q!==null){var X=1,Z=0;Zz(z,X),PU(z,X,Z)}}function QY(z){return 32-sG(z)}function nM(z){return 1<<QY(z)-1}function M$(z){while(z===eJ)eJ=$Q[--HQ],$Q[HQ]=null,zY=$Q[--HQ],$Q[HQ]=null;while(z===Xz)Xz=f5[--h5],f5[h5]=null,p6=f5[--h5],f5[h5]=null,j6=f5[--h5],f5[h5]=null}function rM(){if(Jz(),Xz!==null)return{id:j6,overflow:p6};else return null}function sM(z,Q){Jz(),f5[h5++]=j6,f5[h5++]=p6,f5[h5++]=Xz,j6=Q.id,p6=Q.overflow,Xz=z}function Jz(){if(!S7())q("Expected to be hydrating. This is a bug in React. Please file an issue.")}var C7=null,y5=null,a5=!1,Yz=!1,w8=null;function tM(){if(a5)q("We should not be hydrating here. This is a bug in React. Please file a bug.")}function AU(){Yz=!0}function eM(){return Yz}function zw(z){var Q=z.stateNode.containerInfo;return y5=NM(Q),C7=z,a5=!0,w8=null,Yz=!1,!0}function Qw(z,Q,X){if(y5=MM(Q),C7=z,a5=!0,w8=null,Yz=!1,X!==null)sM(z,X);return!0}function IU(z,Q){switch(z.tag){case I:{SM(z.stateNode.containerInfo,Q);break}case P:{var X=(z.mode&l1)!==K1;fM(z.type,z.memoizedProps,z.stateNode,Q,X);break}case A:{var Z=z.memoizedState;if(Z.dehydrated!==null)vM(Z.dehydrated,Q);break}}}function TU(z,Q){IU(z,Q);var X=qP();X.stateNode=Q,X.return=z;var Z=z.deletions;if(Z===null)z.deletions=[X],z.flags|=p8;else Z.push(X)}function w$(z,Q){{if(Yz)return;switch(z.tag){case I:{var X=z.stateNode.containerInfo;switch(Q.tag){case P:var{type:Z,pendingProps:J}=Q;hM(X,Z);break;case N:var $=Q.pendingProps;yM(X,$);break}break}case P:{var{type:H,memoizedProps:B,stateNode:W}=z;switch(Q.tag){case P:{var{type:w,pendingProps:k}=Q,l=(z.mode&l1)!==K1;mM(H,B,W,w,k,l);break}case N:{var c=Q.pendingProps,Z0=(z.mode&l1)!==K1;gM(H,B,W,c,Z0);break}}break}case A:{var J0=z.memoizedState,$0=J0.dehydrated;if($0!==null)switch(Q.tag){case P:var{type:j0,pendingProps:q1}=Q;VM($0,j0);break;case N:var X1=Q.pendingProps;DM($0,X1);break}break}default:return}}}function kU(z,Q){Q.flags=Q.flags&~h6|Z7,w$(z,Q)}function CU(z,Q){switch(z.tag){case P:{var{type:X,pendingProps:Z}=z,J=WM(Q,X);if(J!==null)return z.stateNode=J,C7=z,y5=RM(J),!0;return!1}case N:{var $=z.pendingProps,H=OM(Q,$);if(H!==null)return z.stateNode=H,C7=z,y5=null,!0;return!1}case A:{var B=KM(Q);if(B!==null){var W={dehydrated:B,treeContext:rM(),retryLane:w5};z.memoizedState=W;var w=UP(B);return w.return=z,z.child=w,C7=z,y5=null,!0}return!1}default:return!1}}function F$(z){return(z.mode&l1)!==K1&&(z.flags&X4)===N1}function b$(z){throw Error("Hydration failed because the initial UI does not match what was rendered on the server.")}function P$(z){if(!a5)return;var Q=y5;if(!Q){if(F$(z))w$(C7,z),b$();kU(C7,z),a5=!1,C7=z;return}var X=Q;if(!CU(z,Q)){if(F$(z))w$(C7,z),b$();Q=dX(X);var Z=C7;if(!Q||!CU(z,Q)){kU(C7,z),a5=!1,C7=z;return}TU(Z,X)}}function Xw(z,Q,X){var Z=z.stateNode,J=!Yz,$=wM(Z,z.type,z.memoizedProps,Q,X,z,J);if(z.updateQueue=$,$!==null)return!0;return!1}function Zw(z){var{stateNode:Q,memoizedProps:X}=z,Z=FM(Q,X,z);if(Z){var J=C7;if(J!==null)switch(J.tag){case I:{var $=J.stateNode.containerInfo,H=(J.mode&l1)!==K1;kM($,Q,X,H);break}case P:{var{type:B,memoizedProps:W,stateNode:w}=J,k=(J.mode&l1)!==K1;CM(B,W,w,Q,X,k);break}}}return Z}function Jw(z){var Q=z.memoizedState,X=Q!==null?Q.dehydrated:null;if(!X)throw Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");bM(X,z)}function Yw(z){var Q=z.memoizedState,X=Q!==null?Q.dehydrated:null;if(!X)throw Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");return PM(X)}function SU(z){var Q=z.return;while(Q!==null&&Q.tag!==P&&Q.tag!==I&&Q.tag!==A)Q=Q.return;C7=Q}function XY(z){if(z!==C7)return!1;if(!a5)return SU(z),a5=!0,!1;if(z.tag!==I&&(z.tag!==P||TM(z.type)&&!Y$(z.type,z.memoizedProps))){var Q=y5;if(Q)if(F$(z))vU(z),b$();else while(Q)TU(z,Q),Q=dX(Q)}if(SU(z),z.tag===A)y5=Yw(z);else y5=C7?dX(z.stateNode):null;return!0}function $w(){return a5&&y5!==null}function vU(z){var Q=y5;while(Q)IU(z,Q),Q=dX(Q)}function GQ(){C7=null,y5=null,a5=!1,Yz=!1}function fU(){if(w8!==null)IW(w8),w8=null}function S7(){return a5}function A$(z){if(w8===null)w8=[z];else w8.push(z)}var Hw=Y.ReactCurrentBatchConfig,Gw=null;function qw(){return Hw.transition}var n5={recordUnsafeLifecycleWarnings:function(z,Q){},flushPendingUnsafeLifecycleWarnings:function(){},recordLegacyContextWarning:function(z,Q){},flushLegacyContextWarning:function(){},discardPendingWarnings:function(){}};{var Uw=function(z){var Q=null,X=z;while(X!==null){if(X.mode&o4)Q=X;X=X.return}return Q},$z=function(z){var Q=[];return z.forEach(function(X){Q.push(X)}),Q.sort().join(", ")},oX=[],aX=[],nX=[],rX=[],sX=[],tX=[],Hz=new Set;n5.recordUnsafeLifecycleWarnings=function(z,Q){if(Hz.has(z.type))return;if(typeof Q.componentWillMount==="function"&&Q.componentWillMount.__suppressDeprecationWarning!==!0)oX.push(z);if(z.mode&o4&&typeof Q.UNSAFE_componentWillMount==="function")aX.push(z);if(typeof Q.componentWillReceiveProps==="function"&&Q.componentWillReceiveProps.__suppressDeprecationWarning!==!0)nX.push(z);if(z.mode&o4&&typeof Q.UNSAFE_componentWillReceiveProps==="function")rX.push(z);if(typeof Q.componentWillUpdate==="function"&&Q.componentWillUpdate.__suppressDeprecationWarning!==!0)sX.push(z);if(z.mode&o4&&typeof Q.UNSAFE_componentWillUpdate==="function")tX.push(z)},n5.flushPendingUnsafeLifecycleWarnings=function(){var z=new Set;if(oX.length>0)oX.forEach(function(c){z.add(y1(c)||"Component"),Hz.add(c.type)}),oX=[];var Q=new Set;if(aX.length>0)aX.forEach(function(c){Q.add(y1(c)||"Component"),Hz.add(c.type)}),aX=[];var X=new Set;if(nX.length>0)nX.forEach(function(c){X.add(y1(c)||"Component"),Hz.add(c.type)}),nX=[];var Z=new Set;if(rX.length>0)rX.forEach(function(c){Z.add(y1(c)||"Component"),Hz.add(c.type)}),rX=[];var J=new Set;if(sX.length>0)sX.forEach(function(c){J.add(y1(c)||"Component"),Hz.add(c.type)}),sX=[];var $=new Set;if(tX.length>0)tX.forEach(function(c){$.add(y1(c)||"Component"),Hz.add(c.type)}),tX=[];if(Q.size>0){var H=$z(Q);q(`Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.
|
|
33
|
+
|
|
34
|
+
* Move code with side effects to componentDidMount, and set initial state in the constructor.
|
|
35
|
+
|
|
36
|
+
Please update the following components: %s`,H)}if(Z.size>0){var B=$z(Z);q(`Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.
|
|
37
|
+
|
|
38
|
+
* Move data fetching code or side effects to componentDidUpdate.
|
|
39
|
+
* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state
|
|
40
|
+
|
|
41
|
+
Please update the following components: %s`,B)}if($.size>0){var W=$z($);q(`Using UNSAFE_componentWillUpdate in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.
|
|
42
|
+
|
|
43
|
+
* Move data fetching code or side effects to componentDidUpdate.
|
|
44
|
+
|
|
45
|
+
Please update the following components: %s`,W)}if(z.size>0){var w=$z(z);_(`componentWillMount has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.
|
|
46
|
+
|
|
47
|
+
* Move code with side effects to componentDidMount, and set initial state in the constructor.
|
|
48
|
+
* Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.
|
|
49
|
+
|
|
50
|
+
Please update the following components: %s`,w)}if(X.size>0){var k=$z(X);_(`componentWillReceiveProps has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.
|
|
51
|
+
|
|
52
|
+
* Move data fetching code or side effects to componentDidUpdate.
|
|
53
|
+
* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state
|
|
54
|
+
* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.
|
|
55
|
+
|
|
56
|
+
Please update the following components: %s`,k)}if(J.size>0){var l=$z(J);_(`componentWillUpdate has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.
|
|
57
|
+
|
|
58
|
+
* Move data fetching code or side effects to componentDidUpdate.
|
|
59
|
+
* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.
|
|
60
|
+
|
|
61
|
+
Please update the following components: %s`,l)}};var ZY=new Map,hU=new Set;n5.recordLegacyContextWarning=function(z,Q){var X=Uw(z);if(X===null){q("Expected to find a StrictMode component in a strict mode tree. This error is likely caused by a bug in React. Please file an issue.");return}if(hU.has(z.type))return;var Z=ZY.get(X);if(z.type.contextTypes!=null||z.type.childContextTypes!=null||Q!==null&&typeof Q.getChildContext==="function"){if(Z===void 0)Z=[],ZY.set(X,Z);Z.push(z)}},n5.flushLegacyContextWarning=function(){ZY.forEach(function(z,Q){if(z.length===0)return;var X=z[0],Z=new Set;z.forEach(function($){Z.add(y1($)||"Component"),hU.add($.type)});var J=$z(Z);try{p4(X),q(`Legacy context API has been detected within a strict-mode tree.
|
|
62
|
+
|
|
63
|
+
The old API will be supported in all 16.x releases, but applications using it should migrate to the new version.
|
|
64
|
+
|
|
65
|
+
Please update the following components: %s
|
|
66
|
+
|
|
67
|
+
Learn more about this warning here: https://reactjs.org/link/legacy-context`,J)}finally{w7()}})},n5.discardPendingWarnings=function(){oX=[],aX=[],nX=[],rX=[],sX=[],tX=[],ZY=new Map}}var I$,T$,k$,C$,S$,yU=function(z,Q){};I$=!1,T$=!1,k$={},C$={},S$={},yU=function(z,Q){if(z===null||typeof z!=="object")return;if(!z._store||z._store.validated||z.key!=null)return;if(typeof z._store!=="object")throw Error("React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue.");z._store.validated=!0;var X=y1(Q)||"Component";if(C$[X])return;C$[X]=!0,q('Each child in a list should have a unique "key" prop. See https://reactjs.org/link/warning-keys for more information.')};function Bw(z){return z.prototype&&z.prototype.isReactComponent}function eX(z,Q,X){var Z=X.ref;if(Z!==null&&typeof Z!=="function"&&typeof Z!=="object"){if((z.mode&o4||y0)&&!(X._owner&&X._self&&X._owner.stateNode!==X._self)&&!(X._owner&&X._owner.tag!==O)&&!(typeof X.type==="function"&&!Bw(X.type))&&X._owner){var J=y1(z)||"Component";if(!k$[J])q('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. We recommend using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',J,Z),k$[J]=!0}if(X._owner){var $=X._owner,H;if($){var B=$;if(B.tag!==O)throw Error("Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref");H=B.stateNode}if(!H)throw Error("Missing owner for string ref "+Z+". This error is likely caused by a bug in React. Please file an issue.");var W=H;S1(Z,"ref");var w=""+Z;if(Q!==null&&Q.ref!==null&&typeof Q.ref==="function"&&Q.ref._stringRef===w)return Q.ref;var k=function(l){var c=W.refs;if(l===null)delete c[w];else c[w]=l};return k._stringRef=w,k}else{if(typeof Z!=="string")throw Error("Expected ref to be a function, a string, an object returned by React.createRef(), or null.");if(!X._owner)throw Error("Element ref was specified as a string ("+Z+`) but no owner was set. This could happen for one of the following reasons:
|
|
68
|
+
1. You may be adding a ref to a function component
|
|
69
|
+
2. You may be adding a ref to a component that was not created inside a component's render method
|
|
70
|
+
3. You have multiple copies of React loaded
|
|
71
|
+
See https://reactjs.org/link/refs-must-have-owner for more information.`)}}return Z}function JY(z,Q){var X=Object.prototype.toString.call(Q);throw Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(Q).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.")}function YY(z){{var Q=y1(z)||"Component";if(S$[Q])return;S$[Q]=!0,q("Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render. Or maybe you meant to call this function rather than return it.")}}function VU(z){var{_payload:Q,_init:X}=z;return X(Q)}function DU(z){function Q(t,O0){if(!z)return;var e=t.deletions;if(e===null)t.deletions=[O0],t.flags|=p8;else e.push(O0)}function X(t,O0){if(!z)return null;var e=O0;while(e!==null)Q(t,e),e=e.sibling;return null}function Z(t,O0){var e=new Map,T0=O0;while(T0!==null){if(T0.key!==null)e.set(T0.key,T0);else e.set(T0.index,T0);T0=T0.sibling}return e}function J(t,O0){var e=Lz(t,O0);return e.index=0,e.sibling=null,e}function $(t,O0,e){if(t.index=e,!z)return t.flags|=gG,O0;var T0=t.alternate;if(T0!==null){var i0=T0.index;if(i0<O0)return t.flags|=Z7,O0;else return i0}else return t.flags|=Z7,O0}function H(t){if(z&&t.alternate===null)t.flags|=Z7;return t}function B(t,O0,e,T0){if(O0===null||O0.tag!==N){var i0=TH(e,t.mode,T0);return i0.return=t,i0}else{var d0=J(O0,e);return d0.return=t,d0}}function W(t,O0,e,T0){var i0=e.type;if(i0===t1)return k(t,O0,e.props.children,T0,e.key);if(O0!==null){if(O0.elementType===i0||jW(O0,e)||typeof i0==="object"&&i0!==null&&i0.$$typeof===Q1&&VU(i0)===O0.type){var d0=J(O0,e.props);return d0.ref=eX(t,O0,e),d0.return=t,d0._debugSource=e._source,d0._debugOwner=e._owner,d0}}var w1=IH(e,t.mode,T0);return w1.ref=eX(t,O0,e),w1.return=t,w1}function w(t,O0,e,T0){if(O0===null||O0.tag!==b||O0.stateNode.containerInfo!==e.containerInfo||O0.stateNode.implementation!==e.implementation){var i0=kH(e,t.mode,T0);return i0.return=t,i0}else{var d0=J(O0,e.children||[]);return d0.return=t,d0}}function k(t,O0,e,T0,i0){if(O0===null||O0.tag!==S){var d0=f8(e,t.mode,T0,i0);return d0.return=t,d0}else{var w1=J(O0,e);return w1.return=t,w1}}function l(t,O0,e){if(typeof O0==="string"&&O0!==""||typeof O0==="number"){var T0=TH(""+O0,t.mode,e);return T0.return=t,T0}if(typeof O0==="object"&&O0!==null){switch(O0.$$typeof){case U4:{var i0=IH(O0,t.mode,e);return i0.ref=eX(t,null,O0),i0.return=t,i0}case F4:{var d0=kH(O0,t.mode,e);return d0.return=t,d0}case Q1:{var{_payload:w1,_init:C1}=O0;return l(t,C1(w1),e)}}if(Q4(O0)||h4(O0)){var _4=f8(O0,t.mode,e,null);return _4.return=t,_4}JY(t,O0)}if(typeof O0==="function")YY(t);return null}function c(t,O0,e,T0){var i0=O0!==null?O0.key:null;if(typeof e==="string"&&e!==""||typeof e==="number"){if(i0!==null)return null;return B(t,O0,""+e,T0)}if(typeof e==="object"&&e!==null){switch(e.$$typeof){case U4:if(e.key===i0)return W(t,O0,e,T0);else return null;case F4:if(e.key===i0)return w(t,O0,e,T0);else return null;case Q1:{var{_payload:d0,_init:w1}=e;return c(t,O0,w1(d0),T0)}}if(Q4(e)||h4(e)){if(i0!==null)return null;return k(t,O0,e,T0,null)}JY(t,e)}if(typeof e==="function")YY(t);return null}function Z0(t,O0,e,T0,i0){if(typeof T0==="string"&&T0!==""||typeof T0==="number"){var d0=t.get(e)||null;return B(O0,d0,""+T0,i0)}if(typeof T0==="object"&&T0!==null){switch(T0.$$typeof){case U4:{var w1=t.get(T0.key===null?e:T0.key)||null;return W(O0,w1,T0,i0)}case F4:{var C1=t.get(T0.key===null?e:T0.key)||null;return w(O0,C1,T0,i0)}case Q1:var{_payload:_4,_init:e1}=T0;return Z0(t,O0,e,e1(_4),i0)}if(Q4(T0)||h4(T0)){var z7=t.get(e)||null;return k(O0,z7,T0,i0,null)}JY(O0,T0)}if(typeof T0==="function")YY(O0);return null}function J0(t,O0,e){{if(typeof t!=="object"||t===null)return O0;switch(t.$$typeof){case U4:case F4:yU(t,e);var T0=t.key;if(typeof T0!=="string")break;if(O0===null){O0=new Set,O0.add(T0);break}if(!O0.has(T0)){O0.add(T0);break}q("Encountered two children with the same key, `%s`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be "+"duplicated and/or omitted — the behavior is unsupported and "+"could change in a future version.",T0);break;case Q1:var{_payload:i0,_init:d0}=t;J0(d0(i0),O0,e);break}}return O0}function $0(t,O0,e,T0){{var i0=null;for(var d0=0;d0<e.length;d0++){var w1=e[d0];i0=J0(w1,i0,t)}}var C1=null,_4=null,e1=O0,z7=0,z4=0,a4=null;for(;e1!==null&&z4<e.length;z4++){if(e1.index>z4)a4=e1,e1=null;else a4=e1.sibling;var l7=c(t,e1,e[z4],T0);if(l7===null){if(e1===null)e1=a4;break}if(z){if(e1&&l7.alternate===null)Q(t,e1)}if(z7=$(l7,z7,z4),_4===null)C1=l7;else _4.sibling=l7;_4=l7,e1=a4}if(z4===e.length){if(X(t,e1),S7()){var m7=z4;Zz(t,m7)}return C1}if(e1===null){for(;z4<e.length;z4++){var k5=l(t,e[z4],T0);if(k5===null)continue;if(z7=$(k5,z7,z4),_4===null)C1=k5;else _4.sibling=k5;_4=k5}if(S7()){var J5=z4;Zz(t,J5)}return C1}var Y5=Z(t,e1);for(;z4<e.length;z4++){var i7=Z0(Y5,t,z4,e[z4],T0);if(i7!==null){if(z){if(i7.alternate!==null)Y5.delete(i7.key===null?z4:i7.key)}if(z7=$(i7,z7,z4),_4===null)C1=i7;else _4.sibling=i7;_4=i7}}if(z)Y5.forEach(function(kQ){return Q(t,kQ)});if(S7()){var n6=z4;Zz(t,n6)}return C1}function j0(t,O0,e,T0){var i0=h4(e);if(typeof i0!=="function")throw Error("An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.");{if(typeof Symbol==="function"&&e[Symbol.toStringTag]==="Generator"){if(!T$)q("Using Generators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. Keep in mind you might need to polyfill these features for older browsers.");T$=!0}if(e.entries===i0){if(!I$)q("Using Maps as children is not supported. Use an array of keyed ReactElements instead.");I$=!0}var d0=i0.call(e);if(d0){var w1=null,C1=d0.next();for(;!C1.done;C1=d0.next()){var _4=C1.value;w1=J0(_4,w1,t)}}}var e1=i0.call(e);if(e1==null)throw Error("An iterable object provided no iterator.");var z7=null,z4=null,a4=O0,l7=0,m7=0,k5=null,J5=e1.next();for(;a4!==null&&!J5.done;m7++,J5=e1.next()){if(a4.index>m7)k5=a4,a4=null;else k5=a4.sibling;var Y5=c(t,a4,J5.value,T0);if(Y5===null){if(a4===null)a4=k5;break}if(z){if(a4&&Y5.alternate===null)Q(t,a4)}if(l7=$(Y5,l7,m7),z4===null)z7=Y5;else z4.sibling=Y5;z4=Y5,a4=k5}if(J5.done){if(X(t,a4),S7()){var i7=m7;Zz(t,i7)}return z7}if(a4===null){for(;!J5.done;m7++,J5=e1.next()){var n6=l(t,J5.value,T0);if(n6===null)continue;if(l7=$(n6,l7,m7),z4===null)z7=n6;else z4.sibling=n6;z4=n6}if(S7()){var kQ=m7;Zz(t,kQ)}return z7}var fZ=Z(t,a4);for(;!J5.done;m7++,J5=e1.next()){var b6=Z0(fZ,t,m7,J5.value,T0);if(b6!==null){if(z){if(b6.alternate!==null)fZ.delete(b6.key===null?m7:b6.key)}if(l7=$(b6,l7,m7),z4===null)z7=b6;else z4.sibling=b6;z4=b6}}if(z)fZ.forEach(function(jP){return Q(t,jP)});if(S7()){var xP=m7;Zz(t,xP)}return z7}function q1(t,O0,e,T0){if(O0!==null&&O0.tag===N){X(t,O0.sibling);var i0=J(O0,e);return i0.return=t,i0}X(t,O0);var d0=TH(e,t.mode,T0);return d0.return=t,d0}function X1(t,O0,e,T0){var i0=e.key,d0=O0;while(d0!==null){if(d0.key===i0){var w1=e.type;if(w1===t1){if(d0.tag===S){X(t,d0.sibling);var C1=J(d0,e.props.children);return C1.return=t,C1._debugSource=e._source,C1._debugOwner=e._owner,C1}}else if(d0.elementType===w1||jW(d0,e)||typeof w1==="object"&&w1!==null&&w1.$$typeof===Q1&&VU(w1)===d0.type){X(t,d0.sibling);var _4=J(d0,e.props);return _4.ref=eX(t,d0,e),_4.return=t,_4._debugSource=e._source,_4._debugOwner=e._owner,_4}X(t,d0);break}else Q(t,d0);d0=d0.sibling}if(e.type===t1){var e1=f8(e.props.children,t.mode,T0,e.key);return e1.return=t,e1}else{var z7=IH(e,t.mode,T0);return z7.ref=eX(t,O0,e),z7.return=t,z7}}function x1(t,O0,e,T0){var i0=e.key,d0=O0;while(d0!==null){if(d0.key===i0)if(d0.tag===b&&d0.stateNode.containerInfo===e.containerInfo&&d0.stateNode.implementation===e.implementation){X(t,d0.sibling);var w1=J(d0,e.children||[]);return w1.return=t,w1}else{X(t,d0);break}else Q(t,d0);d0=d0.sibling}var C1=kH(e,t.mode,T0);return C1.return=t,C1}function j1(t,O0,e,T0){var i0=typeof e==="object"&&e!==null&&e.type===t1&&e.key===null;if(i0)e=e.props.children;if(typeof e==="object"&&e!==null){switch(e.$$typeof){case U4:return H(X1(t,O0,e,T0));case F4:return H(x1(t,O0,e,T0));case Q1:var{_payload:d0,_init:w1}=e;return j1(t,O0,w1(d0),T0)}if(Q4(e))return $0(t,O0,e,T0);if(h4(e))return j0(t,O0,e,T0);JY(t,e)}if(typeof e==="string"&&e!==""||typeof e==="number")return H(q1(t,O0,""+e,T0));if(typeof e==="function")YY(t);return X(t,O0)}return j1}var qQ=DU(!0),mU=DU(!1);function Ww(z,Q){if(z!==null&&Q.child!==z.child)throw Error("Resuming work not yet implemented.");if(Q.child===null)return;var X=Q.child,Z=Lz(X,X.pendingProps);Q.child=Z,Z.return=Q;while(X.sibling!==null)X=X.sibling,Z=Z.sibling=Lz(X,X.pendingProps),Z.return=Q;Z.sibling=null}function Ow(z,Q){var X=z.child;while(X!==null)JP(X,Q),X=X.sibling}var v$=R8(null),f$;f$={};var $Y=null,UQ=null,h$=null,HY=!1;function GY(){$Y=null,UQ=null,h$=null,HY=!1}function gU(){HY=!0}function EU(){HY=!1}function uU(z,Q,X){{d7(v$,Q._currentValue,z),Q._currentValue=X;{if(Q._currentRenderer!==void 0&&Q._currentRenderer!==null&&Q._currentRenderer!==f$)q("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported.");Q._currentRenderer=f$}}}function y$(z,Q){var X=v$.current;p7(v$,Q),z._currentValue=X}function V$(z,Q,X){var Z=z;while(Z!==null){var J=Z.alternate;if(!az(Z.childLanes,Q)){if(Z.childLanes=D1(Z.childLanes,Q),J!==null)J.childLanes=D1(J.childLanes,Q)}else if(J!==null&&!az(J.childLanes,Q))J.childLanes=D1(J.childLanes,Q);if(Z===X)break;Z=Z.return}if(Z!==X)q("Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue.")}function Kw(z,Q,X){_w(z,Q,X)}function _w(z,Q,X){var Z=z.child;if(Z!==null)Z.return=z;while(Z!==null){var J=void 0,$=Z.dependencies;if($!==null){J=Z.child;var H=$.firstContext;while(H!==null){if(H.context===Q){if(Z.tag===O){var B=RX(X),W=d6(y4,B);W.tag=UY;var w=Z.updateQueue;if(w===null);else{var k=w.shared,l=k.pending;if(l===null)W.next=W;else W.next=l.next,l.next=W;k.pending=W}}Z.lanes=D1(Z.lanes,X);var c=Z.alternate;if(c!==null)c.lanes=D1(c.lanes,X);V$(Z.return,X,z),$.lanes=D1($.lanes,X);break}H=H.next}}else if(Z.tag===x)J=Z.type===z.type?null:Z.child;else if(Z.tag===i){var Z0=Z.return;if(Z0===null)throw Error("We just came from a parent so we must have had a parent. This is a bug in React.");Z0.lanes=D1(Z0.lanes,X);var J0=Z0.alternate;if(J0!==null)J0.lanes=D1(J0.lanes,X);V$(Z0,X,z),J=Z.sibling}else J=Z.child;if(J!==null)J.return=Z;else{J=Z;while(J!==null){if(J===z){J=null;break}var $0=J.sibling;if($0!==null){$0.return=J.return,J=$0;break}J=J.return}}Z=J}}function BQ(z,Q){$Y=z,UQ=null,h$=null;var X=z.dependencies;if(X!==null){var Z=X.firstContext;if(Z!==null){if(F5(X.lanes,Q))KZ();X.firstContext=null}}}function J7(z){if(HY)q("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");var Q=z._currentValue;if(h$===z);else{var X={context:z,memoizedValue:Q,next:null};if(UQ===null){if($Y===null)throw Error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");UQ=X,$Y.dependencies={lanes:b0,firstContext:X}}else UQ=UQ.next=X}return Q}var Gz=null;function D$(z){if(Gz===null)Gz=[z];else Gz.push(z)}function Lw(){if(Gz!==null){for(var z=0;z<Gz.length;z++){var Q=Gz[z],X=Q.interleaved;if(X!==null){Q.interleaved=null;var Z=X.next,J=Q.pending;if(J!==null){var $=J.next;J.next=Z,X.next=$}Q.pending=X}}Gz=null}}function xU(z,Q,X,Z){var J=Q.interleaved;if(J===null)X.next=X,D$(Q);else X.next=J.next,J.next=X;return Q.interleaved=X,qY(z,Z)}function Rw(z,Q,X,Z){var J=Q.interleaved;if(J===null)X.next=X,D$(Q);else X.next=J.next,J.next=X;Q.interleaved=X}function Nw(z,Q,X,Z){var J=Q.interleaved;if(J===null)X.next=X,D$(Q);else X.next=J.next,J.next=X;return Q.interleaved=X,qY(z,Z)}function B5(z,Q){return qY(z,Q)}var Mw=qY;function qY(z,Q){z.lanes=D1(z.lanes,Q);var X=z.alternate;if(X!==null)X.lanes=D1(X.lanes,Q);if(X===null&&(z.flags&(Z7|h6))!==N1)gW(z);var Z=z,J=z.return;while(J!==null){if(J.childLanes=D1(J.childLanes,Q),X=J.alternate,X!==null)X.childLanes=D1(X.childLanes,Q);else if((J.flags&(Z7|h6))!==N1)gW(z);Z=J,J=J.return}if(Z.tag===I){var $=Z.stateNode;return $}else return null}var jU=0,pU=1,UY=2,m$=3,BY=!1,g$,WY;g$=!1,WY=null;function E$(z){var Q={baseState:z.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:b0},effects:null};z.updateQueue=Q}function dU(z,Q){var X=Q.updateQueue,Z=z.updateQueue;if(X===Z){var J={baseState:Z.baseState,firstBaseUpdate:Z.firstBaseUpdate,lastBaseUpdate:Z.lastBaseUpdate,shared:Z.shared,effects:Z.effects};Q.updateQueue=J}}function d6(z,Q){var X={eventTime:z,lane:Q,tag:jU,payload:null,callback:null,next:null};return X}function F8(z,Q,X){var Z=z.updateQueue;if(Z===null)return null;var J=Z.shared;if(WY===J&&!g$)q("An update (setState, replaceState, or forceUpdate) was scheduled from inside an update function. Update functions should be pure, with zero side-effects. Consider using componentDidUpdate or a callback."),g$=!0;if(Fb()){var $=J.pending;if($===null)Q.next=Q;else Q.next=$.next,$.next=Q;return J.pending=Q,Mw(z,X)}else return Nw(z,J,Q,X)}function OY(z,Q,X){var Z=Q.updateQueue;if(Z===null)return;var J=Z.shared;if(Qq(X)){var $=J.lanes;$=Zq($,z.pendingLanes);var H=D1($,X);J.lanes=H,v3(z,H)}}function u$(z,Q){var{updateQueue:X,alternate:Z}=z;if(Z!==null){var J=Z.updateQueue;if(X===J){var $=null,H=null,B=X.firstBaseUpdate;if(B!==null){var W=B;do{var w={eventTime:W.eventTime,lane:W.lane,tag:W.tag,payload:W.payload,callback:W.callback,next:null};if(H===null)$=H=w;else H.next=w,H=w;W=W.next}while(W!==null);if(H===null)$=H=Q;else H.next=Q,H=Q}else $=H=Q;X={baseState:J.baseState,firstBaseUpdate:$,lastBaseUpdate:H,shared:J.shared,effects:J.effects},z.updateQueue=X;return}}var k=X.lastBaseUpdate;if(k===null)X.firstBaseUpdate=Q;else k.next=Q;X.lastBaseUpdate=Q}function ww(z,Q,X,Z,J,$){switch(X.tag){case pU:{var H=X.payload;if(typeof H==="function"){gU();var B=H.call($,Z,J);{if(z.mode&o4){b7(!0);try{H.call($,Z,J)}finally{b7(!1)}}EU()}return B}return H}case m$:z.flags=z.flags&~z5|X4;case jU:{var W=X.payload,w;if(typeof W==="function"){gU(),w=W.call($,Z,J);{if(z.mode&o4){b7(!0);try{W.call($,Z,J)}finally{b7(!1)}}EU()}}else w=W;if(w===null||w===void 0)return Z;return g1({},Z,w)}case UY:return BY=!0,Z}return Z}function KY(z,Q,X,Z){var J=z.updateQueue;BY=!1,WY=J.shared;var{firstBaseUpdate:$,lastBaseUpdate:H}=J,B=J.shared.pending;if(B!==null){J.shared.pending=null;var W=B,w=W.next;if(W.next=null,H===null)$=w;else H.next=w;H=W;var k=z.alternate;if(k!==null){var l=k.updateQueue,c=l.lastBaseUpdate;if(c!==H){if(c===null)l.firstBaseUpdate=w;else c.next=w;l.lastBaseUpdate=W}}}if($!==null){var Z0=J.baseState,J0=b0,$0=null,j0=null,q1=null,X1=$;do{var{lane:x1,eventTime:j1}=X1;if(!az(Z,x1)){var t={eventTime:j1,lane:x1,tag:X1.tag,payload:X1.payload,callback:X1.callback,next:null};if(q1===null)j0=q1=t,$0=Z0;else q1=q1.next=t;J0=D1(J0,x1)}else{if(q1!==null){var O0={eventTime:j1,lane:P7,tag:X1.tag,payload:X1.payload,callback:X1.callback,next:null};q1=q1.next=O0}Z0=ww(z,J,X1,Z0,Q,X);var e=X1.callback;if(e!==null&&X1.lane!==P7){z.flags|=s2;var T0=J.effects;if(T0===null)J.effects=[X1];else T0.push(X1)}}if(X1=X1.next,X1===null)if(B=J.shared.pending,B===null)break;else{var i0=B,d0=i0.next;i0.next=null,X1=d0,J.lastBaseUpdate=i0,J.shared.pending=null}}while(!0);if(q1===null)$0=Z0;J.baseState=$0,J.firstBaseUpdate=j0,J.lastBaseUpdate=q1;var w1=J.shared.interleaved;if(w1!==null){var C1=w1;do J0=D1(J0,C1.lane),C1=C1.next;while(C1!==w1)}else if($===null)J.shared.lanes=b0;TZ(J0),z.lanes=J0,z.memoizedState=Z0}WY=null}function Fw(z,Q){if(typeof z!=="function")throw Error("Invalid argument passed as callback. Expected a function. Instead "+("received: "+z));z.call(Q)}function cU(){BY=!1}function _Y(){return BY}function lU(z,Q,X){var Z=Q.effects;if(Q.effects=null,Z!==null)for(var J=0;J<Z.length;J++){var $=Z[J],H=$.callback;if(H!==null)$.callback=null,Fw(H,X)}}var zZ={},b8=R8(zZ),QZ=R8(zZ),LY=R8(zZ);function RY(z){if(z===zZ)throw Error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue.");return z}function iU(){var z=RY(LY.current);return z}function x$(z,Q){d7(LY,Q,z),d7(QZ,z,z),d7(b8,zZ,z);var X=EN(Q);p7(b8,z),d7(b8,X,z)}function WQ(z){p7(b8,z),p7(QZ,z),p7(LY,z)}function j$(){var z=RY(b8.current);return z}function oU(z){var Q=RY(LY.current),X=RY(b8.current),Z=uN(X,z.type);if(X===Z)return;d7(QZ,z,z),d7(b8,Z,z)}function p$(z){if(QZ.current!==z)return;p7(b8,z),p7(QZ,z)}var bw=0,aU=1,nU=1,XZ=2,r5=R8(bw);function d$(z,Q){return(z&Q)!==0}function OQ(z){return z&aU}function c$(z,Q){return z&aU|Q}function Pw(z,Q){return z|Q}function P8(z,Q){d7(r5,Q,z)}function KQ(z){p7(r5,z)}function Aw(z,Q){var X=z.memoizedState;if(X!==null){if(X.dehydrated!==null)return!0;return!1}var Z=z.memoizedProps;return!0}function NY(z){var Q=z;while(Q!==null){if(Q.tag===A){var X=Q.memoizedState;if(X!==null){var Z=X.dehydrated;if(Z===null||BU(Z)||q$(Z))return Q}}else if(Q.tag===d&&Q.memoizedProps.revealOrder!==void 0){var J=(Q.flags&X4)!==N1;if(J)return Q}else if(Q.child!==null){Q.child.return=Q,Q=Q.child;continue}if(Q===z)return null;while(Q.sibling===null){if(Q.return===null||Q.return===z)return null;Q=Q.return}Q.sibling.return=Q.return,Q=Q.sibling}return null}var W5=0,H7=1,_6=2,G7=4,v7=8,l$=[];function i$(){for(var z=0;z<l$.length;z++){var Q=l$[z];Q._workInProgressVersionPrimary=null}l$.length=0}function Iw(z,Q){var X=Q._getVersion,Z=X(Q._source);if(z.mutableSourceEagerHydrationData==null)z.mutableSourceEagerHydrationData=[Q,Z];else z.mutableSourceEagerHydrationData.push(Q,Z)}var{ReactCurrentDispatcher:l0,ReactCurrentBatchConfig:ZZ}=Y,o$,_Q;o$=new Set;var qz=b0,K4=null,q7=null,U7=null,MY=!1,JZ=!1,YZ=0,Tw=0,kw=25,_0=null,V5=null,A8=-1,a$=!1;function $4(){{var z=_0;if(V5===null)V5=[z];else V5.push(z)}}function x0(){{var z=_0;if(V5!==null){if(A8++,V5[A8]!==z)Cw(z)}}}function LQ(z){if(z!==void 0&&z!==null&&!Q4(z))q("%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.",_0,typeof z)}function Cw(z){{var Q=y1(K4);if(!o$.has(Q)){if(o$.add(Q),V5!==null){var X="",Z=30;for(var J=0;J<=A8;J++){var $=V5[J],H=J===A8?z:$,B=J+1+". "+$;while(B.length<Z)B+=" ";B+=H+`
|
|
72
|
+
`,X+=B}q(`React has detected a change in the order of Hooks called by %s. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://reactjs.org/link/rules-of-hooks
|
|
73
|
+
|
|
74
|
+
Previous render Next render
|
|
75
|
+
------------------------------------------------------
|
|
76
|
+
%s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
77
|
+
`,Q,X)}}}}function c7(){throw Error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
78
|
+
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
79
|
+
2. You might be breaking the Rules of Hooks
|
|
80
|
+
3. You might have more than one copy of React in the same app
|
|
81
|
+
See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`)}function n$(z,Q){if(a$)return!1;if(Q===null)return q("%s received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.",_0),!1;if(z.length!==Q.length)q(`The final argument passed to %s changed size between renders. The order and size of this array must remain constant.
|
|
82
|
+
|
|
83
|
+
Previous: %s
|
|
84
|
+
Incoming: %s`,_0,"["+Q.join(", ")+"]","["+z.join(", ")+"]");for(var X=0;X<Q.length&&X<z.length;X++){if(A5(z[X],Q[X]))continue;return!1}return!0}function RQ(z,Q,X,Z,J,$){if(qz=$,K4=Q,V5=z!==null?z._debugHookTypes:null,A8=-1,a$=z!==null&&z.type!==Q.type,Q.memoizedState=null,Q.updateQueue=null,Q.lanes=b0,z!==null&&z.memoizedState!==null)l0.current=RB;else if(V5!==null)l0.current=LB;else l0.current=_B;var H=X(Z,J);if(JZ){var B=0;do{if(JZ=!1,YZ=0,B>=kw)throw Error("Too many re-renders. React limits the number of renders to prevent an infinite loop.");B+=1,a$=!1,q7=null,U7=null,Q.updateQueue=null,A8=-1,l0.current=NB,H=X(Z,J)}while(JZ)}l0.current=VY,Q._debugHookTypes=V5;var W=q7!==null&&q7.next!==null;if(qz=b0,K4=null,q7=null,U7=null,_0=null,V5=null,A8=-1,z!==null&&(z.flags&V6)!==(Q.flags&V6)&&(z.mode&l1)!==K1)q("Internal React error: Expected static flag was missing. Please notify the React team.");if(MY=!1,W)throw Error("Rendered fewer hooks than expected. This may be caused by an accidental early return statement.");return H}function NQ(){var z=YZ!==0;return YZ=0,z}function rU(z,Q,X){if(Q.updateQueue=z.updateQueue,(Q.mode&B6)!==K1)Q.flags&=~(WJ|y6|c5|r1);else Q.flags&=~(c5|r1);z.lanes=MJ(z.lanes,X)}function sU(){if(l0.current=VY,MY){var z=K4.memoizedState;while(z!==null){var Q=z.queue;if(Q!==null)Q.pending=null;z=z.next}MY=!1}qz=b0,K4=null,q7=null,U7=null,V5=null,A8=-1,_0=null,UB=!1,JZ=!1,YZ=0}function L6(){var z={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};if(U7===null)K4.memoizedState=U7=z;else U7=U7.next=z;return U7}function D5(){var z;if(q7===null){var Q=K4.alternate;if(Q!==null)z=Q.memoizedState;else z=null}else z=q7.next;var X;if(U7===null)X=K4.memoizedState;else X=U7.next;if(X!==null)U7=X,X=U7.next,q7=z;else{if(z===null)throw Error("Rendered more hooks than during the previous render.");q7=z;var Z={memoizedState:q7.memoizedState,baseState:q7.baseState,baseQueue:q7.baseQueue,queue:q7.queue,next:null};if(U7===null)K4.memoizedState=U7=Z;else U7=U7.next=Z}return U7}function tU(){return{lastEffect:null,stores:null}}function r$(z,Q){return typeof Q==="function"?Q(z):Q}function s$(z,Q,X){var Z=L6(),J;if(X!==void 0)J=X(Q);else J=Q;Z.memoizedState=Z.baseState=J;var $={pending:null,interleaved:null,lanes:b0,dispatch:null,lastRenderedReducer:z,lastRenderedState:J};Z.queue=$;var H=$.dispatch=fw.bind(null,K4,$);return[Z.memoizedState,H]}function t$(z,Q,X){var Z=D5(),J=Z.queue;if(J===null)throw Error("Should have a queue. This is likely a bug in React. Please file an issue.");J.lastRenderedReducer=z;var $=q7,H=$.baseQueue,B=J.pending;if(B!==null){if(H!==null){var W=H.next,w=B.next;H.next=w,B.next=W}if($.baseQueue!==H)q("Internal error: Expected work-in-progress queue to be a clone. This is a bug in React.");$.baseQueue=H=B,J.pending=null}if(H!==null){var k=H.next,l=$.baseState,c=null,Z0=null,J0=null,$0=k;do{var j0=$0.lane;if(!az(qz,j0)){var q1={lane:j0,action:$0.action,hasEagerState:$0.hasEagerState,eagerState:$0.eagerState,next:null};if(J0===null)Z0=J0=q1,c=l;else J0=J0.next=q1;K4.lanes=D1(K4.lanes,j0),TZ(j0)}else{if(J0!==null){var X1={lane:P7,action:$0.action,hasEagerState:$0.hasEagerState,eagerState:$0.eagerState,next:null};J0=J0.next=X1}if($0.hasEagerState)l=$0.eagerState;else{var x1=$0.action;l=z(l,x1)}}$0=$0.next}while($0!==null&&$0!==k);if(J0===null)c=l;else J0.next=Z0;if(!A5(l,Z.memoizedState))KZ();Z.memoizedState=l,Z.baseState=c,Z.baseQueue=J0,J.lastRenderedState=l}var j1=J.interleaved;if(j1!==null){var t=j1;do{var O0=t.lane;K4.lanes=D1(K4.lanes,O0),TZ(O0),t=t.next}while(t!==j1)}else if(H===null)J.lanes=b0;var e=J.dispatch;return[Z.memoizedState,e]}function e$(z,Q,X){var Z=D5(),J=Z.queue;if(J===null)throw Error("Should have a queue. This is likely a bug in React. Please file an issue.");J.lastRenderedReducer=z;var{dispatch:$,pending:H}=J,B=Z.memoizedState;if(H!==null){J.pending=null;var W=H.next,w=W;do{var k=w.action;B=z(B,k),w=w.next}while(w!==W);if(!A5(B,Z.memoizedState))KZ();if(Z.memoizedState=B,Z.baseQueue===null)Z.baseState=B;J.lastRenderedState=B}return[B,$]}function z9(z,Q,X){return}function wY(z,Q,X){return}function Q9(z,Q,X){var Z=K4,J=L6(),$,H=S7();if(H){if(X===void 0)throw Error("Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.");if($=X(),!_Q){if($!==X())q("The result of getServerSnapshot should be cached to avoid an infinite loop"),_Q=!0}}else{if($=Q(),!_Q){var B=Q();if(!A5($,B))q("The result of getSnapshot should be cached to avoid an infinite loop"),_Q=!0}var W=eY();if(W===null)throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");if(!NJ(W,qz))eU(Z,Q,$)}J.memoizedState=$;var w={value:$,getSnapshot:Q};return J.queue=w,IY(QB.bind(null,Z,w,z),[z]),Z.flags|=c5,$Z(H7|v7,zB.bind(null,Z,w,$,Q),void 0,null),$}function FY(z,Q,X){var Z=K4,J=D5(),$=Q();if(!_Q){var H=Q();if(!A5($,H))q("The result of getSnapshot should be cached to avoid an infinite loop"),_Q=!0}var B=J.memoizedState,W=!A5(B,$);if(W)J.memoizedState=$,KZ();var w=J.queue;if(GZ(QB.bind(null,Z,w,z),[z]),w.getSnapshot!==Q||W||U7!==null&&U7.memoizedState.tag&H7){Z.flags|=c5,$Z(H7|v7,zB.bind(null,Z,w,$,Q),void 0,null);var k=eY();if(k===null)throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");if(!NJ(k,qz))eU(Z,Q,$)}return $}function eU(z,Q,X){z.flags|=BJ;var Z={getSnapshot:Q,value:X},J=K4.updateQueue;if(J===null)J=tU(),K4.updateQueue=J,J.stores=[Z];else{var $=J.stores;if($===null)J.stores=[Z];else $.push(Z)}}function zB(z,Q,X,Z){if(Q.value=X,Q.getSnapshot=Z,XB(Q))ZB(z)}function QB(z,Q,X){var Z=function(){if(XB(Q))ZB(z)};return X(Z)}function XB(z){var{getSnapshot:Q,value:X}=z;try{var Z=Q();return!A5(X,Z)}catch(J){return!0}}function ZB(z){var Q=B5(z,A1);if(Q!==null)K7(Q,z,A1,y4)}function bY(z){var Q=L6();if(typeof z==="function")z=z();Q.memoizedState=Q.baseState=z;var X={pending:null,interleaved:null,lanes:b0,dispatch:null,lastRenderedReducer:r$,lastRenderedState:z};Q.queue=X;var Z=X.dispatch=hw.bind(null,K4,X);return[Q.memoizedState,Z]}function X9(z){return t$(r$)}function Z9(z){return e$(r$)}function $Z(z,Q,X,Z){var J={tag:z,create:Q,destroy:X,deps:Z,next:null},$=K4.updateQueue;if($===null)$=tU(),K4.updateQueue=$,$.lastEffect=J.next=J;else{var H=$.lastEffect;if(H===null)$.lastEffect=J.next=J;else{var B=H.next;H.next=J,J.next=B,$.lastEffect=J}}return J}function J9(z){var Q=L6();{var X={current:z};return Q.memoizedState=X,X}}function PY(z){var Q=D5();return Q.memoizedState}function HZ(z,Q,X,Z){var J=L6(),$=Z===void 0?null:Z;K4.flags|=z,J.memoizedState=$Z(H7|Q,X,void 0,$)}function AY(z,Q,X,Z){var J=D5(),$=Z===void 0?null:Z,H=void 0;if(q7!==null){var B=q7.memoizedState;if(H=B.destroy,$!==null){var W=B.deps;if(n$($,W)){J.memoizedState=$Z(Q,X,H,$);return}}}K4.flags|=z,J.memoizedState=$Z(H7|Q,X,H,$)}function IY(z,Q){if((K4.mode&B6)!==K1)return HZ(WJ|c5|z3,v7,z,Q);else return HZ(c5|z3,v7,z,Q)}function GZ(z,Q){return AY(c5,v7,z,Q)}function Y9(z,Q){return HZ(r1,_6,z,Q)}function TY(z,Q){return AY(r1,_6,z,Q)}function $9(z,Q){var X=r1;if(X|=l8,(K4.mode&B6)!==K1)X|=y6;return HZ(X,G7,z,Q)}function kY(z,Q){return AY(r1,G7,z,Q)}function JB(z,Q){if(typeof Q==="function"){var X=Q,Z=z();return X(Z),function(){X(null)}}else if(Q!==null&&Q!==void 0){var J=Q;if(!J.hasOwnProperty("current"))q("Expected useImperativeHandle() first argument to either be a ref callback or React.createRef() object. Instead received: %s.","an object with keys {"+Object.keys(J).join(", ")+"}");var $=z();return J.current=$,function(){J.current=null}}}function H9(z,Q,X){if(typeof Q!=="function")q("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.",Q!==null?typeof Q:"null");var Z=X!==null&&X!==void 0?X.concat([z]):null,J=r1;if(J|=l8,(K4.mode&B6)!==K1)J|=y6;return HZ(J,G7,JB.bind(null,Q,z),Z)}function CY(z,Q,X){if(typeof Q!=="function")q("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.",Q!==null?typeof Q:"null");var Z=X!==null&&X!==void 0?X.concat([z]):null;return AY(r1,G7,JB.bind(null,Q,z),Z)}function SY(z,Q){}var vY=SY;function G9(z,Q){var X=L6(),Z=Q===void 0?null:Q;return X.memoizedState=[z,Z],z}function fY(z,Q){var X=D5(),Z=Q===void 0?null:Q,J=X.memoizedState;if(J!==null){if(Z!==null){var $=J[1];if(n$(Z,$))return J[0]}}return X.memoizedState=[z,Z],z}function q9(z,Q){var X=L6(),Z=Q===void 0?null:Q,J=z();return X.memoizedState=[J,Z],J}function hY(z,Q){var X=D5(),Z=Q===void 0?null:Q,J=X.memoizedState;if(J!==null){if(Z!==null){var $=J[1];if(n$(Z,$))return J[0]}}var H=z();return X.memoizedState=[H,Z],H}function U9(z){var Q=L6();return Q.memoizedState=z,z}function YB(z){var Q=D5(),X=q7,Z=X.memoizedState;return HB(Q,Z,z)}function $B(z){var Q=D5();if(q7===null)return Q.memoizedState=z,z;else{var X=q7.memoizedState;return HB(Q,X,z)}}function HB(z,Q,X){var Z=!KL(qz);if(Z){if(!A5(X,Q)){var J=Xq();K4.lanes=D1(K4.lanes,J),TZ(J),z.baseState=!0}return Q}else{if(z.baseState)z.baseState=!1,KZ();return z.memoizedState=X,X}}function Sw(z,Q,X){var Z=i5();A7(PL(Z,m6)),z(!0);var J=ZZ.transition;ZZ.transition={};var $=ZZ.transition;ZZ.transition._updatedFibers=new Set;try{z(!1),Q()}finally{if(A7(Z),ZZ.transition=J,J===null&&$._updatedFibers){var H=$._updatedFibers.size;if(H>10)_("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.");$._updatedFibers.clear()}}}function B9(){var z=bY(!1),Q=z[0],X=z[1],Z=Sw.bind(null,X),J=L6();return J.memoizedState=Z,[Q,Z]}function GB(){var z=X9(),Q=z[0],X=D5(),Z=X.memoizedState;return[Q,Z]}function qB(){var z=Z9(),Q=z[0],X=D5(),Z=X.memoizedState;return[Q,Z]}var UB=!1;function vw(){return UB}function W9(){var z=L6(),Q=eY(),X=Q.identifierPrefix,Z;if(S7()){var J=aM();Z=":"+X+"R"+J;var $=YZ++;if($>0)Z+="H"+$.toString(32);Z+=":"}else{var H=Tw++;Z=":"+X+"r"+H.toString(32)+":"}return z.memoizedState=Z,Z}function yY(){var z=D5(),Q=z.memoizedState;return Q}function fw(z,Q,X){if(typeof arguments[3]==="function")q("State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect().");var Z=S8(z),J={lane:Z,action:X,hasEagerState:!1,eagerState:null,next:null};if(BB(z))WB(Q,J);else{var $=xU(z,Q,J,Z);if($!==null){var H=Z5();K7($,z,Z,H),OB($,Q,Z)}}KB(z,Z)}function hw(z,Q,X){if(typeof arguments[3]==="function")q("State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect().");var Z=S8(z),J={lane:Z,action:X,hasEagerState:!1,eagerState:null,next:null};if(BB(z))WB(Q,J);else{var $=z.alternate;if(z.lanes===b0&&($===null||$.lanes===b0)){var H=Q.lastRenderedReducer;if(H!==null){var B;B=l0.current,l0.current=s5;try{var W=Q.lastRenderedState,w=H(W,X);if(J.hasEagerState=!0,J.eagerState=w,A5(w,W)){Rw(z,Q,J,Z);return}}catch(c){}finally{l0.current=B}}}var k=xU(z,Q,J,Z);if(k!==null){var l=Z5();K7(k,z,Z,l),OB(k,Q,Z)}}KB(z,Z)}function BB(z){var Q=z.alternate;return z===K4||Q!==null&&Q===K4}function WB(z,Q){JZ=MY=!0;var X=z.pending;if(X===null)Q.next=Q;else Q.next=X.next,X.next=Q;z.pending=Q}function OB(z,Q,X){if(Qq(X)){var Z=Q.lanes;Z=Zq(Z,z.pendingLanes);var J=D1(Z,X);Q.lanes=J,v3(z,J)}}function KB(z,Q,X){Y3(z,Q)}var VY={readContext:J7,useCallback:c7,useContext:c7,useEffect:c7,useImperativeHandle:c7,useInsertionEffect:c7,useLayoutEffect:c7,useMemo:c7,useReducer:c7,useRef:c7,useState:c7,useDebugValue:c7,useDeferredValue:c7,useTransition:c7,useMutableSource:c7,useSyncExternalStore:c7,useId:c7,unstable_isNewReconciler:S0},_B=null,LB=null,RB=null,NB=null,R6=null,s5=null,DY=null;{var O9=function(){q("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().")},I1=function(){q("Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://reactjs.org/link/rules-of-hooks")};_B={readContext:function(z){return J7(z)},useCallback:function(z,Q){return _0="useCallback",$4(),LQ(Q),G9(z,Q)},useContext:function(z){return _0="useContext",$4(),J7(z)},useEffect:function(z,Q){return _0="useEffect",$4(),LQ(Q),IY(z,Q)},useImperativeHandle:function(z,Q,X){return _0="useImperativeHandle",$4(),LQ(X),H9(z,Q,X)},useInsertionEffect:function(z,Q){return _0="useInsertionEffect",$4(),LQ(Q),Y9(z,Q)},useLayoutEffect:function(z,Q){return _0="useLayoutEffect",$4(),LQ(Q),$9(z,Q)},useMemo:function(z,Q){_0="useMemo",$4(),LQ(Q);var X=l0.current;l0.current=R6;try{return q9(z,Q)}finally{l0.current=X}},useReducer:function(z,Q,X){_0="useReducer",$4();var Z=l0.current;l0.current=R6;try{return s$(z,Q,X)}finally{l0.current=Z}},useRef:function(z){return _0="useRef",$4(),J9(z)},useState:function(z){_0="useState",$4();var Q=l0.current;l0.current=R6;try{return bY(z)}finally{l0.current=Q}},useDebugValue:function(z,Q){return _0="useDebugValue",$4(),SY()},useDeferredValue:function(z){return _0="useDeferredValue",$4(),U9(z)},useTransition:function(){return _0="useTransition",$4(),B9()},useMutableSource:function(z,Q,X){return _0="useMutableSource",$4(),z9()},useSyncExternalStore:function(z,Q,X){return _0="useSyncExternalStore",$4(),Q9(z,Q,X)},useId:function(){return _0="useId",$4(),W9()},unstable_isNewReconciler:S0},LB={readContext:function(z){return J7(z)},useCallback:function(z,Q){return _0="useCallback",x0(),G9(z,Q)},useContext:function(z){return _0="useContext",x0(),J7(z)},useEffect:function(z,Q){return _0="useEffect",x0(),IY(z,Q)},useImperativeHandle:function(z,Q,X){return _0="useImperativeHandle",x0(),H9(z,Q,X)},useInsertionEffect:function(z,Q){return _0="useInsertionEffect",x0(),Y9(z,Q)},useLayoutEffect:function(z,Q){return _0="useLayoutEffect",x0(),$9(z,Q)},useMemo:function(z,Q){_0="useMemo",x0();var X=l0.current;l0.current=R6;try{return q9(z,Q)}finally{l0.current=X}},useReducer:function(z,Q,X){_0="useReducer",x0();var Z=l0.current;l0.current=R6;try{return s$(z,Q,X)}finally{l0.current=Z}},useRef:function(z){return _0="useRef",x0(),J9(z)},useState:function(z){_0="useState",x0();var Q=l0.current;l0.current=R6;try{return bY(z)}finally{l0.current=Q}},useDebugValue:function(z,Q){return _0="useDebugValue",x0(),SY()},useDeferredValue:function(z){return _0="useDeferredValue",x0(),U9(z)},useTransition:function(){return _0="useTransition",x0(),B9()},useMutableSource:function(z,Q,X){return _0="useMutableSource",x0(),z9()},useSyncExternalStore:function(z,Q,X){return _0="useSyncExternalStore",x0(),Q9(z,Q,X)},useId:function(){return _0="useId",x0(),W9()},unstable_isNewReconciler:S0},RB={readContext:function(z){return J7(z)},useCallback:function(z,Q){return _0="useCallback",x0(),fY(z,Q)},useContext:function(z){return _0="useContext",x0(),J7(z)},useEffect:function(z,Q){return _0="useEffect",x0(),GZ(z,Q)},useImperativeHandle:function(z,Q,X){return _0="useImperativeHandle",x0(),CY(z,Q,X)},useInsertionEffect:function(z,Q){return _0="useInsertionEffect",x0(),TY(z,Q)},useLayoutEffect:function(z,Q){return _0="useLayoutEffect",x0(),kY(z,Q)},useMemo:function(z,Q){_0="useMemo",x0();var X=l0.current;l0.current=s5;try{return hY(z,Q)}finally{l0.current=X}},useReducer:function(z,Q,X){_0="useReducer",x0();var Z=l0.current;l0.current=s5;try{return t$(z,Q,X)}finally{l0.current=Z}},useRef:function(z){return _0="useRef",x0(),PY()},useState:function(z){_0="useState",x0();var Q=l0.current;l0.current=s5;try{return X9(z)}finally{l0.current=Q}},useDebugValue:function(z,Q){return _0="useDebugValue",x0(),vY()},useDeferredValue:function(z){return _0="useDeferredValue",x0(),YB(z)},useTransition:function(){return _0="useTransition",x0(),GB()},useMutableSource:function(z,Q,X){return _0="useMutableSource",x0(),wY()},useSyncExternalStore:function(z,Q,X){return _0="useSyncExternalStore",x0(),FY(z,Q)},useId:function(){return _0="useId",x0(),yY()},unstable_isNewReconciler:S0},NB={readContext:function(z){return J7(z)},useCallback:function(z,Q){return _0="useCallback",x0(),fY(z,Q)},useContext:function(z){return _0="useContext",x0(),J7(z)},useEffect:function(z,Q){return _0="useEffect",x0(),GZ(z,Q)},useImperativeHandle:function(z,Q,X){return _0="useImperativeHandle",x0(),CY(z,Q,X)},useInsertionEffect:function(z,Q){return _0="useInsertionEffect",x0(),TY(z,Q)},useLayoutEffect:function(z,Q){return _0="useLayoutEffect",x0(),kY(z,Q)},useMemo:function(z,Q){_0="useMemo",x0();var X=l0.current;l0.current=DY;try{return hY(z,Q)}finally{l0.current=X}},useReducer:function(z,Q,X){_0="useReducer",x0();var Z=l0.current;l0.current=DY;try{return e$(z,Q,X)}finally{l0.current=Z}},useRef:function(z){return _0="useRef",x0(),PY()},useState:function(z){_0="useState",x0();var Q=l0.current;l0.current=DY;try{return Z9(z)}finally{l0.current=Q}},useDebugValue:function(z,Q){return _0="useDebugValue",x0(),vY()},useDeferredValue:function(z){return _0="useDeferredValue",x0(),$B(z)},useTransition:function(){return _0="useTransition",x0(),qB()},useMutableSource:function(z,Q,X){return _0="useMutableSource",x0(),wY()},useSyncExternalStore:function(z,Q,X){return _0="useSyncExternalStore",x0(),FY(z,Q)},useId:function(){return _0="useId",x0(),yY()},unstable_isNewReconciler:S0},R6={readContext:function(z){return O9(),J7(z)},useCallback:function(z,Q){return _0="useCallback",I1(),$4(),G9(z,Q)},useContext:function(z){return _0="useContext",I1(),$4(),J7(z)},useEffect:function(z,Q){return _0="useEffect",I1(),$4(),IY(z,Q)},useImperativeHandle:function(z,Q,X){return _0="useImperativeHandle",I1(),$4(),H9(z,Q,X)},useInsertionEffect:function(z,Q){return _0="useInsertionEffect",I1(),$4(),Y9(z,Q)},useLayoutEffect:function(z,Q){return _0="useLayoutEffect",I1(),$4(),$9(z,Q)},useMemo:function(z,Q){_0="useMemo",I1(),$4();var X=l0.current;l0.current=R6;try{return q9(z,Q)}finally{l0.current=X}},useReducer:function(z,Q,X){_0="useReducer",I1(),$4();var Z=l0.current;l0.current=R6;try{return s$(z,Q,X)}finally{l0.current=Z}},useRef:function(z){return _0="useRef",I1(),$4(),J9(z)},useState:function(z){_0="useState",I1(),$4();var Q=l0.current;l0.current=R6;try{return bY(z)}finally{l0.current=Q}},useDebugValue:function(z,Q){return _0="useDebugValue",I1(),$4(),SY()},useDeferredValue:function(z){return _0="useDeferredValue",I1(),$4(),U9(z)},useTransition:function(){return _0="useTransition",I1(),$4(),B9()},useMutableSource:function(z,Q,X){return _0="useMutableSource",I1(),$4(),z9()},useSyncExternalStore:function(z,Q,X){return _0="useSyncExternalStore",I1(),$4(),Q9(z,Q,X)},useId:function(){return _0="useId",I1(),$4(),W9()},unstable_isNewReconciler:S0},s5={readContext:function(z){return O9(),J7(z)},useCallback:function(z,Q){return _0="useCallback",I1(),x0(),fY(z,Q)},useContext:function(z){return _0="useContext",I1(),x0(),J7(z)},useEffect:function(z,Q){return _0="useEffect",I1(),x0(),GZ(z,Q)},useImperativeHandle:function(z,Q,X){return _0="useImperativeHandle",I1(),x0(),CY(z,Q,X)},useInsertionEffect:function(z,Q){return _0="useInsertionEffect",I1(),x0(),TY(z,Q)},useLayoutEffect:function(z,Q){return _0="useLayoutEffect",I1(),x0(),kY(z,Q)},useMemo:function(z,Q){_0="useMemo",I1(),x0();var X=l0.current;l0.current=s5;try{return hY(z,Q)}finally{l0.current=X}},useReducer:function(z,Q,X){_0="useReducer",I1(),x0();var Z=l0.current;l0.current=s5;try{return t$(z,Q,X)}finally{l0.current=Z}},useRef:function(z){return _0="useRef",I1(),x0(),PY()},useState:function(z){_0="useState",I1(),x0();var Q=l0.current;l0.current=s5;try{return X9(z)}finally{l0.current=Q}},useDebugValue:function(z,Q){return _0="useDebugValue",I1(),x0(),vY()},useDeferredValue:function(z){return _0="useDeferredValue",I1(),x0(),YB(z)},useTransition:function(){return _0="useTransition",I1(),x0(),GB()},useMutableSource:function(z,Q,X){return _0="useMutableSource",I1(),x0(),wY()},useSyncExternalStore:function(z,Q,X){return _0="useSyncExternalStore",I1(),x0(),FY(z,Q)},useId:function(){return _0="useId",I1(),x0(),yY()},unstable_isNewReconciler:S0},DY={readContext:function(z){return O9(),J7(z)},useCallback:function(z,Q){return _0="useCallback",I1(),x0(),fY(z,Q)},useContext:function(z){return _0="useContext",I1(),x0(),J7(z)},useEffect:function(z,Q){return _0="useEffect",I1(),x0(),GZ(z,Q)},useImperativeHandle:function(z,Q,X){return _0="useImperativeHandle",I1(),x0(),CY(z,Q,X)},useInsertionEffect:function(z,Q){return _0="useInsertionEffect",I1(),x0(),TY(z,Q)},useLayoutEffect:function(z,Q){return _0="useLayoutEffect",I1(),x0(),kY(z,Q)},useMemo:function(z,Q){_0="useMemo",I1(),x0();var X=l0.current;l0.current=s5;try{return hY(z,Q)}finally{l0.current=X}},useReducer:function(z,Q,X){_0="useReducer",I1(),x0();var Z=l0.current;l0.current=s5;try{return e$(z,Q,X)}finally{l0.current=Z}},useRef:function(z){return _0="useRef",I1(),x0(),PY()},useState:function(z){_0="useState",I1(),x0();var Q=l0.current;l0.current=s5;try{return Z9(z)}finally{l0.current=Q}},useDebugValue:function(z,Q){return _0="useDebugValue",I1(),x0(),vY()},useDeferredValue:function(z){return _0="useDeferredValue",I1(),x0(),$B(z)},useTransition:function(){return _0="useTransition",I1(),x0(),qB()},useMutableSource:function(z,Q,X){return _0="useMutableSource",I1(),x0(),wY()},useSyncExternalStore:function(z,Q,X){return _0="useSyncExternalStore",I1(),x0(),FY(z,Q)},useId:function(){return _0="useId",I1(),x0(),yY()},unstable_isNewReconciler:S0}}var I8=L4.unstable_now,MB=0,mY=-1,qZ=-1,gY=-1,K9=!1,EY=!1;function wB(){return K9}function yw(){EY=!0}function Vw(){K9=!1,EY=!1}function Dw(){K9=EY,EY=!1}function FB(){return MB}function bB(){MB=I8()}function _9(z){if(qZ=I8(),z.actualStartTime<0)z.actualStartTime=I8()}function PB(z){qZ=-1}function uY(z,Q){if(qZ>=0){var X=I8()-qZ;if(z.actualDuration+=X,Q)z.selfBaseDuration=X;qZ=-1}}function N6(z){if(mY>=0){var Q=I8()-mY;mY=-1;var X=z.return;while(X!==null){switch(X.tag){case I:var Z=X.stateNode;Z.effectDuration+=Q;return;case p:var J=X.stateNode;J.effectDuration+=Q;return}X=X.return}}}function L9(z){if(gY>=0){var Q=I8()-gY;gY=-1;var X=z.return;while(X!==null){switch(X.tag){case I:var Z=X.stateNode;if(Z!==null)Z.passiveEffectDuration+=Q;return;case p:var J=X.stateNode;if(J!==null)J.passiveEffectDuration+=Q;return}X=X.return}}}function M6(){mY=I8()}function R9(){gY=I8()}function N9(z){var Q=z.child;while(Q)z.actualDuration+=Q.actualDuration,Q=Q.sibling}function t5(z,Q){if(z&&z.defaultProps){var X=g1({},Q),Z=z.defaultProps;for(var J in Z)if(X[J]===void 0)X[J]=Z[J];return X}return Q}var M9={},w9,F9,b9,P9,A9,AB,xY,I9,T9,k9,UZ;{w9=new Set,F9=new Set,b9=new Set,P9=new Set,I9=new Set,A9=new Set,T9=new Set,k9=new Set,UZ=new Set;var IB=new Set;xY=function(z,Q){if(z===null||typeof z==="function")return;var X=Q+"_"+z;if(!IB.has(X))IB.add(X),q("%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.",Q,z)},AB=function(z,Q){if(Q===void 0){var X=s1(z)||"Component";if(!A9.has(X))A9.add(X),q("%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.",X)}},Object.defineProperty(M9,"_processChildContext",{enumerable:!1,value:function(){throw Error("_processChildContext is not available in React 16+. This likely means you have multiple copies of React and are attempting to nest a React 15 tree inside a React 16 tree using unstable_renderSubtreeIntoContainer, which isn't supported. Try to make sure you have only one copy of React (and ideally, switch to ReactDOM.createPortal).")}}),Object.freeze(M9)}function C9(z,Q,X,Z){var J=z.memoizedState,$=X(Z,J);{if(z.mode&o4){b7(!0);try{$=X(Z,J)}finally{b7(!1)}}AB(Q,$)}var H=$===null||$===void 0?J:g1({},J,$);if(z.memoizedState=H,z.lanes===b0){var B=z.updateQueue;B.baseState=H}}var S9={isMounted:k_,enqueueSetState:function(z,Q,X){var Z=jz(z),J=Z5(),$=S8(Z),H=d6(J,$);if(H.payload=Q,X!==void 0&&X!==null)xY(X,"setState"),H.callback=X;var B=F8(Z,H,$);if(B!==null)K7(B,Z,$,J),OY(B,Z,$);Y3(Z,$)},enqueueReplaceState:function(z,Q,X){var Z=jz(z),J=Z5(),$=S8(Z),H=d6(J,$);if(H.tag=pU,H.payload=Q,X!==void 0&&X!==null)xY(X,"replaceState"),H.callback=X;var B=F8(Z,H,$);if(B!==null)K7(B,Z,$,J),OY(B,Z,$);Y3(Z,$)},enqueueForceUpdate:function(z,Q){var X=jz(z),Z=Z5(),J=S8(X),$=d6(Z,J);if($.tag=UY,Q!==void 0&&Q!==null)xY(Q,"forceUpdate"),$.callback=Q;var H=F8(X,$,J);if(H!==null)K7(H,X,J,Z),OY(H,X,J);JL(X,J)}};function TB(z,Q,X,Z,J,$,H){var B=z.stateNode;if(typeof B.shouldComponentUpdate==="function"){var W=B.shouldComponentUpdate(Z,$,H);{if(z.mode&o4){b7(!0);try{W=B.shouldComponentUpdate(Z,$,H)}finally{b7(!1)}}if(W===void 0)q("%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.",s1(Q)||"Component")}return W}if(Q.prototype&&Q.prototype.isPureReactComponent)return!hX(X,Z)||!hX(J,$);return!0}function mw(z,Q,X){var Z=z.stateNode;{var J=s1(Q)||"Component",$=Z.render;if(!$)if(Q.prototype&&typeof Q.prototype.render==="function")q("%s(...): No `render` method found on the returned component instance: did you accidentally return an object from the constructor?",J);else q("%s(...): No `render` method found on the returned component instance: you may have forgotten to define `render`.",J);if(Z.getInitialState&&!Z.getInitialState.isReactClassApproved&&!Z.state)q("getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?",J);if(Z.getDefaultProps&&!Z.getDefaultProps.isReactClassApproved)q("getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.",J);if(Z.propTypes)q("propTypes was defined as an instance property on %s. Use a static property to define propTypes instead.",J);if(Z.contextType)q("contextType was defined as an instance property on %s. Use a static property to define contextType instead.",J);{if(Q.childContextTypes&&!UZ.has(Q)&&(z.mode&o4)===K1)UZ.add(Q),q(`%s uses the legacy childContextTypes API which is no longer supported and will be removed in the next major release. Use React.createContext() instead
|
|
85
|
+
|
|
86
|
+
.Learn more about this warning here: https://reactjs.org/link/legacy-context`,J);if(Q.contextTypes&&!UZ.has(Q)&&(z.mode&o4)===K1)UZ.add(Q),q(`%s uses the legacy contextTypes API which is no longer supported and will be removed in the next major release. Use React.createContext() with static contextType instead.
|
|
87
|
+
|
|
88
|
+
Learn more about this warning here: https://reactjs.org/link/legacy-context`,J);if(Z.contextTypes)q("contextTypes was defined as an instance property on %s. Use a static property to define contextTypes instead.",J);if(Q.contextType&&Q.contextTypes&&!T9.has(Q))T9.add(Q),q("%s declares both contextTypes and contextType static properties. The legacy contextTypes property will be ignored.",J)}if(typeof Z.componentShouldUpdate==="function")q("%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.",J);if(Q.prototype&&Q.prototype.isPureReactComponent&&typeof Z.shouldComponentUpdate<"u")q("%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.",s1(Q)||"A pure component");if(typeof Z.componentDidUnmount==="function")q("%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?",J);if(typeof Z.componentDidReceiveProps==="function")q("%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().",J);if(typeof Z.componentWillRecieveProps==="function")q("%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?",J);if(typeof Z.UNSAFE_componentWillRecieveProps==="function")q("%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?",J);var H=Z.props!==X;if(Z.props!==void 0&&H)q("%s(...): When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.",J,J);if(Z.defaultProps)q("Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.",J,J);if(typeof Z.getSnapshotBeforeUpdate==="function"&&typeof Z.componentDidUpdate!=="function"&&!b9.has(Q))b9.add(Q),q("%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.",s1(Q));if(typeof Z.getDerivedStateFromProps==="function")q("%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.",J);if(typeof Z.getDerivedStateFromError==="function")q("%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.",J);if(typeof Q.getSnapshotBeforeUpdate==="function")q("%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.",J);var B=Z.state;if(B&&(typeof B!=="object"||Q4(B)))q("%s.state: must be set to an object or null",J);if(typeof Z.getChildContext==="function"&&typeof Q.childContextTypes!=="object")q("%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().",J)}}function kB(z,Q){Q.updater=S9,z.stateNode=Q,b_(Q,z),Q._reactInternalInstance=M9}function CB(z,Q,X){var Z=!1,J=I5,$=I5,H=Q.contextType;if("contextType"in Q){var B=H===null||H!==void 0&&H.$$typeof===C&&H._context===void 0;if(!B&&!k9.has(Q)){k9.add(Q);var W="";if(H===void 0)W=" However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file.";else if(typeof H!=="object")W=" However, it is set to a "+typeof H+".";else if(H.$$typeof===w0)W=" Did you accidentally pass the Context.Provider instead?";else if(H._context!==void 0)W=" Did you accidentally pass the Context.Consumer instead?";else W=" However, it is set to an object with keys {"+Object.keys(H).join(", ")+"}.";q("%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s",s1(Q)||"Component",W)}}if(typeof H==="object"&&H!==null)$=J7(H);else{J=JQ(z,Q,!0);var w=Q.contextTypes;Z=w!==null&&w!==void 0,$=Z?YQ(z,J):I5}var k=new Q(X,$);if(z.mode&o4){b7(!0);try{k=new Q(X,$)}finally{b7(!1)}}var l=z.memoizedState=k.state!==null&&k.state!==void 0?k.state:null;kB(z,k);{if(typeof Q.getDerivedStateFromProps==="function"&&l===null){var c=s1(Q)||"Component";if(!F9.has(c))F9.add(c),q("`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.",c,k.state===null?"null":"undefined",c)}if(typeof Q.getDerivedStateFromProps==="function"||typeof k.getSnapshotBeforeUpdate==="function"){var Z0=null,J0=null,$0=null;if(typeof k.componentWillMount==="function"&&k.componentWillMount.__suppressDeprecationWarning!==!0)Z0="componentWillMount";else if(typeof k.UNSAFE_componentWillMount==="function")Z0="UNSAFE_componentWillMount";if(typeof k.componentWillReceiveProps==="function"&&k.componentWillReceiveProps.__suppressDeprecationWarning!==!0)J0="componentWillReceiveProps";else if(typeof k.UNSAFE_componentWillReceiveProps==="function")J0="UNSAFE_componentWillReceiveProps";if(typeof k.componentWillUpdate==="function"&&k.componentWillUpdate.__suppressDeprecationWarning!==!0)$0="componentWillUpdate";else if(typeof k.UNSAFE_componentWillUpdate==="function")$0="UNSAFE_componentWillUpdate";if(Z0!==null||J0!==null||$0!==null){var j0=s1(Q)||"Component",q1=typeof Q.getDerivedStateFromProps==="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";if(!P9.has(j0))P9.add(j0),q(`Unsafe legacy lifecycles will not be called for components using new component APIs.
|
|
89
|
+
|
|
90
|
+
%s uses %s but also contains the following legacy lifecycles:%s%s%s
|
|
91
|
+
|
|
92
|
+
The above lifecycles should be removed. Learn more about this warning here:
|
|
93
|
+
https://reactjs.org/link/unsafe-component-lifecycles`,j0,q1,Z0!==null?`
|
|
94
|
+
`+Z0:"",J0!==null?`
|
|
95
|
+
`+J0:"",$0!==null?`
|
|
96
|
+
`+$0:"")}}}if(Z)RU(z,J,$);return k}function gw(z,Q){var X=Q.state;if(typeof Q.componentWillMount==="function")Q.componentWillMount();if(typeof Q.UNSAFE_componentWillMount==="function")Q.UNSAFE_componentWillMount();if(X!==Q.state)q("%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",y1(z)||"Component"),S9.enqueueReplaceState(Q,Q.state,null)}function SB(z,Q,X,Z){var J=Q.state;if(typeof Q.componentWillReceiveProps==="function")Q.componentWillReceiveProps(X,Z);if(typeof Q.UNSAFE_componentWillReceiveProps==="function")Q.UNSAFE_componentWillReceiveProps(X,Z);if(Q.state!==J){{var $=y1(z)||"Component";if(!w9.has($))w9.add($),q("%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",$)}S9.enqueueReplaceState(Q,Q.state,null)}}function v9(z,Q,X,Z){mw(z,Q,X);var J=z.stateNode;J.props=X,J.state=z.memoizedState,J.refs={},E$(z);var $=Q.contextType;if(typeof $==="object"&&$!==null)J.context=J7($);else{var H=JQ(z,Q,!0);J.context=YQ(z,H)}{if(J.state===X){var B=s1(Q)||"Component";if(!I9.has(B))I9.add(B),q("%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.",B)}if(z.mode&o4)n5.recordLegacyContextWarning(z,J);n5.recordUnsafeLifecycleWarnings(z,J)}J.state=z.memoizedState;var W=Q.getDerivedStateFromProps;if(typeof W==="function")C9(z,Q,W,X),J.state=z.memoizedState;if(typeof Q.getDerivedStateFromProps!=="function"&&typeof J.getSnapshotBeforeUpdate!=="function"&&(typeof J.UNSAFE_componentWillMount==="function"||typeof J.componentWillMount==="function"))gw(z,J),KY(z,X,J,Z),J.state=z.memoizedState;if(typeof J.componentDidMount==="function"){var w=r1;if(w|=l8,(z.mode&B6)!==K1)w|=y6;z.flags|=w}}function Ew(z,Q,X,Z){var{stateNode:J,memoizedProps:$}=z;J.props=$;var H=J.context,B=Q.contextType,W=I5;if(typeof B==="object"&&B!==null)W=J7(B);else{var w=JQ(z,Q,!0);W=YQ(z,w)}var k=Q.getDerivedStateFromProps,l=typeof k==="function"||typeof J.getSnapshotBeforeUpdate==="function";if(!l&&(typeof J.UNSAFE_componentWillReceiveProps==="function"||typeof J.componentWillReceiveProps==="function")){if($!==X||H!==W)SB(z,J,X,W)}cU();var c=z.memoizedState,Z0=J.state=c;if(KY(z,X,J,Z),Z0=z.memoizedState,$===X&&c===Z0&&!nJ()&&!_Y()){if(typeof J.componentDidMount==="function"){var J0=r1;if(J0|=l8,(z.mode&B6)!==K1)J0|=y6;z.flags|=J0}return!1}if(typeof k==="function")C9(z,Q,k,X),Z0=z.memoizedState;var $0=_Y()||TB(z,Q,$,X,c,Z0,W);if($0){if(!l&&(typeof J.UNSAFE_componentWillMount==="function"||typeof J.componentWillMount==="function")){if(typeof J.componentWillMount==="function")J.componentWillMount();if(typeof J.UNSAFE_componentWillMount==="function")J.UNSAFE_componentWillMount()}if(typeof J.componentDidMount==="function"){var j0=r1;if(j0|=l8,(z.mode&B6)!==K1)j0|=y6;z.flags|=j0}}else{if(typeof J.componentDidMount==="function"){var q1=r1;if(q1|=l8,(z.mode&B6)!==K1)q1|=y6;z.flags|=q1}z.memoizedProps=X,z.memoizedState=Z0}return J.props=X,J.state=Z0,J.context=W,$0}function uw(z,Q,X,Z,J){var $=Q.stateNode;dU(z,Q);var H=Q.memoizedProps,B=Q.type===Q.elementType?H:t5(Q.type,H);$.props=B;var W=Q.pendingProps,w=$.context,k=X.contextType,l=I5;if(typeof k==="object"&&k!==null)l=J7(k);else{var c=JQ(Q,X,!0);l=YQ(Q,c)}var Z0=X.getDerivedStateFromProps,J0=typeof Z0==="function"||typeof $.getSnapshotBeforeUpdate==="function";if(!J0&&(typeof $.UNSAFE_componentWillReceiveProps==="function"||typeof $.componentWillReceiveProps==="function")){if(H!==W||w!==l)SB(Q,$,Z,l)}cU();var $0=Q.memoizedState,j0=$.state=$0;if(KY(Q,Z,$,J),j0=Q.memoizedState,H===W&&$0===j0&&!nJ()&&!_Y()&&!P0){if(typeof $.componentDidUpdate==="function"){if(H!==z.memoizedProps||$0!==z.memoizedState)Q.flags|=r1}if(typeof $.getSnapshotBeforeUpdate==="function"){if(H!==z.memoizedProps||$0!==z.memoizedState)Q.flags|=d8}return!1}if(typeof Z0==="function")C9(Q,X,Z0,Z),j0=Q.memoizedState;var q1=_Y()||TB(Q,X,B,Z,$0,j0,l)||P0;if(q1){if(!J0&&(typeof $.UNSAFE_componentWillUpdate==="function"||typeof $.componentWillUpdate==="function")){if(typeof $.componentWillUpdate==="function")$.componentWillUpdate(Z,j0,l);if(typeof $.UNSAFE_componentWillUpdate==="function")$.UNSAFE_componentWillUpdate(Z,j0,l)}if(typeof $.componentDidUpdate==="function")Q.flags|=r1;if(typeof $.getSnapshotBeforeUpdate==="function")Q.flags|=d8}else{if(typeof $.componentDidUpdate==="function"){if(H!==z.memoizedProps||$0!==z.memoizedState)Q.flags|=r1}if(typeof $.getSnapshotBeforeUpdate==="function"){if(H!==z.memoizedProps||$0!==z.memoizedState)Q.flags|=d8}Q.memoizedProps=Z,Q.memoizedState=j0}return $.props=Z,$.state=j0,$.context=l,q1}function Uz(z,Q){return{value:z,source:Q,stack:tQ(Q),digest:null}}function f9(z,Q,X){return{value:z,source:null,stack:X!=null?X:null,digest:Q!=null?Q:null}}function xw(z,Q){return!0}function h9(z,Q){try{var X=xw(z,Q);if(X===!1)return;var{value:Z,source:J,stack:$}=Q,H=$!==null?$:"";if(Z!=null&&Z._suppressLogging){if(z.tag===O)return;console.error(Z)}var B=J?y1(J):null,W=B?"The above error occurred in the <"+B+"> component:":"The above error occurred in one of your React components:",w;if(z.tag===I)w=`Consider adding an error boundary to your tree to customize error handling behavior.
|
|
97
|
+
Visit https://reactjs.org/link/error-boundaries to learn more about error boundaries.`;else{var k=y1(z)||"Anonymous";w="React will try to recreate this component tree from scratch "+("using the error boundary you provided, "+k+".")}var l=W+`
|
|
98
|
+
`+H+`
|
|
99
|
+
|
|
100
|
+
`+(""+w);console.error(l)}catch(c){setTimeout(function(){throw c})}}var jw=typeof WeakMap==="function"?WeakMap:Map;function vB(z,Q,X){var Z=d6(y4,X);Z.tag=m$,Z.payload={element:null};var J=Q.value;return Z.callback=function(){Eb(J),h9(z,Q)},Z}function y9(z,Q,X){var Z=d6(y4,X);Z.tag=m$;var J=z.type.getDerivedStateFromError;if(typeof J==="function"){var $=Q.value;Z.payload=function(){return J($)},Z.callback=function(){pW(z),h9(z,Q)}}var H=z.stateNode;if(H!==null&&typeof H.componentDidCatch==="function")Z.callback=function(){if(pW(z),h9(z,Q),typeof J!=="function")mb(this);var{value:W,stack:w}=Q;if(this.componentDidCatch(W,{componentStack:w!==null?w:""}),typeof J!=="function"){if(!F5(z.lanes,A1))q("%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.",y1(z)||"Unknown")}};return Z}function fB(z,Q,X){var Z=z.pingCache,J;if(Z===null)Z=z.pingCache=new jw,J=new Set,Z.set(Q,J);else if(J=Z.get(Q),J===void 0)J=new Set,Z.set(Q,J);if(!J.has(X)){J.add(X);var $=ub.bind(null,z,Q,X);if(l5)kZ(z,X);Q.then($,$)}}function pw(z,Q,X,Z){var J=z.updateQueue;if(J===null){var $=new Set;$.add(X),z.updateQueue=$}else J.add(X)}function dw(z,Q){var X=z.tag;if((z.mode&l1)===K1&&(X===K||X===v||X===j)){var Z=z.alternate;if(Z)z.updateQueue=Z.updateQueue,z.memoizedState=Z.memoizedState,z.lanes=Z.lanes;else z.updateQueue=null,z.memoizedState=null}}function hB(z){var Q=z;do{if(Q.tag===A&&Aw(Q))return Q;Q=Q.return}while(Q!==null);return null}function yB(z,Q,X,Z,J){if((z.mode&l1)===K1){if(z===Q)z.flags|=z5;else{if(z.flags|=X4,X.flags|=t2,X.flags&=~(P_|qX),X.tag===O){var $=X.alternate;if($===null)X.tag=r;else{var H=d6(y4,A1);H.tag=UY,F8(X,H,A1)}}X.lanes=D1(X.lanes,A1)}return z}return z.flags|=z5,z.lanes=J,z}function cw(z,Q,X,Z,J){if(X.flags|=qX,l5)kZ(z,J);if(Z!==null&&typeof Z==="object"&&typeof Z.then==="function"){var $=Z;if(dw(X),S7()&&X.mode&l1)AU();var H=hB(Q);if(H!==null){if(H.flags&=~f6,yB(H,Q,X,z,J),H.mode&l1)fB(z,$,J);pw(H,z,$);return}else{if(!OL(J)){fB(z,$,J),OH();return}var B=Error("A component suspended while responding to synchronous input. This will cause the UI to be replaced with a loading indicator. To fix, updates that suspend should be wrapped with startTransition.");Z=B}}else if(S7()&&X.mode&l1){AU();var W=hB(Q);if(W!==null){if((W.flags&z5)===N1)W.flags|=f6;yB(W,Q,X,z,J),A$(Uz(Z,X));return}}Z=Uz(Z,X),Cb(Z);var w=Q;do{switch(w.tag){case I:{var k=Z;w.flags|=z5;var l=RX(J);w.lanes=D1(w.lanes,l);var c=vB(w,k,l);u$(w,c);return}case O:var Z0=Z,J0=w.type,$0=w.stateNode;if((w.flags&X4)===N1&&(typeof J0.getDerivedStateFromError==="function"||$0!==null&&typeof $0.componentDidCatch==="function"&&!yW($0))){w.flags|=z5;var j0=RX(J);w.lanes=D1(w.lanes,j0);var q1=y9(w,Z0,j0);u$(w,q1);return}break}w=w.return}while(w!==null)}function lw(){return null}var BZ=Y.ReactCurrentOwner,e5=!1,V9,WZ,D9,m9,g9,Bz,E9,jY,OZ;V9={},WZ={},D9={},m9={},g9={},Bz=!1,E9={},jY={},OZ={};function Q5(z,Q,X,Z){if(z===null)Q.child=mU(Q,null,X,Z);else Q.child=qQ(Q,z.child,X,Z)}function iw(z,Q,X,Z){Q.child=qQ(Q,z.child,null,Z),Q.child=qQ(Q,null,X,Z)}function VB(z,Q,X,Z,J){if(Q.type!==Q.elementType){var $=X.propTypes;if($)o5($,Z,"prop",s1(X))}var H=X.render,B=Q.ref,W,w;BQ(Q,J),BX(Q);{if(BZ.current=Q,M5(!0),W=RQ(z,Q,H,Z,B,J),w=NQ(),Q.mode&o4){b7(!0);try{W=RQ(z,Q,H,Z,B,J),w=NQ()}finally{b7(!1)}}M5(!1)}if(cz(),z!==null&&!e5)return rU(z,Q,J),c6(z,Q,J);if(S7()&&w)N$(Q);return Q.flags|=pz,Q5(z,Q,W,J),Q.child}function DB(z,Q,X,Z,J){if(z===null){var $=X.type;if(XP($)&&X.compare===null&&X.defaultProps===void 0){var H=$;return H=TQ($),Q.tag=j,Q.type=H,j9(Q,$),mB(z,Q,H,Z,J)}{var B=$.propTypes;if(B)o5(B,Z,"prop",s1($));if(X.defaultProps!==void 0){var W=s1($)||"Unknown";if(!OZ[W])q("%s: Support for defaultProps will be removed from memo components in a future major release. Use JavaScript default parameters instead.",W),OZ[W]=!0}}var w=AH(X.type,null,Z,Q,Q.mode,J);return w.ref=Q.ref,w.return=Q,Q.child=w,w}{var k=X.type,l=k.propTypes;if(l)o5(l,Z,"prop",s1(k))}var c=z.child,Z0=o9(z,J);if(!Z0){var J0=c.memoizedProps,$0=X.compare;if($0=$0!==null?$0:hX,$0(J0,Z)&&z.ref===Q.ref)return c6(z,Q,J)}Q.flags|=pz;var j0=Lz(c,Z);return j0.ref=Q.ref,j0.return=Q,Q.child=j0,j0}function mB(z,Q,X,Z,J){if(Q.type!==Q.elementType){var $=Q.elementType;if($.$$typeof===Q1){var H=$,B=H._payload,W=H._init;try{$=W(B)}catch(l){$=null}var w=$&&$.propTypes;if(w)o5(w,Z,"prop",s1($))}}if(z!==null){var k=z.memoizedProps;if(hX(k,Z)&&z.ref===Q.ref&&Q.type===z.type){if(e5=!1,Q.pendingProps=Z=k,!o9(z,J))return Q.lanes=z.lanes,c6(z,Q,J);else if((z.flags&t2)!==N1)e5=!0}}return u9(z,Q,X,Z,J)}function gB(z,Q,X){var Z=Q.pendingProps,J=Z.children,$=z!==null?z.memoizedState:null;if(Z.mode==="hidden"||a)if((Q.mode&l1)===K1){var H={baseLanes:b0,cachePool:null,transitions:null};Q.memoizedState=H,z2(Q,X)}else if(!F5(X,w5)){var B=null,W;if($!==null){var w=$.baseLanes;W=D1(w,X)}else W=X;Q.lanes=Q.childLanes=wJ(w5);var k={baseLanes:W,cachePool:B,transitions:null};return Q.memoizedState=k,Q.updateQueue=null,z2(Q,W),null}else{var l={baseLanes:b0,cachePool:null,transitions:null};Q.memoizedState=l;var c=$!==null?$.baseLanes:X;z2(Q,c)}else{var Z0;if($!==null)Z0=D1($.baseLanes,X),Q.memoizedState=null;else Z0=X;z2(Q,Z0)}return Q5(z,Q,J,X),Q.child}function ow(z,Q,X){var Z=Q.pendingProps;return Q5(z,Q,Z,X),Q.child}function aw(z,Q,X){var Z=Q.pendingProps.children;return Q5(z,Q,Z,X),Q.child}function nw(z,Q,X){{Q.flags|=r1;{var Z=Q.stateNode;Z.effectDuration=0,Z.passiveEffectDuration=0}}var J=Q.pendingProps,$=J.children;return Q5(z,Q,$,X),Q.child}function EB(z,Q){var X=Q.ref;if(z===null&&X!==null||z!==null&&z.ref!==X)Q.flags|=q8,Q.flags|=e2}function u9(z,Q,X,Z,J){if(Q.type!==Q.elementType){var $=X.propTypes;if($)o5($,Z,"prop",s1(X))}var H;{var B=JQ(Q,X,!0);H=YQ(Q,B)}var W,w;BQ(Q,J),BX(Q);{if(BZ.current=Q,M5(!0),W=RQ(z,Q,X,Z,H,J),w=NQ(),Q.mode&o4){b7(!0);try{W=RQ(z,Q,X,Z,H,J),w=NQ()}finally{b7(!1)}}M5(!1)}if(cz(),z!==null&&!e5)return rU(z,Q,J),c6(z,Q,J);if(S7()&&w)N$(Q);return Q.flags|=pz,Q5(z,Q,W,J),Q.child}function uB(z,Q,X,Z,J){{switch(RP(Q)){case!1:{var{stateNode:$,type:H}=Q,B=new H(Q.memoizedProps,$.context),W=B.state;$.updater.enqueueSetState($,W,null);break}case!0:{Q.flags|=X4,Q.flags|=z5;var w=Error("Simulated error coming from DevTools"),k=RX(J);Q.lanes=D1(Q.lanes,k);var l=y9(Q,Uz(w,Q),k);u$(Q,l);break}}if(Q.type!==Q.elementType){var c=X.propTypes;if(c)o5(c,Z,"prop",s1(X))}}var Z0;if(K6(X))Z0=!0,sJ(Q);else Z0=!1;BQ(Q,J);var J0=Q.stateNode,$0;if(J0===null)dY(z,Q),CB(Q,X,Z),v9(Q,X,Z,J),$0=!0;else if(z===null)$0=Ew(Q,X,Z,J);else $0=uw(z,Q,X,Z,J);var j0=x9(z,Q,X,$0,Z0,J);{var q1=Q.stateNode;if($0&&q1.props!==Z){if(!Bz)q("It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.",y1(Q)||"a component");Bz=!0}}return j0}function x9(z,Q,X,Z,J,$){EB(z,Q);var H=(Q.flags&X4)!==N1;if(!Z&&!H){if(J)wU(Q,X,!1);return c6(z,Q,$)}var B=Q.stateNode;BZ.current=Q;var W;if(H&&typeof X.getDerivedStateFromError!=="function")W=null,PB();else{BX(Q);{if(M5(!0),W=B.render(),Q.mode&o4){b7(!0);try{B.render()}finally{b7(!1)}}M5(!1)}cz()}if(Q.flags|=pz,z!==null&&H)iw(z,Q,W,$);else Q5(z,Q,W,$);if(Q.memoizedState=B.state,J)wU(Q,X,!0);return Q.child}function xB(z){var Q=z.stateNode;if(Q.pendingContext)NU(z,Q.pendingContext,Q.pendingContext!==Q.context);else if(Q.context)NU(z,Q.context,!1);x$(z,Q.containerInfo)}function rw(z,Q,X){if(xB(Q),z===null)throw Error("Should have a current fiber. This is a bug in React.");var{pendingProps:Z,memoizedState:J}=Q,$=J.element;dU(z,Q),KY(Q,Z,null,X);var{memoizedState:H,stateNode:B}=Q,W=H.element;if(J.isDehydrated){var w={element:W,isDehydrated:!1,cache:H.cache,pendingSuspenseBoundaries:H.pendingSuspenseBoundaries,transitions:H.transitions},k=Q.updateQueue;if(k.baseState=w,Q.memoizedState=w,Q.flags&f6){var l=Uz(Error("There was an error while hydrating. Because the error happened outside of a Suspense boundary, the entire root will switch to client rendering."),Q);return jB(z,Q,W,X,l)}else if(W!==$){var c=Uz(Error("This root received an early update, before anything was able hydrate. Switched the entire root to client rendering."),Q);return jB(z,Q,W,X,c)}else{zw(Q);var Z0=mU(Q,null,W,X);Q.child=Z0;var J0=Z0;while(J0)J0.flags=J0.flags&~Z7|h6,J0=J0.sibling}}else{if(GQ(),W===$)return c6(z,Q,X);Q5(z,Q,W,X)}return Q.child}function jB(z,Q,X,Z,J){return GQ(),A$(J),Q.flags|=f6,Q5(z,Q,X,Z),Q.child}function sw(z,Q,X){if(oU(Q),z===null)P$(Q);var{type:Z,pendingProps:J}=Q,$=z!==null?z.memoizedProps:null,H=J.children,B=Y$(Z,J);if(B)H=null;else if($!==null&&Y$(Z,$))Q.flags|=GX;return EB(z,Q),Q5(z,Q,H,X),Q.child}function tw(z,Q){if(z===null)P$(Q);return null}function ew(z,Q,X,Z){dY(z,Q);var J=Q.pendingProps,$=X,H=$._payload,B=$._init,W=B(H);Q.type=W;var w=Q.tag=ZP(W),k=t5(W,J),l;switch(w){case K:return j9(Q,W),Q.type=W=TQ(W),l=u9(null,Q,W,k,Z),l;case O:return Q.type=W=NH(W),l=uB(null,Q,W,k,Z),l;case v:return Q.type=W=MH(W),l=VB(null,Q,W,k,Z),l;case E:{if(Q.type!==Q.elementType){var c=W.propTypes;if(c)o5(c,k,"prop",s1(W))}return l=DB(null,Q,W,t5(W.type,k),Z),l}}var Z0="";if(W!==null&&typeof W==="object"&&W.$$typeof===Q1)Z0=" Did you wrap a component in React.lazy() more than once?";throw Error("Element type is invalid. Received a promise that resolves to: "+W+". "+("Lazy element type must resolve to a class or function."+Z0))}function zF(z,Q,X,Z,J){dY(z,Q),Q.tag=O;var $;if(K6(X))$=!0,sJ(Q);else $=!1;return BQ(Q,J),CB(Q,X,Z),v9(Q,X,Z,J),x9(null,Q,X,!0,$,J)}function QF(z,Q,X,Z){dY(z,Q);var J=Q.pendingProps,$;{var H=JQ(Q,X,!1);$=YQ(Q,H)}BQ(Q,Z);var B,W;BX(Q);{if(X.prototype&&typeof X.prototype.render==="function"){var w=s1(X)||"Unknown";if(!V9[w])q("The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.",w,w),V9[w]=!0}if(Q.mode&o4)n5.recordLegacyContextWarning(Q,null);M5(!0),BZ.current=Q,B=RQ(null,Q,X,J,$,Z),W=NQ(),M5(!1)}if(cz(),Q.flags|=pz,typeof B==="object"&&B!==null&&typeof B.render==="function"&&B.$$typeof===void 0){var k=s1(X)||"Unknown";if(!WZ[k])q("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.",k,k,k),WZ[k]=!0}if(typeof B==="object"&&B!==null&&typeof B.render==="function"&&B.$$typeof===void 0){{var l=s1(X)||"Unknown";if(!WZ[l])q("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.",l,l,l),WZ[l]=!0}Q.tag=O,Q.memoizedState=null,Q.updateQueue=null;var c=!1;if(K6(X))c=!0,sJ(Q);else c=!1;return Q.memoizedState=B.state!==null&&B.state!==void 0?B.state:null,E$(Q),kB(Q,B),v9(Q,X,J,Z),x9(null,Q,X,!0,c,Z)}else{if(Q.tag=K,Q.mode&o4){b7(!0);try{B=RQ(null,Q,X,J,$,Z),W=NQ()}finally{b7(!1)}}if(S7()&&W)N$(Q);return Q5(null,Q,B,Z),j9(Q,X),Q.child}}function j9(z,Q){{if(Q){if(Q.childContextTypes)q("%s(...): childContextTypes cannot be defined on a function component.",Q.displayName||Q.name||"Component")}if(z.ref!==null){var X="",Z=$8();if(Z)X+=`
|
|
101
|
+
|
|
102
|
+
Check the render method of \``+Z+"`.";var J=Z||"",$=z._debugSource;if($)J=$.fileName+":"+$.lineNumber;if(!g9[J])g9[J]=!0,q("Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?%s",X)}if(Q.defaultProps!==void 0){var H=s1(Q)||"Unknown";if(!OZ[H])q("%s: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.",H),OZ[H]=!0}if(typeof Q.getDerivedStateFromProps==="function"){var B=s1(Q)||"Unknown";if(!m9[B])q("%s: Function components do not support getDerivedStateFromProps.",B),m9[B]=!0}if(typeof Q.contextType==="object"&&Q.contextType!==null){var W=s1(Q)||"Unknown";if(!D9[W])q("%s: Function components do not support contextType.",W),D9[W]=!0}}}var p9={dehydrated:null,treeContext:null,retryLane:P7};function d9(z){return{baseLanes:z,cachePool:lw(),transitions:null}}function XF(z,Q){var X=null;return{baseLanes:D1(z.baseLanes,Q),cachePool:X,transitions:z.transitions}}function ZF(z,Q,X,Z){if(Q!==null){var J=Q.memoizedState;if(J===null)return!1}return d$(z,XZ)}function JF(z,Q){return MJ(z.childLanes,Q)}function pB(z,Q,X){var Z=Q.pendingProps;if(NP(Q))Q.flags|=X4;var J=r5.current,$=!1,H=(Q.flags&X4)!==N1;if(H||ZF(J,z))$=!0,Q.flags&=~X4;else if(z===null||z.memoizedState!==null)J=Pw(J,nU);if(J=OQ(J),P8(Q,J),z===null){P$(Q);var B=Q.memoizedState;if(B!==null){var W=B.dehydrated;if(W!==null)return qF(Q,W)}var{children:w,fallback:k}=Z;if($){var l=YF(Q,w,k,X),c=Q.child;return c.memoizedState=d9(X),Q.memoizedState=p9,l}else return c9(Q,w)}else{var Z0=z.memoizedState;if(Z0!==null){var J0=Z0.dehydrated;if(J0!==null)return UF(z,Q,H,Z,J0,Z0,X)}if($){var{fallback:$0,children:j0}=Z,q1=HF(z,Q,j0,$0,X),X1=Q.child,x1=z.child.memoizedState;return X1.memoizedState=x1===null?d9(X):XF(x1,X),X1.childLanes=JF(z,X),Q.memoizedState=p9,q1}else{var j1=Z.children,t=$F(z,Q,j1,X);return Q.memoizedState=null,t}}}function c9(z,Q,X){var Z=z.mode,J={mode:"visible",children:Q},$=l9(J,Z);return $.return=z,z.child=$,$}function YF(z,Q,X,Z){var{mode:J,child:$}=z,H={mode:"hidden",children:Q},B,W;if((J&l1)===K1&&$!==null){if(B=$,B.childLanes=b0,B.pendingProps=H,z.mode&O4)B.actualDuration=0,B.actualStartTime=-1,B.selfBaseDuration=0,B.treeBaseDuration=0;W=f8(X,J,Z,null)}else B=l9(H,J),W=f8(X,J,Z,null);return B.return=z,W.return=z,B.sibling=W,z.child=B,W}function l9(z,Q,X){return cW(z,Q,b0,null)}function dB(z,Q){return Lz(z,Q)}function $F(z,Q,X,Z){var J=z.child,$=J.sibling,H=dB(J,{mode:"visible",children:X});if((Q.mode&l1)===K1)H.lanes=Z;if(H.return=Q,H.sibling=null,$!==null){var B=Q.deletions;if(B===null)Q.deletions=[$],Q.flags|=p8;else B.push($)}return Q.child=H,H}function HF(z,Q,X,Z,J){var $=Q.mode,H=z.child,B=H.sibling,W={mode:"hidden",children:X},w;if(($&l1)===K1&&Q.child!==H){var k=Q.child;if(w=k,w.childLanes=b0,w.pendingProps=W,Q.mode&O4)w.actualDuration=0,w.actualStartTime=-1,w.selfBaseDuration=H.selfBaseDuration,w.treeBaseDuration=H.treeBaseDuration;Q.deletions=null}else w=dB(H,W),w.subtreeFlags=H.subtreeFlags&V6;var l;if(B!==null)l=Lz(B,Z);else l=f8(Z,$,J,null),l.flags|=Z7;return l.return=Q,w.return=Q,w.sibling=l,Q.child=w,l}function pY(z,Q,X,Z){if(Z!==null)A$(Z);qQ(Q,z.child,null,X);var J=Q.pendingProps,$=J.children,H=c9(Q,$);return H.flags|=Z7,Q.memoizedState=null,H}function GF(z,Q,X,Z,J){var $=Q.mode,H={mode:"visible",children:X},B=l9(H,$),W=f8(Z,$,J,null);if(W.flags|=Z7,B.return=Q,W.return=Q,B.sibling=W,Q.child=B,(Q.mode&l1)!==K1)qQ(Q,z.child,null,J);return W}function qF(z,Q,X){if((z.mode&l1)===K1)q("Cannot hydrate Suspense in legacy mode. Switch from ReactDOM.hydrate(element, container) to ReactDOMClient.hydrateRoot(container, <App />).render(element) or remove the Suspense components from the server rendered components."),z.lanes=wJ(A1);else if(q$(Q))z.lanes=wJ(n8);else z.lanes=wJ(w5);return null}function UF(z,Q,X,Z,J,$,H){if(!X){if(tM(),(Q.mode&l1)===K1)return pY(z,Q,H,null);if(q$(J)){var B,W,w;{var k=_M(J);B=k.digest,W=k.message,w=k.stack}var l;if(W)l=Error(W);else l=Error("The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering.");var c=f9(l,B,w);return pY(z,Q,H,c)}var Z0=F5(H,z.childLanes);if(e5||Z0){var J0=eY();if(J0!==null){var $0=FL(J0,H);if($0!==P7&&$0!==$.retryLane){$.retryLane=$0;var j0=y4;B5(z,$0),K7(J0,z,$0,j0)}}OH();var q1=f9(Error("This Suspense boundary received an update before it finished hydrating. This caused the boundary to switch to client rendering. The usual way to fix this is to wrap the original update in startTransition."));return pY(z,Q,H,q1)}else if(BU(J)){Q.flags|=X4,Q.child=z.child;var X1=xb.bind(null,z);return LM(J,X1),null}else{Qw(Q,J,$.treeContext);var x1=Z.children,j1=c9(Q,x1);return j1.flags|=h6,j1}}else if(Q.flags&f6){Q.flags&=~f6;var t=f9(Error("There was an error while hydrating this Suspense boundary. Switched to client rendering."));return pY(z,Q,H,t)}else if(Q.memoizedState!==null)return Q.child=z.child,Q.flags|=X4,null;else{var{children:O0,fallback:e}=Z,T0=GF(z,Q,O0,e,H),i0=Q.child;return i0.memoizedState=d9(H),Q.memoizedState=p9,T0}}function cB(z,Q,X){z.lanes=D1(z.lanes,Q);var Z=z.alternate;if(Z!==null)Z.lanes=D1(Z.lanes,Q);V$(z.return,Q,X)}function BF(z,Q,X){var Z=Q;while(Z!==null){if(Z.tag===A){var J=Z.memoizedState;if(J!==null)cB(Z,X,z)}else if(Z.tag===d)cB(Z,X,z);else if(Z.child!==null){Z.child.return=Z,Z=Z.child;continue}if(Z===z)return;while(Z.sibling===null){if(Z.return===null||Z.return===z)return;Z=Z.return}Z.sibling.return=Z.return,Z=Z.sibling}}function WF(z){var Q=z,X=null;while(Q!==null){var Z=Q.alternate;if(Z!==null&&NY(Z)===null)X=Q;Q=Q.sibling}return X}function OF(z){if(z!==void 0&&z!=="forwards"&&z!=="backwards"&&z!=="together"&&!E9[z])if(E9[z]=!0,typeof z==="string")switch(z.toLowerCase()){case"together":case"forwards":case"backwards":{q('"%s" is not a valid value for revealOrder on <SuspenseList />. Use lowercase "%s" instead.',z,z.toLowerCase());break}case"forward":case"backward":{q('"%s" is not a valid value for revealOrder on <SuspenseList />. React uses the -s suffix in the spelling. Use "%ss" instead.',z,z.toLowerCase());break}default:q('"%s" is not a supported revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?',z);break}else q('%s is not a supported value for revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?',z)}function KF(z,Q){if(z!==void 0&&!jY[z]){if(z!=="collapsed"&&z!=="hidden")jY[z]=!0,q('"%s" is not a supported value for tail on <SuspenseList />. Did you mean "collapsed" or "hidden"?',z);else if(Q!=="forwards"&&Q!=="backwards")jY[z]=!0,q('<SuspenseList tail="%s" /> is only valid if revealOrder is "forwards" or "backwards". Did you mean to specify revealOrder="forwards"?',z)}}function lB(z,Q){{var X=Q4(z),Z=!X&&typeof h4(z)==="function";if(X||Z){var J=X?"array":"iterable";return q("A nested %s was passed to row #%s in <SuspenseList />. Wrap it in an additional SuspenseList to configure its revealOrder: <SuspenseList revealOrder=...> ... <SuspenseList revealOrder=...>{%s}</SuspenseList> ... </SuspenseList>",J,Q,J),!1}}return!0}function _F(z,Q){if((Q==="forwards"||Q==="backwards")&&z!==void 0&&z!==null&&z!==!1)if(Q4(z)){for(var X=0;X<z.length;X++)if(!lB(z[X],X))return}else{var Z=h4(z);if(typeof Z==="function"){var J=Z.call(z);if(J){var $=J.next(),H=0;for(;!$.done;$=J.next()){if(!lB($.value,H))return;H++}}}else q('A single row was passed to a <SuspenseList revealOrder="%s" />. This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?',Q)}}function i9(z,Q,X,Z,J){var $=z.memoizedState;if($===null)z.memoizedState={isBackwards:Q,rendering:null,renderingStartTime:0,last:Z,tail:X,tailMode:J};else $.isBackwards=Q,$.rendering=null,$.renderingStartTime=0,$.last=Z,$.tail=X,$.tailMode=J}function iB(z,Q,X){var Z=Q.pendingProps,J=Z.revealOrder,$=Z.tail,H=Z.children;OF(J),KF($,J),_F(H,J),Q5(z,Q,H,X);var B=r5.current,W=d$(B,XZ);if(W)B=c$(B,XZ),Q.flags|=X4;else{var w=z!==null&&(z.flags&X4)!==N1;if(w)BF(Q,Q.child,X);B=OQ(B)}if(P8(Q,B),(Q.mode&l1)===K1)Q.memoizedState=null;else switch(J){case"forwards":{var k=WF(Q.child),l;if(k===null)l=Q.child,Q.child=null;else l=k.sibling,k.sibling=null;i9(Q,!1,l,k,$);break}case"backwards":{var c=null,Z0=Q.child;Q.child=null;while(Z0!==null){var J0=Z0.alternate;if(J0!==null&&NY(J0)===null){Q.child=Z0;break}var $0=Z0.sibling;Z0.sibling=c,c=Z0,Z0=$0}i9(Q,!0,c,null,$);break}case"together":{i9(Q,!1,null,null,void 0);break}default:Q.memoizedState=null}return Q.child}function LF(z,Q,X){x$(Q,Q.stateNode.containerInfo);var Z=Q.pendingProps;if(z===null)Q.child=qQ(Q,null,Z,X);else Q5(z,Q,Z,X);return Q.child}var oB=!1;function RF(z,Q,X){var Z=Q.type,J=Z._context,$=Q.pendingProps,H=Q.memoizedProps,B=$.value;{if(!("value"in $)){if(!oB)oB=!0,q("The `value` prop is required for the `<Context.Provider>`. Did you misspell it or forget to pass it?")}var W=Q.type.propTypes;if(W)o5(W,$,"prop","Context.Provider")}if(uU(Q,J,B),H!==null){var w=H.value;if(A5(w,B)){if(H.children===$.children&&!nJ())return c6(z,Q,X)}else Kw(Q,J,X)}var k=$.children;return Q5(z,Q,k,X),Q.child}var aB=!1;function NF(z,Q,X){var Z=Q.type;if(Z._context===void 0){if(Z!==Z.Consumer){if(!aB)aB=!0,q("Rendering <Context> directly is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?")}}else Z=Z._context;var J=Q.pendingProps,$=J.children;if(typeof $!=="function")q("A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it.");BQ(Q,X);var H=J7(Z);BX(Q);var B;return BZ.current=Q,M5(!0),B=$(H),M5(!1),cz(),Q.flags|=pz,Q5(z,Q,B,X),Q.child}function KZ(){e5=!0}function dY(z,Q){if((Q.mode&l1)===K1){if(z!==null)z.alternate=null,Q.alternate=null,Q.flags|=Z7}}function c6(z,Q,X){if(z!==null)Q.dependencies=z.dependencies;if(PB(),TZ(Q.lanes),!F5(X,Q.childLanes))return null;return Ww(z,Q),Q.child}function MF(z,Q,X){{var Z=Q.return;if(Z===null)throw Error("Cannot swap the root fiber.");if(z.alternate=null,Q.alternate=null,X.index=Q.index,X.sibling=Q.sibling,X.return=Q.return,X.ref=Q.ref,Q===Z.child)Z.child=X;else{var J=Z.child;if(J===null)throw Error("Expected parent to have a child.");while(J.sibling!==Q)if(J=J.sibling,J===null)throw Error("Expected to find the previous sibling.");J.sibling=X}var $=Z.deletions;if($===null)Z.deletions=[z],Z.flags|=p8;else $.push(z);return X.flags|=Z7,X}}function o9(z,Q){var X=z.lanes;if(F5(X,Q))return!0;return!1}function wF(z,Q,X){switch(Q.tag){case I:xB(Q);var Z=Q.stateNode;GQ();break;case P:oU(Q);break;case O:{var J=Q.type;if(K6(J))sJ(Q);break}case b:x$(Q,Q.stateNode.containerInfo);break;case x:{var $=Q.memoizedProps.value,H=Q.type._context;uU(Q,H,$);break}case p:{var B=F5(X,Q.childLanes);if(B)Q.flags|=r1;{var W=Q.stateNode;W.effectDuration=0,W.passiveEffectDuration=0}}break;case A:{var w=Q.memoizedState;if(w!==null){if(w.dehydrated!==null)return P8(Q,OQ(r5.current)),Q.flags|=X4,null;var k=Q.child,l=k.childLanes;if(F5(X,l))return pB(z,Q,X);else{P8(Q,OQ(r5.current));var c=c6(z,Q,X);if(c!==null)return c.sibling;else return null}}else P8(Q,OQ(r5.current));break}case d:{var Z0=(z.flags&X4)!==N1,J0=F5(X,Q.childLanes);if(Z0){if(J0)return iB(z,Q,X);Q.flags|=X4}var $0=Q.memoizedState;if($0!==null)$0.rendering=null,$0.tail=null,$0.lastEffect=null;if(P8(Q,r5.current),J0)break;else return null}case Q0:case n:return Q.lanes=b0,gB(z,Q,X)}return c6(z,Q,X)}function nB(z,Q,X){if(Q._debugNeedsRemount&&z!==null)return MF(z,Q,AH(Q.type,Q.key,Q.pendingProps,Q._debugOwner||null,Q.mode,Q.lanes));if(z!==null){var Z=z.memoizedProps,J=Q.pendingProps;if(Z!==J||nJ()||Q.type!==z.type)e5=!0;else{var $=o9(z,X);if(!$&&(Q.flags&X4)===N1)return e5=!1,wF(z,Q,X);if((z.flags&t2)!==N1)e5=!0;else e5=!1}}else if(e5=!1,S7()&&iM(Q)){var H=Q.index,B=oM();PU(Q,B,H)}switch(Q.lanes=b0,Q.tag){case T:return QF(z,Q,Q.type,X);case u:{var W=Q.elementType;return ew(z,Q,W,X)}case K:{var{type:w,pendingProps:k}=Q,l=Q.elementType===w?k:t5(w,k);return u9(z,Q,w,l,X)}case O:{var{type:c,pendingProps:Z0}=Q,J0=Q.elementType===c?Z0:t5(c,Z0);return uB(z,Q,c,J0,X)}case I:return rw(z,Q,X);case P:return sw(z,Q,X);case N:return tw(z,Q);case A:return pB(z,Q,X);case b:return LF(z,Q,X);case v:{var{type:$0,pendingProps:j0}=Q,q1=Q.elementType===$0?j0:t5($0,j0);return VB(z,Q,$0,q1,X)}case S:return ow(z,Q,X);case f:return aw(z,Q,X);case p:return nw(z,Q,X);case x:return RF(z,Q,X);case V:return NF(z,Q,X);case E:{var{type:X1,pendingProps:x1}=Q,j1=t5(X1,x1);if(Q.type!==Q.elementType){var t=X1.propTypes;if(t)o5(t,j1,"prop",s1(X1))}return j1=t5(X1.type,j1),DB(z,Q,X1,j1,X)}case j:return mB(z,Q,Q.type,Q.pendingProps,X);case r:{var{type:O0,pendingProps:e}=Q,T0=Q.elementType===O0?e:t5(O0,e);return zF(z,Q,O0,T0,X)}case d:return iB(z,Q,X);case D:break;case Q0:return gB(z,Q,X)}throw Error("Unknown unit of work tag ("+Q.tag+"). This error is likely caused by a bug in React. Please file an issue.")}function MQ(z){z.flags|=r1}function rB(z){z.flags|=q8,z.flags|=e2}var sB,a9,tB,eB;sB=function(z,Q,X,Z){var J=Q.child;while(J!==null){if(J.tag===P||J.tag===N)dN(z,J.stateNode);else if(J.tag===b);else if(J.child!==null){J.child.return=J,J=J.child;continue}if(J===Q)return;while(J.sibling===null){if(J.return===null||J.return===Q)return;J=J.return}J.sibling.return=J.return,J=J.sibling}},a9=function(z,Q){},tB=function(z,Q,X,Z,J){var $=z.memoizedProps;if($===Z)return;var H=Q.stateNode,B=j$(),W=lN(H,X,$,Z,J,B);if(Q.updateQueue=W,W)MQ(Q)},eB=function(z,Q,X,Z){if(X!==Z)MQ(Q)};function _Z(z,Q){if(S7())return;switch(z.tailMode){case"hidden":{var X=z.tail,Z=null;while(X!==null){if(X.alternate!==null)Z=X;X=X.sibling}if(Z===null)z.tail=null;else Z.sibling=null;break}case"collapsed":{var J=z.tail,$=null;while(J!==null){if(J.alternate!==null)$=J;J=J.sibling}if($===null)if(!Q&&z.tail!==null)z.tail.sibling=null;else z.tail=null;else $.sibling=null;break}}}function f7(z){var Q=z.alternate!==null&&z.alternate.child===z.child,X=b0,Z=N1;if(!Q){if((z.mode&O4)!==K1){var{actualDuration:J,selfBaseDuration:$,child:H}=z;while(H!==null)X=D1(X,D1(H.lanes,H.childLanes)),Z|=H.subtreeFlags,Z|=H.flags,J+=H.actualDuration,$+=H.treeBaseDuration,H=H.sibling;z.actualDuration=J,z.treeBaseDuration=$}else{var B=z.child;while(B!==null)X=D1(X,D1(B.lanes,B.childLanes)),Z|=B.subtreeFlags,Z|=B.flags,B.return=z,B=B.sibling}z.subtreeFlags|=Z}else{if((z.mode&O4)!==K1){var{selfBaseDuration:W,child:w}=z;while(w!==null)X=D1(X,D1(w.lanes,w.childLanes)),Z|=w.subtreeFlags&V6,Z|=w.flags&V6,W+=w.treeBaseDuration,w=w.sibling;z.treeBaseDuration=W}else{var k=z.child;while(k!==null)X=D1(X,D1(k.lanes,k.childLanes)),Z|=k.subtreeFlags&V6,Z|=k.flags&V6,k.return=z,k=k.sibling}z.subtreeFlags|=Z}return z.childLanes=X,Q}function FF(z,Q,X){if($w()&&(Q.mode&l1)!==K1&&(Q.flags&X4)===N1)return vU(Q),GQ(),Q.flags|=f6|qX|z5,!1;var Z=XY(Q);if(X!==null&&X.dehydrated!==null)if(z===null){if(!Z)throw Error("A dehydrated suspense component was completed without a hydrated node. This is probably a bug in React.");if(Jw(Q),f7(Q),(Q.mode&O4)!==K1){var J=X!==null;if(J){var $=Q.child;if($!==null)Q.treeBaseDuration-=$.treeBaseDuration}}return!1}else{if(GQ(),(Q.flags&X4)===N1)Q.memoizedState=null;if(Q.flags|=r1,f7(Q),(Q.mode&O4)!==K1){var H=X!==null;if(H){var B=Q.child;if(B!==null)Q.treeBaseDuration-=B.treeBaseDuration}}return!1}else return fU(),!0}function zW(z,Q,X){var Z=Q.pendingProps;switch(M$(Q),Q.tag){case T:case u:case j:case K:case v:case S:case f:case p:case V:case E:return f7(Q),null;case O:{var J=Q.type;if(K6(J))rJ(Q);return f7(Q),null}case I:{var $=Q.stateNode;if(WQ(Q),_$(Q),i$(),$.pendingContext)$.context=$.pendingContext,$.pendingContext=null;if(z===null||z.child===null){var H=XY(Q);if(H)MQ(Q);else if(z!==null){var B=z.memoizedState;if(!B.isDehydrated||(Q.flags&f6)!==N1)Q.flags|=d8,fU()}}return a9(z,Q),f7(Q),null}case P:{p$(Q);var W=iU(),w=Q.type;if(z!==null&&Q.stateNode!=null){if(tB(z,Q,w,Z,W),z.ref!==Q.ref)rB(Q)}else{if(!Z){if(Q.stateNode===null)throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");return f7(Q),null}var k=j$(),l=XY(Q);if(l){if(Xw(Q,W,k))MQ(Q)}else{var c=pN(w,Z,W,k,Q);if(sB(c,Q,!1,!1),Q.stateNode=c,cN(c,w,Z,W))MQ(Q)}if(Q.ref!==null)rB(Q)}return f7(Q),null}case N:{var Z0=Z;if(z&&Q.stateNode!=null){var J0=z.memoizedProps;eB(z,Q,J0,Z0)}else{if(typeof Z0!=="string"){if(Q.stateNode===null)throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.")}var $0=iU(),j0=j$(),q1=XY(Q);if(q1){if(Zw(Q))MQ(Q)}else Q.stateNode=iN(Z0,$0,j0,Q)}return f7(Q),null}case A:{KQ(Q);var X1=Q.memoizedState;if(z===null||z.memoizedState!==null&&z.memoizedState.dehydrated!==null){var x1=FF(z,Q,X1);if(!x1)if(Q.flags&z5)return Q;else return null}if((Q.flags&X4)!==N1){if(Q.lanes=X,(Q.mode&O4)!==K1)N9(Q);return Q}var j1=X1!==null,t=z!==null&&z.memoizedState!==null;if(j1!==t){if(j1){var O0=Q.child;if(O0.flags|=c8,(Q.mode&l1)!==K1){var e=z===null&&(Q.memoizedProps.unstable_avoidThisFallback!==!0||!Y0);if(e||d$(r5.current,nU))kb();else OH()}}}var T0=Q.updateQueue;if(T0!==null)Q.flags|=r1;if(f7(Q),(Q.mode&O4)!==K1){if(j1){var i0=Q.child;if(i0!==null)Q.treeBaseDuration-=i0.treeBaseDuration}}return null}case b:if(WQ(Q),a9(z,Q),z===null)uM(Q.stateNode.containerInfo);return f7(Q),null;case x:var d0=Q.type._context;return y$(d0,Q),f7(Q),null;case r:{var w1=Q.type;if(K6(w1))rJ(Q);return f7(Q),null}case d:{KQ(Q);var C1=Q.memoizedState;if(C1===null)return f7(Q),null;var _4=(Q.flags&X4)!==N1,e1=C1.rendering;if(e1===null)if(!_4){var z7=Sb()&&(z===null||(z.flags&X4)===N1);if(!z7){var z4=Q.child;while(z4!==null){var a4=NY(z4);if(a4!==null){_4=!0,Q.flags|=X4,_Z(C1,!1);var l7=a4.updateQueue;if(l7!==null)Q.updateQueue=l7,Q.flags|=r1;return Q.subtreeFlags=N1,Ow(Q,X),P8(Q,c$(r5.current,XZ)),Q.child}z4=z4.sibling}}if(C1.tail!==null&&F7()>bW())Q.flags|=X4,_4=!0,_Z(C1,!1),Q.lanes=tG}else _Z(C1,!1);else{if(!_4){var m7=NY(e1);if(m7!==null){Q.flags|=X4,_4=!0;var k5=m7.updateQueue;if(k5!==null)Q.updateQueue=k5,Q.flags|=r1;if(_Z(C1,!0),C1.tail===null&&C1.tailMode==="hidden"&&!e1.alternate&&!S7())return f7(Q),null}else if(F7()*2-C1.renderingStartTime>bW()&&X!==w5)Q.flags|=X4,_4=!0,_Z(C1,!1),Q.lanes=tG}if(C1.isBackwards)e1.sibling=Q.child,Q.child=e1;else{var J5=C1.last;if(J5!==null)J5.sibling=e1;else Q.child=e1;C1.last=e1}}if(C1.tail!==null){var Y5=C1.tail;C1.rendering=Y5,C1.tail=Y5.sibling,C1.renderingStartTime=F7(),Y5.sibling=null;var i7=r5.current;if(_4)i7=c$(i7,XZ);else i7=OQ(i7);return P8(Q,i7),Y5}return f7(Q),null}case D:break;case Q0:case n:{WH(Q);var n6=Q.memoizedState,kQ=n6!==null;if(z!==null){var fZ=z.memoizedState,b6=fZ!==null;if(b6!==kQ&&!a)Q.flags|=c8}if(!kQ||(Q.mode&l1)===K1)f7(Q);else if(F5(F6,w5)){if(f7(Q),Q.subtreeFlags&(Z7|r1))Q.flags|=c8}return null}case G0:return null;case F0:return null}throw Error("Unknown unit of work tag ("+Q.tag+"). This error is likely caused by a bug in React. Please file an issue.")}function bF(z,Q,X){switch(M$(Q),Q.tag){case O:{var Z=Q.type;if(K6(Z))rJ(Q);var J=Q.flags;if(J&z5){if(Q.flags=J&~z5|X4,(Q.mode&O4)!==K1)N9(Q);return Q}return null}case I:{var $=Q.stateNode;WQ(Q),_$(Q),i$();var H=Q.flags;if((H&z5)!==N1&&(H&X4)===N1)return Q.flags=H&~z5|X4,Q;return null}case P:return p$(Q),null;case A:{KQ(Q);var B=Q.memoizedState;if(B!==null&&B.dehydrated!==null){if(Q.alternate===null)throw Error("Threw in newly mounted dehydrated component. This is likely a bug in React. Please file an issue.");GQ()}var W=Q.flags;if(W&z5){if(Q.flags=W&~z5|X4,(Q.mode&O4)!==K1)N9(Q);return Q}return null}case d:return KQ(Q),null;case b:return WQ(Q),null;case x:var w=Q.type._context;return y$(w,Q),null;case Q0:case n:return WH(Q),null;case G0:return null;default:return null}}function QW(z,Q,X){switch(M$(Q),Q.tag){case O:{var Z=Q.type.childContextTypes;if(Z!==null&&Z!==void 0)rJ(Q);break}case I:{var J=Q.stateNode;WQ(Q),_$(Q),i$();break}case P:{p$(Q);break}case b:WQ(Q);break;case A:KQ(Q);break;case d:KQ(Q);break;case x:var $=Q.type._context;y$($,Q);break;case Q0:case n:WH(Q);break}}var XW=null;XW=new Set;var cY=!1,h7=!1,PF=typeof WeakSet==="function"?WeakSet:Set,s0=null,wQ=null,FQ=null;function AF(z){n2(null,function(){throw z}),r2()}var IF=function(z,Q){if(Q.props=z.memoizedProps,Q.state=z.memoizedState,z.mode&O4)try{M6(),Q.componentWillUnmount()}finally{N6(z)}else Q.componentWillUnmount()};function ZW(z,Q){try{T8(G7,z)}catch(X){T4(z,Q,X)}}function n9(z,Q,X){try{IF(z,X)}catch(Z){T4(z,Q,Z)}}function TF(z,Q,X){try{X.componentDidMount()}catch(Z){T4(z,Q,Z)}}function JW(z,Q){try{HW(z)}catch(X){T4(z,Q,X)}}function bQ(z,Q){var X=z.ref;if(X!==null)if(typeof X==="function"){var Z;try{if(v0&&p0&&z.mode&O4)try{M6(),Z=X(null)}finally{N6(z)}else Z=X(null)}catch(J){T4(z,Q,J)}if(typeof Z==="function")q("Unexpected return value from a callback ref in %s. A callback ref should not return a function.",y1(z))}else X.current=null}function lY(z,Q,X){try{X()}catch(Z){T4(z,Q,Z)}}var YW=null,$W=!1;function kF(z,Q){YW=xN(z.containerInfo),s0=Q,CF();var X=$W;return $W=!1,YW=null,X}function CF(){while(s0!==null){var z=s0,Q=z.child;if((z.subtreeFlags&Q3)!==N1&&Q!==null)Q.return=z,s0=Q;else SF()}}function SF(){while(s0!==null){var z=s0;p4(z);try{vF(z)}catch(X){T4(z,z.return,X)}w7();var Q=z.sibling;if(Q!==null){Q.return=z.return,s0=Q;return}s0=z.return}}function vF(z){var{alternate:Q,flags:X}=z;if((X&d8)!==N1){switch(p4(z),z.tag){case K:case v:case j:break;case O:{if(Q!==null){var{memoizedProps:Z,memoizedState:J}=Q,$=z.stateNode;if(z.type===z.elementType&&!Bz){if($.props!==z.memoizedProps)q("Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",y1(z)||"instance");if($.state!==z.memoizedState)q("Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",y1(z)||"instance")}var H=$.getSnapshotBeforeUpdate(z.elementType===z.type?Z:t5(z.type,Z),J);{var B=XW;if(H===void 0&&!B.has(z.type))B.add(z.type),q("%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.",y1(z))}$.__reactInternalSnapshotBeforeUpdate=H}break}case I:{{var W=z.stateNode;BM(W.containerInfo)}break}case P:case N:case b:case r:break;default:throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.")}w7()}}function z6(z,Q,X){var Z=Q.updateQueue,J=Z!==null?Z.lastEffect:null;if(J!==null){var $=J.next,H=$;do{if((H.tag&z)===z){var B=H.destroy;if(H.destroy=void 0,B!==void 0){if((z&v7)!==W5)i_(Q);else if((z&G7)!==W5)oG(Q);if((z&_6)!==W5)CZ(!0);if(lY(Q,X,B),(z&_6)!==W5)CZ(!1);if((z&v7)!==W5)o_();else if((z&G7)!==W5)aG()}}H=H.next}while(H!==$)}}function T8(z,Q){var X=Q.updateQueue,Z=X!==null?X.lastEffect:null;if(Z!==null){var J=Z.next,$=J;do{if(($.tag&z)===z){if((z&v7)!==W5)c_(Q);else if((z&G7)!==W5)a_(Q);var H=$.create;if((z&_6)!==W5)CZ(!0);if($.destroy=H(),(z&_6)!==W5)CZ(!1);if((z&v7)!==W5)l_();else if((z&G7)!==W5)n_();{var B=$.destroy;if(B!==void 0&&typeof B!=="function"){var W=void 0;if(($.tag&G7)!==N1)W="useLayoutEffect";else if(($.tag&_6)!==N1)W="useInsertionEffect";else W="useEffect";var w=void 0;if(B===null)w=" You returned null. If your effect does not require clean up, return undefined (or nothing).";else if(typeof B.then==="function")w=`
|
|
103
|
+
|
|
104
|
+
It looks like you wrote `+W+`(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:
|
|
105
|
+
|
|
106
|
+
`+W+`(() => {
|
|
107
|
+
async function fetchData() {
|
|
108
|
+
// You can await here
|
|
109
|
+
const response = await MyAPI.getData(someId);
|
|
110
|
+
// ...
|
|
111
|
+
}
|
|
112
|
+
fetchData();
|
|
113
|
+
}, [someId]); // Or [] if effect doesn't need props or state
|
|
114
|
+
|
|
115
|
+
Learn more about data fetching with Hooks: https://reactjs.org/link/hooks-data-fetching`;else w=" You returned: "+B;q("%s must not return anything besides a function, which is used for clean-up.%s",W,w)}}}$=$.next}while($!==J)}}function fF(z,Q){if((Q.flags&r1)!==N1)switch(Q.tag){case p:{var X=Q.stateNode.passiveEffectDuration,Z=Q.memoizedProps,J=Z.id,$=Z.onPostCommit,H=FB(),B=Q.alternate===null?"mount":"update";if(wB())B="nested-update";if(typeof $==="function")$(J,B,X,H);var W=Q.return;z:while(W!==null){switch(W.tag){case I:var w=W.stateNode;w.passiveEffectDuration+=X;break z;case p:var k=W.stateNode;k.passiveEffectDuration+=X;break z}W=W.return}break}}}function hF(z,Q,X,Z){if((X.flags&UX)!==N1)switch(X.tag){case K:case v:case j:{if(!h7)if(X.mode&O4)try{M6(),T8(G7|H7,X)}finally{N6(X)}else T8(G7|H7,X);break}case O:{var J=X.stateNode;if(X.flags&r1){if(!h7)if(Q===null){if(X.type===X.elementType&&!Bz){if(J.props!==X.memoizedProps)q("Expected %s props to match memoized props before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",y1(X)||"instance");if(J.state!==X.memoizedState)q("Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",y1(X)||"instance")}if(X.mode&O4)try{M6(),J.componentDidMount()}finally{N6(X)}else J.componentDidMount()}else{var $=X.elementType===X.type?Q.memoizedProps:t5(X.type,Q.memoizedProps),H=Q.memoizedState;if(X.type===X.elementType&&!Bz){if(J.props!==X.memoizedProps)q("Expected %s props to match memoized props before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",y1(X)||"instance");if(J.state!==X.memoizedState)q("Expected %s state to match memoized state before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",y1(X)||"instance")}if(X.mode&O4)try{M6(),J.componentDidUpdate($,H,J.__reactInternalSnapshotBeforeUpdate)}finally{N6(X)}else J.componentDidUpdate($,H,J.__reactInternalSnapshotBeforeUpdate)}}var B=X.updateQueue;if(B!==null){if(X.type===X.elementType&&!Bz){if(J.props!==X.memoizedProps)q("Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",y1(X)||"instance");if(J.state!==X.memoizedState)q("Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",y1(X)||"instance")}lU(X,B,J)}break}case I:{var W=X.updateQueue;if(W!==null){var w=null;if(X.child!==null)switch(X.child.tag){case P:w=J$(X.child.stateNode);break;case O:w=X.child.stateNode;break}lU(X,W,w)}break}case P:{var k=X.stateNode;if(Q===null&&X.flags&r1){var{type:l,memoizedProps:c}=X;sN(k,l,c)}break}case N:break;case b:break;case p:{{var Z0=X.memoizedProps,J0=Z0.onCommit,$0=Z0.onRender,j0=X.stateNode.effectDuration,q1=FB(),X1=Q===null?"mount":"update";if(wB())X1="nested-update";if(typeof $0==="function")$0(X.memoizedProps.id,X1,X.actualDuration,X.treeBaseDuration,X.actualStartTime,q1);{if(typeof J0==="function")J0(X.memoizedProps.id,X1,j0,q1);Vb(X);var x1=X.return;z:while(x1!==null){switch(x1.tag){case I:var j1=x1.stateNode;j1.effectDuration+=j0;break z;case p:var t=x1.stateNode;t.effectDuration+=j0;break z}x1=x1.return}}}break}case A:{xF(z,X);break}case d:case r:case D:case Q0:case n:case F0:break;default:throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.")}if(!h7){if(X.flags&q8)HW(X)}}function yF(z){switch(z.tag){case K:case v:case j:{if(z.mode&O4)try{M6(),ZW(z,z.return)}finally{N6(z)}else ZW(z,z.return);break}case O:{var Q=z.stateNode;if(typeof Q.componentDidMount==="function")TF(z,z.return,Q);JW(z,z.return);break}case P:{JW(z,z.return);break}}}function VF(z,Q){var X=null;{var Z=z;while(!0){if(Z.tag===P){if(X===null){X=Z;try{var J=Z.stateNode;if(Q)HM(J);else qM(Z.stateNode,Z.memoizedProps)}catch(H){T4(z,z.return,H)}}}else if(Z.tag===N){if(X===null)try{var $=Z.stateNode;if(Q)GM($);else UM($,Z.memoizedProps)}catch(H){T4(z,z.return,H)}}else if((Z.tag===Q0||Z.tag===n)&&Z.memoizedState!==null&&Z!==z);else if(Z.child!==null){Z.child.return=Z,Z=Z.child;continue}if(Z===z)return;while(Z.sibling===null){if(Z.return===null||Z.return===z)return;if(X===Z)X=null;Z=Z.return}if(X===Z)X=null;Z.sibling.return=Z.return,Z=Z.sibling}}}function HW(z){var Q=z.ref;if(Q!==null){var X=z.stateNode,Z;switch(z.tag){case P:Z=J$(X);break;default:Z=X}if(typeof Q==="function"){var J;if(z.mode&O4)try{M6(),J=Q(Z)}finally{N6(z)}else J=Q(Z);if(typeof J==="function")q("Unexpected return value from a callback ref in %s. A callback ref should not return a function.",y1(z))}else{if(!Q.hasOwnProperty("current"))q("Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().",y1(z));Q.current=Z}}}function DF(z){var Q=z.alternate;if(Q!==null)Q.return=null;z.return=null}function GW(z){var Q=z.alternate;if(Q!==null)z.alternate=null,GW(Q);{if(z.child=null,z.deletions=null,z.sibling=null,z.tag===P){var X=z.stateNode;if(X!==null)pM(X)}z.stateNode=null,z._debugOwner=null,z.return=null,z.dependencies=null,z.memoizedProps=null,z.memoizedState=null,z.pendingProps=null,z.stateNode=null,z.updateQueue=null}}function mF(z){var Q=z.return;while(Q!==null){if(qW(Q))return Q;Q=Q.return}throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.")}function qW(z){return z.tag===P||z.tag===I||z.tag===b}function UW(z){var Q=z;z:while(!0){while(Q.sibling===null){if(Q.return===null||qW(Q.return))return null;Q=Q.return}Q.sibling.return=Q.return,Q=Q.sibling;while(Q.tag!==P&&Q.tag!==N&&Q.tag!==i){if(Q.flags&Z7)continue z;if(Q.child===null||Q.tag===b)continue z;else Q.child.return=Q,Q=Q.child}if(!(Q.flags&Z7))return Q.stateNode}}function gF(z){var Q=mF(z);switch(Q.tag){case P:{var X=Q.stateNode;if(Q.flags&GX)UU(X),Q.flags&=~GX;var Z=UW(z);s9(z,Z,X);break}case I:case b:{var J=Q.stateNode.containerInfo,$=UW(z);r9(z,$,J);break}default:throw Error("Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.")}}function r9(z,Q,X){var Z=z.tag,J=Z===P||Z===N;if(J){var $=z.stateNode;if(Q)ZM(X,$,Q);else QM(X,$)}else if(Z===b);else{var H=z.child;if(H!==null){r9(H,Q,X);var B=H.sibling;while(B!==null)r9(B,Q,X),B=B.sibling}}}function s9(z,Q,X){var Z=z.tag,J=Z===P||Z===N;if(J){var $=z.stateNode;if(Q)XM(X,$,Q);else zM(X,$)}else if(Z===b);else{var H=z.child;if(H!==null){s9(H,Q,X);var B=H.sibling;while(B!==null)s9(B,Q,X),B=B.sibling}}}var y7=null,Q6=!1;function EF(z,Q,X){{var Z=Q;z:while(Z!==null){switch(Z.tag){case P:{y7=Z.stateNode,Q6=!1;break z}case I:{y7=Z.stateNode.containerInfo,Q6=!0;break z}case b:{y7=Z.stateNode.containerInfo,Q6=!0;break z}}Z=Z.return}if(y7===null)throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");BW(z,Q,X),y7=null,Q6=!1}DF(X)}function k8(z,Q,X){var Z=X.child;while(Z!==null)BW(z,Q,Z),Z=Z.sibling}function BW(z,Q,X){switch(x_(X),X.tag){case P:if(!h7)bQ(X,Q);case N:{{var Z=y7,J=Q6;if(y7=null,k8(z,Q,X),y7=Z,Q6=J,y7!==null)if(Q6)YM(y7,X.stateNode);else JM(y7,X.stateNode)}return}case i:{if(y7!==null)if(Q6)$M(y7,X.stateNode);else G$(y7,X.stateNode);return}case b:{{var $=y7,H=Q6;y7=X.stateNode.containerInfo,Q6=!0,k8(z,Q,X),y7=$,Q6=H}return}case K:case v:case E:case j:{if(!h7){var B=X.updateQueue;if(B!==null){var W=B.lastEffect;if(W!==null){var w=W.next,k=w;do{var l=k,c=l.destroy,Z0=l.tag;if(c!==void 0){if((Z0&_6)!==W5)lY(X,Q,c);else if((Z0&G7)!==W5){if(oG(X),X.mode&O4)M6(),lY(X,Q,c),N6(X);else lY(X,Q,c);aG()}}k=k.next}while(k!==w)}}}k8(z,Q,X);return}case O:{if(!h7){bQ(X,Q);var J0=X.stateNode;if(typeof J0.componentWillUnmount==="function")n9(X,Q,J0)}k8(z,Q,X);return}case D:{k8(z,Q,X);return}case Q0:{if(X.mode&l1){var $0=h7;h7=$0||X.memoizedState!==null,k8(z,Q,X),h7=$0}else k8(z,Q,X);break}default:{k8(z,Q,X);return}}}function uF(z){var Q=z.memoizedState}function xF(z,Q){var X=Q.memoizedState;if(X===null){var Z=Q.alternate;if(Z!==null){var J=Z.memoizedState;if(J!==null){var $=J.dehydrated;if($!==null)IM($)}}}}function WW(z){var Q=z.updateQueue;if(Q!==null){z.updateQueue=null;var X=z.stateNode;if(X===null)X=z.stateNode=new PF;Q.forEach(function(Z){var J=jb.bind(null,z,Z);if(!X.has(Z)){if(X.add(Z),l5)if(wQ!==null&&FQ!==null)kZ(FQ,wQ);else throw Error("Expected finished root and lanes to be set. This is a bug in React.");Z.then(J,J)}})}}function jF(z,Q,X){wQ=X,FQ=z,p4(Q),OW(Q,z),p4(Q),wQ=null,FQ=null}function X6(z,Q,X){var Z=Q.deletions;if(Z!==null)for(var J=0;J<Z.length;J++){var $=Z[J];try{EF(z,Q,$)}catch(W){T4($,Q,W)}}var H=tZ();if(Q.subtreeFlags&X3){var B=Q.child;while(B!==null)p4(B),OW(B,z),B=B.sibling}p4(H)}function OW(z,Q,X){var{alternate:Z,flags:J}=z;switch(z.tag){case K:case v:case E:case j:{if(X6(Q,z),w6(z),J&r1){try{z6(_6|H7,z,z.return),T8(_6|H7,z)}catch(w1){T4(z,z.return,w1)}if(z.mode&O4){try{M6(),z6(G7|H7,z,z.return)}catch(w1){T4(z,z.return,w1)}N6(z)}else try{z6(G7|H7,z,z.return)}catch(w1){T4(z,z.return,w1)}}return}case O:{if(X6(Q,z),w6(z),J&q8){if(Z!==null)bQ(Z,Z.return)}return}case P:{if(X6(Q,z),w6(z),J&q8){if(Z!==null)bQ(Z,Z.return)}{if(z.flags&GX){var $=z.stateNode;try{UU($)}catch(w1){T4(z,z.return,w1)}}if(J&r1){var H=z.stateNode;if(H!=null){var B=z.memoizedProps,W=Z!==null?Z.memoizedProps:B,w=z.type,k=z.updateQueue;if(z.updateQueue=null,k!==null)try{tN(H,k,w,W,B,z)}catch(w1){T4(z,z.return,w1)}}}}return}case N:{if(X6(Q,z),w6(z),J&r1){if(z.stateNode===null)throw Error("This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue.");var{stateNode:l,memoizedProps:c}=z,Z0=Z!==null?Z.memoizedProps:c;try{eN(l,Z0,c)}catch(w1){T4(z,z.return,w1)}}return}case I:{if(X6(Q,z),w6(z),J&r1){if(Z!==null){var J0=Z.memoizedState;if(J0.isDehydrated)try{AM(Q.containerInfo)}catch(w1){T4(z,z.return,w1)}}}return}case b:{X6(Q,z),w6(z);return}case A:{X6(Q,z),w6(z);var $0=z.child;if($0.flags&c8){var{stateNode:j0,memoizedState:q1}=$0,X1=q1!==null;if(j0.isHidden=X1,X1){var x1=$0.alternate!==null&&$0.alternate.memoizedState!==null;if(!x1)Tb()}}if(J&r1){try{uF(z)}catch(w1){T4(z,z.return,w1)}WW(z)}return}case Q0:{var j1=Z!==null&&Z.memoizedState!==null;if(z.mode&l1){var t=h7;h7=t||j1,X6(Q,z),h7=t}else X6(Q,z);if(w6(z),J&c8){var{stateNode:O0,memoizedState:e}=z,T0=e!==null,i0=z;if(O0.isHidden=T0,T0){if(!j1){if((i0.mode&l1)!==K1){s0=i0;var d0=i0.child;while(d0!==null)s0=d0,dF(d0),d0=d0.sibling}}}VF(i0,T0)}return}case d:{if(X6(Q,z),w6(z),J&r1)WW(z);return}case D:return;default:{X6(Q,z),w6(z);return}}}function w6(z){var Q=z.flags;if(Q&Z7){try{gF(z)}catch(X){T4(z,z.return,X)}z.flags&=~Z7}if(Q&h6)z.flags&=~h6}function pF(z,Q,X){wQ=X,FQ=Q,s0=z,KW(z,Q,X),wQ=null,FQ=null}function KW(z,Q,X){var Z=(z.mode&l1)!==K1;while(s0!==null){var J=s0,$=J.child;if(J.tag===Q0&&Z){var H=J.memoizedState!==null,B=H||cY;if(B){t9(z,Q,X);continue}else{var W=J.alternate,w=W!==null&&W.memoizedState!==null,k=w||h7,l=cY,c=h7;if(cY=B,h7=k,h7&&!c)s0=J,cF(J);var Z0=$;while(Z0!==null)s0=Z0,KW(Z0,Q,X),Z0=Z0.sibling;s0=J,cY=l,h7=c,t9(z,Q,X);continue}}if((J.subtreeFlags&UX)!==N1&&$!==null)$.return=J,s0=$;else t9(z,Q,X)}}function t9(z,Q,X){while(s0!==null){var Z=s0;if((Z.flags&UX)!==N1){var J=Z.alternate;p4(Z);try{hF(Q,J,Z,X)}catch(H){T4(Z,Z.return,H)}w7()}if(Z===z){s0=null;return}var $=Z.sibling;if($!==null){$.return=Z.return,s0=$;return}s0=Z.return}}function dF(z){while(s0!==null){var Q=s0,X=Q.child;switch(Q.tag){case K:case v:case E:case j:{if(Q.mode&O4)try{M6(),z6(G7,Q,Q.return)}finally{N6(Q)}else z6(G7,Q,Q.return);break}case O:{bQ(Q,Q.return);var Z=Q.stateNode;if(typeof Z.componentWillUnmount==="function")n9(Q,Q.return,Z);break}case P:{bQ(Q,Q.return);break}case Q0:{var J=Q.memoizedState!==null;if(J){_W(z);continue}break}}if(X!==null)X.return=Q,s0=X;else _W(z)}}function _W(z){while(s0!==null){var Q=s0;if(Q===z){s0=null;return}var X=Q.sibling;if(X!==null){X.return=Q.return,s0=X;return}s0=Q.return}}function cF(z){while(s0!==null){var Q=s0,X=Q.child;if(Q.tag===Q0){var Z=Q.memoizedState!==null;if(Z){LW(z);continue}}if(X!==null)X.return=Q,s0=X;else LW(z)}}function LW(z){while(s0!==null){var Q=s0;p4(Q);try{yF(Q)}catch(Z){T4(Q,Q.return,Z)}if(w7(),Q===z){s0=null;return}var X=Q.sibling;if(X!==null){X.return=Q.return,s0=X;return}s0=Q.return}}function lF(z,Q,X,Z){s0=Q,iF(Q,z,X,Z)}function iF(z,Q,X,Z){while(s0!==null){var J=s0,$=J.child;if((J.subtreeFlags&dz)!==N1&&$!==null)$.return=J,s0=$;else oF(z,Q,X,Z)}}function oF(z,Q,X,Z){while(s0!==null){var J=s0;if((J.flags&c5)!==N1){p4(J);try{aF(Q,J,X,Z)}catch(H){T4(J,J.return,H)}w7()}if(J===z){s0=null;return}var $=J.sibling;if($!==null){$.return=J.return,s0=$;return}s0=J.return}}function aF(z,Q,X,Z){switch(Q.tag){case K:case v:case j:{if(Q.mode&O4){R9();try{T8(v7|H7,Q)}finally{L9(Q)}}else T8(v7|H7,Q);break}}}function nF(z){s0=z,rF()}function rF(){while(s0!==null){var z=s0,Q=z.child;if((s0.flags&p8)!==N1){var X=z.deletions;if(X!==null){for(var Z=0;Z<X.length;Z++){var J=X[Z];s0=J,eF(J,z)}{var $=z.alternate;if($!==null){var H=$.child;if(H!==null){$.child=null;do{var B=H.sibling;H.sibling=null,H=B}while(H!==null)}}}s0=z}}if((z.subtreeFlags&dz)!==N1&&Q!==null)Q.return=z,s0=Q;else sF()}}function sF(){while(s0!==null){var z=s0;if((z.flags&c5)!==N1)p4(z),tF(z),w7();var Q=z.sibling;if(Q!==null){Q.return=z.return,s0=Q;return}s0=z.return}}function tF(z){switch(z.tag){case K:case v:case j:{if(z.mode&O4)R9(),z6(v7|H7,z,z.return),L9(z);else z6(v7|H7,z,z.return);break}}}function eF(z,Q){while(s0!==null){var X=s0;p4(X),Qb(X,Q),w7();var Z=X.child;if(Z!==null)Z.return=X,s0=Z;else zb(z)}}function zb(z){while(s0!==null){var Q=s0,X=Q.sibling,Z=Q.return;if(GW(Q),Q===z){s0=null;return}if(X!==null){X.return=Z,s0=X;return}s0=Z}}function Qb(z,Q){switch(z.tag){case K:case v:case j:{if(z.mode&O4)R9(),z6(v7,z,Q),L9(z);else z6(v7,z,Q);break}}}function Xb(z){switch(z.tag){case K:case v:case j:{try{T8(G7|H7,z)}catch(X){T4(z,z.return,X)}break}case O:{var Q=z.stateNode;try{Q.componentDidMount()}catch(X){T4(z,z.return,X)}break}}}function Zb(z){switch(z.tag){case K:case v:case j:{try{T8(v7|H7,z)}catch(Q){T4(z,z.return,Q)}break}}}function Jb(z){switch(z.tag){case K:case v:case j:{try{z6(G7|H7,z,z.return)}catch(X){T4(z,z.return,X)}break}case O:{var Q=z.stateNode;if(typeof Q.componentWillUnmount==="function")n9(z,z.return,Q);break}}}function Yb(z){switch(z.tag){case K:case v:case j:try{z6(v7|H7,z,z.return)}catch(Q){T4(z,z.return,Q)}}}var $b=0,Hb=1,Gb=2,qb=3,Ub=4;if(typeof Symbol==="function"&&Symbol.for){var LZ=Symbol.for;$b=LZ("selector.component"),Hb=LZ("selector.has_pseudo_class"),Gb=LZ("selector.role"),qb=LZ("selector.test_id"),Ub=LZ("selector.text")}var Bb=[];function Wb(){Bb.forEach(function(z){return z()})}var Ob=Y.ReactCurrentActQueue;function Kb(z){{var Q=typeof IS_REACT_ACT_ENVIRONMENT<"u"?IS_REACT_ACT_ENVIRONMENT:void 0,X=typeof jest<"u";return X&&Q!==!1}}function RW(){{var z=typeof IS_REACT_ACT_ENVIRONMENT<"u"?IS_REACT_ACT_ENVIRONMENT:void 0;if(!z&&Ob.current!==null)q("The current testing environment is not configured to support act(...)");return z}}var _b=Math.ceil,e9=Y.ReactCurrentDispatcher,zH=Y.ReactCurrentOwner,V7=Y.ReactCurrentBatchConfig,Z6=Y.ReactCurrentActQueue,B7=0,NW=1,D7=2,m5=4,l6=0,RZ=1,Wz=2,iY=3,NZ=4,MW=5,QH=6,i1=B7,X5=null,d4=null,W7=b0,F6=b0,XH=R8(b0),O7=l6,MZ=null,ZH=b0,oY=b0,wZ=b0,aY=b0,FZ=null,O5=null,JH=0,wW=500,FW=1/0,Lb=500,i6=null;function bZ(){FW=F7()+Lb}function bW(){return FW}var nY=!1,YH=null,PQ=null,Oz=!1,C8=null,PZ=b0,$H=[],HH=null,Rb=50,AZ=0,GH=null,qH=!1,rY=!1,Nb=50,AQ=0,sY=null,IZ=y4,tY=b0,PW=!1;function eY(){return X5}function Z5(){if((i1&(D7|m5))!==B7)return F7();if(IZ!==y4)return IZ;return IZ=F7(),IZ}function S8(z){var Q=z.mode;if((Q&l1)===K1)return A1;else if((i1&D7)!==B7&&W7!==b0)return RX(W7);var X=qw()!==Gw;if(X){if(V7.transition!==null){var Z=V7.transition;if(!Z._updatedFibers)Z._updatedFibers=new Set;Z._updatedFibers.add(z)}if(tY===P7)tY=Xq();return tY}var J=i5();if(J!==P7)return J;var $=oN();return $}function Mb(z){var Q=z.mode;if((Q&l1)===K1)return A1;return RL()}function K7(z,Q,X,Z){if(db(),PW)q("useInsertionEffect must not schedule updates.");if(qH)rY=!0;if(NX(z,X,Z),(i1&D7)!==b0&&z===X5)ib(Q);else{if(l5)Yq(z,Q,X);if(ob(Q),z===X5){if((i1&D7)===B7)wZ=D1(wZ,X);if(O7===NZ)v8(z,W7)}if(K5(z,Z),X===A1&&i1===B7&&(Q.mode&l1)===K1&&!Z6.isBatchingLegacy)bZ(),bU()}}function wb(z,Q,X){var Z=z.current;Z.lanes=Q,NX(z,Q,X),K5(z,X)}function Fb(z){return(i1&D7)!==B7}function K5(z,Q){var X=z.callbackNode;BL(z,Q);var Z=RJ(z,z===X5?W7:b0);if(Z===b0){if(X!==null)uW(X);z.callbackNode=null,z.callbackPriority=P7;return}var J=s8(Z),$=z.callbackPriority;if($===J&&!(Z6.current!==null&&X!==LH)){if(X==null&&$!==A1)q("Expected scheduled callback to exist. This error is likely caused by a bug in React. Please file an issue.");return}if(X!=null)uW(X);var H;if(J===A1){if(z.tag===N8){if(Z6.isBatchingLegacy!==null)Z6.didScheduleLegacyUpdate=!0;lM(TW.bind(null,z))}else FU(TW.bind(null,z));if(Z6.current!==null)Z6.current.push(M8);else nN(function(){if((i1&(D7|m5))===B7)M8()});H=null}else{var B;switch(Gq(Z)){case b5:B=OJ;break;case m6:B=Z3;break;case g6:B=o8;break;case FJ:B=J3;break;default:B=o8;break}H=RH(B,AW.bind(null,z))}z.callbackPriority=J,z.callbackNode=H}function AW(z,Q){if(Vw(),IZ=y4,tY=b0,(i1&(D7|m5))!==B7)throw Error("Should not already be working.");var X=z.callbackNode,Z=a6();if(Z){if(z.callbackNode!==X)return null}var J=RJ(z,z===X5?W7:b0);if(J===b0)return null;var $=!NJ(z,J)&&!LL(z,J)&&!Q,H=$?fb(z,J):Q2(z,J);if(H!==l6){if(H===Wz){var B=T3(z);if(B!==b0)J=B,H=UH(z,B)}if(H===RZ){var W=MZ;throw Kz(z,b0),v8(z,J),K5(z,F7()),W}if(H===QH)v8(z,J);else{var w=!NJ(z,J),k=z.current.alternate;if(w&&!Pb(k)){if(H=Q2(z,J),H===Wz){var l=T3(z);if(l!==b0)J=l,H=UH(z,l)}if(H===RZ){var c=MZ;throw Kz(z,b0),v8(z,J),K5(z,F7()),c}}z.finishedWork=k,z.finishedLanes=J,bb(z,H,J)}}if(K5(z,F7()),z.callbackNode===X)return AW.bind(null,z);return null}function UH(z,Q){var X=FZ;if(bJ(z)){var Z=Kz(z,Q);Z.flags|=f6,EM(z.containerInfo)}var J=Q2(z,Q);if(J!==Wz){var $=O5;if(O5=X,$!==null)IW($)}return J}function IW(z){if(O5===null)O5=z;else O5.push.apply(O5,z)}function bb(z,Q,X){switch(Q){case l6:case RZ:throw Error("Root did not complete. This is a bug in React.");case Wz:{_z(z,O5,i6);break}case iY:{if(v8(z,X),zq(X)&&!xW()){var Z=JH+wW-F7();if(Z>10){var J=RJ(z,b0);if(J!==b0)break;var $=z.suspendedLanes;if(!az($,X)){var H=Z5();Jq(z,$);break}z.timeoutHandle=$$(_z.bind(null,z,O5,i6),Z);break}}_z(z,O5,i6);break}case NZ:{if(v8(z,X),_L(X))break;if(!xW()){var B=qL(z,X),W=B,w=F7()-W,k=pb(w)-w;if(k>10){z.timeoutHandle=$$(_z.bind(null,z,O5,i6),k);break}}_z(z,O5,i6);break}case MW:{_z(z,O5,i6);break}default:throw Error("Unknown root exit status.")}}function Pb(z){var Q=z;while(!0){if(Q.flags&BJ){var X=Q.updateQueue;if(X!==null){var Z=X.stores;if(Z!==null)for(var J=0;J<Z.length;J++){var $=Z[J],H=$.getSnapshot,B=$.value;try{if(!A5(H(),B))return!1}catch(w){return!1}}}}var W=Q.child;if(Q.subtreeFlags&BJ&&W!==null){W.return=Q,Q=W;continue}if(Q===z)return!0;while(Q.sibling===null){if(Q.return===null||Q.return===z)return!0;Q=Q.return}Q.sibling.return=Q.return,Q=Q.sibling}return!0}function v8(z,Q){Q=MJ(Q,aY),Q=MJ(Q,wZ),ML(z,Q)}function TW(z){if(Dw(),(i1&(D7|m5))!==B7)throw Error("Should not already be working.");a6();var Q=RJ(z,b0);if(!F5(Q,A1))return K5(z,F7()),null;var X=Q2(z,Q);if(z.tag!==N8&&X===Wz){var Z=T3(z);if(Z!==b0)Q=Z,X=UH(z,Z)}if(X===RZ){var J=MZ;throw Kz(z,b0),v8(z,Q),K5(z,F7()),J}if(X===QH)throw Error("Root did not complete. This is a bug in React.");var $=z.current.alternate;return z.finishedWork=$,z.finishedLanes=Q,_z(z,O5,i6),K5(z,F7()),null}function Ab(z,Q){if(Q!==b0){if(v3(z,D1(Q,A1)),K5(z,F7()),(i1&(D7|m5))===B7)bZ(),M8()}}function BH(z,Q){var X=i1;i1|=NW;try{return z(Q)}finally{if(i1=X,i1===B7&&!Z6.isBatchingLegacy)bZ(),bU()}}function Ib(z,Q,X,Z,J){var $=i5(),H=V7.transition;try{return V7.transition=null,A7(b5),z(Q,X,Z,J)}finally{if(A7($),V7.transition=H,i1===B7)bZ()}}function o6(z){if(C8!==null&&C8.tag===N8&&(i1&(D7|m5))===B7)a6();var Q=i1;i1|=NW;var X=V7.transition,Z=i5();try{if(V7.transition=null,A7(b5),z)return z();else return}finally{if(A7(Z),V7.transition=X,i1=Q,(i1&(D7|m5))===B7)M8()}}function kW(){return(i1&(D7|m5))!==B7}function z2(z,Q){d7(XH,F6,z),F6=D1(F6,Q),ZH=D1(ZH,Q)}function WH(z){F6=XH.current,p7(XH,z)}function Kz(z,Q){z.finishedWork=null,z.finishedLanes=b0;var X=z.timeoutHandle;if(X!==H$)z.timeoutHandle=H$,aN(X);if(d4!==null){var Z=d4.return;while(Z!==null){var J=Z.alternate;QW(J,Z),Z=Z.return}}X5=z;var $=Lz(z.current,null);return d4=$,W7=F6=ZH=Q,O7=l6,MZ=null,oY=b0,wZ=b0,aY=b0,FZ=null,O5=null,Lw(),n5.discardPendingWarnings(),$}function CW(z,Q){do{var X=d4;try{if(GY(),sU(),w7(),zH.current=null,X===null||X.return===null){O7=RZ,MZ=Q,d4=null;return}if(v0&&X.mode&O4)uY(X,!0);if(z0)if(cz(),Q!==null&&typeof Q==="object"&&typeof Q.then==="function"){var Z=Q;s_(X,Z,W7)}else r_(X,Q,W7);cw(z,X.return,X,Q,W7),hW(X)}catch(J){if(Q=J,d4===X&&X!==null)X=X.return,d4=X;else X=d4;continue}return}while(!0)}function SW(){var z=e9.current;if(e9.current=VY,z===null)return VY;else return z}function vW(z){e9.current=z}function Tb(){JH=F7()}function TZ(z){oY=D1(z,oY)}function kb(){if(O7===l6)O7=iY}function OH(){if(O7===l6||O7===iY||O7===Wz)O7=NZ;if(X5!==null&&(k3(oY)||k3(wZ)))v8(X5,W7)}function Cb(z){if(O7!==NZ)O7=Wz;if(FZ===null)FZ=[z];else FZ.push(z)}function Sb(){return O7===l6}function Q2(z,Q){var X=i1;i1|=D7;var Z=SW();if(X5!==z||W7!==Q){if(l5){var J=z.memoizedUpdaters;if(J.size>0)kZ(z,W7),J.clear();$q(z,Q)}i6=Hq(),Kz(z,Q)}nG(Q);do try{vb();break}catch($){CW(z,$)}while(!0);if(GY(),i1=X,vW(Z),d4!==null)throw Error("Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue.");return rG(),X5=null,W7=b0,O7}function vb(){while(d4!==null)fW(d4)}function fb(z,Q){var X=i1;i1|=D7;var Z=SW();if(X5!==z||W7!==Q){if(l5){var J=z.memoizedUpdaters;if(J.size>0)kZ(z,W7),J.clear();$q(z,Q)}i6=Hq(),bZ(),Kz(z,Q)}nG(Q);do try{hb();break}catch($){CW(z,$)}while(!0);if(GY(),vW(Z),i1=X,d4!==null)return XL(),l6;else return rG(),X5=null,W7=b0,O7}function hb(){while(d4!==null&&!v_())fW(d4)}function fW(z){var Q=z.alternate;p4(z);var X;if((z.mode&O4)!==K1)_9(z),X=KH(Q,z,F6),uY(z,!0);else X=KH(Q,z,F6);if(w7(),z.memoizedProps=z.pendingProps,X===null)hW(z);else d4=X;zH.current=null}function hW(z){var Q=z;do{var{alternate:X,return:Z}=Q;if((Q.flags&qX)===N1){p4(Q);var J=void 0;if((Q.mode&O4)===K1)J=zW(X,Q,F6);else _9(Q),J=zW(X,Q,F6),uY(Q,!1);if(w7(),J!==null){d4=J;return}}else{var $=bF(X,Q);if($!==null){$.flags&=A_,d4=$;return}if((Q.mode&O4)!==K1){uY(Q,!1);var{actualDuration:H,child:B}=Q;while(B!==null)H+=B.actualDuration,B=B.sibling;Q.actualDuration=H}if(Z!==null)Z.flags|=qX,Z.subtreeFlags=N1,Z.deletions=null;else{O7=QH,d4=null;return}}var W=Q.sibling;if(W!==null){d4=W;return}Q=Z,d4=Q}while(Q!==null);if(O7===l6)O7=MW}function _z(z,Q,X){var Z=i5(),J=V7.transition;try{V7.transition=null,A7(b5),yb(z,Q,X,Z)}finally{V7.transition=J,A7(Z)}return null}function yb(z,Q,X,Z){do a6();while(C8!==null);if(cb(),(i1&(D7|m5))!==B7)throw Error("Should not already be working.");var{finishedWork:J,finishedLanes:$}=z;if(d_($),J===null)return iG(),null;else if($===b0)q("root.finishedLanes should not be empty during a commit. This is a bug in React.");if(z.finishedWork=null,z.finishedLanes=b0,J===z.current)throw Error("Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue.");z.callbackNode=null,z.callbackPriority=P7;var H=D1(J.lanes,J.childLanes);if(wL(z,H),z===X5)X5=null,d4=null,W7=b0;if((J.subtreeFlags&dz)!==N1||(J.flags&dz)!==N1){if(!Oz)Oz=!0,HH=X,RH(o8,function(){return a6(),null})}var B=(J.subtreeFlags&(Q3|X3|UX|dz))!==N1,W=(J.flags&(Q3|X3|UX|dz))!==N1;if(B||W){var w=V7.transition;V7.transition=null;var k=i5();A7(b5);var l=i1;i1|=m5,zH.current=null;var c=kF(z,J);bB(),jF(z,J,$),jN(z.containerInfo),z.current=J,t_($),pF(J,z,$),e_(),f_(),i1=l,A7(k),V7.transition=w}else z.current=J,bB();var Z0=Oz;if(Oz)Oz=!1,C8=z,PZ=$;else AQ=0,sY=null;if(H=z.pendingLanes,H===b0)PQ=null;if(!Z0)mW(z.current,!1);if(E_(J.stateNode,Z),l5)z.memoizedUpdaters.clear();if(Wb(),K5(z,F7()),Q!==null){var J0=z.onRecoverableError;for(var $0=0;$0<Q.length;$0++){var j0=Q[$0],q1=j0.stack,X1=j0.digest;J0(j0.value,{componentStack:q1,digest:X1})}}if(nY){nY=!1;var x1=YH;throw YH=null,x1}if(F5(PZ,A1)&&z.tag!==N8)a6();if(H=z.pendingLanes,F5(H,A1))if(yw(),z===GH)AZ++;else AZ=0,GH=z;else AZ=0;return M8(),iG(),null}function a6(){if(C8!==null){var z=Gq(PZ),Q=AL(g6,z),X=V7.transition,Z=i5();try{return V7.transition=null,A7(Q),Db()}finally{A7(Z),V7.transition=X}}return!1}function Vb(z){if($H.push(z),!Oz)Oz=!0,RH(o8,function(){return a6(),null})}function Db(){if(C8===null)return!1;var z=HH;HH=null;var Q=C8,X=PZ;if(C8=null,PZ=b0,(i1&(D7|m5))!==B7)throw Error("Cannot flush passive effects while already rendering.");qH=!0,rY=!1,zL(X);var Z=i1;i1|=m5,nF(Q.current),lF(Q,Q.current,X,z);{var J=$H;$H=[];for(var $=0;$<J.length;$++){var H=J[$];fF(Q,H)}}QL(),mW(Q.current,!0),i1=Z,M8();{if(rY)if(Q===sY)AQ++;else AQ=0,sY=Q;else AQ=0;qH=!1,rY=!1}u_(Q);{var B=Q.current.stateNode;B.effectDuration=0,B.passiveEffectDuration=0}return!0}function yW(z){return PQ!==null&&PQ.has(z)}function mb(z){if(PQ===null)PQ=new Set([z]);else PQ.add(z)}function gb(z){if(!nY)nY=!0,YH=z}var Eb=gb;function VW(z,Q,X){var Z=Uz(X,Q),J=vB(z,Z,A1),$=F8(z,J,A1),H=Z5();if($!==null)NX($,A1,H),K5($,H)}function T4(z,Q,X){if(AF(X),CZ(!1),z.tag===I){VW(z,z,X);return}var Z=null;Z=Q;while(Z!==null){if(Z.tag===I){VW(Z,z,X);return}else if(Z.tag===O){var{type:J,stateNode:$}=Z;if(typeof J.getDerivedStateFromError==="function"||typeof $.componentDidCatch==="function"&&!yW($)){var H=Uz(X,z),B=y9(Z,H,A1),W=F8(Z,B,A1),w=Z5();if(W!==null)NX(W,A1,w),K5(W,w);return}}Z=Z.return}q(`Internal React error: Attempted to capture a commit phase error inside a detached tree. This indicates a bug in React. Likely causes include deleting the same fiber more than once, committing an already-finished tree, or an inconsistent return pointer.
|
|
116
|
+
|
|
117
|
+
Error message:
|
|
118
|
+
|
|
119
|
+
%s`,X)}function ub(z,Q,X){var Z=z.pingCache;if(Z!==null)Z.delete(Q);var J=Z5();if(Jq(z,X),ab(z),X5===z&&az(W7,X))if(O7===NZ||O7===iY&&zq(W7)&&F7()-JH<wW)Kz(z,b0);else aY=D1(aY,X);K5(z,J)}function DW(z,Q){if(Q===P7)Q=Mb(z);var X=Z5(),Z=B5(z,Q);if(Z!==null)NX(Z,Q,X),K5(Z,X)}function xb(z){var Q=z.memoizedState,X=P7;if(Q!==null)X=Q.retryLane;DW(z,X)}function jb(z,Q){var X=P7,Z;switch(z.tag){case A:Z=z.stateNode;var J=z.memoizedState;if(J!==null)X=J.retryLane;break;case d:Z=z.stateNode;break;default:throw Error("Pinged unknown suspense boundary type. This is probably a bug in React.")}if(Z!==null)Z.delete(Q);DW(z,X)}function pb(z){return z<120?120:z<480?480:z<1080?1080:z<1920?1920:z<3000?3000:z<4320?4320:_b(z/1960)*1960}function db(){if(AZ>Rb)throw AZ=0,GH=null,Error("Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.");if(AQ>Nb)AQ=0,sY=null,q("Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render.")}function cb(){n5.flushLegacyContextWarning(),n5.flushPendingUnsafeLifecycleWarnings()}function mW(z,Q){{if(p4(z),X2(z,y6,Jb),Q)X2(z,WJ,Yb);if(X2(z,y6,Xb),Q)X2(z,WJ,Zb);w7()}}function X2(z,Q,X){{var Z=z,J=null;while(Z!==null){var $=Z.subtreeFlags&Q;if(Z!==J&&Z.child!==null&&$!==N1)Z=Z.child;else{if((Z.flags&Q)!==N1)X(Z);if(Z.sibling!==null)Z=Z.sibling;else Z=J=Z.return}}}}var Z2=null;function gW(z){{if((i1&D7)!==B7)return;if(!(z.mode&l1))return;var Q=z.tag;if(Q!==T&&Q!==I&&Q!==O&&Q!==K&&Q!==v&&Q!==E&&Q!==j)return;var X=y1(z)||"ReactComponent";if(Z2!==null){if(Z2.has(X))return;Z2.add(X)}else Z2=new Set([X]);var Z=j7;try{p4(z),q("Can't perform a React state update on a component that hasn't mounted yet. This indicates that you have a side-effect in your render function that asynchronously later calls tries to update the component. Move this work to useEffect instead.")}finally{if(Z)p4(z);else w7()}}}var KH;{var lb=null;KH=function(z,Q,X){var Z=lW(lb,Q);try{return nB(z,Q,X)}catch($){if(eM()||$!==null&&typeof $==="object"&&typeof $.then==="function")throw $;if(GY(),sU(),QW(z,Q),lW(Q,Z),Q.mode&O4)_9(Q);if(n2(null,nB,null,z,Q,X),w_()){var J=r2();if(typeof J==="object"&&J!==null&&J._suppressLogging&&typeof $==="object"&&$!==null&&!$._suppressLogging)$._suppressLogging=!0}throw $}}}var EW=!1,_H;_H=new Set;function ib(z){if(E8&&!vw())switch(z.tag){case K:case v:case j:{var Q=d4&&y1(d4)||"Unknown",X=Q;if(!_H.has(X)){_H.add(X);var Z=y1(z)||"Unknown";q("Cannot update a component (`%s`) while rendering a different component (`%s`). To locate the bad setState() call inside `%s`, follow the stack trace as described in https://reactjs.org/link/setstate-in-render",Z,Q,Q)}break}case O:{if(!EW)q("Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state."),EW=!0;break}}}function kZ(z,Q){if(l5){var X=z.memoizedUpdaters;X.forEach(function(Z){Yq(z,Z,Q)})}}var LH={};function RH(z,Q){{var X=Z6.current;if(X!==null)return X.push(Q),LH;else return lG(z,Q)}}function uW(z){if(z===LH)return;return S_(z)}function xW(){return Z6.current!==null}function ob(z){{if(z.mode&l1){if(!RW())return}else{if(!Kb())return;if(i1!==B7)return;if(z.tag!==K&&z.tag!==v&&z.tag!==j)return}if(Z6.current===null){var Q=j7;try{p4(z),q(`An update to %s inside a test was not wrapped in act(...).
|
|
120
|
+
|
|
121
|
+
When testing, code that causes React state updates should be wrapped into act(...):
|
|
122
|
+
|
|
123
|
+
act(() => {
|
|
124
|
+
/* fire events that update state */
|
|
125
|
+
});
|
|
126
|
+
/* assert on the output */
|
|
127
|
+
|
|
128
|
+
This ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act`,y1(z))}finally{if(Q)p4(z);else w7()}}}}function ab(z){if(z.tag!==N8&&RW()&&Z6.current===null)q(`A suspended resource finished loading inside a test, but the event was not wrapped in act(...).
|
|
129
|
+
|
|
130
|
+
When testing, code that resolves suspended data should be wrapped into act(...):
|
|
131
|
+
|
|
132
|
+
act(() => {
|
|
133
|
+
/* finish loading suspended data */
|
|
134
|
+
});
|
|
135
|
+
/* assert on the output */
|
|
136
|
+
|
|
137
|
+
This ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act`)}function CZ(z){PW=z}var g5=null,IQ=null,nb=function(z){g5=z};function TQ(z){{if(g5===null)return z;var Q=g5(z);if(Q===void 0)return z;return Q.current}}function NH(z){return TQ(z)}function MH(z){{if(g5===null)return z;var Q=g5(z);if(Q===void 0){if(z!==null&&z!==void 0&&typeof z.render==="function"){var X=TQ(z.render);if(z.render!==X){var Z={$$typeof:o,render:X};if(z.displayName!==void 0)Z.displayName=z.displayName;return Z}}return z}return Q.current}}function jW(z,Q){{if(g5===null)return!1;var X=z.elementType,Z=Q.type,J=!1,$=typeof Z==="object"&&Z!==null?Z.$$typeof:null;switch(z.tag){case O:{if(typeof Z==="function")J=!0;break}case K:{if(typeof Z==="function")J=!0;else if($===Q1)J=!0;break}case v:{if($===o)J=!0;else if($===Q1)J=!0;break}case E:case j:{if($===u0)J=!0;else if($===Q1)J=!0;break}default:return!1}if(J){var H=g5(X);if(H!==void 0&&H===g5(Z))return!0}return!1}}function pW(z){{if(g5===null)return;if(typeof WeakSet!=="function")return;if(IQ===null)IQ=new WeakSet;IQ.add(z)}}var rb=function(z,Q){{if(g5===null)return;var{staleFamilies:X,updatedFamilies:Z}=Q;a6(),o6(function(){wH(z.current,Z,X)})}},sb=function(z,Q){{if(z.context!==I5)return;a6(),o6(function(){SZ(Q,z,null,null)})}};function wH(z,Q,X){{var{alternate:Z,child:J,sibling:$,tag:H,type:B}=z,W=null;switch(H){case K:case j:case O:W=B;break;case v:W=B.render;break}if(g5===null)throw Error("Expected resolveFamily to be set during hot reload.");var w=!1,k=!1;if(W!==null){var l=g5(W);if(l!==void 0){if(X.has(l))k=!0;else if(Q.has(l))if(H===O)k=!0;else w=!0}}if(IQ!==null){if(IQ.has(z)||Z!==null&&IQ.has(Z))k=!0}if(k)z._debugNeedsRemount=!0;if(k||w){var c=B5(z,A1);if(c!==null)K7(c,z,A1,y4)}if(J!==null&&!k)wH(J,Q,X);if($!==null)wH($,Q,X)}}var tb=function(z,Q){{var X=new Set,Z=new Set(Q.map(function(J){return J.current}));return FH(z.current,Z,X),X}};function FH(z,Q,X){{var{child:Z,sibling:J,tag:$,type:H}=z,B=null;switch($){case K:case j:case O:B=H;break;case v:B=H.render;break}var W=!1;if(B!==null){if(Q.has(B))W=!0}if(W)eb(z,X);else if(Z!==null)FH(Z,Q,X);if(J!==null)FH(J,Q,X)}}function eb(z,Q){{var X=zP(z,Q);if(X)return;var Z=z;while(!0){switch(Z.tag){case P:Q.add(Z.stateNode);return;case b:Q.add(Z.stateNode.containerInfo);return;case I:Q.add(Z.stateNode.containerInfo);return}if(Z.return===null)throw Error("Expected to reach root first.");Z=Z.return}}}function zP(z,Q){{var X=z,Z=!1;while(!0){if(X.tag===P)Z=!0,Q.add(X.stateNode);else if(X.child!==null){X.child.return=X,X=X.child;continue}if(X===z)return Z;while(X.sibling===null){if(X.return===null||X.return===z)return Z;X=X.return}X.sibling.return=X.return,X=X.sibling}}return!1}var bH;{bH=!1;try{var dW=Object.preventExtensions({})}catch(z){bH=!0}}function QP(z,Q,X,Z){if(this.tag=z,this.key=X,this.elementType=null,this.type=null,this.stateNode=null,this.return=null,this.child=null,this.sibling=null,this.index=0,this.ref=null,this.pendingProps=Q,this.memoizedProps=null,this.updateQueue=null,this.memoizedState=null,this.dependencies=null,this.mode=Z,this.flags=N1,this.subtreeFlags=N1,this.deletions=null,this.lanes=b0,this.childLanes=b0,this.alternate=null,this.actualDuration=Number.NaN,this.actualStartTime=Number.NaN,this.selfBaseDuration=Number.NaN,this.treeBaseDuration=Number.NaN,this.actualDuration=0,this.actualStartTime=-1,this.selfBaseDuration=0,this.treeBaseDuration=0,this._debugSource=null,this._debugOwner=null,this._debugNeedsRemount=!1,this._debugHookTypes=null,!bH&&typeof Object.preventExtensions==="function")Object.preventExtensions(this)}var T5=function(z,Q,X,Z){return new QP(z,Q,X,Z)};function PH(z){var Q=z.prototype;return!!(Q&&Q.isReactComponent)}function XP(z){return typeof z==="function"&&!PH(z)&&z.defaultProps===void 0}function ZP(z){if(typeof z==="function")return PH(z)?O:K;else if(z!==void 0&&z!==null){var Q=z.$$typeof;if(Q===o)return v;if(Q===u0)return E}return T}function Lz(z,Q){var X=z.alternate;if(X===null)X=T5(z.tag,Q,z.key,z.mode),X.elementType=z.elementType,X.type=z.type,X.stateNode=z.stateNode,X._debugSource=z._debugSource,X._debugOwner=z._debugOwner,X._debugHookTypes=z._debugHookTypes,X.alternate=z,z.alternate=X;else X.pendingProps=Q,X.type=z.type,X.flags=N1,X.subtreeFlags=N1,X.deletions=null,X.actualDuration=0,X.actualStartTime=-1;X.flags=z.flags&V6,X.childLanes=z.childLanes,X.lanes=z.lanes,X.child=z.child,X.memoizedProps=z.memoizedProps,X.memoizedState=z.memoizedState,X.updateQueue=z.updateQueue;var Z=z.dependencies;switch(X.dependencies=Z===null?null:{lanes:Z.lanes,firstContext:Z.firstContext},X.sibling=z.sibling,X.index=z.index,X.ref=z.ref,X.selfBaseDuration=z.selfBaseDuration,X.treeBaseDuration=z.treeBaseDuration,X._debugNeedsRemount=z._debugNeedsRemount,X.tag){case T:case K:case j:X.type=TQ(z.type);break;case O:X.type=NH(z.type);break;case v:X.type=MH(z.type);break}return X}function JP(z,Q){z.flags&=V6|Z7;var X=z.alternate;if(X===null)z.childLanes=b0,z.lanes=Q,z.child=null,z.subtreeFlags=N1,z.memoizedProps=null,z.memoizedState=null,z.updateQueue=null,z.dependencies=null,z.stateNode=null,z.selfBaseDuration=0,z.treeBaseDuration=0;else{z.childLanes=X.childLanes,z.lanes=X.lanes,z.child=X.child,z.subtreeFlags=N1,z.deletions=null,z.memoizedProps=X.memoizedProps,z.memoizedState=X.memoizedState,z.updateQueue=X.updateQueue,z.type=X.type;var Z=X.dependencies;z.dependencies=Z===null?null:{lanes:Z.lanes,firstContext:Z.firstContext},z.selfBaseDuration=X.selfBaseDuration,z.treeBaseDuration=X.treeBaseDuration}return z}function YP(z,Q,X){var Z;if(z===tJ){if(Z=l1,Q===!0)Z|=o4,Z|=B6}else Z=K1;if(l5)Z|=O4;return T5(I,null,null,Z)}function AH(z,Q,X,Z,J,$){var H=T,B=z;if(typeof z==="function")if(PH(z))H=O,B=NH(B);else B=TQ(B);else if(typeof z==="string")H=P;else z:switch(z){case t1:return f8(X.children,J,$,Q);case y:if(H=f,J|=o4,(J&l1)!==K1)J|=B6;break;case W0:return $P(X,J,$,Q);case L0:return HP(X,J,$,Q);case k0:return GP(X,J,$,Q);case D0:return cW(X,J,$,Q);case J1:case a0:case d1:case B4:case R0:default:{if(typeof z==="object"&&z!==null)switch(z.$$typeof){case w0:H=x;break z;case C:H=V;break z;case o:H=v,B=MH(B);break z;case u0:H=E;break z;case Q1:H=u,B=null;break z}var W="";{if(z===void 0||typeof z==="object"&&z!==null&&Object.keys(z).length===0)W+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";var w=Z?y1(Z):null;if(w)W+=`
|
|
138
|
+
|
|
139
|
+
Check the render method of \``+w+"`."}throw Error("Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) "+("but got: "+(z==null?z:typeof z)+"."+W))}}var k=T5(H,X,Q,J);return k.elementType=z,k.type=B,k.lanes=$,k._debugOwner=Z,k}function IH(z,Q,X){var Z=null;Z=z._owner;var{type:J,key:$,props:H}=z,B=AH(J,$,H,Z,Q,X);return B._debugSource=z._source,B._debugOwner=z._owner,B}function f8(z,Q,X,Z){var J=T5(S,z,Z,Q);return J.lanes=X,J}function $P(z,Q,X,Z){if(typeof z.id!=="string")q('Profiler must specify an "id" of type `string` as a prop. Received the type `%s` instead.',typeof z.id);var J=T5(p,z,Z,Q|O4);return J.elementType=W0,J.lanes=X,J.stateNode={effectDuration:0,passiveEffectDuration:0},J}function HP(z,Q,X,Z){var J=T5(A,z,Z,Q);return J.elementType=L0,J.lanes=X,J}function GP(z,Q,X,Z){var J=T5(d,z,Z,Q);return J.elementType=k0,J.lanes=X,J}function cW(z,Q,X,Z){var J=T5(Q0,z,Z,Q);J.elementType=D0,J.lanes=X;var $={isHidden:!1};return J.stateNode=$,J}function TH(z,Q,X){var Z=T5(N,z,null,Q);return Z.lanes=X,Z}function qP(){var z=T5(P,null,null,K1);return z.elementType="DELETED",z}function UP(z){var Q=T5(i,null,null,K1);return Q.stateNode=z,Q}function kH(z,Q,X){var Z=z.children!==null?z.children:[],J=T5(b,Z,z.key,Q);return J.lanes=X,J.stateNode={containerInfo:z.containerInfo,pendingChildren:null,implementation:z.implementation},J}function lW(z,Q){if(z===null)z=T5(T,null,null,K1);return z.tag=Q.tag,z.key=Q.key,z.elementType=Q.elementType,z.type=Q.type,z.stateNode=Q.stateNode,z.return=Q.return,z.child=Q.child,z.sibling=Q.sibling,z.index=Q.index,z.ref=Q.ref,z.pendingProps=Q.pendingProps,z.memoizedProps=Q.memoizedProps,z.updateQueue=Q.updateQueue,z.memoizedState=Q.memoizedState,z.dependencies=Q.dependencies,z.mode=Q.mode,z.flags=Q.flags,z.subtreeFlags=Q.subtreeFlags,z.deletions=Q.deletions,z.lanes=Q.lanes,z.childLanes=Q.childLanes,z.alternate=Q.alternate,z.actualDuration=Q.actualDuration,z.actualStartTime=Q.actualStartTime,z.selfBaseDuration=Q.selfBaseDuration,z.treeBaseDuration=Q.treeBaseDuration,z._debugSource=Q._debugSource,z._debugOwner=Q._debugOwner,z._debugNeedsRemount=Q._debugNeedsRemount,z._debugHookTypes=Q._debugHookTypes,z}function BP(z,Q,X,Z,J){this.tag=Q,this.containerInfo=z,this.pendingChildren=null,this.current=null,this.pingCache=null,this.finishedWork=null,this.timeoutHandle=H$,this.context=null,this.pendingContext=null,this.callbackNode=null,this.callbackPriority=P7,this.eventTimes=S3(b0),this.expirationTimes=S3(y4),this.pendingLanes=b0,this.suspendedLanes=b0,this.pingedLanes=b0,this.expiredLanes=b0,this.mutableReadLanes=b0,this.finishedLanes=b0,this.entangledLanes=b0,this.entanglements=S3(b0),this.identifierPrefix=Z,this.onRecoverableError=J,this.mutableSourceEagerHydrationData=null,this.effectDuration=0,this.passiveEffectDuration=0;{this.memoizedUpdaters=new Set;var $=this.pendingUpdatersLaneMap=[];for(var H=0;H<$3;H++)$.push(new Set)}switch(Q){case tJ:this._debugRootType=X?"hydrateRoot()":"createRoot()";break;case N8:this._debugRootType=X?"hydrate()":"render()";break}}function iW(z,Q,X,Z,J,$,H,B,W,w){var k=new BP(z,Q,X,B,W),l=YP(Q,$);k.current=l,l.stateNode=k;{var c={element:Z,isDehydrated:X,cache:null,transitions:null,pendingSuspenseBoundaries:null};l.memoizedState=c}return E$(l),k}var CH="18.3.1";function WP(z,Q,X){var Z=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;return Z1(Z),{$$typeof:F4,key:Z==null?null:""+Z,children:z,containerInfo:Q,implementation:X}}var SH,vH;SH=!1,vH={};function oW(z){if(!z)return I5;var Q=jz(z),X=cM(Q);if(Q.tag===O){var Z=Q.type;if(K6(Z))return MU(Q,Z,X)}return X}function OP(z,Q){{var X=jz(z);if(X===void 0)if(typeof z.render==="function")throw Error("Unable to find node on an unmounted component.");else{var Z=Object.keys(z).join(",");throw Error("Argument appears to not be a ReactComponent. Keys: "+Z)}var J=pG(X);if(J===null)return null;if(J.mode&o4){var $=y1(X)||"Component";if(!vH[$]){vH[$]=!0;var H=j7;try{if(p4(J),X.mode&o4)q("%s is deprecated in StrictMode. %s was passed an instance of %s which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node",Q,Q,$);else q("%s is deprecated in StrictMode. %s was passed an instance of %s which renders StrictMode children. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node",Q,Q,$)}finally{if(H)p4(H);else w7()}}}return J.stateNode}}function aW(z,Q,X,Z,J,$,H,B){var W=!1,w=null;return iW(z,Q,W,w,X,Z,J,$,H)}function nW(z,Q,X,Z,J,$,H,B,W,w){var k=!0,l=iW(X,Z,k,z,J,$,H,B,W);l.context=oW(null);var c=l.current,Z0=Z5(),J0=S8(c),$0=d6(Z0,J0);return $0.callback=Q!==void 0&&Q!==null?Q:null,F8(c,$0,J0),wb(l,J0,Z0),l}function SZ(z,Q,X,Z){g_(Q,z);var J=Q.current,$=Z5(),H=S8(J);ZL(H);var B=oW(X);if(Q.context===null)Q.context=B;else Q.pendingContext=B;if(E8&&j7!==null&&!SH)SH=!0,q(`Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate.
|
|
140
|
+
|
|
141
|
+
Check the render method of %s.`,y1(j7)||"Unknown");var W=d6($,H);if(W.payload={element:z},Z=Z===void 0?null:Z,Z!==null){if(typeof Z!=="function")q("render(...): Expected the last optional `callback` argument to be a function. Instead received: %s.",Z);W.callback=Z}var w=F8(J,W,H);if(w!==null)K7(w,J,H,$),OY(w,J,H);return H}function J2(z){var Q=z.current;if(!Q.child)return null;switch(Q.child.tag){case P:return J$(Q.child.stateNode);default:return Q.child.stateNode}}function KP(z){switch(z.tag){case I:{var Q=z.stateNode;if(bJ(Q)){var X=WL(Q);Ab(Q,X)}break}case A:{o6(function(){var J=B5(z,A1);if(J!==null){var $=Z5();K7(J,z,A1,$)}});var Z=A1;fH(z,Z);break}}}function rW(z,Q){var X=z.memoizedState;if(X!==null&&X.dehydrated!==null)X.retryLane=NL(X.retryLane,Q)}function fH(z,Q){rW(z,Q);var X=z.alternate;if(X)rW(X,Q)}function _P(z){if(z.tag!==A)return;var Q=KX,X=B5(z,Q);if(X!==null){var Z=Z5();K7(X,z,Q,Z)}fH(z,Q)}function LP(z){if(z.tag!==A)return;var Q=S8(z),X=B5(z,Q);if(X!==null){var Z=Z5();K7(X,z,Q,Z)}fH(z,Q)}function sW(z){var Q=C_(z);if(Q===null)return null;return Q.stateNode}var tW=function(z){return null};function RP(z){return tW(z)}var eW=function(z){return!1};function NP(z){return eW(z)}var zO=null,QO=null,XO=null,ZO=null,JO=null,YO=null,$O=null,HO=null,GO=null;{var qO=function(z,Q,X){var Z=Q[X],J=Q4(z)?z.slice():g1({},z);if(X+1===Q.length){if(Q4(J))J.splice(Z,1);else delete J[Z];return J}return J[Z]=qO(z[Z],Q,X+1),J},UO=function(z,Q){return qO(z,Q,0)},BO=function(z,Q,X,Z){var J=Q[Z],$=Q4(z)?z.slice():g1({},z);if(Z+1===Q.length){var H=X[Z];if($[H]=$[J],Q4($))$.splice(J,1);else delete $[J]}else $[J]=BO(z[J],Q,X,Z+1);return $},WO=function(z,Q,X){if(Q.length!==X.length){_("copyWithRename() expects paths of the same length");return}else for(var Z=0;Z<X.length-1;Z++)if(Q[Z]!==X[Z]){_("copyWithRename() expects paths to be the same except for the deepest key");return}return BO(z,Q,X,0)},OO=function(z,Q,X,Z){if(X>=Q.length)return Z;var J=Q[X],$=Q4(z)?z.slice():g1({},z);return $[J]=OO(z[J],Q,X+1,Z),$},KO=function(z,Q,X){return OO(z,Q,0,X)},hH=function(z,Q){var X=z.memoizedState;while(X!==null&&Q>0)X=X.next,Q--;return X};zO=function(z,Q,X,Z){var J=hH(z,Q);if(J!==null){var $=KO(J.memoizedState,X,Z);J.memoizedState=$,J.baseState=$,z.memoizedProps=g1({},z.memoizedProps);var H=B5(z,A1);if(H!==null)K7(H,z,A1,y4)}},QO=function(z,Q,X){var Z=hH(z,Q);if(Z!==null){var J=UO(Z.memoizedState,X);Z.memoizedState=J,Z.baseState=J,z.memoizedProps=g1({},z.memoizedProps);var $=B5(z,A1);if($!==null)K7($,z,A1,y4)}},XO=function(z,Q,X,Z){var J=hH(z,Q);if(J!==null){var $=WO(J.memoizedState,X,Z);J.memoizedState=$,J.baseState=$,z.memoizedProps=g1({},z.memoizedProps);var H=B5(z,A1);if(H!==null)K7(H,z,A1,y4)}},ZO=function(z,Q,X){if(z.pendingProps=KO(z.memoizedProps,Q,X),z.alternate)z.alternate.pendingProps=z.pendingProps;var Z=B5(z,A1);if(Z!==null)K7(Z,z,A1,y4)},JO=function(z,Q){if(z.pendingProps=UO(z.memoizedProps,Q),z.alternate)z.alternate.pendingProps=z.pendingProps;var X=B5(z,A1);if(X!==null)K7(X,z,A1,y4)},YO=function(z,Q,X){if(z.pendingProps=WO(z.memoizedProps,Q,X),z.alternate)z.alternate.pendingProps=z.pendingProps;var Z=B5(z,A1);if(Z!==null)K7(Z,z,A1,y4)},$O=function(z){var Q=B5(z,A1);if(Q!==null)K7(Q,z,A1,y4)},HO=function(z){tW=z},GO=function(z){eW=z}}function MP(z){var Q=pG(z);if(Q===null)return null;return Q.stateNode}function wP(z){return null}function FP(){return j7}function bP(z){var Q=z.findFiberByHostInstance,X=Y.ReactCurrentDispatcher;return m_({bundleType:z.bundleType,version:z.version,rendererPackageName:z.rendererPackageName,rendererConfig:z.rendererConfig,overrideHookState:zO,overrideHookStateDeletePath:QO,overrideHookStateRenamePath:XO,overrideProps:ZO,overridePropsDeletePath:JO,overridePropsRenamePath:YO,setErrorHandler:HO,setSuspenseHandler:GO,scheduleUpdate:$O,currentDispatcherRef:X,findHostInstanceByFiber:MP,findFiberByHostInstance:Q||wP,findHostInstancesForRefresh:tb,scheduleRefresh:rb,scheduleRoot:sb,setRefreshHandler:nb,getCurrentFiber:FP,reconcilerVersion:CH})}var _O=typeof reportError==="function"?reportError:function(z){console.error(z)};function yH(z){this._internalRoot=z}Y2.prototype.render=yH.prototype.render=function(z){var Q=this._internalRoot;if(Q===null)throw Error("Cannot update an unmounted root.");{if(typeof arguments[1]==="function")q("render(...): does not support the second callback argument. To execute a side effect after rendering, declare it in a component body with useEffect().");else if($2(arguments[1]))q("You passed a container to the second argument of root.render(...). You don't need to pass it again since you already passed it to create the root.");else if(typeof arguments[1]<"u")q("You passed a second argument to root.render(...) but it only accepts one argument.");var X=Q.containerInfo;if(X.nodeType!==X7){var Z=sW(Q.current);if(Z){if(Z.parentNode!==X)q("render(...): It looks like the React-rendered content of the root container was removed without using React. This is not supported and will cause errors. Instead, call root.unmount() to empty a root's container.")}}}SZ(z,Q,null,null)},Y2.prototype.unmount=yH.prototype.unmount=function(){if(typeof arguments[0]==="function")q("unmount(...): does not support a callback argument. To execute a side effect after rendering, declare it in a component body with useEffect().");var z=this._internalRoot;if(z!==null){this._internalRoot=null;var Q=z.containerInfo;if(kW())q("Attempted to synchronously unmount a root while React was already rendering. React cannot finish unmounting the root until the current render has completed, which may lead to a race condition.");o6(function(){SZ(null,z,null,null)}),OU(Q)}};function PP(z,Q){if(!$2(z))throw Error("createRoot(...): Target container is not a DOM element.");LO(z);var X=!1,Z=!1,J="",$=_O,H=null;if(Q!==null&&Q!==void 0){if(Q.hydrate)_("hydrate through createRoot is deprecated. Use ReactDOMClient.hydrateRoot(container, <App />) instead.");else if(typeof Q==="object"&&Q!==null&&Q.$$typeof===U4)q(`You passed a JSX element to createRoot. You probably meant to call root.render instead. Example usage:
|
|
142
|
+
|
|
143
|
+
let root = createRoot(domContainer);
|
|
144
|
+
root.render(<App />);`);if(Q.unstable_strictMode===!0)X=!0;if(Q.identifierPrefix!==void 0)J=Q.identifierPrefix;if(Q.onRecoverableError!==void 0)$=Q.onRecoverableError;if(Q.transitionCallbacks!==void 0)H=Q.transitionCallbacks}var B=aW(z,tJ,null,X,Z,J,$);lJ(B.current,z);var W=z.nodeType===X7?z.parentNode:z;return DX(W),new yH(B)}function Y2(z){this._internalRoot=z}function AP(z){if(z)DL(z)}Y2.prototype.unstable_scheduleHydration=AP;function IP(z,Q,X){if(!$2(z))throw Error("hydrateRoot(...): Target container is not a DOM element.");if(LO(z),Q===void 0)q("Must provide initial children as second argument to hydrateRoot. Example usage: hydrateRoot(domContainer, <App />)");var Z=X!=null?X:null,J=X!=null&&X.hydratedSources||null,$=!1,H=!1,B="",W=_O;if(X!==null&&X!==void 0){if(X.unstable_strictMode===!0)$=!0;if(X.identifierPrefix!==void 0)B=X.identifierPrefix;if(X.onRecoverableError!==void 0)W=X.onRecoverableError}var w=nW(Q,null,z,tJ,Z,$,H,B,W);if(lJ(w.current,z),DX(z),J)for(var k=0;k<J.length;k++){var l=J[k];Iw(w,l)}return new Y2(w)}function $2(z){return!!(z&&(z.nodeType===q5||z.nodeType===v6||z.nodeType===E2||!U0))}function vZ(z){return!!(z&&(z.nodeType===q5||z.nodeType===v6||z.nodeType===E2||z.nodeType===X7&&z.nodeValue===" react-mount-point-unstable "))}function LO(z){{if(z.nodeType===q5&&z.tagName&&z.tagName.toUpperCase()==="BODY")q("createRoot(): Creating roots directly with document.body is discouraged, since its children are often manipulated by third-party scripts and browser extensions. This may lead to subtle reconciliation issues. Try using a container element created for your app.");if(iX(z))if(z._reactRootContainer)q("You are calling ReactDOMClient.createRoot() on a container that was previously passed to ReactDOM.render(). This is not supported.");else q("You are calling ReactDOMClient.createRoot() on a container that has already been passed to createRoot() before. Instead, call root.render() on the existing root instead if you want to update it.")}}var TP=Y.ReactCurrentOwner,RO;RO=function(z){if(z._reactRootContainer&&z.nodeType!==X7){var Q=sW(z._reactRootContainer.current);if(Q){if(Q.parentNode!==z)q("render(...): It looks like the React-rendered content of this container was removed without using React. This is not supported and will cause errors. Instead, call ReactDOM.unmountComponentAtNode to empty a container.")}}var X=!!z._reactRootContainer,Z=VH(z),J=!!(Z&&L8(Z));if(J&&!X)q("render(...): Replacing React-rendered children with a new root component. If you intended to update the children of this node, you should instead have the existing children update their state and render the new components instead of calling ReactDOM.render.");if(z.nodeType===q5&&z.tagName&&z.tagName.toUpperCase()==="BODY")q("render(): Rendering components directly into document.body is discouraged, since its children are often manipulated by third-party scripts and browser extensions. This may lead to subtle reconciliation issues. Try rendering into a container element created for your app.")};function VH(z){if(!z)return null;if(z.nodeType===v6)return z.documentElement;else return z.firstChild}function NO(){}function kP(z,Q,X,Z,J){if(J){if(typeof Z==="function"){var $=Z;Z=function(){var c=J2(H);$.call(c)}}var H=nW(Q,Z,z,N8,null,!1,!1,"",NO);z._reactRootContainer=H,lJ(H.current,z);var B=z.nodeType===X7?z.parentNode:z;return DX(B),o6(),H}else{var W;while(W=z.lastChild)z.removeChild(W);if(typeof Z==="function"){var w=Z;Z=function(){var c=J2(k);w.call(c)}}var k=aW(z,N8,null,!1,!1,"",NO);z._reactRootContainer=k,lJ(k.current,z);var l=z.nodeType===X7?z.parentNode:z;return DX(l),o6(function(){SZ(Q,k,X,Z)}),k}}function CP(z,Q){if(z!==null&&typeof z!=="function")q("%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.",Q,z)}function H2(z,Q,X,Z,J){RO(X),CP(J===void 0?null:J,"render");var $=X._reactRootContainer,H;if(!$)H=kP(X,Q,z,J,Z);else{if(H=$,typeof J==="function"){var B=J;J=function(){var W=J2(H);B.call(W)}}SZ(Q,H,z,J)}return J2(H)}var MO=!1;function SP(z){{if(!MO)MO=!0,q("findDOMNode is deprecated and will be removed in the next major release. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node");var Q=TP.current;if(Q!==null&&Q.stateNode!==null){var X=Q.stateNode._warnedAboutRefsInRender;if(!X)q("%s is accessing findDOMNode inside its render(). render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.",s1(Q.type)||"A component");Q.stateNode._warnedAboutRefsInRender=!0}}if(z==null)return null;if(z.nodeType===q5)return z;return OP(z,"findDOMNode")}function vP(z,Q,X){if(q("ReactDOM.hydrate is no longer supported in React 18. Use hydrateRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot"),!vZ(Q))throw Error("Target container is not a DOM element.");{var Z=iX(Q)&&Q._reactRootContainer===void 0;if(Z)q("You are calling ReactDOM.hydrate() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call hydrateRoot(container, element)?")}return H2(null,z,Q,!0,X)}function fP(z,Q,X){if(q("ReactDOM.render is no longer supported in React 18. Use createRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot"),!vZ(Q))throw Error("Target container is not a DOM element.");{var Z=iX(Q)&&Q._reactRootContainer===void 0;if(Z)q("You are calling ReactDOM.render() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call root.render(element)?")}return H2(null,z,Q,!1,X)}function hP(z,Q,X,Z){if(q("ReactDOM.unstable_renderSubtreeIntoContainer() is no longer supported in React 18. Consider using a portal instead. Until you switch to the createRoot API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot"),!vZ(X))throw Error("Target container is not a DOM element.");if(z==null||!F_(z))throw Error("parentComponent must be a valid React Component");return H2(z,Q,X,!1,Z)}var wO=!1;function yP(z){if(!wO)wO=!0,q("unmountComponentAtNode is deprecated and will be removed in the next major release. Switch to the createRoot API. Learn more: https://reactjs.org/link/switch-to-createroot");if(!vZ(z))throw Error("unmountComponentAtNode(...): Target container is not a DOM element.");{var Q=iX(z)&&z._reactRootContainer===void 0;if(Q)q("You are calling ReactDOM.unmountComponentAtNode() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call root.unmount()?")}if(z._reactRootContainer){{var X=VH(z),Z=X&&!L8(X);if(Z)q("unmountComponentAtNode(): The node you're attempting to unmount was rendered by another copy of React.")}return o6(function(){H2(null,null,z,!1,function(){z._reactRootContainer=null,OU(z)})}),!0}else{{var J=VH(z),$=!!(J&&L8(J)),H=z.nodeType===q5&&vZ(z.parentNode)&&!!z.parentNode._reactRootContainer;if($)q("unmountComponentAtNode(): The node you're attempting to unmount was rendered by React and is not a top-level container. %s",H?"You may have accidentally passed in a React root node instead of its container.":"Instead, have the parent component update its state and rerender in order to remove this component.")}return!1}}if(IL(KP),kL(_P),CL(LP),SL(i5),vL(bL),typeof Map!=="function"||Map.prototype==null||typeof Map.prototype.forEach!=="function"||typeof Set!=="function"||Set.prototype==null||typeof Set.prototype.clear!=="function"||typeof Set.prototype.forEach!=="function")q("React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills");U_(fN),O_(BH,Ib,o6);function VP(z,Q){var X=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!$2(Q))throw Error("Target container is not a DOM element.");return WP(z,Q,null,X)}function DP(z,Q,X,Z){return hP(z,Q,X,Z)}var DH={usingClientEntryPoint:!1,Events:[L8,ZQ,iJ,vG,fG,BH]};function mP(z,Q){if(!DH.usingClientEntryPoint)q('You are importing createRoot from "react-dom" which is not supported. You should instead import it from "react-dom/client".');return PP(z,Q)}function gP(z,Q,X){if(!DH.usingClientEntryPoint)q('You are importing hydrateRoot from "react-dom" which is not supported. You should instead import it from "react-dom/client".');return IP(z,Q,X)}function EP(z){if(kW())q("flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task.");return o6(z)}var uP=bP({findFiberByHostInstance:Qz,bundleType:1,version:CH,rendererPackageName:"react-dom"});if(!uP&&N0&&window.top===window.self){if(navigator.userAgent.indexOf("Chrome")>-1&&navigator.userAgent.indexOf("Edge")===-1||navigator.userAgent.indexOf("Firefox")>-1){var FO=window.location.protocol;if(/^(https?|file):$/.test(FO))console.info("%cDownload the React DevTools for a better development experience: https://reactjs.org/link/react-devtools"+(FO==="file:"?`
|
|
145
|
+
You might need to use a local HTTP server (instead of file://): https://reactjs.org/link/react-devtools-faq`:""),"font-weight:bold")}}if(aP.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=DH,aP.createPortal=VP,aP.createRoot=mP,aP.findDOMNode=SP,aP.flushSync=EP,aP.hydrate=vP,aP.hydrateRoot=gP,aP.render=fP,aP.unmountComponentAtNode=yP,aP.unstable_batchedUpdates=BH,aP.unstable_renderSubtreeIntoContainer=DP,aP.version=CH,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function")__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var TO=Rz((uk,IO)=>{var nP=B0(AO());IO.exports=nP});var kO=Rz((rP)=>{var SQ=B0(TO());CQ=SQ.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,rP.createRoot=function(Y,G){CQ.usingClientEntryPoint=!0;try{return SQ.createRoot(Y,G)}finally{CQ.usingClientEntryPoint=!1}},rP.hydrateRoot=function(Y,G,U){CQ.usingClientEntryPoint=!0;try{return SQ.hydrateRoot(Y,G,U)}finally{CQ.usingClientEntryPoint=!1}};var CQ});var U1=Rz((sP)=>{var gH=B0(V1());(function(){var Y=Symbol.for("react.element"),G=Symbol.for("react.portal"),U=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),q=Symbol.for("react.profiler"),R=Symbol.for("react.provider"),K=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),b=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),N=Symbol.for("react.offscreen"),S=Symbol.iterator,f="@@iterator";function V(y){if(y===null||typeof y!=="object")return null;var W0=S&&y[S]||y[f];if(typeof W0==="function")return W0;return null}var x=gH.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function v(y){{for(var W0=arguments.length,w0=Array(W0>1?W0-1:0),C=1;C<W0;C++)w0[C-1]=arguments[C];p("error",y,w0)}}function p(y,W0,w0){{var C=x.ReactDebugCurrentFrame,o=C.getStackAddendum();if(o!=="")W0+="%s",w0=w0.concat([o]);var L0=w0.map(function(k0){return String(k0)});L0.unshift("Warning: "+W0),Function.prototype.apply.call(console[y],console,L0)}}var A=!1,E=!1,j=!1,u=!1,r=!1,i;i=Symbol.for("react.module.reference");function d(y){if(typeof y==="string"||typeof y==="function")return!0;if(y===U||y===q||r||y===_||y===T||y===I||u||y===N||A||E||j)return!0;if(typeof y==="object"&&y!==null){if(y.$$typeof===P||y.$$typeof===b||y.$$typeof===R||y.$$typeof===K||y.$$typeof===O||y.$$typeof===i||y.getModuleId!==void 0)return!0}return!1}function D(y,W0,w0){var C=y.displayName;if(C)return C;var o=W0.displayName||W0.name||"";return o!==""?w0+"("+o+")":w0}function Q0(y){return y.displayName||"Context"}function n(y){if(y==null)return null;if(typeof y.tag==="number")v("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.");if(typeof y==="function")return y.displayName||y.name||null;if(typeof y==="string")return y;switch(y){case U:return"Fragment";case G:return"Portal";case q:return"Profiler";case _:return"StrictMode";case T:return"Suspense";case I:return"SuspenseList"}if(typeof y==="object")switch(y.$$typeof){case K:var W0=y;return Q0(W0)+".Consumer";case R:var w0=y;return Q0(w0._context)+".Provider";case O:return D(y,y.render,"ForwardRef");case b:var C=y.displayName||null;if(C!==null)return C;return n(y.type)||"Memo";case P:{var o=y,L0=o._payload,k0=o._init;try{return n(k0(L0))}catch(u0){return null}}}return null}var G0=Object.assign,F0=0,K0,S0,P0,a,Y0,U0,H0;function y0(){}y0.__reactDisabledLog=!0;function z0(){{if(F0===0){K0=console.log,S0=console.info,P0=console.warn,a=console.error,Y0=console.group,U0=console.groupCollapsed,H0=console.groupEnd;var y={configurable:!0,enumerable:!0,value:y0,writable:!0};Object.defineProperties(console,{info:y,log:y,warn:y,error:y,group:y,groupCollapsed:y,groupEnd:y})}F0++}}function v0(){{if(F0--,F0===0){var y={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:G0({},y,{value:K0}),info:G0({},y,{value:S0}),warn:G0({},y,{value:P0}),error:G0({},y,{value:a}),group:G0({},y,{value:Y0}),groupCollapsed:G0({},y,{value:U0}),groupEnd:G0({},y,{value:H0})})}if(F0<0)v("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var p0=x.ReactCurrentDispatcher,Y1;function m0(y,W0,w0){{if(Y1===void 0)try{throw Error()}catch(o){var C=o.stack.trim().match(/\n( *(at )?)/);Y1=C&&C[1]||""}return`
|
|
146
|
+
`+Y1+y}}var $1=!1,v1;{var m=typeof WeakMap==="function"?WeakMap:Map;v1=new m}function N0(y,W0){if(!y||$1)return"";{var w0=v1.get(y);if(w0!==void 0)return w0}var C;$1=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var L0;L0=p0.current,p0.current=null,z0();try{if(W0){var k0=function(){throw Error()};if(Object.defineProperty(k0.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==="object"&&Reflect.construct){try{Reflect.construct(k0,[])}catch(B4){C=B4}Reflect.construct(y,[],k0)}else{try{k0.call()}catch(B4){C=B4}y.call(k0.prototype)}}else{try{throw Error()}catch(B4){C=B4}y()}}catch(B4){if(B4&&C&&typeof B4.stack==="string"){var u0=B4.stack.split(`
|
|
147
|
+
`),Q1=C.stack.split(`
|
|
148
|
+
`),a0=u0.length-1,R0=Q1.length-1;while(a0>=1&&R0>=0&&u0[a0]!==Q1[R0])R0--;for(;a0>=1&&R0>=0;a0--,R0--)if(u0[a0]!==Q1[R0]){if(a0!==1||R0!==1)do if(a0--,R0--,R0<0||u0[a0]!==Q1[R0]){var D0=`
|
|
149
|
+
`+u0[a0].replace(" at new "," at ");if(y.displayName&&D0.includes("<anonymous>"))D0=D0.replace("<anonymous>",y.displayName);if(typeof y==="function")v1.set(y,D0);return D0}while(a0>=1&&R0>=0);break}}}finally{$1=!1,p0.current=L0,v0(),Error.prepareStackTrace=o}var J1=y?y.displayName||y.name:"",d1=J1?m0(J1):"";if(typeof y==="function")v1.set(y,d1);return d1}function V0(y,W0,w0){return N0(y,!1)}function L1(y){var W0=y.prototype;return!!(W0&&W0.isReactComponent)}function o1(y,W0,w0){if(y==null)return"";if(typeof y==="function")return N0(y,L1(y));if(typeof y==="string")return m0(y);switch(y){case T:return m0("Suspense");case I:return m0("SuspenseList")}if(typeof y==="object")switch(y.$$typeof){case O:return V0(y.render);case b:return o1(y.type,W0,w0);case P:{var C=y,o=C._payload,L0=C._init;try{return o1(L0(o),W0,w0)}catch(k0){}}}return""}var R1=Object.prototype.hasOwnProperty,A0={},Z1=x.ReactDebugCurrentFrame;function S1(y){if(y){var W0=y._owner,w0=o1(y.type,y._source,W0?W0.type:null);Z1.setExtraStackFrame(w0)}else Z1.setExtraStackFrame(null)}function a1(y,W0,w0,C,o){{var L0=Function.call.bind(R1);for(var k0 in y)if(L0(y,k0)){var u0=void 0;try{if(typeof y[k0]!=="function"){var Q1=Error((C||"React class")+": "+w0+" type `"+k0+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof y[k0]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Q1.name="Invariant Violation",Q1}u0=y[k0](W0,k0,C,w0,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(a0){u0=a0}if(u0&&!(u0 instanceof Error))S1(o),v("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",C||"React class",w0,k0,typeof u0),S1(null);if(u0 instanceof Error&&!(u0.message in A0))A0[u0.message]=!0,S1(o),v("Failed %s type: %s",w0,u0.message),S1(null)}}}var v4=Array.isArray;function G4(y){return v4(y)}function I7(y){{var W0=typeof Symbol==="function"&&Symbol.toStringTag,w0=W0&&y[Symbol.toStringTag]||y.constructor.name||"Object";return w0}}function P4(y){try{return T7(y),!1}catch(W0){return!0}}function T7(y){return""+y}function f4(y){if(P4(y))return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",I7(y)),T7(y)}var V4=x.ReactCurrentOwner,N7={key:!0,ref:!0,__self:!0,__source:!0},u7,l4,Q7;Q7={};function g0(y){if(R1.call(y,"ref")){var W0=Object.getOwnPropertyDescriptor(y,"ref").get;if(W0&&W0.isReactWarning)return!1}return y.ref!==void 0}function H1(y){if(R1.call(y,"key")){var W0=Object.getOwnPropertyDescriptor(y,"key").get;if(W0&&W0.isReactWarning)return!1}return y.key!==void 0}function O1(y,W0){if(typeof y.ref==="string"&&V4.current&&W0&&V4.current.stateNode!==W0){var w0=n(V4.current.type);if(!Q7[w0])v('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',n(V4.current.type),y.ref),Q7[w0]=!0}}function n1(y,W0){{var w0=function(){if(!u7)u7=!0,v("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",W0)};w0.isReactWarning=!0,Object.defineProperty(y,"key",{get:w0,configurable:!0})}}function q4(y,W0){{var w0=function(){if(!l4)l4=!0,v("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",W0)};w0.isReactWarning=!0,Object.defineProperty(y,"ref",{get:w0,configurable:!0})}}var u4=function(y,W0,w0,C,o,L0,k0){var u0={$$typeof:Y,type:y,key:W0,ref:w0,props:k0,_owner:L0};if(u0._store={},Object.defineProperty(u0._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(u0,"_self",{configurable:!1,enumerable:!1,writable:!1,value:C}),Object.defineProperty(u0,"_source",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.freeze)Object.freeze(u0.props),Object.freeze(u0);return u0};function N4(y,W0,w0,C,o){{var L0,k0={},u0=null,Q1=null;if(w0!==void 0)f4(w0),u0=""+w0;if(H1(W0))f4(W0.key),u0=""+W0.key;if(g0(W0))Q1=W0.ref,O1(W0,o);for(L0 in W0)if(R1.call(W0,L0)&&!N7.hasOwnProperty(L0))k0[L0]=W0[L0];if(y&&y.defaultProps){var a0=y.defaultProps;for(L0 in a0)if(k0[L0]===void 0)k0[L0]=a0[L0]}if(u0||Q1){var R0=typeof y==="function"?y.displayName||y.name||"Unknown":y;if(u0)n1(k0,R0);if(Q1)q4(k0,R0)}return u4(y,u0,Q1,o,C,V4.current,k0)}}var{ReactCurrentOwner:e4,ReactDebugCurrentFrame:f1}=x;function k1(y){if(y){var W0=y._owner,w0=o1(y.type,y._source,W0?W0.type:null);f1.setExtraStackFrame(w0)}else f1.setExtraStackFrame(null)}var r7=!1;function M7(y){return typeof y==="object"&&y!==null&&y.$$typeof===Y}function s7(){{if(e4.current){var y=n(e4.current.type);if(y)return`
|
|
150
|
+
|
|
151
|
+
Check the render method of \``+y+"`."}return""}}function $6(y){{if(y!==void 0){var W0=y.fileName.replace(/^.*[\\\/]/,""),w0=y.lineNumber;return`
|
|
152
|
+
|
|
153
|
+
Check your code at `+W0+":"+w0+"."}return""}}var p5={};function H6(y){{var W0=s7();if(!W0){var w0=typeof y==="string"?y:y.displayName||y.name;if(w0)W0=`
|
|
154
|
+
|
|
155
|
+
Check the top-level render call using <`+w0+">."}return W0}}function S5(y,W0){{if(!y._store||y._store.validated||y.key!=null)return;y._store.validated=!0;var w0=H6(W0);if(p5[w0])return;p5[w0]=!0;var C="";if(y&&y._owner&&y._owner!==e4.current)C=" It was passed a child from "+n(y._owner.type)+".";k1(y),v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',w0,C),k1(null)}}function x7(y,W0){{if(typeof y!=="object")return;if(G4(y))for(var w0=0;w0<y.length;w0++){var C=y[w0];if(M7(C))S5(C,W0)}else if(M7(y)){if(y._store)y._store.validated=!0}else if(y){var o=V(y);if(typeof o==="function"){if(o!==y.entries){var L0=o.call(y),k0;while(!(k0=L0.next()).done)if(M7(k0.value))S5(k0.value,W0)}}}}}function d5(y){{var W0=y.type;if(W0===null||W0===void 0||typeof W0==="string")return;var w0;if(typeof W0==="function")w0=W0.propTypes;else if(typeof W0==="object"&&(W0.$$typeof===O||W0.$$typeof===b))w0=W0.propTypes;else return;if(w0){var C=n(W0);a1(w0,y.props,"prop",C,y)}else if(W0.PropTypes!==void 0&&!r7){r7=!0;var o=n(W0);v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",o||"Unknown")}if(typeof W0.getDefaultProps==="function"&&!W0.getDefaultProps.isReactClassApproved)v("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function p1(y){{var W0=Object.keys(y.props);for(var w0=0;w0<W0.length;w0++){var C=W0[w0];if(C!=="children"&&C!=="key"){k1(y),v("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",C),k1(null);break}}if(y.ref!==null)k1(y),v("Invalid attribute `ref` supplied to `React.Fragment`."),k1(null)}}var U4={};function F4(y,W0,w0,C,o,L0){{var k0=d(y);if(!k0){var u0="";if(y===void 0||typeof y==="object"&&y!==null&&Object.keys(y).length===0)u0+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";var Q1=$6(o);if(Q1)u0+=Q1;else u0+=s7();var a0;if(y===null)a0="null";else if(G4(y))a0="array";else if(y!==void 0&&y.$$typeof===Y)a0="<"+(n(y.type)||"Unknown")+" />",u0=" Did you accidentally export a JSX literal instead of a component?";else a0=typeof y;v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",a0,u0)}var R0=N4(y,W0,w0,o,L0);if(R0==null)return R0;if(k0){var D0=W0.children;if(D0!==void 0)if(C)if(G4(D0)){for(var J1=0;J1<D0.length;J1++)x7(D0[J1],y);if(Object.freeze)Object.freeze(D0)}else v("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else x7(D0,y)}if(R1.call(W0,"key")){var d1=n(y),B4=Object.keys(W0).filter(function(h4){return h4!=="key"}),t7=B4.length>0?"{key: someKey, "+B4.join(": ..., ")+": ...}":"{key: someKey}";if(!U4[d1+t7]){var N5=B4.length>0?"{"+B4.join(": ..., ")+": ...}":"{}";v(`A props object containing a "key" prop is being spread into JSX:
|
|
156
|
+
let props = %s;
|
|
157
|
+
<%s {...props} />
|
|
158
|
+
React keys must be passed directly to JSX without using spread:
|
|
159
|
+
let props = %s;
|
|
160
|
+
<%s key={someKey} {...props} />`,t7,d1,N5,d1),U4[d1+t7]=!0}}if(y===U)p1(R0);else d5(R0);return R0}}var t1=F4;sP.Fragment=U,sP.jsxDEV=t1})()});var k4=Rz((yA)=>{var nH=B0(V1());(function(){var Y=Symbol.for("react.element"),G=Symbol.for("react.portal"),U=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),q=Symbol.for("react.profiler"),R=Symbol.for("react.provider"),K=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),b=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),N=Symbol.for("react.offscreen"),S=Symbol.iterator,f="@@iterator";function V(C){if(C===null||typeof C!=="object")return null;var o=S&&C[S]||C[f];if(typeof o==="function")return o;return null}var x=nH.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function v(C){{for(var o=arguments.length,L0=Array(o>1?o-1:0),k0=1;k0<o;k0++)L0[k0-1]=arguments[k0];p("error",C,L0)}}function p(C,o,L0){{var k0=x.ReactDebugCurrentFrame,u0=k0.getStackAddendum();if(u0!=="")o+="%s",L0=L0.concat([u0]);var Q1=L0.map(function(a0){return String(a0)});Q1.unshift("Warning: "+o),Function.prototype.apply.call(console[C],console,Q1)}}var A=!1,E=!1,j=!1,u=!1,r=!1,i;i=Symbol.for("react.module.reference");function d(C){if(typeof C==="string"||typeof C==="function")return!0;if(C===U||C===q||r||C===_||C===T||C===I||u||C===N||A||E||j)return!0;if(typeof C==="object"&&C!==null){if(C.$$typeof===P||C.$$typeof===b||C.$$typeof===R||C.$$typeof===K||C.$$typeof===O||C.$$typeof===i||C.getModuleId!==void 0)return!0}return!1}function D(C,o,L0){var k0=C.displayName;if(k0)return k0;var u0=o.displayName||o.name||"";return u0!==""?L0+"("+u0+")":L0}function Q0(C){return C.displayName||"Context"}function n(C){if(C==null)return null;if(typeof C.tag==="number")v("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.");if(typeof C==="function")return C.displayName||C.name||null;if(typeof C==="string")return C;switch(C){case U:return"Fragment";case G:return"Portal";case q:return"Profiler";case _:return"StrictMode";case T:return"Suspense";case I:return"SuspenseList"}if(typeof C==="object")switch(C.$$typeof){case K:var o=C;return Q0(o)+".Consumer";case R:var L0=C;return Q0(L0._context)+".Provider";case O:return D(C,C.render,"ForwardRef");case b:var k0=C.displayName||null;if(k0!==null)return k0;return n(C.type)||"Memo";case P:{var u0=C,Q1=u0._payload,a0=u0._init;try{return n(a0(Q1))}catch(R0){return null}}}return null}var G0=Object.assign,F0=0,K0,S0,P0,a,Y0,U0,H0;function y0(){}y0.__reactDisabledLog=!0;function z0(){{if(F0===0){K0=console.log,S0=console.info,P0=console.warn,a=console.error,Y0=console.group,U0=console.groupCollapsed,H0=console.groupEnd;var C={configurable:!0,enumerable:!0,value:y0,writable:!0};Object.defineProperties(console,{info:C,log:C,warn:C,error:C,group:C,groupCollapsed:C,groupEnd:C})}F0++}}function v0(){{if(F0--,F0===0){var C={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:G0({},C,{value:K0}),info:G0({},C,{value:S0}),warn:G0({},C,{value:P0}),error:G0({},C,{value:a}),group:G0({},C,{value:Y0}),groupCollapsed:G0({},C,{value:U0}),groupEnd:G0({},C,{value:H0})})}if(F0<0)v("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var p0=x.ReactCurrentDispatcher,Y1;function m0(C,o,L0){{if(Y1===void 0)try{throw Error()}catch(u0){var k0=u0.stack.trim().match(/\n( *(at )?)/);Y1=k0&&k0[1]||""}return`
|
|
161
|
+
`+Y1+C}}var $1=!1,v1;{var m=typeof WeakMap==="function"?WeakMap:Map;v1=new m}function N0(C,o){if(!C||$1)return"";{var L0=v1.get(C);if(L0!==void 0)return L0}var k0;$1=!0;var u0=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Q1;Q1=p0.current,p0.current=null,z0();try{if(o){var a0=function(){throw Error()};if(Object.defineProperty(a0.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==="object"&&Reflect.construct){try{Reflect.construct(a0,[])}catch(h4){k0=h4}Reflect.construct(C,[],a0)}else{try{a0.call()}catch(h4){k0=h4}C.call(a0.prototype)}}else{try{throw Error()}catch(h4){k0=h4}C()}}catch(h4){if(h4&&k0&&typeof h4.stack==="string"){var R0=h4.stack.split(`
|
|
162
|
+
`),D0=k0.stack.split(`
|
|
163
|
+
`),J1=R0.length-1,d1=D0.length-1;while(J1>=1&&d1>=0&&R0[J1]!==D0[d1])d1--;for(;J1>=1&&d1>=0;J1--,d1--)if(R0[J1]!==D0[d1]){if(J1!==1||d1!==1)do if(J1--,d1--,d1<0||R0[J1]!==D0[d1]){var B4=`
|
|
164
|
+
`+R0[J1].replace(" at new "," at ");if(C.displayName&&B4.includes("<anonymous>"))B4=B4.replace("<anonymous>",C.displayName);if(typeof C==="function")v1.set(C,B4);return B4}while(J1>=1&&d1>=0);break}}}finally{$1=!1,p0.current=Q1,v0(),Error.prepareStackTrace=u0}var t7=C?C.displayName||C.name:"",N5=t7?m0(t7):"";if(typeof C==="function")v1.set(C,N5);return N5}function V0(C,o,L0){return N0(C,!1)}function L1(C){var o=C.prototype;return!!(o&&o.isReactComponent)}function o1(C,o,L0){if(C==null)return"";if(typeof C==="function")return N0(C,L1(C));if(typeof C==="string")return m0(C);switch(C){case T:return m0("Suspense");case I:return m0("SuspenseList")}if(typeof C==="object")switch(C.$$typeof){case O:return V0(C.render);case b:return o1(C.type,o,L0);case P:{var k0=C,u0=k0._payload,Q1=k0._init;try{return o1(Q1(u0),o,L0)}catch(a0){}}}return""}var R1=Object.prototype.hasOwnProperty,A0={},Z1=x.ReactDebugCurrentFrame;function S1(C){if(C){var o=C._owner,L0=o1(C.type,C._source,o?o.type:null);Z1.setExtraStackFrame(L0)}else Z1.setExtraStackFrame(null)}function a1(C,o,L0,k0,u0){{var Q1=Function.call.bind(R1);for(var a0 in C)if(Q1(C,a0)){var R0=void 0;try{if(typeof C[a0]!=="function"){var D0=Error((k0||"React class")+": "+L0+" type `"+a0+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof C[a0]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw D0.name="Invariant Violation",D0}R0=C[a0](o,a0,k0,L0,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(J1){R0=J1}if(R0&&!(R0 instanceof Error))S1(u0),v("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",k0||"React class",L0,a0,typeof R0),S1(null);if(R0 instanceof Error&&!(R0.message in A0))A0[R0.message]=!0,S1(u0),v("Failed %s type: %s",L0,R0.message),S1(null)}}}var v4=Array.isArray;function G4(C){return v4(C)}function I7(C){{var o=typeof Symbol==="function"&&Symbol.toStringTag,L0=o&&C[Symbol.toStringTag]||C.constructor.name||"Object";return L0}}function P4(C){try{return T7(C),!1}catch(o){return!0}}function T7(C){return""+C}function f4(C){if(P4(C))return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",I7(C)),T7(C)}var V4=x.ReactCurrentOwner,N7={key:!0,ref:!0,__self:!0,__source:!0},u7,l4,Q7;Q7={};function g0(C){if(R1.call(C,"ref")){var o=Object.getOwnPropertyDescriptor(C,"ref").get;if(o&&o.isReactWarning)return!1}return C.ref!==void 0}function H1(C){if(R1.call(C,"key")){var o=Object.getOwnPropertyDescriptor(C,"key").get;if(o&&o.isReactWarning)return!1}return C.key!==void 0}function O1(C,o){if(typeof C.ref==="string"&&V4.current&&o&&V4.current.stateNode!==o){var L0=n(V4.current.type);if(!Q7[L0])v('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',n(V4.current.type),C.ref),Q7[L0]=!0}}function n1(C,o){{var L0=function(){if(!u7)u7=!0,v("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",o)};L0.isReactWarning=!0,Object.defineProperty(C,"key",{get:L0,configurable:!0})}}function q4(C,o){{var L0=function(){if(!l4)l4=!0,v("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",o)};L0.isReactWarning=!0,Object.defineProperty(C,"ref",{get:L0,configurable:!0})}}var u4=function(C,o,L0,k0,u0,Q1,a0){var R0={$$typeof:Y,type:C,key:o,ref:L0,props:a0,_owner:Q1};if(R0._store={},Object.defineProperty(R0._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(R0,"_self",{configurable:!1,enumerable:!1,writable:!1,value:k0}),Object.defineProperty(R0,"_source",{configurable:!1,enumerable:!1,writable:!1,value:u0}),Object.freeze)Object.freeze(R0.props),Object.freeze(R0);return R0};function N4(C,o,L0,k0,u0){{var Q1,a0={},R0=null,D0=null;if(L0!==void 0)f4(L0),R0=""+L0;if(H1(o))f4(o.key),R0=""+o.key;if(g0(o))D0=o.ref,O1(o,u0);for(Q1 in o)if(R1.call(o,Q1)&&!N7.hasOwnProperty(Q1))a0[Q1]=o[Q1];if(C&&C.defaultProps){var J1=C.defaultProps;for(Q1 in J1)if(a0[Q1]===void 0)a0[Q1]=J1[Q1]}if(R0||D0){var d1=typeof C==="function"?C.displayName||C.name||"Unknown":C;if(R0)n1(a0,d1);if(D0)q4(a0,d1)}return u4(C,R0,D0,u0,k0,V4.current,a0)}}var{ReactCurrentOwner:e4,ReactDebugCurrentFrame:f1}=x;function k1(C){if(C){var o=C._owner,L0=o1(C.type,C._source,o?o.type:null);f1.setExtraStackFrame(L0)}else f1.setExtraStackFrame(null)}var r7=!1;function M7(C){return typeof C==="object"&&C!==null&&C.$$typeof===Y}function s7(){{if(e4.current){var C=n(e4.current.type);if(C)return`
|
|
165
|
+
|
|
166
|
+
Check the render method of \``+C+"`."}return""}}function $6(C){{if(C!==void 0){var o=C.fileName.replace(/^.*[\\\/]/,""),L0=C.lineNumber;return`
|
|
167
|
+
|
|
168
|
+
Check your code at `+o+":"+L0+"."}return""}}var p5={};function H6(C){{var o=s7();if(!o){var L0=typeof C==="string"?C:C.displayName||C.name;if(L0)o=`
|
|
169
|
+
|
|
170
|
+
Check the top-level render call using <`+L0+">."}return o}}function S5(C,o){{if(!C._store||C._store.validated||C.key!=null)return;C._store.validated=!0;var L0=H6(o);if(p5[L0])return;p5[L0]=!0;var k0="";if(C&&C._owner&&C._owner!==e4.current)k0=" It was passed a child from "+n(C._owner.type)+".";k1(C),v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',L0,k0),k1(null)}}function x7(C,o){{if(typeof C!=="object")return;if(G4(C))for(var L0=0;L0<C.length;L0++){var k0=C[L0];if(M7(k0))S5(k0,o)}else if(M7(C)){if(C._store)C._store.validated=!0}else if(C){var u0=V(C);if(typeof u0==="function"){if(u0!==C.entries){var Q1=u0.call(C),a0;while(!(a0=Q1.next()).done)if(M7(a0.value))S5(a0.value,o)}}}}}function d5(C){{var o=C.type;if(o===null||o===void 0||typeof o==="string")return;var L0;if(typeof o==="function")L0=o.propTypes;else if(typeof o==="object"&&(o.$$typeof===O||o.$$typeof===b))L0=o.propTypes;else return;if(L0){var k0=n(o);a1(L0,C.props,"prop",k0,C)}else if(o.PropTypes!==void 0&&!r7){r7=!0;var u0=n(o);v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",u0||"Unknown")}if(typeof o.getDefaultProps==="function"&&!o.getDefaultProps.isReactClassApproved)v("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function p1(C){{var o=Object.keys(C.props);for(var L0=0;L0<o.length;L0++){var k0=o[L0];if(k0!=="children"&&k0!=="key"){k1(C),v("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",k0),k1(null);break}}if(C.ref!==null)k1(C),v("Invalid attribute `ref` supplied to `React.Fragment`."),k1(null)}}var U4={};function F4(C,o,L0,k0,u0,Q1){{var a0=d(C);if(!a0){var R0="";if(C===void 0||typeof C==="object"&&C!==null&&Object.keys(C).length===0)R0+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";var D0=$6(u0);if(D0)R0+=D0;else R0+=s7();var J1;if(C===null)J1="null";else if(G4(C))J1="array";else if(C!==void 0&&C.$$typeof===Y)J1="<"+(n(C.type)||"Unknown")+" />",R0=" Did you accidentally export a JSX literal instead of a component?";else J1=typeof C;v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",J1,R0)}var d1=N4(C,o,L0,u0,Q1);if(d1==null)return d1;if(a0){var B4=o.children;if(B4!==void 0)if(k0)if(G4(B4)){for(var t7=0;t7<B4.length;t7++)x7(B4[t7],C);if(Object.freeze)Object.freeze(B4)}else v("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else x7(B4,C)}if(R1.call(o,"key")){var N5=n(C),h4=Object.keys(o).filter(function(G6){return G6!=="key"}),g1=h4.length>0?"{key: someKey, "+h4.join(": ..., ")+": ...}":"{key: someKey}";if(!U4[N5+g1]){var I6=h4.length>0?"{"+h4.join(": ..., ")+": ...}":"{}";v(`A props object containing a "key" prop is being spread into JSX:
|
|
171
|
+
let props = %s;
|
|
172
|
+
<%s {...props} />
|
|
173
|
+
React keys must be passed directly to JSX without using spread:
|
|
174
|
+
let props = %s;
|
|
175
|
+
<%s key={someKey} {...props} />`,g1,N5,I6,N5),U4[N5+g1]=!0}}if(C===U)p1(d1);else d5(d1);return d1}}function t1(C,o,L0){return F4(C,o,L0,!0)}function y(C,o,L0){return F4(C,o,L0,!1)}var W0=y,w0=t1;yA.Fragment=U,yA.jsx=W0,yA.jsxs=w0})()});var R5=B0(V1(),1),FK=B0(kO(),1);var mH={memory:!0,tasks:!1,vision:!0,operator:!1,mcp:!1,realtime:!1,files:!1,agents:!1,builtinTools:{webSearch:!1,webFetch:!1}};function Mz(Y,G){let U=Y.agents;if(typeof U==="boolean")return{enabled:U,mode:"worker",group:G||void 0};return{...U,group:U.group||G||void 0}}var n4=B0(V1(),1),SO=B0(U1(),1),CO=n4.createContext(null),tP=200;function EH({children:Y}){let[G,U]=n4.useState(!1),[_,q]=n4.useState([]),[R,K]=n4.useState({}),[O,T]=n4.useState({}),[I,b]=n4.useState(0),P=n4.useRef(null),N=n4.useRef(null);n4.useEffect(()=>{let V=setInterval(()=>{let x=Date.now();T((v)=>{let p={};for(let[A,E]of Object.entries(v))if(E.expiresAt>x)p[A]=E;return p})},500);return()=>clearInterval(V)},[]);let S=n4.useCallback(()=>{if(P.current)P.current.close(),P.current=null;try{let V=new EventSource("/api/telemetry/stream");P.current=V,V.onopen=()=>{U(!0)},V.onmessage=(x)=>{if(!x.data||x.data.trim()==="")return;try{let v=JSON.parse(x.data);if(v.connected){U(!0);return}if(Array.isArray(v)){if(q((p)=>{return[...v,...p].slice(0,tP)}),K((p)=>{let A={...p};for(let E of v){let j=A[E.agent_id];if(!j||new Date(E.timestamp)>new Date(j.timestamp))A[E.agent_id]={timestamp:E.timestamp,category:E.category,type:E.type}}return A}),T((p)=>{let A={...p},E=Date.now()+3000;for(let j of v)A[j.agent_id]={type:j.type,expiresAt:E};return A}),v.some((p)=>p.category==="system"&&(p.type==="agent_started"||p.type==="agent_stopped")))b((p)=>p+1)}}catch{}},V.onerror=()=>{if(U(!1),V.close(),P.current=null,N.current)clearTimeout(N.current);N.current=setTimeout(S,2000)}}catch{if(U(!1),N.current)clearTimeout(N.current);N.current=setTimeout(S,2000)}},[]);n4.useEffect(()=>{return S(),()=>{if(P.current)P.current.close();if(N.current)clearTimeout(N.current)}},[S]);let f=n4.useCallback(()=>{q([])},[]);return SO.jsxDEV(CO.Provider,{value:{connected:G,events:_,lastActivityByAgent:R,activeAgents:O,statusChangeCounter:I,clearEvents:f},children:Y},void 0,!1,void 0,this)}function P6(){let Y=n4.useContext(CO);if(!Y)throw Error("useTelemetryContext must be used within TelemetryProvider");return Y}function wz(Y){let{connected:G,events:U,lastActivityByAgent:_}=P6(),q=n4.default.useMemo(()=>{let O=U;if(Y?.agent_id)O=O.filter((T)=>T.agent_id===Y.agent_id);if(Y?.category)O=O.filter((T)=>T.category===Y.category);if(Y?.limit)O=O.slice(0,Y.limit);return O},[U,Y?.agent_id,Y?.category,Y?.limit]),R=Y?.agent_id?_[Y.agent_id]:void 0,K=n4.default.useMemo(()=>{if(!R)return!1;let O=new Date(R.timestamp).getTime();return Date.now()-O<1e4},[R]);return{connected:G,events:q,lastActivity:R,isActive:K}}function yZ(Y){let{activeAgents:G}=P6(),U=G[Y];return{isActive:!!U,type:U?.type}}function VZ(){let{statusChangeCounter:Y}=P6();return Y}var g4=B0(V1(),1),fO=B0(U1(),1),vO=g4.createContext(null);function b1(){let Y=g4.useContext(vO);if(!Y)throw Error("useAuth must be used within an AuthProvider");return Y}function uH({children:Y}){let[G,U]=g4.useState(null),[_,q]=g4.useState(null),[R,K]=g4.useState(!0),[O,T]=g4.useState(null),[I,b]=g4.useState(!1),P=g4.useRef(null),N=g4.useRef(!1),S=g4.useRef(!1),f=g4.useCallback((u)=>{P.current=u,q(u)},[]),V=g4.useCallback(async()=>{if(N.current)return!1;N.current=!0;try{let u=await fetch("/api/auth/refresh",{method:"POST",credentials:"include"});if(!u.ok)return!1;let r=await u.json();f(r.accessToken);let i=await fetch("/api/auth/me",{headers:{Authorization:`Bearer ${r.accessToken}`}});if(i.ok){let d=await i.json();return U(d.user),!0}return!1}catch(u){return console.error("Token refresh failed:",u),!1}finally{N.current=!1}},[f]),x=g4.useCallback(async()=>{try{let u=P.current,i=await(await fetch("/api/auth/check",{headers:u?{Authorization:`Bearer ${u}`}:{}})).json();if(T(i.hasUsers),b(i.isDev??!1),i.authenticated&&i.user)U(i.user);else if(U(null),i.hasUsers){if(!await V())f(null)}}catch(u){console.error("Auth check failed:",u),U(null),f(null)}finally{K(!1)}},[V,f]),v=g4.useCallback(async(u,r)=>{try{let i=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({username:u,password:r})}),d=await i.json();if(!i.ok)return{success:!1,error:d.error||"Login failed"};return f(d.accessToken),U(d.user),T(!0),{success:!0}}catch(i){return console.error("Login failed:",i),{success:!1,error:"Login failed"}}},[f]),p=g4.useCallback(async()=>{try{let u=P.current;await fetch("/api/auth/logout",{method:"POST",credentials:"include",headers:u?{Authorization:`Bearer ${u}`}:{}})}catch(u){console.error("Logout failed:",u)}finally{U(null),f(null)}},[f]),A=g4.useCallback(async(u,r={})=>{let i=new Headers(r.headers),d=P.current;if(d)i.set("Authorization",`Bearer ${d}`);return fetch(u,{...r,headers:i})},[]),E=g4.useCallback(async()=>{return V()},[V]);g4.useEffect(()=>{if(S.current)return;S.current=!0,x()},[x]),g4.useEffect(()=>{if(!_)return;let u=setInterval(()=>{V()},840000);return()=>clearInterval(u)},[_,V]);let j={user:G,isAuthenticated:!!G,isLoading:R,hasUsers:O,isDev:I,accessToken:_,login:v,logout:p,refreshToken:E,checkAuth:x,authFetch:A};return fO.jsxDEV(vO.Provider,{value:j,children:Y},void 0,!1,void 0,this)}var Y7=B0(V1(),1);var yO=B0(U1(),1),hO=Y7.createContext(null);function R4(){let Y=Y7.useContext(hO);if(!Y)throw Error("useProjects must be used within a ProjectProvider");return Y}var xH="apteva_current_project";function jH({children:Y}){let{authFetch:G,isAuthenticated:U,isLoading:_}=b1(),[q,R]=Y7.useState([]),[K,O]=Y7.useState(()=>{if(typeof window<"u")return localStorage.getItem(xH);return null}),[T,I]=Y7.useState(!0),[b,P]=Y7.useState(null),[N,S]=Y7.useState(0),[f,V]=Y7.useState(!1);Y7.useEffect(()=>{fetch("/api/features").then((r)=>r.json()).then((r)=>{V(r.projects===!0)}).catch(()=>{V(!1)})},[]);let x=Y7.useCallback((r)=>{if(O(r),typeof window<"u")if(r===null)localStorage.removeItem(xH);else localStorage.setItem(xH,r)},[]),v=q.find((r)=>r.id===K)||null,p=Y7.useCallback(async()=>{if(!f){R([]),I(!1);return}if(!U&&!_){R([]),I(!1);return}try{P(null);let r=await G("/api/projects");if(!r.ok)throw Error("Failed to fetch projects");let i=await r.json();if(R(i.projects||[]),S(i.unassignedCount||0),K&&K!=="unassigned"&&!i.projects.find((d)=>d.id===K))x(null)}catch(r){console.error("Failed to fetch projects:",r),P("Failed to load projects")}finally{I(!1)}},[G,U,_,K,x,f]),A=Y7.useCallback(async(r)=>{try{let i=await G("/api/projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!i.ok){let D=await i.json();throw Error(D.error||"Failed to create project")}let d=await i.json();return await p(),d.project}catch(i){return console.error("Failed to create project:",i),null}},[G,p]),E=Y7.useCallback(async(r,i)=>{try{let d=await G(`/api/projects/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(!d.ok){let Q0=await d.json();throw Error(Q0.error||"Failed to update project")}let D=await d.json();return await p(),D.project}catch(d){return console.error("Failed to update project:",d),null}},[G,p]),j=Y7.useCallback(async(r)=>{try{let i=await G(`/api/projects/${r}`,{method:"DELETE"});if(!i.ok){let d=await i.json();throw Error(d.error||"Failed to delete project")}if(K===r)x(null);return await p(),!0}catch(i){return console.error("Failed to delete project:",i),!1}},[G,K,x,p]);Y7.useEffect(()=>{if(!_&&f)p()},[_,f,p]);let u={projects:q,currentProjectId:K,currentProject:v,isLoading:T,error:b,unassignedCount:N,projectsEnabled:f,setCurrentProjectId:x,createProject:A,updateProject:E,deleteProject:j,refreshProjects:p};return yO.jsxDEV(hO.Provider,{value:u,children:Y},void 0,!1,void 0,this)}var r6=B0(V1(),1);function pH(Y){let{accessToken:G}=b1(),[U,_]=r6.useState([]),[q,R]=r6.useState(!0),K=r6.useCallback(()=>{let f={"Content-Type":"application/json"};if(G)f.Authorization=`Bearer ${G}`;return f},[G]),O=r6.useCallback(async()=>{let V=await(await fetch("/api/agents",{headers:K()})).json();_(V.agents||[]),R(!1)},[K]),T=VZ();r6.useEffect(()=>{if(Y&&T>0)O()},[Y,T,O]),r6.useEffect(()=>{if(Y)O()},[Y,O]);let I=async(f)=>{await fetch("/api/agents",{method:"POST",headers:K(),body:JSON.stringify(f)}),await O()},b=async(f)=>{await fetch(`/api/agents/${f}`,{method:"DELETE",headers:K()}),await O()},P=async(f,V)=>{let x=await fetch(`/api/agents/${f}`,{method:"PUT",headers:K(),body:JSON.stringify(V)}),v=await x.json();if(await O(),!x.ok&&v.error)return{error:v.error};return{}},N=async(f)=>{let V=f.status==="running"?"stop":"start",x=await fetch(`/api/agents/${f.id}/${V}`,{method:"POST",headers:K()}),v=await x.json();if(await O(),!x.ok&&v.error)return{error:v.error};return{}},S=U.filter((f)=>f.status==="running").length;return{agents:U,loading:q,runningCount:S,fetchAgents:O,createAgent:I,updateAgent:P,deleteAgent:b,toggleAgent:N}}var Fz=B0(V1(),1);function dH(Y){let{accessToken:G}=b1(),[U,_]=Fz.useState([]),q=Fz.useCallback(()=>{let I={"Content-Type":"application/json"};if(G)I.Authorization=`Bearer ${G}`;return I},[G]),R=Fz.useCallback(async()=>{let b=await(await fetch("/api/providers",{headers:q()})).json();_(b.providers||[])},[q]);Fz.useEffect(()=>{if(Y)R()},[Y,R]);let K=U.filter((I)=>I.hasKey);return{providers:U,configuredProviders:K,fetchProviders:R,saveKey:async(I,b)=>{let N=await(await fetch(`/api/keys/${I}/test`,{method:"POST",headers:q(),body:JSON.stringify({key:b})})).json();if(!N.valid)return{success:!1,error:N.error||"API key is invalid"};let S=await fetch(`/api/keys/${I}`,{method:"POST",headers:q(),body:JSON.stringify({key:b})});if(!S.ok)return{success:!1,error:(await S.json()).error||"Failed to save key"};return await R(),{success:!0}},deleteKey:async(I)=>{await fetch(`/api/keys/${I}`,{method:"DELETE",headers:q()}),await R()}}}var bz=B0(V1(),1);function cH(){let{accessToken:Y,isAuthenticated:G}=b1(),[U,_]=bz.useState(null),q=bz.useCallback(()=>{let K={};if(Y)K.Authorization=`Bearer ${Y}`;return K},[Y]);bz.useEffect(()=>{if(!G){_(null);return}fetch("/api/onboarding/status",{headers:q()}).then((K)=>K.json()).then((K)=>{_(K.completed||K.has_any_keys)}).catch(()=>_(!0))},[G,q]);let R=bz.useCallback(async()=>{await fetch("/api/onboarding/complete",{method:"POST",headers:q()}),_(!0)},[q]);return{isComplete:U,setIsComplete:_,complete:R}}var h8=B0(U1(),1);function Pz({message:Y="Loading...",fullScreen:G=!1}){let U=h8.jsxDEV("div",{className:"flex items-center gap-3 text-[#666]",children:[h8.jsxDEV("svg",{className:"animate-spin h-5 w-5",viewBox:"0 0 24 24",children:[h8.jsxDEV("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"},void 0,!1,void 0,this),h8.jsxDEV("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),h8.jsxDEV("span",{children:Y},void 0,!1,void 0,this)]},void 0,!0,void 0,this);if(G)return h8.jsxDEV("div",{className:"min-h-screen bg-[#0a0a0a] text-[#e0e0e0] font-mono flex items-center justify-center",children:U},void 0,!1,void 0,this);return h8.jsxDEV("div",{className:"flex items-center justify-center py-20",children:U},void 0,!1,void 0,this)}var s6=B0(V1(),1),_7=B0(U1(),1);function vQ({children:Y,onClose:G}){return _7.jsxDEV("div",{className:"fixed inset-0 bg-black/70 flex items-center justify-center z-50 p-4",children:_7.jsxDEV("div",{className:"bg-[#111] rounded p-6 w-full max-w-xl lg:max-w-2xl border border-[#1a1a1a] max-h-[90vh] overflow-y-auto",children:Y},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function eP({title:Y,message:G,confirmText:U="Confirm",cancelText:_="Cancel",confirmVariant:q="danger",onConfirm:R,onCancel:K}){return _7.jsxDEV("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:_7.jsxDEV("div",{className:"bg-[#111] border border-[#333] rounded-lg p-6 w-full max-w-sm",children:[Y&&_7.jsxDEV("h3",{className:"font-medium mb-2",children:Y},void 0,!1,void 0,this),_7.jsxDEV("p",{className:"text-sm text-[#ccc] mb-4",children:G},void 0,!1,void 0,this),_7.jsxDEV("div",{className:"flex gap-2",children:[_7.jsxDEV("button",{onClick:K,className:"flex-1 text-sm bg-[#1a1a1a] hover:bg-[#222] border border-[#333] px-4 py-2 rounded transition",children:_},void 0,!1,void 0,this),_7.jsxDEV("button",{onClick:R,className:`flex-1 text-sm text-white px-4 py-2 rounded transition ${q==="danger"?"bg-red-500 hover:bg-red-600":"bg-[#f97316] hover:bg-[#ea580c]"}`,children:U},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function zA({title:Y,message:G,buttonText:U="OK",variant:_="info",onClose:q}){let R={error:"bg-red-500/20 text-red-400",success:"bg-green-500/20 text-green-400",info:"bg-blue-500/20 text-blue-400"},K={error:"✕",success:"✓",info:"ℹ"};return _7.jsxDEV("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:_7.jsxDEV("div",{className:"bg-[#111] border border-[#333] rounded-lg p-6 w-full max-w-sm text-center",children:[_7.jsxDEV("div",{className:`w-12 h-12 rounded-full flex items-center justify-center mx-auto mb-3 ${R[_]}`,children:_7.jsxDEV("span",{className:"text-xl",children:K[_]},void 0,!1,void 0,this)},void 0,!1,void 0,this),Y&&_7.jsxDEV("h3",{className:"font-medium mb-2",children:Y},void 0,!1,void 0,this),_7.jsxDEV("p",{className:"text-sm text-[#ccc] mb-4",children:G},void 0,!1,void 0,this),_7.jsxDEV("button",{onClick:q,className:"w-full text-sm bg-[#1a1a1a] hover:bg-[#222] border border-[#333] px-4 py-2 rounded transition",children:U},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function o7(){let[Y,G]=s6.useState(null),U=s6.useCallback((K,O={})=>{return new Promise((T)=>{G({message:K,options:O,resolve:T})})},[]),_=s6.useCallback(()=>{Y?.resolve(!0),G(null)},[Y]),q=s6.useCallback(()=>{Y?.resolve(!1),G(null)},[Y]),R=Y?_7.jsxDEV(eP,{title:Y.options.title,message:Y.message,confirmText:Y.options.confirmText,cancelText:Y.options.cancelText,confirmVariant:Y.options.confirmVariant,onConfirm:_,onCancel:q},void 0,!1,void 0,this):null;return{confirm:U,ConfirmDialog:R}}function DZ(){let[Y,G]=s6.useState(null),U=s6.useCallback((R,K={})=>{return new Promise((O)=>{G({message:R,options:K,resolve:O})})},[]),_=s6.useCallback(()=>{Y?.resolve(),G(null)},[Y]),q=Y?_7.jsxDEV(zA,{title:Y.options.title,message:Y.message,buttonText:Y.options.buttonText,variant:Y.options.variant,onClose:_},void 0,!1,void 0,this):null;return{alert:U,AlertDialog:q}}var fQ=B0(V1(),1),g7=B0(U1(),1);function r4({value:Y,options:G,onChange:U,placeholder:_="Select..."}){let[q,R]=fQ.useState(!1),K=fQ.useRef(null),O=G.find((T)=>T.value===Y);return fQ.useEffect(()=>{function T(I){if(K.current&&!K.current.contains(I.target))R(!1)}return document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[]),g7.jsxDEV("div",{ref:K,className:"relative",children:[g7.jsxDEV("button",{type:"button",onClick:()=>R(!q),className:"w-full bg-[#0a0a0a] border border-[#222] rounded px-3 py-2 text-left flex items-center justify-between focus:outline-none focus:border-[#f97316] text-[#e0e0e0] hover:border-[#333] transition",children:[g7.jsxDEV("span",{className:O?"text-[#e0e0e0]":"text-[#666]",children:O?g7.jsxDEV(g7.Fragment,{children:[O.label,O.recommended&&g7.jsxDEV("span",{className:"text-[#f97316] text-xs ml-2",children:"(Recommended)"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):_},void 0,!1,void 0,this),g7.jsxDEV(QA,{isOpen:q},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q&&g7.jsxDEV("div",{className:"absolute z-50 w-full min-w-max mt-1 bg-[#111] border border-[#222] rounded shadow-lg max-h-60 overflow-y-auto scrollbar-hide",children:G.map((T)=>g7.jsxDEV("button",{type:"button",onClick:()=>{U(T.value),R(!1)},className:`w-full px-3 py-2 text-left flex items-center justify-between hover:bg-[#1a1a1a] transition ${T.value===Y?"bg-[#1a1a1a] text-[#f97316]":"text-[#e0e0e0]"}`,children:[g7.jsxDEV("span",{children:[T.label,T.recommended&&g7.jsxDEV("span",{className:"text-[#f97316] text-xs ml-2",children:"(Recommended)"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),T.value===Y&&g7.jsxDEV("svg",{className:"w-4 h-4 text-[#f97316]",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:g7.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},T.value,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function QA({isOpen:Y}){return g7.jsxDEV("svg",{className:`w-4 h-4 text-[#666] transition-transform ${Y?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:g7.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"},void 0,!1,void 0,this)},void 0,!1,void 0,this)}var m1=B0(U1(),1);function a7({className:Y="w-4 h-4"}){return m1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function E5({className:Y="w-5 h-5"}){return m1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function q2({className:Y="w-5 h-5"}){return m1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z"},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function U2({className:Y="w-5 h-5"}){return m1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function B2({className:Y="w-5 h-5"}){return m1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[m1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"},void 0,!1,void 0,this),m1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function Az({className:Y="w-4 h-4"}){return m1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z"},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function u5({className:Y="w-4 h-4"}){return m1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function Iz({className:Y="w-4 h-4"}){return m1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[m1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"},void 0,!1,void 0,this),m1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function Tz({className:Y="w-4 h-4"}){return m1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function x5({className:Y="w-4 h-4"}){return m1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function mZ({className:Y="w-4 h-4"}){return m1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z"},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function kz({className:Y="w-4 h-4"}){return m1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 11a7 7 0 01-7 7m0 0a7 7 0 01-7-7m7 7v4m0 0H8m4 0h4m-4-8a3 3 0 01-3-3V5a3 3 0 116 0v6a3 3 0 01-3 3z"},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function lH({className:Y="w-4 h-4"}){return m1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function VO({className:Y="w-4 h-4"}){return m1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function hQ({className:Y="w-4 h-4"}){return m1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function yQ({className:Y="w-4 h-4"}){return m1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function DO({className:Y="w-5 h-5"}){return m1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function mO({className:Y="w-4 h-4"}){return m1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function gO({className:Y="w-4 h-4"}){return m1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function iH({className:Y="w-4 h-4"}){return m1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"},void 0,!1,void 0,this)},void 0,!1,void 0,this)}var YG=B0(V1(),1);var C5=B0(V1(),1);var H4=B0(V1(),1),gQ=B0(V1(),1),Sz=B0(V1(),1);function EO(Y){var G,U,_="";if(typeof Y=="string"||typeof Y=="number")_+=Y;else if(typeof Y=="object")if(Array.isArray(Y)){var q=Y.length;for(G=0;G<q;G++)Y[G]&&(U=EO(Y[G]))&&(_&&(_+=" "),_+=U)}else for(U in Y)Y[U]&&(_&&(_+=" "),_+=U);return _}function uO(){for(var Y,G,U=0,_="",q=arguments.length;U<q;U++)(Y=arguments[U])&&(G=EO(Y))&&(_&&(_+=" "),_+=G);return _}var XA=(Y)=>{let G=JA(Y),{conflictingClassGroups:U,conflictingClassGroupModifiers:_}=Y;return{getClassGroupId:(K)=>{let O=K.split("-");if(O[0]===""&&O.length!==1)O.shift();return pO(O,G)||ZA(K)},getConflictingClassGroupIds:(K,O)=>{let T=U[K]||[];if(O&&_[K])return[...T,..._[K]];return T}}},pO=(Y,G)=>{if(Y.length===0)return G.classGroupId;let U=Y[0],_=G.nextPart.get(U),q=_?pO(Y.slice(1),_):void 0;if(q)return q;if(G.validators.length===0)return;let R=Y.join("-");return G.validators.find(({validator:K})=>K(R))?.classGroupId},xO=/^\[(.+)\]$/,ZA=(Y)=>{if(xO.test(Y)){let G=xO.exec(Y)[1],U=G?.substring(0,G.indexOf(":"));if(U)return"arbitrary.."+U}},JA=(Y)=>{let{theme:G,prefix:U}=Y,_={nextPart:new Map,validators:[]};return $A(Object.entries(Y.classGroups),U).forEach(([R,K])=>{aH(K,_,R,G)}),_},aH=(Y,G,U,_)=>{Y.forEach((q)=>{if(typeof q==="string"){let R=q===""?G:jO(G,q);R.classGroupId=U;return}if(typeof q==="function"){if(YA(q)){aH(q(_),G,U,_);return}G.validators.push({validator:q,classGroupId:U});return}Object.entries(q).forEach(([R,K])=>{aH(K,jO(G,R),U,_)})})},jO=(Y,G)=>{let U=Y;return G.split("-").forEach((_)=>{if(!U.nextPart.has(_))U.nextPart.set(_,{nextPart:new Map,validators:[]});U=U.nextPart.get(_)}),U},YA=(Y)=>Y.isThemeGetter,$A=(Y,G)=>{if(!G)return Y;return Y.map(([U,_])=>{let q=_.map((R)=>{if(typeof R==="string")return G+R;if(typeof R==="object")return Object.fromEntries(Object.entries(R).map(([K,O])=>[G+K,O]));return R});return[U,q]})},HA=(Y)=>{if(Y<1)return{get:()=>{return},set:()=>{}};let G=0,U=new Map,_=new Map,q=(R,K)=>{if(U.set(R,K),G++,G>Y)G=0,_=U,U=new Map};return{get(R){let K=U.get(R);if(K!==void 0)return K;if((K=_.get(R))!==void 0)return q(R,K),K},set(R,K){if(U.has(R))U.set(R,K);else q(R,K)}}};var GA=(Y)=>{let{separator:G,experimentalParseClassName:U}=Y,_=G.length===1,q=G[0],R=G.length,K=(O)=>{let T=[],I=0,b=0,P;for(let x=0;x<O.length;x++){let v=O[x];if(I===0){if(v===q&&(_||O.slice(x,x+R)===G)){T.push(O.slice(b,x)),b=x+R;continue}if(v==="/"){P=x;continue}}if(v==="[")I++;else if(v==="]")I--}let N=T.length===0?O:O.substring(b),S=N.startsWith("!"),f=S?N.substring(1):N,V=P&&P>b?P-b:void 0;return{modifiers:T,hasImportantModifier:S,baseClassName:f,maybePostfixModifierPosition:V}};if(U)return(O)=>U({className:O,parseClassName:K});return K},qA=(Y)=>{if(Y.length<=1)return Y;let G=[],U=[];return Y.forEach((_)=>{if(_[0]==="[")G.push(...U.sort(),_),U=[];else U.push(_)}),G.push(...U.sort()),G},UA=(Y)=>({cache:HA(Y.cacheSize),parseClassName:GA(Y),...XA(Y)}),BA=/\s+/,WA=(Y,G)=>{let{parseClassName:U,getClassGroupId:_,getConflictingClassGroupIds:q}=G,R=[],K=Y.trim().split(BA),O="";for(let T=K.length-1;T>=0;T-=1){let I=K[T],{modifiers:b,hasImportantModifier:P,baseClassName:N,maybePostfixModifierPosition:S}=U(I),f=Boolean(S),V=_(f?N.substring(0,S):N);if(!V){if(!f){O=I+(O.length>0?" "+O:O);continue}if(V=_(N),!V){O=I+(O.length>0?" "+O:O);continue}f=!1}let x=qA(b).join(":"),v=P?x+"!":x,p=v+V;if(R.includes(p))continue;R.push(p);let A=q(V,f);for(let E=0;E<A.length;++E){let j=A[E];R.push(v+j)}O=I+(O.length>0?" "+O:O)}return O};function OA(){let Y=0,G,U,_="";while(Y<arguments.length)if(G=arguments[Y++]){if(U=dO(G))_&&(_+=" "),_+=U}return _}var dO=(Y)=>{if(typeof Y==="string")return Y;let G,U="";for(let _=0;_<Y.length;_++)if(Y[_]){if(G=dO(Y[_]))U&&(U+=" "),U+=G}return U};function KA(Y,...G){let U,_,q,R=K;function K(T){let I=G.reduce((b,P)=>P(b),Y());return U=UA(I),_=U.cache.get,q=U.cache.set,R=O,O(T)}function O(T){let I=_(T);if(I)return I;let b=WA(T,U);return q(T,b),b}return function(){return R(OA.apply(null,arguments))}}var E4=(Y)=>{let G=(U)=>U[Y]||[];return G.isThemeGetter=!0,G},cO=/^\[(?:([a-z-]+):)?(.+)\]$/i,_A=/^\d+\/\d+$/,LA=new Set(["px","full","screen"]),RA=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,NA=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,MA=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,wA=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,FA=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,t6=(Y)=>VQ(Y)||LA.has(Y)||_A.test(Y),y8=(Y)=>DQ(Y,"length",SA),VQ=(Y)=>Boolean(Y)&&!Number.isNaN(Number(Y)),oH=(Y)=>DQ(Y,"number",VQ),gZ=(Y)=>Boolean(Y)&&Number.isInteger(Number(Y)),bA=(Y)=>Y.endsWith("%")&&VQ(Y.slice(0,-1)),E1=(Y)=>cO.test(Y),V8=(Y)=>RA.test(Y),PA=new Set(["length","size","percentage"]),AA=(Y)=>DQ(Y,PA,lO),IA=(Y)=>DQ(Y,"position",lO),TA=new Set(["image","url"]),kA=(Y)=>DQ(Y,TA,fA),CA=(Y)=>DQ(Y,"",vA),EZ=()=>!0,DQ=(Y,G,U)=>{let _=cO.exec(Y);if(_){if(_[1])return typeof G==="string"?_[1]===G:G.has(_[1]);return U(_[2])}return!1},SA=(Y)=>NA.test(Y)&&!MA.test(Y),lO=()=>!1,vA=(Y)=>wA.test(Y),fA=(Y)=>FA.test(Y);var hA=()=>{let Y=E4("colors"),G=E4("spacing"),U=E4("blur"),_=E4("brightness"),q=E4("borderColor"),R=E4("borderRadius"),K=E4("borderSpacing"),O=E4("borderWidth"),T=E4("contrast"),I=E4("grayscale"),b=E4("hueRotate"),P=E4("invert"),N=E4("gap"),S=E4("gradientColorStops"),f=E4("gradientColorStopPositions"),V=E4("inset"),x=E4("margin"),v=E4("opacity"),p=E4("padding"),A=E4("saturate"),E=E4("scale"),j=E4("sepia"),u=E4("skew"),r=E4("space"),i=E4("translate"),d=()=>["auto","contain","none"],D=()=>["auto","hidden","clip","visible","scroll"],Q0=()=>["auto",E1,G],n=()=>[E1,G],G0=()=>["",t6,y8],F0=()=>["auto",VQ,E1],K0=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],S0=()=>["solid","dashed","dotted","double","none"],P0=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],a=()=>["start","end","center","between","around","evenly","stretch"],Y0=()=>["","0",E1],U0=()=>["auto","avoid","all","avoid-page","page","left","right","column"],H0=()=>[VQ,E1];return{cacheSize:500,separator:":",theme:{colors:[EZ],spacing:[t6,y8],blur:["none","",V8,E1],brightness:H0(),borderColor:[Y],borderRadius:["none","","full",V8,E1],borderSpacing:n(),borderWidth:G0(),contrast:H0(),grayscale:Y0(),hueRotate:H0(),invert:Y0(),gap:n(),gradientColorStops:[Y],gradientColorStopPositions:[bA,y8],inset:Q0(),margin:Q0(),opacity:H0(),padding:n(),saturate:H0(),scale:H0(),sepia:Y0(),skew:H0(),space:n(),translate:n()},classGroups:{aspect:[{aspect:["auto","square","video",E1]}],container:["container"],columns:[{columns:[V8]}],"break-after":[{"break-after":U0()}],"break-before":[{"break-before":U0()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...K0(),E1]}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],overscroll:[{overscroll:d()}],"overscroll-x":[{"overscroll-x":d()}],"overscroll-y":[{"overscroll-y":d()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[V]}],"inset-x":[{"inset-x":[V]}],"inset-y":[{"inset-y":[V]}],start:[{start:[V]}],end:[{end:[V]}],top:[{top:[V]}],right:[{right:[V]}],bottom:[{bottom:[V]}],left:[{left:[V]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",gZ,E1]}],basis:[{basis:Q0()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",E1]}],grow:[{grow:Y0()}],shrink:[{shrink:Y0()}],order:[{order:["first","last","none",gZ,E1]}],"grid-cols":[{"grid-cols":[EZ]}],"col-start-end":[{col:["auto",{span:["full",gZ,E1]},E1]}],"col-start":[{"col-start":F0()}],"col-end":[{"col-end":F0()}],"grid-rows":[{"grid-rows":[EZ]}],"row-start-end":[{row:["auto",{span:[gZ,E1]},E1]}],"row-start":[{"row-start":F0()}],"row-end":[{"row-end":F0()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",E1]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",E1]}],gap:[{gap:[N]}],"gap-x":[{"gap-x":[N]}],"gap-y":[{"gap-y":[N]}],"justify-content":[{justify:["normal",...a()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...a(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...a(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[p]}],px:[{px:[p]}],py:[{py:[p]}],ps:[{ps:[p]}],pe:[{pe:[p]}],pt:[{pt:[p]}],pr:[{pr:[p]}],pb:[{pb:[p]}],pl:[{pl:[p]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[r]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[r]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",E1,G]}],"min-w":[{"min-w":[E1,G,"min","max","fit"]}],"max-w":[{"max-w":[E1,G,"none","full","min","max","fit","prose",{screen:[V8]},V8]}],h:[{h:[E1,G,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[E1,G,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[E1,G,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[E1,G,"auto","min","max","fit"]}],"font-size":[{text:["base",V8,y8]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",oH]}],"font-family":[{font:[EZ]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",E1]}],"line-clamp":[{"line-clamp":["none",VQ,oH]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",t6,E1]}],"list-image":[{"list-image":["none",E1]}],"list-style-type":[{list:["none","disc","decimal",E1]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[Y]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[Y]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...S0(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",t6,y8]}],"underline-offset":[{"underline-offset":["auto",t6,E1]}],"text-decoration-color":[{decoration:[Y]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:n()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",E1]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",E1]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...K0(),IA]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",AA]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},kA]}],"bg-color":[{bg:[Y]}],"gradient-from-pos":[{from:[f]}],"gradient-via-pos":[{via:[f]}],"gradient-to-pos":[{to:[f]}],"gradient-from":[{from:[S]}],"gradient-via":[{via:[S]}],"gradient-to":[{to:[S]}],rounded:[{rounded:[R]}],"rounded-s":[{"rounded-s":[R]}],"rounded-e":[{"rounded-e":[R]}],"rounded-t":[{"rounded-t":[R]}],"rounded-r":[{"rounded-r":[R]}],"rounded-b":[{"rounded-b":[R]}],"rounded-l":[{"rounded-l":[R]}],"rounded-ss":[{"rounded-ss":[R]}],"rounded-se":[{"rounded-se":[R]}],"rounded-ee":[{"rounded-ee":[R]}],"rounded-es":[{"rounded-es":[R]}],"rounded-tl":[{"rounded-tl":[R]}],"rounded-tr":[{"rounded-tr":[R]}],"rounded-br":[{"rounded-br":[R]}],"rounded-bl":[{"rounded-bl":[R]}],"border-w":[{border:[O]}],"border-w-x":[{"border-x":[O]}],"border-w-y":[{"border-y":[O]}],"border-w-s":[{"border-s":[O]}],"border-w-e":[{"border-e":[O]}],"border-w-t":[{"border-t":[O]}],"border-w-r":[{"border-r":[O]}],"border-w-b":[{"border-b":[O]}],"border-w-l":[{"border-l":[O]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...S0(),"hidden"]}],"divide-x":[{"divide-x":[O]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[O]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:S0()}],"border-color":[{border:[q]}],"border-color-x":[{"border-x":[q]}],"border-color-y":[{"border-y":[q]}],"border-color-s":[{"border-s":[q]}],"border-color-e":[{"border-e":[q]}],"border-color-t":[{"border-t":[q]}],"border-color-r":[{"border-r":[q]}],"border-color-b":[{"border-b":[q]}],"border-color-l":[{"border-l":[q]}],"divide-color":[{divide:[q]}],"outline-style":[{outline:["",...S0()]}],"outline-offset":[{"outline-offset":[t6,E1]}],"outline-w":[{outline:[t6,y8]}],"outline-color":[{outline:[Y]}],"ring-w":[{ring:G0()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[Y]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[t6,y8]}],"ring-offset-color":[{"ring-offset":[Y]}],shadow:[{shadow:["","inner","none",V8,CA]}],"shadow-color":[{shadow:[EZ]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...P0(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":P0()}],filter:[{filter:["","none"]}],blur:[{blur:[U]}],brightness:[{brightness:[_]}],contrast:[{contrast:[T]}],"drop-shadow":[{"drop-shadow":["","none",V8,E1]}],grayscale:[{grayscale:[I]}],"hue-rotate":[{"hue-rotate":[b]}],invert:[{invert:[P]}],saturate:[{saturate:[A]}],sepia:[{sepia:[j]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[U]}],"backdrop-brightness":[{"backdrop-brightness":[_]}],"backdrop-contrast":[{"backdrop-contrast":[T]}],"backdrop-grayscale":[{"backdrop-grayscale":[I]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[b]}],"backdrop-invert":[{"backdrop-invert":[P]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[A]}],"backdrop-sepia":[{"backdrop-sepia":[j]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[K]}],"border-spacing-x":[{"border-spacing-x":[K]}],"border-spacing-y":[{"border-spacing-y":[K]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",E1]}],duration:[{duration:H0()}],ease:[{ease:["linear","in","out","in-out",E1]}],delay:[{delay:H0()}],animate:[{animate:["none","spin","ping","pulse","bounce",E1]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[gZ,E1]}],"translate-x":[{"translate-x":[i]}],"translate-y":[{"translate-y":[i]}],"skew-x":[{"skew-x":[u]}],"skew-y":[{"skew-y":[u]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",E1]}],accent:[{accent:["auto",Y]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",E1]}],"caret-color":[{caret:[Y]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":n()}],"scroll-mx":[{"scroll-mx":n()}],"scroll-my":[{"scroll-my":n()}],"scroll-ms":[{"scroll-ms":n()}],"scroll-me":[{"scroll-me":n()}],"scroll-mt":[{"scroll-mt":n()}],"scroll-mr":[{"scroll-mr":n()}],"scroll-mb":[{"scroll-mb":n()}],"scroll-ml":[{"scroll-ml":n()}],"scroll-p":[{"scroll-p":n()}],"scroll-px":[{"scroll-px":n()}],"scroll-py":[{"scroll-py":n()}],"scroll-ps":[{"scroll-ps":n()}],"scroll-pe":[{"scroll-pe":n()}],"scroll-pt":[{"scroll-pt":n()}],"scroll-pr":[{"scroll-pr":n()}],"scroll-pb":[{"scroll-pb":n()}],"scroll-pl":[{"scroll-pl":n()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",E1]}],fill:[{fill:[Y,"none"]}],"stroke-w":[{stroke:[t6,y8,oH]}],stroke:[{stroke:[Y,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var iO=KA(hA);var zK=B0(V1(),1),Y6=B0(k4(),1),EQ=B0(V1(),1),E7=B0(k4(),1),QK=B0(k4(),1),zG=B0(k4(),1),uQ=B0(V1(),1),s4=B0(k4(),1),XK=B0(V1(),1),L7=B0(k4(),1),xZ=B0(k4(),1),E0=B0(k4(),1),_5=B0(k4(),1),XG=B0(k4(),1),G1=B0(k4(),1),x4=B0(k4(),1),Z4=B0(k4(),1),o0=B0(k4(),1),T1=B0(k4(),1),uZ=B0(k4(),1),A6=B0(V1(),1),F1=B0(k4(),1),z8=B0(V1(),1),z1=B0(k4(),1),$5=B0(k4(),1),FI=B0(V1(),1),ZK=B0(k4(),1),ZG=B0(V1(),1),JG=B0(k4(),1),bI=B0(V1(),1),JK=B0(k4(),1),YK=B0(V1(),1),$K=B0(k4(),1),PI=B0(V1(),1),HK=B0(k4(),1),GK=B0(k4(),1),qK=B0(k4(),1),VA=Object.defineProperty,DA=(Y,G,U)=>(G in Y)?VA(Y,G,{enumerable:!0,configurable:!0,writable:!0,value:U}):Y[G]=U,mA=(Y,G,U)=>DA(Y,typeof G!=="symbol"?G+"":G,U);function b4(...Y){return iO(uO(Y))}var EC=[{id:"msg-1",role:"assistant",content:"Hello! I'm your AI assistant. How can I help you today?",timestamp:new Date(Date.now()-3600000)},{id:"msg-2",role:"user",content:"I want to plan a trip to Europe",timestamp:new Date(Date.now()-3500000)},{id:"msg-3",role:"assistant",content:"Great choice! Europe has amazing destinations. What's your budget and how many days do you have?",timestamp:new Date(Date.now()-3400000)},{id:"msg-4",role:"user",content:"Around $2000 for 5 days",timestamp:new Date(Date.now()-3300000)},{id:"msg-5",role:"assistant",content:"Perfect! I found some great destinations that fit your budget:",widgets:[{type:"list",id:"destinations-1",props:{items:[{id:"paris",title:"Paris, France",subtitle:"5 days • $1,850",description:"The City of Light with iconic landmarks",metadata:{city:"Paris",country:"France",lat:48.8566,lng:2.3522,price:1850,days:5}},{id:"rome",title:"Rome, Italy",subtitle:"5 days • $1,650",description:"Ancient history meets modern culture",metadata:{city:"Rome",country:"Italy",lat:41.9028,lng:12.4964,price:1650,days:5}},{id:"barcelona",title:"Barcelona, Spain",subtitle:"5 days • $1,450",description:"Beautiful beaches and Gaudí architecture",metadata:{city:"Barcelona",country:"Spain",lat:41.3851,lng:2.1734,price:1450,days:5}}]},actions:[{type:"select_destination",label:"Select",handler:"client",payload:{}},{type:"view_details",label:"Details",handler:"server",payload:{}}]}],timestamp:new Date(Date.now()-3200000)}],uC=[{id:"thread-1",title:"Trip to Europe",preview:"Planning a 5-day trip...",createdAt:new Date(Date.now()-86400000),updatedAt:new Date(Date.now()-3600000),messageCount:12},{id:"thread-2",title:"Restaurant Recommendations",preview:"Looking for good places...",createdAt:new Date(Date.now()-172800000),updatedAt:new Date(Date.now()-86400000),messageCount:8},{id:"thread-3",title:"Budget Planning",preview:"Help with monthly budget",createdAt:new Date(Date.now()-259200000),updatedAt:new Date(Date.now()-172800000),messageCount:15}];function gA(Y=1000){return new Promise((G)=>{setTimeout(()=>{G({id:`msg-${Date.now()}`,role:"assistant",content:"This is a mock response. In production, this would come from your AI agent API.",timestamp:new Date})},Y)})}function EA(Y){let G=Y.toLowerCase();if(G.includes("analyze")||G.includes("analysis"))return`Analysis complete for "${Y}". Found 247 records with an average value of $1,234. The data shows a 23% increase compared to last quarter. Key insights: Revenue is up, customer satisfaction improved by 15%, and operational costs decreased by 8%.`;if(G.includes("sales")||G.includes("revenue"))return"Sales data processed: Q4 2024 revenue reached $2.4M, representing 18% growth year-over-year. Top performing products: Enterprise Plan (+45%), Pro Plan (+32%), Basic Plan (+12%). Regional breakdown: North America (52%), Europe (31%), APAC (17%).";if(G.includes("report")||G.includes("summary"))return"Report generated successfully. Executive Summary: Overall performance exceeded targets by 12%. Marketing ROI improved to 3.2x, customer acquisition cost reduced by 18%, and lifetime value increased by 24%. Detailed breakdown available in attached widgets.";if(G.includes("data")||G.includes("metrics"))return"Data metrics retrieved: 1,847 active users, 12,394 sessions this month, 94.2% uptime, average response time 127ms. Performance is within acceptable parameters. No critical issues detected.";if(G.includes("customer")||G.includes("user"))return"Customer analysis complete: 523 new customers this month, 89% retention rate, average satisfaction score 4.6/5. Top feedback themes: excellent support (87%), easy to use (72%), good value (68%). 3 support tickets pending review.";return"This is a mock response showing how your agent would process and respond to commands. The actual response would be generated by your AI agent based on real data and context."}function uA(Y){let G=EA(Y),U=Y.toLowerCase(),_=[],q;if(U.includes("sales")||U.includes("revenue")||U.includes("analyze"))_.push({type:"card",id:`widget-${Date.now()}-1`,props:{title:"Q4 2024 Performance",description:"Revenue: $2.4M (+18% YoY)",footer:"Updated: "+new Date().toLocaleDateString()},actions:[{type:"view_details",label:"View Details",handler:"client",payload:{reportId:"q4-2024"}}]});if(U.includes("customer")||U.includes("user"))_.push({type:"list",id:`widget-${Date.now()}-2`,props:{items:[{id:"metric-1",title:"Active Users",subtitle:"1,847 users",description:"+12% from last month"},{id:"metric-2",title:"Retention Rate",subtitle:"89%",description:"Above industry average"},{id:"metric-3",title:"Satisfaction Score",subtitle:"4.6/5",description:"Based on 234 reviews"}]}});if(U.includes("task")||U.includes("todo")||U.includes("work")||U.includes("completed"))_.push({type:"list",id:`widget-${Date.now()}-tasks`,props:{items:[{id:"task-1",title:"Implement user authentication",subtitle:"Created just now",description:"Added OAuth 2.0 support with Google and GitHub providers",backgroundColor:"rgba(59, 130, 246, 0.15)",metadata:{status:"created",priority:"high",tags:["backend","security"]}},{id:"task-2",title:"Update API documentation",subtitle:"Modified 2 minutes ago",description:"Changed endpoint descriptions and added new examples",backgroundColor:"rgba(234, 179, 8, 0.15)",metadata:{status:"modified",priority:"medium",tags:["docs"]}},{id:"task-3",title:"Fix login redirect bug",subtitle:"Completed 5 minutes ago",description:"Users now properly redirected after successful login",backgroundColor:"rgba(34, 197, 94, 0.15)",metadata:{status:"completed",priority:"urgent",tags:["bugfix","auth"]}}]},actions:[{type:"view_task",label:"View",handler:"client",payload:{}},{type:"undo",label:"Undo",handler:"server",payload:{}}]}),q={type:"update_database",payload:{table:"tasks",operation:"mark_as_viewed",taskIds:["task-1","task-2","task-3"],timestamp:new Date().toISOString()}};if(U.includes("analyze")||U.includes("analysis"))q={type:"send_notification",payload:{recipient:"team@company.com",subject:"Analysis Complete",message:"Your requested analysis has been completed and is ready for review."}};return{message:G,widgets:_,action:q}}function xA(Y,G,U,_,q=30){let{message:R,widgets:K}=uA(Y),O=R.split(" "),T=0,I=setInterval(()=>{try{if(T<O.length)G({type:"token",content:O[T]+" "}),T++;else{clearInterval(I),K.forEach((P)=>{G({type:"widget",widget:P})});let b=`mock_thread_${Date.now()}`;G({type:"complete"}),U(b)}}catch(b){clearInterval(I),_(b instanceof Error?b:Error("Mock streaming error"))}},q)}function jA(Y){return new Promise((G,U)=>{let _=new FileReader;_.onload=()=>{let R=_.result.split(",")[1];G(R)},_.onerror=()=>U(Error("Failed to read file")),_.readAsDataURL(Y)})}function pA(Y){if(Y.startsWith("image/"))return"image";return"document"}function dA(Y){return["image/jpeg","image/png","image/gif","image/webp","application/pdf","text/plain","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"].includes(Y.type)}async function cA(Y){let G=await jA(Y);return{type:pA(Y.type),source:{type:"base64",media_type:Y.type,data:G}}}async function lA(Y){let G=Array.from(Y);return await Promise.all(G.map((_)=>cA(_)))}async function oO(Y,G){if(!G||G.length===0)return Y;let U=[];if(Y.trim())U.push({type:"text",text:Y.trim()});let _=await lA(G);return U.push(..._),U}function O2(Y){if(Y<1024)return`${Y} B`;if(Y<1048576)return`${(Y/1024).toFixed(1)} KB`;return`${(Y/1048576).toFixed(1)} MB`}var aO=10485760;function sO(Y){if(!dA(Y))return{valid:!1,error:`Unsupported file type: ${Y.type}`};if(Y.size>aO)return{valid:!1,error:`File too large: ${O2(Y.size)} (max ${O2(aO)})`};return{valid:!0}}var iA=["list","table"];function oA(Y){let G=[],U=!1,_=Y.match(/"items"\s*:\s*\[/);if(!_)return{items:G,isStreaming:!1};let q=Y.indexOf("[",_.index);if(q===-1)return{items:G,isStreaming:!0};let R=0,K=!1,O=!1,T=-1;for(let P=q+1;P<Y.length;P++){let N=Y[P];if(O){O=!1;continue}if(N==="\\"&&K){O=!0;continue}if(N==='"'){K=!K;continue}if(K)continue;if(N==="{"){if(R===0)T=P;R++}else if(N==="}"){if(R--,R===0&&T!==-1){let S=Y.slice(T,P+1);try{let f=JSON.parse(S);if(!f.id)f.id=`item-${G.length}-${tH(S)}`;G.push(f)}catch(f){}T=-1}}else if(N==="]"&&R===0){U=!1;break}}if(R>0||T!==-1)U=!0;let I=Y.slice(q);if(eH(I,0)===-1)U=!0;return{items:G,isStreaming:U}}function tH(Y){let G=0;for(let U=0;U<Y.length;U++){let _=Y.charCodeAt(U);G=(G<<5)-G+_,G=G&G}return Math.abs(G).toString(36)}function eH(Y,G){let U=0,_=!1,q=!1;for(let R=G;R<Y.length;R++){let K=Y[R];if(q){q=!1;continue}if(K==="\\"&&_){q=!0;continue}if(K==='"'){_=!_;continue}if(_)continue;if(K==="["||K==="{")U++;else if(K==="]"||K==="}"){if(U--,U===0)return R}}return-1}function W2(Y){let G=[],U=!1,_=!1,q=0,R=null,K=Y,O=Y.lastIndexOf("@ui:");if(O!==-1){let b=Y.slice(O),P=b.match(/^@ui:(\w+)/);if(P){let N=P[1],S=b.indexOf("[");if(S===-1)K=Y.slice(0,O),R=N,_=!0;else{let f=O+S;if(eH(Y,f)===-1)if(iA.includes(N)){let x=Y.slice(f+1),{items:v,isStreaming:p}=oA(x);if(v.length>0){K=Y.slice(0,O);let A=`widget-${N}-streaming-${tH(x)}`,E=K.replace(/[\s:;\-–—\.]+$/g,"").trim();if(E)G.push({type:"text",content:E});G.push({type:"widget",widget:{type:N,id:A,props:N==="table"?{rows:v,columns:[]}:{items:v},isStreaming:p}}),U=!0,_=!1,K=""}else K=Y.slice(0,O),R=N,_=!0}else K=Y.slice(0,O),R=N,_=!0}}}if(_)K=K.replace(/[\s:;\-–—\.]+$/g,"");let T=/@ui:(\w+)\[/g,I;while((I=T.exec(K))!==null){let b=I[1],P=I.index+I[0].length-1,N=eH(K,P);if(N===-1)continue;let S=K.slice(P+1,N);if(I.index>q){let f=K.slice(q,I.index).trim();if(f)G.push({type:"text",content:f})}try{let f=S.trim(),V=JSON.parse(f),x=`widget-${b}-${tH(f)}`,{metadata:v,actions:p,...A}=V;G.push({type:"widget",widget:{type:b,id:x,props:A,...p&&{actions:p},...v&&{metadata:v}}}),U=!0}catch(f){}q=N+1,T.lastIndex=q}if(q<K.length){let b=K.slice(q).trim();if(b)G.push({type:"text",content:b})}if(G.length===0&&K.trim())G.push({type:"text",content:K.trim()});if(R)G.push({type:"widget_pending",pendingType:R});return{segments:G,hasWidgets:U,hasPendingWidget:_}}var tO={card:{schema:"title, description?, image?, footer?, actions?: [{type, label}]",example:'@ui:card[{"title": "Summary", "description": "Details here"}]'},list:{schema:"items: [{id, title, subtitle?, description?, image?, metadata?: {any extra data}}], actions?: [{type, label}] - metadata is sent as action payload when clicked",example:'@ui:list[{"items": [{"id": "1", "title": "Item", "subtitle": "Info", "metadata": {"key": "value"}}]}]'},button_group:{schema:"buttons: [{id, label, variant?}] - Use for standalone buttons only, NOT for form submits",example:'@ui:button_group[{"buttons": [{"id": "ok", "label": "OK"}]}]'},form:{schema:"title?, fields: [{name, type: text|password|number|select|checkbox|textarea|date, label, required?, placeholder?, options?}], actions: [{type, label}] - Button is built-in via actions, do NOT add separate button",example:'@ui:form[{"title": "Settings", "fields": [{"name": "apiKey", "type": "password", "label": "API Key", "required": true}], "actions": [{"type": "save", "label": "Save"}]}]'},table:{schema:"columns: [{key, label}], rows: [...], striped?, compact?",example:'@ui:table[{"columns": [{"key": "name", "label": "Name"}], "rows": [{"name": "A"}]}]'},image:{schema:"src, alt, caption?",example:'@ui:image[{"src": "url", "alt": "desc"}]'},chart:{schema:"chartType: line|bar|pie, data: {labels, datasets}",example:'@ui:chart[{"chartType": "bar", "data": {"labels": ["A"], "datasets": [{"label": "X", "data": [10]}]}}]'},flow:{schema:"title, subtitle?, icon?: research|schedule|analyze|deploy|recurring|automation|data, steps: [{id, label, type?, color?: blue|purple|cyan|amber|emerald|rose|indigo|orange, status?: pending|active|completed|error|skipped}] - Horizontal pipeline. Use @label for agents. Types auto-detected from label.",example:'@ui:flow[{"title": "Deploy Pipeline", "icon": "deploy", "steps": [{"id": "1", "label": "Test", "color": "cyan"}, {"id": "2", "label": "Build", "color": "amber"}, {"id": "3", "label": "Deploy", "color": "rose"}]}]'}},aA=Object.keys(tO),nA=["flow"],eO=aA.filter((Y)=>!nA.includes(Y));function rA(Y){let G=Y||eO,U=`
|
|
176
|
+
## UI Widgets
|
|
177
|
+
SYNTAX: @ui:type[{json}] - MUST use SQUARE BRACKETS [] around the JSON object.
|
|
178
|
+
CORRECT: @ui:list[{"items": [...]}]
|
|
179
|
+
WRONG: @ui:list{"items": [...]} (missing square brackets)
|
|
180
|
+
|
|
181
|
+
`;for(let _ of G){let q=tO[_];if(!q)continue;U+=`${_}: ${q.schema} | ${q.example}
|
|
182
|
+
`}return U+=`
|
|
183
|
+
Per-item "metadata" is sent as payload on action click.
|
|
184
|
+
`,U}function sA(Y){return`
|
|
185
|
+
Widgets: @ui:type[{json}] - MUST use square brackets []. Example: @ui:list[{"items": [...]}]. Types: ${(Y||eO).join(", ")}. Per-item "metadata" is sent as action payload.
|
|
186
|
+
`}function tA({widget:Y,onAction:G}){let{title:U,description:_,image:q,footer:R}=Y.props;return Y6.jsxs("div",{className:"border border-neutral-200 dark:border-neutral-700 rounded-xl bg-white dark:bg-neutral-900 overflow-hidden",children:[q&&Y6.jsx("img",{src:q,alt:U,className:"w-full h-48 object-cover"}),Y6.jsxs("div",{className:"p-4",children:[Y6.jsx("h3",{className:"!text-lg font-semibold !text-neutral-900 dark:!text-white",children:U}),_&&Y6.jsx("p",{className:"!text-neutral-600 dark:!text-neutral-400 mt-2",children:_})]}),(R||Y.actions&&Y.actions.length>0)&&Y6.jsxs("div",{className:"border-t border-neutral-200 dark:border-neutral-700 p-4 flex justify-between items-center",children:[R&&Y6.jsx("span",{className:"!text-sm !text-neutral-600 dark:!text-neutral-400",children:R}),Y.actions&&Y.actions.length>0&&Y6.jsx("div",{className:"flex gap-2",children:Y.actions.map((K,O)=>Y6.jsx("button",{onClick:()=>G?.({type:K.type,payload:K.payload,widgetId:Y.id,timestamp:new Date}),className:"px-3 py-1.5 !text-sm rounded-lg font-medium transition-colors bg-blue-500 !text-white hover:bg-blue-600",children:K.label},O))})]})]})}function eA({widget:Y,onAction:G}){let{items:U}=Y.props,_=Y.isStreaming??!1,q=EQ.useRef(new Set),[R,K]=EQ.useState(new Set);return EQ.useEffect(()=>{let O=new Set(U.map((I)=>I.id)),T=new Set;if(U.forEach((I)=>{if(!q.current.has(I.id))T.add(I.id)}),U.forEach((I)=>q.current.add(I.id)),T.size>0){K(T);let I=setTimeout(()=>{K(new Set)},500);return()=>clearTimeout(I)}},[U]),E7.jsxs("div",{className:"border border-neutral-200 dark:border-neutral-700 rounded-xl bg-white dark:bg-neutral-900 overflow-hidden",children:[U.map((O,T)=>{let I=R.has(O.id),b=T===U.length-1;return E7.jsxs("div",{className:`apteva-list-item flex items-center p-4 transition-colors ${!b||_?"border-b border-neutral-200 dark:border-neutral-700":""} ${!O.backgroundColor?"hover:bg-neutral-50 dark:hover:bg-neutral-800":""} ${I?"apteva-list-item-new":""}`,style:O.backgroundColor?{backgroundColor:O.backgroundColor}:void 0,children:[O.image&&E7.jsx("img",{src:O.image,alt:O.title,className:"w-16 h-16 rounded object-cover"}),E7.jsxs("div",{className:`flex-1 ${O.image?"ml-4":""}`,children:[E7.jsx("h4",{className:"font-semibold !text-neutral-900 dark:!text-white",children:O.title}),O.subtitle&&E7.jsx("p",{className:"!text-sm !text-neutral-600 dark:!text-neutral-400",children:O.subtitle}),O.description&&E7.jsx("p",{className:"!text-xs !text-neutral-500 dark:!text-neutral-500 mt-1",children:O.description})]}),Y.actions&&Y.actions.length>0&&E7.jsx("div",{className:"flex gap-2",children:Y.actions.map((P,N)=>E7.jsx("button",{onClick:()=>G?.({type:P.type,payload:O.metadata||O,widgetId:Y.id,timestamp:new Date}),className:"px-3 py-1.5 !text-sm rounded-lg font-medium transition-colors bg-blue-500 !text-white hover:bg-blue-600",children:P.label},N))})]},O.id)}),_&&E7.jsxs("div",{className:"apteva-list-streaming flex items-center gap-3 p-4 text-neutral-500 dark:text-neutral-400",children:[E7.jsxs("div",{className:"apteva-streaming-dots flex gap-1",children:[E7.jsx("span",{className:"w-2 h-2 bg-current rounded-full animate-pulse",style:{animationDelay:"0ms"}}),E7.jsx("span",{className:"w-2 h-2 bg-current rounded-full animate-pulse",style:{animationDelay:"150ms"}}),E7.jsx("span",{className:"w-2 h-2 bg-current rounded-full animate-pulse",style:{animationDelay:"300ms"}})]}),E7.jsx("span",{className:"text-sm",children:"Loading more..."})]})]})}function zI({widget:Y,onAction:G}){let{label:U,variant:_="primary",disabled:q=!1}=Y.props;return QK.jsx("button",{onClick:()=>Y.actions?.[0]&&G?.({type:Y.actions[0].type,payload:Y.actions[0].payload,widgetId:Y.id,timestamp:new Date}),disabled:q,className:b4("px-4 py-2 rounded-lg font-medium transition-colors",{primary:"bg-blue-500 !text-white hover:bg-blue-600",secondary:"bg-neutral-500 !text-white hover:bg-neutral-600",outline:"border-2 border-blue-500 !text-blue-500 hover:bg-blue-50 dark:hover:bg-blue-900",ghost:"!text-blue-500 hover:bg-blue-50 dark:hover:bg-blue-900"}[_],{"opacity-50 cursor-not-allowed":q}),children:U})}function QI({widget:Y,onAction:G}){let{layout:U="horizontal",buttons:_}=Y.props,q={primary:"bg-blue-500 !text-white hover:bg-blue-600",secondary:"bg-neutral-200 dark:bg-neutral-700 !text-neutral-800 dark:!text-neutral-200 hover:bg-neutral-300 dark:hover:bg-neutral-600",outline:"border border-neutral-300 dark:border-neutral-600 !text-neutral-700 dark:!text-neutral-300 hover:bg-neutral-100 dark:hover:bg-neutral-800"},R=(K)=>{return Y.actions?.find((O)=>O.payload?.buttonId===K)||Y.actions?.[0]};return zG.jsx("div",{className:b4("flex gap-2",U==="vertical"?"flex-col":"flex-row flex-wrap"),children:_.map((K)=>{let O=R(K.id);return zG.jsx("button",{onClick:()=>{if(O)G?.({type:O.type,payload:{...O.payload,buttonId:K.id},widgetId:Y.id,timestamp:new Date})},className:b4("px-4 py-2 rounded-lg font-medium transition-colors text-sm",q[K.variant||"secondary"]),children:K.label},K.id)})})}function XI({widget:Y,onAction:G}){let{columns:U,rows:_,caption:q,compact:R=!1,striped:K=!1}=Y.props,O=Y.isStreaming??!1,T=uQ.useRef(new Set),[I,b]=uQ.useState(new Set);uQ.useEffect(()=>{let N=new Set;if(_.forEach((S,f)=>{let V=S.id||`row-${f}`;if(!T.current.has(V))N.add(V)}),_.forEach((S,f)=>{let V=S.id||`row-${f}`;T.current.add(V)}),N.size>0){b(N);let S=setTimeout(()=>{b(new Set)},500);return()=>clearTimeout(S)}},[_]);let P=(N)=>{switch(N){case"center":return"text-center";case"right":return"text-right";default:return"text-left"}};return s4.jsx("div",{className:"border border-neutral-200 dark:border-neutral-700 rounded-xl bg-white dark:bg-neutral-900 overflow-hidden",children:s4.jsx("div",{className:"overflow-x-auto",children:s4.jsxs("table",{className:"w-full",children:[q&&s4.jsx("caption",{className:"px-4 py-2 text-sm text-neutral-600 dark:text-neutral-400 text-left bg-neutral-50 dark:bg-neutral-800 border-b border-neutral-200 dark:border-neutral-700",children:q}),s4.jsx("thead",{children:s4.jsx("tr",{className:"bg-neutral-50 dark:bg-neutral-800 border-b border-neutral-200 dark:border-neutral-700",children:U.map((N)=>s4.jsx("th",{className:b4("font-semibold text-neutral-900 dark:text-white",R?"px-3 py-2 text-xs":"px-4 py-3 text-sm",P(N.align)),style:N.width?{width:N.width}:void 0,children:N.label},N.key))})}),s4.jsxs("tbody",{children:[_.map((N,S)=>{let f=N.id||`row-${S}`,V=I.has(f);return s4.jsx("tr",{className:b4("apteva-table-row border-b border-neutral-200 dark:border-neutral-700 last:border-b-0","transition-colors hover:bg-neutral-50 dark:hover:bg-neutral-800",K&&S%2===1&&"bg-neutral-50/50 dark:bg-neutral-800/50",V&&"apteva-table-row-new"),onClick:()=>{if(Y.actions&&Y.actions.length>0)G?.({type:Y.actions[0].type,payload:N,widgetId:Y.id,timestamp:new Date})},style:{cursor:Y.actions?.length?"pointer":"default"},children:U.map((x)=>s4.jsx("td",{className:b4("text-neutral-700 dark:text-neutral-300",R?"px-3 py-2 text-xs":"px-4 py-3 text-sm",P(x.align)),children:N[x.key]??"—"},x.key))},f)}),_.length===0&&!O&&s4.jsx("tr",{children:s4.jsx("td",{colSpan:U.length||1,className:"px-4 py-8 text-center text-sm text-neutral-500 dark:text-neutral-400",children:"No data available"})}),O&&s4.jsx("tr",{className:"apteva-table-streaming",children:s4.jsx("td",{colSpan:U.length||1,className:"px-4 py-3 text-center",children:s4.jsxs("div",{className:"flex items-center justify-center gap-3 text-neutral-500 dark:text-neutral-400",children:[s4.jsxs("div",{className:"flex gap-1",children:[s4.jsx("span",{className:"w-2 h-2 bg-current rounded-full animate-pulse",style:{animationDelay:"0ms"}}),s4.jsx("span",{className:"w-2 h-2 bg-current rounded-full animate-pulse",style:{animationDelay:"150ms"}}),s4.jsx("span",{className:"w-2 h-2 bg-current rounded-full animate-pulse",style:{animationDelay:"300ms"}})]}),s4.jsx("span",{className:"text-sm",children:"Loading more..."})]})})})]})]})})})}function ZI({widget:Y,onAction:G}){let{title:U,fields:_}=Y.props,[q,R]=XK.useState(()=>{let b={};return _.forEach((P)=>{b[P.name]=P.defaultValue??(P.type==="checkbox"?!1:"")}),b}),K=(b,P)=>{R((N)=>({...N,[b]:P}))},O=(b)=>{if(b.preventDefault(),Y.actions?.[0]&&G)G({type:Y.actions[0].type,payload:{...Y.actions[0].payload,formData:q},widgetId:Y.id,timestamp:new Date})},T=(b)=>{switch(b.type){case"text":case"password":case"number":case"date":return L7.jsx("input",{type:b.type,name:b.name,value:q[b.name]||"",onChange:(N)=>K(b.name,b.type==="number"?Number(N.target.value):N.target.value),placeholder:b.placeholder,required:b.required,className:"w-full px-3 py-2 rounded-lg border transition-colors border-neutral-200 dark:border-neutral-600 bg-neutral-50 dark:bg-neutral-800 !text-neutral-900 dark:!text-neutral-100 placeholder-neutral-400 dark:placeholder-neutral-500 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"});case"textarea":return L7.jsx("textarea",{name:b.name,value:q[b.name]||"",onChange:(N)=>K(b.name,N.target.value),placeholder:b.placeholder,required:b.required,rows:3,className:"w-full px-3 py-2 rounded-lg border transition-colors border-neutral-200 dark:border-neutral-600 bg-neutral-50 dark:bg-neutral-800 !text-neutral-900 dark:!text-neutral-100 placeholder-neutral-400 dark:placeholder-neutral-500 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"});case"select":return L7.jsxs("select",{name:b.name,value:q[b.name]||"",onChange:(N)=>K(b.name,N.target.value),required:b.required,className:"w-full px-3 py-2 rounded-lg border transition-colors border-neutral-200 dark:border-neutral-600 bg-neutral-50 dark:bg-neutral-800 !text-neutral-900 dark:!text-neutral-100 placeholder-neutral-400 dark:placeholder-neutral-500 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",children:[L7.jsx("option",{value:"",children:b.placeholder||"Select..."}),b.options?.map((N)=>L7.jsx("option",{value:N.value,children:N.label},N.value))]});case"checkbox":return L7.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[L7.jsx("input",{type:"checkbox",name:b.name,checked:q[b.name]||!1,onChange:(N)=>K(b.name,N.target.checked),className:"w-4 h-4 rounded border-neutral-300 dark:border-neutral-600 text-blue-500 focus:ring-blue-500"}),L7.jsx("span",{className:"!text-neutral-700 dark:!text-neutral-300",children:b.label})]});default:return null}},I=Y.actions?.find((b)=>b.type==="submit")||Y.actions?.[0];return L7.jsxs("form",{onSubmit:O,className:"border border-neutral-200 dark:border-neutral-700 rounded-xl bg-white dark:bg-neutral-900 overflow-hidden",children:[L7.jsxs("div",{className:"p-4",children:[U&&L7.jsx("h3",{className:"!text-lg font-semibold !text-neutral-900 dark:!text-white mb-4",children:U}),L7.jsx("div",{className:"space-y-3",children:_.map((b)=>L7.jsxs("div",{className:b.type==="checkbox"?"":"space-y-1",children:[b.type!=="checkbox"&&L7.jsxs("label",{className:"block !text-sm font-medium !text-neutral-600 dark:!text-neutral-400",children:[b.label,b.required&&L7.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),T(b)]},b.name))})]}),I&&L7.jsx("div",{className:"px-4 pb-4",children:L7.jsx("button",{type:"submit",className:"px-3 py-1.5 !text-sm rounded-lg font-medium transition-colors bg-blue-500 !text-white hover:bg-blue-600",children:I.label||"Submit"})})]})}function JI({widget:Y}){let{src:G,alt:U,caption:_}=Y.props;return xZ.jsxs("figure",{className:"overflow-hidden rounded-xl",children:[xZ.jsx("img",{src:G,alt:U,className:"w-full h-auto object-contain bg-neutral-100 dark:bg-neutral-800",loading:"lazy"}),_&&xZ.jsx("figcaption",{className:"mt-2 text-center text-sm text-neutral-600 dark:text-neutral-400",children:_})]})}function YI({type:Y,status:G}){if(G==="completed")return E0.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:E0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.5,d:"M5 13l4 4L19 7"})});if(G==="error")return E0.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:E0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.5,d:"M6 18L18 6M6 6l12 12"})});if(G==="active")return E0.jsx("div",{className:"w-3.5 h-3.5 rounded-full bg-current animate-pulse"});let U="w-4 h-4";if(Y==="time"||Y==="schedule"||Y==="clock")return E0.jsx("svg",{className:U,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:E0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})});if(Y==="recurring"||Y==="repeat")return E0.jsx("svg",{className:U,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:E0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})});if(Y==="agent"||Y?.startsWith("@"))return E0.jsx("svg",{className:U,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:E0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z"})});if(Y==="email"||Y==="mail")return E0.jsx("svg",{className:U,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:E0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})});if(Y==="slack"||Y==="message"||Y==="chat")return E0.jsx("svg",{className:U,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:E0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})});if(Y==="webhook"||Y==="api")return E0.jsx("svg",{className:U,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:E0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"})});if(Y==="build"||Y==="compile"||Y==="package")return E0.jsx("svg",{className:U,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:E0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4"})});if(Y==="test"||Y==="check"||Y==="verify")return E0.jsx("svg",{className:U,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:E0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"})});if(Y==="deploy"||Y==="rocket"||Y==="launch")return E0.jsx("svg",{className:U,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:E0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})});if(Y==="push"||Y==="upload"||Y==="cloud")return E0.jsx("svg",{className:U,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:E0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"})});if(Y==="generate"||Y==="create"||Y==="document"||Y==="file")return E0.jsx("svg",{className:U,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:E0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})});if(Y==="review"||Y==="inspect"||Y==="eye")return E0.jsxs("svg",{className:U,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[E0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),E0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})]});if(Y==="analyze"||Y==="research"||Y==="chart")return E0.jsx("svg",{className:U,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:E0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})});if(Y==="scrape"||Y==="crawl"||Y==="spider")return E0.jsx("svg",{className:U,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:E0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"})});if(Y==="data"||Y==="database"||Y==="storage")return E0.jsx("svg",{className:U,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:E0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4"})});if(Y==="notification"||Y==="bell"||Y==="alert")return E0.jsx("svg",{className:U,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:E0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"})});if(Y==="transform"||Y==="process"||Y==="convert")return E0.jsx("svg",{className:U,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:E0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7h12m0 0l-4-4m4 4l-4 4m0 6H4m0 0l4 4m-4-4l4-4"})});return E0.jsx("div",{className:"w-2 h-2 rounded-full bg-current opacity-50"})}function $I({icon:Y}){if(Y==="research"||Y==="multi-agent"||Y==="agents")return E0.jsx("div",{className:"w-10 h-10 rounded-lg bg-purple-100 dark:bg-purple-500/20 flex items-center justify-center",children:E0.jsx("svg",{className:"w-6 h-6 text-purple-600 dark:text-purple-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:E0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})})});if(Y==="schedule"||Y==="report"||Y==="calendar")return E0.jsx("div",{className:"w-10 h-10 rounded-lg bg-amber-100 dark:bg-amber-500/20 flex items-center justify-center",children:E0.jsx("svg",{className:"w-6 h-6 text-amber-600 dark:text-amber-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:E0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})})});if(Y==="recurring"||Y==="repeat"||Y==="sync")return E0.jsx("div",{className:"w-10 h-10 rounded-lg bg-cyan-100 dark:bg-cyan-500/20 flex items-center justify-center",children:E0.jsx("svg",{className:"w-6 h-6 text-cyan-600 dark:text-cyan-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:E0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})});if(Y==="analyze"||Y==="analysis"||Y==="chart")return E0.jsx("div",{className:"w-10 h-10 rounded-lg bg-cyan-100 dark:bg-cyan-500/20 flex items-center justify-center",children:E0.jsx("svg",{className:"w-6 h-6 text-cyan-600 dark:text-cyan-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:E0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})})});if(Y==="deploy"||Y==="rocket"||Y==="launch")return E0.jsx("div",{className:"w-10 h-10 rounded-lg bg-blue-100 dark:bg-blue-500/20 flex items-center justify-center",children:E0.jsx("svg",{className:"w-6 h-6 text-blue-600 dark:text-blue-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:E0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})})});if(Y==="automation"||Y==="workflow"||Y==="process")return E0.jsx("div",{className:"w-10 h-10 rounded-lg bg-indigo-100 dark:bg-indigo-500/20 flex items-center justify-center",children:E0.jsx("svg",{className:"w-6 h-6 text-indigo-600 dark:text-indigo-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:E0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z"})})});if(Y==="data"||Y==="pipeline"||Y==="etl")return E0.jsx("div",{className:"w-10 h-10 rounded-lg bg-emerald-100 dark:bg-emerald-500/20 flex items-center justify-center",children:E0.jsx("svg",{className:"w-6 h-6 text-emerald-600 dark:text-emerald-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:E0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4"})})});return E0.jsx("div",{className:"w-10 h-10 rounded-lg bg-neutral-100 dark:bg-neutral-700 flex items-center justify-center",children:E0.jsx("svg",{className:"w-6 h-6 text-neutral-600 dark:text-neutral-300",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:E0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"})})})}function HI(){return E0.jsx("svg",{className:"w-4 h-4 text-neutral-400 dark:text-neutral-500 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:E0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}var J6={blue:"bg-blue-100 dark:bg-blue-900/40 !text-blue-700 dark:!text-blue-300 border-blue-300 dark:border-blue-500",purple:"bg-purple-100 dark:bg-purple-900/40 !text-purple-700 dark:!text-purple-300 border-purple-300 dark:border-purple-500",cyan:"bg-cyan-100 dark:bg-cyan-900/40 !text-cyan-700 dark:!text-cyan-300 border-cyan-300 dark:border-cyan-500",amber:"bg-amber-100 dark:bg-amber-900/40 !text-amber-700 dark:!text-amber-300 border-amber-300 dark:border-amber-500",emerald:"bg-emerald-100 dark:bg-emerald-900/40 !text-emerald-700 dark:!text-emerald-300 border-emerald-300 dark:border-emerald-500",rose:"bg-rose-100 dark:bg-rose-900/40 !text-rose-700 dark:!text-rose-300 border-rose-300 dark:border-rose-500",indigo:"bg-indigo-100 dark:bg-indigo-900/40 !text-indigo-700 dark:!text-indigo-300 border-indigo-300 dark:border-indigo-500",orange:"bg-orange-100 dark:bg-orange-900/40 !text-orange-700 dark:!text-orange-300 border-orange-300 dark:border-orange-500",neutral:"bg-neutral-100 dark:bg-neutral-800 !text-neutral-600 dark:!text-neutral-300 border-neutral-300 dark:border-neutral-600"};function GI(Y,G){if(Y.color&&J6[Y.color])return J6[Y.color];if(G==="time"||G==="schedule"||G==="clock")return J6.blue;if(G==="agent"||G?.startsWith("@"))return J6.purple;if(G==="email"||G==="slack"||G==="message"||G==="notification")return J6.cyan;if(G==="generate"||G==="document"||G==="create")return J6.amber;if(G==="deploy"||G==="rocket"||G==="launch")return J6.rose;if(G==="build"||G==="compile"||G==="package")return J6.indigo;if(G==="test"||G==="check"||G==="verify")return J6.emerald;if(G==="data"||G==="database"||G==="storage")return J6.orange;return J6.blue}function qI({widget:Y}){let{title:G,subtitle:U,icon:_,steps:q}=Y.props;return E0.jsxs("div",{className:"rounded-xl bg-white dark:bg-neutral-900 border border-neutral-200 dark:border-neutral-700 overflow-hidden",children:[E0.jsxs("div",{className:"px-4 py-4 flex items-center gap-4",children:[E0.jsx($I,{icon:_}),E0.jsxs("div",{className:"flex-1 min-w-0",children:[E0.jsx("h3",{className:"font-semibold text-base text-neutral-900 dark:text-white truncate",children:G}),U&&E0.jsx("p",{className:"text-sm text-neutral-500 dark:text-neutral-400 truncate mt-0.5",children:U})]})]}),E0.jsx("div",{className:"px-4 pb-4",children:E0.jsx("div",{className:"flex flex-wrap items-center gap-2",children:q.map((R,K)=>{let O=K===q.length-1,T=R.status==="active",I=R.status==="completed",b=R.status==="error",P=R.status==="skipped",N=R.label,S=R.type;if(!S)if(N.startsWith("@"))S="agent";else if(/^\d+[ap]m$/i.test(N)||/^(mon|tue|wed|thu|fri|sat|sun)/i.test(N))S="time";else{let x=N.toLowerCase();S={test:"test",build:"build",push:"push",deploy:"deploy",email:"email",slack:"slack",generate:"generate",review:"review",analyze:"analyze",scrape:"scrape",transform:"transform",notify:"notification",alert:"notification",webhook:"webhook",api:"api",data:"data",process:"process"}[x]}let f,V="";if(T)f="bg-blue-100 dark:bg-blue-900/40 !text-blue-700 dark:!text-blue-300 border-blue-400 dark:border-blue-400 ring-2 ring-blue-400";else if(I)f="bg-emerald-100 dark:bg-emerald-900/40 !text-emerald-700 dark:!text-emerald-300 border-emerald-400 dark:border-emerald-400";else if(b)f="bg-red-100 dark:bg-red-900/40 !text-red-700 dark:!text-red-300 border-red-400 dark:border-red-400";else if(P)f="bg-neutral-100 dark:bg-neutral-800 !text-neutral-400 dark:!text-neutral-500 border-neutral-300 dark:border-neutral-600",V="line-through";else f=GI(R,S);return E0.jsxs("div",{className:"flex items-center gap-2",children:[E0.jsxs("span",{className:`inline-flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium border transition-colors ${f} ${V}`,children:[E0.jsx(YI,{type:S,status:R.status}),N]}),!O&&E0.jsx(HI,{})]},R.id)})})})]})}function QG({widget:Y,onAction:G}){return _5.jsx("div",{className:"apteva-widget",children:(()=>{switch(Y.type){case"card":return _5.jsx(tA,{widget:Y,onAction:G});case"list":return _5.jsx(eA,{widget:Y,onAction:G});case"button":return _5.jsx(zI,{widget:Y,onAction:G});case"button_group":return _5.jsx(QI,{widget:Y,onAction:G});case"table":return _5.jsx(XI,{widget:Y,onAction:G});case"form":return _5.jsx(ZI,{widget:Y,onAction:G});case"image":return _5.jsx(JI,{widget:Y});case"flow":return _5.jsx(qI,{widget:Y});default:return _5.jsxs("div",{className:"p-4 border border-yellow-300 bg-yellow-50 rounded-lg",children:[_5.jsxs("p",{className:"text-sm text-yellow-800",children:["Unknown widget type: ",Y.type]}),_5.jsx("pre",{className:"text-xs mt-2 overflow-auto",children:JSON.stringify(Y,null,2)})]})}})()})}function rH({widgets:Y,onAction:G,onWidgetMount:U,layout:_="stack",spacing:q="normal",columns:R=3,className:K}){zK.useEffect(()=>{Y.forEach((I)=>{U?.(I.id)})},[Y,U]);let O={stack:"flex flex-col",grid:`grid grid-cols-1 md:grid-cols-${R}`,masonry:"columns-1 md:columns-2 lg:columns-3"},T={tight:"gap-2",normal:"gap-4",loose:"gap-6"};return XG.jsx("div",{className:b4(O[_],T[q],K),children:Y.map((I)=>XG.jsx(QG,{widget:I,onAction:G},I.id))})}function nO({type:Y,className:G}){switch(Y){case"card":return G1.jsx("div",{className:b4("apteva-widget-skeleton animate-pulse rounded-lg border border-neutral-200 dark:border-neutral-800 overflow-hidden",G),children:G1.jsxs("div",{className:"p-4 space-y-3",children:[G1.jsx("div",{className:"h-4 bg-neutral-200 dark:bg-neutral-700 rounded w-3/4"}),G1.jsx("div",{className:"h-3 bg-neutral-200 dark:bg-neutral-700 rounded w-full"}),G1.jsx("div",{className:"h-3 bg-neutral-200 dark:bg-neutral-700 rounded w-5/6"})]})});case"list":return G1.jsx("div",{className:b4("apteva-widget-skeleton animate-pulse space-y-2",G),children:[1,2,3].map((U)=>G1.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg border border-neutral-200 dark:border-neutral-800",children:[G1.jsx("div",{className:"w-10 h-10 bg-neutral-200 dark:bg-neutral-700 rounded-full flex-shrink-0"}),G1.jsxs("div",{className:"flex-1 space-y-2",children:[G1.jsx("div",{className:"h-3 bg-neutral-200 dark:bg-neutral-700 rounded w-1/2"}),G1.jsx("div",{className:"h-2 bg-neutral-200 dark:bg-neutral-700 rounded w-3/4"})]})]},U))});case"button_group":return G1.jsxs("div",{className:b4("apteva-widget-skeleton animate-pulse flex gap-2",G),children:[G1.jsx("div",{className:"h-9 bg-neutral-200 dark:bg-neutral-700 rounded-lg w-20"}),G1.jsx("div",{className:"h-9 bg-neutral-200 dark:bg-neutral-700 rounded-lg w-20"}),G1.jsx("div",{className:"h-9 bg-neutral-200 dark:bg-neutral-700 rounded-lg w-20"})]});case"form":return G1.jsxs("div",{className:b4("apteva-widget-skeleton animate-pulse rounded-lg border border-neutral-200 dark:border-neutral-800 p-4 space-y-4",G),children:[G1.jsx("div",{className:"h-4 bg-neutral-200 dark:bg-neutral-700 rounded w-1/3"}),G1.jsxs("div",{className:"space-y-3",children:[G1.jsx("div",{className:"h-10 bg-neutral-200 dark:bg-neutral-700 rounded"}),G1.jsx("div",{className:"h-10 bg-neutral-200 dark:bg-neutral-700 rounded"})]}),G1.jsx("div",{className:"h-9 bg-neutral-200 dark:bg-neutral-700 rounded w-24"})]});case"chart":return G1.jsxs("div",{className:b4("apteva-widget-skeleton animate-pulse rounded-lg border border-neutral-200 dark:border-neutral-800 p-4",G),children:[G1.jsx("div",{className:"h-4 bg-neutral-200 dark:bg-neutral-700 rounded w-1/4 mb-4"}),G1.jsxs("div",{className:"flex items-end gap-2 h-32",children:[G1.jsx("div",{className:"flex-1 bg-neutral-200 dark:bg-neutral-700 rounded-t h-1/2"}),G1.jsx("div",{className:"flex-1 bg-neutral-200 dark:bg-neutral-700 rounded-t h-3/4"}),G1.jsx("div",{className:"flex-1 bg-neutral-200 dark:bg-neutral-700 rounded-t h-1/3"}),G1.jsx("div",{className:"flex-1 bg-neutral-200 dark:bg-neutral-700 rounded-t h-full"}),G1.jsx("div",{className:"flex-1 bg-neutral-200 dark:bg-neutral-700 rounded-t h-2/3"})]})]});case"image":return G1.jsx("div",{className:b4("apteva-widget-skeleton animate-pulse",G),children:G1.jsx("div",{className:"aspect-video bg-neutral-200 dark:bg-neutral-700 rounded-lg"})});case"gallery":return G1.jsx("div",{className:b4("apteva-widget-skeleton animate-pulse grid grid-cols-3 gap-2",G),children:[1,2,3].map((U)=>G1.jsx("div",{className:"aspect-square bg-neutral-200 dark:bg-neutral-700 rounded-lg"},U))});case"map":return G1.jsx("div",{className:b4("apteva-widget-skeleton animate-pulse",G),children:G1.jsx("div",{className:"h-48 bg-neutral-200 dark:bg-neutral-700 rounded-lg flex items-center justify-center",children:G1.jsxs("svg",{className:"w-8 h-8 text-neutral-400 dark:text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[G1.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"}),G1.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})]})})});case"table":return G1.jsxs("div",{className:b4("apteva-widget-skeleton animate-pulse rounded-lg border border-neutral-200 dark:border-neutral-800 overflow-hidden",G),children:[G1.jsxs("div",{className:"flex bg-neutral-100 dark:bg-neutral-800 border-b border-neutral-200 dark:border-neutral-700",children:[G1.jsx("div",{className:"flex-1 px-4 py-3",children:G1.jsx("div",{className:"h-3 bg-neutral-300 dark:bg-neutral-600 rounded w-16"})}),G1.jsx("div",{className:"flex-1 px-4 py-3",children:G1.jsx("div",{className:"h-3 bg-neutral-300 dark:bg-neutral-600 rounded w-20"})}),G1.jsx("div",{className:"flex-1 px-4 py-3",children:G1.jsx("div",{className:"h-3 bg-neutral-300 dark:bg-neutral-600 rounded w-14"})})]}),[1,2,3].map((U)=>G1.jsxs("div",{className:"flex border-b border-neutral-200 dark:border-neutral-800 last:border-b-0",children:[G1.jsx("div",{className:"flex-1 px-4 py-3",children:G1.jsx("div",{className:"h-3 bg-neutral-200 dark:bg-neutral-700 rounded w-24"})}),G1.jsx("div",{className:"flex-1 px-4 py-3",children:G1.jsx("div",{className:"h-3 bg-neutral-200 dark:bg-neutral-700 rounded w-16"})}),G1.jsx("div",{className:"flex-1 px-4 py-3",children:G1.jsx("div",{className:"h-3 bg-neutral-200 dark:bg-neutral-700 rounded w-20"})})]},U))]});default:return G1.jsxs("div",{className:b4("apteva-widget-skeleton animate-pulse rounded-lg border border-neutral-200 dark:border-neutral-800 p-4",G),children:[G1.jsx("div",{className:"h-4 bg-neutral-200 dark:bg-neutral-700 rounded w-1/2 mb-2"}),G1.jsx("div",{className:"h-3 bg-neutral-200 dark:bg-neutral-700 rounded w-full"})]})}}function UI(Y){return/\.(jpg|jpeg|png|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(Y)}function Cz(Y,G=""){let U=[],_=/!\[([^\]]*)\]\(([^)]+)\)|\[([^\]]+)\]\(([^)]+)\)|(\*\*|__)(.+?)\5|`([^`]+)`/g,q=0,R,K=0;while((R=_.exec(Y))!==null){if(R.index>q)U.push(Y.slice(q,R.index));if(R[1]!==void 0||R[2]!==void 0){let O=R[1]||"",T=R[2];U.push(x4.jsx("img",{src:T,alt:O,className:"apteva-md-img"},`${G}img${K++}`))}else if(R[3]!==void 0||R[4]!==void 0){let O=R[3],T=R[4];if(UI(T))U.push(x4.jsx("img",{src:T,alt:O,className:"apteva-md-img"},`${G}img${K++}`));else U.push(x4.jsx("a",{href:T,target:"_blank",rel:"noopener noreferrer",className:"apteva-md-link",children:O},`${G}a${K++}`))}else if(R[5]!==void 0)U.push(x4.jsx("strong",{children:R[6]},`${G}b${K++}`));else if(R[7]!==void 0)U.push(x4.jsx("code",{className:"apteva-md-inline-code",children:R[7]},`${G}code${K++}`));q=R.index+R[0].length}if(q<Y.length)U.push(Y.slice(q));return U.length>0?U:[Y]}function BI(Y){let G=Y.split(`
|
|
187
|
+
`),U=[],_=0,q=0;while(q<G.length){let R=G[q],K=R.match(/^##\s+(.*)$/);if(K){U.push(x4.jsx("h2",{className:"apteva-md-h2",children:Cz(K[1],`${_}`)},`h2${_++}`)),q++;continue}let O=R.match(/^###\s+(.*)$/);if(O){U.push(x4.jsx("h3",{className:"apteva-md-h3",children:Cz(O[1],`${_}`)},`h3${_++}`)),q++;continue}let T=R.match(/^(\s*)([-*+])\s+(.*)$/);if(T){let P=[],N=T[1].length;while(q<G.length){let S=G[q].match(/^(\s*)([-*+])\s+(.*)$/);if(S&&S[1].length===N)P.push(x4.jsx("li",{className:"apteva-md-li",children:Cz(S[3],`${_}`)},`li${_++}`)),q++;else break}U.push(x4.jsx("ul",{className:"apteva-md-ul",children:P},`ul${_++}`));continue}let I=R.match(/^(\s*)(\d+)\.\s+(.*)$/);if(I){let P=[],N=I[1].length;while(q<G.length){let S=G[q].match(/^(\s*)(\d+)\.\s+(.*)$/);if(S&&S[1].length===N)P.push(x4.jsx("li",{className:"apteva-md-li",children:Cz(S[3],`${_}`)},`li${_++}`)),q++;else break}U.push(x4.jsx("ol",{className:"apteva-md-ol",children:P},`ol${_++}`));continue}if(R.match(/^\|(.+)\|$/)&&q+1<G.length){if(G[q+1].match(/^\|([\s:-]+\|)+$/)){let S=R.split("|").filter((V)=>V.trim()!=="").map((V)=>V.trim());q+=2;let f=[];while(q<G.length)if(G[q].match(/^\|(.+)\|$/)){let x=G[q].split("|").filter((v)=>v.trim()!=="").map((v)=>v.trim());f.push(x),q++}else break;U.push(x4.jsx("div",{className:"apteva-md-table-wrapper",children:x4.jsxs("table",{className:"apteva-md-table",children:[x4.jsx("thead",{children:x4.jsx("tr",{children:S.map((V,x)=>x4.jsx("th",{className:"apteva-md-th",children:Cz(V,`th${_}${x}`)},`th${x}`))})}),x4.jsx("tbody",{children:f.map((V,x)=>x4.jsx("tr",{children:V.map((v,p)=>x4.jsx("td",{className:"apteva-md-td",children:Cz(v,`td${_}${x}${p}`)},`td${p}`))},`tr${x}`))})]})},`table-wrapper${_++}`));continue}}if(R==="")U.push(x4.jsx("br",{},`br${_++}`));else U.push(x4.jsxs("span",{children:[Cz(R,`${_}`),q<G.length-1?`
|
|
188
|
+
`:""]},`p${_++}`));q++}return U}function e6({content:Y,className:G=""}){return x4.jsx("div",{className:`apteva-md ${G}`,children:BI(Y)})}function WI({name:Y,status:G,isReceiving:U=!1,inputLength:_=0,streamOutput:q}){if(G==="preparing")return Z4.jsxs("div",{className:"apteva-tool-card apteva-tool-card-preparing",children:[Z4.jsxs("svg",{className:"apteva-tool-icon apteva-tool-icon-spin",fill:"none",viewBox:"0 0 24 24",children:[Z4.jsx("circle",{className:"apteva-tool-spinner-track",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),Z4.jsx("path",{className:"apteva-tool-spinner-fill",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),Z4.jsxs("span",{className:"apteva-tool-label",children:[Z4.jsx("strong",{children:Y}),Z4.jsx("span",{className:"apteva-tool-status-text",children:" preparing..."})]})]});if(G==="running")return Z4.jsxs("div",{className:"apteva-tool-card apteva-tool-card-running",children:[Z4.jsxs("svg",{className:"apteva-tool-icon apteva-tool-icon-spin",fill:"none",viewBox:"0 0 24 24",children:[Z4.jsx("circle",{className:"apteva-tool-spinner-track",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),Z4.jsx("path",{className:"apteva-tool-spinner-fill",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),Z4.jsxs("span",{className:"apteva-tool-label",children:[Z4.jsx("strong",{children:Y}),q?Z4.jsx("span",{className:"apteva-tool-stream-separator",children:" · "}):null,q?Z4.jsx("span",{className:"apteva-tool-stream-output",children:q}):Z4.jsxs(Z4.Fragment,{children:[Z4.jsx("span",{className:"apteva-tool-status-text",children:" running"}),Z4.jsxs("span",{className:"apteva-tool-dots",children:[Z4.jsx("span",{children:"."}),Z4.jsx("span",{children:"."}),Z4.jsx("span",{children:"."})]})]})]})]});if(G==="completed")return Z4.jsxs("div",{className:"apteva-tool-card apteva-tool-card-completed",children:[Z4.jsx("svg",{className:"apteva-tool-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:Z4.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),Z4.jsx("span",{className:"apteva-tool-label",children:Y})]});return Z4.jsxs("div",{className:"apteva-tool-card apteva-tool-card-error",children:[Z4.jsx("svg",{className:"apteva-tool-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:Z4.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),Z4.jsxs("span",{className:"apteva-tool-label",children:[Y," failed"]})]})}function OI({message:Y,onAction:G,enableWidgets:U,onWidgetRender:_}){let q=Y.role==="user",R=Y.metadata?.content_segments,K=Y.metadata?.isStreaming===!0,O=Y.content||R&&R.length>0,T=Sz.useRef(new Set),I=Sz.useMemo(()=>{if(!U||q||!Y.content)return[];return W2(Y.content).segments.filter((E)=>E.type==="widget"&&!!E.widget).map((E)=>E.widget)},[U,q,Y.content]);Sz.useEffect(()=>{if(_&&Y.widgets){for(let A of Y.widgets)if(!T.current.has(A.id))T.current.add(A.id),_(A)}},[Y.widgets,_]),Sz.useEffect(()=>{if(_&&I.length>0){for(let A of I)if(!T.current.has(A.id))T.current.add(A.id),_(A)}},[I,_]);let b=(A)=>{if(!U||q)return o0.jsx(e6,{content:A});let j=W2(A).segments.filter((u)=>u.type==="text"&&u.content).map((u)=>u.content).join("");if(!j.trim())return null;return o0.jsx(e6,{content:j})},P=()=>{if(!U||q||!Y.content)return null;let A=W2(Y.content),E=[],j="";if(A.segments.forEach((u,r)=>{if(u.type==="text"&&u.content)j+=u.content;else if(u.type==="widget"&&u.widget){if(j.trim())E.push(o0.jsx("div",{className:"apteva-message-bubble apteva-message-assistant",children:o0.jsx("div",{className:"apteva-message-content-assistant",children:o0.jsx(e6,{content:j})})},`text-${r}`)),j="";E.push(o0.jsx("div",{className:"apteva-widget-standalone",children:o0.jsx(QG,{widget:u.widget,onAction:G})},`widget-${r}`))}else if(u.type==="widget_pending"&&u.pendingType){if(j.trim())E.push(o0.jsx("div",{className:"apteva-message-bubble apteva-message-assistant",children:o0.jsx("div",{className:"apteva-message-content-assistant",children:o0.jsx(e6,{content:j})})},`text-${r}`)),j="";E.push(o0.jsx("div",{className:"apteva-widget-standalone",children:o0.jsx(nO,{type:u.pendingType})},`pending-${r}`))}}),j.trim())E.push(o0.jsx("div",{className:"apteva-message-bubble apteva-message-assistant",children:o0.jsx("div",{className:"apteva-message-content-assistant",children:o0.jsx(e6,{content:j})})},"text-final"));return E.length>0?E:null},N=Y.metadata?.attachments||[],S=N.length>0,f=()=>{if(!S)return null;return o0.jsx("div",{className:"apteva-message-attachments flex flex-wrap gap-2 mb-2 justify-end",children:N.map((A,E)=>{let j=A.type.startsWith("image/"),u=A.type==="application/pdf";if(j&&A.preview)return o0.jsx("div",{className:"apteva-attachment-image relative rounded-lg overflow-hidden shadow-sm",children:o0.jsx("img",{src:A.preview,alt:A.name,className:"max-w-[150px] max-h-[150px] object-cover"})},E);return o0.jsxs("div",{className:"apteva-attachment-doc flex items-center gap-3 px-4 py-3 bg-neutral-100 dark:bg-neutral-800 border border-neutral-200 dark:border-neutral-700 rounded-xl shadow-sm",children:[o0.jsx("div",{className:"w-10 h-10 flex items-center justify-center bg-red-100 dark:bg-red-900/30 rounded-lg text-red-600 dark:text-red-400",children:u?o0.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"})}):o0.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})})}),o0.jsxs("div",{className:"flex flex-col min-w-0",children:[o0.jsx("span",{className:"text-sm font-medium text-neutral-800 dark:text-neutral-200 truncate max-w-[180px]",children:A.name}),o0.jsxs("span",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:[u?"PDF":"Document"," · ",O2(A.size)]})]})]},E)})})},V=()=>{if(q)return o0.jsx("div",{className:"apteva-message-text",children:Y.content});if(K&&!O)return o0.jsxs("div",{className:"apteva-typing-indicator",children:[o0.jsx("span",{}),o0.jsx("span",{}),o0.jsx("span",{})]});if(R&&R.length>0)return null;return b(Y.content)},x=(A,E)=>{if(!U)return o0.jsx("div",{className:"apteva-message-bubble apteva-message-assistant",children:o0.jsx("div",{className:"apteva-message-content-assistant",children:o0.jsx(e6,{content:A})})},E);let j=W2(A),u=[],r="";if(j.segments.forEach((i,d)=>{if(i.type==="text"&&i.content)r+=i.content;else if(i.type==="widget"&&i.widget){if(r.trim())u.push(o0.jsx("div",{className:"apteva-message-bubble apteva-message-assistant",children:o0.jsx("div",{className:"apteva-message-content-assistant",children:o0.jsx(e6,{content:r})})},`${E}-text-${d}`)),r="";u.push(o0.jsx("div",{className:"apteva-widget-standalone",children:o0.jsx(QG,{widget:i.widget,onAction:G})},`${E}-widget-${d}`))}else if(i.type==="widget_pending"&&i.pendingType){if(r.trim())u.push(o0.jsx("div",{className:"apteva-message-bubble apteva-message-assistant",children:o0.jsx("div",{className:"apteva-message-content-assistant",children:o0.jsx(e6,{content:r})})},`${E}-text-${d}`)),r="";u.push(o0.jsx("div",{className:"apteva-widget-standalone",children:o0.jsx(nO,{type:i.pendingType})},`${E}-pending-${d}`))}}),r.trim())u.push(o0.jsx("div",{className:"apteva-message-bubble apteva-message-assistant",children:o0.jsx("div",{className:"apteva-message-content-assistant",children:o0.jsx(e6,{content:r})})},`${E}-text-final`));return u},v=()=>{if(!R||R.length===0)return null;let A=[];return R.forEach((E,j)=>{if(E.type==="text"&&E.content){let u=x(E.content,`seg-${j}`);if(Array.isArray(u))A.push(...u);else A.push(u)}else if(E.type==="tool")A.push(o0.jsx("div",{className:"apteva-tool-call-standalone",children:o0.jsx(WI,{name:E.name,status:E.status||(E.result!==void 0?"completed":"running"),isReceiving:E.isReceiving,inputLength:E.inputLength,streamOutput:E.streamOutput})},E.id))}),A};if(!q&&(R&&R.length>0))return o0.jsxs("div",{className:"apteva-message-segmented",children:[v(),Y.widgets&&Y.widgets.length>0&&o0.jsx("div",{className:"apteva-widget-standalone",children:o0.jsx(rH,{widgets:Y.widgets,onAction:G,layout:"stack"})}),o0.jsx("div",{className:"apteva-message-timestamp apteva-message-timestamp-assistant",suppressHydrationWarning:!0,children:Y.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]});let p=P();if(!q&&U&&p)return o0.jsxs("div",{className:"apteva-message-segmented",children:[p,Y.widgets&&Y.widgets.length>0&&o0.jsx("div",{className:"apteva-widget-standalone",children:o0.jsx(rH,{widgets:Y.widgets,onAction:G,layout:"stack"})}),o0.jsx("div",{className:"apteva-message-timestamp apteva-message-timestamp-assistant",suppressHydrationWarning:!0,children:Y.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]});if(q&&S)return o0.jsxs("div",{className:"apteva-message-segmented apteva-message-user-with-attachments flex flex-col items-end",children:[f(),Y.content&&o0.jsx("div",{className:"apteva-message-bubble apteva-message-user",children:o0.jsx("div",{className:"apteva-message-content-user",children:o0.jsx("div",{className:"apteva-message-text",children:Y.content})})}),o0.jsx("div",{className:"apteva-message-timestamp apteva-message-timestamp-user",suppressHydrationWarning:!0,children:Y.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]});return o0.jsxs("div",{className:b4("apteva-message-bubble",q?"apteva-message-user":"apteva-message-assistant"),children:[o0.jsx("div",{className:q?"apteva-message-content-user":"apteva-message-content-assistant",children:V()}),Y.widgets&&Y.widgets.length>0&&o0.jsx("div",{className:"apteva-widget-standalone",children:o0.jsx(rH,{widgets:Y.widgets,onAction:G,layout:"stack"})}),o0.jsx("div",{className:b4("apteva-message-timestamp",q?"apteva-message-timestamp-user":"apteva-message-timestamp-assistant"),suppressHydrationWarning:!0,children:Y.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})}var rO=()=>T1.jsx("svg",{className:"w-12 h-12 sm:w-16 sm:h-16",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:T1.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})}),sH=()=>T1.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:T1.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 7l5 5m0 0l-5 5m5-5H6"})});function KI({title:Y,subtitle:G,icon:U,prompts:_,variant:q="centered",chatVariant:R="default",onPromptClick:K}){let O=(_||[]).map((b)=>typeof b==="string"?{text:b}:b),T=O.length>0,I=Y||G||U;if(!I&&!T)return T1.jsx("div",{className:"flex items-center justify-center h-full !text-neutral-500 dark:!text-neutral-400",children:T1.jsxs("div",{className:"text-center space-y-2",children:[T1.jsx("div",{className:"flex justify-center",children:T1.jsx(rO,{})}),T1.jsx("p",{className:"text-sm",children:"No messages yet. Start a conversation!"})]})});if(q==="minimal")return T1.jsxs("div",{className:"flex flex-col h-full px-4 py-4",children:[I&&T1.jsxs("div",{className:"mb-4",children:[Y&&T1.jsx("h2",{className:"text-lg font-semibold !text-neutral-900 dark:!text-white",children:Y}),G&&T1.jsx("p",{className:"text-sm !text-neutral-500 dark:!text-neutral-400 mt-1",children:G})]}),T&&T1.jsx("div",{className:"flex-1 space-y-2",children:O.map((b,P)=>T1.jsx("button",{onClick:()=>K(b.text),className:b4("w-full text-left px-4 py-3 rounded-xl","bg-neutral-50 dark:bg-neutral-800/50","border border-neutral-200 dark:border-neutral-700","hover:bg-neutral-100 dark:hover:bg-neutral-800","hover:border-neutral-300 dark:hover:border-neutral-600","transition-all duration-200","group"),children:T1.jsxs("div",{className:"flex items-center gap-3",children:[T1.jsx("div",{className:"flex-shrink-0 !text-neutral-400 dark:!text-neutral-500 group-hover:!text-blue-500 dark:group-hover:!text-blue-400 transition-colors",children:b.icon||T1.jsx(sH,{})}),T1.jsxs("div",{className:"flex-1 min-w-0",children:[T1.jsx("p",{className:"text-sm font-medium !text-neutral-900 dark:!text-white truncate",children:b.text}),b.description&&T1.jsx("p",{className:"text-xs !text-neutral-500 dark:!text-neutral-400 mt-0.5 truncate",children:b.description})]})]})},P))})]});return T1.jsxs("div",{className:"flex flex-col items-center justify-center h-full px-4 py-6 sm:py-8",children:[T1.jsxs("div",{className:"text-center mb-6 sm:mb-8 max-w-md",children:[T1.jsx("div",{className:"mb-4 !text-neutral-400 dark:!text-neutral-500 flex justify-center",children:U||T1.jsx(rO,{})}),Y&&T1.jsx("h1",{className:"text-xl sm:text-2xl font-semibold !text-neutral-900 dark:!text-white mb-2",children:Y}),G&&T1.jsx("p",{className:"text-sm sm:text-base !text-neutral-500 dark:!text-neutral-400",children:G})]}),T&&T1.jsxs("div",{className:"w-full max-w-2xl",children:[T1.jsx("div",{className:"sm:hidden space-y-2",children:O.map((b,P)=>T1.jsx("button",{onClick:()=>K(b.text),className:b4("w-full text-left px-4 py-3 rounded-xl","bg-white dark:bg-neutral-800","border border-neutral-200 dark:border-neutral-700","hover:bg-neutral-50 dark:hover:bg-neutral-700","hover:border-blue-300 dark:hover:border-blue-600","active:scale-[0.98]","transition-all duration-200","shadow-sm hover:shadow","group"),children:T1.jsxs("div",{className:"flex items-center gap-3",children:[T1.jsx("div",{className:"flex-shrink-0 w-8 h-8 rounded-lg bg-neutral-100 dark:bg-neutral-700 flex items-center justify-center !text-neutral-500 dark:!text-neutral-400 group-hover:bg-blue-100 dark:group-hover:bg-blue-900/30 group-hover:!text-blue-600 dark:group-hover:!text-blue-400 transition-colors",children:b.icon||T1.jsx(sH,{})}),T1.jsxs("div",{className:"flex-1 min-w-0",children:[T1.jsx("p",{className:"text-sm font-medium !text-neutral-900 dark:!text-white",children:b.text}),b.description&&T1.jsx("p",{className:"text-xs !text-neutral-500 dark:!text-neutral-400 mt-0.5 line-clamp-1",children:b.description})]}),T1.jsx("svg",{className:"w-4 h-4 !text-neutral-400 group-hover:!text-blue-500 transition-colors flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:T1.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})},P))}),T1.jsx("div",{className:"hidden sm:grid sm:grid-cols-2 gap-3",children:O.map((b,P)=>T1.jsx("button",{onClick:()=>K(b.text),className:b4("text-left p-4 rounded-xl","bg-white dark:bg-neutral-800","border border-neutral-200 dark:border-neutral-700","hover:bg-neutral-50 dark:hover:bg-neutral-700","hover:border-blue-300 dark:hover:border-blue-600","hover:shadow-md","active:scale-[0.98]","transition-all duration-200","group"),children:T1.jsxs("div",{className:"flex items-start gap-3",children:[T1.jsx("div",{className:"flex-shrink-0 w-9 h-9 rounded-lg bg-neutral-100 dark:bg-neutral-700 flex items-center justify-center !text-neutral-500 dark:!text-neutral-400 group-hover:bg-blue-100 dark:group-hover:bg-blue-900/30 group-hover:!text-blue-600 dark:group-hover:!text-blue-400 transition-colors",children:b.icon||T1.jsx(sH,{})}),T1.jsxs("div",{className:"flex-1 min-w-0",children:[T1.jsx("p",{className:"text-sm font-medium !text-neutral-900 dark:!text-white leading-snug",children:b.text}),b.description&&T1.jsx("p",{className:"text-xs !text-neutral-500 dark:!text-neutral-400 mt-1 line-clamp-2",children:b.description})]})]})},P))})]})]})}function _I({messages:Y,onAction:G,welcomeTitle:U,welcomeSubtitle:_,welcomeIcon:q,suggestedPrompts:R,welcomeVariant:K,chatVariant:O,onPromptClick:T,enableWidgets:I,onWidgetRender:b}){let P=gQ.useRef(null),N=gQ.useRef(!0),S=gQ.useRef(0),f=()=>{if(P.current){let{scrollTop:V,scrollHeight:x,clientHeight:v}=P.current;N.current=x-V-v<100}};return gQ.useEffect(()=>{if(P.current&&N.current){let V=P.current.scrollHeight;if(V!==S.current)P.current.scrollTop=V,S.current=V}},[Y]),uZ.jsx("div",{ref:P,className:"apteva-message-list apteva-scrollbar-hidden",onScroll:f,children:Y.length===0?uZ.jsx(KI,{title:U,subtitle:_,icon:q,prompts:R,variant:K,chatVariant:O,onPromptClick:T||(()=>{})}):Y.map((V)=>uZ.jsx("div",{className:V.role==="user"?"apteva-message-row-user":"apteva-message-row-assistant",children:uZ.jsx(OI,{message:V,onAction:G,enableWidgets:I,onWidgetRender:b})},V.id))})}function LI({onSendMessage:Y,placeholder:G="Type a message...",disabled:U=!1,isLoading:_=!1,onStop:q,onFileUpload:R,onSwitchMode:K}){let[O,T]=A6.useState(""),[I,b]=A6.useState(!1),[P,N]=A6.useState([]),[S,f]=A6.useState(null),[V,x]=A6.useState(!1),v=A6.useRef(null),p=A6.useRef(null),A=A6.useRef(null),E=(D)=>{if(D.key==="Enter"&&!D.shiftKey)D.preventDefault(),j()},j=()=>{let D=O.trim(),Q0=P.length>0;if((D||Q0)&&!U){let n=P.map((G0)=>G0.file);if(Y(O.trim(),n.length>0?n:void 0),T(""),N([]),f(null),x(!1),v.current)v.current.style.height="auto"}},u=(D)=>{T(D.target.value),D.target.style.height="auto";let Q0=D.target.scrollHeight;D.target.style.height=`${Q0}px`;let n=D.target.value.includes(`
|
|
189
|
+
`),F0=Q0>36;if(!V&&(n||F0))x(!0);else if(V&&!n&&!F0&&D.target.value.length<20)x(!1)},r=(D)=>{if(D.target.files&&D.target.files.length>0){let Q0=Array.from(D.target.files),n=[],G0=[];if(Q0.forEach((F0)=>{let K0=sO(F0);if(K0.valid){let S0={file:F0};if(F0.type.startsWith("image/"))S0.preview=URL.createObjectURL(F0);n.push(S0)}else G0.push(K0.error||"Invalid file")}),n.length>0)N((F0)=>[...F0,...n]);if(G0.length>0)f(G0.join(", ")),setTimeout(()=>f(null),5000);R?.(D.target.files),b(!1),D.target.value=""}},i=(D)=>{N((Q0)=>{let n=Q0[D];if(n.preview)URL.revokeObjectURL(n.preview);return Q0.filter((G0,F0)=>F0!==D)})},d=(D)=>{if(D.startsWith("image/"))return F1.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:F1.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})});if(D==="application/pdf")return F1.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:F1.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"})});return F1.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:F1.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})})};return F1.jsxs("div",{className:"px-4 py-3 relative",children:[S&&F1.jsx("div",{className:"absolute bottom-full left-4 right-4 mb-2 p-3 bg-red-50 dark:bg-red-900/30 border border-red-200 dark:border-red-800 rounded-lg z-20",children:F1.jsxs("div",{className:"flex items-center gap-2 !text-red-700 dark:!text-red-300 text-sm",children:[F1.jsx("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:F1.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),F1.jsx("span",{children:S})]})}),P.length>0&&F1.jsx("div",{className:"mb-2 flex flex-wrap gap-2",children:P.map((D,Q0)=>F1.jsxs("div",{className:"relative group flex items-center gap-2 px-3 py-2 bg-neutral-100 dark:bg-neutral-800 border border-neutral-200 dark:border-neutral-700 rounded-lg",children:[D.preview?F1.jsx("img",{src:D.preview,alt:D.file.name,className:"w-8 h-8 object-cover rounded"}):F1.jsx("div",{className:"w-8 h-8 flex items-center justify-center bg-neutral-200 dark:bg-neutral-700 rounded !text-neutral-500 dark:!text-neutral-400",children:d(D.file.type)}),F1.jsxs("div",{className:"flex flex-col min-w-0",children:[F1.jsx("span",{className:"text-xs font-medium !text-neutral-700 dark:!text-neutral-300 truncate max-w-[120px]",children:D.file.name}),F1.jsx("span",{className:"text-xs !text-neutral-500 dark:!text-neutral-400",children:O2(D.file.size)})]}),F1.jsx("button",{onClick:()=>i(Q0),className:"absolute -top-1.5 -right-1.5 w-5 h-5 bg-neutral-500 hover:bg-red-500 text-white rounded-full flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity",title:"Remove file",children:F1.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:F1.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]},Q0))}),F1.jsxs("div",{className:"apteva-composer",style:{gridTemplateColumns:"auto 1fr auto",gridTemplateAreas:V?'"textarea textarea textarea" "plus . send"':'"plus textarea send"',alignItems:"end"},children:[F1.jsxs("div",{className:"relative flex-shrink-0 self-end",style:{gridArea:"plus"},children:[F1.jsx("button",{ref:A,onClick:()=>b(!I),className:"apteva-composer-menu-btn w-8 h-8 rounded-lg flex items-center justify-center transition-all !text-neutral-700 dark:!text-neutral-300 hover:bg-neutral-100 dark:hover:bg-neutral-800",title:"More options",children:F1.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:F1.jsx("path",{d:"M10 5v10M5 10h10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),I&&F1.jsxs(F1.Fragment,{children:[F1.jsx("div",{className:"fixed inset-0 z-[9998]",onClick:()=>b(!1)}),F1.jsxs("div",{className:"apteva-composer-menu fixed bg-neutral-800 dark:bg-neutral-800 rounded-xl shadow-lg overflow-hidden z-[9999] min-w-[200px]",style:{left:A.current?.getBoundingClientRect().left??0,bottom:window.innerHeight-(A.current?.getBoundingClientRect().top??0)+8},children:[F1.jsxs("button",{onClick:()=>{p.current?.click(),b(!1)},className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-neutral-700 dark:hover:bg-neutral-700 transition-colors !text-white text-left",children:[F1.jsx("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:F1.jsx("path",{d:"M10.5 3.5L5.5 8.5C4.67157 9.32843 4.67157 10.6716 5.5 11.5C6.32843 12.3284 7.67157 12.3284 8.5 11.5L14.5 5.5C15.8807 4.11929 15.8807 1.88071 14.5 0.5C13.1193 -0.880711 10.8807 -0.880711 9.5 0.5L3.5 6.5C1.56846 8.43154 1.56846 11.5685 3.5 13.5C5.43154 15.4315 8.56846 15.4315 10.5 13.5L15.5 8.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",transform:"translate(2, 3)"})}),F1.jsx("span",{className:"!text-sm font-medium",children:"Add photos & files"})]}),K&&F1.jsxs("button",{onClick:()=>{K(),b(!1)},className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-neutral-700 dark:hover:bg-neutral-700 transition-colors !text-white text-left border-t border-neutral-700 dark:border-neutral-700",children:[F1.jsx("svg",{className:"w-4.5 h-4.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:F1.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})}),F1.jsx("span",{className:"!text-sm font-medium",children:"Switch to command mode"})]})]})]})]}),F1.jsx("textarea",{ref:v,value:O,onChange:u,onKeyDown:E,placeholder:G,disabled:U,className:"apteva-composer-textarea resize-none bg-transparent border-none focus:outline-none !text-neutral-900 dark:!text-neutral-100 placeholder-neutral-400 dark:placeholder-neutral-500 py-1 disabled:opacity-50 disabled:cursor-not-allowed overflow-y-auto max-h-[200px]",style:{gridArea:"textarea"},rows:1}),F1.jsx("div",{className:"self-end",style:{gridArea:"send"},children:_&&q?F1.jsx("button",{onClick:q,className:"apteva-composer-stop-btn",title:"Stop generation",children:F1.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:F1.jsx("rect",{x:"2",y:"2",width:"10",height:"10",rx:"1",fill:"currentColor"})})}):F1.jsx("button",{onClick:j,disabled:!O.trim()&&P.length===0||U,className:"apteva-composer-send-btn w-8 h-8 rounded-lg flex items-center justify-center font-bold transition-all flex-shrink-0 border border-neutral-300 dark:border-neutral-600 bg-white dark:bg-neutral-800 !text-neutral-700 dark:!text-neutral-300 hover:bg-neutral-50 dark:hover:bg-neutral-700 disabled:opacity-30 disabled:cursor-not-allowed !text-lg",title:"Send message",children:F1.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:F1.jsx("path",{d:"M8 3L8 13M8 3L4 7M8 3L12 7",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})})]}),F1.jsx("input",{ref:p,type:"file",multiple:!0,onChange:r,className:"hidden",accept:"image/*,application/pdf,.doc,.docx,.txt"})]})}function RI({onExecute:Y,state:G,response:U,error:_,plan:q,streamedContent:R,toolName:K,onApprove:O,onReject:T,onReset:I,onStop:b,onExpand:P,placeholder:N="Enter your command...",disabled:S=!1}){let[f,V]=z8.useState(""),[x,v]=z8.useState([]),[p,A]=z8.useState(null),[E,j]=z8.useState(!1),u=z8.useRef(null),r=z8.useRef(null),i=z8.useRef(null),d=()=>{let U0=f.trim(),H0=x.length>0;if((U0||H0)&&!S&&G==="idle"){let y0=x.map((z0)=>z0.file);Y(f.trim(),y0.length>0?y0:void 0),V(""),v([])}},D=(U0)=>{if(U0.key==="Enter"&&!U0.shiftKey)U0.preventDefault(),d()},Q0=()=>{I?.(),u.current?.focus()},n=(U0)=>{if(V(U0),u.current)u.current.style.height="auto",u.current.style.height=`${Math.min(u.current.scrollHeight,120)}px`},G0=(U0)=>{if(U0.target.files&&U0.target.files.length>0){let H0=Array.from(U0.target.files),y0=[],z0=[];if(H0.forEach((v0)=>{let p0=sO(v0);if(p0.valid){let Y1={file:v0};if(v0.type.startsWith("image/"))Y1.preview=URL.createObjectURL(v0);y0.push(Y1)}else z0.push(p0.error||"Invalid file")}),y0.length>0)v((v0)=>[...v0,...y0]);if(z0.length>0)A(z0.join(", ")),setTimeout(()=>A(null),5000);j(!1),U0.target.value=""}},F0=(U0)=>{v((H0)=>{let y0=H0[U0];if(y0.preview)URL.revokeObjectURL(y0.preview);return H0.filter((z0,v0)=>v0!==U0)})},K0=(U0)=>{if(U0.startsWith("image/"))return z1.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:z1.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})});if(U0==="application/pdf")return z1.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:z1.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"})});return z1.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:z1.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})})},S0=()=>{if(G==="loading"){if(K)return{text:K,isToolCall:!0};if(R)return{text:R,isToolCall:!1};return{text:"Processing...",isToolCall:!1}}if(G==="success"&&U)return{text:U,isToolCall:!1};if(G==="error"&&_)return{text:_,isToolCall:!1};if(G==="plan-pending"&&q)return{text:q,isToolCall:!1};return{text:"",isToolCall:!1}},P0=G!=="idle",{text:a,isToolCall:Y0}=S0();return z1.jsxs("div",{className:"w-full relative",children:[p&&z1.jsx("div",{className:"absolute -top-12 left-0 right-0 mx-3 p-2 bg-red-50 dark:bg-red-900/30 border border-red-200 dark:border-red-800 rounded-lg z-30",children:z1.jsxs("div",{className:"flex items-center gap-2 !text-red-700 dark:!text-red-300 text-xs",children:[z1.jsx("svg",{className:"w-3 h-3 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:z1.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),z1.jsx("span",{children:p})]})}),z1.jsxs("div",{className:b4("apteva-composer flex items-center gap-2 px-3 py-2 border-2 bg-white dark:bg-neutral-900 transition-all duration-200",G==="idle"&&"border-neutral-200 dark:border-neutral-700",G==="loading"&&"border-blue-400 dark:border-blue-500",G==="plan-pending"&&"border-amber-400 dark:border-amber-500",G==="success"&&"border-green-400 dark:border-green-500",G==="error"&&"border-red-400 dark:border-red-500"),children:[z1.jsxs("div",{className:"w-8 h-8 flex items-center justify-center flex-shrink-0",children:[G==="idle"&&z1.jsxs("div",{className:"relative",children:[z1.jsx("button",{ref:i,onClick:()=>j(!E),className:"apteva-composer-menu-btn w-8 h-8 rounded-lg flex items-center justify-center transition-all !text-neutral-500 dark:!text-neutral-400 hover:!text-neutral-700 dark:hover:!text-neutral-200 hover:bg-neutral-100 dark:hover:bg-neutral-800",title:"More options",children:z1.jsx("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:z1.jsx("path",{d:"M10 5v10M5 10h10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),E&&z1.jsxs(z1.Fragment,{children:[z1.jsx("div",{className:"fixed inset-0 z-[9998]",onClick:()=>j(!1)}),z1.jsxs("div",{className:"apteva-composer-menu fixed bg-neutral-800 dark:bg-neutral-800 rounded-xl shadow-lg overflow-hidden z-[9999] min-w-[200px]",style:{left:i.current?.getBoundingClientRect().left??0,top:(i.current?.getBoundingClientRect().bottom??0)+8},children:[z1.jsxs("button",{onClick:()=>{r.current?.click(),j(!1)},className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-neutral-700 dark:hover:bg-neutral-700 transition-colors !text-white text-left",children:[z1.jsx("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:z1.jsx("path",{d:"M10.5 3.5L5.5 8.5C4.67157 9.32843 4.67157 10.6716 5.5 11.5C6.32843 12.3284 7.67157 12.3284 8.5 11.5L14.5 5.5C15.8807 4.11929 15.8807 1.88071 14.5 0.5C13.1193 -0.880711 10.8807 -0.880711 9.5 0.5L3.5 6.5C1.56846 8.43154 1.56846 11.5685 3.5 13.5C5.43154 15.4315 8.56846 15.4315 10.5 13.5L15.5 8.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",transform:"translate(2, 3)"})}),z1.jsx("span",{className:"!text-sm font-medium",children:"Add photos & files"})]}),P&&z1.jsxs("button",{onClick:()=>{P(),j(!1)},className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-neutral-700 dark:hover:bg-neutral-700 transition-colors !text-white text-left border-t border-neutral-700 dark:border-neutral-700",children:[z1.jsx("svg",{className:"w-4.5 h-4.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:z1.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})}),z1.jsx("span",{className:"!text-sm font-medium",children:"Expand to chat"})]})]})]})]}),G==="loading"&&!K&&z1.jsx("div",{className:"w-4 h-4 border-2 border-blue-200 border-t-blue-500 rounded-full animate-spin"}),G==="loading"&&K&&z1.jsx("div",{className:"w-2 h-2 rounded-full bg-blue-500 animate-pulse"})]}),x.length>0&&G==="idle"&&z1.jsx("div",{className:"flex items-center gap-1 flex-shrink-0",children:x.map((U0,H0)=>z1.jsxs("div",{className:"relative group flex items-center justify-center w-6 h-6 bg-neutral-100 dark:bg-neutral-800 rounded overflow-hidden",title:U0.file.name,children:[U0.preview?z1.jsx("img",{src:U0.preview,alt:U0.file.name,className:"w-6 h-6 object-cover"}):z1.jsx("span",{className:"text-xs !text-neutral-500 dark:!text-neutral-400",children:K0(U0.file.type)}),z1.jsx("button",{onClick:()=>F0(H0),className:"absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 flex items-center justify-center transition-opacity",title:"Remove",children:z1.jsx("svg",{className:"w-3 h-3 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:z1.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]},H0))}),G==="idle"?z1.jsx("textarea",{ref:u,value:f,onChange:(U0)=>n(U0.target.value),onKeyDown:D,placeholder:x.length>0?"Add a message...":N,disabled:S,rows:1,className:b4("flex-1 resize-none bg-transparent border-none focus:outline-none","!text-neutral-900 dark:!text-neutral-100 placeholder-neutral-400 dark:placeholder-neutral-500","text-sm leading-relaxed py-1","disabled:opacity-50"),style:{minHeight:"24px",maxHeight:"120px"}}):z1.jsx("div",{className:b4("flex-1 text-sm py-1 truncate flex items-center gap-2",G==="loading"&&!Y0&&"!text-neutral-600 dark:!text-neutral-400",G==="loading"&&Y0&&"!text-blue-600 dark:!text-blue-400",G==="success"&&"!text-neutral-900 dark:!text-neutral-100",G==="error"&&"!text-red-600 dark:!text-red-400",G==="plan-pending"&&"!text-amber-700 dark:!text-amber-300"),children:Y0?z1.jsxs(z1.Fragment,{children:[z1.jsx("span",{className:"font-mono",children:a}),z1.jsx("span",{className:"text-neutral-400 dark:text-neutral-500",children:"Running..."})]}):a}),z1.jsx("div",{className:"w-8 h-8 flex items-center justify-center flex-shrink-0",children:G==="plan-pending"?z1.jsxs("div",{className:"flex items-center gap-1",children:[z1.jsx("button",{onClick:O,className:"px-2 py-1 bg-amber-500 text-white rounded-lg hover:bg-amber-600 transition-colors text-xs font-medium",children:"Approve"}),z1.jsx("button",{onClick:T,className:"px-2 py-1 bg-neutral-200 dark:bg-neutral-700 text-neutral-700 dark:text-neutral-300 rounded-lg hover:bg-neutral-300 dark:hover:bg-neutral-600 transition-colors text-xs font-medium",children:"Modify"})]}):z1.jsxs(z1.Fragment,{children:[G==="loading"&&b&&z1.jsx("button",{onClick:b,className:"apteva-composer-stop-btn",title:"Stop generation",children:z1.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:z1.jsx("rect",{x:"2",y:"2",width:"10",height:"10",rx:"1",fill:"currentColor"})})}),(G==="success"||G==="error")&&z1.jsx("button",{onClick:Q0,className:"w-8 h-8 rounded-lg flex items-center justify-center !text-neutral-400 hover:!text-neutral-600 dark:hover:!text-neutral-300 hover:bg-neutral-100 dark:hover:bg-neutral-800 transition-colors",title:"New command",children:z1.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:z1.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),G==="idle"&&z1.jsx("button",{onClick:d,disabled:!f.trim()&&x.length===0||S,className:b4("apteva-composer-send-btn w-8 h-8 rounded-lg flex items-center justify-center transition-all","border border-neutral-200 dark:border-neutral-700","disabled:opacity-30 disabled:cursor-not-allowed",f.trim()||x.length>0?"bg-neutral-900 dark:bg-white !text-white dark:!text-neutral-900 border-neutral-900 dark:border-white":"bg-white dark:bg-neutral-800 !text-neutral-400"),title:"Execute command",children:z1.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:z1.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 12h14M12 5l7 7-7 7"})})})]})})]}),z1.jsx("input",{ref:r,type:"file",multiple:!0,onChange:G0,className:"hidden",accept:"image/*,application/pdf,.doc,.docx,.txt"})]})}var NI="http://91.99.200.48:3000/agents",MI="agt_894abd5966bc9f1e9f8f17f2a6f6b5e0",wI=class{constructor(){mA(this,"config"),this.config={apiUrl:NI,apiKey:MI}}configure(Y){if(Y.apiUrl)this.config.apiUrl=Y.apiUrl;if(Y.apiKey)this.config.apiKey=Y.apiKey}getConfig(){return{...this.config}}async chat(Y){try{console.log("[AptevaClient] Chat request:",{agent_id:Y.agent_id,message:typeof Y.message==="string"?Y.message.substring(0,100)+"...":"[multi-part message]",system:Y.system,stream:Y.stream});let G=await fetch(`${this.config.apiUrl}/chat`,{method:"POST",headers:{"Content-Type":"application/json","X-API-Key":this.config.apiKey},body:JSON.stringify(Y)});if(!G.ok){let _=await G.json().catch(()=>({error:"Request failed"}));throw Error(_.error||`Request failed with status ${G.status}`)}let U=await G.json();return{message:U.response||U.message||"",thread_id:U.thread_id,widgets:U.widgets}}catch(G){throw console.error("Chat API error:",G),G}}async chatStream(Y,G,U,_){try{console.log("[AptevaClient] Chat stream request:",{agent_id:Y.agent_id,message:typeof Y.message==="string"?Y.message.substring(0,100)+"...":"[multi-part message]",system:Y.system,stream:Y.stream});let q=await fetch(`${this.config.apiUrl}/chat`,{method:"POST",headers:{"Content-Type":"application/json","X-API-Key":this.config.apiKey,Accept:"text/event-stream"},body:JSON.stringify({...Y,stream:!0})});if(!q.ok){let I=await q.json().catch(()=>({error:"Request failed"}));throw Error(I.error||`Request failed with status ${q.status}`)}let R=q.body?.getReader();if(!R)throw Error("Response body is not readable");let K=new TextDecoder,O="",T="";while(!0){let{done:I,value:b}=await R.read();if(I)break;O+=K.decode(b,{stream:!0});let P=O.split(`
|
|
190
|
+
`);O=P.pop()||"";for(let N of P){if(!N.trim()||N.startsWith(":"))continue;if(N.startsWith("data: ")){let S=N.slice(6);if(S==="[DONE]"){U?.(T);return}try{let f=JSON.parse(S);if(f.thread_id)T=f.thread_id;G(f)}catch(f){console.warn("[AptevaClient] Failed to parse SSE data:",S)}}}}U?.(T)}catch(q){let R=q instanceof Error?q:Error("Unknown error");throw _?.(R),R}}async createThread(Y,G){let U=await fetch(`${this.config.apiUrl}/agents/${Y}/threads`,{method:"POST",headers:{"Content-Type":"application/json","X-API-Key":this.config.apiKey},body:JSON.stringify({metadata:G})});if(!U.ok){let q=await U.json().catch(()=>({error:"Request failed"}));throw Error(q.error||`Request failed with status ${U.status}`)}return(await U.json()).thread_id}async getThreadMessages(Y){let G=await fetch(`${this.config.apiUrl}/threads/${Y}/messages`,{method:"GET",headers:{"X-API-Key":this.config.apiKey}});if(!G.ok){let _=await G.json().catch(()=>({error:"Request failed"}));throw Error(_.error||`Request failed with status ${G.status}`)}return(await G.json()).messages}async cancelRequest(Y,G){try{let U=await fetch(`${this.config.apiUrl}/agents/${Y}/requests/${G}/cancel`,{method:"POST",headers:{"Content-Type":"application/json","X-API-Key":this.config.apiKey}});if(!U.ok){let _=await U.json().catch(()=>({error:"Cancel request failed"}));throw Error(_.error||`Cancel request failed with status ${U.status}`)}}catch(U){throw console.error("[AptevaClient] Cancel request error:",U),U}}},mQ=new wI,K2=H4.forwardRef(function({agentId:G,threadId:U,initialMessages:_=[],context:q,apiUrl:R,apiKey:K,useMock:O=!1,initialMode:T="chat",showModeToggle:I=!1,onModeChange:b,commandVariant:P="default",planMode:N=!1,onPlanModeChange:S,enableStreaming:f=!0,showProgress:V=!0,loadingText:x="Processing...",welcomeTitle:v,welcomeSubtitle:p,welcomeIcon:A,suggestedPrompts:E,welcomeVariant:j,onThreadChange:u,onMessageSent:r,onAction:i,onFileUpload:d,onComplete:D,onError:Q0,onToolCall:n,onToolResult:G0,variant:F0="default",placeholder:K0,showHeader:S0=!0,headerTitle:P0="Chat",enableWidgets:a=!1,availableWidgets:Y0,compactWidgetContext:U0=!1,onWidgetRender:H0,className:y0},z0){let[v0,p0]=H4.useState(_),[Y1,m0]=H4.useState(!1),[$1,v1]=H4.useState(U||null),[m,N0]=H4.useState(T),[V0,L1]=H4.useState(null),[o1,R1]=H4.useState("idle"),[A0,Z1]=H4.useState(null),[S1,a1]=H4.useState(null),[v4,G4]=H4.useState(0),[I7,P4]=H4.useState(""),[T7,f4]=H4.useState(""),[V4,N7]=H4.useState(null),[u7,l4]=H4.useState(null),[Q7,g0]=H4.useState(""),[H1,O1]=H4.useState(""),[n1,q4]=H4.useState(N),[u4,N4]=H4.useState(!1),e4=H4.useRef(null),f1=H4.useRef(null);H4.useImperativeHandle(z0,()=>({sendMessage:async(p1)=>{if(f1.current)await f1.current(p1)},sendSystemMessage:async(p1)=>{if(f1.current)await f1.current(p1,void 0,!0)},getMessages:()=>v0,clearMessages:()=>p0([])}),[v0]);let k1=H4.useMemo(()=>{if(!a)return q;let p1=U0?sA(Y0):rA(Y0);return q?`${q}
|
|
191
|
+
${p1}`:p1},[q,a,Y0,U0]);H4.useEffect(()=>{if(R||K)mQ.configure({...R&&{apiUrl:R},...K&&{apiKey:K}})},[R,K]),H4.useEffect(()=>{if(U)u?.(U)},[U,u]),H4.useEffect(()=>{q4(N)},[N]),H4.useEffect(()=>{let p1=(U4)=>{let F4=U4.target;if(u4&&!F4.closest(".settings-menu-container"))N4(!1)};return document.addEventListener("mousedown",p1),()=>document.removeEventListener("mousedown",p1)},[u4]);let r7=(p1)=>{if(N0(p1),b?.(p1),p1==="command")R1("idle"),Z1(null),a1(null)},M7=m==="chat"?"Type a message...":"Enter your command...",s7=async(p1,U4,F4)=>{let t1=U4&&U4.length>0,y=t1?U4.map((W0)=>({name:W0.name,type:W0.type,size:W0.size,preview:W0.type.startsWith("image/")?URL.createObjectURL(W0):void 0})):[];if(!F4){let W0={id:`msg-${Date.now()}`,role:"user",content:p1,timestamp:new Date,metadata:t1?{attachments:y}:void 0};p0((w0)=>[...w0,W0]),r?.(W0)}m0(!0);try{let W0=await oO(p1,U4);if(O){let w0=await gA(1000);p0((C)=>[...C,w0])}else{let w0=[],C="",o=[],L0=$1,k0={},u0={},Q1=`msg-${Date.now()}`,a0=()=>{let R0=[...w0];if(C){let D0=R0[R0.length-1];if(D0&&D0.type==="text")D0.content=C;else R0.push({type:"text",content:C})}p0((D0)=>{let J1=D0[D0.length-1];if(J1&&J1.role==="assistant")return[...D0.slice(0,-1),{...J1,content:C,widgets:o.length>0?o:void 0,metadata:{...J1.metadata,content_segments:R0,isStreaming:!0}}];else return[...D0,{id:Q1,role:"assistant",content:C,widgets:o.length>0?o:void 0,timestamp:new Date,metadata:{content_segments:R0,isStreaming:!0}}]})};await mQ.chatStream({agent_id:G,message:W0,stream:!0,...$1&&{thread_id:$1},...k1&&{system:k1}},(R0)=>{switch(R0.type){case"thread_id":if(R0.thread_id){if(L0=R0.thread_id,!$1)v1(R0.thread_id),u?.(R0.thread_id)}break;case"request_id":if(R0.request_id)l4(R0.request_id);break;case"content":case"token":if(R0.content)C+=R0.content,a0();break;case"tool_call":if(R0.tool_id&&R0.tool_name){let D0=R0.tool_display_name||R0.tool_name;if(C)w0.push({type:"text",content:C}),C="";w0.push({type:"tool",id:R0.tool_id,name:D0,status:"preparing"}),k0[R0.tool_id]="",L1(D0),n?.(R0.tool_name,R0.tool_id),a0()}break;case"tool_input_delta":if(R0.tool_id&&R0.content){let D0=R0.tool_id;if(k0[D0]===void 0)k0[D0]="";k0[D0]+=R0.content;let J1=w0.find((d1)=>d1.type==="tool"&&d1.id===D0);if(J1){if(J1.isReceiving=!0,J1.inputLength=k0[D0].length,a0(),u0[D0])clearTimeout(u0[D0]);u0[D0]=setTimeout(()=>{if(J1.status==="preparing")J1.isReceiving=!1,a0()},150)}}break;case"tool_use":if(R0.tool_id){let D0=w0.find((J1)=>J1.type==="tool"&&J1.id===R0.tool_id);if(D0&&D0.status==="preparing")D0.status="running",D0.isReceiving=!1,a0()}break;case"tool_stream":if(R0.tool_id){let D0=w0.find((J1)=>J1.type==="tool"&&J1.id===R0.tool_id);if(D0){if(R0.event==="chunk"&&R0.content){if(D0.pendingReset)D0.streamOutput="",D0.pendingReset=!1;D0.streamOutput=(D0.streamOutput||"")+R0.content,a0()}else if(R0.event==="log"||R0.event==="progress")D0.pendingReset=!0}}break;case"tool_result":if(R0.tool_id){let D0=w0.find((J1)=>J1.type==="tool"&&J1.id===R0.tool_id);if(D0)D0.result=R0.content,D0.status="completed",D0.isReceiving=!1,G0?.(D0.name,R0.content);L1(null),a0()}break;case"widget":if(R0.widget)o.push(R0.widget),a0();break;case"error":throw Error(R0.message||"Stream error")}},(R0)=>{if(C){let D0=w0[w0.length-1];if(D0&&D0.type==="text")D0.content=C;else w0.push({type:"text",content:C})}if(p0((D0)=>{let J1=D0[D0.length-1];if(J1&&J1.role==="assistant")return[...D0.slice(0,-1),{...J1,content:C||"Response received",widgets:o.length>0?o:void 0,metadata:{thread_id:R0,content_segments:w0,isStreaming:!1}}];return D0}),R0&&R0!==$1)v1(R0),u?.(R0);m0(!1),l4(null),L1(null)},(R0)=>{let D0={id:`msg-${Date.now()}-error`,role:"assistant",content:`Error: ${R0.message}`,timestamp:new Date,metadata:{error:!0}};p0((J1)=>{let d1=J1[J1.length-1];if(d1&&d1.id.includes("streaming"))return[...J1.slice(0,-1),D0];return[...J1,D0]}),m0(!1),l4(null),L1(null),Q0?.(R0)})}}catch(W0){let w0={id:`msg-${Date.now()}-error`,role:"assistant",content:W0 instanceof Error?`Error: ${W0.message}`:"An error occurred",timestamp:new Date,metadata:{error:!0}};p0((C)=>[...C,w0]),Q0?.(W0 instanceof Error?W0:Error("Unknown error"))}finally{m0(!1)}};f1.current=s7;let $6=async(p1,U4)=>{let F4=p1||I7;if(!F4.trim()&&(!U4||U4.length===0)){a1(Error("Please enter a command")),R1("error");return}if(n1&&o1!=="plan-pending"){if(R1("loading"),a1(null),P4(""),O)setTimeout(()=>{let t1=`1. Analyze the request: "${F4}"
|
|
192
|
+
2. Process the data
|
|
193
|
+
3. Generate response
|
|
194
|
+
4. Return results`;g0(t1),O1(F4),R1("plan-pending")},800);else try{let y=k1?`${k1}
|
|
195
|
+
|
|
196
|
+
CRITICAL PLANNING MODE: You are ONLY creating a plan. Write a numbered list of steps describing what WOULD be done. DO NOT execute anything.`:"CRITICAL PLANNING MODE: You are ONLY creating a plan. Write a numbered list of steps describing what WOULD be done. DO NOT execute anything.",W0=await mQ.chat({agent_id:G,message:F4,stream:!1,system:y});g0(W0.message),O1(F4),R1("plan-pending")}catch(t1){let y=t1 instanceof Error?t1:Error("Failed to generate plan");a1(y),R1("error"),Q0?.(y)}return}R1("loading"),a1(null),G4(0),f4(""),P4("");try{if(O)if(f){let t1="";xA(F4,(y)=>{if(y.type==="token"&&y.content){t1+=y.content,f4(t1);let W0=Math.min(Math.round(t1.length/10),90);G4(W0)}},(y)=>{let W0={success:!0,data:{summary:t1,thread_id:y},message:t1||"Command executed successfully"};Z1(W0),R1("success"),G4(100),D?.(W0)},(y)=>{a1(y),R1("error"),Q0?.(y)})}else{await new Promise((y)=>setTimeout(y,1500));let t1={success:!0,data:{summary:`Executed: ${F4}`},message:"Command executed successfully"};Z1(t1),R1("success"),G4(100),D?.(t1)}else{let y=k1?`${k1}
|
|
197
|
+
|
|
198
|
+
CRITICAL COMMAND MODE: Maximum 10 words per response. Execute the command immediately. Make reasonable assumptions based on context. Use sensible defaults for missing details. DO NOT ask questions unless something is truly impossible without user input (e.g., missing required password). State what you're doing or the result. Examples: "Analyzing customer data from last quarter..." or "Created 5 new database entries successfully" or "Search complete: found 12 matching results". NO greetings, NO filler words, NO clarification requests. Action/result only.`:`CRITICAL COMMAND MODE: Maximum 10 words per response. Execute the command immediately. Make reasonable assumptions based on context. Use sensible defaults for missing details. DO NOT ask questions unless something is truly impossible without user input (e.g., missing required password). State what you're doing or the result. Examples: "Analyzing customer data from last quarter..." or "Created 5 new database entries successfully" or "Search complete: found 12 matching results". NO greetings, NO filler words, NO clarification requests. Action/result only.`,W0=U4&&U4.length>0?await oO(F4,U4):F4;if(f){let w0="",C="";await mQ.chatStream({agent_id:G,message:W0,stream:!0,...$1&&{thread_id:$1},system:y},(o)=>{if((o.type==="token"||o.type==="content")&&o.content){w0+=o.content,f4(w0),N7(null);let L0=Math.min(Math.round(w0.length/10),90);G4(L0)}else if(o.type==="tool_call"&&o.tool_name){let L0=o.tool_display_name||o.tool_name;C=o.tool_name,N7(L0),n?.(o.tool_name,o.tool_id||""),w0="",f4("")}else if(o.type==="tool_result")G0?.(C,o.content),N7(null);else if(o.type==="thread_id"&&o.thread_id){if(!$1)v1(o.thread_id),u?.(o.thread_id)}else if(o.type==="request_id"&&o.request_id)l4(o.request_id)},(o)=>{let L0={success:!0,data:{summary:w0,thread_id:o},message:w0||"Command executed successfully"};Z1(L0),R1("success"),G4(100),l4(null),D?.(L0)},(o)=>{a1(o),R1("error"),l4(null),Q0?.(o)})}else{let w0=await mQ.chat({agent_id:G,message:W0,stream:!1,...$1&&{thread_id:$1},system:y}),C={success:!0,data:{summary:w0.message,thread_id:w0.thread_id},widgets:w0.widgets,message:w0.message};Z1(C),R1("success"),G4(100),D?.(C)}}}catch(t1){let y=t1 instanceof Error?t1:Error("Unknown error");a1(y),R1("error"),Q0?.(y)}},p5=()=>{R1("idle"),Z1(null),a1(null),G4(0),P4(""),g0(""),O1(""),f4(""),N7(null)},H6=()=>{let p1=Q7;g0(""),O1("");let U4=`Execute this plan now:
|
|
199
|
+
|
|
200
|
+
${p1}`;$6(U4)},S5=()=>{P4(H1),g0(""),O1(""),R1("idle")},x7=async()=>{if(u7&&G)try{await mQ.cancelRequest(G,u7)}catch(p1){console.error("Failed to cancel request:",p1)}if(m0(!1),o1==="loading")R1("idle"),f4(""),N7(null),G4(0);l4(null)},d5=P==="compact";return $5.jsxs("div",{className:b4("apteva-chat flex flex-col h-full",F0!=="default"&&`apteva-chat-${F0}`,y0),children:[S0&&m==="chat"&&$5.jsx("div",{className:"apteva-chat-header px-4 py-3 flex items-center justify-between",children:$5.jsxs("div",{children:[$5.jsx("div",{className:"apteva-chat-title",children:P0}),$5.jsx("div",{className:b4("apteva-chat-status",Y1?V0?"apteva-chat-status-tool":"apteva-chat-status-thinking":"apteva-chat-status-ready"),children:Y1?V0?`Using ${V0}...`:"Thinking...":"Ready"})]})}),m==="chat"&&$5.jsxs($5.Fragment,{children:[$5.jsx(_I,{messages:v0,onAction:i,welcomeTitle:v,welcomeSubtitle:p,welcomeIcon:A,suggestedPrompts:E,welcomeVariant:j,chatVariant:F0,onPromptClick:(p1)=>s7(p1),enableWidgets:a,onWidgetRender:H0}),$5.jsx(LI,{onSendMessage:s7,placeholder:K0||M7,disabled:Y1,isLoading:Y1,onStop:x7,onFileUpload:d,onSwitchMode:I?()=>r7("command"):void 0})]}),m==="command"&&$5.jsx("div",{className:"w-full",children:$5.jsx(RI,{onExecute:(p1,U4)=>{P4(p1),$6(p1,U4)},state:o1,response:A0?.data?.summary||A0?.message,error:S1?.message,plan:Q7,streamedContent:T7,toolName:V4,onApprove:H6,onReject:S5,onReset:p5,onStop:x7,onExpand:I?()=>r7("chat"):void 0,placeholder:K0||"Enter your command..."})}),$5.jsx("style",{dangerouslySetInnerHTML:{__html:`
|
|
201
|
+
@keyframes pulse-border {
|
|
202
|
+
0%, 100% { border-color: rgb(59, 130, 246); }
|
|
203
|
+
50% { border-color: rgb(147, 197, 253); }
|
|
204
|
+
}
|
|
205
|
+
.animate-pulse-border {
|
|
206
|
+
animation: pulse-border 2s ease-in-out infinite;
|
|
207
|
+
}
|
|
208
|
+
.apteva-composer {
|
|
209
|
+
border-radius: var(--apteva-border-radius, 1rem) !important;
|
|
210
|
+
}
|
|
211
|
+
`}})]})});var M4=B0(U1(),1),UK=C5.createContext(null);function BK(){return C5.useContext(UK)}function WK({children:Y}){let{authFetch:G,isAuthenticated:U,isLoading:_}=b1(),[q,R]=C5.useState(null),[K,O]=C5.useState(!1),[T,I]=C5.useState(!1),[b,P]=C5.useState(null),N=async()=>{try{let A=await(await G("/api/meta-agent/status")).json();R(A)}catch(p){console.error("[MetaAgent] Failed to fetch status:",p)}};C5.useEffect(()=>{if(!_&&U)N()},[G,U,_]);let S=async()=>{I(!0),P(null);try{let p=await G("/api/meta-agent/start",{method:"POST"}),A=await p.json();if(!p.ok)P(A.error||"Failed to start assistant");else await N()}catch(p){P("Failed to start assistant")}I(!1)},f=!!(q?.enabled&&q?.available),V=q?.agent,x=!!(V?.status==="running"&&V?.port),v={status:q,isOpen:K,isStarting:T,error:b,isAvailable:f,isRunning:x,agent:V,toggle:()=>O(!K),close:()=>O(!1),startAgent:S};return M4.jsxDEV(UK.Provider,{value:v,children:Y},void 0,!1,void 0,this)}function OK(){let Y=BK();if(!Y?.isAvailable)return null;return M4.jsxDEV("button",{onClick:Y.toggle,className:`hidden md:flex items-center gap-2 px-3 py-2 rounded transition ${Y.isOpen?"bg-[#f97316] text-white":"bg-[#151515] hover:bg-[#1a1a1a] text-[#888] hover:text-white"}`,title:"Apteva Assistant",children:[M4.jsxDEV(_K,{className:"w-5 h-5"},void 0,!1,void 0,this),M4.jsxDEV("span",{className:"text-sm",children:"Assistant"},void 0,!1,void 0,this),Y.isRunning&&M4.jsxDEV("span",{className:"w-2 h-2 rounded-full bg-green-400"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function KK(){let Y=BK(),{currentProjectId:G,currentProject:U}=R4();if(!Y?.isAvailable||!Y.isOpen)return null;let{agent:_,isRunning:q,error:R,isStarting:K,startAgent:O,close:T}=Y,I=C5.useMemo(()=>{let b=[];if(U)b.push(`Current project: "${U.name}" (id: ${U.id})`);else if(G==="unassigned")b.push("Viewing: unassigned agents (no project)");else b.push("Viewing: All Projects");return b.join(`
|
|
212
|
+
`)},[G,U]);return M4.jsxDEV(M4.Fragment,{children:[M4.jsxDEV("div",{className:"hidden md:block fixed inset-0 bg-black/20 z-40",onClick:T},void 0,!1,void 0,this),M4.jsxDEV("div",{className:"hidden md:flex fixed top-0 right-0 h-full w-[480px] lg:w-[540px] bg-[#0a0a0a] border-l border-[#1a1a1a] shadow-2xl z-50 flex-col",children:[M4.jsxDEV("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[#1a1a1a] bg-[#111]",children:[M4.jsxDEV("div",{className:"flex items-center gap-2",children:[M4.jsxDEV("div",{className:`w-2 h-2 rounded-full ${q?"bg-green-400":"bg-[#444]"}`},void 0,!1,void 0,this),M4.jsxDEV("span",{className:"font-medium text-sm",children:"Apteva Assistant"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M4.jsxDEV("button",{onClick:T,className:"text-[#666] hover:text-[#888] transition",children:M4.jsxDEV(AI,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M4.jsxDEV("div",{className:"flex-1 min-h-0 flex flex-col",children:q?M4.jsxDEV(K2,{agentId:"default",apiUrl:`/api/agents/${_.id}`,placeholder:"Ask me anything about Apteva...",variant:"terminal",showHeader:!1,context:I},void 0,!1,void 0,this):M4.jsxDEV("div",{className:"flex-1 flex flex-col items-center justify-center p-6 text-center",children:[M4.jsxDEV(_K,{className:"w-12 h-12 text-[#333] mb-4"},void 0,!1,void 0,this),M4.jsxDEV("h3",{className:"font-medium mb-2",children:"Apteva Assistant"},void 0,!1,void 0,this),M4.jsxDEV("p",{className:"text-sm text-[#666] mb-6",children:"I can help you navigate Apteva, create agents, set up MCP servers, and more."},void 0,!1,void 0,this),R&&M4.jsxDEV("p",{className:"text-sm text-red-400 mb-4",children:R},void 0,!1,void 0,this),M4.jsxDEV("button",{onClick:O,disabled:K,className:"bg-[#f97316] hover:bg-[#fb923c] disabled:opacity-50 text-white px-6 py-2 rounded font-medium transition",children:K?"Starting...":"Start Assistant"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function _K({className:Y="w-6 h-6"}){return M4.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:M4.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z"},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function AI(){return M4.jsxDEV("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:M4.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"},void 0,!1,void 0,this)},void 0,!1,void 0,this)}var u1=B0(U1(),1);function _2({onMenuClick:Y}){let{connected:G}=P6(),{user:U,logout:_}=b1(),{projects:q,currentProjectId:R,currentProject:K,setCurrentProjectId:O,unassignedCount:T,projectsEnabled:I}=R4(),[b,P]=YG.useState(!1),[N,S]=YG.useState(!1),f=async()=>{await _(),P(!1)},V=(p)=>{O(p),S(!1)},x=()=>{if(R===null)return"All Projects";if(R==="unassigned")return"Unassigned";return K?.name||"Select Project"},v=()=>{if(R===null)return"#666";if(R==="unassigned")return"#888";return K?.color||"#6366f1"};return u1.jsxDEV("header",{className:"border-b border-[#1a1a1a] px-4 md:px-6 py-4 flex-shrink-0",children:u1.jsxDEV("div",{className:"flex items-center justify-between",children:[u1.jsxDEV("div",{className:"flex items-center gap-3",children:[u1.jsxDEV("button",{onClick:Y,className:"p-2 -ml-2 text-[#666] hover:text-[#e0e0e0] transition md:hidden",children:u1.jsxDEV(DO,{},void 0,!1,void 0,this)},void 0,!1,void 0,this),u1.jsxDEV("div",{className:"flex items-center gap-2",children:[u1.jsxDEV("span",{className:"text-[#f97316]",children:">_"},void 0,!1,void 0,this),u1.jsxDEV("span",{className:"text-xl tracking-wider",children:"apteva"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),I&&q.length>0&&u1.jsxDEV("div",{className:"relative ml-2 md:ml-4",children:[u1.jsxDEV("button",{onClick:()=>S(!N),className:"flex items-center gap-2 px-3 py-1.5 rounded border border-[#222] bg-[#111] hover:bg-[#1a1a1a] transition text-sm",children:[u1.jsxDEV("span",{className:"w-2.5 h-2.5 rounded-full",style:{backgroundColor:v()}},void 0,!1,void 0,this),u1.jsxDEV("span",{className:"hidden sm:inline max-w-[120px] md:max-w-[180px] truncate",children:x()},void 0,!1,void 0,this),u1.jsxDEV(mO,{},void 0,!1,void 0,this)]},void 0,!0,void 0,this),N&&u1.jsxDEV("div",{className:"absolute left-0 top-full mt-1 w-56 bg-[#111] border border-[#222] rounded-lg shadow-xl z-50",children:u1.jsxDEV("div",{className:"py-1 max-h-64 overflow-y-auto",children:[u1.jsxDEV("button",{onClick:()=>V(null),className:`w-full px-4 py-2 text-left text-sm flex items-center gap-2 hover:bg-[#1a1a1a] transition ${R===null?"bg-[#1a1a1a] text-[#f97316]":""}`,children:[u1.jsxDEV("span",{className:"w-2.5 h-2.5 rounded-full bg-[#666]"},void 0,!1,void 0,this),"All Projects"]},void 0,!0,void 0,this),q.map((p)=>u1.jsxDEV("button",{onClick:()=>V(p.id),className:`w-full px-4 py-2 text-left text-sm flex items-center gap-2 hover:bg-[#1a1a1a] transition ${R===p.id?"bg-[#1a1a1a] text-[#f97316]":""}`,children:[u1.jsxDEV("span",{className:"w-2.5 h-2.5 rounded-full flex-shrink-0",style:{backgroundColor:p.color}},void 0,!1,void 0,this),u1.jsxDEV("span",{className:"truncate",children:p.name},void 0,!1,void 0,this),u1.jsxDEV("span",{className:"ml-auto text-xs text-[#666]",children:p.agentCount},void 0,!1,void 0,this)]},p.id,!0,void 0,this)),T>0&&u1.jsxDEV("button",{onClick:()=>V("unassigned"),className:`w-full px-4 py-2 text-left text-sm flex items-center gap-2 hover:bg-[#1a1a1a] transition ${R==="unassigned"?"bg-[#1a1a1a] text-[#f97316]":""}`,children:[u1.jsxDEV("span",{className:"w-2.5 h-2.5 rounded-full bg-[#888]"},void 0,!1,void 0,this),u1.jsxDEV("span",{className:"truncate",children:"Unassigned"},void 0,!1,void 0,this),u1.jsxDEV("span",{className:"ml-auto text-xs text-[#666]",children:T},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),u1.jsxDEV("div",{className:"flex items-center gap-3 md:gap-4",children:[u1.jsxDEV("div",{className:"flex items-center gap-2",children:[u1.jsxDEV("span",{className:`w-2 h-2 rounded-full ${G?"bg-green-400":"bg-red-400"}`},void 0,!1,void 0,this),u1.jsxDEV("span",{className:"text-xs text-[#666] hidden sm:inline",children:G?"Live":"Offline"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),u1.jsxDEV(OK,{},void 0,!1,void 0,this),U&&u1.jsxDEV("div",{className:"relative",children:[u1.jsxDEV("button",{onClick:()=>P(!b),className:"flex items-center gap-2 px-2 md:px-3 py-2 rounded hover:bg-[#1a1a1a] transition",children:[u1.jsxDEV("div",{className:"w-8 h-8 rounded-full bg-[#f97316] flex items-center justify-center text-black font-medium text-sm",children:U.username.charAt(0).toUpperCase()},void 0,!1,void 0,this),u1.jsxDEV("span",{className:"text-sm text-[#888] hidden sm:block",children:U.username},void 0,!1,void 0,this)]},void 0,!0,void 0,this),b&&u1.jsxDEV("div",{className:"absolute right-0 top-full mt-1 w-48 bg-[#111] border border-[#222] rounded-lg shadow-xl z-50",children:[u1.jsxDEV("div",{className:"px-4 py-3 border-b border-[#222]",children:[u1.jsxDEV("p",{className:"text-sm font-medium",children:U.username},void 0,!1,void 0,this),u1.jsxDEV("p",{className:"text-xs text-[#f97316] mt-1",children:U.role},void 0,!1,void 0,this)]},void 0,!0,void 0,this),u1.jsxDEV("button",{onClick:f,className:"w-full px-4 py-2 text-left text-sm text-red-400 hover:bg-[#1a1a1a] transition",children:"Sign out"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}var J4=B0(U1(),1);function L2({route:Y,agentCount:G,taskCount:U,onNavigate:_,isOpen:q,onClose:R}){let K=(O)=>{_(O),R?.()};return J4.jsxDEV(J4.Fragment,{children:[q&&J4.jsxDEV("div",{className:"fixed inset-0 bg-black/60 z-40 md:hidden",onClick:R},void 0,!1,void 0,this),J4.jsxDEV("aside",{className:`
|
|
213
|
+
fixed inset-y-0 left-0 z-50 w-64 bg-[#0a0a0a] border-r border-[#1a1a1a] p-4 transform transition-transform duration-200 ease-in-out
|
|
214
|
+
md:relative md:w-56 md:translate-x-0 md:z-auto
|
|
215
|
+
${q?"translate-x-0":"-translate-x-full"}
|
|
216
|
+
`,children:[J4.jsxDEV("div",{className:"flex items-center justify-between mb-4 md:hidden",children:[J4.jsxDEV("div",{className:"flex items-center gap-2",children:[J4.jsxDEV("span",{className:"text-[#f97316]",children:">_"},void 0,!1,void 0,this),J4.jsxDEV("span",{className:"text-lg tracking-wider",children:"apteva"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),J4.jsxDEV("button",{onClick:R,className:"p-2 text-[#666] hover:text-[#e0e0e0] transition",children:J4.jsxDEV(E5,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),J4.jsxDEV("nav",{className:"space-y-1",children:[J4.jsxDEV(Q8,{icon:J4.jsxDEV(q2,{},void 0,!1,void 0,this),label:"Dashboard",active:Y==="dashboard",onClick:()=>K("dashboard")},void 0,!1,void 0,this),J4.jsxDEV(Q8,{icon:J4.jsxDEV(U2,{},void 0,!1,void 0,this),label:"Agents",active:Y==="agents",onClick:()=>K("agents"),badge:G>0?String(G):void 0},void 0,!1,void 0,this),J4.jsxDEV(Q8,{icon:J4.jsxDEV(u5,{},void 0,!1,void 0,this),label:"Tasks",active:Y==="tasks",onClick:()=>K("tasks"),badge:U&&U>0?String(U):void 0},void 0,!1,void 0,this),J4.jsxDEV(Q8,{icon:J4.jsxDEV(x5,{},void 0,!1,void 0,this),label:"MCP",active:Y==="mcp",onClick:()=>K("mcp")},void 0,!1,void 0,this),J4.jsxDEV(Q8,{icon:J4.jsxDEV(mZ,{},void 0,!1,void 0,this),label:"Skills",active:Y==="skills",onClick:()=>K("skills")},void 0,!1,void 0,this),J4.jsxDEV(Q8,{icon:J4.jsxDEV(gO,{},void 0,!1,void 0,this),label:"Tests",active:Y==="tests",onClick:()=>K("tests")},void 0,!1,void 0,this),J4.jsxDEV(Q8,{icon:J4.jsxDEV(lH,{},void 0,!1,void 0,this),label:"Telemetry",active:Y==="telemetry",onClick:()=>K("telemetry")},void 0,!1,void 0,this),J4.jsxDEV(Q8,{icon:J4.jsxDEV(VO,{},void 0,!1,void 0,this),label:"API",active:Y==="api",onClick:()=>K("api")},void 0,!1,void 0,this),J4.jsxDEV(Q8,{icon:J4.jsxDEV(B2,{},void 0,!1,void 0,this),label:"Settings",active:Y==="settings",onClick:()=>K("settings")},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function Q8({icon:Y,label:G,active:U,onClick:_,badge:q}){return J4.jsxDEV("button",{onClick:_,className:`w-full flex items-center gap-3 px-3 py-2 rounded font-medium transition ${U?"bg-[#111] text-[#e0e0e0]":"text-[#666] hover:bg-[#111] hover:text-[#888]"}`,children:[Y,G,q&&J4.jsxDEV("span",{className:"ml-auto bg-[#333] text-[#888] text-xs px-2 py-0.5 rounded-full",children:q},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var jZ=B0(U1(),1);function R2({message:Y,onDismiss:G}){return jZ.jsxDEV("div",{className:"bg-red-500/10 border-b border-red-500/30 px-6 py-3 text-red-400 text-sm flex items-center justify-between",children:[jZ.jsxDEV("span",{children:Y},void 0,!1,void 0,this),jZ.jsxDEV("button",{onClick:G,className:"hover:text-red-300",children:jZ.jsxDEV(E5,{className:"w-4 h-4"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var pZ=B0(V1(),1);var $7=B0(U1(),1);function N2(){let{login:Y}=b1(),[G,U]=pZ.useState(""),[_,q]=pZ.useState(""),[R,K]=pZ.useState(null),[O,T]=pZ.useState(!1);return $7.jsxDEV("div",{className:"min-h-screen bg-[#0a0a0a] text-[#e0e0e0] font-mono flex items-center justify-center p-8",children:$7.jsxDEV("div",{className:"w-full max-w-md",children:[$7.jsxDEV("div",{className:"text-center mb-8",children:[$7.jsxDEV("div",{className:"flex items-center justify-center gap-2 mb-2",children:[$7.jsxDEV("span",{className:"text-[#f97316] text-3xl",children:">_"},void 0,!1,void 0,this),$7.jsxDEV("span",{className:"text-3xl tracking-wider",children:"apteva"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$7.jsxDEV("p",{className:"text-[#666]",children:"Run AI agents locally"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$7.jsxDEV("div",{className:"bg-[#111] rounded-lg border border-[#1a1a1a] p-8",children:[$7.jsxDEV("h2",{className:"text-2xl font-semibold mb-2",children:"Welcome back"},void 0,!1,void 0,this),$7.jsxDEV("p",{className:"text-[#666] mb-6",children:"Sign in to continue to apteva"},void 0,!1,void 0,this),$7.jsxDEV("form",{onSubmit:async(b)=>{b.preventDefault(),K(null),T(!0);let P=await Y(G,_);if(!P.success)K(P.error||"Login failed");T(!1)},className:"space-y-4",children:[$7.jsxDEV("div",{children:[$7.jsxDEV("label",{htmlFor:"username",className:"block text-sm text-[#888] mb-1",children:"Username"},void 0,!1,void 0,this),$7.jsxDEV("input",{id:"username",type:"text",value:G,onChange:(b)=>U(b.target.value),placeholder:"Enter your username",autoFocus:!0,required:!0,className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-4 py-3 focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$7.jsxDEV("div",{children:[$7.jsxDEV("label",{htmlFor:"password",className:"block text-sm text-[#888] mb-1",children:"Password"},void 0,!1,void 0,this),$7.jsxDEV("input",{id:"password",type:"password",value:_,onChange:(b)=>q(b.target.value),placeholder:"Enter your password",required:!0,className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-4 py-3 focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),R&&$7.jsxDEV("div",{className:"p-3 bg-red-500/10 border border-red-500/30 rounded text-red-400 text-sm",children:R},void 0,!1,void 0,this),$7.jsxDEV("button",{type:"submit",disabled:O||!G||!_,className:"w-full bg-[#f97316] hover:bg-[#fb923c] disabled:opacity-50 disabled:cursor-not-allowed text-black px-4 py-3 rounded font-medium transition",children:O?"Signing in...":"Sign In"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}var D8=B0(V1(),1),C4=B0(U1(),1);function M2({onComplete:Y}){let[G,U]=D8.useState(""),[_,q]=D8.useState(""),[R,K]=D8.useState(""),[O,T]=D8.useState(""),[I,b]=D8.useState(!1),[P,N]=D8.useState(null),[S,f]=D8.useState(!1);return C4.jsxDEV(C4.Fragment,{children:[C4.jsxDEV("h2",{className:"text-2xl font-semibold mb-2",children:"Create your account"},void 0,!1,void 0,this),C4.jsxDEV("p",{className:"text-[#666] mb-6",children:"Set up your admin account to get started with apteva."},void 0,!1,void 0,this),C4.jsxDEV("form",{onSubmit:async(x)=>{if(x.preventDefault(),N(null),_!==R){N("Passwords do not match");return}f(!0);try{let v=await fetch("/api/onboarding/user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:G,password:_,...O&&{email:O}})}),p=await v.json();if(!v.ok){N(p.error||"Failed to create account"),f(!1);return}let A=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({username:G,password:_})});if(!A.ok){N("Account created but login failed. Please try logging in."),f(!1);return}let E=await A.json();if(E.accessToken)sessionStorage.setItem("accessToken",E.accessToken);Y({username:G})}catch(v){N("Failed to create account"),f(!1)}},className:"space-y-4",children:[C4.jsxDEV("div",{children:[C4.jsxDEV("label",{htmlFor:"username",className:"block text-sm text-[#888] mb-1",children:"Username"},void 0,!1,void 0,this),C4.jsxDEV("input",{id:"username",type:"text",value:G,onChange:(x)=>U(x.target.value),placeholder:"Choose a username",autoFocus:!0,required:!0,className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-4 py-3 focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this),C4.jsxDEV("p",{className:"text-xs text-[#666] mt-1",children:"3-20 characters, letters, numbers, underscore"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),C4.jsxDEV("div",{children:[C4.jsxDEV("label",{htmlFor:"password",className:"block text-sm text-[#888] mb-1",children:"Password"},void 0,!1,void 0,this),C4.jsxDEV("input",{id:"password",type:"password",value:_,onChange:(x)=>q(x.target.value),placeholder:"Enter a password",required:!0,className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-4 py-3 focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this),C4.jsxDEV("p",{className:"text-xs text-[#666] mt-1",children:"Min 8 characters, uppercase, lowercase, number"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),C4.jsxDEV("div",{children:[C4.jsxDEV("label",{htmlFor:"confirmPassword",className:"block text-sm text-[#888] mb-1",children:"Confirm Password"},void 0,!1,void 0,this),C4.jsxDEV("input",{id:"confirmPassword",type:"password",value:R,onChange:(x)=>K(x.target.value),placeholder:"Confirm your password",required:!0,className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-4 py-3 focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),!I?C4.jsxDEV("button",{type:"button",onClick:()=>b(!0),className:"text-sm text-[#666] hover:text-[#888] transition",children:"+ Add email for password recovery (optional)"},void 0,!1,void 0,this):C4.jsxDEV("div",{children:[C4.jsxDEV("label",{htmlFor:"email",className:"block text-sm text-[#888] mb-1",children:["Email ",C4.jsxDEV("span",{className:"text-[#666]",children:"(optional)"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),C4.jsxDEV("input",{id:"email",type:"email",value:O,onChange:(x)=>T(x.target.value),placeholder:"For password recovery only",className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-4 py-3 focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this),C4.jsxDEV("p",{className:"text-xs text-[#666] mt-1",children:"Only used for password recovery, never shared"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),P&&C4.jsxDEV("div",{className:"p-3 bg-red-500/10 border border-red-500/30 rounded text-red-400 text-sm",children:P},void 0,!1,void 0,this),C4.jsxDEV("button",{type:"submit",disabled:S||!G||!_||!R,className:"w-full bg-[#f97316] hover:bg-[#fb923c] disabled:opacity-50 disabled:cursor-not-allowed text-black px-4 py-3 rounded font-medium transition",children:S?"Creating account...":"Create Account"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),C4.jsxDEV("p",{className:"text-xs text-[#666] mt-4 text-center",children:"This will be your admin account with full access to apteva."},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var j5=B0(V1(),1);var t0=B0(U1(),1);function dZ({onComplete:Y,needsAccount:G=!1}){let[U,_]=j5.useState(G?0:1),[q,R]=j5.useState([]),[K,O]=j5.useState(null),[T,I]=j5.useState(""),[b,P]=j5.useState(!1),[N,S]=j5.useState(!1),[f,V]=j5.useState(null),[x,v]=j5.useState(null),[p,A]=j5.useState(!1),E=()=>{let Q0=sessionStorage.getItem("accessToken");return Q0?{Authorization:`Bearer ${Q0}`}:{}};j5.useEffect(()=>{if(G&&!p&&U===0)return;fetch("/api/providers",{headers:E()}).then((Q0)=>Q0.json()).then((Q0)=>{let n=(Q0.providers||[]).filter((G0)=>G0.type==="llm");R(n)})},[p,U,G]);let j=q.filter((Q0)=>Q0.hasKey),u=async()=>{if(!K||!T)return;P(!0),V(null),v(null);try{S(!0);let n=await(await fetch(`/api/keys/${K}/test`,{method:"POST",headers:{"Content-Type":"application/json",...E()},body:JSON.stringify({key:T})})).json();if(S(!1),!n.valid){V(n.error||"API key is invalid"),P(!1);return}let G0=await fetch(`/api/keys/${K}`,{method:"POST",headers:{"Content-Type":"application/json",...E()},body:JSON.stringify({key:T})}),F0=await G0.json();if(!G0.ok)V(F0.error||"Failed to save key");else{v("API key saved successfully!"),I("");let S0=await(await fetch("/api/providers",{headers:E()})).json();R(S0.providers||[]),O(null)}}catch(Q0){V("Failed to save key")}P(!1)},r=async()=>{try{let Q0=await fetch("/api/projects",{method:"POST",headers:{"Content-Type":"application/json",...E()},body:JSON.stringify({name:"My Project",description:"Default project for organizing agents",color:"#f97316"})});if(Q0.ok){let n=await Q0.json();if(n.project?.id)localStorage.setItem("apteva_current_project",n.project.id)}}catch(Q0){console.error("Failed to create default project:",Q0)}await fetch("/api/onboarding/complete",{method:"POST",headers:E()}),Y()},i=()=>{A(!0),_(1)},d=G?3:2,D=G?U:U-1;return t0.jsxDEV("div",{className:"min-h-screen bg-[#0a0a0a] text-[#e0e0e0] font-mono flex items-center justify-center p-8",children:t0.jsxDEV("div",{className:"w-full max-w-2xl",children:[t0.jsxDEV("div",{className:"text-center mb-8",children:[t0.jsxDEV("div",{className:"flex items-center justify-center gap-2 mb-2",children:[t0.jsxDEV("span",{className:"text-[#f97316] text-3xl",children:">_"},void 0,!1,void 0,this),t0.jsxDEV("span",{className:"text-3xl tracking-wider",children:"apteva"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),t0.jsxDEV("p",{className:"text-[#666]",children:"Run AI agents locally"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),t0.jsxDEV("div",{className:"flex items-center justify-center gap-2 mb-8",children:[G&&t0.jsxDEV(t0.Fragment,{children:[t0.jsxDEV("div",{className:`w-3 h-3 rounded-full ${U>=0?"bg-[#f97316]":"bg-[#333]"}`},void 0,!1,void 0,this),t0.jsxDEV("div",{className:`w-16 h-0.5 ${U>=1?"bg-[#f97316]":"bg-[#333]"}`},void 0,!1,void 0,this)]},void 0,!0,void 0,this),t0.jsxDEV("div",{className:`w-3 h-3 rounded-full ${U>=1?"bg-[#f97316]":"bg-[#333]"}`},void 0,!1,void 0,this),t0.jsxDEV("div",{className:`w-16 h-0.5 ${U>=2?"bg-[#f97316]":"bg-[#333]"}`},void 0,!1,void 0,this),t0.jsxDEV("div",{className:`w-3 h-3 rounded-full ${U>=2?"bg-[#f97316]":"bg-[#333]"}`},void 0,!1,void 0,this)]},void 0,!0,void 0,this),t0.jsxDEV("div",{className:"bg-[#111] rounded-lg border border-[#1a1a1a] p-8",children:[U===0&&G&&t0.jsxDEV(M2,{onComplete:i},void 0,!1,void 0,this),U===1&&t0.jsxDEV(II,{providers:q,configuredProviders:j,selectedProvider:K,apiKey:T,saving:b,testing:N,error:f,success:x,onSelectProvider:O,onApiKeyChange:I,onSaveKey:u,onContinue:()=>_(2)},void 0,!1,void 0,this),U===2&&t0.jsxDEV(kI,{configuredProviders:j,onAddMore:()=>_(1),onComplete:r},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function II({providers:Y,configuredProviders:G,selectedProvider:U,apiKey:_,saving:q,testing:R,error:K,success:O,onSelectProvider:T,onApiKeyChange:I,onSaveKey:b,onContinue:P}){let N=Y.find((S)=>S.id===U);if(U&&N)return t0.jsxDEV(t0.Fragment,{children:[t0.jsxDEV("h2",{className:"text-2xl font-semibold mb-2",children:["Add ",N.name," Key"]},void 0,!0,void 0,this),t0.jsxDEV("p",{className:"text-[#666] mb-6",children:"Enter your API key below. It will be encrypted and stored locally."},void 0,!1,void 0,this),t0.jsxDEV("div",{className:"mb-6",children:[t0.jsxDEV("div",{className:"p-4 rounded border border-[#f97316] bg-[#f97316]/5 mb-4",children:t0.jsxDEV("div",{className:"flex items-center justify-between",children:[t0.jsxDEV("div",{children:[t0.jsxDEV("p",{className:"font-medium",children:N.name},void 0,!1,void 0,this),t0.jsxDEV("p",{className:"text-sm text-[#666]",children:[N.models.length," models available"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),t0.jsxDEV("a",{href:N.docsUrl,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-[#3b82f6] hover:underline",children:"Get API Key"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),t0.jsxDEV("div",{className:"space-y-3",children:[t0.jsxDEV("input",{type:"password",value:_,onChange:(S)=>I(S.target.value),placeholder:"Enter your API key...",autoFocus:!0,className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-4 py-3 focus:outline-none focus:border-[#f97316] text-lg"},void 0,!1,void 0,this),K&&t0.jsxDEV("p",{className:"text-red-400 text-sm",children:K},void 0,!1,void 0,this),O&&t0.jsxDEV("p",{className:"text-green-400 text-sm",children:O},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),t0.jsxDEV("div",{className:"flex gap-3",children:[t0.jsxDEV("button",{onClick:()=>{T(null),I("")},className:"flex-1 border border-[#333] hover:border-[#666] px-4 py-3 rounded font-medium transition",children:"Back"},void 0,!1,void 0,this),t0.jsxDEV("button",{onClick:b,disabled:!_||q,className:"flex-1 bg-[#f97316] hover:bg-[#fb923c] disabled:opacity-50 disabled:cursor-not-allowed text-black px-4 py-3 rounded font-medium transition",children:R?"Testing...":q?"Saving...":"Save API Key"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this);return t0.jsxDEV(t0.Fragment,{children:[t0.jsxDEV("h2",{className:"text-2xl font-semibold mb-2",children:"Welcome to apteva"},void 0,!1,void 0,this),t0.jsxDEV("p",{className:"text-[#666] mb-6",children:"To get started, you'll need to add at least one AI provider API key. Your keys are encrypted and stored locally."},void 0,!1,void 0,this),t0.jsxDEV("div",{className:"space-y-3 mb-6",children:Y.map((S)=>t0.jsxDEV(TI,{provider:S,selected:!1,onSelect:()=>!S.hasKey&&T(S.id)},S.id,!1,void 0,this))},void 0,!1,void 0,this),t0.jsxDEV("button",{onClick:P,disabled:G.length===0,className:"w-full bg-[#222] hover:bg-[#333] disabled:opacity-50 disabled:cursor-not-allowed px-4 py-3 rounded font-medium transition",children:G.length===0?"Add at least one API key to continue":`Continue with ${G.length} provider${G.length>1?"s":""}`},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function TI({provider:Y,selected:G,onSelect:U}){return t0.jsxDEV("div",{onClick:U,className:`p-4 rounded border transition cursor-pointer ${Y.hasKey?"border-green-500/30 bg-green-500/5":G?"border-[#f97316] bg-[#f97316]/5":"border-[#222] hover:border-[#333]"}`,children:t0.jsxDEV("div",{className:"flex items-center justify-between",children:[t0.jsxDEV("div",{children:[t0.jsxDEV("p",{className:"font-medium",children:Y.name},void 0,!1,void 0,this),t0.jsxDEV("p",{className:"text-sm text-[#666]",children:[Y.models.length," models available"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Y.hasKey?t0.jsxDEV("span",{className:"text-green-400 text-sm flex items-center gap-1",children:[t0.jsxDEV(a7,{},void 0,!1,void 0,this),"Configured (",Y.keyHint,")"]},void 0,!0,void 0,this):t0.jsxDEV("a",{href:Y.docsUrl,target:"_blank",rel:"noopener noreferrer",onClick:(_)=>_.stopPropagation(),className:"text-sm text-[#3b82f6] hover:underline",children:"Get API Key"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function kI({configuredProviders:Y,onAddMore:G,onComplete:U}){return t0.jsxDEV(t0.Fragment,{children:[t0.jsxDEV("h2",{className:"text-2xl font-semibold mb-2",children:"You're all set!"},void 0,!1,void 0,this),t0.jsxDEV("p",{className:"text-[#666] mb-6",children:["You've configured ",Y.length," provider",Y.length>1?"s":"",". You can add more providers later in Settings."]},void 0,!0,void 0,this),t0.jsxDEV("div",{className:"space-y-2 mb-6",children:Y.map((_)=>t0.jsxDEV("div",{className:"flex items-center gap-3 p-3 bg-[#0a0a0a] rounded",children:[t0.jsxDEV(a7,{className:"w-5 h-5 text-green-400"},void 0,!1,void 0,this),t0.jsxDEV("span",{children:_.name},void 0,!1,void 0,this),t0.jsxDEV("span",{className:"text-[#666] text-sm",children:["(",_.keyHint,")"]},void 0,!0,void 0,this)]},_.id,!0,void 0,this))},void 0,!1,void 0,this),t0.jsxDEV("div",{className:"flex gap-3",children:[t0.jsxDEV("button",{onClick:G,className:"flex-1 border border-[#333] hover:border-[#f97316] px-4 py-3 rounded font-medium transition",children:"Add More"},void 0,!1,void 0,this),t0.jsxDEV("button",{onClick:U,className:"flex-1 bg-[#f97316] hover:bg-[#fb923c] text-black px-4 py-3 rounded font-medium transition",children:"Start Using apteva"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var _1=B0(V1(),1);var F=B0(U1(),1);function w2(){let{projectsEnabled:Y}=R4(),[G,U]=_1.useState("providers"),_=[{key:"providers",label:"Providers"},...Y?[{key:"projects",label:"Projects"}]:[],{key:"api-keys",label:"API Keys"},{key:"account",label:"Account"},{key:"updates",label:"Updates"},{key:"data",label:"Data"}];return F.jsxDEV("div",{className:"flex-1 flex flex-col md:flex-row overflow-hidden",children:[F.jsxDEV("div",{className:"md:hidden border-b border-[#1a1a1a] bg-[#0a0a0a]",children:F.jsxDEV("div",{className:"flex overflow-x-auto",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:_.map((q)=>F.jsxDEV("button",{onClick:()=>U(q.key),className:`flex-shrink-0 px-4 py-3 text-sm font-medium border-b-2 transition ${G===q.key?"border-[#f97316] text-[#f97316]":"border-transparent text-[#666] hover:text-[#888]"}`,children:q.label},q.key,!1,void 0,this))},void 0,!1,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("div",{className:"hidden md:block w-48 border-r border-[#1a1a1a] p-4 flex-shrink-0",children:[F.jsxDEV("h2",{className:"text-sm font-medium text-[#666] uppercase tracking-wider mb-3",children:"Settings"},void 0,!1,void 0,this),F.jsxDEV("nav",{className:"space-y-1",children:_.map((q)=>F.jsxDEV(CI,{label:q.label,active:G===q.key,onClick:()=>U(q.key)},q.key,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("div",{className:"flex-1 overflow-auto p-4 md:p-6",children:[G==="providers"&&F.jsxDEV(SI,{},void 0,!1,void 0,this),G==="projects"&&Y&&F.jsxDEV(vI,{},void 0,!1,void 0,this),G==="api-keys"&&F.jsxDEV(DI,{},void 0,!1,void 0,this),G==="account"&&F.jsxDEV(mI,{},void 0,!1,void 0,this),G==="updates"&&F.jsxDEV(hI,{},void 0,!1,void 0,this),G==="data"&&F.jsxDEV(gI,{},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function CI({label:Y,active:G,onClick:U}){return F.jsxDEV("button",{onClick:U,className:`w-full text-left px-3 py-2 rounded text-sm transition ${G?"bg-[#1a1a1a] text-[#e0e0e0]":"text-[#666] hover:bg-[#111] hover:text-[#888]"}`,children:Y},void 0,!1,void 0,this)}function SI(){let{authFetch:Y}=b1(),{projects:G,projectsEnabled:U}=R4(),[_,q]=_1.useState([]),[R,K]=_1.useState(null),[O,T]=_1.useState(""),[I,b]=_1.useState(!1),[P,N]=_1.useState(!1),[S,f]=_1.useState(null),[V,x]=_1.useState(null),{confirm:v,ConfirmDialog:p}=o7(),A=async()=>{let Q0=await(await Y("/api/providers")).json();q(Q0.providers||[])};_1.useEffect(()=>{A()},[]);let E=async()=>{if(!R||!O)return;b(!0),f(null),x(null);try{N(!0);let Q0=await(await Y(`/api/keys/${R}/test`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:O})})).json();if(N(!1),!Q0.valid){f(Q0.error||"API key is invalid"),b(!1);return}let n=await Y(`/api/keys/${R}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:O})}),G0=await n.json();if(!n.ok)f(G0.error||"Failed to save key");else{let F0="API key saved!";if(G0.restartedAgents&&G0.restartedAgents.length>0){let K0=G0.restartedAgents.filter((P0)=>P0.success).length;if(G0.restartedAgents.length-K0===0)F0+=` Restarted ${K0} agent${K0>1?"s":""} with new key.`;else F0+=` Restarted ${K0}/${G0.restartedAgents.length} agents.`}x(F0),T(""),K(null),A()}}catch(D){f("Failed to save key")}b(!1)},j=async(D)=>{if(!await v("Are you sure you want to remove this API key?",{confirmText:"Remove",title:"Remove API Key"}))return;await Y(`/api/keys/${D}`,{method:"DELETE"}),A()},u=_.filter((D)=>D.type==="llm"),r=_.filter((D)=>D.type==="integration"),i=u.filter((D)=>D.hasKey).length,d=r.filter((D)=>D.hasKey).length;return _1.useEffect(()=>{if(V&&!R){let D=setTimeout(()=>x(null),5000);return()=>clearTimeout(D)}},[V,R]),F.jsxDEV(F.Fragment,{children:[p,F.jsxDEV("div",{className:"space-y-10",children:[V&&!R&&F.jsxDEV("div",{className:"bg-green-500/10 border border-green-500/30 rounded-lg p-4 flex items-center justify-between",children:[F.jsxDEV("div",{className:"flex items-center gap-2 text-green-400",children:[F.jsxDEV(a7,{className:"w-5 h-5"},void 0,!1,void 0,this),F.jsxDEV("span",{children:V},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("button",{onClick:()=>x(null),className:"text-green-400 hover:text-green-300",children:F.jsxDEV(E5,{className:"w-4 h-4"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("div",{children:[F.jsxDEV("div",{className:"mb-6",children:[F.jsxDEV("h1",{className:"text-2xl font-semibold mb-1",children:"AI Providers"},void 0,!1,void 0,this),F.jsxDEV("p",{className:"text-[#666]",children:["Manage your API keys for AI providers. ",i," of ",u.length," configured."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:u.map((D)=>F.jsxDEV(yI,{provider:D,isEditing:R===D.id,apiKey:O,saving:I,testing:P,error:R===D.id?S:null,success:R===D.id?V:null,onStartEdit:()=>{K(D.id),f(null),x(null)},onCancelEdit:()=>{K(null),T(""),f(null)},onApiKeyChange:T,onSave:E,onDelete:()=>j(D.id)},D.id,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("div",{children:[F.jsxDEV("div",{className:"mb-6",children:[F.jsxDEV("h2",{className:"text-xl font-semibold mb-1",children:"MCP Integrations"},void 0,!1,void 0,this),F.jsxDEV("p",{className:"text-[#666]",children:["Connect to MCP gateways for tool integrations. ",d," of ",r.length," configured."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:r.map((D)=>F.jsxDEV(VI,{provider:D,isEditing:R===D.id,apiKey:O,saving:I,testing:P,error:R===D.id?S:null,success:R===D.id?V:null,onStartEdit:()=>{K(D.id),f(null),x(null)},onCancelEdit:()=>{K(null),T(""),f(null)},onApiKeyChange:T,onSave:E,onDelete:()=>j(D.id),projectsEnabled:U,projects:G,onRefresh:A},D.id,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var $G=["#f97316","#6366f1","#22c55e","#ef4444","#3b82f6","#a855f7","#14b8a6","#f59e0b"];function vI(){let{projects:Y,createProject:G,updateProject:U,deleteProject:_}=R4(),[q,R]=_1.useState(!1),[K,O]=_1.useState(null),{confirm:T,ConfirmDialog:I}=o7(),b=async(f)=>{if(!await T("Are you sure you want to delete this project? Agents in this project will become unassigned.",{confirmText:"Delete",title:"Delete Project"}))return;await _(f)},P=()=>{O(null),R(!0)},N=(f)=>{O(f),R(!0)},S=()=>{R(!1),O(null)};return F.jsxDEV(F.Fragment,{children:[I,F.jsxDEV("div",{className:"max-w-4xl w-full",children:[F.jsxDEV("div",{className:"mb-6 flex items-center justify-between gap-4",children:[F.jsxDEV("div",{children:[F.jsxDEV("h1",{className:"text-2xl font-semibold mb-1",children:"Projects"},void 0,!1,void 0,this),F.jsxDEV("p",{className:"text-[#666]",children:"Organize agents into projects for better management."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("button",{onClick:P,className:"flex items-center gap-2 bg-[#f97316] hover:bg-[#fb923c] text-black px-4 py-2 rounded font-medium transition flex-shrink-0",children:[F.jsxDEV(iH,{className:"w-4 h-4"},void 0,!1,void 0,this),"New Project"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Y.length===0?F.jsxDEV("div",{className:"text-center py-12 text-[#666]",children:[F.jsxDEV("p",{className:"text-lg mb-2",children:"No projects yet"},void 0,!1,void 0,this),F.jsxDEV("p",{className:"text-sm",children:"Create a project to organize your agents."},void 0,!1,void 0,this)]},void 0,!0,void 0,this):F.jsxDEV("div",{className:"space-y-3",children:Y.map((f)=>F.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg p-4 flex items-center gap-4",children:[F.jsxDEV("div",{className:"w-4 h-4 rounded-full flex-shrink-0",style:{backgroundColor:f.color}},void 0,!1,void 0,this),F.jsxDEV("div",{className:"flex-1 min-w-0",children:[F.jsxDEV("h3",{className:"font-medium",children:f.name},void 0,!1,void 0,this),f.description&&F.jsxDEV("p",{className:"text-sm text-[#666] truncate",children:f.description},void 0,!1,void 0,this),F.jsxDEV("p",{className:"text-xs text-[#666] mt-1",children:[f.agentCount," agent",f.agentCount!==1?"s":""]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("div",{className:"flex items-center gap-2",children:[F.jsxDEV("button",{onClick:()=>N(f),className:"text-sm text-[#888] hover:text-[#e0e0e0] px-2 py-1",children:"Edit"},void 0,!1,void 0,this),F.jsxDEV("button",{onClick:()=>b(f.id),className:"text-sm text-red-400 hover:text-red-300 px-2 py-1",children:"Delete"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},f.id,!0,void 0,this))},void 0,!1,void 0,this),q&&F.jsxDEV(fI,{project:K,onSave:async(f)=>{if(K){let V=await U(K.id,f);if(V)S();return!!V}else{let V=await G(f);if(V)S();return!!V}},onClose:S},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function fI({project:Y,onSave:G,onClose:U}){let[_,q]=_1.useState(Y?.name||""),[R,K]=_1.useState(Y?.description||""),[O,T]=_1.useState(Y?.color||$G[Math.floor(Math.random()*$G.length)]),[I,b]=_1.useState(!1),[P,N]=_1.useState(null),S=async()=>{if(!_.trim()){N("Name is required");return}b(!0),N(null);let f=await G({name:_,description:R||void 0,color:O});if(b(!1),!f)N(Y?"Failed to update project":"Failed to create project")};return F.jsxDEV(vQ,{onClose:U,children:[F.jsxDEV("h2",{className:"text-xl font-semibold mb-6",children:Y?"Edit Project":"Create New Project"},void 0,!1,void 0,this),F.jsxDEV("div",{className:"space-y-4",children:[F.jsxDEV("div",{children:[F.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"Name"},void 0,!1,void 0,this),F.jsxDEV("input",{type:"text",value:_,onChange:(f)=>q(f.target.value),className:"w-full bg-[#0a0a0a] border border-[#222] rounded px-3 py-2 focus:outline-none focus:border-[#f97316]",placeholder:"My Project",autoFocus:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("div",{children:[F.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"Description (optional)"},void 0,!1,void 0,this),F.jsxDEV("input",{type:"text",value:R,onChange:(f)=>K(f.target.value),className:"w-full bg-[#0a0a0a] border border-[#222] rounded px-3 py-2 focus:outline-none focus:border-[#f97316]",placeholder:"A short description"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("div",{children:[F.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"Color"},void 0,!1,void 0,this),F.jsxDEV("div",{className:"flex gap-3 flex-wrap",children:$G.map((f)=>F.jsxDEV("button",{type:"button",onClick:()=>T(f),className:`w-10 h-10 rounded-full transition ${O===f?"ring-2 ring-white ring-offset-2 ring-offset-[#111]":"hover:scale-110"}`,style:{backgroundColor:f}},f,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),P&&F.jsxDEV("p",{className:"text-red-400 text-sm",children:P},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("div",{className:"flex gap-3 mt-6",children:[F.jsxDEV("button",{onClick:U,className:"flex-1 border border-[#333] hover:border-[#f97316] hover:text-[#f97316] px-4 py-2 rounded font-medium transition",children:"Cancel"},void 0,!1,void 0,this),F.jsxDEV("button",{onClick:S,disabled:I||!_.trim(),className:"flex-1 bg-[#f97316] hover:bg-[#fb923c] disabled:opacity-50 text-black px-4 py-2 rounded font-medium transition",children:I?"Saving...":Y?"Update":"Create"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function hI(){let{authFetch:Y}=b1(),[G,U]=_1.useState(null),[_,q]=_1.useState(!1),[R,K]=_1.useState(!1),[O,T]=_1.useState(null),[I,b]=_1.useState(null),[P,N]=_1.useState(null),S=async()=>{q(!0),T(null);try{let v=await Y("/api/version");if(!v.ok)throw Error("Failed to check for updates");let p=await v.json();U(p)}catch(v){T("Failed to check for updates")}q(!1)},f=async()=>{K(!0),T(null),b(null);try{let p=await(await Y("/api/version/update",{method:"POST"})).json();if(!p.success)T(p.error||"Update failed");else{let A=p.restarted?.length||0,E=A>0?` ${A} running agent${A>1?"s":""} restarted.`:"";b(`Agent binary updated to v${p.version}.${E}`),await S()}}catch(v){T("Failed to update agent")}K(!1)};_1.useEffect(()=>{S()},[]);let V=(v,p)=>{navigator.clipboard.writeText(v),N(p),setTimeout(()=>N(null),2000)},x=G?.apteva.updateAvailable||G?.agent.updateAvailable;return F.jsxDEV("div",{className:"max-w-4xl w-full",children:[F.jsxDEV("div",{className:"mb-6",children:[F.jsxDEV("h1",{className:"text-2xl font-semibold mb-1",children:"Updates"},void 0,!1,void 0,this),F.jsxDEV("p",{className:"text-[#666]",children:"Check for new versions of apteva and the agent binary."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),_&&!G?F.jsxDEV("div",{className:"text-[#666]",children:"Checking version info..."},void 0,!1,void 0,this):O&&!G?F.jsxDEV("div",{className:"text-red-400",children:O},void 0,!1,void 0,this):G?.isDocker?F.jsxDEV("div",{className:"space-y-6",children:[F.jsxDEV("div",{className:"bg-blue-500/10 border border-blue-500/30 rounded-lg p-4",children:[F.jsxDEV("div",{className:"flex items-center gap-2 text-blue-400 mb-2",children:[F.jsxDEV("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:F.jsxDEV("path",{d:"M13.983 11.078h2.119a.186.186 0 00.186-.185V9.006a.186.186 0 00-.186-.186h-2.119a.185.185 0 00-.185.185v1.888c0 .102.083.185.185.185m-2.954-5.43h2.118a.186.186 0 00.186-.186V3.574a.186.186 0 00-.186-.185h-2.118a.185.185 0 00-.185.185v1.888c0 .102.082.185.185.185m0 2.716h2.118a.187.187 0 00.186-.186V6.29a.186.186 0 00-.186-.185h-2.118a.185.185 0 00-.185.185v1.887c0 .102.082.186.185.186m-2.93 0h2.12a.186.186 0 00.184-.186V6.29a.185.185 0 00-.185-.185H8.1a.185.185 0 00-.185.185v1.887c0 .102.083.186.185.186m-2.964 0h2.119a.186.186 0 00.185-.186V6.29a.186.186 0 00-.185-.185H5.136a.186.186 0 00-.186.185v1.887c0 .102.084.186.186.186m5.893 2.715h2.118a.186.186 0 00.186-.185V9.006a.186.186 0 00-.186-.186h-2.118a.185.185 0 00-.185.185v1.888c0 .102.082.185.185.185m-2.93 0h2.12a.185.185 0 00.184-.185V9.006a.185.185 0 00-.184-.186h-2.12a.185.185 0 00-.184.185v1.888c0 .102.083.185.185.185m-2.964 0h2.119a.185.185 0 00.185-.185V9.006a.185.185 0 00-.185-.186H5.136a.186.186 0 00-.186.186v1.887c0 .102.084.185.186.185m-2.92 0h2.12a.185.185 0 00.184-.185V9.006a.185.185 0 00-.184-.186h-2.12a.186.186 0 00-.186.186v1.887c0 .102.084.185.186.185M23.763 9.89c-.065-.051-.672-.51-1.954-.51-.338.001-.676.03-1.01.087-.248-1.7-1.653-2.53-1.716-2.566l-.344-.199-.226.327c-.284.438-.49.922-.612 1.43-.23.97-.09 1.882.403 2.661-.595.332-1.55.413-1.744.42H.751a.751.751 0 00-.75.748 11.376 11.376 0 00.692 4.062c.545 1.428 1.355 2.48 2.41 3.124 1.18.723 3.1 1.137 5.275 1.137.983.003 1.963-.086 2.93-.266a12.248 12.248 0 003.823-1.389c.98-.567 1.86-1.288 2.61-2.136 1.252-1.418 1.998-2.997 2.553-4.4h.221c1.372 0 2.215-.549 2.68-1.009.309-.293.55-.65.707-1.046l.098-.288Z"},void 0,!1,void 0,this)},void 0,!1,void 0,this),F.jsxDEV("span",{className:"font-medium",children:"Docker Environment"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("p",{className:"text-sm text-[#888]",children:"Updates are automatic when you pull a new image version."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg p-5",children:[F.jsxDEV("div",{className:"flex items-center justify-between mb-4",children:[F.jsxDEV("div",{children:[F.jsxDEV("h3",{className:"font-medium text-lg",children:"Current Version"},void 0,!1,void 0,this),F.jsxDEV("p",{className:"text-sm text-[#666]",children:"apteva + agent binary"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("div",{className:"text-right",children:F.jsxDEV("div",{className:"text-xl font-mono",children:["v",G.apteva.installed||"?"]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),x?F.jsxDEV("div",{className:"bg-[#f97316]/10 border border-[#f97316]/30 rounded-lg p-4",children:[F.jsxDEV("p",{className:"text-sm text-[#888] mb-3",children:["A newer version (v",G.apteva.latest,") is available. To update:"]},void 0,!0,void 0,this),F.jsxDEV("div",{className:"space-y-2",children:[F.jsxDEV("code",{className:"block bg-[#0a0a0a] px-3 py-2 rounded font-mono text-sm text-[#888]",children:"docker pull apteva/apteva:latest"},void 0,!1,void 0,this),F.jsxDEV("code",{className:"block bg-[#0a0a0a] px-3 py-2 rounded font-mono text-sm text-[#888]",children:"docker compose up -d"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("button",{onClick:()=>{navigator.clipboard.writeText("docker pull apteva/apteva:latest && docker compose up -d"),N("docker"),setTimeout(()=>N(null),2000)},className:"mt-3 px-3 py-1.5 bg-[#1a1a1a] hover:bg-[#222] rounded text-sm",children:P==="docker"?"Copied!":"Copy commands"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):F.jsxDEV("div",{className:"flex items-center gap-2 text-green-400 text-sm",children:[F.jsxDEV(a7,{className:"w-4 h-4"},void 0,!1,void 0,this),"Up to date"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("p",{className:"text-xs text-[#555]",children:"Your data is stored in a Docker volume and persists across updates."},void 0,!1,void 0,this)]},void 0,!0,void 0,this):G?F.jsxDEV("div",{className:"space-y-6",children:[I&&F.jsxDEV("div",{className:"bg-green-500/10 border border-green-500/30 rounded-lg p-4 text-green-400",children:I},void 0,!1,void 0,this),O&&F.jsxDEV("div",{className:"bg-red-500/10 border border-red-500/30 rounded-lg p-4 text-red-400",children:O},void 0,!1,void 0,this),F.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg p-5",children:[F.jsxDEV("div",{className:"flex items-center justify-between mb-4",children:[F.jsxDEV("div",{children:[F.jsxDEV("h3",{className:"font-medium text-lg",children:"apteva"},void 0,!1,void 0,this),F.jsxDEV("p",{className:"text-sm text-[#666]",children:"The app you're running"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("div",{className:"text-right",children:[F.jsxDEV("div",{className:"text-xl font-mono",children:["v",G.apteva.installed||"?"]},void 0,!0,void 0,this),G.apteva.updateAvailable&&F.jsxDEV("div",{className:"text-sm text-[#f97316]",children:["→ v",G.apteva.latest]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),G.apteva.updateAvailable?F.jsxDEV("div",{className:"bg-[#f97316]/10 border border-[#f97316]/30 rounded-lg p-4",children:[F.jsxDEV("p",{className:"text-sm text-[#888] mb-3",children:"Update by running:"},void 0,!1,void 0,this),F.jsxDEV("div",{className:"flex items-center gap-2",children:[F.jsxDEV("code",{className:"flex-1 bg-[#0a0a0a] px-3 py-2 rounded font-mono text-sm text-[#888]",children:"npx apteva@latest"},void 0,!1,void 0,this),F.jsxDEV("button",{onClick:()=>V("npx apteva@latest","apteva"),className:"px-3 py-2 bg-[#1a1a1a] hover:bg-[#222] rounded text-sm",children:P==="apteva"?"Copied!":"Copy"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):F.jsxDEV("div",{className:"flex items-center gap-2 text-green-400 text-sm",children:[F.jsxDEV(a7,{className:"w-4 h-4"},void 0,!1,void 0,this),"Up to date"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg p-5",children:[F.jsxDEV("div",{className:"flex items-center justify-between mb-4",children:[F.jsxDEV("div",{children:[F.jsxDEV("h3",{className:"font-medium text-lg",children:"Agent Binary"},void 0,!1,void 0,this),F.jsxDEV("p",{className:"text-sm text-[#666]",children:"The Go binary that runs agents"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("div",{className:"text-right",children:[F.jsxDEV("div",{className:"text-xl font-mono",children:["v",G.agent.installed||"?"]},void 0,!0,void 0,this),G.agent.updateAvailable&&F.jsxDEV("div",{className:"text-sm text-[#f97316]",children:["→ v",G.agent.latest]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),G.agent.updateAvailable?F.jsxDEV("div",{className:"bg-[#f97316]/10 border border-[#f97316]/30 rounded-lg p-4",children:[F.jsxDEV("p",{className:"text-sm text-[#888] mb-3",children:"A new version is available. Stop all agents before updating."},void 0,!1,void 0,this),F.jsxDEV("div",{className:"flex items-center gap-2",children:F.jsxDEV("button",{onClick:f,disabled:R,className:"px-4 py-2 bg-[#f97316] text-black rounded font-medium text-sm disabled:opacity-50",children:R?"Updating...":"Update Agent"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):F.jsxDEV("div",{className:"flex items-center gap-2 text-green-400 text-sm",children:[F.jsxDEV(a7,{className:"w-4 h-4"},void 0,!1,void 0,this),"Up to date"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),!x&&!I&&F.jsxDEV("div",{className:"bg-green-500/10 border border-green-500/30 rounded-lg p-4 flex items-center gap-2 text-green-400",children:[F.jsxDEV(a7,{className:"w-5 h-5"},void 0,!1,void 0,this),"Everything is up to date!"]},void 0,!0,void 0,this),F.jsxDEV("button",{onClick:S,disabled:_,className:"text-sm text-[#666] hover:text-[#888] disabled:opacity-50",children:_?"Checking...":"Check for updates"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)}function yI({provider:Y,isEditing:G,apiKey:U,saving:_,testing:q,error:R,success:K,onStartEdit:O,onCancelEdit:T,onApiKeyChange:I,onSave:b,onDelete:P}){let N=Y.id==="ollama",[S,f]=_1.default.useState(null);return _1.default.useEffect(()=>{if(N&&Y.hasKey)fetch("/api/providers/ollama/status").then((V)=>V.json()).then((V)=>f({connected:V.connected,modelCount:V.modelCount})).catch(()=>f({connected:!1}))},[N,Y.hasKey]),F.jsxDEV("div",{className:`bg-[#111] border rounded-lg p-4 ${Y.hasKey?"border-green-500/20":"border-[#1a1a1a]"}`,children:[F.jsxDEV("div",{className:"flex items-start justify-between gap-2 mb-2",children:[F.jsxDEV("div",{className:"min-w-0",children:[F.jsxDEV("h3",{className:"font-medium",children:Y.name},void 0,!1,void 0,this),F.jsxDEV("p",{className:"text-sm text-[#666] truncate",children:Y.type==="integration"?Y.description||"MCP integration":N?"Run models locally":`${Y.models.length} models`},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y.hasKey?F.jsxDEV("span",{className:`text-xs flex items-center gap-1 px-2 py-1 rounded whitespace-nowrap flex-shrink-0 ${N&&S?S.connected?"text-green-400 bg-green-500/10":"text-yellow-400 bg-yellow-500/10":"text-green-400 bg-green-500/10"}`,children:N&&S?S.connected?F.jsxDEV(F.Fragment,{children:[F.jsxDEV(a7,{className:"w-3 h-3"},void 0,!1,void 0,this),S.modelCount," models"]},void 0,!0,void 0,this):F.jsxDEV(F.Fragment,{children:"Not running"},void 0,!1,void 0,this):F.jsxDEV(F.Fragment,{children:[F.jsxDEV(a7,{className:"w-3 h-3"},void 0,!1,void 0,this),Y.keyHint]},void 0,!0,void 0,this)},void 0,!1,void 0,this):F.jsxDEV("span",{className:"text-[#666] text-xs bg-[#1a1a1a] px-2 py-1 rounded whitespace-nowrap flex-shrink-0",children:"Not configured"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("div",{className:"mt-3 pt-3 border-t border-[#1a1a1a]",children:G?F.jsxDEV("div",{className:"space-y-3",children:[F.jsxDEV("input",{type:N?"text":"password",value:U,onChange:(V)=>I(V.target.value),placeholder:N?"http://localhost:11434":Y.hasKey?"Enter new API key...":"Enter API key...",autoFocus:!0,className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-3 py-2 focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this),N&&F.jsxDEV("p",{className:"text-xs text-[#666]",children:"Enter your Ollama server URL. Default is http://localhost:11434"},void 0,!1,void 0,this),R&&F.jsxDEV("p",{className:"text-red-400 text-sm",children:R},void 0,!1,void 0,this),K&&F.jsxDEV("p",{className:"text-green-400 text-sm",children:K},void 0,!1,void 0,this),F.jsxDEV("div",{className:"flex gap-2",children:[F.jsxDEV("button",{onClick:T,className:"flex-1 px-3 py-1.5 border border-[#333] rounded text-sm hover:border-[#666]",children:"Cancel"},void 0,!1,void 0,this),F.jsxDEV("button",{onClick:b,disabled:!U||_,className:"flex-1 px-3 py-1.5 bg-[#f97316] text-black rounded text-sm font-medium disabled:opacity-50",children:q?"Validating...":_?"Saving...":N?"Connect":"Save"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):Y.hasKey?F.jsxDEV("div",{className:"flex items-center justify-between",children:[F.jsxDEV("a",{href:Y.docsUrl,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-[#3b82f6] hover:underline",children:N?"Download Ollama":"View docs"},void 0,!1,void 0,this),F.jsxDEV("div",{className:"flex items-center gap-3",children:[F.jsxDEV("button",{onClick:O,className:"text-sm text-[#888] hover:text-[#e0e0e0]",children:N?"Change URL":"Update key"},void 0,!1,void 0,this),F.jsxDEV("button",{onClick:P,className:"text-red-400 hover:text-red-300 text-sm",children:"Remove"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):F.jsxDEV("div",{className:"flex items-center justify-between",children:[F.jsxDEV("a",{href:Y.docsUrl,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-[#3b82f6] hover:underline",children:N?"Download Ollama":"Get API key"},void 0,!1,void 0,this),F.jsxDEV("button",{onClick:O,className:"text-sm text-[#f97316] hover:text-[#fb923c]",children:N?"Configure":"+ Add key"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function VI({provider:Y,isEditing:G,apiKey:U,saving:_,testing:q,error:R,success:K,onStartEdit:O,onCancelEdit:T,onApiKeyChange:I,onSave:b,onDelete:P,projectsEnabled:N,projects:S,onRefresh:f}){let{authFetch:V}=b1(),[x,v]=_1.useState([]),[p,A]=_1.useState(""),[E,j]=_1.useState(!1),[u,r]=_1.useState(null),[i,d]=_1.useState(!1),{confirm:D,ConfirmDialog:Q0}=o7(),n=async()=>{try{let U0=await(await V(`/api/keys/${Y.id}`)).json();v(U0.keys||[])}catch(Y0){console.error("Failed to fetch keys:",Y0)}};_1.useEffect(()=>{if(N)n()},[Y.id,N]),_1.useEffect(()=>{if(G)r(null)},[G]);let G0=async()=>{if(!U)return;d(!0),r(null);try{let Y0=await V(`/api/keys/${Y.id}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:U,project_id:p||null})}),U0=await Y0.json();if(Y0.ok)I(""),A(""),T(),n(),f();else r(U0.error||"Failed to save key")}catch(Y0){console.error("Failed to save key:",Y0),r("Failed to save key")}d(!1)},F0=async(Y0,U0)=>{if(!await D(`Are you sure you want to remove this API key${U0?` (${U0})`:""}?`,{confirmText:"Remove",title:"Remove API Key"}))return;try{await V(`/api/keys/by-id/${Y0}`,{method:"DELETE"}),n(),f()}catch(y0){console.error("Failed to delete key:",y0)}},K0=x.find((Y0)=>!Y0.project_id),S0=x.filter((Y0)=>Y0.project_id),P0=(Y0)=>S.find((U0)=>U0.id===Y0)?.name||"Unknown",a=(Y0)=>S.find((U0)=>U0.id===Y0)?.color||"#666";if(!N)return F.jsxDEV("div",{className:`bg-[#111] border rounded-lg p-4 ${Y.hasKey?"border-[#f97316]/20":"border-[#1a1a1a]"}`,children:[F.jsxDEV("div",{className:"flex items-center justify-between mb-2",children:[F.jsxDEV("div",{children:[F.jsxDEV("h3",{className:"font-medium",children:Y.name},void 0,!1,void 0,this),F.jsxDEV("p",{className:"text-sm text-[#666]",children:Y.description||"MCP integration"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y.hasKey?F.jsxDEV("span",{className:"text-[#f97316] text-xs flex items-center gap-1 bg-[#f97316]/10 px-2 py-1 rounded",children:[F.jsxDEV(a7,{className:"w-3 h-3"},void 0,!1,void 0,this),Y.keyHint]},void 0,!0,void 0,this):F.jsxDEV("span",{className:"text-[#666] text-xs bg-[#1a1a1a] px-2 py-1 rounded",children:"Not configured"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("div",{className:"mt-3 pt-3 border-t border-[#1a1a1a]",children:G?F.jsxDEV("div",{className:"space-y-3",children:[F.jsxDEV("input",{type:"password",value:U,onChange:(Y0)=>I(Y0.target.value),placeholder:Y.hasKey?"Enter new API key...":"Enter API key...",autoFocus:!0,className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-3 py-2 focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this),R&&F.jsxDEV("p",{className:"text-red-400 text-sm",children:R},void 0,!1,void 0,this),K&&F.jsxDEV("p",{className:"text-green-400 text-sm",children:K},void 0,!1,void 0,this),F.jsxDEV("div",{className:"flex gap-2",children:[F.jsxDEV("button",{onClick:T,className:"flex-1 px-3 py-1.5 border border-[#333] rounded text-sm hover:border-[#666]",children:"Cancel"},void 0,!1,void 0,this),F.jsxDEV("button",{onClick:b,disabled:!U||_,className:"flex-1 px-3 py-1.5 bg-[#f97316] text-black rounded text-sm font-medium disabled:opacity-50",children:q?"Validating...":_?"Saving...":"Save"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):Y.hasKey?F.jsxDEV("div",{className:"flex items-center justify-between",children:[F.jsxDEV("a",{href:Y.docsUrl,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-[#3b82f6] hover:underline",children:"View docs"},void 0,!1,void 0,this),F.jsxDEV("div",{className:"flex items-center gap-3",children:[F.jsxDEV("button",{onClick:O,className:"text-sm text-[#888] hover:text-[#e0e0e0]",children:"Update key"},void 0,!1,void 0,this),F.jsxDEV("button",{onClick:P,className:"text-red-400 hover:text-red-300 text-sm",children:"Remove"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):F.jsxDEV("div",{className:"flex items-center justify-between",children:[F.jsxDEV("a",{href:Y.docsUrl,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-[#3b82f6] hover:underline",children:"Get API key"},void 0,!1,void 0,this),F.jsxDEV("button",{onClick:O,className:"text-sm text-[#f97316] hover:text-[#fb923c]",children:"+ Add key"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this);return F.jsxDEV(F.Fragment,{children:[Q0,F.jsxDEV("div",{className:`bg-[#111] border rounded-lg p-4 ${x.length>0?"border-[#f97316]/20":"border-[#1a1a1a]"}`,children:[F.jsxDEV("div",{className:"flex items-center justify-between mb-2",children:[F.jsxDEV("div",{children:[F.jsxDEV("h3",{className:"font-medium",children:Y.name},void 0,!1,void 0,this),F.jsxDEV("p",{className:"text-sm text-[#666]",children:Y.description||"MCP integration"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),x.length>0?F.jsxDEV("span",{className:"text-[#f97316] text-xs flex items-center gap-1 bg-[#f97316]/10 px-2 py-1 rounded",children:[F.jsxDEV(a7,{className:"w-3 h-3"},void 0,!1,void 0,this),x.length," key",x.length!==1?"s":""]},void 0,!0,void 0,this):F.jsxDEV("span",{className:"text-[#666] text-xs bg-[#1a1a1a] px-2 py-1 rounded",children:"Not configured"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),x.length>0&&F.jsxDEV("div",{className:"mt-3 space-y-2",children:[K0&&F.jsxDEV("div",{className:"flex items-center justify-between text-sm bg-[#0a0a0a] rounded px-3 py-2",children:[F.jsxDEV("div",{className:"flex items-center gap-2",children:[F.jsxDEV("span",{className:"text-[#888]",children:"Global"},void 0,!1,void 0,this),F.jsxDEV("span",{className:"text-[#555]",children:"·"},void 0,!1,void 0,this),F.jsxDEV("span",{className:"text-[#666] font-mono text-xs",children:K0.key_hint},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("button",{onClick:()=>F0(K0.id,"Global"),className:"text-red-400 hover:text-red-300 text-xs",children:"Remove"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),S0.slice(0,E?void 0:2).map((Y0)=>F.jsxDEV("div",{className:"flex items-center justify-between text-sm bg-[#0a0a0a] rounded px-3 py-2",children:[F.jsxDEV("div",{className:"flex items-center gap-2 min-w-0",children:[F.jsxDEV("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{backgroundColor:a(Y0.project_id)}},void 0,!1,void 0,this),F.jsxDEV("span",{className:"text-[#888] truncate",children:Y0.name||P0(Y0.project_id)},void 0,!1,void 0,this),F.jsxDEV("span",{className:"text-[#555]",children:"·"},void 0,!1,void 0,this),F.jsxDEV("span",{className:"text-[#666] font-mono text-xs",children:Y0.key_hint},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("button",{onClick:()=>F0(Y0.id,Y0.name||P0(Y0.project_id)),className:"text-red-400 hover:text-red-300 text-xs flex-shrink-0 ml-2",children:"Remove"},void 0,!1,void 0,this)]},Y0.id,!0,void 0,this)),S0.length>2&&!E&&F.jsxDEV("button",{onClick:()=>j(!0),className:"text-xs text-[#666] hover:text-[#888] w-full text-center py-1",children:["Show ",S0.length-2," more..."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("div",{className:"mt-3 pt-3 border-t border-[#1a1a1a]",children:G?F.jsxDEV("div",{className:"space-y-3",children:[F.jsxDEV("input",{type:"password",value:U,onChange:(Y0)=>I(Y0.target.value),placeholder:"Enter API key...",autoFocus:!0,className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-3 py-2 focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this),F.jsxDEV(r4,{value:p,onChange:A,placeholder:"Global (all projects)",options:[{value:"",label:"Global (all projects)"},...S.map((Y0)=>({value:Y0.id,label:Y0.name}))]},void 0,!1,void 0,this),u&&F.jsxDEV("p",{className:"text-red-400 text-sm",children:u},void 0,!1,void 0,this),F.jsxDEV("div",{className:"flex gap-2",children:[F.jsxDEV("button",{onClick:()=>{T(),A(""),r(null)},className:"flex-1 px-3 py-1.5 border border-[#333] rounded text-sm hover:border-[#666]",children:"Cancel"},void 0,!1,void 0,this),F.jsxDEV("button",{onClick:G0,disabled:!U||i,className:"flex-1 px-3 py-1.5 bg-[#f97316] text-black rounded text-sm font-medium disabled:opacity-50",children:i?"Saving...":"Save"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):F.jsxDEV("div",{className:"flex items-center justify-between",children:[F.jsxDEV("a",{href:Y.docsUrl,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-[#3b82f6] hover:underline",children:x.length>0?"View docs":"Get API key"},void 0,!1,void 0,this),F.jsxDEV("button",{onClick:O,className:"text-sm text-[#f97316] hover:text-[#fb923c]",children:"+ Add key"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function DI(){let{authFetch:Y}=b1(),[G,U]=_1.useState([]),[_,q]=_1.useState(!1),[R,K]=_1.useState(""),[O,T]=_1.useState("90"),[I,b]=_1.useState(!1),[P,N]=_1.useState(null),[S,f]=_1.useState(null),[V,x]=_1.useState(!1),{confirm:v,ConfirmDialog:p}=o7(),A=async()=>{try{let D=await(await Y("/api/keys/personal")).json();U(D.keys||[])}catch{}};_1.useEffect(()=>{A()},[]);let E=async()=>{if(!R.trim()){N("Name is required");return}b(!0),N(null);try{let d=await Y("/api/keys/personal",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:R.trim(),expires_in_days:O?parseInt(O):null})}),D=await d.json();if(!d.ok)N(D.error||"Failed to create key");else f(D.key),K(""),T("90"),A()}catch{N("Failed to create key")}b(!1)},j=async(d,D)=>{if(!await v(`Delete API key "${D}"? This cannot be undone.`,{confirmText:"Delete",title:"Delete API Key"}))return;try{await Y(`/api/keys/personal/${d}`,{method:"DELETE"}),A()}catch{}},u=()=>{if(S)navigator.clipboard.writeText(S),x(!0),setTimeout(()=>x(!1),2000)},r=(d)=>{if(!d)return"Never";return new Date(d).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})},i=(d)=>{if(!d)return!1;return new Date(d)<new Date};return F.jsxDEV(F.Fragment,{children:[p,F.jsxDEV("div",{className:"max-w-4xl w-full",children:[F.jsxDEV("div",{className:"mb-6 flex items-center justify-between gap-4",children:[F.jsxDEV("div",{children:[F.jsxDEV("h1",{className:"text-2xl font-semibold mb-1",children:"API Keys"},void 0,!1,void 0,this),F.jsxDEV("p",{className:"text-[#666]",children:["Create personal API keys for programmatic access. Use them with the ",F.jsxDEV("code",{className:"text-[#888] bg-[#1a1a1a] px-1 rounded text-xs",children:"X-API-Key"},void 0,!1,void 0,this)," header."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),!_&&!S&&F.jsxDEV("button",{onClick:()=>{q(!0),N(null)},className:"flex items-center gap-2 bg-[#f97316] hover:bg-[#fb923c] text-black px-4 py-2 rounded font-medium transition flex-shrink-0",children:[F.jsxDEV(iH,{className:"w-4 h-4"},void 0,!1,void 0,this),"New Key"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),S&&F.jsxDEV("div",{className:"bg-green-500/10 border border-green-500/30 rounded-lg p-4 mb-6",children:[F.jsxDEV("div",{className:"flex items-center gap-2 text-green-400 mb-2",children:[F.jsxDEV(a7,{className:"w-5 h-5"},void 0,!1,void 0,this),F.jsxDEV("span",{className:"font-medium",children:"API key created"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("p",{className:"text-sm text-[#888] mb-3",children:"Copy this key now. You won't be able to see it again."},void 0,!1,void 0,this),F.jsxDEV("div",{className:"flex items-center gap-2",children:[F.jsxDEV("code",{className:"flex-1 bg-[#0a0a0a] px-3 py-2 rounded font-mono text-sm text-[#e0e0e0] break-all select-all",children:S},void 0,!1,void 0,this),F.jsxDEV("button",{onClick:u,className:"px-3 py-2 bg-[#1a1a1a] hover:bg-[#222] rounded text-sm flex-shrink-0",children:V?"Copied!":"Copy"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("button",{onClick:()=>{f(null),q(!1)},className:"mt-3 text-sm text-[#666] hover:text-[#888]",children:"Done"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),_&&!S&&F.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg p-4 mb-6",children:[F.jsxDEV("h3",{className:"font-medium mb-4",children:"Create new API key"},void 0,!1,void 0,this),F.jsxDEV("div",{className:"space-y-4 max-w-md",children:[F.jsxDEV("div",{children:[F.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"Name"},void 0,!1,void 0,this),F.jsxDEV("input",{type:"text",value:R,onChange:(d)=>K(d.target.value),placeholder:"e.g. CI Pipeline, My Script",autoFocus:!0,className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-3 py-2 focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("div",{children:[F.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"Expiration"},void 0,!1,void 0,this),F.jsxDEV("select",{value:O,onChange:(d)=>T(d.target.value),className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-3 py-2 focus:outline-none focus:border-[#f97316]",children:[F.jsxDEV("option",{value:"30",children:"30 days"},void 0,!1,void 0,this),F.jsxDEV("option",{value:"90",children:"90 days"},void 0,!1,void 0,this),F.jsxDEV("option",{value:"180",children:"180 days"},void 0,!1,void 0,this),F.jsxDEV("option",{value:"365",children:"1 year"},void 0,!1,void 0,this),F.jsxDEV("option",{value:"",children:"No expiration"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),P&&F.jsxDEV("p",{className:"text-red-400 text-sm",children:P},void 0,!1,void 0,this),F.jsxDEV("div",{className:"flex gap-2",children:[F.jsxDEV("button",{onClick:()=>{q(!1),N(null),K("")},className:"flex-1 px-3 py-2 border border-[#333] rounded text-sm hover:border-[#666]",children:"Cancel"},void 0,!1,void 0,this),F.jsxDEV("button",{onClick:E,disabled:I||!R.trim(),className:"flex-1 px-3 py-2 bg-[#f97316] text-black rounded text-sm font-medium disabled:opacity-50",children:I?"Creating...":"Create Key"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),G.length===0?F.jsxDEV("div",{className:"text-center py-12 text-[#666]",children:[F.jsxDEV("p",{className:"text-lg mb-2",children:"No API keys yet"},void 0,!1,void 0,this),F.jsxDEV("p",{className:"text-sm",children:"Create an API key to access apteva programmatically."},void 0,!1,void 0,this)]},void 0,!0,void 0,this):F.jsxDEV("div",{className:"space-y-3",children:G.map((d)=>F.jsxDEV("div",{className:`bg-[#111] border rounded-lg p-4 flex items-center gap-4 ${!d.is_active||i(d.expires_at)?"border-[#1a1a1a] opacity-60":"border-[#1a1a1a]"}`,children:[F.jsxDEV("div",{className:"flex-1 min-w-0",children:[F.jsxDEV("div",{className:"flex items-center gap-2 mb-1",children:[F.jsxDEV("h3",{className:"font-medium",children:d.name},void 0,!1,void 0,this),!d.is_active&&F.jsxDEV("span",{className:"text-xs text-red-400 bg-red-500/10 px-2 py-0.5 rounded",children:"Revoked"},void 0,!1,void 0,this),d.is_active&&i(d.expires_at)&&F.jsxDEV("span",{className:"text-xs text-yellow-400 bg-yellow-500/10 px-2 py-0.5 rounded",children:"Expired"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("div",{className:"flex items-center gap-3 text-sm text-[#666]",children:[F.jsxDEV("code",{className:"font-mono text-xs bg-[#0a0a0a] px-2 py-0.5 rounded",children:[d.prefix,"..."]},void 0,!0,void 0,this),F.jsxDEV("span",{children:["Created ",r(d.created_at)]},void 0,!0,void 0,this),d.expires_at&&F.jsxDEV("span",{children:["Expires ",r(d.expires_at)]},void 0,!0,void 0,this),d.last_used_at&&F.jsxDEV("span",{children:["Last used ",r(d.last_used_at)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),d.is_active&&F.jsxDEV("button",{onClick:()=>j(d.id,d.name),className:"text-sm text-red-400 hover:text-red-300 px-2 py-1 flex-shrink-0",children:"Delete"},void 0,!1,void 0,this)]},d.id,!0,void 0,this))},void 0,!1,void 0,this),G.length>0&&F.jsxDEV("div",{className:"mt-6 bg-[#111] border border-[#1a1a1a] rounded-lg p-4",children:[F.jsxDEV("h3",{className:"font-medium mb-2 text-sm",children:"Usage"},void 0,!1,void 0,this),F.jsxDEV("code",{className:"block bg-[#0a0a0a] px-3 py-2 rounded font-mono text-xs text-[#888]",children:'curl -H "X-API-Key: apt_..." http://localhost:4280/api/agents'},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function mI(){let{authFetch:Y,user:G}=b1(),[U,_]=_1.useState(""),[q,R]=_1.useState(""),[K,O]=_1.useState(""),[T,I]=_1.useState(!1),[b,P]=_1.useState(null),N=async()=>{if(!U||!q||!K){P({type:"error",text:"All fields are required"});return}if(q!==K){P({type:"error",text:"New passwords do not match"});return}if(q.length<8){P({type:"error",text:"Password must be at least 8 characters"});return}I(!0),P(null);try{let S=await Y("/api/auth/password",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({currentPassword:U,newPassword:q})}),f=await S.json();if(S.ok)P({type:"success",text:"Password updated successfully"}),_(""),R(""),O("");else P({type:"error",text:f.error||"Failed to update password"})}catch{P({type:"error",text:"Failed to update password"})}I(!1)};return F.jsxDEV("div",{className:"max-w-4xl w-full",children:[F.jsxDEV("div",{className:"mb-6",children:[F.jsxDEV("h1",{className:"text-2xl font-semibold mb-1",children:"Account Settings"},void 0,!1,void 0,this),F.jsxDEV("p",{className:"text-[#666]",children:"Manage your account and security."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),G&&F.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg p-4 mb-6",children:[F.jsxDEV("h3",{className:"font-medium mb-3",children:"Profile"},void 0,!1,void 0,this),F.jsxDEV("div",{className:"space-y-2 text-sm",children:[F.jsxDEV("div",{className:"flex justify-between",children:[F.jsxDEV("span",{className:"text-[#666]",children:"Username"},void 0,!1,void 0,this),F.jsxDEV("span",{children:G.username},void 0,!1,void 0,this)]},void 0,!0,void 0,this),G.email&&F.jsxDEV("div",{className:"flex justify-between",children:[F.jsxDEV("span",{className:"text-[#666]",children:"Email"},void 0,!1,void 0,this),F.jsxDEV("span",{children:G.email},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("div",{className:"flex justify-between",children:[F.jsxDEV("span",{className:"text-[#666]",children:"Role"},void 0,!1,void 0,this),F.jsxDEV("span",{className:"capitalize",children:G.role},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg p-4",children:[F.jsxDEV("h3",{className:"font-medium mb-4",children:"Change Password"},void 0,!1,void 0,this),F.jsxDEV("div",{className:"space-y-4 max-w-md",children:[F.jsxDEV("div",{children:[F.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"Current Password"},void 0,!1,void 0,this),F.jsxDEV("input",{type:"password",value:U,onChange:(S)=>_(S.target.value),className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-3 py-2 focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("div",{children:[F.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"New Password"},void 0,!1,void 0,this),F.jsxDEV("input",{type:"password",value:q,onChange:(S)=>R(S.target.value),className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-3 py-2 focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("div",{children:[F.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"Confirm New Password"},void 0,!1,void 0,this),F.jsxDEV("input",{type:"password",value:K,onChange:(S)=>O(S.target.value),className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-3 py-2 focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),b&&F.jsxDEV("div",{className:`p-3 rounded text-sm ${b.type==="success"?"bg-green-500/10 text-green-400 border border-green-500/30":"bg-red-500/10 text-red-400 border border-red-500/30"}`,children:b.text},void 0,!1,void 0,this),F.jsxDEV("button",{onClick:N,disabled:T||!U||!q||!K,className:"px-4 py-2 bg-[#f97316] hover:bg-[#fb923c] disabled:opacity-50 disabled:cursor-not-allowed text-black rounded text-sm font-medium transition",children:T?"Updating...":"Update Password"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function gI(){let{authFetch:Y}=b1(),[G,U]=_1.useState(!1),[_,q]=_1.useState(null),[R,K]=_1.useState(null),{confirm:O,ConfirmDialog:T}=o7(),I=async()=>{try{let N=await(await Y("/api/telemetry/stats")).json();K(N.stats?.total_events||0)}catch{K(null)}};_1.useEffect(()=>{I()},[]);let b=async()=>{if(!await O("Are you sure you want to delete all telemetry data? This cannot be undone.",{confirmText:"Clear All",title:"Clear Telemetry Data"}))return;U(!0),q(null);try{let N=await Y("/api/telemetry/clear",{method:"POST"}),S=await N.json();if(N.ok)q({type:"success",text:`Cleared ${S.deleted||0} telemetry events.`}),K(0);else q({type:"error",text:S.error||"Failed to clear telemetry"})}catch{q({type:"error",text:"Failed to clear telemetry"})}U(!1)};return F.jsxDEV(F.Fragment,{children:[T,F.jsxDEV("div",{className:"max-w-4xl w-full",children:[F.jsxDEV("div",{className:"mb-6",children:[F.jsxDEV("h1",{className:"text-2xl font-semibold mb-1",children:"Data Management"},void 0,!1,void 0,this),F.jsxDEV("p",{className:"text-[#666]",children:"Manage stored data and telemetry."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg p-4",children:[F.jsxDEV("h3",{className:"font-medium mb-2",children:"Telemetry Data"},void 0,!1,void 0,this),F.jsxDEV("p",{className:"text-sm text-[#666] mb-4",children:R!==null?`${R.toLocaleString()} events stored`:"Loading..."},void 0,!1,void 0,this),_&&F.jsxDEV("div",{className:`mb-4 p-3 rounded text-sm ${_.type==="success"?"bg-green-500/10 text-green-400 border border-green-500/30":"bg-red-500/10 text-red-400 border border-red-500/30"}`,children:_.text},void 0,!1,void 0,this),F.jsxDEV("button",{onClick:b,disabled:G||R===0,className:"px-4 py-2 bg-red-500/20 text-red-400 hover:bg-red-500/30 disabled:opacity-50 disabled:cursor-not-allowed rounded text-sm font-medium transition",children:G?"Clearing...":"Clear All Telemetry"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var c4=B0(U1(),1),EI=[{key:"memory",icon:Az,label:"Memory"},{key:"tasks",icon:u5,label:"Tasks"},{key:"files",icon:hQ,label:"Files"},{key:"vision",icon:Iz,label:"Vision"},{key:"operator",icon:Tz,label:"Operator"},{key:"mcp",icon:x5,label:"MCP"},{key:"realtime",icon:kz,label:"Realtime"},{key:"agents",icon:yQ,label:"Multi-Agent"}];function F2({agent:Y,selected:G,onSelect:U,onToggle:_,showProject:q}){let R=EI.filter((N)=>Y.features?.[N.key]),K=Y.mcpServerDetails||[],O=Y.skillDetails||[],{isActive:T,type:I}=yZ(Y.id),{projects:b}=R4(),P=Y.projectId?b.find((N)=>N.id===Y.projectId):null;return c4.jsxDEV("div",{onClick:U,className:`bg-[#111] rounded p-5 border transition cursor-pointer flex flex-col h-full ${G?"border-[#f97316]":"border-[#1a1a1a] hover:border-[#333]"}`,children:[c4.jsxDEV("div",{className:"flex items-start justify-between mb-3",children:[c4.jsxDEV("div",{children:[c4.jsxDEV("h3",{className:"font-semibold text-lg",children:Y.name},void 0,!1,void 0,this),c4.jsxDEV("p",{className:"text-sm text-[#666]",children:[Y.provider," / ",Y.model,Y.port&&c4.jsxDEV("span",{className:"text-[#444]",children:[" · :",Y.port]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),q&&P&&c4.jsxDEV("p",{className:"text-sm text-[#666] flex items-center gap-1.5 mt-1",children:[c4.jsxDEV("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:P.color}},void 0,!1,void 0,this),P.name]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),c4.jsxDEV(uI,{status:Y.status,isActive:T&&Y.status==="running",activityType:I},void 0,!1,void 0,this)]},void 0,!0,void 0,this),R.length>0&&c4.jsxDEV("div",{className:"flex flex-wrap gap-1.5 mb-3",children:R.map(({key:N,icon:S,label:f})=>c4.jsxDEV("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded bg-[#f97316]/10 text-[#f97316]/70 text-xs",title:f,children:[c4.jsxDEV(S,{className:"w-3 h-3"},void 0,!1,void 0,this),f]},N,!0,void 0,this))},void 0,!1,void 0,this),K.length>0&&c4.jsxDEV("div",{className:"flex flex-wrap gap-1.5 mb-3",children:K.map((N)=>{let S=N.type==="http"&&N.url||N.status==="running";return c4.jsxDEV("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs ${S?"bg-green-500/10 text-green-400":"bg-[#222] text-[#666]"}`,title:`MCP: ${N.name} (${S?"available":N.status})`,children:[c4.jsxDEV(x5,{className:"w-3 h-3"},void 0,!1,void 0,this),N.name]},N.id,!0,void 0,this)})},void 0,!1,void 0,this),O.length>0&&c4.jsxDEV("div",{className:"flex flex-wrap gap-1.5 mb-3",children:O.map((N)=>c4.jsxDEV("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs ${N.enabled?"bg-purple-500/10 text-purple-400":"bg-[#222] text-[#666]"}`,title:`Skill: ${N.name} v${N.version}`,children:[c4.jsxDEV(mZ,{className:"w-3 h-3"},void 0,!1,void 0,this),N.name]},N.id,!0,void 0,this))},void 0,!1,void 0,this),c4.jsxDEV("p",{className:"text-sm text-[#666] line-clamp-2 mb-4 flex-1",children:Y.systemPrompt},void 0,!1,void 0,this),c4.jsxDEV("button",{onClick:_,className:`w-full px-3 py-1.5 rounded text-sm font-medium transition mt-auto ${Y.status==="running"?"bg-[#f97316]/20 text-[#f97316] hover:bg-[#f97316]/30":"bg-[#3b82f6]/20 text-[#3b82f6] hover:bg-[#3b82f6]/30"}`,children:Y.status==="running"?"Stop":"Start"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function uI({status:Y,isActive:G,activityType:U}){if(Y==="running"&&G&&U)return c4.jsxDEV("span",{className:"px-2 py-1 rounded text-xs font-medium bg-green-500/20 text-green-400 animate-pulse",children:U},void 0,!1,void 0,this);return c4.jsxDEV("span",{className:`px-2 py-1 rounded text-xs font-medium ${Y==="running"?"bg-[#3b82f6]/20 text-[#3b82f6]":"bg-[#333] text-[#666]"}`,children:Y},void 0,!1,void 0,this)}var cZ=B0(V1(),1);var B1=B0(U1(),1),xI=[{key:"memory",label:"Memory",description:"Persistent recall",icon:Az},{key:"tasks",label:"Tasks",description:"Schedule and execute tasks",icon:u5},{key:"files",label:"Files",description:"File storage and management",icon:hQ},{key:"vision",label:"Vision",description:"Process images and PDFs",icon:Iz},{key:"operator",label:"Operator",description:"Browser automation",icon:Tz},{key:"mcp",label:"MCP",description:"External tools/services",icon:x5},{key:"realtime",label:"Realtime",description:"Voice conversations",icon:kz},{key:"agents",label:"Multi-Agent",description:"Communicate with peer agents",icon:yQ}];function b2({form:Y,providers:G,configuredProviders:U,onFormChange:_,onProviderChange:q,onCreate:R,onClose:K,onGoToSettings:O}){let{projects:T,currentProjectId:I}=R4(),b=G.find((u)=>u.id===Y.provider),[P,N]=cZ.default.useState([]),[S,f]=cZ.default.useState(!1);cZ.default.useEffect(()=>{if(Y.provider==="ollama")f(!0),fetch("/api/providers/ollama/models").then((u)=>u.json()).then((u)=>{if(u.models&&u.models.length>0){if(N(u.models.map((r)=>({value:r.value,label:r.label||r.value}))),!Y.model&&u.models.length>0)_({...Y,model:u.models[0].value})}}).catch(()=>N([])).finally(()=>f(!1))},[Y.provider]);let V=U.filter((u)=>u.type==="llm").map((u)=>({value:u.id,label:u.name})),x=Y.provider==="ollama"&&P.length>0?P:b?.models.map((u)=>({value:u.value,label:u.label,recommended:u.recommended}))||[],v=T.map((u)=>({value:u.id,label:u.name}));cZ.default.useEffect(()=>{if(Y.projectId===void 0&&I&&I!=="unassigned")_({...Y,projectId:I})},[I]);let p=(u)=>{if(u==="agents")if(typeof Y.features.agents==="boolean"?Y.features.agents:Y.features.agents?.enabled??!1)_({...Y,features:{...Y.features,agents:!1}});else _({...Y,features:{...Y.features,agents:{enabled:!0,mode:"worker",group:Y.projectId||void 0}}});else _({...Y,features:{...Y.features,[u]:!Y.features[u]}})},A=()=>{let u=Y.features.agents;if(typeof u==="boolean")return u;return u?.enabled??!1},E=()=>{return Mz(Y.features,Y.projectId).mode||"worker"},j=(u)=>{let r=Mz(Y.features,Y.projectId);_({...Y,features:{...Y.features,agents:{...r,enabled:!0,mode:u}}})};return B1.jsxDEV(vQ,{children:[B1.jsxDEV("h2",{className:"text-xl font-semibold mb-4",children:"Create New Agent"},void 0,!1,void 0,this),V.length===0?B1.jsxDEV(jI,{onGoToSettings:O},void 0,!1,void 0,this):B1.jsxDEV(B1.Fragment,{children:[B1.jsxDEV("div",{className:"space-y-4",children:[B1.jsxDEV(m8,{label:"Name",children:B1.jsxDEV("input",{type:"text",value:Y.name,onChange:(u)=>_({...Y,name:u.target.value}),className:"w-full bg-[#0a0a0a] border border-[#222] rounded px-3 py-2 focus:outline-none focus:border-[#f97316] text-[#e0e0e0]",placeholder:"My Agent"},void 0,!1,void 0,this)},void 0,!1,void 0,this),T.length>0&&B1.jsxDEV(m8,{label:"Project",children:B1.jsxDEV(r4,{value:Y.projectId||"",options:v,onChange:(u)=>_({...Y,projectId:u||null}),placeholder:"Select project..."},void 0,!1,void 0,this)},void 0,!1,void 0,this),B1.jsxDEV(m8,{label:"Provider",children:B1.jsxDEV(r4,{value:Y.provider,options:V,onChange:q,placeholder:"Select provider..."},void 0,!1,void 0,this)},void 0,!1,void 0,this),B1.jsxDEV(m8,{label:"Model",children:S?B1.jsxDEV("div",{className:"text-sm text-[#666] py-2",children:"Loading Ollama models..."},void 0,!1,void 0,this):Y.provider==="ollama"&&x.length===0?B1.jsxDEV("div",{className:"text-sm text-yellow-400/80 py-2",children:["No models found. Run ",B1.jsxDEV("code",{className:"bg-[#1a1a1a] px-1 rounded",children:"ollama pull llama3.3"},void 0,!1,void 0,this)," to download a model."]},void 0,!0,void 0,this):B1.jsxDEV(r4,{value:Y.model,options:x,onChange:(u)=>_({...Y,model:u}),placeholder:"Select model..."},void 0,!1,void 0,this)},void 0,!1,void 0,this),B1.jsxDEV(m8,{label:"System Prompt",children:B1.jsxDEV("textarea",{value:Y.systemPrompt,onChange:(u)=>_({...Y,systemPrompt:u.target.value}),className:"w-full bg-[#0a0a0a] border border-[#222] rounded px-3 py-2 h-24 resize-none focus:outline-none focus:border-[#f97316] text-[#e0e0e0]"},void 0,!1,void 0,this)},void 0,!1,void 0,this),B1.jsxDEV(m8,{label:"Features",children:B1.jsxDEV("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:xI.map(({key:u,label:r,description:i,icon:d})=>{let D=u==="agents"?A():!!Y.features[u];return B1.jsxDEV("button",{type:"button",onClick:()=>p(u),className:`flex items-center gap-3 p-3 rounded border text-left transition ${D?"border-[#f97316] bg-[#f97316]/10":"border-[#222] hover:border-[#333]"}`,children:[B1.jsxDEV(d,{className:`w-5 h-5 flex-shrink-0 ${D?"text-[#f97316]":"text-[#666]"}`},void 0,!1,void 0,this),B1.jsxDEV("div",{className:"flex-1 min-w-0",children:[B1.jsxDEV("div",{className:`text-sm font-medium ${D?"text-[#f97316]":""}`,children:r},void 0,!1,void 0,this),B1.jsxDEV("div",{className:"text-xs text-[#666]",children:i},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},u,!0,void 0,this)})},void 0,!1,void 0,this)},void 0,!1,void 0,this),A()&&B1.jsxDEV(m8,{label:"Multi-Agent Mode",children:[B1.jsxDEV("div",{className:"flex gap-2",children:[B1.jsxDEV("button",{type:"button",onClick:()=>j("coordinator"),className:`flex-1 p-3 rounded border text-left transition ${E()==="coordinator"?"border-[#f97316] bg-[#f97316]/10":"border-[#222] hover:border-[#333]"}`,children:[B1.jsxDEV("div",{className:`text-sm font-medium ${E()==="coordinator"?"text-[#f97316]":""}`,children:"Coordinator"},void 0,!1,void 0,this),B1.jsxDEV("div",{className:"text-xs text-[#666]",children:"Orchestrates and delegates"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),B1.jsxDEV("button",{type:"button",onClick:()=>j("worker"),className:`flex-1 p-3 rounded border text-left transition ${E()==="worker"?"border-[#f97316] bg-[#f97316]/10":"border-[#222] hover:border-[#333]"}`,children:[B1.jsxDEV("div",{className:`text-sm font-medium ${E()==="worker"?"text-[#f97316]":""}`,children:"Worker"},void 0,!1,void 0,this),B1.jsxDEV("div",{className:"text-xs text-[#666]",children:"Receives delegated tasks"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Y.projectId&&B1.jsxDEV("p",{className:"text-xs text-[#555] mt-2",children:"Group: Using project as agent group"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y.provider==="anthropic"&&B1.jsxDEV(m8,{label:"Agent Built-in Tools",children:[B1.jsxDEV("div",{className:"flex flex-wrap gap-2",children:[B1.jsxDEV("button",{type:"button",onClick:()=>_({...Y,features:{...Y.features,builtinTools:{...Y.features.builtinTools,webSearch:!Y.features.builtinTools?.webSearch}}}),className:`flex items-center gap-2 px-3 py-2 rounded border transition ${Y.features.builtinTools?.webSearch?"border-[#f97316] bg-[#f97316]/10 text-[#f97316]":"border-[#222] hover:border-[#333] text-[#888]"}`,children:[B1.jsxDEV("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:B1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"},void 0,!1,void 0,this)},void 0,!1,void 0,this),B1.jsxDEV("span",{className:"text-sm",children:"Web Search"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),B1.jsxDEV("button",{type:"button",onClick:()=>_({...Y,features:{...Y.features,builtinTools:{...Y.features.builtinTools,webFetch:!Y.features.builtinTools?.webFetch}}}),className:`flex items-center gap-2 px-3 py-2 rounded border transition ${Y.features.builtinTools?.webFetch?"border-[#f97316] bg-[#f97316]/10 text-[#f97316]":"border-[#222] hover:border-[#333] text-[#888]"}`,children:[B1.jsxDEV("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:B1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"},void 0,!1,void 0,this)},void 0,!1,void 0,this),B1.jsxDEV("span",{className:"text-sm",children:"Web Fetch"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),B1.jsxDEV("p",{className:"text-xs text-[#555] mt-2",children:"Provider-native tools for real-time web access"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),B1.jsxDEV("div",{className:"flex gap-3 mt-6",children:[B1.jsxDEV("button",{onClick:K,className:"flex-1 border border-[#333] hover:border-[#f97316] hover:text-[#f97316] px-4 py-2 rounded font-medium transition",children:"Cancel"},void 0,!1,void 0,this),B1.jsxDEV("button",{onClick:R,disabled:!Y.name,className:"flex-1 bg-[#f97316] hover:bg-[#fb923c] disabled:opacity-50 text-black px-4 py-2 rounded font-medium transition",children:"Create"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function m8({label:Y,children:G}){return B1.jsxDEV("div",{children:[B1.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:Y},void 0,!1,void 0,this),G]},void 0,!0,void 0,this)}function jI({onGoToSettings:Y}){return B1.jsxDEV("div",{className:"text-center py-6",children:[B1.jsxDEV("p",{className:"text-[#666] mb-4",children:"No API keys configured. Add a provider key first."},void 0,!1,void 0,this),B1.jsxDEV("button",{onClick:Y,className:"bg-[#f97316] hover:bg-[#fb923c] text-black px-4 py-2 rounded font-medium transition",children:"Go to Settings"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var h1=B0(V1(),1);var h=B0(U1(),1),pI=[{key:"memory",label:"Memory",description:"Persistent recall",icon:Az},{key:"tasks",label:"Tasks",description:"Schedule and execute tasks",icon:u5},{key:"files",label:"Files",description:"File storage and management",icon:hQ},{key:"vision",label:"Vision",description:"Process images and PDFs",icon:Iz},{key:"operator",label:"Operator",description:"Browser automation",icon:Tz},{key:"mcp",label:"MCP",description:"External tools/services",icon:x5},{key:"realtime",label:"Realtime",description:"Voice conversations",icon:kz},{key:"agents",label:"Multi-Agent",description:"Communicate with peer agents",icon:yQ}];function P2({agent:Y,providers:G,onClose:U,onStartAgent:_,onUpdateAgent:q,onDeleteAgent:R}){let[K,O]=h1.useState("chat");return h.jsxDEV("div",{className:"w-full h-full flex flex-col overflow-hidden bg-[#0a0a0a] border-l border-[#1a1a1a]",children:[h.jsxDEV("div",{className:"border-b border-[#1a1a1a] flex items-center",children:[h.jsxDEV("div",{className:"flex-1 overflow-x-auto scrollbar-hide px-2 md:px-4",children:h.jsxDEV("div",{className:"flex gap-1",children:[h.jsxDEV(xQ,{active:K==="chat",onClick:()=>O("chat"),children:"Chat"},void 0,!1,void 0,this),h.jsxDEV(xQ,{active:K==="threads",onClick:()=>O("threads"),children:"Threads"},void 0,!1,void 0,this),h.jsxDEV(xQ,{active:K==="tasks",onClick:()=>O("tasks"),children:"Tasks"},void 0,!1,void 0,this),h.jsxDEV(xQ,{active:K==="memory",onClick:()=>O("memory"),children:"Memory"},void 0,!1,void 0,this),h.jsxDEV(xQ,{active:K==="files",onClick:()=>O("files"),children:"Files"},void 0,!1,void 0,this),h.jsxDEV(xQ,{active:K==="settings",onClick:()=>O("settings"),children:"Settings"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),h.jsxDEV("button",{onClick:U,className:"text-[#666] hover:text-[#e0e0e0] transition p-2 flex-shrink-0 mr-2",children:h.jsxDEV(E5,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),h.jsxDEV("div",{className:"flex-1 min-h-0 flex flex-col overflow-hidden",children:[K==="chat"&&h.jsxDEV(dI,{agent:Y,onStartAgent:_},void 0,!1,void 0,this),K==="threads"&&h.jsxDEV(cI,{agent:Y},void 0,!1,void 0,this),K==="tasks"&&h.jsxDEV(lI,{agent:Y},void 0,!1,void 0,this),K==="memory"&&h.jsxDEV(iI,{agent:Y},void 0,!1,void 0,this),K==="files"&&h.jsxDEV(oI,{agent:Y},void 0,!1,void 0,this),K==="settings"&&h.jsxDEV(aI,{agent:Y,providers:G,onUpdateAgent:q,onDeleteAgent:R},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function xQ({active:Y,onClick:G,children:U}){return h.jsxDEV("button",{onClick:G,className:`px-4 py-3 text-sm font-medium border-b-2 transition ${Y?"border-[#f97316] text-[#e0e0e0]":"border-transparent text-[#666] hover:text-[#888]"}`,children:U},void 0,!1,void 0,this)}function dI({agent:Y,onStartAgent:G}){if(Y.status==="running"&&Y.port)return h.jsxDEV(K2,{agentId:"default",apiUrl:`/api/agents/${Y.id}`,placeholder:"Message this agent...",context:Y.systemPrompt,variant:"terminal",headerTitle:Y.name},void 0,!1,void 0,this);return h.jsxDEV("div",{className:"flex-1 flex items-center justify-center text-[#666]",children:h.jsxDEV("div",{className:"text-center",children:[h.jsxDEV("p",{className:"text-lg mb-2",children:"Agent is not running"},void 0,!1,void 0,this),h.jsxDEV("button",{onClick:G,className:"bg-[#3b82f6]/20 text-[#3b82f6] hover:bg-[#3b82f6]/30 px-4 py-2 rounded font-medium transition",children:"Start Agent"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function cI({agent:Y}){let[G,U]=h1.useState([]),[_,q]=h1.useState(!0),[R,K]=h1.useState(null),[O,T]=h1.useState(null),[I,b]=h1.useState([]),[P,N]=h1.useState(!1),{confirm:S,ConfirmDialog:f}=o7();h1.useEffect(()=>{U([]),T(null),b([]),K(null),q(!0)},[Y.id]),h1.useEffect(()=>{if(Y.status!=="running"){q(!1);return}(async()=>{try{let p=await fetch(`/api/agents/${Y.id}/threads`);if(!p.ok)throw Error("Failed to fetch threads");let A=await p.json();U(A.threads||[]),K(null)}catch(p){K(p instanceof Error?p.message:"Failed to load threads")}finally{q(!1)}})()},[Y.id,Y.status]);let V=async(v)=>{T(v),N(!0);try{let p=await fetch(`/api/agents/${Y.id}/threads/${v}/messages`);if(!p.ok)throw Error("Failed to fetch messages");let A=await p.json();b(A.messages||[])}catch{b([])}finally{N(!1)}},x=async(v,p)=>{if(p.stopPropagation(),!await S("Delete this thread?",{confirmText:"Delete",title:"Delete Thread"}))return;try{if(await fetch(`/api/agents/${Y.id}/threads/${v}`,{method:"DELETE"}),U((E)=>E.filter((j)=>j.id!==v)),O===v)T(null),b([])}catch{}};if(Y.status!=="running")return h.jsxDEV("div",{className:"flex-1 flex items-center justify-center text-[#666]",children:h.jsxDEV("p",{children:"Start the agent to view threads"},void 0,!1,void 0,this)},void 0,!1,void 0,this);if(_)return h.jsxDEV("div",{className:"flex-1 flex items-center justify-center text-[#666]",children:h.jsxDEV("p",{children:"Loading threads..."},void 0,!1,void 0,this)},void 0,!1,void 0,this);if(R)return h.jsxDEV("div",{className:"flex-1 flex items-center justify-center text-red-400",children:h.jsxDEV("p",{children:R},void 0,!1,void 0,this)},void 0,!1,void 0,this);if(O){let v=G.find((p)=>p.id===O);return h.jsxDEV(h.Fragment,{children:[f,h.jsxDEV("div",{className:"flex-1 flex flex-col overflow-hidden",children:[h.jsxDEV("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-[#1a1a1a]",children:[h.jsxDEV("button",{onClick:()=>{T(null),b([])},className:"text-[#666] hover:text-[#e0e0e0] transition text-lg",children:"←"},void 0,!1,void 0,this),h.jsxDEV("div",{className:"flex-1",children:[h.jsxDEV("p",{className:"text-sm font-medium",children:v?.title||`Thread ${O.slice(0,8)}`},void 0,!1,void 0,this),h.jsxDEV("p",{className:"text-xs text-[#666]",children:v&&new Date(v.updated_at||v.created_at).toLocaleString()},void 0,!1,void 0,this)]},void 0,!0,void 0,this),h.jsxDEV("button",{onClick:(p)=>x(O,p),className:"text-[#666] hover:text-red-400 text-sm px-2 py-1",children:"Delete"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),h.jsxDEV("div",{className:"flex-1 overflow-auto p-4",children:P?h.jsxDEV("p",{className:"text-[#666]",children:"Loading messages..."},void 0,!1,void 0,this):I.length===0?h.jsxDEV("p",{className:"text-[#666]",children:"No messages in this thread"},void 0,!1,void 0,this):h.jsxDEV("div",{className:"space-y-4",children:I.map((p,A)=>h.jsxDEV("div",{className:`${p.role==="user"?"text-right":""}`,children:h.jsxDEV("div",{className:`inline-block max-w-[80%] p-3 rounded ${p.role==="user"?"bg-[#f97316]/20 text-[#f97316]":"bg-[#1a1a1a] text-[#e0e0e0]"}`,children:[h.jsxDEV("div",{className:"text-sm whitespace-pre-wrap",children:typeof p.content==="string"?p.content:Array.isArray(p.content)?p.content.map((E,j)=>h.jsxDEV("div",{children:[E.type==="text"&&E.text,E.type==="tool_use"&&h.jsxDEV("div",{className:"bg-[#222] p-2 rounded mt-1 text-xs text-[#888]",children:["\uD83D\uDD27 Tool: ",E.name]},void 0,!0,void 0,this),E.type==="tool_result"&&h.jsxDEV("div",{className:"bg-[#222] p-2 rounded mt-1 text-xs text-[#888]",children:["\uD83D\uDCCB Result: ",typeof E.content==="string"?E.content.slice(0,200):"..."]},void 0,!0,void 0,this)]},j,!0,void 0,this)):JSON.stringify(p.content)},void 0,!1,void 0,this),h.jsxDEV("p",{className:"text-xs text-[#666] mt-1",children:new Date(p.created_at).toLocaleTimeString()},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},A,!1,void 0,this))},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}return h.jsxDEV(h.Fragment,{children:[f,h.jsxDEV("div",{className:"flex-1 overflow-auto",children:G.length===0?h.jsxDEV("div",{className:"flex items-center justify-center h-full text-[#666]",children:h.jsxDEV("p",{children:"No conversation threads yet"},void 0,!1,void 0,this)},void 0,!1,void 0,this):h.jsxDEV("div",{className:"divide-y divide-[#1a1a1a]",children:G.map((v)=>h.jsxDEV("div",{onClick:()=>V(v.id),className:"p-4 cursor-pointer hover:bg-[#111] transition flex items-center justify-between",children:[h.jsxDEV("div",{className:"flex-1 min-w-0",children:[h.jsxDEV("p",{className:"text-sm font-medium truncate",children:v.title||`Thread ${v.id.slice(0,8)}`},void 0,!1,void 0,this),h.jsxDEV("p",{className:"text-xs text-[#666] mt-1",children:[new Date(v.updated_at||v.created_at).toLocaleString(),v.message_count!==void 0&&` • ${v.message_count} messages`]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),h.jsxDEV("button",{onClick:(p)=>x(v.id,p),className:"text-[#666] hover:text-red-400 text-lg ml-4",children:"×"},void 0,!1,void 0,this)]},v.id,!0,void 0,this))},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function lI({agent:Y}){let[G,U]=h1.useState([]),[_,q]=h1.useState(!0),[R,K]=h1.useState(null),[O,T]=h1.useState("all"),{events:I}=wz({agent_id:Y.id,category:"task"});h1.useEffect(()=>{U([]),K(null),q(!0)},[Y.id]);let b=async()=>{if(Y.status!=="running"){q(!1);return}try{let N=await fetch(`/api/agents/${Y.id}/tasks?status=${O}`);if(!N.ok)throw Error("Failed to fetch tasks");let S=await N.json();U(S.tasks||[]),K(null)}catch(N){K(N instanceof Error?N.message:"Failed to load tasks")}finally{q(!1)}};h1.useEffect(()=>{q(!0),b()},[Y.id,Y.status,O,I.length]);let P=(N)=>{switch(N){case"pending":return"bg-yellow-500/20 text-yellow-400";case"running":return"bg-blue-500/20 text-blue-400";case"completed":return"bg-green-500/20 text-green-400";case"failed":return"bg-red-500/20 text-red-400";default:return"bg-[#222] text-[#666]"}};if(Y.status!=="running")return h.jsxDEV("div",{className:"flex-1 flex items-center justify-center text-[#666]",children:h.jsxDEV("p",{children:"Start the agent to view tasks"},void 0,!1,void 0,this)},void 0,!1,void 0,this);if(!Y.features?.tasks)return h.jsxDEV("div",{className:"flex-1 flex items-center justify-center text-[#666]",children:h.jsxDEV("div",{className:"text-center",children:[h.jsxDEV("p",{className:"mb-2",children:"Tasks feature is not enabled"},void 0,!1,void 0,this),h.jsxDEV("p",{className:"text-sm",children:"Enable it in Settings to schedule tasks"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this);if(_)return h.jsxDEV("div",{className:"flex-1 flex items-center justify-center text-[#666]",children:h.jsxDEV("p",{children:"Loading tasks..."},void 0,!1,void 0,this)},void 0,!1,void 0,this);if(R)return h.jsxDEV("div",{className:"flex-1 flex items-center justify-center text-red-400",children:h.jsxDEV("p",{children:R},void 0,!1,void 0,this)},void 0,!1,void 0,this);return h.jsxDEV("div",{className:"flex-1 overflow-auto p-4",children:[h.jsxDEV("div",{className:"flex gap-2 mb-4",children:["all","pending","running","completed"].map((N)=>h.jsxDEV("button",{onClick:()=>T(N),className:`px-3 py-1 text-xs rounded transition ${O===N?"bg-[#f97316] text-black":"bg-[#1a1a1a] text-[#666] hover:text-[#888]"}`,children:N.charAt(0).toUpperCase()+N.slice(1)},N,!1,void 0,this))},void 0,!1,void 0,this),G.length===0?h.jsxDEV("div",{className:"text-center py-10 text-[#666]",children:h.jsxDEV("p",{children:["No ",O==="all"?"":O+" ","tasks"]},void 0,!0,void 0,this)},void 0,!1,void 0,this):h.jsxDEV("div",{className:"space-y-3",children:G.map((N)=>h.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded p-3",children:[h.jsxDEV("div",{className:"flex items-start justify-between",children:[h.jsxDEV("div",{className:"flex-1 min-w-0",children:[h.jsxDEV("p",{className:"text-sm font-medium text-[#e0e0e0]",children:N.name},void 0,!1,void 0,this),N.description&&h.jsxDEV("p",{className:"text-xs text-[#666] mt-1 line-clamp-2",children:N.description},void 0,!1,void 0,this)]},void 0,!0,void 0,this),h.jsxDEV("span",{className:`text-xs px-2 py-0.5 rounded ml-2 ${P(N.status)}`,children:N.status},void 0,!1,void 0,this)]},void 0,!0,void 0,this),h.jsxDEV("div",{className:"flex items-center gap-4 mt-2 text-xs text-[#666]",children:[h.jsxDEV("span",{children:["Created: ",new Date(N.created_at).toLocaleString()]},void 0,!0,void 0,this),N.scheduled_at&&h.jsxDEV("span",{children:["Scheduled: ",new Date(N.scheduled_at).toLocaleString()]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),N.status==="completed"&&N.result&&h.jsxDEV("div",{className:"mt-2 p-2 bg-[#0a0a0a] rounded text-xs text-[#888]",children:[h.jsxDEV("p",{className:"text-[#666] mb-1",children:"Result:"},void 0,!1,void 0,this),h.jsxDEV("p",{className:"whitespace-pre-wrap",children:N.result},void 0,!1,void 0,this)]},void 0,!0,void 0,this),N.status==="failed"&&N.error&&h.jsxDEV("div",{className:"mt-2 p-2 bg-red-500/10 rounded text-xs text-red-400",children:[h.jsxDEV("p",{className:"text-red-400/70 mb-1",children:"Error:"},void 0,!1,void 0,this),h.jsxDEV("p",{className:"whitespace-pre-wrap",children:N.error},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},N.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function iI({agent:Y}){let[G,U]=h1.useState([]),[_,q]=h1.useState(!0),[R,K]=h1.useState(null),[O,T]=h1.useState(!1),{confirm:I,ConfirmDialog:b}=o7();h1.useEffect(()=>{U([]),K(null),q(!0)},[Y.id]);let P=async()=>{if(Y.status!=="running"){q(!1);return}try{let f=await fetch(`/api/agents/${Y.id}/memories`);if(!f.ok)throw Error("Failed to fetch memories");let V=await f.json();U(V.memories||[]),T(V.enabled??!1),K(null)}catch(f){K(f instanceof Error?f.message:"Failed to load memories")}finally{q(!1)}};h1.useEffect(()=>{P()},[Y.id,Y.status]);let N=async(f)=>{try{await fetch(`/api/agents/${Y.id}/memories/${f}`,{method:"DELETE"}),U((V)=>V.filter((x)=>x.id!==f))}catch{}},S=async()=>{if(!await I("Clear all memories?",{confirmText:"Clear",title:"Clear Memories"}))return;try{await fetch(`/api/agents/${Y.id}/memories`,{method:"DELETE"}),U([])}catch{}};if(!Y.features?.memory)return h.jsxDEV("div",{className:"flex-1 flex items-center justify-center text-[#666]",children:h.jsxDEV("div",{className:"text-center",children:[h.jsxDEV("p",{className:"mb-2",children:"Memory feature is not enabled"},void 0,!1,void 0,this),h.jsxDEV("p",{className:"text-sm",children:"Enable it in Settings to persist knowledge"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this);if(Y.status!=="running")return h.jsxDEV("div",{className:"flex-1 flex items-center justify-center text-[#666]",children:h.jsxDEV("p",{children:"Start the agent to view memories"},void 0,!1,void 0,this)},void 0,!1,void 0,this);if(_)return h.jsxDEV("div",{className:"flex-1 flex items-center justify-center text-[#666]",children:h.jsxDEV("p",{children:"Loading memories..."},void 0,!1,void 0,this)},void 0,!1,void 0,this);if(R)return h.jsxDEV("div",{className:"flex-1 flex items-center justify-center text-red-400",children:h.jsxDEV("p",{children:R},void 0,!1,void 0,this)},void 0,!1,void 0,this);if(!O)return h.jsxDEV("div",{className:"flex-1 flex items-center justify-center text-[#666]",children:h.jsxDEV("div",{className:"text-center",children:[h.jsxDEV("p",{className:"mb-2",children:"Memory system not initialized"},void 0,!1,void 0,this),h.jsxDEV("p",{className:"text-sm",children:"Check OPENAI_API_KEY for embeddings"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this);return h.jsxDEV(h.Fragment,{children:[b,h.jsxDEV("div",{className:"flex-1 overflow-auto p-4",children:[h.jsxDEV("div",{className:"flex items-center justify-between mb-4",children:[h.jsxDEV("h3",{className:"text-sm font-medium text-[#888]",children:["Stored Memories (",G.length,")"]},void 0,!0,void 0,this),G.length>0&&h.jsxDEV("button",{onClick:S,className:"text-xs text-red-400 hover:text-red-300",children:"Clear All"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),G.length===0?h.jsxDEV("div",{className:"text-center py-10 text-[#666]",children:[h.jsxDEV("p",{children:"No memories stored yet"},void 0,!1,void 0,this),h.jsxDEV("p",{className:"text-sm mt-1",children:"The agent will remember important information from conversations"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):h.jsxDEV("div",{className:"space-y-3",children:G.map((f)=>h.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded p-3",children:[h.jsxDEV("div",{className:"flex items-start justify-between gap-2",children:[h.jsxDEV("p",{className:"text-sm text-[#e0e0e0] flex-1",children:f.content},void 0,!1,void 0,this),h.jsxDEV("button",{onClick:()=>N(f.id),className:"text-[#666] hover:text-red-400 text-sm flex-shrink-0",children:"×"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),h.jsxDEV("div",{className:"flex items-center gap-3 mt-2",children:[h.jsxDEV("span",{className:`text-xs px-2 py-0.5 rounded ${f.type==="preference"?"bg-purple-500/20 text-purple-400":f.type==="fact"?"bg-green-500/20 text-green-400":"bg-blue-500/20 text-blue-400"}`,children:f.type},void 0,!1,void 0,this),h.jsxDEV("span",{className:"text-xs text-[#666]",children:new Date(f.created_at).toLocaleString()},void 0,!1,void 0,this),f.importance&&h.jsxDEV("span",{className:"text-xs text-[#555]",children:["importance: ",f.importance.toFixed(1)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},f.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function oI({agent:Y}){let[G,U]=h1.useState([]),[_,q]=h1.useState(!0),[R,K]=h1.useState(null),[O,T]=h1.useState(!1),[I,b]=h1.useState(null),[P,N]=h1.useState(!1),S=h1.default.useRef(null),{confirm:f,ConfirmDialog:V}=o7();h1.useEffect(()=>{U([]),K(null),q(!0)},[Y.id]);let x=async()=>{if(Y.status!=="running"){q(!1);return}try{let D=await fetch(`/api/agents/${Y.id}/files`);if(!D.ok)throw Error("Failed to fetch files");let Q0=await D.json();U(Q0.files||[]),K(null)}catch(D){K(D instanceof Error?D.message:"Failed to load files")}finally{q(!1)}};h1.useEffect(()=>{x()},[Y.id,Y.status]);let v=async(D)=>{if(!await f("Delete this file?",{confirmText:"Delete",title:"Delete File"}))return;try{await fetch(`/api/agents/${Y.id}/files/${D}`,{method:"DELETE"}),U((n)=>n.filter((G0)=>G0.id!==D))}catch{}},p=(D,Q0)=>{let n=document.createElement("a");n.href=`/api/agents/${Y.id}/files/${D}/download`,n.download=Q0,n.click()},A=(D)=>{if(D<1024)return`${D} B`;if(D<1048576)return`${(D/1024).toFixed(1)} KB`;return`${(D/1048576).toFixed(1)} MB`},E=async(D)=>{T(!0),b(null);try{let Q0=new FormData;Q0.append("file",D);let n=await fetch(`/api/agents/${Y.id}/files`,{method:"POST",body:Q0});if(!n.ok){let G0=await n.json();throw Error(G0.error||"Upload failed")}await x()}catch(Q0){b(Q0 instanceof Error?Q0.message:"Upload failed")}finally{T(!1)}},j=(D)=>{let Q0=D.target.files?.[0];if(Q0)E(Q0);D.target.value=""},u=(D)=>{D.preventDefault(),N(!1);let Q0=D.dataTransfer.files?.[0];if(Q0)E(Q0)},r=(D)=>{D.preventDefault(),N(!0)},i=(D)=>{D.preventDefault(),N(!1)},d=(D)=>{if(D.startsWith("image/"))return"\uD83D\uDDBC";if(D.includes("pdf"))return"\uD83D\uDCD5";if(D.includes("json"))return"{}";if(D.includes("javascript")||D.includes("typescript"))return"⚡";if(D.startsWith("text/"))return"\uD83D\uDCC4";if(D.startsWith("audio/"))return"\uD83C\uDFB5";if(D.startsWith("video/"))return"\uD83C\uDFAC";return"\uD83D\uDCC1"};if(!Y.features?.files)return h.jsxDEV("div",{className:"flex-1 flex items-center justify-center text-[#666]",children:h.jsxDEV("div",{className:"text-center",children:[h.jsxDEV("p",{className:"mb-2",children:"Files feature is not enabled"},void 0,!1,void 0,this),h.jsxDEV("p",{className:"text-sm",children:"Enable it in Settings to manage files"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this);if(Y.status!=="running")return h.jsxDEV("div",{className:"flex-1 flex items-center justify-center text-[#666]",children:h.jsxDEV("p",{children:"Start the agent to view files"},void 0,!1,void 0,this)},void 0,!1,void 0,this);if(_)return h.jsxDEV("div",{className:"flex-1 flex items-center justify-center text-[#666]",children:h.jsxDEV("p",{children:"Loading files..."},void 0,!1,void 0,this)},void 0,!1,void 0,this);if(R)return h.jsxDEV("div",{className:"flex-1 flex items-center justify-center text-red-400",children:h.jsxDEV("p",{children:R},void 0,!1,void 0,this)},void 0,!1,void 0,this);return h.jsxDEV(h.Fragment,{children:[V,h.jsxDEV("div",{className:`flex-1 overflow-auto p-4 transition ${P?"bg-[#f97316]/5":""}`,onDrop:u,onDragOver:r,onDragLeave:i,children:[h.jsxDEV("input",{ref:S,type:"file",className:"hidden",onChange:j},void 0,!1,void 0,this),h.jsxDEV("div",{className:"flex items-center justify-between mb-4",children:[h.jsxDEV("h3",{className:"text-sm font-medium text-[#888]",children:["Agent Files (",G.length,")"]},void 0,!0,void 0,this),h.jsxDEV("div",{className:"flex items-center gap-2",children:[h.jsxDEV("button",{onClick:()=>S.current?.click(),disabled:O,className:"text-xs bg-[#f97316] hover:bg-[#fb923c] disabled:opacity-50 text-black px-3 py-1 rounded font-medium transition",children:O?"Uploading...":"Upload"},void 0,!1,void 0,this),h.jsxDEV("button",{onClick:x,className:"text-xs text-[#666] hover:text-[#888]",children:"Refresh"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),I&&h.jsxDEV("div",{className:"mb-4 text-sm bg-red-500/10 text-red-400 px-3 py-2 rounded",children:I},void 0,!1,void 0,this),P&&h.jsxDEV("div",{className:"mb-4 border-2 border-dashed border-[#f97316] rounded-lg p-8 text-center",children:h.jsxDEV("p",{className:"text-[#f97316]",children:"Drop file to upload"},void 0,!1,void 0,this)},void 0,!1,void 0,this),G.length===0&&!P&&h.jsxDEV("div",{className:"text-center py-10 text-[#666]",children:[h.jsxDEV("p",{children:"No files stored yet"},void 0,!1,void 0,this),h.jsxDEV("p",{className:"text-sm mt-1",children:"Drop files here, click Upload, or attach files in Chat"},void 0,!1,void 0,this),Y.features?.memory&&h.jsxDEV("p",{className:"text-xs mt-2 text-[#555]",children:"Files will be auto-ingested into memory"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),G.length>0&&h.jsxDEV("div",{className:"space-y-2",children:G.map((D)=>h.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded p-3 flex items-center gap-3",children:[h.jsxDEV("div",{className:"w-10 h-10 bg-[#1a1a1a] rounded flex items-center justify-center text-[#666]",children:d(D.mime_type)},void 0,!1,void 0,this),h.jsxDEV("div",{className:"flex-1 min-w-0",children:[h.jsxDEV("p",{className:"text-sm text-[#e0e0e0] truncate",children:D.filename},void 0,!1,void 0,this),h.jsxDEV("p",{className:"text-xs text-[#666]",children:[A(D.size_bytes)," • ",new Date(D.created_at).toLocaleString(),D.source&&D.source!=="upload"&&` • ${D.source}`]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),h.jsxDEV("div",{className:"flex items-center gap-2",children:[h.jsxDEV("button",{onClick:()=>p(D.id,D.filename),className:"text-xs text-[#666] hover:text-[#f97316] px-2 py-1",children:"↓"},void 0,!1,void 0,this),h.jsxDEV("button",{onClick:()=>v(D.id),className:"text-[#666] hover:text-red-400 text-sm",children:"×"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},D.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function aI({agent:Y,providers:G,onUpdateAgent:U,onDeleteAgent:_}){let{authFetch:q,isDev:R}=b1(),[K,O]=h1.useState({name:Y.name,provider:Y.provider,model:Y.model,systemPrompt:Y.systemPrompt,features:{...Y.features,builtinTools:Y.features.builtinTools||{webSearch:!1,webFetch:!1}},mcpServers:[...Y.mcpServers||[]],skills:[...Y.skills||[]]}),[T,I]=h1.useState(!1),[b,P]=h1.useState(!1),[N,S]=h1.useState(null),[f,V]=h1.useState([]),[x,v]=h1.useState([]),[p,A]=h1.useState(null),[E,j]=h1.useState(!1);h1.useEffect(()=>{(async()=>{try{let U0=await(await q("/api/mcp/servers")).json();V(U0.servers||[])}catch(Y0){console.error("Failed to fetch MCP servers:",Y0)}})()},[q]),h1.useEffect(()=>{if(!R)return;(async()=>{try{let Y0=await q(`/api/agents/${Y.id}/api-key`);if(Y0.ok){let U0=await Y0.json();A(U0.apiKey)}}catch(Y0){}})()},[Y.id,R,q]),h1.useEffect(()=>{(async()=>{try{let U0=await(await q("/api/skills")).json();v(U0.skills||[])}catch(Y0){console.error("Failed to fetch skills:",Y0)}})()},[q]),h1.useEffect(()=>{O({name:Y.name,provider:Y.provider,model:Y.model,systemPrompt:Y.systemPrompt,features:{...Y.features,builtinTools:Y.features.builtinTools||{webSearch:!1,webFetch:!1}},mcpServers:[...Y.mcpServers||[]],skills:[...Y.skills||[]]}),S(null)},[Y.id]);let u=G.find((a)=>a.id===K.provider),r=G.filter((a)=>a.hasKey&&a.type==="llm").map((a)=>({value:a.id,label:a.name})),i=u?.models.map((a)=>({value:a.value,label:a.label,recommended:a.recommended}))||[],d=(a)=>{let Y0=G.find((H0)=>H0.id===a),U0=Y0?.models.find((H0)=>H0.recommended)?.value||Y0?.models[0]?.value||"";O((H0)=>({...H0,provider:a,model:U0}))},D=(a)=>{if(a==="agents"){let Y0=(U0)=>{return Mz(U0.features,Y.projectId).enabled};O((U0)=>{if(typeof U0.features.agents==="boolean"?U0.features.agents:U0.features.agents?.enabled??!1)return{...U0,features:{...U0.features,agents:!1}};else return{...U0,features:{...U0.features,agents:{enabled:!0,mode:"worker",group:Y.projectId||void 0}}}})}else O((Y0)=>({...Y0,features:{...Y0.features,[a]:!Y0.features[a]}}))},Q0=(a)=>{O((Y0)=>{let U0=Mz(Y0.features,Y.projectId);return{...Y0,features:{...Y0.features,agents:{...U0,enabled:!0,mode:a}}}})},n=()=>{let a=K.features.agents;if(typeof a==="boolean")return a;return a?.enabled??!1},G0=()=>{return Mz(K.features,Y.projectId).mode||"worker"},F0=(a)=>{O((Y0)=>({...Y0,mcpServers:Y0.mcpServers.includes(a)?Y0.mcpServers.filter((U0)=>U0!==a):[...Y0.mcpServers,a]}))},K0=(a)=>{O((Y0)=>({...Y0,skills:Y0.skills.includes(a)?Y0.skills.filter((U0)=>U0!==a):[...Y0.skills,a]}))},S0=async()=>{I(!0),S(null);let a=await U(K);if(I(!1),a.error)S({type:"error",text:a.error});else S({type:"success",text:"Settings saved"}),setTimeout(()=>S(null),2000)},P0=K.name!==Y.name||K.provider!==Y.provider||K.model!==Y.model||K.systemPrompt!==Y.systemPrompt||JSON.stringify(K.features)!==JSON.stringify(Y.features)||JSON.stringify(K.mcpServers.sort())!==JSON.stringify((Y.mcpServers||[]).sort())||JSON.stringify(K.skills.sort())!==JSON.stringify((Y.skills||[]).sort());return h.jsxDEV("div",{className:"flex-1 overflow-auto p-4",children:h.jsxDEV("div",{className:"space-y-4",children:[h.jsxDEV(X8,{label:"Name",children:h.jsxDEV("input",{type:"text",value:K.name,onChange:(a)=>O((Y0)=>({...Y0,name:a.target.value})),className:"w-full bg-[#0a0a0a] border border-[#222] rounded px-3 py-2 focus:outline-none focus:border-[#f97316] text-[#e0e0e0]"},void 0,!1,void 0,this)},void 0,!1,void 0,this),h.jsxDEV(X8,{label:"Provider",children:h.jsxDEV(r4,{value:K.provider,options:r,onChange:d},void 0,!1,void 0,this)},void 0,!1,void 0,this),h.jsxDEV(X8,{label:"Model",children:h.jsxDEV(r4,{value:K.model,options:i,onChange:(a)=>O((Y0)=>({...Y0,model:a}))},void 0,!1,void 0,this)},void 0,!1,void 0,this),h.jsxDEV(X8,{label:"System Prompt",children:h.jsxDEV("textarea",{value:K.systemPrompt,onChange:(a)=>O((Y0)=>({...Y0,systemPrompt:a.target.value})),className:"w-full bg-[#0a0a0a] border border-[#222] rounded px-3 py-2 h-24 resize-none focus:outline-none focus:border-[#f97316] text-[#e0e0e0]"},void 0,!1,void 0,this)},void 0,!1,void 0,this),h.jsxDEV(X8,{label:"Features",children:h.jsxDEV("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:pI.map(({key:a,label:Y0,description:U0,icon:H0})=>{let y0=a==="agents"?n():!!K.features[a];return h.jsxDEV("button",{type:"button",onClick:()=>D(a),className:`flex items-center gap-3 p-3 rounded border text-left transition ${y0?"border-[#f97316] bg-[#f97316]/10":"border-[#222] hover:border-[#333]"}`,children:[h.jsxDEV(H0,{className:`w-5 h-5 flex-shrink-0 ${y0?"text-[#f97316]":"text-[#666]"}`},void 0,!1,void 0,this),h.jsxDEV("div",{className:"flex-1 min-w-0",children:[h.jsxDEV("div",{className:`text-sm font-medium ${y0?"text-[#f97316]":""}`,children:Y0},void 0,!1,void 0,this),h.jsxDEV("div",{className:"text-xs text-[#666]",children:U0},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},a,!0,void 0,this)})},void 0,!1,void 0,this)},void 0,!1,void 0,this),n()&&h.jsxDEV(X8,{label:"Multi-Agent Mode",children:[h.jsxDEV("div",{className:"flex gap-2",children:[h.jsxDEV("button",{type:"button",onClick:()=>Q0("coordinator"),className:`flex-1 p-3 rounded border text-left transition ${G0()==="coordinator"?"border-[#f97316] bg-[#f97316]/10":"border-[#222] hover:border-[#333]"}`,children:[h.jsxDEV("div",{className:`text-sm font-medium ${G0()==="coordinator"?"text-[#f97316]":""}`,children:"Coordinator"},void 0,!1,void 0,this),h.jsxDEV("div",{className:"text-xs text-[#666]",children:"Orchestrates and delegates to other agents"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),h.jsxDEV("button",{type:"button",onClick:()=>Q0("worker"),className:`flex-1 p-3 rounded border text-left transition ${G0()==="worker"?"border-[#f97316] bg-[#f97316]/10":"border-[#222] hover:border-[#333]"}`,children:[h.jsxDEV("div",{className:`text-sm font-medium ${G0()==="worker"?"text-[#f97316]":""}`,children:"Worker"},void 0,!1,void 0,this),h.jsxDEV("div",{className:"text-xs text-[#666]",children:"Receives tasks from coordinators"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Y.projectId&&h.jsxDEV("p",{className:"text-xs text-[#555] mt-2",children:"Group: Using project as agent group"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),K.provider==="anthropic"&&h.jsxDEV(X8,{label:"Agent Built-in Tools",children:[h.jsxDEV("div",{className:"flex flex-wrap gap-2",children:[h.jsxDEV("button",{type:"button",onClick:()=>O((a)=>({...a,features:{...a.features,builtinTools:{...a.features.builtinTools,webSearch:!a.features.builtinTools?.webSearch}}})),className:`flex items-center gap-2 px-3 py-2 rounded border transition ${K.features.builtinTools?.webSearch?"border-[#f97316] bg-[#f97316]/10 text-[#f97316]":"border-[#222] hover:border-[#333] text-[#888]"}`,children:[h.jsxDEV("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"},void 0,!1,void 0,this)},void 0,!1,void 0,this),h.jsxDEV("span",{className:"text-sm",children:"Web Search"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),h.jsxDEV("button",{type:"button",onClick:()=>O((a)=>({...a,features:{...a.features,builtinTools:{...a.features.builtinTools,webFetch:!a.features.builtinTools?.webFetch}}})),className:`flex items-center gap-2 px-3 py-2 rounded border transition ${K.features.builtinTools?.webFetch?"border-[#f97316] bg-[#f97316]/10 text-[#f97316]":"border-[#222] hover:border-[#333] text-[#888]"}`,children:[h.jsxDEV("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"},void 0,!1,void 0,this)},void 0,!1,void 0,this),h.jsxDEV("span",{className:"text-sm",children:"Web Fetch"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),h.jsxDEV("p",{className:"text-xs text-[#555] mt-2",children:"Provider-native tools for real-time web access"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),K.features.mcp&&h.jsxDEV(X8,{label:"MCP Servers",children:f.length===0?h.jsxDEV("p",{className:"text-sm text-[#666]",children:"No MCP servers configured. Add servers in the MCP page first."},void 0,!1,void 0,this):h.jsxDEV("div",{className:"space-y-2",children:[f.filter((a)=>a.project_id===null||a.project_id===Y.projectId).map((a)=>{let Y0=a.type==="http"&&a.url,U0=Y0||a.status==="running",H0=Y0?`${a.source||"remote"} • http`:`${a.type} • ${a.package||a.command||"custom"}${a.status==="running"&&a.port?` • :${a.port}`:""}`;return h.jsxDEV("button",{type:"button",onClick:()=>F0(a.id),className:`w-full flex items-center gap-3 p-3 rounded border text-left transition ${K.mcpServers.includes(a.id)?"border-[#f97316] bg-[#f97316]/10":"border-[#222] hover:border-[#333]"}`,children:[h.jsxDEV("div",{className:`w-2 h-2 rounded-full flex-shrink-0 ${U0?"bg-green-400":"bg-[#444]"}`},void 0,!1,void 0,this),h.jsxDEV("div",{className:"flex-1 min-w-0",children:[h.jsxDEV("div",{className:"flex items-center gap-2",children:[h.jsxDEV("span",{className:`text-sm font-medium ${K.mcpServers.includes(a.id)?"text-[#f97316]":""}`,children:a.name},void 0,!1,void 0,this),a.project_id===null&&h.jsxDEV("span",{className:"text-[10px] text-[#666] bg-[#1a1a1a] px-1.5 py-0.5 rounded",children:"Global"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),h.jsxDEV("div",{className:"text-xs text-[#666]",children:H0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),h.jsxDEV("div",{className:`text-xs px-2 py-0.5 rounded ${U0?"bg-green-500/20 text-green-400":"bg-[#222] text-[#666]"}`,children:Y0?"remote":a.status},void 0,!1,void 0,this)]},a.id,!0,void 0,this)}),h.jsxDEV("p",{className:"text-xs text-[#666] mt-2",children:"Remote servers are always available. Local servers must be running."},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),h.jsxDEV(X8,{label:"Skills",children:x.length===0?h.jsxDEV("p",{className:"text-sm text-[#666]",children:"No skills configured. Add skills in the Skills page first."},void 0,!1,void 0,this):h.jsxDEV("div",{className:"space-y-2",children:[x.filter((a)=>a.enabled&&(a.project_id===null||a.project_id===Y.projectId)).map((a)=>h.jsxDEV("button",{type:"button",onClick:()=>K0(a.id),className:`w-full flex items-center gap-3 p-3 rounded border text-left transition ${K.skills.includes(a.id)?"border-[#f97316] bg-[#f97316]/10":"border-[#222] hover:border-[#333]"}`,children:[h.jsxDEV("div",{className:"flex-1 min-w-0",children:[h.jsxDEV("div",{className:"flex items-center gap-2",children:[h.jsxDEV("span",{className:`text-sm font-medium ${K.skills.includes(a.id)?"text-[#f97316]":""}`,children:a.name},void 0,!1,void 0,this),a.project_id===null&&h.jsxDEV("span",{className:"text-[10px] text-[#666] bg-[#1a1a1a] px-1.5 py-0.5 rounded",children:"Global"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),h.jsxDEV("div",{className:"text-xs text-[#666]",children:a.description},void 0,!1,void 0,this)]},void 0,!0,void 0,this),h.jsxDEV("div",{className:"text-xs px-2 py-0.5 rounded bg-[#222] text-[#666]",children:["v",a.version]},void 0,!0,void 0,this)]},a.id,!0,void 0,this)),h.jsxDEV("p",{className:"text-xs text-[#666] mt-2",children:"Skills provide reusable instructions for the agent."},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),N&&h.jsxDEV("div",{className:`text-sm px-3 py-2 rounded ${N.type==="success"?"bg-green-500/10 text-green-400":"bg-red-500/10 text-red-400"}`,children:N.text},void 0,!1,void 0,this),h.jsxDEV("button",{onClick:S0,disabled:!P0||T||!K.name,className:"w-full bg-[#f97316] hover:bg-[#fb923c] disabled:opacity-50 disabled:cursor-not-allowed text-black px-4 py-2 rounded font-medium transition",children:T?"Saving...":"Save Changes"},void 0,!1,void 0,this),Y.status==="running"&&P0&&h.jsxDEV("p",{className:"text-xs text-[#666] text-center",children:"Changes will be applied to the running agent"},void 0,!1,void 0,this),R&&p&&h.jsxDEV("div",{className:"mt-8 pt-6 border-t border-[#222]",children:[h.jsxDEV("p",{className:"text-sm text-[#666] mb-3",children:"Developer Info"},void 0,!1,void 0,this),h.jsxDEV("div",{className:"space-y-2",children:[h.jsxDEV("div",{className:"flex items-center justify-between",children:[h.jsxDEV("span",{className:"text-xs text-[#666]",children:"Agent ID"},void 0,!1,void 0,this),h.jsxDEV("code",{className:"text-xs bg-[#1a1a1a] px-2 py-1 rounded text-[#888]",children:Y.id},void 0,!1,void 0,this)]},void 0,!0,void 0,this),h.jsxDEV("div",{className:"flex items-center justify-between",children:[h.jsxDEV("span",{className:"text-xs text-[#666]",children:"Port"},void 0,!1,void 0,this),h.jsxDEV("code",{className:"text-xs bg-[#1a1a1a] px-2 py-1 rounded text-[#888]",children:Y.port||"N/A"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),h.jsxDEV("div",{className:"flex flex-col gap-1",children:[h.jsxDEV("div",{className:"flex items-center justify-between",children:[h.jsxDEV("span",{className:"text-xs text-[#666]",children:"API Key"},void 0,!1,void 0,this),h.jsxDEV("button",{onClick:()=>j(!E),className:"text-xs text-[#f97316] hover:text-[#fb923c]",children:E?"Hide":"Show"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),E&&h.jsxDEV("code",{className:"text-xs bg-[#1a1a1a] px-2 py-1 rounded text-[#888] break-all",children:p},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y.status==="running"&&Y.port&&h.jsxDEV("div",{className:"flex flex-col gap-1 mt-2",children:[h.jsxDEV("span",{className:"text-xs text-[#666]",children:"Test with curl"},void 0,!1,void 0,this),h.jsxDEV("code",{className:"text-xs bg-[#1a1a1a] px-2 py-1.5 rounded text-[#666] break-all",children:['curl -H "X-API-Key: ',E?p:"***",'" http://localhost:',Y.port,"/config"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),h.jsxDEV("div",{className:"mt-8 pt-6 border-t border-[#222]",children:[h.jsxDEV("p",{className:"text-sm text-[#666] mb-3",children:"Danger Zone"},void 0,!1,void 0,this),b?h.jsxDEV("div",{className:"flex gap-2",children:[h.jsxDEV("button",{onClick:()=>P(!1),className:"flex-1 border border-[#333] hover:border-[#444] px-4 py-2 rounded font-medium transition",children:"Cancel"},void 0,!1,void 0,this),h.jsxDEV("button",{onClick:_,className:"flex-1 bg-red-500/20 text-red-400 hover:bg-red-500/30 px-4 py-2 rounded font-medium transition",children:"Confirm Delete"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):h.jsxDEV("button",{onClick:()=>P(!0),className:"w-full border border-red-500/30 text-red-400/70 hover:border-red-500/50 hover:text-red-400 px-4 py-2 rounded font-medium transition",children:"Delete Agent"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function X8({label:Y,children:G}){return h.jsxDEV("div",{children:[h.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:Y},void 0,!1,void 0,this),G]},void 0,!0,void 0,this)}var LK=B0(V1(),1);var S4=B0(U1(),1);function A2({agents:Y,loading:G,selectedAgent:U,providers:_,onSelectAgent:q,onCloseAgent:R,onToggleAgent:K,onDeleteAgent:O,onUpdateAgent:T,onNewAgent:I,canCreateAgent:b=!0}){let{currentProjectId:P,currentProject:N}=R4(),S=LK.useMemo(()=>{if(P===null)return Y;if(P==="unassigned")return Y.filter((V)=>!V.projectId);return Y.filter((V)=>V.projectId===P)},[Y,P]),f=P===null?"Agents":P==="unassigned"?"Unassigned Agents":N?.name||"Agents";return S4.jsxDEV("div",{className:"flex-1 flex overflow-hidden relative",children:[S4.jsxDEV("div",{className:"flex-1 overflow-auto p-6",children:[S4.jsxDEV("div",{className:"flex items-center justify-between mb-6",children:[S4.jsxDEV("div",{className:"flex items-center gap-3",children:[N&&S4.jsxDEV("span",{className:"w-3 h-3 rounded-full",style:{backgroundColor:N.color}},void 0,!1,void 0,this),S4.jsxDEV("h1",{className:"text-xl font-semibold",children:f},void 0,!1,void 0,this),P!==null&&S4.jsxDEV("span",{className:"text-sm text-[#666]",children:["(",S.length," agent",S.length!==1?"s":"",")"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),I&&S4.jsxDEV("button",{onClick:I,disabled:!b,className:"bg-[#f97316] hover:bg-[#fb923c] disabled:opacity-50 disabled:cursor-not-allowed text-black px-4 py-2 rounded font-medium transition",children:"+ New Agent"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),G?S4.jsxDEV(Pz,{message:"Loading agents..."},void 0,!1,void 0,this):S.length===0?S4.jsxDEV(nI,{onNewAgent:I,canCreateAgent:b,hasProjectFilter:P!==null},void 0,!1,void 0,this):S4.jsxDEV("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-3 auto-rows-fr",children:S.map((V)=>S4.jsxDEV(F2,{agent:V,selected:U?.id===V.id,onSelect:()=>q(V),onToggle:(x)=>K(V,x),showProject:P===null},V.id,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),U&&S4.jsxDEV("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-[2px] z-10",onClick:R},void 0,!1,void 0,this),U&&S4.jsxDEV("div",{className:"absolute right-0 top-0 bottom-0 w-full sm:w-[500px] lg:w-[600px] xl:w-[700px] z-20",children:S4.jsxDEV(P2,{agent:U,providers:_,onClose:R,onStartAgent:(V)=>K(U,V),onUpdateAgent:(V)=>T(U.id,V),onDeleteAgent:()=>O(U.id)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function nI({onNewAgent:Y,canCreateAgent:G,hasProjectFilter:U}){return S4.jsxDEV("div",{className:"text-center py-20 text-[#666]",children:[U?S4.jsxDEV(S4.Fragment,{children:[S4.jsxDEV("p",{className:"text-lg",children:"No agents in this project"},void 0,!1,void 0,this),S4.jsxDEV("p",{className:"text-sm mt-1",children:"Create an agent or assign existing agents to this project"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):S4.jsxDEV(S4.Fragment,{children:[S4.jsxDEV("p",{className:"text-lg",children:"No agents yet"},void 0,!1,void 0,this),S4.jsxDEV("p",{className:"text-sm mt-1",children:"Create your first agent to get started"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y&&S4.jsxDEV("button",{onClick:Y,disabled:!G,className:"mt-4 bg-[#f97316] hover:bg-[#fb923c] disabled:opacity-50 disabled:cursor-not-allowed text-black px-4 py-2 rounded font-medium transition",children:"+ New Agent"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var n7=B0(V1(),1);var W1=B0(U1(),1);function T2({agents:Y,loading:G,runningCount:U,configuredProviders:_,onNavigate:q,onSelectAgent:R}){let{authFetch:K}=b1(),{currentProjectId:O}=R4(),{events:T,statusChangeCounter:I}=P6(),[b,P]=n7.useState(null),[N,S]=n7.useState([]),[f,V]=n7.useState([]),x=n7.useMemo(()=>{if(!O)return Y;if(O==="unassigned")return Y.filter((i)=>!i.projectId);return Y.filter((i)=>i.projectId===O)},[Y,O]),v=n7.useMemo(()=>{return x.filter((i)=>i.status==="running").length},[x]),p=n7.useMemo(()=>{return new Set(x.map((i)=>i.id))},[x]),A=n7.useCallback(async()=>{try{let[i,d,D]=await Promise.all([K("/api/dashboard"),K("/api/tasks?status=all"),K("/api/telemetry/events?type=thread_activity&limit=20")]);if(i.ok){let Q0=await i.json();P(Q0)}if(d.ok){let Q0=await d.json();S((Q0.tasks||[]).slice(0,5))}if(D.ok){let Q0=await D.json();V(Q0.events||[])}}catch(i){console.error("Failed to fetch dashboard data:",i)}},[K]);n7.useEffect(()=>{A()},[A,I]);let E=n7.useMemo(()=>{if(!O)return N;return N.filter((i)=>p.has(i.agentId))},[N,O,p]),j=n7.useMemo(()=>{if(!O)return b?.tasks||{total:0,pending:0,running:0,completed:0};let i=E.length,d=E.filter((n)=>n.status==="pending").length,D=E.filter((n)=>n.status==="running").length,Q0=E.filter((n)=>n.status==="completed").length;return{total:i,pending:d,running:D,completed:Q0}},[b,O,E]),u=n7.useMemo(()=>{let i=T.filter((n)=>n.type==="thread_activity"),d=new Set(i.map((n)=>n.id)),D=[...i];for(let n of f)if(!d.has(n.id))D.push(n),d.add(n.id);let Q0=D;if(O)Q0=D.filter((n)=>p.has(n.agent_id));return Q0.sort((n,G0)=>new Date(G0.timestamp).getTime()-new Date(n.timestamp).getTime()),Q0.slice(0,8)},[T,f,O,p]),r=n7.useMemo(()=>{let i=new Map;for(let d of Y)i.set(d.id,d.name);return i},[Y]);return W1.jsxDEV("div",{className:"flex-1 overflow-auto p-6",children:[W1.jsxDEV("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-4 mb-6",children:[W1.jsxDEV(I2,{label:"Agents",value:x.length,subValue:`${v} running`},void 0,!1,void 0,this),W1.jsxDEV(I2,{label:"Tasks",value:j.total,subValue:`${j.pending} pending`},void 0,!1,void 0,this),W1.jsxDEV(I2,{label:"Completed",value:j.completed,color:"text-green-400"},void 0,!1,void 0,this),W1.jsxDEV(I2,{label:"Providers",value:_.length,color:"text-[#f97316]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),W1.jsxDEV("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[W1.jsxDEV(HG,{title:"Agents",actionLabel:"View All",onAction:()=>q("agents"),children:G?W1.jsxDEV("div",{className:"p-4 text-center text-[#666]",children:"Loading..."},void 0,!1,void 0,this):x.length===0?W1.jsxDEV("div",{className:"p-4 text-center text-[#666]",children:"No agents yet"},void 0,!1,void 0,this):W1.jsxDEV("div",{className:"divide-y divide-[#1a1a1a]",children:x.slice(0,5).map((i)=>W1.jsxDEV(rI,{agent:i,onSelect:()=>R(i),showProject:!O},i.id,!1,void 0,this))},void 0,!1,void 0,this)},void 0,!1,void 0,this),W1.jsxDEV(HG,{title:"Activity",actionLabel:"Telemetry",onAction:()=>q("telemetry"),children:u.length===0?W1.jsxDEV("div",{className:"p-4 text-center text-[#666]",children:[W1.jsxDEV("p",{children:"No activity yet"},void 0,!1,void 0,this),W1.jsxDEV("p",{className:"text-sm text-[#444] mt-1",children:"Agent activity will appear here in real-time"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):W1.jsxDEV("div",{className:"divide-y divide-[#1a1a1a]",children:u.map((i)=>W1.jsxDEV(tI,{activity:i.data?.activity||"Working...",agentName:r.get(i.agent_id)||i.agent_id,timestamp:i.timestamp},i.id,!1,void 0,this))},void 0,!1,void 0,this)},void 0,!1,void 0,this),W1.jsxDEV(HG,{title:"Recent Tasks",actionLabel:"View All",onAction:()=>q("tasks"),children:E.length===0?W1.jsxDEV("div",{className:"p-4 text-center text-[#666]",children:[W1.jsxDEV("p",{children:"No tasks yet"},void 0,!1,void 0,this),W1.jsxDEV("p",{className:"text-sm text-[#444] mt-1",children:"Tasks will appear when agents create them"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):W1.jsxDEV("div",{className:"divide-y divide-[#1a1a1a]",children:E.map((i)=>W1.jsxDEV("div",{className:"px-4 py-3 flex items-center justify-between",children:[W1.jsxDEV("div",{className:"flex-1 min-w-0",children:[W1.jsxDEV("p",{className:"font-medium truncate",children:i.title},void 0,!1,void 0,this),W1.jsxDEV("p",{className:"text-sm text-[#666]",children:i.agentName},void 0,!1,void 0,this)]},void 0,!0,void 0,this),W1.jsxDEV(eI,{status:i.status},void 0,!1,void 0,this)]},`${i.agentId}-${i.id}`,!0,void 0,this))},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function I2({label:Y,value:G,subValue:U,color:_}){return W1.jsxDEV("div",{className:"bg-[#111] rounded p-4 border border-[#1a1a1a]",children:[W1.jsxDEV("p",{className:"text-sm text-[#666] mb-1",children:Y},void 0,!1,void 0,this),W1.jsxDEV("p",{className:`text-2xl font-semibold ${_||""}`,children:G},void 0,!1,void 0,this),U&&W1.jsxDEV("p",{className:"text-xs text-[#555] mt-1",children:U},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function HG({title:Y,actionLabel:G,onAction:U,children:_}){return W1.jsxDEV("div",{className:"bg-[#111] rounded border border-[#1a1a1a] overflow-hidden",children:[W1.jsxDEV("div",{className:"px-4 py-3 border-b border-[#1a1a1a] flex items-center justify-between",children:[W1.jsxDEV("h3",{className:"font-semibold",children:Y},void 0,!1,void 0,this),W1.jsxDEV("button",{onClick:U,className:"text-sm text-[#3b82f6] hover:text-[#60a5fa]",children:G},void 0,!1,void 0,this)]},void 0,!0,void 0,this),_]},void 0,!0,void 0,this)}function rI({agent:Y,onSelect:G,showProject:U}){let{isActive:_}=yZ(Y.id),{projects:q}=R4(),R=Y.projectId?q.find((K)=>K.id===Y.projectId):null;return W1.jsxDEV("div",{onClick:G,className:"px-4 py-3 hover:bg-[#1a1a1a] cursor-pointer flex items-center justify-between",children:[W1.jsxDEV("div",{className:"flex-1 min-w-0",children:[W1.jsxDEV("p",{className:"font-medium",children:Y.name},void 0,!1,void 0,this),W1.jsxDEV("div",{className:"flex items-center gap-2 text-sm text-[#666]",children:[W1.jsxDEV("span",{children:Y.provider},void 0,!1,void 0,this),U&&R&&W1.jsxDEV(W1.Fragment,{children:[W1.jsxDEV("span",{className:"text-[#444]",children:"·"},void 0,!1,void 0,this),W1.jsxDEV("span",{className:"flex items-center gap-1",children:[W1.jsxDEV("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:R.color}},void 0,!1,void 0,this),R.name]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),W1.jsxDEV("span",{className:`w-2 h-2 rounded-full flex-shrink-0 ${Y.status==="running"?_?"bg-green-400 animate-pulse":"bg-[#3b82f6]":"bg-[#444]"}`},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function sI(Y){let G=Math.floor((Date.now()-new Date(Y).getTime())/1000);if(G<5)return"just now";if(G<60)return`${G}s ago`;let U=Math.floor(G/60);if(U<60)return`${U}m ago`;let _=Math.floor(U/60);if(_<24)return`${_}h ago`;return`${Math.floor(_/24)}d ago`}function tI({activity:Y,agentName:G,timestamp:U}){return W1.jsxDEV("div",{className:"px-4 py-3",children:[W1.jsxDEV("p",{className:"text-sm truncate",children:Y},void 0,!1,void 0,this),W1.jsxDEV("div",{className:"flex items-center gap-2 text-xs text-[#555] mt-1",children:[W1.jsxDEV("span",{className:"text-[#666]",children:G},void 0,!1,void 0,this),W1.jsxDEV("span",{className:"text-[#444]",children:"·"},void 0,!1,void 0,this),W1.jsxDEV("span",{children:sI(U)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function eI({status:Y}){let G={pending:"bg-yellow-500/20 text-yellow-400",running:"bg-blue-500/20 text-blue-400",completed:"bg-green-500/20 text-green-400",failed:"bg-red-500/20 text-red-400",cancelled:"bg-gray-500/20 text-gray-400"};return W1.jsxDEV("span",{className:`px-2 py-0.5 rounded text-xs font-medium ${G[Y]||G.pending}`,children:Y},void 0,!1,void 0,this)}var H5=B0(V1(),1);var M0=B0(U1(),1);function k2({onSelectAgent:Y}){let{authFetch:G}=b1(),{currentProjectId:U}=R4(),[_,q]=H5.useState([]),[R,K]=H5.useState(!0),[O,T]=H5.useState("all"),[I,b]=H5.useState(null),[P,N]=H5.useState(!1),S=H5.useRef(null),{events:f}=wz({category:"TASK"}),V=H5.useCallback(async()=>{try{let A=`/api/tasks?status=${O}`;if(U!==null)A+=`&project_id=${encodeURIComponent(U)}`;let j=await(await G(A)).json();q(j.tasks||[])}catch(A){console.error("Failed to fetch tasks:",A)}finally{K(!1)}},[G,O,U]);H5.useEffect(()=>{V()},[V]),H5.useEffect(()=>{if(!f.length)return;let A=f[0];if(!A||A.id===S.current)return;let E=A.type;if(E==="task_created"||E==="task_updated"||E==="task_deleted")S.current=A.id,console.log("[TasksPage] Telemetry event:",E),V()},[f,V]);let x=H5.useCallback(async(A)=>{b(A),N(!0);try{let E=await G(`/api/tasks/${A.agentId}/${A.id}`);if(console.log("[TasksPage] Fetch task response status:",E.status),E.ok){let j=await E.json();if(console.log("[TasksPage] Task data:",j),console.log("[TasksPage] Has trajectory:",!!j.task?.trajectory,"Length:",j.task?.trajectory?.length),j.task)b({...j.task,agentId:A.agentId,agentName:A.agentName})}else console.error("[TasksPage] Failed to fetch task:",E.status,await E.text())}catch(E){console.error("Failed to fetch task details:",E)}finally{N(!1)}},[G]),v={pending:"bg-yellow-500/20 text-yellow-400",running:"bg-blue-500/20 text-blue-400",completed:"bg-green-500/20 text-green-400",failed:"bg-red-500/20 text-red-400",cancelled:"bg-gray-500/20 text-gray-400"};return M0.jsxDEV("div",{className:"flex-1 flex overflow-hidden",children:[M0.jsxDEV("div",{className:`flex-1 p-4 md:p-6 overflow-auto ${I?"hidden md:block md:w-1/2 lg:w-2/3":""}`,children:M0.jsxDEV("div",{className:"max-w-4xl",children:[M0.jsxDEV("div",{className:"mb-6",children:[M0.jsxDEV("div",{className:"mb-4",children:[M0.jsxDEV("h1",{className:"text-xl md:text-2xl font-semibold mb-1",children:"Tasks"},void 0,!1,void 0,this),M0.jsxDEV("p",{className:"text-sm text-[#666]",children:"View tasks from all running agents"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M0.jsxDEV("div",{className:"flex gap-2 overflow-x-auto scrollbar-hide pb-1",children:[{value:"all",label:"All"},{value:"pending",label:"Pending"},{value:"running",label:"Running"},{value:"completed",label:"Completed"},{value:"failed",label:"Failed"}].map((A)=>M0.jsxDEV("button",{onClick:()=>T(A.value),className:`px-3 py-1.5 rounded text-sm transition whitespace-nowrap ${O===A.value?"bg-[#f97316] text-black":"bg-[#1a1a1a] hover:bg-[#222]"}`,children:A.label},A.value,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),R?M0.jsxDEV("div",{className:"text-center py-12 text-[#666]",children:"Loading tasks..."},void 0,!1,void 0,this):_.length===0?M0.jsxDEV("div",{className:"text-center py-12",children:[M0.jsxDEV(u5,{className:"w-12 h-12 mx-auto mb-4 text-[#333]"},void 0,!1,void 0,this),M0.jsxDEV("p",{className:"text-[#666]",children:"No tasks found"},void 0,!1,void 0,this),M0.jsxDEV("p",{className:"text-sm text-[#444] mt-1",children:"Tasks will appear here when agents create them"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):M0.jsxDEV("div",{className:"space-y-3",children:_.map((A)=>M0.jsxDEV("div",{onClick:()=>x(A),className:`bg-[#111] border rounded-lg p-4 cursor-pointer transition ${I?.id===A.id&&I?.agentId===A.agentId?"border-[#f97316]":"border-[#1a1a1a] hover:border-[#333]"}`,children:[M0.jsxDEV("div",{className:"flex items-start justify-between mb-2",children:[M0.jsxDEV("div",{className:"flex-1",children:[M0.jsxDEV("h3",{className:"font-medium",children:A.title},void 0,!1,void 0,this),M0.jsxDEV("p",{className:"text-sm text-[#666]",children:[A.agentName,A.execute_at&&M0.jsxDEV("span",{className:"ml-2",children:["· Scheduled: ",new Date(A.execute_at).toLocaleString()]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),M0.jsxDEV("span",{className:`px-2 py-1 rounded text-xs font-medium ${v[A.status]||v.pending}`,children:A.status},void 0,!1,void 0,this)]},void 0,!0,void 0,this),A.description&&M0.jsxDEV("p",{className:"text-sm text-[#888] mb-2 line-clamp-2",children:A.description},void 0,!1,void 0,this),M0.jsxDEV("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-[#555]",children:[M0.jsxDEV("span",{children:["Type: ",A.type]},void 0,!0,void 0,this),M0.jsxDEV("span",{children:["Priority: ",A.priority]},void 0,!0,void 0,this),A.recurrence&&M0.jsxDEV("span",{children:["Recurrence: ",A.recurrence]},void 0,!0,void 0,this),M0.jsxDEV("span",{children:["Created: ",new Date(A.created_at).toLocaleString()]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},`${A.agentId}-${A.id}`,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),I&&M0.jsxDEV(zT,{task:I,statusColors:v,onClose:()=>b(null),onSelectAgent:Y,loading:P},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function zT({task:Y,statusColors:G,onClose:U,onSelectAgent:_,loading:q}){return M0.jsxDEV("div",{className:"w-full md:w-1/2 lg:w-1/3 border-l border-[#1a1a1a] bg-[#0a0a0a] flex flex-col overflow-hidden",children:[M0.jsxDEV("div",{className:"flex items-center justify-between p-4 border-b border-[#1a1a1a]",children:[M0.jsxDEV("h2",{className:"font-medium truncate pr-2",children:"Task Details"},void 0,!1,void 0,this),M0.jsxDEV("button",{onClick:U,className:"text-[#666] hover:text-[#e0e0e0] transition",children:M0.jsxDEV(E5,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M0.jsxDEV("div",{className:"flex-1 overflow-auto p-4 space-y-4",children:[M0.jsxDEV("div",{children:[M0.jsxDEV("div",{className:"flex items-start justify-between gap-2 mb-2",children:[M0.jsxDEV("h3",{className:"text-lg font-medium",children:Y.title},void 0,!1,void 0,this),M0.jsxDEV("span",{className:`px-2 py-1 rounded text-xs font-medium flex-shrink-0 ${G[Y.status]}`,children:Y.status},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M0.jsxDEV("button",{onClick:()=>_?.(Y.agentId),className:"text-sm text-[#f97316] hover:underline",children:Y.agentName},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y.description&&M0.jsxDEV("div",{children:[M0.jsxDEV("h4",{className:"text-xs text-[#666] uppercase tracking-wider mb-1",children:"Description"},void 0,!1,void 0,this),M0.jsxDEV("p",{className:"text-sm text-[#888] whitespace-pre-wrap",children:Y.description},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M0.jsxDEV("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[M0.jsxDEV("div",{children:[M0.jsxDEV("span",{className:"text-[#666]",children:"Type"},void 0,!1,void 0,this),M0.jsxDEV("p",{className:"capitalize",children:Y.type},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M0.jsxDEV("div",{children:[M0.jsxDEV("span",{className:"text-[#666]",children:"Priority"},void 0,!1,void 0,this),M0.jsxDEV("p",{children:Y.priority},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M0.jsxDEV("div",{children:[M0.jsxDEV("span",{className:"text-[#666]",children:"Source"},void 0,!1,void 0,this),M0.jsxDEV("p",{className:"capitalize",children:Y.source},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y.recurrence&&M0.jsxDEV("div",{children:[M0.jsxDEV("span",{className:"text-[#666]",children:"Recurrence"},void 0,!1,void 0,this),M0.jsxDEV("p",{children:Y.recurrence},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),M0.jsxDEV("div",{className:"space-y-2 text-sm",children:[M0.jsxDEV("div",{className:"flex justify-between",children:[M0.jsxDEV("span",{className:"text-[#666]",children:"Created"},void 0,!1,void 0,this),M0.jsxDEV("span",{children:new Date(Y.created_at).toLocaleString()},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y.execute_at&&M0.jsxDEV("div",{className:"flex justify-between",children:[M0.jsxDEV("span",{className:"text-[#666]",children:"Scheduled"},void 0,!1,void 0,this),M0.jsxDEV("span",{children:new Date(Y.execute_at).toLocaleString()},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y.executed_at&&M0.jsxDEV("div",{className:"flex justify-between",children:[M0.jsxDEV("span",{className:"text-[#666]",children:"Started"},void 0,!1,void 0,this),M0.jsxDEV("span",{children:new Date(Y.executed_at).toLocaleString()},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y.completed_at&&M0.jsxDEV("div",{className:"flex justify-between",children:[M0.jsxDEV("span",{className:"text-[#666]",children:"Completed"},void 0,!1,void 0,this),M0.jsxDEV("span",{children:new Date(Y.completed_at).toLocaleString()},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y.next_run&&M0.jsxDEV("div",{className:"flex justify-between",children:[M0.jsxDEV("span",{className:"text-[#666]",children:"Next Run"},void 0,!1,void 0,this),M0.jsxDEV("span",{children:new Date(Y.next_run).toLocaleString()},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Y.status==="failed"&&Y.error&&M0.jsxDEV("div",{className:"min-w-0",children:[M0.jsxDEV("h4",{className:"text-xs text-red-400 uppercase tracking-wider mb-1",children:"Error"},void 0,!1,void 0,this),M0.jsxDEV("div",{className:"bg-red-500/10 border border-red-500/20 rounded p-3 overflow-x-auto",children:M0.jsxDEV("pre",{className:"text-sm text-red-400 whitespace-pre-wrap break-words",children:Y.error},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y.status==="completed"&&Y.result&&M0.jsxDEV("div",{className:"min-w-0",children:[M0.jsxDEV("h4",{className:"text-xs text-green-400 uppercase tracking-wider mb-1",children:"Result"},void 0,!1,void 0,this),M0.jsxDEV("div",{className:"bg-green-500/10 border border-green-500/20 rounded p-3 overflow-x-auto",children:M0.jsxDEV("pre",{className:"text-sm text-green-400 whitespace-pre-wrap break-words",children:typeof Y.result==="string"?Y.result:JSON.stringify(Y.result,null,2)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q&&!Y.trajectory&&M0.jsxDEV("div",{children:[M0.jsxDEV("h4",{className:"text-xs text-[#666] uppercase tracking-wider mb-2",children:"Trajectory"},void 0,!1,void 0,this),M0.jsxDEV("div",{className:"text-sm text-[#555]",children:"Loading trajectory..."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y.trajectory&&Y.trajectory.length>0&&M0.jsxDEV("div",{children:[M0.jsxDEV("h4",{className:"text-xs text-[#666] uppercase tracking-wider mb-2",children:["Trajectory (",Y.trajectory.length," steps)"]},void 0,!0,void 0,this),M0.jsxDEV(QT,{trajectory:Y.trajectory},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function QT({trajectory:Y}){let[G,U]=H5.useState(new Set),_=(K)=>{U((O)=>{let T=new Set(O);if(T.has(K))T.delete(K);else T.add(K);return T})},q={user:{bg:"bg-blue-500/10",text:"text-blue-400",icon:"\uD83D\uDC64",label:"User"},assistant:{bg:"bg-purple-500/10",text:"text-purple-400",icon:"\uD83E\uDD16",label:"Assistant"}},R=(K)=>{let O=K.content;if(typeof O==="string"){let T=O.length>200,I=G.has(K.id);return M0.jsxDEV("div",{children:[M0.jsxDEV("p",{className:`text-sm text-[#ccc] whitespace-pre-wrap break-words ${!I&&T?"line-clamp-4":""}`,children:O},void 0,!1,void 0,this),T&&M0.jsxDEV("button",{onClick:()=>_(K.id),className:"text-xs text-[#666] hover:text-[#888] mt-1",children:I?"Show less":"Show more..."},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}return M0.jsxDEV("div",{className:"space-y-2",children:O.map((T,I)=>{if(T.type==="tool_use"){let b=JSON.stringify(T.input,null,2),P=b.length>150,N=`${K.id}-${I}`,S=G.has(N);return M0.jsxDEV("div",{className:"bg-orange-500/10 border border-orange-500/20 rounded p-2",children:[M0.jsxDEV("div",{className:"flex items-center gap-2 mb-1",children:[M0.jsxDEV("span",{className:"text-orange-400",children:"\uD83D\uDD27"},void 0,!1,void 0,this),M0.jsxDEV("span",{className:"text-xs font-medium text-orange-400",children:"Tool Call"},void 0,!1,void 0,this),M0.jsxDEV("span",{className:"text-xs text-[#888]",children:T.name},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M0.jsxDEV("pre",{className:`text-xs text-[#888] overflow-x-auto ${!S&&P?"line-clamp-3":""}`,children:b},void 0,!1,void 0,this),P&&M0.jsxDEV("button",{onClick:()=>_(N),className:"text-xs text-[#666] hover:text-[#888] mt-1",children:S?"Show less":"Show more..."},void 0,!1,void 0,this)]},I,!0,void 0,this)}if(T.type==="tool_result"){let b=T.is_error,P=`${K.id}-${I}`,N=G.has(P),S=T.content.length>150;return M0.jsxDEV("div",{className:`${b?"bg-red-500/10 border-red-500/20":"bg-teal-500/10 border-teal-500/20"} border rounded p-2`,children:[M0.jsxDEV("div",{className:"flex items-center gap-2 mb-1",children:[M0.jsxDEV("span",{children:b?"❌":"\uD83D\uDCCB"},void 0,!1,void 0,this),M0.jsxDEV("span",{className:`text-xs font-medium ${b?"text-red-400":"text-teal-400"}`,children:"Tool Result"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M0.jsxDEV("pre",{className:`text-xs text-[#888] overflow-x-auto whitespace-pre-wrap break-words ${!N&&S?"line-clamp-3":""}`,children:T.content},void 0,!1,void 0,this),S&&M0.jsxDEV("button",{onClick:()=>_(P),className:"text-xs text-[#666] hover:text-[#888] mt-1",children:N?"Show less":"Show more..."},void 0,!1,void 0,this)]},I,!0,void 0,this)}return null})},void 0,!1,void 0,this)};return M0.jsxDEV("div",{className:"space-y-2",children:Y.map((K)=>{let O=q[K.role]||q.assistant;return M0.jsxDEV("div",{className:`${O.bg} border border-[#1a1a1a] rounded overflow-hidden p-3`,children:[M0.jsxDEV("div",{className:"flex items-center gap-2 mb-2",children:[M0.jsxDEV("span",{children:O.icon},void 0,!1,void 0,this),M0.jsxDEV("span",{className:`text-xs font-medium ${O.text}`,children:O.label},void 0,!1,void 0,this),K.model&&M0.jsxDEV("span",{className:"text-xs text-[#555]",children:["· ",K.model]},void 0,!0,void 0,this),M0.jsxDEV("span",{className:"text-xs text-[#555]",children:["· ",new Date(K.created_at).toLocaleTimeString()]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),R(K)]},K.id,!0,void 0,this)})},void 0,!1,void 0,this)}var r0=B0(V1(),1);var t4=B0(V1(),1);var I0=B0(U1(),1);function GG(Y){return Y.authSchemes.some((G)=>G.toUpperCase()==="API_KEY")}function NK(Y){return Y.authSchemes.some((G)=>G.toUpperCase()==="OAUTH2")}function XT(Y){return GG(Y)&&NK(Y)}function qG({providerId:Y="composio",projectId:G,onConnectionComplete:U}){let{authFetch:_}=b1(),[q,R]=t4.useState([]),[K,O]=t4.useState([]),[T,I]=t4.useState(!0),[b,P]=t4.useState(""),[N,S]=t4.useState(null),[f,V]=t4.useState(null),[x,v]=t4.useState(null),[p,A]=t4.useState(null),[E,j]=t4.useState(null),[u,r]=t4.useState(""),[i,d]=t4.useState(null),[D,Q0]=t4.useState(""),[n,G0]=t4.useState(!1),[F0,K0]=t4.useState(null),[S0,P0]=t4.useState(null),a=t4.useCallback(async()=>{I(!0),v(null);let m=G&&G!=="unassigned"?`?project_id=${G}`:"";try{let[N0,V0]=await Promise.all([_(`/api/integrations/${Y}/apps${m}`),_(`/api/integrations/${Y}/connected${m}`)]),L1=await N0.json(),o1=await V0.json();R(L1.apps||[]),O(o1.accounts||[])}catch(N0){console.error("Failed to fetch integrations:",N0),v("Failed to load integrations")}I(!1)},[_,Y,G]);t4.useEffect(()=>{a()},[a]),t4.useEffect(()=>{if(new URLSearchParams(window.location.search).get("connected"))window.history.replaceState({},"",window.location.pathname),a(),U?.()},[a,U]),t4.useEffect(()=>{if(!f?.connectionId)return;let m=G&&G!=="unassigned"?`?project_id=${G}`:"",N0=setInterval(async()=>{try{let L1=await(await _(`/api/integrations/${Y}/connection/${f.connectionId}${m}`)).json();if(L1.connection?.status==="active")V(null),S(null),a(),U?.();else if(L1.connection?.status==="failed")V(null),S(null),v(`Connection to ${f.appSlug} failed`)}catch(V0){}},2000);return()=>clearInterval(N0)},[f,_,Y,G,a,U]);let Y0=async(m,N0,V0)=>{if(XT(m)&&!N0&&!V0){A({app:m});return}if(GG(m)&&!N0&&!V0){j({app:m}),r("");return}S(m.slug),v(null);try{let L1={appSlug:m.slug};if(N0)L1.credentials={authScheme:"API_KEY",apiKey:N0};let o1=G&&G!=="unassigned"?`?project_id=${G}`:"",R1=await _(`/api/integrations/${Y}/connect${o1}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(L1)}),A0=await R1.json();if(!R1.ok){v(A0.error||"Failed to initiate connection"),S(null),j(null);return}if(A0.status==="active"||!A0.redirectUrl){S(null),j(null),a(),U?.();return}if(A0.redirectUrl){V({appSlug:m.slug,connectionId:A0.connectionId});let Z1=window.open(A0.redirectUrl,`connect-${m.slug}`,"width=600,height=700,left=200,top=100");if(!Z1||Z1.closed)window.location.href=A0.redirectUrl}}catch(L1){v(`Failed to connect: ${L1}`),S(null),j(null)}},U0=(m)=>{if(m.preventDefault(),!E||!u.trim())return;Y0(E.app,u.trim())},H0=async(m)=>{let N0=G&&G!=="unassigned"?`?project_id=${G}`:"";try{let V0=await _(`/api/integrations/${Y}/connection/${m.id}${N0}`,{method:"DELETE"});if(V0.ok)a();else{let L1=await V0.json();v(L1.error||"Failed to disconnect")}}catch(V0){v(`Failed to disconnect: ${V0}`)}},y0=(m)=>{d({app:m}),Q0(`${m.name} MCP`),K0(null)},z0=async()=>{if(!i||!D.trim())return;G0(!0),v(null);try{let m=G&&G!=="unassigned"?`?project_id=${G}`:"",N0=await _(`/api/integrations/${Y}/configs${m}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:D.replace(/[^a-zA-Z0-9\s-]/g,"").substring(0,30),toolkitSlug:i.app.slug})}),V0=await N0.json();if(!N0.ok){v(V0.error||"Failed to create MCP config"),G0(!1);return}K0(D),U?.()}catch(m){v(`Failed to create MCP config: ${m}`)}finally{G0(!1)}},v0=(m)=>{P0({message:`Disconnect ${m.appName}?`,onConfirm:()=>{H0(m),P0(null)}})},p0=(m)=>{return K.some((N0)=>N0.appId===m&&N0.status==="active")},Y1=(m)=>{return K.find((N0)=>N0.appId===m)},m0=q.filter((m)=>{if(!b)return!0;let N0=b.toLowerCase();return m.name.toLowerCase().includes(N0)||m.slug.toLowerCase().includes(N0)||m.description?.toLowerCase().includes(N0)||m.categories.some((V0)=>V0.toLowerCase().includes(N0))}),$1=m0.filter((m)=>p0(m.slug)),v1=m0.filter((m)=>!p0(m.slug));if(T)return I0.jsxDEV("div",{className:"text-center py-8 text-[#666]",children:"Loading apps..."},void 0,!1,void 0,this);return I0.jsxDEV("div",{className:"space-y-6",children:[p&&I0.jsxDEV("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:I0.jsxDEV("div",{className:"bg-[#111] border border-[#333] rounded-lg p-6 w-full max-w-md mx-4",children:[I0.jsxDEV("div",{className:"flex items-center gap-3 mb-4",children:[p.app.logo&&I0.jsxDEV("img",{src:p.app.logo,alt:p.app.name,className:"w-10 h-10 object-contain"},void 0,!1,void 0,this),I0.jsxDEV("div",{children:[I0.jsxDEV("h3",{className:"font-medium",children:["Connect ",p.app.name]},void 0,!0,void 0,this),I0.jsxDEV("p",{className:"text-xs text-[#666]",children:"Choose how to authenticate"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),I0.jsxDEV("div",{className:"space-y-3",children:[I0.jsxDEV("button",{onClick:()=>{A(null),j({app:p.app}),r("")},className:"w-full text-left p-3 bg-[#0a0a0a] hover:bg-[#1a1a1a] border border-[#333] hover:border-[#f97316] rounded-lg transition",children:[I0.jsxDEV("div",{className:"font-medium text-sm",children:"API Key"},void 0,!1,void 0,this),I0.jsxDEV("div",{className:"text-xs text-[#666] mt-0.5",children:["Enter your ",p.app.name," API key directly"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),I0.jsxDEV("button",{onClick:()=>{A(null),Y0(p.app,void 0,!0)},className:"w-full text-left p-3 bg-[#0a0a0a] hover:bg-[#1a1a1a] border border-[#333] hover:border-[#f97316] rounded-lg transition",children:[I0.jsxDEV("div",{className:"font-medium text-sm",children:"OAuth"},void 0,!1,void 0,this),I0.jsxDEV("div",{className:"text-xs text-[#666] mt-0.5",children:["Sign in with your ",p.app.name," account"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),I0.jsxDEV("button",{onClick:()=>A(null),className:"w-full text-sm text-[#666] hover:text-white mt-4 py-2 transition",children:"Cancel"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),E&&I0.jsxDEV("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:I0.jsxDEV("div",{className:"bg-[#111] border border-[#333] rounded-lg p-6 w-full max-w-md mx-4",children:[I0.jsxDEV("div",{className:"flex items-center gap-3 mb-4",children:[E.app.logo&&I0.jsxDEV("img",{src:E.app.logo,alt:E.app.name,className:"w-10 h-10 object-contain"},void 0,!1,void 0,this),I0.jsxDEV("div",{children:[I0.jsxDEV("h3",{className:"font-medium",children:["Connect ",E.app.name]},void 0,!0,void 0,this),I0.jsxDEV("p",{className:"text-xs text-[#666]",children:"Enter your API key to connect"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),I0.jsxDEV("form",{onSubmit:U0,children:[I0.jsxDEV("input",{type:"password",value:u,onChange:(m)=>r(m.target.value),placeholder:"Enter API Key...",className:"w-full bg-[#0a0a0a] border border-[#333] rounded-lg px-4 py-2 mb-4 focus:outline-none focus:border-[#f97316]",autoFocus:!0},void 0,!1,void 0,this),I0.jsxDEV("div",{className:"flex gap-2",children:[I0.jsxDEV("button",{type:"button",onClick:()=>j(null),className:"flex-1 text-sm bg-[#1a1a1a] hover:bg-[#222] border border-[#333] px-4 py-2 rounded transition",children:"Cancel"},void 0,!1,void 0,this),I0.jsxDEV("button",{type:"submit",disabled:!u.trim()||N===E.app.slug,className:"flex-1 text-sm bg-[#f97316] hover:bg-[#ea580c] text-white px-4 py-2 rounded transition disabled:opacity-50",children:N===E.app.slug?"Connecting...":"Connect"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),i&&I0.jsxDEV("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:I0.jsxDEV("div",{className:"bg-[#111] border border-[#333] rounded-lg p-6 w-full max-w-md mx-4",children:F0?I0.jsxDEV(I0.Fragment,{children:[I0.jsxDEV("div",{className:"text-center mb-4",children:[I0.jsxDEV("div",{className:"w-12 h-12 bg-green-500/20 rounded-full flex items-center justify-center mx-auto mb-3",children:I0.jsxDEV("span",{className:"text-green-400 text-2xl",children:"✓"},void 0,!1,void 0,this)},void 0,!1,void 0,this),I0.jsxDEV("h3",{className:"font-medium text-lg",children:"MCP Config Created!"},void 0,!1,void 0,this),I0.jsxDEV("p",{className:"text-sm text-[#888] mt-2",children:['"',F0,'" has been created successfully.']},void 0,!0,void 0,this),I0.jsxDEV("p",{className:"text-xs text-[#666] mt-2",children:"You can now add it to your agents from the MCP Configs tab."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),I0.jsxDEV("button",{onClick:()=>{d(null),K0(null)},className:"w-full text-sm bg-[#f97316] hover:bg-[#ea580c] text-white px-4 py-2 rounded transition",children:"Done"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):I0.jsxDEV(I0.Fragment,{children:[I0.jsxDEV("div",{className:"flex items-center gap-3 mb-4",children:[i.app.logo&&I0.jsxDEV("img",{src:i.app.logo,alt:i.app.name,className:"w-10 h-10 object-contain"},void 0,!1,void 0,this),I0.jsxDEV("div",{children:[I0.jsxDEV("h3",{className:"font-medium",children:"Create MCP Config"},void 0,!1,void 0,this),I0.jsxDEV("p",{className:"text-xs text-[#666]",children:["Create an MCP config for ",i.app.name]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),I0.jsxDEV("form",{onSubmit:(m)=>{m.preventDefault(),z0()},children:[I0.jsxDEV("label",{className:"block text-xs text-[#888] mb-1",children:"Config Name"},void 0,!1,void 0,this),I0.jsxDEV("input",{type:"text",value:D,onChange:(m)=>Q0(m.target.value),placeholder:"Enter config name...",className:"w-full bg-[#0a0a0a] border border-[#333] rounded-lg px-4 py-2 mb-4 focus:outline-none focus:border-[#f97316]",autoFocus:!0,maxLength:30},void 0,!1,void 0,this),I0.jsxDEV("div",{className:"flex gap-2",children:[I0.jsxDEV("button",{type:"button",onClick:()=>d(null),className:"flex-1 text-sm bg-[#1a1a1a] hover:bg-[#222] border border-[#333] px-4 py-2 rounded transition",children:"Cancel"},void 0,!1,void 0,this),I0.jsxDEV("button",{type:"submit",disabled:!D.trim()||n,className:"flex-1 text-sm bg-[#f97316] hover:bg-[#ea580c] text-white px-4 py-2 rounded transition disabled:opacity-50",children:n?"Creating...":"Create Config"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),S0&&I0.jsxDEV("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:I0.jsxDEV("div",{className:"bg-[#111] border border-[#333] rounded-lg p-6 w-full max-w-sm mx-4",children:[I0.jsxDEV("p",{className:"text-center mb-4",children:S0.message},void 0,!1,void 0,this),I0.jsxDEV("div",{className:"flex gap-2",children:[I0.jsxDEV("button",{onClick:()=>P0(null),className:"flex-1 text-sm bg-[#1a1a1a] hover:bg-[#222] border border-[#333] px-4 py-2 rounded transition",children:"Cancel"},void 0,!1,void 0,this),I0.jsxDEV("button",{onClick:S0.onConfirm,className:"flex-1 text-sm bg-red-500 hover:bg-red-600 text-white px-4 py-2 rounded transition",children:"Confirm"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),x&&I0.jsxDEV("div",{className:"text-red-400 text-sm p-3 bg-red-500/10 border border-red-500/20 rounded-lg flex items-center justify-between",children:[I0.jsxDEV("span",{children:x},void 0,!1,void 0,this),I0.jsxDEV("button",{onClick:()=>v(null),className:"text-red-400 hover:text-red-300",children:"×"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),f&&I0.jsxDEV("div",{className:"text-yellow-400 text-sm p-3 bg-yellow-500/10 border border-yellow-500/20 rounded-lg flex items-center gap-2",children:[I0.jsxDEV("span",{className:"animate-spin",children:"⟳"},void 0,!1,void 0,this),I0.jsxDEV("span",{children:["Waiting for ",f.appSlug," authorization..."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),I0.jsxDEV("div",{children:I0.jsxDEV("input",{type:"text",value:b,onChange:(m)=>P(m.target.value),placeholder:"Search apps...",className:"w-full bg-[#111] border border-[#333] rounded-lg px-4 py-2 focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$1.length>0&&I0.jsxDEV("div",{children:[I0.jsxDEV("h3",{className:"text-sm font-medium text-[#888] mb-3",children:["Connected (",$1.length,")"]},void 0,!0,void 0,this),I0.jsxDEV("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:$1.map((m)=>I0.jsxDEV(RK,{app:m,connection:Y1(m.slug),onConnect:()=>Y0(m),onDisconnect:()=>{let N0=Y1(m.slug);if(N0)v0(N0)},onCreateMcpConfig:()=>y0(m),connecting:N===m.slug},m.id,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),I0.jsxDEV("div",{children:[I0.jsxDEV("h3",{className:"text-sm font-medium text-[#888] mb-3",children:["Available Apps (",v1.length,")"]},void 0,!0,void 0,this),v1.length===0?I0.jsxDEV("p",{className:"text-[#666] text-sm",children:b?"No apps match your search":"No apps available"},void 0,!1,void 0,this):I0.jsxDEV("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:v1.slice(0,50).map((m)=>I0.jsxDEV(RK,{app:m,onConnect:()=>Y0(m),connecting:N===m.slug},m.id,!1,void 0,this))},void 0,!1,void 0,this),v1.length>50&&I0.jsxDEV("p",{className:"text-xs text-[#555] mt-3 text-center",children:["Showing first 50 of ",v1.length," apps. Use search to find more."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function RK({app:Y,connection:G,onConnect:U,onDisconnect:_,onCreateMcpConfig:q,connecting:R}){let K=G?.status==="active",O=GG(Y),T=NK(Y),I=O&&T;return I0.jsxDEV("div",{className:`bg-[#111] border rounded-lg p-3 transition ${K?"border-green-500/30":"border-[#1a1a1a] hover:border-[#333]"}`,children:[I0.jsxDEV("div",{className:"flex items-start gap-3",children:[I0.jsxDEV("div",{className:"w-10 h-10 rounded bg-[#1a1a1a] flex items-center justify-center flex-shrink-0 overflow-hidden",children:Y.logo?I0.jsxDEV("img",{src:Y.logo,alt:Y.name,className:"w-8 h-8 object-contain",onError:(b)=>{b.target.style.display="none"}},void 0,!1,void 0,this):I0.jsxDEV("span",{className:"text-lg",children:Y.name[0]?.toUpperCase()},void 0,!1,void 0,this)},void 0,!1,void 0,this),I0.jsxDEV("div",{className:"flex-1 min-w-0",children:[I0.jsxDEV("div",{className:"flex items-center gap-2",children:[I0.jsxDEV("h4",{className:"font-medium text-sm truncate",children:Y.name},void 0,!1,void 0,this),K&&I0.jsxDEV("span",{className:"text-xs text-green-400",children:"✓"},void 0,!1,void 0,this),!K&&O&&!T&&I0.jsxDEV("span",{className:"text-[10px] bg-[#222] text-[#888] px-1.5 py-0.5 rounded",title:"Requires API Key",children:"API Key"},void 0,!1,void 0,this),!K&&I&&I0.jsxDEV("span",{className:"text-[10px] bg-[#1a2a1a] text-[#6a6] px-1.5 py-0.5 rounded",title:"Supports API Key or OAuth",children:"API Key / OAuth"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y.description&&I0.jsxDEV("p",{className:"text-xs text-[#666] line-clamp-2 mt-0.5",children:Y.description},void 0,!1,void 0,this),Y.categories.length>0&&I0.jsxDEV("div",{className:"flex flex-wrap gap-1 mt-1",children:Y.categories.slice(0,2).map((b)=>I0.jsxDEV("span",{className:"text-[10px] bg-[#1a1a1a] text-[#555] px-1.5 py-0.5 rounded",children:b},b,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),I0.jsxDEV("div",{className:"mt-3 flex gap-2",children:K?I0.jsxDEV(I0.Fragment,{children:[q&&I0.jsxDEV("button",{onClick:q,className:"flex-1 text-xs bg-[#1a2a1a] hover:bg-[#1a3a1a] border border-green-500/30 hover:border-green-500/50 text-green-400 px-3 py-1.5 rounded transition",children:"Create MCP Config"},void 0,!1,void 0,this),_&&I0.jsxDEV("button",{onClick:_,className:"text-xs text-[#666] hover:text-red-400 transition px-2",title:"Disconnect",children:"×"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):I0.jsxDEV("button",{onClick:U,disabled:R,className:"w-full text-xs bg-[#1a1a1a] hover:bg-[#222] border border-[#333] hover:border-[#f97316] px-3 py-1.5 rounded transition disabled:opacity-50",children:R?"Connecting...":O&&!T?"Enter API Key":"Connect"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var M=B0(U1(),1);function C2(){let{authFetch:Y}=b1(),{projects:G,currentProjectId:U}=R4(),[_,q]=r0.useState([]),[R,K]=r0.useState(!0),[O,T]=r0.useState(!1),[I,b]=r0.useState(null),[P,N]=r0.useState(null),[S,f]=r0.useState("servers"),{confirm:V,ConfirmDialog:x}=o7(),v=G.length>0,p=async()=>{try{let D=await(await Y("/api/mcp/servers")).json();q(D.servers||[])}catch(d){console.error("Failed to fetch MCP servers:",d)}K(!1)};r0.useEffect(()=>{p()},[Y]);let A=_.filter((d)=>{if(!U)return!0;if(U==="unassigned")return d.project_id===null;return d.project_id===null||d.project_id===U}),E=async(d)=>{try{await Y(`/api/mcp/servers/${d}/start`,{method:"POST"}),p()}catch(D){console.error("Failed to start server:",D)}},j=async(d)=>{try{await Y(`/api/mcp/servers/${d}/stop`,{method:"POST"}),p()}catch(D){console.error("Failed to stop server:",D)}},u=async(d)=>{if(!await V("Delete this MCP server?",{confirmText:"Delete",title:"Delete Server"}))return;try{if(await Y(`/api/mcp/servers/${d}`,{method:"DELETE"}),P?.id===d)N(null);p()}catch(Q0){console.error("Failed to delete server:",Q0)}},r=async(d,D)=>{try{await Y(`/api/mcp/servers/${d}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:D})}),p()}catch(Q0){console.error("Failed to rename server:",Q0)}},i=async(d,D)=>{try{await Y(`/api/mcp/servers/${d}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(D)}),p()}catch(Q0){throw console.error("Failed to update server:",Q0),Q0}};return M.jsxDEV(M.Fragment,{children:[x,M.jsxDEV("div",{className:"flex-1 overflow-auto p-6",children:[M.jsxDEV("div",{className:"max-w-6xl",children:[M.jsxDEV("div",{className:"flex items-center justify-between mb-6",children:[M.jsxDEV("div",{children:[M.jsxDEV("h1",{className:"text-2xl font-semibold mb-1",children:"MCP Servers"},void 0,!1,void 0,this),M.jsxDEV("p",{className:"text-[#666]",children:"Manage Model Context Protocol servers for tool integrations."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),S==="servers"&&M.jsxDEV("button",{onClick:()=>T(!0),className:"bg-[#f97316] hover:bg-[#fb923c] text-black px-4 py-2 rounded font-medium transition",children:"+ Add Server"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV("div",{className:"flex gap-1 mb-6 bg-[#111] border border-[#1a1a1a] rounded-lg p-1 w-fit",children:[M.jsxDEV("button",{onClick:()=>f("servers"),className:`px-4 py-2 rounded text-sm font-medium transition ${S==="servers"?"bg-[#1a1a1a] text-white":"text-[#666] hover:text-[#888]"}`,children:"My Servers"},void 0,!1,void 0,this),M.jsxDEV("button",{onClick:()=>f("hosted"),className:`px-4 py-2 rounded text-sm font-medium transition ${S==="hosted"?"bg-[#1a1a1a] text-white":"text-[#666] hover:text-[#888]"}`,children:"Hosted Services"},void 0,!1,void 0,this),M.jsxDEV("button",{onClick:()=>f("registry"),className:`px-4 py-2 rounded text-sm font-medium transition ${S==="registry"?"bg-[#1a1a1a] text-white":"text-[#666] hover:text-[#888]"}`,children:"Browse Registry"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),S==="servers"&&M.jsxDEV(M.Fragment,{children:[R&&M.jsxDEV("div",{className:"text-center py-8 text-[#666]",children:"Loading..."},void 0,!1,void 0,this),!R&&A.length===0&&_.length===0&&M.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg p-8 text-center",children:[M.jsxDEV(x5,{className:"w-12 h-12 text-[#333] mx-auto mb-4"},void 0,!1,void 0,this),M.jsxDEV("h3",{className:"text-lg font-medium mb-2",children:"No MCP servers configured"},void 0,!1,void 0,this),M.jsxDEV("p",{className:"text-[#666] mb-6 max-w-md mx-auto",children:"MCP servers extend your agents with tools like file access, web browsing, database connections, and more."},void 0,!1,void 0,this),M.jsxDEV("div",{className:"flex gap-3 justify-center",children:[M.jsxDEV("button",{onClick:()=>T(!0),className:"bg-[#f97316] hover:bg-[#fb923c] text-black px-4 py-2 rounded font-medium transition",children:"Add Manually"},void 0,!1,void 0,this),M.jsxDEV("button",{onClick:()=>f("registry"),className:"border border-[#333] hover:border-[#666] px-4 py-2 rounded font-medium transition",children:"Browse Registry"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),!R&&A.length===0&&_.length>0&&M.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg p-6 text-center",children:M.jsxDEV("p",{className:"text-[#666]",children:"No servers match this filter."},void 0,!1,void 0,this)},void 0,!1,void 0,this),!R&&A.length>0&&M.jsxDEV("div",{className:"flex gap-6",children:[M.jsxDEV("div",{className:`space-y-3 ${P?"w-1/2":"w-full"}`,children:A.map((d)=>{let Q0=d.type==="http"&&d.url||d.status==="running",n=v&&d.project_id?G.find((G0)=>G0.id===d.project_id):null;return M.jsxDEV(ZT,{server:d,project:n,selected:P?.id===d.id,onSelect:()=>N(Q0?d:null),onStart:()=>E(d.id),onStop:()=>j(d.id),onDelete:()=>u(d.id),onEdit:()=>b(d)},d.id,!1,void 0,this)})},void 0,!1,void 0,this),P&&M.jsxDEV("div",{className:"w-1/2",children:M.jsxDEV(JT,{server:P,onClose:()=>N(null)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),S==="hosted"&&M.jsxDEV(HT,{onServerAdded:p,projectId:U},void 0,!1,void 0,this),S==="registry"&&M.jsxDEV($T,{onInstall:(d)=>{p(),f("servers")}},void 0,!1,void 0,this),S==="servers"&&M.jsxDEV("div",{className:"mt-8 p-4 bg-[#111] border border-[#1a1a1a] rounded-lg",children:[M.jsxDEV("h3",{className:"font-medium mb-2",children:"Quick Start"},void 0,!1,void 0,this),M.jsxDEV("p",{className:"text-sm text-[#666] mb-3",children:"Add an MCP server by providing its npm package name. For example:"},void 0,!1,void 0,this),M.jsxDEV("div",{className:"flex flex-wrap gap-2",children:[{name:"filesystem",pkg:"@modelcontextprotocol/server-filesystem"},{name:"fetch",pkg:"@modelcontextprotocol/server-fetch"},{name:"memory",pkg:"@modelcontextprotocol/server-memory"}].map((d)=>M.jsxDEV("code",{className:"text-xs bg-[#0a0a0a] px-2 py-1 rounded",children:d.pkg},d.name,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),O&&M.jsxDEV(UT,{onClose:()=>T(!1),onAdded:()=>{T(!1),p()},projects:v?G:void 0,defaultProjectId:U&&U!=="unassigned"?U:null},void 0,!1,void 0,this),I&&M.jsxDEV(BT,{server:I,projects:v?G:void 0,onClose:()=>b(null),onSaved:()=>{b(null),p()}},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function ZT({server:Y,project:G,selected:U,onSelect:_,onStart:q,onStop:R,onDelete:K,onEdit:O}){let T=Y.type==="http"&&Y.url,I=T||Y.status==="running",b=()=>{if(T)return`${Y.source||"remote"} • http`;return`${Y.type} • ${Y.package||Y.command||"custom"}${Y.status==="running"&&Y.port?` • :${Y.port}`:""}`},P=()=>{if(G)return M.jsxDEV("span",{className:"text-xs px-1.5 py-0.5 rounded",style:{backgroundColor:`${G.color}20`,color:G.color},children:G.name},void 0,!1,void 0,this);if(Y.project_id===null)return M.jsxDEV("span",{className:"text-xs text-[#666] bg-[#1a1a1a] px-1.5 py-0.5 rounded",children:"Global"},void 0,!1,void 0,this);return null};return M.jsxDEV("div",{className:`bg-[#111] border rounded-lg p-4 cursor-pointer transition ${U?"border-[#f97316]":"border-[#1a1a1a] hover:border-[#333]"}`,onClick:I?_:void 0,children:M.jsxDEV("div",{className:"flex items-center justify-between",children:[M.jsxDEV("div",{className:"flex items-center gap-3",children:[M.jsxDEV("div",{className:`w-2 h-2 rounded-full ${I?"bg-green-400":"bg-[#444]"}`},void 0,!1,void 0,this),M.jsxDEV("div",{children:[M.jsxDEV("div",{className:"flex items-center gap-2",children:[M.jsxDEV("h3",{className:"font-medium",children:Y.name},void 0,!1,void 0,this),P()]},void 0,!0,void 0,this),M.jsxDEV("p",{className:"text-sm text-[#666]",children:b()},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV("div",{className:"flex items-center gap-2",children:[M.jsxDEV("button",{onClick:(N)=>{N.stopPropagation(),O()},className:"text-sm text-[#666] hover:text-[#888] px-3 py-1 transition",title:"Edit server settings",children:"Edit"},void 0,!1,void 0,this),T?M.jsxDEV("button",{onClick:(N)=>{N.stopPropagation(),K()},className:"text-sm text-[#666] hover:text-red-400 px-3 py-1 transition",children:"Remove"},void 0,!1,void 0,this):Y.status==="running"?M.jsxDEV(M.Fragment,{children:[M.jsxDEV("button",{onClick:(N)=>{N.stopPropagation(),_()},className:"text-sm text-[#f97316] hover:text-[#fb923c] px-3 py-1 transition",children:"Tools"},void 0,!1,void 0,this),M.jsxDEV("button",{onClick:(N)=>{N.stopPropagation(),R()},className:"text-sm text-[#666] hover:text-red-400 px-3 py-1 transition",children:"Stop"},void 0,!1,void 0,this),M.jsxDEV("button",{onClick:(N)=>{N.stopPropagation(),K()},className:"text-sm text-[#666] hover:text-red-400 px-3 py-1 transition",children:"Delete"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):M.jsxDEV(M.Fragment,{children:[M.jsxDEV("button",{onClick:(N)=>{N.stopPropagation(),q()},className:"text-sm text-[#666] hover:text-green-400 px-3 py-1 transition",children:"Start"},void 0,!1,void 0,this),M.jsxDEV("button",{onClick:(N)=>{N.stopPropagation(),K()},className:"text-sm text-[#666] hover:text-red-400 px-3 py-1 transition",children:"Delete"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function JT({server:Y,onClose:G}){let{authFetch:U}=b1(),[_,q]=r0.useState([]),[R,K]=r0.useState(null),[O,T]=r0.useState(!0),[I,b]=r0.useState(null),[P,N]=r0.useState(null);return r0.useEffect(()=>{(async()=>{T(!0),b(null);try{let f=await U(`/api/mcp/servers/${Y.id}/tools`),V=await f.json();if(!f.ok){b(V.error||"Failed to fetch tools");return}q(V.tools||[]),K(V.serverInfo||null)}catch(f){b(`Failed to fetch tools: ${f}`)}finally{T(!1)}})()},[Y.id,U]),M.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg overflow-hidden",children:[M.jsxDEV("div",{className:"p-4 border-b border-[#1a1a1a] flex items-center justify-between",children:[M.jsxDEV("div",{children:[M.jsxDEV("h3",{className:"font-medium",children:[Y.name," Tools"]},void 0,!0,void 0,this),R&&M.jsxDEV("p",{className:"text-xs text-[#666]",children:[R.name," v",R.version]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV("button",{onClick:G,className:"text-[#666] hover:text-[#888] text-xl leading-none",children:"×"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV("div",{className:"p-4 max-h-[500px] overflow-auto",children:[O&&M.jsxDEV("p",{className:"text-[#666]",children:"Loading tools..."},void 0,!1,void 0,this),I&&M.jsxDEV("div",{className:"text-red-400 text-sm p-3 bg-red-500/10 rounded",children:I},void 0,!1,void 0,this),!O&&!I&&_.length===0&&M.jsxDEV("p",{className:"text-[#666]",children:"No tools available from this server."},void 0,!1,void 0,this),!O&&!I&&_.length>0&&!P&&M.jsxDEV("div",{className:"space-y-2",children:_.map((S)=>M.jsxDEV("button",{onClick:()=>N(S),className:"w-full text-left p-3 bg-[#0a0a0a] hover:bg-[#1a1a1a] border border-[#222] hover:border-[#333] rounded transition",children:[M.jsxDEV("div",{className:"font-medium text-sm",children:S.name},void 0,!1,void 0,this),S.description&&M.jsxDEV("div",{className:"text-xs text-[#666] mt-1",children:S.description},void 0,!1,void 0,this)]},S.name,!0,void 0,this))},void 0,!1,void 0,this),P&&M.jsxDEV(YT,{serverId:Y.id,tool:P,onBack:()=>N(null)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function YT({serverId:Y,tool:G,onBack:U}){let{authFetch:_}=b1(),[q,R]=r0.useState("{}"),[K,O]=r0.useState(null),[T,I]=r0.useState(null),[b,P]=r0.useState(!1);r0.useEffect(()=>{let S=G.inputSchema;if(S&&typeof S==="object"&&"properties"in S){let f=S.properties,V={};for(let[x,v]of Object.entries(f))if(v.default!==void 0)V[x]=v.default;else if(v.type==="string")V[x]="";else if(v.type==="number"||v.type==="integer")V[x]=0;else if(v.type==="boolean")V[x]=!1;else if(v.type==="array")V[x]=[];else if(v.type==="object")V[x]={};R(JSON.stringify(V,null,2))}},[G]);let N=async()=>{P(!0),I(null),O(null);try{let S=JSON.parse(q),f=await _(`/api/mcp/servers/${Y}/tools/${encodeURIComponent(G.name)}/call`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({arguments:S})}),V=await f.json();if(!f.ok){I(V.error||"Failed to call tool");return}O(V.result)}catch(S){I(`Error: ${S}`)}finally{P(!1)}};return M.jsxDEV("div",{className:"space-y-4",children:[M.jsxDEV("div",{className:"flex items-center gap-2",children:[M.jsxDEV("button",{onClick:U,className:"text-[#666] hover:text-[#888] text-sm",children:"← Back"},void 0,!1,void 0,this),M.jsxDEV("span",{className:"text-[#444]",children:"/"},void 0,!1,void 0,this),M.jsxDEV("span",{className:"font-medium",children:G.name},void 0,!1,void 0,this)]},void 0,!0,void 0,this),G.description&&M.jsxDEV("p",{className:"text-sm text-[#666]",children:G.description},void 0,!1,void 0,this),G.inputSchema&&M.jsxDEV("div",{className:"text-xs",children:M.jsxDEV("details",{className:"cursor-pointer",children:[M.jsxDEV("summary",{className:"text-[#666] hover:text-[#888]",children:"Input Schema"},void 0,!1,void 0,this),M.jsxDEV("pre",{className:"mt-2 p-2 bg-[#0a0a0a] rounded text-[#888] overflow-auto max-h-32",children:JSON.stringify(G.inputSchema,null,2)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),M.jsxDEV("div",{children:[M.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"Arguments (JSON)"},void 0,!1,void 0,this),M.jsxDEV("textarea",{value:q,onChange:(S)=>R(S.target.value),className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-3 py-2 h-32 font-mono text-sm focus:outline-none focus:border-[#f97316] resize-none",placeholder:"{}"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV("button",{onClick:N,disabled:b,className:"w-full bg-[#f97316] hover:bg-[#fb923c] disabled:opacity-50 text-black px-4 py-2 rounded font-medium transition",children:b?"Calling...":"Call Tool"},void 0,!1,void 0,this),T&&M.jsxDEV("div",{className:"text-red-400 text-sm p-3 bg-red-500/10 rounded",children:T},void 0,!1,void 0,this),K&&M.jsxDEV("div",{className:"space-y-2",children:[M.jsxDEV("div",{className:"text-sm text-[#666]",children:["Result ",K.isError&&M.jsxDEV("span",{className:"text-red-400",children:"(error)"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV("div",{className:`p-3 rounded text-sm ${K.isError?"bg-red-500/10":"bg-green-500/10"}`,children:K.content.map((S,f)=>M.jsxDEV("div",{className:"mb-2 last:mb-0",children:[S.type==="text"&&M.jsxDEV("pre",{className:"whitespace-pre-wrap font-mono text-xs",children:S.text},void 0,!1,void 0,this),S.type==="image"&&S.data&&M.jsxDEV("img",{src:`data:${S.mimeType||"image/png"};base64,${S.data}`,alt:"Tool result",className:"max-w-full rounded"},void 0,!1,void 0,this)]},f,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function $T({onInstall:Y}){let{authFetch:G}=b1(),[U,_]=r0.useState(""),[q,R]=r0.useState([]),[K,O]=r0.useState(!1),[T,I]=r0.useState(!1),[b,P]=r0.useState(null),[N,S]=r0.useState(null),f=async(v)=>{O(!0),S(null);try{let p=await G(`/api/mcp/registry?search=${encodeURIComponent(v)}&limit=20`),A=await p.json();if(!p.ok)S(A.error||"Failed to search registry"),R([]);else R(A.servers||[])}catch(p){S(`Failed to search: ${p}`),R([])}finally{O(!1),I(!0)}},V=(v)=>{if(v.preventDefault(),U.trim())f(U.trim())};r0.useEffect(()=>{f("")},[]);let x=async(v)=>{if(!v.npmPackage){S("This server does not have an npm package");return}P(v.id),S(null);try{let p=await G("/api/mcp/servers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:v.name,type:"npm",package:v.npmPackage})});if(!p.ok){let A=await p.json();S(A.error||"Failed to add server");return}Y(v)}catch(p){S(`Failed to add server: ${p}`)}finally{P(null)}};return M.jsxDEV("div",{className:"space-y-6",children:[M.jsxDEV("form",{onSubmit:V,className:"flex gap-2",children:[M.jsxDEV("input",{type:"text",value:U,onChange:(v)=>_(v.target.value),placeholder:"Search MCP servers (e.g., filesystem, github, slack...)",className:"flex-1 bg-[#111] border border-[#333] rounded-lg px-4 py-3 focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this),M.jsxDEV("button",{type:"submit",disabled:K,className:"bg-[#f97316] hover:bg-[#fb923c] disabled:opacity-50 text-black px-6 py-3 rounded-lg font-medium transition",children:K?"...":"Search"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),N&&M.jsxDEV("div",{className:"text-red-400 text-sm p-3 bg-red-500/10 border border-red-500/20 rounded-lg",children:N},void 0,!1,void 0,this),!K&&T&&q.length===0&&M.jsxDEV("div",{className:"text-center py-8 text-[#666]",children:"No servers found. Try a different search term."},void 0,!1,void 0,this),q.length>0&&M.jsxDEV("div",{className:"grid gap-4 md:grid-cols-2",children:q.map((v)=>M.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg p-4 hover:border-[#333] transition",children:M.jsxDEV("div",{className:"flex items-start justify-between gap-3",children:[M.jsxDEV("div",{className:"flex-1 min-w-0",children:[M.jsxDEV("h3",{className:"font-medium truncate",children:v.name},void 0,!1,void 0,this),M.jsxDEV("p",{className:"text-sm text-[#666] mt-1 line-clamp-2",children:v.description||"No description"},void 0,!1,void 0,this),M.jsxDEV("div",{className:"flex items-center gap-2 mt-2 text-xs text-[#555]",children:[v.version&&M.jsxDEV("span",{children:["v",v.version]},void 0,!0,void 0,this),M.jsxDEV("span",{className:`px-1.5 py-0.5 rounded ${v.npmPackage?"bg-green-500/10 text-green-400":"bg-blue-500/10 text-blue-400"}`,children:v.npmPackage?"npm":"remote"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV("code",{className:"text-xs text-[#555] bg-[#0a0a0a] px-2 py-0.5 rounded mt-2 inline-block truncate max-w-full",children:v.npmPackage||v.fullName},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV("div",{className:"flex-shrink-0",children:v.npmPackage?M.jsxDEV("button",{onClick:()=>x(v),disabled:b===v.id,className:"text-sm bg-[#1a1a1a] hover:bg-[#222] border border-[#333] hover:border-[#f97316] px-3 py-1.5 rounded transition disabled:opacity-50",children:b===v.id?"Adding...":"Add"},void 0,!1,void 0,this):v.repository?M.jsxDEV("a",{href:v.repository,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-[#666] hover:text-[#f97316] transition",children:"View →"},void 0,!1,void 0,this):null},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},v.id,!1,void 0,this))},void 0,!1,void 0,this),K&&M.jsxDEV("div",{className:"text-center py-8 text-[#666]",children:"Searching registry..."},void 0,!1,void 0,this),M.jsxDEV("div",{className:"p-4 bg-[#111] border border-[#1a1a1a] rounded-lg text-sm text-[#666]",children:M.jsxDEV("p",{children:["Servers are sourced from the"," ",M.jsxDEV("a",{href:"https://github.com/modelcontextprotocol/servers",target:"_blank",rel:"noopener noreferrer",className:"text-[#f97316] hover:underline",children:"official MCP registry"},void 0,!1,void 0,this),". Not all servers have npm packages - some require manual setup."]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function HT({onServerAdded:Y,projectId:G}){let{authFetch:U}=b1(),[_,q]=r0.useState("composio"),[R,K]=r0.useState("configs"),[O,T]=r0.useState(!1),[I,b]=r0.useState(!1),[P,N]=r0.useState(!1),[S,f]=r0.useState([]),[V,x]=r0.useState(new Set),[v,p]=r0.useState(!0),[A,E]=r0.useState(!1),[j,u]=r0.useState(null),{alert:r,AlertDialog:i}=DZ(),d=async()=>{try{let[K0,S0]=await Promise.all([U("/api/providers"),U("/api/mcp/servers")]),P0=await K0.json(),a=await S0.json(),Y0=P0.providers||[],U0=a.servers||[],H0=new Set(U0.filter(($1)=>$1.source==="composio"&&$1.url).map(($1)=>{let v1=$1.url.match(/\/v3\/mcp\/([^/]+)/);return v1?v1[1]:null}).filter(Boolean));x(H0);let y0=Y0.find(($1)=>$1.id==="composio"),z0=Y0.find(($1)=>$1.id==="smithery"),v0=Y0.find(($1)=>$1.id==="agentdojo"),p0=y0?.hasKey||!1,Y1=z0?.hasKey||!1,m0=v0?.hasKey||!1;if(T(p0),b(Y1),N(m0),p0)q("composio"),D();else if(Y1)q("smithery");else if(m0)q("agentdojo")}catch(K0){console.error("Failed to fetch providers:",K0)}p(!1)},D=async()=>{E(!0);try{let K0=G&&G!=="unassigned"?`?project_id=${G}`:"",P0=await(await U(`/api/integrations/composio/configs${K0}`)).json();f(P0.configs||[])}catch(K0){console.error("Failed to fetch Composio configs:",K0)}E(!1)},Q0=async(K0)=>{u(K0);try{let S0=G&&G!=="unassigned"?`?project_id=${G}`:"",P0=await U(`/api/integrations/composio/configs/${K0}/add${S0}`,{method:"POST"});if(P0.ok)x((a)=>new Set([...a,K0])),Y?.();else{let a=await P0.json();await r(a.error||"Failed to add config",{title:"Error",variant:"error"})}}catch(S0){console.error("Failed to add config:",S0)}u(null)},n=(K0)=>{return V.has(K0)};if(r0.useEffect(()=>{d()},[U]),v)return M.jsxDEV("div",{className:"text-center py-8 text-[#666]",children:"Loading..."},void 0,!1,void 0,this);let G0=O||I||P,F0=[O,I,P].filter(Boolean).length;if(!G0)return M.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg p-8 text-center",children:[M.jsxDEV("p",{className:"text-[#888] mb-2",children:"No hosted MCP services connected"},void 0,!1,void 0,this),M.jsxDEV("p",{className:"text-sm text-[#666] mb-4",children:"Connect Composio, Smithery, or AgentDojo in Settings to access cloud-based MCP servers."},void 0,!1,void 0,this),M.jsxDEV("a",{href:"/settings",className:"inline-block bg-[#1a1a1a] hover:bg-[#222] border border-[#333] hover:border-[#f97316] px-4 py-2 rounded text-sm font-medium transition",children:"Go to Settings →"},void 0,!1,void 0,this)]},void 0,!0,void 0,this);return M.jsxDEV(M.Fragment,{children:[i,M.jsxDEV("div",{className:"space-y-6",children:[F0>1&&M.jsxDEV("div",{className:"flex gap-1 bg-[#0a0a0a] border border-[#222] rounded-lg p-1 w-fit",children:[O&&M.jsxDEV("button",{onClick:()=>{q("composio"),K("configs")},className:`px-4 py-2 rounded text-sm font-medium transition flex items-center gap-2 ${_==="composio"?"bg-[#1a1a1a] text-white":"text-[#666] hover:text-[#888]"}`,children:[M.jsxDEV("span",{className:"w-2 h-2 rounded-full bg-purple-500"},void 0,!1,void 0,this),"Composio"]},void 0,!0,void 0,this),I&&M.jsxDEV("button",{onClick:()=>q("smithery"),className:`px-4 py-2 rounded text-sm font-medium transition flex items-center gap-2 ${_==="smithery"?"bg-[#1a1a1a] text-white":"text-[#666] hover:text-[#888]"}`,children:[M.jsxDEV("span",{className:"w-2 h-2 rounded-full bg-blue-500"},void 0,!1,void 0,this),"Smithery"]},void 0,!0,void 0,this),P&&M.jsxDEV("button",{onClick:()=>q("agentdojo"),className:`px-4 py-2 rounded text-sm font-medium transition flex items-center gap-2 ${_==="agentdojo"?"bg-[#1a1a1a] text-white":"text-[#666] hover:text-[#888]"}`,children:[M.jsxDEV("span",{className:"w-2 h-2 rounded-full bg-green-500"},void 0,!1,void 0,this),"AgentDojo"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),O&&(F0===1||_==="composio")&&M.jsxDEV(M.Fragment,{children:[M.jsxDEV("div",{className:"flex items-center justify-between",children:[M.jsxDEV("div",{className:"flex gap-1 bg-[#0a0a0a] border border-[#222] rounded-lg p-1",children:[M.jsxDEV("button",{onClick:()=>K("configs"),className:`px-4 py-2 rounded text-sm font-medium transition ${R==="configs"?"bg-[#1a1a1a] text-white":"text-[#666] hover:text-[#888]"}`,children:"MCP Configs"},void 0,!1,void 0,this),M.jsxDEV("button",{onClick:()=>K("connect"),className:`px-4 py-2 rounded text-sm font-medium transition ${R==="connect"?"bg-[#1a1a1a] text-white":"text-[#666] hover:text-[#888]"}`,children:"Connect Apps"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F0===1&&M.jsxDEV("div",{className:"flex items-center gap-2 text-xs text-[#666]",children:[M.jsxDEV("span",{className:"w-2 h-2 rounded-full bg-purple-500"},void 0,!1,void 0,this),"Composio",M.jsxDEV("span",{className:"text-green-400",children:"Connected"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),R==="connect"&&M.jsxDEV("div",{children:[M.jsxDEV("p",{className:"text-sm text-[#666] mb-4",children:"Connect your accounts to enable tools in MCP configs"},void 0,!1,void 0,this),M.jsxDEV(qG,{providerId:"composio",projectId:G,onConnectionComplete:()=>{D()}},void 0,!1,void 0,this)]},void 0,!0,void 0,this),R==="configs"&&M.jsxDEV("div",{children:[M.jsxDEV("div",{className:"flex items-center justify-between mb-3",children:[M.jsxDEV("p",{className:"text-sm text-[#666]",children:"Your MCP configs from Composio"},void 0,!1,void 0,this),M.jsxDEV("div",{className:"flex items-center gap-3",children:[M.jsxDEV("button",{onClick:D,disabled:A,className:"text-xs text-[#666] hover:text-[#888] transition",children:A?"Loading...":"Refresh"},void 0,!1,void 0,this),M.jsxDEV("a",{href:"https://app.composio.dev/mcp_configs",target:"_blank",rel:"noopener noreferrer",className:"text-xs text-[#666] hover:text-[#f97316] transition",children:"Create Config →"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),A?M.jsxDEV("div",{className:"text-center py-6 text-[#666]",children:"Loading configs..."},void 0,!1,void 0,this):S.length===0?M.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg p-4 text-center",children:[M.jsxDEV("p",{className:"text-sm text-[#666]",children:"No MCP configs found"},void 0,!1,void 0,this),M.jsxDEV("p",{className:"text-xs text-[#555] mt-2",children:["First ",M.jsxDEV("button",{onClick:()=>K("connect"),className:"text-[#f97316] hover:text-[#fb923c]",children:"connect some apps"},void 0,!1,void 0,this),", then create a config."]},void 0,!0,void 0,this),M.jsxDEV("a",{href:"https://app.composio.dev/mcp_configs",target:"_blank",rel:"noopener noreferrer",className:"text-xs text-[#f97316] hover:text-[#fb923c] mt-2 inline-block",children:"Create in Composio →"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):M.jsxDEV("div",{className:"space-y-2",children:S.map((K0)=>{let S0=n(K0.id),P0=j===K0.id;return M.jsxDEV("div",{className:`bg-[#111] border rounded-lg p-3 transition flex items-center justify-between ${S0?"border-green-500/30":"border-[#1a1a1a] hover:border-[#333]"}`,children:[M.jsxDEV("div",{className:"flex-1 min-w-0",children:[M.jsxDEV("div",{className:"flex items-center gap-2",children:[M.jsxDEV("span",{className:"font-medium text-sm",children:K0.name},void 0,!1,void 0,this),M.jsxDEV("span",{className:"text-xs text-[#555]",children:[K0.toolsCount," tools"]},void 0,!0,void 0,this),S0&&M.jsxDEV("span",{className:"text-xs text-green-400",children:"Added"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),K0.toolkits.length>0&&M.jsxDEV("div",{className:"flex flex-wrap gap-1 mt-1",children:[K0.toolkits.slice(0,4).map((a)=>M.jsxDEV("span",{className:"text-xs bg-[#1a1a1a] text-[#666] px-1.5 py-0.5 rounded",children:a},a,!1,void 0,this)),K0.toolkits.length>4&&M.jsxDEV("span",{className:"text-xs text-[#555]",children:["+",K0.toolkits.length-4]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV("div",{className:"flex items-center gap-2 ml-3",children:[S0?M.jsxDEV("span",{className:"text-xs text-[#555] px-2 py-1",children:"In Servers"},void 0,!1,void 0,this):M.jsxDEV("button",{onClick:()=>Q0(K0.id),disabled:P0,className:"text-xs bg-[#f97316] hover:bg-[#fb923c] text-black px-3 py-1 rounded font-medium transition disabled:opacity-50",children:P0?"Adding...":"Add"},void 0,!1,void 0,this),M.jsxDEV("a",{href:`https://app.composio.dev/mcp_configs/${K0.id}`,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-[#666] hover:text-[#888] transition",children:"Edit"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},K0.id,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),I&&(F0===1||_==="smithery")&&M.jsxDEV("div",{children:[F0===1&&M.jsxDEV("div",{className:"flex items-center gap-2 text-xs text-[#666] mb-4",children:[M.jsxDEV("span",{className:"w-2 h-2 rounded-full bg-blue-500"},void 0,!1,void 0,this),"Smithery",M.jsxDEV("span",{className:"text-green-400",children:"Connected"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV("div",{className:"flex items-center justify-between mb-3",children:[M.jsxDEV("p",{className:"text-sm text-[#666]",children:"Add MCP servers from the Smithery registry"},void 0,!1,void 0,this),M.jsxDEV("a",{href:"https://smithery.ai/servers",target:"_blank",rel:"noopener noreferrer",className:"text-xs text-[#666] hover:text-[#f97316] transition",children:"Browse Smithery →"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg p-4 text-center",children:[M.jsxDEV("p",{className:"text-sm text-[#666]",children:["Smithery servers can be added from the ",M.jsxDEV("strong",{children:"Browse Registry"},void 0,!1,void 0,this)," tab."]},void 0,!0,void 0,this),M.jsxDEV("p",{className:"text-xs text-[#555] mt-2",children:"Your API key will be used automatically when adding Smithery servers."},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),P&&(F0===1||_==="agentdojo")&&M.jsxDEV(GT,{projectId:G,onServerAdded:Y,showProviderBadge:F0===1},void 0,!1,void 0,this),M.jsxDEV("div",{className:"p-3 bg-[#0a0a0a] border border-[#222] rounded text-xs text-[#666]",children:[M.jsxDEV("strong",{className:"text-[#888]",children:"Tip:"},void 0,!1,void 0,this)," Connect apps first, then add MCP configs to make tools available to your agents."," · ",M.jsxDEV("a",{href:"/settings",className:"text-[#f97316] hover:text-[#fb923c]",children:"Add more providers in Settings"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function GT({projectId:Y,onServerAdded:G,showProviderBadge:U}){let{authFetch:_}=b1(),[q,R]=r0.useState("configs"),[K,O]=r0.useState([]),[T,I]=r0.useState(new Set),[b,P]=r0.useState(!1),[N,S]=r0.useState(null),{alert:f,AlertDialog:V}=DZ(),x=async()=>{P(!0);try{let A=Y&&Y!=="unassigned"?`?project_id=${Y}`:"",[E,j]=await Promise.all([_(`/api/integrations/agentdojo/configs${A}`),_("/api/mcp/servers")]),u=await E.json(),r=await j.json();O(u.configs||[]);let i=new Set((r.servers||[]).filter((d)=>d.source==="agentdojo").map((d)=>{let D=d.url?.match(/\/mcp\/([^/?]+)/);return D?D[1]:d.name}));I(i)}catch(A){console.error("Failed to fetch AgentDojo configs:",A)}P(!1)},v=async(A)=>{S(A);try{let E=Y&&Y!=="unassigned"?`?project_id=${Y}`:"",j=await _(`/api/integrations/agentdojo/configs/${A}/add${E}`,{method:"POST"});if(j.ok){let u=K.find((r)=>r.id===A);I((r)=>new Set([...r,u?.slug||A])),G?.()}else{let u=await j.json();await f(u.error||"Failed to add config",{title:"Error",variant:"error"})}}catch(E){console.error("Failed to add config:",E)}S(null)},p=(A)=>{return T.has(A.slug)||T.has(A.id)||T.has(A.name)};return r0.useEffect(()=>{x()},[_,Y]),M.jsxDEV(M.Fragment,{children:[V,M.jsxDEV("div",{children:[U&&M.jsxDEV("div",{className:"flex items-center gap-2 text-xs text-[#666] mb-4",children:[M.jsxDEV("span",{className:"w-2 h-2 rounded-full bg-green-500"},void 0,!1,void 0,this),"AgentDojo",M.jsxDEV("span",{className:"text-green-400",children:"Connected"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV("div",{className:"flex items-center justify-between mb-4",children:M.jsxDEV("div",{className:"flex gap-1 bg-[#0a0a0a] border border-[#222] rounded-lg p-1",children:[M.jsxDEV("button",{onClick:()=>R("configs"),className:`px-4 py-2 rounded text-sm font-medium transition ${q==="configs"?"bg-[#1a1a1a] text-white":"text-[#666] hover:text-[#888]"}`,children:"MCP Servers"},void 0,!1,void 0,this),M.jsxDEV("button",{onClick:()=>R("toolkits"),className:`px-4 py-2 rounded text-sm font-medium transition ${q==="toolkits"?"bg-[#1a1a1a] text-white":"text-[#666] hover:text-[#888]"}`,children:"Browse Toolkits"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),q==="configs"&&M.jsxDEV("div",{children:[M.jsxDEV("div",{className:"flex items-center justify-between mb-3",children:[M.jsxDEV("p",{className:"text-sm text-[#666]",children:"Your MCP servers from AgentDojo"},void 0,!1,void 0,this),M.jsxDEV("button",{onClick:x,disabled:b,className:"text-xs text-[#666] hover:text-[#888] transition",children:b?"Loading...":"Refresh"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),b?M.jsxDEV("div",{className:"text-center py-6 text-[#666]",children:"Loading servers..."},void 0,!1,void 0,this):K.length===0?M.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg p-4 text-center",children:[M.jsxDEV("p",{className:"text-sm text-[#666]",children:"No MCP servers found"},void 0,!1,void 0,this),M.jsxDEV("p",{className:"text-xs text-[#555] mt-2",children:[M.jsxDEV("button",{onClick:()=>R("toolkits"),className:"text-[#f97316] hover:text-[#fb923c]",children:"Browse toolkits"},void 0,!1,void 0,this)," ","to create a new MCP server."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):M.jsxDEV("div",{className:"space-y-2",children:K.map((A)=>{let E=p(A),j=N===A.id;return M.jsxDEV("div",{className:`bg-[#111] border rounded-lg p-3 transition flex items-center justify-between ${E?"border-green-500/30":"border-[#1a1a1a] hover:border-[#333]"}`,children:[M.jsxDEV("div",{className:"flex-1 min-w-0",children:[M.jsxDEV("div",{className:"flex items-center gap-2",children:[M.jsxDEV("span",{className:"font-medium text-sm",children:A.name},void 0,!1,void 0,this),M.jsxDEV("span",{className:"text-xs text-[#555]",children:[A.toolsCount," tools"]},void 0,!0,void 0,this),E&&M.jsxDEV("span",{className:"text-xs text-green-400",children:"Added"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),A.mcpUrl&&M.jsxDEV("code",{className:"text-xs text-[#555] mt-1 block truncate",children:A.mcpUrl},void 0,!1,void 0,this),!A.mcpUrl&&A.slug&&M.jsxDEV("code",{className:"text-xs text-[#555] mt-1 block truncate",children:A.slug},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV("div",{className:"flex items-center gap-2 ml-3",children:E?M.jsxDEV("span",{className:"text-xs text-[#555] px-2 py-1",children:"In Servers"},void 0,!1,void 0,this):M.jsxDEV("button",{onClick:()=>v(A.id),disabled:j,className:"text-xs bg-[#f97316] hover:bg-[#fb923c] text-black px-3 py-1 rounded font-medium transition disabled:opacity-50",children:j?"Adding...":"Add"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},A.id,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q==="toolkits"&&M.jsxDEV("div",{children:[M.jsxDEV("p",{className:"text-sm text-[#666] mb-4",children:"Browse available toolkits and create MCP servers"},void 0,!1,void 0,this),M.jsxDEV(qG,{providerId:"agentdojo",projectId:Y,onConnectionComplete:()=>{x()}},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function qT(Y){let G=[],U=Y,_=null,q=Y.match(/(?:npx\s+-y\s+)?(@?[\w-]+\/)?(@?[\w-]+)(?:@[\w.-]+)?/);if(q){let O=q[2]||q[1];if(O)_=O.replace(/^@/,"").replace(/-mcp$/,"").replace(/-server$/,"").replace(/^server-/,"").replace(/^mcp-/,"")}let R=/--(\w+[-\w]*)\s+(YOUR_\w+|<[\w_]+>|\{[\w_]+\}|\$[\w_]+|[\w_]*(?:TOKEN|KEY|SECRET|PASSWORD|USER|ID|APIKEY)[\w_]*)/gi,K;while((K=R.exec(Y))!==null){let O=K[1],T=K[2],I=O.toUpperCase().replace(/-/g,"_"),b=_?`${_.toUpperCase().replace(/-/g,"_")}_${I}`:I;G.push({key:b,flag:O}),U=U.replace(new RegExp(`(--${O}\\s+)${T.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}`,"i"),`--${O} $${b}`)}return{cleanCommand:U,credentials:G,serverName:_}}function UT({onClose:Y,onAdded:G,projects:U,defaultProjectId:_}){let{authFetch:q}=b1(),[R,K]=r0.useState("npm"),[O,T]=r0.useState(""),[I,b]=r0.useState(""),[P,N]=r0.useState(""),[S,f]=r0.useState(""),[V,x]=r0.useState(""),[v,p]=r0.useState(""),[A,E]=r0.useState(""),[j,u]=r0.useState([]),[r,i]=r0.useState(_||null),[d,D]=r0.useState(!1),[Q0,n]=r0.useState(null),G0=U&&U.length>0,F0=()=>{u([...j,{key:"",value:""}])},K0=(H0,y0,z0)=>{let v0=[...j];v0[H0][y0]=z0,u(v0)},S0=(H0)=>{u(j.filter((y0,z0)=>z0!==H0))},P0=(H0)=>{if(f(H0),H0.includes("YOUR_")||H0.includes("<")||H0.includes("{")||/TOKEN|KEY|SECRET|PASSWORD/i.test(H0)){let{cleanCommand:y0,credentials:z0,serverName:v0}=qT(H0);if(!O&&v0)T(v0);if(z0.length>0){let p0=new Set(j.map((m0)=>m0.key)),Y1=z0.filter((m0)=>!p0.has(m0.key)).map((m0)=>({key:m0.key,value:""}));if(Y1.length>0)u([...j,...Y1]),f(y0)}}},a=(H0)=>{if(H0.startsWith("npx ")||H0.includes(" --")||H0.includes("YOUR_")||H0.includes("<")||/\s+(TOKEN|KEY|SECRET|PASSWORD)/i.test(H0))K("command"),P0(H0);else if(b(H0),!O&&H0){let z0=H0.replace(/^@[\w-]+\//,"").replace(/@[\w.-]+$/,"").replace(/^server-/,"").replace(/-server$/,"").replace(/^mcp-/,"").replace(/-mcp$/,"");if(z0&&z0!==H0)T(z0)}},Y0=async()=>{if(!O){n("Name is required");return}if(R==="npm"&&!I){n("npm package is required");return}if(R==="pip"&&!I){n("pip package is required");return}if(R==="command"&&!S){n("Command is required");return}if(R==="http"&&!V){n("URL is required");return}D(!0),n(null);let H0={};for(let{key:y0,value:z0}of j)if(y0.trim())H0[y0.trim()]=z0;try{let y0={name:O};if(R==="npm")y0.type="npm",y0.package=I;else if(R==="pip"){if(y0.type="pip",y0.package=I,P)y0.pip_module=P}else if(R==="http"){y0.type="http",y0.url=V;let v0={"Content-Type":"application/json"};if(v&&A){let p0=btoa(`${v}:${A}`);v0.Authorization=`Basic ${p0}`}y0.headers=v0}else{let v0=S.trim().split(/\s+/);y0.type="custom",y0.command=v0[0],y0.args=v0.slice(1).join(" ")}if(Object.keys(H0).length>0)y0.env=H0;if(r)y0.project_id=r;let z0=await q("/api/mcp/servers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(y0)});if(!z0.ok){let v0=await z0.json();n(v0.error||"Failed to add server"),D(!1);return}G()}catch(y0){n("Failed to add server"),D(!1)}},U0=(H0,y0)=>{K("npm"),T(H0),b(y0)};return M.jsxDEV("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-[2px] z-50 flex items-center justify-center p-4",children:M.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg w-full max-w-lg max-h-[90vh] overflow-y-auto",children:[M.jsxDEV("div",{className:"p-4 border-b border-[#1a1a1a] flex items-center justify-between sticky top-0 bg-[#111]",children:[M.jsxDEV("h2",{className:"text-lg font-semibold",children:"Add MCP Server"},void 0,!1,void 0,this),M.jsxDEV("button",{onClick:Y,className:"text-[#666] hover:text-[#888]",children:"✕"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV("div",{className:"p-4 space-y-4",children:[M.jsxDEV("div",{children:[M.jsxDEV("p",{className:"text-sm text-[#666] mb-2",children:"Quick add:"},void 0,!1,void 0,this),M.jsxDEV("div",{className:"flex flex-wrap gap-2",children:[{name:"filesystem",pkg:"@modelcontextprotocol/server-filesystem",type:"npm"},{name:"fetch",pkg:"@modelcontextprotocol/server-fetch",type:"npm"},{name:"memory",pkg:"@modelcontextprotocol/server-memory",type:"npm"},{name:"github",pkg:"@modelcontextprotocol/server-github",type:"npm"},{name:"time",pkg:"mcp-server-time",module:"mcp_server_time",type:"pip"}].map((H0)=>M.jsxDEV("button",{onClick:()=>{if(K(H0.type),T(H0.name),b(H0.pkg),H0.type==="pip"&&"module"in H0)N(H0.module||"");else N("")},className:"text-sm bg-[#1a1a1a] hover:bg-[#222] px-3 py-1 rounded transition",children:H0.name},H0.name,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV("div",{className:"flex gap-1 bg-[#0a0a0a] border border-[#222] rounded p-1",children:[M.jsxDEV("button",{onClick:()=>K("npm"),className:`flex-1 px-2 py-1.5 rounded text-sm transition ${R==="npm"?"bg-[#1a1a1a] text-white":"text-[#666] hover:text-[#888]"}`,children:"npm"},void 0,!1,void 0,this),M.jsxDEV("button",{onClick:()=>K("pip"),className:`flex-1 px-2 py-1.5 rounded text-sm transition ${R==="pip"?"bg-[#1a1a1a] text-white":"text-[#666] hover:text-[#888]"}`,children:"pip"},void 0,!1,void 0,this),M.jsxDEV("button",{onClick:()=>K("command"),className:`flex-1 px-2 py-1.5 rounded text-sm transition ${R==="command"?"bg-[#1a1a1a] text-white":"text-[#666] hover:text-[#888]"}`,children:"Command"},void 0,!1,void 0,this),M.jsxDEV("button",{onClick:()=>K("http"),className:`flex-1 px-2 py-1.5 rounded text-sm transition ${R==="http"?"bg-[#1a1a1a] text-white":"text-[#666] hover:text-[#888]"}`,children:"HTTP"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV("div",{children:[M.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"Name"},void 0,!1,void 0,this),M.jsxDEV("input",{type:"text",value:O,onChange:(H0)=>T(H0.target.value),placeholder:"e.g., pushover",className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-3 py-2 focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),G0&&M.jsxDEV("div",{children:[M.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"Scope"},void 0,!1,void 0,this),M.jsxDEV(r4,{value:r||"",onChange:(H0)=>i(H0||null),options:[{value:"",label:"Global (all projects)"},...U.map((H0)=>({value:H0.id,label:H0.name}))],placeholder:"Select scope..."},void 0,!1,void 0,this),M.jsxDEV("p",{className:"text-xs text-[#555] mt-1",children:"Global servers are available to all agents. Project-scoped servers are only available to agents in that project."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),R==="npm"&&M.jsxDEV("div",{children:[M.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"npm Package"},void 0,!1,void 0,this),M.jsxDEV("input",{type:"text",value:I,onChange:(H0)=>a(H0.target.value),placeholder:"e.g., @modelcontextprotocol/server-filesystem or paste full command",className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-3 py-2 focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this),M.jsxDEV("p",{className:"text-xs text-[#555] mt-1",children:"Package name or paste a full npx command with credentials"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),R==="pip"&&M.jsxDEV("div",{className:"space-y-4",children:[M.jsxDEV("div",{children:[M.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"pip Package"},void 0,!1,void 0,this),M.jsxDEV("input",{type:"text",value:I,onChange:(H0)=>{if(b(H0.target.value),!P&&H0.target.value){let y0=H0.target.value.split("[")[0].replace(/-/g,".");N(y0)}},placeholder:"e.g., late-sdk[mcp]",className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-3 py-2 focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this),M.jsxDEV("p",{className:"text-xs text-[#555] mt-1",children:"Python package with extras, e.g., late-sdk[mcp] or mcp-server-time"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV("div",{children:[M.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"Module (optional)"},void 0,!1,void 0,this),M.jsxDEV("input",{type:"text",value:P,onChange:(H0)=>N(H0.target.value),placeholder:"e.g., late.mcp",className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-3 py-2 font-mono text-sm focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this),M.jsxDEV("p",{className:"text-xs text-[#555] mt-1",children:"Python module to run with -m. Auto-detected from package name if not specified."},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),R==="command"&&M.jsxDEV("div",{children:[M.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"Command"},void 0,!1,void 0,this),M.jsxDEV("input",{type:"text",value:S,onChange:(H0)=>P0(H0.target.value),placeholder:"e.g., npx -y pushover-mcp@latest start --token YOUR_TOKEN",className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-3 py-2 font-mono text-sm focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this),M.jsxDEV("p",{className:"text-xs text-[#555] mt-1",children:"Paste the full command - credentials like YOUR_TOKEN will be auto-extracted"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),R==="http"&&M.jsxDEV("div",{className:"space-y-4",children:[M.jsxDEV("div",{children:[M.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"URL"},void 0,!1,void 0,this),M.jsxDEV("input",{type:"text",value:V,onChange:(H0)=>x(H0.target.value),placeholder:"e.g., https://example.com/wp-json/mcp/v1/messages",className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-3 py-2 font-mono text-sm focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV("div",{className:"p-3 bg-[#0a0a0a] border border-[#222] rounded",children:[M.jsxDEV("p",{className:"text-xs text-[#666] mb-3",children:"Optional: Basic Auth credentials (will be encoded and stored securely)"},void 0,!1,void 0,this),M.jsxDEV("div",{className:"grid grid-cols-2 gap-3",children:[M.jsxDEV("div",{children:[M.jsxDEV("label",{className:"block text-xs text-[#555] mb-1",children:"Username"},void 0,!1,void 0,this),M.jsxDEV("input",{type:"text",value:v,onChange:(H0)=>p(H0.target.value),placeholder:"username",className:"w-full bg-[#111] border border-[#333] rounded px-3 py-2 text-sm focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV("div",{children:[M.jsxDEV("label",{className:"block text-xs text-[#555] mb-1",children:"Password"},void 0,!1,void 0,this),M.jsxDEV("input",{type:"password",value:A,onChange:(H0)=>E(H0.target.value),placeholder:"password or app key",className:"w-full bg-[#111] border border-[#333] rounded px-3 py-2 text-sm focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV("div",{children:[M.jsxDEV("div",{className:"flex items-center justify-between mb-2",children:[M.jsxDEV("label",{className:"text-sm text-[#666]",children:"Environment Variables / Credentials"},void 0,!1,void 0,this),M.jsxDEV("button",{onClick:F0,className:"text-xs text-[#f97316] hover:text-[#fb923c] transition",children:"+ Add Variable"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),j.length===0&&M.jsxDEV("p",{className:"text-xs text-[#555] bg-[#0a0a0a] border border-[#222] rounded p-3",children:"Add environment variables for API tokens and credentials. These are stored encrypted and passed to the server at startup."},void 0,!1,void 0,this),j.length>0&&M.jsxDEV("div",{className:"space-y-2",children:j.map((H0,y0)=>M.jsxDEV("div",{className:"flex gap-2",children:[M.jsxDEV("input",{type:"text",value:H0.key,onChange:(z0)=>K0(y0,"key",z0.target.value),placeholder:"KEY",className:"w-1/3 bg-[#0a0a0a] border border-[#333] rounded px-2 py-1.5 text-sm font-mono focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this),M.jsxDEV("input",{type:"password",value:H0.value,onChange:(z0)=>K0(y0,"value",z0.target.value),placeholder:"value",className:"flex-1 bg-[#0a0a0a] border border-[#333] rounded px-2 py-1.5 text-sm font-mono focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this),M.jsxDEV("button",{onClick:()=>S0(y0),className:"text-[#666] hover:text-red-400 px-2 transition",children:"✕"},void 0,!1,void 0,this)]},y0,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Q0&&M.jsxDEV("p",{className:"text-red-400 text-sm",children:Q0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV("div",{className:"p-4 border-t border-[#1a1a1a] flex justify-end gap-2 sticky bottom-0 bg-[#111]",children:[M.jsxDEV("button",{onClick:Y,className:"px-4 py-2 border border-[#333] hover:border-[#666] rounded transition",children:"Cancel"},void 0,!1,void 0,this),M.jsxDEV("button",{onClick:Y0,disabled:d||!O||(R==="npm"?!I:R==="pip"?!I:R==="http"?!V:!S),className:"px-4 py-2 bg-[#f97316] hover:bg-[#fb923c] text-black rounded font-medium transition disabled:opacity-50",children:d?"Adding...":"Add Server"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function BT({server:Y,projects:G,onClose:U,onSaved:_}){let{authFetch:q}=b1(),[R,K]=r0.useState(Y.name),[O,T]=r0.useState(Y.package||""),[I,b]=r0.useState(Y.command||""),[P,N]=r0.useState(Y.args||""),[S,f]=r0.useState(Y.url||""),[V,x]=r0.useState(()=>{let P0=Y.headers?.Authorization||"";if(P0.startsWith("Basic "))try{return atob(P0.slice(6)).split(":")[0]||""}catch{return""}return""}),[v,p]=r0.useState(()=>{let P0=Y.headers?.Authorization||"";if(P0.startsWith("Basic "))try{return atob(P0.slice(6)).split(":").slice(1).join(":")||""}catch{return""}return""}),[A,E]=r0.useState(()=>{return Object.entries(Y.env||{}).map(([P0,a])=>({key:P0,value:a}))}),[j,u]=r0.useState(Y.project_id),[r,i]=r0.useState(!1),[d,D]=r0.useState(null),Q0=G&&G.length>0,n=Y.type==="http",G0=()=>{E([...A,{key:"",value:""}])},F0=(P0,a,Y0)=>{let U0=[...A];U0[P0][a]=Y0,E(U0)},K0=(P0)=>{E(A.filter((a,Y0)=>Y0!==P0))},S0=async()=>{if(!R.trim()){D("Name is required");return}i(!0),D(null);let P0={};for(let{key:a,value:Y0}of A)if(a.trim())P0[a.trim()]=Y0;try{let a={name:R.trim(),env:P0};if(n){if(S.trim())a.url=S.trim();let U0={"Content-Type":"application/json"};if(V&&v){let H0=btoa(`${V}:${v}`);U0.Authorization=`Basic ${H0}`}a.headers=U0}else{if(Y.type==="npm"&&O.trim())a.package=O.trim();if(Y.type==="pip"&&O.trim())a.package=O.trim();if(Y.type==="custom"){if(I.trim())a.command=I.trim();if(P.trim())a.args=P.trim()}}a.project_id=j;let Y0=await q(`/api/mcp/servers/${Y.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!Y0.ok){let U0=await Y0.json();D(U0.error||"Failed to save changes"),i(!1);return}if(Y.status==="running"&&!n)try{await q(`/api/mcp/servers/${Y.id}/stop`,{method:"POST"}),await q(`/api/mcp/servers/${Y.id}/start`,{method:"POST"})}catch(U0){console.error("Failed to restart server:",U0)}_()}catch(a){D("Failed to save changes"),i(!1)}};return M.jsxDEV("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-[2px] z-50 flex items-center justify-center p-4",children:M.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg w-full max-w-lg max-h-[90vh] overflow-y-auto",children:[M.jsxDEV("div",{className:"p-4 border-b border-[#1a1a1a] flex items-center justify-between sticky top-0 bg-[#111]",children:[M.jsxDEV("h2",{className:"text-lg font-semibold",children:"Edit MCP Server"},void 0,!1,void 0,this),M.jsxDEV("button",{onClick:U,className:"text-[#666] hover:text-[#888]",children:"✕"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV("div",{className:"p-4 space-y-4",children:[M.jsxDEV("div",{className:"text-sm text-[#666] bg-[#0a0a0a] border border-[#222] rounded p-3",children:["Type: ",M.jsxDEV("span",{className:"text-[#888]",children:Y.type},void 0,!1,void 0,this),Y.package&&M.jsxDEV(M.Fragment,{children:[" • Package: ",M.jsxDEV("span",{className:"text-[#888] font-mono",children:Y.package},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y.command&&M.jsxDEV(M.Fragment,{children:[" • Command: ",M.jsxDEV("span",{className:"text-[#888] font-mono",children:Y.command},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV("div",{children:[M.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"Name"},void 0,!1,void 0,this),M.jsxDEV("input",{type:"text",value:R,onChange:(P0)=>K(P0.target.value),className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-3 py-2 focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Q0&&M.jsxDEV("div",{children:[M.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"Scope"},void 0,!1,void 0,this),M.jsxDEV(r4,{value:j||"",onChange:(P0)=>u(P0||null),options:[{value:"",label:"Global (all projects)"},...G.map((P0)=>({value:P0.id,label:P0.name}))],placeholder:"Select scope..."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y.type==="npm"&&M.jsxDEV("div",{children:[M.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"npm Package"},void 0,!1,void 0,this),M.jsxDEV("input",{type:"text",value:O,onChange:(P0)=>T(P0.target.value),className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-3 py-2 font-mono text-sm focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y.type==="pip"&&M.jsxDEV("div",{children:[M.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"pip Package"},void 0,!1,void 0,this),M.jsxDEV("input",{type:"text",value:O,onChange:(P0)=>T(P0.target.value),className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-3 py-2 font-mono text-sm focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),n&&M.jsxDEV(M.Fragment,{children:[M.jsxDEV("div",{children:[M.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"Server URL"},void 0,!1,void 0,this),M.jsxDEV("input",{type:"text",value:S,onChange:(P0)=>f(P0.target.value),placeholder:"https://example.com/mcp",className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-3 py-2 font-mono text-sm focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV("div",{children:[M.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"Authentication (Basic Auth)"},void 0,!1,void 0,this),M.jsxDEV("div",{className:"flex gap-2",children:[M.jsxDEV("input",{type:"text",value:V,onChange:(P0)=>x(P0.target.value),placeholder:"Username",className:"flex-1 bg-[#0a0a0a] border border-[#333] rounded px-3 py-2 text-sm focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this),M.jsxDEV("input",{type:"password",value:v,onChange:(P0)=>p(P0.target.value),placeholder:"Password / App Password",className:"flex-1 bg-[#0a0a0a] border border-[#333] rounded px-3 py-2 text-sm focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV("p",{className:"text-xs text-[#555] mt-1",children:"Leave empty if no authentication required"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Y.type==="custom"&&M.jsxDEV(M.Fragment,{children:[M.jsxDEV("div",{children:[M.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"Command"},void 0,!1,void 0,this),M.jsxDEV("input",{type:"text",value:I,onChange:(P0)=>b(P0.target.value),className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-3 py-2 font-mono text-sm focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV("div",{children:[M.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"Arguments"},void 0,!1,void 0,this),M.jsxDEV("input",{type:"text",value:P,onChange:(P0)=>N(P0.target.value),placeholder:"e.g., --token $TOKEN --verbose",className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-3 py-2 font-mono text-sm focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),!n&&M.jsxDEV("div",{children:[M.jsxDEV("div",{className:"flex items-center justify-between mb-2",children:[M.jsxDEV("label",{className:"text-sm text-[#666]",children:"Environment Variables / Credentials"},void 0,!1,void 0,this),M.jsxDEV("button",{onClick:G0,className:"text-xs text-[#f97316] hover:text-[#fb923c] transition",children:"+ Add Variable"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),A.length===0&&M.jsxDEV("p",{className:"text-xs text-[#555] bg-[#0a0a0a] border border-[#222] rounded p-3",children:"No environment variables configured."},void 0,!1,void 0,this),A.length>0&&M.jsxDEV("div",{className:"space-y-2",children:A.map((P0,a)=>M.jsxDEV("div",{className:"flex gap-2",children:[M.jsxDEV("input",{type:"text",value:P0.key,onChange:(Y0)=>F0(a,"key",Y0.target.value),placeholder:"KEY",className:"w-1/3 bg-[#0a0a0a] border border-[#333] rounded px-2 py-1.5 text-sm font-mono focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this),M.jsxDEV("input",{type:"password",value:P0.value,onChange:(Y0)=>F0(a,"value",Y0.target.value),placeholder:"value",className:"flex-1 bg-[#0a0a0a] border border-[#333] rounded px-2 py-1.5 text-sm font-mono focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this),M.jsxDEV("button",{onClick:()=>K0(a),className:"text-[#666] hover:text-red-400 px-2 transition",children:"✕"},void 0,!1,void 0,this)]},a,!0,void 0,this))},void 0,!1,void 0,this),M.jsxDEV("p",{className:"text-xs text-[#555] mt-2",children:Y.status==="running"?"Server will be automatically restarted to apply changes.":"Changes will take effect when the server is started."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),d&&M.jsxDEV("p",{className:"text-red-400 text-sm",children:d},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV("div",{className:"p-4 border-t border-[#1a1a1a] flex justify-end gap-2 sticky bottom-0 bg-[#111]",children:[M.jsxDEV("button",{onClick:U,className:"px-4 py-2 border border-[#333] hover:border-[#666] rounded transition",children:"Cancel"},void 0,!1,void 0,this),M.jsxDEV("button",{onClick:S0,disabled:r||!R.trim(),className:"px-4 py-2 bg-[#f97316] hover:bg-[#fb923c] text-black rounded font-medium transition disabled:opacity-50",children:r?"Saving...":"Save Changes"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}var Y4=B0(V1(),1);var s=B0(U1(),1);function UG(){let{authFetch:Y}=b1(),{projects:G,currentProjectId:U}=R4(),[_,q]=Y4.useState([]),[R,K]=Y4.useState(!0),[O,T]=Y4.useState("installed"),[I,b]=Y4.useState(!1),[P,N]=Y4.useState(!1),[S,f]=Y4.useState(null),{confirm:V,ConfirmDialog:x}=o7(),{alert:v,AlertDialog:p}=DZ(),A=G.length>0,[E,j]=Y4.useState(""),[u,r]=Y4.useState([]),[i,d]=Y4.useState(!1),[D,Q0]=Y4.useState(null),[n,G0]=Y4.useState(""),[F0,K0]=Y4.useState([]),[S0,P0]=Y4.useState(!1),[a,Y0]=Y4.useState(null),[U0,H0]=Y4.useState(null),[y0,z0]=Y4.useState(null),[v0,p0]=Y4.useState(U&&U!=="unassigned"?U:null),Y1=_.filter((A0)=>{if(!U)return!0;if(U==="unassigned")return A0.project_id===null;return A0.project_id===null||A0.project_id===U}),m0=async()=>{try{let Z1=await(await Y("/api/skills")).json();q(Z1.skills||[])}catch(A0){console.error("Failed to fetch skills:",A0)}K(!1)},$1=async(A0)=>{d(!0);try{let Z1=A0!==void 0?A0:E,S1=Z1?`/api/skills/marketplace/search?q=${encodeURIComponent(Z1)}`:"/api/skills/marketplace/featured",v4=await(await Y(S1)).json();r(v4.skills||[])}catch(Z1){console.error("Failed to search marketplace:",Z1)}d(!1)};Y4.useEffect(()=>{m0()},[Y]),Y4.useEffect(()=>{if(O==="marketplace"&&u.length===0)$1("")},[O]);let v1=async(A0)=>{try{await Y(`/api/skills/${A0}/toggle`,{method:"POST"}),m0()}catch(Z1){console.error("Failed to toggle skill:",Z1)}},m=async(A0)=>{if(!await V("Delete this skill?",{confirmText:"Delete",title:"Delete Skill"}))return;try{if(await Y(`/api/skills/${A0}`,{method:"DELETE"}),S?.id===A0)f(null);m0()}catch(S1){console.error("Failed to delete skill:",S1)}},N0=async(A0)=>{Q0(A0.id);try{let Z1=await Y(`/api/skills/marketplace/${A0.id}/install`,{method:"POST"}),S1=await Z1.json();if(Z1.ok)await v(`Installed "${A0.name}" successfully!`,{title:"Skill Installed"}),m0(),T("installed");else await v(S1.error||"Failed to install skill",{title:"Installation Failed"})}catch(Z1){console.error("Failed to install skill:",Z1),await v("Failed to install skill",{title:"Error"})}Q0(null)},V0=(A0)=>_.some((Z1)=>Z1.name===A0),L1=async(A0)=>{let Z1=A0||n;if(!Z1.trim())return;let S1="",a1="";if(Z1.includes("github.com")){let v4=Z1.match(/github\.com\/([^/]+)\/([^/]+)/);if(v4)S1=v4[1],a1=v4[2].replace(/\.git$/,"")}else if(Z1.includes("/")){let v4=Z1.split("/");S1=v4[0],a1=v4[1]}if(!S1||!a1){Y0("Invalid repo format. Use 'owner/repo' or GitHub URL");return}P0(!0),Y0(null),K0([]),H0(null);try{let v4=await Y(`/api/skills/github/${S1}/${a1}`),G4=await v4.json();if(!v4.ok){Y0(G4.error||"Failed to fetch repository"),P0(!1);return}K0(G4.skills||[]),H0(G4.repo||null)}catch(v4){Y0("Failed to fetch repository")}P0(!1)},o1=async(A0)=>{if(!U0)return;z0(A0.name);try{let Z1=await Y("/api/skills/github/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({owner:U0.owner,repo:U0.repo,skillName:A0.name,downloadUrl:A0.downloadUrl,projectId:v0})}),S1=await Z1.json();if(Z1.ok)await v(`Installed "${A0.name}" successfully!`,{title:"Skill Installed"}),m0();else await v(S1.error||"Failed to install skill",{title:"Installation Failed",variant:"error"})}catch(Z1){await v("Failed to install skill",{title:"Error",variant:"error"})}z0(null)},R1=async()=>{if(!U0||F0.length===0)return;let A0=F0.filter((a1)=>!V0(a1.name));if(A0.length===0){await v("All skills are already installed",{title:"Info"});return}if(!await V(`Install ${A0.length} skill(s) from ${U0.owner}/${U0.repo}?`,{confirmText:"Install All",title:"Install Skills"}))return;let S1=0;for(let a1 of A0){z0(a1.name);try{if((await Y("/api/skills/github/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({owner:U0.owner,repo:U0.repo,skillName:a1.name,downloadUrl:a1.downloadUrl,projectId:v0})})).ok)S1++}catch(v4){}}z0(null),m0(),await v(`Installed ${S1} of ${A0.length} skills`,{title:"Installation Complete"})};return s.jsxDEV(s.Fragment,{children:[x,p,s.jsxDEV("div",{className:"flex-1 overflow-auto p-6",children:s.jsxDEV("div",{className:"max-w-6xl",children:[s.jsxDEV("div",{className:"flex items-center justify-between mb-6",children:[s.jsxDEV("div",{children:[s.jsxDEV("h1",{className:"text-2xl font-semibold mb-1",children:"Skills"},void 0,!1,void 0,this),s.jsxDEV("p",{className:"text-[#666]",children:"Manage agent skills - instructions that teach agents how to perform tasks."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),O==="installed"&&s.jsxDEV("div",{className:"flex gap-2",children:[s.jsxDEV("button",{onClick:()=>N(!0),className:"bg-[#1a1a1a] hover:bg-[#222] text-white px-4 py-2 rounded font-medium transition border border-[#333]",children:"Import"},void 0,!1,void 0,this),s.jsxDEV("button",{onClick:()=>b(!0),className:"bg-[#f97316] hover:bg-[#fb923c] text-black px-4 py-2 rounded font-medium transition",children:"+ Create Skill"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),s.jsxDEV("div",{className:"flex gap-1 mb-6 bg-[#111] border border-[#1a1a1a] rounded-lg p-1 w-fit",children:[s.jsxDEV("button",{onClick:()=>T("installed"),className:`px-4 py-2 rounded text-sm font-medium transition ${O==="installed"?"bg-[#1a1a1a] text-white":"text-[#666] hover:text-[#888]"}`,children:["Installed (",Y1.length,")"]},void 0,!0,void 0,this),s.jsxDEV("button",{onClick:()=>T("github"),className:`px-4 py-2 rounded text-sm font-medium transition ${O==="github"?"bg-[#1a1a1a] text-white":"text-[#666] hover:text-[#888]"}`,children:"Browse GitHub"},void 0,!1,void 0,this),s.jsxDEV("button",{onClick:()=>T("marketplace"),className:`px-4 py-2 rounded text-sm font-medium transition ${O==="marketplace"?"bg-[#1a1a1a] text-white":"text-[#666] hover:text-[#888]"}`,children:"Marketplace"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),O==="installed"&&s.jsxDEV(s.Fragment,{children:R?s.jsxDEV("div",{className:"text-[#666]",children:"Loading skills..."},void 0,!1,void 0,this):_.length===0?s.jsxDEV("div",{className:"text-center py-20 text-[#666]",children:[s.jsxDEV("p",{className:"text-lg",children:"No skills installed"},void 0,!1,void 0,this),s.jsxDEV("p",{className:"text-sm mt-1",children:"Create a skill or browse the marketplace"},void 0,!1,void 0,this),s.jsxDEV("button",{onClick:()=>T("marketplace"),className:"mt-4 bg-[#f97316] hover:bg-[#fb923c] text-black px-4 py-2 rounded font-medium transition",children:"Browse Marketplace"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):Y1.length===0?s.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg p-6 text-center",children:s.jsxDEV("p",{className:"text-[#666]",children:"No skills match this filter."},void 0,!1,void 0,this)},void 0,!1,void 0,this):s.jsxDEV("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:Y1.map((A0)=>{let Z1=A&&A0.project_id?G.find((S1)=>S1.id===A0.project_id):null;return s.jsxDEV(WT,{skill:A0,project:Z1,onToggle:()=>v1(A0.id),onDelete:()=>m(A0.id),onView:()=>f(A0)},A0.id,!1,void 0,this)})},void 0,!1,void 0,this)},void 0,!1,void 0,this),O==="github"&&s.jsxDEV("div",{className:"space-y-6",children:[s.jsxDEV("form",{onSubmit:(A0)=>{A0.preventDefault(),L1()},className:"flex gap-2",children:[s.jsxDEV("input",{type:"text",value:n,onChange:(A0)=>G0(A0.target.value),placeholder:"Enter GitHub repo (e.g., WordPress/agent-skills)",className:"flex-1 bg-[#111] border border-[#333] rounded-lg px-4 py-3 focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this),s.jsxDEV("button",{type:"submit",disabled:S0,className:"bg-[#f97316] hover:bg-[#fb923c] disabled:opacity-50 text-black px-6 py-3 rounded-lg font-medium transition",children:S0?"...":"Browse"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),A&&F0.length>0&&s.jsxDEV("div",{className:"flex items-center gap-3 p-3 bg-[#0a0a0a] border border-[#222] rounded-lg",children:[s.jsxDEV("span",{className:"text-sm text-[#666]",children:"Install to:"},void 0,!1,void 0,this),s.jsxDEV(r4,{value:v0||"",onChange:(A0)=>p0(A0||null),options:[{value:"",label:"Global (all projects)"},...G.map((A0)=>({value:A0.id,label:A0.name}))],placeholder:"Select scope..."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),a&&s.jsxDEV("div",{className:"text-red-400 text-sm p-3 bg-red-500/10 border border-red-500/20 rounded-lg",children:a},void 0,!1,void 0,this),U0&&F0.length>0&&s.jsxDEV("div",{className:"flex items-center justify-between",children:[s.jsxDEV("div",{className:"flex items-center gap-3",children:[s.jsxDEV("a",{href:U0.url,target:"_blank",rel:"noopener noreferrer",className:"text-[#f97316] hover:underline font-medium",children:[U0.owner,"/",U0.repo]},void 0,!0,void 0,this),s.jsxDEV("span",{className:"text-sm text-[#666]",children:[F0.length," skill",F0.length!==1?"s":""," found"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),F0.some((A0)=>!V0(A0.name))&&s.jsxDEV("button",{onClick:R1,disabled:!!y0,className:"text-sm bg-[#1a1a1a] hover:bg-[#222] border border-[#333] hover:border-[#f97316] px-4 py-2 rounded transition disabled:opacity-50",children:"Install All"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),S0&&s.jsxDEV("div",{className:"text-center py-8 text-[#666]",children:"Fetching skills from repository..."},void 0,!1,void 0,this),!S0&&!U0&&!a&&s.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg p-8 text-center",children:[s.jsxDEV("div",{className:"text-4xl mb-4",children:"\uD83D\uDCE6"},void 0,!1,void 0,this),s.jsxDEV("h3",{className:"text-lg font-medium mb-2",children:"Browse Skills from GitHub"},void 0,!1,void 0,this),s.jsxDEV("p",{className:"text-[#666] mb-6 max-w-md mx-auto",children:"Enter a GitHub repository to browse and install skills. Skills are markdown files with instructions that teach agents how to perform specific tasks."},void 0,!1,void 0,this),s.jsxDEV("div",{className:"flex flex-wrap gap-2 justify-center",children:[{label:"WordPress Skills",repo:"WordPress/agent-skills"}].map(({label:A0,repo:Z1})=>s.jsxDEV("button",{onClick:()=>{G0(Z1),L1(Z1)},className:"text-sm bg-[#1a1a1a] hover:bg-[#222] border border-[#333] hover:border-[#f97316] px-3 py-1.5 rounded transition",children:A0},Z1,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),!S0&&U0&&F0.length===0&&s.jsxDEV("div",{className:"text-center py-8 text-[#666]",children:"No skills found in this repository. Skills should be in subdirectories with a SKILL.md file."},void 0,!1,void 0,this),F0.length>0&&s.jsxDEV("div",{className:"grid gap-4 md:grid-cols-2",children:F0.map((A0)=>{let Z1=V0(A0.name),S1=y0===A0.name;return s.jsxDEV("div",{className:`bg-[#111] border rounded-lg p-4 transition ${Z1?"border-green-500/30":"border-[#1a1a1a] hover:border-[#333]"}`,children:s.jsxDEV("div",{className:"flex items-start justify-between gap-3",children:[s.jsxDEV("div",{className:"flex-1 min-w-0",children:[s.jsxDEV("div",{className:"flex items-center gap-2",children:[s.jsxDEV("h3",{className:"font-medium truncate",children:A0.name},void 0,!1,void 0,this),Z1&&s.jsxDEV("span",{className:"text-xs text-green-400",children:"✓ Installed"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),s.jsxDEV("p",{className:"text-sm text-[#666] mt-1 line-clamp-2",children:A0.description||"No description"},void 0,!1,void 0,this),s.jsxDEV("div",{className:"flex items-center gap-2 mt-2 text-xs text-[#555]",children:[s.jsxDEV("span",{children:[(A0.size/1024).toFixed(1),"KB"]},void 0,!0,void 0,this),s.jsxDEV("span",{className:"px-1.5 py-0.5 rounded bg-blue-500/10 text-blue-400",children:"GitHub"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),s.jsxDEV("div",{className:"flex-shrink-0",children:Z1?s.jsxDEV("span",{className:"text-xs text-[#555] px-3 py-1.5",children:"Added"},void 0,!1,void 0,this):s.jsxDEV("button",{onClick:()=>o1(A0),disabled:S1,className:"text-sm bg-[#1a1a1a] hover:bg-[#222] border border-[#333] hover:border-[#f97316] px-3 py-1.5 rounded transition disabled:opacity-50",children:S1?"Installing...":"Install"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},A0.name,!1,void 0,this)})},void 0,!1,void 0,this),s.jsxDEV("div",{className:"p-4 bg-[#111] border border-[#1a1a1a] rounded-lg text-sm text-[#666]",children:s.jsxDEV("p",{children:["Skills are sourced from GitHub repositories. Each skill should be in its own directory with a"," ",s.jsxDEV("code",{className:"text-[#888] bg-[#0a0a0a] px-1 rounded",children:"SKILL.md"},void 0,!1,void 0,this)," file containing instructions."]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),O==="marketplace"&&s.jsxDEV(s.Fragment,{children:[s.jsxDEV("div",{className:"mb-6",children:s.jsxDEV("div",{className:"flex gap-2",children:[s.jsxDEV("input",{type:"text",value:E,onChange:(A0)=>j(A0.target.value),onKeyDown:(A0)=>A0.key==="Enter"&&$1(),placeholder:"Search skills...",className:"flex-1 bg-[#111] border border-[#1a1a1a] rounded px-4 py-2 focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this),s.jsxDEV("button",{onClick:()=>$1(),disabled:i,className:"bg-[#1a1a1a] hover:bg-[#222] text-white px-4 py-2 rounded font-medium transition border border-[#333]",children:i?"...":"Search"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),i?s.jsxDEV("div",{className:"text-[#666]",children:"Loading..."},void 0,!1,void 0,this):u.length===0?s.jsxDEV("div",{className:"text-center py-20 text-[#666]",children:[s.jsxDEV("p",{className:"text-lg",children:"No skills found"},void 0,!1,void 0,this),s.jsxDEV("p",{className:"text-sm mt-1",children:"Try a different search term"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):s.jsxDEV("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:u.map((A0)=>s.jsxDEV(OT,{skill:A0,installed:V0(A0.name),installing:D===A0.id,onInstall:()=>N0(A0)},A0.id,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),I&&s.jsxDEV(KT,{authFetch:Y,onClose:()=>b(!1),onCreated:()=>{b(!1),m0()},projects:A?G:void 0,defaultProjectId:U&&U!=="unassigned"?U:null},void 0,!1,void 0,this),P&&s.jsxDEV(_T,{authFetch:Y,onClose:()=>N(!1),onImported:()=>{N(!1),m0()}},void 0,!1,void 0,this),S&&s.jsxDEV(LT,{skill:S,authFetch:Y,onClose:()=>f(null),onUpdated:()=>{f(null),m0()}},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function WT({skill:Y,project:G,onToggle:U,onDelete:_,onView:q}){let R={local:"Local",skillsmp:"SkillsMP",github:"GitHub",import:"Imported"}[Y.source],K=()=>{if(G)return s.jsxDEV("span",{className:"text-xs px-1.5 py-0.5 rounded",style:{backgroundColor:`${G.color}20`,color:G.color},children:G.name},void 0,!1,void 0,this);if(Y.project_id===null)return s.jsxDEV("span",{className:"text-xs text-[#666] bg-[#1a1a1a] px-1.5 py-0.5 rounded",children:"Global"},void 0,!1,void 0,this);return null};return s.jsxDEV("div",{className:`bg-[#111] rounded-lg p-5 border transition cursor-pointer ${Y.enabled?"border-[#1a1a1a]":"border-[#1a1a1a] opacity-60"} hover:border-[#333]`,onClick:q,children:[s.jsxDEV("div",{className:"flex items-start justify-between mb-3",children:[s.jsxDEV("div",{className:"flex-1 min-w-0",children:[s.jsxDEV("div",{className:"flex items-center gap-2",children:[s.jsxDEV("h3",{className:"font-semibold text-lg truncate",children:Y.name},void 0,!1,void 0,this),K()]},void 0,!0,void 0,this),s.jsxDEV("p",{className:"text-xs text-[#666] flex items-center gap-2 mt-0.5",children:[s.jsxDEV("span",{className:`px-1.5 py-0.5 rounded text-[10px] ${Y.source==="skillsmp"?"bg-purple-500/20 text-purple-400":Y.source==="github"?"bg-blue-500/20 text-blue-400":"bg-[#222] text-[#888]"}`,children:R},void 0,!1,void 0,this),Y.metadata?.version&&s.jsxDEV("span",{children:["v",Y.metadata.version]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),s.jsxDEV("button",{onClick:(O)=>{O.stopPropagation(),U()},className:`w-10 h-5 rounded-full transition-colors relative ${Y.enabled?"bg-[#f97316]":"bg-[#333]"}`,children:s.jsxDEV("span",{className:`absolute top-0.5 w-4 h-4 rounded-full bg-white transition-transform ${Y.enabled?"left-5":"left-0.5"}`},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),s.jsxDEV("p",{className:"text-sm text-[#888] line-clamp-2 mb-4",children:Y.description},void 0,!1,void 0,this),s.jsxDEV("div",{className:"flex items-center justify-between",children:[s.jsxDEV("div",{className:"flex gap-1 flex-wrap",children:[Y.allowed_tools.slice(0,2).map((O)=>s.jsxDEV("span",{className:"text-xs bg-[#222] px-2 py-0.5 rounded text-[#666]",children:O},O,!1,void 0,this)),Y.allowed_tools.length>2&&s.jsxDEV("span",{className:"text-xs text-[#666]",children:["+",Y.allowed_tools.length-2]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),s.jsxDEV("button",{onClick:(O)=>{O.stopPropagation(),_()},className:"text-red-400 hover:text-red-300 text-sm",children:"Delete"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function OT({skill:Y,installed:G,installing:U,onInstall:_}){return s.jsxDEV("div",{className:"bg-[#111] rounded-lg p-5 border border-[#1a1a1a] hover:border-[#333] transition",children:[s.jsxDEV("div",{className:"flex items-start justify-between mb-3",children:[s.jsxDEV("div",{className:"flex-1 min-w-0",children:[s.jsxDEV("h3",{className:"font-semibold text-lg truncate",children:Y.name},void 0,!1,void 0,this),s.jsxDEV("p",{className:"text-xs text-[#666] mt-0.5",children:["by ",Y.author," · v",Y.version]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),s.jsxDEV("div",{className:"flex items-center gap-1 text-yellow-500 text-sm",children:["★ ",Y.rating.toFixed(1)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),s.jsxDEV("p",{className:"text-sm text-[#888] line-clamp-2 mb-4",children:Y.description},void 0,!1,void 0,this),s.jsxDEV("div",{className:"flex items-center justify-between",children:[s.jsxDEV("div",{className:"flex gap-1 flex-wrap",children:Y.tags.slice(0,3).map((q)=>s.jsxDEV("span",{className:"text-xs bg-[#222] px-2 py-0.5 rounded text-[#666]",children:q},q,!1,void 0,this))},void 0,!1,void 0,this),G?s.jsxDEV("span",{className:"text-green-400 text-sm",children:"✓ Installed"},void 0,!1,void 0,this):s.jsxDEV("button",{onClick:_,disabled:U,className:"bg-[#f97316] hover:bg-[#fb923c] disabled:opacity-50 text-black px-3 py-1 rounded text-sm font-medium transition",children:U?"Installing...":"Install"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),s.jsxDEV("div",{className:"mt-3 text-xs text-[#555]",children:[Y.downloads.toLocaleString()," downloads"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function KT({authFetch:Y,onClose:G,onCreated:U,projects:_,defaultProjectId:q}){let[R,K]=Y4.useState(""),[O,T]=Y4.useState(""),[I,b]=Y4.useState(""),[P,N]=Y4.useState(q||null),[S,f]=Y4.useState(!1),[V,x]=Y4.useState(null),v=_&&_.length>0,p=async()=>{if(!R||!O||!I){x("All fields are required");return}f(!0),x(null);try{let A={name:R,description:O,content:I,source:"local"};if(P)A.project_id=P;let E=await Y("/api/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(A)}),j=await E.json();if(!E.ok){x(j.error||"Failed to create skill"),f(!1);return}U()}catch(A){x("Failed to create skill"),f(!1)}};return s.jsxDEV("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50 p-4",onClick:G,children:s.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg w-full max-w-2xl max-h-[90vh] overflow-auto",onClick:(A)=>A.stopPropagation(),children:[s.jsxDEV("div",{className:"p-6 border-b border-[#1a1a1a]",children:s.jsxDEV("h2",{className:"text-xl font-semibold",children:"Create Skill"},void 0,!1,void 0,this)},void 0,!1,void 0,this),s.jsxDEV("div",{className:"p-6 space-y-4",children:[V&&s.jsxDEV("div",{className:"bg-red-500/10 border border-red-500/30 rounded p-3 text-red-400 text-sm",children:V},void 0,!1,void 0,this),s.jsxDEV("div",{children:[s.jsxDEV("label",{className:"block text-sm text-[#888] mb-1",children:"Name"},void 0,!1,void 0,this),s.jsxDEV("input",{type:"text",value:R,onChange:(A)=>K(A.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"-")),placeholder:"my-skill-name",className:"w-full bg-[#0a0a0a] border border-[#222] rounded px-3 py-2 focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this),s.jsxDEV("p",{className:"text-xs text-[#555] mt-1",children:"Lowercase letters, numbers, and hyphens only"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),s.jsxDEV("div",{children:[s.jsxDEV("label",{className:"block text-sm text-[#888] mb-1",children:"Description"},void 0,!1,void 0,this),s.jsxDEV("input",{type:"text",value:O,onChange:(A)=>T(A.target.value),placeholder:"What this skill does and when to use it...",className:"w-full bg-[#0a0a0a] border border-[#222] rounded px-3 py-2 focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),v&&s.jsxDEV("div",{children:[s.jsxDEV("label",{className:"block text-sm text-[#888] mb-1",children:"Scope"},void 0,!1,void 0,this),s.jsxDEV(r4,{value:P||"",onChange:(A)=>N(A||null),options:[{value:"",label:"Global (all projects)"},..._.map((A)=>({value:A.id,label:A.name}))],placeholder:"Select scope..."},void 0,!1,void 0,this),s.jsxDEV("p",{className:"text-xs text-[#555] mt-1",children:"Global skills are available to all agents. Project-scoped skills are only available to agents in that project."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),s.jsxDEV("div",{children:[s.jsxDEV("label",{className:"block text-sm text-[#888] mb-1",children:"Instructions (Markdown)"},void 0,!1,void 0,this),s.jsxDEV("textarea",{value:I,onChange:(A)=>b(A.target.value),placeholder:`# Skill Instructions
|
|
217
|
+
|
|
218
|
+
Write detailed instructions here...`,rows:12,className:"w-full bg-[#0a0a0a] border border-[#222] rounded px-3 py-2 focus:outline-none focus:border-[#f97316] font-mono text-sm"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),s.jsxDEV("div",{className:"p-6 border-t border-[#1a1a1a] flex justify-end gap-3",children:[s.jsxDEV("button",{onClick:G,className:"px-4 py-2 text-[#888] hover:text-white transition",children:"Cancel"},void 0,!1,void 0,this),s.jsxDEV("button",{onClick:p,disabled:S,className:"bg-[#f97316] hover:bg-[#fb923c] disabled:opacity-50 text-black px-4 py-2 rounded font-medium transition",children:S?"Creating...":"Create Skill"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function _T({authFetch:Y,onClose:G,onImported:U}){let[_,q]=Y4.useState(""),[R,K]=Y4.useState(!1),[O,T]=Y4.useState(null);return s.jsxDEV("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50 p-4",onClick:G,children:s.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg w-full max-w-2xl max-h-[90vh] overflow-auto",onClick:(b)=>b.stopPropagation(),children:[s.jsxDEV("div",{className:"p-6 border-b border-[#1a1a1a]",children:[s.jsxDEV("h2",{className:"text-xl font-semibold",children:"Import Skill"},void 0,!1,void 0,this),s.jsxDEV("p",{className:"text-sm text-[#666] mt-1",children:"Paste the contents of a SKILL.md file"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),s.jsxDEV("div",{className:"p-6 space-y-4",children:[O&&s.jsxDEV("div",{className:"bg-red-500/10 border border-red-500/30 rounded p-3 text-red-400 text-sm",children:O},void 0,!1,void 0,this),s.jsxDEV("textarea",{value:_,onChange:(b)=>q(b.target.value),placeholder:`---
|
|
219
|
+
name: skill-name
|
|
220
|
+
description: What this skill does...
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
# Instructions
|
|
224
|
+
|
|
225
|
+
Your skill instructions here...`,rows:16,className:"w-full bg-[#0a0a0a] border border-[#222] rounded px-3 py-2 focus:outline-none focus:border-[#f97316] font-mono text-sm"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),s.jsxDEV("div",{className:"p-6 border-t border-[#1a1a1a] flex justify-end gap-3",children:[s.jsxDEV("button",{onClick:G,className:"px-4 py-2 text-[#888] hover:text-white transition",children:"Cancel"},void 0,!1,void 0,this),s.jsxDEV("button",{onClick:async()=>{if(!_.trim()){T("Paste SKILL.md content");return}K(!0),T(null);try{let b=await Y("/api/skills/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:_})}),P=await b.json();if(!b.ok){T(P.error||"Failed to import skill"),K(!1);return}U()}catch(b){T("Failed to import skill"),K(!1)}},disabled:R,className:"bg-[#f97316] hover:bg-[#fb923c] disabled:opacity-50 text-black px-4 py-2 rounded font-medium transition",children:R?"Importing...":"Import Skill"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function LT({skill:Y,authFetch:G,onClose:U,onUpdated:_}){let[q,R]=Y4.useState(!1),[K,O]=Y4.useState(Y.content),[T,I]=Y4.useState(!1),b=async()=>{I(!0);try{await G(`/api/skills/${Y.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:K})}),_()}catch(N){console.error("Failed to save:",N)}I(!1)},P=async()=>{try{let S=await(await G(`/api/skills/${Y.id}/export`)).text(),f=new Blob([S],{type:"text/markdown"}),V=URL.createObjectURL(f),x=document.createElement("a");x.href=V,x.download=`${Y.name}-SKILL.md`,x.click(),URL.revokeObjectURL(V)}catch(N){console.error("Failed to export:",N)}};return s.jsxDEV("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50 p-4",onClick:U,children:s.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg w-full max-w-3xl max-h-[90vh] overflow-auto",onClick:(N)=>N.stopPropagation(),children:[s.jsxDEV("div",{className:"p-6 border-b border-[#1a1a1a] flex items-center justify-between",children:[s.jsxDEV("div",{children:[s.jsxDEV("h2",{className:"text-xl font-semibold",children:Y.name},void 0,!1,void 0,this),s.jsxDEV("p",{className:"text-sm text-[#666] mt-0.5",children:Y.description},void 0,!1,void 0,this)]},void 0,!0,void 0,this),s.jsxDEV("div",{className:"flex gap-2",children:[s.jsxDEV("button",{onClick:P,className:"text-sm text-[#888] hover:text-white transition px-3 py-1 rounded border border-[#333]",children:"Export"},void 0,!1,void 0,this),s.jsxDEV("button",{onClick:()=>R(!q),className:"text-sm text-[#888] hover:text-white transition px-3 py-1 rounded border border-[#333]",children:q?"View":"Edit"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),s.jsxDEV("div",{className:"p-6",children:q?s.jsxDEV("textarea",{value:K,onChange:(N)=>O(N.target.value),rows:20,className:"w-full bg-[#0a0a0a] border border-[#222] rounded px-3 py-2 focus:outline-none focus:border-[#f97316] font-mono text-sm"},void 0,!1,void 0,this):s.jsxDEV("pre",{className:"bg-[#0a0a0a] border border-[#222] rounded p-4 font-mono text-sm overflow-auto max-h-[60vh] whitespace-pre-wrap",children:Y.content},void 0,!1,void 0,this)},void 0,!1,void 0,this),s.jsxDEV("div",{className:"p-6 border-t border-[#1a1a1a] flex justify-between",children:[s.jsxDEV("div",{className:"text-xs text-[#555]",children:Y.source!=="local"&&Y.source_url&&s.jsxDEV("a",{href:Y.source_url,target:"_blank",rel:"noopener noreferrer",className:"text-[#f97316] hover:underline",children:"View source →"},void 0,!1,void 0,this)},void 0,!1,void 0,this),s.jsxDEV("div",{className:"flex gap-3",children:[s.jsxDEV("button",{onClick:U,className:"px-4 py-2 text-[#888] hover:text-white transition",children:"Close"},void 0,!1,void 0,this),q&&s.jsxDEV("button",{onClick:b,disabled:T,className:"bg-[#f97316] hover:bg-[#fb923c] disabled:opacity-50 text-black px-4 py-2 rounded font-medium transition",children:T?"Saving...":"Save Changes"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}var R7=B0(V1(),1);var C0=B0(U1(),1);function BG(){let{authFetch:Y}=b1(),{currentProjectId:G}=R4(),{confirm:U,ConfirmDialog:_}=o7(),[q,R]=R7.useState([]),[K,O]=R7.useState([]),[T,I]=R7.useState(!0),[b,P]=R7.useState(!1),[N,S]=R7.useState(null),[f,V]=R7.useState(new Set),[x,v]=R7.useState(!1),[p,A]=R7.useState(null),[E,j]=R7.useState(null),[u,r]=R7.useState({}),[i,d]=R7.useState(""),[D,Q0]=R7.useState(""),[n,G0]=R7.useState(""),F0=G&&G!=="all"&&G!=="unassigned"?G:null,K0=F0?K.filter((m)=>m.projectId===F0):K,{events:S0}=wz({category:"test",limit:50}),P0=R7.useRef(new Set);R7.useEffect(()=>{for(let m of S0){if(P0.current.has(m.id))continue;P0.current.add(m.id);let N0=m.data?.test_case_id;if(!N0)continue;if(m.type==="test_started")r((V0)=>({...V0,[N0]:{phase:"starting"}})),V((V0)=>new Set(V0).add(N0));else if(m.type==="test_planning")r((V0)=>({...V0,[N0]:{phase:"planning"}}));else if(m.type==="test_executing"){let V0=m.data?.agent_name;r((L1)=>({...L1,[N0]:{phase:"executing",detail:V0}}))}else if(m.type==="test_judging")r((V0)=>({...V0,[N0]:{phase:"judging"}}));else if(m.type==="test_completed")r((V0)=>{let L1={...V0};return delete L1[N0],L1}),V((V0)=>{let L1=new Set(V0);return L1.delete(N0),L1}),a()}if(P0.current.size>500)P0.current=new Set([...P0.current].slice(-200))},[S0]);let a=async()=>{try{let m=F0?`?project_id=${F0}`:"",N0=await Y(`/api/tests${m}`);if(N0.ok)R(await N0.json())}catch{}I(!1)},Y0=async()=>{try{let m=await Y("/api/agents");if(m.ok){let N0=await m.json();O((N0.agents||N0).map((V0)=>({id:V0.id,name:V0.name,status:V0.status,provider:V0.provider,model:V0.model,projectId:V0.projectId||null})))}}catch{}};R7.useEffect(()=>{a(),Y0()},[G]);let U0=()=>{S(null),d(""),Q0(""),G0(""),P(!0)},H0=(m)=>{S(m),d(m.name),Q0(m.behavior||""),G0(m.agent_id||""),P(!0)},y0=async()=>{if(!i||!D)return;let m={name:i,behavior:D,agent_id:n||null,project_id:F0||void 0};if(N)await Y(`/api/tests/${N.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(m)});else await Y("/api/tests",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(m)});P(!1),a()},z0=async(m)=>{if(!await U("Delete this test case? Run history will also be deleted."))return;await Y(`/api/tests/${m}`,{method:"DELETE"}),a()},v0=async(m)=>{V((N0)=>new Set(N0).add(m));try{await Y(`/api/tests/${m}/run`,{method:"POST"}),await a()}catch{}V((N0)=>{let V0=new Set(N0);return V0.delete(m),V0}),r((N0)=>{let V0={...N0};return delete V0[m],V0})},p0=async()=>{v(!0);try{let m=q.map((N0)=>N0.id);V(new Set(m)),await Y("/api/tests/run",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({test_case_ids:m})}),await a()}catch{}V(new Set),v(!1)},Y1=async(m)=>{try{let N0=await Y(`/api/tests/${m}/runs`);if(N0.ok)A({testId:m,runs:await N0.json()})}catch{}},m0={starting:{label:"Starting",color:"bg-blue-900/50 text-blue-400 border-blue-500/30"},planning:{label:"Planning",color:"bg-purple-900/50 text-purple-400 border-purple-500/30"},executing:{label:"Executing",color:"bg-cyan-900/50 text-cyan-400 border-cyan-500/30"},judging:{label:"Judging",color:"bg-amber-900/50 text-amber-400 border-amber-500/30"}},$1=(m)=>{return C0.jsxDEV("span",{className:`px-2 py-0.5 rounded text-xs font-medium ${{passed:"bg-green-900/50 text-green-400",failed:"bg-red-900/50 text-red-400",error:"bg-yellow-900/50 text-yellow-400",running:"bg-blue-900/50 text-blue-400"}[m]||"bg-[#222] text-[#666]"}`,children:m.toUpperCase()},void 0,!1,void 0,this)},v1=(m)=>{let N0=u[m];if(!N0)return null;let V0=m0[N0.phase]||m0.starting;return C0.jsxDEV("span",{className:`inline-flex items-center gap-1.5 px-2 py-0.5 rounded text-xs font-medium border ${V0.color} animate-pulse`,children:[C0.jsxDEV("span",{className:"w-1.5 h-1.5 rounded-full bg-current"},void 0,!1,void 0,this),V0.label,N0.detail?` · ${N0.detail}`:""]},void 0,!0,void 0,this)};return C0.jsxDEV("div",{className:"flex-1 overflow-auto p-6",children:[_,C0.jsxDEV("div",{className:"flex items-center justify-between mb-6",children:[C0.jsxDEV("div",{children:[C0.jsxDEV("h1",{className:"text-xl font-bold",children:"Tests"},void 0,!1,void 0,this),C0.jsxDEV("p",{className:"text-sm text-[#666] mt-1",children:"Describe behavior, AI handles the rest"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),C0.jsxDEV("div",{className:"flex gap-2",children:[q.length>0&&C0.jsxDEV("button",{onClick:p0,disabled:x,className:"px-4 py-2 bg-[#1a1a1a] hover:bg-[#222] text-[#e0e0e0] rounded text-sm font-medium transition disabled:opacity-50",children:x?"Running...":"Run All"},void 0,!1,void 0,this),C0.jsxDEV("button",{onClick:U0,className:"px-4 py-2 bg-[#f97316] hover:bg-[#fb923c] text-white rounded text-sm font-medium transition",children:"+ New Test"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),T?C0.jsxDEV("div",{className:"text-[#666] text-sm",children:"Loading..."},void 0,!1,void 0,this):q.length===0?C0.jsxDEV("div",{className:"text-center py-16",children:[C0.jsxDEV("div",{className:"text-[#333] text-4xl mb-4",children:C0.jsxDEV("svg",{className:"w-12 h-12 mx-auto",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C0.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),C0.jsxDEV("p",{className:"text-[#666] mb-2",children:"No tests yet"},void 0,!1,void 0,this),C0.jsxDEV("p",{className:"text-xs text-[#555] mb-4",children:"Describe what your agents should do and let AI verify it"},void 0,!1,void 0,this),C0.jsxDEV("button",{onClick:U0,className:"px-4 py-2 bg-[#f97316] hover:bg-[#fb923c] text-white rounded text-sm font-medium transition",children:"Create your first test"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):C0.jsxDEV("div",{className:"space-y-3",children:q.map((m)=>C0.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg p-4",children:C0.jsxDEV("div",{className:"flex items-start justify-between",children:[C0.jsxDEV("div",{className:"flex-1 min-w-0",children:[C0.jsxDEV("div",{className:"flex items-center gap-2 mb-1",children:[C0.jsxDEV("span",{className:"font-medium text-sm",children:m.name},void 0,!1,void 0,this),u[m.id]?v1(m.id):m.last_run&&C0.jsxDEV(C0.Fragment,{children:[$1(m.last_run.status),m.last_run.score!=null&&C0.jsxDEV("span",{className:"text-xs text-[#888] font-mono",children:[m.last_run.score,"/10"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),m.behavior&&C0.jsxDEV("p",{className:"text-xs text-[#888] mb-1.5 line-clamp-2",children:m.behavior},void 0,!1,void 0,this),C0.jsxDEV("div",{className:"text-xs text-[#666] space-y-0.5",children:[C0.jsxDEV("div",{children:["Agent:"," ",C0.jsxDEV("span",{className:"text-[#888]",children:m.agent_name||(m.last_run?.selected_agent_name?`${m.last_run.selected_agent_name} (auto-selected)`:"Auto (AI picks)")},void 0,!1,void 0,this)]},void 0,!0,void 0,this),m.last_run?.generated_message&&C0.jsxDEV("div",{className:"truncate",children:["Message: ",C0.jsxDEV("span",{className:"text-[#888]",children:['"',m.last_run.generated_message,'"']},void 0,!0,void 0,this)]},void 0,!0,void 0,this),m.input_message&&!m.last_run?.generated_message&&C0.jsxDEV("div",{className:"truncate",children:["Message: ",C0.jsxDEV("span",{className:"text-[#888]",children:['"',m.input_message,'"']},void 0,!0,void 0,this)]},void 0,!0,void 0,this),m.last_run&&C0.jsxDEV("div",{children:["Last run:"," ",C0.jsxDEV("span",{className:"text-[#888]",children:[m.last_run.duration_ms?`${(m.last_run.duration_ms/1000).toFixed(1)}s`:"---",m.last_run.judge_reasoning&&` --- "${m.last_run.judge_reasoning.slice(0,80)}${m.last_run.judge_reasoning.length>80?"...":""}"`]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),C0.jsxDEV("div",{className:"flex items-center gap-1 ml-3 shrink-0",children:[C0.jsxDEV("button",{onClick:()=>Y1(m.id),className:"px-2 py-1 text-xs text-[#666] hover:text-[#888] hover:bg-[#1a1a1a] rounded transition",title:"View run history",children:"History"},void 0,!1,void 0,this),C0.jsxDEV("button",{onClick:()=>v0(m.id),disabled:f.has(m.id),className:"px-3 py-1 text-xs bg-[#1a1a1a] hover:bg-[#222] text-[#e0e0e0] rounded transition disabled:opacity-50",children:f.has(m.id)?"Running...":"Run"},void 0,!1,void 0,this),C0.jsxDEV("button",{onClick:()=>H0(m),className:"px-2 py-1 text-xs text-[#666] hover:text-[#888] hover:bg-[#1a1a1a] rounded transition",children:"Edit"},void 0,!1,void 0,this),C0.jsxDEV("button",{onClick:()=>z0(m.id),className:"px-2 py-1 text-xs text-[#666] hover:text-red-400 hover:bg-[#1a1a1a] rounded transition",children:"Delete"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},m.id,!1,void 0,this))},void 0,!1,void 0,this),p&&C0.jsxDEV("div",{className:"mt-6",children:[C0.jsxDEV("div",{className:"flex items-center justify-between mb-3",children:[C0.jsxDEV("h2",{className:"text-sm font-bold text-[#888]",children:"Run History"},void 0,!1,void 0,this),C0.jsxDEV("button",{onClick:()=>{A(null),j(null)},className:"text-xs text-[#666] hover:text-[#888]",children:"Close"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),p.runs.length===0?C0.jsxDEV("p",{className:"text-sm text-[#666]",children:"No runs yet"},void 0,!1,void 0,this):C0.jsxDEV("div",{className:"space-y-2",children:p.runs.map((m)=>C0.jsxDEV("div",{className:"bg-[#0d0d0d] border border-[#1a1a1a] rounded p-3",children:[C0.jsxDEV("div",{className:"flex items-center justify-between cursor-pointer",onClick:()=>j(E===m.id?null:m.id),children:[C0.jsxDEV("div",{className:"flex items-center gap-3",children:[$1(m.status),C0.jsxDEV("span",{className:"text-xs text-[#666]",children:m.duration_ms?`${(m.duration_ms/1000).toFixed(1)}s`:"---"},void 0,!1,void 0,this),m.score!=null&&C0.jsxDEV("span",{className:"text-xs text-[#888] font-mono",children:[m.score,"/10"]},void 0,!0,void 0,this),m.selected_agent_name&&C0.jsxDEV("span",{className:"text-xs text-[#555]",children:["Agent: ",m.selected_agent_name]},void 0,!0,void 0,this),C0.jsxDEV("span",{className:"text-xs text-[#555]",children:new Date(m.created_at).toLocaleString()},void 0,!1,void 0,this)]},void 0,!0,void 0,this),C0.jsxDEV("span",{className:"text-xs text-[#555]",children:E===m.id?"---":"+"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),E===m.id&&C0.jsxDEV("div",{className:"mt-3 space-y-2",children:[m.planner_reasoning&&C0.jsxDEV("div",{children:[C0.jsxDEV("div",{className:"text-xs text-[#666] mb-1",children:"Planner:"},void 0,!1,void 0,this),C0.jsxDEV("div",{className:"text-sm text-[#aaa] bg-[#0a0a0a] p-2 rounded",children:[m.selected_agent_name&&C0.jsxDEV("span",{className:"text-[#f97316]",children:m.selected_agent_name},void 0,!1,void 0,this),m.selected_agent_name&&" --- ",m.planner_reasoning]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),m.generated_message&&C0.jsxDEV("div",{children:[C0.jsxDEV("div",{className:"text-xs text-[#666] mb-1",children:"Generated Message:"},void 0,!1,void 0,this),C0.jsxDEV("div",{className:"text-sm text-[#aaa] bg-[#0a0a0a] p-2 rounded",children:['"',m.generated_message,'"']},void 0,!0,void 0,this)]},void 0,!0,void 0,this),m.judge_reasoning&&C0.jsxDEV("div",{children:[C0.jsxDEV("div",{className:"text-xs text-[#666] mb-1",children:"Judge:"},void 0,!1,void 0,this),C0.jsxDEV("div",{className:"text-sm text-[#aaa] bg-[#0a0a0a] p-2 rounded",children:m.judge_reasoning},void 0,!1,void 0,this)]},void 0,!0,void 0,this),m.error&&C0.jsxDEV("div",{children:[C0.jsxDEV("div",{className:"text-xs text-red-400 mb-1",children:"Error:"},void 0,!1,void 0,this),C0.jsxDEV("div",{className:"text-sm text-red-300 bg-[#0a0a0a] p-2 rounded",children:m.error},void 0,!1,void 0,this)]},void 0,!0,void 0,this),m.agent_response&&C0.jsxDEV("div",{children:[C0.jsxDEV("div",{className:"text-xs text-[#666] mb-1",children:"Agent Response (Thread):"},void 0,!1,void 0,this),C0.jsxDEV("pre",{className:"text-xs text-[#888] bg-[#0a0a0a] p-2 rounded overflow-auto max-h-64",children:m.agent_response},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},m.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),b&&C0.jsxDEV("div",{className:"fixed inset-0 bg-black/60 z-50 flex items-center justify-center",onClick:()=>P(!1),children:C0.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg w-full max-w-lg mx-4 p-6",onClick:(m)=>m.stopPropagation(),children:[C0.jsxDEV("h2",{className:"text-lg font-bold mb-4",children:N?"Edit Test":"New Test"},void 0,!1,void 0,this),C0.jsxDEV("div",{className:"space-y-4",children:[C0.jsxDEV("div",{children:[C0.jsxDEV("label",{className:"block text-xs text-[#666] mb-1",children:"Name"},void 0,!1,void 0,this),C0.jsxDEV("input",{value:i,onChange:(m)=>d(m.target.value),placeholder:"e.g. Social Media Posting",className:"w-full bg-[#0a0a0a] border border-[#222] rounded px-3 py-2 text-sm focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),C0.jsxDEV("div",{children:[C0.jsxDEV("label",{className:"block text-xs text-[#666] mb-1",children:"Behavior"},void 0,!1,void 0,this),C0.jsxDEV("textarea",{value:D,onChange:(m)=>Q0(m.target.value),placeholder:"Describe what should happen, e.g. 'When asked to post on social media, the agent creates a proper post with relevant hashtags and confirms it was published'",rows:3,className:"w-full bg-[#0a0a0a] border border-[#222] rounded px-3 py-2 text-sm focus:outline-none focus:border-[#f97316] resize-none"},void 0,!1,void 0,this),C0.jsxDEV("p",{className:"text-xs text-[#555] mt-1",children:"AI will generate the test message and evaluate results based on this"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),C0.jsxDEV("div",{children:[C0.jsxDEV("label",{className:"block text-xs text-[#666] mb-1",children:"Agent"},void 0,!1,void 0,this),C0.jsxDEV(r4,{value:n,onChange:G0,placeholder:"Auto (AI picks the best agent)",options:K0.map((m)=>({value:m.id,label:`${m.name} (${m.status})`}))},void 0,!1,void 0,this),C0.jsxDEV("p",{className:"text-xs text-[#555] mt-1",children:"Leave empty to let AI choose the right agent"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),C0.jsxDEV("div",{className:"flex justify-end gap-2 mt-6",children:[C0.jsxDEV("button",{onClick:()=>P(!1),className:"px-4 py-2 text-sm text-[#888] hover:text-[#e0e0e0] transition",children:"Cancel"},void 0,!1,void 0,this),C0.jsxDEV("button",{onClick:y0,disabled:!i||!D,className:"px-4 py-2 bg-[#f97316] hover:bg-[#fb923c] disabled:opacity-50 text-white rounded text-sm font-medium transition",children:N?"Save":"Create"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var j4=B0(V1(),1);var n0=B0(U1(),1);function MK(Y){let G=Y.category==="LLM",U=Y.category==="TOOL",_=Y.level==="error",q=Y.data?.input_tokens||0,R=Y.data?.output_tokens||0;return{llm_calls:G?1:0,tool_calls:U?1:0,errors:_?1:0,input_tokens:q,output_tokens:R}}function WG(){let{events:Y,statusChangeCounter:G}=P6(),{currentProjectId:U,currentProject:_}=R4(),{authFetch:q}=b1(),[R,K]=j4.useState(null),[O,T]=j4.useState([]),[I,b]=j4.useState([]),[P,N]=j4.useState(!0),[S,f]=j4.useState({level:"",agent_id:""}),[V,x]=j4.useState(new Set(["DATABASE"])),[v,p]=j4.useState([]),[A,E]=j4.useState(null),j=j4.useRef(new Set),[u,r]=j4.useState(new Set),i=j4.useRef(new Set);j4.useEffect(()=>{(async()=>{try{let p0=await(await q("/api/agents")).json();p(p0.agents||[])}catch(v0){console.error("Failed to fetch agents:",v0)}})()},[q]);let d=j4.useMemo(()=>{if(U===null)return v;if(U==="unassigned")return v.filter((z0)=>!z0.projectId);return v.filter((z0)=>z0.projectId===U)},[v,U]),D=j4.useMemo(()=>new Set(d.map((z0)=>z0.id)),[d]),Q0=async()=>{N(!0);try{let z0=U==="unassigned"?"null":U||"",v0=new URLSearchParams;if(z0)v0.set("project_id",z0);let Y1=await(await q(`/api/telemetry/stats${v0.toString()?`?${v0}`:""}`)).json();K(Y1.stats);let m0=new URLSearchParams;if(S.level)m0.set("level",S.level);if(S.agent_id)m0.set("agent_id",S.agent_id);if(z0)m0.set("project_id",z0);m0.set("limit","100");let m=(await(await q(`/api/telemetry/events?${m0}`)).json()).events||[];T(m),j.current=new Set(m.map((o1)=>o1.id));let N0=new URLSearchParams;if(N0.set("group_by","agent"),z0)N0.set("project_id",z0);let L1=await(await q(`/api/telemetry/usage?${N0}`)).json();b(L1.usage||[])}catch(z0){console.error("Failed to fetch telemetry:",z0)}N(!1)};j4.useEffect(()=>{Q0()},[S,U,q,G]);let n=j4.useMemo(()=>{if(!R)return null;let z0=0,v0=0,p0=0,Y1=0,m0=0,$1=0;for(let v1 of Y)if(!j.current.has(v1.id)){z0++;let m=MK(v1);v0+=m.llm_calls,p0+=m.tool_calls,Y1+=m.errors,m0+=m.input_tokens,$1+=m.output_tokens}return{total_events:R.total_events+z0,total_llm_calls:R.total_llm_calls+v0,total_tool_calls:R.total_tool_calls+p0,total_errors:R.total_errors+Y1,total_input_tokens:R.total_input_tokens+m0,total_output_tokens:R.total_output_tokens+$1}},[R,Y]),G0=j4.useMemo(()=>{let z0=new Map;for(let v0 of I)z0.set(v0.agent_id,{...v0});for(let v0 of Y)if(!j.current.has(v0.id)){let p0=MK(v0),Y1=z0.get(v0.agent_id);if(Y1)Y1.llm_calls+=p0.llm_calls,Y1.tool_calls+=p0.tool_calls,Y1.errors+=p0.errors,Y1.input_tokens+=p0.input_tokens,Y1.output_tokens+=p0.output_tokens;else z0.set(v0.agent_id,{agent_id:v0.agent_id,llm_calls:p0.llm_calls,tool_calls:p0.tool_calls,errors:p0.errors,input_tokens:p0.input_tokens,output_tokens:p0.output_tokens})}return Array.from(z0.values())},[I,Y]),F0=j4.default.useMemo(()=>{let z0=Y;if(U!==null)z0=z0.filter((m0)=>D.has(m0.agent_id));if(S.agent_id)z0=z0.filter((m0)=>m0.agent_id===S.agent_id);if(V.size>0)z0=z0.filter((m0)=>!V.has(m0.category));if(S.level)z0=z0.filter((m0)=>m0.level===S.level);let v0=O;if(V.size>0)v0=v0.filter((m0)=>!V.has(m0.category));let p0=new Set(z0.map((m0)=>m0.id)),Y1=[...z0];for(let m0 of v0)if(!p0.has(m0.id))Y1.push(m0),p0.add(m0.id);return Y1.sort((m0,$1)=>new Date($1.timestamp).getTime()-new Date(m0.timestamp).getTime()),Y1.slice(0,100)},[Y,O,S,V,U,D]);j4.useEffect(()=>{let z0=[];for(let v0 of Y)if(!i.current.has(v0.id))i.current.add(v0.id),z0.push(v0.id);if(z0.length>0)r((v0)=>{let p0=new Set(v0);return z0.forEach((Y1)=>p0.add(Y1)),p0}),setTimeout(()=>{r((v0)=>{let p0=new Set(v0);return z0.forEach((Y1)=>p0.delete(Y1)),p0})},5000)},[Y]);let K0=(z0)=>{return v.find((p0)=>p0.id===z0)?.name||z0},S0=(z0)=>{if(z0>=1e6)return(z0/1e6).toFixed(1)+"M";if(z0>=1000)return(z0/1000).toFixed(1)+"K";return z0.toString()},P0={debug:"text-[#555]",info:"text-blue-400",warn:"text-yellow-400",error:"text-red-400"},a={LLM:"bg-purple-500/20 text-purple-400 border-purple-500/30",TOOL:"bg-blue-500/20 text-blue-400 border-blue-500/30",CHAT:"bg-green-500/20 text-green-400 border-green-500/30",ERROR:"bg-red-500/20 text-red-400 border-red-500/30",SYSTEM:"bg-gray-500/20 text-gray-400 border-gray-500/30",TASK:"bg-yellow-500/20 text-yellow-400 border-yellow-500/30",MEMORY:"bg-cyan-500/20 text-cyan-400 border-cyan-500/30",MCP:"bg-orange-500/20 text-orange-400 border-orange-500/30",DATABASE:"bg-pink-500/20 text-pink-400 border-pink-500/30"},Y0=["LLM","TOOL","CHAT","TASK","MEMORY","MCP","SYSTEM","DATABASE","ERROR"],U0=(z0)=>{x((v0)=>{let p0=new Set(v0);if(p0.has(z0))p0.delete(z0);else p0.add(z0);return p0})},H0=[{value:"",label:"All Agents"},...d.map((z0)=>({value:z0.id,label:z0.name}))],y0=[{value:"",label:"All Levels"},{value:"debug",label:"Debug"},{value:"info",label:"Info"},{value:"warn",label:"Warn"},{value:"error",label:"Error"}];return n0.jsxDEV("div",{className:"flex-1 overflow-auto p-6",children:n0.jsxDEV("div",{children:[n0.jsxDEV("div",{className:"mb-6",children:[n0.jsxDEV("div",{className:"flex items-center gap-3 mb-1",children:[_&&n0.jsxDEV("span",{className:"w-3 h-3 rounded-full",style:{backgroundColor:_.color}},void 0,!1,void 0,this),n0.jsxDEV("h1",{className:"text-2xl font-semibold",children:U===null?"Telemetry":U==="unassigned"?"Telemetry - Unassigned":`Telemetry - ${_?.name||""}`},void 0,!1,void 0,this)]},void 0,!0,void 0,this),n0.jsxDEV("p",{className:"text-[#666]",children:"Monitor agent activity, token usage, and errors."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),n&&n0.jsxDEV("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4 mb-6",children:[n0.jsxDEV(jQ,{label:"Events",value:S0(n.total_events)},void 0,!1,void 0,this),n0.jsxDEV(jQ,{label:"LLM Calls",value:S0(n.total_llm_calls)},void 0,!1,void 0,this),n0.jsxDEV(jQ,{label:"Tool Calls",value:S0(n.total_tool_calls)},void 0,!1,void 0,this),n0.jsxDEV(jQ,{label:"Errors",value:S0(n.total_errors),color:"red"},void 0,!1,void 0,this),n0.jsxDEV(jQ,{label:"Input Tokens",value:S0(n.total_input_tokens)},void 0,!1,void 0,this),n0.jsxDEV(jQ,{label:"Output Tokens",value:S0(n.total_output_tokens)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),G0.length>0&&n0.jsxDEV("div",{className:"mb-6",children:[n0.jsxDEV("h2",{className:"text-lg font-medium mb-3",children:"Usage by Agent"},void 0,!1,void 0,this),n0.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg overflow-hidden",children:n0.jsxDEV("table",{className:"w-full text-sm",children:[n0.jsxDEV("thead",{children:n0.jsxDEV("tr",{className:"border-b border-[#1a1a1a] text-[#666]",children:[n0.jsxDEV("th",{className:"text-left p-3",children:"Agent"},void 0,!1,void 0,this),n0.jsxDEV("th",{className:"text-right p-3",children:"LLM Calls"},void 0,!1,void 0,this),n0.jsxDEV("th",{className:"text-right p-3",children:"Tool Calls"},void 0,!1,void 0,this),n0.jsxDEV("th",{className:"text-right p-3",children:"Input Tokens"},void 0,!1,void 0,this),n0.jsxDEV("th",{className:"text-right p-3",children:"Output Tokens"},void 0,!1,void 0,this),n0.jsxDEV("th",{className:"text-right p-3",children:"Errors"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),n0.jsxDEV("tbody",{children:G0.map((z0)=>n0.jsxDEV("tr",{className:"border-b border-[#1a1a1a] last:border-0",children:[n0.jsxDEV("td",{className:"p-3 font-medium",children:K0(z0.agent_id)},void 0,!1,void 0,this),n0.jsxDEV("td",{className:"p-3 text-right text-[#888]",children:S0(z0.llm_calls)},void 0,!1,void 0,this),n0.jsxDEV("td",{className:"p-3 text-right text-[#888]",children:S0(z0.tool_calls)},void 0,!1,void 0,this),n0.jsxDEV("td",{className:"p-3 text-right text-[#888]",children:S0(z0.input_tokens)},void 0,!1,void 0,this),n0.jsxDEV("td",{className:"p-3 text-right text-[#888]",children:S0(z0.output_tokens)},void 0,!1,void 0,this),n0.jsxDEV("td",{className:"p-3 text-right",children:z0.errors>0?n0.jsxDEV("span",{className:"text-red-400",children:z0.errors},void 0,!1,void 0,this):n0.jsxDEV("span",{className:"text-[#444]",children:"0"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},z0.agent_id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),n0.jsxDEV("div",{className:"flex flex-wrap items-center gap-3 mb-4",children:[n0.jsxDEV("div",{className:"w-44",children:n0.jsxDEV(r4,{value:S.agent_id,options:H0,onChange:(z0)=>f({...S,agent_id:z0}),placeholder:"All Agents"},void 0,!1,void 0,this)},void 0,!1,void 0,this),n0.jsxDEV("div",{className:"flex flex-wrap items-center gap-1.5 flex-1",children:Y0.map((z0)=>{let v0=V.has(z0),p0=a[z0]||"bg-[#222] text-[#888] border-[#333]";return n0.jsxDEV("button",{onClick:()=>U0(z0),className:`px-2 py-0.5 rounded text-xs border transition-all ${v0?"bg-[#1a1a1a] text-[#555] border-[#333] opacity-50":p0}`,children:z0},z0,!1,void 0,this)})},void 0,!1,void 0,this),n0.jsxDEV("div",{className:"flex items-center gap-2",children:[n0.jsxDEV("div",{className:"w-36",children:n0.jsxDEV(r4,{value:S.level,options:y0,onChange:(z0)=>f({...S,level:z0}),placeholder:"All Levels"},void 0,!1,void 0,this)},void 0,!1,void 0,this),n0.jsxDEV("button",{onClick:Q0,className:"px-3 py-2 bg-[#1a1a1a] hover:bg-[#222] border border-[#333] rounded text-sm transition",children:"Refresh"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),n0.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg",children:[n0.jsxDEV("div",{className:"p-3 border-b border-[#1a1a1a] flex items-center justify-between",children:[n0.jsxDEV("h2",{className:"font-medium",children:"Recent Events"},void 0,!1,void 0,this),Y.length>0&&n0.jsxDEV("span",{className:"text-xs text-[#666]",children:[Y.length," new"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),P&&F0.length===0?n0.jsxDEV("div",{className:"p-8 text-center text-[#666]",children:"Loading..."},void 0,!1,void 0,this):F0.length===0?n0.jsxDEV("div",{className:"p-8 text-center text-[#666]",children:"No telemetry events yet. Events will appear here in real-time once agents start sending data."},void 0,!1,void 0,this):n0.jsxDEV("div",{className:"divide-y divide-[#1a1a1a]",children:F0.map((z0)=>{let v0=u.has(z0.id);return n0.jsxDEV("div",{className:`p-3 hover:bg-[#0a0a0a] cursor-pointer transition-all duration-500 ${v0?"bg-green-500/5":""}`,style:{animation:v0?"slideIn 0.3s ease-out":void 0},onClick:()=>E(A===z0.id?null:z0.id),children:n0.jsxDEV("div",{className:"flex items-start gap-3",children:[n0.jsxDEV("span",{className:`px-2 py-0.5 rounded text-xs border transition-colors duration-300 ${a[z0.category]||"bg-[#222] text-[#888] border-[#333]"}`,children:z0.category},void 0,!1,void 0,this),n0.jsxDEV("div",{className:"flex-1 min-w-0",children:[n0.jsxDEV("div",{className:"flex items-center gap-2",children:[n0.jsxDEV("span",{className:"font-medium text-sm",children:z0.type},void 0,!1,void 0,this),n0.jsxDEV("span",{className:`text-xs ${P0[z0.level]||"text-[#666]"}`,children:z0.level},void 0,!1,void 0,this),z0.duration_ms&&n0.jsxDEV("span",{className:"text-xs text-[#555]",children:[z0.duration_ms,"ms"]},void 0,!0,void 0,this),n0.jsxDEV("span",{className:`w-1.5 h-1.5 rounded-full bg-green-400 transition-opacity duration-1000 ${v0?"opacity-100":"opacity-0"}`},void 0,!1,void 0,this)]},void 0,!0,void 0,this),n0.jsxDEV("div",{className:"text-xs text-[#555] mt-1",children:[K0(z0.agent_id)," · ",new Date(z0.timestamp).toLocaleString()]},void 0,!0,void 0,this),z0.error&&n0.jsxDEV("div",{className:"text-xs text-red-400 mt-1 font-mono",children:z0.error},void 0,!1,void 0,this),A===z0.id&&z0.data&&Object.keys(z0.data).length>0&&n0.jsxDEV("pre",{className:"text-xs text-[#666] mt-2 p-2 bg-[#0a0a0a] rounded overflow-x-auto",children:JSON.stringify(z0.data,null,2)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},z0.id,!1,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function jQ({label:Y,value:G,color:U}){return n0.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg p-4",children:[n0.jsxDEV("div",{className:"text-[#666] text-xs mb-1",children:Y},void 0,!1,void 0,this),n0.jsxDEV("div",{className:`text-2xl font-semibold ${U==="red"?"text-red-400":""}`,children:G},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var L5=B0(V1(),1);var f0=B0(U1(),1),RT={get:"#61affe",post:"#49cc90",put:"#fca130",delete:"#f93e3e",patch:"#50e3c2"};function NT({method:Y,path:G,parameters:U,requestBody:_,authFetch:q}){let[R,K]=L5.useState({}),[O,T]=L5.useState(""),[I,b]=L5.useState(null),[P,N]=L5.useState(!1),[S,f]=L5.useState(null);L5.useEffect(()=>{if(_?.content?.["application/json"]?.schema){let A=_.content["application/json"].schema;if(A.example)T(JSON.stringify(A.example,null,2));else if(A.properties){let E={};for(let[j,u]of Object.entries(A.properties))if(u.example!==void 0)E[j]=u.example;else if(u.type==="string")E[j]="";else if(u.type==="number"||u.type==="integer")E[j]=0;else if(u.type==="boolean")E[j]=!1;else if(u.type==="array")E[j]=[];else if(u.type==="object")E[j]={};T(JSON.stringify(E,null,2))}}},[_]);let V=async()=>{N(!0),f(null),b(null);try{let A=G,E=[];for(let d of U||[]){let D=R[d.name]||"";if(d.in==="path")A=A.replace(`{${d.name}}`,encodeURIComponent(D));else if(d.in==="query"&&D)E.push(`${d.name}=${encodeURIComponent(D)}`)}if(E.length>0)A+=`?${E.join("&")}`;let j={method:Y.toUpperCase()};if(O&&["post","put","patch"].includes(Y))j.headers={"Content-Type":"application/json"},j.body=O;let u=await q(`/api${A}`,j),r;if(u.headers.get("content-type")?.includes("application/json"))r=await u.json();else r=await u.text();b({status:u.status,data:r})}catch(A){f(A.message||"Request failed")}finally{N(!1)}},x=U?.filter((A)=>A.in==="path")||[],v=U?.filter((A)=>A.in==="query")||[],p=["post","put","patch"].includes(Y)&&_;return f0.jsxDEV("div",{style:{marginTop:16,padding:16,background:"#0a0a14",borderRadius:6,border:"1px solid #222"},children:[f0.jsxDEV("h4",{style:{fontSize:13,color:"#f97316",marginBottom:12,fontWeight:600},children:"Try it out"},void 0,!1,void 0,this),x.length>0&&f0.jsxDEV("div",{style:{marginBottom:12},children:[f0.jsxDEV("div",{style:{fontSize:11,color:"#666",marginBottom:6},children:"Path Parameters"},void 0,!1,void 0,this),x.map((A)=>f0.jsxDEV("div",{style:{marginBottom:8},children:[f0.jsxDEV("label",{style:{fontSize:12,color:"#888",display:"block",marginBottom:4},children:[A.name," ",A.required&&f0.jsxDEV("span",{style:{color:"#f66"},children:"*"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),f0.jsxDEV("input",{type:"text",value:R[A.name]||"",onChange:(E)=>K({...R,[A.name]:E.target.value}),placeholder:A.schema?.type||"string",style:{width:"100%",padding:"8px 12px",background:"#111",border:"1px solid #333",borderRadius:4,color:"#fff",fontSize:13,fontFamily:"monospace"}},void 0,!1,void 0,this)]},A.name,!0,void 0,this))]},void 0,!0,void 0,this),v.length>0&&f0.jsxDEV("div",{style:{marginBottom:12},children:[f0.jsxDEV("div",{style:{fontSize:11,color:"#666",marginBottom:6},children:"Query Parameters"},void 0,!1,void 0,this),v.map((A)=>f0.jsxDEV("div",{style:{marginBottom:8},children:[f0.jsxDEV("label",{style:{fontSize:12,color:"#888",display:"block",marginBottom:4},children:[A.name," ",A.required&&f0.jsxDEV("span",{style:{color:"#f66"},children:"*"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),f0.jsxDEV("input",{type:"text",value:R[A.name]||"",onChange:(E)=>K({...R,[A.name]:E.target.value}),placeholder:A.schema?.type||"string",style:{width:"100%",padding:"8px 12px",background:"#111",border:"1px solid #333",borderRadius:4,color:"#fff",fontSize:13,fontFamily:"monospace"}},void 0,!1,void 0,this)]},A.name,!0,void 0,this))]},void 0,!0,void 0,this),p&&f0.jsxDEV("div",{style:{marginBottom:12},children:[f0.jsxDEV("div",{style:{fontSize:11,color:"#666",marginBottom:6},children:"Request Body (JSON)"},void 0,!1,void 0,this),f0.jsxDEV("textarea",{value:O,onChange:(A)=>T(A.target.value),rows:6,style:{width:"100%",padding:"8px 12px",background:"#111",border:"1px solid #333",borderRadius:4,color:"#fff",fontSize:12,fontFamily:"monospace",resize:"vertical"}},void 0,!1,void 0,this)]},void 0,!0,void 0,this),f0.jsxDEV("button",{onClick:V,disabled:P,style:{padding:"10px 20px",background:P?"#333":"#f97316",color:P?"#666":"#000",border:"none",borderRadius:4,cursor:P?"not-allowed":"pointer",fontSize:13,fontWeight:600},children:P?"Executing...":"Execute"},void 0,!1,void 0,this),S&&f0.jsxDEV("div",{style:{marginTop:12,padding:12,background:"#2a1515",borderRadius:4,color:"#f66",fontSize:12},children:S},void 0,!1,void 0,this),I&&f0.jsxDEV("div",{style:{marginTop:12},children:[f0.jsxDEV("div",{style:{fontSize:11,color:"#666",marginBottom:6},children:["Response"," ",f0.jsxDEV("span",{style:{color:I.status>=200&&I.status<300?"#49cc90":"#f66"},children:I.status},void 0,!1,void 0,this)]},void 0,!0,void 0,this),f0.jsxDEV("pre",{style:{padding:12,background:"#111",borderRadius:4,color:"#888",fontSize:11,fontFamily:"monospace",overflow:"auto",maxHeight:300,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:typeof I.data==="string"?I.data:JSON.stringify(I.data,null,2)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function wK(){let{authFetch:Y}=b1(),[G,U]=L5.useState(null),[_,q]=L5.useState(!0),[R,K]=L5.useState(new Set),[O,T]=L5.useState(null),[I,b]=L5.useState(!1);L5.useEffect(()=>{S()},[]);async function P(){if(!G)return;try{await navigator.clipboard.writeText(JSON.stringify(G,null,2)),b(!0),setTimeout(()=>b(!1),2000)}catch(j){console.error("Failed to copy:",j)}}function N(){if(!G)return;let j=new Blob([JSON.stringify(G,null,2)],{type:"application/json"}),u=URL.createObjectURL(j),r=document.createElement("a");r.href=u,r.download="apteva-openapi.json",r.click(),URL.revokeObjectURL(u)}async function S(){try{let j=await Y("/api/openapi");if(j.ok){let u=await j.json();U(u)}}catch(j){console.error("Failed to load OpenAPI spec:",j)}finally{q(!1)}}function f(j){K((u)=>{let r=new Set(u);if(r.has(j))r.delete(j);else r.add(j);return r})}function V(j,u=0){if(!j)return"{}";if(u>2)return"...";if(j.$ref)return j.$ref.split("/").pop()||"Object";if(j.type==="array")return`${V(j.items,u+1)}[]`;if(j.type==="object"&&j.properties){let r=Object.entries(j.properties).slice(0,3).map(([d,D])=>`${d}: ${D.type||"any"}`).join(", "),i=Object.keys(j.properties).length>3?", ...":"";return`{ ${r}${i} }`}return j.type||"any"}if(_)return f0.jsxDEV("div",{style:{padding:24},children:f0.jsxDEV("p",{style:{color:"#888"},children:"Loading API documentation..."},void 0,!1,void 0,this)},void 0,!1,void 0,this);if(!G)return f0.jsxDEV("div",{style:{padding:24},children:f0.jsxDEV("p",{style:{color:"#f66"},children:"Failed to load API documentation"},void 0,!1,void 0,this)},void 0,!1,void 0,this);let x=G.tags||[],v=Object.entries(G.paths);function p(j){let u=new Set;function r(i){if(!i)return;if(typeof i==="object"){if(i.$ref){let d=i.$ref.split("/").pop();if(d)u.add(d)}for(let d of Object.values(i))r(d)}}return r(j.requestBody),r(j.responses),u}function A(){if(!O||!G.components?.schemas)return Object.keys(G.components?.schemas||{});let j=new Set;for(let[u,r]of E)for(let[i,d]of Object.entries(r)){if(!["get","post","put","delete","patch"].includes(i))continue;if(d.tags?.includes(O))p(d).forEach((Q0)=>j.add(Q0))}return Array.from(j)}let E=O?v.filter(([j,u])=>Object.values(u).some((r)=>r.tags?.includes(O))):v;return f0.jsxDEV("div",{style:{padding:24,maxWidth:1000,height:"100%",overflowY:"auto"},children:[f0.jsxDEV("div",{style:{marginBottom:24},children:[f0.jsxDEV("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:8},children:[f0.jsxDEV("h1",{style:{fontSize:24,fontWeight:600},children:G.info.title},void 0,!1,void 0,this),f0.jsxDEV("div",{style:{display:"flex",gap:8},children:[f0.jsxDEV("button",{onClick:P,style:{padding:"8px 16px",borderRadius:4,border:"1px solid #333",background:I?"#49cc90":"#1a1a2e",color:I?"#000":"#fff",cursor:"pointer",fontSize:12,fontFamily:"inherit"},children:I?"Copied!":"Copy JSON"},void 0,!1,void 0,this),f0.jsxDEV("button",{onClick:N,style:{padding:"8px 16px",borderRadius:4,border:"1px solid #333",background:"#1a1a2e",color:"#fff",cursor:"pointer",fontSize:12,fontFamily:"inherit"},children:"Download"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),f0.jsxDEV("p",{style:{color:"#888",marginBottom:8},children:G.info.description.split(`
|
|
226
|
+
`)[0]},void 0,!1,void 0,this),f0.jsxDEV("p",{style:{color:"#666",fontSize:12},children:["Version: ",G.info.version]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),f0.jsxDEV("div",{style:{background:"#1a1a2e",padding:12,borderRadius:6,marginBottom:24,fontFamily:"monospace"},children:[f0.jsxDEV("span",{style:{color:"#888"},children:"Base URL: "},void 0,!1,void 0,this),f0.jsxDEV("span",{style:{color:"#61affe"},children:[window.location.origin,"/api"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),f0.jsxDEV("div",{style:{marginBottom:24,display:"flex",flexWrap:"wrap",gap:8},children:[f0.jsxDEV("button",{onClick:()=>T(null),style:{padding:"6px 12px",borderRadius:4,border:"1px solid #333",background:O===null?"#333":"transparent",color:O===null?"#fff":"#888",cursor:"pointer",fontSize:12},children:"All"},void 0,!1,void 0,this),x.map((j)=>f0.jsxDEV("button",{onClick:()=>T(j.name),style:{padding:"6px 12px",borderRadius:4,border:"1px solid #333",background:O===j.name?"#333":"transparent",color:O===j.name?"#fff":"#888",cursor:"pointer",fontSize:12},title:j.description,children:j.name},j.name,!1,void 0,this))]},void 0,!0,void 0,this),f0.jsxDEV("div",{style:{display:"flex",flexDirection:"column",gap:8},children:E.map(([j,u])=>Object.entries(u).filter(([r])=>["get","post","put","delete","patch"].includes(r)).map(([r,i])=>{let d=`${r}:${j}`,D=R.has(d),Q0=r.toUpperCase(),n=RT[r]||"#888";return f0.jsxDEV("div",{style:{border:"1px solid #333",borderRadius:6,overflow:"hidden"},children:[f0.jsxDEV("div",{onClick:()=>f(d),style:{display:"flex",alignItems:"center",gap:12,padding:"12px 16px",background:D?"#1a1a2e":"transparent",cursor:"pointer"},children:[f0.jsxDEV("span",{style:{background:n,color:"#000",padding:"4px 8px",borderRadius:4,fontSize:11,fontWeight:600,minWidth:60,textAlign:"center"},children:Q0},void 0,!1,void 0,this),f0.jsxDEV("span",{style:{fontFamily:"monospace",color:"#fff"},children:j},void 0,!1,void 0,this),f0.jsxDEV("span",{style:{color:"#888",flex:1,fontSize:13},children:i.summary},void 0,!1,void 0,this),f0.jsxDEV("span",{style:{color:"#666",fontSize:12},children:D?"[-]":"[+]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),D&&f0.jsxDEV("div",{style:{padding:16,background:"#0d0d1a",borderTop:"1px solid #333"},children:[i.description&&f0.jsxDEV("p",{style:{color:"#888",marginBottom:16,fontSize:13},children:i.description},void 0,!1,void 0,this),i.parameters&&i.parameters.length>0&&f0.jsxDEV("div",{style:{marginBottom:16},children:[f0.jsxDEV("h4",{style:{fontSize:13,color:"#888",marginBottom:8},children:"Parameters"},void 0,!1,void 0,this),f0.jsxDEV("div",{style:{background:"#1a1a2e",borderRadius:4,padding:12},children:i.parameters.map((G0)=>f0.jsxDEV("div",{style:{display:"flex",gap:12,marginBottom:8,fontSize:12},children:[f0.jsxDEV("span",{style:{color:"#61affe",minWidth:100},children:[G0.name,G0.required&&f0.jsxDEV("span",{style:{color:"#f66"},children:"*"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),f0.jsxDEV("span",{style:{color:"#666"},children:["(",G0.in,")"]},void 0,!0,void 0,this),f0.jsxDEV("span",{style:{color:"#888"},children:G0.schema?.type||"string"},void 0,!1,void 0,this),G0.description&&f0.jsxDEV("span",{style:{color:"#666"},children:["- ",G0.description]},void 0,!0,void 0,this)]},G0.name,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),i.requestBody&&f0.jsxDEV("div",{style:{marginBottom:16},children:[f0.jsxDEV("h4",{style:{fontSize:13,color:"#888",marginBottom:8},children:["Request Body",i.requestBody.required&&f0.jsxDEV("span",{style:{color:"#f66"},children:" (required)"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),f0.jsxDEV("div",{style:{background:"#1a1a2e",borderRadius:4,padding:12,fontFamily:"monospace",fontSize:12,color:"#49cc90"},children:Object.entries(i.requestBody.content||{}).map(([G0,F0])=>f0.jsxDEV("div",{children:[f0.jsxDEV("span",{style:{color:"#666"},children:[G0,": "]},void 0,!0,void 0,this),V(F0.schema)]},G0,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),i.responses&&f0.jsxDEV("div",{children:[f0.jsxDEV("h4",{style:{fontSize:13,color:"#888",marginBottom:8},children:"Responses"},void 0,!1,void 0,this),f0.jsxDEV("div",{style:{background:"#1a1a2e",borderRadius:4,padding:12},children:Object.entries(i.responses).map(([G0,F0])=>{let K0=F0.content?.["application/json"]?.schema,S0=K0?.$ref?.split("/").pop(),P0=K0?.type,a=K0?.items?.$ref?.split("/").pop();return f0.jsxDEV("div",{style:{marginBottom:12,fontSize:12},children:[f0.jsxDEV("div",{style:{display:"flex",gap:12,marginBottom:4},children:[f0.jsxDEV("span",{style:{color:G0.startsWith("2")?"#49cc90":"#f66",minWidth:40},children:G0},void 0,!1,void 0,this),f0.jsxDEV("span",{style:{color:"#888"},children:F0.description},void 0,!1,void 0,this)]},void 0,!0,void 0,this),K0&&f0.jsxDEV("div",{style:{marginLeft:52,padding:"8px 12px",background:"#0d0d1a",borderRadius:4,fontFamily:"monospace"},children:S0?f0.jsxDEV("span",{style:{color:"#61affe"},children:S0},void 0,!1,void 0,this):P0==="array"&&a?f0.jsxDEV("span",{style:{color:"#61affe"},children:[a,"[]"]},void 0,!0,void 0,this):P0==="array"?f0.jsxDEV("span",{style:{color:"#888"},children:"array"},void 0,!1,void 0,this):f0.jsxDEV("span",{style:{color:"#888"},children:V(K0)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},G0,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this),f0.jsxDEV(NT,{method:r,path:j,parameters:i.parameters,requestBody:i.requestBody,authFetch:Y},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},d,!0,void 0,this)}))},void 0,!1,void 0,this),G.components?.schemas&&A().length>0&&f0.jsxDEV("div",{style:{marginTop:32},children:[f0.jsxDEV("h2",{style:{fontSize:18,fontWeight:600,marginBottom:16},children:["Schemas ",O&&f0.jsxDEV("span",{style:{color:"#666",fontSize:14},children:["(",O,")"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),f0.jsxDEV("div",{style:{display:"flex",flexDirection:"column",gap:8},children:A().map((j)=>{let u=G.components.schemas[j];if(!u)return null;return f0.jsxDEV("div",{style:{border:"1px solid #333",borderRadius:6,padding:12},children:[f0.jsxDEV("h3",{style:{fontSize:14,color:"#61affe",marginBottom:8},children:j},void 0,!1,void 0,this),u.properties&&f0.jsxDEV("div",{style:{fontSize:12},children:Object.entries(u.properties).map(([r,i])=>f0.jsxDEV("div",{style:{display:"flex",gap:8,marginBottom:4,fontFamily:"monospace"},children:[f0.jsxDEV("span",{style:{color:"#fff",minWidth:120},children:r},void 0,!1,void 0,this),f0.jsxDEV("span",{style:{color:"#888"},children:[i.type||(i.$ref?i.$ref.split("/").pop():"any"),i.nullable&&" | null"]},void 0,!0,void 0,this),i.enum&&f0.jsxDEV("span",{style:{color:"#666"},children:["[",i.enum.join(" | "),"]"]},void 0,!0,void 0,this)]},r,!0,void 0,this))},void 0,!1,void 0,this)]},j,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var w4=B0(U1(),1);function MT(){let{isAuthenticated:Y,isLoading:G,hasUsers:U,accessToken:_,checkAuth:q}=b1(),{currentProjectId:R,refreshProjects:K}=R4(),O=VZ(),{isComplete:T,setIsComplete:I}=cH(),b=()=>{return _?{Authorization:`Bearer ${_}`}:{}},P=Y&&T===!0,{agents:N,loading:S,runningCount:f,fetchAgents:V,createAgent:x,updateAgent:v,deleteAgent:p,toggleAgent:A}=pH(P),{providers:E,configuredProviders:j,fetchProviders:u}=dH(P),r=j.filter((m)=>m.type==="llm"),i=R5.useMemo(()=>{if(R===null)return N.length;if(R==="unassigned")return N.filter((m)=>!m.projectId).length;return N.filter((m)=>m.projectId===R).length},[N,R]),[d,D]=R5.useState(!1),[Q0,n]=R5.useState(null),[G0,F0]=R5.useState("dashboard"),[K0,S0]=R5.useState(null),[P0,a]=R5.useState(0),[Y0,U0]=R5.useState(!1);R5.useEffect(()=>{if(!P)return;(async()=>{try{let N0="/api/tasks?status=pending";if(R!==null)N0+=`&project_id=${encodeURIComponent(R)}`;let V0=await fetch(N0,{headers:b()});if(V0.ok){let L1=await V0.json();a(L1.count??(L1.tasks||[]).length)}}catch{}})()},[P,_,R,N,O]);let[H0,y0]=R5.useState({name:"",model:"",provider:"",systemPrompt:"You are a helpful assistant.",features:{...mH},mcpServers:[],skills:[]});R5.useEffect(()=>{if(r.length>0&&!H0.provider){let m=r[0],N0=m.models.find((V0)=>V0.recommended)?.value||m.models[0]?.value||"";y0((V0)=>({...V0,provider:m.id,model:N0}))}},[r,H0.provider]),R5.useEffect(()=>{if(Q0){let m=N.find((N0)=>N0.id===Q0.id);if(m)n(m);else n(null)}},[N,Q0]);let z0=(m)=>{let N0=E.find((L1)=>L1.id===m),V0=N0?.models.find((L1)=>L1.recommended)?.value||N0?.models[0]?.value||"";y0((L1)=>({...L1,provider:m,model:V0}))},v0=async()=>{if(!H0.name)return;await x(H0),await K();let m=r[0],N0=m?.models.find((V0)=>V0.recommended)?.value||m?.models[0]?.value||"";y0({name:"",model:N0,provider:m?.id||"",systemPrompt:"You are a helpful assistant.",features:{...mH},mcpServers:[],skills:[]}),D(!1)},p0=async(m,N0)=>{N0?.stopPropagation(),S0(null);let V0=await A(m);if(V0.error)S0(V0.error)},Y1=async(m,N0)=>{if(N0?.stopPropagation(),Q0?.id===m)n(null);await p(m),await K()},m0=(m)=>{n(m),S0(null),F0("agents")},$1=(m)=>{F0(m),n(null)},v1=()=>{I(!0),u(),q()};if(G||U===null)return w4.jsxDEV(Pz,{fullScreen:!0},void 0,!1,void 0,this);if(!U)return w4.jsxDEV(dZ,{onComplete:v1,needsAccount:!0},void 0,!1,void 0,this);if(!Y)return w4.jsxDEV(N2,{},void 0,!1,void 0,this);if(T===null)return w4.jsxDEV(Pz,{fullScreen:!0},void 0,!1,void 0,this);if(!T)return w4.jsxDEV(dZ,{onComplete:v1,needsAccount:!1},void 0,!1,void 0,this);return w4.jsxDEV("div",{className:"h-screen bg-[#0a0a0a] text-[#e0e0e0] font-mono flex flex-col overflow-hidden",children:[w4.jsxDEV(_2,{onMenuClick:()=>U0(!0)},void 0,!1,void 0,this),K0&&w4.jsxDEV(R2,{message:K0,onDismiss:()=>S0(null)},void 0,!1,void 0,this),w4.jsxDEV("div",{className:"flex flex-1 overflow-hidden",children:[w4.jsxDEV(L2,{route:G0,agentCount:i,taskCount:P0,onNavigate:$1,isOpen:Y0,onClose:()=>U0(!1)},void 0,!1,void 0,this),w4.jsxDEV("main",{className:"flex-1 overflow-hidden flex",children:[G0==="settings"&&w4.jsxDEV(w2,{},void 0,!1,void 0,this),G0==="agents"&&w4.jsxDEV(A2,{agents:N,loading:S,selectedAgent:Q0,providers:E,onSelectAgent:m0,onCloseAgent:()=>n(null),onToggleAgent:p0,onDeleteAgent:Y1,onUpdateAgent:v,onNewAgent:()=>D(!0),canCreateAgent:r.length>0},void 0,!1,void 0,this),G0==="dashboard"&&w4.jsxDEV(T2,{agents:N,loading:S,runningCount:f,configuredProviders:j,onNavigate:$1,onSelectAgent:m0},void 0,!1,void 0,this),G0==="tasks"&&w4.jsxDEV(k2,{},void 0,!1,void 0,this),G0==="mcp"&&w4.jsxDEV(C2,{},void 0,!1,void 0,this),G0==="skills"&&w4.jsxDEV(UG,{},void 0,!1,void 0,this),G0==="tests"&&w4.jsxDEV(BG,{},void 0,!1,void 0,this),G0==="telemetry"&&w4.jsxDEV(WG,{},void 0,!1,void 0,this),G0==="api"&&w4.jsxDEV(wK,{},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),d&&w4.jsxDEV(b2,{form:H0,providers:E,configuredProviders:j,onFormChange:y0,onProviderChange:z0,onCreate:v0,onClose:()=>D(!1),onGoToSettings:()=>{D(!1),F0("settings")}},void 0,!1,void 0,this),w4.jsxDEV(KK,{},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function wT(){return w4.jsxDEV(uH,{children:w4.jsxDEV(jH,{children:w4.jsxDEV(WK,{children:w4.jsxDEV(EH,{children:w4.jsxDEV(MT,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)}var FT=FK.createRoot(document.getElementById("root"));FT.render(w4.jsxDEV(wT,{},void 0,!1,void 0,this));
|
|
227
|
+
|
|
228
|
+
//# debugId=83C8AA4B1282567764756E2164756E21
|